-
Notifications
You must be signed in to change notification settings - Fork 0
/
strolch-wc-tree.html
81 lines (61 loc) · 1.95 KB
/
strolch-wc-tree.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!-- Imports -->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-card/paper-card.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="strolch-wc-tree-item.html">
<dom-module id="strolch-wc-tree">
<template>
<!-- Style -->
<style is="custom-style">
:host {
@apply(--layout-vertical);
}
</style>
<!-- Requests -->
<!-- Content -->
<template is="dom-repeat" items="[[elements]]" as="element">
<strolch-wc-tree-item selected-item="{{selectedItem}}"
title-html="[[titleHtml]]"
func-obj="{{funcObj}}"
item="[[element]]"></strolch-wc-tree-item>
</template>
</template>
<script>
Polymer({
/* Component */
is: "strolch-wc-tree",
behaviors: [],
/* Properties */
properties: {
selectedItem: {
type: Object,
value: null
},
titleHtml: {
type: Boolean,
reflectToAttribute: true,
value: false
},
elements: {
type: Array
}
},
/* Computations */
/* Observers */
observers: [],
/* Listeners */
listeners: {
'strolch-wc-tree-item-selected': 'onItemSelected'
},
onItemSelected: function (e) {
if (this.selectedItem != null) {
this.selectedItem.__selected = false;
}
this.selectedItem = e.detail.item;
}
/* Private */
/* Public */
/* Lifecycle */
});
</script>
</dom-module>