iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 12.8 kB
JavaScript
export const __webpack_ids__=["8058"];export const __webpack_modules__={75011:function(e,t,i){i.d(t,{I:()=>a,k:()=>n});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const n=new Set(["primary","accent","disabled","red","pink","purple","deep-purple","indigo","blue","light-blue","cyan","teal","green","light-green","lime","yellow","amber","orange","deep-orange","brown","light-grey","grey","dark-grey","blue-grey","black","white"]);function a(e){return n.has(e)?`var(--${e}-color)`:e}},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 o=i&&!n;clearTimeout(n),n=window.setTimeout((()=>{n=void 0,e(...a)}),t),o&&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)}))},124:function(e,t,i){var n=i(44249),a=i(72621),o=(i(9359),i(70104),i(57243)),l=i(15093),d=i(69634),r=i(75011),s=i(36522),c=i(49976);i(7285),i(51868),i(92824);const h="M20.65,20.87L18.3,18.5L12,12.23L8.44,8.66L7,7.25L4.27,4.5L3,5.77L5.78,8.55C3.23,11.69 3.42,16.31 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C13.79,21.58 15.57,21 17.03,19.8L19.73,22.5L21,21.23L20.65,20.87M12,19.59C10.4,19.59 8.89,18.97 7.76,17.83C6.62,16.69 6,15.19 6,13.59C6,12.27 6.43,11 7.21,10L12,14.77V19.59M12,5.1V9.68L19.25,16.94C20.62,14 20.09,10.37 17.65,7.93L12,2.27L8.3,5.97L9.71,7.38L12,5.1Z",u="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z";(0,n.Z)([(0,l.Mo)("ha-color-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:String,attribute:"default_color"})],key:"defaultColor",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,attribute:"include_state"})],key:"includeState",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,attribute:"include_none"})],key:"includeNone",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(i,"connectedCallback",this,3)([]),this._select?.layoutOptions()}},{kind:"method",key:"_valueSelected",value:function(e){if(e.stopPropagation(),!this.isConnected)return;const t=e.target.value;this.value=t===this.defaultColor?void 0:t,(0,s.B)(this,"value-changed",{value:this.value})}},{kind:"method",key:"render",value:function(){const e=this.value||this.defaultColor||"",t=!(r.k.has(e)||"none"===e||"state"===e);return o.dy` <ha-select .icon="${Boolean(e)}" .label="${this.label}" .value="${e}" .helper="${this.helper}" .disabled="${this.disabled}" ="${c.U}" ="${this._valueSelected}" fixedMenuPosition naturalMenuWidth .clearable="${!this.defaultColor}"> ${e?o.dy` <span slot="icon"> ${"none"===e?o.dy` <ha-svg-icon path="${h}"></ha-svg-icon> `:"state"===e?o.dy`<ha-svg-icon path="${u}"></ha-svg-icon>`:this._renderColorCircle(e||"grey")} </span> `:o.Ld} ${this.includeNone?o.dy` <ha-list-item value="none" graphic="icon"> ${this.hass.localize("ui.components.color-picker.none")} ${"none"===this.defaultColor?` (${this.hass.localize("ui.components.color-picker.default")})`:o.Ld} <ha-svg-icon slot="graphic" path="${h}"></ha-svg-icon> </ha-list-item> `:o.Ld} ${this.includeState?o.dy` <ha-list-item value="state" graphic="icon"> ${this.hass.localize("ui.components.color-picker.state")} ${"state"===this.defaultColor?` (${this.hass.localize("ui.components.color-picker.default")})`:o.Ld} <ha-svg-icon slot="graphic" path="${u}"></ha-svg-icon> </ha-list-item> `:o.Ld} ${this.includeState||this.includeNone?o.dy`<ha-md-divider role="separator" tabindex="-1"></ha-md-divider>`:o.Ld} ${Array.from(r.k).map((e=>o.dy` <ha-list-item .value="${e}" graphic="icon"> ${this.hass.localize(`ui.components.color-picker.colors.${e}`)||e} ${this.defaultColor===e?` (${this.hass.localize("ui.components.color-picker.default")})`:o.Ld} <span slot="graphic">${this._renderColorCircle(e)}</span> </ha-list-item> `))} ${t?o.dy` <ha-list-item .value="${e}" graphic="icon"> ${e} <span slot="graphic">${this._renderColorCircle(e)}</span> </ha-list-item> `:o.Ld} </ha-select> `}},{kind:"method",key:"_renderColorCircle",value:function(e){return o.dy` <span class="circle-color" style="${(0,d.V)({"--circle-color":(0,r.I)(e)})}"></span> `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`.circle-color{display:block;background-color:var(--circle-color,var(--divider-color));border:1px solid var(--outline-color);border-radius:10px;width:20px;height:20px;box-sizing:border-box}ha-select{width:100%}`}]}}),o.oi)},7285:function(e,t,i){i.d(t,{M:()=>s});var n=i(44249),a=i(72621),o=i(65703),l=i(46289),d=i(57243),r=i(15093);let s=(0,n.Z)([(0,r.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,a.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[l.W,d.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?d.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:d.iv``]}}]}}),o.K)},51868:function(e,t,i){var n=i(44249),a=i(72621),o=i(1231),l=i(57243),d=i(15093);(0,n.Z)([(0,d.Mo)("ha-md-divider")],(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,a.Z)(i,"styles",this),l.iv`:host{--md-divider-color:var(--divider-color)}`]}}]}}),o.B)},92824:function(e,t,i){var n=i(44249),a=i(72621),o=i(60930),l=i(9714),d=i(57243),r=i(15093),s=i(22381),c=i(76320);i(23334);(0,n.Z)([(0,r.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return d.dy` ${(0,a.Z)(i,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?d.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>`:d.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?d.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:d.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,s.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[l.W,d.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}`]}]}}),o.K)},15439:function(e,t,i){i.r(t),i.d(t,{HaSelectorUiColor:()=>d});var n=i(44249),a=i(57243),o=i(15093),l=i(36522);i(124);let d=(0,n.Z)([(0,o.Mo)("ha-selector-ui_color")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"method",key:"render",value:function(){return a.dy` <ha-color-picker .label="${this.label}" .hass="${this.hass}" .value="${this.value}" .helper="${this.helper}" .includeNone="${this.selector.ui_color?.include_none}" .includeState="${this.selector.ui_color?.include_state}" .defaultColor="${this.selector.ui_color?.default_color}" -changed="${this._valueChanged}"></ha-color-picker> `}},{kind:"method",key:"_valueChanged",value:function(e){(0,l.B)(this,"value-changed",{value:e.detail.value})}}]}}),a.oi)}};
//# sourceMappingURL=8058.3586fe5bc74edf84.js.map