@openremote/or-tree-menu 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 Lo=class extends Be{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[Ie`${Te(uo)}`,Ie`${Te(mo)}`,Ie`${Te(po)}`,Ie`${Te(ho)}`,Ie`${Te(fo)}`,Ie`${Te(go)}`,Ie`${Te(bo)}`,Ie`${Te(vo)}`,Ie`${Te(_o)}`,Ie`${Te(xo)}`,Ie`${Te(yo)}`,Ie`${Te(wo)}`,Ie`${Te(ko)}`,Ie`${Te(Ao)}`,Ie`${Te(Eo)}`,Ie`${Te(Co)}`,Oo]}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===Io.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Io.DATETIME:"boolean"==typeof this.value?this.type=Io.CHECKBOX:"number"==typeof this.value?this.type=Io.NUMBER:"string"==typeof this.value?this.type=Io.TEXT:this.type=Io.JSON),!0}focus(){this.type===Io.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?ie`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Io.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,ie`
|
|
263
|
+
`;let Lo=class extends Be{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[Ie`${Te(uo)}`,Ie`${Te(mo)}`,Ie`${Te(po)}`,Ie`${Te(ho)}`,Ie`${Te(fo)}`,Ie`${Te(go)}`,Ie`${Te(bo)}`,Ie`${Te(vo)}`,Ie`${Te(_o)}`,Ie`${Te(xo)}`,Ie`${Te(yo)}`,Ie`${Te(wo)}`,Ie`${Te(ko)}`,Ie`${Te(Ao)}`,Ie`${Te(Eo)}`,Ie`${Te(Co)}`,Oo]}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===Io.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Io.DATETIME:"boolean"==typeof this.value?this.type=Io.CHECKBOX:"number"==typeof this.value?this.type=Io.NUMBER:"string"==typeof this.value?this.type=Io.TEXT:this.type=Io.JSON),!0}focus(){this.type===Io.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?ie`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Io.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,ie`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${e?e.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),ie`
|
|
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 Io.NUMBER:case Io.RANGE:case Io.DATE:case Io.DATETIME:case Io.TIME:case Io.MONTH:case Io.WEEK:case Io.EMAIL:case Io.PASSWORD:case Io.TELEPHONE:case Io.URL:case Io.TEXT:case Io.TEXTAREA:case Io.JSON:case Io.JSON_OBJECT:{let e,d=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(d.some((t=>"string"!=typeof t)))if(this.type===Io.JSON||this.type===Io.JSON_OBJECT)if(void 0!==d[0]){if("string"!=typeof d[0]||null===d[0])try{d[0]=JSON.stringify(d[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),d[0]=""}}else d[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Io.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Io.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Io.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Io.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Io.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Io.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,d=d.map((t=>void 0!==t?Gr.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let c=this.label,s=this.type,m="component";if(this.type===Io.RANGE&&(c=void 0,n=!1,i=!1,s=Io.NUMBER,m="number"),this.type!==Io.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":s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(s===Io.TEXTAREA||s===Io.JSON||s===Io.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=s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT?ie`
|
|
432
|
+
`;case Io.NUMBER:case Io.RANGE:case Io.DATE:case Io.DATETIME:case Io.TIME:case Io.MONTH:case Io.WEEK:case Io.EMAIL:case Io.PASSWORD:case Io.TELEPHONE:case Io.URL:case Io.TEXT:case Io.TEXTAREA:case Io.JSON:case Io.JSON_OBJECT:{let e,d=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(d.some((t=>"string"!=typeof t)))if(this.type===Io.JSON||this.type===Io.JSON_OBJECT)if(void 0!==d[0]){if("string"!=typeof d[0]||null===d[0])try{d[0]=JSON.stringify(d[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),d[0]=""}}else d[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Io.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Io.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Io.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Io.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Io.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Io.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,d=d.map((t=>void 0!==t?Gr.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let c=this.label,s=this.type,m="component";if(this.type===Io.RANGE&&(c=void 0,n=!1,i=!1,s=Io.NUMBER,m="number"),this.type!==Io.RANGE||!this.disableSliderNumberInput){this.censored&&(s=Io.PASSWORD),this.type===Io.PASSWORD&&this.advertised&&(s=Io.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":s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(s===Io.TEXTAREA||s===Io.JSON||s===Io.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=s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT?ie`
|
|
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="${mn(this.minLength)}"
|
|
435
435
|
maxlength="${mn(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?"":ie`<span class="mdc-line-ripple"></span>`}
|
|
454
|
+
${this.type!==Io.PASSWORD||this.censored?"":ie`<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?ie`<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?ie`
|
|
@@ -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!==Io.JSON&&this.type!==Io.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 Io.CHECKBOX:case Io.SWITCH:e="on"===e;break;case Io.JSON:case Io.JSON_OBJECT:case Io.NUMBER:case Io.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Io.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Jr.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Io.JSON||this.type==Io.JSON_OBJECT?Jr.i18next.t("validation.invalidJSON"):Jr.i18next.t("validation.invalidNumber")}break;case Io.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Jr.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Io.CHECKBOX_LIST&&e!==a&&(this.type===Io.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new To(this.value,a,n))),null!=this.searchProvider&&this.type===Io.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!==Io.CHECKBOX_LIST||Gr.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new To(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,Jr.i18next.t(e,{defaultValue:Gr.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(", "):""}};co([Ge({type:Boolean})],Lo.prototype,"focused",void 0),co([Ge()],Lo.prototype,"value",void 0),co([Ge({type:String})],Lo.prototype,"type",void 0),co([Ge({type:String})],Lo.prototype,"name",void 0),co([Ge({type:Boolean})],Lo.prototype,"readonly",void 0),co([Ge({type:Boolean})],Lo.prototype,"required",void 0),co([Ge()],Lo.prototype,"max",void 0),co([Ge()],Lo.prototype,"min",void 0),co([Ge({type:Number})],Lo.prototype,"step",void 0),co([Ge({type:Boolean})],Lo.prototype,"checked",void 0),co([Ge({type:Boolean})],Lo.prototype,"indeterminate",void 0),co([Ge({type:Number})],Lo.prototype,"maxLength",void 0),co([Ge({type:Number})],Lo.prototype,"minLength",void 0),co([Ge({type:Number})],Lo.prototype,"rows",void 0),co([Ge({type:Number})],Lo.prototype,"cols",void 0),co([Ge({type:Boolean})],Lo.prototype,"multiple",void 0),co([Ge({type:String,attribute:!0,reflect:!1})],Lo.prototype,"pattern",void 0),co([Ge({type:String})],Lo.prototype,"placeHolder",void 0),co([Ge({type:Array})],Lo.prototype,"options",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoSelect",void 0),co([Ge({type:Object})],Lo.prototype,"searchProvider",void 0),co([Ge({type:String})],Lo.prototype,"searchLabel",void 0),co([Ge({type:String})],Lo.prototype,"icon",void 0),co([Ge({type:String})],Lo.prototype,"iconColor",void 0),co([Ge({type:String})],Lo.prototype,"iconOn",void 0),co([Ge({type:String})],Lo.prototype,"iconTrailing",void 0),co([Ge({type:Boolean})],Lo.prototype,"compact",void 0),co([Ge({type:Boolean})],Lo.prototype,"comfortable",void 0),co([Ge({type:Boolean})],Lo.prototype,"raised",void 0),co([Ge({type:Boolean})],Lo.prototype,"action",void 0),co([Ge({type:Boolean})],Lo.prototype,"unElevated",void 0),co([Ge({type:Boolean})],Lo.prototype,"outlined",void 0),co([Ge({type:Boolean})],Lo.prototype,"rounded",void 0),co([Ge({type:Object})],Lo.prototype,"format",void 0),co([Ge({type:Boolean})],Lo.prototype,"disableSliderNumberInput",void 0),co([Ge({type:Boolean})],Lo.prototype,"fullWidth",void 0),co([Ge({type:String})],Lo.prototype,"helperText",void 0),co([Ge({type:Boolean})],Lo.prototype,"helperPersistent",void 0),co([Ge({type:String,attribute:!0})],Lo.prototype,"validationMessage",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoValidate",void 0),co([Ge({type:Boolean})],Lo.prototype,"charCounter",void 0),co([Ge({type:String})],Lo.prototype,"label",void 0),co([Ge({type:Boolean})],Lo.prototype,"disabled",void 0),co([Ge({type:Boolean})],Lo.prototype,"continuous",void 0),co([Ge({type:Boolean})],Lo.prototype,"resizeVertical",void 0),co([qe()],Lo.prototype,"isUiValid",void 0),co([qe()],Lo.prototype,"searchableValue",void 0),co([qe()],Lo.prototype,"errorMessage",void 0),Lo=co([Xe("or-mwc-input")],Lo);var Ro=o(744),No=o(512),zo=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 Do=o(48);class $o extends CustomEvent{constructor(t){super($o.NAME,{detail:t,bubbles:!0,composed:!0})}}$o.NAME="or-mwc-menu-changed";class Mo extends CustomEvent{constructor(){super(Mo.NAME,{bubbles:!0,composed:!0})}}Mo.NAME="or-mwc-menu-closed";const Po=Ie`
|
|
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!==Io.JSON&&this.type!==Io.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 Io.CHECKBOX:case Io.SWITCH:e="on"===e;break;case Io.JSON:case Io.JSON_OBJECT:case Io.NUMBER:case Io.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Io.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Jr.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Io.JSON||this.type==Io.JSON_OBJECT?Jr.i18next.t("validation.invalidJSON"):Jr.i18next.t("validation.invalidNumber")}break;case Io.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Jr.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Io.CHECKBOX_LIST&&e!==a&&(this.type===Io.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new To(this.value,a,n))),null!=this.searchProvider&&this.type===Io.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!==Io.CHECKBOX_LIST||Gr.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new To(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,Jr.i18next.t(e,{defaultValue:Gr.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(", "):""}};co([Ge({type:Boolean})],Lo.prototype,"focused",void 0),co([Ge()],Lo.prototype,"value",void 0),co([Ge({type:String})],Lo.prototype,"type",void 0),co([Ge({type:String})],Lo.prototype,"name",void 0),co([Ge({type:Boolean})],Lo.prototype,"readonly",void 0),co([Ge({type:Boolean})],Lo.prototype,"required",void 0),co([Ge()],Lo.prototype,"max",void 0),co([Ge()],Lo.prototype,"min",void 0),co([Ge({type:Number})],Lo.prototype,"step",void 0),co([Ge({type:Boolean})],Lo.prototype,"checked",void 0),co([Ge({type:Boolean})],Lo.prototype,"indeterminate",void 0),co([Ge({type:Number})],Lo.prototype,"maxLength",void 0),co([Ge({type:Number})],Lo.prototype,"minLength",void 0),co([Ge({type:Number})],Lo.prototype,"rows",void 0),co([Ge({type:Number})],Lo.prototype,"cols",void 0),co([Ge({type:Boolean})],Lo.prototype,"multiple",void 0),co([Ge({type:String,attribute:!0,reflect:!1})],Lo.prototype,"pattern",void 0),co([Ge({type:String})],Lo.prototype,"placeHolder",void 0),co([Ge({type:Array})],Lo.prototype,"options",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoSelect",void 0),co([Ge({type:Object})],Lo.prototype,"searchProvider",void 0),co([Ge({type:String})],Lo.prototype,"searchLabel",void 0),co([Ge({type:String})],Lo.prototype,"icon",void 0),co([Ge({type:String})],Lo.prototype,"iconColor",void 0),co([Ge({type:String})],Lo.prototype,"iconOn",void 0),co([Ge({type:String})],Lo.prototype,"iconTrailing",void 0),co([Ge({type:Boolean})],Lo.prototype,"compact",void 0),co([Ge({type:Boolean})],Lo.prototype,"comfortable",void 0),co([Ge({type:Boolean})],Lo.prototype,"raised",void 0),co([Ge({type:Boolean})],Lo.prototype,"action",void 0),co([Ge({type:Boolean})],Lo.prototype,"unElevated",void 0),co([Ge({type:Boolean})],Lo.prototype,"outlined",void 0),co([Ge({type:Boolean})],Lo.prototype,"rounded",void 0),co([Ge({type:Object})],Lo.prototype,"format",void 0),co([Ge({type:Boolean})],Lo.prototype,"disableSliderNumberInput",void 0),co([Ge({type:Boolean})],Lo.prototype,"fullWidth",void 0),co([Ge({type:String})],Lo.prototype,"helperText",void 0),co([Ge({type:Boolean})],Lo.prototype,"helperPersistent",void 0),co([Ge({type:String,attribute:!0})],Lo.prototype,"validationMessage",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoValidate",void 0),co([Ge({type:Boolean})],Lo.prototype,"charCounter",void 0),co([Ge({type:String})],Lo.prototype,"label",void 0),co([Ge({type:Boolean})],Lo.prototype,"disabled",void 0),co([Ge({type:Boolean})],Lo.prototype,"continuous",void 0),co([Ge({type:Boolean})],Lo.prototype,"resizeVertical",void 0),co([Ge({type:Boolean})],Lo.prototype,"censored",void 0),co([Ge({type:Boolean,reflect:!0})],Lo.prototype,"advertised",void 0),co([qe()],Lo.prototype,"isUiValid",void 0),co([qe()],Lo.prototype,"searchableValue",void 0),co([qe()],Lo.prototype,"errorMessage",void 0),Lo=co([Xe("or-mwc-input")],Lo);var Ro=o(744),No=o(512),zo=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 Do=o(48);class $o extends CustomEvent{constructor(t){super($o.NAME,{detail:t,bubbles:!0,composed:!0})}}$o.NAME="or-mwc-menu-changed";class Mo extends CustomEvent{constructor(){super(Mo.NAME,{bubbles:!0,composed:!0})}}Mo.NAME="or-mwc-menu-closed";const Po=Ie`
|
|
497
498
|
:host {
|
|
498
499
|
white-space: nowrap;
|
|
499
500
|
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${Te(Gr.DefaultColor4)}));
|
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 Lo=class extends Be{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[Ie`${Te(uo)}`,Ie`${Te(mo)}`,Ie`${Te(po)}`,Ie`${Te(ho)}`,Ie`${Te(fo)}`,Ie`${Te(go)}`,Ie`${Te(bo)}`,Ie`${Te(vo)}`,Ie`${Te(_o)}`,Ie`${Te(xo)}`,Ie`${Te(yo)}`,Ie`${Te(wo)}`,Ie`${Te(ko)}`,Ie`${Te(Ao)}`,Ie`${Te(Eo)}`,Ie`${Te(Co)}`,Oo]}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===Io.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Io.DATETIME:"boolean"==typeof this.value?this.type=Io.CHECKBOX:"number"==typeof this.value?this.type=Io.NUMBER:"string"==typeof this.value?this.type=Io.TEXT:this.type=Io.JSON),!0}focus(){this.type===Io.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?ie`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Io.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,ie`
|
|
263
|
+
`;let Lo=class extends Be{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[Ie`${Te(uo)}`,Ie`${Te(mo)}`,Ie`${Te(po)}`,Ie`${Te(ho)}`,Ie`${Te(fo)}`,Ie`${Te(go)}`,Ie`${Te(bo)}`,Ie`${Te(vo)}`,Ie`${Te(_o)}`,Ie`${Te(xo)}`,Ie`${Te(yo)}`,Ie`${Te(wo)}`,Ie`${Te(ko)}`,Ie`${Te(Ao)}`,Ie`${Te(Eo)}`,Ie`${Te(Co)}`,Oo]}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===Io.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Io.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Io.DATETIME:"boolean"==typeof this.value?this.type=Io.CHECKBOX:"number"==typeof this.value?this.type=Io.NUMBER:"string"==typeof this.value?this.type=Io.TEXT:this.type=Io.JSON),!0}focus(){this.type===Io.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?ie`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Io.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,ie`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${e?e.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),ie`
|
|
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 Io.NUMBER:case Io.RANGE:case Io.DATE:case Io.DATETIME:case Io.TIME:case Io.MONTH:case Io.WEEK:case Io.EMAIL:case Io.PASSWORD:case Io.TELEPHONE:case Io.URL:case Io.TEXT:case Io.TEXTAREA:case Io.JSON:case Io.JSON_OBJECT:{let e,d=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(d.some((t=>"string"!=typeof t)))if(this.type===Io.JSON||this.type===Io.JSON_OBJECT)if(void 0!==d[0]){if("string"!=typeof d[0]||null===d[0])try{d[0]=JSON.stringify(d[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),d[0]=""}}else d[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Io.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Io.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Io.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Io.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Io.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Io.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,d=d.map((t=>void 0!==t?Gr.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let c=this.label,s=this.type,m="component";if(this.type===Io.RANGE&&(c=void 0,n=!1,i=!1,s=Io.NUMBER,m="number"),this.type!==Io.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":s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(s===Io.TEXTAREA||s===Io.JSON||s===Io.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=s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT?ie`
|
|
432
|
+
`;case Io.NUMBER:case Io.RANGE:case Io.DATE:case Io.DATETIME:case Io.TIME:case Io.MONTH:case Io.WEEK:case Io.EMAIL:case Io.PASSWORD:case Io.TELEPHONE:case Io.URL:case Io.TEXT:case Io.TEXTAREA:case Io.JSON:case Io.JSON_OBJECT:{let e,d=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(d.some((t=>"string"!=typeof t)))if(this.type===Io.JSON||this.type===Io.JSON_OBJECT)if(void 0!==d[0]){if("string"!=typeof d[0]||null===d[0])try{d[0]=JSON.stringify(d[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),d[0]=""}}else d[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Io.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Io.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Io.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Io.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Io.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Io.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,d=d.map((t=>void 0!==t?Gr.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let c=this.label,s=this.type,m="component";if(this.type===Io.RANGE&&(c=void 0,n=!1,i=!1,s=Io.NUMBER,m="number"),this.type!==Io.RANGE||!this.disableSliderNumberInput){this.censored&&(s=Io.PASSWORD),this.type===Io.PASSWORD&&this.advertised&&(s=Io.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":s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(s===Io.TEXTAREA||s===Io.JSON||s===Io.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=s===Io.TEXTAREA||s===Io.JSON||s===Io.JSON_OBJECT?ie`
|
|
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="${mn(this.minLength)}"
|
|
435
435
|
maxlength="${mn(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?"":ie`<span class="mdc-line-ripple"></span>`}
|
|
454
|
+
${this.type!==Io.PASSWORD||this.censored?"":ie`<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?ie`<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?ie`
|
|
@@ -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!==Io.JSON&&this.type!==Io.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 Io.CHECKBOX:case Io.SWITCH:e="on"===e;break;case Io.JSON:case Io.JSON_OBJECT:case Io.NUMBER:case Io.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Io.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Jr.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Io.JSON||this.type==Io.JSON_OBJECT?Jr.i18next.t("validation.invalidJSON"):Jr.i18next.t("validation.invalidNumber")}break;case Io.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Jr.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Io.CHECKBOX_LIST&&e!==a&&(this.type===Io.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new To(this.value,a,n))),null!=this.searchProvider&&this.type===Io.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!==Io.CHECKBOX_LIST||Gr.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new To(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,Jr.i18next.t(e,{defaultValue:Gr.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(", "):""}};co([Ge({type:Boolean})],Lo.prototype,"focused",void 0),co([Ge()],Lo.prototype,"value",void 0),co([Ge({type:String})],Lo.prototype,"type",void 0),co([Ge({type:String})],Lo.prototype,"name",void 0),co([Ge({type:Boolean})],Lo.prototype,"readonly",void 0),co([Ge({type:Boolean})],Lo.prototype,"required",void 0),co([Ge()],Lo.prototype,"max",void 0),co([Ge()],Lo.prototype,"min",void 0),co([Ge({type:Number})],Lo.prototype,"step",void 0),co([Ge({type:Boolean})],Lo.prototype,"checked",void 0),co([Ge({type:Boolean})],Lo.prototype,"indeterminate",void 0),co([Ge({type:Number})],Lo.prototype,"maxLength",void 0),co([Ge({type:Number})],Lo.prototype,"minLength",void 0),co([Ge({type:Number})],Lo.prototype,"rows",void 0),co([Ge({type:Number})],Lo.prototype,"cols",void 0),co([Ge({type:Boolean})],Lo.prototype,"multiple",void 0),co([Ge({type:String,attribute:!0,reflect:!1})],Lo.prototype,"pattern",void 0),co([Ge({type:String})],Lo.prototype,"placeHolder",void 0),co([Ge({type:Array})],Lo.prototype,"options",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoSelect",void 0),co([Ge({type:Object})],Lo.prototype,"searchProvider",void 0),co([Ge({type:String})],Lo.prototype,"searchLabel",void 0),co([Ge({type:String})],Lo.prototype,"icon",void 0),co([Ge({type:String})],Lo.prototype,"iconColor",void 0),co([Ge({type:String})],Lo.prototype,"iconOn",void 0),co([Ge({type:String})],Lo.prototype,"iconTrailing",void 0),co([Ge({type:Boolean})],Lo.prototype,"compact",void 0),co([Ge({type:Boolean})],Lo.prototype,"comfortable",void 0),co([Ge({type:Boolean})],Lo.prototype,"raised",void 0),co([Ge({type:Boolean})],Lo.prototype,"action",void 0),co([Ge({type:Boolean})],Lo.prototype,"unElevated",void 0),co([Ge({type:Boolean})],Lo.prototype,"outlined",void 0),co([Ge({type:Boolean})],Lo.prototype,"rounded",void 0),co([Ge({type:Object})],Lo.prototype,"format",void 0),co([Ge({type:Boolean})],Lo.prototype,"disableSliderNumberInput",void 0),co([Ge({type:Boolean})],Lo.prototype,"fullWidth",void 0),co([Ge({type:String})],Lo.prototype,"helperText",void 0),co([Ge({type:Boolean})],Lo.prototype,"helperPersistent",void 0),co([Ge({type:String,attribute:!0})],Lo.prototype,"validationMessage",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoValidate",void 0),co([Ge({type:Boolean})],Lo.prototype,"charCounter",void 0),co([Ge({type:String})],Lo.prototype,"label",void 0),co([Ge({type:Boolean})],Lo.prototype,"disabled",void 0),co([Ge({type:Boolean})],Lo.prototype,"continuous",void 0),co([Ge({type:Boolean})],Lo.prototype,"resizeVertical",void 0),co([qe()],Lo.prototype,"isUiValid",void 0),co([qe()],Lo.prototype,"searchableValue",void 0),co([qe()],Lo.prototype,"errorMessage",void 0),Lo=co([Xe("or-mwc-input")],Lo);var Ro=o(744),No=o(512),zo=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 Do=o(48);class $o extends CustomEvent{constructor(t){super($o.NAME,{detail:t,bubbles:!0,composed:!0})}}$o.NAME="or-mwc-menu-changed";class Mo extends CustomEvent{constructor(){super(Mo.NAME,{bubbles:!0,composed:!0})}}Mo.NAME="or-mwc-menu-closed";const Po=Ie`
|
|
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!==Io.JSON&&this.type!==Io.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 Io.CHECKBOX:case Io.SWITCH:e="on"===e;break;case Io.JSON:case Io.JSON_OBJECT:case Io.NUMBER:case Io.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Io.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=Jr.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Io.JSON||this.type==Io.JSON_OBJECT?Jr.i18next.t("validation.invalidJSON"):Jr.i18next.t("validation.invalidNumber")}break;case Io.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=Jr.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Io.CHECKBOX_LIST&&e!==a&&(this.type===Io.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new To(this.value,a,n))),null!=this.searchProvider&&this.type===Io.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!==Io.CHECKBOX_LIST||Gr.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new To(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,Jr.i18next.t(e,{defaultValue:Gr.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(", "):""}};co([Ge({type:Boolean})],Lo.prototype,"focused",void 0),co([Ge()],Lo.prototype,"value",void 0),co([Ge({type:String})],Lo.prototype,"type",void 0),co([Ge({type:String})],Lo.prototype,"name",void 0),co([Ge({type:Boolean})],Lo.prototype,"readonly",void 0),co([Ge({type:Boolean})],Lo.prototype,"required",void 0),co([Ge()],Lo.prototype,"max",void 0),co([Ge()],Lo.prototype,"min",void 0),co([Ge({type:Number})],Lo.prototype,"step",void 0),co([Ge({type:Boolean})],Lo.prototype,"checked",void 0),co([Ge({type:Boolean})],Lo.prototype,"indeterminate",void 0),co([Ge({type:Number})],Lo.prototype,"maxLength",void 0),co([Ge({type:Number})],Lo.prototype,"minLength",void 0),co([Ge({type:Number})],Lo.prototype,"rows",void 0),co([Ge({type:Number})],Lo.prototype,"cols",void 0),co([Ge({type:Boolean})],Lo.prototype,"multiple",void 0),co([Ge({type:String,attribute:!0,reflect:!1})],Lo.prototype,"pattern",void 0),co([Ge({type:String})],Lo.prototype,"placeHolder",void 0),co([Ge({type:Array})],Lo.prototype,"options",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoSelect",void 0),co([Ge({type:Object})],Lo.prototype,"searchProvider",void 0),co([Ge({type:String})],Lo.prototype,"searchLabel",void 0),co([Ge({type:String})],Lo.prototype,"icon",void 0),co([Ge({type:String})],Lo.prototype,"iconColor",void 0),co([Ge({type:String})],Lo.prototype,"iconOn",void 0),co([Ge({type:String})],Lo.prototype,"iconTrailing",void 0),co([Ge({type:Boolean})],Lo.prototype,"compact",void 0),co([Ge({type:Boolean})],Lo.prototype,"comfortable",void 0),co([Ge({type:Boolean})],Lo.prototype,"raised",void 0),co([Ge({type:Boolean})],Lo.prototype,"action",void 0),co([Ge({type:Boolean})],Lo.prototype,"unElevated",void 0),co([Ge({type:Boolean})],Lo.prototype,"outlined",void 0),co([Ge({type:Boolean})],Lo.prototype,"rounded",void 0),co([Ge({type:Object})],Lo.prototype,"format",void 0),co([Ge({type:Boolean})],Lo.prototype,"disableSliderNumberInput",void 0),co([Ge({type:Boolean})],Lo.prototype,"fullWidth",void 0),co([Ge({type:String})],Lo.prototype,"helperText",void 0),co([Ge({type:Boolean})],Lo.prototype,"helperPersistent",void 0),co([Ge({type:String,attribute:!0})],Lo.prototype,"validationMessage",void 0),co([Ge({type:Boolean})],Lo.prototype,"autoValidate",void 0),co([Ge({type:Boolean})],Lo.prototype,"charCounter",void 0),co([Ge({type:String})],Lo.prototype,"label",void 0),co([Ge({type:Boolean})],Lo.prototype,"disabled",void 0),co([Ge({type:Boolean})],Lo.prototype,"continuous",void 0),co([Ge({type:Boolean})],Lo.prototype,"resizeVertical",void 0),co([Ge({type:Boolean})],Lo.prototype,"censored",void 0),co([Ge({type:Boolean,reflect:!0})],Lo.prototype,"advertised",void 0),co([qe()],Lo.prototype,"isUiValid",void 0),co([qe()],Lo.prototype,"searchableValue",void 0),co([qe()],Lo.prototype,"errorMessage",void 0),Lo=co([Xe("or-mwc-input")],Lo);var Ro=o(744),No=o(512),zo=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 Do=o(48);class $o extends CustomEvent{constructor(t){super($o.NAME,{detail:t,bubbles:!0,composed:!0})}}$o.NAME="or-mwc-menu-changed";class Mo extends CustomEvent{constructor(){super(Mo.NAME,{bubbles:!0,composed:!0})}}Mo.NAME="or-mwc-menu-closed";const Po=Ie`
|
|
497
498
|
:host {
|
|
498
499
|
white-space: nowrap;
|
|
499
500
|
--internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${Te(Gr.DefaultColor4)}));
|