iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 6.77 kB
JavaScript
export const __webpack_ids__=["59810"];export const __webpack_modules__={49976:function(e,t,i){i.d(t,{U:()=>n});const n=e=>e.stopPropagation()},22381:function(e,t,i){i.d(t,{D:()=>n});const n=(e,t,i=!1)=>{let n;const a=(...a)=>{const l=i&&!n;clearTimeout(n),n=window.setTimeout((()=>{n=void 0,e(...a)}),t),l&&e(...a)};return a.cancel=()=>{clearTimeout(n)},a}},76320:function(e,t,i){i.d(t,{T:()=>n,y:()=>a});const n=e=>{requestAnimationFrame((()=>setTimeout(e,0)))},a=()=>new Promise((e=>{n(e)}))},92824:function(e,t,i){var n=i(44249),a=i(72621),l=i(60930),d=i(9714),s=i(57243),o=i(15093),c=i(22381),r=i(76320);i(23334);(0,n.Z)([(0,o.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return s.dy` ${(0,a.Z)(i,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?s.dy`<ha-icon-button label="clear" ="${this._clearValue}" .path="${"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"}"></ha-icon-button>`:s.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?s.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:s.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,a.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow&&this.shadowRoot?.querySelector(".mdc-select__selected-text-container")?.classList.add("inline-arrow")}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){const e=this.shadowRoot?.querySelector(".mdc-select__selected-text-container");this.inlineArrow?e?.classList.add("inline-arrow"):e?.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,c.D)((async()=>{await(0,r.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[d.W,s.iv`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`]}]}}),l.K)},93408:function(e,t,i){i.r(t),i.d(t,{HaThemeSelector:()=>d});var n=i(44249),a=i(57243),l=i(15093);i(95439);let d=(0,n.Z)([(0,l.Mo)("ha-selector-theme")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return a.dy` <ha-theme-picker .hass="${this.hass}" .value="${this.value}" .label="${this.label}" .includeDefault="${this.selector.theme?.include_default}" .disabled="${this.disabled}" .required="${this.required}"></ha-theme-picker> `}}]}}),a.oi)},95439:function(e,t,i){var n=i(44249),a=(i(9359),i(70104),i(87319),i(57243)),l=i(15093),d=i(36522),s=i(49976);i(92824);(0,n.Z)([(0,l.Mo)("ha-theme-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"include-default",type:Boolean})],key:"includeDefault",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"method",key:"render",value:function(){return a.dy` <ha-select .label="${this.label||this.hass.localize("ui.components.theme-picker.theme")}" .value="${this.value}" .required="${this.required}" .disabled="${this.disabled}" ="${this._changed}" ="${s.U}" fixedMenuPosition naturalMenuWidth> ${this.required?a.Ld:a.dy` <mwc-list-item value="remove"> ${this.hass.localize("ui.components.theme-picker.no_theme")} </mwc-list-item> `} ${this.includeDefault?a.dy` <mwc-list-item .value="${"default"}"> ioBroker </mwc-list-item> `:a.Ld} ${Object.keys(this.hass.themes.themes).sort().map((e=>a.dy`<mwc-list-item .value="${e}">${e}</mwc-list-item>`))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){this.hass&&""!==e.target.value&&(this.value="remove"===e.target.value?void 0:e.target.value,(0,d.B)(this,"value-changed",{value:this.value}))}}]}}),a.oi)}};
//# sourceMappingURL=59810.e8c334a9e42e4f90.js.map