@daffodil/design 0.81.1 → 0.83.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 (258) hide show
  1. package/accordion/README.md +44 -29
  2. package/accordion/accordion/accordion/accordion.component.d.ts +3 -0
  3. package/accordion/accordion/accordion-item/accordion-item.component.d.ts +23 -12
  4. package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +3 -0
  5. package/accordion/accordion.d.ts +5 -0
  6. package/accordion/examples/disabled-accordion/disabled-accordion.component.d.ts +5 -0
  7. package/accordion/examples/initially-expanded-accordion/initially-expanded-accordion.component.d.ts +5 -0
  8. package/accordion/examples/public_api.d.ts +2 -0
  9. package/accordion/src/accordion-theme.scss +28 -6
  10. package/article/README.md +4 -3
  11. package/article/article.d.ts +3 -0
  12. package/article/src/article-theme.scss +128 -51
  13. package/breadcrumb/README.md +38 -28
  14. package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +15 -2
  15. package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +18 -4
  16. package/breadcrumb/breadcrumb.d.ts +3 -0
  17. package/breadcrumb/examples/iterated-breadcrumb/iterated-breadcrumb.component.d.ts +6 -0
  18. package/breadcrumb/public_api.d.ts +2 -2
  19. package/button/README.md +43 -23
  20. package/button/button/basic/button.component.d.ts +5 -1
  21. package/button/button/button-base.directive.d.ts +11 -3
  22. package/button/button/button-sizable.directive.d.ts +1 -1
  23. package/button/button/raised/raised.component.d.ts +2 -0
  24. package/button/button/stroked/stroked.component.d.ts +5 -1
  25. package/button/button.d.ts +4 -2
  26. package/button/button.module.d.ts +1 -2
  27. package/button/examples/elevated-button/elevated-button.component.d.ts +6 -0
  28. package/button/examples/examples.d.ts +2 -1
  29. package/button/examples/public_api.d.ts +1 -0
  30. package/button/public_api.d.ts +0 -1
  31. package/button/src/button/basic/button-theme.scss +185 -80
  32. package/button/src/button/button-base.scss +41 -16
  33. package/button/src/button/flat/flat-theme.scss +144 -85
  34. package/button/src/button/icon/icon-theme.scss +183 -79
  35. package/button/src/button/raised/raised-theme.scss +2 -7
  36. package/button/src/button/stroked/stroked-theme.scss +128 -94
  37. package/button/src/button/underline/underline-theme.scss +112 -44
  38. package/callout/README.md +4 -3
  39. package/callout/callout.d.ts +3 -0
  40. package/card/README.md +6 -3
  41. package/card/card/basic/basic.component.d.ts +7 -0
  42. package/card/card/raised/raised.component.d.ts +7 -0
  43. package/card/card/stroked/stroked.component.d.ts +7 -0
  44. package/card/card-base.directive.d.ts +25 -0
  45. package/card/card.d.ts +18 -1
  46. package/card/card.module.d.ts +10 -8
  47. package/card/examples/card-theming/card-theming.component.d.ts +2 -1
  48. package/card/examples/public_api.d.ts +1 -1
  49. package/card/public_api.d.ts +6 -1
  50. package/card/src/card/raised/raised-theme.scss +30 -0
  51. package/card/src/card/stroked/stroked-theme.scss +135 -0
  52. package/card/src/card-base-theme.scss +197 -0
  53. package/card/src/card-base.scss +134 -0
  54. package/container/README.md +5 -3
  55. package/container/container.d.ts +3 -0
  56. package/core/colorable/colorable.d.ts +20 -14
  57. package/core/colorable/colorable.directive.d.ts +9 -6
  58. package/fesm2022/daffodil-design-accordion-examples.mjs +28 -4
  59. package/fesm2022/daffodil-design-accordion-examples.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-accordion.mjs +56 -29
  61. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-article-examples.mjs +30 -30
  63. package/fesm2022/daffodil-design-article.mjs +14 -11
  64. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +24 -4
  66. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-breadcrumb.mjs +78 -40
  68. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-button-examples.mjs +55 -33
  70. package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-button.mjs +79 -69
  72. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-callout-examples.mjs +12 -12
  74. package/fesm2022/daffodil-design-callout-examples.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-callout.mjs +25 -22
  76. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-card-examples.mjs +35 -31
  78. package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-card.mjs +140 -86
  80. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  81. package/fesm2022/daffodil-design-checkbox-examples.mjs +6 -6
  82. package/fesm2022/daffodil-design-checkbox-examples.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-container-examples.mjs +3 -3
  84. package/fesm2022/daffodil-design-container.mjs +10 -7
  85. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-hero-examples.mjs +12 -12
  87. package/fesm2022/daffodil-design-hero-examples.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-hero.mjs +25 -22
  89. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  90. package/fesm2022/daffodil-design-image-examples.mjs +9 -9
  91. package/fesm2022/daffodil-design-image.mjs +36 -19
  92. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-input-examples.mjs +12 -12
  94. package/fesm2022/daffodil-design-link-set.mjs +19 -16
  95. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  96. package/fesm2022/daffodil-design-list-examples.mjs +12 -12
  97. package/fesm2022/daffodil-design-list.mjs +13 -10
  98. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  99. package/fesm2022/daffodil-design-loading-icon-examples.mjs +4 -4
  100. package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +1 -1
  101. package/fesm2022/daffodil-design-loading-icon.mjs +11 -8
  102. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  103. package/fesm2022/daffodil-design-media-gallery-examples.mjs +62 -13
  104. package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +1 -1
  105. package/fesm2022/daffodil-design-media-gallery.mjs +204 -250
  106. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  107. package/fesm2022/daffodil-design-menu-examples.mjs +6 -6
  108. package/fesm2022/daffodil-design-menu-examples.mjs.map +1 -1
  109. package/fesm2022/daffodil-design-menu.mjs +16 -16
  110. package/fesm2022/daffodil-design-modal-examples.mjs +7 -7
  111. package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
  112. package/fesm2022/daffodil-design-modal.mjs +28 -25
  113. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  114. package/fesm2022/daffodil-design-navbar-examples.mjs +12 -12
  115. package/fesm2022/daffodil-design-navbar-examples.mjs.map +1 -1
  116. package/fesm2022/daffodil-design-navbar.mjs +10 -7
  117. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  118. package/fesm2022/daffodil-design-notification-examples.mjs +17 -16
  119. package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
  120. package/fesm2022/daffodil-design-notification.mjs +23 -20
  121. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  122. package/fesm2022/daffodil-design-paginator-examples.mjs +6 -6
  123. package/fesm2022/daffodil-design-paginator.mjs +13 -7
  124. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  125. package/fesm2022/daffodil-design-progress-bar-examples.mjs +10 -10
  126. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
  127. package/fesm2022/daffodil-design-progress-bar.mjs +13 -13
  128. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  129. package/fesm2022/daffodil-design-quantity-field-examples.mjs +12 -12
  130. package/fesm2022/daffodil-design-radio-examples.mjs +3 -3
  131. package/fesm2022/daffodil-design-sidebar-examples.mjs +14 -14
  132. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +1 -1
  133. package/fesm2022/daffodil-design-sidebar.mjs +150 -61
  134. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  135. package/fesm2022/daffodil-design-switch-examples.mjs +15 -15
  136. package/fesm2022/daffodil-design-switch-examples.mjs.map +1 -1
  137. package/fesm2022/daffodil-design-switch.mjs +38 -10
  138. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  139. package/fesm2022/daffodil-design-tabs-examples.mjs +23 -17
  140. package/fesm2022/daffodil-design-tabs-examples.mjs.map +1 -1
  141. package/fesm2022/daffodil-design-tabs.mjs +67 -35
  142. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  143. package/fesm2022/daffodil-design-text-snippet-examples.mjs +3 -3
  144. package/fesm2022/daffodil-design-text-snippet.mjs +4 -5
  145. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  146. package/fesm2022/daffodil-design-toast-examples.mjs +40 -15
  147. package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
  148. package/fesm2022/daffodil-design-toast.mjs +296 -239
  149. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  150. package/fesm2022/daffodil-design-tree-examples.mjs +6 -6
  151. package/fesm2022/daffodil-design-tree.mjs +15 -12
  152. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  153. package/fesm2022/daffodil-design-youtube-player.mjs +104 -0
  154. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -0
  155. package/fesm2022/daffodil-design.mjs +167 -155
  156. package/fesm2022/daffodil-design.mjs.map +1 -1
  157. package/hero/README.md +4 -3
  158. package/hero/hero.d.ts +3 -0
  159. package/image/README.md +4 -3
  160. package/image/image/image.component.d.ts +22 -1
  161. package/image/image.d.ts +3 -0
  162. package/link-set/README.md +4 -3
  163. package/link-set/link-set.d.ts +3 -0
  164. package/list/README.md +4 -3
  165. package/list/list.d.ts +3 -0
  166. package/loading-icon/README.md +10 -7
  167. package/loading-icon/loading-icon.d.ts +3 -0
  168. package/loading-icon/src/loading-icon-theme.scss +66 -38
  169. package/media-gallery/README.md +19 -10
  170. package/media-gallery/examples/iterated-media-gallery/iterated-media-gallery.component.d.ts +13 -0
  171. package/media-gallery/examples/media-gallery-with-video/media-gallery-with-video.component.d.ts +5 -0
  172. package/media-gallery/examples/public_api.d.ts +2 -0
  173. package/media-gallery/helpers/media-gallery-registration.interface.d.ts +1 -1
  174. package/media-gallery/media-gallery/media-gallery.component.d.ts +89 -11
  175. package/media-gallery/media-gallery.d.ts +4 -2
  176. package/media-gallery/media-gallery.module.d.ts +1 -2
  177. package/media-gallery/public_api.d.ts +3 -4
  178. package/media-gallery/src/media-gallery-theme.scss +30 -4
  179. package/media-gallery/thumbnail/thumbnail.directive.d.ts +45 -22
  180. package/menu/README.md +1 -2
  181. package/modal/README.md +3 -2
  182. package/modal/modal.d.ts +3 -0
  183. package/navbar/README.md +3 -2
  184. package/navbar/navbar.d.ts +3 -0
  185. package/notification/README.md +5 -4
  186. package/notification/notification.d.ts +3 -0
  187. package/notification/src/notification-theme.scss +62 -23
  188. package/package.json +1 -1
  189. package/paginator/README.md +3 -2
  190. package/paginator/paginator/paginator.component.d.ts +3 -0
  191. package/paginator/paginator.d.ts +3 -0
  192. package/progress-bar/README.md +5 -6
  193. package/progress-bar/progress-bar.component.d.ts +0 -3
  194. package/progress-bar/progress-bar.d.ts +3 -0
  195. package/progress-bar/src/progress-bar-theme.scss +17 -8
  196. package/scss/theme.scss +36 -17
  197. package/scss/theming/_configure-theme.scss +2 -0
  198. package/scss/theming/_index.scss +1 -0
  199. package/scss/theming/_light-dark.scss +45 -0
  200. package/sidebar/README.md +20 -21
  201. package/sidebar/helper/sidebar-mode.d.ts +9 -15
  202. package/sidebar/public_api.d.ts +10 -11
  203. package/sidebar/sidebar/sidebar.component.d.ts +22 -7
  204. package/sidebar/sidebar-footer/sidebar-footer.component.d.ts +11 -0
  205. package/sidebar/sidebar-header/sidebar-header-title/sidebar-header-title.directive.d.ts +8 -0
  206. package/sidebar/sidebar-header/sidebar-header.component.d.ts +19 -1
  207. package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +36 -15
  208. package/sidebar/sidebar-viewport-backdrop/sidebar-viewport-backdrop.component.d.ts +17 -0
  209. package/sidebar/sidebar.d.ts +4 -2
  210. package/sidebar/sidebar.module.d.ts +1 -2
  211. package/switch/README.md +3 -2
  212. package/switch/src/switch-theme.scss +29 -10
  213. package/switch/switch/switch.component.d.ts +31 -6
  214. package/switch/switch.d.ts +3 -0
  215. package/tabs/README.md +33 -3
  216. package/tabs/src/tabs-theme.scss +31 -13
  217. package/tabs/tabs/tab/tab.component.d.ts +1 -1
  218. package/tabs/tabs/tab-label/tab-label.component.d.ts +6 -0
  219. package/tabs/tabs/tab-panel/tab-panel.component.d.ts +8 -0
  220. package/tabs/tabs/tabs.component.d.ts +21 -4
  221. package/tabs/tabs.d.ts +8 -2
  222. package/text-snippet/README.md +19 -1
  223. package/toast/README.md +21 -151
  224. package/toast/examples/dismissible-toast/dismissible-toast.component.d.ts +11 -0
  225. package/toast/examples/public_api.d.ts +2 -1
  226. package/toast/interfaces/toast-action.d.ts +22 -11
  227. package/toast/interfaces/toast-action.type.d.ts +10 -0
  228. package/toast/interfaces/toast.d.ts +11 -5
  229. package/toast/options/daff-toast-options.d.ts +2 -1
  230. package/toast/public_api.d.ts +2 -6
  231. package/toast/service/position.service.d.ts +9 -1
  232. package/toast/service/toast.service.d.ts +63 -0
  233. package/toast/src/toast-theme.scss +80 -33
  234. package/toast/toast/toast-config.d.ts +24 -1
  235. package/toast/toast/toast-provider.d.ts +16 -0
  236. package/toast/toast/toast.component.d.ts +20 -1
  237. package/toast/toast-actions/toast-actions.directive.d.ts +3 -0
  238. package/toast/toast-message/toast-message.directive.d.ts +3 -0
  239. package/toast/toast-title/toast-title.directive.d.ts +3 -0
  240. package/tree/README.md +6 -10
  241. package/tree/src/tree-theme.scss +39 -13
  242. package/tree/tree.d.ts +3 -0
  243. package/youtube-player/index.d.ts +1 -0
  244. package/youtube-player/public_api.d.ts +3 -0
  245. package/youtube-player/safe-url.pipe.d.ts +10 -0
  246. package/youtube-player/youtube-player.component.d.ts +23 -0
  247. package/youtube-player/youtube-player.d.ts +6 -0
  248. package/card/card/card.component.d.ts +0 -48
  249. package/card/src/card-theme-variants/basic-card.scss +0 -6
  250. package/card/src/card-theme-variants/linkable-card.scss +0 -16
  251. package/card/src/card-theme-variants/stroked-card.scss +0 -3
  252. package/card/src/card-theme.scss +0 -170
  253. package/media-gallery/media-renderer/media-renderer.component.d.ts +0 -29
  254. package/media-gallery/registry/media-gallery.registry.d.ts +0 -34
  255. package/media-gallery/thumbnail/thumbnail-compat.token.d.ts +0 -1
  256. package/media-gallery/thumbnail/thumbnail-registration.interface.d.ts +0 -9
  257. package/scss/theming/prebuilt/internal-theme.scss +0 -13
  258. package/toast/toast.module.d.ts +0 -19
