@daffodil/design 0.90.0 → 0.92.3-rc.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 (277) hide show
  1. package/accordion/README.md +26 -38
  2. package/accordion/index.d.ts +9 -6
  3. package/article/README.md +66 -46
  4. package/article/index.d.ts +41 -0
  5. package/article/src/article-theme.scss +22 -0
  6. package/breadcrumb/README.md +6 -1
  7. package/breadcrumb/index.d.ts +65 -11
  8. package/breadcrumb/src/breadcrumb-theme.scss +1 -1
  9. package/button/README.md +36 -33
  10. package/button/index.d.ts +27 -6
  11. package/button/src/button/basic/button-theme.scss +4 -2
  12. package/button/src/button/button-base.scss +29 -6
  13. package/button/src/button/icon/icon-theme.scss +10 -6
  14. package/button/src/button/raised/raised-theme.scss +6 -4
  15. package/callout/README.md +15 -27
  16. package/card/README.md +36 -69
  17. package/card/index.d.ts +7 -41
  18. package/card/src/card-base-theme.scss +2 -5
  19. package/card/src/card-base.scss +2 -2
  20. package/checkbox/README.md +0 -0
  21. package/checkbox/index.d.ts +177 -0
  22. package/container/README.md +18 -23
  23. package/fesm2022/daffodil-design-accordion.mjs +34 -25
  24. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  25. package/fesm2022/daffodil-design-article.mjs +283 -17
  26. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  27. package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
  28. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  29. package/fesm2022/daffodil-design-button.mjs +90 -45
  30. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  31. package/fesm2022/daffodil-design-callout.mjs +23 -23
  32. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  33. package/fesm2022/daffodil-design-card.mjs +43 -90
  34. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-checkbox.mjs +317 -0
  36. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
  37. package/fesm2022/daffodil-design-container.mjs +8 -8
  38. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-form-field.mjs +56 -86
  40. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-form.mjs +62 -0
  42. package/fesm2022/daffodil-design-form.mjs.map +1 -0
  43. package/fesm2022/daffodil-design-hero.mjs +23 -23
  44. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-image.mjs +19 -11
  46. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-input.mjs +18 -14
  48. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-link-set.mjs +25 -17
  50. package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-list.mjs +16 -16
  52. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
  54. package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
  56. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-menu.mjs +223 -60
  58. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-modal.mjs +86 -83
  60. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-native-select.mjs +47 -41
  62. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-navbar.mjs +25 -21
  64. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-notification.mjs +28 -64
  66. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-paginator.mjs +11 -16
  68. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
  70. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-quantity-field.mjs +19 -18
  72. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-radio.mjs +27 -56
  74. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-select.mjs +6 -6
  76. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-sidebar.mjs +30 -60
  78. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-spinner.mjs +99 -0
  80. package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
  81. package/fesm2022/daffodil-design-switch.mjs +49 -106
  82. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-tabs.mjs +35 -27
  84. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  85. package/fesm2022/daffodil-design-tag.mjs +7 -7
  86. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  87. package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
  88. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  89. package/fesm2022/daffodil-design-textarea.mjs +6 -3
  90. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  91. package/fesm2022/daffodil-design-toast.mjs +79 -80
  92. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-tree.mjs +152 -112
  94. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  95. package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
  96. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  97. package/fesm2022/daffodil-design.mjs +559 -711
  98. package/fesm2022/daffodil-design.mjs.map +1 -1
  99. package/form/README.md +75 -0
  100. package/form/index.d.ts +27 -0
  101. package/form-field/README.md +74 -99
  102. package/form-field/index.d.ts +64 -42
  103. package/hero/README.md +5 -5
  104. package/image/README.md +27 -19
  105. package/image/index.d.ts +6 -1
  106. package/index.d.ts +282 -447
  107. package/input/README.md +36 -16
  108. package/input/index.d.ts +4 -3
  109. package/link-set/index.d.ts +9 -1
  110. package/list/README.md +2 -2
  111. package/loading-icon/README.md +1 -1
  112. package/loading-icon/index.d.ts +1 -1
  113. package/media-gallery/README.md +3 -3
  114. package/menu/README.md +107 -10
  115. package/menu/index.d.ts +143 -11
  116. package/modal/README.md +107 -17
  117. package/modal/index.d.ts +72 -35
  118. package/native-select/README.md +52 -15
  119. package/native-select/index.d.ts +8 -7
  120. package/navbar/README.md +23 -17
  121. package/navbar/index.d.ts +12 -2
  122. package/navbar/src/navbar-theme.scss +4 -46
  123. package/notification/README.md +4 -4
  124. package/notification/index.d.ts +7 -38
  125. package/package.json +1 -1
  126. package/paginator/README.md +42 -6
  127. package/paginator/index.d.ts +5 -9
  128. package/progress-bar/README.md +3 -3
  129. package/quantity-field/README.md +4 -4
  130. package/quantity-field/index.d.ts +4 -1
  131. package/radio/README.md +1 -1
  132. package/radio/index.d.ts +0 -16
  133. package/scss/layout/_breakpoint.scss +1 -1
  134. package/scss/theme.scss +9 -5
  135. package/scss/theming/_color-palettes.scss +19 -11
  136. package/scss/theming/_configure-theme.scss +11 -10
  137. package/scss/theming/_daff-theme.scss +5 -14
  138. package/scss/theming/_get-base-color.scss +2 -2
  139. package/scss/theming/_get-palette.scss +2 -2
  140. package/scss/theming/_get-theme-mode.scss +3 -3
  141. package/scss/theming/_index.scss +2 -1
  142. package/scss/theming/contrast/max-contrast/max-contrast.scss +3 -3
  143. package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
  144. package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
  145. package/scss/theming/create-theme/_create-theme.scss +330 -0
  146. package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
  147. package/scss/theming/create-theme/_index.scss +1 -0
  148. package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
  149. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
  150. package/scss/typography/mixins/_font-weight.scss +8 -14
  151. package/select/README.md +107 -4
  152. package/sidebar/README.md +6 -14
  153. package/sidebar/index.d.ts +3 -15
  154. package/spinner/README.md +57 -0
  155. package/spinner/index.d.ts +53 -0
  156. package/spinner/src/spinner-theme.scss +62 -0
  157. package/switch/README.md +21 -29
  158. package/switch/index.d.ts +18 -48
  159. package/switch/src/switch-theme.scss +26 -18
  160. package/tabs/README.md +1 -1
  161. package/tabs/index.d.ts +8 -5
  162. package/tag/README.md +24 -30
  163. package/tag/index.d.ts +1 -1
  164. package/tag/src/tag-theme.scss +11 -9
  165. package/text-snippet/README.md +1 -1
  166. package/text-snippet/src/text-snippet-theme.scss +12 -0
  167. package/textarea/README.md +36 -6
  168. package/textarea/index.d.ts +4 -4
  169. package/toast/README.md +4 -4
  170. package/tree/README.md +39 -22
  171. package/tree/index.d.ts +57 -96
  172. package/tree/src/tree-theme.scss +0 -4
  173. package/accordion/examples/index.d.ts +0 -20
  174. package/article/examples/index.d.ts +0 -50
  175. package/breadcrumb/examples/index.d.ts +0 -10
  176. package/button/examples/index.d.ts +0 -67
  177. package/callout/examples/index.d.ts +0 -41
  178. package/card/examples/index.d.ts +0 -62
  179. package/card/src/card/raised/raised-theme.scss +0 -28
  180. package/checkbox/examples/index.d.ts +0 -32
  181. package/container/examples/index.d.ts +0 -16
  182. package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
  183. package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
  184. package/fesm2022/daffodil-design-article-examples.mjs +0 -134
  185. package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
  186. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
  187. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
  188. package/fesm2022/daffodil-design-button-examples.mjs +0 -178
  189. package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
  190. package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
  191. package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
  192. package/fesm2022/daffodil-design-card-examples.mjs +0 -168
  193. package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
  194. package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
  195. package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
  196. package/fesm2022/daffodil-design-container-examples.mjs +0 -41
  197. package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
  198. package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
  199. package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
  200. package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
  201. package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
  202. package/fesm2022/daffodil-design-image-examples.mjs +0 -58
  203. package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
  204. package/fesm2022/daffodil-design-input-examples.mjs +0 -108
  205. package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
  206. package/fesm2022/daffodil-design-list-examples.mjs +0 -77
  207. package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
  208. package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
  209. package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
  210. package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
  211. package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
  212. package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
  213. package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
  214. package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
  215. package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
  216. package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
  217. package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
  218. package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
  219. package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
  220. package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
  221. package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
  222. package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
  223. package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
  224. package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
  225. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
  226. package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
  227. package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
  228. package/fesm2022/daffodil-design-radio-examples.mjs +0 -34
  229. package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
  230. package/fesm2022/daffodil-design-select-examples.mjs +0 -117
  231. package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
  232. package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
  233. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
  234. package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
  235. package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
  236. package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
  237. package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
  238. package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
  239. package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
  240. package/fesm2022/daffodil-design-tag-examples.mjs +0 -125
  241. package/fesm2022/daffodil-design-tag-examples.mjs.map +0 -1
  242. package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
  243. package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
  244. package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
  245. package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
  246. package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
  247. package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
  248. package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
  249. package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
  250. package/form-field/examples/index.d.ts +0 -18
  251. package/hero/examples/index.d.ts +0 -45
  252. package/image/examples/index.d.ts +0 -10
  253. package/input/examples/index.d.ts +0 -10
  254. package/list/examples/index.d.ts +0 -29
  255. package/loading-icon/examples/index.d.ts +0 -16
  256. package/media-gallery/examples/index.d.ts +0 -38
  257. package/menu/examples/index.d.ts +0 -20
  258. package/modal/examples/index.d.ts +0 -15
  259. package/native-select/examples/index.d.ts +0 -10
  260. package/navbar/examples/index.d.ts +0 -31
  261. package/notification/examples/index.d.ts +0 -12
  262. package/paginator/examples/index.d.ts +0 -26
  263. package/progress-bar/examples/index.d.ts +0 -10
  264. package/quantity-field/examples/index.d.ts +0 -30
  265. package/radio/examples/index.d.ts +0 -13
  266. package/select/examples/index.d.ts +0 -28
  267. package/sidebar/examples/index.d.ts +0 -10
  268. package/sticky/examples/index.d.ts +0 -10
  269. package/switch/examples/index.d.ts +0 -46
  270. package/tabs/examples/index.d.ts +0 -12
  271. package/tag/examples/index.d.ts +0 -50
  272. package/text-snippet/examples/index.d.ts +0 -10
  273. package/textarea/examples/index.d.ts +0 -10
  274. package/toast/examples/index.d.ts +0 -56
  275. package/tree/examples/index.d.ts +0 -18
  276. /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
  277. /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
