UNPKG

iobroker.lovelace

Version:

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

3 lines 16.2 kB
/*! For license information please see 40648.6a948ca01eade3b8.js.LICENSE.txt */ export const __webpack_ids__=["40648"];export const __webpack_modules__={51784:function(e,t,i){i.d(t,{dJ:()=>m,zB:()=>u});var a=i(44249),o=i(72621),n=i(67840),s=i(88854),r=i(57243),l=i(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:i,getCloseAnimation:a}=t;t.getOpenAnimation=()=>{const e=i.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e},t.getCloseAnimation=()=>{const e=a.call(void 0);return e.container=[...e.container??[],...e.dialog??[]],e.dialog=[],e}}));(0,a.Z)([(0,l.Mo)("ha-md-dialog")],(function(e,t){class a extends t{constructor(){super(),e(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),d||(d=i.e("73854").then(i.bind(i,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,l.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(((i,a)=>{t.onload=()=>i(),t.onerror=()=>a(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,o.Z)(a,"styles",this),r.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"}]]},m=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?c:s.I,u=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?h:s.G},18049:function(e,t,i){var a=i(44249),o=i(72621),n=i(68245),s=i(57243),r=i(15093);(0,a.Z)([(0,r.Mo)("ha-md-select-option")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"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,i){var a=i(44249),o=i(72621),n=i(84626),s=i(57243),r=i(15093);(0,a.Z)([(0,r.Mo)("ha-md-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"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)},38321:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiDialogSelectDashboard:()=>u});var o=i(44249),n=(i(9359),i(70104),i(57243)),s=i(15093),r=i(36522),l=(i(51784),i(95198),i(23334),i(67846),i(18049),i(59826),i(17170)),d=i(6649),c=i(28008),h=e([l]);l=(h.then?(await h)():h)[0];const m="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";let u=(0,o.Z)([(0,s.Mo)("hui-dialog-select-dashboard")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_dashboards",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_fromUrlPath",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_toUrlPath",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_saving",value:()=>!1},{kind:"field",decorators:[(0,s.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._config=e.lovelaceConfig,this._fromUrlPath=e.urlPath,this._params=e,this._getDashboards()}},{kind:"method",key:"closeDialog",value:function(){this._saving=!1,this._dashboards=void 0,this._toUrlPath=void 0,this._dialog?.close()}},{kind:"method",key:"_dialogClosed",value:function(){this._params=void 0,(0,r.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){if(!this._params)return n.Ld;const e=this._params.header||this.hass.localize("ui.panel.lovelace.editor.select_dashboard.header");return n.dy` <ha-md-dialog open @closed="${this._dialogClosed}" .ariaLabel="${e}" .disableCancelAction="${this._saving}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" .label="${this.hass.localize("ui.common.close")}" .path="${m}" @click="${this.closeDialog}" .disabled="${this._saving}"></ha-icon-button> <span slot="title" .title="${e}">${e}</span> </ha-dialog-header> <div slot="content"> ${this._dashboards&&!this._saving?n.dy` <ha-md-select .label="${this.hass.localize("ui.panel.lovelace.editor.select_view.dashboard_label")}" @change="${this._dashboardChanged}" .value="${this._toUrlPath||""}"> ${this._dashboards.map((e=>n.dy` <ha-md-select-option .disabled="${"storage"!==e.mode||e.url_path===this._fromUrlPath||"lovelace"===e.url_path&&null===this._fromUrlPath}" .value="${e.url_path}">${e.title}</ha-md-select-option> `))} </ha-md-select> `:n.dy`<div class="loading"> <ha-spinner size="medium"></ha-spinner> </div>`} </div> <div slot="actions"> <ha-button @click="${this.closeDialog}" .disabled="${this._saving}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button @click="${this._selectDashboard}" .disabled="${!this._config||this._fromUrlPath===this._toUrlPath||this._saving}"> ${this._params.actionLabel||this.hass.localize("ui.common.move")} </ha-button> </div> </ha-md-dialog> `}},{kind:"method",key:"_getDashboards",value:async function(){this._dashboards=[{id:"lovelace",url_path:"lovelace",require_admin:!1,show_in_sidebar:!0,title:this.hass.localize("ui.common.default"),mode:this.hass.panels.lovelace?.config?.mode},...this._params.dashboards||await(0,d.j2)(this.hass)];const e=this._fromUrlPath||this.hass.defaultPanel;for(const t of this._dashboards)if(t.url_path!==e){this._toUrlPath=t.url_path;break}}},{kind:"method",key:"_dashboardChanged",value:async function(e){const t=e.target.value;t!==this._toUrlPath&&(this._toUrlPath=t)}},{kind:"method",key:"_selectDashboard",value:async function(){this._saving=!0,"lovelace"===this._toUrlPath&&(this._toUrlPath=null),this._params.dashboardSelectedCallback(this._toUrlPath),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[c.yu,n.iv`ha-md-select{width:100%}.loading{display:flex;justify-content:center}`]}}]}}),n.oi);a()}catch(e){a(e)}}))},1231:function(e,t,i){i.d(t,{B:()=>l});var a=i(9065),o=i(15093),n=i(57243);class s extends n.oi{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}(0,a.__decorate)([(0,o.Cb)({type:Boolean,reflect:!0})],s.prototype,"inset",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean,reflect:!0,attribute:"inset-start"})],s.prototype,"insetStart",void 0),(0,a.__decorate)([(0,o.Cb)({type:Boolean,reflect:!0,attribute:"inset-end"})],s.prototype,"insetEnd",void 0);const r=n.iv`:host{box-sizing:border-box;color:var(--md-divider-color,var(--md-sys-color-outline-variant,#cac4d0));display:flex;height:var(--md-divider-thickness,1px);width:100%}:host([inset-start]),:host([inset]){padding-inline-start:16px}:host([inset-end]),:host([inset]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors:active){:host::before{background:CanvasText}}`;let l=class extends s{};l.styles=[r],l=(0,a.__decorate)([(0,o.Mo)("md-divider")],l)},43895:function(e,t,i){i.d(t,{_:()=>o});i(92745),i(9359),i(31526);var a=i(7162);class o{constructor(e,t){this.host=e,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent((0,a.d7)(this.host,{kind:a.GB.CLICK_SELECTION}))},this.onKeydown=e=>{if(this.host.href&&"Enter"===e.code){const e=this.getInteractiveElement();e instanceof HTMLAnchorElement&&e.click()}if(e.defaultPrevented)return;const t=e.code;this.host.keepOpen&&"Escape"!==t||(0,a.kE)(t)&&(e.preventDefault(),this.host.dispatchEvent((0,a.d7)(this.host,{kind:a.GB.KEYDOWN,key:t})))},this.getHeadlineElements=t.getHeadlineElements,this.getSupportingTextElements=t.getSupportingTextElements,this.getDefaultElements=t.getDefaultElements,this.getInteractiveElement=t.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const e=this.getHeadlineElements(),t=[];return e.forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getDefaultElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getSupportingTextElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),t.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(e){this.internalTypeaheadText=e}}},99072:function(e,t,i){i.d(t,{W:()=>a});const a=i(57243).iv`:host{display:flex;--md-ripple-hover-color:var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity:var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color:var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity:var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, .3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape:8px}a,button,li{background:0 0;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:0;-webkit-tap-highlight-color:transparent}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color,var(--md-sys-color-on-surface,#1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight,var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400)));min-height:var(--md-menu-item-one-line-container-height,56px);padding-top:var(--md-menu-item-top-space,12px);padding-bottom:var(--md-menu-item-bottom-space,12px);padding-inline-start:var(--md-menu-item-leading-space,16px);padding-inline-end:var(--md-menu-item-trailing-space,16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height,72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, .875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight,var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, .6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight,var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}.list-item{background-color:var(--md-menu-item-container-color,transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color,var(--md-sys-color-secondary-container,#e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color,var(--md-sys-color-on-secondary-container,#1d192b))}@media(forced-colors:active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}`}}; //# sourceMappingURL=40648.6a948ca01eade3b8.js.map