@openremote/or-chart 1.2.0-snapshot.20240616202404 → 1.2.0-snapshot.20240819114736
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.bundle.js
CHANGED
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
</div>
|
|
482
482
|
${t?W`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
|
|
483
483
|
</span>
|
|
484
|
-
`}return t}}}return W`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case _a.LIST:const e=new sr(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case _a.SELECT:const n=new Dr(t);this._mdcComponent=n,this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,a=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(a)return}n.menu.menuSurface_.close()};break;case _a.RADIO:case _a.CHECKBOX_LIST:case _a.COLOUR:break;case _a.BUTTON:case _a.BUTTON_MOMENTARY:const o=!this.action&&!this.label,s=new Rn(t);o&&(s.unbounded=!0),this._mdcComponent=s;break;case _a.BUTTON_TOGGLE:this._mdcComponent=new Hr(t);break;case _a.CHECKBOX:this._mdcComponent=new _i(t);const l=this.shadowRoot.getElementById("field");if(l){const t=new Ar(l);t.input=this._mdcComponent,this._mdcComponent2=t}break;case _a.SWITCH:this._mdcComponent=new wi(t);break;case _a.RANGE:this._mdcComponent=new Ni(t);const d=this.shadowRoot.getElementById("number");if(d){const t=new ai(d);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const c=new ai(t);c.useNativeValidation=!1,this._mdcComponent=c}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===_a.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===_a.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===_a.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===_a.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}this.autoValidate&&this.reportValidity()}renderOutlined(t){return W`
|
|
484
|
+
`}return t}}}return W`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var e,n;if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case _a.LIST:const e=new sr(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case _a.SELECT:const n=new Dr(t);this._mdcComponent=n,null!==this.value&&void 0!==this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,a=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(a)return}n.menu.menuSurface_.close()};break;case _a.RADIO:case _a.CHECKBOX_LIST:case _a.COLOUR:break;case _a.BUTTON:case _a.BUTTON_MOMENTARY:const o=!this.action&&!this.label,s=new Rn(t);o&&(s.unbounded=!0),this._mdcComponent=s;break;case _a.BUTTON_TOGGLE:this._mdcComponent=new Hr(t);break;case _a.CHECKBOX:this._mdcComponent=new _i(t);const l=this.shadowRoot.getElementById("field");if(l){const t=new Ar(l);t.input=this._mdcComponent,this._mdcComponent2=t}break;case _a.SWITCH:this._mdcComponent=new wi(t);break;case _a.RANGE:this._mdcComponent=new Ni(t);const d=this.shadowRoot.getElementById("number");if(d){const t=new ai(d);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const c=new ai(t);c.useNativeValidation=!1,this._mdcComponent=c}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===_a.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===_a.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===_a.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===_a.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null===(n=null===(e=this._mdcComponent)||void 0===e?void 0:e.layout)||void 0===n||n.call(e)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return W`
|
|
485
485
|
<span class="mdc-notched-outline">
|
|
486
486
|
<span class="mdc-notched-outline__leading"></span>
|
|
487
487
|
${t?W`
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
`:""}
|
|
492
492
|
<span class="mdc-notched-outline__trailing"></span>
|
|
493
493
|
</span>
|
|
494
|
-
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==_a.JSON&&this.type!==_a.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case _a.CHECKBOX:case _a.SWITCH:e="on"===e;break;case _a.JSON:case _a.JSON_OBJECT:case _a.NUMBER:case _a.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==_a.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=De.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===_a.JSON||this.type==_a.JSON_OBJECT?De.i18next.t("validation.invalidJSON"):De.i18next.t("validation.invalidNumber")}break;case _a.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=De.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==_a.CHECKBOX_LIST&&e!==o&&(this.type===_a.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new fa(this.value,o,n))),null!=this.searchProvider&&this.type===_a.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==_a.CHECKBOX_LIST||Ye.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new fa(e,o,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,De.i18next.t(e,{defaultValue:Ye.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Jr([ft({type:Boolean})],ya.prototype,"focused",void 0),Jr([ft()],ya.prototype,"value",void 0),Jr([ft({type:String})],ya.prototype,"type",void 0),Jr([ft({type:String})],ya.prototype,"name",void 0),Jr([ft({type:Boolean})],ya.prototype,"readonly",void 0),Jr([ft({type:Boolean})],ya.prototype,"required",void 0),Jr([ft()],ya.prototype,"max",void 0),Jr([ft()],ya.prototype,"min",void 0),Jr([ft({type:Number})],ya.prototype,"step",void 0),Jr([ft({type:Boolean})],ya.prototype,"checked",void 0),Jr([ft({type:Boolean})],ya.prototype,"indeterminate",void 0),Jr([ft({type:Number})],ya.prototype,"maxLength",void 0),Jr([ft({type:Number})],ya.prototype,"minLength",void 0),Jr([ft({type:Number})],ya.prototype,"rows",void 0),Jr([ft({type:Number})],ya.prototype,"cols",void 0),Jr([ft({type:Boolean})],ya.prototype,"multiple",void 0),Jr([ft({type:String,attribute:!0,reflect:!1})],ya.prototype,"pattern",void 0),Jr([ft({type:String})],ya.prototype,"placeHolder",void 0),Jr([ft({type:Array})],ya.prototype,"options",void 0),Jr([ft({type:Boolean})],ya.prototype,"autoSelect",void 0),Jr([ft({type:Object})],ya.prototype,"searchProvider",void 0),Jr([ft({type:String})],ya.prototype,"icon",void 0),Jr([ft({type:String})],ya.prototype,"iconColor",void 0),Jr([ft({type:String})],ya.prototype,"iconOn",void 0),Jr([ft({type:String})],ya.prototype,"iconTrailing",void 0),Jr([ft({type:Boolean})],ya.prototype,"compact",void 0),Jr([ft({type:Boolean})],ya.prototype,"comfortable",void 0),Jr([ft({type:Boolean})],ya.prototype,"raised",void 0),Jr([ft({type:Boolean})],ya.prototype,"action",void 0),Jr([ft({type:Boolean})],ya.prototype,"unElevated",void 0),Jr([ft({type:Boolean})],ya.prototype,"outlined",void 0),Jr([ft({type:Boolean})],ya.prototype,"rounded",void 0),Jr([ft({type:Object})],ya.prototype,"format",void 0),Jr([ft({type:Boolean})],ya.prototype,"disableSliderNumberInput",void 0),Jr([ft({type:Boolean})],ya.prototype,"fullWidth",void 0),Jr([ft({type:String})],ya.prototype,"helperText",void 0),Jr([ft({type:Boolean})],ya.prototype,"helperPersistent",void 0),Jr([ft({type:String,attribute:!0})],ya.prototype,"validationMessage",void 0),Jr([ft({type:Boolean})],ya.prototype,"autoValidate",void 0),Jr([ft({type:Boolean})],ya.prototype,"charCounter",void 0),Jr([ft({type:String})],ya.prototype,"label",void 0),Jr([ft({type:Boolean})],ya.prototype,"disabled",void 0),Jr([ft({type:Boolean})],ya.prototype,"continuous",void 0),Jr([ft({type:Boolean})],ya.prototype,"resizeVertical",void 0),Jr([_t()],ya.prototype,"isUiValid",void 0),Jr([_t()],ya.prototype,"searchableValue",void 0),Jr([_t()],ya.prototype,"errorMessage",void 0),ya=Jr([mt("or-mwc-input")],ya);var va=function(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};const xa=l(420),ka=l(6568),wa=o`
|
|
494
|
+
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==_a.JSON&&this.type!==_a.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case _a.CHECKBOX:case _a.SWITCH:e="on"===e;break;case _a.JSON:case _a.JSON_OBJECT:case _a.NUMBER:case _a.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==_a.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=De.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===_a.JSON||this.type==_a.JSON_OBJECT?De.i18next.t("validation.invalidJSON"):De.i18next.t("validation.invalidNumber")}break;case _a.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=De.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==_a.CHECKBOX_LIST&&e!==o&&(this.type===_a.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new fa(this.value,o,n))),null!=this.searchProvider&&this.type===_a.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==_a.CHECKBOX_LIST||Ye.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new fa(e,o,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,De.i18next.t(e,{defaultValue:Ye.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Jr([ft({type:Boolean})],ya.prototype,"focused",void 0),Jr([ft()],ya.prototype,"value",void 0),Jr([ft({type:String})],ya.prototype,"type",void 0),Jr([ft({type:String})],ya.prototype,"name",void 0),Jr([ft({type:Boolean})],ya.prototype,"readonly",void 0),Jr([ft({type:Boolean})],ya.prototype,"required",void 0),Jr([ft()],ya.prototype,"max",void 0),Jr([ft()],ya.prototype,"min",void 0),Jr([ft({type:Number})],ya.prototype,"step",void 0),Jr([ft({type:Boolean})],ya.prototype,"checked",void 0),Jr([ft({type:Boolean})],ya.prototype,"indeterminate",void 0),Jr([ft({type:Number})],ya.prototype,"maxLength",void 0),Jr([ft({type:Number})],ya.prototype,"minLength",void 0),Jr([ft({type:Number})],ya.prototype,"rows",void 0),Jr([ft({type:Number})],ya.prototype,"cols",void 0),Jr([ft({type:Boolean})],ya.prototype,"multiple",void 0),Jr([ft({type:String,attribute:!0,reflect:!1})],ya.prototype,"pattern",void 0),Jr([ft({type:String})],ya.prototype,"placeHolder",void 0),Jr([ft({type:Array})],ya.prototype,"options",void 0),Jr([ft({type:Boolean})],ya.prototype,"autoSelect",void 0),Jr([ft({type:Object})],ya.prototype,"searchProvider",void 0),Jr([ft({type:String})],ya.prototype,"icon",void 0),Jr([ft({type:String})],ya.prototype,"iconColor",void 0),Jr([ft({type:String})],ya.prototype,"iconOn",void 0),Jr([ft({type:String})],ya.prototype,"iconTrailing",void 0),Jr([ft({type:Boolean})],ya.prototype,"compact",void 0),Jr([ft({type:Boolean})],ya.prototype,"comfortable",void 0),Jr([ft({type:Boolean})],ya.prototype,"raised",void 0),Jr([ft({type:Boolean})],ya.prototype,"action",void 0),Jr([ft({type:Boolean})],ya.prototype,"unElevated",void 0),Jr([ft({type:Boolean})],ya.prototype,"outlined",void 0),Jr([ft({type:Boolean})],ya.prototype,"rounded",void 0),Jr([ft({type:Object})],ya.prototype,"format",void 0),Jr([ft({type:Boolean})],ya.prototype,"disableSliderNumberInput",void 0),Jr([ft({type:Boolean})],ya.prototype,"fullWidth",void 0),Jr([ft({type:String})],ya.prototype,"helperText",void 0),Jr([ft({type:Boolean})],ya.prototype,"helperPersistent",void 0),Jr([ft({type:String,attribute:!0})],ya.prototype,"validationMessage",void 0),Jr([ft({type:Boolean})],ya.prototype,"autoValidate",void 0),Jr([ft({type:Boolean})],ya.prototype,"charCounter",void 0),Jr([ft({type:String})],ya.prototype,"label",void 0),Jr([ft({type:Boolean})],ya.prototype,"disabled",void 0),Jr([ft({type:Boolean})],ya.prototype,"continuous",void 0),Jr([ft({type:Boolean})],ya.prototype,"resizeVertical",void 0),Jr([_t()],ya.prototype,"isUiValid",void 0),Jr([_t()],ya.prototype,"searchableValue",void 0),Jr([_t()],ya.prototype,"errorMessage",void 0),ya=Jr([mt("or-mwc-input")],ya);var va=function(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};const xa=l(420),ka=l(6568),wa=o`
|
|
495
495
|
|
|
496
496
|
:host {
|
|
497
497
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${a(Ye.DefaultColor2)}));
|
package/dist/umd/index.js
CHANGED
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
</div>
|
|
482
482
|
${t?B`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
|
|
483
483
|
</span>
|
|
484
|
-
`}return t}}}return B`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case bo.LIST:const e=new lr(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case bo.SELECT:const n=new Ir(t);this._mdcComponent=n,this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,o=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(o)return}n.menu.menuSurface_.close()};break;case bo.RADIO:case bo.CHECKBOX_LIST:case bo.COLOUR:break;case bo.BUTTON:case bo.BUTTON_MOMENTARY:const a=!this.action&&!this.label,l=new Mn(t);a&&(l.unbounded=!0),this._mdcComponent=l;break;case bo.BUTTON_TOGGLE:this._mdcComponent=new Pr(t);break;case bo.CHECKBOX:this._mdcComponent=new gi(t);const c=this.shadowRoot.getElementById("field");if(c){const t=new Lr(c);t.input=this._mdcComponent,this._mdcComponent2=t}break;case bo.SWITCH:this._mdcComponent=new ki(t);break;case bo.RANGE:this._mdcComponent=new Hi(t);const s=this.shadowRoot.getElementById("number");if(s){const t=new oi(s);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const d=new oi(t);d.useNativeValidation=!1,this._mdcComponent=d}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===bo.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===bo.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===bo.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===bo.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}this.autoValidate&&this.reportValidity()}renderOutlined(t){return B`
|
|
484
|
+
`}return t}}}return B`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){const t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var e,n;if(super.updated(t),t.has("type")){const t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case bo.LIST:const e=new lr(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case bo.SELECT:const n=new Ir(t);this._mdcComponent=n,null!==this.value&&void 0!==this.value||(n.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return-1;const t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),n.useDefaultValidation=!this.multiple,n.valid=!this.required||!this.multiple&&n.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const i=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(i),this._mdcComponent.foundation.adapter.floatLabel(!!i),this._menuObserver||(this._menuObserver=new IntersectionObserver(((t,e)=>{var n,i;t[0].target.style.minWidth!=(null===(n=t[0].target.parentElement)||void 0===n?void 0:n.clientWidth)+"px"&&(t[0].target.style.minWidth=(null===(i=t[0].target.parentElement)||void 0===i?void 0:i.clientWidth)+"px")})),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));const r=void 0!==this.searchProvider,o=this.multiple;n.menu.menuSurface_.foundation.handleBodyClick=function(t){const e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;if(o)return}n.menu.menuSurface_.close()};break;case bo.RADIO:case bo.CHECKBOX_LIST:case bo.COLOUR:break;case bo.BUTTON:case bo.BUTTON_MOMENTARY:const a=!this.action&&!this.label,l=new Mn(t);a&&(l.unbounded=!0),this._mdcComponent=l;break;case bo.BUTTON_TOGGLE:this._mdcComponent=new Pr(t);break;case bo.CHECKBOX:this._mdcComponent=new gi(t);const c=this.shadowRoot.getElementById("field");if(c){const t=new Lr(c);t.input=this._mdcComponent,this._mdcComponent2=t}break;case bo.SWITCH:this._mdcComponent=new ki(t);break;case bo.RANGE:this._mdcComponent=new Hi(t);const s=this.shadowRoot.getElementById("number");if(s){const t=new oi(s);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:const d=new oi(t);d.useNativeValidation=!1,this._mdcComponent=d}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===bo.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!(!this.disabled&&!this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;const e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===bo.RANGE&&this._mdcComponent){const t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===bo.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===bo.CHECKBOX&&this._mdcComponent){const t=this._mdcComponent;t.checked=!!this.value,t.disabled=!(!this.disabled&&!this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null===(n=null===(e=this._mdcComponent)||void 0===e?void 0:e.layout)||void 0===n||n.call(e)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return B`
|
|
485
485
|
<span class="mdc-notched-outline">
|
|
486
486
|
<span class="mdc-notched-outline__leading"></span>
|
|
487
487
|
${t?B`
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
`:""}
|
|
492
492
|
<span class="mdc-notched-outline__trailing"></span>
|
|
493
493
|
</span>
|
|
494
|
-
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==bo.JSON&&this.type!==bo.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case bo.CHECKBOX:case bo.SWITCH:e="on"===e;break;case bo.JSON:case bo.JSON_OBJECT:case bo.NUMBER:case bo.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==bo.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Ie.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===bo.JSON||this.type==bo.JSON_OBJECT?Ie.i18next.t("validation.invalidJSON"):Ie.i18next.t("validation.invalidNumber")}break;case bo.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Ie.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==bo.CHECKBOX_LIST&&e!==a&&(this.type===bo.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new go(this.value,a,n))),null!=this.searchProvider&&this.type===bo.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==bo.CHECKBOX_LIST||Se.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new go(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,Ie.i18next.t(e,{defaultValue:Se.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Jr([ht({type:Boolean})],xo.prototype,"focused",void 0),Jr([ht()],xo.prototype,"value",void 0),Jr([ht({type:String})],xo.prototype,"type",void 0),Jr([ht({type:String})],xo.prototype,"name",void 0),Jr([ht({type:Boolean})],xo.prototype,"readonly",void 0),Jr([ht({type:Boolean})],xo.prototype,"required",void 0),Jr([ht()],xo.prototype,"max",void 0),Jr([ht()],xo.prototype,"min",void 0),Jr([ht({type:Number})],xo.prototype,"step",void 0),Jr([ht({type:Boolean})],xo.prototype,"checked",void 0),Jr([ht({type:Boolean})],xo.prototype,"indeterminate",void 0),Jr([ht({type:Number})],xo.prototype,"maxLength",void 0),Jr([ht({type:Number})],xo.prototype,"minLength",void 0),Jr([ht({type:Number})],xo.prototype,"rows",void 0),Jr([ht({type:Number})],xo.prototype,"cols",void 0),Jr([ht({type:Boolean})],xo.prototype,"multiple",void 0),Jr([ht({type:String,attribute:!0,reflect:!1})],xo.prototype,"pattern",void 0),Jr([ht({type:String})],xo.prototype,"placeHolder",void 0),Jr([ht({type:Array})],xo.prototype,"options",void 0),Jr([ht({type:Boolean})],xo.prototype,"autoSelect",void 0),Jr([ht({type:Object})],xo.prototype,"searchProvider",void 0),Jr([ht({type:String})],xo.prototype,"icon",void 0),Jr([ht({type:String})],xo.prototype,"iconColor",void 0),Jr([ht({type:String})],xo.prototype,"iconOn",void 0),Jr([ht({type:String})],xo.prototype,"iconTrailing",void 0),Jr([ht({type:Boolean})],xo.prototype,"compact",void 0),Jr([ht({type:Boolean})],xo.prototype,"comfortable",void 0),Jr([ht({type:Boolean})],xo.prototype,"raised",void 0),Jr([ht({type:Boolean})],xo.prototype,"action",void 0),Jr([ht({type:Boolean})],xo.prototype,"unElevated",void 0),Jr([ht({type:Boolean})],xo.prototype,"outlined",void 0),Jr([ht({type:Boolean})],xo.prototype,"rounded",void 0),Jr([ht({type:Object})],xo.prototype,"format",void 0),Jr([ht({type:Boolean})],xo.prototype,"disableSliderNumberInput",void 0),Jr([ht({type:Boolean})],xo.prototype,"fullWidth",void 0),Jr([ht({type:String})],xo.prototype,"helperText",void 0),Jr([ht({type:Boolean})],xo.prototype,"helperPersistent",void 0),Jr([ht({type:String,attribute:!0})],xo.prototype,"validationMessage",void 0),Jr([ht({type:Boolean})],xo.prototype,"autoValidate",void 0),Jr([ht({type:Boolean})],xo.prototype,"charCounter",void 0),Jr([ht({type:String})],xo.prototype,"label",void 0),Jr([ht({type:Boolean})],xo.prototype,"disabled",void 0),Jr([ht({type:Boolean})],xo.prototype,"continuous",void 0),Jr([ht({type:Boolean})],xo.prototype,"resizeVertical",void 0),Jr([gt()],xo.prototype,"isUiValid",void 0),Jr([gt()],xo.prototype,"searchableValue",void 0),Jr([gt()],xo.prototype,"errorMessage",void 0),xo=Jr([mt("or-mwc-input")],xo);var yo=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};const wo=d(420),ko=d(568),Eo=a`
|
|
494
|
+
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==bo.JSON&&this.type!==bo.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case bo.CHECKBOX:case bo.SWITCH:e="on"===e;break;case bo.JSON:case bo.JSON_OBJECT:case bo.NUMBER:case bo.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==bo.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Ie.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===bo.JSON||this.type==bo.JSON_OBJECT?Ie.i18next.t("validation.invalidJSON"):Ie.i18next.t("validation.invalidNumber")}break;case bo.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Ie.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==bo.CHECKBOX_LIST&&e!==a&&(this.type===bo.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new go(this.value,a,n))),null!=this.searchProvider&&this.type===bo.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==bo.CHECKBOX_LIST||Se.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new go(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,Ie.i18next.t(e,{defaultValue:Se.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Jr([ht({type:Boolean})],xo.prototype,"focused",void 0),Jr([ht()],xo.prototype,"value",void 0),Jr([ht({type:String})],xo.prototype,"type",void 0),Jr([ht({type:String})],xo.prototype,"name",void 0),Jr([ht({type:Boolean})],xo.prototype,"readonly",void 0),Jr([ht({type:Boolean})],xo.prototype,"required",void 0),Jr([ht()],xo.prototype,"max",void 0),Jr([ht()],xo.prototype,"min",void 0),Jr([ht({type:Number})],xo.prototype,"step",void 0),Jr([ht({type:Boolean})],xo.prototype,"checked",void 0),Jr([ht({type:Boolean})],xo.prototype,"indeterminate",void 0),Jr([ht({type:Number})],xo.prototype,"maxLength",void 0),Jr([ht({type:Number})],xo.prototype,"minLength",void 0),Jr([ht({type:Number})],xo.prototype,"rows",void 0),Jr([ht({type:Number})],xo.prototype,"cols",void 0),Jr([ht({type:Boolean})],xo.prototype,"multiple",void 0),Jr([ht({type:String,attribute:!0,reflect:!1})],xo.prototype,"pattern",void 0),Jr([ht({type:String})],xo.prototype,"placeHolder",void 0),Jr([ht({type:Array})],xo.prototype,"options",void 0),Jr([ht({type:Boolean})],xo.prototype,"autoSelect",void 0),Jr([ht({type:Object})],xo.prototype,"searchProvider",void 0),Jr([ht({type:String})],xo.prototype,"icon",void 0),Jr([ht({type:String})],xo.prototype,"iconColor",void 0),Jr([ht({type:String})],xo.prototype,"iconOn",void 0),Jr([ht({type:String})],xo.prototype,"iconTrailing",void 0),Jr([ht({type:Boolean})],xo.prototype,"compact",void 0),Jr([ht({type:Boolean})],xo.prototype,"comfortable",void 0),Jr([ht({type:Boolean})],xo.prototype,"raised",void 0),Jr([ht({type:Boolean})],xo.prototype,"action",void 0),Jr([ht({type:Boolean})],xo.prototype,"unElevated",void 0),Jr([ht({type:Boolean})],xo.prototype,"outlined",void 0),Jr([ht({type:Boolean})],xo.prototype,"rounded",void 0),Jr([ht({type:Object})],xo.prototype,"format",void 0),Jr([ht({type:Boolean})],xo.prototype,"disableSliderNumberInput",void 0),Jr([ht({type:Boolean})],xo.prototype,"fullWidth",void 0),Jr([ht({type:String})],xo.prototype,"helperText",void 0),Jr([ht({type:Boolean})],xo.prototype,"helperPersistent",void 0),Jr([ht({type:String,attribute:!0})],xo.prototype,"validationMessage",void 0),Jr([ht({type:Boolean})],xo.prototype,"autoValidate",void 0),Jr([ht({type:Boolean})],xo.prototype,"charCounter",void 0),Jr([ht({type:String})],xo.prototype,"label",void 0),Jr([ht({type:Boolean})],xo.prototype,"disabled",void 0),Jr([ht({type:Boolean})],xo.prototype,"continuous",void 0),Jr([ht({type:Boolean})],xo.prototype,"resizeVertical",void 0),Jr([gt()],xo.prototype,"isUiValid",void 0),Jr([gt()],xo.prototype,"searchableValue",void 0),Jr([gt()],xo.prototype,"errorMessage",void 0),xo=Jr([mt("or-mwc-input")],xo);var yo=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};const wo=d(420),ko=d(568),Eo=a`
|
|
495
495
|
|
|
496
496
|
:host {
|
|
497
497
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${o(Se.DefaultColor2)}));
|