iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 4.42 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[90143],{24770:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiTodoListEditor:function(){return z}});a(18111),a(61701),a(62953);var o=a(40445),s=a(5124),l=a(67576),n=a(22786),c=a(63533),r=a(62134),d=a(36312),h=a(1087),_=a(38962),p=a(52763),u=a(84698),m=a(7382),v=a(65590),g=a(82286),f=e([_,p,r]);[_,p,r]=f.then?(await f)():f;let b,y,C=e=>e;const E="M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",$=[r.ITEM_TAP_ACTION_EDIT,r.ITEM_TAP_ACTION_TOGGLE],k=(0,c.kp)(u.H,(0,c.Ik)({title:(0,c.lq)((0,c.Yj)()),theme:(0,c.lq)((0,c.Yj)()),entity:(0,c.lq)((0,c.Yj)()),hide_completed:(0,c.lq)((0,c.zM)()),hide_create:(0,c.lq)((0,c.zM)()),hide_section_headers:(0,c.lq)((0,c.zM)()),display_order:(0,c.lq)((0,c.Yj)()),item_tap_action:(0,c.lq)((0,c.Yj)()),due_date_period:(0,c.lq)((0,c.Ik)())}));class z extends s.WF{setConfig(e){(0,c.vA)(e,k),this._config=e}render(){return this.hass&&this._config?(0,s.qy)(b||(b=C` ${0} <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form> `),(0,d.x)(this.hass.config,"todo")?"":(0,s.qy)(y||(y=C` <ha-alert alert-type="error"> ${0} </ha-alert> `),this.hass.localize("ui.panel.lovelace.editor.card.shopping-list.integration_not_loaded")),this.hass,this._data(this._config),this._schema(this.hass.localize,this._todoListSupportsFeature(v.Ed.MOVE_TODO_ITEM)),this._computeLabelCallback,this._computeHelperCallback,this._valueChanged):s.s6}_valueChanged(e){const t=Object.assign({},e.detail.value);t.item_tap_action===r.ITEM_TAP_ACTION_EDIT&&delete t.item_tap_action,(0,h.r)(this,"config-changed",{config:t})}_todoListSupportsFeature(e){var t,a;const i=null!==(t=this._config)&&void 0!==t&&t.entity?this.hass.states[null===(a=this._config)||void 0===a?void 0:a.entity]:void 0;return!!i&&(0,g.$)(i,e)}static get styles(){return m.U}constructor(...e){super(...e),this._schema=(0,n.A)((e,t)=>[{name:"title",selector:{text:{}}},{name:"entity",selector:{entity:{domain:"todo"}}},{name:"theme",selector:{theme:{}}},{name:"hide_completed",selector:{boolean:{}}},{name:"hide_create",selector:{boolean:{}}},{name:"hide_section_headers",selector:{boolean:{}}},{name:"display_order",selector:{select:{options:Object.values(v.EE).map(a=>({value:a,label:e(`ui.panel.lovelace.editor.card.todo-list.sort_modes.${a===v.EE.NONE&&t?"manual":a}`)}))}}},{name:"due_date_period",selector:{period:{options:["today","tomorrow","this_week","next_week","this_month","next_month","next_7d","next_30d","none"]}}},{name:"interactions",type:"expandable",flatten:!0,iconPath:E,schema:[{name:"item_tap_action",required:!0,selector:{select:{mode:"dropdown",options:Object.values($).map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.todo-list.actions.${t}`)}))}}}]}]),this._data=(0,n.A)(e=>Object.assign({display_order:"none",item_tap_action:"edit"},e)),this._computeLabelCallback=e=>{switch(e.name){case"theme":return`${this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;case"hide_completed":case"hide_create":case"hide_section_headers":case"display_order":case"item_tap_action":case"due_date_period":return this.hass.localize(`ui.panel.lovelace.editor.card.todo-list.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}},this._computeHelperCallback=e=>{switch(e.name){case"hide_section_headers":case"due_date_period":return this.hass.localize(`ui.panel.lovelace.editor.card.todo-list.${e.name}_helper`);default:return}}}}(0,o.Cg)([(0,l.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,o.Cg)([(0,l.wk)()],z.prototype,"_config",void 0),z=(0,o.Cg)([(0,l.EM)("hui-todo-list-card-editor")],z),i()}catch(b){i(b)}})},84698:function(e,t,a){a.d(t,{H:function(){return o}});var i=a(63533);const o=(0,i.Ik)({type:(0,i.Yj)(),view_layout:(0,i.bz)(),layout_options:(0,i.bz)(),grid_options:(0,i.bz)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}}]);