iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 17.1 kB
JavaScript
/*! For license information please see 40648.7422cf5edc92ed82.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["40648"],{51784:function(e,t,i){i.d(t,{dJ:()=>p,zB:()=>v});var a=i(61701),o=i(72621),n=(i(52247),i(71695),i(19423),i(40251),i(47021),i(67840)),s=i(88854),r=i(57243),l=i(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:i,getCloseAnimation:a}=t;t.getOpenAnimation=()=>{var e,t;const a=i.call(void 0);return a.container=[...null!==(e=a.container)&&void 0!==e?e:[],...null!==(t=a.dialog)&&void 0!==t?t:[]],a.dialog=[],a},t.getCloseAnimation=()=>{var e,t;const i=a.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}}));(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),c||(c=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(){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 i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog");(await c).default.registerDialog(i),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)=>{var o;t.onload=()=>i(),t.onerror=()=>a(new Error(`Stylesheet failed to load: ${e}`)),null===(o=this.shadowRoot)||void 0===o||o.appendChild(t)}))}},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){var t;e.preventDefault();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog .container");void 0!==this.animate&&(null==i||i.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),(0,r.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} 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 m=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"}]]}),u=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"}]]}),p=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?m:s.I,v=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?u:s.G},18049:function(e,t,i){var a=i(61701),o=i(72621),n=(i(71695),i(47021),i(68245)),s=i(57243),r=i(50778);let l,d=e=>e;(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),(0,s.iv)(l||(l=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,i){var a=i(61701),o=i(72621),n=(i(71695),i(47021),i(84626)),s=i(57243),r=i(50778);let l,d=e=>e;(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),(0,s.iv)(l||(l=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)},38321:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HuiDialogSelectDashboard:()=>b});var o=i(61701),n=(i(71695),i(9359),i(70104),i(40251),i(47021),i(57243)),s=i(50778),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];let m,u,p,v,g,y=e=>e;const f="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 b=(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(){return!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(){var e;this._saving=!1,this._dashboards=void 0,this._toUrlPath=void 0,null===(e=this._dialog)||void 0===e||e.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(0,n.dy)(m||(m=y` <ha-md-dialog open ="${0}" .ariaLabel="${0}" .disableCancelAction="${0}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" .label="${0}" .path="${0}" ="${0}" .disabled="${0}"></ha-icon-button> <span slot="title" .title="${0}">${0}</span> </ha-dialog-header> <div slot="content"> ${0} </div> <div slot="actions"> <ha-button ="${0}" .disabled="${0}"> ${0} </ha-button> <ha-button ="${0}" .disabled="${0}"> ${0} </ha-button> </div> </ha-md-dialog> `),this._dialogClosed,e,this._saving,this.hass.localize("ui.common.close"),f,this.closeDialog,this._saving,e,e,this._dashboards&&!this._saving?(0,n.dy)(u||(u=y` <ha-md-select .label="${0}" ="${0}" .value="${0}"> ${0} </ha-md-select> `),this.hass.localize("ui.panel.lovelace.editor.select_view.dashboard_label"),this._dashboardChanged,this._toUrlPath||"",this._dashboards.map((e=>(0,n.dy)(p||(p=y` <ha-md-select-option .disabled="${0}" .value="${0}">${0}</ha-md-select-option> `),"storage"!==e.mode||e.url_path===this._fromUrlPath||"lovelace"===e.url_path&&null===this._fromUrlPath,e.url_path,e.title)))):(0,n.dy)(v||(v=y`<div class="loading"> <ha-spinner size="medium"></ha-spinner> </div>`)),this.closeDialog,this._saving,this.hass.localize("ui.common.cancel"),this._selectDashboard,!this._config||this._fromUrlPath===this._toUrlPath||this._saving,this._params.actionLabel||this.hass.localize("ui.common.move"))}},{kind:"method",key:"_getDashboards",value:async function(){var e;this._dashboards=[{id:"lovelace",url_path:"lovelace",require_admin:!1,show_in_sidebar:!0,title:this.hass.localize("ui.common.default"),mode:null===(e=this.hass.panels.lovelace)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.mode},...this._params.dashboards||await(0,d.j2)(this.hass)];const t=this._fromUrlPath||this.hass.defaultPanel;for(const i of this._dashboards)if(i.url_path!==t){this._toUrlPath=i.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,(0,n.iv)(g||(g=y`ha-md-select{width:100%}.loading{display:flex;justify-content:center}`))]}}]}}),n.oi);a()}catch(m){a(m)}}))},1231:function(e,t,i){i.d(t,{B:()=>d});var a=i(9065),o=i(50778),n=(i(71695),i(47021),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);let r;const l=(0,n.iv)(r||(r=(e=>e)`: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%}{:host::before{background:CanvasText}}`));let d=class extends s{};d.styles=[l],d=(0,a.__decorate)([(0,o.Mo)("md-divider")],d)},43895:function(e,t,i){i.d(t,{_:()=>o});i(22152),i(92745),i(9359),i(31526),i(81804);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:()=>o});let a;const o=(0,i(57243).iv)(a||(a=(e=>e)`: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))}{: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.7422cf5edc92ed82.js.map