-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sections support #1139
base: dev
Are you sure you want to change the base?
feat: sections support #1139
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ globals: | |
window: true | ||
Event: true | ||
customElements: true | ||
document: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ const style = css` | |
:host { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
} | ||
ha-card { | ||
flex-direction: column; | ||
|
@@ -12,6 +13,8 @@ const style = css` | |
position: relative; | ||
overflow: hidden; | ||
} | ||
ha-card.sections { | ||
akloeckner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
ha-card > div { | ||
padding: 0px 16px 16px 16px; | ||
} | ||
|
@@ -120,6 +123,12 @@ const style = css` | |
justify-content: space-between; | ||
flex-wrap: nowrap; | ||
} | ||
.sections.small .states { | ||
padding: 0px 16px 0px 16px; | ||
} | ||
.sections.small .header { | ||
padding: 0px 16px 0px 16px; | ||
} | ||
.states .icon { | ||
align-self: center; | ||
margin-left: 0; | ||
|
@@ -230,6 +239,9 @@ const style = css` | |
left: initial; | ||
right: 0; | ||
} | ||
.sections.small .state__time { | ||
display: none; | ||
} | ||
.graph { | ||
align-self: flex-end; | ||
box-sizing: border-box; | ||
|
@@ -238,6 +250,10 @@ const style = css` | |
margin-top: auto; | ||
width: 100%; | ||
} | ||
.sections .graph { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, too: if this is useful also in non-section views, let's consider to just add it to the regular styles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is only useful for section view. It makes graph position itself so that it's not clipping out of bounds. |
||
position: absolute; | ||
bottom: 0; | ||
} | ||
.graph__container { | ||
display: flex; | ||
flex-direction: row; | ||
|
@@ -348,13 +364,19 @@ const style = css` | |
padding-top: 16px; | ||
flex-wrap: wrap; | ||
} | ||
.sections .graph__legend { | ||
padding-top: 8px; | ||
} | ||
.graph__legend__item { | ||
cursor: pointer; | ||
display: flex; | ||
min-width: 0; | ||
margin: .4em; | ||
align-items: center | ||
} | ||
.sections .graph__legend__item { | ||
margin: .4em .4em 0px .4em; | ||
} | ||
.graph__legend__item span { | ||
opacity: .75; | ||
margin-left: .4em; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder: isn't this taken care of by home assistant? If we report a minimum row count via
getLayoutOptions
, shouldn't this be reflected inthis.config.layout_options
?See also here, maybe: https://github.com/home-assistant/frontend/blob/67217b9dd0f5ad43aafb3bba2fe2821407b25243/src/panels/lovelace/editor/card-editor/hui-card-layout-editor.ts#L68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it only clamps the values for setting the card size and for the visual editor, values set by user in
this.config.layout_options
stays untouched even when they're lower than minimum set ingetLayoutOptions
.