@@ -1,316 +1,12 @@
1
- import { CommonModule, isPlatformBrowser } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { EventEmitter, ElementRef, HostBinding, Output, Input, ViewChild, ChangeDetectionStrategy, Component, Optional, Self, Directive, ContentChildren, NgModule, isDevMode, Injectable, InjectionToken, inject, PLATFORM_ID, DOCUMENT, Inject, makeEnvironmentProviders, provideAppInitializer, afterNextRender } from '@angular/core';
4
- import * as i1 from '@angular/forms';
2
+ import { HostBinding, Directive, NgModule, isDevMode, Input, Injectable, InjectionToken, inject, PLATFORM_ID, DOCUMENT, Inject, makeEnvironmentProviders, provideAppInitializer, EventEmitter, Output, afterNextRender, signal, input, computed, effect, forwardRef, Optional, SkipSelf } from '@angular/core';
5
3
  import { BreakpointObserver } from '@angular/cdk/layout';
4
+ import { isPlatformBrowser } from '@angular/common';
6
5
  import { of, fromEventPattern, Subject, merge, fromEvent, EMPTY, combineLatest } from 'rxjs';
7
6
  import { startWith, map, catchError, filter, shareReplay } from 'rxjs/operators';
8
7
  import { DaffServerSafePersistenceServiceToken } from '@daffodil/core';
9
-
10
- class DaffErrorStateMatcher {
11
- isErrorState(control, formSubmitted) {
12
- return control.errors && (control.touched || formSubmitted);
13
- }
14
- }
15
-
16
- let checkboxIdNum = 0;
17
- class DaffCheckboxComponent {
18
- get checked() {
19
- return this._checked;
20
- }
21
- set checked(value) {
22
- if (this._checked === value) {
23
- return;
24
- }
25
- if (value === true) {
26
- this.nativeCheckbox.nativeElement.checked = true;
27
- this.becameChecked.emit(this._checked);
28
- }
29
- else {
30
- this.nativeCheckbox.nativeElement.checked = false;
31
- this.becameUnchecked.emit();
32
- }
33
- this._checked = value;
34
- }
35
- /**
36
- * @docs-private
37
- */
38
- _onChange(val) {
39
- if (val.target.checked) {
40
- this.select();
41
- }
42
- else {
43
- this.deselect();
44
- }
45
- }
46
- ;
47
- /**
48
- * @docs-private
49
- */
50
- get focusClass() {
51
- return this.focused === true;
52
- }
53
- ;
54
- /**
55
- * @docs-private
56
- */
57
- get disabledClass() {
58
- return this.disabled === true;
59
- }
60
- ;
61
- /**
62
- * Sets focused to false.
63
- */
64
- onBlur() {
65
- this.focused = false;
66
- }
67
- /**
68
- * Sets focused to true.
69
- */
70
- onFocus() {
71
- this.focused = true;
72
- }
73
- constructor(_cdRef) {
74
- this._cdRef = _cdRef;
75
- /**
76
- * Boolean value to determine whether or not the checkbox is checked.
77
- */
78
- this._checked = false;
79
- /**
80
- * The id of the checkbox. Must be unique. If not entered by a user then it is generated.
81
- */
82
- this.id = 'daff-checkbox-' + checkboxIdNum;
83
- /**
84
- * The aria-label of the checkbox.
85
- */
86
- // eslint-disable-next-line @angular-eslint/no-input-rename
87
- this.label = '';
88
- /**
89
- * Event on whether or not the selection has changed.
90
- */
91
- this.becameChecked = new EventEmitter();
92
- this.becameUnchecked = new EventEmitter();
93
- /**
94
- * The role of the component. Set to "checkbox".
95
- *
96
- * @docs-private
97
- */
98
- this.role = 'checkbox';
99
- /**
100
- * Increments id number on new checkbox. Gurantees unique ID on generation.
101
- */
102
- checkboxIdNum++;
103
- }
104
- /**
105
- * Sets checked to true.
106
- */
107
- select() {
108
- this.checked = true;
109
- this._cdRef.markForCheck();
110
- }
111
- /**
112
- * Sets checked to false
113
- */
114
- deselect() {
115
- this.checked = false;
116
- this._cdRef.markForCheck();
117
- }
118
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
119
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxComponent, isStandalone: false, selector: "daff-checkbox", inputs: { name: "name", value: "value", checked: "checked", id: "id", label: ["aria-label", "label"], labeledBy: ["aria-labelledby", "labeledBy"] }, outputs: { becameChecked: "becameChecked", becameUnchecked: "becameUnchecked" }, host: { properties: { "attr.role": "this.role", "class.focused": "this.focusClass", "class.disabled": "this.disabledClass" } }, viewQueries: [{ propertyName: "nativeCheckbox", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<input #inputElement\ntype=\"checkbox\"\n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labeledBy\"\n[attr.checked]=\"checked ? '' : null\"\n[attr.id] = \"id\"\n[attr.value]=\"value\"\n[attr.name]=\"name\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"_onChange($event)\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"\n/>\n<label [attr.for]=\"id\"><ng-content></ng-content></label>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
120
- }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxComponent, decorators: [{
122
- type: Component,
123
- args: [{ selector: 'daff-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<input #inputElement\ntype=\"checkbox\"\n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labeledBy\"\n[attr.checked]=\"checked ? '' : null\"\n[attr.id] = \"id\"\n[attr.value]=\"value\"\n[attr.name]=\"name\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"_onChange($event)\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"\n/>\n<label [attr.for]=\"id\"><ng-content></ng-content></label>" }]
124
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { nativeCheckbox: [{
125
- type: ViewChild,
126
- args: ['inputElement', { static: true, read: ElementRef }]
127
- }], name: [{
128
- type: Input
129
- }], value: [{
130
- type: Input
131
- }], checked: [{
132
- type: Input
133
- }], id: [{
134
- type: Input
135
- }], label: [{
136
- type: Input,
137
- args: ['aria-label']
138
- }], labeledBy: [{
139
- type: Input,
140
- args: ['aria-labelledby']
141
- }], becameChecked: [{
142
- type: Output
143
- }], becameUnchecked: [{
144
- type: Output
145
- }], role: [{
146
- type: HostBinding,
147
- args: ['attr.role']
148
- }], focusClass: [{
149
- type: HostBinding,
150
- args: ['class.focused']
151
- }], disabledClass: [{
152
- type: HostBinding,
153
- args: ['class.disabled']
154
- }] } });
155
-
156
- /**
157
- * A directive for binding the DaffCheckboxComponent and the Control Value Accessor.
158
- */
159
- class DaffCheckboxControlValueAccessorDirective {
160
- constructor(_control, _checkbox) {
161
- this._control = _control;
162
- this._checkbox = _checkbox;
163
- if (this._control != null) {
164
- this._control.valueAccessor = this;
165
- }
166
- }
167
- /**
168
- * A lifecycle method called when the directive is initialized.
169
- */
170
- /**
171
- * @docs-private
172
- */
173
- ngOnInit() {
174
- // See the note about `writeValue` usage.
175
- this.writeValue(this._control.value);
176
- // Watch for user events on the component to update the state
177
- this._checkbox.becameChecked.subscribe(() => {
178
- this._onChange(true);
179
- });
180
- this._checkbox.becameUnchecked.subscribe(() => {
181
- this._onChange(false);
182
- });
183
- }
184
- /**
185
- * writes a new value down into the component.
186
- */
187
- writeValue(value) {
188
- value = !!value;
189
- if (value === true) {
190
- this.fireSelect();
191
- }
192
- else {
193
- this.fireDeselect();
194
- }
195
- }
196
- /**
197
- * Registers the change handler
198
- */
199
- registerOnChange(fn) {
200
- this._onChange = (val) => {
201
- fn(val);
202
- };
203
- }
204
- /**
205
- * Registers the touched handler
206
- */
207
- registerOnTouched(fn) {
208
- this._onTouched = fn;
209
- }
210
- /**
211
- * Sets the disabled state.
212
- */
213
- setDisabledState(isDisabled) {
214
- this._checkbox.disabled = isDisabled;
215
- }
216
- /**
217
- * calls the child checkbox's select function
218
- */
219
- fireSelect() {
220
- this._checkbox.select();
221
- }
222
- /**
223
- * calls the child checkbox's deselect function
224
- */
225
- fireDeselect() {
226
- this._checkbox.deselect();
227
- }
228
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxControlValueAccessorDirective, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: DaffCheckboxComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
229
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxControlValueAccessorDirective, isStandalone: false, selector: "daff-checkbox[ngModel], daff-checkbox[formControl], daff-checkbox[formControlName]", inputs: { value: "value", name: "name" }, ngImport: i0 }); }
230
- }
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxControlValueAccessorDirective, decorators: [{
232
- type: Directive,
233
- args: [{
234
- // eslint-disable-next-line @angular-eslint/directive-selector
235
- selector: 'daff-checkbox[ngModel], daff-checkbox[formControl], daff-checkbox[formControlName]',
236
- standalone: false,
237
- }]
238
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
239
- type: Optional
240
- }, {
241
- type: Self
242
- }] }, { type: DaffCheckboxComponent }], propDecorators: { value: [{
243
- type: Input
244
- }], name: [{
245
- type: Input
246
- }] } });
247
-
248
- class DaffCheckboxSetComponent {
249
- constructor() {
250
- /**
251
- * The role of the component. Set to "checkbox".
252
- *
253
- * @docs-private
254
- */
255
- this.role = 'group';
256
- this.valueList = new EventEmitter();
257
- }
258
- getValues() {
259
- const checkboxes = this.checkboxes.toArray();
260
- return this.formArray.value.map((element, index) => element === true ? checkboxes[index].value : false).filter(element => element !== false);
261
- }
262
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxSetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
263
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxSetComponent, isStandalone: false, selector: "daff-checkbox-set", inputs: { formArray: "formArray", name: "name" }, outputs: { valueList: "valueList" }, host: { properties: { "attr.role": "this.role" } }, queries: [{ propertyName: "checkboxes", predicate: DaffCheckboxComponent }], ngImport: i0, template: "<ng-content></ng-content>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
264
- }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxSetComponent, decorators: [{
266
- type: Component,
267
- args: [{ selector: 'daff-checkbox-set', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-content></ng-content>" }]
268
- }], propDecorators: { formArray: [{
269
- type: Input
270
- }], name: [{
271
- type: Input
272
- }], role: [{
273
- type: HostBinding,
274
- args: ['attr.role']
275
- }], checkboxes: [{
276
- type: ContentChildren,
277
- args: [DaffCheckboxComponent]
278
- }], valueList: [{
279
- type: Output
280
- }] } });
281
-
282
- class DaffCheckboxModule {
283
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
284
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, declarations: [DaffCheckboxComponent,
285
- DaffCheckboxSetComponent,
286
- DaffCheckboxControlValueAccessorDirective], imports: [CommonModule], exports: [DaffCheckboxComponent,
287
- DaffCheckboxSetComponent,
288
- DaffCheckboxControlValueAccessorDirective] }); }
289
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, providers: [
290
- DaffCheckboxSetComponent,
291
- ], imports: [CommonModule] }); }
292
- }
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, decorators: [{
294
- type: NgModule,
295
- args: [{
296
- exports: [
297
- DaffCheckboxComponent,
298
- DaffCheckboxSetComponent,
299
- DaffCheckboxControlValueAccessorDirective,
300
- ],
301
- declarations: [
302
- DaffCheckboxComponent,
303
- DaffCheckboxSetComponent,
304
- DaffCheckboxControlValueAccessorDirective,
305
- ],
306
- imports: [
307
- CommonModule,
308
- ],
309
- providers: [
310
- DaffCheckboxSetComponent,
311
- ],
312
- }]
313
- }] });
8
+ import * as i2 from '@angular/cdk/a11y';
9
+ import { CdkTrapFocus } from '@angular/cdk/a11y';
314
10
 
