Compare commits

...
Author SHA1 Message Date
Paul Bottein 1388193811 Pass the form context to nested forms 2026-12-02 18:33:36 +01:00
3 changed files with 9 additions and 0 deletions

No files matched your search

@@ -36,6 +36,8 @@ export class HaFormExpandable extends LitElement implements HaFormElement {
key: string
) => string;
@property({ attribute: false }) public context?: Record<string, any>;
@query("ha-form", true) private _form?: HaForm;
public reportValidity(): boolean {
@@ -109,6 +111,7 @@ export class HaFormExpandable extends LitElement implements HaFormElement {
.computeLabel=${this._computeLabel}
.computeHelper=${this._computeHelper}
.localizeValue=${this.localizeValue}
.context=${this.context}
></ha-form>
</div>
</ha-expansion-panel>
+3
View File
@@ -35,6 +35,8 @@ export class HaFormGrid extends LitElement implements HaFormElement {
key: string
) => string;
@property({ attribute: false }) public context?: Record<string, any>;
@queryAll("ha-form", true) private _forms?: HaForm[];
static shadowRootOptions = {
@@ -83,6 +85,7 @@ export class HaFormGrid extends LitElement implements HaFormElement {
.computeLabel=${this.computeLabel}
.computeHelper=${this.computeHelper}
.localizeValue=${this.localizeValue}
.context=${this.context}
></ha-form>
`
)}
@@ -54,6 +54,8 @@ export class HaFormOptionalActions extends LitElement implements HaFormElement {
key: string
) => string;
@property({ attribute: false }) public context?: Record<string, any>;
@state() private _displayActions?: string[];
@query("ha-form") private _form?: HaForm;
@@ -130,6 +132,7 @@ export class HaFormOptionalActions extends LitElement implements HaFormElement {
.computeLabel=${this.computeLabel}
.computeHelper=${this.computeHelper}
.localizeValue=${this.localizeValue}
.context=${this.context}
></ha-form>
`
: nothing