@openremote/or-map 1.7.0-snapshot.20250605141506 → 1.7.0-snapshot.20250611105753
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
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
.mdc-list-item__graphic > or-icon {
|
|
564
564
|
pointer-events: none;
|
|
565
565
|
}
|
|
566
|
-
`;let uo=class extends Ut{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[Tt`${At(Gr)}`,Tt`${At(Hr)}`,Tt`${At(jr)}`,Tt`${At(Xr)}`,Tt`${At(Zr)}`,Tt`${At(Wr)}`,Tt`${At(Yr)}`,Tt`${At(Kr)}`,Tt`${At(Jr)}`,Tt`${At(Qr)}`,Tt`${At(to)}`,Tt`${At(eo)}`,Tt`${At(no)}`,Tt`${At(ro)}`,Tt`${At(io)}`,Tt`${At(oo)}`,co]}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===so.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===so.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===so.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=so.DATETIME:"boolean"==typeof this.value?this.type=so.CHECKBOX:"number"==typeof this.value?this.type=so.NUMBER:"string"==typeof this.value?this.type=so.TEXT:this.type=so.JSON),!0}focus(){this.type===so.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const n=!this.fullWidth&&this.label;let i=!this.fullWidth&&this.outlined,r=!!this.helperText;const o=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!o&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":o},s=null!==this.value&&void 0!==this.value||!1===this.value;let l=n?nt`<span class="mdc-floating-label ${s?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case so.RADIO:const n=this.resolveOptions(this.options);return this._selectedIndex=-1,nt`
|
|
566
|
+
`;let uo=class extends Ut{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[Tt`${At(Gr)}`,Tt`${At(Hr)}`,Tt`${At(jr)}`,Tt`${At(Xr)}`,Tt`${At(Zr)}`,Tt`${At(Wr)}`,Tt`${At(Yr)}`,Tt`${At(Kr)}`,Tt`${At(Jr)}`,Tt`${At(Qr)}`,Tt`${At(to)}`,Tt`${At(eo)}`,Tt`${At(no)}`,Tt`${At(ro)}`,Tt`${At(io)}`,Tt`${At(oo)}`,co]}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===so.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===so.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===so.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=so.DATETIME:"boolean"==typeof this.value?this.type=so.CHECKBOX:"number"==typeof this.value?this.type=so.NUMBER:"string"==typeof this.value?this.type=so.TEXT:this.type=so.JSON),!0}focus(){this.type===so.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const n=!this.fullWidth&&this.label;let i=!this.fullWidth&&this.outlined,r=!!this.helperText;const o=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!o&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":o},s=null!==this.value&&void 0!==this.value||!1===this.value;let l=n?nt`<span class="mdc-floating-label ${s?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case so.RADIO:const n=this.resolveOptions(this.options);return this._selectedIndex=-1,nt`
|
|
567
567
|
<div class="mdc-radio-container">
|
|
568
568
|
${n?n.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),nt`
|
|
569
569
|
<div id="field" class="mdc-form-field">
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
/>
|
|
733
733
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
734
734
|
</div>
|
|
735
|
-
`;case so.NUMBER:case so.RANGE:case so.DATE:case so.DATETIME:case so.TIME:case so.MONTH:case so.WEEK:case so.EMAIL:case so.PASSWORD:case so.TELEPHONE:case so.URL:case so.TEXT:case so.TEXTAREA:case so.JSON:case so.JSON_OBJECT:{let n,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===so.JSON||this.type===so.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 n=this.format?Object.assign({},this.format):{};switch(this.type){case so.TIME:n.asDate=!0,n.hour12=!1,n.timeStyle=this.step&&this.step<60?"medium":"short";break;case so.DATE:n.asDate=!0,n.momentJsFormat="YYYY-MM-DD";break;case so.WEEK:n.asDate=!0,n.momentJsFormat="YYYY-[W]WW";break;case so.MONTH:n.asDate=!0,n.momentJsFormat="YYYY-MM";break;case so.DATETIME:n.asDate=!0,n.momentJsFormat="YYYY-MM-DDTHH:mm";break;case so.NUMBER:null!==(t=n.maximumFractionDigits)&&void 0!==t||(n.maximumFractionDigits=20)}n.useGrouping=!1,c=c.map((t=>void 0!==t?e.Util.getValueAsString(t,(()=>n),"en-GB"):void 0))}let d=this.label,u=this.type,h="component";if(this.type===so.RANGE&&(d=void 0,i=!1,r=!1,u=so.NUMBER,h="number"),this.type!==so.RANGE||!this.disableSliderNumberInput){const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!i,"mdc-text-field--outlined":i,"mdc-text-field--textarea":u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!i,"dense-comfortable":this.comfortable&&!(u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":s,"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};n=u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT?nt`
|
|
735
|
+
`;case so.NUMBER:case so.RANGE:case so.DATE:case so.DATETIME:case so.TIME:case so.MONTH:case so.WEEK:case so.EMAIL:case so.PASSWORD:case so.TELEPHONE:case so.URL:case so.TEXT:case so.TEXTAREA:case so.JSON:case so.JSON_OBJECT:{let n,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===so.JSON||this.type===so.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 n=this.format?Object.assign({},this.format):{};switch(this.type){case so.TIME:n.asDate=!0,n.hour12=!1,n.timeStyle=this.step&&this.step<60?"medium":"short";break;case so.DATE:n.asDate=!0,n.momentJsFormat="YYYY-MM-DD";break;case so.WEEK:n.asDate=!0,n.momentJsFormat="YYYY-[W]WW";break;case so.MONTH:n.asDate=!0,n.momentJsFormat="YYYY-MM";break;case so.DATETIME:n.asDate=!0,n.momentJsFormat="YYYY-MM-DDTHH:mm";break;case so.NUMBER:null!==(t=n.maximumFractionDigits)&&void 0!==t||(n.maximumFractionDigits=20)}n.useGrouping=!1,c=c.map((t=>void 0!==t?e.Util.getValueAsString(t,(()=>n),"en-GB"):void 0))}let d=this.label,u=this.type,h="component";if(this.type===so.RANGE&&(d=void 0,i=!1,r=!1,u=so.NUMBER,h="number"),this.type!==so.RANGE||!this.disableSliderNumberInput){this.censored&&(u=so.PASSWORD),this.type===so.PASSWORD&&this.advertised&&(u=so.TEXT);const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!i,"mdc-text-field--outlined":i,"mdc-text-field--textarea":u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!i,"dense-comfortable":this.comfortable&&!(u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":s,"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};n=u===so.TEXTAREA||u===so.JSON||u===so.JSON_OBJECT?nt`
|
|
736
736
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
737
737
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${He(this.minLength)}"
|
|
738
738
|
maxlength="${He(this.maxLength)}" rows="${this.rows?this.rows:5}"
|
|
@@ -754,6 +754,7 @@
|
|
|
754
754
|
${n}
|
|
755
755
|
${i?this.renderOutlined(l):l}
|
|
756
756
|
${i?"":nt`<span class="mdc-line-ripple"></span>`}
|
|
757
|
+
${this.type!==so.PASSWORD||this.censored?"":nt`<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>`}
|
|
757
758
|
${this.iconTrailing?nt`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
758
759
|
</label>
|
|
759
760
|
${r||o?nt`
|
|
@@ -796,7 +797,7 @@
|
|
|
796
797
|
`:""}
|
|
797
798
|
<span class="mdc-notched-outline__trailing"></span>
|
|
798
799
|
</span>
|
|
799
|
-
`}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!==so.JSON&&this.type!==so.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,n,i){var r,o;let a,s=this.value;if("undefined"===n&&(s=null,n=void 0),"null"===n&&(s=void 0,n=null),"string"==typeof n)switch(this.type){case so.CHECKBOX:case so.SWITCH:n="on"===n;break;case so.JSON:case so.JSON_OBJECT:case so.NUMBER:case so.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type!==so.JSON_OBJECT||"object"==typeof n&&!Array.isArray(n)||(n=this.value,a=Lr.i18next.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===so.JSON||this.type==so.JSON_OBJECT?Lr.i18next.t("validation.invalidJSON"):Lr.i18next.t("validation.invalidNumber")}break;case so.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=Lr.i18next.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==so.CHECKBOX_LIST&&n!==s&&(this.type===so.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new ao(this.value,s,i))),null!=this.searchProvider&&this.type===so.SELECT){const t=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("select-searchable"))||void 0===o?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==so.CHECKBOX_LIST||e.Util.objectsEqual(n,s,!0)||this.dispatchEvent(new ao(n,s,i))}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 n;return t&&t.length>0&&(n=t.map((t=>{if(Array.isArray(t))return t;{const n=""+t;return[t,Lr.i18next.t(n,{defaultValue:e.Util.camelCaseToSentenceCase(n)})]}}))),n}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(", "):""}};$r([Gt({type:Boolean})],uo.prototype,"focused",void 0),$r([Gt()],uo.prototype,"value",void 0),$r([Gt({type:String})],uo.prototype,"type",void 0),$r([Gt({type:String})],uo.prototype,"name",void 0),$r([Gt({type:Boolean})],uo.prototype,"readonly",void 0),$r([Gt({type:Boolean})],uo.prototype,"required",void 0),$r([Gt()],uo.prototype,"max",void 0),$r([Gt()],uo.prototype,"min",void 0),$r([Gt({type:Number})],uo.prototype,"step",void 0),$r([Gt({type:Boolean})],uo.prototype,"checked",void 0),$r([Gt({type:Boolean})],uo.prototype,"indeterminate",void 0),$r([Gt({type:Number})],uo.prototype,"maxLength",void 0),$r([Gt({type:Number})],uo.prototype,"minLength",void 0),$r([Gt({type:Number})],uo.prototype,"rows",void 0),$r([Gt({type:Number})],uo.prototype,"cols",void 0),$r([Gt({type:Boolean})],uo.prototype,"multiple",void 0),$r([Gt({type:String,attribute:!0,reflect:!1})],uo.prototype,"pattern",void 0),$r([Gt({type:String})],uo.prototype,"placeHolder",void 0),$r([Gt({type:Array})],uo.prototype,"options",void 0),$r([Gt({type:Boolean})],uo.prototype,"autoSelect",void 0),$r([Gt({type:Object})],uo.prototype,"searchProvider",void 0),$r([Gt({type:String})],uo.prototype,"searchLabel",void 0),$r([Gt({type:String})],uo.prototype,"icon",void 0),$r([Gt({type:String})],uo.prototype,"iconColor",void 0),$r([Gt({type:String})],uo.prototype,"iconOn",void 0),$r([Gt({type:String})],uo.prototype,"iconTrailing",void 0),$r([Gt({type:Boolean})],uo.prototype,"compact",void 0),$r([Gt({type:Boolean})],uo.prototype,"comfortable",void 0),$r([Gt({type:Boolean})],uo.prototype,"raised",void 0),$r([Gt({type:Boolean})],uo.prototype,"action",void 0),$r([Gt({type:Boolean})],uo.prototype,"unElevated",void 0),$r([Gt({type:Boolean})],uo.prototype,"outlined",void 0),$r([Gt({type:Boolean})],uo.prototype,"rounded",void 0),$r([Gt({type:Object})],uo.prototype,"format",void 0),$r([Gt({type:Boolean})],uo.prototype,"disableSliderNumberInput",void 0),$r([Gt({type:Boolean})],uo.prototype,"fullWidth",void 0),$r([Gt({type:String})],uo.prototype,"helperText",void 0),$r([Gt({type:Boolean})],uo.prototype,"helperPersistent",void 0),$r([Gt({type:String,attribute:!0})],uo.prototype,"validationMessage",void 0),$r([Gt({type:Boolean})],uo.prototype,"autoValidate",void 0),$r([Gt({type:Boolean})],uo.prototype,"charCounter",void 0),$r([Gt({type:String})],uo.prototype,"label",void 0),$r([Gt({type:Boolean})],uo.prototype,"disabled",void 0),$r([Gt({type:Boolean})],uo.prototype,"continuous",void 0),$r([Gt({type:Boolean})],uo.prototype,"resizeVertical",void 0),$r([Xt()],uo.prototype,"isUiValid",void 0),$r([Xt()],uo.prototype,"searchableValue",void 0),$r([Xt()],uo.prototype,"errorMessage",void 0),uo=$r([qt("or-mwc-input")],uo);var ho="mdc-dom-focus-sentinel",po=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+ho)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(ho)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(ho),t},t}(),mo={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},fo={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},go={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},_o=function(t){function e(n){var i=t.call(this,Qe(Qe({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=fo.CLOSE_ACTION,i.scrimClickAction_=fo.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=fo.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return Je(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return mo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return fo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return go},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(mo.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(fo.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(mo.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(mo.OPEN),t.adapter.addBodyClass(mo.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),go.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(mo.CLOSING),this.adapter.removeClass(mo.OPEN),this.adapter.removeBodyClass(mo.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),go.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,fo.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(mo.OPENING),this.adapter.removeClass(mo.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(mo.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(mo.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(mo.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(mo.SCROLLABLE)},e}(rn),bo=_o.strings,vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Je(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new po(t,e)});var i=this.root.querySelector(bo.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+bo.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(bo.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(bo.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+bo.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=tn(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new In(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(bo.OPENING_EVENT,this.handleOpening_),this.listen(bo.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(bo.OPENING_EVENT,this.handleOpening_),this.unlisten(bo.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new _o({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&ln(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=sn(t.target,"["+bo.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(bo.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(bo.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(bo.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(bo.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(bo.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+bo.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(on),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 s=t.length-1;s>=0;s--)(r=t[s])&&(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 xo=l(40),wo=l(744);class ko extends CustomEvent{constructor(){super(ko.NAME,{bubbles:!0,composed:!0})}}ko.NAME="or-mwc-dialog-opened";class Eo extends CustomEvent{constructor(t){super(Eo.NAME,{detail:t,bubbles:!0,composed:!0})}}Eo.NAME="or-mwc-dialog-closed";const Co=Tt`
|
|
800
|
+
`}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!==so.JSON&&this.type!==so.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,n,i){var r,o;let a,s=this.value;if("undefined"===n&&(s=null,n=void 0),"null"===n&&(s=void 0,n=null),"string"==typeof n)switch(this.type){case so.CHECKBOX:case so.SWITCH:n="on"===n;break;case so.JSON:case so.JSON_OBJECT:case so.NUMBER:case so.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type!==so.JSON_OBJECT||"object"==typeof n&&!Array.isArray(n)||(n=this.value,a=Lr.i18next.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===so.JSON||this.type==so.JSON_OBJECT?Lr.i18next.t("validation.invalidJSON"):Lr.i18next.t("validation.invalidNumber")}break;case so.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=Lr.i18next.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==so.CHECKBOX_LIST&&n!==s&&(this.type===so.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new ao(this.value,s,i))),null!=this.searchProvider&&this.type===so.SELECT){const t=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("select-searchable"))||void 0===o?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==so.CHECKBOX_LIST||e.Util.objectsEqual(n,s,!0)||this.dispatchEvent(new ao(n,s,i))}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 n;return t&&t.length>0&&(n=t.map((t=>{if(Array.isArray(t))return t;{const n=""+t;return[t,Lr.i18next.t(n,{defaultValue:e.Util.camelCaseToSentenceCase(n)})]}}))),n}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(", "):""}};$r([Gt({type:Boolean})],uo.prototype,"focused",void 0),$r([Gt()],uo.prototype,"value",void 0),$r([Gt({type:String})],uo.prototype,"type",void 0),$r([Gt({type:String})],uo.prototype,"name",void 0),$r([Gt({type:Boolean})],uo.prototype,"readonly",void 0),$r([Gt({type:Boolean})],uo.prototype,"required",void 0),$r([Gt()],uo.prototype,"max",void 0),$r([Gt()],uo.prototype,"min",void 0),$r([Gt({type:Number})],uo.prototype,"step",void 0),$r([Gt({type:Boolean})],uo.prototype,"checked",void 0),$r([Gt({type:Boolean})],uo.prototype,"indeterminate",void 0),$r([Gt({type:Number})],uo.prototype,"maxLength",void 0),$r([Gt({type:Number})],uo.prototype,"minLength",void 0),$r([Gt({type:Number})],uo.prototype,"rows",void 0),$r([Gt({type:Number})],uo.prototype,"cols",void 0),$r([Gt({type:Boolean})],uo.prototype,"multiple",void 0),$r([Gt({type:String,attribute:!0,reflect:!1})],uo.prototype,"pattern",void 0),$r([Gt({type:String})],uo.prototype,"placeHolder",void 0),$r([Gt({type:Array})],uo.prototype,"options",void 0),$r([Gt({type:Boolean})],uo.prototype,"autoSelect",void 0),$r([Gt({type:Object})],uo.prototype,"searchProvider",void 0),$r([Gt({type:String})],uo.prototype,"searchLabel",void 0),$r([Gt({type:String})],uo.prototype,"icon",void 0),$r([Gt({type:String})],uo.prototype,"iconColor",void 0),$r([Gt({type:String})],uo.prototype,"iconOn",void 0),$r([Gt({type:String})],uo.prototype,"iconTrailing",void 0),$r([Gt({type:Boolean})],uo.prototype,"compact",void 0),$r([Gt({type:Boolean})],uo.prototype,"comfortable",void 0),$r([Gt({type:Boolean})],uo.prototype,"raised",void 0),$r([Gt({type:Boolean})],uo.prototype,"action",void 0),$r([Gt({type:Boolean})],uo.prototype,"unElevated",void 0),$r([Gt({type:Boolean})],uo.prototype,"outlined",void 0),$r([Gt({type:Boolean})],uo.prototype,"rounded",void 0),$r([Gt({type:Object})],uo.prototype,"format",void 0),$r([Gt({type:Boolean})],uo.prototype,"disableSliderNumberInput",void 0),$r([Gt({type:Boolean})],uo.prototype,"fullWidth",void 0),$r([Gt({type:String})],uo.prototype,"helperText",void 0),$r([Gt({type:Boolean})],uo.prototype,"helperPersistent",void 0),$r([Gt({type:String,attribute:!0})],uo.prototype,"validationMessage",void 0),$r([Gt({type:Boolean})],uo.prototype,"autoValidate",void 0),$r([Gt({type:Boolean})],uo.prototype,"charCounter",void 0),$r([Gt({type:String})],uo.prototype,"label",void 0),$r([Gt({type:Boolean})],uo.prototype,"disabled",void 0),$r([Gt({type:Boolean})],uo.prototype,"continuous",void 0),$r([Gt({type:Boolean})],uo.prototype,"resizeVertical",void 0),$r([Gt({type:Boolean})],uo.prototype,"censored",void 0),$r([Gt({type:Boolean,reflect:!0})],uo.prototype,"advertised",void 0),$r([Xt()],uo.prototype,"isUiValid",void 0),$r([Xt()],uo.prototype,"searchableValue",void 0),$r([Xt()],uo.prototype,"errorMessage",void 0),uo=$r([qt("or-mwc-input")],uo);var ho="mdc-dom-focus-sentinel",po=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+ho)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(ho)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(ho),t},t}(),mo={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},fo={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},go={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},_o=function(t){function e(n){var i=t.call(this,Qe(Qe({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=fo.CLOSE_ACTION,i.scrimClickAction_=fo.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=fo.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return Je(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return mo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return fo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return go},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(mo.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(fo.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(mo.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(mo.OPEN),t.adapter.addBodyClass(mo.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),go.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(mo.CLOSING),this.adapter.removeClass(mo.OPEN),this.adapter.removeBodyClass(mo.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),go.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,fo.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(mo.OPENING),this.adapter.removeClass(mo.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(mo.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(mo.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(mo.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(mo.SCROLLABLE)},e}(rn),bo=_o.strings,vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Je(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new po(t,e)});var i=this.root.querySelector(bo.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+bo.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(bo.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(bo.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+bo.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=tn(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new In(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(bo.OPENING_EVENT,this.handleOpening_),this.listen(bo.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(bo.OPENING_EVENT,this.handleOpening_),this.unlisten(bo.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new _o({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&ln(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=sn(t.target,"["+bo.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(bo.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(bo.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(bo.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(bo.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(bo.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+bo.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(on),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 s=t.length-1;s>=0;s--)(r=t[s])&&(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 xo=l(40),wo=l(744);class ko extends CustomEvent{constructor(){super(ko.NAME,{bubbles:!0,composed:!0})}}ko.NAME="or-mwc-dialog-opened";class Eo extends CustomEvent{constructor(t){super(Eo.NAME,{detail:t,bubbles:!0,composed:!0})}}Eo.NAME="or-mwc-dialog-closed";const Co=Tt`
|
|
800
801
|
:host {
|
|
801
802
|
position: relative;
|
|
802
803
|
}
|
package/dist/umd/index.js
CHANGED
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
.mdc-list-item__graphic > or-icon {
|
|
564
564
|
pointer-events: none;
|
|
565
565
|
}
|
|
566
|
-
`;let po=class extends $t{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[Tt`${At(jr)}`,Tt`${At(qr)}`,Tt`${At(Xr)}`,Tt`${At(Gr)}`,Tt`${At(Yr)}`,Tt`${At(Kr)}`,Tt`${At(Wr)}`,Tt`${At(Jr)}`,Tt`${At(Zr)}`,Tt`${At(Qr)}`,Tt`${At(to)}`,Tt`${At(eo)}`,Tt`${At(no)}`,Tt`${At(ro)}`,Tt`${At(io)}`,Tt`${At(oo)}`,so]}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===lo.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===lo.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===lo.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=lo.DATETIME:"boolean"==typeof this.value?this.type=lo.CHECKBOX:"number"==typeof this.value?this.type=lo.NUMBER:"string"==typeof this.value?this.type=lo.TEXT:this.type=lo.JSON),!0}focus(){this.type===lo.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const n=!this.fullWidth&&this.label;let i=!this.fullWidth&&this.outlined,r=!!this.helperText;const o=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!o&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":o},l=null!==this.value&&void 0!==this.value||!1===this.value;let c=n?nt`<span class="mdc-floating-label ${l?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case lo.RADIO:const n=this.resolveOptions(this.options);return this._selectedIndex=-1,nt`
|
|
566
|
+
`;let po=class extends $t{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[Tt`${At(jr)}`,Tt`${At(qr)}`,Tt`${At(Xr)}`,Tt`${At(Gr)}`,Tt`${At(Yr)}`,Tt`${At(Kr)}`,Tt`${At(Wr)}`,Tt`${At(Jr)}`,Tt`${At(Zr)}`,Tt`${At(Qr)}`,Tt`${At(to)}`,Tt`${At(eo)}`,Tt`${At(no)}`,Tt`${At(ro)}`,Tt`${At(io)}`,Tt`${At(oo)}`,so]}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===lo.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===lo.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===lo.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=lo.DATETIME:"boolean"==typeof this.value?this.type=lo.CHECKBOX:"number"==typeof this.value?this.type=lo.NUMBER:"string"==typeof this.value?this.type=lo.TEXT:this.type=lo.JSON),!0}focus(){this.type===lo.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const n=!this.fullWidth&&this.label;let i=!this.fullWidth&&this.outlined,r=!!this.helperText;const o=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!o&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":o},l=null!==this.value&&void 0!==this.value||!1===this.value;let c=n?nt`<span class="mdc-floating-label ${l?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case lo.RADIO:const n=this.resolveOptions(this.options);return this._selectedIndex=-1,nt`
|
|
567
567
|
<div class="mdc-radio-container">
|
|
568
568
|
${n?n.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),nt`
|
|
569
569
|
<div id="field" class="mdc-form-field">
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
/>
|
|
733
733
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
734
734
|
</div>
|
|
735
|
-
`;case lo.NUMBER:case lo.RANGE:case lo.DATE:case lo.DATETIME:case lo.TIME:case lo.MONTH:case lo.WEEK:case lo.EMAIL:case lo.PASSWORD:case lo.TELEPHONE:case lo.URL:case lo.TEXT:case lo.TEXTAREA:case lo.JSON:case lo.JSON_OBJECT:{let n,s=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(s.some((t=>"string"!=typeof t)))if(this.type===lo.JSON||this.type===lo.JSON_OBJECT)if(void 0!==s[0]){if("string"!=typeof s[0]||null===s[0])try{s[0]=JSON.stringify(s[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),s[0]=""}}else s[0]="";else{const n=this.format?Object.assign({},this.format):{};switch(this.type){case lo.TIME:n.asDate=!0,n.hour12=!1,n.timeStyle=this.step&&this.step<60?"medium":"short";break;case lo.DATE:n.asDate=!0,n.momentJsFormat="YYYY-MM-DD";break;case lo.WEEK:n.asDate=!0,n.momentJsFormat="YYYY-[W]WW";break;case lo.MONTH:n.asDate=!0,n.momentJsFormat="YYYY-MM";break;case lo.DATETIME:n.asDate=!0,n.momentJsFormat="YYYY-MM-DDTHH:mm";break;case lo.NUMBER:null!==(t=n.maximumFractionDigits)&&void 0!==t||(n.maximumFractionDigits=20)}n.useGrouping=!1,s=s.map((t=>void 0!==t?e.Util.getValueAsString(t,(()=>n),"en-GB"):void 0))}let d=this.label,p=this.type,m="component";if(this.type===lo.RANGE&&(d=void 0,i=!1,r=!1,p=lo.NUMBER,m="number"),this.type!==lo.RANGE||!this.disableSliderNumberInput){const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!i,"mdc-text-field--outlined":i,"mdc-text-field--textarea":p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!i,"dense-comfortable":this.comfortable&&!(p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":l,"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};n=p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT?nt`
|
|
735
|
+
`;case lo.NUMBER:case lo.RANGE:case lo.DATE:case lo.DATETIME:case lo.TIME:case lo.MONTH:case lo.WEEK:case lo.EMAIL:case lo.PASSWORD:case lo.TELEPHONE:case lo.URL:case lo.TEXT:case lo.TEXTAREA:case lo.JSON:case lo.JSON_OBJECT:{let n,s=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(s.some((t=>"string"!=typeof t)))if(this.type===lo.JSON||this.type===lo.JSON_OBJECT)if(void 0!==s[0]){if("string"!=typeof s[0]||null===s[0])try{s[0]=JSON.stringify(s[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),s[0]=""}}else s[0]="";else{const n=this.format?Object.assign({},this.format):{};switch(this.type){case lo.TIME:n.asDate=!0,n.hour12=!1,n.timeStyle=this.step&&this.step<60?"medium":"short";break;case lo.DATE:n.asDate=!0,n.momentJsFormat="YYYY-MM-DD";break;case lo.WEEK:n.asDate=!0,n.momentJsFormat="YYYY-[W]WW";break;case lo.MONTH:n.asDate=!0,n.momentJsFormat="YYYY-MM";break;case lo.DATETIME:n.asDate=!0,n.momentJsFormat="YYYY-MM-DDTHH:mm";break;case lo.NUMBER:null!==(t=n.maximumFractionDigits)&&void 0!==t||(n.maximumFractionDigits=20)}n.useGrouping=!1,s=s.map((t=>void 0!==t?e.Util.getValueAsString(t,(()=>n),"en-GB"):void 0))}let d=this.label,p=this.type,m="component";if(this.type===lo.RANGE&&(d=void 0,i=!1,r=!1,p=lo.NUMBER,m="number"),this.type!==lo.RANGE||!this.disableSliderNumberInput){this.censored&&(p=lo.PASSWORD),this.type===lo.PASSWORD&&this.advertised&&(p=lo.TEXT);const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!i,"mdc-text-field--outlined":i,"mdc-text-field--textarea":p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!i,"dense-comfortable":this.comfortable&&!(p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":l,"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};n=p===lo.TEXTAREA||p===lo.JSON||p===lo.JSON_OBJECT?nt`
|
|
736
736
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
737
737
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${qe(this.minLength)}"
|
|
738
738
|
maxlength="${qe(this.maxLength)}" rows="${this.rows?this.rows:5}"
|
|
@@ -754,6 +754,7 @@
|
|
|
754
754
|
${n}
|
|
755
755
|
${i?this.renderOutlined(c):c}
|
|
756
756
|
${i?"":nt`<span class="mdc-line-ripple"></span>`}
|
|
757
|
+
${this.type!==lo.PASSWORD||this.censored?"":nt`<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>`}
|
|
757
758
|
${this.iconTrailing?nt`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
758
759
|
</label>
|
|
759
760
|
${r||o?nt`
|
|
@@ -796,7 +797,7 @@
|
|
|
796
797
|
`:""}
|
|
797
798
|
<span class="mdc-notched-outline__trailing"></span>
|
|
798
799
|
</span>
|
|
799
|
-
`}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!==lo.JSON&&this.type!==lo.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,n,i){var r,o;let a,l=this.value;if("undefined"===n&&(l=null,n=void 0),"null"===n&&(l=void 0,n=null),"string"==typeof n)switch(this.type){case lo.CHECKBOX:case lo.SWITCH:n="on"===n;break;case lo.JSON:case lo.JSON_OBJECT:case lo.NUMBER:case lo.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type!==lo.JSON_OBJECT||"object"==typeof n&&!Array.isArray(n)||(n=this.value,a=Or.i18next.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===lo.JSON||this.type==lo.JSON_OBJECT?Or.i18next.t("validation.invalidJSON"):Or.i18next.t("validation.invalidNumber")}break;case lo.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=Or.i18next.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==lo.CHECKBOX_LIST&&n!==l&&(this.type===lo.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new ao(this.value,l,i))),null!=this.searchProvider&&this.type===lo.SELECT){const t=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("select-searchable"))||void 0===o?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==lo.CHECKBOX_LIST||e.Util.objectsEqual(n,l,!0)||this.dispatchEvent(new ao(n,l,i))}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 n;return t&&t.length>0&&(n=t.map((t=>{if(Array.isArray(t))return t;{const n=""+t;return[t,Or.i18next.t(n,{defaultValue:e.Util.camelCaseToSentenceCase(n)})]}}))),n}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(", "):""}};Vr([jt({type:Boolean})],po.prototype,"focused",void 0),Vr([jt()],po.prototype,"value",void 0),Vr([jt({type:String})],po.prototype,"type",void 0),Vr([jt({type:String})],po.prototype,"name",void 0),Vr([jt({type:Boolean})],po.prototype,"readonly",void 0),Vr([jt({type:Boolean})],po.prototype,"required",void 0),Vr([jt()],po.prototype,"max",void 0),Vr([jt()],po.prototype,"min",void 0),Vr([jt({type:Number})],po.prototype,"step",void 0),Vr([jt({type:Boolean})],po.prototype,"checked",void 0),Vr([jt({type:Boolean})],po.prototype,"indeterminate",void 0),Vr([jt({type:Number})],po.prototype,"maxLength",void 0),Vr([jt({type:Number})],po.prototype,"minLength",void 0),Vr([jt({type:Number})],po.prototype,"rows",void 0),Vr([jt({type:Number})],po.prototype,"cols",void 0),Vr([jt({type:Boolean})],po.prototype,"multiple",void 0),Vr([jt({type:String,attribute:!0,reflect:!1})],po.prototype,"pattern",void 0),Vr([jt({type:String})],po.prototype,"placeHolder",void 0),Vr([jt({type:Array})],po.prototype,"options",void 0),Vr([jt({type:Boolean})],po.prototype,"autoSelect",void 0),Vr([jt({type:Object})],po.prototype,"searchProvider",void 0),Vr([jt({type:String})],po.prototype,"searchLabel",void 0),Vr([jt({type:String})],po.prototype,"icon",void 0),Vr([jt({type:String})],po.prototype,"iconColor",void 0),Vr([jt({type:String})],po.prototype,"iconOn",void 0),Vr([jt({type:String})],po.prototype,"iconTrailing",void 0),Vr([jt({type:Boolean})],po.prototype,"compact",void 0),Vr([jt({type:Boolean})],po.prototype,"comfortable",void 0),Vr([jt({type:Boolean})],po.prototype,"raised",void 0),Vr([jt({type:Boolean})],po.prototype,"action",void 0),Vr([jt({type:Boolean})],po.prototype,"unElevated",void 0),Vr([jt({type:Boolean})],po.prototype,"outlined",void 0),Vr([jt({type:Boolean})],po.prototype,"rounded",void 0),Vr([jt({type:Object})],po.prototype,"format",void 0),Vr([jt({type:Boolean})],po.prototype,"disableSliderNumberInput",void 0),Vr([jt({type:Boolean})],po.prototype,"fullWidth",void 0),Vr([jt({type:String})],po.prototype,"helperText",void 0),Vr([jt({type:Boolean})],po.prototype,"helperPersistent",void 0),Vr([jt({type:String,attribute:!0})],po.prototype,"validationMessage",void 0),Vr([jt({type:Boolean})],po.prototype,"autoValidate",void 0),Vr([jt({type:Boolean})],po.prototype,"charCounter",void 0),Vr([jt({type:String})],po.prototype,"label",void 0),Vr([jt({type:Boolean})],po.prototype,"disabled",void 0),Vr([jt({type:Boolean})],po.prototype,"continuous",void 0),Vr([jt({type:Boolean})],po.prototype,"resizeVertical",void 0),Vr([Gt()],po.prototype,"isUiValid",void 0),Vr([Gt()],po.prototype,"searchableValue",void 0),Vr([Gt()],po.prototype,"errorMessage",void 0),po=Vr([Ut("or-mwc-input")],po);var mo="mdc-dom-focus-sentinel",uo=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+mo)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(mo)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(mo),t},t}(),ho={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},fo={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},go={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},bo=function(t){function e(n){var i=t.call(this,Qe(Qe({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=fo.CLOSE_ACTION,i.scrimClickAction_=fo.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=fo.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return Ze(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return ho},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return fo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return go},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(ho.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(fo.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(ho.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(ho.OPEN),t.adapter.addBodyClass(ho.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),go.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(ho.CLOSING),this.adapter.removeClass(ho.OPEN),this.adapter.removeBodyClass(ho.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),go.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,fo.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(ho.OPENING),this.adapter.removeClass(ho.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(ho.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(ho.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(ho.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(ho.SCROLLABLE)},e}(rn),vo=bo.strings,_o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ze(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new uo(t,e)});var i=this.root.querySelector(vo.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+vo.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(vo.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(vo.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+vo.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=tn(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new In(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(vo.OPENING_EVENT,this.handleOpening_),this.listen(vo.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(vo.OPENING_EVENT,this.handleOpening_),this.unlisten(vo.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new bo({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&cn(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=ln(t.target,"["+vo.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(vo.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(vo.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(vo.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(vo.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(vo.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+vo.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(on),xo=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 yo=s(40),wo=s(744);class ko extends CustomEvent{constructor(){super(ko.NAME,{bubbles:!0,composed:!0})}}ko.NAME="or-mwc-dialog-opened";class Eo extends CustomEvent{constructor(t){super(Eo.NAME,{detail:t,bubbles:!0,composed:!0})}}Eo.NAME="or-mwc-dialog-closed";const Co=Tt`
|
|
800
|
+
`}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!==lo.JSON&&this.type!==lo.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,n,i){var r,o;let a,l=this.value;if("undefined"===n&&(l=null,n=void 0),"null"===n&&(l=void 0,n=null),"string"==typeof n)switch(this.type){case lo.CHECKBOX:case lo.SWITCH:n="on"===n;break;case lo.JSON:case lo.JSON_OBJECT:case lo.NUMBER:case lo.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type!==lo.JSON_OBJECT||"object"==typeof n&&!Array.isArray(n)||(n=this.value,a=Or.i18next.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===lo.JSON||this.type==lo.JSON_OBJECT?Or.i18next.t("validation.invalidJSON"):Or.i18next.t("validation.invalidNumber")}break;case lo.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=Or.i18next.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==lo.CHECKBOX_LIST&&n!==l&&(this.type===lo.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new ao(this.value,l,i))),null!=this.searchProvider&&this.type===lo.SELECT){const t=null===(o=null===(r=this.shadowRoot)||void 0===r?void 0:r.getElementById("select-searchable"))||void 0===o?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==lo.CHECKBOX_LIST||e.Util.objectsEqual(n,l,!0)||this.dispatchEvent(new ao(n,l,i))}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 n;return t&&t.length>0&&(n=t.map((t=>{if(Array.isArray(t))return t;{const n=""+t;return[t,Or.i18next.t(n,{defaultValue:e.Util.camelCaseToSentenceCase(n)})]}}))),n}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(", "):""}};Vr([jt({type:Boolean})],po.prototype,"focused",void 0),Vr([jt()],po.prototype,"value",void 0),Vr([jt({type:String})],po.prototype,"type",void 0),Vr([jt({type:String})],po.prototype,"name",void 0),Vr([jt({type:Boolean})],po.prototype,"readonly",void 0),Vr([jt({type:Boolean})],po.prototype,"required",void 0),Vr([jt()],po.prototype,"max",void 0),Vr([jt()],po.prototype,"min",void 0),Vr([jt({type:Number})],po.prototype,"step",void 0),Vr([jt({type:Boolean})],po.prototype,"checked",void 0),Vr([jt({type:Boolean})],po.prototype,"indeterminate",void 0),Vr([jt({type:Number})],po.prototype,"maxLength",void 0),Vr([jt({type:Number})],po.prototype,"minLength",void 0),Vr([jt({type:Number})],po.prototype,"rows",void 0),Vr([jt({type:Number})],po.prototype,"cols",void 0),Vr([jt({type:Boolean})],po.prototype,"multiple",void 0),Vr([jt({type:String,attribute:!0,reflect:!1})],po.prototype,"pattern",void 0),Vr([jt({type:String})],po.prototype,"placeHolder",void 0),Vr([jt({type:Array})],po.prototype,"options",void 0),Vr([jt({type:Boolean})],po.prototype,"autoSelect",void 0),Vr([jt({type:Object})],po.prototype,"searchProvider",void 0),Vr([jt({type:String})],po.prototype,"searchLabel",void 0),Vr([jt({type:String})],po.prototype,"icon",void 0),Vr([jt({type:String})],po.prototype,"iconColor",void 0),Vr([jt({type:String})],po.prototype,"iconOn",void 0),Vr([jt({type:String})],po.prototype,"iconTrailing",void 0),Vr([jt({type:Boolean})],po.prototype,"compact",void 0),Vr([jt({type:Boolean})],po.prototype,"comfortable",void 0),Vr([jt({type:Boolean})],po.prototype,"raised",void 0),Vr([jt({type:Boolean})],po.prototype,"action",void 0),Vr([jt({type:Boolean})],po.prototype,"unElevated",void 0),Vr([jt({type:Boolean})],po.prototype,"outlined",void 0),Vr([jt({type:Boolean})],po.prototype,"rounded",void 0),Vr([jt({type:Object})],po.prototype,"format",void 0),Vr([jt({type:Boolean})],po.prototype,"disableSliderNumberInput",void 0),Vr([jt({type:Boolean})],po.prototype,"fullWidth",void 0),Vr([jt({type:String})],po.prototype,"helperText",void 0),Vr([jt({type:Boolean})],po.prototype,"helperPersistent",void 0),Vr([jt({type:String,attribute:!0})],po.prototype,"validationMessage",void 0),Vr([jt({type:Boolean})],po.prototype,"autoValidate",void 0),Vr([jt({type:Boolean})],po.prototype,"charCounter",void 0),Vr([jt({type:String})],po.prototype,"label",void 0),Vr([jt({type:Boolean})],po.prototype,"disabled",void 0),Vr([jt({type:Boolean})],po.prototype,"continuous",void 0),Vr([jt({type:Boolean})],po.prototype,"resizeVertical",void 0),Vr([jt({type:Boolean})],po.prototype,"censored",void 0),Vr([jt({type:Boolean,reflect:!0})],po.prototype,"advertised",void 0),Vr([Gt()],po.prototype,"isUiValid",void 0),Vr([Gt()],po.prototype,"searchableValue",void 0),Vr([Gt()],po.prototype,"errorMessage",void 0),po=Vr([Ut("or-mwc-input")],po);var mo="mdc-dom-focus-sentinel",uo=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+mo)).forEach((function(t){t.parentElement.removeChild(t)})),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){e.length>0&&e[e.length-1].focus()})),i.addEventListener("focus",(function(){e.length>0&&e[0].focus()})),t.insertBefore(n,t.children[0]),t.appendChild(i)},t.prototype.focusInitialElement=function(t,e){var n=0;e&&(n=Math.max(t.indexOf(e),0)),t[n].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),n=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(mo)&&!e,i=!1;if(n){var r=getComputedStyle(t);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(mo),t},t}(),ho={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},fo={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},go={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},bo=function(t){function e(n){var i=t.call(this,Qe(Qe({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=fo.CLOSE_ACTION,i.scrimClickAction_=fo.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=fo.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return Ze(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return ho},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return fo},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return go},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(ho.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(fo.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(ho.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(ho.OPEN),t.adapter.addBodyClass(ho.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),go.DIALOG_ANIMATION_OPEN_TIME_MS)}))},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(ho.CLOSING),this.adapter.removeClass(ho.OPEN),this.adapter.removeBodyClass(ho.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),go.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,fo.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var n=t.composedPath?t.composedPath()[0]:t.target,i=!this.adapter.eventTargetMatches(n,this.suppressDefaultPressSelector);e&&i&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(ho.OPENING),this.adapter.removeClass(ho.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(ho.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(ho.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(ho.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(ho.SCROLLABLE)},e}(rn),vo=bo.strings,_o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ze(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){var e,n;void 0===t&&(t=function(t,e){return new uo(t,e)});var i=this.root.querySelector(vo.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+vo.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(vo.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(vo.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+vo.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=tn(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new In(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var n=["resize","orientationchange"];this.handleOpening_=function(){n.forEach((function(t){return window.addEventListener(t,e.handleLayout_)})),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){n.forEach((function(t){return window.removeEventListener(t,e.handleLayout_)})),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(vo.OPENING_EVENT,this.handleOpening_),this.listen(vo.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(vo.OPENING_EVENT,this.handleOpening_),this.unlisten(vo.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach((function(t){return t.destroy()})),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new bo({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){return e=t.buttons_,n=new Set,[].forEach.call(e,(function(t){return n.add(t.offsetTop)})),n.size>1;var e,n},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&cn(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=ln(t.target,"["+vo.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(vo.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight;var e},notifyClosed:function(e){return t.emit(vo.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(vo.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(vo.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(vo.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach((function(t){t.parentElement.appendChild(t)}))},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+vo.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(on),xo=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 yo=s(40),wo=s(744);class ko extends CustomEvent{constructor(){super(ko.NAME,{bubbles:!0,composed:!0})}}ko.NAME="or-mwc-dialog-opened";class Eo extends CustomEvent{constructor(t){super(Eo.NAME,{detail:t,bubbles:!0,composed:!0})}}Eo.NAME="or-mwc-dialog-closed";const Co=Tt`
|
|
800
801
|
:host {
|
|
801
802
|
position: relative;
|
|
802
803
|
}
|