UNPKG

13.6 kBJSONView Raw
1{
2 "props": {
3 "nodes": {
4 "type": "Array",
5 "desc": "The array of nodes that designates the tree structure",
6 "required": true,
7 "examples": [ "[ {...}, {...} ]" ],
8 "category": "content"
9 },
10
11 "node-key": {
12 "type": "String",
13 "desc": "The property name of each node object that holds a unique node id",
14 "required": true,
15 "examples": [ "key", "id" ],
16 "category": "content"
17 },
18
19 "label-key": {
20 "type": "String",
21 "desc": "The property name of each node object that holds the label of the node",
22 "default": "label",
23 "examples": [ "name", "description" ],
24 "category": "content"
25 },
26
27 "color": {
28 "extends": "color"
29 },
30
31 "control-color": {
32 "extends": "color",
33 "desc": "Color name for controls (like checkboxes) from the Quasar Color Palette",
34 "category": "style"
35 },
36
37 "text-color": {
38 "extends": "text-color"
39 },
40
41 "selected-color": {
42 "extends": "color",
43 "desc": "Color name for selected nodes (from the Quasar Color Palette)"
44 },
45
46 "dark": {
47 "extends": "dark"
48 },
49
50 "icon": {
51 "extends": "icon"
52 },
53
54 "tick-strategy": {
55 "type": "String",
56 "desc": "The type of strategy to use for the selection of the nodes",
57 "default": "none",
58 "values": [ "none", "strict", "leaf", "leaf-filtered" ],
59 "category": "behavior"
60 },
61
62 "ticked": {
63 "type": "Array",
64 "desc": "Keys of nodes that are ticked",
65 "sync": true,
66 "examples": [ ":ticked.sync=\"tickedKeys\"" ],
67 "category": "state"
68 },
69
70 "expanded": {
71 "type": "Array",
72 "desc": "Keys of nodes that are expanded",
73 "sync": true,
74 "examples": [ ":expanded.sync=\"expandedKeys\"" ],
75 "category": "state"
76 },
77
78 "selected": {
79 "type": "Any",
80 "desc": "Key of node currently selected",
81 "sync": true,
82 "examples": [ ":selected.sync=\"selectedKey\"" ],
83 "category": "state"
84 },
85
86 "default-expand-all": {
87 "type": "Boolean",
88 "desc": "Allow the tree to have all its branches expanded, when first rendered",
89 "category": "behavior"
90 },
91
92 "accordion": {
93 "type": "Boolean",
94 "desc": "Allows the tree to be set in accordion mode",
95 "category": "behavior"
96 },
97
98 "filter": {
99 "type": "String",
100 "desc": "The text value to be used for filtering nodes",
101 "examples": [ ":filter=\"searchText\"" ],
102 "category": "filter"
103 },
104
105 "filter-method": {
106 "type": "Function",
107 "desc": "The function to use to filter the tree nodes",
108 "default": "(see source code)",
109 "params": {
110 "node": {
111 "type": "Object",
112 "desc": "Node currently being filtered",
113 "__exemption": [ "examples" ]
114 },
115 "filter": {
116 "type": "String",
117 "desc": "Filter text to match against",
118 "__exemption": [ "examples" ]
119 }
120 },
121 "returns": {
122 "type": "Boolean",
123 "desc": "Matches or not"
124 },
125 "category": "filter"
126 },
127
128 "duration": {
129 "type": "Number",
130 "desc": "Toggle animation duration (in milliseconds)",
131 "default": 300,
132 "examples": [ ":duration=\"500\"" ],
133 "category": "style"
134 },
135
136 "no-nodes-label": {
137 "type": "String",
138 "desc": "Override default such label for when no nodes are available",
139 "examples": [ "No nodes to show!" ],
140 "category": "content"
141 },
142
143 "no-results-label": {
144 "type": "String",
145 "desc": "Override default such label for when no nodes are available due to filtering",
146 "examples": [ "No results" ],
147 "category": "content"
148 }
149 },
150
151 "scopedSlots": {
152 "default-header": {
153 "desc": "Slot to use for defining the header of a node",
154 "scope": {
155 "expanded": {
156 "type": "Boolean",
157 "desc": "Is node expanded? Can directly be assigned new Boolean value which changes expanded state",
158 "reactive": true
159 },
160 "ticked": {
161 "type": "Boolean",
162 "desc": "Is node ticked? Can directly be assigned new Boolean value which changes ticked state",
163 "reactive": true
164 },
165 "tree": {
166 "type": "Object",
167 "desc": "QTree instance",
168 "__exemption": [ "examples" ]
169 },
170 "node": {
171 "type": "Object",
172 "desc": "Node object",
173 "__exemption": [ "examples" ]
174 },
175 "key": {
176 "type": "Any",
177 "desc": "Node's key",
178 "__exemption": [ "examples" ]
179 },
180 "color": {
181 "type": "String",
182 "desc": "QTree instance 'color' supplied prop value",
183 "examples": [ "primary" ]
184 },
185 "dark": {
186 "type": "Boolean",
187 "desc": "QTree instance 'dark' supplied prop value"
188 }
189 }
190 },
191
192 "header-[name]": {
193 "desc": "Header template slot for describing node header; Used by nodes which have their 'header' prop set to '[name]', where '[name]' can be any string",
194 "scope": {
195 "expanded": {
196 "type": "Boolean",
197 "desc": "Is node expanded? Can directly be assigned new Boolean value which changes expanded state",
198 "reactive": true
199 },
200 "ticked": {
201 "type": "Boolean",
202 "desc": "Is node ticked? Can directly be assigned new Boolean value which changes ticked state",
203 "reactive": true
204 },
205 "tree": {
206 "type": "Object",
207 "desc": "QTree instance",
208 "__exemption": [ "examples" ]
209 },
210 "node": {
211 "type": "Object",
212 "desc": "Node object",
213 "__exemption": [ "examples" ]
214 },
215 "key": {
216 "type": "Any",
217 "desc": "Node's key",
218 "__exemption": [ "examples" ]
219 },
220 "color": {
221 "type": "String",
222 "desc": "QTree instance 'color' supplied prop value",
223 "examples": [ "primary" ]
224 },
225 "dark": {
226 "type": "Boolean",
227 "desc": "QTree instance 'dark' supplied prop value"
228 }
229 }
230 },
231
232 "default-body": {
233 "desc": "Slot to use for defining the body of a node",
234 "scope": {
235 "expanded": {
236 "type": "Boolean",
237 "desc": "Is node expanded? Can directly be assigned new Boolean value which changes expanded state",
238 "reactive": true
239 },
240 "ticked": {
241 "type": "Boolean",
242 "desc": "Is node ticked? Can directly be assigned new Boolean value which changes ticked state",
243 "reactive": true
244 },
245 "tree": {
246 "type": "Object",
247 "desc": "QTree instance",
248 "__exemption": [ "examples" ]
249 },
250 "node": {
251 "type": "Object",
252 "desc": "Node object",
253 "__exemption": [ "examples" ]
254 },
255 "key": {
256 "type": "Any",
257 "desc": "Node's key",
258 "__exemption": [ "examples" ]
259 },
260 "color": {
261 "type": "String",
262 "desc": "QTree instance 'color' supplied prop value",
263 "examples": [ "primary" ]
264 },
265 "dark": {
266 "type": "Boolean",
267 "desc": "QTree instance 'dark' supplied prop value"
268 }
269 }
270 },
271
272 "body-[name]": {
273 "desc": "Body template slot for describing node body; Used by nodes which have their 'body' prop set to '[name]', where '[name]' can be any string",
274 "scope": {
275 "expanded": {
276 "type": "Boolean",
277 "desc": "Is node expanded? Can directly be assigned new Boolean value which changes expanded state",
278 "reactive": true
279 },
280 "ticked": {
281 "type": "Boolean",
282 "desc": "Is node ticked? Can directly be assigned new Boolean value which changes ticked state",
283 "reactive": true
284 },
285 "tree": {
286 "type": "Object",
287 "desc": "QTree instance",
288 "__exemption": [ "examples" ]
289 },
290 "node": {
291 "type": "Object",
292 "desc": "Node object",
293 "__exemption": [ "examples" ]
294 },
295 "key": {
296 "type": "Any",
297 "desc": "Node's key",
298 "__exemption": [ "examples" ]
299 },
300 "color": {
301 "type": "String",
302 "desc": "QTree instance 'color' supplied prop value",
303 "examples": [ "primary" ]
304 },
305 "dark": {
306 "type": "Boolean",
307 "desc": "QTree instance 'dark' supplied prop value"
308 }
309 }
310 }
311 },
312
313 "events": {
314 "update:expanded": {
315 "desc": "Triggered when nodes are expanded or collapsed; Used by Vue on 'update' synched prop",
316 "params": {
317 "expanded": {
318 "type": "Array",
319 "desc": "The expanded node keys",
320 "examples": [ "[ 'Node 1', 'Node 2' ]" ]
321 }
322 }
323 },
324
325 "lazy-load": {
326 "desc": "Emitted when the lazy loading of nodes is finished",
327 "params": {
328 "details": {
329 "type": "Object",
330 "desc": "Lazy loading details",
331 "definition": {
332 "node": {
333 "type": "Object",
334 "desc": "The node to which the new nodes (the children) will be appended",
335 "__exemption": [ "examples" ]
336 },
337 "key": {
338 "type": "String",
339 "desc": "The key of the node getting the newly loaded child nodes",
340 "examples": [ "New Node" ]
341 },
342 "done": {
343 "type": "Function",
344 "desc": "The callback to be carried out when the loading is successful",
345 "params": {
346 "children": {
347 "type": "Array",
348 "desc": "Array of nodes",
349 "__exemption": [ "examples" ]
350 }
351 },
352 "returns": null
353 },
354 "fail": {
355 "type": "Function",
356 "desc": "The callback to be carried out should the loading fails",
357 "params": null,
358 "returns": null
359 }
360 }
361 }
362 }
363 },
364
365 "update:ticked": {
366 "desc": "Emitted when nodes are ticked/unticked via the checkbox; Used by Vue on 'ticked' synched prop",
367 "params": {
368 "target": {
369 "type": "Array",
370 "desc": "The ticked node keys",
371 "examples": [ "[ 'Node 1', 'Node 2' ]" ]
372 }
373 }
374 },
375
376 "update:selected": {
377 "desc": "Emitted when selected node changes; Used by Vue on 'selected' synched prop",
378 "params": {
379 "target": {
380 "type": "Any",
381 "desc": "The selected node key",
382 "examples": [ "Node 1" ]
383 }
384 }
385 }
386 },
387
388 "methods": {
389 "getNodeByKey": {
390 "desc": "Get the node with the given key",
391 "params": {
392 "key": {
393 "type": "Any",
394 "desc": "The key of a node",
395 "required": true,
396 "examples": [ "Node 1" ]
397 }
398 },
399 "returns": {
400 "type": "Object",
401 "desc": "Requested node",
402 "__exemption": [ "examples" ]
403 }
404 },
405
406 "getTickedNodes": {
407 "desc": "Get array of nodes that are ticked",
408 "returns": {
409 "type": "Array",
410 "desc": "Ticked node objects",
411 "__exemption": [ "examples" ]
412 }
413 },
414
415 "getExpandedNodes": {
416 "desc": "Get array of nodes that are expanded",
417 "returns": {
418 "type": "Array",
419 "desc": "Expanded node objects",
420 "__exemption": [ "examples" ]
421 }
422 },
423
424 "isExpanded": {
425 "desc": "Determine if a node is expanded",
426 "params": {
427 "key": {
428 "type": "Any",
429 "desc": "The key of a node",
430 "required": true,
431 "examples": [ "Node 1" ]
432 }
433 },
434 "returns": {
435 "type": "Boolean",
436 "desc": "Is specified node expanded?"
437 }
438 },
439
440 "expandAll": {
441 "desc": "Use to expand all branches of the tree"
442 },
443
444 "collapseAll": {
445 "desc": "Use to collapse all branches of the tree"
446 },
447
448 "setExpanded": {
449 "desc": "Expands the tree at the point of the node with the key given",
450 "params": {
451 "key": {
452 "type": "Any",
453 "desc": "The key of a node",
454 "required": true,
455 "examples": [ "Node 1" ]
456 },
457 "state": {
458 "type": "Boolean",
459 "desc": "Set to 'true' to expand the branch of the tree, otherwise 'false' collapses it",
460 "required": true
461 }
462 }
463 },
464
465 "isTicked": {
466 "desc": "Method to check if a node's checkbox is selected or not",
467 "params": {
468 "key": {
469 "type": "Any",
470 "desc": "The key of a node",
471 "required": true,
472 "examples": [ "Node 1" ]
473 }
474 },
475 "returns": {
476 "type": "Boolean",
477 "desc": "Is specified node ticked?"
478 }
479 },
480
481 "setTicked": {
482 "desc": "Method to set a node's checkbox programmatically",
483 "params": {
484 "keys": {
485 "type": "Array",
486 "desc": "The keys of nodes to tick/untick",
487 "required": true,
488 "examples": [ "[ 'Node 1', 'Node 2' ]" ]
489 },
490 "state": {
491 "type": "Boolean",
492 "desc": "Set to 'true' to tick the checkbox of nodes, otherwise 'false' unticks them",
493 "required": true
494 }
495 }
496 }
497 }
498}