iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 12.1 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9979"],{95198:function(e,i,t){var a=t(61701),o=(t(71695),t(47021),t(57243)),n=t(50778);let d,l,s=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)(d||(d=s` <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)(l||(l=s`: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:()=>m});var a=t(61701),o=t(72621),n=(t(22152),t(71695),t(47021),t(74966)),d=t(51408),l=t(57243),s=t(50778),r=t(76525);t(23334);let c,h,g,u=e=>e;const p=["button","ha-list-item"],m=(e,i)=>{var t;return(0,l.dy)(c||(c=u` <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,s.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,l.dy)(h||(h=u`<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,p].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[d.W,(0,l.iv)(g||(g=u`: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)},86614:function(e,i,t){t.a(e,(async function(e,a){try{t.r(i);var o=t(61701),n=(t(71695),t(19423),t(40251),t(47021),t(57243)),d=t(50778),l=t(36522),s=t(49976),r=(t(59826),t(34273),t(73729),t(95198),t(23334),t(28008)),c=t(58885),h=t(32930),g=t(16815),u=e([g]);g=(u.then?(await u)():u)[0];let p,m,v=e=>e;const f="M12,15C7.58,15 4,16.79 4,19V21H20V19C20,16.79 16.42,15 12,15M8,9A4,4 0 0,0 12,13A4,4 0 0,0 16,9M11.5,2C11.2,2 11,2.21 11,2.5V5.5H10V3C10,3 7.75,3.86 7.75,6.75C7.75,6.75 7,6.89 7,8H17C16.95,6.89 16.25,6.75 16.25,6.75C16.25,3.86 14,3 14,3V5.5H13V2.5C13,2.21 12.81,2 12.5,2H11.5Z",_="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",b="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",k="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z";(0,o.Z)([(0,d.Mo)("dialog-dashboard-strategy-editor")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_strategyConfig",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_GUImode",value(){return!0}},{kind:"field",decorators:[(0,d.SB)()],key:"_guiModeAvailable",value(){return!0}},{kind:"field",decorators:[(0,d.IO)("hui-dashboard-strategy-element-editor")],key:"_strategyEditorEl",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this._params=e,this._strategyConfig=e.config.strategy,await this.updateComplete}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._strategyConfig=void 0,this._guiModeAvailable=!0,this._GUImode=!0,(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"_handleConfigChanged",value:function(e){e.stopPropagation(),this._guiModeAvailable=e.detail.guiModeAvailable,this._strategyConfig=e.detail.config}},{kind:"method",key:"_handleGUIModeChanged",value:function(e){e.stopPropagation(),this._GUImode=e.detail.guiMode,this._guiModeAvailable=e.detail.guiModeAvailable}},{kind:"method",key:"_opened",value:function(){var e;null===(e=this._strategyEditorEl)||void 0===e||e.focusYamlEditor()}},{kind:"method",key:"_save",value:async function(){await this._params.saveConfig(Object.assign(Object.assign({},this._params.config),{},{strategy:this._strategyConfig})),(0,c.f)(this,this.hass),this.closeDialog()}},{kind:"method",key:"_delete",value:async function(e){e.stopPropagation(),await this._params.deleteDashboard()&&this.closeDialog()}},{kind:"method",key:"_cancel",value:function(e){e.stopPropagation(),this.closeDialog()}},{kind:"method",key:"_handleAction",value:function(e){switch(e.stopPropagation(),e.detail.index){case 0:this._toggleMode();break;case 1:this._takeControl()}}},{kind:"method",key:"_toggleMode",value:function(){var e;null===(e=this._strategyEditorEl)||void 0===e||e.toggleMode()}},{kind:"method",key:"_takeControl",value:function(){this._params.takeControl(),this.closeDialog()}},{kind:"method",key:"render",value:function(){if(!this._params||!this._strategyConfig)return n.Ld;const e=(0,h.n2)(this._strategyConfig),i=this.hass.localize("ui.panel.lovelace.editor.strategy-editor.header");return(0,n.dy)(p||(p=v` <ha-dialog open ="${0}" 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" .title="${0}">${0}</span> <ha-button-menu corner="BOTTOM_END" menu-corner="END" slot="actionItems" ="${0}" fixed ="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-list-item graphic="icon" .disabled="${0}"> ${0} <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> </ha-list-item> <ha-list-item graphic="icon"> ${0} <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> </ha-list-item> </ha-button-menu> </ha-dialog-header> <div class="content"> <hui-dashboard-strategy-element-editor .hass="${0}" .lovelace="${0}" .value="${0}" -changed="${0}" -changed="${0}" dialogInitialFocus></hui-dashboard-strategy-element-editor> </div> <ha-button class="danger" ="${0}" slot="secondaryAction"> ${0} </ha-button> <ha-button ="${0}" slot="primaryAction"> ${0} </ha-button> <ha-button ="${0}" slot="primaryAction"> ${0} </ha-button> </ha-dialog> `),this.closeDialog,this._opened,i||"-",this.hass.localize("ui.common.close"),_,i,i,s.U,this._handleAction,this.hass.localize("ui.common.menu"),b,!this._guiModeAvailable&&!this._GUImode,this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._GUImode?"yaml":"ui")),k,this.hass.localize("ui.panel.lovelace.editor.strategy-editor.take_control"),f,this.hass,this._params.config,e,this._handleConfigChanged,this._handleGUIModeChanged,this._delete,this.hass.localize("ui.common.delete"),this._cancel,this.hass.localize("ui.common.cancel"),this._save,this.hass.localize("ui.common.save"))}},{kind:"get",static:!0,key:"styles",value:function(){return[r.yu,(0,n.iv)(m||(m=v`ha-dialog{--dialog-content-padding:0 24px;--dialog-surface-position:fixed;--dialog-surface-top:40px;--mdc-dialog-min-width:min(600px, calc(100% - 32px));--mdc-dialog-max-width:calc(100% - 32px);--mdc-dialog-max-height:calc(100% - 80px)} all and (max-width:450px),all and (max-height:500px){ha-dialog{height:100%;--dialog-surface-top:0px;--mdc-dialog-min-width:100%;--mdc-dialog-max-width:100%;--mdc-dialog-max-height:100%;--dialog-content-padding:8px}}.danger{--mdc-theme-primary:var(--error-color)}`))]}}]}}),n.oi);a()}catch(p){a(p)}}))},58885:function(e,i,t){t.d(i,{f:()=>o});var a=t(72473);const o=(e,i)=>(0,a.C)(e,{message:i.localize("ui.common.successfully_saved")})}}]);
//# sourceMappingURL=9979.54f0da00312eba02.js.map