315
11
  /**
316
12
  * @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
@@ -322,10 +18,10 @@ class DaffFormLabelDirective {
322
18
  */
323
19
  this.class = true;
324
20
  }
325
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
326
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffFormLabelDirective, isStandalone: true, selector: "[daffFormLabel]", host: { properties: { "class.daff-form-label": "this.class" } }, ngImport: i0 }); }
21
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffFormLabelDirective, isStandalone: true, selector: "[daffFormLabel]", host: { properties: { "class.daff-form-label": "this.class" } }, ngImport: i0 }); }
327
23
  }
328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelDirective, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelDirective, decorators: [{
329
25
  type: Directive,
330
26
  args: [{
331
27
  selector: '[daffFormLabel]',
@@ -339,11 +35,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
339
35
  * @deprecated in favor of standalone components. Deprecated in version 0.84.0. Will be removed in version 1.0.0.
340
36
  */
341
37
  class DaffFormLabelModule {
342
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
343
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelModule, imports: [DaffFormLabelDirective], exports: [DaffFormLabelDirective] }); }
344
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelModule }); }
38
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
39
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelModule, imports: [DaffFormLabelDirective], exports: [DaffFormLabelDirective] }); }
40
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelModule }); }
345
41
  }
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFormLabelModule, decorators: [{
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFormLabelModule, decorators: [{
347
43
  type: NgModule,
348
44
  args: [{
349
45
  exports: [
@@ -356,63 +52,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
356
52
  }] });
357
53
 
358
54
  /**
359
- *
360
- * Prefix can be used to place content before another piece of content in components like
361
- * `daff-form-field`, `daff-solo-field`, and `daff-list`.
55
+ * DaffPrefixDirective can be used to place content before another piece of content
56
+ * in components like `DaffFormFieldComponent` or `DaffListComponent`.
362
57
  */
363
58
  class DaffPrefixDirective {
364
- constructor() {
365
- /**
366
- * @docs-private
367
- */
368
- this.class = true;
369
- }
370
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
371
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffPrefixDirective, isStandalone: true, selector: "[daffPrefix]", host: { properties: { "class.daff-prefix": "this.class" } }, ngImport: i0 }); }
59
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffPrefixDirective, isStandalone: true, selector: "[daffPrefix]", host: { classAttribute: "daff-prefix" }, ngImport: i0 }); }
372
61
  }
373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixDirective, decorators: [{
374
63
  type: Directive,
375
64
  args: [{
376
65
  selector: '[daffPrefix]',
66
+ host: {
67
+ class: 'daff-prefix',
68
+ },
377
69
  }]
378
- }], propDecorators: { class: [{
379
- type: HostBinding,
380
- args: ['class.daff-prefix']
381
- }] } });
70
+ }] });
382
71
 
383
72
  /**
384
- *
385
- * Prefix can be used to place content after another piece of content in components like
386
- * `daff-form-field`, `daff-solo-field`, and `daff-list`.
73
+ * DaffSuffixDirective can be used to place content after another piece of content
74
+ * in components like `DaffFormFieldComponent` or `DaffListComponent`.
387
75
  */
388
76
  class DaffSuffixDirective {
389
- constructor() {
390
- /**
391
- * @docs-private
392
- */
393
- this.class = true;
394
- }
395
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
396
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSuffixDirective, isStandalone: true, selector: "[daffSuffix]", host: { properties: { "class.daff-suffix": "this.class" } }, ngImport: i0 }); }
77
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
78
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSuffixDirective, isStandalone: true, selector: "[daffSuffix]", host: { classAttribute: "daff-suffix" }, ngImport: i0 }); }
397
79
  }
398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, decorators: [{
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSuffixDirective, decorators: [{
399
81
  type: Directive,
400
82
  args: [{
401
83
  selector: '[daffSuffix]',
84
+ host: {
85
+ class: 'daff-suffix',
86
+ },
402
87
  }]
403
- }], propDecorators: { class: [{
404
- type: HostBinding,
405
- args: ['class.daff-suffix']
406
- }] } });
88
+ }] });
407
89
 
90
+ /**
91
+ * @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0.
92
+ */
408
93
  class DaffPrefixSuffixModule {
409
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
410
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, imports: [DaffPrefixDirective,
94
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixSuffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
95
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixSuffixModule, imports: [DaffPrefixDirective,
411
96
  DaffSuffixDirective], exports: [DaffPrefixDirective,
412
97
  DaffSuffixDirective] }); }
413
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule }); }
98
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixSuffixModule }); }
414
99
  }
