iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 14.3 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9281"],{95198:function(i,e,t){var a=t(61701),o=(t(71695),t(47021),t(57243)),n=t(50778);let d,l,s=i=>i;(0,a.Z)([(0,n.Mo)("ha-dialog-header")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(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(i,e,t){t.d(e,{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,u,g=i=>i;const v=["button","ha-list-item"],m=(i,e)=>{var t;return(0,l.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==i?void 0:i.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",e)};(0,a.Z)([(0,s.Mo)("ha-dialog")],(function(i,e){class t extends e{constructor(...e){super(...e),i(this)}}return{F:t,d:[{kind:"field",key:r.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(i,e){var t;null===(t=this.contentElement)||void 0===t||t.scrollTo(i,e)}},{kind:"method",key:"renderHeading",value:function(){return(0,l.dy)(h||(h=g`<slot name="heading"> ${0} </slot>`),(0,o.Z)(t,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var i;(0,o.Z)(t,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,v].join(", "),this._updateScrolledAttribute(),null===(i=this.contentElement)||void 0===i||i.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)(u||(u=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)},23437:function(i,e,t){t.r(e),t.d(e,{HuiDialogEditSection:()=>L});var a=t(61701),o=(t(71695),t(19423),t(40251),t(19134),t(97003),t(47021),t(57243)),n=t(50778),d=t(35359),l=t(36522),s=t(49976),r=(t(59826),t(34273),t(73729),t(95198),t(23334),t(7285),t(64889),t(28008)),c=t(2593),h=t(27486);t(29073);let u,g=i=>i;(0,a.Z)([(0,n.Mo)("hui-section-settings-editor")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"viewConfig",value:void 0},{kind:"field",key:"_schema",value(){return(0,h.Z)((i=>[{name:"column_span",selector:{number:{min:1,max:i,slider_ticks:!0}}}]))}},{kind:"method",key:"render",value:function(){const i={column_span:this.config.column_span||1},e=this._schema(this.viewConfig.max_columns||4);return(0,o.dy)(u||(u=g` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" -changed="${0}"></ha-form> `),this.hass,i,e,this._computeLabel,this._computeHelper,this._valueChanged)}},{kind:"field",key:"_computeLabel",value(){return i=>this.hass.localize(`ui.panel.lovelace.editor.edit_section.settings.${i.name}`)}},{kind:"field",key:"_computeHelper",value(){return i=>this.hass.localize(`ui.panel.lovelace.editor.edit_section.settings.${i.name}_helper`)||""}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const e=i.detail.value,t=Object.assign(Object.assign({},this.config),{},{column_span:e.column_span});(0,l.B)(this,"value-changed",{value:t})}}]}}),o.oi);t(99426),t(32145);let v,m=i=>i;(0,a.Z)([(0,n.Mo)("hui-section-visibility-editor")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"method",key:"render",value:function(){var i;const e=null!==(i=this.config.visibility)&&void 0!==i?i:[];return(0,o.dy)(v||(v=m` <ha-alert alert-type="info"> ${0} </ha-alert> <ha-card-conditions-editor .hass="${0}" .conditions="${0}" -changed="${0}"> </ha-card-conditions-editor> `),this.hass.localize("ui.panel.lovelace.editor.edit_section.visibility.explanation"),this.hass,e,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(i){var e;i.stopPropagation();const t=i.detail.value,a=Object.assign(Object.assign({},this.config),{},{visibility:t});0===(null===(e=a.visibility)||void 0===e?void 0:e.length)&&delete a.visibility,(0,l.B)(this,"value-changed",{value:a})}}]}}),o.oi);t(56820),t(99619);let p,f,_,b,k,y,x,w=i=>i;const $=["tab-settings","tab-visibility"];let L=(0,a.Z)([(0,n.Mo)("hui-dialog-edit-section")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_viewConfig",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_yamlMode",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_currTab",value(){return $[0]}},{kind:"field",decorators:[(0,n.IO)("ha-yaml-editor")],key:"_editor",value:void 0},{kind:"method",key:"updated",value:function(i){if(this._yamlMode&&i.has("_yamlMode")){var e;const i=Object.assign({},this._config);null===(e=this._editor)||void 0===e||e.setValue(i)}}},{kind:"method",key:"showDialog",value:async function(i){this._params=i,this._config=(0,c.an)(this._params.lovelaceConfig,[this._params.viewIndex,this._params.sectionIndex]),this._viewConfig=(0,c.an)(this._params.lovelaceConfig,[this._params.viewIndex])}},{kind:"method",key:"closeDialog",value:function(){return this._params=void 0,this._yamlMode=!1,this._config=void 0,this._currTab=$[0],(0,l.B)(this,"dialog-closed",{dialog:this.localName}),!0}},{kind:"method",key:"render",value:function(){if(!this._params||!this._config)return o.Ld;const i=this.hass.localize("ui.panel.lovelace.editor.edit_section.header");let e=o.Ld;if(this._yamlMode)e=(0,o.dy)(p||(p=w` <ha-yaml-editor .hass="${0}" dialogInitialFocus -changed="${0}"></ha-yaml-editor> `),this.hass,this._viewYamlChanged);else switch(this._currTab){case"tab-settings":e=(0,o.dy)(f||(f=w` <hui-section-settings-editor .hass="${0}" .config="${0}" .viewConfig="${0}" -changed="${0}"> </hui-section-settings-editor> `),this.hass,this._config,this._viewConfig,this._configChanged);break;case"tab-visibility":e=(0,o.dy)(_||(_=w` <hui-section-visibility-editor .hass="${0}" .config="${0}" -changed="${0}"> </hui-section-visibility-editor> `),this.hass,this._config,this._configChanged)}return(0,o.dy)(b||(b=w` <ha-dialog open scrimClickAction ="${0}" ="${0}" .heading="${0}" class="${0}"> <ha-dialog-header show-border slot="heading"> <ha-icon-button slot="navigationIcon" dialogAction="cancel" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title">${0}</span> <ha-button-menu slot="actionItems" fixed corner="BOTTOM_END" menu-corner="END" ="${0}" ="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-list-item graphic="icon"> ${0} <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> </ha-list-item> </ha-button-menu> ${0} </ha-dialog-header> ${0} <ha-button slot="secondaryAction" ="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" ="${0}"> ${0} </ha-button> </ha-dialog> `),this._ignoreKeydown,this._cancel,i,(0,d.$)({"yaml-mode":this._yamlMode}),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",i,s.U,this._handleAction,this.hass.localize("ui.common.menu"),"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",this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml")),"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",this._yamlMode?o.Ld:(0,o.dy)(k||(k=w` <mwc-tab-bar .activeIndex="${0}" :activated="${0}"> ${0} </mwc-tab-bar> `),$.indexOf(this._currTab),this._handleTabChanged,$.map((i=>(0,o.dy)(y||(y=w` <mwc-tab .label="${0}"> </mwc-tab> `),this.hass.localize(`ui.panel.lovelace.editor.edit_section.${i.replace("-","_")}`))))),e,this._cancel,this.hass.localize("ui.common.cancel"),this._save,this.hass.localize("ui.common.save"))}},{kind:"method",key:"_configChanged",value:function(i){i.stopPropagation(),this._config=i.detail.value}},{kind:"method",key:"_handleTabChanged",value:function(i){const e=$[i.detail.index];e!==this._currTab&&(this._currTab=e)}},{kind:"method",key:"_handleAction",value:async function(i){if(i.stopPropagation(),i.preventDefault(),0===i.detail.index)this._yamlMode=!this._yamlMode}},{kind:"method",key:"_viewYamlChanged",value:function(i){i.stopPropagation(),i.detail.isValid&&(this._config=i.detail.value)}},{kind:"method",key:"_ignoreKeydown",value:function(i){i.stopPropagation()}},{kind:"method",key:"_cancel",value:function(i){i&&i.stopPropagation(),this.closeDialog()}},{kind:"method",key:"_save",value:async function(){if(!this._params||!this._config)return;const i=(0,c.Qr)(this._params.lovelaceConfig,[this._params.viewIndex,this._params.sectionIndex],this._config);this._params.saveConfig(i),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.yu,(0,o.iv)(x||(x=w`ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:40px} all and (max-width:450px),all and (max-height:500px){ha-dialog{--dialog-surface-margin-top:0px}}ha-dialog.yaml-mode{--dialog-content-padding:0}mwc-tab-bar{color:var(--primary-text-color);text-transform:uppercase;padding:0 20px} all and (min-width:600px){ha-dialog{--mdc-dialog-min-width:600px}}`))]}}]}}),o.oi)}}]);
//# sourceMappingURL=9281.4600bfc5f971a66c.js.map