2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
export const id=980;export const ids=[980];export const modules={1980:(i,e,t)=>{var a=t(6312),n=t(5112),o=t(8857),d=t(5323),l=t(977),r=t(4897),s=t(8689),c=t(1453),p=t(207);let h;c.m.addInitializer((async i=>{await i.updateComplete;const e=i;e.dialog.prepend(e.scrim),e.scrim.style.inset=0,e.scrim.style.zIndex=0;const{getOpenAnimation:t,getCloseAnimation:a}=e;e.getOpenAnimation=()=>{const i=t.call(void 0);return i.container=[...i.container??[],...i.dialog??[]],i.dialog=[],i},e.getCloseAnimation=()=>{const i=a.call(void 0);return i.container=[...i.container??[],...i.dialog??[]],i.dialog=[],i}}));(0,a.A)([(0,o.EM)("ha-md-dialog")],(function(i,e){class a extends e{constructor(){super(),i(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),h||(h=t.e(314).then(t.bind(t,1314)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,o.MZ)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:()=>!1},{kind:"field",key:"_polyfillDialogRegistered",value:()=>!1},{kind:"method",key:"_handleOpen",value:async function(i){if(i.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const e=this.shadowRoot?.querySelector("dialog");(await h).default.registerDialog(e),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(i){const e=document.createElement("link");return e.rel="stylesheet",e.href=i,new Promise(((t,a)=>{e.onload=()=>t(),e.onerror=()=>a(new Error(`Stylesheet failed to load: ${i}`)),this.shadowRoot?.appendChild(e)}))}},{kind:"method",key:"_handleCancel",value:function(i){if(this.disableCancelAction){i.preventDefault();const e=this.shadowRoot?.querySelector("dialog .container");void 0!==this.animate&&e?.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2})}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,s.A)(a,"styles",this),n.AH`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`]}}]}}),c.m);p.T,p.N;(0,a.A)([(0,o.EM)("ha-dialog-header")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"method",key:"render",value:function(){return n.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}},{kind:"get",static:!0,key:"styles",value:function(){return[n.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}`]}}]}}),n.WF);t(6019),t(7460);var m=t(822),f=t(7449),u=t(542);(0,a.A)([(0,o.EM)("ha-textfield")],(function(i,e){class t extends e{constructor(...e){super(...e),i(this)}}return{F:t,d:[{kind:"field",decorators:[(0,o.MZ)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,o.MZ)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,o.MZ)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,o.MZ)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,o.MZ)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,o.MZ)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,o.MZ)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,o.P)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(i){(0,s.A)(t,"updated",this,3)([i]),(i.has("invalid")||i.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||i.has("invalid")&&void 0!==i.get("invalid"))&&this.reportValidity()),i.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),i.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),i.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(i,e=!1){const t=e?"trailing":"leading";return n.qy` <span class="mdc-text-field__icon mdc-text-field__icon--${t}" tabindex="${e?1:-1}"> <slot name="${t}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[f.R,n.AH`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}`,"rtl"===u.G.document.dir?n.AH`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:n.AH``]}]}}),m.J);(0,a.A)([(0,o.EM)("dialog-box")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"field",decorators:[(0,o.MZ)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.wk)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,o.wk)()],key:"_closeState",value:void 0},{kind:"field",decorators:[(0,o.P)("ha-textfield")],key:"_textField",value:void 0},{kind:"field",decorators:[(0,o.P)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:async function(i){this._params=i}},{kind:"method",key:"closeDialog",value:function(){return!this._params?.confirmation&&!this._params?.prompt&&(!this._params||(this._dismiss(),!0))}},{kind:"method",key:"render",value:function(){if(!this._params)return n.s6;const i=this._params.confirmation||this._params.prompt,e=this._params.title||this._params.confirmation&&this.hass.localize("ui.dialogs.generic.default_confirmation_title");return n.qy` <ha-md-dialog open .disableCancelAction="${i||!1}" @closed="${this._dialogClosed}" type="alert" aria-labelledby="dialog-box-title" aria-describedby="dialog-box-description"> <div slot="headline"> <span .title="${e}" id="dialog-box-title"> ${this._params.warning?n.qy`<ha-svg-icon .path="${"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16"}" style="color:var(--warning-color)"></ha-svg-icon> `:n.s6} ${e} </span> </div> <div slot="content" id="dialog-box-description"> ${this._params.text?n.qy` <p>${this._params.text}</p> `:""} ${this._params.prompt?n.qy` <ha-textfield dialogInitialFocus value="${(0,l.J)(this._params.defaultValue)}" .placeholder="${this._params.placeholder}" .label="${this._params.inputLabel?this._params.inputLabel:""}" .type="${this._params.inputType?this._params.inputType:"text"}" .min="${this._params.inputMin}" .max="${this._params.inputMax}"></ha-textfield> `:""} </div> <div slot="actions"> ${i&&n.qy` <ha-button @click="${this._dismiss}" ?dialogInitialFocus="${!this._params.prompt&&this._params.destructive}"> ${this._params.dismissText?this._params.dismissText:this.hass.localize("ui.dialogs.generic.cancel")} </ha-button> `} <ha-button @click="${this._confirm}" ?dialogInitialFocus="${!this._params.prompt&&!this._params.destructive}" class="${(0,d.H)({destructive:this._params.destructive||!1})}"> ${this._params.confirmText?this._params.confirmText:this.hass.localize("ui.dialogs.generic.ok")} </ha-button> </div> </ha-md-dialog> `}},{kind:"method",key:"_cancel",value:function(){this._params?.cancel&&this._params.cancel()}},{kind:"method",key:"_dismiss",value:function(){this._closeState="canceled",this._closeDialog(),this._cancel()}},{kind:"method",key:"_confirm",value:function(){this._closeState="confirmed",this._closeDialog(),this._params.confirm&&this._params.confirm(this._textField?.value)}},{kind:"method",key:"_closeDialog",value:function(){(0,r.r)(this,"dialog-closed",{dialog:this.localName}),this._dialog?.close()}},{kind:"method",key:"_dialogClosed",value:function(){this._closeState||((0,r.r)(this,"dialog-closed",{dialog:this.localName}),this._cancel()),this._closeState=void 0,this._params=void 0}},{kind:"get",static:!0,key:"styles",value:function(){return n.AH`:host([inert]){pointer-events:initial!important;cursor:initial!important}a{color:var(--primary-color)}p{margin:0;color:var(--primary-text-color)}.no-bottom-padding{padding-bottom:0}.secondary{color:var(--secondary-text-color)}.destructive{--mdc-theme-primary:var(--error-color)}ha-textfield{width:100%}`}}]}}),n.WF)}};
|
|
//# sourceMappingURL=980.hKGcUt97H_A.js.map
|