/
demo-more-infos.js
58 lines (54 loc) · 1.4 KB
/
demo-more-infos.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/paper-toggle-button/paper-toggle-button";
import "./demo-more-info";
class DemoMoreInfos extends PolymerElement {
static get template() {
return html`
<style>
.cards {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
demo-more-info {
margin: 16px 16px 32px;
}
app-toolbar {
background-color: var(--light-primary-color);
}
.filters {
margin-left: 60px;
}
</style>
<app-toolbar>
<div class='filters'>
<paper-toggle-button
checked='{{_showConfig}}'
>Show entity</paper-toggle-button>
</div>
</app-toolbar>
<div class='cards'>
<template is='dom-repeat' items='[[entities]]'>
<demo-more-info
entity-id='[[item]]'
show-config='[[_showConfig]]'
hass='[[hass]]'
></demo-more-info>
</template>
</div>
`;
}
static get properties() {
return {
entities: Array,
hass: Object,
_showConfig: {
type: Boolean,
value: false,
},
};
}
}
customElements.define("demo-more-infos", DemoMoreInfos);