@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,443 @@
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
+ var _a;
138
+ if (((_a = node._treeRef) === null || _a === void 0 ? void 0 : _a.parent.parent) === undefined) {
139
+ return;
140
+ }
141
+ node._treeRef.parent.open = !node._treeRef.parent.open;
142
+ this.document.getElementById('tree-' + node._treeRef.parent.id).focus();
143
+ }
144
+ /**
145
+ * Toggle the open state of this specific subtree tree.
146
+ */
147
+ toggleTree(node) {
148
+ if (node._treeRef.open === false) {
149
+ node._treeRef.open = true;
150
+ }
151
+ else {
152
+ node._treeRef.open = false;
153
+ }
154
+ }
155
+ }
156
+ /** @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 });
157
+ /** @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 });
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeItemDirective, decorators: [{
159
+ type: Directive,
160
+ args: [{
161
+ selector: '[daffTreeItem]',
162
+ }]
163
+ }], ctorParameters: function () {
164
+ return [{ type: undefined, decorators: [{
165
+ type: Inject,
166
+ args: [DOCUMENT]
167
+ }] }, { type: DaffTreeNotifierService }];
168
+ }, propDecorators: { class: [{
169
+ type: HostBinding,
170
+ args: ['class.daff-tree-item']
171
+ }], classParent: [{
172
+ type: HostBinding,
173
+ args: ['class.daff-tree-item__parent']
174
+ }], id: [{
175
+ type: HostBinding,
176
+ args: ['attr.id']
177
+ }], ariaExpanded: [{
178
+ type: HostBinding,
179
+ args: ['attr.aria-expanded']
180
+ }], depth: [{
181
+ type: HostBinding,
182
+ args: ['style.--depth']
183
+ }], selectedClass: [{
184
+ type: HostBinding,
185
+ args: ['class.selected']
186
+ }], openClass: [{
187
+ type: HostBinding,
188
+ args: ['class.open']
189
+ }], node: [{
190
+ type: Input
191
+ }], selected: [{
192
+ type: Input
193
+ }], onEscape: [{
194
+ type: HostListener,
195
+ args: ['keydown.escape']
196
+ }], onClick: [{
197
+ type: HostListener,
198
+ args: ['click']
199
+ }] } });
200
+
201
+ /**
202
+ * Flatten a DaffTreeUi<unknown> into an array, removing elements from the array
203
+ * below nodes in the tree that are not open.
204
+ */
205
+ const flattenTree = (daffUiTree) => {
206
+ var _a;
207
+ const tree = [];
208
+ let items = [
209
+ Object.assign(Object.assign({}, daffUiTree), { title: 'Root', level: 0, url: '/', data: undefined, open: true, _treeRef: daffUiTree }),
210
+ ];
211
+ while (items) {
212
+ const el = items.pop();
213
+ if (!el) {
214
+ break;
215
+ }
216
+ if (el.open) {
217
+ items = [
218
+ ...items,
219
+ ...el.items.map((i) => (Object.assign(Object.assign({}, i), { level: el.level + 1, _treeRef: i }))).reverse(),
220
+ ];
221
+ }
222
+ if ((_a = el._treeRef.parent) === null || _a === void 0 ? void 0 : _a.open) {
223
+ tree.push({
224
+ id: el.id,
225
+ title: el.title,
226
+ level: el.level,
227
+ url: el.url,
228
+ hasChildren: el.items.length > 0,
229
+ data: undefined,
230
+ _treeRef: el._treeRef,
231
+ });
232
+ }
233
+ }
234
+ return tree;
235
+ };
236
+
237
+ /**
238
+ * Traverse the tree, pre-order, right-to-left
239
+ */
240
+ const traverse = (tree, visit, key) => {
241
+ let stack = [
242
+ tree,
243
+ ];
244
+ while (stack) {
245
+ const el = stack.pop();
246
+ if (!el) {
247
+ break;
248
+ }
249
+ visit(el);
250
+ stack = [
251
+ ...stack,
252
+ ...el[key],
253
+ ];
254
+ }
255
+ return tree;
256
+ };
257
+
258
+ const daffDataTreeToUiTree = (data, parent, open = false) => {
259
+ var _a;
260
+ return ({
261
+ id: (_a = data.id) !== null && _a !== void 0 ? _a : data.title,
262
+ title: data.title,
263
+ url: data.url,
264
+ data: data.data,
265
+ open,
266
+ parent,
267
+ items: [],
268
+ });
269
+ };
270
+ /**
271
+ * This function translates the original data given to us by the client
272
+ * to the internal representation of the tree used by the {@link DaffTreeComponent}
273
+ */
274
+ const hydrateTree = (data) => {
275
+ const tree = daffDataTreeToUiTree(data, undefined, true);
276
+ let treeStack = [
277
+ tree,
278
+ ];
279
+ traverse(data, (el) => {
280
+ const treeEl = treeStack.pop();
281
+ treeEl.items = el.items.map((i) => daffDataTreeToUiTree(i, treeEl, false));
282
+ treeStack = [
283
+ ...treeStack,
284
+ ...treeEl.items,
285
+ ];
286
+ return el;
287
+ }, 'items');
288
+ return tree;
289
+ };
290
+
291
+ /**
292
+ * The `DaffTreeComponent` allows you to render tree structures as interactable ui.
293
+ *
294
+ * They can be used like:
295
+ *
296
+ * ```html
297
+ * <ul daff-tree [tree]="tree">
298
+ * <ng-template #daffTreeItemWithChildrenTpl let-node>
299
+ * <button daffTreeItem [node]="node">{{ node.title }} </button>
300
+ * </ng-template>
301
+ *
302
+ * <ng-template #daffTreeItemTpl let-node>
303
+ * <a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a>
304
+ * </ng-template>
305
+ * </ul>
306
+ * ```
307
+ *
308
+ * where `tree` is a {@link DaffTreeData}.
309
+ *
310
+ */
311
+ class DaffTreeComponent {
312
+ constructor(notifier) {
313
+ this.notifier = notifier;
314
+ /**
315
+ * The css class of the daff-tree.
316
+ *
317
+ * @docs-private
318
+ */
319
+ this.class = true;
320
+ /**
321
+ * The internal tree element.
322
+ */
323
+ this.tree = undefined;
324
+ /**
325
+ * The flattened tree data. You can iterate through this if you want to inspect
326
+ * the resulting array structure we computed to render the tree.
327
+ */
328
+ this.flatTree = [];
329
+ /**
330
+ * @docs-private
331
+ */
332
+ this._dataTree = undefined;
333
+ }
334
+ /**
335
+ * The tree data you would like to render.
336
+ */
337
+ get dataTree() {
338
+ return this._dataTree;
339
+ }
340
+ set dataTree(dataTree) {
341
+ if (!dataTree) {
342
+ this._dataTree = undefined;
343
+ this.tree = undefined;
344
+ this.flatTree = [];
345
+ return;
346
+ }
347
+ this._dataTree = dataTree;
348
+ this.tree = hydrateTree(this.dataTree);
349
+ this.flatTree = flattenTree(this.tree);
350
+ }
351
+ ;
352
+ /**
353
+ * The track-by function used to reduce tree-item re-renders
354
+ */
355
+ trackByTreeElement(index, el) {
356
+ return el.title;
357
+ }
358
+ /**
359
+ * @docs-private
360
+ */
361
+ ngOnInit() {
362
+ this.notifier.notice$.subscribe(() => {
363
+ this.flatTree = flattenTree(this.tree);
364
+ });
365
+ }
366
+ }
367
+ /** @nocollapse */ DaffTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeComponent, deps: [{ token: DaffTreeNotifierService }], target: i0.ɵɵFactoryTarget.Component });
368
+ /** @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: [
369
+ DaffTreeNotifierService,
370
+ ], 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 });
371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeComponent, decorators: [{
372
+ type: Component,
373
+ args: [{ selector: 'ul[daff-tree]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
374
+ DaffTreeNotifierService,
375
+ ], 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"] }]
376
+ }], ctorParameters: function () { return [{ type: DaffTreeNotifierService }]; }, propDecorators: { class: [{
377
+ type: HostBinding,
378
+ args: ['class.daff-tree']
379
+ }], dataTree: [{
380
+ type: Input,
381
+ args: ['tree']
382
+ }], withChildrenTemplate: [{
383
+ type: ContentChild,
384
+ args: ['daffTreeItemWithChildrenTpl', { static: true }]
385
+ }], treeItemTemplate: [{
386
+ type: ContentChild,
387
+ args: ['daffTreeItemTpl', { static: true }]
388
+ }] } });
389
+
390
+ class DaffTreeModule {
391
+ }
392
+ /** @nocollapse */ DaffTreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
393
+ /** @nocollapse */ DaffTreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, declarations: [DaffTreeComponent,
394
+ DaffTreeItemDirective], imports: [CommonModule], exports: [DaffTreeComponent,
395
+ DaffTreeItemDirective] });
396
+ /** @nocollapse */ DaffTreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, imports: [[
397
+ CommonModule,
398
+ ]] });
399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTreeModule, decorators: [{
400
+ type: NgModule,
401
+ args: [{
402
+ declarations: [
403
+ DaffTreeComponent,
404
+ DaffTreeItemDirective,
405
+ ],
406
+ imports: [
407
+ CommonModule,
408
+ ],
409
+ exports: [
410
+ DaffTreeComponent,
411
+ DaffTreeItemDirective,
412
+ ],
413
+ }]
414
+ }] });
415
+
416
+ /**
417
+ * Transform a tree-like structure in-place into a {@link DaffTreeData}.
418
+ *
419
+ * This will mutate the original object, hydrating with additional properties.
420
+ *
421
+ * @param tree - The data structure representing tree-like data.
422
+ * @param transformFn - A user-supplied function that will transform the user
423
+ * type into a {@link DaffTreeData}
424
+ * @param key - The property of the your tree that indicates which
425
+ * key contains the "children" of your tree structure.
426
+ *
427
+ */
428
+ const daffTransformTreeInPlace = (tree, transformFn, key) => traverse(tree, (el) => {
429
+ const r = Object.assign(el, transformFn(el));
430
+ r.items = el[key];
431
+ el = r;
432
+ return el;
433
+ },
434
+ // This type is confusing. I don't understand why it has to be here,
435
+ // the associated error message is incomprehensible.
436
+ key);
437
+
438
+ /**
439
+ * Generated bundle index. Do not edit.
440
+ */
441
+
442
+ export { DaffTreeComponent, DaffTreeItemDirective, DaffTreeModule, daffTransformTreeInPlace };
443
+ //# 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;QACK,IAAA,CAAA,OAAO,GAA6B,IAAI,eAAe,CAAU,IAAI,CAAC,CAAC;AAE/E;;AAEG;QACH,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;CACE,EAAA,uBAAuB,CA+BnC;;ACjCD;;;;;;;;;;;;;;;;;;;;AAoBG;MAIU,qBAAqB,CAAA;IA+EhC,WAC4B,CAAA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