UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 13 kB
export const __webpack_ids__=["26443"];export const __webpack_modules__={49976:function(e,t,i){i.d(t,{U:()=>a});const a=e=>e.stopPropagation()},94369:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{u:()=>o});var n=i(16485),l=i(27486),s=e([n]);n=(s.then?(await s)():s)[0];const o=(e,t)=>{try{return d(t)?.of(e)??e}catch{return e}},d=(0,l.Z)((e=>new Intl.DisplayNames(e.language,{type:"language",fallback:"code"})));a()}catch(e){a(e)}}))},22381:function(e,t,i){i.d(t,{D:()=>a});const a=(e,t,i=!1)=>{let a;const n=(...n)=>{const l=i&&!a;clearTimeout(a),a=window.setTimeout((()=>{a=void 0,e(...n)}),t),l&&e(...n)};return n.cancel=()=>{clearTimeout(a)},n}},76320:function(e,t,i){i.d(t,{T:()=>a,y:()=>n});const a=e=>{requestAnimationFrame((()=>setTimeout(e,0)))},n=()=>new Promise((e=>{a(e)}))},2790:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaLanguagePicker:()=>y,getLanguageOptions:()=>m});var n=i(44249),l=i(72621),s=i(16485),o=(i(9359),i(70104),i(57243)),d=i(15093),r=i(27486),c=i(36522),u=i(49976),h=i(94369),p=i(1416),v=i(67862),g=(i(7285),i(92824),e([s,h]));[s,h]=g.then?(await g)():g;const m=(e,t,i,a)=>{let n=[];if(t){const t=v.o.translations;n=e.map((e=>{let i=t[e]?.nativeName;if(!i)try{i=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(t){i=e}return{value:e,label:i}}))}else a&&(n=e.map((e=>({value:e,label:(0,h.u)(e,a)}))));return!i&&a&&n.sort(((e,t)=>(0,p.fe)(e.label,t.label,a.language))),n};let y=(0,n.Z)([(0,d.Mo)("ha-language-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"languages",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_defaultLanguages",value:()=>[]},{kind:"field",decorators:[(0,d.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,l.Z)(i,"firstUpdated",this,3)([e]),this._computeDefaultLanguageOptions()}},{kind:"method",key:"updated",value:function(e){(0,l.Z)(i,"updated",this,3)([e]);const t=e.has("hass")&&this.hass&&e.get("hass")&&e.get("hass").locale.language!==this.hass.locale.language;if(e.has("languages")||e.has("value")||t){if(this._select.layoutOptions(),this._select.value!==this.value&&(0,c.B)(this,"value-changed",{value:this._select.value}),!this.value)return;const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale).findIndex((e=>e.value===this.value));-1===e&&(this.value=void 0),t&&this._select.select(e)}}},{kind:"field",key:"_getLanguagesOptions",value:()=>(0,r.Z)(m)},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(v.o.translations)}},{kind:"method",key:"render",value:function(){const e=this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale),t=this.value??(this.required?e[0]?.value:this.value);return o.dy` <ha-select .label="${this.label??(this.hass?.localize("ui.components.language-picker.language")||"Language")}" .value="${t||""}" .required="${this.required}" .disabled="${this.disabled}" @selected="${this._changed}" @closed="${u.U}" fixedMenuPosition naturalMenuWidth .inlineArrow="${this.inlineArrow}"> ${0===e.length?o.dy`<ha-list-item value="">${this.hass?.localize("ui.components.language-picker.no_languages")||"No languages"}</ha-list-item>`:e.map((e=>o.dy` <ha-list-item .value="${e.value}">${e.label}</ha-list-item> `))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){const t=e.target;""!==t.value&&t.value!==this.value&&(this.value=t.value,(0,c.B)(this,"value-changed",{value:this.value}))}}]}}),o.oi);a()}catch(e){a(e)}}))},7285:function(e,t,i){i.d(t,{M:()=>r});var a=i(44249),n=i(72621),l=i(65703),s=i(46289),o=i(57243),d=i(15093);let r=(0,a.Z)([(0,d.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,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,o.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?o.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:o.iv``]}}]}}),l.K)},92824:function(e,t,i){var a=i(44249),n=i(72621),l=i(60930),s=i(9714),o=i(57243),d=i(15093),r=i(22381),c=i(76320);i(23334);(0,a.Z)([(0,d.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return o.dy` ${(0,n.Z)(i,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?o.dy`<ha-icon-button label="clear" @click="${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>`:o.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?o.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:o.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,n.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,n.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,n.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,r.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[s.W,o.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)},74783:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaLanguageSelector:()=>r});var n=i(44249),l=i(57243),s=i(15093),o=i(2790),d=e([o]);o=(d.then?(await d)():d)[0];let r=(0,n.Z)([(0,s.Mo)("ha-selector-language")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return l.dy` <ha-language-picker .hass="${this.hass}" .value="${this.value}" .label="${this.label}" .helper="${this.helper}" .languages="${this.selector.language?.languages}" .nativeName="${Boolean(this.selector?.language?.native_name)}" .noSort="${Boolean(this.selector?.language?.no_sort)}" .disabled="${this.disabled}" .required="${this.required}"></ha-language-picker> `}},{kind:"field",static:!0,key:"styles",value:()=>l.iv`ha-language-picker{width:100%}`}]}}),l.oi);a()}catch(e){a(e)}}))},16485:function(e,t,i){i.a(e,(async function(e,t){try{i(92745);var a=i(61449),n=i(40574),l=i(30532),s=i(41674),o=i(49722),d=i(76632),r=i(7884),c=i(35185),u=i(60933),h=i(44180),p=i(49447);const e=async()=>{const e=(0,h.sS)(),t=[];(0,l.shouldPolyfill)()&&await Promise.all([i.e("80210"),i.e("74055")]).then(i.bind(i,98133)),(0,o.shouldPolyfill)()&&await Promise.all([i.e("83895"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,p.H)()))),(0,u.shouldPolyfill)()&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,s.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,d.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,r.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("57377")]).then(i.bind(i,39030)).then((()=>i.e("61236").then(i.t.bind(i,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,p.n)(e)))};await e(),t()}catch(e){t(e)}}),1)}}; //# sourceMappingURL=26443.4ea8f41c16837865.js.map