@@ -1,11 +1,9 @@
1
+ import { NgTemplateOutlet, CommonModule } from '@angular/common';
1
2
  import * as i0 from '@angular/core';
2
- import { Injectable, TemplateRef, ViewContainerRef, Component, ChangeDetectionStrategy, Inject, ViewChild, Directive, HostBinding, HostListener, Input, NgModule } from '@angular/core';
3
- import * as i2 from '@daffodil/design';
3
+ import { isDevMode, Directive, Inject, Input, EventEmitter, contentChildren, computed, signal, ElementRef, Component, ChangeDetectionStrategy, HostBinding, Output, ViewChildren, NgModule } from '@angular/core';
4
+ import * as i1 from '@daffodil/design';
4
5
  import { DaffSelectableDirective, DaffArticleEncapsulatedDirective, DaffSkeletonableDirective } from '@daffodil/design';
5
6
  import { createSingleInjectionToken } from '@daffodil/core';
6
- import { BehaviorSubject, Subject } from 'rxjs';
7
- import { takeUntil } from 'rxjs/operators';
8
- import { CommonModule } from '@angular/common';
9
7
 
10
8
  const { token: DAFF_MEDIA_GALLERY_TOKEN,
11
9
  /**
@@ -13,279 +11,223 @@ const { token: DAFF_MEDIA_GALLERY_TOKEN,
13
11
  */
14
12
  provider: provideDaffMediaGalleryToken, } = createSingleInjectionToken('DAFF_MEDIA_GALLERY_TOKEN');
