UNPKG

iobroker.lovelace

Version:

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

5 lines 6.94 kB
/*! For license information please see 67395.cf9ae7588c30d000.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[67395],{57237:function(t,o,e){e.d(o,{d:function(){return a}});const a=t=>t.stopPropagation()},70947:function(t,o,e){e(62953);var a=e(40445),i=e(50759),r=(e(38625),e(5124)),n=e(67576);e(67094);let s,c,h=t=>t;class l extends i.A{renderCheckboxIcon(){return(0,r.qy)(s||(s=h` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[i.A.styles,(0,r.AH)(c||(c=h`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],l.prototype,"selected",void 0),l=(0,a.Cg)([(0,n.EM)("ha-dropdown-item")],l)},29823:function(t,o,e){e.a(t,async function(t,o){try{e(3362),e(62953);var a=e(40445),i=e(52254),r=e(5124),n=e(67576),s=t([i]);i=(s.then?(await s)():s)[0];let c,h=t=>t;class l extends i.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[i.A.styles,(0,r.AH)(c||(c=h`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var( --card-background-color, var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)), )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,a.Cg)([(0,n.EM)("ha-dropdown")],l),o()}catch(c){o(c)}})},8456:function(t,o,e){e.a(t,async function(t,a){try{e.r(o),e.d(o,{HaFormOptionalActions:function(){return A}});e(74423),e(18111),e(22489),e(61701),e(45367),e(92731),e(3362),e(62953);var i=e(40445),r=e(5124),n=e(67576),s=e(22786),c=e(57237),h=e(18350),l=e(29823),d=(e(70947),e(67094),e(52763)),p=t([h,l,d]);[h,l,d]=p.then?(await p)():p;let u,m,f,g,v,y=t=>t;const b="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",w=[];class A extends r.WF{async focus(){var t;await this.updateComplete,null===(t=this._form)||void 0===t||t.focus()}reportValidity(){return!this._form||this._form.reportValidity()}updated(t){if(super.updated(t),t.has("data")){var o;const t=null!==(o=this._displayActions)&&void 0!==o?o:w,e=this._hiddenActions(this.schema.schema,t);this._displayActions=[...t,...e.filter(t=>t in this.data)]}}render(){var t,o,e;const a=null!==(t=this._displayActions)&&void 0!==t?t:w,i=this._displaySchema(this.schema.schema,null!==(o=this._displayActions)&&void 0!==o?o:[]),n=this._hiddenActions(this.schema.schema,a),s=new Map(this.computeLabel?this.schema.schema.map(t=>[t.name,t]):[]);return(0,r.qy)(u||(u=y` ${0} ${0} `),i.length>0?(0,r.qy)(m||(m=y` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" .computeLabel="${0}" .computeHelper="${0}" .localizeValue="${0}"></ha-form> `),this.hass,this.data,i,this.disabled,this.computeLabel,this.computeHelper,this.localizeValue):r.s6,n.length>0?(0,r.qy)(f||(f=y` <ha-dropdown @wa-select="${0}" @closed="${0}"> <ha-button slot="trigger" appearance="filled" size="small"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> ${0} </ha-dropdown> `),this._handleAddAction,c.d,b,(null===(e=this.localize)||void 0===e?void 0:e.call(this,"ui.components.form-optional-actions.add"))||"Add interaction",n.map(t=>{const o=s.get(t);return(0,r.qy)(g||(g=y` <ha-dropdown-item .value="${0}"> ${0} </ha-dropdown-item> `),t,this.computeLabel&&o?this.computeLabel(o):t)})):r.s6)}_handleAddAction(t){var o;const e=t.detail.item.value;this._displayActions=[...null!==(o=this._displayActions)&&void 0!==o?o:[],e]}constructor(...t){super(...t),this.disabled=!1,this._hiddenActions=(0,s.A)((t,o)=>t.map(t=>t.name).filter(t=>!o.includes(t))),this._displaySchema=(0,s.A)((t,o)=>t.filter(t=>o.includes(t.name)))}}A.styles=(0,r.AH)(v||(v=y`:host{display:flex!important;flex-direction:column;gap:var(--ha-space-6)}:host ha-form{display:block}ha-dropdown{display:inline-block}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"localize",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"data",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"schema",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],A.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"computeLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"computeHelper",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],A.prototype,"localizeValue",void 0),(0,i.Cg)([(0,n.wk)()],A.prototype,"_displayActions",void 0),(0,i.Cg)([(0,n.P)("ha-form")],A.prototype,"_form",void 0),A=(0,i.Cg)([(0,n.EM)("ha-form-optional_actions")],A),a()}catch(u){a(u)}})},69235:function(t,o,e){e.a(t,async function(t,o){try{e(3362),e(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await e.e(71055).then(e.bind(e,52370))).default),o()}catch(a){o(a)}},1)},35370:function(t,o,e){var a=e(26198);t.exports=function(t,o,e){for(var i=0,r=arguments.length>2?e:a(o),n=new t(r);r>i;)n[i]=o[i++];return n}},95010:function(t,o,e){e.d(o,{q:function(){return i},N:function(){return r}});e(54743),e(11745),e(16573),e(78100),e(77936),e(21489),e(48140),e(75044),e(21903),e(91134),e(28845),e(373),e(37467),e(44732),e(79577),e(16632),e(34226),e(9486),e(20456);let a=(t=21)=>{let o="",e=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)o+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&e[t]];return o};function i(t,o,e){const a=t=>Object.is(t,-0)?0:t;return a(t<o?o:t>e?e:t)}function r(t=""){return`${t}${a()}`}}}]);