415
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, decorators: [{
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffPrefixSuffixModule, decorators: [{
416
101
  type: NgModule,
417
102
  args: [{
418
103
  imports: [
@@ -426,141 +111,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
426
111
  }]
427
112
  }] });
428
113
 
114
+ const DAFF_PREFIX_SUFFIX_DIRECTIVES = [
115
+ DaffPrefixDirective,
116
+ DaffSuffixDirective,
117
+ ];
118
+
429
119
  /**
430
- * Enumerates the available color palette options for a component.
431
- * These values can be used to apply specific color styles to components within the application.
120
+ * The available color options.
432
121
  */
433
- var DaffPaletteEnum;
434
- (function (DaffPaletteEnum) {
122
+ var DaffColorEnum;
123
+ (function (DaffColorEnum) {
435
124
  /**
436
- * Your primary color.
125
+ * The primary color.
437
126
  */
438
- DaffPaletteEnum["Primary"] = "primary";
127
+ DaffColorEnum["Primary"] = "primary";
439
128
  /**
440
- * Your secondary color.
129
+ * The secondary color.
441
130
  */
442
- DaffPaletteEnum["Secondary"] = "secondary";
131
+ DaffColorEnum["Secondary"] = "secondary";
443
132
  /**
444
- * Your tertiary color.
133
+ * The tertiary color.
445
134
  */
446
- DaffPaletteEnum["Tertiary"] = "tertiary";
135
+ DaffColorEnum["Tertiary"] = "tertiary";
447
136
  /**
448
- * A light color that does not change based on the defined theme.
137
+ * A light color that does not change based on the theme.
449
138
  */
450
- DaffPaletteEnum["Light"] = "light";
139
+ DaffColorEnum["Light"] = "light";
451
140
  /**
452
- * A dark color that does not change based on the defined theme.
141
+ * A dark color that does not change based on the theme.
453
142
  */
454
- DaffPaletteEnum["Dark"] = "dark";
143
+ DaffColorEnum["Dark"] = "dark";
455
144
  /**
456
- * A color that matches the defined theme.
145
+ * A color that matches the theme.
457
146
  */
458
- DaffPaletteEnum["Theme"] = "theme";
147
+ DaffColorEnum["Theme"] = "theme";
459
148
  /**
460
- * A color that contrasts against the defined theme.
149
+ * A color that contrasts against the theme.
461
150
  */
462
- DaffPaletteEnum["ThemeContrast"] = "theme-contrast";
151
+ DaffColorEnum["ThemeContrast"] = "theme-contrast";
463
152
  /**
464
153
  * @deprecated Deprecated in version 0.82.0. Will be removed in version 1.0.0.
465
- * Black. It's dark.
466
154
  */
467
- DaffPaletteEnum["Black"] = "black";
155
+ DaffColorEnum["Black"] = "black";
468
156
  /**
469
157
  * @deprecated Deprecated in version 0.82.0. Will be removed in version 1.0.0.
470
- * White. It's bright.
471
158
  */
472
- DaffPaletteEnum["White"] = "white";
473
- })(DaffPaletteEnum || (DaffPaletteEnum = {}));
159
+ DaffColorEnum["White"] = "white";
160
+ })(DaffColorEnum || (DaffColorEnum = {}));
474
161
 
475
- const colorInPalette = (color) => Object.values(DaffPaletteEnum).includes(color);
162
+ const isDaffColor = (color) => Object.values(DaffColorEnum).includes(color);
476
163
  const validateColor = (color) => {
477
164
  if (isDevMode()) {
478
- if (color !== undefined && !colorInPalette(color)) {
479
- console.warn(color + ' is not a valid color in DaffPalette');
165
+ if (color !== undefined && !isDaffColor(color)) {
166
+ console.warn(color + ' is not a valid color in DaffColor');
480
167
  }
481
168
  }
482
169
  };
483
170
  /**
484
- * `DaffColorableDirective` allows a component to conditionally apply color-specific
485
- * styles by setting CSS classes based on the specified color. This directive is useful
486
- * for applying different color palettes to a component in an Angular application.
487
- *
488
- * Supported colors: `primary | secondary | tertiary | light | dark | theme | theme-contrast`
489
- *
490
- * | Color | Class |
491
- * | -------- | ----- |
492
- * | `primary` | `.daff-primary`|
493
- * | `secondary` | `.daff-secondary`|
494
- * | `tertiary` | `.daff-tertiary`|
495
- * | `light` | `daff-light` |
496
- * | `dark` | `daff-dark` |
497
- * | `theme` | `daff-theme`|
498
- * | `theme-contrast` | `.daff-theme-contrast`|
499
- *
500
- * `white` and `black` have been deprecated in favor of `light` and `dark`.
501
- *
502
- * @example Implementing it as an attribute directive
503
- *
504
- * ```html
505
- * <div daffColorable [color]="primary">Colored content</div>
506
- * ```
507
- *
508
- * ```scss
509
- * .div {
510
- * &.daff-primary {
511
- * color: daff-color($primary);
512
- * }
513
- * }
514
- * ```
515
- *
516
- * In this example, the `daff-primary` class is applied to the `div` element, allowing you to
517
- * use the color class to style the `div`.
518
- *
519
- * @example Implementing it as an Angular host directive
520
- *
521
- * ```ts
522
- * @Component({
523
- * selector: 'custom-component',
524
- * template: 'custom-component.html',
525
- * hostDirectives: [
526
- * {
527
- * directive: DaffColorableDirective,
528
- * inputs: ['color'],
529
- * },
530
- * ],
531
- * })
532
- * export class CustomComponent {
533
- * @HostBinding('class.custom-component') class = true;
534
- * }
535
- * ```
536
- *
537
- * ```scss
538
- * .custom-component {
539
- * &.daff-primary {
540
- * background: daff-color($primary, 10);
541
- * color: daff-color($primary, 90);
542
- * }
543
- * }
544
- * ```
171
+ * Enforces consistent use of {@link DaffColor} on a component by applying
172
+ * color-specific CSS classes and validating the color in dev mode.
545
173
  */
546
174
  class DaffColorableDirective {
547
- /**
548
- * Dynamically sets the CSS classes based on the color.
549
- * @docs-private
550
- */
551
- get class() {
552
- return {
553
- 'daff-primary': this.color === DaffPaletteEnum.Primary,
554
- 'daff-secondary': this.color === DaffPaletteEnum.Secondary,
555
- 'daff-tertiary': this.color === DaffPaletteEnum.Tertiary,
556
- 'daff-light': this.color === DaffPaletteEnum.Light,
557
- 'daff-dark': this.color === DaffPaletteEnum.Dark,
558
- 'daff-theme': this.color === DaffPaletteEnum.Theme,
559
- 'daff-theme-contrast': this.color === DaffPaletteEnum.ThemeContrast,
560
- 'daff-black': this.color === DaffPaletteEnum.Black,
561
- 'daff-white': this.color === DaffPaletteEnum.White,
562
- };
563
- }
564
175
  /**
565
176
  * @docs-private
566
177
  */
@@ -578,47 +189,75 @@ class DaffColorableDirective {
578
189
  this.color = this.defaultColor;
579
190
  }
580
191
  }
581
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
582
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffColorableDirective, isStandalone: true, selector: "[daffColorable]", inputs: { color: "color" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
192
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffColorableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
193
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffColorableDirective, isStandalone: true, selector: "[daffColorable]", inputs: { color: "color" }, host: { properties: { "class.daff-primary": "color === \"primary\"", "class.daff-secondary": "color === \"secondary\"", "class.daff-tertiary": "color === \"tertiary\"", "class.daff-light": "color === \"light\"", "class.daff-dark": "color === \"dark\"", "class.daff-theme": "color === \"theme\"", "class.daff-theme-contrast": "color === \"theme-contrast\"", "class.daff-black": "color === \"black\"", "class.daff-white": "color === \"white\"" } }, usesOnChanges: true, ngImport: i0 }); }
583
194
  }
584
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, decorators: [{
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffColorableDirective, decorators: [{
585
196
  type: Directive,
586
197
  args: [{
587
198
  selector: '[daffColorable]',
199
+ host: {
200
+ '[class.daff-primary]': 'color === "primary"',
201
+ '[class.daff-secondary]': 'color === "secondary"',
202
+ '[class.daff-tertiary]': 'color === "tertiary"',
203
+ '[class.daff-light]': 'color === "light"',
204
+ '[class.daff-dark]': 'color === "dark"',
205
+ '[class.daff-theme]': 'color === "theme"',
206
+ '[class.daff-theme-contrast]': 'color === "theme-contrast"',
207
+ '[class.daff-black]': 'color === "black"',
208
+ '[class.daff-white]': 'color === "white"',
209
+ },
588
210
  }]
589
- }], propDecorators: { class: [{
590
- type: HostBinding,
591
- args: ['class']
592
- }], color: [{
211
+ }], propDecorators: { color: [{
593
212
  type: Input
594
213
  }] } });
595
214
 
215
+ /**
216
+ * Sensible breakpoints for layouts and interfaces used across `@daffodil/design` components.
217
+ */
596
218
  var DaffBreakpoints;
597
219
  (function (DaffBreakpoints) {
220
+ /** `min-width: 1920px` */
598
221
  DaffBreakpoints["DESKTOP"] = "(min-width: 1920px)";
222
+ /** `min-width: 1440px` */
599
223
  DaffBreakpoints["LAPTOP"] = "(min-width: 1440px)";
224
+ /** `min-width: 1200px` */
600
225
  DaffBreakpoints["SMALL_LAPTOP"] = "(min-width: 1200px)";
226
+ /** `min-width: 1024px` */
601
227
  DaffBreakpoints["BIG_TABLET"] = "(min-width: 1024px)";
228
+ /** `min-width: 768px` */
602
229
  DaffBreakpoints["TABLET"] = "(min-width: 768px)";
230
+ /** `min-width: 480px` */
603
231
  DaffBreakpoints["MOBILE"] = "(min-width: 480px)";
604
232
  })(DaffBreakpoints || (DaffBreakpoints = {}));
605
233
 
606
234
  /**
607
- * A stubbed out breakpoint observer service.
235
+ * A no-op implementation of Angular CDK's `BreakpointObserver` that always reports
236
+ * no breakpoints as matched. Useful for server-side rendering or testing contexts
237
+ * where browser layout APIs are unavailable.
608
238
  */
609
239
  class NoopBreakpointObserver {
240
+ /**
241
+ * @docs-private
242
+ */
610
243
  // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method, @angular-eslint/use-lifecycle-interface
611
244
  ngOnDestroy() { }
245
+ /**
246
+ * Always returns `false`, indicating that none of the given media queries are active.
247
+ */
612
248
  isMatched(value) {
613
249
  return false;
614
250
  }
251
+ /**
252
+ * Returns an observable that never emits a `BreakpointState`, making breakpoint-dependent logic inert.
253
+ */
615
254
  observe(value) {
616
255
  return of();
617
256
  }
618
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: NoopBreakpointObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
619
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: NoopBreakpointObserver, providedIn: 'root' }); }
257
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NoopBreakpointObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
258
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NoopBreakpointObserver, providedIn: 'root' }); }
620
259
  }
