@daffodil/design 0.93.0 → 0.94.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.
Files changed (138) hide show
  1. package/README.md +0 -1
  2. package/accordion/src/accordion-theme.scss +2 -2
  3. package/article/src/article/_stops-article-cascade.scss +5 -1
  4. package/article/src/article-theme.scss +2 -2
  5. package/badge/README.md +85 -0
  6. package/badge/src/badge-theme.scss +197 -0
  7. package/beacon/README.md +61 -0
  8. package/beacon/src/beacon-theme.scss +61 -0
  9. package/breadcrumb/src/breadcrumb-theme.scss +2 -2
  10. package/button/src/button/basic/button-theme.scss +2 -2
  11. package/button/src/button/flat/flat-theme.scss +2 -2
  12. package/button/src/button/icon/icon-theme.scss +2 -2
  13. package/button/src/button/raised/raised-theme.scss +13 -13
  14. package/button/src/button/stroked/stroked-theme.scss +2 -2
  15. package/button/src/button/underline/underline-theme.scss +2 -2
  16. package/callout/src/callout-theme.scss +12 -2
  17. package/card/src/card/stroked/stroked-theme.scss +14 -22
  18. package/card/src/card-base-theme.scss +4 -4
  19. package/card/src/card-base.scss +13 -16
  20. package/fesm2022/daffodil-design-accordion.mjs +9 -15
  21. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-article.mjs +2 -2
  23. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-badge.mjs +87 -0
  25. package/fesm2022/daffodil-design-badge.mjs.map +1 -0
  26. package/fesm2022/daffodil-design-beacon.mjs +48 -0
  27. package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
  28. package/fesm2022/daffodil-design-breadcrumb.mjs +1 -1
  29. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-button.mjs +1 -1
  31. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-callout.mjs +2 -2
  33. package/fesm2022/daffodil-design-card.mjs +9 -11
  34. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-form-field.mjs +95 -115
  36. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  37. package/fesm2022/daffodil-design-form.mjs +5 -7
  38. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-image.mjs +41 -98
  40. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-input.mjs +3 -3
  42. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  43. package/fesm2022/daffodil-design-list.mjs +16 -21
  44. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-media-gallery.mjs +56 -61
  46. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-menu.mjs +61 -38
  48. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-modal.mjs +2 -2
  50. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-native-select.mjs +3 -3
  52. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-notification.mjs +17 -20
  54. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-paginator.mjs +71 -76
  56. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-progress-bar.mjs +33 -53
  58. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-select.mjs +1 -1
  60. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-sidebar.mjs +2 -2
  62. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-spinner.mjs +17 -16
  64. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-switch.mjs +20 -29
  66. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-tabs.mjs +86 -88
  68. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-tag.mjs +33 -28
  70. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-text-snippet.mjs +18 -23
  72. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-textarea.mjs +3 -3
  74. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-toast.mjs +19 -20
  76. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  77. package/fesm2022/daffodil-design.mjs +111 -80
  78. package/fesm2022/daffodil-design.mjs.map +1 -1
  79. package/form/src/hint/hint-theme.scss +2 -2
  80. package/form-field/src/form-field-theme.scss +2 -2
  81. package/hero/src/hero-theme.scss +12 -2
  82. package/list/README.md +10 -0
  83. package/list/src/list-theme.scss +2 -2
  84. package/media-gallery/README.md +0 -5
  85. package/media-gallery/src/media-gallery-theme.scss +2 -2
  86. package/menu/README.md +5 -0
  87. package/menu/src/menu-theme.scss +4 -4
  88. package/notification/src/notification-theme.scss +2 -2
  89. package/package.json +1 -1
  90. package/paginator/src/paginator-theme.scss +2 -2
  91. package/progress-bar/README.md +1 -1
  92. package/progress-bar/src/progress-bar-theme.scss +2 -2
  93. package/scss/global.scss +4 -0
  94. package/scss/state/skeleton/_mixins.scss +2 -2
  95. package/scss/theme/default.scss +15 -0
  96. package/scss/theme.scss +4 -8
  97. package/scss/theming/_configure-palette.scss +5 -1
  98. package/scss/theming/_get-theme-mode.scss +1 -1
  99. package/scss/theming/_index.scss +2 -3
  100. package/scss/theming/_light-dark.scss +37 -12
  101. package/scss/theming/color-shift/_color-shift.scss +56 -0
  102. package/scss/theming/color-shift/_color-shift.spec.scss +107 -0
  103. package/scss/theming/color-shift/_index.scss +1 -0
  104. package/scss/theming/{_daff-theme.scss → default/_daff-theme.scss} +4 -4
  105. package/scss/theming/default/_index.scss +1 -0
  106. package/select/src/select-theme.scss +5 -3
  107. package/switch/src/switch-theme.scss +2 -2
  108. package/tabs/src/tabs-theme.scss +2 -2
  109. package/tag/README.md +10 -6
  110. package/tag/src/tag-theme.scss +102 -5
  111. package/toast/src/toast-theme.scss +2 -2
  112. package/tree/src/tree-theme.scss +2 -2
  113. package/types/daffodil-design-accordion.d.ts +4 -4
  114. package/types/daffodil-design-badge.d.ts +63 -0
  115. package/types/daffodil-design-beacon.d.ts +26 -0
  116. package/types/daffodil-design-card.d.ts +2 -2
  117. package/types/daffodil-design-form-field.d.ts +34 -31
  118. package/types/daffodil-design-form.d.ts +2 -2
  119. package/types/daffodil-design-image.d.ts +15 -28
  120. package/types/daffodil-design-list.d.ts +3 -3
  121. package/types/daffodil-design-media-gallery.d.ts +31 -20
  122. package/types/daffodil-design-menu.d.ts +51 -20
  123. package/types/daffodil-design-notification.d.ts +5 -6
  124. package/types/daffodil-design-paginator.d.ts +20 -25
  125. package/types/daffodil-design-progress-bar.d.ts +16 -21
  126. package/types/daffodil-design-spinner.d.ts +2 -2
  127. package/types/daffodil-design-switch.d.ts +7 -8
  128. package/types/daffodil-design-tabs.d.ts +29 -29
  129. package/types/daffodil-design-tag.d.ts +22 -16
  130. package/types/daffodil-design-text-snippet.d.ts +9 -9
  131. package/types/daffodil-design.d.ts +61 -41
  132. package/fesm2022/daffodil-design-loading-icon.mjs +0 -67
  133. package/fesm2022/daffodil-design-loading-icon.mjs.map +0 -1
  134. package/loading-icon/README.md +0 -59
  135. package/loading-icon/src/loading-icon-theme.scss +0 -103
  136. package/scss/theming/illuminate/illuminate.scss +0 -149
  137. package/scss/theming/illuminate/illuminate.spec.scss +0 -15
  138. package/types/daffodil-design-loading-icon.d.ts +0 -31
