@daffodil/design 0.94.1 → 0.95.0
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/README.md +1 -2
- package/accordion/src/accordion-theme.scss +4 -4
- package/article/README.md +4 -27
- package/article/src/article-theme.scss +14 -14
- package/badge/src/badge-theme.scss +0 -6
- package/button/README.md +0 -4
- package/button/src/button/basic/button-theme.scss +17 -42
- package/button/src/button/button-base.scss +12 -3
- package/button/src/button/flat/flat-theme.scss +14 -12
- package/button/src/button/icon/icon-theme.scss +19 -40
- package/button/src/button/stroked/stroked-theme.scss +22 -36
- package/card/src/card/stroked/stroked-theme.scss +1 -1
- package/card/src/card-base.scss +0 -1
- package/fesm2022/daffodil-design-accordion.mjs +285 -188
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +578 -340
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-badge.mjs +166 -84
- package/fesm2022/daffodil-design-badge.mjs.map +1 -1
- package/fesm2022/daffodil-design-beacon.mjs +109 -47
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +541 -408
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +349 -224
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +496 -327
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +373 -313
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +103 -60
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +441 -352
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +155 -57
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +349 -234
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image-lite.mjs +60 -0
- package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
- package/fesm2022/daffodil-design-image.mjs +245 -107
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +217 -164
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +308 -170
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +525 -417
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +680 -450
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +175 -166
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +145 -68
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +376 -226
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +296 -192
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +382 -300
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +424 -364
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +874 -887
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +156 -99
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +176 -106
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +685 -427
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +251 -133
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-testing.mjs +4 -16
- package/fesm2022/daffodil-design-testing.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +170 -150
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +658 -481
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +456 -469
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +1628 -1650
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/README.md +0 -4
- package/form-field/src/form-field-theme.scss +12 -4
- package/image/README.md +4 -0
- package/image-lite/README.md +58 -0
- package/image-lite/src/image-theme.scss +18 -0
- package/list/src/list-base.scss +3 -4
- package/list/src/list-theme.scss +6 -5
- package/media-gallery/README.md +1 -1
- package/media-gallery/src/media-gallery-theme.scss +3 -3
- package/menu/src/menu-theme.scss +6 -2
- package/notification/src/notification-theme.scss +10 -10
- package/package.json +1 -1
- package/scss/global.scss +17 -11
- package/scss/theme.scss +2 -18
- package/scss/theming/_get-palette.scss +0 -3
- package/scss/theming/_index.scss +0 -1
- package/scss/theming/_light-dark.scss +2 -2
- package/scss/theming/_theme-css-variables.scss +1 -1
- package/scss/theming/create-theme/_create-theme.scss +2 -2
- package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
- package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
- package/scss/typography/_classes.scss +0 -6
- package/scss/typography/_index.scss +0 -1
- package/scss/typography/mixins/_sizes.scss +0 -1
- package/scss/typography/utilities/_variables.scss +3 -0
- package/select/src/select-theme.scss +10 -14
- package/switch/src/switch-theme.scss +2 -2
- package/tabs/src/tabs-theme.scss +4 -4
- package/types/daffodil-design-accordion.d.ts +92 -67
- package/types/daffodil-design-article.d.ts +49 -56
- package/types/daffodil-design-badge.d.ts +56 -33
- package/types/daffodil-design-beacon.d.ts +35 -14
- package/types/daffodil-design-breadcrumb.d.ts +89 -85
- package/types/daffodil-design-button.d.ts +128 -146
- package/types/daffodil-design-callout.d.ts +55 -39
- package/types/daffodil-design-card.d.ts +66 -56
- package/types/daffodil-design-checkbox.d.ts +211 -167
- package/types/daffodil-design-container.d.ts +17 -16
- package/types/daffodil-design-form-field.d.ts +273 -240
- package/types/daffodil-design-form.d.ts +21 -21
- package/types/daffodil-design-hero.d.ts +55 -39
- package/types/daffodil-design-image-lite.d.ts +17 -0
- package/types/daffodil-design-image.d.ts +89 -55
- package/types/daffodil-design-input.d.ts +86 -72
- package/types/daffodil-design-list.d.ts +49 -43
- package/types/daffodil-design-media-gallery.d.ts +176 -148
- package/types/daffodil-design-menu.d.ts +177 -169
- package/types/daffodil-design-modal.d.ts +205 -205
- package/types/daffodil-design-native-select.d.ts +94 -84
- package/types/daffodil-design-navbar.d.ts +34 -24
- package/types/daffodil-design-notification.d.ts +82 -67
- package/types/daffodil-design-paginator.d.ts +140 -118
- package/types/daffodil-design-progress-bar.d.ts +92 -74
- package/types/daffodil-design-radio.d.ts +183 -144
- package/types/daffodil-design-select.d.ts +207 -178
- package/types/daffodil-design-sidebar.d.ts +270 -253
- package/types/daffodil-design-spinner.d.ts +49 -36
- package/types/daffodil-design-switch.d.ts +77 -46
- package/types/daffodil-design-tabs.d.ts +248 -198
- package/types/daffodil-design-tag.d.ts +91 -56
- package/types/daffodil-design-testing.d.ts +1 -3
- package/types/daffodil-design-text-snippet.d.ts +48 -37
- package/types/daffodil-design-textarea.d.ts +88 -79
- package/types/daffodil-design-toast.d.ts +175 -183
- package/types/daffodil-design-tree.d.ts +186 -169
- package/types/daffodil-design-youtube-player.d.ts +56 -52
- package/types/daffodil-design.d.ts +614 -695
- package/button/src/button/raised/raised-theme.scss +0 -92
- package/button/src/button/underline/underline-theme.scss +0 -141
- package/fesm2022/daffodil-design-link-set.mjs +0 -160
- package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
- package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
- package/link-set/README.md +0 -86
- package/quantity-field/README.md +0 -63
- package/scss/theming/_configure-theme.scss +0 -120
- package/scss/typography/mixins/_font-weight.scss +0 -14
- package/types/daffodil-design-link-set.d.ts +0 -72
- package/types/daffodil-design-quantity-field.d.ts +0 -171
|
@@ -1,487 +1,474 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import * as i1 from
|
|
5
|
-
import { DaffArticleEncapsulatedDirective } from
|
|
6
|
-
import { __decorate } from
|
|
7
|
-
import { BehaviorSubject } from
|
|
8
|
-
import { collect } from
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This service is used by tree items to notify their parent
|
|
12
|
-
* that the tree has to be recomputed.
|
|
13
|
-
*
|
|
14
|
-
* This service is a multiton associated with each tree instance.
|
|
15
|
-
* It follows the same lifecycle as the tree it is associated with.
|
|
16
|
-
*/
|
|
1
|
+
import { CommonModule, DOCUMENT, NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, Directive, Inject, NgModule, ViewEncapsulation, computed, contentChild, effect, inject, input, signal, untracked } from "@angular/core";
|
|
4
|
+
import * as i1 from "@daffodil/design";
|
|
5
|
+
import { DaffArticleEncapsulatedDirective } from "@daffodil/design";
|
|
6
|
+
import { __decorate } from "tslib";
|
|
7
|
+
import { BehaviorSubject } from "rxjs";
|
|
8
|
+
import { collect } from "@daffodil/core";
|
|
17
9
|
let DaffTreeNotifierService = class DaffTreeNotifierService {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* `notify` can be called to trigger a re-computation of the tree
|
|
30
|
-
* if data has changed unexpectedly and a re-render did not occur.
|
|
31
|
-
*
|
|
32
|
-
* This should be used sparingly. Instead, prefer updating `data` on the tree
|
|
33
|
-
* itself for performance reasons.
|
|
34
|
-
*/
|
|
35
|
-
notify() {
|
|
36
|
-
this._notice.next(true);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Cleanup when the tree is destroyed.
|
|
40
|
-
*
|
|
41
|
-
* @docs-private
|
|
42
|
-
*/
|
|
43
|
-
ngOnDestroy() {
|
|
44
|
-
this._notice.complete();
|
|
45
|
-
}
|
|
10
|
+
constructor() {
|
|
11
|
+
this._notice = new BehaviorSubject(true);
|
|
12
|
+
this.notice$ = this._notice.asObservable();
|
|
13
|
+
}
|
|
14
|
+
notify() {
|
|
15
|
+
this._notice.next(true);
|
|
16
|
+
}
|
|
17
|
+
ngOnDestroy() {
|
|
18
|
+
this._notice.complete();
|
|
19
|
+
}
|
|
46
20
|
};
|
|
47
|
-
DaffTreeNotifierService = __decorate([
|
|
48
|
-
Inject({})
|
|
49
|
-
], DaffTreeNotifierService);
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Flatten a DaffTreeUi<unknown> into an array, removing elements from the array
|
|
53
|
-
* below nodes in the tree that are not open.
|
|
54
|
-
*/
|
|
21
|
+
DaffTreeNotifierService = __decorate([Inject({})], DaffTreeNotifierService);
|
|
55
22
|
const flattenTree = (daffUiTree, removeNodes = false) => {
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
else if (removeNodes && el._treeRef.parent?.open) {
|
|
98
|
-
tree.push({
|
|
99
|
-
id: el.id,
|
|
100
|
-
title: el.title,
|
|
101
|
-
level: el.level,
|
|
102
|
-
url: el.url,
|
|
103
|
-
visible: !hasClosedAncestor,
|
|
104
|
-
hasChildren: el.items.length > 0,
|
|
105
|
-
data: undefined,
|
|
106
|
-
_treeRef: el._treeRef,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return tree;
|
|
23
|
+
const tree = [];
|
|
24
|
+
if (!daffUiTree) return [];
|
|
25
|
+
let items = [{
|
|
26
|
+
...daffUiTree,
|
|
27
|
+
level: 0,
|
|
28
|
+
data: void 0,
|
|
29
|
+
open: true,
|
|
30
|
+
_treeRef: daffUiTree
|
|
31
|
+
}];
|
|
32
|
+
while (items) {
|
|
33
|
+
const el = items.pop();
|
|
34
|
+
if (!el) break;
|
|
35
|
+
items = [...items, ...el.items.map((i) => ({
|
|
36
|
+
...i,
|
|
37
|
+
level: el.level + 1,
|
|
38
|
+
_treeRef: i
|
|
39
|
+
})).reverse()];
|
|
40
|
+
const hasClosedAncestor = el._treeRef.parent ? collect(el._treeRef.parent, (node) => node.parent ? [node.parent] : [], el.level).reduce((acc, parent) => acc || !parent.open, false) : false;
|
|
41
|
+
if (!removeNodes && el._treeRef.parent) tree.push({
|
|
42
|
+
id: el.id,
|
|
43
|
+
title: el.title,
|
|
44
|
+
level: el.level,
|
|
45
|
+
url: el.url,
|
|
46
|
+
visible: !hasClosedAncestor,
|
|
47
|
+
hasChildren: el.items.length > 0,
|
|
48
|
+
data: el.data,
|
|
49
|
+
_treeRef: el._treeRef
|
|
50
|
+
});
|
|
51
|
+
else if (removeNodes && el._treeRef.parent?.open) tree.push({
|
|
52
|
+
id: el.id,
|
|
53
|
+
title: el.title,
|
|
54
|
+
level: el.level,
|
|
55
|
+
url: el.url,
|
|
56
|
+
visible: !hasClosedAncestor,
|
|
57
|
+
hasChildren: el.items.length > 0,
|
|
58
|
+
data: el.data,
|
|
59
|
+
_treeRef: el._treeRef
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return tree;
|
|
111
63
|
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Traverse the tree, pre-order, right-to-left
|
|
115
|
-
*/
|
|
116
64
|
const traverse = (tree, visit, key) => {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
visit(el);
|
|
126
|
-
stack = [
|
|
127
|
-
...stack,
|
|
128
|
-
...el[key],
|
|
129
|
-
];
|
|
130
|
-
}
|
|
131
|
-
return tree;
|
|
65
|
+
let stack = [tree];
|
|
66
|
+
while (stack) {
|
|
67
|
+
const el = stack.pop();
|
|
68
|
+
if (!el) break;
|
|
69
|
+
visit(el);
|
|
70
|
+
stack = [...stack, ...el[key]];
|
|
71
|
+
}
|
|
72
|
+
return tree;
|
|
132
73
|
};
|
|
133
|
-
|
|
134
74
|
const daffDataTreeToUiTree = (data, parent, open = false) => ({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
75
|
+
id: parent ? `${parent.id}.${data.id ?? data.title}` : data.id ?? data.title,
|
|
76
|
+
title: data.title,
|
|
77
|
+
url: data.url,
|
|
78
|
+
data: data.data,
|
|
79
|
+
open,
|
|
80
|
+
parent,
|
|
81
|
+
items: []
|
|
142
82
|
});
|
|
143
|
-
/**
|
|
144
|
-
* This function translates the original data given to us by the client
|
|
145
|
-
* to the internal representation of the tree used by the {@link DaffTreeComponent}
|
|
146
|
-
*/
|
|
147
83
|
const hydrateTree = (data, treeId) => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
...treeEl.items,
|
|
166
|
-
];
|
|
167
|
-
return el;
|
|
168
|
-
}, 'items');
|
|
169
|
-
return root;
|
|
84
|
+
const root = {
|
|
85
|
+
id: treeId ?? data.id ?? data.title,
|
|
86
|
+
title: data.title,
|
|
87
|
+
url: data.url,
|
|
88
|
+
data: data.data,
|
|
89
|
+
open: true,
|
|
90
|
+
parent: void 0,
|
|
91
|
+
items: []
|
|
92
|
+
};
|
|
93
|
+
let treeStack = [root];
|
|
94
|
+
traverse(data, (el) => {
|
|
95
|
+
const treeEl = treeStack.pop();
|
|
96
|
+
treeEl.items = el.items.map((i) => daffDataTreeToUiTree(i, treeEl, false));
|
|
97
|
+
treeStack = [...treeStack, ...treeEl.items];
|
|
98
|
+
return el;
|
|
99
|
+
}, "items");
|
|
100
|
+
return root;
|
|
170
101
|
};
|
|
171
|
-
|
|
172
|
-
/* eslint-disable quote-props */
|
|
173
102
|
let daffTreeId = 0;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
103
|
+
var DaffTreeComponent = class DaffTreeComponent {
|
|
104
|
+
constructor() {
|
|
105
|
+
this.notifier = inject(DaffTreeNotifierService);
|
|
106
|
+
this.renderMode = input("in-dom", ...ngDevMode ? [{ debugName: "renderMode" }] : /* istanbul ignore next */ []);
|
|
107
|
+
this.id = input(`${daffTreeId++}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
108
|
+
this.tree = input(...ngDevMode ? [void 0, { debugName: "tree" }] : /* istanbul ignore next */ []);
|
|
109
|
+
this._tree = computed(() => {
|
|
110
|
+
const tree = this.tree();
|
|
111
|
+
return tree ? hydrateTree(tree, this.id()) : void 0;
|
|
112
|
+
}, ...ngDevMode ? [{ debugName: "_tree" }] : /* istanbul ignore next */ []);
|
|
113
|
+
this._revision = signal(0, ...ngDevMode ? [{ debugName: "_revision" }] : /* istanbul ignore next */ []);
|
|
114
|
+
this.flatTree = computed(() => {
|
|
115
|
+
this._revision();
|
|
116
|
+
const tree = this._tree();
|
|
117
|
+
return tree ? flattenTree(tree, this.renderMode() === "not-in-dom") : [];
|
|
118
|
+
}, ...ngDevMode ? [{ debugName: "flatTree" }] : /* istanbul ignore next */ []);
|
|
119
|
+
this.withChildrenTemplate = contentChild("daffTreeItemWithChildrenTpl", ...ngDevMode ? [{ debugName: "withChildrenTemplate" }] : /* istanbul ignore next */ []);
|
|
120
|
+
this.treeItemTemplate = contentChild("daffTreeItemTpl", ...ngDevMode ? [{ debugName: "treeItemTemplate" }] : /* istanbul ignore next */ []);
|
|
121
|
+
this.notifier.notice$.subscribe(() => {
|
|
122
|
+
this._revision.update((r) => r + 1);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
static {
|
|
126
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
127
|
+
minVersion: "12.0.0",
|
|
128
|
+
version: "22.2.4",
|
|
129
|
+
ngImport: i0,
|
|
130
|
+
type: DaffTreeComponent,
|
|
131
|
+
deps: [],
|
|
132
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
static {
|
|
136
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
137
|
+
minVersion: "17.0.0",
|
|
138
|
+
version: "22.2.4",
|
|
139
|
+
type: DaffTreeComponent,
|
|
140
|
+
isStandalone: true,
|
|
141
|
+
selector: "ul[daff-tree]",
|
|
142
|
+
inputs: {
|
|
143
|
+
renderMode: {
|
|
144
|
+
classPropertyName: "renderMode",
|
|
145
|
+
publicName: "renderMode",
|
|
146
|
+
isSignal: true,
|
|
147
|
+
isRequired: false,
|
|
148
|
+
transformFunction: null
|
|
149
|
+
},
|
|
150
|
+
id: {
|
|
151
|
+
classPropertyName: "id",
|
|
152
|
+
publicName: "id",
|
|
153
|
+
isSignal: true,
|
|
154
|
+
isRequired: false,
|
|
155
|
+
transformFunction: null
|
|
156
|
+
},
|
|
157
|
+
tree: {
|
|
158
|
+
classPropertyName: "tree",
|
|
159
|
+
publicName: "tree",
|
|
160
|
+
isSignal: true,
|
|
161
|
+
isRequired: false,
|
|
162
|
+
transformFunction: null
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
host: { classAttribute: "daff-tree" },
|
|
166
|
+
providers: [DaffTreeNotifierService],
|
|
167
|
+
queries: [{
|
|
168
|
+
propertyName: "withChildrenTemplate",
|
|
169
|
+
first: true,
|
|
170
|
+
predicate: ["daffTreeItemWithChildrenTpl"],
|
|
171
|
+
descendants: true,
|
|
172
|
+
isSignal: true
|
|
173
|
+
}, {
|
|
174
|
+
propertyName: "treeItemTemplate",
|
|
175
|
+
first: true,
|
|
176
|
+
predicate: ["daffTreeItemTpl"],
|
|
177
|
+
descendants: true,
|
|
178
|
+
isSignal: true
|
|
179
|
+
}],
|
|
180
|
+
hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }],
|
|
181
|
+
ngImport: i0,
|
|
182
|
+
template: "@for (node of flatTree(); track node.id) {\n <li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n <ng-container\n *ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n </ng-container>\n </li>\n}",
|
|
183
|
+
styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 1rem}.daff-tree li.hidden{display:none}.daff-tree-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;position:relative;background:none;border:0;padding:.5rem 1rem .5rem 0;line-height:1.5rem;font-weight:400;text-align:left;text-decoration:none;width:100%;padding-left:calc(var(--tree-padding) * (var(--depth)))}.daff-tree-item:before{content:\"\";position:absolute;top:0;bottom:0;left:0;width:.25rem}.daff-tree-item:focus,.daff-tree-item:focus-visible{z-index:1}.daff-tree-item.selected{font-weight:500}.daff-tree-item.parent{position:relative;padding-right:2.5rem}.daff-tree-item.parent:after{content:\"\";position:absolute;top:48%;right:1rem;display:inline-block;border-right:.125rem solid currentColor;border-bottom:.125rem solid currentColor;width:.5rem;height:.5rem;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-tree-item.parent.open:after{top:56%;transform:translateY(-50%) rotate(225deg)}\n"],
|
|
184
|
+
dependencies: [{
|
|
185
|
+
kind: "directive",
|
|
186
|
+
type: NgTemplateOutlet,
|
|
187
|
+
selector: "[ngTemplateOutlet]",
|
|
188
|
+
inputs: [
|
|
189
|
+
"ngTemplateOutletContext",
|
|
190
|
+
"ngTemplateOutlet",
|
|
191
|
+
"ngTemplateOutletInjector"
|
|
192
|
+
]
|
|
193
|
+
}],
|
|
194
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
195
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
200
|
+
minVersion: "12.0.0",
|
|
201
|
+
version: "22.2.4",
|
|
202
|
+
ngImport: i0,
|
|
203
|
+
type: DaffTreeComponent,
|
|
204
|
+
decorators: [{
|
|
205
|
+
type: Component,
|
|
206
|
+
args: [{
|
|
207
|
+
selector: "ul[daff-tree]",
|
|
208
|
+
encapsulation: ViewEncapsulation.None,
|
|
209
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
210
|
+
providers: [DaffTreeNotifierService],
|
|
211
|
+
hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
|
|
212
|
+
host: { "class": "daff-tree" },
|
|
213
|
+
imports: [NgTemplateOutlet],
|
|
214
|
+
template: "@for (node of flatTree(); track node.id) {\n <li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n <ng-container\n *ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n </ng-container>\n </li>\n}",
|
|
215
|
+
styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 1rem}.daff-tree li.hidden{display:none}.daff-tree-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;position:relative;background:none;border:0;padding:.5rem 1rem .5rem 0;line-height:1.5rem;font-weight:400;text-align:left;text-decoration:none;width:100%;padding-left:calc(var(--tree-padding) * (var(--depth)))}.daff-tree-item:before{content:\"\";position:absolute;top:0;bottom:0;left:0;width:.25rem}.daff-tree-item:focus,.daff-tree-item:focus-visible{z-index:1}.daff-tree-item.selected{font-weight:500}.daff-tree-item.parent{position:relative;padding-right:2.5rem}.daff-tree-item.parent:after{content:\"\";position:absolute;top:48%;right:1rem;display:inline-block;border-right:.125rem solid currentColor;border-bottom:.125rem solid currentColor;width:.5rem;height:.5rem;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-tree-item.parent.open:after{top:56%;transform:translateY(-50%) rotate(225deg)}\n"]
|
|
216
|
+
}]
|
|
217
|
+
}],
|
|
218
|
+
ctorParameters: () => [],
|
|
219
|
+
propDecorators: {
|
|
220
|
+
renderMode: [{
|
|
221
|
+
type: i0.Input,
|
|
222
|
+
args: [{
|
|
223
|
+
isSignal: true,
|
|
224
|
+
alias: "renderMode",
|
|
225
|
+
required: false
|
|
226
|
+
}]
|
|
227
|
+
}],
|
|
228
|
+
id: [{
|
|
229
|
+
type: i0.Input,
|
|
230
|
+
args: [{
|
|
231
|
+
isSignal: true,
|
|
232
|
+
alias: "id",
|
|
233
|
+
required: false
|
|
234
|
+
}]
|
|
235
|
+
}],
|
|
236
|
+
tree: [{
|
|
237
|
+
type: i0.Input,
|
|
238
|
+
args: [{
|
|
239
|
+
isSignal: true,
|
|
240
|
+
alias: "tree",
|
|
241
|
+
required: false
|
|
242
|
+
}]
|
|
243
|
+
}],
|
|
244
|
+
withChildrenTemplate: [{
|
|
245
|
+
type: i0.ContentChild,
|
|
246
|
+
args: ["daffTreeItemWithChildrenTpl", { isSignal: true }]
|
|
247
|
+
}],
|
|
248
|
+
treeItemTemplate: [{
|
|
249
|
+
type: i0.ContentChild,
|
|
250
|
+
args: ["daffTreeItemTpl", { isSignal: true }]
|
|
251
|
+
}]
|
|
252
|
+
}
|
|
253
|
+
});
|
|
277
254
|
const walkUp = (tree, visit) => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
255
|
+
while (tree.parent) {
|
|
256
|
+
visit(tree);
|
|
257
|
+
tree = tree.parent;
|
|
258
|
+
}
|
|
259
|
+
return tree;
|
|
283
260
|
};
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Open all ancestor nodes of the given node so that it becomes visible in the tree.
|
|
287
|
-
*/
|
|
288
261
|
const daffTreeOpenAncestors = (node) => {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
262
|
+
walkUp(node, (ancestor) => {
|
|
263
|
+
ancestor.open = true;
|
|
264
|
+
return ancestor;
|
|
265
|
+
});
|
|
293
266
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
class DaffTreeModule {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
i0.ɵɵ
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
267
|
+
var DaffTreeItemDirective = class DaffTreeItemDirective {
|
|
268
|
+
constructor() {
|
|
269
|
+
this.document = inject(DOCUMENT);
|
|
270
|
+
this.treeNotifier = inject(DaffTreeNotifierService);
|
|
271
|
+
this.node = input.required(...ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []);
|
|
272
|
+
this.selected = input(false, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
273
|
+
this.id = computed(() => "tree-" + this.node().id, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
274
|
+
this.depth = computed(() => this.node().level, ...ngDevMode ? [{ debugName: "depth" }] : /* istanbul ignore next */ []);
|
|
275
|
+
this.isParent = computed(() => this.node().hasChildren, ...ngDevMode ? [{ debugName: "isParent" }] : /* istanbul ignore next */ []);
|
|
276
|
+
this.open = computed(() => this.node()._treeRef.open, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
277
|
+
this.ariaExpanded = computed(() => {
|
|
278
|
+
const node = this.node();
|
|
279
|
+
return node.hasChildren ? node._treeRef.open ? "true" : "false" : void 0;
|
|
280
|
+
}, ...ngDevMode ? [{ debugName: "ariaExpanded" }] : /* istanbul ignore next */ []);
|
|
281
|
+
effect(() => {
|
|
282
|
+
if (this.selected()) {
|
|
283
|
+
const node = untracked(this.node);
|
|
284
|
+
daffTreeOpenAncestors(node._treeRef);
|
|
285
|
+
this.treeNotifier.notify();
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
onEscape() {
|
|
290
|
+
this.toggleParent(this.node());
|
|
291
|
+
}
|
|
292
|
+
onClick() {
|
|
293
|
+
if (this.node().hasChildren) this.toggleTree(this.node());
|
|
294
|
+
this.treeNotifier.notify();
|
|
295
|
+
}
|
|
296
|
+
toggleParent(node) {
|
|
297
|
+
if (node._treeRef?.parent.parent === void 0) return;
|
|
298
|
+
node._treeRef.parent.open = !node._treeRef.parent.open;
|
|
299
|
+
this.document.getElementById("tree-" + node._treeRef.parent.id).focus();
|
|
300
|
+
}
|
|
301
|
+
toggleTree(node) {
|
|
302
|
+
if (node._treeRef.open === false) node._treeRef.open = true;
|
|
303
|
+
else node._treeRef.open = false;
|
|
304
|
+
}
|
|
305
|
+
static {
|
|
306
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
307
|
+
minVersion: "12.0.0",
|
|
308
|
+
version: "22.2.4",
|
|
309
|
+
ngImport: i0,
|
|
310
|
+
type: DaffTreeItemDirective,
|
|
311
|
+
deps: [],
|
|
312
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
static {
|
|
316
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
317
|
+
minVersion: "17.1.0",
|
|
318
|
+
version: "22.2.4",
|
|
319
|
+
type: DaffTreeItemDirective,
|
|
320
|
+
isStandalone: true,
|
|
321
|
+
selector: "[daffTreeItem]",
|
|
322
|
+
inputs: {
|
|
323
|
+
node: {
|
|
324
|
+
classPropertyName: "node",
|
|
325
|
+
publicName: "node",
|
|
326
|
+
isSignal: true,
|
|
327
|
+
isRequired: true,
|
|
328
|
+
transformFunction: null
|
|
329
|
+
},
|
|
330
|
+
selected: {
|
|
331
|
+
classPropertyName: "selected",
|
|
332
|
+
publicName: "selected",
|
|
333
|
+
isSignal: true,
|
|
334
|
+
isRequired: false,
|
|
335
|
+
transformFunction: null
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
host: {
|
|
339
|
+
listeners: {
|
|
340
|
+
"keydown.escape": "onEscape()",
|
|
341
|
+
"click": "onClick()"
|
|
342
|
+
},
|
|
343
|
+
properties: {
|
|
344
|
+
"class.selected": "selected()",
|
|
345
|
+
"class.parent": "isParent()",
|
|
346
|
+
"class.open": "open()",
|
|
347
|
+
"attr.id": "id()",
|
|
348
|
+
"attr.aria-expanded": "ariaExpanded()",
|
|
349
|
+
"style.--depth": "depth()"
|
|
350
|
+
},
|
|
351
|
+
classAttribute: "daff-tree-item"
|
|
352
|
+
},
|
|
353
|
+
ngImport: i0
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
358
|
+
minVersion: "12.0.0",
|
|
359
|
+
version: "22.2.4",
|
|
360
|
+
ngImport: i0,
|
|
361
|
+
type: DaffTreeItemDirective,
|
|
362
|
+
decorators: [{
|
|
363
|
+
type: Directive,
|
|
364
|
+
args: [{
|
|
365
|
+
selector: "[daffTreeItem]",
|
|
366
|
+
host: {
|
|
367
|
+
"class": "daff-tree-item",
|
|
368
|
+
"[class.selected]": "selected()",
|
|
369
|
+
"[class.parent]": "isParent()",
|
|
370
|
+
"[class.open]": "open()",
|
|
371
|
+
"[attr.id]": "id()",
|
|
372
|
+
"[attr.aria-expanded]": "ariaExpanded()",
|
|
373
|
+
"[style.--depth]": "depth()",
|
|
374
|
+
"(keydown.escape)": "onEscape()",
|
|
375
|
+
"(click)": "onClick()"
|
|
376
|
+
}
|
|
377
|
+
}]
|
|
378
|
+
}],
|
|
379
|
+
ctorParameters: () => [],
|
|
380
|
+
propDecorators: {
|
|
381
|
+
node: [{
|
|
382
|
+
type: i0.Input,
|
|
383
|
+
args: [{
|
|
384
|
+
isSignal: true,
|
|
385
|
+
alias: "node",
|
|
386
|
+
required: true
|
|
387
|
+
}]
|
|
388
|
+
}],
|
|
389
|
+
selected: [{
|
|
390
|
+
type: i0.Input,
|
|
391
|
+
args: [{
|
|
392
|
+
isSignal: true,
|
|
393
|
+
alias: "selected",
|
|
394
|
+
required: false
|
|
395
|
+
}]
|
|
396
|
+
}]
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
var DaffTreeModule = class DaffTreeModule {
|
|
400
|
+
static {
|
|
401
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
402
|
+
minVersion: "12.0.0",
|
|
403
|
+
version: "22.2.4",
|
|
404
|
+
ngImport: i0,
|
|
405
|
+
type: DaffTreeModule,
|
|
406
|
+
deps: [],
|
|
407
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
static {
|
|
411
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
412
|
+
minVersion: "14.0.0",
|
|
413
|
+
version: "22.2.4",
|
|
414
|
+
ngImport: i0,
|
|
415
|
+
type: DaffTreeModule,
|
|
416
|
+
imports: [
|
|
417
|
+
CommonModule,
|
|
418
|
+
DaffTreeComponent,
|
|
419
|
+
DaffTreeItemDirective
|
|
420
|
+
],
|
|
421
|
+
exports: [DaffTreeComponent, DaffTreeItemDirective]
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
static {
|
|
425
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
426
|
+
minVersion: "12.0.0",
|
|
427
|
+
version: "22.2.4",
|
|
428
|
+
ngImport: i0,
|
|
429
|
+
type: DaffTreeModule,
|
|
430
|
+
imports: [CommonModule]
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
435
|
+
minVersion: "12.0.0",
|
|
436
|
+
version: "22.2.4",
|
|
437
|
+
ngImport: i0,
|
|
438
|
+
type: DaffTreeModule,
|
|
439
|
+
decorators: [{
|
|
440
|
+
type: NgModule,
|
|
441
|
+
args: [{
|
|
442
|
+
imports: [
|
|
443
|
+
CommonModule,
|
|
444
|
+
DaffTreeComponent,
|
|
445
|
+
DaffTreeItemDirective
|
|
446
|
+
],
|
|
447
|
+
exports: [DaffTreeComponent, DaffTreeItemDirective]
|
|
448
|
+
}]
|
|
449
|
+
}]
|
|
450
|
+
});
|
|
459
451
|
const daffTransformTree = (tree, transformFn, key) => {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
452
|
+
const transformedTree = transformFn(tree);
|
|
453
|
+
const queue = [{
|
|
454
|
+
node: tree,
|
|
455
|
+
parent: transformedTree
|
|
456
|
+
}];
|
|
457
|
+
while (queue.length > 0) {
|
|
458
|
+
const { node, parent } = queue.shift();
|
|
459
|
+
const childItems = node[key];
|
|
460
|
+
for (const child of childItems) {
|
|
461
|
+
const transformedChild = transformFn(child);
|
|
462
|
+
parent.items.push(transformedChild);
|
|
463
|
+
queue.push({
|
|
464
|
+
node: child,
|
|
465
|
+
parent: transformedChild
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return transformedTree;
|
|
472
470
|
};
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* @docs-private
|
|
476
|
-
*/
|
|
477
|
-
const DAFF_TREE_COMPONENTS = [
|
|
478
|
-
DaffTreeComponent,
|
|
479
|
-
DaffTreeItemDirective,
|
|
480
|
-
];
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Generated bundle index. Do not edit.
|
|
484
|
-
*/
|
|
485
|
-
|
|
471
|
+
const DAFF_TREE_COMPONENTS = [DaffTreeComponent, DaffTreeItemDirective];
|
|
486
472
|
export { DAFF_TREE_COMPONENTS, DaffTreeComponent, DaffTreeItemDirective, DaffTreeModule, daffTransformTree };
|
|
487
|
-
|
|
473
|
+
|
|
474
|
+
//# sourceMappingURL=daffodil-design-tree.mjs.map
|