diff --git a/src/common/search/search-input.ts b/src/common/search/search-input.ts index f9806d60e0..ae1d48811a 100644 --- a/src/common/search/search-input.ts +++ b/src/common/search/search-input.ts @@ -14,6 +14,9 @@ class SearchInput extends LitElement { @property() public filter?: string; + @property({ type: Boolean }) + public suffix = false; + @property({ type: Boolean }) public autofocus = false; @@ -33,7 +36,7 @@ class SearchInput extends LitElement { .label=${this.label || "Search"} .value=${this.filter || ""} .icon=${true} - .iconTrailing=${this.filter} + .iconTrailing=${this.filter || this.suffix} @input=${this._filterInputChanged} > @@ -43,16 +46,18 @@ class SearchInput extends LitElement { .path=${mdiMagnify} > - ${this.filter && - html` - - `} +
+ ${this.filter && + html` + + `} + +
`; } @@ -81,15 +86,16 @@ class SearchInput extends LitElement { ha-svg-icon { outline: none; } - ha-icon-button { - --mdc-icon-button-size: 24px; - } .clear-button { --mdc-icon-size: 20px; } ha-textfield { display: inherit; } + .trailing { + display: flex; + align-items: center; + } `; } } diff --git a/src/components/ha-button-related-filter-menu.ts b/src/components/ha-button-related-filter-menu.ts index fb65469e12..9eb28c7bb7 100644 --- a/src/components/ha-button-related-filter-menu.ts +++ b/src/components/ha-button-related-filter-menu.ts @@ -73,6 +73,7 @@ export class HaRelatedFilterButtonMenu extends LitElement { .hass=${this.hass} .value=${this.value?.area} no-add + .excludeDomains=${this.excludeDomains} @value-changed=${this._areaPicked} > - -
- ${filterInfo - ? html`
- ${this.narrow - ? html`
- - - ${filterInfo} - -
` - : filterInfo} - - ${this.hass.localize("ui.components.data-table.clear")} - -
` - : ""} -
`; + .hass=${this.hass} + .filter=${this.filter} + .suffix=${!this.narrow} + @value-changed=${this._handleSearchChange} + .label=${this.searchLabel || + this.hass.localize("ui.components.data-table.search")} + > + ${!this.narrow + ? html`
+ ${filterInfo + ? html`
+ ${filterInfo} + + ${this.hass.localize("ui.components.data-table.clear")} + +
` + : ""} + +
` + : ""} + `; return html` -
+
+ ${this.narrow + ? html`
+ ${this.numHidden || + this.activeFilters + ? html`${this.numHidden || "!"}` + : ""} +
` + : ""} +
${this.narrow ? html`
@@ -267,6 +272,12 @@ export class HaTabsSubpageDataTable extends LitElement { align-items: center; color: var(--secondary-text-color); } + search-input { + --mdc-text-field-fill-color: var(--sidebar-background-color); + --mdc-text-field-idle-line-color: var(--divider-color); + --text-field-overflow: visible; + z-index: 5; + } .table-header search-input { display: block; position: absolute; @@ -276,15 +287,16 @@ export class HaTabsSubpageDataTable extends LitElement { } .search-toolbar search-input { display: block; + width: 100%; color: var(--secondary-text-color); - --mdc-text-field-fill-color: transparant; - --mdc-text-field-idle-line-color: var(--divider-color); --mdc-ripple-color: transparant; } .filters { + --mdc-text-field-fill-color: initial; + --mdc-text-field-idle-line-color: initial; + --text-field-overflow: initial; display: flex; justify-content: flex-end; - width: 100%; margin-right: 8px; } .active-filters { @@ -295,6 +307,7 @@ export class HaTabsSubpageDataTable extends LitElement { padding: 2px 2px 2px 8px; margin-left: 4px; font-size: 14px; + width: max-content; } .active-filters ha-svg-icon { color: var(--primary-color); @@ -313,6 +326,24 @@ export class HaTabsSubpageDataTable extends LitElement { left: 0; content: ""; } + .badge { + min-width: 20px; + box-sizing: border-box; + border-radius: 50%; + font-weight: 400; + background-color: var(--primary-color); + line-height: 20px; + text-align: center; + padding: 0px 4px; + color: var(--text-primary-color); + position: absolute; + right: 0; + top: 4px; + font-size: 0.65em; + } + .filter-menu { + position: relative; + } `; } } diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index 0054e2dbbf..1c749ad090 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -272,6 +272,7 @@ class HassTabsSubpage extends LitElement { ha-menu-button, ha-icon-button-arrow-prev, ::slotted([slot="toolbar-icon"]) { + display: flex; flex-shrink: 0; pointer-events: auto; color: var(--sidebar-icon-color); diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 4dc224c2e7..3c8dbe1f1e 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -297,29 +297,35 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { this._filter ); - const filterMenu = html` - - - - ${this.hass.localize( - "ui.panel.config.integrations.ignore.show_ignored" - )} - - - ${this.hass.localize( - "ui.panel.config.integrations.disable.show_disabled" - )} - - `; + + + + ${this.hass.localize( + "ui.panel.config.integrations.ignore.show_ignored" + )} + + + ${this.hass.localize( + "ui.panel.config.integrations.disable.show_disabled" + )} + + + ${!this._showDisabled && this.narrow && disabledCount + ? html`${disabledCount}` + : ""} +
`; return html` - ${!this._showDisabled && disabledCount - ? html`
- ${this.hass.localize( - "ui.panel.config.integrations.disable.disabled_integrations", - { number: disabledCount } - )} - + ${!this._showDisabled && disabledCount + ? html`
+ ${this.hass.localize( + "ui.panel.config.integrations.disable.disabled_integrations", + { number: disabledCount } )} - > -
` - : ""} - ${filterMenu} + +
` + : ""} + ${filterMenu} + `} @@ -683,13 +687,15 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { .empty-message h1 { margin-bottom: 0; } - + search-input { + --mdc-text-field-fill-color: var(--sidebar-background-color); + --mdc-text-field-idle-line-color: var(--divider-color); + --text-field-overflow: visible; + } search-input.header { display: block; color: var(--secondary-text-color); margin-left: 8px; - --mdc-text-field-fill-color: transparant; - --mdc-text-field-idle-line-color: var(--divider-color); --mdc-ripple-color: transparant; } .search { @@ -717,6 +723,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { align-items: center; padding: 2px 2px 2px 8px; font-size: 14px; + width: max-content; } .active-filters mwc-button { margin-left: 8px; @@ -732,6 +739,21 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { left: 0; content: ""; } + .badge { + min-width: 20px; + box-sizing: border-box; + border-radius: 50%; + font-weight: 400; + background-color: var(--primary-color); + line-height: 20px; + text-align: center; + padding: 0px 4px; + color: var(--text-primary-color); + position: absolute; + right: 14px; + top: 8px; + font-size: 0.65em; + } `, ]; } diff --git a/src/panels/config/logs/ha-config-logs.ts b/src/panels/config/logs/ha-config-logs.ts index 603fef1777..7161e055fd 100644 --- a/src/panels/config/logs/ha-config-logs.ts +++ b/src/panels/config/logs/ha-config-logs.ts @@ -105,10 +105,10 @@ export class HaConfigLogs extends LitElement { } search-input { display: block; + --mdc-text-field-fill-color: var(--sidebar-background-color); + --mdc-text-field-idle-line-color: var(--divider-color); } search-input.header { - --mdc-text-field-fill-color: transparant; - --mdc-text-field-idle-line-color: var(--divider-color); --mdc-ripple-color: transparant; } .content {