mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Merge pull request #6433 from yosilevy/edit-card-RTL-fix
Edit card rtl fix
This commit is contained in:
commit
ef8be5d559
@ -5,7 +5,7 @@ import "./ha-icon-button";
|
|||||||
import { css, CSSResult, customElement, html } from "lit-element";
|
import { css, CSSResult, customElement, html } from "lit-element";
|
||||||
import type { Constructor, HomeAssistant } from "../types";
|
import type { Constructor, HomeAssistant } from "../types";
|
||||||
import { mdiClose } from "@mdi/js";
|
import { mdiClose } from "@mdi/js";
|
||||||
import { computeRTL } from "../common/util/compute_rtl";
|
import { computeRTLDirection } from "../common/util/compute_rtl";
|
||||||
|
|
||||||
const MwcDialog = customElements.get("mwc-dialog") as Constructor<Dialog>;
|
const MwcDialog = customElements.get("mwc-dialog") as Constructor<Dialog>;
|
||||||
|
|
||||||
@ -14,8 +14,8 @@ export const createCloseHeading = (hass: HomeAssistant, title: string) => html`
|
|||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
aria-label=${hass.localize("ui.dialogs.generic.close")}
|
aria-label=${hass.localize("ui.dialogs.generic.close")}
|
||||||
dialogAction="close"
|
dialogAction="close"
|
||||||
?rtl=${computeRTL(hass)}
|
|
||||||
class="header_button"
|
class="header_button"
|
||||||
|
dir=${computeRTLDirection(hass)}
|
||||||
>
|
>
|
||||||
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
|
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
@ -61,7 +61,7 @@ export class HaDialog extends MwcDialog {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
mwc-icon-button[rtl].header_button {
|
[dir="rtl"].header_button {
|
||||||
right: auto;
|
right: auto;
|
||||||
left: 16px;
|
left: 16px;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ import "./hui-card-preview";
|
|||||||
import type { EditCardDialogParams } from "./show-edit-card-dialog";
|
import type { EditCardDialogParams } from "./show-edit-card-dialog";
|
||||||
import { getCardDocumentationURL } from "../get-card-documentation-url";
|
import { getCardDocumentationURL } from "../get-card-documentation-url";
|
||||||
import { mdiHelpCircle } from "@mdi/js";
|
import { mdiHelpCircle } from "@mdi/js";
|
||||||
|
import { computeRTLDirection } from "../../../../common/util/compute_rtl";
|
||||||
import { HassDialog } from "../../../../dialogs/make-dialog-manager";
|
import { HassDialog } from "../../../../dialogs/make-dialog-manager";
|
||||||
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
|
import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box";
|
||||||
|
|
||||||
@ -118,9 +119,13 @@ export class HuiDialogEditCard extends LitElement implements HassDialog {
|
|||||||
|
|
||||||
let heading: string;
|
let heading: string;
|
||||||
if (this._cardConfig && this._cardConfig.type) {
|
if (this._cardConfig && this._cardConfig.type) {
|
||||||
heading = `${this.hass!.localize(
|
heading = this.hass!.localize(
|
||||||
`ui.panel.lovelace.editor.card.${this._cardConfig.type}.name`
|
"ui.panel.lovelace.editor.edit_card.typed_header",
|
||||||
)} ${this.hass!.localize("ui.panel.lovelace.editor.edit_card.header")}`;
|
"type",
|
||||||
|
this.hass!.localize(
|
||||||
|
`ui.panel.lovelace.editor.card.${this._cardConfig.type}.name`
|
||||||
|
)
|
||||||
|
);
|
||||||
} else if (!this._cardConfig) {
|
} else if (!this._cardConfig) {
|
||||||
heading = this._viewConfig.title
|
heading = this._viewConfig.title
|
||||||
? this.hass!.localize(
|
? this.hass!.localize(
|
||||||
@ -151,6 +156,7 @@ export class HuiDialogEditCard extends LitElement implements HassDialog {
|
|||||||
title=${this.hass!.localize("ui.panel.lovelace.menu.help")}
|
title=${this.hass!.localize("ui.panel.lovelace.menu.help")}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
|
dir=${computeRTLDirection(this.hass)}
|
||||||
>
|
>
|
||||||
<mwc-icon-button>
|
<mwc-icon-button>
|
||||||
<ha-svg-icon path=${mdiHelpCircle}></ha-svg-icon>
|
<ha-svg-icon path=${mdiHelpCircle}></ha-svg-icon>
|
||||||
|
@ -1901,6 +1901,7 @@
|
|||||||
},
|
},
|
||||||
"edit_card": {
|
"edit_card": {
|
||||||
"header": "Card Configuration",
|
"header": "Card Configuration",
|
||||||
|
"typed_header": "{type} Card Configuration",
|
||||||
"pick_card": "Which card would you like to add?",
|
"pick_card": "Which card would you like to add?",
|
||||||
"pick_card_view_title": "Which card would you like to add to your {name} view?",
|
"pick_card_view_title": "Which card would you like to add to your {name} view?",
|
||||||
"toggle_editor": "Toggle Editor",
|
"toggle_editor": "Toggle Editor",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user