621
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: NoopBreakpointObserver, decorators: [{
260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: NoopBreakpointObserver, decorators: [{
622
261
  type: Injectable,
623
262
  args: [{
624
263
  providedIn: 'root',
@@ -675,7 +314,6 @@ const validateStatus = (status) => {
675
314
  *
676
315
  * ```ts
677
316
  * @Component({
678
- * standalone: true,
679
317
  * selector: 'custom-component',
680
318
  * template: 'custom-component.html',
681
319
  * hostDirectives: [
@@ -704,18 +342,6 @@ const validateStatus = (status) => {
704
342
  * - `daff-success`: Applied when the status is `success`.
705
343
  */
706
344
  class DaffStatusableDirective {
707
- /**
708
- * Dynamically sets the CSS classes based on the status.
709
- * @docs-private
710
- */
711
- get class() {
712
- return {
713
- 'daff-info': this.status === DaffStatusEnum.Info,
714
- 'daff-warn': this.status === DaffStatusEnum.Warn,
715
- 'daff-critical': this.status === DaffStatusEnum.Critical,
716
- 'daff-success': this.status === DaffStatusEnum.Success,
717
- };
718
- }
719
345
  /**
720
346
  * @docs-private
721
347
  */
@@ -729,22 +355,25 @@ class DaffStatusableDirective {
729
355
  */
730
356
  ngOnInit() {
731
357
  validateStatus(this.status);
732
- if (this.status !== this.defaultStatus && this.defaultStatus) {
358
+ if (this.defaultStatus && !this.status) {
733
359
  this.status = this.defaultStatus;
734
360
  }
735
361
  }
736
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
737
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
362
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
363
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class.daff-info": "status === \"info\"", "class.daff-warn": "status === \"warn\"", "class.daff-critical": "status === \"critical\"", "class.daff-success": "status === \"success\"" } }, usesOnChanges: true, ngImport: i0 }); }
738
364
  }
739
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, decorators: [{
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffStatusableDirective, decorators: [{
740
366
  type: Directive,
741
367
  args: [{
742
368
  selector: '[daffStatusable]',
369
+ host: {
370
+ '[class.daff-info]': 'status === "info"',
371
+ '[class.daff-warn]': 'status === "warn"',
372
+ '[class.daff-critical]': 'status === "critical"',
373
+ '[class.daff-success]': 'status === "success"',
374
+ },
743
375
  }]
744
- }], propDecorators: { class: [{
745
- type: HostBinding,
746
- args: ['class']
747
- }], status: [{
376
+ }], propDecorators: { status: [{
748
377
  type: Input
749
378
  }] } });
750
379
 
@@ -766,7 +395,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
766
395
  *
767
396
  * ```ts
768
397
  * @Component({
769
- * standalone: true,
770
398
  * selector: 'custom-component',
771
399
  * template: 'custom-component.html',
772
400
  * hostDirectives: [
@@ -797,21 +425,24 @@ class DaffSkeletonableDirective {
797
425
  */
798
426
  this.skeleton = false;
799
427
  }
800
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
801
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSkeletonableDirective, isStandalone: true, selector: "[daffSkeletonable]", inputs: { skeleton: "skeleton" }, host: { properties: { "class.daff-skeleton": "this.skeleton" } }, ngImport: i0 }); }
428
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
429
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSkeletonableDirective, isStandalone: true, selector: "[daffSkeletonable]", inputs: { skeleton: "skeleton" }, host: { properties: { "class.daff-skeleton": "skeleton" } }, ngImport: i0 }); }
802
430
  }
803
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, decorators: [{
431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSkeletonableDirective, decorators: [{
804
432
  type: Directive,
805
433
  args: [{
806
434
  selector: '[daffSkeletonable]',
435
+ host: {
436
+ '[class.daff-skeleton]': 'skeleton',
437
+ },
807
438
  }]
808
439
  }], propDecorators: { skeleton: [{
809
440
  type: Input
810
- }, {
811
- type: HostBinding,
812
- args: ['class.daff-skeleton']
813
441
  }] } });
814
442
 
443
+ /**
444
+ * This enum will be removed from the public api in v1.0.0.
445
+ */
815
446
  var DaffTextAlignmentEnum;
816
447
  (function (DaffTextAlignmentEnum) {
817
448
  DaffTextAlignmentEnum["Left"] = "left";
@@ -828,62 +459,9 @@ const validateTextAlignment = (textAlignment) => {
828
459
  }
829
460
  };
830
461
  /**
831
- * `DaffTextAlignableDirective` allows for dynamic text alignment of a component by
832
- * setting CSS classes based on the specified text alignment. This directive is
833
- * useful when text alignment needs to be managed dynamically in an Angular component.
834
- *
835
- * ## Why not just use CSS?
836
- *
837
- * While the native CSS `text-align` property can be used for static text alignment,
838
- * the `DaffTextAlignableDirective` provides a structured and consistent way to handle
839
- * dynamic text alignment within Angular components in more complex use cases where the
840
- * application of `text-align: center;` would cause unexpected side effects.
841
- *
842
- * @example Implementing it as an attribute directive
843
- *
844
- * ```html
845
- * <div daffTextAlignable textAlignment="center">Aligned text</div>
846
- * ```
847
- *
848
- * In this example, the `daff-center` class is added to the `div` element, allowing
849
- * you to style the `div` as you wish using the class.
850
- *
851
- * @example Implementing it as an Angular host directive
852
- *
853
- * ```ts
854
- * @Component({
855
- * standalone: true,
856
- * selector: 'custom-component',
857
- * template: 'custom-component.html',
858
- * hostDirectives: [
859
- * {
860
- * directive: DaffTextAlignableDirective,
861
- * inputs: ['textAlignment'],
862
- * },
863
- * ],
864
- * })
865
- * export class CustomComponent { }
866
- * ```
867
- *
868
- * ```scss
869
- * .custom-component {
870
- * &.daff-left {
871
- * text-align: left;
872
- * }
873
- * }
874
- * ```
462
+ * `DaffTextAlignableDirective` enforces consistent use of text alignment across components.
875
463
  */
876
464
  class DaffTextAlignableDirective {
877
- /**
878
- * @docs-private
879
- */
880
- get class() {
881
- return {
882
- 'daff-left': this.textAlignment === DaffTextAlignmentEnum.Left,
883
- 'daff-center': this.textAlignment === DaffTextAlignmentEnum.Center,
884
- 'daff-right': this.textAlignment === DaffTextAlignmentEnum.Right,
885
- };
886
- }
887
465
  /**
888
466
  * @docs-private
889
467
  */
@@ -901,86 +479,46 @@ class DaffTextAlignableDirective {
901
479
  this.textAlignment = this.defaultAlignment;
902
480
  }
903
481
  }
904
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
905
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffTextAlignableDirective, isStandalone: true, selector: "[daffTextAlignable]", inputs: { textAlignment: "textAlignment" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
482
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
483
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffTextAlignableDirective, isStandalone: true, selector: "[daffTextAlignable]", inputs: { textAlignment: "textAlignment" }, host: { properties: { "class.daff-left": "textAlignment === \"left\"", "class.daff-center": "textAlignment === \"center\"", "class.daff-right": "textAlignment === \"right\"" } }, usesOnChanges: true, ngImport: i0 }); }
906
484
  }
907
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, decorators: [{
485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTextAlignableDirective, decorators: [{
908
486
  type: Directive,
909
487
  args: [{
910
488
  selector: '[daffTextAlignable]',
489
+ host: {
490
+ '[class.daff-left]': 'textAlignment === "left"',
491
+ '[class.daff-center]': 'textAlignment === "center"',
492
+ '[class.daff-right]': 'textAlignment === "right"',
493
+ },
911
494
  }]
912
- }], propDecorators: { class: [{
913
- type: HostBinding,
914
- args: ['class']
915
- }], textAlignment: [{
495
+ }], propDecorators: { textAlignment: [{
916
496
  type: Input
917
497
  }] } });
918
498
 
919
499
  /**
920
- * `DaffCompactableDirective` allows a component to conditionally apply a compact
921
- * style by toggling a CSS class. This is useful for creating components that can
922
- * switch between regular and compact styles based on the `compact` property.
923
- *
924
- * @example Implementing it as an attribute directive
925
- *
926
- * ```html
927
- * <div daffCompactable [compact]="isCompact">Content goes here</div>
928
- * ```
929
- *
930
- * In this example, the `daff-compact` class is applied to the `div` element when
931
- * `isCompact` is `true`, making the `div` display its compact state.
932
- *
933
- * @example Implementing it as an Angular host directive
934
- *
935
- * ```ts
936
- * @Component({
937
- * standalone: true,
938
- * selector: 'custom-component',
939
- * template: 'custom-component.html',
940
- * hostDirectives: [
941
- * {
942
- * directive: DaffCompactableDirective,
943
- * inputs: ['compact'],
944
- * },
945
- * ],
946
- * })
947
- * export class CustomComponent { }
948
- * ```
949
- *
950
- * The directive applies the `daff-compact` class to the component and
951
- * should be defined in your styles to display the compact state as desired.
952
- *
953
- * ```scss
954
- * :host {
955
- * padding: 8px 16px;
956
- *
957
- * &.daff-compact {
958
- * padding: 4px 8px;
959
- * }
960
- * }
961
- * ```
500
+ * Enforces consistent use of the compact property.
962
501
  */
963
502
  class DaffCompactableDirective {
964
503
  constructor() {
965
504
  /**
966
- * Controls whether the component is compact.
505
+ * Whether the component is compact.
967
506
  */
968
507
  this.compact = false;
969
508
  }
970
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
971
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffCompactableDirective, isStandalone: true, selector: "[daffCompactable]", inputs: { compact: "compact" }, host: { properties: { "class.daff-compact": "this.compact" } }, ngImport: i0 }); }
509
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
510
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffCompactableDirective, isStandalone: true, selector: "[daffCompactable]", inputs: { compact: "compact" }, host: { properties: { "class.daff-compact": "compact" } }, ngImport: i0 }); }
972
511
  }
973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, decorators: [{
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffCompactableDirective, decorators: [{
974
513
  type: Directive,
975
514
  args: [{
976
515
  selector: '[daffCompactable]',
977
- standalone: true,
516
+ host: {
517
+ '[class.daff-compact]': 'compact',
518
+ },
978
519
  }]
979
520
  }], propDecorators: { compact: [{
980
521
  type: Input
981
- }, {
982
- type: HostBinding,
983
- args: ['class.daff-compact']
984
522
  }] } });
985
523
 
986
524
  /**
@@ -1025,7 +563,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
1025
563
  *
1026
564
  * ```ts
1027
565
  * @Component({
1028
- * standalone: true,
1029
566
  * selector: 'my-custom-component',
1030
567
  * template: 'my-custom-component.html',
1031
568
  * hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
@@ -1042,70 +579,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
1042
579
  * This directive will apply the `daff-manage-container-layout` class to your component, ensuring that the styles set on `:host` are passed down to the container.
1043
580
  */
1044
581
  class DaffManageContainerLayoutDirective {
1045
- constructor() {
1046
- /**
1047
- * @docs-private
1048
- */
1049
- this.class = true;
1050
- }
1051
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1052
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffManageContainerLayoutDirective, isStandalone: true, selector: "[daffManageContainerLayout]", host: { properties: { "class.daff-manage-container-layout": "this.class" } }, ngImport: i0 }); }
582
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffManageContainerLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
583
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffManageContainerLayoutDirective, isStandalone: true, selector: "[daffManageContainerLayout]", host: { classAttribute: "daff-manage-container-layout" }, ngImport: i0 }); }
1053
584
  }