@@ -1,6 +1,6 @@
1
1
  import { NgTemplateOutlet, CommonModule } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { isDevMode, Input, Inject, Directive, EventEmitter, contentChildren, computed, signal, ElementRef, ViewChildren, Output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import { computed, input, isDevMode, Inject, Directive, output, contentChildren, viewChildren, ElementRef, signal, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
4
  import * as i1 from '@daffodil/design';
5
5
  import { DaffSelectableDirective, DaffArticleEncapsulatedDirective, DaffSkeletonableDirective } from '@daffodil/design';
6
6
  import { createSingleInjectionToken } from '@daffodil/core';
@@ -20,22 +20,6 @@ let uniqueThumbnailId = 0;
20
20
  * ```
21
21
  */
22
22
  class DaffThumbnailDirective {
23
- /**
24
- * @docs-private
25
- *
26
- * The autogenerated unique id for a thumbnail.
27
- */
28
- get id() {
29
- return this.gallery.id + '-thumbnail-' + this._increment;
30
- }
31
- /**
32
- * @docs-private
33
- *
34
- * The unique id of the selected thumbnail.
35
- */
36
- get selectedThumbnailId() {
37
- return this.id + '-selected';
38
- }
39
23
  constructor(
40
24
  /**
41
25
  * @docs-private
@@ -48,28 +32,40 @@ class DaffThumbnailDirective {
48
32
  this.gallery = gallery;
49
33
  this.templateRef = templateRef;
50
34
  this._increment = uniqueThumbnailId;
35
+ /**
36
+ * @docs-private
37
+ *
38
+ * The autogenerated unique id for a thumbnail.
39
+ */
40
+ this.id = computed(() => this.gallery.id() + '-thumbnail-' + this._increment, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
41
+ /**
42
+ * @docs-private
43
+ *
44
+ * The unique id of the selected thumbnail.
45
+ */
46
+ this.selectedThumbnailId = computed(() => this.id() + '-selected', ...(ngDevMode ? [{ debugName: "selectedThumbnailId" }] : /* istanbul ignore next */ []));
51
47
  /**
52
48
  * The file path to a thumbnail, presumably an image.
53
49
  */
54
- this.thumbnailSrc = undefined;
50
+ this.thumbnailSrc = input(undefined, ...(ngDevMode ? [{ debugName: "thumbnailSrc" }] : /* istanbul ignore next */ []));
55
51
  /**
56
52
  * Provides an accessible label for a thumbnail.
57
53
  */
58
- this.label = undefined;
54
+ this.label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
59
55
  /** Indicates whether the thumbnail represents a video. */
60
- this.isVideo = false;
56
+ this.isVideo = input(false, ...(ngDevMode ? [{ debugName: "isVideo" }] : /* istanbul ignore next */ []));
61
57
  uniqueThumbnailId++;
62
58
  }
63
59
  /**
64
60
  * @docs-private
65
61
  */
66
62
  ngOnInit() {
67
- if (!this.label && isDevMode()) {
68
- console.warn('The thumbnail ' + this.id + ' is missing a label.');
63
+ if (!this.label() && isDevMode()) {
64
+ console.warn('The thumbnail ' + this.id() + ' is missing a label.');
69
65
  }
70
66
  }
71
67
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThumbnailDirective, deps: [{ token: DAFF_MEDIA_GALLERY_TOKEN }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
72
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffThumbnailDirective, isStandalone: true, selector: "[daffThumbnail]", inputs: { thumbnailSrc: "thumbnailSrc", label: "label", isVideo: "isVideo" }, ngImport: i0 }); }
68
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffThumbnailDirective, isStandalone: true, selector: "[daffThumbnail]", inputs: { thumbnailSrc: { classPropertyName: "thumbnailSrc", publicName: "thumbnailSrc", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, isVideo: { classPropertyName: "isVideo", publicName: "isVideo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
73
69
  }
74
70
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThumbnailDirective, decorators: [{
75
71
  type: Directive,
@@ -79,15 +75,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
79
75
  }], ctorParameters: () => [{ type: undefined, decorators: [{
80
76
  type: Inject,
81
77
  args: [DAFF_MEDIA_GALLERY_TOKEN]
82
- }] }, { type: i0.TemplateRef }], propDecorators: { thumbnailSrc: [{
83
- type: Input
84
- }], label: [{
85
- type: Input
86
- }], isVideo: [{
87
- type: Input
88
- }] } });
78
+ }] }, { type: i0.TemplateRef }], propDecorators: { thumbnailSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbnailSrc", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], isVideo: [{ type: i0.Input, args: [{ isSignal: true, alias: "isVideo", required: false }] }] } });
89
79
 
90
- /* eslint-disable quote-props */
91
80
  let uniqueGalleryId = 0;
92
81
  /**
93
82
  * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.
@@ -101,36 +90,38 @@ let uniqueGalleryId = 0;
101
90
  * ```
102
91
  */
103
92
  class DaffMediaGalleryComponent {
104
- /**
105
- * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.
106
- */
107
- get id() {
108
- return this._id;
109
- }
110
- set id(val) {
111
- if (!val) {
112
- return;
113
- }
114
- this._id = val;
115
- }
116
- ;
117
93
  /**
118
94
  * @docs-private
119
95
  */
120
96
  constructor(skeletonDirective) {
121
97
  this.skeletonDirective = skeletonDirective;
122
98
  /**
123
- * The internal ID of the gallery.
99
+ * The auto-generated ID of the gallery.
100
+ */
101
+ this._defaultId = 'media-gallery-' + uniqueGalleryId;
102
+ /**
103
+ * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.
124
104
  */
125
- this._id = 'media-gallery-' + uniqueGalleryId;
105
+ // eslint-disable-next-line @angular-eslint/no-input-rename
106
+ this.customId = input(undefined, { ...(ngDevMode ? { debugName: "customId" } : /* istanbul ignore next */ {}), alias: 'id' });
107
+ /**
108
+ * @docs-private
109
+ *
110
+ * The resolved ID of the gallery: the custom ID when provided, otherwise the auto-generated one.
111
+ */
112
+ this.id = computed(() => this.customId() || this._defaultId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
126
113
  /**
127
114
  * An event indicating that the selected media gallery element has changed.
128
115
  */
129
- this.elementChange = new EventEmitter();
116
+ this.elementChange = output();
130
117
  /**
131
118
  * @docs-private
132
119
  */
133
120
  this._thumbnails = contentChildren(DaffThumbnailDirective, ...(ngDevMode ? [{ debugName: "_thumbnails" }] : /* istanbul ignore next */ []));
121
+ /**
122
+ * @docs-private
123
+ */
124
+ this._thumbnailButtons = viewChildren('thumbnailButtons', { ...(ngDevMode ? { debugName: "_thumbnailButtons" } : /* istanbul ignore next */ {}), read: ElementRef });
134
125
  /**
135
126
  * @docs-private
136
127
  */
@@ -152,8 +143,19 @@ class DaffMediaGalleryComponent {
152
143
  get skeleton() {
153
144
  return this.skeletonDirective.skeleton;
154
145
  }
146
+ /**
147
+ * @docs-private
148
+ *
149
+ * Whether the given thumbnail is the currently selected one.
150
+ */
151
+ _isSelected(thumbnail) {
152
+ return thumbnail === this._selectedThumbnail();
153
+ }
155
154
  focusSelected() {
156
- this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();
155
+ const index = this._selectedIndex();
156
+ if (index !== null) {
157
+ this._thumbnailButtons().at(index)?.nativeElement.focus();
158
+ }
157
159
  }
158
160
  /**
159
161
  * Select a specific entry in the media gallery by its index.
@@ -213,9 +215,9 @@ class DaffMediaGalleryComponent {
213
215
  }
214
216
  }
215
217
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryComponent, deps: [{ token: i1.DaffSkeletonableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
216
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { id: "id" }, outputs: { elementChange: "elementChange" }, host: { properties: { "attr.id": "id" }, classAttribute: "daff-media-gallery" }, providers: [
218
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { customId: { classPropertyName: "customId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { elementChange: "elementChange" }, host: { properties: { "attr.id": "id()" }, classAttribute: "daff-media-gallery" }, providers: [
217
219
  { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
218
- ], queries: [{ propertyName: "_thumbnails", predicate: DaffThumbnailDirective, isSignal: true }], viewQueries: [{ propertyName: "_thumbnailButtons", predicate: ["thumbnailButtons"], descendants: true, read: ElementRef }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, { directive: i1.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media(min-width:1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media(min-width:480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media(min-width:1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media(min-width:480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media(min-width:1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DaffSelectableDirective, selector: "[daffSelected]", inputs: ["selected"], outputs: ["becameSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
220
+ ], queries: [{ propertyName: "_thumbnails", predicate: DaffThumbnailDirective, isSignal: true }], viewQueries: [{ propertyName: "_thumbnailButtons", predicate: ["thumbnailButtons"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, { directive: i1.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"_isSelected(thumbnail)\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label() ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"_isSelected(thumbnail) ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId()\"\n\t\t\t\t[attr.tabindex]=\"_isSelected(thumbnail) ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id()\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc()) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc()\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo()) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\"></div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId()\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media(min-width:1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media(min-width:480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media(min-width:1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media(min-width:480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media(min-width:1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DaffSelectableDirective, selector: "[daffSelected]", inputs: ["selected"], outputs: ["becameSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
219
221
  }
220
222
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
221
223
  type: Component,
@@ -228,21 +230,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
228
230
  inputs: ['skeleton'],
229
231
  },
230
232
  ], host: {
231
- 'class': 'daff-media-gallery',
232
- '[attr.id]': 'id',
233
+ class: 'daff-media-gallery',
234
+ '[attr.id]': 'id()',
233
235
  }, imports: [
234
236
  DaffThumbnailDirective,
235
237
  NgTemplateOutlet,
236
238
  DaffSelectableDirective,
237
- ], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media(min-width:1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media(min-width:480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media(min-width:1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media(min-width:480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media(min-width:1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"] }]
238
- }], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { id: [{
239
- type: Input
240
- }], elementChange: [{
241
- type: Output
242
- }], _thumbnails: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DaffThumbnailDirective), { isSignal: true }] }], _thumbnailButtons: [{
243
- type: ViewChildren,
244
- args: ['thumbnailButtons', { read: ElementRef }]
245
- }] } });
239
+ ], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"_isSelected(thumbnail)\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label() ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"_isSelected(thumbnail) ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId()\"\n\t\t\t\t[attr.tabindex]=\"_isSelected(thumbnail) ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id()\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc()) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc()\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo()) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\"></div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId()\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media(min-width:1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media(min-width:480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media(min-width:1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media(min-width:480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media(min-width:1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media(min-width:1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"] }]
240
+ }], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { customId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], elementChange: [{ type: i0.Output, args: ["elementChange"] }], _thumbnails: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DaffThumbnailDirective), { isSignal: true }] }], _thumbnailButtons: [{ type: i0.ViewChildren, args: ['thumbnailButtons', { ...{ read: ElementRef }, isSignal: true }] }] } });
246
241
 
247
242
  /**
248
243
  * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n Input,\n TemplateRef,\n OnInit,\n isDevMode,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n private _increment = uniqueThumbnailId;\n\n /**\n * @docs-private\n *\n * The autogenerated unique id for a thumbnail.\n */\n get id(): string {\n return this.gallery.id + '-thumbnail-' + this._increment;\n }\n\n /**\n * @docs-private\n *\n * The unique id of the selected thumbnail.\n */\n get selectedThumbnailId(): string {\n return this.id + '-selected';\n }\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n @Input() thumbnailSrc = undefined;\n\n /**\n * Provides an accessible label for a thumbnail.\n */\n @Input() label: string = undefined;\n\n /** Indicates whether the thumbnail represents a video. */\n @Input() isVideo = false;\n\n constructor(\n /**\n * @docs-private\n */\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n /**\n * @docs-private\n */\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label && isDevMode()) {\n console.warn('The thumbnail ' + this.id + ' is missing a label.');\n }\n }\n}\n","/* eslint-disable quote-props */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ChangeDetectionStrategy,\n Input,\n QueryList,\n ViewChildren,\n ElementRef,\n Output,\n EventEmitter,\n contentChildren,\n signal,\n computed,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.\n *\n * ```html\n * <daff-media-gallery>\n * <ng-template daffThumbnail thumbnailSrc=\"/thumbnail-path.jpg\" label=\"Your description\">\n * <daff-image src=\"/image-path.jpg\" alt=\"Your description\" width=\"100\" height=\"100\"></daff-image>\n * </ng-template>\n * </daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrls: ['./media-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n host: {\n 'class': 'daff-media-gallery',\n '[attr.id]': 'id',\n },\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n /**\n * The internal ID of the gallery.\n */\n private _id = 'media-gallery-' + uniqueGalleryId;\n\n /**\n * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.\n */\n @Input()\n get id() {\n return this._id;\n }\n set id(val: string | undefined | null) {\n if(!val){\n return;\n }\n this._id = val;\n };\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n @Output() elementChange: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n @ViewChildren('thumbnailButtons', { read: ElementRef }) private _thumbnailButtons: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n private focusSelected() {\n this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();\n }\n\n /**\n * Select a specific entry in the media gallery by its index.\n *\n * @param index The index to set, starting at 0.\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the first element.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the last element of the gallery.\n *\n * @param Whether to move focus to the newly selected item.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n}\n","<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"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ACP,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACI,MAAM,6BAA6B,GAAW;IACnD,yBAAyB;IACzB,sBAAsB;;;ACRxB;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n TemplateRef,\n OnInit,\n isDevMode,\n input,\n computed,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n private _increment = uniqueThumbnailId;\n\n /**\n * @docs-private\n *\n * The autogenerated unique id for a thumbnail.\n */\n id = computed(() => this.gallery.id() + '-thumbnail-' + this._increment);\n\n /**\n * @docs-private\n *\n * The unique id of the selected thumbnail.\n */\n selectedThumbnailId = computed(() => this.id() + '-selected');\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n thumbnailSrc = input<string | undefined>(undefined);\n\n /**\n * Provides an accessible label for a thumbnail.\n */\n label = input<string | undefined>(undefined);\n\n /** Indicates whether the thumbnail represents a video. */\n isVideo = input(false);\n\n constructor(\n /**\n * @docs-private\n */\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n /**\n * @docs-private\n */\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label() && isDevMode()) {\n console.warn('The thumbnail ' + this.id() + ' is missing a label.');\n }\n }\n}\n","\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n ChangeDetectionStrategy,\n ElementRef,\n contentChildren,\n viewChildren,\n signal,\n computed,\n input,\n output,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.\n *\n * ```html\n * <daff-media-gallery>\n * <ng-template daffThumbnail thumbnailSrc=\"/thumbnail-path.jpg\" label=\"Your description\">\n * <daff-image src=\"/image-path.jpg\" alt=\"Your description\" width=\"100\" height=\"100\"></daff-image>\n * </ng-template>\n * </daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrl: './media-gallery.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n host: {\n class: 'daff-media-gallery',\n '[attr.id]': 'id()',\n },\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n /**\n * The auto-generated ID of the gallery.\n */\n private _defaultId = 'media-gallery-' + uniqueGalleryId;\n\n /**\n * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n customId = input<string | undefined | null>(undefined, { alias: 'id' });\n\n /**\n * @docs-private\n *\n * The resolved ID of the gallery: the custom ID when provided, otherwise the auto-generated one.\n */\n id = computed(() => this.customId() || this._defaultId);\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n elementChange = output<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n private _thumbnailButtons = viewChildren('thumbnailButtons', { read: ElementRef });\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n /**\n * @docs-private\n *\n * Whether the given thumbnail is the currently selected one.\n */\n _isSelected(thumbnail: DaffThumbnailDirective): boolean {\n return thumbnail === this._selectedThumbnail();\n }\n\n private focusSelected() {\n const index = this._selectedIndex();\n if(index !== null) {\n this._thumbnailButtons().at(index)?.nativeElement.focus();\n }\n }\n\n /**\n * Select a specific entry in the media gallery by its index.\n *\n * @param index The index to set, starting at 0.\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the first element.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the last element of the gallery.\n *\n * @param Whether to move focus to the newly selected item.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n}\n","<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"_isSelected(thumbnail)\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label() ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"_isSelected(thumbnail) ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId()\"\n\t\t\t\t[attr.tabindex]=\"_isSelected(thumbnail) ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id()\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc()) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc()\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo()) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\"></div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId()\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,EACX,KAAK,EAAE,wBAAwB;AAC/B;;AAEG;AACH,QAAQ,EAAE,4BAA4B,GACvC,GAAG,0BAA0B,CAA+B,0BAA0B,CAAC;;ACGxF,IAAI,iBAAiB,GAAG,CAAC;AAEzB;;;;;;AAMG;MAIU,sBAAsB,CAAA;AA+BjC,IAAA,WAAA;AACE;;AAEG;IACsC,OAAqC;AAC9E;;AAEG;IACI,WAAiC,EAAA;QAJC,IAAA,CAAA,OAAO,GAAP,OAAO;QAIzC,IAAA,CAAA,WAAW,GAAX,WAAW;QArCZ,IAAA,CAAA,UAAU,GAAG,iBAAiB;AAEtC;;;;AAIG;AACH,QAAA,IAAA,CAAA,EAAE,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC,UAAU,yEAAC;AAExE;;;;AAIG;AACH,QAAA,IAAA,CAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,EAAE,GAAG,WAAW,0FAAC;AAE7D;;AAEG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAqB,SAAS,mFAAC;AAEnD;;AAEG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAqB,SAAS,4EAAC;;AAG5C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,KAAK,8EAAC;AAYpB,QAAA,iBAAiB,EAAE;IACrB;AAEA;;AAEG;IACH,QAAQ,GAAA;QACN,IAAG,CAAC,IAAI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AAA,CAAA,CAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FASH,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACI,MAAM,6BAA6B,GAAW;IACnD,yBAAyB;IACzB,sBAAsB;;;ACRxB;;AAEG;;;;"}
@@ -1,8 +1,8 @@
1
1
  import * as i1 from '@angular/cdk/overlay';
2
- import { OverlayModule } from '@angular/cdk/overlay';
2
+ import { STANDARD_DROPDOWN_BELOW_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
3
3
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
4
4
  import * as i0 from '@angular/core';
5
- import { Injector, Type, TemplateRef, Injectable, signal, input, computed, Input, Directive, ContentChild, ChangeDetectionStrategy, Component, ContentChildren, Inject, ViewEncapsulation, NgModule } from '@angular/core';
5
+ import { Injector, Type, TemplateRef, Injectable, signal, input, computed, Directive, ContentChild, ChangeDetectionStrategy, Component, ContentChildren, Inject, ViewEncapsulation, NgModule } from '@angular/core';
6
6
  import { BehaviorSubject, map, Subject, takeUntil } from 'rxjs';
7
7
  import { createConfigInjectionToken, createSingletonInjectionToken } from '@daffodil/core';
8
8
  import { CommonModule } from '@angular/common';
@@ -12,6 +12,8 @@ import { FocusKeyManager } from '@angular/cdk/a11y';
12
12
 
13
13
  const daffMenuConfigDefault = {
14
14
  menuId: '',
15
+ xPosition: 'after',
16
+ yPosition: 'below',
15
17
  };
16
18
  const {
17
19
  /**
@@ -23,34 +25,39 @@ token: DAFF_MENU_CONFIG,
23
25
  */
24
26
  provider: provideDaffMenuConfig, } = createConfigInjectionToken(daffMenuConfigDefault, 'DAFF_MENU_CONFIG');
25
27
 
26
- function daffMenuCreateOverlay(overlay, element, config = {}) {
27
- return overlay.create({
28
- hasBackdrop: true,
29
- backdropClass: 'cdk-overlay-transparent-backdrop',
30
- scrollStrategy: overlay.scrollStrategies.block(),
31
- disposeOnNavigation: true,
32
- positionStrategy: overlay
33
- .position()
34
- .flexibleConnectedTo(element)
35
- .withPositions([
36
- {
37
- originX: 'start',
38
- originY: 'bottom',
39
- overlayX: 'start',
40
- overlayY: 'top',
41
- offsetY: 0,
42
- },
43
- {
44
- originX: 'start',
45
- originY: 'top',
46
- overlayX: 'start',
47
- overlayY: 'bottom',
48
- },
49
- ]),
50
- ...config,
51
- });
52
- }
53
- ;
28
+ /**
29
+ * The CDK connected position for a menu. `yPosition` controls whether the menu drops
30
+ * below or rises above the activator; `xPosition` controls which edges line up. The menu
31
+ * stays anchored to the activator, so this is a single placement rather than a set of
32
+ * fallbacks.
33
+ */
34
+ const daffMenuConnectedPosition = (xPosition, yPosition) => {
35
+ const x = xPosition === 'before' ? 'end' : 'start';
36
+ return {
37
+ originX: x,
38
+ overlayX: x,
39
+ originY: yPosition === 'above' ? 'top' : 'bottom',
40
+ overlayY: yPosition === 'above' ? 'bottom' : 'top',
41
+ };
42
+ };
43
+ const daffMenuCreateOverlay = (overlay, element, xPosition = 'after', yPosition = 'below', config = {}) => overlay.create({
44
+ hasBackdrop: true,
45
+ backdropClass: 'cdk-overlay-transparent-backdrop',
46
+ panelClass: 'daff-menu-overlay',
47
+ scrollStrategy: overlay.scrollStrategies.block(),
48
+ disposeOnNavigation: true,
49
+ positionStrategy: overlay
50
+ .position()
51
+ .flexibleConnectedTo(element)
52
+ .withFlexibleDimensions(true)
53
+ .withPush(false)
54
+ .withViewportMargin(24)
55
+ .withPositions([
56
+ daffMenuConnectedPosition(xPosition, yPosition),
57
+ ...STANDARD_DROPDOWN_BELOW_POSITIONS,
58
+ ]),
59
+ ...config,
60
+ });
54
61
 
55
62
  class DaffMenuService {
56
63
  constructor(overlay, injector) {
@@ -64,7 +71,7 @@ class DaffMenuService {
64
71
  */
65
72
  async _createOverlay(activatorElement, component, config) {
66
73
  if (!this._overlay) {
67
- this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);
74
+ this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element, config?.xPosition, config?.yPosition);
68
75
  if (typeof component === 'object' && component?.import) {
69
76
  component = await component.import();
70
77
  }
@@ -141,11 +148,23 @@ class DaffMenuActivatorDirective {
141
148
  this._destroyed$ = new Subject();
142
149
  this._defaultMenuId = daffNextMenuId();
143
150
  this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
151
+ /**
152
+ * The menu content to display when activated.
153
+ */
154
+ this.daffMenuActivator = input(...(ngDevMode ? [undefined, { debugName: "daffMenuActivator" }] : /* istanbul ignore next */ []));
144
155
  /**
145
156
  * An optional ID for the activator.
146
157
  * When set, the menu's ID is derived as `${id}-menu`.
147
158
  */
148
159
  this.id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
160
+ /**
161
+ * The horizontal alignment of the menu relative to the activator. Defaults to `after`.
162
+ */
163
+ this.xPosition = input('after', ...(ngDevMode ? [{ debugName: "xPosition" }] : /* istanbul ignore next */ []));
164
+ /**
165
+ * The vertical position of the menu relative to the activator. Defaults to `below`.
166
+ */
167
+ this.yPosition = input('below', ...(ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []));
149
168
  /**
150
169
  * The resolved menu ID.
151
170
  */
@@ -177,10 +196,12 @@ class DaffMenuActivatorDirective {
177
196
  */
178
197
  onClick(event) {
179
198
  event.preventDefault();
180
- this.service.open(this.viewContainerRef, this.daffMenuActivator, { menuId: this.menuId() });
199
+ this.service.open(this.viewContainerRef, this.daffMenuActivator(), { menuId: this.menuId(), xPosition: this.xPosition(), yPosition: this.yPosition() });
181
200
  }
182
201
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuActivatorDirective, deps: [{ token: DaffMenuService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
183
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: { classPropertyName: "daffMenuActivator", publicName: "daffMenuActivator", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "click": "onClick($event)" }, properties: { "attr.aria-expanded": "ariaExpanded", "attr.aria-controls": "_open ? menuId() : null" } }, exportAs: ["daffMenuActivator"], ngImport: i0 }); }
202
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: { classPropertyName: "daffMenuActivator", publicName: "daffMenuActivator", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, xPosition: { classPropertyName: "xPosition", publicName: "xPosition", isSignal: true, isRequired: false, transformFunction: null }, yPosition: { classPropertyName: "yPosition", publicName: "yPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "menu" }, listeners: { "click": "onClick($event)" }, properties: { "attr.aria-expanded": "ariaExpanded", "attr.aria-controls": "_open ? menuId() : null" } }, providers: [
203
+ DaffMenuService,
204
+ ], exportAs: ["daffMenuActivator"], ngImport: i0 }); }
184
205
  }
185
206
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuActivatorDirective, decorators: [{
186
207
  type: Directive,
@@ -193,10 +214,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
193
214
  '[attr.aria-controls]': '_open ? menuId() : null',
194
215
  },
195
216
  exportAs: 'daffMenuActivator',
217
+ providers: [
218
+ DaffMenuService,
219
+ ],
196
220
  }]
197
- }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { daffMenuActivator: [{
198
- type: Input
199
- }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
221
+ }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { daffMenuActivator: [{ type: i0.Input, args: [{ isSignal: true, alias: "daffMenuActivator", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], xPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "xPosition", required: false }] }], yPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "yPosition", required: false }] }] } });
200
222
 
