UNPKG

iobroker.lovelace

Version:

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

3 lines 12.6 kB
/*! For license information please see 38267.a31b41730f8bdde1.js.LICENSE.txt */ "use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["38267"],{95198:function(e,t,o){var i=o(61701),a=(o(71695),o(47021),o(57243)),n=o(50778);let s,l,r=e=>e;(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(0,a.dy)(s||(s=r` <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[(0,a.iv)(l||(l=r`: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:()=>g,zB:()=>p});var i=o(61701),a=o(72621),n=(o(52247),o(71695),o(19423),o(40251),o(47021),o(67840)),s=o(88854),l=o(57243),r=o(50778);let d,c,h=e=>e;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=()=>{var e,t;const i=o.call(void 0);return i.container=[...null!==(e=i.container)&&void 0!==e?e:[],...null!==(t=i.dialog)&&void 0!==t?t:[]],i.dialog=[],i},t.getCloseAnimation=()=>{var e,t;const o=i.call(void 0);return o.container=[...null!==(e=o.container)&&void 0!==e?e:[],...null!==(t=o.dialog)&&void 0!==t?t:[]],o.dialog=[],o}}));(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),c||(c=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(){return!1}},{kind:"field",key:"_polyfillDialogRegistered",value(){return!1}},{kind:"method",key:"_handleOpen",value:async function(e){var t;if(e.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog");(await c).default.registerDialog(o),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)=>{var a;t.onload=()=>o(),t.onerror=()=>i(new Error(`Stylesheet failed to load: ${e}`)),null===(a=this.shadowRoot)||void 0===a||a.appendChild(t)}))}},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){var t;e.preventDefault();const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog .container");void 0!==this.animate&&(null==o||o.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),(0,l.iv)(d||(d=h`: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 u=Object.assign(Object.assign({},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"}]]}),m=Object.assign(Object.assign({},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"}]]}),g=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?u:s.I,p=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?m:s.G},18049:function(e,t,o){var i=o(61701),a=o(72621),n=(o(71695),o(47021),o(68245)),s=o(57243),l=o(50778);let r,d=e=>e;(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),(0,s.iv)(r||(r=d`: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(61701),a=o(72621),n=(o(71695),o(47021),o(84626)),s=o(57243),l=o(50778);let r,d=e=>e;(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),(0,s.iv)(r||(r=d`: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(61701),a=(o(19083),o(71695),o(92745),o(61893),o(40251),o(19134),o(97003),o(47021),o(57243)),n=o(50778),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);let h,u,m,g=e=>e;(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(){return 500}},{kind:"field",decorators:[(0,n.IO)("ha-md-dialog")],key:"_dialogElement",value:void 0},{kind:"method",key:"showDialog",value:function(e){var t;this._dialogParams=e,this._lineCount=(null===(t=this._dialogParams)||void 0===t?void 0:t.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))),(0,a.dy)(h||(h=g` <ha-md-dialog open @closed="${0}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title" id="dialog-light-color-favorite-title"> ${0} </span> <span slot="subtitle"> ${0}${0} </span> </ha-dialog-header> <div slot="content" class="content"> <div> ${0}: </div> <ha-md-select .label="${0}" @change="${0}" .value="${0}"> ${0} </ha-md-select> </div> <div slot="actions"> <ha-button @click="${0}"> ${0} </ha-button> <ha-button @click="${0}"> ${0} </ha-button> </div> </ha-md-dialog> `),this._dialogClosed,this.closeDialog,this.hass.localize("ui.common.close"),"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",this.hass.localize("ui.panel.config.logs.download_logs"),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})}`,this.hass.localize("ui.panel.config.logs.select_number_of_lines"),this.hass.localize("ui.panel.config.logs.lines"),this._setNumberOfLogs,String(this._lineCount),e.map((e=>(0,a.dy)(u||(u=g` <ha-md-select-option .value="${0}"> ${0} </ha-md-select-option> `),String(e),e))),this.closeDialog,this.hass.localize("ui.common.cancel"),this._downloadLogs,this.hass.localize("ui.common.download"))}},{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,(0,a.iv)(m||(m=g`: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),o(63721);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});o(22152),o(63721),o(52247);var i=o(9065),a=o(50778),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(){var e;return null!==(e=this.getAttribute("name"))&&void 0!==e?e:""}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.a31b41730f8bdde1.js.map