1054
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, decorators: [{
585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffManageContainerLayoutDirective, decorators: [{
1055
586
  type: Directive,
1056
587
  args: [{
1057
588
  selector: '[daffManageContainerLayout]',
1058
- standalone: true,
589
+ host: {
590
+ class: 'daff-manage-container-layout',
591
+ },
1059
592
  }]
1060
- }], propDecorators: { class: [{
1061
- type: HostBinding,
1062
- args: ['class.daff-manage-container-layout']
1063
- }] } });
593
+ }] });
1064
594
 
1065
595
  /**
1066
- * `DaffArticleEncapsulatedDirective` is used to encapsulate custom components within an article,
1067
- * preventing {@link DaffArticleComponent } styles from bleeding into the component.
1068
- *
1069
- * @example Implementing it as an attribute directive
1070
- *
1071
- * ```html
1072
- * <my-custom-component daffArticleEncapsulated></my-custom-component>
1073
- * ```
1074
- *
1075
- * @example Implementing it as an Angular host directive
1076
- *
1077
- * ```ts
1078
- * @Component({
1079
- * standalone: true,
1080
- * selector: 'custom-component',
1081
- * template: 'custom-component.html',
1082
- * hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
1083
- * })
1084
- * export class CustomComponent { }
1085
- * ```
1086
- *
1087
- * This directive will apply the `daff-ae` class to the component, ensuring that it is encapsulated from the article's styles.
596
+ * The `DaffArticleEncapsulatedDirective` prevents {@link DaffArticleComponent } styles from bleeding into custom components nested within an article.
1088
597
  */
1089
598
  class DaffArticleEncapsulatedDirective {
1090
- constructor() {
1091
- /**
1092
- * @docs-private
1093
- */
1094
- this.class = true;
1095
- }
1096
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1097
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffArticleEncapsulatedDirective, isStandalone: true, selector: "[daffArticleEncapsulated]", host: { properties: { "class.daff-ae": "this.class" } }, ngImport: i0 }); }
599
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleEncapsulatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
600
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffArticleEncapsulatedDirective, isStandalone: true, selector: "[daffArticleEncapsulated]", host: { classAttribute: "daff-ae" }, ngImport: i0 }); }
1098
601
  }
1099
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, decorators: [{
602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffArticleEncapsulatedDirective, decorators: [{
1100
603
  type: Directive,
1101
604
  args: [{
1102
605
  selector: '[daffArticleEncapsulated]',
1103
- standalone: true,
606
+ host: {
607
+ class: 'daff-ae',
608
+ },
1104
609
  }]
1105
- }], propDecorators: { class: [{
1106
- type: HostBinding,
1107
- args: ['class.daff-ae']
1108
- }] } });
610
+ }] });
1109
611
 
1110
612
  /**
1111
613
  * The possible states of a theme.
@@ -1147,10 +649,10 @@ class DaffOsThemeService {
1147
649
  getThemePreference() {
1148
650
  return this.preference$;
1149
651
  }
1150
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOsThemeService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1151
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOsThemeService, providedIn: 'root' }); }
652
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOsThemeService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
653
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOsThemeService, providedIn: 'root' }); }
1152
654
  }
1153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOsThemeService, decorators: [{
655
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOsThemeService, decorators: [{
1154
656
  type: Injectable,
1155
657
  args: [{
1156
658
  providedIn: 'root',
@@ -1204,10 +706,10 @@ class DaffThemeStorageService {
1204
706
  this.progressStorageEvent(DaffTheme.None);
1205
707
  this.storage.removeItem(THEME_STORAGE_KEY);
1206
708
  }
1207
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeStorageService, deps: [{ token: DaffServerSafePersistenceServiceToken }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1208
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeStorageService, providedIn: 'root' }); }
709
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeStorageService, deps: [{ token: DaffServerSafePersistenceServiceToken }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
710
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeStorageService, providedIn: 'root' }); }
1209
711
  }
1210
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeStorageService, decorators: [{
712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeStorageService, decorators: [{
1211
713
  type: Injectable,
1212
714
  args: [{
1213
715
  providedIn: 'root',
@@ -1278,10 +780,10 @@ class DaffThemingService {
1278
780
  ? this.lightMode()
1279
781
  : this.darkMode();
1280
782
  }
1281
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemingService, deps: [{ token: DaffOsThemeService }, { token: DaffThemeStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1282
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemingService, providedIn: 'root' }); }
783
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemingService, deps: [{ token: DaffOsThemeService }, { token: DaffThemeStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
784
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemingService, providedIn: 'root' }); }
1283
785
  }
1284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemingService, decorators: [{
786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemingService, decorators: [{
1285
787
  type: Injectable,
1286
788
  args: [{
1287
789
  providedIn: 'root',
@@ -1324,10 +826,10 @@ class DaffThemeClassSetterService {
1324
826
  this.renderer.removeClass(this.doc.body, DAFF_THEME_LIGHT_CSS_CLASS);
1325
827
  this.renderer.removeClass(this.doc.body, DAFF_THEME_DARK_CSS_CLASS);
1326
828
  }
1327
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeClassSetterService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }, { token: DaffThemingService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1328
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeClassSetterService }); }
829
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeClassSetterService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }, { token: DaffThemingService }], target: i0.ɵɵFactoryTarget.Injectable }); }
830
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeClassSetterService }); }
1329
831
  }
1330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffThemeClassSetterService, decorators: [{
832
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffThemeClassSetterService, decorators: [{
1331
833
  type: Injectable
1332
834
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1333
835
  type: Inject,
@@ -1408,10 +910,10 @@ class DaffFocusStackService {
1408
910
  this.document.activeElement.blur();
1409
911
  return this.document.activeElement;
1410
912
  }
1411
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFocusStackService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1412
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFocusStackService, providedIn: 'root' }); }
913
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFocusStackService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
914
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFocusStackService, providedIn: 'root' }); }
1413
915
  }
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffFocusStackService, decorators: [{
916
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffFocusStackService, decorators: [{
1415
917
  type: Injectable,
1416
918
  args: [{ providedIn: 'root' }]
1417
919
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -1481,19 +983,6 @@ var DaffSizableEnum;
1481
983
  * - `daff-xl`: Applied when the size is `xl`.
1482
984
  */
1483
985
  class DaffSizableDirective {
1484
- /**
1485
- * Dynamically sets the CSS classes based on the size.
1486
- * @docs-private
1487
- */
1488
- get class() {
1489
- return {
1490
- 'daff-xs': this.size === DaffSizableEnum.XSmall,
1491
- 'daff-sm': this.size === DaffSizableEnum.Small,
1492
- 'daff-md': this.size === DaffSizableEnum.Medium,
1493
- 'daff-lg': this.size === DaffSizableEnum.Large,
1494
- 'daff-xl': this.size === DaffSizableEnum.XLarge,
1495
- };
1496
- }
1497
986
  /**
1498
987
  * @docs-private
1499
988
  */
@@ -1510,19 +999,22 @@ class DaffSizableDirective {
1510
999
  this.size = this.defaultSize;
1511
1000
  }
1512
1001
  }
1513
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1514
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSizableDirective, isStandalone: true, selector: "[daffSizable]", inputs: { size: "size" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
1002
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1003
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSizableDirective, isStandalone: true, selector: "[daffSizable]", inputs: { size: "size" }, host: { properties: { "class.daff-xs": "size === \"xs\"", "class.daff-sm": "size === \"sm\"", "class.daff-md": "size === \"md\"", "class.daff-lg": "size === \"lg\"", "class.daff-xl": "size === \"xl\"" } }, usesOnChanges: true, ngImport: i0 }); }
1515
1004
  }
1516
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, decorators: [{
1005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSizableDirective, decorators: [{
1517
1006
  type: Directive,
1518
1007
  args: [{
1519
1008
  selector: '[daffSizable]',
1520
- standalone: true,
1009
+ host: {
1010
+ '[class.daff-xs]': 'size === "xs"',
1011
+ '[class.daff-sm]': 'size === "sm"',
1012
+ '[class.daff-md]': 'size === "md"',
1013
+ '[class.daff-lg]': 'size === "lg"',
1014
+ '[class.daff-xl]': 'size === "xl"',
1015
+ },
1521
1016
  }]
1522
- }], propDecorators: { class: [{
1523
- type: HostBinding,
1524
- args: ['class']
1525
- }], size: [{
1017
+ }], propDecorators: { size: [{
1526
1018
  type: Input
1527
1019
  }] } });
1528
1020
 
@@ -1633,24 +1125,77 @@ class DaffOpenableDirective {
1633
1125
  }
1634
1126
  }
1635
1127
  }
1636
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1637
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffOpenableDirective, isStandalone: true, selector: "[daffOpenable]", inputs: { open: "open" }, outputs: { toggled: "toggled" }, host: { properties: { "class.daff-open": "this.open" } }, usesOnChanges: true, ngImport: i0 }); }
1128
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOpenableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1129
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffOpenableDirective, isStandalone: true, selector: "[daffOpenable]", inputs: { open: "open" }, outputs: { toggled: "toggled" }, host: { properties: { "class.daff-open": "open" } }, usesOnChanges: true, ngImport: i0 }); }
1638
1130
  }
1639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, decorators: [{
1131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOpenableDirective, decorators: [{
1640
1132
  type: Directive,
1641
1133
  args: [{
1642
1134
  selector: '[daffOpenable]',
1643
- standalone: true,
1135
+ host: {
1136
+ '[class.daff-open]': 'open',
1137
+ },
1644
1138
  }]
1645
1139
  }], propDecorators: { open: [{
1646
1140
  type: Input
1647
- }, {
1648
- type: HostBinding,
1649
- args: ['class.daff-open']
1650
1141
  }], toggled: [{
1651
1142
  type: Output
1652
1143
  }] } });
1653
1144
 
