@daffodil/design 0.61.0 → 0.62.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. package/accordion/examples/package.json +1 -1
  2. package/article/examples/package.json +1 -1
  3. package/button/examples/package.json +1 -1
  4. package/callout/examples/package.json +1 -1
  5. package/card/examples/package.json +1 -1
  6. package/checkbox/examples/package.json +1 -1
  7. package/container/examples/package.json +1 -1
  8. package/core/animation/animation-state-with-params.d.ts +8 -0
  9. package/core/public_api.d.ts +1 -0
  10. package/esm2020/core/animation/animation-state-with-params.mjs +2 -0
  11. package/esm2020/core/public_api.mjs +2 -1
  12. package/esm2020/molecules/backdrop/animation/backdrop-animation-state.mjs +2 -0
  13. package/esm2020/molecules/backdrop/animation/backdrop-animation.mjs +6 -2
  14. package/esm2020/molecules/backdrop/backdrop/backdrop.component.mjs +40 -5
  15. package/esm2020/molecules/sidebar/animation/sidebar-animation-state.mjs +2 -2
  16. package/esm2020/molecules/sidebar/animation/sidebar-animation-width.mjs +2 -0
  17. package/esm2020/molecules/sidebar/animation/sidebar-animation.mjs +21 -4
  18. package/esm2020/molecules/sidebar/animation/sidebar-viewport-animation-state.mjs +3 -0
  19. package/esm2020/molecules/sidebar/helper/sidebar-mode.mjs +1 -1
  20. package/esm2020/molecules/sidebar/helper/sidebar-side.mjs +2 -0
  21. package/esm2020/molecules/sidebar/public_api.mjs +1 -2
  22. package/esm2020/molecules/sidebar/sidebar/sidebar.component.mjs +62 -10
  23. package/esm2020/molecules/sidebar/sidebar-viewport/backdrop-interactable.mjs +5 -0
  24. package/esm2020/molecules/sidebar/sidebar-viewport/content-pad.mjs +17 -0
  25. package/esm2020/molecules/sidebar/sidebar-viewport/content-shift.mjs +21 -0
  26. package/esm2020/molecules/sidebar/sidebar-viewport/sidebar-viewport.component.mjs +83 -81
  27. package/esm2020/sidebar/examples/basic-sidebar/basic-sidebar.component.mjs +12 -0
  28. package/esm2020/sidebar/examples/basic-sidebar/basic-sidebar.module.mjs +29 -0
  29. package/esm2020/sidebar/examples/daffodil-design-sidebar-examples.mjs +5 -0
  30. package/esm2020/sidebar/examples/fixed-and-over-sidebar/fixed-and-over-sidebar.component.mjs +21 -0
  31. package/esm2020/sidebar/examples/fixed-and-over-sidebar/fixed-and-over-sidebar.module.mjs +32 -0
  32. package/esm2020/sidebar/examples/index.mjs +2 -0
  33. package/esm2020/sidebar/examples/public_api.mjs +18 -0
  34. package/esm2020/sidebar/examples/sidebar-with-sticky/sidebar-with-sticky.component.mjs +12 -0
  35. package/esm2020/sidebar/examples/sidebar-with-sticky/sidebar-with-sticky.module.mjs +29 -0
  36. package/esm2020/sidebar/examples/two-fixed-sidebars-either-side/two-fixed-sidebars-either-side.component.mjs +12 -0
  37. package/esm2020/sidebar/examples/two-fixed-sidebars-either-side/two-fixed-sidebars-either-side.module.mjs +29 -0
  38. package/esm2020/sidebar/examples/under-sidebar/under-sidebar.component.mjs +26 -0
  39. package/esm2020/sidebar/examples/under-sidebar/under-sidebar.module.mjs +32 -0
  40. package/esm2020/tree/daffodil-design-tree.mjs +5 -0
  41. package/esm2020/tree/examples/basic-tree/basic-tree.component.mjs +39 -0
  42. package/esm2020/tree/examples/basic-tree/basic-tree.module.mjs +34 -0
  43. package/esm2020/tree/examples/daffodil-design-tree-examples.mjs +5 -0
  44. package/esm2020/tree/examples/index.mjs +2 -0
  45. package/esm2020/tree/examples/public_api.mjs +7 -0
  46. package/esm2020/tree/index.mjs +2 -0
  47. package/esm2020/tree/interfaces/recursive-key.mjs +2 -0
  48. package/esm2020/tree/interfaces/tree-data.mjs +2 -0
  49. package/esm2020/tree/interfaces/tree-ui.mjs +2 -0
  50. package/esm2020/tree/public_api.mjs +5 -0
  51. package/esm2020/tree/tree/tree-notifier.service.mjs +45 -0
  52. package/esm2020/tree/tree/tree.component.mjs +106 -0
  53. package/esm2020/tree/tree-item/tree-item.directive.mjs +154 -0
  54. package/esm2020/tree/tree.module.mjs +31 -0
  55. package/esm2020/tree/utils/flatten-tree.mjs +47 -0
  56. package/esm2020/tree/utils/hydrate-tree.mjs +31 -0
  57. package/esm2020/tree/utils/transform-in-place.mjs +23 -0
  58. package/esm2020/tree/utils/traverse-tree.mjs +21 -0
  59. package/fesm2015/daffodil-design-sidebar-examples.mjs +218 -0
  60. package/fesm2015/daffodil-design-sidebar-examples.mjs.map +1 -0
  61. package/fesm2015/daffodil-design-tree-examples.mjs +81 -0
  62. package/fesm2015/daffodil-design-tree-examples.mjs.map +1 -0
  63. package/fesm2015/daffodil-design-tree.mjs +443 -0
  64. package/fesm2015/daffodil-design-tree.mjs.map +1 -0
  65. package/fesm2015/daffodil-design.mjs +250 -98
  66. package/fesm2015/daffodil-design.mjs.map +1 -1
  67. package/fesm2020/daffodil-design-sidebar-examples.mjs +218 -0
  68. package/fesm2020/daffodil-design-sidebar-examples.mjs.map +1 -0
  69. package/fesm2020/daffodil-design-tree-examples.mjs +81 -0
  70. package/fesm2020/daffodil-design-tree-examples.mjs.map +1 -0
  71. package/fesm2020/daffodil-design-tree.mjs +448 -0
  72. package/fesm2020/daffodil-design-tree.mjs.map +1 -0
  73. package/fesm2020/daffodil-design.mjs +250 -98
  74. package/fesm2020/daffodil-design.mjs.map +1 -1
  75. package/hero/examples/package.json +1 -1
  76. package/image/examples/package.json +1 -1
  77. package/input/examples/package.json +1 -1
  78. package/list/examples/package.json +1 -1
  79. package/loading-icon/examples/package.json +1 -1
  80. package/media-gallery/examples/package.json +1 -1
  81. package/menu/examples/package.json +1 -1
  82. package/modal/examples/package.json +1 -1
  83. package/molecules/backdrop/animation/backdrop-animation-state.d.ts +2 -0
  84. package/molecules/backdrop/backdrop/backdrop.component.d.ts +17 -3
  85. package/molecules/sidebar/animation/sidebar-animation-state.d.ts +2 -1
  86. package/molecules/sidebar/animation/sidebar-animation-width.d.ts +2 -0
  87. package/molecules/sidebar/animation/sidebar-animation.d.ts +3 -1
  88. package/molecules/sidebar/animation/sidebar-viewport-animation-state.d.ts +6 -0
  89. package/molecules/sidebar/helper/sidebar-mode.d.ts +27 -1
  90. package/molecules/sidebar/helper/sidebar-side.d.ts +12 -0
  91. package/molecules/sidebar/public_api.d.ts +2 -1
  92. package/molecules/sidebar/sidebar/sidebar.component.d.ts +37 -5
  93. package/molecules/sidebar/sidebar-viewport/backdrop-interactable.d.ts +6 -0
  94. package/molecules/sidebar/sidebar-viewport/content-pad.d.ts +7 -0
  95. package/molecules/sidebar/sidebar-viewport/content-shift.d.ts +8 -0
  96. package/molecules/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +47 -44
  97. package/navbar/examples/package.json +1 -1
  98. package/package.json +1 -1
  99. package/paginator/examples/package.json +1 -1
  100. package/quantity-field/examples/package.json +1 -1
  101. package/radio/examples/package.json +1 -1
  102. package/scss/global.scss +1 -0
  103. package/scss/theme.scss +2 -0
  104. package/sidebar/examples/basic-sidebar/basic-sidebar.component.d.ts +5 -0
  105. package/sidebar/examples/basic-sidebar/basic-sidebar.module.d.ts +8 -0
  106. package/sidebar/examples/daffodil-design-sidebar-examples.d.ts +5 -0
  107. package/sidebar/examples/fixed-and-over-sidebar/fixed-and-over-sidebar.component.d.ts +8 -0
  108. package/sidebar/examples/fixed-and-over-sidebar/fixed-and-over-sidebar.module.d.ts +8 -0
  109. package/sidebar/examples/index.d.ts +1 -0
  110. package/sidebar/examples/package.json +1 -0
  111. package/sidebar/examples/public_api.d.ts +2 -0
  112. package/sidebar/examples/sidebar-with-sticky/sidebar-with-sticky.component.d.ts +5 -0
  113. package/sidebar/examples/sidebar-with-sticky/sidebar-with-sticky.module.d.ts +8 -0
  114. package/sidebar/examples/two-fixed-sidebars-either-side/two-fixed-sidebars-either-side.component.d.ts +5 -0
  115. package/sidebar/examples/two-fixed-sidebars-either-side/two-fixed-sidebars-either-side.module.d.ts +8 -0
  116. package/sidebar/examples/under-sidebar/under-sidebar.component.d.ts +10 -0
  117. package/sidebar/examples/under-sidebar/under-sidebar.module.d.ts +8 -0
  118. package/src/molecules/sidebar/README.md +10 -0
  119. package/src/molecules/sidebar/helper/_variables.scss +7 -0
  120. package/src/molecules/sidebar/sidebar/sidebar-theme.scss +3 -3
  121. package/src/molecules/sidebar/sidebar-viewport/sidebar-viewport-theme.scss +5 -0
  122. package/tree/README.md +38 -0
  123. package/tree/daffodil-design-tree.d.ts +5 -0
  124. package/tree/examples/basic-tree/basic-tree.component.d.ts +7 -0
  125. package/tree/examples/basic-tree/basic-tree.module.d.ts +10 -0
  126. package/tree/examples/daffodil-design-tree-examples.d.ts +5 -0
  127. package/tree/examples/index.d.ts +1 -0
  128. package/tree/examples/package.json +1 -0
  129. package/tree/examples/public_api.d.ts +4 -0
  130. package/tree/index.d.ts +1 -0
  131. package/tree/interfaces/recursive-key.d.ts +3 -0
  132. package/tree/interfaces/tree-data.d.ts +13 -0
  133. package/tree/interfaces/tree-ui.d.ts +11 -0
  134. package/tree/package.json +1 -0
  135. package/tree/public_api.d.ts +6 -0
  136. package/tree/src/tree-theme.scss +38 -0
  137. package/tree/tree/tree-notifier.service.d.ts +32 -0
  138. package/tree/tree/tree.component.d.ts +75 -0
  139. package/tree/tree-item/tree-item.directive.d.ts +102 -0
  140. package/tree/tree.module.d.ts +9 -0
  141. package/tree/utils/flatten-tree.d.ts +19 -0
  142. package/tree/utils/hydrate-tree.d.ts +8 -0
  143. package/tree/utils/transform-in-place.d.ts +15 -0
  144. package/tree/utils/traverse-tree.d.ts +5 -0
