c.3243a8b0.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import{a as e,h as i,e as t,i as a,$ as n,O as l,z as o,A as s,r as c,n as r,m as d}from"./main-ad130be7.js";import"./c.3f859915.js";e([r("search-input")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"filter",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"suffix",value:()=>!1},{kind:"field",decorators:[t({type:Boolean})],key:"autofocus",value:()=>!1},{kind:"field",decorators:[t({type:String})],key:"label",value:void 0},{kind:"method",key:"focus",value:function(){var e;null===(e=this._input)||void 0===e||e.focus()}},{kind:"field",decorators:[a("ha-textfield",!0)],key:"_input",value:void 0},{kind:"method",key:"render",value:function(){return n`
  2. <ha-textfield
  3. .autofocus=${this.autofocus}
  4. .label=${this.label||"Search"}
  5. .value=${this.filter||""}
  6. icon
  7. .iconTrailing=${this.filter||this.suffix}
  8. @input=${this._filterInputChanged}
  9. >
  10. <slot name="prefix" slot="leadingIcon">
  11. <ha-svg-icon
  12. tabindex="-1"
  13. class="prefix"
  14. .path=${l}
  15. ></ha-svg-icon>
  16. </slot>
  17. <div class="trailing" slot="trailingIcon">
  18. ${this.filter&&n`
  19. <ha-icon-button
  20. @click=${this._clearSearch}
  21. .label=${this.hass.localize("ui.common.clear")}
  22. .path=${o}
  23. class="clear-button"
  24. ></ha-icon-button>
  25. `}
  26. <slot name="suffix"></slot>
  27. </div>
  28. </ha-textfield>
  29. `}},{kind:"method",key:"_filterChanged",value:async function(e){s(this,"value-changed",{value:String(e)})}},{kind:"method",key:"_filterInputChanged",value:async function(e){this._filterChanged(e.target.value)}},{kind:"method",key:"_clearSearch",value:async function(){this._filterChanged("")}},{kind:"get",static:!0,key:"styles",value:function(){return c`
  30. :host {
  31. display: inline-flex;
  32. }
  33. ha-svg-icon,
  34. ha-icon-button {
  35. color: var(--primary-text-color);
  36. }
  37. ha-svg-icon {
  38. outline: none;
  39. }
  40. .clear-button {
  41. --mdc-icon-size: 20px;
  42. }
  43. ha-textfield {
  44. display: inherit;
  45. }
  46. .trailing {
  47. display: flex;
  48. align-items: center;
  49. }
  50. `}}]}}),i);const u=d(((e,i)=>e.filter((e=>h(e.name).includes(h(i))||h(e.description).includes(h(i))||h(e.category).includes(h(i))||h(e.full_name).includes(h(i))||h(e.authors).includes(h(i))||h(e.domain).includes(h(i)))))),h=d((e=>String(e||"").toLocaleLowerCase().replace(/-|_| /g,"")));export{u as f};