1145
+ /**
1146
+ * This enum will be removed from the public api in v1.0.0.
1147
+ */
1148
+ var DaffOrientationEnum;
1149
+ (function (DaffOrientationEnum) {
1150
+ DaffOrientationEnum["Horizontal"] = "horizontal";
1151
+ DaffOrientationEnum["Vertical"] = "vertical";
1152
+ })(DaffOrientationEnum || (DaffOrientationEnum = {}));
1153
+
1154
+ const orientationValues = (orientation) => Object.values(DaffOrientationEnum).includes(orientation);
1155
+ const validateOrientation = (orientation) => {
1156
+ if (isDevMode()) {
1157
+ if (orientation !== undefined && !orientationValues(orientation)) {
1158
+ console.warn(`'${orientation}' is not a valid value of the orientation property. The available values are: left, center, or right.`);
1159
+ }
1160
+ }
1161
+ };
1162
+ /**
1163
+ * `DaffOrientableDirective`enforces consistent use of orientation across components.
1164
+ */
1165
+ class DaffOrientableDirective {
1166
+ /**
1167
+ * @docs-private
1168
+ */
1169
+ ngOnInit() {
1170
+ if (this.defaultOrientation && !this.orientation) {
1171
+ this.orientation = this.defaultOrientation;
1172
+ }
1173
+ validateOrientation(this.orientation);
1174
+ }
1175
+ /**
1176
+ * @docs-private
1177
+ */
1178
+ ngOnChanges(changes) {
1179
+ if (!changes.orientation?.currentValue) {
1180
+ this.orientation = this.defaultOrientation;
1181
+ }
1182
+ }
1183
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOrientableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1184
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffOrientableDirective, isStandalone: true, selector: "[daffOrientable]", inputs: { orientation: "orientation" }, host: { properties: { "class.daff-horizontal": "orientation === \"horizontal\"", "class.daff-vertical": "orientation === \"vertical\"" } }, usesOnChanges: true, ngImport: i0 }); }
1185
+ }
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffOrientableDirective, decorators: [{
1187
+ type: Directive,
1188
+ args: [{
1189
+ selector: '[daffOrientable]',
1190
+ host: {
1191
+ '[class.daff-horizontal]': 'orientation === "horizontal"',
1192
+ '[class.daff-vertical]': 'orientation === "vertical"',
1193
+ },
1194
+ }]
1195
+ }], propDecorators: { orientation: [{
1196
+ type: Input
1197
+ }] } });
1198
+
1654
1199
  class DaffSelectableDirective {
1655
1200
  constructor(cd) {
1656
1201
  this.cd = cd;
@@ -1659,35 +1204,40 @@ class DaffSelectableDirective {
1659
1204
  */
1660
1205
  this.selected = false;
1661
1206
  /**
1662
- * An event that fires after the media element becomes selected.
1207
+ * An event that fires after the component becomes selected.
1663
1208
  */
1664
1209
  this.becameSelected = new EventEmitter();
1665
1210
  }
1211
+ /**
1212
+ * Selects the component and emits the `becameSelected` event.
1213
+ */
1666
1214
  select() {
1667
1215
  this.selected = true;
1668
1216
  this.becameSelected.emit();
1669
1217
  this.cd.markForCheck();
1670
1218
  return this;
1671
1219
  }
1220
+ /**
1221
+ * Deselects the component.
1222
+ */
1672
1223
  deselect() {
1673
1224
  this.selected = false;
1674
1225
  this.cd.markForCheck();
1675
1226
  return this;
1676
1227
  }
1677
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSelectableDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1678
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSelectableDirective, isStandalone: true, selector: "[daffSelected]", inputs: { selected: "selected" }, outputs: { becameSelected: "becameSelected" }, host: { properties: { "class.daff-selected": "this.selected" } }, ngImport: i0 }); }
1228
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSelectableDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1229
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSelectableDirective, isStandalone: true, selector: "[daffSelected]", inputs: { selected: "selected" }, outputs: { becameSelected: "becameSelected" }, host: { properties: { "class.daff-selected": "selected" } }, ngImport: i0 }); }
1679
1230
  }
1680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSelectableDirective, decorators: [{
1231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSelectableDirective, decorators: [{
1681
1232
  type: Directive,
1682
1233
  args: [{
1683
1234
  selector: '[daffSelected]',
1684
- standalone: true,
1235
+ host: {
1236
+ '[class.daff-selected]': 'selected',
1237
+ },
1685
1238
  }]
1686
1239
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { selected: [{
1687
1240
  type: Input
1688
- }, {
1689
- type: HostBinding,
1690
- args: ['class.daff-selected']
1691
1241
  }], becameSelected: [{
1692
1242
  type: Output
1693
1243
  }] } });
@@ -1812,10 +1362,10 @@ class DaffStickyTrackerDirective {
1812
1362
  this.renderer.removeChild(this.sentinelElement.parentElement, this.sentinelElement);
1813
1363
  }
1814
1364
  }
1815
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStickyTrackerDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1816
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffStickyTrackerDirective, isStandalone: true, selector: "[daffStickyTracker]", inputs: { sticky: "sticky" }, ngImport: i0 }); }
1365
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffStickyTrackerDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1366
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffStickyTrackerDirective, isStandalone: true, selector: "[daffStickyTracker]", inputs: { sticky: "sticky" }, ngImport: i0 }); }
1817
1367
  }
