@openremote/or-attribute-picker 1.2.0-snapshot.20241015145246 → 1.2.0-snapshot.20241209103107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/index.js +7 -5
- package/dist/umd/index.orbundle.js +15 -13
- package/package.json +6 -6
package/dist/umd/index.js
CHANGED
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
.mdc-list-item__graphic > or-icon {
|
|
261
261
|
pointer-events: none;
|
|
262
262
|
}
|
|
263
|
-
`;let Qi=class extends gt{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[h`${f(Di)}`,h`${f(Ri)}`,h`${f(Ni)}`,h`${f(zi)}`,h`${f(Mi)}`,h`${f(Pi)}`,h`${f(Fi)}`,h`${f($i)}`,h`${f(Hi)}`,h`${f(Bi)}`,h`${f(Vi)}`,h`${f(Ui)}`,h`${f(Xi)}`,h`${f(ji)}`,h`${f(Yi)}`,h`${f(Gi)}`,Ji]}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===Ki.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ki.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ki.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ki.DATETIME:"boolean"==typeof this.value?this.type=Ki.CHECKBOX:"number"==typeof this.value?this.type=Ki.NUMBER:"string"==typeof this.value?this.type=Ki.TEXT:this.type=Ki.JSON),!0}focus(){this.type===Ki.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){const t=!this.fullWidth&&this.label;let e=!this.fullWidth&&this.outlined,n=!!this.helperText;const i=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!i&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},o=null!==this.value&&void 0!==this.value||!1===this.value;let a=t?K`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ki.RADIO:const t=this.resolveOptions(this.options);return this._selectedIndex=-1,K`
|
|
263
|
+
`;let Qi=class extends gt{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[h`${f(Di)}`,h`${f(Ri)}`,h`${f(Ni)}`,h`${f(zi)}`,h`${f(Mi)}`,h`${f(Pi)}`,h`${f(Fi)}`,h`${f($i)}`,h`${f(Hi)}`,h`${f(Bi)}`,h`${f(Vi)}`,h`${f(Ui)}`,h`${f(Xi)}`,h`${f(ji)}`,h`${f(Yi)}`,h`${f(Gi)}`,Ji]}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===Ki.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ki.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ki.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ki.DATETIME:"boolean"==typeof this.value?this.type=Ki.CHECKBOX:"number"==typeof this.value?this.type=Ki.NUMBER:"string"==typeof this.value?this.type=Ki.TEXT:this.type=Ki.JSON),!0}focus(){this.type===Ki.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){const t=!this.fullWidth&&this.label;let e=!this.fullWidth&&this.outlined,n=!!this.helperText;const i=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!i&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":i},o=null!==this.value&&void 0!==this.value||!1===this.value;let a=t?K`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ki.RADIO:const t=this.resolveOptions(this.options);return this._selectedIndex=-1,K`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${t?t.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),K`
|
|
266
266
|
<div id="field" class="mdc-form-field">
|
|
@@ -345,7 +345,9 @@
|
|
|
345
345
|
<div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${null!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${u}">
|
|
346
346
|
${Rt(null!=this.searchProvider,(()=>K`
|
|
347
347
|
<label id="select-searchable" class="mdc-text-field mdc-text-field--filled">
|
|
348
|
-
<span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id"
|
|
348
|
+
<span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id">
|
|
349
|
+
<or-translate .value="${this.searchLabel}"></or-translate>
|
|
350
|
+
</span>
|
|
349
351
|
<input class="mdc-text-field__input" type="text"
|
|
350
352
|
@keyup="${t=>this.searchableValue=t.target.value}"
|
|
351
353
|
/>
|
|
@@ -491,7 +493,7 @@
|
|
|
491
493
|
`:""}
|
|
492
494
|
<span class="mdc-notched-outline__trailing"></span>
|
|
493
495
|
</span>
|
|
494
|
-
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==Ki.JSON&&this.type!==Ki.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case Ki.CHECKBOX:case Ki.SWITCH:e="on"===e;break;case Ki.JSON:case Ki.JSON_OBJECT:case Ki.NUMBER:case Ki.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ki.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=_t.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Ki.JSON||this.type==Ki.JSON_OBJECT?_t.i18next.t("validation.invalidJSON"):_t.i18next.t("validation.invalidNumber")}break;case Ki.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=_t.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Ki.CHECKBOX_LIST&&e!==a&&(this.type===Ki.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new qi(this.value,a,n))),null!=this.searchProvider&&this.type===Ki.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==Ki.CHECKBOX_LIST||hi.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new qi(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,_t.i18next.t(e,{defaultValue:hi.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Oi([i({type:Boolean})],Qi.prototype,"focused",void 0),Oi([i()],Qi.prototype,"value",void 0),Oi([i({type:String})],Qi.prototype,"type",void 0),Oi([i({type:String})],Qi.prototype,"name",void 0),Oi([i({type:Boolean})],Qi.prototype,"readonly",void 0),Oi([i({type:Boolean})],Qi.prototype,"required",void 0),Oi([i()],Qi.prototype,"max",void 0),Oi([i()],Qi.prototype,"min",void 0),Oi([i({type:Number})],Qi.prototype,"step",void 0),Oi([i({type:Boolean})],Qi.prototype,"checked",void 0),Oi([i({type:Boolean})],Qi.prototype,"indeterminate",void 0),Oi([i({type:Number})],Qi.prototype,"maxLength",void 0),Oi([i({type:Number})],Qi.prototype,"minLength",void 0),Oi([i({type:Number})],Qi.prototype,"rows",void 0),Oi([i({type:Number})],Qi.prototype,"cols",void 0),Oi([i({type:Boolean})],Qi.prototype,"multiple",void 0),Oi([i({type:String,attribute:!0,reflect:!1})],Qi.prototype,"pattern",void 0),Oi([i({type:String})],Qi.prototype,"placeHolder",void 0),Oi([i({type:Array})],Qi.prototype,"options",void 0),Oi([i({type:Boolean})],Qi.prototype,"autoSelect",void 0),Oi([i({type:Object})],Qi.prototype,"searchProvider",void 0),Oi([i({type:String})],Qi.prototype,"icon",void 0),Oi([i({type:String})],Qi.prototype,"iconColor",void 0),Oi([i({type:String})],Qi.prototype,"iconOn",void 0),Oi([i({type:String})],Qi.prototype,"iconTrailing",void 0),Oi([i({type:Boolean})],Qi.prototype,"compact",void 0),Oi([i({type:Boolean})],Qi.prototype,"comfortable",void 0),Oi([i({type:Boolean})],Qi.prototype,"raised",void 0),Oi([i({type:Boolean})],Qi.prototype,"action",void 0),Oi([i({type:Boolean})],Qi.prototype,"unElevated",void 0),Oi([i({type:Boolean})],Qi.prototype,"outlined",void 0),Oi([i({type:Boolean})],Qi.prototype,"rounded",void 0),Oi([i({type:Object})],Qi.prototype,"format",void 0),Oi([i({type:Boolean})],Qi.prototype,"disableSliderNumberInput",void 0),Oi([i({type:Boolean})],Qi.prototype,"fullWidth",void 0),Oi([i({type:String})],Qi.prototype,"helperText",void 0),Oi([i({type:Boolean})],Qi.prototype,"helperPersistent",void 0),Oi([i({type:String,attribute:!0})],Qi.prototype,"validationMessage",void 0),Oi([i({type:Boolean})],Qi.prototype,"autoValidate",void 0),Oi([i({type:Boolean})],Qi.prototype,"charCounter",void 0),Oi([i({type:String})],Qi.prototype,"label",void 0),Oi([i({type:Boolean})],Qi.prototype,"disabled",void 0),Oi([i({type:Boolean})],Qi.prototype,"continuous",void 0),Oi([i({type:Boolean})],Qi.prototype,"resizeVertical",void 0),Oi([r()],Qi.prototype,"isUiValid",void 0),Oi([r()],Qi.prototype,"searchableValue",void 0),Oi([r()],Qi.prototype,"errorMessage",void 0),Qi=Oi([t("or-mwc-input")],Qi);var Zi="mdc-dom-focus-sentinel",tr=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("."+Zi)).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(Zi)&&!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(Zi),t},t}(),er={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"},nr={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"},ir={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rr=function(t){function e(n){var i=t.call(this,Ht(Ht({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=nr.CLOSE_ACTION,i.scrimClickAction_=nr.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=nr.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return $t(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return er},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nr},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ir},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(er.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(nr.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(er.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(er.OPEN),t.adapter.addBodyClass(er.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),ir.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(er.CLOSING),this.adapter.removeClass(er.OPEN),this.adapter.removeBodyClass(er.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),ir.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,nr.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(er.OPENING),this.adapter.removeClass(er.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(er.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(er.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(er.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(er.SCROLLABLE)},e}(Xt),or=rr.strings,ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $t(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 tr(t,e)});var i=this.root.querySelector(or.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+or.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(or.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(or.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+or.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=Bt(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new fe(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(or.OPENING_EVENT,this.handleOpening_),this.listen(or.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(or.OPENING_EVENT,this.handleOpening_),this.unlisten(or.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 rr({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&&qt(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=Gt(t.target,"["+or.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(or.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(or.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(or.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(or.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(or.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("["+or.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(Yt),lr=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 dr=l(40),cr=l(744);class sr extends CustomEvent{constructor(){super(sr.NAME,{bubbles:!0,composed:!0})}}sr.NAME="or-mwc-dialog-opened";class mr extends CustomEvent{constructor(t){super(mr.NAME,{detail:t,bubbles:!0,composed:!0})}}mr.NAME="or-mwc-dialog-closed";const pr=h`
|
|
496
|
+
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==Ki.JSON&&this.type!==Ki.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let o,a=this.value;if("undefined"===e&&(a=null,e=void 0),"null"===e&&(a=void 0,e=null),"string"==typeof e)switch(this.type){case Ki.CHECKBOX:case Ki.SWITCH:e="on"===e;break;case Ki.JSON:case Ki.JSON_OBJECT:case Ki.NUMBER:case Ki.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ki.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,o=_t.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,o=this.type===Ki.JSON||this.type==Ki.JSON_OBJECT?_t.i18next.t("validation.invalidJSON"):_t.i18next.t("validation.invalidNumber")}break;case Ki.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,o=_t.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(o),this.reportValidity(),this.type!==Ki.CHECKBOX_LIST&&e!==a&&(this.type===Ki.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new qi(this.value,a,n))),null!=this.searchProvider&&this.type===Ki.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==Ki.CHECKBOX_LIST||hi.Util.objectsEqual(e,a,!0)||this.dispatchEvent(new qi(e,a,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,_t.i18next.t(e,{defaultValue:hi.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};Oi([i({type:Boolean})],Qi.prototype,"focused",void 0),Oi([i()],Qi.prototype,"value",void 0),Oi([i({type:String})],Qi.prototype,"type",void 0),Oi([i({type:String})],Qi.prototype,"name",void 0),Oi([i({type:Boolean})],Qi.prototype,"readonly",void 0),Oi([i({type:Boolean})],Qi.prototype,"required",void 0),Oi([i()],Qi.prototype,"max",void 0),Oi([i()],Qi.prototype,"min",void 0),Oi([i({type:Number})],Qi.prototype,"step",void 0),Oi([i({type:Boolean})],Qi.prototype,"checked",void 0),Oi([i({type:Boolean})],Qi.prototype,"indeterminate",void 0),Oi([i({type:Number})],Qi.prototype,"maxLength",void 0),Oi([i({type:Number})],Qi.prototype,"minLength",void 0),Oi([i({type:Number})],Qi.prototype,"rows",void 0),Oi([i({type:Number})],Qi.prototype,"cols",void 0),Oi([i({type:Boolean})],Qi.prototype,"multiple",void 0),Oi([i({type:String,attribute:!0,reflect:!1})],Qi.prototype,"pattern",void 0),Oi([i({type:String})],Qi.prototype,"placeHolder",void 0),Oi([i({type:Array})],Qi.prototype,"options",void 0),Oi([i({type:Boolean})],Qi.prototype,"autoSelect",void 0),Oi([i({type:Object})],Qi.prototype,"searchProvider",void 0),Oi([i({type:String})],Qi.prototype,"searchLabel",void 0),Oi([i({type:String})],Qi.prototype,"icon",void 0),Oi([i({type:String})],Qi.prototype,"iconColor",void 0),Oi([i({type:String})],Qi.prototype,"iconOn",void 0),Oi([i({type:String})],Qi.prototype,"iconTrailing",void 0),Oi([i({type:Boolean})],Qi.prototype,"compact",void 0),Oi([i({type:Boolean})],Qi.prototype,"comfortable",void 0),Oi([i({type:Boolean})],Qi.prototype,"raised",void 0),Oi([i({type:Boolean})],Qi.prototype,"action",void 0),Oi([i({type:Boolean})],Qi.prototype,"unElevated",void 0),Oi([i({type:Boolean})],Qi.prototype,"outlined",void 0),Oi([i({type:Boolean})],Qi.prototype,"rounded",void 0),Oi([i({type:Object})],Qi.prototype,"format",void 0),Oi([i({type:Boolean})],Qi.prototype,"disableSliderNumberInput",void 0),Oi([i({type:Boolean})],Qi.prototype,"fullWidth",void 0),Oi([i({type:String})],Qi.prototype,"helperText",void 0),Oi([i({type:Boolean})],Qi.prototype,"helperPersistent",void 0),Oi([i({type:String,attribute:!0})],Qi.prototype,"validationMessage",void 0),Oi([i({type:Boolean})],Qi.prototype,"autoValidate",void 0),Oi([i({type:Boolean})],Qi.prototype,"charCounter",void 0),Oi([i({type:String})],Qi.prototype,"label",void 0),Oi([i({type:Boolean})],Qi.prototype,"disabled",void 0),Oi([i({type:Boolean})],Qi.prototype,"continuous",void 0),Oi([i({type:Boolean})],Qi.prototype,"resizeVertical",void 0),Oi([r()],Qi.prototype,"isUiValid",void 0),Oi([r()],Qi.prototype,"searchableValue",void 0),Oi([r()],Qi.prototype,"errorMessage",void 0),Qi=Oi([t("or-mwc-input")],Qi);var Zi="mdc-dom-focus-sentinel",tr=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("."+Zi)).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(Zi)&&!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(Zi),t},t}(),er={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"},nr={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"},ir={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rr=function(t){function e(n){var i=t.call(this,Ht(Ht({},e.defaultAdapter),n))||this;return i.isOpen_=!1,i.animationFrame_=0,i.animationTimer_=0,i.layoutFrame_=0,i.escapeKeyAction_=nr.CLOSE_ACTION,i.scrimClickAction_=nr.CLOSE_ACTION,i.autoStackButtons_=!0,i.areButtonsStacked_=!1,i.suppressDefaultPressSelector=nr.SUPPRESS_DEFAULT_PRESS_SELECTOR,i}return $t(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return er},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nr},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ir},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(er.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(nr.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(er.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(er.OPEN),t.adapter.addBodyClass(er.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),ir.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(er.CLOSING),this.adapter.removeClass(er.OPEN),this.adapter.removeBodyClass(er.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),ir.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,nr.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(er.OPENING),this.adapter.removeClass(er.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(er.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(er.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(er.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(er.SCROLLABLE)},e}(Xt),or=rr.strings,ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $t(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 tr(t,e)});var i=this.root.querySelector(or.CONTAINER_SELECTOR);if(!i)throw new Error("Dialog component requires a "+or.CONTAINER_SELECTOR+" container element");this.container_=i,this.content_=this.root.querySelector(or.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(or.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+or.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=Bt(this.buttons_),o=r.next();!o.done;o=r.next()){var a=o.value;this.buttonRipples_.push(new fe(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(or.OPENING_EVENT,this.handleOpening_),this.listen(or.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(or.OPENING_EVENT,this.handleOpening_),this.unlisten(or.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 rr({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&&qt(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=Gt(t.target,"["+or.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(or.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(or.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(or.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(or.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(or.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("["+or.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(Yt),lr=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 dr=l(40),cr=l(744);class sr extends CustomEvent{constructor(){super(sr.NAME,{bubbles:!0,composed:!0})}}sr.NAME="or-mwc-dialog-opened";class mr extends CustomEvent{constructor(t){super(mr.NAME,{detail:t,bubbles:!0,composed:!0})}}mr.NAME="or-mwc-dialog-closed";const pr=h`
|
|
495
497
|
:host {
|
|
496
498
|
position: relative;
|
|
497
499
|
}
|
|
@@ -518,7 +520,7 @@
|
|
|
518
520
|
max-width: 1024px;
|
|
519
521
|
}
|
|
520
522
|
}
|
|
521
|
-
`;let ur=class extends gt{constructor(){super(...arguments),this._open=!1}static get styles(){return[h`${f(dr)}`,h`${f(cr)}`,pr]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new ar(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return K`
|
|
523
|
+
`;let ur=class extends gt{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=t=>this._onBrowserNavigate(t)}static get styles(){return[h`${f(dr)}`,h`${f(cr)}`,pr]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new ar(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return K`
|
|
522
524
|
${"string"==typeof this.styles?K`<style>${this.styles}</style>`:this.styles||""}
|
|
523
525
|
|
|
524
526
|
<div id="dialog"
|
|
@@ -551,7 +553,7 @@
|
|
|
551
553
|
</div>
|
|
552
554
|
<div class="mdc-dialog__scrim"></div>
|
|
553
555
|
</div>
|
|
554
|
-
`}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new sr)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){const e=this.actions.find((e=>e.actionName===t));e&&e.action&&e.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new mr(t))}};lr([i({type:String})],ur.prototype,"heading",void 0),lr([i({type:Object,attribute:!1})],ur.prototype,"content",void 0),lr([i({type:Array,attribute:!1})],ur.prototype,"actions",void 0),lr([i({type:Object,attribute:!1})],ur.prototype,"dismissAction",void 0),lr([i({type:Boolean})],ur.prototype,"avatar",void 0),lr([i()],ur.prototype,"styles",void 0),lr([i({attribute:!1})],ur.prototype,"_open",void 0),lr([o("#dialog")],ur.prototype,"_mdcElem",void 0),ur=lr([t("or-mwc-dialog")],ur);var fr=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};class hr extends CustomEvent{}class gr extends ur{constructor(){super(...arguments),this.multiSelect=!1,this.showOnlyDatapointAttrs=!1,this.showOnlyRuleStateAttrs=!1}connectedCallback(){super.connectedCallback(),this.heading=_t.i18next.t("selectAttributes"),this._setDialogContent(),this._setDialogActions(),this.dismissAction=null,this.styles=this._getStyles()}setShowOnlyDatapointAttrs(t){return this.showOnlyDatapointAttrs=t,this}setShowOnlyRuleStateAttrs(t){return this.showOnlyRuleStateAttrs=t,this}setMultiSelect(t){return this.multiSelect=t,this}setOpen(t){return super.setOpen(t),this}setHeading(t){return super.setHeading(t),this}setContent(t){throw new Error("Cannot modify attribute picker content")}setActions(t){throw new Error("Cannot modify attribute picker actions")}setDismissAction(t){throw new Error("Cannot modify attribute picker dismiss action")}setStyles(t){throw new Error("Cannot modify attribute picker styles")}setAvatar(t){throw new Error("Cannot modify attribute picker avatar setting")}_updateDialogContent(){this._setDialogContent()}_updateDialogActions(){this._setDialogActions()}_getAttributesTemplate(t,e,n,i=!1,r){return function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{d(i.next(t))}catch(t){o(t)}}function l(t){try{d(i.throw(t))}catch(t){o(t)}}function d(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,l)}d((i=i.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){const o=Math.max((null==t?void 0:t.length)||0,(null==e?void 0:e.length)||0),a=[];for(let n=0;n<o;n++)a.push({text:hi.Util.getAttributeLabel(null==t?void 0:t[n],null==e?void 0:e[n],void 0,!0),value:(null==t?void 0:t[n].name)||(null==e?void 0:e[n].name)});return K`
|
|
556
|
+
`}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new sr)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){const e=this.actions.find((e=>e.actionName===t));e&&e.action&&e.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new mr(t))}_onBrowserNavigate(t){this.close("close")}};lr([i({type:String})],ur.prototype,"heading",void 0),lr([i({type:Object,attribute:!1})],ur.prototype,"content",void 0),lr([i({type:Array,attribute:!1})],ur.prototype,"actions",void 0),lr([i({type:Object,attribute:!1})],ur.prototype,"dismissAction",void 0),lr([i({type:Boolean})],ur.prototype,"avatar",void 0),lr([i()],ur.prototype,"styles",void 0),lr([i({attribute:!1})],ur.prototype,"_open",void 0),lr([o("#dialog")],ur.prototype,"_mdcElem",void 0),ur=lr([t("or-mwc-dialog")],ur);var fr=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};class hr extends CustomEvent{}class gr extends ur{constructor(){super(...arguments),this.multiSelect=!1,this.showOnlyDatapointAttrs=!1,this.showOnlyRuleStateAttrs=!1}connectedCallback(){super.connectedCallback(),this.heading=_t.i18next.t("selectAttributes"),this._setDialogContent(),this._setDialogActions(),this.dismissAction=null,this.styles=this._getStyles()}setShowOnlyDatapointAttrs(t){return this.showOnlyDatapointAttrs=t,this}setShowOnlyRuleStateAttrs(t){return this.showOnlyRuleStateAttrs=t,this}setMultiSelect(t){return this.multiSelect=t,this}setOpen(t){return super.setOpen(t),this}setHeading(t){return super.setHeading(t),this}setContent(t){throw new Error("Cannot modify attribute picker content")}setActions(t){throw new Error("Cannot modify attribute picker actions")}setDismissAction(t){throw new Error("Cannot modify attribute picker dismiss action")}setStyles(t){throw new Error("Cannot modify attribute picker styles")}setAvatar(t){throw new Error("Cannot modify attribute picker avatar setting")}_updateDialogContent(){this._setDialogContent()}_updateDialogActions(){this._setDialogActions()}_getAttributesTemplate(t,e,n,i=!1,r){return function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{d(i.next(t))}catch(t){o(t)}}function l(t){try{d(i.throw(t))}catch(t){o(t)}}function d(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,l)}d((i=i.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){const o=Math.max((null==t?void 0:t.length)||0,(null==e?void 0:e.length)||0),a=[];for(let n=0;n<o;n++)a.push({text:hi.Util.getAttributeLabel(null==t?void 0:t[n],null==e?void 0:e[n],void 0,!0),value:(null==t?void 0:t[n].name)||(null==e?void 0:e[n].name)});return K`
|
|
555
557
|
${Rt(i,(()=>K`
|
|
556
558
|
<or-mwc-list id="attribute-selector" .type="${Ei.MULTI_CHECKBOX}" .listItems="${a}" .values="${n}"
|
|
557
559
|
@or-mwc-list-changed="${t=>null==r?void 0:r(t.detail.map((t=>t.value)))}"
|