More height fixes in devtools/statistics (#24438)

* More height fixes in devtools/statistics

* fix selection bar
This commit is contained in:
karwosts 2025-02-28 05:07:00 -08:00 committed by GitHub
parent ebc1259e39
commit 88e6906b6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,7 +81,7 @@ type DisplayedStatisticData = StatisticData & {
class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) { class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ type: Boolean }) public narrow = false; @property({ type: Boolean, reflect: true }) public narrow = false;
@state() private _data: StatisticData[] = [] as StatisticsMetaData[]; @state() private _data: StatisticData[] = [] as StatisticsMetaData[];
@ -307,7 +307,7 @@ class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) {
</ha-assist-chip>`; </ha-assist-chip>`;
return html` return html`
<div> <div class="table-with-toolbars">
${this._selectMode ${this._selectMode
? html`<div class="selection-bar"> ? html`<div class="selection-bar">
<div class="selection-controls"> <div class="selection-controls">
@ -700,15 +700,16 @@ class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) {
height: 100%; height: 100%;
} }
.table-with-toolbars {
height: 100%;
display: flex;
flex-direction: column;
}
ha-data-table { ha-data-table {
width: 100%; width: 100%;
height: 100%; flex-grow: 1;
--data-table-border-width: 0; --data-table-border-width: 0;
} }
:host(:not([narrow])) ha-data-table {
height: calc(100vh - 1px - var(--header-height) - 48px);
display: block;
}
:host([narrow]) { :host([narrow]) {
--expansion-panel-summary-padding: 0 16px; --expansion-panel-summary-padding: 0 16px;
@ -748,7 +749,6 @@ class HaPanelDevStatistics extends KeyboardShortcutMixin(LitElement) {
.selection-bar { .selection-bar {
background: rgba(var(--rgb-primary-color), 0.1); background: rgba(var(--rgb-primary-color), 0.1);
width: 100%; width: 100%;
height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;