Migrate generic-picker to new design (#27594)

* WIP new combo box

* Use new combo box for generic picker

* Fix esc close and clean up

* Fix empty search list item

* Fix picker usages

* Improve labels picker

* Patch WA to make esc on popover work correctly

* Apply suggestion from @piitaya

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>

* Fix NO_MATCHING_ITEMS_FOUND_ID

* Fix possible undefined boolean props

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
Wendelin
2025-10-24 12:52:56 +02:00
committed by GitHub
parent c139ec22f9
commit 21b83426d6
21 changed files with 1070 additions and 706 deletions

View File

@@ -113,6 +113,9 @@ export class HaEntityPicker extends LitElement {
@property({ attribute: "hide-clear-icon", type: Boolean })
public hideClearIcon = false;
@property({ attribute: "add-button", type: Boolean })
public addButton = false;
@query("ha-generic-picker") private _picker?: HaGenericPicker;
protected firstUpdated(changedProperties: PropertyValues): void {
@@ -281,7 +284,7 @@ export class HaEntityPicker extends LitElement {
.searchLabel=${this.searchLabel}
.notFoundLabel=${notFoundLabel}
.placeholder=${placeholder}
.value=${this.value}
.value=${this.addButton ? undefined : this.value}
.rowRenderer=${this._rowRenderer}
.getItems=${this._getItems}
.getAdditionalItems=${this._getAdditionalItems}
@@ -289,6 +292,9 @@ export class HaEntityPicker extends LitElement {
.searchFn=${this._searchFn}
.valueRenderer=${this._valueRenderer}
@value-changed=${this._valueChanged}
.addButtonLabel=${this.addButton
? this.hass.localize("ui.components.entity.entity-picker.add")
: undefined}
>
</ha-generic-picker>
`;