201
223
  /**
202
224
  * Injection token/provider pair used to identify menu items.
@@ -322,7 +344,7 @@ class DaffMenuComponent {
322
344
  }
323
345
  }
324
346
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuComponent, deps: [{ token: i1$1.ConfigurableFocusTrapFactory }, { token: i0.ElementRef }, { token: DaffMenuService }, { token: DAFF_MENU_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
325
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { attributes: { "tabindex": "0", "role": "menu" }, listeners: { "keydown": "handleKeydown($event)" }, properties: { "id": "config.menuId" }, classAttribute: "daff-menu" }, queries: [{ propertyName: "_items", predicate: DAFF_MENU_ITEM_TOKEN }], ngImport: i0, template: "<ng-content></ng-content>", styles: [".daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
347
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { attributes: { "tabindex": "0", "role": "menu" }, listeners: { "keydown": "handleKeydown($event)" }, properties: { "id": "config.menuId" }, classAttribute: "daff-menu" }, queries: [{ propertyName: "_items", predicate: DAFF_MENU_ITEM_TOKEN }], ngImport: i0, template: "<ng-content></ng-content>", styles: [".daff-menu-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
326
348
  }
327
349
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMenuComponent, decorators: [{
328
350
  type: Component,
@@ -334,7 +356,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
334
356
  '(keydown)': 'handleKeydown($event)',
335
357
  }, imports: [
336
358
  DaffMenuItemComponent,
337
- ], template: "<ng-content></ng-content>", styles: [".daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"] }]
359
+ ], template: "<ng-content></ng-content>", styles: [".daff-menu-overlay>*:not(.daff-menu){display:contents}.daff-menu{display:block;min-width:7rem;max-width:20rem;border-radius:.25rem;padding:.5rem;overflow-y:auto}.daff-menu-item{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:.5rem;font-size:1rem;line-height:1.25rem;border:none;border-radius:.25rem;margin:0;padding:.75rem 1rem;text-decoration:none;width:100%}\n"] }]
338
360
  }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: DaffMenuService }, { type: undefined, decorators: [{
339
361
  type: Inject,
340
362
  args: [DAFF_MENU_CONFIG]
@@ -392,6 +414,7 @@ const DAFF_MENU_COMPONENTS = [
392
414
  DaffMenuComponent,
393
415
  DaffMenuActivatorDirective,
394
416
  DaffMenuItemComponent,
417
+ DaffPrefixDirective,
395
418
  ];
396
419
 
397
420
  /**