iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 12.2 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["80460"],{88618:function(e,t,i){i.d(t,{Wg:()=>r,qN:()=>o.q});i(71695),i(47021);var n,a,l=i(9065),s=i(50778),o=i(11911);const d=null!==(a=null===(n=window.ShadyDOM)||void 0===n?void 0:n.inUse)&&void 0!==a&&a;class r extends o.H{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=e=>{this.disabled||this.setFormData(e.formData)}}findFormElement(){if(!this.shadowRoot||d)return null;const e=this.getRootNode().querySelectorAll("form");for(const t of Array.from(e))if(t.contains(this))return t;return null}connectedCallback(){var e;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(e=this.containingForm)||void 0===e||e.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.containingForm)||void 0===e||e.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}r.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,l.__decorate)([(0,s.Cb)({type:Boolean})],r.prototype,"disabled",void 0)},49976:function(e,t,i){i.d(t,{U:()=>n});const n=e=>e.stopPropagation()},94369:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{u:()=>o});var a=i(16485),l=i(27486),s=e([a]);a=(s.then?(await s)():s)[0];const o=(e,t)=>{try{var i,n;return null!==(i=null===(n=d(t))||void 0===n?void 0:n.of(e))&&void 0!==i?i:e}catch(a){return e}},d=(0,l.Z)((e=>new Intl.DisplayNames(e.language,{type:"language",fallback:"code"})));n()}catch(o){n(o)}}))},2790:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t),i.d(t,{HaLanguagePicker:()=>x,getLanguageOptions:()=>_});var a=i(61701),l=i(72621),s=i(16485),o=(i(71695),i(61893),i(9359),i(70104),i(47021),i(57243)),d=i(50778),r=i(27486),c=i(36522),u=i(49976),h=i(94369),v=i(1416),p=i(67862),m=(i(7285),i(92824),e([s,h]));[s,h]=m.then?(await m)():m;let g,f,y,k,b=e=>e;const _=(e,t,i,n)=>{let a=[];if(t){const t=p.o.translations;a=e.map((e=>{var i;let n=null===(i=t[e])||void 0===i?void 0:i.nativeName;if(!n)try{n=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(a){n=e}return{value:e,label:n}}))}else n&&(a=e.map((e=>({value:e,label:(0,h.u)(e,n)}))));return!i&&n&&a.sort(((e,t)=>(0,v.fe)(e.label,t.label,n.language))),a};let x=(0,a.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(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_defaultLanguages",value(){return[]}},{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){var n,a;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(null!==(n=this.languages)&&void 0!==n?n:this._defaultLanguages,this.nativeName,this.noSort,null===(a=this.hass)||void 0===a?void 0:a.locale).findIndex((e=>e.value===this.value));-1===e&&(this.value=void 0),t&&this._select.select(e)}}},{kind:"field",key:"_getLanguagesOptions",value(){return(0,r.Z)(_)}},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(p.o.translations)}},{kind:"method",key:"render",value:function(){var e,t,i,n,a,l,s;const d=this._getLanguagesOptions(null!==(e=this.languages)&&void 0!==e?e:this._defaultLanguages,this.nativeName,this.noSort,null===(t=this.hass)||void 0===t?void 0:t.locale),r=null!==(i=this.value)&&void 0!==i?i:this.required?null===(n=d[0])||void 0===n?void 0:n.value:this.value;return(0,o.dy)(g||(g=b` <ha-select .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" ="${0}" ="${0}" fixedMenuPosition naturalMenuWidth .inlineArrow="${0}"> ${0} </ha-select> `),null!==(a=this.label)&&void 0!==a?a:(null===(l=this.hass)||void 0===l?void 0:l.localize("ui.components.language-picker.language"))||"Language",r||"",this.required,this.disabled,this._changed,u.U,this.inlineArrow,0===d.length?(0,o.dy)(f||(f=b`<ha-list-item value="">${0}</ha-list-item>`),(null===(s=this.hass)||void 0===s?void 0:s.localize("ui.components.language-picker.no_languages"))||"No languages"):d.map((e=>(0,o.dy)(y||(y=b` <ha-list-item .value="${0}">${0}</ha-list-item> `),e.value,e.label))))}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(k||(k=b`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);n()}catch(g){n(g)}}))},7285:function(e,t,i){var n=i(61701),a=i(72621),l=(i(71695),i(47021),i(65703)),s=i(46289),o=i(57243),d=i(50778);let r,c,u,h=e=>e;(0,n.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,a.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,(0,o.iv)(r||(r=h`: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?(0,o.iv)(c||(c=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,o.iv)(u||(u=h``))]}}]}}),l.K)},92824:function(e,t,i){var n=i(61701),a=i(72621),l=(i(71695),i(40251),i(47021),i(60930)),s=i(9714),o=i(57243),d=i(50778),r=i(22381),c=i(76320);i(23334);let u,h,v,p,m=e=>e;(0,n.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(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return(0,o.dy)(u||(u=m` ${0} ${0} `),(0,a.Z)(i,"render",this,3)([]),this.clearable&&!this.required&&!this.disabled&&this.value?(0,o.dy)(h||(h=m`<ha-icon-button label="clear" ="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"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"):o.Ld)}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,o.dy)(v||(v=m`<span class="mdc-select__icon"><slot name="icon"></slot></span>`)):o.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(){var e;((0,a.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow)&&(null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector(".mdc-select__selected-text-container"))||void 0===e||e.classList.add("inline-arrow"))}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".mdc-select__selected-text-container");this.inlineArrow?null==e||e.classList.add("inline-arrow"):null==e||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,r.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,o.iv)(p||(p=m`: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)},17743:function(e,t,i){var n=i(13053);e.exports=function(e,t,i){for(var a=0,l=arguments.length>2?i:n(t),s=new e(l);l>a;)s[a]=t[a++];return s}}}]);
//# sourceMappingURL=80460.99e04fe242fc75ed.js.map