mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
History+logbook positioning update + RTL fixes + label refactor (#2659)
This commit is contained in:
parent
79183bb6ea
commit
86b353e627
@ -18,6 +18,7 @@ import "../../resources/ha-style";
|
|||||||
|
|
||||||
import formatDate from "../../common/datetime/format_date";
|
import formatDate from "../../common/datetime/format_date";
|
||||||
import LocalizeMixin from "../../mixins/localize-mixin";
|
import LocalizeMixin from "../../mixins/localize-mixin";
|
||||||
|
import { computeRTL } from "../../common/util/compute_rtl";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @appliesMixin LocalizeMixin
|
* @appliesMixin LocalizeMixin
|
||||||
@ -37,6 +38,15 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {
|
|||||||
|
|
||||||
paper-dropdown-menu {
|
paper-dropdown-menu {
|
||||||
max-width: 100px;
|
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 {
|
paper-item {
|
||||||
@ -158,6 +168,12 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {
|
|||||||
type: String,
|
type: String,
|
||||||
value: "date",
|
value: "date",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
rtl: {
|
||||||
|
type: Boolean,
|
||||||
|
reflectToAttribute: true,
|
||||||
|
computed: "_computeRTL(hass)",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +214,10 @@ class HaPanelHistory extends LocalizeMixin(PolymerElement) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeRTL(hass) {
|
||||||
|
return computeRTL(hass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("ha-panel-history", HaPanelHistory);
|
customElements.define("ha-panel-history", HaPanelHistory);
|
||||||
|
@ -18,6 +18,7 @@ import "./ha-logbook";
|
|||||||
|
|
||||||
import formatDate from "../../common/datetime/format_date";
|
import formatDate from "../../common/datetime/format_date";
|
||||||
import LocalizeMixin from "../../mixins/localize-mixin";
|
import LocalizeMixin from "../../mixins/localize-mixin";
|
||||||
|
import { computeRTL } from "../../common/util/compute_rtl";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @appliesMixin LocalizeMixin
|
* @appliesMixin LocalizeMixin
|
||||||
@ -52,6 +53,13 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
|
|||||||
paper-dropdown-menu {
|
paper-dropdown-menu {
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
|
--paper-input-container-label-floating: {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:host([rtl]) paper-dropdown-menu {
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
paper-item {
|
paper-item {
|
||||||
@ -205,6 +213,12 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
|
|||||||
datePicker: {
|
datePicker: {
|
||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
rtl: {
|
||||||
|
type: Boolean,
|
||||||
|
reflectToAttribute: true,
|
||||||
|
computed: "_computeRTL(hass)",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,6 +256,10 @@ class HaPanelLogbook extends LocalizeMixin(PolymerElement) {
|
|||||||
refreshLogbook() {
|
refreshLogbook() {
|
||||||
this.shadowRoot.querySelector("ha-logbook-data").refreshLogbook();
|
this.shadowRoot.querySelector("ha-logbook-data").refreshLogbook();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeRTL(hass) {
|
||||||
|
return computeRTL(hass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("ha-panel-logbook", HaPanelLogbook);
|
customElements.define("ha-panel-logbook", HaPanelLogbook);
|
||||||
|
@ -808,7 +808,8 @@
|
|||||||
"period": "Period"
|
"period": "Period"
|
||||||
},
|
},
|
||||||
"logbook": {
|
"logbook": {
|
||||||
"showing_entries": "[%key:ui::panel::history::showing_entries%]"
|
"showing_entries": "[%key:ui::panel::history::showing_entries%]",
|
||||||
|
"period": "Period"
|
||||||
},
|
},
|
||||||
"lovelace": {
|
"lovelace": {
|
||||||
"cards": {
|
"cards": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user