Add advanced yaml only row_span option for sections (#21833)

This commit is contained in:
Paul Bottein 2024-09-03 18:20:55 +02:00 committed by GitHub
parent ab534933fc
commit 2c975d4f41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ export interface LovelaceBaseSectionConfig {
title?: string;
visibility?: Condition[];
column_span?: number;
row_span?: number;
}
export interface LovelaceSectionConfig extends LovelaceBaseSectionConfig {

View File

@ -166,6 +166,8 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
maxColumnCount
);
const rowSpan = sectionConfig?.row_span || 1;
(section as any).itemPath = [idx];
return html`
@ -173,6 +175,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
class="section"
style=${styleMap({
"--column-span": columnSpan,
"--row-span": rowSpan,
})}
>
${
@ -332,6 +335,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
.section {
border-radius: var(--ha-card-border-radius, 12px);
grid-column: span var(--column-span);
grid-row: span var(--row-span);
}
.section:has(hui-section[hidden]) {