15
13
 
16
- const isGallery = (element) => !('gallery' in element);
17
- class DaffMediaGalleryRegistry {
18
- constructor() {
19
- this.galleries = {};
20
- }
14
+ 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 {
21
23
  /**
22
- * @description
23
- * Adds a media element to the internal registry.
24
+ * @docs-private
25
+ *
26
+ * The autogenerated unique id for a thumbnail.
24
27
  */
25
- add(gallery, thumbnail) {
26
- if (this.galleries[gallery.name]) {
27
- let newGallery = this.galleries[gallery.name].getValue();
28
- if (thumbnail) {
29
- newGallery = {
30
- ...newGallery,
31
- thumbnails: [
32
- ...newGallery.thumbnails.filter(t => t !== thumbnail),
33
- thumbnail,
34
- ],
35
- };
36
- }
37
- this.galleries[gallery.name].next(newGallery);
38
- }
39
- else {
40
- this.galleries[gallery.name] = new BehaviorSubject({
41
- gallery,
42
- thumbnails: thumbnail ? [thumbnail] : [],
43
- });
44
- }
45
- if (this.galleries[gallery.name].getValue().thumbnails.length === 1) {
46
- thumbnail.select();
47
- }
28
+ get id() {
29
+ return this.gallery.id + '-thumbnail-' + this._increment;
48
30
  }
49
31
  /**
50
- * @description
51
- * Removes a thumbnail or gallery from the internal registry.
32
+ * @docs-private
33
+ *
34
+ * The unique id of the selected thumbnail.
52
35
  */
53
- remove(element) {
54
- if (isGallery(element)) {
55
- this.removeGallery(element);
56
- }
57
- else {
58
- this.removeThumbnail(element);
59
- }
60
- }
61
- removeThumbnail(thumbnail) {
62
- if (!this.galleries[thumbnail.gallery.name]) {
63
- return;
64
- }
65
- const gallery = this.galleries[thumbnail.gallery.name].getValue();
66
- const index = gallery.thumbnails.indexOf(thumbnail);
67
- if (index === -1) {
68
- return;
69
- }
70
- this.galleries[thumbnail.gallery.name].next({
71
- ...gallery,
72
- thumbnails: [
73
- ...gallery.thumbnails.slice(0, index),
74
- ...gallery.thumbnails.slice(index + 1),
75
- ],
76
- });
77
- }
78
- removeGallery(gallery) {
79
- delete this.galleries[gallery.name];
36
+ get selectedThumbnailId() {
37
+ return this.id + '-selected';
80
38
  }
39
+ constructor(
81
40
  /**
82
- * @description
83
- * Selects a media element for a given gallery.
41
+ * @docs-private
84
42
  */
85
- select(thumbnail) {
86
- if (!this.galleries[thumbnail.gallery.name]) {
87
- return;
88
- }
89
- const gallery = this.galleries[thumbnail.gallery.name].getValue();
90
- const index = gallery.thumbnails.indexOf(thumbnail);
91
- if (thumbnail.selected || index === -1) {
92
- return;
93
- }
94
- this.galleries[thumbnail.gallery.name].next({
95
- ...gallery,
96
- thumbnails: [
97
- ...gallery.thumbnails.filter(m => m !== thumbnail).map(m => m.deselect()),
98
- thumbnail.select(),
99
- ],
100
- });
101
- }
102
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
103
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, providedIn: 'root' }); }
104
- }
105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryRegistry, decorators: [{
106
- type: Injectable,
107
- args: [{ providedIn: 'root' }]
108
- }] });
109
-
110
- /**
111
- * Dynamically renders the selected `DaffThumbnailDirective` in a `daff-media-gallery` any time the selected thumbnail
112
- * changes.
113
- */
114
- class DaffMediaRendererComponent {
115
- constructor(componentFactoryResolver, registry, gallery) {
116
- this.componentFactoryResolver = componentFactoryResolver;
117
- this.registry = registry;
118
- this.gallery = gallery;
119
- /**
120
- * Private tracker for indicating when the component is destroyed.
121
- */
122
- this._destroy$ = new Subject();
123
- }
124
- ngOnInit() {
125
- this.registry.galleries[this.gallery.name]
126
- .pipe(takeUntil(this._destroy$))
127
- .subscribe((gallery) => {
128
- /**
129
- * Clear out the slot for the dynamically rendered thumbnail
130
- */
131
- this.slot.clear();
132
- const _selectedThumbnail = gallery.thumbnails.filter(media => media.selected).shift();
133
- /**
134
- * If there's no selected media, render nothing.
135
- */
136
- if (!_selectedThumbnail) {
137
- return;
138
- }
139
- const _selectedThumbnailComponent = _selectedThumbnail.component;
140
- /**
141
- * Create the component to insert.
142
- */
143
- const component = this.componentFactoryResolver.resolveComponentFactory(_selectedThumbnailComponent.constructor);
144
- const componentRef = this.slot.createComponent(component);
145
- /**
146
- * Fill the component with it's values from the original component
147
- */
148
- component.inputs.forEach(input => {
149
- componentRef.instance[input.propName] = _selectedThumbnailComponent[input.propName];
150
- });
151
- /**
152
- * Trigger a change detection on the component tree, outside the cycle to address
153
- * the fact that the component was created outside a typical CD loop.
154
- */
155
- componentRef.changeDetectorRef.detectChanges();
156
- });
157
- }
43
+ gallery,
158
44
  /**
159
- * Used to unsubscribe from the dynamic component.
45
+ * @docs-private
160
46
  */
161
- ngOnDestroy() {
162
- this._destroy$.next(true);
163
- this._destroy$.unsubscribe();
164
- }
165
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaRendererComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: DaffMediaGalleryRegistry }, { token: DAFF_MEDIA_GALLERY_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
166
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: DaffMediaRendererComponent, isStandalone: true, selector: "daff-media-renderer", viewQueries: [{ propertyName: "slot", first: true, predicate: TemplateRef, descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template></ng-template>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
167
- }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaRendererComponent, decorators: [{
169
- type: Component,
170
- args: [{
171
- selector: 'daff-media-renderer',
172
- template: '<ng-template></ng-template>',
173
- changeDetection: ChangeDetectionStrategy.OnPush,
174
- standalone: true,
175
- }]
176
- }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: DaffMediaGalleryRegistry }, { type: undefined, decorators: [{
177
- type: Inject,
178
- args: [DAFF_MEDIA_GALLERY_TOKEN]
179
- }] }], propDecorators: { slot: [{
180
- type: ViewChild,
181
- args: [TemplateRef, { static: true, read: ViewContainerRef }]
182
- }] } });
183
-
184
- const {
185
- /**
186
- * A multi provider injection token that marks a component as renderable for the `DaffMediaRendererComponent`.
187
- */
188
- token: daffThumbnailCompatToken,
189
- /**
190
- * Provider function for {@link daffThumbnailCompatToken}.
191
- */
192
- provider: provideDaffThumbnailCompatToken, } = createSingleInjectionToken('thumbnailCompatToken');
193
-
194
- /**
195
- * A directive marking thumbnails for the `DaffMediaRendererComponent`. Needs to be wrapped in a `daff-media-gallery` component
196
- * and needs to be placed on a component that is provided as a `daffThumbnailCompatToken`.
197
- */
198
- class DaffThumbnailDirective {
199
- constructor(component, registry, gallery, selectedDirective) {
200
- this.component = component;
201
- this.registry = registry;
47
+ templateRef) {
202
48
  this.gallery = gallery;
203
- this.selectedDirective = selectedDirective;
49
+ this.templateRef = templateRef;
50
+ this._increment = uniqueThumbnailId;
204
51
  /**
205
- * Adds a class for styling a thumbnail
52
+ * The file path to a thumbnail, presumably an image.
206
53
  */
207
- this.class = true;
208
- }
209
- get selected() {
210
- return this.selectedDirective.selected;
211
- }
212
- select() {
213
- this.selectedDirective.select();
214
- return this;
215
- }
216
- deselect() {
217
- this.selectedDirective.deselect();
218
- return this;
54
+ this.thumbnailSrc = undefined;
55
+ /**
56
+ * Provides an accessible label for a thumbnail.
57
+ */
58
+ this.label = undefined;
59
+ /** Indicates whether the thumbnail represents a video. */
60
+ this.isVideo = false;
61
+ uniqueThumbnailId++;
219
62
  }
220
63
  /**
221
- * Adds a click event to trigger selection of the media element.
222
- *
223
- * @param event: MouseEvent
64
+ * @docs-private
224
65
  */
225
- onClick($event) {
226
- this.registry.select(this);
227
- }
228
66
  ngOnInit() {
229
- this.registry.add(this.gallery, this);
230
- }
231
- ngOnDestroy() {
232
- this.registry.remove(this);
67
+ if (!this.label && isDevMode()) {
68
+ console.warn('The thumbnail ' + this.id + ' is missing a label.');
69
+ }
233
70
  }
234
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffThumbnailDirective, deps: [{ token: daffThumbnailCompatToken }, { token: DaffMediaGalleryRegistry }, { token: DAFF_MEDIA_GALLERY_TOKEN }, { token: i2.DaffSelectableDirective }], target: i0.ɵɵFactoryTarget.Directive }); }
235
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.7", type: DaffThumbnailDirective, isStandalone: true, selector: "[daffThumbnail]", host: { listeners: { "click": "onClick($event)" }, properties: { "class.daff-thumbnail": "this.class" } }, hostDirectives: [{ directive: i2.DaffSelectableDirective, inputs: ["selected", "selected"], outputs: ["becameSelected", "becameSelected"] }], ngImport: i0 }); }
71
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", 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: "19.1.5", type: DaffThumbnailDirective, isStandalone: true, selector: "[daffThumbnail]", inputs: { thumbnailSrc: "thumbnailSrc", label: "label", isVideo: "isVideo" }, ngImport: i0 }); }
236
73
  }
