iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 17.5 kB
JavaScript
export const __webpack_ids__=["57173"];export const __webpack_modules__={71403:function(e,t,i){var a=i(44249),o=(i(9359),i(70104),i(57243)),n=i(15093),d=i(36522);var s=i(82100);i(41307),i(84346),i(37583),i(83166);const r="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z";(0,a.Z)([(0,n.Mo)("ha-areas-display-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"show-navigation-button"})],key:"showNavigationButton",value:()=>!1},{kind:"method",key:"render",value:function(){const e=(0,s.a)(this.hass.areas),t=Object.values(this.hass.areas).sort(((t,i)=>e(t.area_id,i.area_id))).map((e=>{const{floor:t}=((e,t)=>{const i=t.areas[e]||null;if(!i)return{area:null,floor:null};const a=i?.floor_id;return{area:i,floor:a?t.floors[a]:null}})(e.area_id,this.hass);return{value:e.area_id,label:e.name,icon:e.icon??void 0,iconPath:r,description:t?.name}})),i={order:this.value?.order??[],hidden:this.value?.hidden??[]};return o.dy` <ha-expansion-panel outlined .header="${this.label}" .expanded="${this.expanded}"> <ha-svg-icon slot="leading-icon" .path="${r}"></ha-svg-icon> <ha-items-display-editor .hass="${this.hass}" .items="${t}" .value="${i}" -changed="${this._areaDisplayChanged}" .showNavigationButton="${this.showNavigationButton}"></ha-items-display-editor> </ha-expansion-panel> `}},{kind:"method",key:"_areaDisplayChanged",value:async function(e){e.stopPropagation();const t=e.detail.value,i={...this.value,...t};0===i.hidden?.length&&delete i.hidden,0===i.order?.length&&delete i.order,(0,d.B)(this,"value-changed",{value:i})}}]}}),o.oi)},41307:function(e,t,i){var a=i(44249),o=i(72621),n=i(57243),d=i(15093),s=i(35359),r=i(36522),l=i(76320);i(37583);(0,a.Z)([(0,d.Mo)("ha-expansion-panel")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"left-chevron",type:Boolean,reflect:!0})],key:"leftChevron",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-collapse",type:Boolean,reflect:!0})],key:"noCollapse",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,d.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){const e=this.noCollapse?n.Ld:n.dy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,s.$)({expanded:this.expanded})}"></ha-svg-icon> `;return n.dy` <div class="top ${(0,s.$)({expanded:this.expanded})}"> <div id="summary" class="${(0,s.$)({noCollapse:this.noCollapse})}" ="${this._toggleContainer}" ="${this._toggleContainer}" ="${this._focusChanged}" ="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1"> ${this.leftChevron?e:n.Ld} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> ${this.leftChevron?n.Ld:e} <slot name="icons"></slot> </div> </div> <div class="container ${(0,s.$)({expanded:this.expanded})}" ="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?n.dy`<slot></slot>`:""} </div> `}},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(i,"willUpdate",this,3)([e]),e.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,r.B)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,l.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=t,(0,r.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`}]}}),n.oi)},13928:function(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>s});var a=i(44249),o=i(15093),n=i(5111),d=i(37583);let s=(0,a.Z)([(0,o.Mo)("ha-icon-next")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"path",value:()=>"rtl"===n.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}]}}),d.HaSvgIcon)},84346:function(e,t,i){var a=i(44249),o=(i(92745),i(9359),i(56475),i(70104),i(18672)),n=i(57243),d=i(15093),s=i(35359),r=i(20552),l=i(91583),h=i(94571),c=i(27486),u=i(36522),v=i(1416);i(65981),i(23334),i(13928),i(19993),i(74633),i(62801),i(37583);(0,a.Z)([(0,d.Mo)("ha-items-display-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"items",value:()=>[]},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"show-navigation-button"})],key:"showNavigationButton",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"value",value:()=>({order:[],hidden:[]})},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"actionsRenderer",value:void 0},{kind:"field",key:"_showIcon",value(){return new o.Z(this,{callback:e=>e[0]?.contentRect.width>450})}},{kind:"method",key:"_toggle",value:function(e){e.stopPropagation();const t=e.currentTarget.value,i=this._hiddenItems(this.items,this.value.hidden).map((e=>e.value));i.includes(t)?i.splice(i.indexOf(t),1):i.push(t);const a=this._visibleItems(this.items,i,this.value.order).map((e=>e.value));this.value={hidden:i,order:a},(0,u.B)(this,"value-changed",{value:this.value})}},{kind:"method",key:"_itemMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,a=this._visibleItems(this.items,this.value.hidden,this.value.order).map((e=>e.value)),o=a.splice(t,1)[0];a.splice(i,0,o),this.value={...this.value,order:a},(0,u.B)(this,"value-changed",{value:this.value})}},{kind:"method",key:"_navigate",value:function(e){const t=e.currentTarget.value;(0,u.B)(this,"item-display-navigate-clicked",{value:t}),e.stopPropagation()}},{kind:"field",key:"_visibleItems",value:()=>(0,c.Z)(((e,t,i)=>{const a=(0,v.UB)(i);return e.filter((e=>!t.includes(e.value))).sort(((e,t)=>a(e.value,t.value)))}))},{kind:"field",key:"_allItems",value(){return(0,c.Z)(((e,t,i)=>[...this._visibleItems(e,t,i),...this._hiddenItems(e,t)]))}},{kind:"field",key:"_hiddenItems",value:()=>(0,c.Z)(((e,t)=>e.filter((e=>t.includes(e.value)))))},{kind:"method",key:"render",value:function(){const e=this._allItems(this.items,this.value.hidden,this.value.order),t=this._showIcon.value;return n.dy` <ha-sortable draggable-selector=".draggable" handle-selector=".handle" -moved="${this._itemMoved}"> <ha-md-list> ${(0,l.r)(e,(e=>e.value),((e,i)=>{const a=!this.value.hidden.includes(e.value),{label:o,value:d,description:l,icon:c,iconPath:u}=e;return n.dy` <ha-md-list-item type="${(0,r.o)(this.showNavigationButton?"button":void 0)}" ="${this.showNavigationButton?this._navigate:void 0}" .value="${d}" class="${(0,s.$)({hidden:!a,draggable:a})}"> <span slot="headline">${o}</span> ${l?n.dy`<span slot="supporting-text">${l}</span>`:n.Ld} ${a?n.dy` <ha-svg-icon class="handle" .path="${"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z"}" slot="start"></ha-svg-icon> `:n.dy`<ha-svg-icon slot="start"></ha-svg-icon>`} ${t?c?n.dy` <ha-icon class="icon" .icon="${(0,h.C)(c,"")}" slot="start"></ha-icon> `:u?n.dy` <ha-svg-icon class="icon" .path="${u}" slot="start"></ha-svg-icon> `:n.Ld:n.Ld} ${this.actionsRenderer?n.dy` <span slot="end"> ${this.actionsRenderer(e)} </span> `:n.Ld} <ha-icon-button .path="${a?"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z":"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}" slot="end" .label="${this.hass.localize("ui.components.items-display-editor."+(a?"hide":"show"),{label:o})}" .value="${d}" ="${this._toggle}"></ha-icon-button> ${this.showNavigationButton?n.dy` <ha-icon-next slot="end"></ha-icon-next> `:n.Ld} </ha-md-list-item> `}))} </ha-md-list> </ha-sortable> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block}.handle{cursor:move;padding:8px;margin:-8px}ha-md-list{padding:0}ha-md-list-item{--md-list-item-top-space:0;--md-list-item-bottom-space:0;--md-list-item-leading-space:8px;--md-list-item-trailing-space:8px;--md-list-item-two-line-container-height:48px;--md-list-item-one-line-container-height:48px}ha-md-list-item ha-icon-button{margin-left:-12px;margin-right:-12px}ha-md-list-item.hidden{--md-list-item-label-text-color:var(--disabled-text-color);--md-list-item-supporting-text-color:var(--disabled-text-color)}ha-md-list-item.hidden .icon{color:var(--disabled-text-color)}`}]}}),n.oi)},74633:function(e,t,i){var a=i(44249),o=i(72621),n=i(78755),d=i(57243),s=i(15093);(0,a.Z)([(0,s.Mo)("ha-md-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"styles",this),d.iv`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center)}`]}}]}}),n.g)},19993:function(e,t,i){var a=i(44249),o=i(72621),n=i(623),d=i(57243),s=i(15093);(0,a.Z)([(0,s.Mo)("ha-md-list")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"styles",this),d.iv`:host{--md-sys-color-surface:var(--card-background-color)}`]}}]}}),n.j)},62801:function(e,t,i){var a=i(44249),o=i(72621),n=(i(9359),i(56475),i(22139),i(57243)),d=i(15093),s=i(36522);(0,a.Z)([(0,d.Mo)("ha-sortable")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"rollback",value:()=>!0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(a,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(a,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?n.Ld:n.dy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e("34153"),i.e("467")]).then(i.bind(i,59807))).default,a={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(a.draggable=this.draggableSelector),this.handleSelector&&(a.handle=this.handleSelector),void 0!==this.invertSwap&&(a.invertSwap=this.invertSwap),this.group&&(a.group=this.group),this.filter&&(a.filter=this.filter),this._sortable=new t(e,a)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,s.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,s.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,s.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,s.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,s.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),n.oi)}};
//# sourceMappingURL=57173.3edb6bdf0943b5e9.js.map