mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 20:56:36 +00:00
After rebase clean
This commit is contained in:
parent
94c1af7729
commit
1d007a5aaf
@ -33,7 +33,6 @@ export interface LovelaceSectionElement extends HTMLElement {
|
|||||||
lovelace?: Lovelace;
|
lovelace?: Lovelace;
|
||||||
preview?: boolean;
|
preview?: boolean;
|
||||||
viewIndex?: number;
|
viewIndex?: number;
|
||||||
columnSpan?: number;
|
|
||||||
index?: number;
|
index?: number;
|
||||||
cards?: HuiCard[];
|
cards?: HuiCard[];
|
||||||
isStrategy: boolean;
|
isStrategy: boolean;
|
||||||
|
@ -35,8 +35,6 @@ export class GridSection extends LitElement implements LovelaceSectionElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public isStrategy = false;
|
@property({ type: Boolean }) public isStrategy = false;
|
||||||
|
|
||||||
@property({ type: Number, attribute: "column_span" }) public columnSpan = 1;
|
|
||||||
|
|
||||||
@property({ attribute: false }) public cards: HuiCard[] = [];
|
@property({ attribute: false }) public cards: HuiCard[] = [];
|
||||||
|
|
||||||
@state() _config?: LovelaceSectionConfig;
|
@state() _config?: LovelaceSectionConfig;
|
||||||
@ -79,12 +77,7 @@ export class GridSection extends LitElement implements LovelaceSectionElement {
|
|||||||
.options=${CARD_SORTABLE_OPTIONS}
|
.options=${CARD_SORTABLE_OPTIONS}
|
||||||
invert-swap
|
invert-swap
|
||||||
>
|
>
|
||||||
<div
|
<div class="container ${classMap({ "edit-mode": editMode })}">
|
||||||
class="container ${classMap({ "edit-mode": editMode })}"
|
|
||||||
style=${styleMap({
|
|
||||||
"--column-span": this.columnSpan,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
${repeat(
|
${repeat(
|
||||||
cardsConfig,
|
cardsConfig,
|
||||||
(cardConfig) => this._getKey(cardConfig),
|
(cardConfig) => this._getKey(cardConfig),
|
||||||
|
@ -47,8 +47,6 @@ export class HuiSection extends ReactiveElement {
|
|||||||
|
|
||||||
@property({ type: Number }) public viewIndex!: number;
|
@property({ type: Number }) public viewIndex!: number;
|
||||||
|
|
||||||
@property({ type: Number }) public columnSpan!: number;
|
|
||||||
|
|
||||||
@state() private _cards: HuiCard[] = [];
|
@state() private _cards: HuiCard[] = [];
|
||||||
|
|
||||||
private _layoutElementType?: string;
|
private _layoutElementType?: string;
|
||||||
@ -133,9 +131,6 @@ export class HuiSection extends ReactiveElement {
|
|||||||
if (changedProperties.has("_cards")) {
|
if (changedProperties.has("_cards")) {
|
||||||
this._layoutElement.cards = this._cards;
|
this._layoutElement.cards = this._cards;
|
||||||
}
|
}
|
||||||
if (changedProperties.has("columnSpan")) {
|
|
||||||
this._layoutElement.columnSpan = this.columnSpan;
|
|
||||||
}
|
|
||||||
if (changedProperties.has("hass") || changedProperties.has("preview")) {
|
if (changedProperties.has("hass") || changedProperties.has("preview")) {
|
||||||
this._updateElement();
|
this._updateElement();
|
||||||
}
|
}
|
||||||
@ -200,7 +195,6 @@ export class HuiSection extends ReactiveElement {
|
|||||||
this._layoutElement!.lovelace = this.lovelace;
|
this._layoutElement!.lovelace = this.lovelace;
|
||||||
this._layoutElement!.index = this.index;
|
this._layoutElement!.index = this.index;
|
||||||
this._layoutElement!.viewIndex = this.viewIndex;
|
this._layoutElement!.viewIndex = this.viewIndex;
|
||||||
this._layoutElement!.columnSpan = this.columnSpan;
|
|
||||||
this._layoutElement!.cards = this._cards;
|
this._layoutElement!.cards = this._cards;
|
||||||
|
|
||||||
if (addLayoutElement) {
|
if (addLayoutElement) {
|
||||||
|
@ -225,10 +225,10 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
sectionConfig?.column_span || 1,
|
sectionConfig?.column_span || 1,
|
||||||
maxColumnCount
|
maxColumnCount
|
||||||
);
|
);
|
||||||
|
|
||||||
const rowSpan = sectionConfig?.row_span || 1;
|
const rowSpan = sectionConfig?.row_span || 1;
|
||||||
|
|
||||||
(section as any).itemPath = [idx];
|
(section as any).itemPath = [idx];
|
||||||
(section as any).columnSpan = columnSpan;
|
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
@ -384,7 +384,6 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
--column-gap: var(--ha-view-sections-column-gap, 24px);
|
--column-gap: var(--ha-view-sections-column-gap, 24px);
|
||||||
--column-min-width: var(--ha-view-sections-column-min-width, 320px);
|
--column-min-width: var(--ha-view-sections-column-min-width, 320px);
|
||||||
--column-max-width: var(--ha-view-sections-column-max-width, 500px);
|
--column-max-width: var(--ha-view-sections-column-max-width, 500px);
|
||||||
--column-min-width: var(--ha-view-sections-column-min-width, 320px);
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user