237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffThumbnailDirective, decorators: [{
74
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffThumbnailDirective, decorators: [{
238
75
  type: Directive,
239
76
  args: [{
240
77
  selector: '[daffThumbnail]',
241
- standalone: true,
242
- hostDirectives: [{
243
- directive: DaffSelectableDirective,
244
- inputs: ['selected'],
245
- outputs: ['becameSelected'],
246
- }],
247
78
  }]
248
- }], ctorParameters: () => [{ type: i0.Type, decorators: [{
249
- type: Inject,
250
- args: [daffThumbnailCompatToken]
251
- }] }, { type: DaffMediaGalleryRegistry }, { type: undefined, decorators: [{
79
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
252
80
  type: Inject,
253
81
  args: [DAFF_MEDIA_GALLERY_TOKEN]
254
- }] }, { type: i2.DaffSelectableDirective }], propDecorators: { class: [{
255
- type: HostBinding,
256
- args: ['class.daff-thumbnail']
257
- }], onClick: [{
258
- type: HostListener,
259
- args: ['click', ['$event']]
82
+ }] }, { type: i0.TemplateRef }], propDecorators: { thumbnailSrc: [{
83
+ type: Input
84
+ }], label: [{
85
+ type: Input
86
+ }], isVideo: [{
87
+ type: Input
260
88
  }] } });
