UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

3 lines 11.7 kB
/*! For license information please see 38267.32796f5678fb1dd2.js.LICENSE.txt */ export const __webpack_ids__=["38267"];export const __webpack_modules__={95198:function(e,t,o){var i=o(44249),a=o(57243),n=o(15093);(0,i.Z)([(0,n.Mo)("ha-dialog-header")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return a.dy` <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[a.iv`: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}`]}}]}}),a.oi)},51784:function(e,t,o){o.d(t,{dJ:()=>u,zB:()=>m});var i=o(44249),a=o(72621),n=o(67840),s=o(88854),l=o(57243),r=o(15093);let d;n.A.addInitializer((async e=>{await e.updateComplete;const t=e;t.dialog.prepend(t.scrim),t.scrim.style.inset=0,t.scrim.style.zIndex=0;const{getOpenAnimation:o,getCloseAnimation:i}=t;t.getOpenAnimation=()=>{const e=o.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e},t.getCloseAnimation=()=>{const e=i.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e}}));(0,i.Z)([(0,r.Mo)("ha-md-dialog")],(function(e,t){class i extends t{constructor(){super(),e(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),d||(d=o.e("73854").then(o.bind(o,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:()=>!1},{kind:"field",key:"_polyfillDialogRegistered",value:()=>!1},{kind:"method",key:"_handleOpen",value:async function(e){if(e.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const t=this.shadowRoot?.querySelector("dialog");(await d).default.registerDialog(t),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=e,new Promise(((o,i)=>{t.onload=()=>o(),t.onerror=()=>i(new Error(`Stylesheet failed to load: ${e}`)),this.shadowRoot?.appendChild(t)}))}},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){e.preventDefault();const t=this.shadowRoot?.querySelector("dialog .container");void 0!==this.animate&&t?.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,a.Z)(i,"styles",this),l.iv`: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}`]}}]}}),n.A);const c={...s.I,dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]},h={...s.G,dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]},u=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?c:s.I,m=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?h:s.G},18049:function(e,t,o){var i=o(44249),a=o(72621),n=o(68245),s=o(57243),l=o(15093);(0,i.Z)([(0,l.Mo)("ha-md-select-option")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(o,"styles",this),s.iv`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}`]}}]}}),n.y)},67846:function(e,t,o){var i=o(44249),a=o(72621),n=o(84626),s=o(57243),l=o(15093);(0,i.Z)([(0,l.Mo)("ha-md-select")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(o,"styles",this),s.iv`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface-variant:var(--secondary-text-color);--md-sys-color-surface-container-highest:var(--input-fill-color);--md-sys-color-on-surface:var(--input-ink-color);--md-sys-color-surface-container:var(--input-fill-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-sys-color-secondary-container:var(--input-fill-color);--md-menu-container-color:var(--card-background-color)}`]}}]}}),n.K)},1518:function(e,t,o){o.r(t);var i=o(44249),a=(o(92745),o(57243)),n=o(15093),s=o(36522),l=(o(59826),o(95198),o(23334),o(51784),o(67846),o(18049),o(43546)),r=o(79960),d=o(28008),c=o(58014);(0,i.Z)([(0,n.Mo)("dialog-download-logs")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_dialogParams",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_lineCount",value:()=>500},{kind:"field",decorators:[(0,n.IO)("ha-md-dialog")],key:"_dialogElement",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._dialogParams=e,this._lineCount=this._dialogParams?.defaultLineCount||500}},{kind:"method",key:"closeDialog",value:function(){this._dialogElement.close()}},{kind:"method",key:"_dialogClosed",value:function(){this._dialogParams=void 0,this._lineCount=500,(0,s.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){if(!this._dialogParams)return a.Ld;const e=[100,500,1e3,5e3,1e4];return!e.includes(this._lineCount)&&this._lineCount&&(e.push(this._lineCount),e.sort(((e,t)=>e-t))),a.dy` <ha-md-dialog open @closed="${this._dialogClosed}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" @click="${this.closeDialog}" .label="${this.hass.localize("ui.common.close")}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}"></ha-icon-button> <span slot="title" id="dialog-light-color-favorite-title"> ${this.hass.localize("ui.panel.config.logs.download_logs")} </span> <span slot="subtitle"> ${this._dialogParams.header}${0===this._dialogParams.boot?"":` ⸱ ${-1===this._dialogParams.boot?this.hass.localize("ui.panel.config.logs.previous"):this.hass.localize("ui.panel.config.logs.startups_ago",{boot:-1*this._dialogParams.boot})}`} </span> </ha-dialog-header> <div slot="content" class="content"> <div> ${this.hass.localize("ui.panel.config.logs.select_number_of_lines")}: </div> <ha-md-select .label="${this.hass.localize("ui.panel.config.logs.lines")}" @change="${this._setNumberOfLogs}" .value="${String(this._lineCount)}"> ${e.map((e=>a.dy` <ha-md-select-option .value="${String(e)}"> ${e} </ha-md-select-option> `))} </ha-md-select> </div> <div slot="actions"> <ha-button @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button @click="${this._downloadLogs}"> ${this.hass.localize("ui.common.download")} </ha-button> </div> </ha-md-dialog> `}},{kind:"method",key:"_downloadLogs",value:async function(){const e=this._dialogParams.provider,t=this._dialogParams.boot,o=(new Date).toISOString().replace(/:/g,"-"),i=(0,r.Bq)(e,this._lineCount,t),a="core"!==e?`${e}_${o}.log`:`home-assistant_${o}.log`,n=await(0,l.iI)(this.hass,i);(0,c.N)(n.path,a),this.closeDialog()}},{kind:"method",key:"_setNumberOfLogs",value:function(e){this._lineCount=Number(e.target.value)}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,d.yu,a.iv`:host{direction:var(--direction);--dialog-content-overflow:visible}.content{display:flex;flex-direction:column;align-items:center;gap:8px}`]}}]}}),a.oi)},79679:function(e,t,o){function i(e,t){!t.bubbles||e.shadowRoot&&!t.composed||t.stopPropagation();const o=Reflect.construct(t.constructor,[t.type,t]),i=e.dispatchEvent(o);return i||t.preventDefault(),i}o.d(t,{e:()=>i})},61073:function(e,t,o){o.d(t,{N:()=>n,b:()=>i});o(67351);const i=Symbol("internals"),a=Symbol("privateInternals");function n(e){return class extends e{get[i](){return this[a]||(this[a]=this.attachInternals()),this[a]}}}},19484:function(e,t,o){o.d(t,{$u:()=>s,hz:()=>r});var i=o(9065),a=o(15093),n=o(61073);const s=Symbol("getFormValue"),l=Symbol("getFormState");function r(e){class t extends e{get form(){return this[n.b].form}get labels(){return this[n.b].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e,t,o){if("name"!==e&&"disabled"!==e)super.attributeChangedCallback(e,t,o);else{const o="disabled"===e?null!==t:t;this.requestUpdate(e,o)}}requestUpdate(e,t,o){super.requestUpdate(e,t,o),this[n.b].setFormValue(this[s](),this[l]())}[s](){throw new Error("Implement [getFormValue]")}[l](){return this[s]()}formDisabledCallback(e){this.disabled=e}}return t.formAssociated=!0,(0,i.__decorate)([(0,a.Cb)({noAccessor:!0})],t.prototype,"name",null),(0,i.__decorate)([(0,a.Cb)({type:Boolean,noAccessor:!0})],t.prototype,"disabled",null),t}}}; //# sourceMappingURL=38267.32796f5678fb1dd2.js.map