@daffodil/design 0.68.1 → 0.70.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/atoms/progress-indicator/progress-indicator.component.d.ts +2 -1
- package/esm2022/atoms/progress-indicator/progress-indicator.component.mjs +3 -2
- package/esm2022/progress-bar/animation/progress-bar-animation.mjs +9 -0
- package/esm2022/progress-bar/daffodil-design-progress-bar.mjs +5 -0
- package/esm2022/progress-bar/examples/daffodil-design-progress-bar-examples.mjs +5 -0
- package/esm2022/progress-bar/examples/index.mjs +2 -0
- package/esm2022/progress-bar/examples/progress-bar-default/progress-bar-default.component.mjs +12 -0
- package/esm2022/progress-bar/examples/progress-bar-default/progress-bar-default.module.mjs +24 -0
- package/esm2022/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.component.mjs +12 -0
- package/esm2022/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.module.mjs +24 -0
- package/esm2022/progress-bar/examples/progress-bar-themes/progress-bar-themes.component.mjs +18 -0
- package/esm2022/progress-bar/examples/progress-bar-themes/progress-bar-themes.module.mjs +28 -0
- package/esm2022/progress-bar/examples/public_api.mjs +12 -0
- package/esm2022/progress-bar/progress-bar.component.mjs +142 -0
- package/esm2022/progress-bar/progress-bar.module.mjs +24 -0
- package/esm2022/progress-bar/public_api.mjs +3 -0
- package/esm2022/public_api.mjs +1 -2
- package/esm2022/sidebar/public_api.mjs +2 -1
- package/esm2022/sidebar/sidebar-viewport/sidebar-viewport.component.mjs +12 -4
- package/esm2022/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation-state.mjs +2 -0
- package/esm2022/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation.mjs +20 -0
- package/esm2022/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.mjs +91 -0
- package/esm2022/sidebar/sidebar.module.mjs +10 -9
- package/esm2022/tree/examples/basic-tree/basic-tree.component.mjs +1 -1
- package/esm2022/tree/interfaces/tree-render-mode.mjs +2 -0
- package/esm2022/tree/public_api.mjs +2 -1
- package/esm2022/tree/tree/tree.component.mjs +43 -36
- package/esm2022/tree/utils/flatten-tree.mjs +26 -14
- package/esm2022/tree/utils/transform.mjs +25 -0
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +113 -0
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-progress-bar.mjs +178 -0
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -0
- package/fesm2022/daffodil-design-sidebar.mjs +131 -14
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +1 -1
- package/fesm2022/daffodil-design-tree-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +92 -48
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +3 -126
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/package.json +1 -1
- package/progress-bar/README.md +27 -0
- package/progress-bar/animation/progress-bar-animation.d.ts +4 -0
- package/progress-bar/examples/index.d.ts +1 -0
- package/progress-bar/examples/progress-bar-default/progress-bar-default.component.d.ts +5 -0
- package/progress-bar/examples/progress-bar-default/progress-bar-default.module.d.ts +8 -0
- package/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.component.d.ts +5 -0
- package/progress-bar/examples/progress-bar-indeterminate/progress-bar-indeterminate.module.d.ts +8 -0
- package/progress-bar/examples/progress-bar-themes/progress-bar-themes.component.d.ts +9 -0
- package/progress-bar/examples/progress-bar-themes/progress-bar-themes.module.d.ts +9 -0
- package/progress-bar/examples/public_api.d.ts +2 -0
- package/progress-bar/index.d.ts +5 -0
- package/progress-bar/progress-bar.component.d.ts +76 -0
- package/progress-bar/progress-bar.module.d.ts +8 -0
- package/progress-bar/public_api.d.ts +2 -0
- package/progress-bar/src/progress-bar-theme.scss +68 -0
- package/public_api.d.ts +0 -1
- package/scss/theme.scss +2 -0
- package/sidebar/public_api.d.ts +1 -0
- package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +3 -2
- package/sidebar/sidebar-viewport-backdrop/animation/backdrop-animation-state.d.ts +2 -0
- package/{molecules/backdrop → sidebar/sidebar-viewport-backdrop}/animation/backdrop-animation.d.ts +1 -1
- package/{molecules/backdrop/backdrop/backdrop.component.d.ts → sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts} +5 -5
- package/sidebar/sidebar.module.d.ts +4 -4
- package/tree/README.md +1 -3
- package/tree/interfaces/tree-render-mode.d.ts +6 -0
- package/tree/public_api.d.ts +2 -0
- package/tree/tree/tree.component.d.ts +33 -11
- package/tree/utils/flatten-tree.d.ts +2 -1
- package/tree/utils/transform.d.ts +13 -0
- package/esm2022/molecules/backdrop/animation/backdrop-animation-state.mjs +0 -2
- package/esm2022/molecules/backdrop/animation/backdrop-animation.mjs +0 -20
- package/esm2022/molecules/backdrop/backdrop/backdrop.component.mjs +0 -87
- package/esm2022/molecules/backdrop/backdrop.module.mjs +0 -24
- package/esm2022/molecules/backdrop/public_api.mjs +0 -3
- package/molecules/backdrop/animation/backdrop-animation-state.d.ts +0 -2
- package/molecules/backdrop/backdrop.module.d.ts +0 -8
- package/molecules/backdrop/public_api.d.ts +0 -2
@@ -2,6 +2,7 @@ import * as i2 from '@angular/common';
|
|
2
2
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, Input, ContentChild, Directive, HostListener, NgModule } from '@angular/core';
|
5
|
+
import { daffArticleEncapsulatedMixin } from '@daffodil/design';
|
5
6
|
import { __decorate } from 'tslib';
|
6
7
|
import { BehaviorSubject } from 'rxjs';
|
7
8
|
|
@@ -50,14 +51,15 @@ DaffTreeNotifierService = __decorate([
|
|
50
51
|
* Flatten a DaffTreeUi<unknown> into an array, removing elements from the array
|
51
52
|
* below nodes in the tree that are not open.
|
52
53
|
*/
|
53
|
-
const flattenTree = (daffUiTree) => {
|
54
|
+
const flattenTree = (daffUiTree, removeNodes = false) => {
|
54
55
|
const tree = [];
|
56
|
+
if (!daffUiTree) {
|
57
|
+
return [];
|
58
|
+
}
|
55
59
|
let items = [
|
56
60
|
{
|
57
61
|
...daffUiTree,
|
58
|
-
title: 'Root',
|
59
62
|
level: 0,
|
60
|
-
url: '/',
|
61
63
|
data: undefined,
|
62
64
|
open: true,
|
63
65
|
_treeRef: daffUiTree,
|
@@ -68,22 +70,33 @@ const flattenTree = (daffUiTree) => {
|
|
68
70
|
if (!el) {
|
69
71
|
break;
|
70
72
|
}
|
71
|
-
|
72
|
-
items
|
73
|
-
|
74
|
-
...
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
73
|
+
items = [
|
74
|
+
...items,
|
75
|
+
...el.items.map((i) => ({
|
76
|
+
...i,
|
77
|
+
level: el.level + 1,
|
78
|
+
_treeRef: i,
|
79
|
+
})).reverse(),
|
80
|
+
];
|
81
|
+
if (!removeNodes && el._treeRef.parent) {
|
82
|
+
tree.push({
|
83
|
+
id: el.id,
|
84
|
+
title: el.title,
|
85
|
+
level: el.level,
|
86
|
+
url: el.url,
|
87
|
+
visible: el._treeRef.parent?.open,
|
88
|
+
hasChildren: el.items.length > 0,
|
89
|
+
data: undefined,
|
90
|
+
_treeRef: el._treeRef,
|
91
|
+
});
|
80
92
|
}
|
81
|
-
if (el._treeRef.parent?.open) {
|
93
|
+
else if (removeNodes && el._treeRef.parent?.open) {
|
82
94
|
tree.push({
|
83
95
|
id: el.id,
|
84
96
|
title: el.title,
|
85
97
|
level: el.level,
|
86
98
|
url: el.url,
|
99
|
+
visible: el._treeRef.parent?.open,
|
87
100
|
hasChildren: el.items.length > 0,
|
88
101
|
data: undefined,
|
89
102
|
_treeRef: el._treeRef,
|
@@ -144,6 +157,16 @@ const hydrateTree = (data) => {
|
|
144
157
|
return tree;
|
145
158
|
};
|
146
159
|
|
160
|
+
/**
|
161
|
+
* An _elementRef and an instance of renderer2 are needed for the list mixins
|
162
|
+
*/
|
163
|
+
class DaffTreeBase {
|
164
|
+
constructor(_elementRef, _renderer) {
|
165
|
+
this._elementRef = _elementRef;
|
166
|
+
this._renderer = _renderer;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
const _daffTreeBase = daffArticleEncapsulatedMixin((DaffTreeBase));
|
147
170
|
/**
|
148
171
|
* The `DaffTreeComponent` allows you to render tree structures as interactable ui.
|
149
172
|
*
|
@@ -164,27 +187,12 @@ const hydrateTree = (data) => {
|
|
164
187
|
* where `tree` is a {@link DaffTreeData}.
|
165
188
|
*
|
166
189
|
*/
|
167
|
-
class DaffTreeComponent {
|
168
|
-
|
169
|
-
|
170
|
-
*/
|
171
|
-
get dataTree() {
|
172
|
-
return this._dataTree;
|
173
|
-
}
|
174
|
-
set dataTree(dataTree) {
|
175
|
-
if (!dataTree) {
|
176
|
-
this._dataTree = undefined;
|
177
|
-
this.tree = undefined;
|
178
|
-
this.flatTree = [];
|
179
|
-
return;
|
180
|
-
}
|
181
|
-
this._dataTree = dataTree;
|
182
|
-
this.tree = hydrateTree(this.dataTree);
|
183
|
-
this.flatTree = flattenTree(this.tree);
|
184
|
-
}
|
185
|
-
;
|
186
|
-
constructor(notifier) {
|
190
|
+
class DaffTreeComponent extends _daffTreeBase {
|
191
|
+
constructor(notifier, elementRef, renderer) {
|
192
|
+
super(elementRef, renderer);
|
187
193
|
this.notifier = notifier;
|
194
|
+
this.elementRef = elementRef;
|
195
|
+
this.renderer = renderer;
|
188
196
|
/**
|
189
197
|
* The css class of the daff-tree.
|
190
198
|
*
|
@@ -194,16 +202,26 @@ class DaffTreeComponent {
|
|
194
202
|
/**
|
195
203
|
* The internal tree element.
|
196
204
|
*/
|
197
|
-
this.
|
205
|
+
this._tree = undefined;
|
198
206
|
/**
|
199
207
|
* The flattened tree data. You can iterate through this if you want to inspect
|
200
208
|
* the resulting array structure we computed to render the tree.
|
201
209
|
*/
|
202
210
|
this.flatTree = [];
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
211
|
+
}
|
212
|
+
ngOnChanges(changes) {
|
213
|
+
if (!changes.tree.currentValue) {
|
214
|
+
this._tree = undefined;
|
215
|
+
this.flatTree = [];
|
216
|
+
return;
|
217
|
+
}
|
218
|
+
if (changes.renderMode && !changes.tree) {
|
219
|
+
this.flatTree = flattenTree(this._tree, changes.renderMode.currentValue === 'not-in-dom');
|
220
|
+
}
|
221
|
+
else if (changes.renderMode || changes.tree) {
|
222
|
+
this._tree = hydrateTree(changes.tree?.currentValue ?? this.tree);
|
223
|
+
this.flatTree = flattenTree(this._tree, (changes.renderMode?.currentValue ?? this.renderMode) === 'not-in-dom');
|
224
|
+
}
|
207
225
|
}
|
208
226
|
/**
|
209
227
|
* The track-by function used to reduce tree-item re-renders
|
@@ -216,25 +234,26 @@ class DaffTreeComponent {
|
|
216
234
|
*/
|
217
235
|
ngOnInit() {
|
218
236
|
this.notifier.notice$.subscribe(() => {
|
219
|
-
this.flatTree = flattenTree(this.
|
237
|
+
this.flatTree = flattenTree(this._tree, this.renderMode === 'not-in-dom');
|
220
238
|
});
|
221
239
|
}
|
222
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffTreeComponent, deps: [{ token: DaffTreeNotifierService }], target: i0.ɵɵFactoryTarget.Component }); }
|
223
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: DaffTreeComponent, selector: "ul[daff-tree]", inputs: {
|
240
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffTreeComponent, deps: [{ token: DaffTreeNotifierService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
241
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: DaffTreeComponent, selector: "ul[daff-tree]", inputs: { renderMode: "renderMode", tree: "tree" }, host: { properties: { "class.daff-tree": "this.class" } }, providers: [
|
224
242
|
DaffTreeNotifierService,
|
225
|
-
], 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
|
243
|
+
], queries: [{ propertyName: "withChildrenTemplate", first: true, predicate: ["daffTreeItemWithChildrenTpl"], descendants: true, static: true }, { propertyName: "treeItemTemplate", first: true, predicate: ["daffTreeItemTpl"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<ng-container>\n\t\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t\t</ng-container>\n\t\t</li>\n\t</ng-container>\n</ng-container>", styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 16px}.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: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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
226
244
|
}
|
227
245
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffTreeComponent, decorators: [{
|
228
246
|
type: Component,
|
229
247
|
args: [{ selector: 'ul[daff-tree]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
230
248
|
DaffTreeNotifierService,
|
231
|
-
], template: "<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<li [attr.aria-level]=\"node.level\">\n\t\t<ng-container
|
232
|
-
}], ctorParameters: () => [{ type: DaffTreeNotifierService }], propDecorators: { class: [{
|
249
|
+
], template: "<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<ng-container>\n\t\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t\t</ng-container>\n\t\t</li>\n\t</ng-container>\n</ng-container>", styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 16px}.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: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"] }]
|
250
|
+
}], ctorParameters: () => [{ type: DaffTreeNotifierService }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { class: [{
|
233
251
|
type: HostBinding,
|
234
252
|
args: ['class.daff-tree']
|
235
|
-
}],
|
236
|
-
type: Input
|
237
|
-
|
253
|
+
}], renderMode: [{
|
254
|
+
type: Input
|
255
|
+
}], tree: [{
|
256
|
+
type: Input
|
238
257
|
}], withChildrenTemplate: [{
|
239
258
|
type: ContentChild,
|
240
259
|
args: ['daffTreeItemWithChildrenTpl', { static: true }]
|
@@ -438,9 +457,34 @@ const daffTransformTreeInPlace = (tree, transformFn, key) => traverse(tree, (el)
|
|
438
457
|
// the associated error message is incomprehensible.
|
439
458
|
key);
|
440
459
|
|
460
|
+
/**
|
461
|
+
* Transform a tree-like structure into a {@link DaffTreeData}.
|
462
|
+
*
|
463
|
+
* @param tree - The data structure representing tree-like data.
|
464
|
+
* @param transformFn - A user-supplied function that will transform the user
|
465
|
+
* type into a {@link DaffTreeData}
|
466
|
+
* @param key - The property of the your tree that indicates which
|
467
|
+
* key contains the "children" of your tree structure.
|
468
|
+
*
|
469
|
+
*/
|
470
|
+
const daffTransformTree = (tree, transformFn, key) => {
|
471
|
+
const transformedTree = transformFn(tree);
|
472
|
+
const queue = [{ node: tree, parent: transformedTree }];
|
473
|
+
while (queue.length > 0) {
|
474
|
+
const { node, parent } = queue.shift();
|
475
|
+
const childItems = node[key];
|
476
|
+
for (const child of childItems) {
|
477
|
+
const transformedChild = transformFn(child);
|
478
|
+
parent.items.push(transformedChild);
|
479
|
+
queue.push({ node: child, parent: transformedChild });
|
480
|
+
}
|
481
|
+
}
|
482
|
+
return transformedTree;
|
483
|
+
};
|
484
|
+
|
441
485
|
/**
|
442
486
|
* Generated bundle index. Do not edit.
|
443
487
|
*/
|
444
488
|
|
445
|
-
export { DaffTreeComponent, DaffTreeItemDirective, DaffTreeModule, daffTransformTreeInPlace };
|
489
|
+
export { DaffTreeComponent, DaffTreeItemDirective, DaffTreeModule, daffTransformTree, daffTransformTreeInPlace };
|
446
490
|
//# sourceMappingURL=daffodil-design-tree.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-tree.mjs","sources":["../../../libs/design/tree/src/tree/tree-notifier.service.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-item/tree-item.directive.ts","../../../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 { 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 { traverse } from './traverse-tree';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\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 { DaffTreeNotifierService } from './tree-notifier.service';\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';\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 { 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 { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\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 { traverse } from './traverse-tree';\nimport { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\nimport { DaffTreeData } from '../interfaces/tree-data';\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;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB,CAAA;AAA7B,IAAA,WAAA,GAAA;AAEL;;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;CAC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|
1
|
+
{"version":3,"file":"daffodil-design-tree.mjs","sources":["../../../libs/design/tree/src/tree/tree-notifier.service.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-item/tree-item.directive.ts","../../../libs/design/tree/src/tree.module.ts","../../../libs/design/tree/src/utils/transform-in-place.ts","../../../libs/design/tree/src/utils/transform.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 { 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 visible: boolean;\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>, removeNodes: boolean = false): DaffTreeFlatNode[] => {\n const tree: DaffTreeFlatNode[] = [];\n if(!daffUiTree) {\n return [];\n }\n\n let items = [\n {\n ...daffUiTree,\n level: 0,\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 items = [\n ...items,\n ...el.items.map((i) => ({\n ...i,\n level:\n el.level + 1,\n _treeRef: i,\n })).reverse(),\n ];\n\n if(!removeNodes && el._treeRef.parent) {\n tree.push({\n id: el.id,\n title: el.title,\n level: el.level,\n url : el.url,\n visible: el._treeRef.parent?.open,\n hasChildren: el.items.length > 0,\n data: undefined,\n _treeRef: el._treeRef,\n });\n } else if(removeNodes && el._treeRef.parent?.open) {\n tree.push({\n id: el.id,\n title: el.title,\n level: el.level,\n url : el.url,\n visible: el._treeRef.parent?.open,\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 { traverse } from './traverse-tree';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\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 {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnInit,\n Renderer2,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { daffArticleEncapsulatedMixin } from '@daffodil/design';\n\nimport { DaffTreeNotifierService } from './tree-notifier.service';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeRenderMode } from '../interfaces/tree-render-mode';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\nimport {\n DaffTreeFlatNode,\n flattenTree,\n} from '../utils/flatten-tree';\nimport { hydrateTree } from '../utils/hydrate-tree';\n\n/**\n * An _elementRef and an instance of renderer2 are needed for the list mixins\n */\nclass DaffTreeBase {\n constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {}\n}\n\nconst _daffTreeBase = daffArticleEncapsulatedMixin((DaffTreeBase));\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 extends _daffTreeBase implements OnInit, OnChanges {\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 rendering mode for nodes in the tree.\n *\n * Default value is 'in-dom', which means nodes are present in the DOM.\n *\n * Generally, `not-in-dom` is faster as there are less DOM elements to render,\n * but there may be use-cases (like SEO) where having the tree in the DOM\n * is relevant.\n */\n @Input() renderMode: DaffTreeRenderMode;\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 * The tree data you would like to render.\n */\n @Input() tree: DaffTreeData<unknown>;\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 private elementRef: ElementRef,\n private renderer: Renderer2,\n ) {\n super(elementRef, renderer);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if(!changes.tree.currentValue) {\n this._tree = undefined;\n this.flatTree = [];\n return;\n }\n\n if(changes.renderMode && !changes.tree) {\n this.flatTree = flattenTree(this._tree, changes.renderMode.currentValue === 'not-in-dom');\n } else if(changes.renderMode || changes.tree) {\n this._tree = hydrateTree(changes.tree?.currentValue ?? this.tree);\n this.flatTree = flattenTree(this._tree, (changes.renderMode?.currentValue ?? this.renderMode) === 'not-in-dom');\n }\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, this.renderMode === 'not-in-dom');\n });\n }\n}\n","<ng-container *ngFor=\"let node of flatTree; trackBy: trackByTreeElement\">\n\t<ng-container>\n\t\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t\t<ng-container\n\t\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate : treeItemTemplate; context: { $implicit: node }\">\n\t\t\t</ng-container>\n\t\t</li>\n\t</ng-container>\n</ng-container>","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 { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\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 { traverse } from './traverse-tree';\nimport { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\nimport { DaffTreeData } from '../interfaces/tree-data';\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","import { RecursiveTreeKeyOfType } from '../interfaces/recursive-key';\nimport { DaffTreeData } from '../interfaces/tree-data';\n\n/**\n * Transform a tree-like structure into a {@link DaffTreeData}.\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 daffTransformTree = <\n // eslint-disable-next-line @typescript-eslint/ban-types\n T extends Record<any,any>,\n V\n>(\n tree: T,\n transformFn: (type: T) => DaffTreeData<V>,\n key: RecursiveTreeKeyOfType<T>,\n): DaffTreeData<V> => {\n\n const transformedTree: DaffTreeData<V> = transformFn(tree);\n\n const queue: { node: T; parent: DaffTreeData<V> }[] = [{ node: tree, parent: transformedTree }];\n\n while (queue.length > 0) {\n const { node, parent } = queue.shift();\n\n const childItems = node[key];\n for (const child of <T[]>childItems) {\n const transformedChild: DaffTreeData<V> = transformFn(child);\n parent.items.push(transformedChild);\n queue.push({ node: child, parent: transformedChild });\n }\n }\n\n return transformedTree;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffTreeNotifierService"],"mappings":";;;;;;;;AAMA;;;;;;AAMG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB,CAAA;AAA7B,IAAA,WAAA,GAAA;AAEL;;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;;AC5BD;;;AAGG;AACI,MAAM,WAAW,GAAG,CAAC,UAA+B,EAAE,WAAA,GAAuB,KAAK,KAAwB;IAC/G,MAAM,IAAI,GAAuB,EAAE,CAAC;IACpC,IAAG,CAAC,UAAU,EAAE;AACd,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;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,GAA2C,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhG,IAAA,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AAEvC,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,QAAA,KAAK,MAAM,KAAK,IAAS,UAAU,EAAE;AACnC,YAAA,MAAM,gBAAgB,GAAoB,WAAW,CAAC,KAAK,CAAC,CAAC;AAC7D,YAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACpC,YAAA,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACvD,SAAA;AACF,KAAA;AAED,IAAA,OAAO,eAAe,CAAC;AACzB;;ACvCA;;AAEG;;;;"}
|
@@ -1038,7 +1038,8 @@ class DaffProgressIndicatorBase {
|
|
1038
1038
|
}
|
1039
1039
|
const _daffProgressIndicatorBase = daffColorMixin(DaffProgressIndicatorBase, 'primary');
|
1040
1040
|
/**
|
1041
|
-
* @
|
1041
|
+
* @deprecated in v1.0.0
|
1042
|
+
* Use `DaffProgressBarComponent` instead.
|
1042
1043
|
*/
|
1043
1044
|
class DaffProgressIndicatorComponent extends _daffProgressIndicatorBase {
|
1044
1045
|
/**
|
@@ -1463,130 +1464,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImpor
|
|
1463
1464
|
}]
|
1464
1465
|
}] });
|
1465
1466
|
|
1466
|
-
const animationDuration = '350ms';
|
1467
|
-
const backdropTransitionOut = 'cubic-bezier(0.4, 0.0, 1, 1)';
|
1468
|
-
const backdropTransitionIn = 'cubic-bezier(0.0, 0.0, 0.2, 1)';
|
1469
|
-
const daffBackdropAnimations = {
|
1470
|
-
fadeBackdrop: trigger('fadeBackdrop', [
|
1471
|
-
state('interactable', style({ opacity: 1 })),
|
1472
|
-
state('non-interactable', style({ opacity: 0 })),
|
1473
|
-
transition('interactable => non-interactable', animate(animationDuration + ' ' + backdropTransitionOut)),
|
1474
|
-
transition('non-interactable => interactable', animate(animationDuration + ' ' + backdropTransitionIn)),
|
1475
|
-
transition(':enter', [
|
1476
|
-
style({ opacity: 0 }),
|
1477
|
-
animate(animationDuration + ' ' + backdropTransitionIn, style({ opacity: 1 })),
|
1478
|
-
]),
|
1479
|
-
transition(':leave', [
|
1480
|
-
animate(animationDuration + ' ' + backdropTransitionOut, style({ opacity: 0 })),
|
1481
|
-
]),
|
1482
|
-
]),
|
1483
|
-
};
|
1484
|
-
|
1485
|
-
const getAnimationState = (interactable) => interactable ? 'interactable' : 'non-interactable';
|
1486
|
-
|
1487
|
-
class DaffBackdropComponent {
|
1488
|
-
constructor() {
|
1489
|
-
/**
|
1490
|
-
* Determines whether or not the backdrop is transparent.
|
1491
|
-
*/
|
1492
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
1493
|
-
this.transparent = false;
|
1494
|
-
/**
|
1495
|
-
* Determines whether or not the backdrop is interactable.
|
1496
|
-
*/
|
1497
|
-
this.interactable = true;
|
1498
|
-
/**
|
1499
|
-
* Boolean property that determines whether or not the
|
1500
|
-
* backdrop should fill up its containing window.
|
1501
|
-
*/
|
1502
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
1503
|
-
this.fullscreen = false;
|
1504
|
-
/**
|
1505
|
-
* Output event triggered when the backdrop is clicked.
|
1506
|
-
*/
|
1507
|
-
this.backdropClicked = new EventEmitter();
|
1508
|
-
this.interactableClass = true;
|
1509
|
-
}
|
1510
|
-
ngOnInit() {
|
1511
|
-
this.interactableClass = this.interactable;
|
1512
|
-
}
|
1513
|
-
/**
|
1514
|
-
* Animation hook for that controls the backdrops
|
1515
|
-
* entrance and fade animations.
|
1516
|
-
*/
|
1517
|
-
get fadeBackdropTrigger() {
|
1518
|
-
return getAnimationState(this.interactable);
|
1519
|
-
}
|
1520
|
-
animationDone(e) {
|
1521
|
-
this.interactableClass = !(e.toState === ':leave' || e.toState === 'non-interactable');
|
1522
|
-
}
|
1523
|
-
animationStart(e) {
|
1524
|
-
if (e.toState === ':enter' || e.toState === 'interactable') {
|
1525
|
-
this.interactableClass = true;
|
1526
|
-
}
|
1527
|
-
}
|
1528
|
-
/**
|
1529
|
-
* @deprecated
|
1530
|
-
* Backdrop event that triggers when the backdrop element is clicked.
|
1531
|
-
*/
|
1532
|
-
onBackdropClicked() {
|
1533
|
-
this.backdropClicked.emit();
|
1534
|
-
}
|
1535
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1536
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.1", type: DaffBackdropComponent, selector: "daff-backdrop", inputs: { transparent: "transparent", interactable: "interactable", fullscreen: "fullscreen" }, outputs: { backdropClicked: "backdropClicked" }, host: { listeners: { "@fadeBackdrop.done": "animationDone($event)", "@fadeBackdrop.start": "animationStart($event)", "click": "onBackdropClicked()" }, properties: { "class.interactable": "this.interactableClass", "@fadeBackdrop": "this.fadeBackdropTrigger" } }, ngImport: i0, template: "<div class=\"daff-backdrop\" [class.daff-backdrop--fullscreen]=\"fullscreen\" [class.daff-backdrop--transparent]=\"transparent\"></div>\n", styles: [":host{display:block;-webkit-tap-highlight-color:rgba(0,0,0,0);visibility:hidden;pointer-events:none}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.daff-backdrop{background:#0000004d;height:100%;width:100%}.daff-backdrop--transparent{background:none}.daff-backdrop:focus,.daff-backdrop:active,.daff-backdrop:visited{outline:0}.daff-backdrop--fullscreen{position:absolute}\n"], animations: [
|
1537
|
-
daffBackdropAnimations.fadeBackdrop,
|
1538
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1539
|
-
}
|
1540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropComponent, decorators: [{
|
1541
|
-
type: Component,
|
1542
|
-
args: [{ selector: 'daff-backdrop', animations: [
|
1543
|
-
daffBackdropAnimations.fadeBackdrop,
|
1544
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"daff-backdrop\" [class.daff-backdrop--fullscreen]=\"fullscreen\" [class.daff-backdrop--transparent]=\"transparent\"></div>\n", styles: [":host{display:block;-webkit-tap-highlight-color:rgba(0,0,0,0);visibility:hidden;pointer-events:none}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.daff-backdrop{background:#0000004d;height:100%;width:100%}.daff-backdrop--transparent{background:none}.daff-backdrop:focus,.daff-backdrop:active,.daff-backdrop:visited{outline:0}.daff-backdrop--fullscreen{position:absolute}\n"] }]
|
1545
|
-
}], propDecorators: { transparent: [{
|
1546
|
-
type: Input
|
1547
|
-
}], interactable: [{
|
1548
|
-
type: Input
|
1549
|
-
}], fullscreen: [{
|
1550
|
-
type: Input
|
1551
|
-
}], backdropClicked: [{
|
1552
|
-
type: Output
|
1553
|
-
}], interactableClass: [{
|
1554
|
-
type: HostBinding,
|
1555
|
-
args: ['class.interactable']
|
1556
|
-
}], fadeBackdropTrigger: [{
|
1557
|
-
type: HostBinding,
|
1558
|
-
args: ['@fadeBackdrop']
|
1559
|
-
}], animationDone: [{
|
1560
|
-
type: HostListener,
|
1561
|
-
args: ['@fadeBackdrop.done', ['$event']]
|
1562
|
-
}], animationStart: [{
|
1563
|
-
type: HostListener,
|
1564
|
-
args: ['@fadeBackdrop.start', ['$event']]
|
1565
|
-
}], onBackdropClicked: [{
|
1566
|
-
type: HostListener,
|
1567
|
-
args: ['click']
|
1568
|
-
}] } });
|
1569
|
-
|
1570
|
-
class DaffBackdropModule {
|
1571
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
1572
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropModule, declarations: [DaffBackdropComponent], imports: [CommonModule], exports: [DaffBackdropComponent] }); }
|
1573
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropModule, imports: [CommonModule] }); }
|
1574
|
-
}
|
1575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DaffBackdropModule, decorators: [{
|
1576
|
-
type: NgModule,
|
1577
|
-
args: [{
|
1578
|
-
imports: [
|
1579
|
-
CommonModule,
|
1580
|
-
],
|
1581
|
-
declarations: [
|
1582
|
-
DaffBackdropComponent,
|
1583
|
-
],
|
1584
|
-
exports: [
|
1585
|
-
DaffBackdropComponent,
|
1586
|
-
],
|
1587
|
-
}]
|
1588
|
-
}] });
|
1589
|
-
|
1590
1467
|
/**
|
1591
1468
|
* @deprecated in v1.0.0
|
1592
1469
|
*/
|
@@ -2671,5 +2548,5 @@ function daffSizeMixin(Base, defaultSize) {
|
|
2671
2548
|
* Generated bundle index. Do not edit.
|
2672
2549
|
*/
|
2673
2550
|
|
2674
|
-
export { DAFF_THEME_INITIALIZER,
|
2551
|
+
export { DAFF_THEME_INITIALIZER, DaffBreakpoints, DaffButtonSetComponent, DaffButtonSetModule, DaffCheckboxComponent, DaffCheckboxControlValueAccessorDirective, DaffCheckboxModule, DaffCheckboxSetComponent, DaffErrorMessageComponent, DaffErrorMessageModule, DaffErrorStateMatcher, DaffFeatureComponent, DaffFeatureIconDirective, DaffFeatureModeEnum, DaffFeatureModule, DaffFeatureSubheaderDirective, DaffFeatureSubtitleDirective, DaffFeatureTitleDirective, DaffFocusStackService, DaffFormFieldComponent, DaffFormFieldControl, DaffFormFieldModule, DaffFormLabelDirective, DaffFormLabelModule, DaffGalleryImageComponent, DaffImageGalleryComponent, DaffImageGalleryModule, DaffImageListComponent, DaffImageListModule, DaffInputComponent, DaffInputModule, DaffNativeSelectComponent, DaffNativeSelectModule, DaffPrefixDirective, DaffPrefixSuffixModule, DaffProgressIndicatorComponent, DaffProgressIndicatorModule, DaffQtyDropdownComponent, DaffQtyDropdownModule, DaffQuantityFieldComponent, DaffQuantityFieldModule, DaffQuantityInputComponent, DaffQuantitySelectComponent, DaffRadioComponent, DaffRadioControlValueAccessorDirective, DaffRadioModule, DaffRadioSetComponent, DaffSizableEnum, DaffStatusEnum, DaffSuffixDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, daffArticleEncapsulatedMixin, daffColorMixin, daffCompactableMixin, daffFocusableElementsSelector, daffManageContainerLayoutMixin, daffPrefixableMixin, daffSizeMixin, daffSkeletonableMixin, daffStatusMixin, daffSuffixableMixin, daffTextAlignmentMixin };
|
2675
2552
|
//# sourceMappingURL=daffodil-design.mjs.map
|