iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
18 lines • 10.7 kB
JavaScript
/*! For license information please see 40728.b9a5e2076ff9d622.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["40728"],{99152:function(t,e,i){i.d(e,{V:()=>o});i(63721),i(71695),i(61893),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const s=Symbol("selection controller");class r{constructor(){this.selected=null,this.ordered=null,this.set=new Set}}class o{constructor(t){this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,t.addEventListener("keydown",(t=>{this.keyDownHandler(t)})),t.addEventListener("mousedown",(()=>{this.mousedownHandler()})),t.addEventListener("mouseup",(()=>{this.mouseupHandler()}))}static getController(t){const e=!("global"in t)||"global"in t&&t.global?document:t.getRootNode();let i=e[s];return void 0===i&&(i=new o(e),e[s]=i),i}keyDownHandler(t){const e=t.target;"checked"in e&&this.has(e)&&("ArrowRight"==t.key||"ArrowDown"==t.key?this.selectNext(e):"ArrowLeft"!=t.key&&"ArrowUp"!=t.key||this.selectPrevious(e))}mousedownHandler(){this.mouseIsDown=!0}mouseupHandler(){this.mouseIsDown=!1}has(t){return this.getSet(t.name).set.has(t)}selectPrevious(t){const e=this.getOrdered(t),i=e.indexOf(t),s=e[i-1]||e[e.length-1];return this.select(s),s}selectNext(t){const e=this.getOrdered(t),i=e.indexOf(t),s=e[i+1]||e[0];return this.select(s),s}select(t){t.click()}focus(t){if(this.mouseIsDown)return;const e=this.getSet(t.name),i=this.focusedSet;this.focusedSet=e,i!=e&&e.selected&&e.selected!=t&&e.selected.focus()}isAnySelected(t){const e=this.getSet(t.name);for(const i of e.set)if(i.checked)return!0;return!1}getOrdered(t){const e=this.getSet(t.name);return e.ordered||(e.ordered=Array.from(e.set),e.ordered.sort(((t,e)=>t.compareDocumentPosition(e)==Node.DOCUMENT_POSITION_PRECEDING?1:0))),e.ordered}getSet(t){return this.sets[t]||(this.sets[t]=new r),this.sets[t]}register(t){const e=t.name||t.getAttribute("name")||"",i=this.getSet(e);i.set.add(t),i.ordered=null}unregister(t){const e=this.getSet(t.name);e.set.delete(t),e.ordered=null,e.selected==t&&(e.selected=null)}update(t){if(this.updating)return;this.updating=!0;const e=this.getSet(t.name);if(t.checked){for(const i of e.set)i!=t&&(i.checked=!1);e.selected=t}if(this.isAnySelected(t))for(const i of e.set){if(void 0===i.formElementTabIndex)break;i.formElementTabIndex=i.checked?0:-1}this.updating=!1}}},78755:function(t,e,i){i.d(e,{g:()=>I});var s=i(9065),r=i(50778),o=(i(71695),i(19423),i(47021),i(57618),i(26499),i(23111),i(57243)),l=i(35359),a=i(79840),n=i(13823),d=i(64840);let c,m,h,p,u,g,y,v,f=t=>t;const b=(0,n.T)(o.oi);class x extends b{constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(t){this.href&&(this.type="link"),super.willUpdate(t)}render(){return this.renderListItem((0,o.dy)(c||(c=f` <md-item> <div slot="container"> ${0} ${0} </div> <slot name="start" slot="start"></slot> <slot name="end" slot="end"></slot> ${0} </md-item> `),this.renderRipple(),this.renderFocusRing(),this.renderBody()))}renderListItem(t){const e="link"===this.type;let i;switch(this.type){case"link":i=(0,a.i0)(m||(m=f`a`));break;case"button":i=(0,a.i0)(h||(h=f`button`));break;default:i=(0,a.i0)(p||(p=f`li`))}const s="text"!==this.type,r=e&&this.target?this.target:o.Ld;return(0,a.dy)(u||(u=f`
<${0}
id="item"
tabindex="${0}"
?disabled=${0}
role="listitem"
aria-selected=${0}
aria-checked=${0}
aria-expanded=${0}
aria-haspopup=${0}
class="list-item ${0}"
href=${0}
target=${0}
=${0}
>${0}</${0}>
`),i,this.isDisabled||!s?-1:0,this.isDisabled,this.ariaSelected||o.Ld,this.ariaChecked||o.Ld,this.ariaExpanded||o.Ld,this.ariaHasPopup||o.Ld,(0,l.$)(this.getRenderClasses()),this.href||o.Ld,r,this.onFocus,t,i)}renderRipple(){return"text"===this.type?o.Ld:(0,o.dy)(g||(g=f` <md-ripple part="ripple" for="item" ?disabled="${0}"></md-ripple>`),this.isDisabled)}renderFocusRing(){return"text"===this.type?o.Ld:(0,o.dy)(y||(y=f` <md-focus-ring -changed="${0}" part="focus-ring" for="item" inward></md-focus-ring>`),this.onFocusRingVisibilityChanged)}onFocusRingVisibilityChanged(t){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return(0,o.dy)(v||(v=f` <slot></slot> <slot name="overline" slot="overline"></slot> <slot name="headline" slot="headline"></slot> <slot name="supporting-text" slot="supporting-text"></slot> <slot name="trailing-supporting-text" slot="trailing-supporting-text"></slot> `))}onFocus(){-1===this.tabIndex&&this.dispatchEvent((0,d.oh)())}focus(){var t;null===(t=this.listItemRoot)||void 0===t||t.focus()}}x.shadowRootOptions=Object.assign(Object.assign({},o.oi.shadowRootOptions),{},{delegatesFocus:!0}),(0,s.__decorate)([(0,r.Cb)({type:Boolean,reflect:!0})],x.prototype,"disabled",void 0),(0,s.__decorate)([(0,r.Cb)({reflect:!0})],x.prototype,"type",void 0),(0,s.__decorate)([(0,r.Cb)({type:Boolean,attribute:"md-list-item",reflect:!0})],x.prototype,"isListItem",void 0),(0,s.__decorate)([(0,r.Cb)()],x.prototype,"href",void 0),(0,s.__decorate)([(0,r.Cb)()],x.prototype,"target",void 0),(0,s.__decorate)([(0,r.IO)(".list-item")],x.prototype,"listItemRoot",void 0);let w;const k=(0,o.iv)(w||(w=(t=>t)`:host{display:flex;-webkit-tap-highlight-color:transparent;--md-ripple-hover-color:var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity:var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color:var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity:var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape:8px}a,button,li{background:0 0;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:0;-webkit-tap-highlight-color:transparent;width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, .3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color,var(--md-sys-color-on-surface,#1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight,var(--md-sys-typescale-body-large-weight,var(--md-ref-typeface-weight-regular,400)));min-height:var(--md-list-item-one-line-container-height,56px);padding-top:var(--md-list-item-top-space,12px);padding-bottom:var(--md-list-item-bottom-space,12px);padding-inline-start:var(--md-list-item-leading-space,16px);padding-inline-end:var(--md-list-item-trailing-space,16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height,72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, .875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight,var(--md-sys-typescale-body-medium-weight,var(--md-ref-typeface-weight-regular,400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color,var(--md-sys-color-on-surface-variant,#49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, .6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight,var(--md-sys-typescale-label-small-weight,var(--md-ref-typeface-weight-medium,500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color,var(--md-sys-color-on-surface-variant,#49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color,var(--md-sys-color-on-surface-variant,#49454f))} {.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}`));let I=class extends x{};I.styles=[k],I=(0,s.__decorate)([(0,r.Mo)("md-list-item")],I)},623:function(t,e,i){i.d(e,{j:()=>p});var s=i(9065),r=i(50778),o=(i(67351),i(71695),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021),i(57243)),l=i(7750);let a,n=t=>t;const d=new Set(Object.values(l.E));class c extends o.oi{get items(){return this.listController.items}constructor(){super(),this.listController=new l.g({isItem:t=>t.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:t=>{t.tabIndex=-1},activateItem:t=>{t.tabIndex=0},isNavigableKey:t=>d.has(t),isActivatable:t=>!t.disabled&&"text"!==t.type}),this.internals=this.attachInternals(),o.sk||(this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown))}render(){return(0,o.dy)(a||(a=n` <slot -items="${0}" -activation="${0}" ="${0}"> </slot> `),this.listController.onDeactivateItems,this.listController.onRequestActivation,this.listController.onSlotchange)}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}}(0,s.__decorate)([(0,r.NH)({flatten:!0})],c.prototype,"slotItems",void 0);let m;const h=(0,o.iv)(m||(m=(t=>t)`:host{background:var(--md-list-container-color,var(--md-sys-color-surface,#fef7ff));color:unset;display:flex;flex-direction:column;outline:0;padding:8px 0;position:relative}`));let p=class extends c{};p.styles=[h],p=(0,s.__decorate)([(0,r.Mo)("md-list")],p)}}]);
//# sourceMappingURL=40728.b9a5e2076ff9d622.js.map