diff --git a/dist/select-list-card.js b/dist/select-list-card.js index b10e5eb..c80a555 100644 --- a/dist/select-list-card.js +++ b/dist/select-list-card.js @@ -286,7 +286,7 @@ found at http://polymer.github.io/PATENTS.txt .switch-label { margin-left: 10px; } - `}};e([Z()],Je.prototype,"hass",void 0),e([Z()],Je.prototype,"_config",void 0),Je=e([B("select-list-card-editor")],Je);var Ze;console.info(`%c select-list-card \n%c ${Be("common.version")} 1.1.1 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"select-list-card",name:""+Be("common.name"),description:""+Be("common.description"),preview:!0});let Ke=Ze=class extends ie{constructor(){super(...arguments),this.open=!0,this.options=[]}static async getConfigElement(){return document.createElement("select-list-card-editor")}static getStubConfig(e,t){return{entity:t.find(e=>e.startsWith("input_select"))||"",icon:"",truncate:!0,show_toggle:!1,scroll_to_selected:!0,max_options:5}}setConfig(e){if(!e||!e.entity||!e.entity.startsWith("input_select"))throw new Error(Be("error.invalid_configuration"));e.test_gui&&function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null}().setEditMode(!0),this.config=Object.assign({title:"",icon:"",show_toggle:!1,truncate:!0,scroll_to_selected:!0,max_options:5},e),this.open=this.open||this.config.open}async getCardSize(){let e=0;return this.config?(e+=this.config.title?1:0,e+=this.config.max_options?this.config.max_options:this.options.length,e):e}shouldUpdate(e){return function(e,t,s){if(t.has("config")||s)return!0;if(e.config.entity){var i=t.get("hass");return!i||i.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}(this,e,!1)}render(){if(!this.config.entity)return this.showError();const e=this.stateObj,t=e.state;this.options=e.attributes.options;const s=0===this.config.max_options?"":`max-height: ${48*(this.config.max_options||5)+16}px`;return j` + `}};e([Z()],Je.prototype,"hass",void 0),e([Z()],Je.prototype,"_config",void 0),Je=e([B("select-list-card-editor")],Je);var Ze;console.info(`%c select-list-card \n%c ${Be("common.version")} 1.1.1 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"select-list-card",name:"Select List Card"+Be("common.name"),description:"The select-list-card creates a selector using the items in an input-select helper"+Be("common.description"),preview:!0});let Ke=Ze=class extends ie{constructor(){super(...arguments),this.open=!0,this.options=[]}static async getConfigElement(){return document.createElement("select-list-card-editor")}static getStubConfig(e,t){return{entity:t.find(e=>e.startsWith("input_select"))||"",icon:"",truncate:!0,show_toggle:!1,scroll_to_selected:!0,max_options:5}}setConfig(e){if(!e||!e.entity||!e.entity.startsWith("input_select"))throw new Error(Be("error.invalid_configuration"));e.test_gui&&function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null}().setEditMode(!0),this.config=Object.assign({title:"",icon:"",show_toggle:!1,truncate:!0,scroll_to_selected:!0,max_options:5},e),this.open=this.open||this.config.open}async getCardSize(){let e=0;return this.config?(e+=this.config.title?1:0,e+=this.config.max_options?this.config.max_options:this.options.length,e):e}shouldUpdate(e){return function(e,t,s){if(t.has("config")||s)return!0;if(e.config.entity){var i=t.get("hass");return!i||i.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}(this,e,!1)}render(){if(!this.config.entity)return this.showError();const e=this.stateObj,t=e.state;this.options=e.attributes.options;const s=0===this.config.max_options?"":`max-height: ${48*(this.config.max_options||5)+16}px`;return j` ${this.config.title&&this.config.title.length?j`