iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 6.87 kB
JavaScript
/*! For license information please see 5080.859a41694582300a.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["5080"],{26499:function(t,e,s){var i=s(9065),n=s(50778),o=(s(71695),s(19134),s(44495),s(47021),s(57243));let a,l=t=>t;class r extends o.oi{constructor(){super(...arguments),this.multiline=!1}render(){return(0,o.dy)(a||(a=l` <slot name="container"></slot> <slot class="non-text" name="start"></slot> <div class="text"> <slot name="overline" ="${0}"></slot> <slot class="default-slot" ="${0}"></slot> <slot name="headline" ="${0}"></slot> <slot name="supporting-text" ="${0}"></slot> </div> <slot class="non-text" name="trailing-supporting-text"></slot> <slot class="non-text" name="end"></slot> `),this.handleTextSlotChange,this.handleTextSlotChange,this.handleTextSlotChange,this.handleTextSlotChange)}handleTextSlotChange(){let t=!1,e=0;for(const s of this.textSlots)if(c(s)&&(e+=1),e>1){t=!0;break}this.multiline=t}}function c(t){for(const s of t.assignedNodes({flatten:!0})){var e;const t=s.nodeType===Node.ELEMENT_NODE,i=s.nodeType===Node.TEXT_NODE&&(null===(e=s.textContent)||void 0===e?void 0:e.match(/\S/));if(t||i)return!0}return!1}(0,i.__decorate)([(0,n.Cb)({type:Boolean,reflect:!0})],r.prototype,"multiline",void 0),(0,i.__decorate)([(0,n.Kt)(".text slot")],r.prototype,"textSlots",void 0);let d;const h=(0,o.iv)(d||(d=(t=>t)`:host{color:var(--md-sys-color-on-surface,#1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, .875rem);font-weight:var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant,#49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, .6875rem);font-weight:var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}`));let f=class extends r{};f.styles=[h],f=(0,i.__decorate)([(0,n.Mo)("md-item")],f)},7750:function(t,e,s){s.d(e,{E:()=>n,g:()=>o});s(71695),s(92745),s(47021);var i=s(64840);const n={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class o{constructor(t){this.handleKeydown=t=>{const e=t.key;if(t.defaultPrevented||!this.isNavigableKey(e))return;const s=this.items;if(!s.length)return;const o=(0,i.CL)(s,this.isActivatable);t.preventDefault();const a=this.isRtl(),l=a?n.ArrowRight:n.ArrowLeft,r=a?n.ArrowLeft:n.ArrowRight;let c=null;switch(e){case n.ArrowDown:case r:c=(0,i.xZ)(s,o,this.isActivatable,this.wrapNavigation());break;case n.ArrowUp:case l:c=(0,i.Rn)(s,o,this.isActivatable,this.wrapNavigation());break;case n.Home:c=(0,i.PQ)(s,this.isActivatable);break;case n.End:c=(0,i.dl)(s,this.isActivatable)}c&&o&&o.item!==c&&(o.item.tabIndex=-1)},this.onDeactivateItems=()=>{const t=this.items;for(const e of t)this.deactivateItem(e)},this.onRequestActivation=t=>{this.onDeactivateItems();const e=t.target;this.activateItem(e),e.focus()},this.onSlotchange=()=>{const t=this.items;let e=!1;for(const i of t){!(!i.disabled&&i.tabIndex>-1)||e?i.tabIndex=-1:(e=!0,i.tabIndex=0)}if(e)return;const s=(0,i.B3)(t,this.isActivatable);s&&(s.tabIndex=0)};const{isItem:e,getPossibleItems:s,isRtl:o,deactivateItem:a,activateItem:l,isNavigableKey:r,isActivatable:c,wrapNavigation:d}=t;this.isItem=e,this.getPossibleItems=s,this.isRtl=o,this.deactivateItem=a,this.activateItem=l,this.isNavigableKey=r,this.isActivatable=c,this.wrapNavigation=null!=d?d:()=>!0}get items(){const t=this.getPossibleItems(),e=[];for(const s of t){if(this.isItem(s)){e.push(s);continue}const t=s.item;t&&this.isItem(t)&&e.push(t)}return e}activateNextItem(){const t=this.items,e=(0,i.CL)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,i.xZ)(t,e,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const t=this.items,e=(0,i.CL)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,i.Rn)(t,e,this.isActivatable,this.wrapNavigation())}}},64840:function(t,e,s){s.d(e,{AW:()=>r,B3:()=>l,CL:()=>a,NS:()=>h,PQ:()=>i,Rn:()=>d,dl:()=>n,oh:()=>f,tq:()=>o,xZ:()=>c});s(71695),s(47021);function i(t,e=m){const s=l(t,e);return s&&(s.tabIndex=0,s.focus()),s}function n(t,e=m){const s=r(t,e);return s&&(s.tabIndex=0,s.focus()),s}function o(t,e=m){const s=a(t,e);return s&&(s.item.tabIndex=-1),s}function a(t,e=m){for(let s=0;s<t.length;s++){const i=t[s];if(0===i.tabIndex&&e(i))return{item:i,index:s}}return null}function l(t,e=m){for(const s of t)if(e(s))return s;return null}function r(t,e=m){for(let s=t.length-1;s>=0;s--){const i=t[s];if(e(i))return i}return null}function c(t,e,s=m,n=!0){if(e){const i=function(t,e,s=m,i=!0){for(let n=1;n<t.length;n++){const o=(n+e)%t.length;if(o<e&&!i)return null;const a=t[o];if(s(a))return a}return t[e]?t[e]:null}(t,e.index,s,n);return i&&(i.tabIndex=0,i.focus()),i}return i(t,s)}function d(t,e,s=m,i=!0){if(e){const n=function(t,e,s=m,i=!0){for(let n=1;n<t.length;n++){const o=(e-n+t.length)%t.length;if(o>e&&!i)return null;const a=t[o];if(s(a))return a}return t[e]?t[e]:null}(t,e.index,s,i);return n&&(n.tabIndex=0,n.focus()),n}return n(t,s)}function h(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function f(){return new Event("request-activation",{bubbles:!0,composed:!0})}function m(t){return!t.disabled}}}]);
//# sourceMappingURL=5080.859a41694582300a.js.map