@openremote/or-chart 1.6.2 → 1.6.3
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
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
.mdc-list-item__graphic > or-icon {
|
|
261
261
|
pointer-events: none;
|
|
262
262
|
}
|
|
263
|
-
`;let Pa=class extends Tt{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[mt`${ut(ga)}`,mt`${ut(fa)}`,mt`${ut(_a)}`,mt`${ut(ba)}`,mt`${ut(ya)}`,mt`${ut(va)}`,mt`${ut(xa)}`,mt`${ut(ka)}`,mt`${ut(wa)}`,mt`${ut(Ma)}`,mt`${ut(La)}`,mt`${ut(Ta)}`,mt`${ut(Da)}`,mt`${ut(Ya)}`,mt`${ut(Sa)}`,mt`${ut(Ea)}`,Ia]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===Ca.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ca.DATETIME:"boolean"==typeof this.value?this.type=Ca.CHECKBOX:"number"==typeof this.value?this.type=Ca.NUMBER:"string"==typeof this.value?this.type=Ca.TEXT:this.type=Ca.JSON),!0}focus(){this.type===Ca.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},o=null!==this.value&&void 0!==this.value||!1===this.value;let s=e?N`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ca.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,N`
|
|
263
|
+
`;let Pa=class extends Tt{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.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[mt`${ut(ga)}`,mt`${ut(fa)}`,mt`${ut(_a)}`,mt`${ut(ba)}`,mt`${ut(ya)}`,mt`${ut(va)}`,mt`${ut(xa)}`,mt`${ut(ka)}`,mt`${ut(wa)}`,mt`${ut(Ma)}`,mt`${ut(La)}`,mt`${ut(Ta)}`,mt`${ut(Da)}`,mt`${ut(Ya)}`,mt`${ut(Sa)}`,mt`${ut(Ea)}`,Ia]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===Ca.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ca.DATETIME:"boolean"==typeof this.value?this.type=Ca.CHECKBOX:"number"==typeof this.value?this.type=Ca.NUMBER:"string"==typeof this.value?this.type=Ca.TEXT:this.type=Ca.JSON),!0}focus(){this.type===Ca.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},o=null!==this.value&&void 0!==this.value||!1===this.value;let s=e?N`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ca.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,N`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${e?e.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),N`
|
|
266
266
|
<div id="field" class="mdc-form-field">
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
/>
|
|
430
430
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
431
431
|
</div>
|
|
432
|
-
`;case Ca.NUMBER:case Ca.RANGE:case Ca.DATE:case Ca.DATETIME:case Ca.TIME:case Ca.MONTH:case Ca.WEEK:case Ca.EMAIL:case Ca.PASSWORD:case Ca.TELEPHONE:case Ca.URL:case Ca.TEXT:case Ca.TEXTAREA:case Ca.JSON:case Ca.JSON_OBJECT:{let e,l=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(l.some((t=>"string"!=typeof t)))if(this.type===Ca.JSON||this.type===Ca.JSON_OBJECT)if(void 0!==l[0]){if("string"!=typeof l[0]||null===l[0])try{l[0]=JSON.stringify(l[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),l[0]=""}}else l[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Ca.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Ca.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Ca.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Ca.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Ca.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Ca.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,l=l.map((t=>void 0!==t?Ve.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let d=this.label,c=this.type,u="component";if(this.type===Ca.RANGE&&(d=void 0,n=!1,i=!1,c=Ca.NUMBER,u="number"),this.type!==Ca.RANGE||!this.disableSliderNumberInput){const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":o,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT?N`
|
|
432
|
+
`;case Ca.NUMBER:case Ca.RANGE:case Ca.DATE:case Ca.DATETIME:case Ca.TIME:case Ca.MONTH:case Ca.WEEK:case Ca.EMAIL:case Ca.PASSWORD:case Ca.TELEPHONE:case Ca.URL:case Ca.TEXT:case Ca.TEXTAREA:case Ca.JSON:case Ca.JSON_OBJECT:{let e,l=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(l.some((t=>"string"!=typeof t)))if(this.type===Ca.JSON||this.type===Ca.JSON_OBJECT)if(void 0!==l[0]){if("string"!=typeof l[0]||null===l[0])try{l[0]=JSON.stringify(l[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),l[0]=""}}else l[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Ca.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Ca.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Ca.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Ca.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Ca.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Ca.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,l=l.map((t=>void 0!==t?Ve.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let d=this.label,c=this.type,u="component";if(this.type===Ca.RANGE&&(d=void 0,n=!1,i=!1,c=Ca.NUMBER,u="number"),this.type!==Ca.RANGE||!this.disableSliderNumberInput){this.censored&&(c=Ca.PASSWORD),this.type===Ca.PASSWORD&&this.advertised&&(c=Ca.TEXT);const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":o,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT?N`
|
|
433
433
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
434
434
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${_n(this.minLength)}"
|
|
435
435
|
maxlength="${_n(this.maxLength)}" rows="${this.rows?this.rows:5}"
|
|
@@ -451,6 +451,7 @@
|
|
|
451
451
|
${e}
|
|
452
452
|
${n?this.renderOutlined(s):s}
|
|
453
453
|
${n?"":N`<span class="mdc-line-ripple"></span>`}
|
|
454
|
+
${this.type!==Ca.PASSWORD||this.censored?"":N`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`}
|
|
454
455
|
${this.iconTrailing?N`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
455
456
|
</label>
|
|
456
457
|
${i||r?N`
|
|
@@ -493,7 +494,7 @@
|
|
|
493
494
|
`:""}
|
|
494
495
|
<span class="mdc-notched-outline__trailing"></span>
|
|
495
496
|
</span>
|
|
496
|
-
`}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!==Ca.JSON&&this.type!==Ca.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 Ca.CHECKBOX:case Ca.SWITCH:e="on"===e;break;case Ca.JSON:case Ca.JSON_OBJECT:case Ca.NUMBER:case Ca.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ca.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=$e.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===Ca.JSON||this.type==Ca.JSON_OBJECT?$e.i18next.t("validation.invalidJSON"):$e.i18next.t("validation.invalidNumber")}break;case Ca.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=$e.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==Ca.CHECKBOX_LIST&&e!==o&&(this.type===Ca.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Aa(this.value,o,n))),null!=this.searchProvider&&this.type===Ca.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!==Ca.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new Aa(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,$e.i18next.t(e,{defaultValue:Ve.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(", "):""}};ha([At({type:Boolean})],Pa.prototype,"focused",void 0),ha([At()],Pa.prototype,"value",void 0),ha([At({type:String})],Pa.prototype,"type",void 0),ha([At({type:String})],Pa.prototype,"name",void 0),ha([At({type:Boolean})],Pa.prototype,"readonly",void 0),ha([At({type:Boolean})],Pa.prototype,"required",void 0),ha([At()],Pa.prototype,"max",void 0),ha([At()],Pa.prototype,"min",void 0),ha([At({type:Number})],Pa.prototype,"step",void 0),ha([At({type:Boolean})],Pa.prototype,"checked",void 0),ha([At({type:Boolean})],Pa.prototype,"indeterminate",void 0),ha([At({type:Number})],Pa.prototype,"maxLength",void 0),ha([At({type:Number})],Pa.prototype,"minLength",void 0),ha([At({type:Number})],Pa.prototype,"rows",void 0),ha([At({type:Number})],Pa.prototype,"cols",void 0),ha([At({type:Boolean})],Pa.prototype,"multiple",void 0),ha([At({type:String,attribute:!0,reflect:!1})],Pa.prototype,"pattern",void 0),ha([At({type:String})],Pa.prototype,"placeHolder",void 0),ha([At({type:Array})],Pa.prototype,"options",void 0),ha([At({type:Boolean})],Pa.prototype,"autoSelect",void 0),ha([At({type:Object})],Pa.prototype,"searchProvider",void 0),ha([At({type:String})],Pa.prototype,"searchLabel",void 0),ha([At({type:String})],Pa.prototype,"icon",void 0),ha([At({type:String})],Pa.prototype,"iconColor",void 0),ha([At({type:String})],Pa.prototype,"iconOn",void 0),ha([At({type:String})],Pa.prototype,"iconTrailing",void 0),ha([At({type:Boolean})],Pa.prototype,"compact",void 0),ha([At({type:Boolean})],Pa.prototype,"comfortable",void 0),ha([At({type:Boolean})],Pa.prototype,"raised",void 0),ha([At({type:Boolean})],Pa.prototype,"action",void 0),ha([At({type:Boolean})],Pa.prototype,"unElevated",void 0),ha([At({type:Boolean})],Pa.prototype,"outlined",void 0),ha([At({type:Boolean})],Pa.prototype,"rounded",void 0),ha([At({type:Object})],Pa.prototype,"format",void 0),ha([At({type:Boolean})],Pa.prototype,"disableSliderNumberInput",void 0),ha([At({type:Boolean})],Pa.prototype,"fullWidth",void 0),ha([At({type:String})],Pa.prototype,"helperText",void 0),ha([At({type:Boolean})],Pa.prototype,"helperPersistent",void 0),ha([At({type:String,attribute:!0})],Pa.prototype,"validationMessage",void 0),ha([At({type:Boolean})],Pa.prototype,"autoValidate",void 0),ha([At({type:Boolean})],Pa.prototype,"charCounter",void 0),ha([At({type:String})],Pa.prototype,"label",void 0),ha([At({type:Boolean})],Pa.prototype,"disabled",void 0),ha([At({type:Boolean})],Pa.prototype,"continuous",void 0),ha([At({type:Boolean})],Pa.prototype,"resizeVertical",void 0),ha([Ct()],Pa.prototype,"isUiValid",void 0),ha([Ct()],Pa.prototype,"searchableValue",void 0),ha([Ct()],Pa.prototype,"errorMessage",void 0),Pa=ha([St("or-mwc-input")],Pa);var Ra=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 Ha=d(420),ja=d(6568),za=mt`
|
|
497
|
+
`}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!==Ca.JSON&&this.type!==Ca.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 Ca.CHECKBOX:case Ca.SWITCH:e="on"===e;break;case Ca.JSON:case Ca.JSON_OBJECT:case Ca.NUMBER:case Ca.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ca.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=$e.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===Ca.JSON||this.type==Ca.JSON_OBJECT?$e.i18next.t("validation.invalidJSON"):$e.i18next.t("validation.invalidNumber")}break;case Ca.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=$e.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==Ca.CHECKBOX_LIST&&e!==o&&(this.type===Ca.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Aa(this.value,o,n))),null!=this.searchProvider&&this.type===Ca.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!==Ca.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new Aa(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,$e.i18next.t(e,{defaultValue:Ve.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(", "):""}};ha([At({type:Boolean})],Pa.prototype,"focused",void 0),ha([At()],Pa.prototype,"value",void 0),ha([At({type:String})],Pa.prototype,"type",void 0),ha([At({type:String})],Pa.prototype,"name",void 0),ha([At({type:Boolean})],Pa.prototype,"readonly",void 0),ha([At({type:Boolean})],Pa.prototype,"required",void 0),ha([At()],Pa.prototype,"max",void 0),ha([At()],Pa.prototype,"min",void 0),ha([At({type:Number})],Pa.prototype,"step",void 0),ha([At({type:Boolean})],Pa.prototype,"checked",void 0),ha([At({type:Boolean})],Pa.prototype,"indeterminate",void 0),ha([At({type:Number})],Pa.prototype,"maxLength",void 0),ha([At({type:Number})],Pa.prototype,"minLength",void 0),ha([At({type:Number})],Pa.prototype,"rows",void 0),ha([At({type:Number})],Pa.prototype,"cols",void 0),ha([At({type:Boolean})],Pa.prototype,"multiple",void 0),ha([At({type:String,attribute:!0,reflect:!1})],Pa.prototype,"pattern",void 0),ha([At({type:String})],Pa.prototype,"placeHolder",void 0),ha([At({type:Array})],Pa.prototype,"options",void 0),ha([At({type:Boolean})],Pa.prototype,"autoSelect",void 0),ha([At({type:Object})],Pa.prototype,"searchProvider",void 0),ha([At({type:String})],Pa.prototype,"searchLabel",void 0),ha([At({type:String})],Pa.prototype,"icon",void 0),ha([At({type:String})],Pa.prototype,"iconColor",void 0),ha([At({type:String})],Pa.prototype,"iconOn",void 0),ha([At({type:String})],Pa.prototype,"iconTrailing",void 0),ha([At({type:Boolean})],Pa.prototype,"compact",void 0),ha([At({type:Boolean})],Pa.prototype,"comfortable",void 0),ha([At({type:Boolean})],Pa.prototype,"raised",void 0),ha([At({type:Boolean})],Pa.prototype,"action",void 0),ha([At({type:Boolean})],Pa.prototype,"unElevated",void 0),ha([At({type:Boolean})],Pa.prototype,"outlined",void 0),ha([At({type:Boolean})],Pa.prototype,"rounded",void 0),ha([At({type:Object})],Pa.prototype,"format",void 0),ha([At({type:Boolean})],Pa.prototype,"disableSliderNumberInput",void 0),ha([At({type:Boolean})],Pa.prototype,"fullWidth",void 0),ha([At({type:String})],Pa.prototype,"helperText",void 0),ha([At({type:Boolean})],Pa.prototype,"helperPersistent",void 0),ha([At({type:String,attribute:!0})],Pa.prototype,"validationMessage",void 0),ha([At({type:Boolean})],Pa.prototype,"autoValidate",void 0),ha([At({type:Boolean})],Pa.prototype,"charCounter",void 0),ha([At({type:String})],Pa.prototype,"label",void 0),ha([At({type:Boolean})],Pa.prototype,"disabled",void 0),ha([At({type:Boolean})],Pa.prototype,"continuous",void 0),ha([At({type:Boolean})],Pa.prototype,"resizeVertical",void 0),ha([At({type:Boolean})],Pa.prototype,"censored",void 0),ha([At({type:Boolean,reflect:!0})],Pa.prototype,"advertised",void 0),ha([Ct()],Pa.prototype,"isUiValid",void 0),ha([Ct()],Pa.prototype,"searchableValue",void 0),ha([Ct()],Pa.prototype,"errorMessage",void 0),Pa=ha([St("or-mwc-input")],Pa);var Ra=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 Ha=d(420),ja=d(6568),za=mt`
|
|
497
498
|
|
|
498
499
|
:host {
|
|
499
500
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${ut(Ve.DefaultColor2)}));
|
package/dist/umd/index.js
CHANGED
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
.mdc-list-item__graphic > or-icon {
|
|
261
261
|
pointer-events: none;
|
|
262
262
|
}
|
|
263
|
-
`;let Po=class extends Ct{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[mt`${pt(vo)}`,mt`${pt(go)}`,mt`${pt(bo)}`,mt`${pt(_o)}`,mt`${pt(xo)}`,mt`${pt(yo)}`,mt`${pt(wo)}`,mt`${pt(ko)}`,mt`${pt(Eo)}`,mt`${pt(Ao)}`,mt`${pt(Co)}`,mt`${pt(To)}`,mt`${pt(Io)}`,mt`${pt(Oo)}`,mt`${pt(So)}`,mt`${pt(Ro)}`,zo]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===No.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===No.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===No.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=No.DATETIME:"boolean"==typeof this.value?this.type=No.CHECKBOX:"number"==typeof this.value?this.type=No.NUMBER:"string"==typeof this.value?this.type=No.TEXT:this.type=No.JSON),!0}focus(){this.type===No.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),o={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},a=null!==this.value&&void 0!==this.value||!1===this.value;let l=e?j`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case No.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,j`
|
|
263
|
+
`;let Po=class extends Ct{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.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[mt`${pt(vo)}`,mt`${pt(go)}`,mt`${pt(bo)}`,mt`${pt(_o)}`,mt`${pt(xo)}`,mt`${pt(yo)}`,mt`${pt(wo)}`,mt`${pt(ko)}`,mt`${pt(Eo)}`,mt`${pt(Ao)}`,mt`${pt(Co)}`,mt`${pt(To)}`,mt`${pt(Io)}`,mt`${pt(Oo)}`,mt`${pt(So)}`,mt`${pt(Ro)}`,zo]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===No.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===No.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===No.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=No.DATETIME:"boolean"==typeof this.value?this.type=No.CHECKBOX:"number"==typeof this.value?this.type=No.NUMBER:"string"==typeof this.value?this.type=No.TEXT:this.type=No.JSON),!0}focus(){this.type===No.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),o={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},a=null!==this.value&&void 0!==this.value||!1===this.value;let l=e?j`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case No.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,j`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${e?e.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),j`
|
|
266
266
|
<div id="field" class="mdc-form-field">
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
/>
|
|
430
430
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
431
431
|
</div>
|
|
432
|
-
`;case No.NUMBER:case No.RANGE:case No.DATE:case No.DATETIME:case No.TIME:case No.MONTH:case No.WEEK:case No.EMAIL:case No.PASSWORD:case No.TELEPHONE:case No.URL:case No.TEXT:case No.TEXTAREA:case No.JSON:case No.JSON_OBJECT:{let e,c=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(c.some((t=>"string"!=typeof t)))if(this.type===No.JSON||this.type===No.JSON_OBJECT)if(void 0!==c[0]){if("string"!=typeof c[0]||null===c[0])try{c[0]=JSON.stringify(c[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),c[0]=""}}else c[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case No.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case No.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case No.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case No.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case No.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case No.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,c=c.map((t=>void 0!==t?Xe.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let s=this.label,d=this.type,p="component";if(this.type===No.RANGE&&(s=void 0,n=!1,i=!1,d=No.NUMBER,p="number"),this.type!==No.RANGE||!this.disableSliderNumberInput){const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":a,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT?j`
|
|
432
|
+
`;case No.NUMBER:case No.RANGE:case No.DATE:case No.DATETIME:case No.TIME:case No.MONTH:case No.WEEK:case No.EMAIL:case No.PASSWORD:case No.TELEPHONE:case No.URL:case No.TEXT:case No.TEXTAREA:case No.JSON:case No.JSON_OBJECT:{let e,c=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(c.some((t=>"string"!=typeof t)))if(this.type===No.JSON||this.type===No.JSON_OBJECT)if(void 0!==c[0]){if("string"!=typeof c[0]||null===c[0])try{c[0]=JSON.stringify(c[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),c[0]=""}}else c[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case No.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case No.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case No.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case No.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case No.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case No.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,c=c.map((t=>void 0!==t?Xe.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let s=this.label,d=this.type,p="component";if(this.type===No.RANGE&&(s=void 0,n=!1,i=!1,d=No.NUMBER,p="number"),this.type!==No.RANGE||!this.disableSliderNumberInput){this.censored&&(d=No.PASSWORD),this.type===No.PASSWORD&&this.advertised&&(d=No.TEXT);const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":a,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=d===No.TEXTAREA||d===No.JSON||d===No.JSON_OBJECT?j`
|
|
433
433
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
434
434
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${gn(this.minLength)}"
|
|
435
435
|
maxlength="${gn(this.maxLength)}" rows="${this.rows?this.rows:5}"
|
|
@@ -451,6 +451,7 @@
|
|
|
451
451
|
${e}
|
|
452
452
|
${n?this.renderOutlined(l):l}
|
|
453
453
|
${n?"":j`<span class="mdc-line-ripple"></span>`}
|
|
454
|
+
${this.type!==No.PASSWORD||this.censored?"":j`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`}
|
|
454
455
|
${this.iconTrailing?j`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
455
456
|
</label>
|
|
456
457
|
${i||r?j`
|
|
@@ -493,7 +494,7 @@
|
|
|
493
494
|
`:""}
|
|
494
495
|
<span class="mdc-notched-outline__trailing"></span>
|
|
495
496
|
</span>
|
|
496
|
-
`}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!==No.JSON&&this.type!==No.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 No.CHECKBOX:case No.SWITCH:e="on"===e;break;case No.JSON:case No.JSON_OBJECT:case No.NUMBER:case No.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==No.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Ue.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===No.JSON||this.type==No.JSON_OBJECT?Ue.i18next.t("validation.invalidJSON"):Ue.i18next.t("validation.invalidNumber")}break;case No.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Ue.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==No.CHECKBOX_LIST&&e!==a&&(this.type===No.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Lo(this.value,a,n))),null!=this.searchProvider&&this.type===No.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!==No.CHECKBOX_LIST||Xe.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new Lo(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,Ue.i18next.t(e,{defaultValue:Xe.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(", "):""}};fo([Rt({type:Boolean})],Po.prototype,"focused",void 0),fo([Rt()],Po.prototype,"value",void 0),fo([Rt({type:String})],Po.prototype,"type",void 0),fo([Rt({type:String})],Po.prototype,"name",void 0),fo([Rt({type:Boolean})],Po.prototype,"readonly",void 0),fo([Rt({type:Boolean})],Po.prototype,"required",void 0),fo([Rt()],Po.prototype,"max",void 0),fo([Rt()],Po.prototype,"min",void 0),fo([Rt({type:Number})],Po.prototype,"step",void 0),fo([Rt({type:Boolean})],Po.prototype,"checked",void 0),fo([Rt({type:Boolean})],Po.prototype,"indeterminate",void 0),fo([Rt({type:Number})],Po.prototype,"maxLength",void 0),fo([Rt({type:Number})],Po.prototype,"minLength",void 0),fo([Rt({type:Number})],Po.prototype,"rows",void 0),fo([Rt({type:Number})],Po.prototype,"cols",void 0),fo([Rt({type:Boolean})],Po.prototype,"multiple",void 0),fo([Rt({type:String,attribute:!0,reflect:!1})],Po.prototype,"pattern",void 0),fo([Rt({type:String})],Po.prototype,"placeHolder",void 0),fo([Rt({type:Array})],Po.prototype,"options",void 0),fo([Rt({type:Boolean})],Po.prototype,"autoSelect",void 0),fo([Rt({type:Object})],Po.prototype,"searchProvider",void 0),fo([Rt({type:String})],Po.prototype,"searchLabel",void 0),fo([Rt({type:String})],Po.prototype,"icon",void 0),fo([Rt({type:String})],Po.prototype,"iconColor",void 0),fo([Rt({type:String})],Po.prototype,"iconOn",void 0),fo([Rt({type:String})],Po.prototype,"iconTrailing",void 0),fo([Rt({type:Boolean})],Po.prototype,"compact",void 0),fo([Rt({type:Boolean})],Po.prototype,"comfortable",void 0),fo([Rt({type:Boolean})],Po.prototype,"raised",void 0),fo([Rt({type:Boolean})],Po.prototype,"action",void 0),fo([Rt({type:Boolean})],Po.prototype,"unElevated",void 0),fo([Rt({type:Boolean})],Po.prototype,"outlined",void 0),fo([Rt({type:Boolean})],Po.prototype,"rounded",void 0),fo([Rt({type:Object})],Po.prototype,"format",void 0),fo([Rt({type:Boolean})],Po.prototype,"disableSliderNumberInput",void 0),fo([Rt({type:Boolean})],Po.prototype,"fullWidth",void 0),fo([Rt({type:String})],Po.prototype,"helperText",void 0),fo([Rt({type:Boolean})],Po.prototype,"helperPersistent",void 0),fo([Rt({type:String,attribute:!0})],Po.prototype,"validationMessage",void 0),fo([Rt({type:Boolean})],Po.prototype,"autoValidate",void 0),fo([Rt({type:Boolean})],Po.prototype,"charCounter",void 0),fo([Rt({type:String})],Po.prototype,"label",void 0),fo([Rt({type:Boolean})],Po.prototype,"disabled",void 0),fo([Rt({type:Boolean})],Po.prototype,"continuous",void 0),fo([Rt({type:Boolean})],Po.prototype,"resizeVertical",void 0),fo([Lt()],Po.prototype,"isUiValid",void 0),fo([Lt()],Po.prototype,"searchableValue",void 0),fo([Lt()],Po.prototype,"errorMessage",void 0),Po=fo([It("or-mwc-input")],Po);var Mo=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 $o=p(420),Fo=p(568),jo=mt`
|
|
497
|
+
`}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!==No.JSON&&this.type!==No.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 No.CHECKBOX:case No.SWITCH:e="on"===e;break;case No.JSON:case No.JSON_OBJECT:case No.NUMBER:case No.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==No.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Ue.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===No.JSON||this.type==No.JSON_OBJECT?Ue.i18next.t("validation.invalidJSON"):Ue.i18next.t("validation.invalidNumber")}break;case No.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Ue.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==No.CHECKBOX_LIST&&e!==a&&(this.type===No.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Lo(this.value,a,n))),null!=this.searchProvider&&this.type===No.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!==No.CHECKBOX_LIST||Xe.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new Lo(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,Ue.i18next.t(e,{defaultValue:Xe.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(", "):""}};fo([Rt({type:Boolean})],Po.prototype,"focused",void 0),fo([Rt()],Po.prototype,"value",void 0),fo([Rt({type:String})],Po.prototype,"type",void 0),fo([Rt({type:String})],Po.prototype,"name",void 0),fo([Rt({type:Boolean})],Po.prototype,"readonly",void 0),fo([Rt({type:Boolean})],Po.prototype,"required",void 0),fo([Rt()],Po.prototype,"max",void 0),fo([Rt()],Po.prototype,"min",void 0),fo([Rt({type:Number})],Po.prototype,"step",void 0),fo([Rt({type:Boolean})],Po.prototype,"checked",void 0),fo([Rt({type:Boolean})],Po.prototype,"indeterminate",void 0),fo([Rt({type:Number})],Po.prototype,"maxLength",void 0),fo([Rt({type:Number})],Po.prototype,"minLength",void 0),fo([Rt({type:Number})],Po.prototype,"rows",void 0),fo([Rt({type:Number})],Po.prototype,"cols",void 0),fo([Rt({type:Boolean})],Po.prototype,"multiple",void 0),fo([Rt({type:String,attribute:!0,reflect:!1})],Po.prototype,"pattern",void 0),fo([Rt({type:String})],Po.prototype,"placeHolder",void 0),fo([Rt({type:Array})],Po.prototype,"options",void 0),fo([Rt({type:Boolean})],Po.prototype,"autoSelect",void 0),fo([Rt({type:Object})],Po.prototype,"searchProvider",void 0),fo([Rt({type:String})],Po.prototype,"searchLabel",void 0),fo([Rt({type:String})],Po.prototype,"icon",void 0),fo([Rt({type:String})],Po.prototype,"iconColor",void 0),fo([Rt({type:String})],Po.prototype,"iconOn",void 0),fo([Rt({type:String})],Po.prototype,"iconTrailing",void 0),fo([Rt({type:Boolean})],Po.prototype,"compact",void 0),fo([Rt({type:Boolean})],Po.prototype,"comfortable",void 0),fo([Rt({type:Boolean})],Po.prototype,"raised",void 0),fo([Rt({type:Boolean})],Po.prototype,"action",void 0),fo([Rt({type:Boolean})],Po.prototype,"unElevated",void 0),fo([Rt({type:Boolean})],Po.prototype,"outlined",void 0),fo([Rt({type:Boolean})],Po.prototype,"rounded",void 0),fo([Rt({type:Object})],Po.prototype,"format",void 0),fo([Rt({type:Boolean})],Po.prototype,"disableSliderNumberInput",void 0),fo([Rt({type:Boolean})],Po.prototype,"fullWidth",void 0),fo([Rt({type:String})],Po.prototype,"helperText",void 0),fo([Rt({type:Boolean})],Po.prototype,"helperPersistent",void 0),fo([Rt({type:String,attribute:!0})],Po.prototype,"validationMessage",void 0),fo([Rt({type:Boolean})],Po.prototype,"autoValidate",void 0),fo([Rt({type:Boolean})],Po.prototype,"charCounter",void 0),fo([Rt({type:String})],Po.prototype,"label",void 0),fo([Rt({type:Boolean})],Po.prototype,"disabled",void 0),fo([Rt({type:Boolean})],Po.prototype,"continuous",void 0),fo([Rt({type:Boolean})],Po.prototype,"resizeVertical",void 0),fo([Rt({type:Boolean})],Po.prototype,"censored",void 0),fo([Rt({type:Boolean,reflect:!0})],Po.prototype,"advertised",void 0),fo([Lt()],Po.prototype,"isUiValid",void 0),fo([Lt()],Po.prototype,"searchableValue",void 0),fo([Lt()],Po.prototype,"errorMessage",void 0),Po=fo([It("or-mwc-input")],Po);var Mo=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 $o=p(420),Fo=p(568),jo=mt`
|
|
497
498
|
|
|
498
499
|
:host {
|
|
499
500
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${pt(Xe.DefaultColor2)}));
|