iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 12.5 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["95444"],{5828:function(e,t,n){n.r(t),n.d(t,{HaIconButtonPrev:()=>l});var i=n(61701),o=(n(71695),n(47021),n(57243)),a=n(50778),s=n(5111);n(23334);let d,c=e=>e;let l=(0,i.Z)([(0,a.Mo)("ha-icon-button-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_icon",value(){return"rtl"===s.E.document.dir?"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z":"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"}},{kind:"method",key:"render",value:function(){var e;return(0,o.dy)(d||(d=c` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon)}}]}}),o.oi)},38070:function(e,t,n){n.d(t,{Q:()=>i});const i=["relative","total","date","time","datetime"]},25508:function(e,t,n){n.a(e,(async function(e,i){try{n.d(t,{Q:()=>f});n(71695),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(47021);var o=n(35729),a=(n(83442),n(92263)),s=n(15367),d=n(56332),c=n(13888),l=(n(9427),n(40249)),r=e([o,a,s,d,c]);[o,a,s,d,c]=r.then?(await r)():r;const u=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),h={},f=e=>(0,l.ED)("action-button"===e?"service-button":e,"element",u,h);i()}catch(u){i(u)}}))},18372:function(e,t,n){var i=n(61701),o=(n(19083),n(71695),n(9359),n(56475),n(70104),n(61006),n(47021),n(57243)),a=n(50778),s=n(27486),d=n(62900),c=n(36522),l=n(73850),r=(n(29073),n(8148));let u,h=e=>e;const f={none:{},"entity-id":{},"last-changed":{},"last-updated":{},"last-triggered":{domains:["automation","script"]},position:{domains:["cover"]},"tilt-position":{domains:["cover"]},brightness:{domains:["light"]}};(0,i.Z)([(0,a.Mo)("hui-generic-entity-row-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,d.hu)(e,r.K),this._config=e}},{kind:"field",key:"_schema",value(){return(0,s.Z)(((e,t)=>{const n=(0,l.M)(e);return[{name:"entity",required:!0,selector:{entity:{}}},{type:"grid",name:"",schema:[{name:"name",selector:{text:{}}},{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}}]},{name:"secondary_info",selector:{select:{options:Object.keys(f).filter((e=>!("domains"in f[e])||"domains"in f[e]&&f[e].domains.includes(n))).map((e=>({value:e,label:t(`ui.panel.lovelace.editor.card.entities.secondary_info_values.${e}`)})))}}}]}))}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return o.Ld;const e=this._schema(this._config.entity,this.hass.localize);return(0,o.dy)(u||(u=h` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" -changed="${0}"></ha-form> `),this.hass,this._config,e,this._computeLabelCallback,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){(0,c.B)(this,"config-changed",{config:e.detail.value})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>"secondary_info"===e.name?this.hass.localize(`ui.panel.lovelace.editor.card.entity-row.${e.name}`):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}]}}),o.oi)},88333:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),o=(n(71695),n(40251),n(47021),n(50778)),a=n(46542),s=n(6973),d=(n(18372),e([a,s]));[a,s]=d.then?(await d)():d;const c="generic-row";(0,i.Z)([(0,o.Mo)("hui-row-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"get",key:"configElementType",value:function(){var e,t,n;return null!==(e=this.value)&&void 0!==e&&e.type||!("entity"in this.value)?"perform-action"===(null===(t=this.value)||void 0===t?void 0:t.type)?"call-service":null===(n=this.value)||void 0===n?void 0:n.type:c}},{kind:"method",key:"getConfigElement",value:async function(){if(this.configElementType===c)return document.createElement("hui-generic-entity-row-editor");const e=await(0,a.T)(this.configElementType);return e&&e.getConfigElement?e.getConfigElement():void 0}}]}}),s.k);t()}catch(c){t(c)}}))},56515:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),o=(n(71695),n(40251),n(47021),n(50778)),a=n(86609),s=n(6973),d=e([a,s]);[a,s]=d.then?(await d)():d;(0,i.Z)([(0,o.Mo)("hui-card-feature-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,a.A)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}},{kind:"method",key:"getConfigForm",value:async function(){const e=await(0,a.A)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}}]}}),s.k);t()}catch(c){t(c)}}))},42417:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),o=(n(71695),n(40251),n(47021),n(50778)),a=n(64830),s=n(6973),d=e([s]);s=(d.then?(await d)():d)[0];(0,i.Z)([(0,o.Mo)("hui-headerfooter-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,a.Q)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}}]}}),s.k);t()}catch(c){t(c)}}))},86005:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),o=(n(71695),n(40251),n(47021),n(50778)),a=n(15583),s=n(6973),d=e([a,s]);[a,s]=d.then?(await d)():d;(0,i.Z)([(0,o.Mo)("hui-heading-badge-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"get",key:"configElementType",value:function(){var e;return(null===(e=this.value)||void 0===e?void 0:e.type)||"entity"}},{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,a.t)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}},{kind:"method",key:"getConfigForm",value:async function(){const e=await(0,a.t)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}}]}}),s.k);t()}catch(c){t(c)}}))},50357:function(e,t,n){n.a(e,(async function(e,i){try{n.r(t),n.d(t,{HuiSubElementEditor:()=>M});var o=n(61701),a=(n(71695),n(47021),n(57243)),s=n(50778),d=n(36522),c=(n(23334),n(5828),n(88333)),l=n(56515),r=n(42417),u=n(86005),h=n(98007),f=e([c,l,r,u,h]);[c,l,r,u,h]=f.then?(await f)():f;let g,m,v,y,k,p,_,b=e=>e;const C="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",$="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z";let M=(0,o.Z)([(0,s.Mo)("hui-sub-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_guiModeAvailable",value(){return!0}},{kind:"field",decorators:[(0,s.SB)()],key:"_guiMode",value(){return!0}},{kind:"field",decorators:[(0,s.IO)(".editor")],key:"_editorElement",value:void 0},{kind:"method",key:"render",value:function(){var e,t;const n=this.config.elementConfig&&"type"in this.config.elementConfig?this.config.elementConfig.type:"";return(0,a.dy)(g||(g=b` <div class="header"> <div class="back-title"> <ha-icon-button-prev .label="${0}" ="${0}"></ha-icon-button-prev> <span slot="title"> ${0} </span> </div> <ha-icon-button class="gui-mode-button" ="${0}" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> </div> ${0} `),this.hass.localize("ui.common.back"),this._goBack,"element"===(null===(e=this.config)||void 0===e?void 0:e.type)?this.hass.localize("ui.panel.lovelace.editor.sub-element-editor.types.element_type",{type:this.hass.localize(`ui.panel.lovelace.editor.card.picture-elements.element_types.${n}`)||n}):this.hass.localize(`ui.panel.lovelace.editor.sub-element-editor.types.${null===(t=this.config)||void 0===t?void 0:t.type}`),this._toggleMode,!this._guiModeAvailable,this.hass.localize(this._guiMode?"ui.panel.lovelace.editor.edit_card.show_code_editor":"ui.panel.lovelace.editor.edit_card.show_visual_editor"),this._guiMode?C:$,this._renderEditor())}},{kind:"method",key:"_renderEditor",value:function(){switch(this.config.type){case"row":return(0,a.dy)(m||(m=b` <hui-row-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-row-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"header":case"footer":return(0,a.dy)(v||(v=b` <hui-headerfooter-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-headerfooter-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"element":return(0,a.dy)(y||(y=b` <hui-picture-element-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-picture-element-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"feature":return(0,a.dy)(k||(k=b` <hui-card-feature-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-card-feature-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"heading-badge":return(0,a.dy)(p||(p=b` <hui-heading-badge-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-heading-badge-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);default:return a.Ld}}},{kind:"method",key:"_goBack",value:function(){(0,d.B)(this,"go-back")}},{kind:"method",key:"_toggleMode",value:function(){var e;null===(e=this._editorElement)||void 0===e||e.toggleMode()}},{kind:"method",key:"_handleGUIModeChanged",value:function(e){e.stopPropagation(),this._guiMode=e.detail.guiMode,this._guiModeAvailable=e.detail.guiModeAvailable}},{kind:"method",key:"_handleConfigChanged",value:function(e){this._guiModeAvailable=e.detail.guiModeAvailable}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(_||(_=b`.header{display:flex;justify-content:space-between;align-items:center}.back-title{display:flex;align-items:center;font-size:18px}`))}}]}}),a.oi);i()}catch(g){i(g)}}))},98007:function(e,t,n){n.a(e,(async function(e,t){try{var i=n(61701),o=(n(71695),n(40251),n(47021),n(50778)),a=n(6973),s=n(25508),d=e([s,a]);[s,a]=d.then?(await d)():d;(0,i.Z)([(0,o.Mo)("hui-picture-element-element-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"get",key:"configElementType",value:function(){var e,t;return"action-button"===(null===(e=this.value)||void 0===e?void 0:e.type)?"service-button":null===(t=this.value)||void 0===t?void 0:t.type}},{kind:"method",key:"getConfigElement",value:async function(){const e=await(0,s.Q)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}}]}}),a.k);t()}catch(c){t(c)}}))},8148:function(e,t,n){n.d(t,{K:()=>s});var i=n(62900),o=n(38070),a=n(30571);const s=(0,i.G0)([(0,i.Ry)({entity:(0,i.Z_)(),name:(0,i.jt)((0,i.Z_)()),icon:(0,i.jt)((0,i.Z_)()),image:(0,i.jt)((0,i.Z_)()),secondary_info:(0,i.jt)((0,i.Z_)()),format:(0,i.jt)((0,i.kE)(o.Q)),state_color:(0,i.jt)((0,i.O7)()),tap_action:(0,i.jt)(a.fJ),hold_action:(0,i.jt)(a.fJ),double_tap_action:(0,i.jt)(a.fJ),confirmation:(0,i.jt)(a.TX)}),(0,i.Z_)()])}}]);
//# sourceMappingURL=95444.ade091dd6fa4474a.js.map