@daffodil/design 0.94.1 → 0.95.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.
Files changed (170) hide show
  1. package/README.md +1 -2
  2. package/accordion/src/accordion-theme.scss +4 -4
  3. package/article/README.md +4 -27
  4. package/article/src/article-theme.scss +14 -14
  5. package/badge/src/badge-theme.scss +0 -6
  6. package/button/README.md +0 -4
  7. package/button/src/button/basic/button-theme.scss +17 -42
  8. package/button/src/button/button-base.scss +12 -3
  9. package/button/src/button/flat/flat-theme.scss +14 -12
  10. package/button/src/button/icon/icon-theme.scss +19 -40
  11. package/button/src/button/stroked/stroked-theme.scss +22 -36
  12. package/card/src/card/stroked/stroked-theme.scss +1 -1
  13. package/card/src/card-base.scss +0 -1
  14. package/fesm2022/daffodil-design-accordion.mjs +285 -188
  15. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-article.mjs +578 -340
  17. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-badge.mjs +166 -84
  19. package/fesm2022/daffodil-design-badge.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-beacon.mjs +109 -47
  21. package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +541 -408
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +349 -224
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +496 -327
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +373 -313
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +103 -60
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +441 -352
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +155 -57
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +349 -234
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image-lite.mjs +60 -0
  41. package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
  42. package/fesm2022/daffodil-design-image.mjs +245 -107
  43. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-input.mjs +217 -164
  45. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +308 -170
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
  49. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-menu.mjs +525 -417
  51. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-modal.mjs +680 -450
  53. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-native-select.mjs +175 -166
  55. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-navbar.mjs +145 -68
  57. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-notification.mjs +376 -226
  59. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-paginator.mjs +296 -192
  61. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
  63. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-radio.mjs +382 -300
  65. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-select.mjs +424 -364
  67. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-sidebar.mjs +874 -887
  69. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-spinner.mjs +156 -99
  71. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-switch.mjs +176 -106
  73. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-tabs.mjs +685 -427
  75. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-tag.mjs +251 -133
  77. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-testing.mjs +4 -16
  79. package/fesm2022/daffodil-design-testing.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
  81. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-textarea.mjs +170 -150
  83. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-toast.mjs +658 -481
  85. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-tree.mjs +456 -469
  87. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
  89. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  90. package/fesm2022/daffodil-design.mjs +1628 -1650
  91. package/fesm2022/daffodil-design.mjs.map +1 -1
  92. package/form-field/README.md +0 -4
  93. package/form-field/src/form-field-theme.scss +12 -4
  94. package/image/README.md +4 -0
  95. package/image-lite/README.md +58 -0
  96. package/image-lite/src/image-theme.scss +18 -0
  97. package/list/src/list-base.scss +3 -4
  98. package/list/src/list-theme.scss +6 -5
  99. package/media-gallery/README.md +1 -1
  100. package/media-gallery/src/media-gallery-theme.scss +3 -3
  101. package/menu/src/menu-theme.scss +6 -2
  102. package/notification/src/notification-theme.scss +10 -10
  103. package/package.json +1 -1
  104. package/scss/global.scss +17 -11
  105. package/scss/theme.scss +2 -18
  106. package/scss/theming/_get-palette.scss +0 -3
  107. package/scss/theming/_index.scss +0 -1
  108. package/scss/theming/_light-dark.scss +2 -2
  109. package/scss/theming/_theme-css-variables.scss +1 -1
  110. package/scss/theming/create-theme/_create-theme.scss +2 -2
  111. package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
  112. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
  113. package/scss/typography/_classes.scss +0 -6
  114. package/scss/typography/_index.scss +0 -1
  115. package/scss/typography/mixins/_sizes.scss +0 -1
  116. package/scss/typography/utilities/_variables.scss +3 -0
  117. package/select/src/select-theme.scss +10 -14
  118. package/switch/src/switch-theme.scss +2 -2
  119. package/tabs/src/tabs-theme.scss +4 -4
  120. package/types/daffodil-design-accordion.d.ts +92 -67
  121. package/types/daffodil-design-article.d.ts +49 -56
  122. package/types/daffodil-design-badge.d.ts +56 -33
  123. package/types/daffodil-design-beacon.d.ts +35 -14
  124. package/types/daffodil-design-breadcrumb.d.ts +89 -85
  125. package/types/daffodil-design-button.d.ts +128 -146
  126. package/types/daffodil-design-callout.d.ts +55 -39
  127. package/types/daffodil-design-card.d.ts +66 -56
  128. package/types/daffodil-design-checkbox.d.ts +211 -167
  129. package/types/daffodil-design-container.d.ts +17 -16
  130. package/types/daffodil-design-form-field.d.ts +273 -240
  131. package/types/daffodil-design-form.d.ts +21 -21
  132. package/types/daffodil-design-hero.d.ts +55 -39
  133. package/types/daffodil-design-image-lite.d.ts +17 -0
  134. package/types/daffodil-design-image.d.ts +89 -55
  135. package/types/daffodil-design-input.d.ts +86 -72
  136. package/types/daffodil-design-list.d.ts +49 -43
  137. package/types/daffodil-design-media-gallery.d.ts +176 -148
  138. package/types/daffodil-design-menu.d.ts +177 -169
  139. package/types/daffodil-design-modal.d.ts +205 -205
  140. package/types/daffodil-design-native-select.d.ts +94 -84
  141. package/types/daffodil-design-navbar.d.ts +34 -24
  142. package/types/daffodil-design-notification.d.ts +82 -67
  143. package/types/daffodil-design-paginator.d.ts +140 -118
  144. package/types/daffodil-design-progress-bar.d.ts +92 -74
  145. package/types/daffodil-design-radio.d.ts +183 -144
  146. package/types/daffodil-design-select.d.ts +207 -178
  147. package/types/daffodil-design-sidebar.d.ts +270 -253
  148. package/types/daffodil-design-spinner.d.ts +49 -36
  149. package/types/daffodil-design-switch.d.ts +77 -46
  150. package/types/daffodil-design-tabs.d.ts +248 -198
  151. package/types/daffodil-design-tag.d.ts +91 -56
  152. package/types/daffodil-design-testing.d.ts +1 -3
  153. package/types/daffodil-design-text-snippet.d.ts +48 -37
  154. package/types/daffodil-design-textarea.d.ts +88 -79
  155. package/types/daffodil-design-toast.d.ts +175 -183
  156. package/types/daffodil-design-tree.d.ts +186 -169
  157. package/types/daffodil-design-youtube-player.d.ts +56 -52
  158. package/types/daffodil-design.d.ts +614 -695
  159. package/button/src/button/raised/raised-theme.scss +0 -92
  160. package/button/src/button/underline/underline-theme.scss +0 -141
  161. package/fesm2022/daffodil-design-link-set.mjs +0 -160
  162. package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
  163. package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
  164. package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
  165. package/link-set/README.md +0 -86
  166. package/quantity-field/README.md +0 -63
  167. package/scss/theming/_configure-theme.scss +0 -120
  168. package/scss/typography/mixins/_font-weight.scss +0 -14
  169. package/types/daffodil-design-link-set.d.ts +0 -72
  170. package/types/daffodil-design-quantity-field.d.ts +0 -171
