iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 6.65 kB
JavaScript
/*! For license information please see 5080.9301ccabe7f8e48e.js.LICENSE.txt */
export const __webpack_ids__=["5080"];export const __webpack_modules__={26499:function(t,e,s){var i=s(9065),n=s(15093),o=s(57243);class a extends o.oi{constructor(){super(...arguments),this.multiline=!1}render(){return o.dy` <slot name="container"></slot> <slot class="non-text" name="start"></slot> <div class="text"> <slot name="overline" ="${this.handleTextSlotChange}"></slot> <slot class="default-slot" ="${this.handleTextSlotChange}"></slot> <slot name="headline" ="${this.handleTextSlotChange}"></slot> <slot name="supporting-text" ="${this.handleTextSlotChange}"></slot> </div> <slot class="non-text" name="trailing-supporting-text"></slot> <slot class="non-text" name="end"></slot> `}handleTextSlotChange(){let t=!1,e=0;for(const s of this.textSlots)if(l(s)&&(e+=1),e>1){t=!0;break}this.multiline=t}}function l(t){for(const e of t.assignedNodes({flatten:!0})){const t=e.nodeType===Node.ELEMENT_NODE,s=e.nodeType===Node.TEXT_NODE&&e.textContent?.match(/\S/);if(t||s)return!0}return!1}(0,i.__decorate)([(0,n.Cb)({type:Boolean,reflect:!0})],a.prototype,"multiline",void 0),(0,i.__decorate)([(0,n.Kt)(".text slot")],a.prototype,"textSlots",void 0);const r=o.iv`: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 c=class extends a{};c.styles=[r],c=(0,i.__decorate)([(0,n.Mo)("md-item")],c)},7750:function(t,e,s){s.d(e,{E:()=>n,g:()=>o});s(92745);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 s of t){!(!s.disabled&&s.tabIndex>-1)||e?s.tabIndex=-1:(e=!0,s.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=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){function i(t,e=f){const s=l(t,e);return s&&(s.tabIndex=0,s.focus()),s}function n(t,e=f){const s=r(t,e);return s&&(s.tabIndex=0,s.focus()),s}function o(t,e=f){const s=a(t,e);return s&&(s.item.tabIndex=-1),s}function a(t,e=f){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=f){for(const s of t)if(e(s))return s;return null}function r(t,e=f){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=f,n=!0){if(e){const i=function(t,e,s=f,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=f,i=!0){if(e){const n=function(t,e,s=f,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 m(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function h(){return new Event("request-activation",{bubbles:!0,composed:!0})}function f(t){return!t.disabled}s.d(e,{AW:()=>r,B3:()=>l,CL:()=>a,NS:()=>m,PQ:()=>i,Rn:()=>d,dl:()=>n,oh:()=>h,tq:()=>o,xZ:()=>c})}};
//# sourceMappingURL=5080.9301ccabe7f8e48e.js.map