261
89
 
262
90
  let uniqueGalleryId = 0;
91
+ /**
92
+ * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.
93
+ *
94
+ * ```html
95
+ * <daff-media-gallery>
96
+ * <ng-template daffThumbnail thumbnailSrc="/thumbnail-path.jpg" label="Your description">
97
+ * <daff-image src="/image-path.jpg" alt="Your description" width="100" height="100"></daff-image>
98
+ * </ng-template>
99
+ * </daff-media-gallery>
100
+ * ```
101
+ */
263
102
  class DaffMediaGalleryComponent {
264
- constructor(registry) {
265
- this.registry = registry;
103
+ /**
104
+ * 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.
105
+ */
106
+ get id() {
107
+ return this._id;
108
+ }
109
+ set id(val) {
110
+ if (!val) {
111
+ return;
112
+ }
113
+ this._id = val;
114
+ }
115
+ ;
116
+ /**
117
+ * @docs-private
118
+ */
119
+ constructor(skeletonDirective) {
120
+ this.skeletonDirective = skeletonDirective;
121
+ /**
122
+ * @docs-private
123
+ */
124
+ this.role = 'tablist';
266
125
  /**
126
+ * The internal ID of the gallery.
127
+ */
128
+ this._id = 'media-gallery-' + uniqueGalleryId;
129
+ /**
130
+ * @docs-private
131
+ *
267
132
  * Adds a class for styling the media gallery
268
133
  */
269
134
  this.class = true;
270
135
  /**
271
- * The name of the gallery
136
+ * An event indicating that the selected media gallery element has changed.
137
+ */
138
+ this.elementChange = new EventEmitter();
139
+ /**
140
+ * @docs-private
272
141
  */
273
- this.name = `${uniqueGalleryId}`;
142
+ this._thumbnails = contentChildren(DaffThumbnailDirective);
143
+ /**
144
+ * @docs-private
145
+ */
146
+ this._selectedThumbnail = computed(() => {
147
+ const idx = this._selectedIndex();
148
+ if (!idx) {
149
+ return this._thumbnails().at(0);
150
+ }
151
+ return this._thumbnails().at(idx);
152
+ });
153
+ this._selectedIndex = signal(null);
274
154
  uniqueGalleryId++;
275
155
  }
276
- ngOnInit() {
277
- this.registry.add(this);
156
+ /**
157
+ * @docs-private
158
+ *
159
+ * Whether or not the component its currently displaying its skeleton state.
160
+ */
161
+ get skeleton() {
162
+ return this.skeletonDirective.skeleton;
163
+ }
164
+ focusSelected() {
165
+ this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();
166
+ }
167
+ /**
168
+ * Select a specific entry in the media gallery by its index.
169
+ *
170
+ * @param index The index to set, starting at 0.
171
+ */
172
+ selectIndex(index) {
173
+ this._selectedIndex.set(index);
174
+ this.elementChange.emit(index);
175
+ }
176
+ /**
177
+ * Navigate to the next element in the list of thumbnails.
178
+ *
179
+ * @param focus Whether to move focus to the newly selected item.
180
+ */
181
+ next(focus = true) {
182
+ this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);
183
+ this.elementChange.emit(this._selectedIndex());
184
+ if (focus) {
185
+ this.focusSelected();
186
+ }
278
187
  }
279
- ngOnDestroy() {
280
- this.registry.remove(this);
188
+ /**
189
+ * Navigate to the previous element in the list of thumbnails.
190
+ *
191
+ * @param focus Whether to move focus to the newly selected item.
192
+ */
193
+ previous(focus = true) {
194
+ this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);
195
+ this.elementChange.emit(this._selectedIndex());
196
+ if (focus) {
197
+ this.focusSelected();
198
+ }
281
199
  }
282
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryComponent, deps: [{ token: DaffMediaGalleryRegistry }], target: i0.ɵɵFactoryTarget.Component }); }
283
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { name: "name" }, host: { properties: { "class.daff-media-gallery": "this.class" } }, providers: [
200
+ /**
201
+ * Select the first element.
202
+ *
203
+ * @param focus Whether to move focus to the newly selected item.
204
+ */
205
+ selectFirst(focus = true) {
206
+ this._selectedIndex.set(0);
207
+ this.elementChange.emit(this._selectedIndex());
208
+ if (focus) {
209
+ this.focusSelected();
210
+ }
211
+ }
212
+ /**
213
+ * Select the last element of the gallery.
214
+ *
215
+ * @param Whether to move focus to the newly selected item.
216
+ */
217
+ selectLast(focus = true) {
218
+ this._selectedIndex.set(this._thumbnails().length - 1);
219
+ this.elementChange.emit(this._selectedIndex());
220
+ if (focus) {
221
+ this.focusSelected();
222
+ }
223
+ }
224
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryComponent, deps: [{ token: i1.DaffSkeletonableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
225
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { id: "id" }, outputs: { elementChange: "elementChange" }, host: { properties: { "attr.role": "this.role", "attr.id": "this.id", "class.daff-media-gallery": "this.class" } }, providers: [
284
226
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
285
227
  { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
286
- ], hostDirectives: [{ directive: i2.DaffArticleEncapsulatedDirective }, { directive: i2.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<div class=\"daff-media-gallery__thumbnails\">\n\t<ng-content select=\"[daffThumbnail]\"></ng-content>\n</div>\n<div class=\"daff-media-gallery__selected-thumbnail\">\n\t<daff-media-renderer></daff-media-renderer>\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column}@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:inline-block;height:64px;width:64px;margin:0 2px;max-width:100%;overflow:hidden;user-select:none}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:72px;width:72px}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{display:block;margin:0 0 4px;height:80px;width:80px}}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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:72px;width:72px;position:absolute;top:0;left:0}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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:80px;width:80px;position:absolute;top:0;left:0}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative}: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}.daff-media-gallery__thumbnails{margin:0 -2px;max-height:100%;order:2}@media (min-width: 1024px){.daff-media-gallery__thumbnails{margin:0 8px 0 0;order:1}}.daff-media-gallery__selected-thumbnail{display:block;flex-grow:1;order:1;position:relative}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2}}\n"], dependencies: [{ kind: "component", type: DaffMediaRendererComponent, selector: "daff-media-renderer" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
228
+ ], 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>\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}: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}: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}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;flex-grow:1}: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}: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 }); }
287
229
  }
