diff --git a/src/dialogs/config-flow/dialog-data-entry-flow.ts b/src/dialogs/config-flow/dialog-data-entry-flow.ts index 94959185ec..726143bdb1 100644 --- a/src/dialogs/config-flow/dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/dialog-data-entry-flow.ts @@ -1,4 +1,3 @@ -import "@material/mwc-button"; import { mdiClose, mdiHelpCircle } from "@mdi/js"; import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import type { CSSResultGroup, PropertyValues } from "lit"; @@ -177,6 +176,17 @@ class DataEntryFlowDialog extends LitElement { return nothing; } + const showDocumentationLink = + ([ + "form", + "menu", + "external", + "progress", + "data_entry_flow_progressed", + ].includes(this._step?.type as any) && + this._params.manifest?.is_built_in) || + !!this._params.manifest?.documentation; + return html` @@ -199,26 +209,18 @@ class DataEntryFlowDialog extends LitElement { : this._step === undefined ? // When we are going to next step, we render 1 round of empty // to reset the element. - "" + nothing : html`
- ${([ - "form", - "menu", - "external", - "progress", - "data_entry_flow_progressed", - ].includes(this._step?.type as any) && - this._params.manifest?.is_built_in) || - this._params.manifest?.documentation + ${showDocumentationLink ? html` @@ -229,7 +231,7 @@ class DataEntryFlowDialog extends LitElement { ` - : ""} + : nothing} ` : this._step.type === "external" @@ -250,6 +253,7 @@ class DataEntryFlowDialog extends LitElement { .flowConfig=${this._params.flowConfig} .step=${this._step} .hass=${this.hass} + .increasePaddingEnd=${showDocumentationLink} > ` : this._step.type === "abort" @@ -261,6 +265,7 @@ class DataEntryFlowDialog extends LitElement { .handler=${this._step.handler} .domain=${this._params.domain ?? this._step.handler} + .increasePaddingEnd=${showDocumentationLink} > ` : this._step.type === "progress" @@ -270,6 +275,7 @@ class DataEntryFlowDialog extends LitElement { .step=${this._step} .hass=${this.hass} .progress=${this._progress} + .increasePaddingEnd=${showDocumentationLink} > ` : this._step.type === "menu" @@ -278,6 +284,7 @@ class DataEntryFlowDialog extends LitElement { .flowConfig=${this._params.flowConfig} .step=${this._step} .hass=${this.hass} + .increasePaddingEnd=${showDocumentationLink} > ` : html` @@ -286,7 +293,8 @@ class DataEntryFlowDialog extends LitElement { .step=${this._step} .hass=${this.hass} .navigateToResult=${this._params - .navigateToResult} + .navigateToResult ?? false} + .increasePaddingEnd=${showDocumentationLink} > `} `} diff --git a/src/dialogs/config-flow/step-flow-abort.ts b/src/dialogs/config-flow/step-flow-abort.ts index fa54d4ca57..9f0ad9abb0 100644 --- a/src/dialogs/config-flow/step-flow-abort.ts +++ b/src/dialogs/config-flow/step-flow-abort.ts @@ -22,6 +22,9 @@ class StepFlowAbort extends LitElement { @property({ attribute: false }) public handler!: string; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + protected firstUpdated(changed: PropertyValues) { super.firstUpdated(changed); if (this.step.reason === "missing_credentials") { @@ -34,7 +37,7 @@ class StepFlowAbort extends LitElement { return nothing; } return html` -

+

${this.params.flowConfig.renderAbortHeader ? this.params.flowConfig.renderAbortHeader(this.hass, this.step) : this.hass.localize(`component.${this.domain}.title`)} diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index 6f59bf593d..327b5b783a 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -36,6 +36,9 @@ class StepFlowCreateEntry extends LitElement { @property({ attribute: false }) public step!: DataEntryFlowStepCreateEntry; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + public navigateToResult = false; @state() private _deviceUpdate: Record< @@ -113,7 +116,7 @@ class StepFlowCreateEntry extends LitElement { this.step.result?.entry_id ); return html` -

+

${devices.length ? localize("ui.panel.config.integrations.config_flow.assign_area", { number: devices.length, diff --git a/src/dialogs/config-flow/step-flow-external.ts b/src/dialogs/config-flow/step-flow-external.ts index 4e3b10512c..98d98c61ef 100644 --- a/src/dialogs/config-flow/step-flow-external.ts +++ b/src/dialogs/config-flow/step-flow-external.ts @@ -15,11 +15,16 @@ class StepFlowExternal extends LitElement { @property({ attribute: false }) public step!: DataEntryFlowStepExternal; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + protected render(): TemplateResult { const localize = this.hass.localize; return html` -

${this.flowConfig.renderExternalStepHeader(this.hass, this.step)}

+

+ ${this.flowConfig.renderExternalStepHeader(this.hass, this.step)} +

${this.flowConfig.renderExternalStepDescription(this.hass, this.step)}
@@ -51,6 +56,9 @@ class StepFlowExternal extends LitElement { .open-button a { text-decoration: none; } + h2.end-space { + padding-inline-end: 72px; + } `, ]; } diff --git a/src/dialogs/config-flow/step-flow-form.ts b/src/dialogs/config-flow/step-flow-form.ts index 0c6da5eda2..06ec17dc0d 100644 --- a/src/dialogs/config-flow/step-flow-form.ts +++ b/src/dialogs/config-flow/step-flow-form.ts @@ -27,6 +27,9 @@ class StepFlowForm extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + @state() private _loading = false; @state() private _stepData?: Record; @@ -43,7 +46,9 @@ class StepFlowForm extends LitElement { const stepData = this._stepDataProcessed; return html` -

${this.flowConfig.renderShowFormStepHeader(this.hass, this.step)}

+

+ ${this.flowConfig.renderShowFormStepHeader(this.hass, this.step)} +

${this.flowConfig.renderShowFormStepDescription(this.hass, this.step)} ${this._errorMsg diff --git a/src/dialogs/config-flow/step-flow-menu.ts b/src/dialogs/config-flow/step-flow-menu.ts index 7c1f1e35f6..b0fcd3ba64 100644 --- a/src/dialogs/config-flow/step-flow-menu.ts +++ b/src/dialogs/config-flow/step-flow-menu.ts @@ -17,6 +17,9 @@ class StepFlowMenu extends LitElement { @property({ attribute: false }) public step!: DataEntryFlowStepMenu; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + protected render(): TemplateResult { let options: string[]; let translations: Record; @@ -42,7 +45,9 @@ class StepFlowMenu extends LitElement { ); return html` -

${this.flowConfig.renderMenuHeader(this.hass, this.step)}

+

+ ${this.flowConfig.renderMenuHeader(this.hass, this.step)} +

${description ? html`
${description}
` : ""}
${options.map( diff --git a/src/dialogs/config-flow/step-flow-progress.ts b/src/dialogs/config-flow/step-flow-progress.ts index ef56fa271d..c71efcb98c 100644 --- a/src/dialogs/config-flow/step-flow-progress.ts +++ b/src/dialogs/config-flow/step-flow-progress.ts @@ -24,9 +24,12 @@ class StepFlowProgress extends LitElement { @property({ type: Number }) public progress?: number; + @property({ type: Boolean, attribute: "increase-padding-end" }) + public increasePaddingEnd = false; + protected render(): TemplateResult { return html` -

+

${this.flowConfig.renderShowFormProgressHeader(this.hass, this.step)}

diff --git a/src/dialogs/config-flow/styles.ts b/src/dialogs/config-flow/styles.ts index daaa9342af..0e2aca3e7b 100644 --- a/src/dialogs/config-flow/styles.ts +++ b/src/dialogs/config-flow/styles.ts @@ -22,6 +22,9 @@ export const configFlowContentStyles = css` text-transform: var(--mdc-typography-headline6-text-transform, inherit); box-sizing: border-box; } + h2.end-space { + padding-inline-end: 72px; + } .content, .preview {