@@ -0,0 +1,448 @@
1
+ import * as i2 from '@angular/common';
2
+ import { DOCUMENT, CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Inject, Directive, HostBinding, Input, HostListener, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChild, NgModule } from '@angular/core';
5
+ import { __decorate } from 'tslib';
6
+ import { BehaviorSubject } from 'rxjs';
7
+
8
+ /**
9
+ * This service is used by tree-items to notify their parent
10
+ * that the tree has to be re-computed.
11
+ *
12
+ * This service is a multiton associated with each tree instance.
13
+ * It follows the same lifecycle has the tree it is associated with.
14
+ */
15
+ let DaffTreeNotifierService = class DaffTreeNotifierService {
16
+ constructor() {
17
+ /**
18
+ * @docs-private
19
+ */
20
+ this._notice = new BehaviorSubject(true);
21
+ /**
22
+ * An observable that emits when the tree needs to be re-computed.
23
+ */
24
+ this.notice$ = this._notice.asObservable();
25
+ }
26
+ /**
27
+ * `notify` can be called to trigger a re-computation of the tree
28
+ * if data has changed unexpectedly and a re-render did not occur.
29
+ *
30
+ * This should be used sparingly. Instead, prefer updating `data` on the tree
31
+ * itself for performance reasons.
32
+ */
33
+ notify() {
34
+ this._notice.next(true);
35
+ }
36
+ /**
37
+ * Cleanup when the tree is destroyed.
38
+ *
39
+ * @docs-private
40
+ */
41
+ ngOnDestroy() {
42
+ this._notice.complete();
43
+ }
44
+ };
45
+ DaffTreeNotifierService = __decorate([
46
+ Inject({})
47
+ ], DaffTreeNotifierService);
48
+
49
+ /**
50
+ * The `DaffTreeItemDirective` allows you to demarcate the elements which are
51
+ * tree-children that interact with the parent tree.
52
+ *
53
+ * They can be used like:
54
+ *
55
+ * ```html
56
+ * <ul daff-tree [tree]="tree">
57
+ * <ng-template #daffTreeItemWithChildrenTpl let-node>
58
+ * <button daffTreeItem [node]="node">{{ node.title }} </button>
59
+ * </ng-template>
60
+ *
61
+ * <ng-template #daffTreeItemTpl let-node>
62
+ * <a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
63
+ * </ng-template>
64
+ * </ul>
65
+ * ```
66
+ *
67
+ * where `tree` is a {@link DaffTreeData} and `daff-tree` is a {@link DaffTreeComponent}.
68
+ *
69
+ */
70
+ class DaffTreeItemDirective {
71
+ constructor(document, treeNotifier) {
72
+ this.document = document;
73
+ this.treeNotifier = treeNotifier;
74
+ /**
75
+ * The css class of the daff-tree.
76
+ *
77
+ * @docs-private
78
+ */
79
+ this.class = true;
80
+ /**
81
+ * The css class of a DaffTreeItemDirective that has children.
82
+ *
83
+ * @docs-private
84
+ */
85
+ this.classParent = false;
86
+ /**
87
+ * The CSS class indicating whether or not the tree is `open`.
88
+ */
89
+ this.openClass = false;
90
+ /**
91
+ * Whether or not the tree item is the currently active item.
92
+ * Note that there is no requirement there there only be one active item at a time.
93
+ */
94
+ this.selected = false;
95
+ }
96
+ /**
97
+ * The CSS class indicating whether or not the tree is `selected`.
98
+ */
99
+ get selectedClass() {
100
+ return this.selected;
101
+ }
102
+ ;
103
+ /**
104
+ * The {@link DaffTreeFlatNode} associated with this specific tree item.
105
+ */
106
+ get node() {
107
+ return this._node;
108
+ }
109
+ ;
110
+ set node(val) {
111
+ this._node = val;
112
+ this.id = 'tree-' + this._node.id;
113
+ this.ariaExpanded = this._node._treeRef.open ? 'true' : 'false';
114
+ this.depth = this._node.level;
115
+ this.classParent = this._node.hasChildren;
116
+ this.openClass = this._node._treeRef.open;
117
+ }
118
+ /**
119
+ * @docs-private
120
+ */
121
+ onEscape() {
122
+ this.toggleParent(this.node);
123
+ }
124
+ /**
125
+ * @docs-private
126
+ */
127
+ onClick() {
128
+ if (this.node.hasChildren) {
129
+ this.toggleTree(this.node);
130
+ }
131
+ this.treeNotifier.notify();
132
+ }
133
+ /**
134
+ * Toggle the open state of the tree's parent.
135
+ */
136
+ toggleParent(node) {
137
+ if (node._treeRef?.parent.parent === undefined) {
138
+ return;
139
+ }
140
+ node._treeRef.parent.open = !node._treeRef.parent.open;
141
+ this.document.getElementById('tree-' + node._treeRef.parent.id).focus();
142
+ }
143
+ /**
144
+ * Toggle the open state of this specific subtree tree.
145
+ */
146
+ toggleTree(node) {
147
+ if (node._treeRef.open === false) {
148
+ node._treeRef.open = true;
149
+ }
150
+ else {
151
+ node._treeRef.open = false;
152
+ }
153
+ }
154
+ }
155
+ /** @nocollapse */ DaffTreeItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeItemDirective, deps: [{ token: DOCUMENT }, { token: DaffTreeNotifierService }], target: i0.ɵɵFactoryTarget.Directive });
156
+ /** @nocollapse */ DaffTreeItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.0", type: DaffTreeItemDirective, selector: "[daffTreeItem]", inputs: { node: "node", selected: "selected" }, host: { listeners: { "keydown.escape": "onEscape()", "click": "onClick()" }, properties: { "class.daff-tree-item": "this.class", "class.daff-tree-item__parent": "this.classParent", "attr.id": "this.id", "attr.aria-expanded": "this.ariaExpanded", "style.--depth": "this.depth", "class.selected": "this.selectedClass", "class.open": "this.openClass" } }, ngImport: i0 });
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeItemDirective, decorators: [{
158
+ type: Directive,
159
+ args: [{
160
+ selector: '[daffTreeItem]',
161
+ }]
162
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
163
+ type: Inject,
164
+ args: [DOCUMENT]
165
+ }] }, { type: DaffTreeNotifierService }]; }, propDecorators: { class: [{
166
+ type: HostBinding,
167
+ args: ['class.daff-tree-item']
168
+ }], classParent: [{
169
+ type: HostBinding,
170
+ args: ['class.daff-tree-item__parent']
171
+ }], id: [{
172
+ type: HostBinding,
173
+ args: ['attr.id']
174
+ }], ariaExpanded: [{
175
+ type: HostBinding,
176
+ args: ['attr.aria-expanded']
177
+ }], depth: [{
178
+ type: HostBinding,
179
+ args: ['style.--depth']
180
+ }], selectedClass: [{
181
+ type: HostBinding,
182
+ args: ['class.selected']
183
+ }], openClass: [{
184
+ type: HostBinding,
185
+ args: ['class.open']
186
+ }], node: [{
187
+ type: Input
188
+ }], selected: [{
189
+ type: Input
190
+ }], onEscape: [{
191
+ type: HostListener,
192
+ args: ['keydown.escape']
193
+ }], onClick: [{
194
+ type: HostListener,
195
+ args: ['click']
196
+ }] } });
197
+
198
+ /**
199
+ * Flatten a DaffTreeUi<unknown> into an array, removing elements from the array
200
+ * below nodes in the tree that are not open.
201
+ */
202
+ const flattenTree = (daffUiTree) => {
203
+ const tree = [];
204
+ let items = [
205
+ {
206
+ ...daffUiTree,
207
+ title: 'Root',
208
+ level: 0,
209
+ url: '/',
210
+ data: undefined,
211
+ open: true,
212
+ _treeRef: daffUiTree,
213
+ },
214
+ ];
215
+ while (items) {
216
+ const el = items.pop();
217
+ if (!el) {
218
+ break;
219
+ }
220
+ if (el.open) {
221
+ items = [
222
+ ...items,
223
+ ...el.items.map((i) => ({
224
+ ...i,
225
+ level: el.level + 1,
226
+ _treeRef: i,
227
+ })).reverse(),
228
+ ];
229
+ }
230
+ if (el._treeRef.parent?.open) {
231
+ tree.push({
232
+ id: el.id,
233
+ title: el.title,
234
+ level: el.level,
235
+ url: el.url,
236
+ hasChildren: el.items.length > 0,
237
+ data: undefined,
238
+ _treeRef: el._treeRef,
239
+ });
240
+ }
241
+ }
242
+ return tree;
243
+ };
244
+
245
+ /**
246
+ * Traverse the tree, pre-order, right-to-left
247
+ */
248
+ const traverse = (tree, visit, key) => {
249
+ let stack = [
250
+ tree,
251
+ ];
252
+ while (stack) {
253
+ const el = stack.pop();
254
+ if (!el) {
255
+ break;
256
+ }
257
+ visit(el);
258
+ stack = [
259
+ ...stack,
260
+ ...el[key],
261
+ ];
262
+ }
263
+ return tree;
264
+ };
265
+
266
+ const daffDataTreeToUiTree = (data, parent, open = false) => ({
267
+ id: data.id ?? data.title,
268
+ title: data.title,
269
+ url: data.url,
270
+ data: data.data,
271
+ open,
272
+ parent,
273
+ items: [],
274
+ });
275
+ /**
276
+ * This function translates the original data given to us by the client
277
+ * to the internal representation of the tree used by the {@link DaffTreeComponent}
278
+ */
279
+ const hydrateTree = (data) => {
280
+ const tree = daffDataTreeToUiTree(data, undefined, true);
281
+ let treeStack = [
282
+ tree,
283
+ ];
284
+ traverse(data, (el) => {
285
+ const treeEl = treeStack.pop();
286
+ treeEl.items = el.items.map((i) => daffDataTreeToUiTree(i, treeEl, false));
287
+ treeStack = [
288
+ ...treeStack,
289
+ ...treeEl.items,
290
+ ];
291
+ return el;
292
+ }, 'items');
293
+ return tree;
294
+ };
295
+
296
+ /**
297
+ * The `DaffTreeComponent` allows you to render tree structures as interactable ui.
298
+ *
299
+ * They can be used like:
300
+ *
301
+ * ```html
302
+ * <ul daff-tree [tree]="tree">
303
+ * <ng-template #daffTreeItemWithChildrenTpl let-node>
304
+ * <button daffTreeItem [node]="node">{{ node.title }} </button>
305
+ * </ng-template>
306
+ *
307
+ * <ng-template #daffTreeItemTpl let-node>
308
+ * <a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
309
+ * </ng-template>
310
+ * </ul>
311
+ * ```
312
+ *
313
+ * where `tree` is a {@link DaffTreeData}.
314
+ *
315
+ */
316
+ class DaffTreeComponent {
317
+ constructor(notifier) {
318
+ this.notifier = notifier;
319
+ /**
320
+ * The css class of the daff-tree.
321
+ *
322
+ * @docs-private
323
+ */
324
+ this.class = true;
325
+ /**
326
+ * The internal tree element.
327
+ */
328
+ this.tree = undefined;
329
+ /**
330
+ * The flattened tree data. You can iterate through this if you want to inspect
331
+ * the resulting array structure we computed to render the tree.
332
+ */
333
+ this.flatTree = [];
334
+ /**
335
+ * @docs-private
336
+ */
337
+ this._dataTree = undefined;
338
+ }
339
+ /**
340
+ * The tree data you would like to render.
341
+ */
342
+ get dataTree() {
343
+ return this._dataTree;
344
+ }
345
+ set dataTree(dataTree) {
346
+ if (!dataTree) {
347
+ this._dataTree = undefined;
348
+ this.tree = undefined;
349
+ this.flatTree = [];
350
+ return;
351
+ }
352
+ this._dataTree = dataTree;
353
+ this.tree = hydrateTree(this.dataTree);
354
+ this.flatTree = flattenTree(this.tree);
355
+ }
356
+ ;
357
+ /**
358
+ * The track-by function used to reduce tree-item re-renders
359
+ */
360
+ trackByTreeElement(index, el) {
361
+ return el.title;
362
+ }
363
+ /**
364
+ * @docs-private
365
+ */
366
+ ngOnInit() {
367
+ this.notifier.notice$.subscribe(() => {
368
+ this.flatTree = flattenTree(this.tree);
369
+ });
370
+ }
371
+ }
372
+ /** @nocollapse */ DaffTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeComponent, deps: [{ token: DaffTreeNotifierService }], target: i0.ɵɵFactoryTarget.Component });
373
+ /** @nocollapse */ DaffTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: DaffTreeComponent, selector: "ul[daff-tree]", inputs: { dataTree: ["tree", "dataTree"] }, host: { properties: { "class.daff-tree": "this.class" } }, providers: [
374
+ DaffTreeNotifierService,
375
+ ], queries: [{ propertyName: "withChildrenTemplate", first: true, predicate: ["daffTreeItemWithChildrenTpl"], descendants: true, static: true }, { propertyName: "treeItemTemplate", first: true, predicate: ["daffTreeItemTpl"], descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<li [attr.aria-level]=\"node.level\">\n\t\t<ng-container \n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t</ng-container>\t\n\t</li>\n</ng-container>", styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 16px}.daff-tree-item{cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;position:relative;background:none;border:0;padding:8px 16px 8px 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:4px}.daff-tree-item:focus,.daff-tree-item:focus-visible{z-index:1}.daff-tree-item.selected{font-weight:600}.daff-tree-item__parent{position:relative}.daff-tree-item__parent:after{content:\"\";position:absolute;top:48%;right:16px;display:inline-block;border-right:2px solid currentColor;border-bottom:2px solid currentColor;width:8px;height:8px;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-tree-item__parent.open:after{top:56%;transform:translateY(-50%) rotate(225deg)}\n"], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeComponent, decorators: [{
377
+ type: Component,
378
+ args: [{ selector: 'ul[daff-tree]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
379
+ DaffTreeNotifierService,
380
+ ], template: "<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<li [attr.aria-level]=\"node.level\">\n\t\t<ng-container \n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t</ng-container>\t\n\t</li>\n</ng-container>", styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 16px}.daff-tree-item{cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;position:relative;background:none;border:0;padding:8px 16px 8px 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:4px}.daff-tree-item:focus,.daff-tree-item:focus-visible{z-index:1}.daff-tree-item.selected{font-weight:600}.daff-tree-item__parent{position:relative}.daff-tree-item__parent:after{content:\"\";position:absolute;top:48%;right:16px;display:inline-block;border-right:2px solid currentColor;border-bottom:2px solid currentColor;width:8px;height:8px;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-tree-item__parent.open:after{top:56%;transform:translateY(-50%) rotate(225deg)}\n"] }]
381
+ }], ctorParameters: function () { return [{ type: DaffTreeNotifierService }]; }, propDecorators: { class: [{
382
+ type: HostBinding,
383
+ args: ['class.daff-tree']
384
+ }], dataTree: [{
385
+ type: Input,
386
+ args: ['tree']
387
+ }], withChildrenTemplate: [{
388
+ type: ContentChild,
389
+ args: ['daffTreeItemWithChildrenTpl', { static: true }]
390
+ }], treeItemTemplate: [{
391
+ type: ContentChild,
392
+ args: ['daffTreeItemTpl', { static: true }]
393
+ }] } });
394
+
395
+ class DaffTreeModule {
396
+ }
397
+ /** @nocollapse */ DaffTreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
398
+ /** @nocollapse */ DaffTreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, declarations: [DaffTreeComponent,
399
+ DaffTreeItemDirective], imports: [CommonModule], exports: [DaffTreeComponent,
400
+ DaffTreeItemDirective] });
401
+ /** @nocollapse */ DaffTreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, imports: [[
402
+ CommonModule,
403
+ ]] });
404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, decorators: [{
405
+ type: NgModule,
406
+ args: [{
407
+ declarations: [
408
+ DaffTreeComponent,
409
+ DaffTreeItemDirective,
410
+ ],
411
+ imports: [
412
+ CommonModule,
413
+ ],
414
+ exports: [
415
+ DaffTreeComponent,
416
+ DaffTreeItemDirective,
417
+ ],
418
+ }]
419
+ }] });
420
+
421
+ /**
422
+ * Transform a tree-like structure in-place into a {@link DaffTreeData}.
423
+ *
424
+ * This will mutate the original object, hydrating with additional properties.
425
+ *
426
+ * @param tree - The data structure representing tree-like data.
427
+ * @param transformFn - A user-supplied function that will transform the user
428
+ * type into a {@link DaffTreeData}
429
+ * @param key - The property of the your tree that indicates which
430
+ * key contains the "children" of your tree structure.
431
+ *
432
+ */
433
+ const daffTransformTreeInPlace = (tree, transformFn, key) => traverse(tree, (el) => {
434
+ const r = Object.assign(el, transformFn(el));
435
+ r.items = el[key];
436
+ el = r;
437
+ return el;
438
+ },
439
+ // This type is confusing. I don't understand why it has to be here,
440
+ // the associated error message is incomprehensible.
441
+ key);
442
+
443
+ /**
444
+ * Generated bundle index. Do not edit.
445
+ */
446
+
447
+ export { DaffTreeComponent, DaffTreeItemDirective, DaffTreeModule, daffTransformTreeInPlace };
448
+ //# sourceMappingURL=daffodil-design-tree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-design-tree.mjs","sources":["../../../libs/design/tree/src/tree/tree-notifier.service.ts","../../../libs/design/tree/src/tree-item/tree-item.directive.ts","../../../libs/design/tree/src/utils/flatten-tree.ts","../../../libs/design/tree/src/utils/traverse-tree.ts","../../../libs/design/tree/src/utils/hydrate-tree.ts","../../../libs/design/tree/src/tree/tree.component.ts","../../../libs/design/tree/src/tree/tree.component.html","../../../libs/design/tree/src/tree.module.ts","../../../libs/design/tree/src/utils/transform-in-place.ts","../../../libs/design/tree/src/daffodil-design-tree.ts"],"sourcesContent":["import {\n Inject,\n OnDestroy,\n} from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n/**\n * This service is used by tree-items to notify their parent\n * that the tree has to be re-computed.\n *\n * This service is a multiton associated with each tree instance.\n * It follows the same lifecycle has the tree it is associated with.\n */\n@Inject({})\nexport class DaffTreeNotifierService implements OnDestroy {\n\n /**\n * @docs-private\n */\n private _notice: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\n\n /**\n * An observable that emits when the tree needs to be re-computed.\n */\n notice$ = this._notice.asObservable();\n\n /**\n * `notify` can be called to trigger a re-computation of the tree\n * if data has changed unexpectedly and a re-render did not occur.\n *\n * This should be used sparingly. Instead, prefer updating `data` on the tree\n * itself for performance reasons.\n */\n notify() {\n this._notice.next(true);\n }\n\n /**\n * Cleanup when the tree is destroyed.\n *\n * @docs-private\n */\n ngOnDestroy(): void {\n this._notice.complete();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n HostBinding,\n HostListener,\n Inject,\n Input,\n} from '@angular/core';\n\nimport { DaffTreeNotifierService } from '../tree/tree-notifier.service';\nimport { DaffTreeFlatNode } from '../utils/flatten-tree';\n\n/**\n * The `DaffTreeItemDirective` allows you to demarcate the elements which are\n * tree-children that interact with the parent tree.\n *\n * They can be used like:\n *\n * ```html\n * <ul daff-tree [tree]=\"tree\">\n * <ng-template #daffTreeItemWithChildrenTpl let-node>\n * <button daffTreeItem [node]=\"node\">{{ node.title }} </button>\n * </ng-template>\n *\n * <ng-template #daffTreeItemTpl let-node>\n * <a daffTreeItem [node]=\"node\" [routerLink]=\"node.url\">{{ node.title }}</a>\n * </ng-template>\n * </ul>\n * ```\n *\n * where `tree` is a {@link DaffTreeData} and `daff-tree` is a {@link DaffTreeComponent}.\n *\n */\n@Directive({\n selector: '[daffTreeItem]',\n})\nexport class DaffTreeItemDirective {\n\n /**\n * The css class of the daff-tree.\n *\n * @docs-private\n */\n @HostBinding('class.daff-tree-item') class = true;\n\n /**\n * The css class of a DaffTreeItemDirective that has children.\n *\n * @docs-private\n */\n @HostBinding('class.daff-tree-item__parent') classParent = false;\n\n /**\n * The html `id` of the tree item. This is derived from the {@link DaffTreeData}.\n *\n * @docs-private\n */\n @HostBinding('attr.id') id;\n\n /**\n * Accessibility property, notifying users about whether\n * or not the tree item is open.\n *\n * @docs-private\n */\n @HostBinding('attr.aria-expanded') ariaExpanded: string;\n\n /**\n * A css variable indicating the depth of the tree.\n * You can use this to style your templates if you want to\n * use different designs at different depths.\n */\n @HostBinding('style.--depth') depth: number;\n\n /**\n * The CSS class indicating whether or not the tree is `selected`.\n */\n @HostBinding('class.selected') get selectedClass() {\n return this.selected;\n };\n\n /**\n * The CSS class indicating whether or not the tree is `open`.\n */\n @HostBinding('class.open') openClass = false;\n\n /**\n * The {@link DaffTreeFlatNode} associated with this specific tree item.\n *\n * @docs-private\n */\n private _node: DaffTreeFlatNode;\n\n /**\n * The {@link DaffTreeFlatNode} associated with this specific tree item.\n */\n @Input()\n get node() {\n return this._node;\n };\n set node(val: DaffTreeFlatNode) {\n this._node = val;\n this.id = 'tree-' + this._node.id;\n this.ariaExpanded = this._node._treeRef.open ? 'true' : 'false';\n this.depth = this._node.level;\n this.classParent = this._node.hasChildren;\n this.openClass = this._node._treeRef.open;\n }\n\n /**\n * Whether or not the tree item is the currently active item.\n * Note that there is no requirement there there only be one active item at a time.\n */\n @Input() selected = false;\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n private treeNotifier: DaffTreeNotifierService,\n ) {}\n\n /**\n * @docs-private\n */\n @HostListener('keydown.escape')\n onEscape() {\n this.toggleParent(this.node);\n }\n\n /**\n * @docs-private\n */\n @HostListener('click')\n onClick() {\n if(this.node.hasChildren) {\n this.toggleTree(this.node);\n }\n this.treeNotifier.notify();\n }\n\n /**\n * Toggle the open state of the tree's parent.\n */\n toggleParent(node: DaffTreeFlatNode) {\n if(node._treeRef?.parent.parent === undefined) {\n return;\n }\n node._treeRef.parent.open = !node._treeRef.parent.open;\n (<Document>this.document).getElementById('tree-' + node._treeRef.parent.id).focus();\n }\n\n /**\n * Toggle the open state of this specific subtree tree.\n */\n toggleTree(node: DaffTreeFlatNode) {\n if(node._treeRef.open === false) {\n node._treeRef.open = true;\n } else {\n node._treeRef.open = false;\n }\n }\n}\n","import { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * A flattened node of a tree. This is used when translating the tree data\n * structure into an array.\n */\nexport interface DaffTreeFlatNode {\n id: number | string;\n title: string;\n url: string;\n level: number;\n hasChildren: boolean;\n data: unknown;\n _treeRef: DaffTreeUi<unknown>;\n}\n\n/**\n * Flatten a DaffTreeUi<unknown> into an array, removing elements from the array\n * below nodes in the tree that are not open.\n */\nexport const flattenTree = (daffUiTree: DaffTreeUi<unknown>): DaffTreeFlatNode[] => {\n const tree: DaffTreeFlatNode[] = [];\n\n let items = [\n {\n ...daffUiTree,\n title: 'Root',\n level: 0,\n url: '/',\n data: undefined,\n open: true,\n _treeRef: daffUiTree,\n },\n ];\n\n\n while(items) {\n const el = items.pop();\n if(!el) {\n break;\n }\n\n if(el.open) {\n items = [\n ...items,\n ...el.items.map((i) => ({\n ...i,\n level:\n el.level + 1,\n _treeRef: i,\n })).reverse(),\n ];\n }\n\n if(el._treeRef.parent?.open) {\n tree.push({\n id: el.id,\n title: el.title,\n level: el.level,\n url : el.url,\n hasChildren: el.items.length > 0,\n data: undefined,\n _treeRef: el._treeRef,\n });\n }\n }\n\n return tree;\n};\n","import { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\n\n/**\n * Traverse the tree, pre-order, right-to-left\n */\nexport const traverse = <T extends Record<any, any>, V extends Record<any, any> = T>(\n tree: T,\n visit: (tree: T) => V,\n key: RecursiveTreeKeyOfType<T>,\n): V => {\n let stack = [\n tree,\n ];\n\n while(stack) {\n const el = stack.pop();\n if(!el) {\n break;\n }\n\n visit(el);\n\n stack = [\n ...stack,\n ...<T[]><unknown>el[key],\n ];\n }\n\n return tree;\n};\n","import { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\nimport { traverse } from './traverse-tree';\n\nexport const daffDataTreeToUiTree = <T>(data: DaffTreeData<T>, parent: DaffTreeUi<T>, open: boolean = false): DaffTreeUi<T> => ({\n id: data.id ?? data.title,\n title: data.title,\n url: data.url,\n data: data.data,\n open,\n parent,\n items: [],\n});\n\n/**\n * This function translates the original data given to us by the client\n * to the internal representation of the tree used by the {@link DaffTreeComponent}\n */\nexport const hydrateTree = <T>(data: DaffTreeData<T>): DaffTreeUi<T> => {\n const tree = daffDataTreeToUiTree(data, undefined, true);\n\n let treeStack = [\n tree,\n ];\n\n traverse(data, (el) => {\n const treeEl = treeStack.pop();\n treeEl.items = el.items.map((i) => daffDataTreeToUiTree(i, treeEl, false));\n treeStack = [\n ...treeStack,\n ...treeEl.items,\n ];\n return el;\n }, 'items');\n\n return tree;\n};\n","import { Location } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n HostBinding,\n Input,\n OnInit,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\nimport {\n DaffTreeFlatNode,\n flattenTree,\n} from '../utils/flatten-tree';\nimport { hydrateTree } from '../utils/hydrate-tree';\nimport { DaffTreeNotifierService } from './tree-notifier.service';\n\n/**\n * The `DaffTreeComponent` allows you to render tree structures as interactable ui.\n *\n * They can be used like:\n *\n * ```html\n * <ul daff-tree [tree]=\"tree\">\n * <ng-template #daffTreeItemWithChildrenTpl let-node>\n * <button daffTreeItem [node]=\"node\">{{ node.title }} </button>\n * </ng-template>\n *\n * <ng-template #daffTreeItemTpl let-node>\n * <a daffTreeItem [node]=\"node\" [routerLink]=\"node.url\">{{ node.title }}</a>\n * </ng-template>\n * </ul>\n * ```\n *\n * where `tree` is a {@link DaffTreeData}.\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'ul[daff-tree]',\n templateUrl: './tree.component.html',\n styleUrls: ['./tree.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n DaffTreeNotifierService,\n ],\n})\nexport class DaffTreeComponent implements OnInit {\n\n /**\n * The css class of the daff-tree.\n *\n * @docs-private\n */\n @HostBinding('class.daff-tree') class = true;\n\n /**\n * The internal tree element.\n */\n private tree: DaffTreeUi<unknown> = undefined;\n\n /**\n * The flattened tree data. You can iterate through this if you want to inspect\n * the resulting array structure we computed to render the tree.\n */\n public flatTree: DaffTreeFlatNode[] = [];\n\n /**\n * @docs-private\n */\n private _dataTree: DaffTreeData<unknown> = undefined;\n\n /**\n * The tree data you would like to render.\n */\n @Input('tree')\n get dataTree() {\n return this._dataTree;\n }\n set dataTree(dataTree: DaffTreeData<unknown>){\n if(!dataTree) {\n this._dataTree = undefined;\n this.tree = undefined;\n this.flatTree = [];\n return;\n }\n this._dataTree = dataTree;\n this.tree = hydrateTree(this.dataTree);\n this.flatTree = flattenTree(this.tree);\n };\n\n /**\n * The template used to render tree-nodes that themselves have children.\n *\n * @docs-private\n */\n @ContentChild('daffTreeItemWithChildrenTpl', { static: true })\n withChildrenTemplate: TemplateRef<any>;\n\n /**\n * The template used to render tree-nodes that have no children.\n *\n * @docs-private\n */\n @ContentChild('daffTreeItemTpl', { static: true }) treeItemTemplate: TemplateRef<any>;\n\n constructor(\n private notifier: DaffTreeNotifierService,\n ) {}\n\n /**\n * The track-by function used to reduce tree-item re-renders\n */\n trackByTreeElement(index: number, el: any): any {\n return el.title;\n }\n\n /**\n * @docs-private\n */\n ngOnInit(): void {\n this.notifier.notice$.subscribe(() => {\n this.flatTree = flattenTree(this.tree);\n });\n }\n}\n","<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<li [attr.aria-level]=\"node.level\">\n\t\t<ng-container \n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t</ng-container>\t\n\t</li>\n</ng-container>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\nimport { DaffTreeComponent } from './tree/tree.component';\n\n@NgModule({\n declarations: [\n DaffTreeComponent,\n DaffTreeItemDirective,\n ],\n imports: [\n CommonModule,\n ],\n exports: [\n DaffTreeComponent,\n DaffTreeItemDirective,\n ],\n})\nexport class DaffTreeModule { }\n","import { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { traverse } from './traverse-tree';\n\n/**\n * Transform a tree-like structure in-place into a {@link DaffTreeData}.\n *\n * This will mutate the original object, hydrating with additional properties.\n *\n * @param tree - The data structure representing tree-like data.\n * @param transformFn - A user-supplied function that will transform the user\n * type into a {@link DaffTreeData}\n * @param key - The property of the your tree that indicates which\n * key contains the \"children\" of your tree structure.\n *\n */\nexport const daffTransformTreeInPlace = <\n // eslint-disable-next-line @typescript-eslint/ban-types\n T extends Record<any,any>,\n>(\n tree: T,\n transformFn: (type: T) => T & DaffTreeData<unknown>,\n key: RecursiveTreeKeyOfType<T>,\n): DaffTreeData<unknown> => traverse<T, T & DaffTreeData<unknown>>(\n tree,\n (el) => {\n const r = Object.assign(el, transformFn(el));\n r.items = el[key];\n el = r;\n return <T & DaffTreeData<unknown>>el;\n },\n // This type is confusing. I don't understand why it has to be here,\n // the associated error message is incomprehensible.\n <T[string] extends T[] ? string : never>key,\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffTreeNotifierService"],"mappings":";;;;;;;AAMA;;;;;;AAMG;AAEH,IAAa,uBAAuB,GAApC,MAAa,uBAAuB,CAAA;AAApC,IAAA,WAAA,GAAA;AAEE;;AAEG;AACK,QAAA,IAAA,CAAA,OAAO,GAA6B,IAAI,eAAe,CAAU,IAAI,CAAC,CAAC;AAE/E;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;KAqBvC;AAnBC;;;;;;AAMG;IACH,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACzB;AAED;;;;AAIG;IACH,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;KACzB;CACF,CAAA;AA/BY,uBAAuB,GAAA,UAAA,CAAA;IADnC,MAAM,CAAC,EAAE,CAAC;AACE,CAAA,EAAA,uBAAuB,CA+BnC;;ACjCD;;;;;;;;;;;;;;;;;;;;AAoBG;MAIU,qBAAqB,CAAA;IA+EhC,WAC4B,CAAA,QAAa,EAC/B,YAAqC,EAAA;QADnB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAK;QAC/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