288
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
289
231
  type: Component,
290
232
  args: [{ selector: 'daff-media-gallery', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
291
233
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -297,36 +239,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
297
239
  inputs: ['skeleton'],
298
240
  },
299
241
  ], imports: [
300
- DaffMediaRendererComponent,
301
242
  DaffThumbnailDirective,
302
- ], template: "<div class=\"daff-media-gallery__thumbnails\">\n\t<ng-content select=\"[daffThumbnail]\"></ng-content>\n</div>\n<div class=\"daff-media-gallery__selected-thumbnail\">\n\t<daff-media-renderer></daff-media-renderer>\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column}@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:inline-block;height:64px;width:64px;margin:0 2px;max-width:100%;overflow:hidden;user-select:none}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:72px;width:72px}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{display:block;margin:0 0 4px;height:80px;width:80px}}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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:72px;width:72px;position:absolute;top:0;left:0}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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:80px;width:80px;position:absolute;top:0;left:0}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative}: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}.daff-media-gallery__thumbnails{margin:0 -2px;max-height:100%;order:2}@media (min-width: 1024px){.daff-media-gallery__thumbnails{margin:0 8px 0 0;order:1}}.daff-media-gallery__selected-thumbnail{display:block;flex-grow:1;order:1;position:relative}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2}}\n"] }]
303
- }], ctorParameters: () => [{ type: DaffMediaGalleryRegistry }], propDecorators: { class: [{
243
+ NgTemplateOutlet,
244
+ DaffSelectableDirective,
245
+ ], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl>\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}: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}: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}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}: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}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;flex-grow:1}: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}: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"] }]
246
+ }], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { role: [{
304
247
  type: HostBinding,
305
- args: ['class.daff-media-gallery']
306
- }], name: [{
248
+ args: ['attr.role']
249
+ }], id: [{
250
+ type: HostBinding,
251
+ args: ['attr.id']
252
+ }, {
307
253
  type: Input
254
+ }], class: [{
255
+ type: HostBinding,
256
+ args: ['class.daff-media-gallery']
257
+ }], elementChange: [{
258
+ type: Output
259
+ }], _thumbnailButtons: [{
260
+ type: ViewChildren,
261
+ args: ['thumbnailButtons', { read: ElementRef }]
308
262
  }] } });
