iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 8.41 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["1262"],{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),r=t(50778),s=t(76525);t(23334);let c,h,p,g=e=>e;const u=["button","ha-list-item"],m=(e,i)=>{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==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,r.Mo)("ha-dialog")],(function(e,i){class t extends i{constructor(...i){super(...i),e(this)}}return{F:t,d:[{kind:"field",key:s.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=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[d.W,(0,l.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)},81680:function(e,i,t){t.r(i),t.d(i,{HuiCreateDialogHeaderFooter:()=>m});var a=t(61701),o=(t(71695),t(9359),t(70104),t(40251),t(47021),t(31622),t(57243)),n=t(50778),d=t(36522),l=t(73729),r=t(28008);const s=[{type:"graph",icon:"M4 19V20H22V22H2V2H4V17C7 17 10 15 12.1 11.4C15.1 6.4 18.4 4 22 4V6C19.2 6 16.5 8.1 13.9 12.5C11.3 16.6 7.7 19 4 19Z"},{type:"buttons",icon:"M13 5C15.21 5 17 6.79 17 9C17 10.5 16.2 11.77 15 12.46V11.24C15.61 10.69 16 9.89 16 9C16 7.34 14.66 6 13 6S10 7.34 10 9C10 9.89 10.39 10.69 11 11.24V12.46C9.8 11.77 9 10.5 9 9C9 6.79 10.79 5 13 5M20 20.5C19.97 21.32 19.32 21.97 18.5 22H13C12.62 22 12.26 21.85 12 21.57L8 17.37L8.74 16.6C8.93 16.39 9.2 16.28 9.5 16.28H9.7L12 18V9C12 8.45 12.45 8 13 8S14 8.45 14 9V13.47L15.21 13.6L19.15 15.79C19.68 16.03 20 16.56 20 17.14V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.11 2.9 14 4 14H8V12L4 12L4 4H20L20 12H18V14H20V13.96L20.04 14C21.13 14 22 13.09 22 12V4C22 2.9 21.11 2 20 2Z"},{type:"picture",icon:"M20,5A2,2 0 0,1 22,7V17A2,2 0 0,1 20,19H4C2.89,19 2,18.1 2,17V7C2,5.89 2.89,5 4,5H20M5,16H19L14.5,10L11,14.5L8.5,11.5L5,16Z"}];t(19423);var c=t(64830);let h,p,g,u=e=>e,m=(0,a.Z)([(0,n.Mo)("hui-dialog-create-headerfooter")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(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:"method",key:"showDialog",value:async function(e){this._params=e}},{kind:"method",key:"closeDialog",value:function(){return this._params=void 0,(0,d.B)(this,"dialog-closed",{dialog:this.localName}),!0}},{kind:"method",key:"render",value:function(){return this._params?(0,o.dy)(h||(h=u` <ha-dialog open scrimClickAction .heading="${0}" ="${0}" ="${0}"> <div class="elements"> ${0} </div> <div slot="primaryAction"> <mwc-button ="${0}"> ${0} </mwc-button> </div> </ha-dialog> `),(0,l.i)(this.hass,this.hass.localize("ui.panel.lovelace.editor.header-footer.choose_header_footer",{type:this.hass.localize(`ui.panel.lovelace.editor.header-footer.${this._params.type}`)})),this._ignoreKeydown,this._cancel,s.map(((e,i)=>(0,o.dy)(p||(p=u` <ha-card role="button" tabindex="0" aria-labelledby="${0}" outlined .type="${0}" ="${0}" ="${0}" dialogInitialFocus> <ha-svg-icon .path="${0}"></ha-svg-icon> <div .id="${0}" role="none presentation"> ${0} </div> </ha-card> `),"card-name-"+i,e.type,this._handleHeaderFooterPicked,this._handleHeaderFooterPicked,e.icon,"card-name-"+i,this.hass.localize(`ui.panel.lovelace.editor.header-footer.types.${e.type}.name`)))),this._cancel,this.hass.localize("ui.common.cancel")):o.Ld}},{kind:"method",key:"_handleHeaderFooterPicked",value:async function(e){if(e instanceof KeyboardEvent&&"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key)return;const i=e.currentTarget.type;let t={type:i};var a;this.hass&&(t=await(async(e,i,t,a)=>{let o={type:i};const n=await(0,c.Q)(i);if(n&&n.getStubConfig){const i=await n.getStubConfig(e,t,a);o=Object.assign(Object.assign({},o),i)}return o})(this.hass,i,(null===(a=this._params)||void 0===a?void 0:a.entities)||[],[]));this._params.pickHeaderFooter(t),this.closeDialog()}},{kind:"method",key:"_ignoreKeydown",value:function(e){e.stopPropagation()}},{kind:"method",key:"_cancel",value:function(e){e&&e.stopPropagation(),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.yu,(0,o.iv)(g||(g=u` all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-max-height:100%;height:100%}} all and (min-width:850px){ha-dialog{--mdc-dialog-min-width:550px}}ha-dialog{--mdc-dialog-max-width:550px;--dialog-content-padding:2px 24px 20px 24px;--dialog-z-index:6}.elements{display:flex;flex-wrap:wrap}.spinner,ha-card{width:calc(50% - 8px);text-align:center;margin:4px}ha-card{box-sizing:border-box;padding:8px;color:var(--secondary-text-color);font-size:16px;cursor:pointer}ha-svg-icon{padding-bottom:4px;--mdc-icon-size:38px}`))]}}]}}),o.oi)}}]);
//# sourceMappingURL=1262.c09b0efe07442e76.js.map