1818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStickyTrackerDirective, decorators: [{
1368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffStickyTrackerDirective, decorators: [{
1819
1369
  type: Directive,
1820
1370
  args: [{
1821
1371
  selector: '[daffStickyTracker]',
@@ -1827,6 +1377,304 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
1827
1377
  type: Input
1828
1378
  }] } });
1829
1379
 
1380
+ /**
1381
+ * Enforces consistent use of the disabled property.
1382
+ */
1383
+ class DaffDisableableDirective {
1384
+ constructor() {
1385
+ /**
1386
+ * Whether the component is disabled.
1387
+ */
1388
+ this.disabled = false;
1389
+ }
1390
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDisableableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1391
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffDisableableDirective, isStandalone: true, selector: "[daffDisableable]", inputs: { disabled: "disabled" }, host: { properties: { "class.daff-disabled": "disabled" } }, ngImport: i0 }); }
1392
+ }
1393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffDisableableDirective, decorators: [{
1394
+ type: Directive,
1395
+ args: [{
1396
+ selector: '[daffDisableable]',
1397
+ host: {
1398
+ '[class.daff-disabled]': 'disabled',
1399
+ },
1400
+ }]
1401
+ }], propDecorators: { disabled: [{
1402
+ type: Input
1403
+ }] } });
1404
+
1405
+ /**
1406
+ * `DaffLoadableDirective` allows a component to display a loading UI
1407
+ * by conditionally applying a CSS class. This is useful for indicating to
1408
+ * users that a user action is being processed. This directive can be used to
1409
+ * apply a loading UI to any component by toggling the `loading`
1410
+ * input property. When `loading` is `true`, the `daff-loading` CSS class
1411
+ * is applied, which should style the component to look like it's not interactable.
1412
+ *
1413
+ * @example Implementing it as an attribute directive
1414
+ *
1415
+ * ```html
1416
+ * <div daffLoadable [loading]="isLoading">Content</div>
1417
+ * ```
1418
+ *
1419
+ * @example Implementing it as an Angular host directive
1420
+ *
1421
+ * ```ts
1422
+ * @Component({
1423
+ * selector: 'custom-component',
1424
+ * template: 'custom-component.html',
1425
+ * hostDirectives: [
1426
+ * {
1427
+ * directive: DaffLoadableDirective,
1428
+ * inputs: ['loading'],
1429
+ * },
1430
+ * ],
1431
+ * })
1432
+ * export class CustomComponent { }
1433
+ * ```
1434
+ *
1435
+ * ```scss
1436
+ * :host {
1437
+ * .spinner {
1438
+ * opacity: 0;
1439
+ * }
1440
+ * .daff-loading {
1441
+ * .spinner {
1442
+ * opacity: 1;
1443
+ * }
1444
+ * }
1445
+ * }
1446
+ * ```
1447
+ *
1448
+ * The directive applies the `daff-loading` class to the component. The class should be
1449
+ * defined in your styles to display the loading state as desired.
1450
+ */
1451
+ class DaffLoadableDirective {
1452
+ constructor() {
1453
+ this.loading = false;
1454
+ }
1455
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffLoadableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1456
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffLoadableDirective, isStandalone: true, selector: "[daffLoadable]", inputs: { loading: "loading" }, host: { properties: { "class.daff-loading": "loading" } }, ngImport: i0 }); }
1457
+ }
1458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffLoadableDirective, decorators: [{
1459
+ type: Directive,
1460
+ args: [{
1461
+ selector: '[daffLoadable]',
1462
+ host: {
1463
+ '[class.daff-loading]': 'loading',
1464
+ },
1465
+ }]
1466
+ }], propDecorators: { loading: [{
1467
+ type: Input
1468
+ }] } });
1469
+
1470
+ class DaffRovingTabIndexService {
1471
+ constructor(document) {
1472
+ this.document = document;
1473
+ this._hierarchy = [];
1474
+ this._group = signal('', ...(ngDevMode ? [{ debugName: "_group" }] : []));
1475
+ this.group = this._group.asReadonly();
1476
+ }
1477
+ enter(group) {
1478
+ if (this._group() !== group) {
1479
+ this._hierarchy.push(group);
1480
+ this._group.set(group);
1481
+ const el = this.document.querySelector(`[data-rti="${group}"]`);
1482
+ if (el) {
1483
+ this.document.activeElement.blur();
1484
+ el.focus();
1485
+ }
1486
+ }
1487
+ }
1488
+ leave() {
1489
+ const prev = this._hierarchy.pop();
1490
+ if (prev) {
1491
+ const group = this._hierarchy[this._hierarchy.length - 1] || '';
1492
+ this._group.set(group);
1493
+ this.document.activeElement.blur();
1494
+ const boundary = this.document.querySelector(`[data-rti-boundary="${prev}"][data-rti="${group}"]`);
1495
+ if (boundary) {
1496
+ boundary.focus();
1497
+ }
1498
+ else {
1499
+ console.warn(`The boundary for RTI group ${prev} does not have a reference to the parent group ${group}`);
1500
+ }
1501
+ }
1502
+ }
1503
+ next() {
1504
+ this._changeFocus();
1505
+ }
1506
+ previous() {
1507
+ this._changeFocus(true);
1508
+ }
1509
+ _changeFocus(up = false) {
1510
+ if (this._group()) {
1511
+ const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1512
+ const index = ary.findIndex((el) => el === this.document.activeElement);
1513
+ this.document.activeElement.blur();
1514
+ (up
1515
+ ? ary[index === 0 ? ary.length - 1 : index - 1]
1516
+ : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1517
+ }
1518
+ }
1519
+ onKeydown(evt) {
1520
+ if ('key' in evt) {
1521
+ switch (evt.key) {
1522
+ case 'ArrowUp':
1523
+ case 'ArrowDown':
1524
+ if (this._group()) {
1525
+ evt.preventDefault();
1526
+ const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1527
+ const index = ary.findIndex((el) => el === this.document.activeElement);
1528
+ this.document.activeElement.blur();
1529
+ (evt.key === 'ArrowUp'
1530
+ ? ary[index === 0 ? ary.length - 1 : index - 1]
1531
+ : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1532
+ }
1533
+ break;
1534
+ default:
1535
+ break;
1536
+ }
1537
+ }
1538
+ }
1539
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1540
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexService, providedIn: 'root' }); }
1541
+ }
1542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexService, decorators: [{
1543
+ type: Injectable,
1544
+ args: [{
1545
+ providedIn: 'root',
1546
+ }]
1547
+ }], ctorParameters: () => [{ type: Document, decorators: [{
1548
+ type: Inject,
1549
+ args: [DOCUMENT]
1550
+ }] }] });
1551
+
1552
+ /**
1553
+ * Defines the boundary of an RTI group.
1554
+ */
1555
+ class DaffRovingTabIndexBoundaryDirective {
1556
+ /**
1557
+ * Don't touch this directly. Use `_uniqueId`.
1558
+ */
1559
+ static { this._uniqueIdCounter = 0; }
1560
+ get _uniqueId() {
1561
+ if (!this._cachedUniqueId) {
1562
+ this._cachedUniqueId = `ε-rtiBoundary-${DaffRovingTabIndexBoundaryDirective._uniqueIdCounter++}`;
1563
+ }
1564
+ return this._cachedUniqueId;
1565
+ }
1566
+ constructor(groupService, focusTrap) {
1567
+ this.groupService = groupService;
1568
+ this.focusTrap = focusTrap;
1569
+ /**
1570
+ * The name of the group for which that this element will act as boundary.
1571
+ * Optional, will be autogenerated to a unique name if omitted.
1572
+ */
1573
+ this.rtiBoundary = input(null, ...(ngDevMode ? [{ debugName: "rtiBoundary" }] : []));
1574
+ /**
1575
+ * The name of the group defined by this boundary.
1576
+ */
1577
+ this.effectiveBoundary = computed(() => this.rtiBoundary() || this._uniqueId, ...(ngDevMode ? [{ debugName: "effectiveBoundary" }] : []));
1578
+ effect(() => {
1579
+ this.focusTrap.enabled = this.effectiveBoundary() === this.groupService.group();
1580
+ });
1581
+ }
1582
+ /**
1583
+ * @docs-private
1584
+ */
1585
+ enterGroup(evt) {
1586
+ evt.preventDefault();
1587
+ evt.stopPropagation();
1588
+ this.groupService.enter(this.effectiveBoundary());
1589
+ }
1590
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexBoundaryDirective, deps: [{ token: DaffRovingTabIndexService }, { token: i2.CdkTrapFocus }], target: i0.ɵɵFactoryTarget.Directive }); }
1591
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: DaffRovingTabIndexBoundaryDirective, isStandalone: true, selector: "[rtiBoundary]", inputs: { rtiBoundary: { classPropertyName: "rtiBoundary", publicName: "rtiBoundary", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.space": "enterGroup($event)" }, properties: { "attr.data-rti-boundary": "effectiveBoundary()" } }, hostDirectives: [{ directive: i2.CdkTrapFocus }, { directive: i0.forwardRef(() => DaffRovingTabIndexDirective) }], ngImport: i0 }); }
1592
+ }
1593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexBoundaryDirective, decorators: [{
1594
+ type: Directive,
1595
+ args: [{
1596
+ // eslint-disable-next-line @angular-eslint/directive-selector
1597
+ selector: '[rtiBoundary]',
1598
+ host: {
1599
+ '[attr.data-rti-boundary]': 'effectiveBoundary()',
1600
+ '(keydown.space)': 'enterGroup($event)',
1601
+ },
1602
+ hostDirectives: [
1603
+ CdkTrapFocus,
1604
+ forwardRef((() => DaffRovingTabIndexDirective)),
1605
+ ],
1606
+ }]
1607
+ }], ctorParameters: () => [{ type: DaffRovingTabIndexService }, { type: i2.CdkTrapFocus }], propDecorators: { rtiBoundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtiBoundary", required: false }] }] } });
1608
+
1609
+ /**
1610
+ * Declares that an element is an RTI target.
1611
+ * Automatically applied to `<a>` and `<button>` elements.
1612
+ */
1613
+ class DaffRovingTabIndexDirective {
1614
+ constructor(service, parent) {
1615
+ this.service = service;
1616
+ this.parent = parent;
1617
+ /**
1618
+ * Allows the RTI group to be overriden.
1619
+ * By default it will be the nearest ancestor or the default root group if no boundary ancestor exists.
1620
+ * @see {@link DaffRovingTabIndexBoundaryDirective}.
1621
+ */
1622
+ this.rti = input('', ...(ngDevMode ? [{ debugName: "rti" }] : []));
1623
+ /**
1624
+ * The group in which this RTI target resides.
1625
+ * See {@link DaffRovingTabIndexBoundaryDirective} to make an element act as the boundary of an RTI group.
1626
+ */
1627
+ this.group = computed(() => this.rti() || this.parent?.effectiveBoundary() || '', ...(ngDevMode ? [{ debugName: "group" }] : []));
1628
+ /**
1629
+ * @docs-private
1630
+ */
1631
+ this.tabindex = computed(() => this.service.group() === this.group()
1632
+ ? 0
1633
+ : -1, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
1634
+ }
1635
+ /**
1636
+ * @docs-private
1637
+ */
1638
+ leaveGroup(evt) {
1639
+ evt.stopPropagation();
1640
+ this.service.leave();
1641
+ }
1642
+ /**
1643
+ * @docs-private
1644
+ */
1645
+ next(evt) {
1646
+ evt.stopPropagation();
1647
+ this.service.next();
1648
+ }
1649
+ /**
1650
+ * @docs-private
1651
+ */
1652
+ previous(evt) {
1653
+ evt.stopPropagation();
1654
+ this.service.previous();
1655
+ }
1656
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexDirective, deps: [{ token: DaffRovingTabIndexService }, { token: DaffRovingTabIndexBoundaryDirective, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1657
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.18", type: DaffRovingTabIndexDirective, isStandalone: true, selector: "[rti],a,button", inputs: { rti: { classPropertyName: "rti", publicName: "rti", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.escape": "leaveGroup($event)", "keydown.arrowup": "previous($event)", "keydown.arrowdown": "next($event)" }, properties: { "attr.tabindex": "tabindex()", "attr.data-rti": "group()" } }, ngImport: i0 }); }
1658
+ }
1659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffRovingTabIndexDirective, decorators: [{
1660
+ type: Directive,
1661
+ args: [{
1662
+ // eslint-disable-next-line @angular-eslint/directive-selector
1663
+ selector: '[rti],a,button',
1664
+ host: {
1665
+ '[attr.tabindex]': 'tabindex()',
1666
+ '[attr.data-rti]': 'group()',
1667
+ '(keydown.escape)': 'leaveGroup($event)',
1668
+ '(keydown.arrowup)': 'previous($event)',
1669
+ '(keydown.arrowdown)': 'next($event)',
1670
+ },
1671
+ }]
1672
+ }], ctorParameters: () => [{ type: DaffRovingTabIndexService }, { type: DaffRovingTabIndexBoundaryDirective, decorators: [{
1673
+ type: Optional
1674
+ }, {
1675
+ type: SkipSelf
1676
+ }] }], propDecorators: { rti: [{ type: i0.Input, args: [{ isSignal: true, alias: "rti", required: false }] }] } });
1677
+
1830
1678
  // Core
1831
1679
 
1832
1680
  /*
@@ -1843,5 +1691,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
1843
1691
  * Generated bundle index. Do not edit.
1844
1692
  */
1845
1693
 
1846
- export { DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffCheckboxComponent, DaffCheckboxControlValueAccessorDirective, DaffCheckboxModule, DaffCheckboxSetComponent, DaffColorableDirective, DaffCompactableDirective, DaffErrorStateMatcher, DaffFocusStackService, DaffFormLabelDirective, DaffFormLabelModule, DaffManageContainerLayoutDirective, DaffOpenableDirective, DaffPrefixDirective, DaffPrefixSuffixModule, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffStickyTrackerDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
1694
+ export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffColorableDirective, DaffCompactableDirective, DaffDisableableDirective, DaffFocusStackService, DaffFormLabelDirective, DaffFormLabelModule, DaffLoadableDirective, DaffManageContainerLayoutDirective, DaffOpenableDirective, DaffOrientableDirective, DaffOrientationEnum, DaffPrefixDirective, DaffPrefixSuffixModule, DaffRovingTabIndexBoundaryDirective, DaffRovingTabIndexDirective, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffStickyTrackerDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
1847
1695
  //# sourceMappingURL=daffodil-design.mjs.map