@daffodil/design 0.92.3 → 0.93.1
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/accordion/README.md +4 -4
- package/beacon/README.md +61 -0
- package/beacon/src/beacon-theme.scss +61 -0
- package/breadcrumb/README.md +13 -35
- package/button/README.md +28 -50
- package/card/README.md +8 -22
- package/card/src/card/stroked/stroked-theme.scss +8 -1
- package/card/src/card-base-theme.scss +12 -1
- package/container/README.md +4 -26
- package/fesm2022/daffodil-design-accordion.mjs +15 -15
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +30 -30
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-beacon.mjs +48 -0
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
- package/fesm2022/daffodil-design-breadcrumb.mjs +20 -20
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +37 -49
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +22 -22
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +31 -31
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +13 -13
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +7 -7
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +13 -12
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +9 -9
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +22 -22
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +8 -8
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +12 -11
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-link-set.mjs +16 -16
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +20 -17
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +7 -7
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +20 -20
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -27
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +5 -3
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +9 -9
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +16 -16
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +8 -8
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +11 -11
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +13 -13
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +16 -16
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +11 -11
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +36 -30
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +8 -8
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +3 -3
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +17 -25
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +43 -35
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-testing.mjs +19 -0
- package/fesm2022/daffodil-design-testing.mjs.map +1 -0
- package/fesm2022/daffodil-design-text-snippet.mjs +3 -3
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +3 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +22 -22
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +27 -25
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +22 -11
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +126 -160
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/README.md +15 -6
- package/hero/README.md +14 -49
- package/image/README.md +6 -29
- package/input/README.md +8 -34
- package/list/README.md +29 -55
- package/list/src/list-theme.scss +16 -2
- package/media-gallery/README.md +36 -43
- package/menu/README.md +24 -55
- package/menu/src/menu-theme.scss +12 -2
- package/modal/README.md +15 -45
- package/native-select/README.md +8 -6
- package/navbar/README.md +18 -27
- package/notification/README.md +14 -49
- package/package.json +1 -1
- package/paginator/README.md +11 -31
- package/paginator/src/paginator-theme.scss +16 -2
- package/progress-bar/README.md +14 -41
- package/scss/global.scss +25 -2
- package/scss/theme.scss +2 -0
- package/select/README.md +5 -6
- package/select/src/select-theme.scss +10 -2
- package/sidebar/README.md +1 -1
- package/spinner/README.md +15 -9
- package/switch/README.md +17 -6
- package/tabs/README.md +39 -39
- package/tag/README.md +31 -31
- package/tag/src/tag-theme.scss +100 -3
- package/textarea/README.md +9 -7
- package/toast/README.md +55 -52
- package/tree/README.md +12 -43
- package/tree/src/tree-theme.scss +8 -4
- package/{accordion/index.d.ts → types/daffodil-design-accordion.d.ts} +1 -1
- package/types/daffodil-design-beacon.d.ts +26 -0
- package/{button/index.d.ts → types/daffodil-design-button.d.ts} +7 -8
- package/{input/index.d.ts → types/daffodil-design-input.d.ts} +4 -1
- package/{list/index.d.ts → types/daffodil-design-list.d.ts} +4 -1
- package/{menu/index.d.ts → types/daffodil-design-menu.d.ts} +3 -3
- package/{modal/index.d.ts → types/daffodil-design-modal.d.ts} +11 -5
- package/{native-select/index.d.ts → types/daffodil-design-native-select.d.ts} +3 -1
- package/{sidebar/index.d.ts → types/daffodil-design-sidebar.d.ts} +9 -3
- package/{tabs/index.d.ts → types/daffodil-design-tabs.d.ts} +0 -6
- package/types/daffodil-design-tag.d.ts +80 -0
- package/types/daffodil-design-testing.d.ts +11 -0
- package/{tree/index.d.ts → types/daffodil-design-tree.d.ts} +2 -0
- package/{youtube-player/index.d.ts → types/daffodil-design-youtube-player.d.ts} +15 -0
- package/{index.d.ts → types/daffodil-design.d.ts} +25 -67
- package/tag/index.d.ts +0 -71
- /package/{article/index.d.ts → types/daffodil-design-article.d.ts} +0 -0
- /package/{breadcrumb/index.d.ts → types/daffodil-design-breadcrumb.d.ts} +0 -0
- /package/{callout/index.d.ts → types/daffodil-design-callout.d.ts} +0 -0
- /package/{card/index.d.ts → types/daffodil-design-card.d.ts} +0 -0
- /package/{checkbox/index.d.ts → types/daffodil-design-checkbox.d.ts} +0 -0
- /package/{container/index.d.ts → types/daffodil-design-container.d.ts} +0 -0
- /package/{form-field/index.d.ts → types/daffodil-design-form-field.d.ts} +0 -0
- /package/{form/index.d.ts → types/daffodil-design-form.d.ts} +0 -0
- /package/{hero/index.d.ts → types/daffodil-design-hero.d.ts} +0 -0
- /package/{image/index.d.ts → types/daffodil-design-image.d.ts} +0 -0
- /package/{link-set/index.d.ts → types/daffodil-design-link-set.d.ts} +0 -0
- /package/{loading-icon/index.d.ts → types/daffodil-design-loading-icon.d.ts} +0 -0
- /package/{media-gallery/index.d.ts → types/daffodil-design-media-gallery.d.ts} +0 -0
- /package/{navbar/index.d.ts → types/daffodil-design-navbar.d.ts} +0 -0
- /package/{notification/index.d.ts → types/daffodil-design-notification.d.ts} +0 -0
- /package/{paginator/index.d.ts → types/daffodil-design-paginator.d.ts} +0 -0
- /package/{progress-bar/index.d.ts → types/daffodil-design-progress-bar.d.ts} +0 -0
- /package/{quantity-field/index.d.ts → types/daffodil-design-quantity-field.d.ts} +0 -0
- /package/{radio/index.d.ts → types/daffodil-design-radio.d.ts} +0 -0
- /package/{select/index.d.ts → types/daffodil-design-select.d.ts} +0 -0
- /package/{spinner/index.d.ts → types/daffodil-design-spinner.d.ts} +0 -0
- /package/{switch/index.d.ts → types/daffodil-design-switch.d.ts} +0 -0
- /package/{text-snippet/index.d.ts → types/daffodil-design-text-snippet.d.ts} +0 -0
- /package/{textarea/index.d.ts → types/daffodil-design-textarea.d.ts} +0 -0
- /package/{toast/index.d.ts → types/daffodil-design-toast.d.ts} +0 -0
|
@@ -202,29 +202,29 @@ class DaffTreeComponent {
|
|
|
202
202
|
* but there may be use-cases (like SEO) where having the tree in the DOM
|
|
203
203
|
* is relevant.
|
|
204
204
|
*/
|
|
205
|
-
this.renderMode = input('in-dom', ...(ngDevMode ? [{ debugName: "renderMode" }] : []));
|
|
205
|
+
this.renderMode = input('in-dom', ...(ngDevMode ? [{ debugName: "renderMode" }] : /* istanbul ignore next */ []));
|
|
206
206
|
/**
|
|
207
207
|
* A unique identifier for the tree instance.
|
|
208
208
|
* Used as a prefix for all node IDs in the tree.
|
|
209
209
|
* If not provided, an auto-incrementing number is used.
|
|
210
210
|
*/
|
|
211
|
-
this.id = input(`${daffTreeId++}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
211
|
+
this.id = input(`${daffTreeId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
212
212
|
/**
|
|
213
213
|
* The tree data you would like to render.
|
|
214
214
|
*/
|
|
215
|
-
this.tree = input(...(ngDevMode ? [undefined, { debugName: "tree" }] : []));
|
|
215
|
+
this.tree = input(...(ngDevMode ? [undefined, { debugName: "tree" }] : /* istanbul ignore next */ []));
|
|
216
216
|
/**
|
|
217
217
|
* The internal tree element.
|
|
218
218
|
*/
|
|
219
219
|
this._tree = computed(() => {
|
|
220
220
|
const tree = this.tree();
|
|
221
221
|
return tree ? hydrateTree(tree, this.id()) : undefined;
|
|
222
|
-
}, ...(ngDevMode ? [{ debugName: "_tree" }] : []));
|
|
222
|
+
}, ...(ngDevMode ? [{ debugName: "_tree" }] : /* istanbul ignore next */ []));
|
|
223
223
|
/**
|
|
224
224
|
* A revision counter incremented by notifications from tree items.
|
|
225
225
|
* Used to trigger re-flattening when tree item state changes.
|
|
226
226
|
*/
|
|
227
|
-
this._revision = signal(0, ...(ngDevMode ? [{ debugName: "_revision" }] : []));
|
|
227
|
+
this._revision = signal(0, ...(ngDevMode ? [{ debugName: "_revision" }] : /* istanbul ignore next */ []));
|
|
228
228
|
/**
|
|
229
229
|
* @docs-private
|
|
230
230
|
*
|
|
@@ -235,29 +235,29 @@ class DaffTreeComponent {
|
|
|
235
235
|
this._revision();
|
|
236
236
|
const tree = this._tree();
|
|
237
237
|
return tree ? flattenTree(tree, this.renderMode() === 'not-in-dom') : [];
|
|
238
|
-
}, ...(ngDevMode ? [{ debugName: "flatTree" }] : []));
|
|
238
|
+
}, ...(ngDevMode ? [{ debugName: "flatTree" }] : /* istanbul ignore next */ []));
|
|
239
239
|
/**
|
|
240
240
|
* The template used to render tree-nodes that themselves have children.
|
|
241
241
|
*
|
|
242
242
|
* @docs-private
|
|
243
243
|
*/
|
|
244
|
-
this.withChildrenTemplate = contentChild('daffTreeItemWithChildrenTpl', ...(ngDevMode ? [{ debugName: "withChildrenTemplate" }] : []));
|
|
244
|
+
this.withChildrenTemplate = contentChild('daffTreeItemWithChildrenTpl', ...(ngDevMode ? [{ debugName: "withChildrenTemplate" }] : /* istanbul ignore next */ []));
|
|
245
245
|
/**
|
|
246
246
|
* The template used to render tree-nodes that have no children.
|
|
247
247
|
*
|
|
248
248
|
* @docs-private
|
|
249
249
|
*/
|
|
250
|
-
this.treeItemTemplate = contentChild('daffTreeItemTpl', ...(ngDevMode ? [{ debugName: "treeItemTemplate" }] : []));
|
|
250
|
+
this.treeItemTemplate = contentChild('daffTreeItemTpl', ...(ngDevMode ? [{ debugName: "treeItemTemplate" }] : /* istanbul ignore next */ []));
|
|
251
251
|
this.notifier.notice$.subscribe(() => {
|
|
252
252
|
this._revision.update((r) => r + 1);
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
256
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
255
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
256
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffTreeComponent, isStandalone: true, selector: "ul[daff-tree]", inputs: { renderMode: { classPropertyName: "renderMode", publicName: "renderMode", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, tree: { classPropertyName: "tree", publicName: "tree", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "daff-tree" }, providers: [
|
|
257
257
|
DaffTreeNotifierService,
|
|
258
258
|
], queries: [{ propertyName: "withChildrenTemplate", first: true, predicate: ["daffTreeItemWithChildrenTpl"], descendants: true, isSignal: true }, { propertyName: "treeItemTemplate", first: true, predicate: ["daffTreeItemTpl"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }], ngImport: i0, template: "@for (node of flatTree(); track node.id) {\n\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t<ng-container\n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n\t\t</ng-container>\n\t</li>\n}", styles: [".daff-tree{margin:0;padding:0;list-style:none;--tree-padding: 1rem}.daff-tree li.hidden{display:none}.daff-tree-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;position:relative;background:none;border:0;padding:.5rem 1rem .5rem 0;line-height:1.5rem;font-weight:400;text-align:left;text-decoration:none;width:100%;padding-left:calc(var(--tree-padding) * (var(--depth)))}.daff-tree-item:before{content:\"\";position:absolute;top:0;bottom:0;left:0;width:.25rem}.daff-tree-item:focus,.daff-tree-item:focus-visible{z-index:1}.daff-tree-item.selected{font-weight:500}.daff-tree-item.parent{position:relative;padding-right:2.5rem}.daff-tree-item.parent:after{content:\"\";position:absolute;top:48%;right:1rem;display:inline-block;border-right:2px solid currentColor;border-bottom:2px solid currentColor;width:.5rem;height:.5rem;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-tree-item.parent.open:after{top:56%;transform:translateY(-50%) rotate(225deg)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
259
259
|
}
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeComponent, decorators: [{
|
|
261
261
|
type: Component,
|
|
262
262
|
args: [{ selector: 'ul[daff-tree]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
263
263
|
DaffTreeNotifierService,
|
|
@@ -320,7 +320,7 @@ class DaffTreeItemDirective {
|
|
|
320
320
|
/**
|
|
321
321
|
* The {@link DaffTreeFlatNode} associated with this specific tree item.
|
|
322
322
|
*/
|
|
323
|
-
this.node = input.required(...(ngDevMode ? [{ debugName: "node" }] : []));
|
|
323
|
+
this.node = input.required(...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
|
|
324
324
|
/**
|
|
325
325
|
* Whether or not the tree item is the currently active item.
|
|
326
326
|
* Note that there is no requirement that there only be one active item at a time.
|
|
@@ -328,31 +328,33 @@ class DaffTreeItemDirective {
|
|
|
328
328
|
* When a tree item becomes selected, all of its ancestor nodes
|
|
329
329
|
* will be automatically opened so that the selected item is visible.
|
|
330
330
|
*/
|
|
331
|
-
this.selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
331
|
+
this.selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
332
332
|
/**
|
|
333
333
|
* The html `id` of the tree item. This is derived from the {@link DaffTreeData}.
|
|
334
334
|
*/
|
|
335
|
-
this.id = computed(() => 'tree-' + this.node().id, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
335
|
+
this.id = computed(() => 'tree-' + this.node().id, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
336
336
|
/**
|
|
337
337
|
* A property indicating the depth of the tree.
|
|
338
338
|
*/
|
|
339
|
-
this.depth = computed(() => this.node().level, ...(ngDevMode ? [{ debugName: "depth" }] : []));
|
|
339
|
+
this.depth = computed(() => this.node().level, ...(ngDevMode ? [{ debugName: "depth" }] : /* istanbul ignore next */ []));
|
|
340
340
|
/**
|
|
341
341
|
* Whether or not this node has children.
|
|
342
342
|
*/
|
|
343
|
-
this.isParent = computed(() => this.node().hasChildren, ...(ngDevMode ? [{ debugName: "isParent" }] : []));
|
|
343
|
+
this.isParent = computed(() => this.node().hasChildren, ...(ngDevMode ? [{ debugName: "isParent" }] : /* istanbul ignore next */ []));
|
|
344
344
|
/**
|
|
345
345
|
* Indicates whether or not the tree is `open`.
|
|
346
346
|
*/
|
|
347
|
-
this.open = computed(() => this.node()._treeRef.open, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
347
|
+
this.open = computed(() => this.node()._treeRef.open, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
348
348
|
/**
|
|
349
349
|
* Accessibility property, notifying users about whether
|
|
350
350
|
* or not the tree item is open.
|
|
351
|
+
*
|
|
352
|
+
* @docs-private
|
|
351
353
|
*/
|
|
352
354
|
this.ariaExpanded = computed(() => {
|
|
353
355
|
const node = this.node();
|
|
354
356
|
return node.hasChildren ? (node._treeRef.open ? 'true' : 'false') : undefined;
|
|
355
|
-
}, ...(ngDevMode ? [{ debugName: "ariaExpanded" }] : []));
|
|
357
|
+
}, ...(ngDevMode ? [{ debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
|
|
356
358
|
effect(() => {
|
|
357
359
|
if (this.selected()) {
|
|
358
360
|
const node = untracked(this.node);
|
|
@@ -397,10 +399,10 @@ class DaffTreeItemDirective {
|
|
|
397
399
|
node._treeRef.open = false;
|
|
398
400
|
}
|
|
399
401
|
}
|
|
400
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
401
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
402
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
403
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffTreeItemDirective, isStandalone: true, selector: "[daffTreeItem]", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.escape": "onEscape()", "click": "onClick()" }, properties: { "class.selected": "selected()", "class.parent": "isParent()", "class.open": "open()", "attr.id": "id()", "attr.aria-expanded": "ariaExpanded()", "style.--depth": "depth()" }, classAttribute: "daff-tree-item" }, ngImport: i0 }); }
|
|
402
404
|
}
|
|
403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeItemDirective, decorators: [{
|
|
404
406
|
type: Directive,
|
|
405
407
|
args: [{
|
|
406
408
|
selector: '[daffTreeItem]',
|
|
@@ -422,14 +424,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
422
424
|
* @deprecated in favor of {@link DAFF_TREE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
|
|
423
425
|
*/
|
|
424
426
|
class DaffTreeModule {
|
|
425
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
426
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
427
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
428
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeModule, imports: [CommonModule,
|
|
427
429
|
DaffTreeComponent,
|
|
428
430
|
DaffTreeItemDirective], exports: [DaffTreeComponent,
|
|
429
431
|
DaffTreeItemDirective] }); }
|
|
430
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
432
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeModule, imports: [CommonModule] }); }
|
|
431
433
|
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTreeModule, decorators: [{
|
|
433
435
|
type: NgModule,
|
|
434
436
|
args: [{
|
|
435
437
|
imports: [
|
|
@@ -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/utils/walk-up.ts","../../../libs/design/tree/src/utils/open-ancestors.ts","../../../libs/design/tree/src/tree-item/tree-item.directive.ts","../../../libs/design/tree/src/tree.module.ts","../../../libs/design/tree/src/utils/transform.ts","../../../libs/design/tree/src/tree.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 recomputed.\n *\n * This service is a multiton associated with each tree instance.\n * It follows the same lifecycle as 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 { collect } from '@daffodil/core';\n\nimport { 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 const hasClosedAncestor = el._treeRef.parent\n ? collect(el._treeRef.parent, (node) => node.parent ? [node.parent] : [], el.level).reduce(\n (acc, parent) => acc || !parent.open,\n false,\n )\n : false;\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: !hasClosedAncestor,\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: !hasClosedAncestor,\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: parent ? `${parent.id}.${data.id ?? data.title}` : (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>, treeId?: string): DaffTreeUi<T> => {\n const root: DaffTreeUi<T> = {\n id: treeId ?? (data.id ?? data.title),\n title: data.title,\n url: data.url,\n data: data.data,\n open: true,\n parent: undefined,\n items: [],\n };\n\n let treeStack = [\n root,\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 root;\n};\n","/* eslint-disable quote-props */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n inject,\n input,\n signal,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { DaffArticleEncapsulatedDirective } from '@daffodil/design';\n\nimport { DaffTreeNotifierService } from './tree-notifier.service';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeRenderMode } from '../interfaces/tree-render-mode';\nimport { flattenTree } from '../utils/flatten-tree';\nimport { hydrateTree } from '../utils/hydrate-tree';\n\nlet daffTreeId = 0;\n\n/**\n * The `DaffTreeComponent` allows you to render tree structures as interactable UI.\n *\n * @example Basic use of the tree component\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 hostDirectives: [{\n directive: DaffArticleEncapsulatedDirective,\n }],\n host: {\n 'class': 'daff-tree',\n },\n imports: [\n NgTemplateOutlet,\n ],\n})\nexport class DaffTreeComponent {\n private notifier = inject(DaffTreeNotifierService);\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 readonly renderMode = input<DaffTreeRenderMode>('in-dom');\n\n /**\n * A unique identifier for the tree instance.\n * Used as a prefix for all node IDs in the tree.\n * If not provided, an auto-incrementing number is used.\n */\n readonly id = input<string>(`${daffTreeId++}`);\n\n /**\n * The tree data you would like to render.\n */\n readonly tree = input<DaffTreeData<unknown>>();\n\n /**\n * The internal tree element.\n */\n private _tree = computed(() => {\n const tree = this.tree();\n return tree ? hydrateTree(tree, this.id()) : undefined;\n });\n\n /**\n * A revision counter incremented by notifications from tree items.\n * Used to trigger re-flattening when tree item state changes.\n */\n readonly _revision = signal(0);\n\n /**\n * @docs-private\n *\n * The flattened tree data. For debugging purposes, you can iterate through this if you want to inspect\n * the resulting array structure we computed to render the tree.\n */\n readonly flatTree = computed(() => {\n this._revision();\n const tree = this._tree();\n return tree ? flattenTree(tree, this.renderMode() === 'not-in-dom') : [];\n });\n\n /**\n * The template used to render tree-nodes that themselves have children.\n *\n * @docs-private\n */\n readonly withChildrenTemplate = contentChild<TemplateRef<any>>('daffTreeItemWithChildrenTpl');\n\n /**\n * The template used to render tree-nodes that have no children.\n *\n * @docs-private\n */\n readonly treeItemTemplate = contentChild<TemplateRef<any>>('daffTreeItemTpl');\n\n constructor() {\n this.notifier.notice$.subscribe(() => {\n this._revision.update((r) => r + 1);\n });\n }\n}\n","@for (node of flatTree(); track node.id) {\n\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t<ng-container\n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n\t\t</ng-container>\n\t</li>\n}","import { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Walk up the tree from a leaf to the root applying the\n * visit function at each node along the way.\n */\nexport const walkUp = <T>(\n tree: DaffTreeUi<T>,\n visit: (tree: DaffTreeUi<T>) => DaffTreeUi<T>,\n): DaffTreeUi<T> => {\n while(tree.parent) {\n visit(tree);\n tree = tree.parent;\n }\n\n return tree;\n};\n","import { walkUp } from './walk-up';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Open all ancestor nodes of the given node so that it becomes visible in the tree.\n */\nexport const daffTreeOpenAncestors = <T>(node: DaffTreeUi<T>): void => {\n walkUp(node, (ancestor) => {\n ancestor.open = true;\n return ancestor;\n });\n};\n","/* eslint-disable quote-props */\n\nimport { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport { DaffTreeNotifierService } from '../tree/tree-notifier.service';\nimport { DaffTreeFlatNode } from '../utils/flatten-tree';\nimport { daffTreeOpenAncestors } from '../utils/open-ancestors';\n\n/**\n * The `DaffTreeItemDirective` marks elements as tree child nodes that interact with the parent tree structure.\n *\n * @example Using a `[daffTreeItem]`\n *\n * `[tree]` is a {@link DaffTreeData} and `[daff-tree]` is a {@link DaffTreeComponent}.\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 */\n@Directive({\n selector: '[daffTreeItem]',\n host: {\n 'class': 'daff-tree-item',\n '[class.selected]': 'selected()',\n '[class.parent]': 'isParent()',\n '[class.open]': 'open()',\n '[attr.id]': 'id()',\n '[attr.aria-expanded]': 'ariaExpanded()',\n '[style.--depth]': 'depth()',\n '(keydown.escape)': 'onEscape()',\n '(click)': 'onClick()',\n },\n})\nexport class DaffTreeItemDirective {\n private document = inject(DOCUMENT);\n private treeNotifier = inject(DaffTreeNotifierService);\n\n /**\n * The {@link DaffTreeFlatNode} associated with this specific tree item.\n */\n readonly node = input.required<DaffTreeFlatNode>();\n\n /**\n * Whether or not the tree item is the currently active item.\n * Note that there is no requirement that there only be one active item at a time.\n *\n * When a tree item becomes selected, all of its ancestor nodes\n * will be automatically opened so that the selected item is visible.\n */\n readonly selected = input(false);\n\n /**\n * The html `id` of the tree item. This is derived from the {@link DaffTreeData}.\n */\n protected readonly id = computed(() => 'tree-' + this.node().id);\n\n /**\n * A property indicating the depth of the tree.\n */\n protected readonly depth = computed(() => this.node().level);\n\n /**\n * Whether or not this node has children.\n */\n protected readonly isParent = computed(() => this.node().hasChildren);\n\n /**\n * Indicates whether or not the tree is `open`.\n */\n protected readonly open = computed(() => this.node()._treeRef.open);\n\n /**\n * Accessibility property, notifying users about whether\n * or not the tree item is open.\n */\n protected readonly ariaExpanded = computed(() => {\n const node = this.node();\n return node.hasChildren ? (node._treeRef.open ? 'true' : 'false') : undefined;\n });\n\n constructor() {\n effect(() => {\n if(this.selected()) {\n const node = untracked(this.node);\n daffTreeOpenAncestors(node._treeRef);\n this.treeNotifier.notify();\n }\n });\n }\n\n /**\n * @docs-private\n */\n onEscape() {\n this.toggleParent(this.node());\n }\n\n /**\n * @docs-private\n */\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/**\n * @deprecated in favor of {@link DAFF_TREE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffTreeComponent,\n DaffTreeItemDirective,\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';\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\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","import { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_TREE_COMPONENTS = <const> [\n DaffTreeComponent,\n DaffTreeItemDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"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;AAE9E;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;IAqBvC;AAnBE;;;;;;AAMG;IACH,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IACzB;AAEA;;;;AAIG;IACH,WAAW,GAAA;AACT,QAAA,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M,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;AACnC,YAAA,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;QACvD;IACF;AAEA,IAAA,OAAO,eAAe;AACxB;;ACpCA;;AAEG;AACI,MAAM,oBAAoB,GAAW;IAC1C,iBAAiB;IACjB,qBAAqB;;;ACRvB;;AAEG;;;;"}
|
|
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/utils/walk-up.ts","../../../libs/design/tree/src/utils/open-ancestors.ts","../../../libs/design/tree/src/tree-item/tree-item.directive.ts","../../../libs/design/tree/src/tree.module.ts","../../../libs/design/tree/src/utils/transform.ts","../../../libs/design/tree/src/tree.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 recomputed.\n *\n * This service is a multiton associated with each tree instance.\n * It follows the same lifecycle as 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 { collect } from '@daffodil/core';\n\nimport { 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 const hasClosedAncestor = el._treeRef.parent\n ? collect(el._treeRef.parent, (node) => node.parent ? [node.parent] : [], el.level).reduce(\n (acc, parent) => acc || !parent.open,\n false,\n )\n : false;\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: !hasClosedAncestor,\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: !hasClosedAncestor,\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: parent ? `${parent.id}.${data.id ?? data.title}` : (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>, treeId?: string): DaffTreeUi<T> => {\n const root: DaffTreeUi<T> = {\n id: treeId ?? (data.id ?? data.title),\n title: data.title,\n url: data.url,\n data: data.data,\n open: true,\n parent: undefined,\n items: [],\n };\n\n let treeStack = [\n root,\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 root;\n};\n","/* eslint-disable quote-props */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n inject,\n input,\n signal,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { DaffArticleEncapsulatedDirective } from '@daffodil/design';\n\nimport { DaffTreeNotifierService } from './tree-notifier.service';\nimport { DaffTreeData } from '../interfaces/tree-data';\nimport { DaffTreeRenderMode } from '../interfaces/tree-render-mode';\nimport { flattenTree } from '../utils/flatten-tree';\nimport { hydrateTree } from '../utils/hydrate-tree';\n\nlet daffTreeId = 0;\n\n/**\n * The `DaffTreeComponent` allows you to render tree structures as interactable UI.\n *\n * @example Basic use of the tree component\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 hostDirectives: [{\n directive: DaffArticleEncapsulatedDirective,\n }],\n host: {\n 'class': 'daff-tree',\n },\n imports: [\n NgTemplateOutlet,\n ],\n})\nexport class DaffTreeComponent {\n private notifier = inject(DaffTreeNotifierService);\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 readonly renderMode = input<DaffTreeRenderMode>('in-dom');\n\n /**\n * A unique identifier for the tree instance.\n * Used as a prefix for all node IDs in the tree.\n * If not provided, an auto-incrementing number is used.\n */\n readonly id = input<string>(`${daffTreeId++}`);\n\n /**\n * The tree data you would like to render.\n */\n readonly tree = input<DaffTreeData<unknown>>();\n\n /**\n * The internal tree element.\n */\n private _tree = computed(() => {\n const tree = this.tree();\n return tree ? hydrateTree(tree, this.id()) : undefined;\n });\n\n /**\n * A revision counter incremented by notifications from tree items.\n * Used to trigger re-flattening when tree item state changes.\n */\n readonly _revision = signal(0);\n\n /**\n * @docs-private\n *\n * The flattened tree data. For debugging purposes, you can iterate through this if you want to inspect\n * the resulting array structure we computed to render the tree.\n */\n readonly flatTree = computed(() => {\n this._revision();\n const tree = this._tree();\n return tree ? flattenTree(tree, this.renderMode() === 'not-in-dom') : [];\n });\n\n /**\n * The template used to render tree-nodes that themselves have children.\n *\n * @docs-private\n */\n readonly withChildrenTemplate = contentChild<TemplateRef<any>>('daffTreeItemWithChildrenTpl');\n\n /**\n * The template used to render tree-nodes that have no children.\n *\n * @docs-private\n */\n readonly treeItemTemplate = contentChild<TemplateRef<any>>('daffTreeItemTpl');\n\n constructor() {\n this.notifier.notice$.subscribe(() => {\n this._revision.update((r) => r + 1);\n });\n }\n}\n","@for (node of flatTree(); track node.id) {\n\t<li [attr.aria-level]=\"node.level\" [class.hidden]=\"!node.visible\">\n\t\t<ng-container\n\t\t\t*ngTemplateOutlet=\"node.hasChildren ? withChildrenTemplate() : treeItemTemplate(); context: { $implicit: node }\">\n\t\t</ng-container>\n\t</li>\n}","import { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Walk up the tree from a leaf to the root applying the\n * visit function at each node along the way.\n */\nexport const walkUp = <T>(\n tree: DaffTreeUi<T>,\n visit: (tree: DaffTreeUi<T>) => DaffTreeUi<T>,\n): DaffTreeUi<T> => {\n while(tree.parent) {\n visit(tree);\n tree = tree.parent;\n }\n\n return tree;\n};\n","import { walkUp } from './walk-up';\nimport { DaffTreeUi } from '../interfaces/tree-ui';\n\n/**\n * Open all ancestor nodes of the given node so that it becomes visible in the tree.\n */\nexport const daffTreeOpenAncestors = <T>(node: DaffTreeUi<T>): void => {\n walkUp(node, (ancestor) => {\n ancestor.open = true;\n return ancestor;\n });\n};\n","/* eslint-disable quote-props */\n\nimport { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n inject,\n input,\n untracked,\n} from '@angular/core';\n\nimport { DaffTreeNotifierService } from '../tree/tree-notifier.service';\nimport { DaffTreeFlatNode } from '../utils/flatten-tree';\nimport { daffTreeOpenAncestors } from '../utils/open-ancestors';\n\n/**\n * The `DaffTreeItemDirective` marks elements as tree child nodes that interact with the parent tree structure.\n *\n * @example Using a `[daffTreeItem]`\n *\n * `[tree]` is a {@link DaffTreeData} and `[daff-tree]` is a {@link DaffTreeComponent}.\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 */\n@Directive({\n selector: '[daffTreeItem]',\n host: {\n 'class': 'daff-tree-item',\n '[class.selected]': 'selected()',\n '[class.parent]': 'isParent()',\n '[class.open]': 'open()',\n '[attr.id]': 'id()',\n '[attr.aria-expanded]': 'ariaExpanded()',\n '[style.--depth]': 'depth()',\n '(keydown.escape)': 'onEscape()',\n '(click)': 'onClick()',\n },\n})\nexport class DaffTreeItemDirective {\n private document = inject(DOCUMENT);\n private treeNotifier = inject(DaffTreeNotifierService);\n\n /**\n * The {@link DaffTreeFlatNode} associated with this specific tree item.\n */\n readonly node = input.required<DaffTreeFlatNode>();\n\n /**\n * Whether or not the tree item is the currently active item.\n * Note that there is no requirement that there only be one active item at a time.\n *\n * When a tree item becomes selected, all of its ancestor nodes\n * will be automatically opened so that the selected item is visible.\n */\n readonly selected = input(false);\n\n /**\n * The html `id` of the tree item. This is derived from the {@link DaffTreeData}.\n */\n protected readonly id = computed(() => 'tree-' + this.node().id);\n\n /**\n * A property indicating the depth of the tree.\n */\n protected readonly depth = computed(() => this.node().level);\n\n /**\n * Whether or not this node has children.\n */\n protected readonly isParent = computed(() => this.node().hasChildren);\n\n /**\n * Indicates whether or not the tree is `open`.\n */\n protected readonly open = computed(() => this.node()._treeRef.open);\n\n /**\n * Accessibility property, notifying users about whether\n * or not the tree item is open.\n *\n * @docs-private\n */\n protected readonly ariaExpanded = computed(() => {\n const node = this.node();\n return node.hasChildren ? (node._treeRef.open ? 'true' : 'false') : undefined;\n });\n\n constructor() {\n effect(() => {\n if(this.selected()) {\n const node = untracked(this.node);\n daffTreeOpenAncestors(node._treeRef);\n this.treeNotifier.notify();\n }\n });\n }\n\n /**\n * @docs-private\n */\n onEscape() {\n this.toggleParent(this.node());\n }\n\n /**\n * @docs-private\n */\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/**\n * @deprecated in favor of {@link DAFF_TREE_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffTreeComponent,\n DaffTreeItemDirective,\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';\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\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","import { DaffTreeComponent } from './tree/tree.component';\nimport { DaffTreeItemDirective } from './tree-item/tree-item.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_TREE_COMPONENTS = <const> [\n DaffTreeComponent,\n DaffTreeItemDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"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;AAE9E;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;IAqBvC;AAnBE;;;;;;AAMG;IACH,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IACzB;AAEA;;;;AAIG;IACH,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;IACzB;CACD;AA/BY,uBAAuB,GAAA,UAAA,CAAA;IADnC,MAAM,CAAC,EAAE;AACG,CAAA,EAAA,uBAAuB,CA+BnC;;AC1BD;;;AAGG;AACI,MAAM,WAAW,GAAG,CAAC,UAA+B,EAAE,WAAA,GAAuB,KAAK,KAAwB;IAC/G,MAAM,IAAI,GAAuB,EAAE;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qB;;;ACRvB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, Pipe } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/platform-browser';
|
|
4
4
|
|
|
5
5
|
const validateProperty = (object, prop) => {
|
|
@@ -22,6 +22,9 @@ const validateProperties = (object, props) => {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
class DaffYoutubePlayerComponent {
|
|
25
|
+
/**
|
|
26
|
+
* The width of the player.
|
|
27
|
+
*/
|
|
25
28
|
get width() {
|
|
26
29
|
return this._width;
|
|
27
30
|
}
|
|
@@ -29,6 +32,9 @@ class DaffYoutubePlayerComponent {
|
|
|
29
32
|
this._width = value;
|
|
30
33
|
validateProperty(this, 'width');
|
|
31
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The height of the player.
|
|
37
|
+
*/
|
|
32
38
|
get height() {
|
|
33
39
|
return this._height;
|
|
34
40
|
}
|
|
@@ -38,6 +44,9 @@ class DaffYoutubePlayerComponent {
|
|
|
38
44
|
}
|
|
39
45
|
constructor(sanitizer) {
|
|
40
46
|
this.sanitizer = sanitizer;
|
|
47
|
+
/**
|
|
48
|
+
* The title of the YouTube video.
|
|
49
|
+
*/
|
|
41
50
|
this.title = '';
|
|
42
51
|
}
|
|
43
52
|
/**
|
|
@@ -46,6 +55,9 @@ class DaffYoutubePlayerComponent {
|
|
|
46
55
|
ngOnInit() {
|
|
47
56
|
validateProperties(this, ['width', 'height']);
|
|
48
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @docs-private
|
|
60
|
+
*/
|
|
49
61
|
get _aspectRatio() {
|
|
50
62
|
return this.sanitizer.bypassSecurityTrustStyle(this.width + ' / ' + this.height);
|
|
51
63
|
}
|
|
@@ -55,12 +67,14 @@ class DaffYoutubePlayerComponent {
|
|
|
55
67
|
get maxWidth() {
|
|
56
68
|
return this.width + 'px';
|
|
57
69
|
}
|
|
58
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
59
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
70
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffYoutubePlayerComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffYoutubePlayerComponent, isStandalone: true, selector: "daff-youtube-player", inputs: { src: "src", title: "title", width: "width", height: "height" }, host: { properties: { "style.max-width": "maxWidth" } }, ngImport: i0, template: "@if (src) {\n <iframe class=\"daff-youtube-player\"\n [style.aspectRatio]=\"_aspectRatio\"\n [src]=\"src\"\n [title]=\"title\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n}", styles: [":host{display:block;border-radius:inherit;position:relative;width:100%}:host .daff-youtube-player{display:block;object-fit:cover;max-width:100%;max-height:100%;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
72
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffYoutubePlayerComponent, decorators: [{
|
|
62
74
|
type: Component,
|
|
63
|
-
args: [{ selector: 'daff-youtube-player', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
args: [{ selector: 'daff-youtube-player', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
76
|
+
'[style.max-width]': 'maxWidth',
|
|
77
|
+
}, template: "@if (src) {\n <iframe class=\"daff-youtube-player\"\n [style.aspectRatio]=\"_aspectRatio\"\n [src]=\"src\"\n [title]=\"title\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n}", styles: [":host{display:block;border-radius:inherit;position:relative;width:100%}:host .daff-youtube-player{display:block;object-fit:cover;max-width:100%;max-height:100%;width:100%}\n"] }]
|
|
64
78
|
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { src: [{
|
|
65
79
|
type: Input
|
|
66
80
|
}], title: [{
|
|
@@ -69,9 +83,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
69
83
|
type: Input
|
|
70
84
|
}], height: [{
|
|
71
85
|
type: Input
|
|
72
|
-
}], maxWidth: [{
|
|
73
|
-
type: HostBinding,
|
|
74
|
-
args: ['style.max-width']
|
|
75
86
|
}] } });
|
|
76
87
|
|
|
77
88
|
class DaffYoutubeSafePipe {
|
|
@@ -81,10 +92,10 @@ class DaffYoutubeSafePipe {
|
|
|
81
92
|
transform(url) {
|
|
82
93
|
return this.domSanitizer.bypassSecurityTrustResourceUrl(url);
|
|
83
94
|
}
|
|
84
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
85
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
95
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffYoutubeSafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
96
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffYoutubeSafePipe, isStandalone: true, name: "daffYoutubeSafe" }); }
|
|
86
97
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffYoutubeSafePipe, decorators: [{
|
|
88
99
|
type: Pipe,
|
|
89
100
|
args: [{
|
|
90
101
|
name: 'daffYoutubeSafe',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-design-youtube-player.mjs","sources":["../../../libs/design/youtube-player/src/youtube-player.component.ts","../../../libs/design/youtube-player/src/youtube-player.component.html","../../../libs/design/youtube-player/src/safe-url.pipe.ts","../../../libs/design/youtube-player/src/youtube-player.ts","../../../libs/design/youtube-player/src/daffodil-design-youtube-player.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"daffodil-design-youtube-player.mjs","sources":["../../../libs/design/youtube-player/src/youtube-player.component.ts","../../../libs/design/youtube-player/src/youtube-player.component.html","../../../libs/design/youtube-player/src/safe-url.pipe.ts","../../../libs/design/youtube-player/src/youtube-player.ts","../../../libs/design/youtube-player/src/daffodil-design-youtube-player.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnInit,\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeStyle,\n SafeUrl,\n} from '@angular/platform-browser';\n\nconst validateProperty = (object: Record<string, any>, prop: string) => {\n if (object[prop] === null || object[prop] === undefined || object[prop] === '') {\n throw new Error(`DaffYoutubePlayerComponent must have a defined ${prop} attribute.`);\n }\n};\n\nconst validateProperties = (object: Record<string, any>, props: string[]) => {\n const invalidProps = props.filter(prop => {\n try {\n validateProperty(object, prop);\n } catch(e) {\n return true;\n }\n return false;\n });\n\n if (invalidProps.length) {\n throw new Error(`DaffYoutubePlayerComponent must have the ${invalidProps.join(',')} attributes defined.`);\n }\n};\n\n@Component({\n selector: 'daff-youtube-player',\n templateUrl: './youtube-player.component.html',\n styleUrl: './youtube-player.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.max-width]': 'maxWidth',\n },\n})\nexport class DaffYoutubePlayerComponent implements OnInit {\n /**\n * The URL of the YouTube video.\n */\n @Input() src: SafeUrl;\n\n /**\n * The title of the YouTube video.\n */\n @Input() title = '';\n\n private _width: number;\n\n /**\n * The width of the player.\n */\n @Input()\n get width(): number {\n return this._width;\n }\n set width(value: number) {\n this._width = value;\n validateProperty(this, 'width');\n }\n\n private _height: number;\n\n /**\n * The height of the player.\n */\n @Input()\n get height(): number {\n return this._height;\n }\n set height(value: number) {\n this._height = value;\n validateProperty(this, 'height');\n }\n\n constructor(private sanitizer: DomSanitizer) {}\n\n /**\n * @docs-private\n */\n ngOnInit(): void {\n validateProperties(this, ['width', 'height']);\n }\n\n /**\n * @docs-private\n */\n get _aspectRatio(): SafeStyle {\n return this.sanitizer.bypassSecurityTrustStyle(this.width + ' / ' + this.height);\n }\n\n /**\n * @docs-private\n */\n get maxWidth(): string {\n return this.width + 'px';\n }\n}\n","@if (src) {\n <iframe class=\"daff-youtube-player\"\n [style.aspectRatio]=\"_aspectRatio\"\n [src]=\"src\"\n [title]=\"title\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>\n}","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\nimport {\n DomSanitizer,\n SafeUrl,\n} from '@angular/platform-browser';\n\n@Pipe({\n name: 'daffYoutubeSafe',\n})\nexport class DaffYoutubeSafePipe implements PipeTransform {\n constructor(private domSanitizer: DomSanitizer) {}\n transform(url: string): SafeUrl {\n return this.domSanitizer.bypassSecurityTrustResourceUrl(url);\n }\n}\n","import { DaffYoutubeSafePipe } from './safe-url.pipe';\nimport { DaffYoutubePlayerComponent } from './youtube-player.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_YOUTUBE_PLAYER_COMPONENTS = <const> [\n DaffYoutubePlayerComponent,\n DaffYoutubeSafePipe,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAE,IAAY,KAAI;IACrE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE;AAC9E,QAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,IAAI,CAAA,WAAA,CAAa,CAAC;IACtF;AACF,CAAC;AAED,MAAM,kBAAkB,GAAG,CAAC,MAA2B,EAAE,KAAe,KAAI;IAC1E,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,IAAG;AACvC,QAAA,IAAI;AACF,YAAA,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC;QAChC;QAAE,OAAM,CAAC,EAAE;AACT,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,KAAK;AACd,IAAA,CAAC,CAAC;AAEF,IAAA,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yCAAA,EAA4C,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,oBAAA,CAAsB,CAAC;IAC3G;AACF,CAAC;MAWY,0BAA0B,CAAA;AAarC;;AAEG;AACH,IAAA,IACI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;IACA,IAAI,KAAK,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;AACnB,QAAA,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC;IACjC;AAIA;;AAEG;AACH,IAAA,IACI,MA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