iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 16.5 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["31061"],{94279:function(e,t,i){i.a(e,(async function(e,t){try{var o=i(61701),a=i(72621),n=(i(71695),i(9359),i(31526),i(40251),i(47021),i(2394)),r=i(28737),l=i(43631),d=i(57243),s=i(50778),u=i(20552),c=i(36522),h=(i(23334),i(7285),i(83166),e([r]));r=(h.then?(await h)():h)[0];let v,b,p,k,f,y,m=e=>e;const g="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",_="M7,10L12,15L17,10H7Z",$="M7,15L12,10L17,15H7Z";(0,l.hC)("vaadin-combo-box-item",(0,d.iv)(v||(v=m`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`)));(0,o.Z)([(0,s.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"invalid",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"items",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"filteredItems",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"dataProvider",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"allow-custom-value",type:Boolean})],key:"allowCustomValue",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value(){return"value"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value(){return"label"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"item-id-path"})],key:"itemIdPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"renderer",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"opened",value(){return!1}},{kind:"field",decorators:[(0,s.IO)("vaadin-combo-box-light",!0)],key:"_comboBox",value:void 0},{kind:"field",decorators:[(0,s.IO)("ha-textfield",!0)],key:"_inputElement",value:void 0},{kind:"field",key:"_overlayMutationObserver",value:void 0},{kind:"field",key:"_bodyMutationObserver",value:void 0},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:async function(){var e,t;await this.updateComplete,await(null===(e=this._inputElement)||void 0===e?void 0:e.updateComplete),null===(t=this._inputElement)||void 0===t||t.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),this._overlayMutationObserver&&(this._overlayMutationObserver.disconnect(),this._overlayMutationObserver=void 0),this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=void 0)}},{kind:"get",key:"selectedItem",value:function(){return this._comboBox.selectedItem}},{kind:"method",key:"setInputValue",value:function(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){var e;return(0,d.dy)(b||(b=m` <vaadin-combo-box-light .itemValuePath="${0}" .itemIdPath="${0}" .itemLabelPath="${0}" .items="${0}" .value="${0}" .filteredItems="${0}" .dataProvider="${0}" .allowCustomValue="${0}" .disabled="${0}" .required="${0}" ${0} -changed="${0}" -changed="${0}" -changed="${0}" attr-for-value="value"> <ha-textfield label="${0}" placeholder="${0}" ?disabled="${0}" ?required="${0}" validationMessage="${0}" .errorMessage="${0}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${0}" .icon="${0}" .invalid="${0}" .helper="${0}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${0} <ha-svg-icon role="button" tabindex="-1" aria-label="${0}" aria-expanded="${0}" class="toggle-button" .path="${0}" ="${0}"></ha-svg-icon> </vaadin-combo-box-light> `),this.itemValuePath,this.itemIdPath,this.itemLabelPath,this.items,this.value||"",this.filteredItems,this.dataProvider,this.allowCustomValue,this.disabled,this.required,(0,n.t)(this.renderer||this._defaultRowRenderer),this._openedChanged,this._filterChanged,this._valueChanged,(0,u.o)(this.label),(0,u.o)(this.placeholder),this.disabled,this.required,(0,u.o)(this.validationMessage),this.errorMessage,(0,d.dy)(p||(p=m`<div style="width:28px" role="none presentation"></div>`)),this.icon,this.invalid,this.helper,this.value?(0,d.dy)(k||(k=m`<ha-svg-icon role="button" tabindex="-1" aria-label="${0}" class="clear-button" .path="${0}" ="${0}"></ha-svg-icon>`),(0,u.o)(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.clear")),g,this._clearValue):"",(0,u.o)(this.label),this.opened?"true":"false",this.opened?$:_,this._toggleOpen)}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>(0,d.dy)(f||(f=m`<ha-list-item> ${0} </ha-list-item>`),this.itemLabelPath?e[this.itemLabelPath]:e)}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,c.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){var t,i;this.opened?(null===(t=this._comboBox)||void 0===t||t.close(),e.stopPropagation()):null===(i=this._comboBox)||void 0===i||i.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,c.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else{var i;null===(i=this._bodyMutationObserver)||void 0===i||i.disconnect(),this._bodyMutationObserver=void 0}}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{var t;"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){var t;if(e.inert)return e.inert=!1,null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const i=e.target;var t;if(i.inert)null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0,i.inert=!1}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,c.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,c.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value(){return(0,d.iv)(y||(y=m`:host{display:block;width:100%}vaadin-combo-box-light{position:relative;--vaadin-combo-box-overlay-max-height:calc(45vh - 56px)}ha-textfield{width:100%}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;padding:2px;color:var(--secondary-text-color)}ha-svg-icon{color:var(--input-dropdown-icon-color);position:absolute;cursor:pointer}.toggle-button{right:12px;top:-10px;inset-inline-start:initial;inset-inline-end:12px;direction:var(--direction)}:host([opened]) .toggle-button{color:var(--primary-color)}.clear-button{--mdc-icon-size:20px;top:-7px;right:36px;inset-inline-start:initial;inset-inline-end:36px;direction:var(--direction)}`))}}]}}),d.oi);t()}catch(v){t(v)}}))},21393:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaIconPicker:()=>C});var a=i(61701),n=(i(19083),i(71695),i(92745),i(61893),i(9359),i(56475),i(31526),i(70104),i(52924),i(40251),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47021),i(57243)),r=i(50778),l=i(27486),d=i(36522),s=i(80654),u=i(94279),c=(i(7285),i(65981),e([u]));u=(c.then?(await c)():c)[0];let h,v,b,p,k,f=e=>e,y=[],m=!1;const g=async()=>{m=!0;const e=await i.e("25016").then(i.t.bind(i,58134,19));y=e.default.map((e=>({icon:`mdi:${e.name}`,parts:new Set(e.name.split("-")),keywords:e.keywords})));const t=[];Object.keys(s.g).forEach((e=>{t.push(_(e))})),(await Promise.all(t)).forEach((e=>{y.push(...e)}))},_=async e=>{try{const t=s.g[e].getIconList;if("function"!=typeof t)return[];const i=await t();return i.map((t=>{var i;return{icon:`${e}:${t.name}`,parts:new Set(t.name.split("-")),keywords:null!==(i=t.keywords)&&void 0!==i?i:[]}}))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},$=e=>(0,n.dy)(h||(h=f`<ha-list-item graphic="avatar"> <ha-icon .icon="${0}" slot="graphic"></ha-icon> ${0} </ha-list-item>`),e.icon,e.icon);let C=(0,a.Z)([(0,r.Mo)("ha-icon-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"invalid",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(v||(v=f` <ha-combo-box .hass="${0}" item-value-path="icon" item-label-path="icon" .value="${0}" allow-custom-value .dataProvider="${0}" .label="${0}" .helper="${0}" .disabled="${0}" .required="${0}" .placeholder="${0}" .errorMessage="${0}" .invalid="${0}" .renderer="${0}" icon -changed="${0}" -changed="${0}"> ${0} </ha-combo-box> `),this.hass,this._value,m?this._iconProvider:void 0,this.label,this.helper,this.disabled,this.required,this.placeholder,this.errorMessage,this.invalid,$,this._openedChanged,this._valueChanged,this._value||this.placeholder?(0,n.dy)(b||(b=f` <ha-icon .icon="${0}" slot="icon"> </ha-icon> `),this._value||this.placeholder):(0,n.dy)(p||(p=f`<slot slot="icon" name="fallback"></slot>`)))}},{kind:"field",key:"_filterIcons",value(){return(0,l.Z)(((e,t=y)=>{if(!e)return t;const i=[],o=(e,t)=>i.push({icon:e,rank:t});for(const a of t)a.parts.has(e)?o(a.icon,1):a.keywords.includes(e)?o(a.icon,2):a.icon.includes(e)?o(a.icon,3):a.keywords.some((t=>t.includes(e)))&&o(a.icon,4);return 0===i.length&&o(e,0),i.sort(((e,t)=>e.rank-t.rank))}))}},{kind:"field",key:"_iconProvider",value(){return(e,t)=>{const i=this._filterIcons(e.filter.toLowerCase(),y),o=e.page*e.pageSize,a=o+e.pageSize;t(i.slice(o,a),i.length)}}},{kind:"method",key:"_openedChanged",value:async function(e){e.detail.value&&!m&&(await g(),this.requestUpdate())}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this._setValue(e.detail.value)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,(0,d.B)(this,"value-changed",{value:this._value},{bubbles:!1,composed:!1})}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(k||(k=f`[slot=icon]{color:var(--primary-text-color);position:relative;bottom:2px}[slot=prefix]{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}`))}}]}}),n.oi);o()}catch(h){o(h)}}))},62841:function(e,t,i){i.a(e,(async function(e,o){try{i.r(t);var a=i(61701),n=(i(71695),i(19423),i(47021),i(57243)),r=i(50778),l=i(36522),d=i(21393),s=(i(83166),i(28008)),u=e([d]);d=(u.then?(await u)():u)[0];let c,h,v=e=>e;(0,a.Z)([(0,r.Mo)("ha-input_button-form")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"new",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_icon",value:void 0},{kind:"field",key:"_item",value:void 0},{kind:"set",key:"item",value:function(e){this._item=e,e?(this._name=e.name||"",this._icon=e.icon||""):(this._name="",this._icon="")}},{kind:"method",key:"focus",value:function(){this.updateComplete.then((()=>{var e;return null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector("[dialogInitialFocus]"))||void 0===e?void 0:e.focus()}))}},{kind:"method",key:"render",value:function(){return this.hass?(0,n.dy)(c||(c=v` <div class="form"> <ha-textfield .value="${0}" .configValue="${0}" ="${0}" .label="${0}" autoValidate required .validationMessage="${0}" dialogInitialFocus></ha-textfield> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" -changed="${0}" .label="${0}"></ha-icon-picker> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon")):n.Ld}},{kind:"method",key:"_valueChanged",value:function(e){var t;if(!this.new&&!this._item)return;e.stopPropagation();const i=e.target.configValue,o=(null===(t=e.detail)||void 0===t?void 0:t.value)||e.target.value;if(this[`_${i}`]===o)return;const a=Object.assign({},this._item);o?a[i]=o:delete a[i],(0,l.B)(this,"value-changed",{value:a})}},{kind:"get",static:!0,key:"styles",value:function(){return[s.Qx,(0,n.iv)(h||(h=v`.form{color:var(--primary-text-color)}.row{padding:16px 0}ha-textfield{display:block;margin:8px 0}`))]}}]}}),n.oi);o()}catch(c){o(c)}}))},30338:function(e,t,i){var o=i(97934),a=i(71998),n=i(4576),r=i(36760);e.exports=function(e,t){t&&"string"==typeof e||a(e);var i=r(e);return n(a(void 0!==i?o(i,e):e))}},60933:function(e,t,i){var o=i(40810),a=i(57877),n=i(63983),r=i(12360),l=i(13053),d=i(47645);o({target:"Array",proto:!0},{flatMap:function(e){var t,i=r(this),o=l(i);return n(e),(t=d(i,0)).length=a(t,i,i,o,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},32126:function(e,t,i){i(35709)("flatMap")},25677:function(e,t,i){var o=i(40810),a=i(97934),n=i(63983),r=i(71998),l=i(4576),d=i(30338),s=i(79995),u=i(14181),c=i(92288),h=s((function(){for(var e,t,i=this.iterator,o=this.mapper;;){if(t=this.inner)try{if(!(e=r(a(t.next,t.iterator))).done)return e.value;this.inner=null}catch(n){u(i,"throw",n)}if(e=r(a(this.next,i)),this.done=!!e.done)return;try{this.inner=d(o(e.value,this.counter++),!1)}catch(n){u(i,"throw",n)}}}));o({target:"Iterator",proto:!0,real:!0,forced:c},{flatMap:function(e){return r(this),n(e),new h(l(this),{mapper:e,inner:null})}})}}]);
//# sourceMappingURL=31061.f39bdbb3a1fa9b60.js.map