@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
@@ -0,0 +1,99 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, input, ContentChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@daffodil/design';
4
+ import { DaffColorableDirective, DaffSizableDirective } from '@daffodil/design';
5
+
6
+ /**
7
+ * Labels are used to describe the loading state and provide context for users.
8
+ * They are optional.
9
+ *
10
+ * @usage
11
+ * ```html
12
+ * <daff-spinner-label>Loading</daff-spinner-label>
13
+ * ```
14
+ */
15
+ class DaffSpinnerLabelDirective {
16
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
17
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSpinnerLabelDirective, isStandalone: true, selector: "daff-spinner-label", ngImport: i0 }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerLabelDirective, decorators: [{
20
+ type: Directive,
21
+ args: [{
22
+ /* eslint-disable-next-line @angular-eslint/directive-selector */
23
+ selector: 'daff-spinner-label',
24
+ }]
25
+ }] });
26
+
27
+ /**
28
+ * DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.
29
+ */
30
+ class DaffSpinnerComponent {
31
+ static { this.SIZE_MAP = {
32
+ xs: 12,
33
+ sm: 16,
34
+ md: 32,
35
+ lg: 40,
36
+ xl: 48,
37
+ }; }
38
+ /**
39
+ * @docs-private
40
+ */
41
+ get _ariaLabel() {
42
+ if (!this._label) {
43
+ return this.ariaLabel();
44
+ }
45
+ }
46
+ /**
47
+ * @docs-private
48
+ *
49
+ * The dimension (width/height) based on the size.
50
+ */
51
+ get dimension() {
52
+ return DaffSpinnerComponent.SIZE_MAP[this.sizable.size];
53
+ }
54
+ constructor(sizable) {
55
+ this.sizable = sizable;
56
+ /**
57
+ * The `aria-label` for the spinner. Defaults to "loading".
58
+ */
59
+ this.ariaLabel = input('loading', ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
60
+ this.sizable.defaultSize = 'md';
61
+ }
62
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerComponent, deps: [{ token: i1.DaffSizableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
63
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffSpinnerComponent, isStandalone: true, selector: "daff-spinner", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status" }, properties: { "attr.aria-label": "_ariaLabel" }, classAttribute: "daff-spinner" }, queries: [{ propertyName: "_label", first: true, predicate: DaffSpinnerLabelDirective, descendants: true }], hostDirectives: [{ directive: i1.DaffColorableDirective, inputs: ["color", "color"] }, { directive: i1.DaffSizableDirective, inputs: ["size", "size"] }], ngImport: i0, template: "<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}", styles: [":host{display:inline-flex;flex-direction:column;align-items:center;gap:.25rem}:host.daff-xs .daff-spinner__track,:host.daff-xs .daff-spinner__path{stroke-width:1.5}:host.daff-xl .daff-spinner__track,:host.daff-xl .daff-spinner__path{stroke-width:2.5}.daff-spinner__svg{display:block}.daff-spinner__track{stroke:currentColor;stroke-opacity:.25;stroke-width:2}.daff-spinner__path{stroke:currentColor;stroke-width:2;stroke-linecap:round;animation:spinner-rotation 1s cubic-bezier(0,0,1,1) infinite;transform-origin:center}@keyframes spinner-rotation{to{transform:rotate(1turn)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerComponent, decorators: [{
66
+ type: Component,
67
+ args: [{ selector: 'daff-spinner', host: {
68
+ class: 'daff-spinner',
69
+ role: 'status',
70
+ '[attr.aria-label]': '_ariaLabel',
71
+ }, hostDirectives: [
72
+ {
73
+ directive: DaffColorableDirective,
74
+ inputs: ['color'],
75
+ },
76
+ {
77
+ directive: DaffSizableDirective,
78
+ inputs: ['size'],
79
+ },
80
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}", styles: [":host{display:inline-flex;flex-direction:column;align-items:center;gap:.25rem}:host.daff-xs .daff-spinner__track,:host.daff-xs .daff-spinner__path{stroke-width:1.5}:host.daff-xl .daff-spinner__track,:host.daff-xl .daff-spinner__path{stroke-width:2.5}.daff-spinner__svg{display:block}.daff-spinner__track{stroke:currentColor;stroke-opacity:.25;stroke-width:2}.daff-spinner__path{stroke:currentColor;stroke-width:2;stroke-linecap:round;animation:spinner-rotation 1s cubic-bezier(0,0,1,1) infinite;transform-origin:center}@keyframes spinner-rotation{to{transform:rotate(1turn)}}\n"] }]
81
+ }], ctorParameters: () => [{ type: i1.DaffSizableDirective }], propDecorators: { _label: [{
82
+ type: ContentChild,
83
+ args: [DaffSpinnerLabelDirective]
84
+ }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
85
+
86
+ /**
87
+ * @docs-private
88
+ */
89
+ const DAFF_SPINNER_COMPONENTS = [
90
+ DaffSpinnerComponent,
91
+ DaffSpinnerLabelDirective,
92
+ ];
93
+
94
+ /**
95
+ * Generated bundle index. Do not edit.
96
+ */
97
+
98
+ export { DAFF_SPINNER_COMPONENTS, DaffSpinnerComponent, DaffSpinnerLabelDirective };
99
+ //# sourceMappingURL=daffodil-design-spinner.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-design-spinner.mjs","sources":["../../../libs/design/spinner/src/spinner-label/spinner-label.directive.ts","../../../libs/design/spinner/src/spinner.component.ts","../../../libs/design/spinner/src/spinner.component.html","../../../libs/design/spinner/src/spinner.ts","../../../libs/design/spinner/src/daffodil-design-spinner.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Labels are used to describe the loading state and provide context for users.\n * They are optional.\n *\n * @usage\n * ```html\n * <daff-spinner-label>Loading</daff-spinner-label>\n * ```\n */\n@Directive({\n /* eslint-disable-next-line @angular-eslint/directive-selector */\n selector: 'daff-spinner-label',\n})\nexport class DaffSpinnerLabelDirective {}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n ContentChild,\n} from '@angular/core';\n\nimport {\n DaffColorableDirective,\n DaffSizableDirective,\n DaffSizeAllType,\n} from '@daffodil/design';\n\nimport { DaffSpinnerLabelDirective } from './spinner-label/spinner-label.directive';\n\n/**\n * DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.\n */\n@Component({\n selector: 'daff-spinner',\n templateUrl: './spinner.component.html',\n styleUrl: './spinner.component.scss',\n host: {\n class: 'daff-spinner',\n role: 'status',\n '[attr.aria-label]': '_ariaLabel',\n },\n hostDirectives: [\n {\n directive: DaffColorableDirective,\n inputs: ['color'],\n },\n {\n directive: DaffSizableDirective,\n inputs: ['size'],\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DaffSpinnerComponent {\n /**\n * @docs-private\n */\n @ContentChild(DaffSpinnerLabelDirective) _label: DaffSpinnerLabelDirective;\n\n private static readonly SIZE_MAP: Record<DaffSizeAllType, number> = {\n xs: 12,\n sm: 16,\n md: 32,\n lg: 40,\n xl: 48,\n };\n\n /**\n * The `aria-label` for the spinner. Defaults to \"loading\".\n */\n ariaLabel = input('loading', { alias: 'aria-label' });\n\n /**\n * @docs-private\n */\n get _ariaLabel() {\n if (!this._label) {\n return this.ariaLabel();\n }\n }\n\n /**\n * @docs-private\n *\n * The dimension (width/height) based on the size.\n */\n get dimension() {\n return DaffSpinnerComponent.SIZE_MAP[this.sizable.size];\n }\n\n constructor(\n private sizable: DaffSizableDirective<DaffSizeAllType>,\n ) {\n this.sizable.defaultSize = 'md';\n }\n}\n","<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}","import { DaffSpinnerLabelDirective } from './spinner-label/spinner-label.directive';\nimport { DaffSpinnerComponent } from './spinner.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SPINNER_COMPONENTS = <const> [\n DaffSpinnerComponent,\n DaffSpinnerLabelDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;AAQG;MAKU,yBAAyB,CAAA;kIAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;sHAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;AAAC,YAAA,IAAA,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A,EAAA;;sBAM9C,YAAY;uBAAC,yBAAyB;;;AExCzC;;AAEG;AACI,MAAM,uBAAuB,GAAW;IAC7C,oBAAoB;IACpB,yBAAyB;;;ACR3B;;AAEG;;;;"}
@@ -1,108 +1,65 @@
1
1
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Output, Input, HostBinding, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
4
- import * as i1 from '@daffodil/design/loading-icon';
5
- import { DAFF_LOADING_ICON_COMPONENTS } from '@daffodil/design/loading-icon';
3
+ import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import * as i1 from '@daffodil/design';
5
+ import { DaffSizableDirective, DaffDisableableDirective } from '@daffodil/design';
6
6
 
7
7
  /**
8
8
  * The position of the label relative to the switch.
9
9
  */
10
- var DaffLabelPositionEnum;
11
- (function (DaffLabelPositionEnum) {
12
- DaffLabelPositionEnum["LEFT"] = "daff-left";
13
- DaffLabelPositionEnum["RIGHT"] = "daff-right";
14
- DaffLabelPositionEnum["TOP"] = "daff-top";
15
- DaffLabelPositionEnum["BOTTOM"] = "daff-bottom";
16
- })(DaffLabelPositionEnum || (DaffLabelPositionEnum = {}));
10
+ var DaffSwitchLabelPositionEnum;
11
+ (function (DaffSwitchLabelPositionEnum) {
12
+ DaffSwitchLabelPositionEnum["LEFT"] = "left";
13
+ DaffSwitchLabelPositionEnum["RIGHT"] = "right";
14
+ DaffSwitchLabelPositionEnum["TOP"] = "top";
15
+ DaffSwitchLabelPositionEnum["BOTTOM"] = "bottom";
16
+ })(DaffSwitchLabelPositionEnum || (DaffSwitchLabelPositionEnum = {}));
17
17
 
18
- let switchUniqueId = 0;
18
+ /* eslint-disable quote-props */
19
+ let switchIncrementalId = 0;
19
20
  /**
20
21
  * The switch component provides a way to toggle between two settings.
21
22
  *
22
23
  * ```html
23
- * <daff-switch>
24
- * Label
25
- * </daff-switch>
24
+ * <daff-switch>Label</daff-switch>
26
25
  * ```
27
26
  */
28
- class DaffSwitchComponent {
29
- constructor() {
27
+ class DaffSwitchComponent extends DaffSizableDirective {
28
+ constructor(disabledDirective) {
29
+ super();
30
+ this.disabledDirective = disabledDirective;
30
31
  /**
31
- * Whether the switch is loading.
32
+ * The position of the label relative to the switch.
32
33
  */
33
- this.loading = false;
34
+ this.labelPosition = DaffSwitchLabelPositionEnum.LEFT;
34
35
  /**
35
36
  * Current state of switch (on/off).
36
37
  */
37
38
  this.checked = false;
38
- /**
39
- * The position of the label relative to the switch.
40
- */
41
- this.labelPosition = DaffLabelPositionEnum.LEFT;
42
- /**
43
- * Whether the switch shows an error.
44
- */
45
- this.error = false;
46
- /**
47
- * @docs-private
48
- */
49
- this._disabled = false;
50
39
  /**
51
40
  * @docs-private
52
41
  */
53
- this.externalAriaLabel = null;
54
- /**
55
- * aria-label for the switch.
56
- */
57
- this.ariaLabel = '';
42
+ this.labelId = 'daff-switch-' + switchIncrementalId++ + '-label';
58
43
  /**
59
- * A unique id for the switch.
44
+ * The unique id of the switch. Defaults to an autogenerated value. When using this,
45
+ * it's your responsibility to ensure that the id for each switch is unique.
60
46
  *
61
- * The `id` is automatically generated by linking the prefix 'daff-switch-' with an incrementing number. This value can be customized by passing a different `id` value via the component's `id` input.
62
- *
63
- * @example Using the `id` property
64
- * ```html
65
- * <daff-switch [id]="'custom-id'"></daff-switch>
66
- * ```
47
+ * It gets assigned to the `for` attribute on the `<label>` inside of the switch.
67
48
  */
68
- this.id = 'daff-switch-' + switchUniqueId++;
49
+ this.id = 'daff-switch-' + switchIncrementalId++;
69
50
  /**
70
51
  * Output event triggered when the switch has been toggled.
71
52
  */
72
53
  this.toggled = new EventEmitter();
73
54
  }
74
55
  /**
75
- * Whether the switch is disabled and/or loading.
56
+ * Whether the switch is disabled.
76
57
  */
77
58
  get disabled() {
78
- return this._disabled || this.loading;
59
+ return this.disabledDirective.disabled;
79
60
  }
80
61
  set disabled(value) {
81
- this._disabled = coerceBooleanProperty(value);
82
- }
83
- /**
84
- * @docs-private
85
- */
86
- get disabledAttribute() {
87
- return this.disabled ? true : null;
88
- }
89
- /**
90
- * @docs-private
91
- */
92
- get ariaDisabled() {
93
- return this.disabled ? true : null;
94
- }
95
- /**
96
- * @docs-private
97
- */
98
- get classes() {
99
- return `daff-switch ${this.labelPosition}`;
100
- }
101
- handleKeydown(event) {
102
- if (event.code === 'Space') {
103
- event.preventDefault();
104
- this.onToggle();
105
- }
62
+ this.disabledDirective.disabled = coerceBooleanProperty(value);
106
63
  }
107
64
  /**
108
65
  * @docs-private
@@ -113,48 +70,34 @@ class DaffSwitchComponent {
113
70
  this.toggled.emit(this.checked);
114
71
  }
115
72
  }
116
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
117
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DaffSwitchComponent, isStandalone: true, selector: "daff-switch", inputs: { disabled: "disabled", loading: "loading", checked: "checked", labelPosition: "labelPosition", error: "error", ariaLabel: ["aria-label", "ariaLabel"], id: "id" }, outputs: { toggled: "toggled" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class.daff-disabled": "this.disabled", "attr.disabled": "this.disabledAttribute", "attr.aria-disabled": "this.ariaDisabled", "class": "this.classes", "class.daff-loading": "this.loading", "attr.aria-label": "this.externalAriaLabel" } }, ngImport: i0, template: "<div class=\"daff-switch__wrapper\">\n <label class=\"daff-switch__label\" [attr.for]=\"id\">\n <ng-content></ng-content>\n </label>\n <label class=\"daff-switch__toggle\" \n [class.daff-checked]=\"checked\">\n @if (loading) {\n <daff-loading-icon class=\"daff-switch__loading\"></daff-loading-icon>\n }\n <input \n type=\"checkbox\" \n role=\"switch\" \n [attr.disabled] = \"disabled ? '' : null\" \n [checked]=\"checked\"\n (change)=\"onToggle()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.id]=\"id\"\n /> \n </label>\n</div>\n@if (error) {\n <ng-content select=\"daff-error-message\"></ng-content>\n}", styles: [":host{display:flex;flex-direction:column}:host.daff-loading .daff-switch__toggle:before{display:none}:host.daff-left .daff-switch__wrapper{flex-direction:row}:host.daff-right .daff-switch__wrapper{flex-direction:row-reverse}:host.daff-left .daff-switch__wrapper,:host.daff-right .daff-switch__wrapper{gap:.5rem}:host.daff-top .daff-switch__wrapper{flex-direction:column}:host.daff-top .daff-switch__toggle{margin-left:-.125rem}:host.daff-bottom .daff-switch__wrapper{flex-direction:column-reverse}:host.daff-top .daff-switch__wrapper,:host.daff-bottom .daff-switch__wrapper{align-items:flex-start;gap:.25rem}:host.daff-top .daff-switch__toggle,:host.daff-bottom .daff-switch__toggle{margin-left:-.25rem}:host.daff-disabled{opacity:.4}:host.daff-disabled .daff-switch__toggle{cursor:default}.daff-switch__wrapper{display:flex;align-items:center}.daff-switch__label{font-size:1rem;color:inherit}.daff-switch__loading{position:relative;left:.125rem;max-width:1.25rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;background-clip:content-box;border-radius:1rem;height:2rem;width:3.5rem;padding:.125rem;margin:.125rem;position:relative}.daff-switch__toggle>input[type=checkbox]{opacity:0;margin:0;padding:0;border:none}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.25rem;width:1.25rem;inset-block-end:4px;inset-inline-start:4px;transition:transform .3s}.daff-switch__toggle.daff-checked:before{transform:translate(1.5rem)}\n"], dependencies: [{ kind: "component", type: i1.DaffLoadingIconComponent, selector: "daff-loading-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
73
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSwitchComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
74
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffSwitchComponent, isStandalone: true, selector: "daff-switch", inputs: { labelPosition: "labelPosition", disabled: "disabled", checked: "checked", id: "id" }, outputs: { toggled: "toggled" }, host: { properties: { "class.checked": "checked", "class.left": "labelPosition === \"left\"", "class.right": "labelPosition === \"right\"", "class.top": "labelPosition === \"top\"", "class.bottom": "labelPosition === \"bottom\"" }, classAttribute: "daff-switch" }, usesInheritance: true, hostDirectives: [{ directive: i1.DaffSizableDirective, inputs: ["size", "size"] }, { directive: i1.DaffDisableableDirective, inputs: ["disabled", "disabled"] }], ngImport: i0, template: "<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>", styles: [":host{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.left{flex-direction:row}:host.right{flex-direction:row-reverse}:host.top{flex-direction:column}:host.bottom{flex-direction:column-reverse}:host.left,:host.right{justify-content:space-between;width:fit-content}:host.top,:host.bottom{align-items:flex-start}:host.daff-disabled{opacity:.5;cursor:not-allowed}:host.daff-disabled .daff-switch__label{cursor:not-allowed}:host.daff-disabled .daff-switch__toggle{cursor:not-allowed}:host.checked .daff-switch__toggle:before{transform:translate(1.5rem)}:host.daff-sm .daff-switch__toggle{height:1.5rem;width:2.75rem}:host.daff-sm .daff-switch__toggle:before{height:1.125rem;width:1.125rem;inset-inline-start:.15rem}:host.daff-sm.checked .daff-switch__toggle:before{transform:translate(1.25rem)}.daff-switch__label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:1rem;line-height:1rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;display:flex;align-items:center;border:none;border-radius:1rem;height:2rem;width:3.5rem;margin:0;outline:none;padding:0;position:relative}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.625rem;width:1.625rem;inset-inline-start:.175rem;transition:transform .3s}.daff-switch__toggle:after{content:\"\";display:flex;border-radius:1rem;width:100%;outline-offset:1px;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
118
75
  }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSwitchComponent, decorators: [{
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSwitchComponent, decorators: [{
120
77
  type: Component,
121
- args: [{ selector: 'daff-switch', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
122
- DAFF_LOADING_ICON_COMPONENTS,
123
- ], template: "<div class=\"daff-switch__wrapper\">\n <label class=\"daff-switch__label\" [attr.for]=\"id\">\n <ng-content></ng-content>\n </label>\n <label class=\"daff-switch__toggle\" \n [class.daff-checked]=\"checked\">\n @if (loading) {\n <daff-loading-icon class=\"daff-switch__loading\"></daff-loading-icon>\n }\n <input \n type=\"checkbox\" \n role=\"switch\" \n [attr.disabled] = \"disabled ? '' : null\" \n [checked]=\"checked\"\n (change)=\"onToggle()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.id]=\"id\"\n /> \n </label>\n</div>\n@if (error) {\n <ng-content select=\"daff-error-message\"></ng-content>\n}", styles: [":host{display:flex;flex-direction:column}:host.daff-loading .daff-switch__toggle:before{display:none}:host.daff-left .daff-switch__wrapper{flex-direction:row}:host.daff-right .daff-switch__wrapper{flex-direction:row-reverse}:host.daff-left .daff-switch__wrapper,:host.daff-right .daff-switch__wrapper{gap:.5rem}:host.daff-top .daff-switch__wrapper{flex-direction:column}:host.daff-top .daff-switch__toggle{margin-left:-.125rem}:host.daff-bottom .daff-switch__wrapper{flex-direction:column-reverse}:host.daff-top .daff-switch__wrapper,:host.daff-bottom .daff-switch__wrapper{align-items:flex-start;gap:.25rem}:host.daff-top .daff-switch__toggle,:host.daff-bottom .daff-switch__toggle{margin-left:-.25rem}:host.daff-disabled{opacity:.4}:host.daff-disabled .daff-switch__toggle{cursor:default}.daff-switch__wrapper{display:flex;align-items:center}.daff-switch__label{font-size:1rem;color:inherit}.daff-switch__loading{position:relative;left:.125rem;max-width:1.25rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;background-clip:content-box;border-radius:1rem;height:2rem;width:3.5rem;padding:.125rem;margin:.125rem;position:relative}.daff-switch__toggle>input[type=checkbox]{opacity:0;margin:0;padding:0;border:none}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.25rem;width:1.25rem;inset-block-end:4px;inset-inline-start:4px;transition:transform .3s}.daff-switch__toggle.daff-checked:before{transform:translate(1.5rem)}\n"] }]
124
- }], propDecorators: { disabled: [{
78
+ args: [{ selector: 'daff-switch', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
79
+ {
80
+ directive: DaffSizableDirective,
81
+ inputs: ['size'],
82
+ },
83
+ {
84
+ directive: DaffDisableableDirective,
85
+ inputs: ['disabled'],
86
+ },
87
+ ], host: {
88
+ 'class': 'daff-switch',
89
+ '[class.checked]': 'checked',
90
+ '[class.left]': 'labelPosition === "left"',
91
+ '[class.right]': 'labelPosition === "right"',
92
+ '[class.top]': 'labelPosition === "top"',
93
+ '[class.bottom]': 'labelPosition === "bottom"',
94
+ }, template: "<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>", styles: [":host{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.left{flex-direction:row}:host.right{flex-direction:row-reverse}:host.top{flex-direction:column}:host.bottom{flex-direction:column-reverse}:host.left,:host.right{justify-content:space-between;width:fit-content}:host.top,:host.bottom{align-items:flex-start}:host.daff-disabled{opacity:.5;cursor:not-allowed}:host.daff-disabled .daff-switch__label{cursor:not-allowed}:host.daff-disabled .daff-switch__toggle{cursor:not-allowed}:host.checked .daff-switch__toggle:before{transform:translate(1.5rem)}:host.daff-sm .daff-switch__toggle{height:1.5rem;width:2.75rem}:host.daff-sm .daff-switch__toggle:before{height:1.125rem;width:1.125rem;inset-inline-start:.15rem}:host.daff-sm.checked .daff-switch__toggle:before{transform:translate(1.25rem)}.daff-switch__label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:1rem;line-height:1rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;display:flex;align-items:center;border:none;border-radius:1rem;height:2rem;width:3.5rem;margin:0;outline:none;padding:0;position:relative}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.625rem;width:1.625rem;inset-inline-start:.175rem;transition:transform .3s}.daff-switch__toggle:after{content:\"\";display:flex;border-radius:1rem;width:100%;outline-offset:1px;height:100%}\n"] }]
95
+ }], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { labelPosition: [{
125
96
  type: Input
126
- }, {
127
- type: HostBinding,
128
- args: ['class.daff-disabled']
129
- }], disabledAttribute: [{
130
- type: HostBinding,
131
- args: ['attr.disabled']
132
- }], ariaDisabled: [{
133
- type: HostBinding,
134
- args: ['attr.aria-disabled']
135
- }], classes: [{
136
- type: HostBinding,
137
- args: ['class']
138
- }], loading: [{
97
+ }], disabled: [{
139
98
  type: Input
140
- }, {
141
- type: HostBinding,
142
- args: ['class.daff-loading']
143
99
  }], checked: [{
144
100
  type: Input
145
- }], labelPosition: [{
146
- type: Input
147
- }], error: [{
148
- type: Input
149
- }], handleKeydown: [{
150
- type: HostListener,
151
- args: ['keydown', ['$event']]
152
- }], externalAriaLabel: [{
153
- type: HostBinding,
154
- args: ['attr.aria-label']
155
- }], ariaLabel: [{
156
- type: Input,
157
- args: ['aria-label']
158
101
  }], id: [{
159
102
  type: Input
160
103
  }], toggled: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-switch.mjs","sources":["../../../libs/design/switch/src/switch/label-position.ts","../../../libs/design/switch/src/switch/switch.component.ts","../../../libs/design/switch/src/switch/switch.component.html","../../../libs/design/switch/src/switch.ts","../../../libs/design/switch/src/daffodil-design-switch.ts"],"sourcesContent":["export type DaffLabelPosition = 'daff-left' | 'daff-right' | 'daff-top' | 'daff-bottom';\n\n/**\n * The position of the label relative to the switch.\n */\nexport enum DaffLabelPositionEnum {\n LEFT = 'daff-left',\n RIGHT = 'daff-right',\n TOP = 'daff-top',\n BOTTOM = 'daff-bottom',\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n} from '@angular/core';\n\nimport { DAFF_LOADING_ICON_COMPONENTS } from '@daffodil/design/loading-icon';\n\nimport {\n DaffLabelPosition,\n DaffLabelPositionEnum,\n} from './label-position';\n\nlet switchUniqueId = 0;\n\n/**\n * The switch component provides a way to toggle between two settings.\n *\n * ```html\n * <daff-switch>\n * Label\n * </daff-switch>\n * ```\n */\n@Component({\n selector: 'daff-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrls: ['./switch.component.scss'],\n imports: [\n DAFF_LOADING_ICON_COMPONENTS,\n ],\n})\nexport class DaffSwitchComponent {\n /**\n * Whether the switch is disabled and/or loading.\n */\n @Input() @HostBinding('class.daff-disabled') get disabled() {\n return this._disabled || this.loading;\n }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n }\n\n /**\n * @docs-private\n */\n @HostBinding('attr.disabled') get disabledAttribute() {\n return this.disabled ? true : null;\n }\n\n /**\n * @docs-private\n */\n @HostBinding('attr.aria-disabled') get ariaDisabled() {\n return this.disabled ? true : null;\n }\n\n /**\n * @docs-private\n */\n @HostBinding('class') get classes() {\n return `daff-switch ${this.labelPosition}`;\n }\n\n /**\n * Whether the switch is loading.\n */\n @Input() @HostBinding('class.daff-loading') loading = false;\n\n /**\n * Current state of switch (on/off).\n */\n @Input() checked = false;\n\n /**\n * The position of the label relative to the switch.\n */\n @Input() labelPosition: DaffLabelPosition = DaffLabelPositionEnum.LEFT;\n\n /**\n * Whether the switch shows an error.\n */\n @Input() error = false;\n\n /**\n * @docs-private\n */\n _disabled = false;\n\n @HostListener('keydown', ['$event'])\n handleKeydown(event: KeyboardEvent) {\n if (event.code === 'Space') {\n event.preventDefault();\n this.onToggle();\n }\n }\n\n /**\n * @docs-private\n */\n @HostBinding('attr.aria-label') private externalAriaLabel = null;\n\n /**\n * aria-label for the switch.\n */\n @Input('aria-label') ariaLabel = '';\n\n /**\n * A unique id for the switch.\n *\n * The `id` is automatically generated by linking the prefix 'daff-switch-' with an incrementing number. This value can be customized by passing a different `id` value via the component's `id` input.\n *\n * @example Using the `id` property\n * ```html\n * <daff-switch [id]=\"'custom-id'\"></daff-switch>\n * ```\n */\n @Input() id: string = 'daff-switch-' + switchUniqueId++;\n\n /**\n * Output event triggered when the switch has been toggled.\n */\n @Output() toggled = new EventEmitter<boolean>();\n\n /**\n * @docs-private\n */\n onToggle() {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.toggled.emit(this.checked);\n }\n }\n}\n","<div class=\"daff-switch__wrapper\">\n <label class=\"daff-switch__label\" [attr.for]=\"id\">\n <ng-content></ng-content>\n </label>\n <label class=\"daff-switch__toggle\" \n [class.daff-checked]=\"checked\">\n @if (loading) {\n <daff-loading-icon class=\"daff-switch__loading\"></daff-loading-icon>\n }\n <input \n type=\"checkbox\" \n role=\"switch\" \n [attr.disabled] = \"disabled ? '' : null\" \n [checked]=\"checked\"\n (change)=\"onToggle()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.id]=\"id\"\n /> \n </label>\n</div>\n@if (error) {\n <ng-content select=\"daff-error-message\"></ng-content>\n}","import { DaffSwitchComponent } from './switch/switch.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SWITCH_COMPONENTS = <const> [\n DaffSwitchComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;AAEG;AACH,IAAY,qBAKX;AALD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,WAAkB;AAClB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,YAAoB;AACpB,IAAA,qBAAA,CAAA,KAAA,CAAA,GAAA,UAAgB;AAChB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,aAAsB;AACxB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,GAAA,EAAA,CAAA,CAAA;;ACajC,IAAI,cAAc,GAAG,CAAC;AAEtB;;;;;;;;AAQG;MAUU,mBAAmB,CAAA;AAThC,IAAA,WAAA,GAAA;AAyCE;;AAEG;QACyC,IAAA,CAAA,OAAO,GAAG,KAAK;AAE3D;;AAEG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK;AAExB;;AAEG;AACM,QAAA,IAAA,CAAA,aAAa,GAAsB,qBAAqB,CAAC,IAAI;AAEtE;;AAEG;QACM,IAAA,CAAA,KAAK,GAAG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C,QAAQ,CAAC;gBAWK,iBAAiB,EAAA,CAAA;sBAAxD,WAAW;uBAAC,iBAAiB;gBAKT,SAAS,EAAA,CAAA;sBAA7B,KAAK;uBAAC,YAAY;gBAYV,EAAE,EAAA,CAAA;sBAAV;gBAKS,OAAO,EAAA,CAAA;sBAAhB;;;AE9HH;;AAEG;AACI,MAAM,sBAAsB,GAAW;IAC5C,mBAAmB;;;ACNrB;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-switch.mjs","sources":["../../../libs/design/switch/src/switch/label-position.ts","../../../libs/design/switch/src/switch/switch.component.ts","../../../libs/design/switch/src/switch/switch.component.html","../../../libs/design/switch/src/switch.ts","../../../libs/design/switch/src/daffodil-design-switch.ts"],"sourcesContent":["export type DaffSwitchLabelPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * The position of the label relative to the switch.\n */\nexport enum DaffSwitchLabelPositionEnum {\n LEFT = 'left',\n RIGHT = 'right',\n TOP = 'top',\n BOTTOM = 'bottom',\n}\n","/* eslint-disable quote-props */\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport {\n DaffDisableable,\n DaffDisableableDirective,\n DaffSizableDirective,\n DaffSizeSmallType,\n} from '@daffodil/design';\n\nimport {\n DaffSwitchLabelPosition,\n DaffSwitchLabelPositionEnum,\n} from './label-position';\n\nlet switchIncrementalId = 0;\n\nexport type DaffSwitchSize = DaffSizeSmallType;\n\n/**\n * The switch component provides a way to toggle between two settings.\n *\n * ```html\n * <daff-switch>Label</daff-switch>\n * ```\n */\n@Component({\n selector: 'daff-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrls: ['./switch.component.scss'],\n hostDirectives: [\n {\n directive: DaffSizableDirective,\n inputs: ['size'],\n },\n {\n directive: DaffDisableableDirective,\n inputs: ['disabled'],\n },\n ],\n host: {\n 'class': 'daff-switch',\n '[class.checked]': 'checked',\n '[class.left]': 'labelPosition === \"left\"',\n '[class.right]': 'labelPosition === \"right\"',\n '[class.top]': 'labelPosition === \"top\"',\n '[class.bottom]': 'labelPosition === \"bottom\"',\n },\n})\nexport class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> implements DaffDisableable {\n /**\n * The position of the label relative to the switch.\n */\n @Input() labelPosition: DaffSwitchLabelPosition = DaffSwitchLabelPositionEnum.LEFT;\n\n constructor(private disabledDirective: DaffDisableableDirective) {\n super();\n }\n\n /**\n * Whether the switch is disabled.\n */\n @Input() get disabled() {\n return this.disabledDirective.disabled;\n }\n set disabled(value: any) {\n this.disabledDirective.disabled = coerceBooleanProperty(value);\n }\n\n /**\n * Current state of switch (on/off).\n */\n @Input() checked = false;\n\n /**\n * @docs-private\n */\n labelId: string = 'daff-switch-' + switchIncrementalId++ + '-label';\n\n /**\n * The unique id of the switch. Defaults to an autogenerated value. When using this,\n * it's your responsibility to ensure that the id for each switch is unique.\n *\n * It gets assigned to the `for` attribute on the `<label>` inside of the switch.\n */\n @Input() id = 'daff-switch-' + switchIncrementalId++;\n\n /**\n * Output event triggered when the switch has been toggled.\n */\n @Output() toggled = new EventEmitter<boolean>();\n\n /**\n * @docs-private\n */\n onToggle() {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.toggled.emit(this.checked);\n }\n }\n}\n","<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>","import { DaffSwitchComponent } from './switch/switch.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SWITCH_COMPONENTS = <const> [\n DaffSwitchComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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;sBASA;;sBAUA;;sBAaA;;sBAKA;;;AEhGH;;AAEG;AACI,MAAM,sBAAsB,GAAW;IAC5C,mBAAmB;;;ACNrB;;AAEG;;;;"}
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { TemplateRef, Input, ViewChild, ChangeDetectionStrategy, Component, ContentChild, ViewEncapsulation, EventEmitter, ViewChildren, ContentChildren, Output, HostBinding } from '@angular/core';
3
- import * as i1$1 from '@angular/common';
4
- import { NgIf, NgTemplateOutlet } from '@angular/common';
5
3
  import * as i1 from '@daffodil/design';
6
- import { DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
4
+ import { DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
5
+ import * as i1$1 from '@angular/common';
6
+ import { NgTemplateOutlet } from '@angular/common';
7
7
  import { RouterLink, RouterLinkActive } from '@angular/router';
8
8
 
9
9
  let tabId = 1;
@@ -26,11 +26,16 @@ let tabId = 1;
26
26
  * ```
27
27
  */
28
28
  class DaffTabComponent {
29
- constructor() {
30
- /**
31
- * Whether the tab is disabled.
32
- */
33
- this.disabled = false;
29
+ /**
30
+ * @docs-private
31
+ *
32
+ * Whether the tab is disabled.
33
+ */
34
+ get disabled() {
35
+ return this.disabledDirective.disabled;
36
+ }
37
+ constructor(disabledDirective) {
38
+ this.disabledDirective = disabledDirective;
34
39
  /**
35
40
  * A unique id for the tab component. Defaults to an autogenerated value. When using this,
36
41
  * it's your responsibility to ensure that the id for each tab is unique.
@@ -42,8 +47,8 @@ class DaffTabComponent {
42
47
  this.panelId = 'daff-tab-panel-' + tabId;
43
48
  tabId++;
44
49
  }
45
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
46
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffTabComponent, isStandalone: true, selector: "daff-tab", inputs: { disabled: "disabled", id: "id" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, read: TemplateRef, static: true }, { propertyName: "labelRef", first: true, predicate: ["label"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `
50
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
51
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabComponent, isStandalone: true, selector: "daff-tab", inputs: { id: "id" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, read: TemplateRef, static: true }, { propertyName: "labelRef", first: true, predicate: ["label"], descendants: true, read: TemplateRef, static: true }], hostDirectives: [{ directive: i1.DaffDisableableDirective, inputs: ["disabled", "disabled"] }], ngImport: i0, template: `
47
52
  <ng-template #label>
48
53
  <ng-content select="daff-tab-label"></ng-content>
49
54
  </ng-template>
@@ -52,7 +57,7 @@ class DaffTabComponent {
52
57
  </ng-template>
53
58
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
54
59
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabComponent, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabComponent, decorators: [{
56
61
  type: Component,
57
62
  args: [{
58
63
  selector: 'daff-tab',
@@ -65,10 +70,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
65
70
  </ng-template>
66
71
  `,
67
72
  changeDetection: ChangeDetectionStrategy.OnPush,
73
+ hostDirectives: [
74
+ {
75
+ directive: DaffDisableableDirective,
76
+ inputs: ['disabled'],
77
+ },
78
+ ],
68
79
  }]
69
- }], ctorParameters: () => [], propDecorators: { disabled: [{
70
- type: Input
71
- }], contentRef: [{
80
+ }], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { contentRef: [{
72
81
  type: ViewChild,
73
82
  args: ['content', { read: TemplateRef, static: true }]
74
83
  }], labelRef: [{
@@ -91,13 +100,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
91
100
  * ```
92
101
  */
93
102
  class DaffTabLabelComponent {
94
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
95
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DaffTabLabelComponent, isStandalone: true, selector: "daff-tab-label", queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-tab-label__content\">\n <ng-content></ng-content>\n</div>\n@if (_suffix) {\n <ng-content select=\"[daffSuffix]\"></ng-content>\n}", styles: [":host{display:flex;justify-content:center;align-items:center;gap:.5rem}.daff-tab-label__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
103
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
104
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffTabLabelComponent, isStandalone: true, selector: "daff-tab-label", queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-tab-label__content\">\n <ng-content></ng-content>\n</div>\n@if (_suffix) {\n <ng-content select=\"[daffSuffix]\"></ng-content>\n}", styles: [":host{display:flex;justify-content:center;align-items:center;gap:.5rem}.daff-tab-label__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
96
105
  }
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabLabelComponent, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabLabelComponent, decorators: [{
98
107
  type: Component,
99
108
  args: [{ selector: 'daff-tab-label', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
100
- NgIf,
101
109
  DaffPrefixDirective,
102
110
  DaffSuffixDirective,
103
111
  ], template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-tab-label__content\">\n <ng-content></ng-content>\n</div>\n@if (_suffix) {\n <ng-content select=\"[daffSuffix]\"></ng-content>\n}", styles: [":host{display:flex;justify-content:center;align-items:center;gap:.5rem}.daff-tab-label__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}\n"] }]
@@ -145,10 +153,10 @@ class DaffTabPanelComponent {
145
153
  this._ariaLabelledBy = this.tab.id;
146
154
  this._id = this.tab.panelId;
147
155
  }
148
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabPanelComponent, deps: [{ token: DaffTabComponent }], target: i0.ɵɵFactoryTarget.Component }); }
149
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffTabPanelComponent, isStandalone: true, selector: "daff-tab-panel", host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "attr.id": "tabPanelId", "attr.aria-labelledby": "ariaLabelledBy" }, classAttribute: "daff-tab-panel" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host(.daff-tab-panel){display:block;padding:1rem 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
156
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabPanelComponent, deps: [{ token: DaffTabComponent }], target: i0.ɵɵFactoryTarget.Component }); }
157
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabPanelComponent, isStandalone: true, selector: "daff-tab-panel", host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "attr.id": "tabPanelId", "attr.aria-labelledby": "ariaLabelledBy" }, classAttribute: "daff-tab-panel" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host(.daff-tab-panel){display:block;padding:1rem 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
150
158
  }
151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabPanelComponent, decorators: [{
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabPanelComponent, decorators: [{
152
160
  type: Component,
153
161
  args: [{ selector: 'daff-tab-panel', template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
154
162
  'class': 'daff-tab-panel',
@@ -192,10 +200,10 @@ class DaffTabActivatorComponent {
192
200
  focus() {
193
201
  this.el.nativeElement.focus();
194
202
  }
195
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabActivatorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DaffSelectableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
196
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffTabActivatorComponent, isStandalone: true, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: { tabActivatorId: "tabActivatorId", panelId: "panelId" }, host: { attributes: { "role": "tab" }, properties: { "attr.aria-selected": "ariaSelected", "attr.tabindex": "tabIndex", "attr.id": "tabActivatorId", "attr.aria-controls": "panelId" }, classAttribute: "daff-tab-activator" }, hostDirectives: [{ directive: i1.DaffSelectableDirective, inputs: ["selected", "selected"] }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [".daff-tab-activator{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;appearance:none;background:none;border:none;font-size:1rem;line-height:1.5rem;font-weight:500;height:3rem;margin:0;min-width:8rem;padding:.5rem 1.5rem;text-decoration:none;z-index:2}.daff-tab-activator[disabled]{cursor:not-allowed;opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
203
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabActivatorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DaffSelectableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
204
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabActivatorComponent, isStandalone: true, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: { tabActivatorId: "tabActivatorId", panelId: "panelId" }, host: { attributes: { "role": "tab" }, properties: { "attr.aria-selected": "ariaSelected", "attr.tabindex": "tabIndex", "attr.id": "tabActivatorId", "attr.aria-controls": "panelId" }, classAttribute: "daff-tab-activator" }, hostDirectives: [{ directive: i1.DaffSelectableDirective, inputs: ["selected", "selected"] }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [".daff-tab-activator{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;appearance:none;background:none;border:none;font-size:1rem;line-height:1.5rem;font-weight:500;height:3rem;margin:0;min-width:8rem;padding:.5rem 1.5rem;text-decoration:none;z-index:2}.daff-tab-activator[disabled]{cursor:not-allowed;opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
197
205
  }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabActivatorComponent, decorators: [{
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabActivatorComponent, decorators: [{
199
207
  type: Component,
200
208
  args: [{ selector: '' +
201
209
  'button[daff-tab-activator]' + ',' +
@@ -384,10 +392,10 @@ class DaffTabsComponent {
384
392
  const array = this._tabs.toArray();
385
393
  this.select(array[array.length - 1].id);
386
394
  }
387
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Component }); }
388
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DaffTabsComponent, isStandalone: true, selector: "daff-tabs", inputs: { initiallySelected: "initiallySelected", ariaLabel: ["aria-label", "ariaLabel"], linkMode: "linkMode", url: "url", queryParam: "queryParam" }, outputs: { tabChange: "tabChange" }, host: { properties: { "attr.aria-label": "this.externalAriaLabel" }, classAttribute: "daff-tabs" }, queries: [{ propertyName: "_labels", predicate: DaffTabLabelComponent, descendants: true }, { propertyName: "_tabs", predicate: DaffTabComponent }], viewQueries: [{ propertyName: "_tabActivators", predicate: DaffTabActivatorComponent, descendants: true }], ngImport: i0, template: "<div class=\"daff-tabs__tab-list\"\n\trole=\"tablist\"\n\t[attr.aria-label]=\"ariaLabel\"\n\t(keydown.home)=\"selectFirst($event)\"\n\t(keydown.end)=\"selectLast($event)\">\n\t@for (tab of _tabs; track tab) {\n\t\t@if (linkMode && tab.disabled) {\n\t\t\t<button daff-tab-activator routerLinkActive\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t} @else if (linkMode) {\n\t\t\t<a daff-tab-activator routerLinkActive\n\t\t\t\tclass=\"daff-ae daff_tabs__link\"\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[routerLink]=\"url || currentPath\"\n\t\t\t\tqueryParamsHandling=\"merge\"\n\t\t\t\t[queryParams]=\"_buildQueryParams(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\"\n\t\t\t\t(isActiveChange)=\"$event && select(tab.id)\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</a>\n\t\t} @else {\n\t\t\t<button daff-tab-activator\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t(click)=\"select(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n\n@for (tab of _tabs; track tab) {\n\t@if(tab.id === selectedTab ) {\n\t\t<ng-container *ngTemplateOutlet=\"tab.contentRef\"></ng-container>\n\t}\n}", styles: [":host(.daff-tabs){max-width:100%}.daff-tabs{display:block}.daff-tabs .daff-tabs__tab-list{display:flex;overflow-x:auto;scrollbar-width:thin;position:relative}.daff-tabs .daff-tabs__tab-list:after{content:\"\";position:absolute;height:.125rem;width:100%;bottom:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: DaffTabActivatorComponent, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: ["tabActivatorId", "panelId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
395
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Component }); }
396
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffTabsComponent, isStandalone: true, selector: "daff-tabs", inputs: { initiallySelected: "initiallySelected", ariaLabel: ["aria-label", "ariaLabel"], linkMode: "linkMode", url: "url", queryParam: "queryParam" }, outputs: { tabChange: "tabChange" }, host: { properties: { "attr.aria-label": "this.externalAriaLabel" }, classAttribute: "daff-tabs" }, queries: [{ propertyName: "_labels", predicate: DaffTabLabelComponent, descendants: true }, { propertyName: "_tabs", predicate: DaffTabComponent }], viewQueries: [{ propertyName: "_tabActivators", predicate: DaffTabActivatorComponent, descendants: true }], ngImport: i0, template: "<div class=\"daff-tabs__tab-list\"\n\trole=\"tablist\"\n\t[attr.aria-label]=\"ariaLabel\"\n\t(keydown.home)=\"selectFirst($event)\"\n\t(keydown.end)=\"selectLast($event)\">\n\t@for (tab of _tabs; track tab) {\n\t\t@if (linkMode && tab.disabled) {\n\t\t\t<button daff-tab-activator routerLinkActive\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t} @else if (linkMode) {\n\t\t\t<a daff-tab-activator routerLinkActive\n\t\t\t\tclass=\"daff-ae daff_tabs__link\"\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[routerLink]=\"url || currentPath\"\n\t\t\t\tqueryParamsHandling=\"merge\"\n\t\t\t\t[queryParams]=\"_buildQueryParams(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\"\n\t\t\t\t(isActiveChange)=\"$event && select(tab.id)\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</a>\n\t\t} @else {\n\t\t\t<button daff-tab-activator\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t(click)=\"select(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n\n@for (tab of _tabs; track tab) {\n\t@if(tab.id === selectedTab ) {\n\t\t<ng-container *ngTemplateOutlet=\"tab.contentRef\"></ng-container>\n\t}\n}", styles: [":host(.daff-tabs){max-width:100%}.daff-tabs{display:block}.daff-tabs .daff-tabs__tab-list{display:flex;overflow-x:auto;scrollbar-width:thin;position:relative}.daff-tabs .daff-tabs__tab-list:after{content:\"\";position:absolute;height:.125rem;width:100%;bottom:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: DaffTabActivatorComponent, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: ["tabActivatorId", "panelId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
389
397
  }
390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTabsComponent, decorators: [{
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabsComponent, decorators: [{
391
399
  type: Component,
392
400
  args: [{ selector: 'daff-tabs', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
393
401
  'class': 'daff-tabs',