mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix energy selection date card in grid layout (#21293)
Fix energy selection card in grid layout
This commit is contained in:
parent
3e4d06fca3
commit
dc93a0ce54
@ -1,17 +1,17 @@
|
|||||||
import {
|
import {
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
nothing,
|
|
||||||
css,
|
|
||||||
CSSResultGroup,
|
CSSResultGroup,
|
||||||
|
LitElement,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
|
css,
|
||||||
|
html,
|
||||||
|
nothing,
|
||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { HomeAssistant } from "../../../../types";
|
import { HomeAssistant } from "../../../../types";
|
||||||
import "../../components/hui-energy-period-selector";
|
|
||||||
import { LovelaceCard } from "../../types";
|
|
||||||
import { EnergyCardBaseConfig } from "../types";
|
|
||||||
import { hasConfigChanged } from "../../common/has-changed";
|
import { hasConfigChanged } from "../../common/has-changed";
|
||||||
|
import "../../components/hui-energy-period-selector";
|
||||||
|
import { LovelaceCard, LovelaceLayoutOptions } from "../../types";
|
||||||
|
import { EnergyCardBaseConfig } from "../types";
|
||||||
|
|
||||||
@customElement("hui-energy-date-selection-card")
|
@customElement("hui-energy-date-selection-card")
|
||||||
export class HuiEnergyDateSelectionCard
|
export class HuiEnergyDateSelectionCard
|
||||||
@ -26,6 +26,13 @@ export class HuiEnergyDateSelectionCard
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getLayoutOptions(): LovelaceLayoutOptions {
|
||||||
|
return {
|
||||||
|
grid_rows: 1,
|
||||||
|
grid_columns: 4,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public setConfig(config: EnergyCardBaseConfig): void {
|
public setConfig(config: EnergyCardBaseConfig): void {
|
||||||
this._config = config;
|
this._config = config;
|
||||||
}
|
}
|
||||||
@ -57,6 +64,13 @@ export class HuiEnergyDateSelectionCard
|
|||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static get styles(): CSSResultGroup {
|
||||||
return css`
|
return css`
|
||||||
|
:host {
|
||||||
|
ha-card {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.padded {
|
.padded {
|
||||||
padding-left: 16px !important;
|
padding-left: 16px !important;
|
||||||
padding-inline-start: 16px !important;
|
padding-inline-start: 16px !important;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user