wispcss 0.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -0
- package/LICENSE +49 -0
- package/README.md +386 -0
- package/README.zh-CN.md +385 -0
- package/dist/wispcss.css +45823 -0
- package/dist/wispcss.min.css +2 -0
- package/examples/add-h2-ids.cjs +284 -0
- package/examples/demo-actions.html +188 -0
- package/examples/demo-alarm.html +219 -0
- package/examples/demo-animation.html +399 -0
- package/examples/demo-aura.html +195 -0
- package/examples/demo-avatar.html +279 -0
- package/examples/demo-background.html +284 -0
- package/examples/demo-badge.html +398 -0
- package/examples/demo-blob.html +307 -0
- package/examples/demo-blockquote.html +190 -0
- package/examples/demo-bookmark.html +243 -0
- package/examples/demo-breadcrumb.html +179 -0
- package/examples/demo-btns.html +349 -0
- package/examples/demo-bubble.html +215 -0
- package/examples/demo-buoy.html +187 -0
- package/examples/demo-button-icon.html +231 -0
- package/examples/demo-button-link.html +177 -0
- package/examples/demo-button.html +361 -0
- package/examples/demo-callout.html +601 -0
- package/examples/demo-check.html +323 -0
- package/examples/demo-code.html +212 -0
- package/examples/demo-color.html +545 -0
- package/examples/demo-comment.html +510 -0
- package/examples/demo-deform.html +229 -0
- package/examples/demo-dialog.html +932 -0
- package/examples/demo-divider.html +208 -0
- package/examples/demo-drawer.html +623 -0
- package/examples/demo-dropmenu.html +382 -0
- package/examples/demo-droppanel.html +354 -0
- package/examples/demo-ellipsis.html +145 -0
- package/examples/demo-emphasis.html +146 -0
- package/examples/demo-empty.html +112 -0
- package/examples/demo-entry.html +219 -0
- package/examples/demo-field.html +359 -0
- package/examples/demo-file.html +206 -0
- package/examples/demo-flag.html +225 -0
- package/examples/demo-form.html +201 -0
- package/examples/demo-gilt.html +170 -0
- package/examples/demo-heading.html +93 -0
- package/examples/demo-icon.html +164 -0
- package/examples/demo-input.html +300 -0
- package/examples/demo-kbd.html +202 -0
- package/examples/demo-lamp.html +248 -0
- package/examples/demo-link.html +142 -0
- package/examples/demo-normalize.html +366 -0
- package/examples/demo-otp.html +277 -0
- package/examples/demo-pagination.html +562 -0
- package/examples/demo-position.html +205 -0
- package/examples/demo-poster.html +384 -0
- package/examples/demo-pre - /345/211/257/346/234/254.html" +169 -0
- package/examples/demo-pre.html +205 -0
- package/examples/demo-preset.html +344 -0
- package/examples/demo-progress.html +303 -0
- package/examples/demo-range.html +211 -0
- package/examples/demo-rank.html +270 -0
- package/examples/demo-rating.html +251 -0
- package/examples/demo-reset.html +105 -0
- package/examples/demo-segment.html +436 -0
- package/examples/demo-select.html +332 -0
- package/examples/demo-shadow.html +152 -0
- package/examples/demo-shell.html +377 -0
- package/examples/demo-shimmer.html +217 -0
- package/examples/demo-size.html +149 -0
- package/examples/demo-skeleton.html +143 -0
- package/examples/demo-sketch.html +213 -0
- package/examples/demo-spacer.html +150 -0
- package/examples/demo-spinner.html +220 -0
- package/examples/demo-stats.html +165 -0
- package/examples/demo-status.html +212 -0
- package/examples/demo-step.html +240 -0
- package/examples/demo-styles.css +14 -0
- package/examples/demo-summary.html +128 -0
- package/examples/demo-swatch.html +253 -0
- package/examples/demo-switch.html +223 -0
- package/examples/demo-table.html +339 -0
- package/examples/demo-tag.html +318 -0
- package/examples/demo-text.html +91 -0
- package/examples/demo-theme.html +167 -0
- package/examples/demo-tools.html +152 -0
- package/examples/demo-transition.html +169 -0
- package/examples/demo-tree.html +929 -0
- package/examples/demo-underline.html +76 -0
- package/examples/demo-utils.js +131 -0
- package/examples/demo-validate.html +120 -0
- package/examples/index.html +149 -0
- package/package.json +72 -8
- package/script-gen-color.js +148 -0
- package/script-mini.js +78 -0
- package/script-prefix.js +398 -0
- package/skill.md +575 -0
|
@@ -0,0 +1,929 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<link id="wispcss-css" rel="stylesheet" href="../dist/wispcss.css">
|
|
8
|
+
<link rel="stylesheet" href="./demo-styles.css">
|
|
9
|
+
<title>Tree - WispCSS Demo</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<h1>Tree Component</h1>
|
|
14
|
+
<p>Hierarchical tree built on ul/li with states, shapes, densities, indent modes, node styles, grouping, checkboxes, notes, toggle expansion, and dynamic colors.</p>
|
|
15
|
+
|
|
16
|
+
<h2>Notes</h2>
|
|
17
|
+
<div class="section">
|
|
18
|
+
<ul>
|
|
19
|
+
<li>Structure must be <code>ul > li</code>. Each row is <code>div[data-role="node"]</code> containing <code>div[data-role="content"] > span[data-role="label"]</code> and optionally <code>span[data-role="arrow"]</code>, <code>.check + input</code>, <code>div[data-role="note"]</code>, <code>span[data-role="spacer"]</code>, <code>div[data-role="custom"]</code>.</li>
|
|
20
|
+
<li>Child levels are wrapped by <code>div[data-role="children"] > ul</code> placed right after the node row. The top-level <code>ul</code> does <b>not</b> need a <code>data-role="children"</code> wrapper.</li>
|
|
21
|
+
<li>Trees cannot be nested. Do not use <code>ul</code>/<code>li</code> inside non-list nodes.</li>
|
|
22
|
+
<li>Every branch node requires a <code>span[data-role="arrow"]</code> to keep indentation consistent; the arrow content is hidden automatically for leaf nodes.</li>
|
|
23
|
+
<li>Child levels are collapsed by default. Use <code>.tree-expanded</code> (one branch), <code>.tree-expanded-n</code> (up to level n), or <code>.tree-expanded-all</code> (all) to expand, or a <code><input data-role="toggle" type="checkbox"></code> for interactive CSS-only toggling.</li>
|
|
24
|
+
<li>Grouping: use <code>div[data-role="group"]</code> as a non-selectable section label; its indentation aligns with its child nodes.</li>
|
|
25
|
+
<li><code>.tree-selected</code> colors the whole row, <code>.tree-active</code> colors only the label, and <code>.tree-disabled</code> disables a row or the root.</li>
|
|
26
|
+
<li>Edit mode replaces the label text with an <code><input></code> inside <code>span[data-role="label"]</code>.</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<h2 id="basic">Basic usage</h2>
|
|
31
|
+
<div class="section">
|
|
32
|
+
<div>
|
|
33
|
+
<h3>Default (collapsed)</h3>
|
|
34
|
+
<div class="tree">
|
|
35
|
+
<ul>
|
|
36
|
+
<li>
|
|
37
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
38
|
+
<div data-role="children">
|
|
39
|
+
<ul>
|
|
40
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
41
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
42
|
+
</ul>
|
|
43
|
+
</div>
|
|
44
|
+
</li>
|
|
45
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
46
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
47
|
+
</ul>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<h3>Single branch expanded (<code>.tree-expanded</code> on node)</h3>
|
|
52
|
+
<div class="tree">
|
|
53
|
+
<ul>
|
|
54
|
+
<li>
|
|
55
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
56
|
+
<div data-role="children">
|
|
57
|
+
<ul>
|
|
58
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
59
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
60
|
+
</ul>
|
|
61
|
+
</div>
|
|
62
|
+
</li>
|
|
63
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
64
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
65
|
+
</ul>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<h3>All expanded (<code>.tree-expanded-all</code>)</h3>
|
|
70
|
+
<div class="tree tree-expanded-all">
|
|
71
|
+
<ul>
|
|
72
|
+
<li>
|
|
73
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
74
|
+
<div data-role="children">
|
|
75
|
+
<ul>
|
|
76
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
77
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
78
|
+
</ul>
|
|
79
|
+
</div>
|
|
80
|
+
</li>
|
|
81
|
+
<li>
|
|
82
|
+
<div data-role="node"><div data-role="content"><span data-role="label">B</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
83
|
+
<div data-role="children">
|
|
84
|
+
<ul>
|
|
85
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B-1</span></div></div></li>
|
|
86
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B-2</span></div></div></li>
|
|
87
|
+
</ul>
|
|
88
|
+
</div>
|
|
89
|
+
</li>
|
|
90
|
+
<li>
|
|
91
|
+
<div data-role="node"><div data-role="content"><span data-role="label">C</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
92
|
+
<div data-role="children">
|
|
93
|
+
<ul>
|
|
94
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C-1</span></div></div></li>
|
|
95
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C-2</span></div></div></li>
|
|
96
|
+
</ul>
|
|
97
|
+
</div>
|
|
98
|
+
</li>
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div>
|
|
103
|
+
<h3>Expand levels (<code>.tree-expanded-1</code> ~ <code>.tree-expanded-3</code>)</h3>
|
|
104
|
+
<div class="flex gap-4">
|
|
105
|
+
<div>
|
|
106
|
+
<h3>Level 1</h3>
|
|
107
|
+
<div class="tree tree-expanded-1">
|
|
108
|
+
<ul>
|
|
109
|
+
<li>
|
|
110
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
111
|
+
<div data-role="children">
|
|
112
|
+
<ul>
|
|
113
|
+
<li>
|
|
114
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
115
|
+
<div data-role="children">
|
|
116
|
+
<ul>
|
|
117
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1</span></div></div></li>
|
|
118
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-2</span></div></div></li>
|
|
119
|
+
</ul>
|
|
120
|
+
</div>
|
|
121
|
+
</li>
|
|
122
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
123
|
+
</ul>
|
|
124
|
+
</div>
|
|
125
|
+
</li>
|
|
126
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
127
|
+
</ul>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div>
|
|
131
|
+
<h3>Level 2</h3>
|
|
132
|
+
<div class="tree tree-expanded-2">
|
|
133
|
+
<ul>
|
|
134
|
+
<li>
|
|
135
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
136
|
+
<div data-role="children">
|
|
137
|
+
<ul>
|
|
138
|
+
<li>
|
|
139
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
140
|
+
<div data-role="children">
|
|
141
|
+
<ul>
|
|
142
|
+
<li>
|
|
143
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
144
|
+
<div data-role="children">
|
|
145
|
+
<ul>
|
|
146
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1-1</span></div></div></li>
|
|
147
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1-2</span></div></div></li>
|
|
148
|
+
</ul>
|
|
149
|
+
</div>
|
|
150
|
+
</li>
|
|
151
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-2</span></div></div></li>
|
|
152
|
+
</ul>
|
|
153
|
+
</div>
|
|
154
|
+
</li>
|
|
155
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
156
|
+
</ul>
|
|
157
|
+
</div>
|
|
158
|
+
</li>
|
|
159
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
160
|
+
</ul>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
<div>
|
|
164
|
+
<h3>Level 3</h3>
|
|
165
|
+
<div class="tree tree-expanded-3">
|
|
166
|
+
<ul>
|
|
167
|
+
<li>
|
|
168
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
169
|
+
<div data-role="children">
|
|
170
|
+
<ul>
|
|
171
|
+
<li>
|
|
172
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
173
|
+
<div data-role="children">
|
|
174
|
+
<ul>
|
|
175
|
+
<li>
|
|
176
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
177
|
+
<div data-role="children">
|
|
178
|
+
<ul>
|
|
179
|
+
<li>
|
|
180
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1-1-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
181
|
+
<div data-role="children">
|
|
182
|
+
<ul>
|
|
183
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1-1-1</span></div></div></li>
|
|
184
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1-1-2</span></div></div></li>
|
|
185
|
+
</ul>
|
|
186
|
+
</div>
|
|
187
|
+
</li>
|
|
188
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1-2</span></div></div></li>
|
|
189
|
+
</ul>
|
|
190
|
+
</div>
|
|
191
|
+
</li>
|
|
192
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-2</span></div></div></li>
|
|
193
|
+
</ul>
|
|
194
|
+
</div>
|
|
195
|
+
</li>
|
|
196
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
197
|
+
</ul>
|
|
198
|
+
</div>
|
|
199
|
+
</li>
|
|
200
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
201
|
+
</ul>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<h2 id="states">States</h2>
|
|
209
|
+
<div class="section">
|
|
210
|
+
<div>
|
|
211
|
+
<h3>Selected (<code>.tree-selected</code>) — colors the whole row</h3>
|
|
212
|
+
<div class="tree">
|
|
213
|
+
<ul>
|
|
214
|
+
<li>
|
|
215
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
216
|
+
<div data-role="children">
|
|
217
|
+
<ul>
|
|
218
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
219
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
220
|
+
</ul>
|
|
221
|
+
</div>
|
|
222
|
+
</li>
|
|
223
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
224
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
225
|
+
</ul>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
<div>
|
|
229
|
+
<h3>Active (<code>.tree-active</code>) — colors only the label</h3>
|
|
230
|
+
<div class="tree">
|
|
231
|
+
<ul>
|
|
232
|
+
<li>
|
|
233
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
234
|
+
<div data-role="children">
|
|
235
|
+
<ul>
|
|
236
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
237
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
238
|
+
</ul>
|
|
239
|
+
</div>
|
|
240
|
+
</li>
|
|
241
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
242
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
243
|
+
</ul>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
<div>
|
|
247
|
+
<h3>Disabled (<code>.tree-disabled</code>) — single node or root</h3>
|
|
248
|
+
<div class="tree">
|
|
249
|
+
<ul>
|
|
250
|
+
<li>
|
|
251
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
252
|
+
<div data-role="children">
|
|
253
|
+
<ul>
|
|
254
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
255
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
256
|
+
</ul>
|
|
257
|
+
</div>
|
|
258
|
+
</li>
|
|
259
|
+
<li><div data-role="node" class="tree-disabled"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
260
|
+
<li><div data-role="node" class="tree-disabled"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
261
|
+
</ul>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
<div>
|
|
265
|
+
<h3>Hoverable (<code>.tree-hoverable</code>)</h3>
|
|
266
|
+
<div class="tree tree-hoverable">
|
|
267
|
+
<ul>
|
|
268
|
+
<li>
|
|
269
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
270
|
+
<div data-role="children">
|
|
271
|
+
<ul>
|
|
272
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
273
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
274
|
+
</ul>
|
|
275
|
+
</div>
|
|
276
|
+
</li>
|
|
277
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
278
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
279
|
+
</ul>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<h2 id="features">Features</h2>
|
|
285
|
+
<div class="section">
|
|
286
|
+
<div>
|
|
287
|
+
<h3>Interactive toggle (<code>input[data-role="toggle"]</code>) — CSS-only expand/collapse</h3>
|
|
288
|
+
<div class="tree tree-hoverable">
|
|
289
|
+
<ul>
|
|
290
|
+
<li>
|
|
291
|
+
<label data-role="node">
|
|
292
|
+
<input data-role="toggle" type="checkbox" checked />
|
|
293
|
+
<div data-role="content"><span data-role="label">A</span></div>
|
|
294
|
+
<span data-role="arrow"><span class="icon icon-chevron-down"></span></span>
|
|
295
|
+
</label>
|
|
296
|
+
<div data-role="children">
|
|
297
|
+
<ul>
|
|
298
|
+
<li>
|
|
299
|
+
<label data-role="node">
|
|
300
|
+
<input data-role="toggle" type="checkbox" />
|
|
301
|
+
<div data-role="content"><span data-role="label">A-1</span></div>
|
|
302
|
+
<span data-role="arrow"><span class="icon icon-chevron-down"></span></span>
|
|
303
|
+
</label>
|
|
304
|
+
<div data-role="children">
|
|
305
|
+
<ul>
|
|
306
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1</span></div></div></li>
|
|
307
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-2</span></div></div></li>
|
|
308
|
+
</ul>
|
|
309
|
+
</div>
|
|
310
|
+
</li>
|
|
311
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
312
|
+
</ul>
|
|
313
|
+
</div>
|
|
314
|
+
</li>
|
|
315
|
+
<li>
|
|
316
|
+
<label data-role="node">
|
|
317
|
+
<input data-role="toggle" type="checkbox" />
|
|
318
|
+
<div data-role="content"><span data-role="label">B</span></div>
|
|
319
|
+
<span data-role="arrow"><span class="icon icon-chevron-down"></span></span>
|
|
320
|
+
</label>
|
|
321
|
+
<div data-role="children">
|
|
322
|
+
<ul>
|
|
323
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B-1</span></div></div></li>
|
|
324
|
+
</ul>
|
|
325
|
+
</div>
|
|
326
|
+
</li>
|
|
327
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
328
|
+
</ul>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
<div>
|
|
332
|
+
<h3>Edit mode — label replaced by <code><input></code></h3>
|
|
333
|
+
<div class="tree">
|
|
334
|
+
<ul>
|
|
335
|
+
<li>
|
|
336
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">
|
|
337
|
+
<input value="A" />
|
|
338
|
+
</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
339
|
+
<div data-role="children">
|
|
340
|
+
<ul>
|
|
341
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
342
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
343
|
+
</ul>
|
|
344
|
+
</div>
|
|
345
|
+
</li>
|
|
346
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
347
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
348
|
+
</ul>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
<div>
|
|
352
|
+
<h3>Checkbox integration (<code>.check + input</code>)</h3>
|
|
353
|
+
<div class="tree">
|
|
354
|
+
<ul>
|
|
355
|
+
<li>
|
|
356
|
+
<div data-role="node" class="tree-expanded"><label class="check"><input type="checkbox"/></label><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
357
|
+
<div data-role="children">
|
|
358
|
+
<ul>
|
|
359
|
+
<li><div data-role="node"><label class="check"><input type="checkbox"/></label><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
360
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" checked /></label><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
361
|
+
</ul>
|
|
362
|
+
</div>
|
|
363
|
+
</li>
|
|
364
|
+
<li><div data-role="node"><label class="check"><input type="checkbox"/></label><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
365
|
+
<li><div data-role="node"><label class="check"><input type="checkbox"/></label><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
366
|
+
</ul>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
<div>
|
|
370
|
+
<h3>Note nodes (<code>div[data-role="note"]</code>)</h3>
|
|
371
|
+
<div class="tree">
|
|
372
|
+
<ul>
|
|
373
|
+
<li>
|
|
374
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
375
|
+
<div data-role="note"><div data-role="content">This is apple</div></div>
|
|
376
|
+
<div data-role="children">
|
|
377
|
+
<ul>
|
|
378
|
+
<li>
|
|
379
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div>
|
|
380
|
+
<div data-role="note"><div data-role="content">This is apple-1</div></div>
|
|
381
|
+
</li>
|
|
382
|
+
<li>
|
|
383
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div>
|
|
384
|
+
<div data-role="note"><div data-role="content">This is apple-2</div></div>
|
|
385
|
+
</li>
|
|
386
|
+
</ul>
|
|
387
|
+
</div>
|
|
388
|
+
</li>
|
|
389
|
+
<li>
|
|
390
|
+
<div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div>
|
|
391
|
+
<div data-role="note"><div data-role="content">This is banana</div></div>
|
|
392
|
+
</li>
|
|
393
|
+
<li>
|
|
394
|
+
<div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div>
|
|
395
|
+
<div data-role="note"><div data-role="content">This is cherry</div></div>
|
|
396
|
+
</li>
|
|
397
|
+
</ul>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
<div>
|
|
401
|
+
<h3>Complex content (avatar, badge, spacer)</h3>
|
|
402
|
+
<div class="tree">
|
|
403
|
+
<ul>
|
|
404
|
+
<li>
|
|
405
|
+
<div data-role="node" class="tree-expanded">
|
|
406
|
+
<span class="avatar avatar-circle avatar-6">
|
|
407
|
+
<img src="https://unpkg.com/@codady/resource/image/earth01_sm.jpg" />
|
|
408
|
+
</span>
|
|
409
|
+
<div data-role="content">
|
|
410
|
+
<span data-role="label">A</span>
|
|
411
|
+
<span class="badge badge-2xs">2</span>
|
|
412
|
+
<span data-role="spacer"></span>
|
|
413
|
+
<span class="text-caption">Apple</span>
|
|
414
|
+
</div>
|
|
415
|
+
<span data-role="arrow"><span class="icon icon-chevron-down"></span></span>
|
|
416
|
+
</div>
|
|
417
|
+
<div data-role="children">
|
|
418
|
+
<ul>
|
|
419
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
420
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
421
|
+
</ul>
|
|
422
|
+
</div>
|
|
423
|
+
</li>
|
|
424
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
425
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
426
|
+
</ul>
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
<div>
|
|
430
|
+
<h3>Arrow position (first child)</h3>
|
|
431
|
+
<p>All <code>data-role="node"</code> elements should carry a <code>data-role="arrow"</code> child — even leaf nodes — to keep indentation consistent.</p>
|
|
432
|
+
<div class="tree">
|
|
433
|
+
<ul>
|
|
434
|
+
<li>
|
|
435
|
+
<div data-role="node" class="tree-expanded"><span data-role="arrow"><span class="icon icon-chevron-down"></span></span><div data-role="content"><span data-role="label">A</span></div></div>
|
|
436
|
+
<div data-role="children">
|
|
437
|
+
<ul>
|
|
438
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
439
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
440
|
+
</ul>
|
|
441
|
+
</div>
|
|
442
|
+
</li>
|
|
443
|
+
<li>
|
|
444
|
+
<div data-role="node"><span data-role="arrow"><span class="icon icon-chevron-down"></span></span><div data-role="content"><span data-role="label">B</span></div></div>
|
|
445
|
+
<div data-role="children">
|
|
446
|
+
<ul>
|
|
447
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">B-1</span></div></div></li>
|
|
448
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">B-2</span></div></div></li>
|
|
449
|
+
</ul>
|
|
450
|
+
</div>
|
|
451
|
+
</li>
|
|
452
|
+
<li>
|
|
453
|
+
<div data-role="node"><span data-role="arrow"><span class="icon icon-chevron-down"></span></span><div data-role="content"><span data-role="label">C</span></div></div>
|
|
454
|
+
<div data-role="children">
|
|
455
|
+
<ul>
|
|
456
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">C-1</span></div></div></li>
|
|
457
|
+
<li><div data-role="node"><span data-role="arrow"></span><div data-role="content"><span data-role="label">C-2</span></div></div></li>
|
|
458
|
+
</ul>
|
|
459
|
+
</div>
|
|
460
|
+
</li>
|
|
461
|
+
</ul>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
<div>
|
|
465
|
+
<h3>Padded (<code>.tree-padded</code>)</h3>
|
|
466
|
+
<div class="tree tree-hoverable tree-padded" style="border:1px solid #ebebeb;border-radius:12px;">
|
|
467
|
+
<ul>
|
|
468
|
+
<li>
|
|
469
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
470
|
+
<div data-role="children">
|
|
471
|
+
<ul>
|
|
472
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
473
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
474
|
+
</ul>
|
|
475
|
+
</div>
|
|
476
|
+
</li>
|
|
477
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
478
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
479
|
+
</ul>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
|
|
484
|
+
<h2 id="group">Grouping</h2>
|
|
485
|
+
<p>The group's label indentation aligns with its child nodes. Groups use <code>div[data-role="group"]</code> as a non-selectable section header.</p>
|
|
486
|
+
<div class="section">
|
|
487
|
+
<div>
|
|
488
|
+
<h3>Progressive li padding indent</h3>
|
|
489
|
+
<div class="tree tree-hoverable tree-padded tree-expanded-all">
|
|
490
|
+
<ul>
|
|
491
|
+
<li>
|
|
492
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
493
|
+
<div data-role="children">
|
|
494
|
+
<ul>
|
|
495
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
496
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
497
|
+
</ul>
|
|
498
|
+
</div>
|
|
499
|
+
</li>
|
|
500
|
+
<li>
|
|
501
|
+
<div data-role="group"><div data-role="content">Group</div></div>
|
|
502
|
+
<div data-role="children">
|
|
503
|
+
<ul>
|
|
504
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
505
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
506
|
+
</ul>
|
|
507
|
+
</div>
|
|
508
|
+
</li>
|
|
509
|
+
</ul>
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
<div>
|
|
513
|
+
<h3>Dedicated indent</h3>
|
|
514
|
+
<p>Child nodes of a group must share the same <code>--tree-level</code> to keep indentation consistent.</p>
|
|
515
|
+
<div class="tree tree-hoverable tree-padded tree-indent-dedicated">
|
|
516
|
+
<ul>
|
|
517
|
+
<li style="--tree-level:0;">
|
|
518
|
+
<div data-role="node" class="tree-expanded"><span data-role="indent"></span><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
519
|
+
<div data-role="children">
|
|
520
|
+
<ul>
|
|
521
|
+
<li style="--tree-level:1;"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
522
|
+
<li style="--tree-level:1;"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
523
|
+
</ul>
|
|
524
|
+
</div>
|
|
525
|
+
</li>
|
|
526
|
+
<li style="--tree-level:0;">
|
|
527
|
+
<div data-role="group"><span data-role="indent"></span><div data-role="content">Group</div></div>
|
|
528
|
+
<div data-role="children">
|
|
529
|
+
<ul>
|
|
530
|
+
<li style="--tree-level:0;"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
531
|
+
<li style="--tree-level:0;"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
532
|
+
</ul>
|
|
533
|
+
</div>
|
|
534
|
+
</li>
|
|
535
|
+
</ul>
|
|
536
|
+
</div>
|
|
537
|
+
</div>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
<h2 id="shapes">Shapes</h2>
|
|
541
|
+
<div class="section">
|
|
542
|
+
<div>
|
|
543
|
+
<h3>Default</h3>
|
|
544
|
+
<div class="tree tree-expanded-all">
|
|
545
|
+
<ul>
|
|
546
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
547
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
548
|
+
</ul>
|
|
549
|
+
</div>
|
|
550
|
+
</div>
|
|
551
|
+
<div>
|
|
552
|
+
<h3>Square (<code>.tree-square</code>)</h3>
|
|
553
|
+
<div class="tree tree-square tree-expanded-all">
|
|
554
|
+
<ul>
|
|
555
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
556
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
557
|
+
</ul>
|
|
558
|
+
</div>
|
|
559
|
+
</div>
|
|
560
|
+
<div>
|
|
561
|
+
<h3>Rounded (<code>.tree-rounded</code>)</h3>
|
|
562
|
+
<div class="tree tree-rounded tree-expanded-all">
|
|
563
|
+
<ul>
|
|
564
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
565
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
566
|
+
</ul>
|
|
567
|
+
</div>
|
|
568
|
+
</div>
|
|
569
|
+
<div>
|
|
570
|
+
<h3>Pill (<code>.tree-pill</code>)</h3>
|
|
571
|
+
<div class="tree tree-pill tree-expanded-all">
|
|
572
|
+
<ul>
|
|
573
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
574
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
575
|
+
</ul>
|
|
576
|
+
</div>
|
|
577
|
+
</div>
|
|
578
|
+
</div>
|
|
579
|
+
|
|
580
|
+
<h2 id="density">Density</h2>
|
|
581
|
+
<div class="section">
|
|
582
|
+
<div>
|
|
583
|
+
<h3>Tight (<code>.tree-tight</code>)</h3>
|
|
584
|
+
<div class="tree tree-hoverable tree-tight tree-expanded-all">
|
|
585
|
+
<ul>
|
|
586
|
+
<li>
|
|
587
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
588
|
+
<div data-role="children">
|
|
589
|
+
<ul>
|
|
590
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
591
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
592
|
+
</ul>
|
|
593
|
+
</div>
|
|
594
|
+
</li>
|
|
595
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
596
|
+
</ul>
|
|
597
|
+
</div>
|
|
598
|
+
</div>
|
|
599
|
+
<div>
|
|
600
|
+
<h3>Snug (<code>.tree-snug</code>)</h3>
|
|
601
|
+
<div class="tree tree-hoverable tree-snug tree-expanded-all">
|
|
602
|
+
<ul>
|
|
603
|
+
<li>
|
|
604
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
605
|
+
<div data-role="children">
|
|
606
|
+
<ul>
|
|
607
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
608
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
609
|
+
</ul>
|
|
610
|
+
</div>
|
|
611
|
+
</li>
|
|
612
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
613
|
+
</ul>
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div>
|
|
617
|
+
<h3>Compact (<code>.tree-compact</code>)</h3>
|
|
618
|
+
<div class="tree tree-hoverable tree-compact tree-expanded-all">
|
|
619
|
+
<ul>
|
|
620
|
+
<li>
|
|
621
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
622
|
+
<div data-role="children">
|
|
623
|
+
<ul>
|
|
624
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
625
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
626
|
+
</ul>
|
|
627
|
+
</div>
|
|
628
|
+
</li>
|
|
629
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
630
|
+
</ul>
|
|
631
|
+
</div>
|
|
632
|
+
</div>
|
|
633
|
+
<div>
|
|
634
|
+
<h3>Relaxed (<code>.tree-relaxed</code>)</h3>
|
|
635
|
+
<div class="tree tree-hoverable tree-relaxed tree-expanded-all">
|
|
636
|
+
<ul>
|
|
637
|
+
<li>
|
|
638
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
639
|
+
<div data-role="children">
|
|
640
|
+
<ul>
|
|
641
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
642
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
643
|
+
</ul>
|
|
644
|
+
</div>
|
|
645
|
+
</li>
|
|
646
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
647
|
+
</ul>
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
<div>
|
|
651
|
+
<h3>Loose (<code>.tree-loose</code>)</h3>
|
|
652
|
+
<div class="tree tree-hoverable tree-loose tree-expanded-all">
|
|
653
|
+
<ul>
|
|
654
|
+
<li>
|
|
655
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
656
|
+
<div data-role="children">
|
|
657
|
+
<ul>
|
|
658
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
659
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
660
|
+
</ul>
|
|
661
|
+
</div>
|
|
662
|
+
</li>
|
|
663
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
664
|
+
</ul>
|
|
665
|
+
</div>
|
|
666
|
+
</div>
|
|
667
|
+
</div>
|
|
668
|
+
|
|
669
|
+
<h2 id="indent">Indent modes</h2>
|
|
670
|
+
<div class="section">
|
|
671
|
+
<div>
|
|
672
|
+
<h3>Cascading (<code>.tree-indent-cascading</code>) — default</h3>
|
|
673
|
+
<div class="tree tree-hoverable tree-indent-cascading tree-expanded-all">
|
|
674
|
+
<ul>
|
|
675
|
+
<li>
|
|
676
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
677
|
+
<div data-role="children">
|
|
678
|
+
<ul>
|
|
679
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
680
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
681
|
+
</ul>
|
|
682
|
+
</div>
|
|
683
|
+
</li>
|
|
684
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
685
|
+
</ul>
|
|
686
|
+
</div>
|
|
687
|
+
</div>
|
|
688
|
+
<div>
|
|
689
|
+
<h3>Dedicated (<code>.tree-indent-dedicated</code>) — requires <code>--tree-level</code> and <code>span[data-role="indent"]</code></h3>
|
|
690
|
+
<div class="tree tree-hoverable tree-indent-dedicated tree-expanded-all">
|
|
691
|
+
<ul>
|
|
692
|
+
<li style="--tree-level:0">
|
|
693
|
+
<div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
694
|
+
<div data-role="note"><span data-role="indent"></span><div data-role="content">Apple note</div></div>
|
|
695
|
+
<div data-role="children">
|
|
696
|
+
<ul>
|
|
697
|
+
<li style="--tree-level:1">
|
|
698
|
+
<div data-role="node" class="tree-selected"><span data-role="indent"></span><div data-role="content"><span data-role="label">A-1</span></div></div>
|
|
699
|
+
<div data-role="note"><span data-role="indent"></span><div data-role="content">Apple-1 note</div></div>
|
|
700
|
+
</li>
|
|
701
|
+
<li style="--tree-level:1"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
702
|
+
</ul>
|
|
703
|
+
</div>
|
|
704
|
+
</li>
|
|
705
|
+
<li style="--tree-level:0"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
706
|
+
<li style="--tree-level:0"><div data-role="node"><span data-role="indent"></span><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
707
|
+
</ul>
|
|
708
|
+
</div>
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
|
|
712
|
+
<h2 id="node-styles">Node styles</h2>
|
|
713
|
+
<div class="section">
|
|
714
|
+
<div>
|
|
715
|
+
<h3>Button style (<code>.tree-btns</code>)</h3>
|
|
716
|
+
<div class="tree tree-btns tree-expanded-all">
|
|
717
|
+
<ul>
|
|
718
|
+
<li>
|
|
719
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">A</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
720
|
+
<div data-role="children">
|
|
721
|
+
<ul>
|
|
722
|
+
<li>
|
|
723
|
+
<div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
724
|
+
<div data-role="children">
|
|
725
|
+
<ul>
|
|
726
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-1</span></div></div></li>
|
|
727
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1-2</span></div></div></li>
|
|
728
|
+
</ul>
|
|
729
|
+
</div>
|
|
730
|
+
</li>
|
|
731
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
732
|
+
</ul>
|
|
733
|
+
</div>
|
|
734
|
+
</li>
|
|
735
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
736
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">C</span></div></div></li>
|
|
737
|
+
</ul>
|
|
738
|
+
</div>
|
|
739
|
+
</div>
|
|
740
|
+
<div>
|
|
741
|
+
<h3>List style (<code>.tree-entries</code>) — fully expanded, check icon on selected</h3>
|
|
742
|
+
<div class="tree tree-entries">
|
|
743
|
+
<ul>
|
|
744
|
+
<li>
|
|
745
|
+
<div data-role="node"><div data-role="content">
|
|
746
|
+
<span data-role="label">A</span>
|
|
747
|
+
<div data-role="custom">This is a custom node</div>
|
|
748
|
+
</div></div>
|
|
749
|
+
<div data-role="children">
|
|
750
|
+
<ul>
|
|
751
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-1</span></div></div></li>
|
|
752
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">A-2</span></div></div></li>
|
|
753
|
+
</ul>
|
|
754
|
+
</div>
|
|
755
|
+
</li>
|
|
756
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content">
|
|
757
|
+
<span data-role="label">B</span>
|
|
758
|
+
<div data-role="custom">This is a custom node</div>
|
|
759
|
+
</div></div></li>
|
|
760
|
+
<li><div data-role="node"><div data-role="content">
|
|
761
|
+
<span data-role="label">C</span>
|
|
762
|
+
<div data-role="custom">This is a custom node</div>
|
|
763
|
+
</div></div></li>
|
|
764
|
+
</ul>
|
|
765
|
+
</div>
|
|
766
|
+
</div>
|
|
767
|
+
</div>
|
|
768
|
+
|
|
769
|
+
<h2 id="colors">Colors</h2>
|
|
770
|
+
<div class="section">
|
|
771
|
+
<div>
|
|
772
|
+
<h3>Default (primary)</h3>
|
|
773
|
+
<div class="tree">
|
|
774
|
+
<ul>
|
|
775
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
776
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
777
|
+
</ul>
|
|
778
|
+
</div>
|
|
779
|
+
</div>
|
|
780
|
+
<div>
|
|
781
|
+
<h3>Primary (<code>.tree-primary</code>)</h3>
|
|
782
|
+
<div class="tree tree-primary">
|
|
783
|
+
<ul>
|
|
784
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
785
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
786
|
+
</ul>
|
|
787
|
+
</div>
|
|
788
|
+
</div>
|
|
789
|
+
<div>
|
|
790
|
+
<h3>Success (<code>.tree-success</code>)</h3>
|
|
791
|
+
<div class="tree tree-success">
|
|
792
|
+
<ul>
|
|
793
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
794
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
795
|
+
</ul>
|
|
796
|
+
</div>
|
|
797
|
+
</div>
|
|
798
|
+
<div>
|
|
799
|
+
<h3>Warning (<code>.tree-warning</code>)</h3>
|
|
800
|
+
<div class="tree tree-warning">
|
|
801
|
+
<ul>
|
|
802
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
803
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
804
|
+
</ul>
|
|
805
|
+
</div>
|
|
806
|
+
</div>
|
|
807
|
+
<div>
|
|
808
|
+
<h3>Error (<code>.tree-error</code>)</h3>
|
|
809
|
+
<div class="tree tree-error">
|
|
810
|
+
<ul>
|
|
811
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
812
|
+
<li><div data-role="node" class="tree-active"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
813
|
+
</ul>
|
|
814
|
+
</div>
|
|
815
|
+
</div>
|
|
816
|
+
<div>
|
|
817
|
+
<h3>Color + entries style</h3>
|
|
818
|
+
<div class="tree tree-primary tree-entries">
|
|
819
|
+
<ul>
|
|
820
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">A</span></div></div></li>
|
|
821
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">B</span></div></div></li>
|
|
822
|
+
</ul>
|
|
823
|
+
</div>
|
|
824
|
+
</div>
|
|
825
|
+
</div>
|
|
826
|
+
|
|
827
|
+
<h2 id="use-cases">Use cases</h2>
|
|
828
|
+
<div class="section">
|
|
829
|
+
<div>
|
|
830
|
+
<h3>File explorer</h3>
|
|
831
|
+
<div class="tree tree-hoverable tree-rounded">
|
|
832
|
+
<ul>
|
|
833
|
+
<li>
|
|
834
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">📁 src</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
835
|
+
<div data-role="children">
|
|
836
|
+
<ul>
|
|
837
|
+
<li>
|
|
838
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">📁 components</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
839
|
+
<div data-role="children">
|
|
840
|
+
<ul>
|
|
841
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 Button.tsx</span></div></div></li>
|
|
842
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 Tree.tsx</span></div></div></li>
|
|
843
|
+
</ul>
|
|
844
|
+
</div>
|
|
845
|
+
</li>
|
|
846
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 index.ts</span></div></div></li>
|
|
847
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 utils.ts</span></div></div></li>
|
|
848
|
+
</ul>
|
|
849
|
+
</div>
|
|
850
|
+
</li>
|
|
851
|
+
<li>
|
|
852
|
+
<div data-role="node" class="tree-expanded"><div data-role="content"><span data-role="label">📁 public</span></div><span data-role="arrow"><span class="icon icon-chevron-down"></span></span></div>
|
|
853
|
+
<div data-role="children">
|
|
854
|
+
<ul>
|
|
855
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 index.html</span></div></div></li>
|
|
856
|
+
</ul>
|
|
857
|
+
</div>
|
|
858
|
+
</li>
|
|
859
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">📄 package.json</span></div></div></li>
|
|
860
|
+
</ul>
|
|
861
|
+
</div>
|
|
862
|
+
</div>
|
|
863
|
+
<div>
|
|
864
|
+
<h3>Permission / category selector with checkboxes</h3>
|
|
865
|
+
<div class="tree tree-hoverable tree-expanded-all">
|
|
866
|
+
<ul>
|
|
867
|
+
<li>
|
|
868
|
+
<div data-role="node"><label class="check"><input type="checkbox" checked /></label><div data-role="content"><span data-role="label">User management</span></div></div>
|
|
869
|
+
<div data-role="children">
|
|
870
|
+
<ul>
|
|
871
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" checked /></label><div data-role="content"><span data-role="label">View users</span></div></div></li>
|
|
872
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" /></label><div data-role="content"><span data-role="label">Edit users</span></div></div></li>
|
|
873
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" /></label><div data-role="content"><span data-role="label">Delete users</span></div></div></li>
|
|
874
|
+
</ul>
|
|
875
|
+
</div>
|
|
876
|
+
</li>
|
|
877
|
+
<li>
|
|
878
|
+
<div data-role="node"><label class="check"><input type="checkbox" /></label><div data-role="content"><span data-role="label">Role management</span></div></div>
|
|
879
|
+
<div data-role="children">
|
|
880
|
+
<ul>
|
|
881
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" /></label><div data-role="content"><span data-role="label">View roles</span></div></div></li>
|
|
882
|
+
<li><div data-role="node"><label class="check"><input type="checkbox" /></label><div data-role="content"><span data-role="label">Assign roles</span></div></div></li>
|
|
883
|
+
</ul>
|
|
884
|
+
</div>
|
|
885
|
+
</li>
|
|
886
|
+
</ul>
|
|
887
|
+
</div>
|
|
888
|
+
</div>
|
|
889
|
+
<div>
|
|
890
|
+
<h3>Tag filter (btns style)</h3>
|
|
891
|
+
<div class="tree tree-btns tree-pill">
|
|
892
|
+
<ul>
|
|
893
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content"><span data-role="label">All</span></div></div></li>
|
|
894
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">Frontend</span></div></div></li>
|
|
895
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">Backend</span></div></div></li>
|
|
896
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">DevOps</span></div></div></li>
|
|
897
|
+
<li><div data-role="node"><div data-role="content"><span data-role="label">Design</span></div></div></li>
|
|
898
|
+
</ul>
|
|
899
|
+
</div>
|
|
900
|
+
</div>
|
|
901
|
+
<div>
|
|
902
|
+
<h3>Settings menu (entries style with colors)</h3>
|
|
903
|
+
<div class="tree tree-entries tree-success">
|
|
904
|
+
<ul>
|
|
905
|
+
<li><div data-role="node" class="tree-selected"><div data-role="content">
|
|
906
|
+
<span data-role="label"><b>General</b></span>
|
|
907
|
+
<div data-role="custom">Language, region, appearance</div>
|
|
908
|
+
</div></div></li>
|
|
909
|
+
<li><div data-role="node"><div data-role="content">
|
|
910
|
+
<span data-role="label"><b>Notifications</b></span>
|
|
911
|
+
<div data-role="custom">Email, push, in-app alerts</div>
|
|
912
|
+
</div></div></li>
|
|
913
|
+
<li><div data-role="node"><div data-role="content">
|
|
914
|
+
<span data-role="label"><b>Privacy</b></span>
|
|
915
|
+
<div data-role="custom">Data sharing and cookies</div>
|
|
916
|
+
</div></div></li>
|
|
917
|
+
<li><div data-role="node"><div data-role="content">
|
|
918
|
+
<span data-role="label"><b>Security</b></span>
|
|
919
|
+
<div data-role="custom">Password, 2FA, sessions</div>
|
|
920
|
+
</div></div></li>
|
|
921
|
+
</ul>
|
|
922
|
+
</div>
|
|
923
|
+
</div>
|
|
924
|
+
</div>
|
|
925
|
+
|
|
926
|
+
<script src="./demo-utils.js"></script>
|
|
927
|
+
</body>
|
|
928
|
+
|
|
929
|
+
</html>
|