mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Force narrow style for action, condition and trigger in flows (#25619)
This commit is contained in:
parent
5371fd649c
commit
b907dbefad
@ -34,6 +34,8 @@ const getWarning = (obj, item) => (obj && item.name ? obj[item.name] : null);
|
||||
export class HaForm extends LitElement implements HaFormElement {
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property({ attribute: false }) public data!: HaFormDataContainer;
|
||||
|
||||
@property({ attribute: false }) public schema!: readonly HaFormSchema[];
|
||||
@ -135,6 +137,7 @@ export class HaForm extends LitElement implements HaFormElement {
|
||||
? html`<ha-selector
|
||||
.schema=${item}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.name=${item.name}
|
||||
.selector=${item.selector}
|
||||
.value=${getValue(this.data, item)}
|
||||
|
@ -19,6 +19,8 @@ import { SubscribeMixin } from "../../mixins/subscribe-mixin";
|
||||
export class HaActionSelector extends SubscribeMixin(LitElement) {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property({ attribute: false }) public selector!: ActionSelector;
|
||||
|
||||
@property({ attribute: false }) public value?: Action;
|
||||
@ -66,6 +68,7 @@ export class HaActionSelector extends SubscribeMixin(LitElement) {
|
||||
.disabled=${this.disabled}
|
||||
.actions=${this._actions(this.value)}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
></ha-automation-action>
|
||||
`;
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import type { HomeAssistant } from "../../types";
|
||||
export class HaConditionSelector extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property({ attribute: false }) public selector!: ConditionSelector;
|
||||
|
||||
@property({ attribute: false }) public value?: Condition;
|
||||
@ -24,6 +26,7 @@ export class HaConditionSelector extends LitElement {
|
||||
.disabled=${this.disabled}
|
||||
.conditions=${this.value || []}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
></ha-automation-condition>
|
||||
`;
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import type { HomeAssistant } from "../../types";
|
||||
export class HaTriggerSelector extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property({ attribute: false }) public selector!: TriggerSelector;
|
||||
|
||||
@property({ attribute: false }) public value?: Trigger;
|
||||
@ -33,6 +35,7 @@ export class HaTriggerSelector extends LitElement {
|
||||
.disabled=${this.disabled}
|
||||
.triggers=${this._triggers(this.value)}
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
></ha-automation-trigger>
|
||||
`;
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ const LEGACY_UI_SELECTORS = new Set(["ui-action", "ui-color"]);
|
||||
export class HaSelector extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property() public name?: string;
|
||||
|
||||
@property({ attribute: false }) public selector!: Selector;
|
||||
@ -127,6 +129,7 @@ export class HaSelector extends LitElement {
|
||||
return html`
|
||||
${dynamicElement(`ha-selector-${this._type}`, {
|
||||
hass: this.hass,
|
||||
narrow: this.narrow,
|
||||
name: this.name,
|
||||
selector: this._handleLegacySelector(this.selector),
|
||||
value: this.value,
|
||||
|
@ -349,6 +349,7 @@ class DataEntryFlowDialog extends LitElement {
|
||||
${this._step.type === "form"
|
||||
? html`
|
||||
<step-flow-form
|
||||
narrow
|
||||
.flowConfig=${this._params.flowConfig}
|
||||
.step=${this._step}
|
||||
.hass=${this.hass}
|
||||
|
@ -27,6 +27,8 @@ import { configFlowContentStyles } from "./styles";
|
||||
class StepFlowForm extends LitElement {
|
||||
@property({ attribute: false }) public flowConfig!: FlowConfig;
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@property({ attribute: false }) public step!: DataEntryFlowStepForm;
|
||||
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@ -63,6 +65,7 @@ class StepFlowForm extends LitElement {
|
||||
: ""}
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
.narrow=${this.narrow}
|
||||
.data=${stepData}
|
||||
.disabled=${this._loading}
|
||||
@value-changed=${this._stepDataChanged}
|
||||
|
Loading…
x
Reference in New Issue
Block a user