@openremote/or-json-forms 1.2.0-snapshot.20241015145246 → 1.2.0-snapshot.20241218144812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/index.js +7 -5
- package/dist/umd/index.orbundle.js +10 -8
- package/package.json +4 -4
package/dist/umd/index.js
CHANGED
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
.mdc-list-item__graphic > or-icon {
|
|
267
267
|
pointer-events: none;
|
|
268
268
|
}
|
|
269
|
-
`;let Wa=class extends ce{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[l`${s(Aa)}`,l`${s(Ca)}`,l`${s(Ea)}`,l`${s($a)}`,l`${s(Sa)}`,l`${s(Ta)}`,l`${s(Ia)}`,l`${s(Ra)}`,l`${s(La)}`,l`${s(Ma)}`,l`${s(Oa)}`,l`${s(Na)}`,l`${s(Da)}`,l`${s(Pa)}`,l`${s(ja)}`,l`${s(Fa)}`,Ba]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var e,t;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect())}shouldUpdate(e){return e.has("indeterminate")&&this._mdcComponent&&this.type===Ua.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),e.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ua.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),e.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ua.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ua.DATETIME:"boolean"==typeof this.value?this.type=Ua.CHECKBOX:"number"==typeof this.value?this.type=Ua.NUMBER:"string"==typeof this.value?this.type=Ua.TEXT:this.type=Ua.JSON),!0}focus(){this.type===Ua.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){const e=!this.fullWidth&&this.label;let t=!this.fullWidth&&this.outlined,n=!!this.helperText;const i=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!i&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},o=null!==this.value&&void 0!==this.value||!1===this.value;let a=e?H`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ua.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,H`
|
|
269
|
+
`;let Wa=class extends ce{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[l`${s(Aa)}`,l`${s(Ca)}`,l`${s(Ea)}`,l`${s($a)}`,l`${s(Sa)}`,l`${s(Ta)}`,l`${s(Ia)}`,l`${s(Ra)}`,l`${s(La)}`,l`${s(Ma)}`,l`${s(Oa)}`,l`${s(Na)}`,l`${s(Da)}`,l`${s(Pa)}`,l`${s(ja)}`,l`${s(Fa)}`,Ba]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var e,t;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect())}shouldUpdate(e){return e.has("indeterminate")&&this._mdcComponent&&this.type===Ua.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),e.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ua.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),e.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ua.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ua.DATETIME:"boolean"==typeof this.value?this.type=Ua.CHECKBOX:"number"==typeof this.value?this.type=Ua.NUMBER:"string"==typeof this.value?this.type=Ua.TEXT:this.type=Ua.JSON),!0}focus(){this.type===Ua.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){const e=!this.fullWidth&&this.label;let t=!this.fullWidth&&this.outlined,n=!!this.helperText;const i=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!i&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},o=null!==this.value&&void 0!==this.value||!1===this.value;let a=e?H`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ua.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,H`
|
|
270
270
|
<div class="mdc-radio-container">
|
|
271
271
|
${e?e.map((([e,t],n)=>(this.value===e&&(this._selectedIndex=n),H`
|
|
272
272
|
<div id="field" class="mdc-form-field">
|
|
@@ -351,7 +351,9 @@
|
|
|
351
351
|
<div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${null!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${h}">
|
|
352
352
|
${Ci(null!=this.searchProvider,(()=>H`
|
|
353
353
|
<label id="select-searchable" class="mdc-text-field mdc-text-field--filled">
|
|
354
|
-
<span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id"
|
|
354
|
+
<span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id">
|
|
355
|
+
<or-translate .value="${this.searchLabel}"></or-translate>
|
|
356
|
+
</span>
|
|
355
357
|
<input class="mdc-text-field__input" type="text"
|
|
356
358
|
@keyup="${e=>this.searchableValue=e.target.value}"
|
|
357
359
|
/>
|
|
@@ -497,7 +499,7 @@
|
|
|
497
499
|
`:""}
|
|
498
500
|
<span class="mdc-notched-outline__trailing"></span>
|
|
499
501
|
</span>
|
|
500
|
-
`}setCustomValidity(e){this.errorMessage=e;const t=this.shadowRoot.getElementById("elem");t&&t.setCustomValidity&&t.setCustomValidity(null!=e?e:""),this.reportValidity()}checkValidity(){const e=this.shadowRoot.getElementById("elem");let t=!0;return e&&e.validity&&(t=e.validity.valid),!t||this.type!==Ua.JSON&&this.type!==Ua.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(t=!1),t}reportValidity(){const e=this.checkValidity();return this.isUiValid=e,this._mdcComponent&&(this._mdcComponent.valid=e),e}onValueChange(e,t,n){var i,r;let o,a=this.value;if("undefined"===t&&(a=null,t=void 0),"null"===t&&(a=void 0,t=null),"string"==typeof t)switch(this.type){case Ua.CHECKBOX:case Ua.SWITCH:t="on"===t;break;case Ua.JSON:case Ua.JSON_OBJECT:case Ua.NUMBER:case Ua.RANGE:if(""===t)t=null;else try{t=JSON.parse(t),this.type!==Ua.JSON_OBJECT||"object"==typeof t&&!Array.isArray(t)||(t=this.value,o=ua.i18next.t("validation.invalidJSON"))}catch(e){t=this.value,o=this.type===Ua.JSON||this.type==Ua.JSON_OBJECT?ua.i18next.t("validation.invalidJSON"):ua.i18next.t("validation.invalidNumber")}break;case Ua.DATETIME:if(""===t)t=null;else try{t=Date.parse(t)}catch(e){t=this.value,o=ua.i18next.t("validation.invalidDate")}}if(this.value=t,this.setCustomValidity(o),this.reportValidity(),this.type!==Ua.CHECKBOX_LIST&&t!==a&&(this.type===Ua.RANGE&&(this._mdcComponent.setValue(t),this._mdcComponent2&&(this._mdcComponent2.value=t)),this.dispatchEvent(new za(this.value,a,n))),null!=this.searchProvider&&this.type===Ua.SELECT){const e=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];e&&(this.searchableValue=void 0,e.value="")}this.type!==Ua.CHECKBOX_LIST||sa.Util.objectsEqual(t,a,!0)||this.dispatchEvent(new za(t,a,n))}get valid(){const e=this.shadowRoot.getElementById("elem");return!e||!e.checkValidity||e.checkValidity()}get currentValue(){const e=this.shadowRoot.getElementById("elem");if(e&&e.value)return e.value}resolveOptions(e){let t;return e&&e.length>0&&(t=e.map((e=>{if(Array.isArray(e))return e;{const t=""+e;return[e,ua.i18next.t(t,{defaultValue:sa.Util.camelCaseToSentenceCase(t)})]}}))),t}getSelectedTextValue(e){const t=this.value,n=Array.isArray(t)?t:null!=t?[t]:void 0;if(!n)return"";const i=e||this.resolveOptions(this.options);return i&&n?n.map((e=>i.find((([t,n],i)=>e===t)))).map((e=>e?e[1]:"")).join(", "):""}};wa([me({type:Boolean})],Wa.prototype,"focused",void 0),wa([me()],Wa.prototype,"value",void 0),wa([me({type:String})],Wa.prototype,"type",void 0),wa([me({type:String})],Wa.prototype,"name",void 0),wa([me({type:Boolean})],Wa.prototype,"readonly",void 0),wa([me({type:Boolean})],Wa.prototype,"required",void 0),wa([me()],Wa.prototype,"max",void 0),wa([me()],Wa.prototype,"min",void 0),wa([me({type:Number})],Wa.prototype,"step",void 0),wa([me({type:Boolean})],Wa.prototype,"checked",void 0),wa([me({type:Boolean})],Wa.prototype,"indeterminate",void 0),wa([me({type:Number})],Wa.prototype,"maxLength",void 0),wa([me({type:Number})],Wa.prototype,"minLength",void 0),wa([me({type:Number})],Wa.prototype,"rows",void 0),wa([me({type:Number})],Wa.prototype,"cols",void 0),wa([me({type:Boolean})],Wa.prototype,"multiple",void 0),wa([me({type:String,attribute:!0,reflect:!1})],Wa.prototype,"pattern",void 0),wa([me({type:String})],Wa.prototype,"placeHolder",void 0),wa([me({type:Array})],Wa.prototype,"options",void 0),wa([me({type:Boolean})],Wa.prototype,"autoSelect",void 0),wa([me({type:Object})],Wa.prototype,"searchProvider",void 0),wa([me({type:String})],Wa.prototype,"icon",void 0),wa([me({type:String})],Wa.prototype,"iconColor",void 0),wa([me({type:String})],Wa.prototype,"iconOn",void 0),wa([me({type:String})],Wa.prototype,"iconTrailing",void 0),wa([me({type:Boolean})],Wa.prototype,"compact",void 0),wa([me({type:Boolean})],Wa.prototype,"comfortable",void 0),wa([me({type:Boolean})],Wa.prototype,"raised",void 0),wa([me({type:Boolean})],Wa.prototype,"action",void 0),wa([me({type:Boolean})],Wa.prototype,"unElevated",void 0),wa([me({type:Boolean})],Wa.prototype,"outlined",void 0),wa([me({type:Boolean})],Wa.prototype,"rounded",void 0),wa([me({type:Object})],Wa.prototype,"format",void 0),wa([me({type:Boolean})],Wa.prototype,"disableSliderNumberInput",void 0),wa([me({type:Boolean})],Wa.prototype,"fullWidth",void 0),wa([me({type:String})],Wa.prototype,"helperText",void 0),wa([me({type:Boolean})],Wa.prototype,"helperPersistent",void 0),wa([me({type:String,attribute:!0})],Wa.prototype,"validationMessage",void 0),wa([me({type:Boolean})],Wa.prototype,"autoValidate",void 0),wa([me({type:Boolean})],Wa.prototype,"charCounter",void 0),wa([me({type:String})],Wa.prototype,"label",void 0),wa([me({type:Boolean})],Wa.prototype,"disabled",void 0),wa([me({type:Boolean})],Wa.prototype,"continuous",void 0),wa([me({type:Boolean})],Wa.prototype,"resizeVertical",void 0),wa([fe()],Wa.prototype,"isUiValid",void 0),wa([fe()],Wa.prototype,"searchableValue",void 0),wa([fe()],Wa.prototype,"errorMessage",void 0),Wa=wa([ue("or-mwc-input")],Wa);var Va=o(88352),Ga=o.n(Va),Ka=(o(99176),o(52948),o(80832),o(7e4),function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a});class qa extends CustomEvent{constructor(e,t){super(qa.NAME,{bubbles:!0,composed:!0,detail:{value:e,valid:t}})}}qa.NAME="or-ace-editor-changed";class Xa extends CustomEvent{constructor(){super(Xa.NAME,{bubbles:!0,composed:!0})}}Xa.NAME="or-ace-editor-edit";let Ya=class extends ce{constructor(){super(...arguments),this.mode="ace/mode/json",this._lastValue="",this._editing=!1}static get styles(){return l`
|
|
502
|
+
`}setCustomValidity(e){this.errorMessage=e;const t=this.shadowRoot.getElementById("elem");t&&t.setCustomValidity&&t.setCustomValidity(null!=e?e:""),this.reportValidity()}checkValidity(){const e=this.shadowRoot.getElementById("elem");let t=!0;return e&&e.validity&&(t=e.validity.valid),!t||this.type!==Ua.JSON&&this.type!==Ua.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(t=!1),t}reportValidity(){const e=this.checkValidity();return this.isUiValid=e,this._mdcComponent&&(this._mdcComponent.valid=e),e}onValueChange(e,t,n){var i,r;let o,a=this.value;if("undefined"===t&&(a=null,t=void 0),"null"===t&&(a=void 0,t=null),"string"==typeof t)switch(this.type){case Ua.CHECKBOX:case Ua.SWITCH:t="on"===t;break;case Ua.JSON:case Ua.JSON_OBJECT:case Ua.NUMBER:case Ua.RANGE:if(""===t)t=null;else try{t=JSON.parse(t),this.type!==Ua.JSON_OBJECT||"object"==typeof t&&!Array.isArray(t)||(t=this.value,o=ua.i18next.t("validation.invalidJSON"))}catch(e){t=this.value,o=this.type===Ua.JSON||this.type==Ua.JSON_OBJECT?ua.i18next.t("validation.invalidJSON"):ua.i18next.t("validation.invalidNumber")}break;case Ua.DATETIME:if(""===t)t=null;else try{t=Date.parse(t)}catch(e){t=this.value,o=ua.i18next.t("validation.invalidDate")}}if(this.value=t,this.setCustomValidity(o),this.reportValidity(),this.type!==Ua.CHECKBOX_LIST&&t!==a&&(this.type===Ua.RANGE&&(this._mdcComponent.setValue(t),this._mdcComponent2&&(this._mdcComponent2.value=t)),this.dispatchEvent(new za(this.value,a,n))),null!=this.searchProvider&&this.type===Ua.SELECT){const e=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];e&&(this.searchableValue=void 0,e.value="")}this.type!==Ua.CHECKBOX_LIST||sa.Util.objectsEqual(t,a,!0)||this.dispatchEvent(new za(t,a,n))}get valid(){const e=this.shadowRoot.getElementById("elem");return!e||!e.checkValidity||e.checkValidity()}get currentValue(){const e=this.shadowRoot.getElementById("elem");if(e&&e.value)return e.value}resolveOptions(e){let t;return e&&e.length>0&&(t=e.map((e=>{if(Array.isArray(e))return e;{const t=""+e;return[e,ua.i18next.t(t,{defaultValue:sa.Util.camelCaseToSentenceCase(t)})]}}))),t}getSelectedTextValue(e){const t=this.value,n=Array.isArray(t)?t:null!=t?[t]:void 0;if(!n)return"";const i=e||this.resolveOptions(this.options);return i&&n?n.map((e=>i.find((([t,n],i)=>e===t)))).map((e=>e?e[1]:"")).join(", "):""}};wa([me({type:Boolean})],Wa.prototype,"focused",void 0),wa([me()],Wa.prototype,"value",void 0),wa([me({type:String})],Wa.prototype,"type",void 0),wa([me({type:String})],Wa.prototype,"name",void 0),wa([me({type:Boolean})],Wa.prototype,"readonly",void 0),wa([me({type:Boolean})],Wa.prototype,"required",void 0),wa([me()],Wa.prototype,"max",void 0),wa([me()],Wa.prototype,"min",void 0),wa([me({type:Number})],Wa.prototype,"step",void 0),wa([me({type:Boolean})],Wa.prototype,"checked",void 0),wa([me({type:Boolean})],Wa.prototype,"indeterminate",void 0),wa([me({type:Number})],Wa.prototype,"maxLength",void 0),wa([me({type:Number})],Wa.prototype,"minLength",void 0),wa([me({type:Number})],Wa.prototype,"rows",void 0),wa([me({type:Number})],Wa.prototype,"cols",void 0),wa([me({type:Boolean})],Wa.prototype,"multiple",void 0),wa([me({type:String,attribute:!0,reflect:!1})],Wa.prototype,"pattern",void 0),wa([me({type:String})],Wa.prototype,"placeHolder",void 0),wa([me({type:Array})],Wa.prototype,"options",void 0),wa([me({type:Boolean})],Wa.prototype,"autoSelect",void 0),wa([me({type:Object})],Wa.prototype,"searchProvider",void 0),wa([me({type:String})],Wa.prototype,"searchLabel",void 0),wa([me({type:String})],Wa.prototype,"icon",void 0),wa([me({type:String})],Wa.prototype,"iconColor",void 0),wa([me({type:String})],Wa.prototype,"iconOn",void 0),wa([me({type:String})],Wa.prototype,"iconTrailing",void 0),wa([me({type:Boolean})],Wa.prototype,"compact",void 0),wa([me({type:Boolean})],Wa.prototype,"comfortable",void 0),wa([me({type:Boolean})],Wa.prototype,"raised",void 0),wa([me({type:Boolean})],Wa.prototype,"action",void 0),wa([me({type:Boolean})],Wa.prototype,"unElevated",void 0),wa([me({type:Boolean})],Wa.prototype,"outlined",void 0),wa([me({type:Boolean})],Wa.prototype,"rounded",void 0),wa([me({type:Object})],Wa.prototype,"format",void 0),wa([me({type:Boolean})],Wa.prototype,"disableSliderNumberInput",void 0),wa([me({type:Boolean})],Wa.prototype,"fullWidth",void 0),wa([me({type:String})],Wa.prototype,"helperText",void 0),wa([me({type:Boolean})],Wa.prototype,"helperPersistent",void 0),wa([me({type:String,attribute:!0})],Wa.prototype,"validationMessage",void 0),wa([me({type:Boolean})],Wa.prototype,"autoValidate",void 0),wa([me({type:Boolean})],Wa.prototype,"charCounter",void 0),wa([me({type:String})],Wa.prototype,"label",void 0),wa([me({type:Boolean})],Wa.prototype,"disabled",void 0),wa([me({type:Boolean})],Wa.prototype,"continuous",void 0),wa([me({type:Boolean})],Wa.prototype,"resizeVertical",void 0),wa([fe()],Wa.prototype,"isUiValid",void 0),wa([fe()],Wa.prototype,"searchableValue",void 0),wa([fe()],Wa.prototype,"errorMessage",void 0),Wa=wa([ue("or-mwc-input")],Wa);var Va=o(88352),Ga=o.n(Va),Ka=(o(99176),o(52948),o(80832),o(7e4),function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a});class qa extends CustomEvent{constructor(e,t){super(qa.NAME,{bubbles:!0,composed:!0,detail:{value:e,valid:t}})}}qa.NAME="or-ace-editor-changed";class Xa extends CustomEvent{constructor(){super(Xa.NAME,{bubbles:!0,composed:!0})}}Xa.NAME="or-ace-editor-edit";let Ya=class extends ce{constructor(){super(...arguments),this.mode="ace/mode/json",this._lastValue="",this._editing=!1}static get styles(){return l`
|
|
501
503
|
:host {
|
|
502
504
|
display: block;
|
|
503
505
|
width: 100%;
|
|
@@ -548,7 +550,7 @@
|
|
|
548
550
|
max-width: 1024px;
|
|
549
551
|
}
|
|
550
552
|
}
|
|
551
|
-
`;let ps=class extends ce{constructor(){super(...arguments),this._open=!1}static get styles(){return[l`${s(as)}`,l`${s(ss)}`,us]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(e){return this._open=!0,this}setHeading(e){return this.heading=e,this}setContent(e){return this.content=e,this}setActions(e){return this.actions=e,this}setDismissAction(e){return this.dismissAction=e,this}setStyles(e){return this.styles=e,this}setAvatar(e){return this.avatar=e,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new rs(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(e){this._mdcComponent&&this._mdcComponent.close(e)}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return H`
|
|
553
|
+
`;let ps=class extends ce{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=e=>this._onBrowserNavigate(e)}static get styles(){return[l`${s(as)}`,l`${s(ss)}`,us]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(e){return this._open=!0,this}setHeading(e){return this.heading=e,this}setContent(e){return this.content=e,this}setActions(e){return this.actions=e,this}setDismissAction(e){return this.dismissAction=e,this}setStyles(e){return this.styles=e,this}setAvatar(e){return this.avatar=e,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new rs(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(e){this._mdcComponent&&this._mdcComponent.close(e)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return H`
|
|
552
554
|
${"string"==typeof this.styles?H`<style>${this.styles}</style>`:this.styles||""}
|
|
553
555
|
|
|
554
556
|
<div id="dialog"
|
|
@@ -581,7 +583,7 @@
|
|
|
581
583
|
</div>
|
|
582
584
|
<div class="mdc-dialog__scrim"></div>
|
|
583
585
|
</div>
|
|
584
|
-
`}updated(e){super.updated(e),e.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new ls)}_onDialogClosed(e){if("close"===e&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(e&&this.actions){const t=this.actions.find((t=>t.actionName===e));t&&t.action&&t.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new cs(e))}};function hs(e,t){if(!e||!t)return H``;const n=t.renderers||Jt({jsonforms:Object.assign({},e)}),i=t.schema,r=t.uischema;let o;if(n&&i&&r){const a=n.map((e=>[e,e.tester(r,i)])).sort(((e,t)=>t[1]-e[1])),s=a&&a.length>0?a[0]:void 0;o=s&&-1!==s[1]?s[0].renderer(e,t):H`<span>No applicable renderer found!</span>`}return o}function ms(e,t){return e.map((e=>{let n,i,r;const o=bs(e,t);if(e.$ref&&(e=gn.schema(t,e.$ref)),Array.isArray(e.allOf)&&(e=_n(e,t,"allOf")),fn(e).every((e=>"object"===e))){const t=function(e){let t=[];return e.allOf?t=e.allOf.map((e=>e.properties?Object.entries(e.properties):[])).flat():e.properties&&(t=Object.entries(e.properties)),t}(e),a=t.find((([e,t])=>void 0!==fs(t)));a?(n=a[0],i=fs(a[1]),r=()=>{const e={};return e[a[0]]=fs(a[1]),e},o[0]||(o[0]=fs(a[1]))):r=()=>kn(e)}else r=()=>kn(e);return{title:o[0],description:o[1],defaultValueCreator:r,constProperty:n,constValue:i}}))}function fs(e){if(e)return void 0!==e.const?e.const:Array.isArray(e.enum)&&1===e.enum.length?e.enum[0]:void 0}function gs(e,t,n,i,r,o){const a=ms(t[i],e),s=a.map(((e,t)=>[t+"",e.title||ua.i18next.t("schema.title.indexedItem",{index:t})])),l=r?ua.i18next.t("schema.anyOfPickerLabel",{label:r}):ua.i18next.t("type");return H`
|
|
586
|
+
`}updated(e){super.updated(e),e.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new ls)}_onDialogClosed(e){if("close"===e&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(e&&this.actions){const t=this.actions.find((t=>t.actionName===e));t&&t.action&&t.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new cs(e))}_onBrowserNavigate(e){this.close("close")}};function hs(e,t){if(!e||!t)return H``;const n=t.renderers||Jt({jsonforms:Object.assign({},e)}),i=t.schema,r=t.uischema;let o;if(n&&i&&r){const a=n.map((e=>[e,e.tester(r,i)])).sort(((e,t)=>t[1]-e[1])),s=a&&a.length>0?a[0]:void 0;o=s&&-1!==s[1]?s[0].renderer(e,t):H`<span>No applicable renderer found!</span>`}return o}function ms(e,t){return e.map((e=>{let n,i,r;const o=bs(e,t);if(e.$ref&&(e=gn.schema(t,e.$ref)),Array.isArray(e.allOf)&&(e=_n(e,t,"allOf")),fn(e).every((e=>"object"===e))){const t=function(e){let t=[];return e.allOf?t=e.allOf.map((e=>e.properties?Object.entries(e.properties):[])).flat():e.properties&&(t=Object.entries(e.properties)),t}(e),a=t.find((([e,t])=>void 0!==fs(t)));a?(n=a[0],i=fs(a[1]),r=()=>{const e={};return e[a[0]]=fs(a[1]),e},o[0]||(o[0]=fs(a[1]))):r=()=>kn(e)}else r=()=>kn(e);return{title:o[0],description:o[1],defaultValueCreator:r,constProperty:n,constValue:i}}))}function fs(e){if(e)return void 0!==e.const?e.const:Array.isArray(e.enum)&&1===e.enum.length?e.enum[0]:void 0}function gs(e,t,n,i,r,o){const a=ms(t[i],e),s=a.map(((e,t)=>[t+"",e.title||ua.i18next.t("schema.title.indexedItem",{index:t})])),l=r?ua.i18next.t("schema.anyOfPickerLabel",{label:r}):ua.i18next.t("type");return H`
|
|
585
587
|
<or-mwc-input class="any-of-picker" .label="${l}" .type="${Ua.SELECT}" .options="${s}" @or-mwc-input-changed="${e=>(e=>{const t=a[e];o(t)})(Number(e.detail.value))}"></or-mwc-input>
|
|
586
588
|
`}function bs(e,t){let n;if(e.$ref&&(n=vs(e.$ref),e=gn.schema(t,e.$ref)),e.title)return[e.title,e.description];if(e.allOf){const n=_n(e,t,"allOf").allOf.find((e=>!!e.title));if(n)return[n.title,n.description]}return[ua.i18next.t("schema.title."+n,{defaultValue:sa.Util.camelCaseToSentenceCase(n)}),void 0]}function vs(e){return e.substr(e.lastIndexOf("/")+1)}function ys(e,t,n,i){if(n)return n;const r=bs(e,t);return r[0]?r[0]:i?sa.Util.camelCaseToSentenceCase(vs(i)):void 0}os([me({type:String})],ps.prototype,"heading",void 0),os([me({type:Object,attribute:!1})],ps.prototype,"content",void 0),os([me({type:Array,attribute:!1})],ps.prototype,"actions",void 0),os([me({type:Object,attribute:!1})],ps.prototype,"dismissAction",void 0),os([me({type:Boolean})],ps.prototype,"avatar",void 0),os([me()],ps.prototype,"styles",void 0),os([me({attribute:!1})],ps.prototype,"_open",void 0),os([ge("#dialog")],ps.prototype,"_mdcElem",void 0),ps=os([ue("or-mwc-dialog")],ps);const xs=e=>({type:"Control",scope:e,label:!1}),_s=(e,t,n)=>{const i=vi(),r=vi();ds((new ps).setContent(H`
|
|
587
589
|
<or-ace-editor ${_i(i)} @or-ace-editor-edit="${()=>{r.value.disabled=!0}}" @or-ace-editor-changed="${e=>(e=>{const t=e.detail.valid;r.value.disabled=!t})(e)}" .value="${t}"></or-ace-editor>
|