diff --git a/src/panels/history/ha-panel-history.js b/src/panels/history/ha-panel-history.js index d83f0ecde3..a09ee7bf8f 100644 --- a/src/panels/history/ha-panel-history.js +++ b/src/panels/history/ha-panel-history.js @@ -18,6 +18,7 @@ import "../../resources/ha-style"; import formatDate from "../../common/datetime/format_date"; import LocalizeMixin from "../../mixins/localize-mixin"; +import { computeRTL } from "../../common/util/compute_rtl"; /* * @appliesMixin LocalizeMixin @@ -37,6 +38,15 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) { paper-dropdown-menu { max-width: 100px; + margin-top: 13px; + margin-right: 16px; + --paper-input-container-label-floating: { + padding-bottom: 10px; + } + } + + :host([rtl]) paper-dropdown-menu { + text-align: right; } paper-item { @@ -158,6 +168,12 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) { type: String, value: "date", }, + + rtl: { + type: Boolean, + reflectToAttribute: true, + computed: "_computeRTL(hass)", + }, }; } @@ -198,6 +214,10 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) { return 1; } } + + _computeRTL(hass) { + return computeRTL(hass); + } } customElements.define("ha-panel-history", HaPanelHistory); diff --git a/src/panels/logbook/ha-panel-logbook.js b/src/panels/logbook/ha-panel-logbook.js index 1612548882..aa7ecdebe1 100644 --- a/src/panels/logbook/ha-panel-logbook.js +++ b/src/panels/logbook/ha-panel-logbook.js @@ -18,6 +18,7 @@ import "./ha-logbook"; import formatDate from "../../common/datetime/format_date"; import LocalizeMixin from "../../mixins/localize-mixin"; +import { computeRTL } from "../../common/util/compute_rtl"; /* * @appliesMixin LocalizeMixin @@ -52,6 +53,13 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) { paper-dropdown-menu { max-width: 100px; margin-right: 16px; + --paper-input-container-label-floating: { + padding-bottom: 10px; + } + } + + :host([rtl]) paper-dropdown-menu { + text-align: right; } paper-item { @@ -205,6 +213,12 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) { datePicker: { type: Object, }, + + rtl: { + type: Boolean, + reflectToAttribute: true, + computed: "_computeRTL(hass)", + }, }; } @@ -242,6 +256,10 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) { refreshLogbook() { this.shadowRoot.querySelector("ha-logbook-data").refreshLogbook(); } + + _computeRTL(hass) { + return computeRTL(hass); + } } customElements.define("ha-panel-logbook", HaPanelLogbook); diff --git a/src/translations/en.json b/src/translations/en.json index 6f92dbc9ba..bac990dfb5 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -808,7 +808,8 @@ "period": "Period" }, "logbook": { - "showing_entries": "[%key:ui::panel::history::showing_entries%]" + "showing_entries": "[%key:ui::panel::history::showing_entries%]", + "period": "Period" }, "lovelace": { "cards": {