UNPKG

iobroker.lovelace

Version:

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

2 lines 2.29 kB
export const __webpack_ids__=["17497"];export const __webpack_modules__={23006:function(e,t,a){a.r(t),a.d(t,{HuiMarkdownCardEditor:()=>u});var o=a(44249),i=a(57243),n=a(15093),l=a(27486),s=a(62900),c=a(36522),r=(a(29073),a(18200));const d=(0,s.f0)(r.I,(0,s.Ry)({text_only:(0,s.jt)((0,s.O7)()),title:(0,s.jt)((0,s.Z_)()),content:(0,s.Z_)()}));let u=(0,o.Z)([(0,n.Mo)("hui-markdown-card-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,s.hu)(e,d),this._config=e}},{kind:"field",key:"_schema",value:()=>(0,l.Z)(((e,t)=>[{name:"style",required:!0,selector:{select:{mode:"box",options:["card","text-only"].map((t=>({label:e(`ui.panel.lovelace.editor.card.markdown.style_options.${t}`),image:{src:`/static/images/form/markdown_${t.replace("-","_")}.svg`,src_dark:`/static/images/form/markdown_${t.replace("-","_")}_dark.svg`,flip_rtl:!0},value:t})))}}},...t?[]:[{name:"title",selector:{text:{}}}],{name:"content",required:!0,selector:{template:{}}}]))},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return i.Ld;const e={...this._config,style:this._config.text_only?"text-only":"card"},t=this._schema(this.hass.localize,this._config.text_only||!1);return i.dy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${t}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){const t={...e.detail.value};"text-only"===t.style?t.text_only=!0:delete t.text_only,delete t.style,(0,c.B)(this,"config-changed",{config:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"style":case"content":return this.hass.localize(`ui.panel.lovelace.editor.card.markdown.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}]}}),i.oi)},18200:function(e,t,a){a.d(t,{I:()=>i});var o=a(62900);const i=(0,o.Ry)({type:(0,o.Z_)(),view_layout:(0,o.Yj)(),layout_options:(0,o.Yj)(),grid_options:(0,o.Yj)(),visibility:(0,o.Yj)()})}}; //# sourceMappingURL=17497.953f29e2252c158c.js.map