iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 10.4 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["30247"],{95198:function(e,i,t){var a=t(61701),o=(t(71695),t(47021),t(57243)),n=t(50778);let l,s,d=e=>e;(0,a.Z)([(0,n.Mo)("ha-dialog-header")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,o.dy)(l||(l=d` <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,o.iv)(s||(s=d`: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)} 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}`))]}}]}}),o.oi)},73729:function(e,i,t){t.d(i,{i:()=>v});var a=t(61701),o=t(72621),n=(t(22152),t(71695),t(47021),t(74966)),l=t(51408),s=t(57243),d=t(50778),r=t(76525);t(23334);let c,h,p,g=e=>e;const u=["button","ha-list-item"],v=(e,i)=>{var t;return(0,s.dy)(c||(c=g` <div class="header_title"> <ha-icon-button .label="${0}" .path="${0}" dialogAction="close" class="header_button"></ha-icon-button> <span>${0}</span> </div> `),null!==(t=null==e?void 0:e.localize("ui.common.close"))&&void 0!==t?t:"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",i)};(0,a.Z)([(0,d.Mo)("ha-dialog")],(function(e,i){class t extends i{constructor(...i){super(...i),e(this)}}return{F:t,d:[{kind:"field",key:r.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,i){var t;null===(t=this.contentElement)||void 0===t||t.scrollTo(e,i)}},{kind:"method",key:"renderHeading",value:function(){return(0,s.dy)(h||(h=g`<slot name="heading"> ${0} </slot>`),(0,o.Z)(t,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,o.Z)(t,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,u].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(t,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value(){return[l.W,(0,s.iv)(p||(p=g`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(
--dialog-scroll-divider-color,
var(--divider-color)
);z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`))]}}]}}),n.M)},44111:function(e,i,t){t.a(e,(async function(e,a){try{t.r(i),t.d(i,{HuiSaveConfig:()=>$});var o=t(61701),n=(t(40251),t(31622),t(57243)),l=t(50778),s=t(36522),d=t(17170),r=(t(73729),t(95198),t(55486),t(23334),t(1888),t(64889),t(28008)),c=t(73192),h=t(28421),p=e([d]);d=(p.then?(await p)():p)[0];let g,u,v,m,f,_,b,k=e=>e;const y="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",x="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",w={views:[{title:"Home"}]};let $=(0,o.Z)([(0,l.Mo)("hui-dialog-save-config")],(function(e,i){return{F:class extends i{constructor(){super(),e(this),this._saving=!1}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_emptyConfig",value(){return!1}},{kind:"field",decorators:[(0,l.SB)()],key:"_saving",value:void 0},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._emptyConfig=!1}},{kind:"method",key:"closeDialog",value:function(){return this._params=void 0,(0,s.B)(this,"dialog-closed",{dialog:this.localName}),!0}},{kind:"method",key:"render",value:function(){if(!this._params)return n.Ld;const e=this.hass.localize("ui.panel.lovelace.editor.save_config.header");return(0,n.dy)(g||(g=k` <ha-dialog open scrimClickAction escapeKeyAction ="${0}" .heading="${0}"> <ha-dialog-header slot="heading"> <ha-icon-button slot="navigationIcon" dialogAction="cancel" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title">${0}</span> <a href="${0}" title="${0}" target="_blank" rel="noreferrer" slot="actionItems"> <ha-icon-button .path="${0}" .label="${0}"></ha-icon-button> </a> </ha-dialog-header> <div> <p> ${0} </p> ${0} </div> ${0} </ha-dialog> `),this._close,e,this.hass.localize("ui.common.close"),y,e,(0,c.R)(this.hass,"/lovelace/"),this.hass.localize("ui.panel.lovelace.menu.help"),x,this.hass.localize("ui.common.help"),this.hass.localize("ui.panel.lovelace.editor.save_config.para"),"storage"===this._params.mode?(0,n.dy)(u||(u=k` <p> ${0} </p> <ha-formfield .label="${0}"> <ha-switch .checked="${0}" ="${0}" dialogInitialFocus></ha-switch></ha-formfield> `),this.hass.localize("ui.panel.lovelace.editor.save_config.para_sure"),this.hass.localize("ui.panel.lovelace.editor.save_config.empty_config"),this._emptyConfig,this._emptyConfigChanged):(0,n.dy)(v||(v=k` <p> ${0} </p> <p> ${0} </p> <p> ${0} </p> <ha-yaml-editor .hass="${0}" .defaultValue="${0}" dialogInitialFocus></ha-yaml-editor> `),this.hass.localize("ui.panel.lovelace.editor.save_config.yaml_mode"),this.hass.localize("ui.panel.lovelace.editor.save_config.yaml_control"),this.hass.localize("ui.panel.lovelace.editor.save_config.yaml_config"),this.hass,this._params.lovelace.config),"storage"===this._params.mode?(0,n.dy)(m||(m=k` <mwc-button slot="primaryAction" ="${0}"> ${0} </mwc-button> <mwc-button slot="primaryAction" ?disabled="${0}" ="${0}"> ${0} ${0} </mwc-button> `),this.closeDialog,this.hass.localize("ui.common.cancel"),this._saving,this._saveConfig,this._saving?(0,n.dy)(f||(f=k`<ha-spinner size="small" aria-label="Saving"></ha-spinner>`)):"",this.hass.localize("ui.panel.lovelace.editor.save_config.save")):(0,n.dy)(_||(_=k` <mwc-button slot="primaryAction" ="${0}"> ${0}</mwc-button> `),this.closeDialog,this.hass.localize("ui.panel.lovelace.editor.save_config.close")))}},{kind:"method",key:"_close",value:function(e){e&&e.stopPropagation(),this.closeDialog()}},{kind:"method",key:"_emptyConfigChanged",value:function(e){this._emptyConfig=e.target.checked}},{kind:"method",key:"_saveConfig",value:async function(){if(this.hass&&this._params){this._saving=!0;try{const e=this._params.lovelace;await e.saveConfig(this._emptyConfig?w:await(0,h.mQ)(e.config,this.hass)),e.setEditMode(!0),this._saving=!1,this.closeDialog()}catch(e){alert(`Saving failed: ${e.message}`),this._saving=!1}}}},{kind:"get",static:!0,key:"styles",value:function(){return[r.yu,(0,n.iv)(b||(b=k`ha-dialog{--dialog-content-padding:0 24px 24px 24px}ha-dialog-header a{color:inherit;text-decoration:none}`))]}}]}}),n.oi);a()}catch(g){a(g)}}))}}]);
//# sourceMappingURL=30247.103c6ba3a1eedab6.js.map