@@ -1,281 +1,354 @@
1
- import { NgTemplateOutlet, CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { computed, input, isDevMode, Inject, Directive, output, contentChildren, viewChildren, ElementRef, signal, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
- import * as i1 from '@daffodil/design';
5
- import { DaffSelectableDirective, DaffArticleEncapsulatedDirective, DaffSkeletonableDirective } from '@daffodil/design';
6
- import { createSingleInjectionToken } from '@daffodil/core';
7
-
8
- const { token: DAFF_MEDIA_GALLERY_TOKEN,
9
- /**
10
- * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.
11
- */
12
- provider: provideDaffMediaGalleryToken, } = createSingleInjectionToken('DAFF_MEDIA_GALLERY_TOKEN');
13
-
1
+ import { CommonModule, NgTemplateOutlet } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, Directive, ElementRef, Inject, NgModule, computed, contentChildren, input, isDevMode, output, signal, viewChildren } from "@angular/core";
4
+ import * as i1 from "@daffodil/design";
5
+ import { DaffArticleEncapsulatedDirective, DaffSelectableDirective, DaffSkeletonableDirective } from "@daffodil/design";
6
+ import { createSingleInjectionToken } from "@daffodil/core";
7
+ const { token: DAFF_MEDIA_GALLERY_TOKEN, provider: provideDaffMediaGalleryToken } = createSingleInjectionToken("DAFF_MEDIA_GALLERY_TOKEN");
14
8
  let uniqueThumbnailId = 0;
15
- /**
16
- * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.
17
- *
18
- * ```html
19
- * <ng-template daffThumbnail></ng-template>
20
- * ```
21
- */
22
- class DaffThumbnailDirective {
23
- constructor(
24
- /**
25
- * @docs-private
26
- */
27
- gallery,
28
- /**
29
- * @docs-private
30
- */
31
- templateRef) {
32
- this.gallery = gallery;
33
- this.templateRef = templateRef;
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 */ []));
47
- /**
48
- * The file path to a thumbnail, presumably an image.
49
- */
50
- this.thumbnailSrc = input(undefined, ...(ngDevMode ? [{ debugName: "thumbnailSrc" }] : /* istanbul ignore next */ []));
51
- /**
52
- * Provides an accessible label for a thumbnail.
53
- */
54
- this.label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
55
- /** Indicates whether the thumbnail represents a video. */
56
- this.isVideo = input(false, ...(ngDevMode ? [{ debugName: "isVideo" }] : /* istanbul ignore next */ []));
57
- uniqueThumbnailId++;
58
- }
59
- /**
60
- * @docs-private
61
- */
62
- ngOnInit() {
63
- if (!this.label() && isDevMode()) {
64
- console.warn('The thumbnail ' + this.id() + ' is missing a label.');
65
- }
66
- }
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 }); }
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 }); }
69
- }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThumbnailDirective, decorators: [{
71
- type: Directive,
72
- args: [{
73
- selector: '[daffThumbnail]',
74
- }]
75
- }], ctorParameters: () => [{ type: undefined, decorators: [{
76
- type: Inject,
77
- args: [DAFF_MEDIA_GALLERY_TOKEN]
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 }] }] } });
79
-
9
+ var DaffThumbnailDirective = class DaffThumbnailDirective {
10
+ constructor(gallery, templateRef) {
11
+ this.gallery = gallery;
12
+ this.templateRef = templateRef;
13
+ this._increment = uniqueThumbnailId;
14
+ this.id = computed(() => this.gallery.id() + "-thumbnail-" + this._increment, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
15
+ this.selectedThumbnailId = computed(() => this.id() + "-selected", ...ngDevMode ? [{ debugName: "selectedThumbnailId" }] : /* istanbul ignore next */ []);
16
+ this.thumbnailSrc = input(void 0, ...ngDevMode ? [{ debugName: "thumbnailSrc" }] : /* istanbul ignore next */ []);
17
+ this.label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
18
+ this.isVideo = input(false, ...ngDevMode ? [{ debugName: "isVideo" }] : /* istanbul ignore next */ []);
19
+ uniqueThumbnailId++;
20
+ }
21
+ ngOnInit() {
22
+ if (!this.label() && isDevMode()) console.warn("The thumbnail " + this.id() + " is missing a label.");
23
+ }
24
+ static {
25
+ this.ɵfac = i0.ɵɵngDeclareFactory({
26
+ minVersion: "12.0.0",
27
+ version: "22.2.4",
28
+ ngImport: i0,
29
+ type: DaffThumbnailDirective,
30
+ deps: [{ token: DAFF_MEDIA_GALLERY_TOKEN }, { token: i0.TemplateRef }],
31
+ target: i0.ɵɵFactoryTarget.Directive
32
+ });
33
+ }
34
+ static {
35
+ this.ɵdir = i0.ɵɵngDeclareDirective({
36
+ minVersion: "17.1.0",
37
+ version: "22.2.4",
38
+ type: DaffThumbnailDirective,
39
+ isStandalone: true,
40
+ selector: "[daffThumbnail]",
41
+ inputs: {
42
+ thumbnailSrc: {
43
+ classPropertyName: "thumbnailSrc",
44
+ publicName: "thumbnailSrc",
45
+ isSignal: true,
46
+ isRequired: false,
47
+ transformFunction: null
48
+ },
49
+ label: {
50
+ classPropertyName: "label",
51
+ publicName: "label",
52
+ isSignal: true,
53
+ isRequired: false,
54
+ transformFunction: null
55
+ },
56
+ isVideo: {
57
+ classPropertyName: "isVideo",
58
+ publicName: "isVideo",
59
+ isSignal: true,
60
+ isRequired: false,
61
+ transformFunction: null
62
+ }
63
+ },
64
+ ngImport: i0
65
+ });
66
+ }
67
+ };
68
+ i0.ɵɵngDeclareClassMetadata({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.4",
71
+ ngImport: i0,
72
+ type: DaffThumbnailDirective,
73
+ decorators: [{
74
+ type: Directive,
75
+ args: [{ selector: "[daffThumbnail]" }]
76
+ }],
77
+ ctorParameters: () => [{
78
+ type: void 0,
79
+ decorators: [{
80
+ type: Inject,
81
+ args: [DAFF_MEDIA_GALLERY_TOKEN]
82
+ }]
83
+ }, { type: i0.TemplateRef }],
84
+ propDecorators: {
85
+ thumbnailSrc: [{
86
+ type: i0.Input,
87
+ args: [{
88
+ isSignal: true,
89
+ alias: "thumbnailSrc",
90
+ required: false
91
+ }]
92
+ }],
93
+ label: [{
94
+ type: i0.Input,
95
+ args: [{
96
+ isSignal: true,
97
+ alias: "label",
98
+ required: false
99
+ }]
100
+ }],
101
+ isVideo: [{
102
+ type: i0.Input,
103
+ args: [{
104
+ isSignal: true,
105
+ alias: "isVideo",
106
+ required: false
107
+ }]
108
+ }]
109
+ }
110
+ });
80
111
  let uniqueGalleryId = 0;
81
- /**
82
- * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.
83
- *
84
- * ```html
85
- * <daff-media-gallery>
86
- * <ng-template daffThumbnail thumbnailSrc="/thumbnail-path.jpg" label="Your description">
87
- * <daff-image src="/image-path.jpg" alt="Your description" width="100" height="100"></daff-image>
88
- * </ng-template>
89
- * </daff-media-gallery>
90
- * ```
91
- */
92
- class DaffMediaGalleryComponent {
93
- /**
94
- * @docs-private
95
- */
96
- constructor(skeletonDirective) {
97
- this.skeletonDirective = skeletonDirective;
98
- /**
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.
104
- */
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 */ []));
113
- /**
114
- * An event indicating that the selected media gallery element has changed.
115
- */
116
- this.elementChange = output();
117
- /**
118
- * @docs-private
119
- */
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 });
125
- /**
126
- * @docs-private
127
- */
128
- this._selectedThumbnail = computed(() => {
129
- const idx = this._selectedIndex();
130
- if (!idx) {
131
- return this._thumbnails().at(0);
132
- }
133
- return this._thumbnails().at(idx);
134
- }, ...(ngDevMode ? [{ debugName: "_selectedThumbnail" }] : /* istanbul ignore next */ []));
135
- this._selectedIndex = signal(null, ...(ngDevMode ? [{ debugName: "_selectedIndex" }] : /* istanbul ignore next */ []));
136
- uniqueGalleryId++;
137
- }
138
- /**
139
- * @docs-private
140
- *
141
- * Whether or not the component its currently displaying its skeleton state.
142
- */
143
- get skeleton() {
144
- return this.skeletonDirective.skeleton;
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
- }
154
- focusSelected() {
155
- const index = this._selectedIndex();
156
- if (index !== null) {
157
- this._thumbnailButtons().at(index)?.nativeElement.focus();
158
- }
159
- }
160
- /**
161
- * Select a specific entry in the media gallery by its index.
162
- *
163
- * @param index The index to set, starting at 0.
164
- */
165
- selectIndex(index) {
166
- this._selectedIndex.set(index);
167
- this.elementChange.emit(index);
168
- }
169
- /**
170
- * Navigate to the next element in the list of thumbnails.
171
- *
172
- * @param focus Whether to move focus to the newly selected item.
173
- */
174
- next(focus = true) {
175
- this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);
176
- this.elementChange.emit(this._selectedIndex());
177
- if (focus) {
178
- this.focusSelected();
179
- }
180
- }
181
- /**
182
- * Navigate to the previous element in the list of thumbnails.
183
- *
184
- * @param focus Whether to move focus to the newly selected item.
185
- */
186
- previous(focus = true) {
187
- this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);
188
- this.elementChange.emit(this._selectedIndex());
189
- if (focus) {
190
- this.focusSelected();
191
- }
192
- }
193
- /**
194
- * Select the first element.
195
- *
196
- * @param focus Whether to move focus to the newly selected item.
197
- */
198
- selectFirst(focus = true) {
199
- this._selectedIndex.set(0);
200
- this.elementChange.emit(this._selectedIndex());
201
- if (focus) {
202
- this.focusSelected();
203
- }
204
- }
205
- /**
206
- * Select the last element of the gallery.
207
- *
208
- * @param Whether to move focus to the newly selected item.
209
- */
210
- selectLast(focus = true) {
211
- this._selectedIndex.set(this._thumbnails().length - 1);
212
- this.elementChange.emit(this._selectedIndex());
213
- if (focus) {
214
- this.focusSelected();
215
- }
216
- }
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 }); }
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: [
219
- { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
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 }); }
221
- }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
223
- type: Component,
224
- args: [{ selector: 'daff-media-gallery', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
225
- { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
226
- ], hostDirectives: [
227
- { directive: DaffArticleEncapsulatedDirective },
228
- {
229
- directive: DaffSkeletonableDirective,
230
- inputs: ['skeleton'],
231
- },
232
- ], host: {
233
- class: 'daff-media-gallery',
234
- '[attr.id]': 'id()',
235
- }, imports: [
236
- DaffThumbnailDirective,
237
- NgTemplateOutlet,
238
- DaffSelectableDirective,
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 }] }] } });
241
-
242
- /**
243
- * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
244
- */
245
- class DaffMediaGalleryModule {
246
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
247
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule,
248
- DaffMediaGalleryComponent,
249
- DaffThumbnailDirective], exports: [DaffMediaGalleryComponent,
250
- DaffThumbnailDirective] }); }
251
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule] }); }
252
- }
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMediaGalleryModule, decorators: [{
254
- type: NgModule,
255
- args: [{
256
- imports: [
257
- CommonModule,
258
- DaffMediaGalleryComponent,
259
- DaffThumbnailDirective,
260
- ],
261
- exports: [
262
- DaffMediaGalleryComponent,
263
- DaffThumbnailDirective,
264
- ],
265
- }]
266
- }] });
267
-
268
- /**
269
- * @docs-private
270
- */
271
- const DAFF_MEDIA_GALLERY_COMPONENTS = [
272
- DaffMediaGalleryComponent,
273
- DaffThumbnailDirective,
274
- ];
275
-
276
- /**
277
- * Generated bundle index. Do not edit.
278
- */
279
-
112
+ var DaffMediaGalleryComponent = class DaffMediaGalleryComponent {
113
+ constructor(skeletonDirective) {
114
+ this.skeletonDirective = skeletonDirective;
115
+ this._defaultId = "media-gallery-" + uniqueGalleryId;
116
+ this.customId = input(void 0, {
117
+ ...ngDevMode ? { debugName: "customId" } : /* istanbul ignore next */ {},
118
+ alias: "id"
119
+ });
120
+ this.id = computed(() => this.customId() || this._defaultId, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
121
+ this.elementChange = output();
122
+ this._thumbnails = contentChildren(DaffThumbnailDirective, ...ngDevMode ? [{ debugName: "_thumbnails" }] : /* istanbul ignore next */ []);
123
+ this._thumbnailButtons = viewChildren("thumbnailButtons", {
124
+ ...ngDevMode ? { debugName: "_thumbnailButtons" } : /* istanbul ignore next */ {},
125
+ read: ElementRef
126
+ });
127
+ this._selectedThumbnail = computed(() => {
128
+ const idx = this._selectedIndex();
129
+ if (!idx) return this._thumbnails().at(0);
130
+ return this._thumbnails().at(idx);
131
+ }, ...ngDevMode ? [{ debugName: "_selectedThumbnail" }] : /* istanbul ignore next */ []);
132
+ this._selectedIndex = signal(null, ...ngDevMode ? [{ debugName: "_selectedIndex" }] : /* istanbul ignore next */ []);
133
+ uniqueGalleryId++;
134
+ }
135
+ get skeleton() {
136
+ return this.skeletonDirective.skeleton;
137
+ }
138
+ _isSelected(thumbnail) {
139
+ return thumbnail === this._selectedThumbnail();
140
+ }
141
+ focusSelected() {
142
+ const index = this._selectedIndex();
143
+ if (index !== null) this._thumbnailButtons().at(index)?.nativeElement.focus();
144
+ }
145
+ selectIndex(index) {
146
+ this._selectedIndex.set(index);
147
+ this.elementChange.emit(index);
148
+ }
149
+ next(focus = true) {
150
+ this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);
151
+ this.elementChange.emit(this._selectedIndex());
152
+ if (focus) this.focusSelected();
153
+ }
154
+ previous(focus = true) {
155
+ this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);
156
+ this.elementChange.emit(this._selectedIndex());
157
+ if (focus) this.focusSelected();
158
+ }
159
+ selectFirst(focus = true) {
160
+ this._selectedIndex.set(0);
161
+ this.elementChange.emit(this._selectedIndex());
162
+ if (focus) this.focusSelected();
163
+ }
164
+ selectLast(focus = true) {
165
+ this._selectedIndex.set(this._thumbnails().length - 1);
166
+ this.elementChange.emit(this._selectedIndex());
167
+ if (focus) this.focusSelected();
168
+ }
169
+ static {
170
+ this.ɵfac = i0.ɵɵngDeclareFactory({
171
+ minVersion: "12.0.0",
172
+ version: "22.2.4",
173
+ ngImport: i0,
174
+ type: DaffMediaGalleryComponent,
175
+ deps: [{ token: i1.DaffSkeletonableDirective }],
176
+ target: i0.ɵɵFactoryTarget.Component
177
+ });
178
+ }
179
+ static {
180
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
181
+ minVersion: "17.0.0",
182
+ version: "22.2.4",
183
+ type: DaffMediaGalleryComponent,
184
+ isStandalone: true,
185
+ selector: "daff-media-gallery",
186
+ inputs: { customId: {
187
+ classPropertyName: "customId",
188
+ publicName: "id",
189
+ isSignal: true,
190
+ isRequired: false,
191
+ transformFunction: null
192
+ } },
193
+ outputs: { elementChange: "elementChange" },
194
+ host: {
195
+ properties: { "attr.id": "id()" },
196
+ classAttribute: "daff-media-gallery"
197
+ },
198
+ providers: [{
199
+ provide: DAFF_MEDIA_GALLERY_TOKEN,
200
+ useExisting: DaffMediaGalleryComponent
201
+ }],
202
+ queries: [{
203
+ propertyName: "_thumbnails",
204
+ predicate: DaffThumbnailDirective,
205
+ isSignal: true
206
+ }],
207
+ viewQueries: [{
208
+ propertyName: "_thumbnailButtons",
209
+ predicate: ["thumbnailButtons"],
210
+ descendants: true,
211
+ read: ElementRef,
212
+ isSignal: true
213
+ }],
214
+ hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, {
215
+ directive: i1.DaffSkeletonableDirective,
216
+ inputs: ["skeleton", "skeleton"]
217
+ }],
218
+ ngImport: i0,
219
+ template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n @if(skeleton) {\n <div class=\"daff-thumbnail\"></div>\n <div class=\"daff-thumbnail\"></div>\n <div class=\"daff-thumbnail\"></div>\n }\n @else {\n @for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n <button \n #thumbnailButtons\n class=\"daff-thumbnail\" \n role=\"tab\"\n daffSelected\n [selected]=\"_isSelected(thumbnail)\"\n attr.aria-label=\"{{ thumbnail.label() ?? 'Gallery Element ' + (index + 1) }}\"\n [attr.aria-selected]=\"_isSelected(thumbnail) ? 'true' : 'false'\"\n [attr.aria-controls]=\"thumbnail.selectedThumbnailId()\"\n [attr.tabindex]=\"_isSelected(thumbnail) ? 0 : -1\"\n (click)=\"selectIndex(index)\"\n [attr.id]=\"thumbnail.id()\"\n (keydown.arrowright)=\"next()\"\n (keydown.arrowleft)=\"previous()\">\n @if (thumbnail.thumbnailSrc()) {\n <img [src]=\"thumbnail.thumbnailSrc()\" aria-hidden=\"true\"/>\n }\n @if (thumbnail.isVideo()) {\n <div class=\"daff-media-gallery__video-button\"></div>\n }\n </button>\n }\n }\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n class=\"daff-media-gallery__selected-thumbnail\"\n tabindex=\"0\"\n #selectedThumbnail\n role=\"tabpanel\"\n [attr.id]=\"selectedEl?.selectedThumbnailId()\">\n @if(selectedEl) {\n <ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n }\n @else {\n <div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n }\n</div>",
220
+ 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{order:1;width:100%}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2}}.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"],
221
+ dependencies: [{
222
+ kind: "directive",
223
+ type: NgTemplateOutlet,
224
+ selector: "[ngTemplateOutlet]",
225
+ inputs: [
226
+ "ngTemplateOutletContext",
227
+ "ngTemplateOutlet",
228
+ "ngTemplateOutletInjector"
229
+ ]
230
+ }, {
231
+ kind: "directive",
232
+ type: DaffSelectableDirective,
233
+ selector: "[daffSelected]",
234
+ inputs: ["selected"],
235
+ outputs: ["becameSelected"]
236
+ }],
237
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
238
+ });
239
+ }
240
+ };
241
+ i0.ɵɵngDeclareClassMetadata({
242
+ minVersion: "12.0.0",
243
+ version: "22.2.4",
244
+ ngImport: i0,
245
+ type: DaffMediaGalleryComponent,
246
+ decorators: [{
247
+ type: Component,
248
+ args: [{
249
+ selector: "daff-media-gallery",
250
+ changeDetection: ChangeDetectionStrategy.OnPush,
251
+ providers: [{
252
+ provide: DAFF_MEDIA_GALLERY_TOKEN,
253
+ useExisting: DaffMediaGalleryComponent
254
+ }],
255
+ hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }, {
256
+ directive: DaffSkeletonableDirective,
257
+ inputs: ["skeleton"]
258
+ }],
259
+ host: {
260
+ class: "daff-media-gallery",
261
+ "[attr.id]": "id()"
262
+ },
263
+ imports: [
264
+ DaffThumbnailDirective,
265
+ NgTemplateOutlet,
266
+ DaffSelectableDirective
267
+ ],
268
+ template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n @if(skeleton) {\n <div class=\"daff-thumbnail\"></div>\n <div class=\"daff-thumbnail\"></div>\n <div class=\"daff-thumbnail\"></div>\n }\n @else {\n @for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n <button \n #thumbnailButtons\n class=\"daff-thumbnail\" \n role=\"tab\"\n daffSelected\n [selected]=\"_isSelected(thumbnail)\"\n attr.aria-label=\"{{ thumbnail.label() ?? 'Gallery Element ' + (index + 1) }}\"\n [attr.aria-selected]=\"_isSelected(thumbnail) ? 'true' : 'false'\"\n [attr.aria-controls]=\"thumbnail.selectedThumbnailId()\"\n [attr.tabindex]=\"_isSelected(thumbnail) ? 0 : -1\"\n (click)=\"selectIndex(index)\"\n [attr.id]=\"thumbnail.id()\"\n (keydown.arrowright)=\"next()\"\n (keydown.arrowleft)=\"previous()\">\n @if (thumbnail.thumbnailSrc()) {\n <img [src]=\"thumbnail.thumbnailSrc()\" aria-hidden=\"true\"/>\n }\n @if (thumbnail.isVideo()) {\n <div class=\"daff-media-gallery__video-button\"></div>\n }\n </button>\n }\n }\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n class=\"daff-media-gallery__selected-thumbnail\"\n tabindex=\"0\"\n #selectedThumbnail\n role=\"tabpanel\"\n [attr.id]=\"selectedEl?.selectedThumbnailId()\">\n @if(selectedEl) {\n <ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n }\n @else {\n <div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n }\n</div>",
269
+ 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{order:1;width:100%}@media(min-width:1024px){.daff-media-gallery__selected-thumbnail{order:2}}.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"]
270
+ }]
271
+ }],
272
+ ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }],
273
+ propDecorators: {
274
+ customId: [{
275
+ type: i0.Input,
276
+ args: [{
277
+ isSignal: true,
278
+ alias: "id",
279
+ required: false
280
+ }]
281
+ }],
282
+ elementChange: [{
283
+ type: i0.Output,
284
+ args: ["elementChange"]
285
+ }],
286
+ _thumbnails: [{
287
+ type: i0.ContentChildren,
288
+ args: [i0.forwardRef(() => DaffThumbnailDirective), { isSignal: true }]
289
+ }],
290
+ _thumbnailButtons: [{
291
+ type: i0.ViewChildren,
292
+ args: ["thumbnailButtons", {
293
+ read: ElementRef,
294
+ isSignal: true
295
+ }]
296
+ }]
297
+ }
298
+ });
299
+ var DaffMediaGalleryModule = class DaffMediaGalleryModule {
300
+ static {
301
+ this.ɵfac = i0.ɵɵngDeclareFactory({
302
+ minVersion: "12.0.0",
303
+ version: "22.2.4",
304
+ ngImport: i0,
305
+ type: DaffMediaGalleryModule,
306
+ deps: [],
307
+ target: i0.ɵɵFactoryTarget.NgModule
308
+ });
309
+ }
310
+ static {
311
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
312
+ minVersion: "14.0.0",
313
+ version: "22.2.4",
314
+ ngImport: i0,
315
+ type: DaffMediaGalleryModule,
316
+ imports: [
317
+ CommonModule,
318
+ DaffMediaGalleryComponent,
319
+ DaffThumbnailDirective
320
+ ],
321
+ exports: [DaffMediaGalleryComponent, DaffThumbnailDirective]
322
+ });
323
+ }
324
+ static {
325
+ this.ɵinj = i0.ɵɵngDeclareInjector({
326
+ minVersion: "12.0.0",
327
+ version: "22.2.4",
328
+ ngImport: i0,
329
+ type: DaffMediaGalleryModule,
330
+ imports: [CommonModule]
331
+ });
332
+ }
333
+ };
334
+ i0.ɵɵngDeclareClassMetadata({
335
+ minVersion: "12.0.0",
336
+ version: "22.2.4",
337
+ ngImport: i0,
338
+ type: DaffMediaGalleryModule,
339
+ decorators: [{
340
+ type: NgModule,
341
+ args: [{
342
+ imports: [
343
+ CommonModule,
344
+ DaffMediaGalleryComponent,
345
+ DaffThumbnailDirective
346
+ ],
347
+ exports: [DaffMediaGalleryComponent, DaffThumbnailDirective]
348
+ }]
349
+ }]
350
+ });
351
+ const DAFF_MEDIA_GALLERY_COMPONENTS = [DaffMediaGalleryComponent, DaffThumbnailDirective];
280
352
  export { DAFF_MEDIA_GALLERY_COMPONENTS, DaffMediaGalleryComponent, DaffMediaGalleryModule, DaffThumbnailDirective };
281
- //# sourceMappingURL=daffodil-design-media-gallery.mjs.map
353
+
354
+ //# sourceMappingURL=daffodil-design-media-gallery.mjs.map