iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 13.4 kB
JavaScript
export const __webpack_ids__=["9281"];export const __webpack_modules__={95198:function(i,e,t){var a=t(44249),o=t(57243),n=t(15093);(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 o.dy` <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[o.iv`: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:()=>h});var a=t(44249),o=t(72621),n=t(74966),d=t(51408),s=t(57243),l=t(15093),r=t(76525);t(23334);const c=["button","ha-list-item"],h=(i,e)=>s.dy` <div class="header_title"> <ha-icon-button .label="${i?.localize("ui.common.close")??"Close"}" .path="${"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"}" dialogAction="close" class="header_button"></ha-icon-button> <span>${e}</span> </div> `;(0,a.Z)([(0,l.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){this.contentElement?.scrollTo(i,e)}},{kind:"method",key:"renderHeading",value:function(){return s.dy`<slot name="heading"> ${(0,o.Z)(t,"renderHeading",this,3)([])} </slot>`}},{kind:"method",key:"firstUpdated",value:function(){(0,o.Z)(t,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,c].join(", "),this._updateScrolledAttribute(),this.contentElement?.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:()=>[d.W,s.iv`: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:()=>g});var a=t(44249),o=t(57243),n=t(15093),d=t(35359),s=t(36522),l=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);(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:()=>(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 o.dy` <ha-form .hass="${this.hass}" .data="${i}" .schema="${e}" .computeLabel="${this._computeLabel}" .computeHelper="${this._computeHelper}" -changed="${this._valueChanged}"></ha-form> `}},{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={...this.config,column_span:e.column_span};(0,s.B)(this,"value-changed",{value:t})}}]}}),o.oi);t(99426),t(32145);(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(){const i=this.config.visibility??[];return o.dy` <ha-alert alert-type="info"> ${this.hass.localize("ui.panel.lovelace.editor.edit_section.visibility.explanation")} </ha-alert> <ha-card-conditions-editor .hass="${this.hass}" .conditions="${i}" -changed="${this._valueChanged}"> </ha-card-conditions-editor> `}},{kind:"method",key:"_valueChanged",value:function(i){i.stopPropagation();const e=i.detail.value,t={...this.config,visibility:e};0===t.visibility?.length&&delete t.visibility,(0,s.B)(this,"value-changed",{value:t})}}]}}),o.oi);t(56820),t(99619);const u=["tab-settings","tab-visibility"];let g=(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:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_currTab",value:()=>u[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")){const i={...this._config};this._editor?.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=u[0],(0,s.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=o.dy` <ha-yaml-editor .hass="${this.hass}" dialogInitialFocus -changed="${this._viewYamlChanged}"></ha-yaml-editor> `;else switch(this._currTab){case"tab-settings":e=o.dy` <hui-section-settings-editor .hass="${this.hass}" .config="${this._config}" .viewConfig="${this._viewConfig}" -changed="${this._configChanged}"> </hui-section-settings-editor> `;break;case"tab-visibility":e=o.dy` <hui-section-visibility-editor .hass="${this.hass}" .config="${this._config}" -changed="${this._configChanged}"> </hui-section-visibility-editor> `}return o.dy` <ha-dialog open scrimClickAction ="${this._ignoreKeydown}" ="${this._cancel}" .heading="${i}" class="${(0,d.$)({"yaml-mode":this._yamlMode})}"> <ha-dialog-header show-border slot="heading"> <ha-icon-button slot="navigationIcon" dialogAction="cancel" .label="${this.hass.localize("ui.common.close")}" .path="${"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"}"></ha-icon-button> <span slot="title">${i}</span> <ha-button-menu slot="actionItems" fixed corner="BOTTOM_END" menu-corner="END" ="${l.U}" ="${this._handleAction}"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${"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"}"></ha-icon-button> <ha-list-item graphic="icon"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml"))} <ha-svg-icon slot="graphic" .path="${"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"}"></ha-svg-icon> </ha-list-item> </ha-button-menu> ${this._yamlMode?o.Ld:o.dy` <mwc-tab-bar .activeIndex="${u.indexOf(this._currTab)}" :activated="${this._handleTabChanged}"> ${u.map((i=>o.dy` <mwc-tab .label="${this.hass.localize(`ui.panel.lovelace.editor.edit_section.${i.replace("-","_")}`)}"> </mwc-tab> `))} </mwc-tab-bar> `} </ha-dialog-header> ${e} <ha-button slot="secondaryAction" ="${this._cancel}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" ="${this._save}"> ${this.hass.localize("ui.common.save")} </ha-button> </ha-dialog> `}},{kind:"method",key:"_configChanged",value:function(i){i.stopPropagation(),this._config=i.detail.value}},{kind:"method",key:"_handleTabChanged",value:function(i){const e=u[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,o.iv`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.016544197fc2bfb8.js.map