|
|
@ -7,65 +7,65 @@ class CCPInputWidgetController extends HTMLElement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
connectedCallback() {
|
|
|
|
connectedCallback() {
|
|
|
|
this.#data = JSON.parse(atob(this.getAttribute("input")))
|
|
|
|
this.#data = JSON.parse(base64DecodeUnicode(this.getAttribute("input")))
|
|
|
|
|
|
|
|
|
|
|
|
if (this.isChecklist()) {
|
|
|
|
if (this.isChecklist()) {
|
|
|
|
|
|
|
|
|
|
|
|
const opts = this.#data.schema.enum.join(",")
|
|
|
|
const opts = this.#data.schema.enum.join(",")
|
|
|
|
this.innerHTML += `<d4s-ccp-input-checklist readonly="${this.#data.schema.readOnly}" options="${opts}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-checklist>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-checklist readonly="${this.#data.schema.readOnly}" options="${opts}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-checklist>`
|
|
|
|
this.querySelector("d4s-ccp-input-checklist").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-checklist").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isEnum()) {
|
|
|
|
} else if (this.isEnum()) {
|
|
|
|
|
|
|
|
|
|
|
|
const opts = this.#data.schema.enum.join(",")
|
|
|
|
const opts = this.#data.schema.enum.join(",")
|
|
|
|
this.innerHTML += `<d4s-ccp-input-enum readonly="${this.#data.schema.readOnly}" options="${opts}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-enum>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-enum readonly="${this.#data.schema.readOnly}" options="${opts}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-enum>`
|
|
|
|
this.querySelector("d4s-ccp-input-enum").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-enum").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isCode()) {
|
|
|
|
} else if (this.isCode()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-textarea readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-textarea>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-textarea readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-textarea>`
|
|
|
|
this.querySelector("d4s-ccp-input-textarea").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-textarea").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isDateTime()) {
|
|
|
|
} else if (this.isDateTime()) {
|
|
|
|
|
|
|
|
|
|
|
|
const t = this.#data.schema.format.toLowerCase() === "datetime" ?
|
|
|
|
const t = this.#data.schema.format.toLowerCase() === "datetime" ?
|
|
|
|
"datetime-local" : this.#data.schema.format.toLowerCase()
|
|
|
|
"datetime-local" : this.#data.schema.format.toLowerCase()
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple type="${t}" readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple type="${t}" readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isFile()) {
|
|
|
|
} else if (this.isFile()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-file readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-file>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-file readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-file>`
|
|
|
|
this.querySelector("d4s-ccp-input-file").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-file").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isRemoteFile()) {
|
|
|
|
} else if (this.isRemoteFile()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-remotefile readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-remotefile>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-remotefile readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-remotefile>`
|
|
|
|
this.querySelector("d4s-ccp-input-remotefile").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-remotefile").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isGeo()) {
|
|
|
|
} else if (this.isGeo()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-geo readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-remotefile>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-geo readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-remotefile>`
|
|
|
|
this.querySelector("d4s-ccp-input-geo").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-geo").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isSecret()) {
|
|
|
|
} else if (this.isSecret()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-secret readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs }" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-secret>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-secret readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs }" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-secret>`
|
|
|
|
this.querySelector("d4s-ccp-input-secret").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-secret").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isBoolean()) {
|
|
|
|
} else if (this.isBoolean()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-boolean readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-boolean>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-boolean readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-boolean>`
|
|
|
|
this.querySelector("d4s-ccp-input-boolean").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-boolean").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.isNumber()) {
|
|
|
|
} else if (this.isNumber()) {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple type="number" readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple type="number" readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${btoa(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.innerHTML += `<d4s-ccp-input-simple readonly="${this.#data.schema.readOnly}" default="${this.#data.schema.default}" maxOccurs="${this.#data.maxOccurs}" minOccurs="${this.#data.minOccurs}" name="${this.#data.id}" description="${base64EncodeUnicode(this.#data.description)}" title="${this.#data.title}"></d4s-ccp-input-simple>`
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
this.querySelector("d4s-ccp-input-simple").default = this.#data.schema.default
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -173,7 +173,7 @@ class CCPBaseInputWidgetController extends HTMLElement {
|
|
|
|
this.#rootdoc = this//this.attachShadow({ mode: "open" });
|
|
|
|
this.#rootdoc = this//this.attachShadow({ mode: "open" });
|
|
|
|
this.#name = this.getAttribute("name")
|
|
|
|
this.#name = this.getAttribute("name")
|
|
|
|
this.#title = this.getAttribute("title")
|
|
|
|
this.#title = this.getAttribute("title")
|
|
|
|
this.#description = this.getAttribute("description")
|
|
|
|
this.#description = base64DecodeUnicode(this.getAttribute("description"))
|
|
|
|
//this.#default = this.getAttribute("default")
|
|
|
|
//this.#default = this.getAttribute("default")
|
|
|
|
this.#minOccurs = Number(this.getAttribute("minoccurs") ? this.getAttribute("minoccurs") : 1)
|
|
|
|
this.#minOccurs = Number(this.getAttribute("minoccurs") ? this.getAttribute("minoccurs") : 1)
|
|
|
|
this.#maxOccurs = Number(this.getAttribute("maxoccurs") ? this.getAttribute("maxoccurs") : 1)
|
|
|
|
this.#maxOccurs = Number(this.getAttribute("maxoccurs") ? this.getAttribute("maxoccurs") : 1)
|
|
|
@ -296,7 +296,7 @@ class CCPBaseInputWidgetController extends HTMLElement {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<small class="text-muted">${atob(this.#description)}</small>
|
|
|
|
<small class="text-muted">${this.#description}</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div name="content">
|
|
|
|
<div name="content">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -616,7 +616,7 @@ class CCPRemoteFileInputWidgetController extends CCPBaseInputWidgetController {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<small class="text-muted m-0">Select an item or drag and drop it to a proper input</small>
|
|
|
|
<small class="text-muted m-0">Select an item or drag and drop it to a proper input</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="min-width:500px; max-width:640px;overflow:auto;etxt-wrap:nowrap;text-overflow: ellipsis;min-height:5rem; max-height:10rem;">
|
|
|
|
<div style="min-width:500px; max-width:640px;overflow:auto;text-wrap:nowrap;text-overflow: ellipsis;min-height:5rem; max-height:10rem;">
|
|
|
|
<d4s-storage-tree
|
|
|
|
<d4s-storage-tree
|
|
|
|
base-url="${addresses[iss]}"
|
|
|
|
base-url="${addresses[iss]}"
|
|
|
|
file-download-enabled="true"
|
|
|
|
file-download-enabled="true"
|
|
|
|