class CCPOutputWidgetEditorController extends HTMLElement { #output = null #index = null #type = null #delete_icon = ` ` constructor(){ super() } connectedCallback(controller){ } get index(){ return this.#index } render(output, i){ this.#index = i this.#output = output this.#type = output.schema.enum ? "enum" : "string" this.innerHTML = `
${this.renderMetadata()}
` this.addEventListener("input", ev=>{ const val = ev.target.value const ename = ev.target.getAttribute("name") if(ename === "id"){ this.#output.id = val } else if(ename === "title"){ this.#output.title = val } else if(ename === "description"){ this.#output.description = val } else if(ename === "minOccurs"){ this.#output.minOccurs = val } else if(ename === "maxOccurs"){ this.#output.maxOccurs = val } else if(ename === "contentMediaType"){ this.#output.schema.contentMediaType = val } else if(ename === "href"){ this.#output.metadata[0].href = val this.#output.metadata[0].title = val } }) } renderMetadata(output){ if(this.#output.metadata && this.#output.metadata.length > 0){ return `
` }else return "" } } window.customElements.define('d4s-ccp-output-editor', CCPOutputWidgetEditorController);