309
263
 
310
264
  /**
311
265
  * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
312
266
  */
313
267
  class DaffMediaGalleryModule {
314
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
315
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule,
268
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
269
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule,
316
270
  DaffMediaGalleryComponent,
317
- DaffThumbnailDirective,
318
- DaffMediaRendererComponent], exports: [DaffMediaGalleryComponent,
271
+ DaffThumbnailDirective], exports: [DaffMediaGalleryComponent,
319
272
  DaffThumbnailDirective] }); }
320
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule] }); }
273
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, imports: [CommonModule] }); }
321
274
  }
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: DaffMediaGalleryModule, decorators: [{
275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DaffMediaGalleryModule, decorators: [{
323
276
  type: NgModule,
324
277
  args: [{
325
278
  imports: [
326
279
  CommonModule,
327
280
  DaffMediaGalleryComponent,
328
281
  DaffThumbnailDirective,
329
- DaffMediaRendererComponent,
330
282
  ],
331
283
  exports: [
332
284
  DaffMediaGalleryComponent,
@@ -335,15 +287,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImpor
335
287
  }]
336
288
  }] });
337
289
 
290
+ /**
291
+ * @docs-private
292
+ */
338
293
  const DAFF_MEDIA_GALLERY_COMPONENTS = [
339
294
  DaffMediaGalleryComponent,
340
295
  DaffThumbnailDirective,
341
- DaffMediaRendererComponent,
342
296
  ];
343
297
 
344
298
  /**
345
299
  * Generated bundle index. Do not edit.
346
300
  */
347
301
 
348
- export { DAFF_MEDIA_GALLERY_COMPONENTS, DaffMediaGalleryComponent, DaffMediaGalleryModule, DaffThumbnailDirective, daffThumbnailCompatToken };
302
+ export { DAFF_MEDIA_GALLERY_COMPONENTS, DaffMediaGalleryComponent, DaffMediaGalleryModule, DaffThumbnailDirective };
349
303
  //# sourceMappingURL=daffodil-design-media-gallery.mjs.map