@daffodil/design 0.94.1 → 0.95.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +1 -2
  2. package/accordion/src/accordion-theme.scss +4 -4
  3. package/article/README.md +4 -27
  4. package/article/src/article-theme.scss +14 -14
  5. package/badge/src/badge-theme.scss +0 -6
  6. package/button/README.md +0 -4
  7. package/button/src/button/basic/button-theme.scss +17 -42
  8. package/button/src/button/button-base.scss +12 -3
  9. package/button/src/button/flat/flat-theme.scss +14 -12
  10. package/button/src/button/icon/icon-theme.scss +19 -40
  11. package/button/src/button/stroked/stroked-theme.scss +22 -36
  12. package/card/src/card/stroked/stroked-theme.scss +1 -1
  13. package/card/src/card-base.scss +0 -1
  14. package/fesm2022/daffodil-design-accordion.mjs +285 -188
  15. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  16. package/fesm2022/daffodil-design-article.mjs +578 -340
  17. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  18. package/fesm2022/daffodil-design-badge.mjs +166 -84
  19. package/fesm2022/daffodil-design-badge.mjs.map +1 -1
  20. package/fesm2022/daffodil-design-beacon.mjs +109 -47
  21. package/fesm2022/daffodil-design-beacon.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-breadcrumb.mjs +384 -277
  23. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-button.mjs +541 -408
  25. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-callout.mjs +349 -224
  27. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-card.mjs +496 -327
  29. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-checkbox.mjs +373 -313
  31. package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-container.mjs +103 -60
  33. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  34. package/fesm2022/daffodil-design-form-field.mjs +441 -352
  35. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-form.mjs +155 -57
  37. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-hero.mjs +349 -234
  39. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-image-lite.mjs +60 -0
  41. package/fesm2022/daffodil-design-image-lite.mjs.map +1 -0
  42. package/fesm2022/daffodil-design-image.mjs +245 -107
  43. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-input.mjs +217 -164
  45. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-list.mjs +308 -170
  47. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-media-gallery.mjs +351 -278
  49. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-menu.mjs +525 -417
  51. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  52. package/fesm2022/daffodil-design-modal.mjs +680 -450
  53. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-native-select.mjs +175 -166
  55. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  56. package/fesm2022/daffodil-design-navbar.mjs +145 -68
  57. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  58. package/fesm2022/daffodil-design-notification.mjs +376 -226
  59. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-paginator.mjs +296 -192
  61. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-progress-bar.mjs +243 -157
  63. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-radio.mjs +382 -300
  65. package/fesm2022/daffodil-design-radio.mjs.map +1 -1
  66. package/fesm2022/daffodil-design-select.mjs +424 -364
  67. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  68. package/fesm2022/daffodil-design-sidebar.mjs +874 -887
  69. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  70. package/fesm2022/daffodil-design-spinner.mjs +156 -99
  71. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  72. package/fesm2022/daffodil-design-switch.mjs +176 -106
  73. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  74. package/fesm2022/daffodil-design-tabs.mjs +685 -427
  75. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  76. package/fesm2022/daffodil-design-tag.mjs +251 -133
  77. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  78. package/fesm2022/daffodil-design-testing.mjs +4 -16
  79. package/fesm2022/daffodil-design-testing.mjs.map +1 -1
  80. package/fesm2022/daffodil-design-text-snippet.mjs +140 -54
  81. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  82. package/fesm2022/daffodil-design-textarea.mjs +170 -150
  83. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  84. package/fesm2022/daffodil-design-toast.mjs +658 -481
  85. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  86. package/fesm2022/daffodil-design-tree.mjs +456 -469
  87. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  88. package/fesm2022/daffodil-design-youtube-player.mjs +168 -115
  89. package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
  90. package/fesm2022/daffodil-design.mjs +1628 -1650
  91. package/fesm2022/daffodil-design.mjs.map +1 -1
  92. package/form-field/README.md +0 -4
  93. package/form-field/src/form-field-theme.scss +12 -4
  94. package/image/README.md +4 -0
  95. package/image-lite/README.md +58 -0
  96. package/image-lite/src/image-theme.scss +18 -0
  97. package/list/src/list-base.scss +3 -4
  98. package/list/src/list-theme.scss +6 -5
  99. package/media-gallery/README.md +1 -1
  100. package/media-gallery/src/media-gallery-theme.scss +3 -3
  101. package/menu/src/menu-theme.scss +6 -2
  102. package/notification/src/notification-theme.scss +10 -10
  103. package/package.json +1 -1
  104. package/scss/global.scss +17 -11
  105. package/scss/theme.scss +2 -18
  106. package/scss/theming/_get-palette.scss +0 -3
  107. package/scss/theming/_index.scss +0 -1
  108. package/scss/theming/_light-dark.scss +2 -2
  109. package/scss/theming/_theme-css-variables.scss +1 -1
  110. package/scss/theming/create-theme/_create-theme.scss +2 -2
  111. package/scss/theming/get-font-colors/_get-font-colors.scss +7 -25
  112. package/scss/theming/get-font-colors/_get-font-colors.spec.scss +0 -12
  113. package/scss/typography/_classes.scss +0 -6
  114. package/scss/typography/_index.scss +0 -1
  115. package/scss/typography/mixins/_sizes.scss +0 -1
  116. package/scss/typography/utilities/_variables.scss +3 -0
  117. package/select/src/select-theme.scss +10 -14
  118. package/switch/src/switch-theme.scss +2 -2
  119. package/tabs/src/tabs-theme.scss +4 -4
  120. package/types/daffodil-design-accordion.d.ts +92 -67
  121. package/types/daffodil-design-article.d.ts +49 -56
  122. package/types/daffodil-design-badge.d.ts +56 -33
  123. package/types/daffodil-design-beacon.d.ts +35 -14
  124. package/types/daffodil-design-breadcrumb.d.ts +89 -85
  125. package/types/daffodil-design-button.d.ts +128 -146
  126. package/types/daffodil-design-callout.d.ts +55 -39
  127. package/types/daffodil-design-card.d.ts +66 -56
  128. package/types/daffodil-design-checkbox.d.ts +211 -167
  129. package/types/daffodil-design-container.d.ts +17 -16
  130. package/types/daffodil-design-form-field.d.ts +273 -240
  131. package/types/daffodil-design-form.d.ts +21 -21
  132. package/types/daffodil-design-hero.d.ts +55 -39
  133. package/types/daffodil-design-image-lite.d.ts +17 -0
  134. package/types/daffodil-design-image.d.ts +89 -55
  135. package/types/daffodil-design-input.d.ts +86 -72
  136. package/types/daffodil-design-list.d.ts +49 -43
  137. package/types/daffodil-design-media-gallery.d.ts +176 -148
  138. package/types/daffodil-design-menu.d.ts +177 -169
  139. package/types/daffodil-design-modal.d.ts +205 -205
  140. package/types/daffodil-design-native-select.d.ts +94 -84
  141. package/types/daffodil-design-navbar.d.ts +34 -24
  142. package/types/daffodil-design-notification.d.ts +82 -67
  143. package/types/daffodil-design-paginator.d.ts +140 -118
  144. package/types/daffodil-design-progress-bar.d.ts +92 -74
  145. package/types/daffodil-design-radio.d.ts +183 -144
  146. package/types/daffodil-design-select.d.ts +207 -178
  147. package/types/daffodil-design-sidebar.d.ts +270 -253
  148. package/types/daffodil-design-spinner.d.ts +49 -36
  149. package/types/daffodil-design-switch.d.ts +77 -46
  150. package/types/daffodil-design-tabs.d.ts +248 -198
  151. package/types/daffodil-design-tag.d.ts +91 -56
  152. package/types/daffodil-design-testing.d.ts +1 -3
  153. package/types/daffodil-design-text-snippet.d.ts +48 -37
  154. package/types/daffodil-design-textarea.d.ts +88 -79
  155. package/types/daffodil-design-toast.d.ts +175 -183
  156. package/types/daffodil-design-tree.d.ts +186 -169
  157. package/types/daffodil-design-youtube-player.d.ts +56 -52
  158. package/types/daffodil-design.d.ts +614 -695
  159. package/button/src/button/raised/raised-theme.scss +0 -92
  160. package/button/src/button/underline/underline-theme.scss +0 -141
  161. package/fesm2022/daffodil-design-link-set.mjs +0 -160
  162. package/fesm2022/daffodil-design-link-set.mjs.map +0 -1
  163. package/fesm2022/daffodil-design-quantity-field.mjs +0 -364
  164. package/fesm2022/daffodil-design-quantity-field.mjs.map +0 -1
  165. package/link-set/README.md +0 -86
  166. package/quantity-field/README.md +0 -63
  167. package/scss/theming/_configure-theme.scss +0 -120
  168. package/scss/typography/mixins/_font-weight.scss +0 -14
  169. package/types/daffodil-design-link-set.d.ts +0 -72
  170. package/types/daffodil-design-quantity-field.d.ts +0 -171
@@ -1,1687 +1,1665 @@
1
- import * as i0 from '@angular/core';
2
- import { HostBinding, Directive, NgModule, isDevMode, Input, Injectable, InjectionToken, inject, PLATFORM_ID, DOCUMENT, Inject, makeEnvironmentProviders, provideAppInitializer, model, EventEmitter, Output, afterNextRender, signal, input, computed, Optional, SkipSelf, effect, forwardRef } from '@angular/core';
3
- import { BreakpointObserver } from '@angular/cdk/layout';
4
- import { isPlatformBrowser } from '@angular/common';
5
- import { of, fromEventPattern, Subject, merge, fromEvent, EMPTY, combineLatest } from 'rxjs';
6
- import { startWith, map, catchError, filter, shareReplay } from 'rxjs/operators';
7
- import { DaffServerSafePersistenceServiceToken } from '@daffodil/core';
8
- import * as i2 from '@angular/cdk/a11y';
9
- import { CdkTrapFocus } from '@angular/cdk/a11y';
10
-
11
- /**
12
- * @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
13
- */
14
- class DaffFormLabelDirective {
15
- constructor() {
16
- /**
17
- * @docs-private
18
- */
19
- this.class = true;
20
- }
21
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
22
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffFormLabelDirective, isStandalone: true, selector: "[daffFormLabel]", host: { properties: { "class.daff-form-label": "this.class" } }, ngImport: i0 }); }
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelDirective, decorators: [{
25
- type: Directive,
26
- args: [{
27
- selector: '[daffFormLabel]',
28
- }]
29
- }], propDecorators: { class: [{
30
- type: HostBinding,
31
- args: ['class.daff-form-label']
32
- }] } });
33
-
34
- /**
35
- * @deprecated in favor of standalone components. Deprecated in version 0.84.0. Will be removed in version 1.0.0.
36
- */
37
- class DaffFormLabelModule {
38
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
39
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelModule, imports: [DaffFormLabelDirective], exports: [DaffFormLabelDirective] }); }
40
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelModule }); }
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFormLabelModule, decorators: [{
43
- type: NgModule,
44
- args: [{
45
- exports: [
46
- DaffFormLabelDirective,
47
- ],
48
- imports: [
49
- DaffFormLabelDirective,
50
- ],
51
- }]
52
- }] });
53
-
54
- /**
55
- * DaffPrefixDirective can be used to place content before another piece of content
56
- * in components like `DaffFormFieldComponent` or `DaffListComponent`.
57
- */
58
- class DaffPrefixDirective {
59
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
60
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffPrefixDirective, isStandalone: true, selector: "[daffPrefix]", host: { classAttribute: "daff-prefix" }, ngImport: i0 }); }
61
- }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixDirective, decorators: [{
63
- type: Directive,
64
- args: [{
65
- selector: '[daffPrefix]',
66
- host: {
67
- class: 'daff-prefix',
68
- },
69
- }]
70
- }] });
71
-
72
- /**
73
- * DaffSuffixDirective can be used to place content after another piece of content
74
- * in components like `DaffFormFieldComponent` or `DaffListComponent`.
75
- */
76
- class DaffSuffixDirective {
77
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
78
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffSuffixDirective, isStandalone: true, selector: "[daffSuffix]", host: { classAttribute: "daff-suffix" }, ngImport: i0 }); }
79
- }
80
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSuffixDirective, decorators: [{
81
- type: Directive,
82
- args: [{
83
- selector: '[daffSuffix]',
84
- host: {
85
- class: 'daff-suffix',
86
- },
87
- }]
88
- }] });
89
-
90
- /**
91
- * @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0.
92
- */
93
- class DaffPrefixSuffixModule {
94
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixSuffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
95
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixSuffixModule, imports: [DaffPrefixDirective,
96
- DaffSuffixDirective], exports: [DaffPrefixDirective,
97
- DaffSuffixDirective] }); }
98
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixSuffixModule }); }
99
- }
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffPrefixSuffixModule, decorators: [{
101
- type: NgModule,
102
- args: [{
103
- imports: [
104
- DaffPrefixDirective,
105
- DaffSuffixDirective,
106
- ],
107
- exports: [
108
- DaffPrefixDirective,
109
- DaffSuffixDirective,
110
- ],
111
- }]
112
- }] });
113
-
114
- const DAFF_PREFIX_SUFFIX_DIRECTIVES = [
115
- DaffPrefixDirective,
116
- DaffSuffixDirective,
117
- ];
118
-
119
- /**
120
- * The available color options.
121
- */
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, Directive, EventEmitter, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Output, PLATFORM_ID, SkipSelf, afterNextRender, computed, effect, forwardRef, inject, input, isDevMode, makeEnvironmentProviders, model, provideAppInitializer, signal } from "@angular/core";
3
+ import { BreakpointObserver } from "@angular/cdk/layout";
4
+ import { isPlatformBrowser } from "@angular/common";
5
+ import { EMPTY, Subject, combineLatest, fromEvent, fromEventPattern, merge, of } from "rxjs";
6
+ import { catchError, filter, map, shareReplay, startWith } from "rxjs/operators";
7
+ import { DaffServerSafePersistenceServiceToken } from "@daffodil/core";
8
+ import * as i2 from "@angular/cdk/a11y";
9
+ import { CdkTrapFocus } from "@angular/cdk/a11y";
10
+ var DaffPrefixDirective = class DaffPrefixDirective {
11
+ static {
12
+ this.ɵfac = i0.ɵɵngDeclareFactory({
13
+ minVersion: "12.0.0",
14
+ version: "22.2.4",
15
+ ngImport: i0,
16
+ type: DaffPrefixDirective,
17
+ deps: [],
18
+ target: i0.ɵɵFactoryTarget.Directive
19
+ });
20
+ }
21
+ static {
22
+ this.ɵdir = i0.ɵɵngDeclareDirective({
23
+ minVersion: "14.0.0",
24
+ version: "22.2.4",
25
+ type: DaffPrefixDirective,
26
+ isStandalone: true,
27
+ selector: "[daffPrefix]",
28
+ host: { classAttribute: "daff-prefix" },
29
+ ngImport: i0
30
+ });
31
+ }
32
+ };
33
+ i0.ɵɵngDeclareClassMetadata({
34
+ minVersion: "12.0.0",
35
+ version: "22.2.4",
36
+ ngImport: i0,
37
+ type: DaffPrefixDirective,
38
+ decorators: [{
39
+ type: Directive,
40
+ args: [{
41
+ selector: "[daffPrefix]",
42
+ host: { class: "daff-prefix" }
43
+ }]
44
+ }]
45
+ });
46
+ var DaffSuffixDirective = class DaffSuffixDirective {
47
+ static {
48
+ this.ɵfac = i0.ɵɵngDeclareFactory({
49
+ minVersion: "12.0.0",
50
+ version: "22.2.4",
51
+ ngImport: i0,
52
+ type: DaffSuffixDirective,
53
+ deps: [],
54
+ target: i0.ɵɵFactoryTarget.Directive
55
+ });
56
+ }
57
+ static {
58
+ this.ɵdir = i0.ɵɵngDeclareDirective({
59
+ minVersion: "14.0.0",
60
+ version: "22.2.4",
61
+ type: DaffSuffixDirective,
62
+ isStandalone: true,
63
+ selector: "[daffSuffix]",
64
+ host: { classAttribute: "daff-suffix" },
65
+ ngImport: i0
66
+ });
67
+ }
68
+ };
69
+ i0.ɵɵngDeclareClassMetadata({
70
+ minVersion: "12.0.0",
71
+ version: "22.2.4",
72
+ ngImport: i0,
73
+ type: DaffSuffixDirective,
74
+ decorators: [{
75
+ type: Directive,
76
+ args: [{
77
+ selector: "[daffSuffix]",
78
+ host: { class: "daff-suffix" }
79
+ }]
80
+ }]
81
+ });
82
+ var DaffPrefixSuffixModule = class DaffPrefixSuffixModule {
83
+ static {
84
+ this.ɵfac = i0.ɵɵngDeclareFactory({
85
+ minVersion: "12.0.0",
86
+ version: "22.2.4",
87
+ ngImport: i0,
88
+ type: DaffPrefixSuffixModule,
89
+ deps: [],
90
+ target: i0.ɵɵFactoryTarget.NgModule
91
+ });
92
+ }
93
+ static {
94
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
95
+ minVersion: "14.0.0",
96
+ version: "22.2.4",
97
+ ngImport: i0,
98
+ type: DaffPrefixSuffixModule,
99
+ imports: [DaffPrefixDirective, DaffSuffixDirective],
100
+ exports: [DaffPrefixDirective, DaffSuffixDirective]
101
+ });
102
+ }
103
+ static {
104
+ this.ɵinj = i0.ɵɵngDeclareInjector({
105
+ minVersion: "12.0.0",
106
+ version: "22.2.4",
107
+ ngImport: i0,
108
+ type: DaffPrefixSuffixModule
109
+ });
110
+ }
111
+ };
112
+ i0.ɵɵngDeclareClassMetadata({
113
+ minVersion: "12.0.0",
114
+ version: "22.2.4",
115
+ ngImport: i0,
116
+ type: DaffPrefixSuffixModule,
117
+ decorators: [{
118
+ type: NgModule,
119
+ args: [{
120
+ imports: [DaffPrefixDirective, DaffSuffixDirective],
121
+ exports: [DaffPrefixDirective, DaffSuffixDirective]
122
+ }]
123
+ }]
124
+ });
125
+ const DAFF_PREFIX_SUFFIX_DIRECTIVES = [DaffPrefixDirective, DaffSuffixDirective];
122
126
  var DaffColorEnum;
123
- (function (DaffColorEnum) {
124
- /**
125
- * The primary color.
126
- */
127
- DaffColorEnum["Primary"] = "primary";
128
- /**
129
- * The secondary color.
130
- */
131
- DaffColorEnum["Secondary"] = "secondary";
132
- /**
133
- * The tertiary color.
134
- */
135
- DaffColorEnum["Tertiary"] = "tertiary";
136
- /**
137
- * A light color.
138
- *
139
- * This does not track the theme mode. An element with this color stays light
140
- * in both light and dark mode. Use `Theme` or `ThemeContrast` instead for a
141
- * color that flips with the mode.
142
- */
143
- DaffColorEnum["Light"] = "light";
144
- /**
145
- * A dark color.
146
- *
147
- * This does not track the theme mode. An element with this color stays dark
148
- * in both light and dark mode. Use `Theme` or `ThemeContrast` instead for a
149
- * color that flips with the mode.
150
- */
151
- DaffColorEnum["Dark"] = "dark";
152
- /**
153
- * A color that matches the theme.
154
- */
155
- DaffColorEnum["Theme"] = "theme";
156
- /**
157
- * A color that contrasts against the theme.
158
- */
159
- DaffColorEnum["ThemeContrast"] = "theme-contrast";
160
- /**
161
- * @deprecated Deprecated in version 0.82.0. Will be removed in version 1.0.0.
162
- */
163
- DaffColorEnum["Black"] = "black";
164
- /**
165
- * @deprecated Deprecated in version 0.82.0. Will be removed in version 1.0.0.
166
- */
167
- DaffColorEnum["White"] = "white";
127
+ (function(DaffColorEnum) {
128
+ DaffColorEnum["Primary"] = "primary";
129
+ DaffColorEnum["Secondary"] = "secondary";
130
+ DaffColorEnum["Tertiary"] = "tertiary";
131
+ DaffColorEnum["Light"] = "light";
132
+ DaffColorEnum["Dark"] = "dark";
133
+ DaffColorEnum["Theme"] = "theme";
134
+ DaffColorEnum["ThemeContrast"] = "theme-contrast";
135
+ DaffColorEnum["Black"] = "black";
136
+ DaffColorEnum["White"] = "white";
168
137
  })(DaffColorEnum || (DaffColorEnum = {}));
169
-
170
138
  const isDaffColor = (color) => Object.values(DaffColorEnum).includes(color);
171
139
  const validateColor = (color) => {
172
- if (isDevMode()) {
173
- if (color !== undefined && !isDaffColor(color)) {
174
- console.warn(color + ' is not a valid color in DaffColor');
175
- }
176
- }
140
+ if (isDevMode()) {
141
+ if (color !== void 0 && !isDaffColor(color)) console.warn(color + " is not a valid color in DaffColor");
142
+ }
177
143
  };
178
- /**
179
- * Enforces consistent use of {@link DaffColor} on a component by applying
180
- * color-specific CSS classes and validating the color in dev mode.
181
- */
182
- class DaffColorableDirective {
183
- /**
184
- * @docs-private
185
- */
186
- ngOnChanges(changes) {
187
- if (!changes.color.currentValue) {
188
- this.color = this.defaultColor;
189
- }
190
- }
191
- /**
192
- * @docs-private
193
- */
194
- ngOnInit() {
195
- validateColor(this.color);
196
- if (!this.color) {
197
- this.color = this.defaultColor;
198
- }
199
- }
200
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffColorableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
201
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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 }); }
202
- }
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffColorableDirective, decorators: [{
204
- type: Directive,
205
- args: [{
206
- selector: '[daffColorable]',
207
- host: {
208
- '[class.daff-primary]': 'color === "primary"',
209
- '[class.daff-secondary]': 'color === "secondary"',
210
- '[class.daff-tertiary]': 'color === "tertiary"',
211
- '[class.daff-light]': 'color === "light"',
212
- '[class.daff-dark]': 'color === "dark"',
213
- '[class.daff-theme]': 'color === "theme"',
214
- '[class.daff-theme-contrast]': 'color === "theme-contrast"',
215
- '[class.daff-black]': 'color === "black"',
216
- '[class.daff-white]': 'color === "white"',
217
- },
218
- }]
219
- }], propDecorators: { color: [{
220
- type: Input
221
- }] } });
222
-
223
- /**
224
- * Sensible breakpoints for layouts and interfaces used across `@daffodil/design` components.
225
- */
144
+ var DaffColorableDirective = class DaffColorableDirective {
145
+ ngOnChanges(changes) {
146
+ if (!changes.color.currentValue) this.color = this.defaultColor;
147
+ }
148
+ ngOnInit() {
149
+ validateColor(this.color);
150
+ if (!this.color) this.color = this.defaultColor;
151
+ }
152
+ static {
153
+ this.ɵfac = i0.ɵɵngDeclareFactory({
154
+ minVersion: "12.0.0",
155
+ version: "22.2.4",
156
+ ngImport: i0,
157
+ type: DaffColorableDirective,
158
+ deps: [],
159
+ target: i0.ɵɵFactoryTarget.Directive
160
+ });
161
+ }
162
+ static {
163
+ this.ɵdir = i0.ɵɵngDeclareDirective({
164
+ minVersion: "14.0.0",
165
+ version: "22.2.4",
166
+ type: DaffColorableDirective,
167
+ isStandalone: true,
168
+ selector: "[daffColorable]",
169
+ inputs: { color: "color" },
170
+ host: { properties: {
171
+ "class.daff-primary": "color === \"primary\"",
172
+ "class.daff-secondary": "color === \"secondary\"",
173
+ "class.daff-tertiary": "color === \"tertiary\"",
174
+ "class.daff-light": "color === \"light\"",
175
+ "class.daff-dark": "color === \"dark\"",
176
+ "class.daff-theme": "color === \"theme\"",
177
+ "class.daff-theme-contrast": "color === \"theme-contrast\"",
178
+ "class.daff-black": "color === \"black\"",
179
+ "class.daff-white": "color === \"white\""
180
+ } },
181
+ usesOnChanges: true,
182
+ ngImport: i0
183
+ });
184
+ }
185
+ };
186
+ i0.ɵɵngDeclareClassMetadata({
187
+ minVersion: "12.0.0",
188
+ version: "22.2.4",
189
+ ngImport: i0,
190
+ type: DaffColorableDirective,
191
+ decorators: [{
192
+ type: Directive,
193
+ args: [{
194
+ selector: "[daffColorable]",
195
+ host: {
196
+ "[class.daff-primary]": "color === \"primary\"",
197
+ "[class.daff-secondary]": "color === \"secondary\"",
198
+ "[class.daff-tertiary]": "color === \"tertiary\"",
199
+ "[class.daff-light]": "color === \"light\"",
200
+ "[class.daff-dark]": "color === \"dark\"",
201
+ "[class.daff-theme]": "color === \"theme\"",
202
+ "[class.daff-theme-contrast]": "color === \"theme-contrast\"",
203
+ "[class.daff-black]": "color === \"black\"",
204
+ "[class.daff-white]": "color === \"white\""
205
+ }
206
+ }]
207
+ }],
208
+ propDecorators: { color: [{ type: Input }] }
209
+ });
226
210
  var DaffBreakpoints;
227
- (function (DaffBreakpoints) {
228
- /** `min-width: 1920px` */
229
- DaffBreakpoints["DESKTOP"] = "(min-width: 1920px)";
230
- /** `min-width: 1440px` */
231
- DaffBreakpoints["LAPTOP"] = "(min-width: 1440px)";
232
- /** `min-width: 1200px` */
233
- DaffBreakpoints["SMALL_LAPTOP"] = "(min-width: 1200px)";
234
- /** `min-width: 1024px` */
235
- DaffBreakpoints["BIG_TABLET"] = "(min-width: 1024px)";
236
- /** `min-width: 768px` */
237
- DaffBreakpoints["TABLET"] = "(min-width: 768px)";
238
- /** `min-width: 480px` */
239
- DaffBreakpoints["MOBILE"] = "(min-width: 480px)";
211
+ (function(DaffBreakpoints) {
212
+ DaffBreakpoints["DESKTOP"] = "(min-width: 1920px)";
213
+ DaffBreakpoints["LAPTOP"] = "(min-width: 1440px)";
214
+ DaffBreakpoints["SMALL_LAPTOP"] = "(min-width: 1200px)";
215
+ DaffBreakpoints["BIG_TABLET"] = "(min-width: 1024px)";
216
+ DaffBreakpoints["TABLET"] = "(min-width: 768px)";
217
+ DaffBreakpoints["MOBILE"] = "(min-width: 480px)";
240
218
  })(DaffBreakpoints || (DaffBreakpoints = {}));
241
-
242
- /**
243
- * A no-op implementation of Angular CDK's `BreakpointObserver` that always reports
244
- * no breakpoints as matched. Useful for server-side rendering or testing contexts
245
- * where browser layout APIs are unavailable.
246
- */
247
- class NoopBreakpointObserver {
248
- /**
249
- * @docs-private
250
- */
251
- // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method, @angular-eslint/use-lifecycle-interface
252
- ngOnDestroy() { }
253
- /**
254
- * Always returns `false`, indicating that none of the given media queries are active.
255
- */
256
- isMatched(value) {
257
- return false;
258
- }
259
- /**
260
- * Returns an observable that never emits a `BreakpointState`, making breakpoint-dependent logic inert.
261
- */
262
- observe(value) {
263
- return of();
264
- }
265
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoopBreakpointObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
266
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoopBreakpointObserver, providedIn: 'root' }); }
267
- }
268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoopBreakpointObserver, decorators: [{
269
- type: Injectable,
270
- args: [{
271
- providedIn: 'root',
272
- }]
273
- }] });
274
-
275
- /**
276
- * Provides a {@link NoopBreakpointObserver} if the platform is not browser.
277
- */
278
- const SERVER_SAFE_BREAKPOINT_OBSERVER = new InjectionToken('SERVER_SAFE_BREAKPOINT_OBSERVER', {
279
- factory: () => isPlatformBrowser(inject(PLATFORM_ID))
280
- ? inject(BreakpointObserver)
281
- : inject(NoopBreakpointObserver),
219
+ var NoopBreakpointObserver = class NoopBreakpointObserver {
220
+ ngOnDestroy() {}
221
+ isMatched(value) {
222
+ return false;
223
+ }
224
+ observe(value) {
225
+ return of();
226
+ }
227
+ static {
228
+ this.ɵfac = i0.ɵɵngDeclareFactory({
229
+ minVersion: "12.0.0",
230
+ version: "22.2.4",
231
+ ngImport: i0,
232
+ type: NoopBreakpointObserver,
233
+ deps: [],
234
+ target: i0.ɵɵFactoryTarget.Injectable
235
+ });
236
+ }
237
+ static {
238
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
239
+ minVersion: "12.0.0",
240
+ version: "22.2.4",
241
+ ngImport: i0,
242
+ type: NoopBreakpointObserver,
243
+ providedIn: "root"
244
+ });
245
+ }
246
+ };
247
+ i0.ɵɵngDeclareClassMetadata({
248
+ minVersion: "12.0.0",
249
+ version: "22.2.4",
250
+ ngImport: i0,
251
+ type: NoopBreakpointObserver,
252
+ decorators: [{
253
+ type: Injectable,
254
+ args: [{ providedIn: "root" }]
255
+ }]
282
256
  });
283
-
284
- /**
285
- * A basic constructor type useful for mixins
286
- * See https://blog.mariusschulz.com/2017/05/26/typescript-2-2-mixin-classes
287
- * for a really good explanation of why mixins are useful.
288
- */
289
-
290
- /**
291
- * The `DaffStatusEnum` enumerates the possible status values for a component.
292
- */
257
+ const SERVER_SAFE_BREAKPOINT_OBSERVER = new InjectionToken("SERVER_SAFE_BREAKPOINT_OBSERVER", { factory: () => isPlatformBrowser(inject(PLATFORM_ID)) ? inject(BreakpointObserver) : inject(NoopBreakpointObserver) });
293
258
  var DaffStatusEnum;
294
- (function (DaffStatusEnum) {
295
- DaffStatusEnum["Info"] = "info";
296
- DaffStatusEnum["Warn"] = "warn";
297
- DaffStatusEnum["Critical"] = "critical";
298
- DaffStatusEnum["Success"] = "success";
259
+ (function(DaffStatusEnum) {
260
+ DaffStatusEnum["Info"] = "info";
261
+ DaffStatusEnum["Warn"] = "warn";
262
+ DaffStatusEnum["Critical"] = "critical";
263
+ DaffStatusEnum["Success"] = "success";
299
264
  })(DaffStatusEnum || (DaffStatusEnum = {}));
300
-
301
265
  const statusValues = (status) => Object.values(DaffStatusEnum).includes(status);
302
266
  const validateStatus = (status) => {
303
- if (isDevMode()) {
304
- if (status !== undefined && !statusValues(status)) {
305
- console.warn(`'${status}' is not a valid value of the status property.\n\n` +
306
- `The available values are: info, warn, critical, or success.`);
307
- }
308
- }
267
+ if (isDevMode()) {
268
+ if (status !== void 0 && !statusValues(status)) console.warn(`'${status}' is not a valid value of the status property.\n\nThe available values are: info, warn, critical, or success.`);
269
+ }
309
270
  };
310
- /**
311
- * `DaffStatusableDirective` allows a component to conditionally apply status-specific
312
- * styles by setting CSS classes based on the specified status. This directive is useful
313
- * for indicating different statuses such as info, warning, critical, or success states.
314
- *
315
- * @example Implementing it as an attribute directive
316
- *
317
- * ```html
318
- * <div daffStatusable [status]="componentStatus">Status content</div>
319
- * ```
320
- *
321
- * @example Implementing it as an Angular host directive
322
- *
323
- * ```ts
324
- * @Component({
325
- * selector: 'custom-component',
326
- * template: 'custom-component.html',
327
- * hostDirectives: [
328
- * {
329
- * directive: DaffStatusableDirective,
330
- * inputs: ['status'],
331
- * },
332
- * ],
333
- * })
334
- * export class CustomComponent { }
335
- *
336
- * ```scss
337
- * :host {
338
- * &.daff-critical {
339
- * background: daff-color($red, 10);
340
- * color: daff-color($red, 90);
341
- * }
342
- * }
343
- * ```
344
- *
345
- * The directive applies the following CSS classes to the component based on the status:
346
- *
347
- * - `daff-info`: Applied when the status is `info`.
348
- * - `daff-warn`: Applied when the status is `warn`.
349
- * - `daff-critical`: Applied when the status is `critical`.
350
- * - `daff-success`: Applied when the status is `success`.
351
- */
352
- class DaffStatusableDirective {
353
- /**
354
- * @docs-private
355
- */
356
- ngOnChanges(changes) {
357
- if (!changes.status.currentValue) {
358
- this.status = this.defaultStatus;
359
- }
360
- }
361
- /**
362
- * @docs-private
363
- */
364
- ngOnInit() {
365
- validateStatus(this.status);
366
- if (this.defaultStatus && !this.status) {
367
- this.status = this.defaultStatus;
368
- }
369
- }
370
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
371
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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 }); }
372
- }
373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffStatusableDirective, decorators: [{
374
- type: Directive,
375
- args: [{
376
- selector: '[daffStatusable]',
377
- host: {
378
- '[class.daff-info]': 'status === "info"',
379
- '[class.daff-warn]': 'status === "warn"',
380
- '[class.daff-critical]': 'status === "critical"',
381
- '[class.daff-success]': 'status === "success"',
382
- },
383
- }]
384
- }], propDecorators: { status: [{
385
- type: Input
386
- }] } });
387
-
388
- /**
389
- * `DaffSkeletonableDirective` allows a component to display a skeleton loading
390
- * state by conditionally applying a CSS class. This is useful for indicating to
391
- * users that content is loading or being processed. This directive can be used to
392
- * apply a skeleton loading state to any component by toggling the `skeleton`
393
- * input property. When `skeleton` is `true`, the `daff-skeleton` CSS class
394
- * is applied, which should style the component to look like a loading placeholder.
395
- *
396
- * @example Implementing it as an attribute directive
397
- *
398
- * ```html
399
- * <div daffSkeletonable [skeleton]="isLoading">Content</div>
400
- * ```
401
- *
402
- * @example Implementing it as an Angular host directive
403
- *
404
- * ```ts
405
- * @Component({
406
- * selector: 'custom-component',
407
- * template: 'custom-component.html',
408
- * hostDirectives: [
409
- * {
410
- * directive: DaffSkeletonableDirective,
411
- * inputs: ['skeleton'],
412
- * },
413
- * ],
414
- * })
415
- * export class CustomComponent { }
416
- * ```
417
- *
418
- * ```scss
419
- * :host {
420
- * .daff-skeleton {
421
- * @include state.skeleton-screen(48px, 24px);
422
- * }
423
- * }
424
- * ```
425
- *
426
- * The directive applies the `daff-skeleton` class to the component should be defined in your styles to display the loading
427
- * state as desired. It can be used in conjuction with the `skeleton-screen` mixin, which provides predefined loading styles.
428
- */
429
- class DaffSkeletonableDirective {
430
- constructor() {
431
- /**
432
- * Controls whether the component displays a skeleton loading state.
433
- */
434
- this.skeleton = false;
435
- }
436
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
437
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffSkeletonableDirective, isStandalone: true, selector: "[daffSkeletonable]", inputs: { skeleton: "skeleton" }, host: { properties: { "class.daff-skeleton": "skeleton" } }, ngImport: i0 }); }
438
- }
439
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSkeletonableDirective, decorators: [{
440
- type: Directive,
441
- args: [{
442
- selector: '[daffSkeletonable]',
443
- host: {
444
- '[class.daff-skeleton]': 'skeleton',
445
- },
446
- }]
447
- }], propDecorators: { skeleton: [{
448
- type: Input
449
- }] } });
450
-
451
- /**
452
- * @deprecated Deprecated in version 0.93.0. Will be removed in version 0.96.0.
453
- *
454
- * This enum will be removed from the public api in v1.0.0.
455
- */
271
+ var DaffStatusableDirective = class DaffStatusableDirective {
272
+ ngOnChanges(changes) {
273
+ if (!changes.status.currentValue) this.status = this.defaultStatus;
274
+ }
275
+ ngOnInit() {
276
+ validateStatus(this.status);
277
+ if (this.defaultStatus && !this.status) this.status = this.defaultStatus;
278
+ }
279
+ static {
280
+ this.ɵfac = i0.ɵɵngDeclareFactory({
281
+ minVersion: "12.0.0",
282
+ version: "22.2.4",
283
+ ngImport: i0,
284
+ type: DaffStatusableDirective,
285
+ deps: [],
286
+ target: i0.ɵɵFactoryTarget.Directive
287
+ });
288
+ }
289
+ static {
290
+ this.ɵdir = i0.ɵɵngDeclareDirective({
291
+ minVersion: "14.0.0",
292
+ version: "22.2.4",
293
+ type: DaffStatusableDirective,
294
+ isStandalone: true,
295
+ selector: "[daffStatusable]",
296
+ inputs: { status: "status" },
297
+ host: { properties: {
298
+ "class.daff-info": "status === \"info\"",
299
+ "class.daff-warn": "status === \"warn\"",
300
+ "class.daff-critical": "status === \"critical\"",
301
+ "class.daff-success": "status === \"success\""
302
+ } },
303
+ usesOnChanges: true,
304
+ ngImport: i0
305
+ });
306
+ }
307
+ };
308
+ i0.ɵɵngDeclareClassMetadata({
309
+ minVersion: "12.0.0",
310
+ version: "22.2.4",
311
+ ngImport: i0,
312
+ type: DaffStatusableDirective,
313
+ decorators: [{
314
+ type: Directive,
315
+ args: [{
316
+ selector: "[daffStatusable]",
317
+ host: {
318
+ "[class.daff-info]": "status === \"info\"",
319
+ "[class.daff-warn]": "status === \"warn\"",
320
+ "[class.daff-critical]": "status === \"critical\"",
321
+ "[class.daff-success]": "status === \"success\""
322
+ }
323
+ }]
324
+ }],
325
+ propDecorators: { status: [{ type: Input }] }
326
+ });
327
+ var DaffSkeletonableDirective = class DaffSkeletonableDirective {
328
+ constructor() {
329
+ this.skeleton = false;
330
+ }
331
+ static {
332
+ this.ɵfac = i0.ɵɵngDeclareFactory({
333
+ minVersion: "12.0.0",
334
+ version: "22.2.4",
335
+ ngImport: i0,
336
+ type: DaffSkeletonableDirective,
337
+ deps: [],
338
+ target: i0.ɵɵFactoryTarget.Directive
339
+ });
340
+ }
341
+ static {
342
+ this.ɵdir = i0.ɵɵngDeclareDirective({
343
+ minVersion: "14.0.0",
344
+ version: "22.2.4",
345
+ type: DaffSkeletonableDirective,
346
+ isStandalone: true,
347
+ selector: "[daffSkeletonable]",
348
+ inputs: { skeleton: "skeleton" },
349
+ host: { properties: { "class.daff-skeleton": "skeleton" } },
350
+ ngImport: i0
351
+ });
352
+ }
353
+ };
354
+ i0.ɵɵngDeclareClassMetadata({
355
+ minVersion: "12.0.0",
356
+ version: "22.2.4",
357
+ ngImport: i0,
358
+ type: DaffSkeletonableDirective,
359
+ decorators: [{
360
+ type: Directive,
361
+ args: [{
362
+ selector: "[daffSkeletonable]",
363
+ host: { "[class.daff-skeleton]": "skeleton" }
364
+ }]
365
+ }],
366
+ propDecorators: { skeleton: [{ type: Input }] }
367
+ });
456
368
  var DaffTextAlignmentEnum;
457
- (function (DaffTextAlignmentEnum) {
458
- DaffTextAlignmentEnum["Left"] = "left";
459
- DaffTextAlignmentEnum["Center"] = "center";
460
- DaffTextAlignmentEnum["Right"] = "right";
369
+ (function(DaffTextAlignmentEnum) {
370
+ DaffTextAlignmentEnum["Left"] = "left";
371
+ DaffTextAlignmentEnum["Center"] = "center";
372
+ DaffTextAlignmentEnum["Right"] = "right";
461
373
  })(DaffTextAlignmentEnum || (DaffTextAlignmentEnum = {}));
462
-
463
374
  const textAlignmentValues = (textAlignment) => Object.values(DaffTextAlignmentEnum).includes(textAlignment);
464
375
  const validateTextAlignment = (textAlignment) => {
465
- if (isDevMode()) {
466
- if (textAlignment !== undefined && !textAlignmentValues(textAlignment)) {
467
- console.warn(`'${textAlignment}' is not a valid value of the textAlignment property. The available values are: left, center, or right.`);
468
- }
469
- }
376
+ if (isDevMode()) {
377
+ if (textAlignment !== void 0 && !textAlignmentValues(textAlignment)) console.warn(`'${textAlignment}' is not a valid value of the textAlignment property. The available values are: left, center, or right.`);
378
+ }
470
379
  };
471
- /**
472
- * `DaffTextAlignableDirective` enforces consistent use of text alignment across components.
473
- */
474
- class DaffTextAlignableDirective {
475
- /**
476
- * @docs-private
477
- */
478
- ngOnChanges(changes) {
479
- if (!changes.textAlignment?.currentValue) {
480
- this.textAlignment = this.defaultAlignment;
481
- }
482
- }
483
- /**
484
- * @docs-private
485
- */
486
- ngOnInit() {
487
- validateTextAlignment(this.textAlignment);
488
- if (!this.textAlignment) {
489
- this.textAlignment = this.defaultAlignment;
490
- }
491
- }
492
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
493
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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 }); }
494
- }
495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTextAlignableDirective, decorators: [{
496
- type: Directive,
497
- args: [{
498
- selector: '[daffTextAlignable]',
499
- host: {
500
- '[class.daff-left]': 'textAlignment === "left"',
501
- '[class.daff-center]': 'textAlignment === "center"',
502
- '[class.daff-right]': 'textAlignment === "right"',
503
- },
504
- }]
505
- }], propDecorators: { textAlignment: [{
506
- type: Input
507
- }] } });
508
-
509
- /**
510
- * Enforces consistent use of the compact property.
511
- */
512
- class DaffCompactableDirective {
513
- constructor() {
514
- /**
515
- * Whether the component is compact.
516
- */
517
- this.compact = false;
518
- }
519
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
520
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffCompactableDirective, isStandalone: true, selector: "[daffCompactable]", inputs: { compact: "compact" }, host: { properties: { "class.daff-compact": "compact" } }, ngImport: i0 }); }
521
- }
522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffCompactableDirective, decorators: [{
523
- type: Directive,
524
- args: [{
525
- selector: '[daffCompactable]',
526
- host: {
527
- '[class.daff-compact]': 'compact',
528
- },
529
- }]
530
- }], propDecorators: { compact: [{
531
- type: Input
532
- }] } });
533
-
534
- /**
535
- * `DaffManageContainerLayoutDirective` gives a component the ability to manage a `DaffContainerComponent`'s layout.
536
- * By including this directive, predetermined layout styles are passed down to the container.
537
- *
538
- * To understand the motivation for this directive, consider:
539
- *
540
- * ```html
541
- * <daff-container>
542
- * <daff-hero></daff-hero>
543
- * </daff-container>
544
- * ```
545
- * vs.
546
- *
547
- * ```html
548
- * <daff-hero>
549
- * <daff-container></daff-container>
550
- * </daff-hero>
551
- * ```
552
- *
553
- * The former may inappropriately constrain the width of its child elements,
554
- * while the latter (without `DaffManageContainerLayoutDirective`) may unexpectedly
555
- * interfere in the layout features of its parent element (i.e. display: grid, display: flex).
556
- *
557
- * @example Implementing it as an attribute directive
558
- *
559
- * ```html
560
- * <my-custom-component daffManageContainerLayout>
561
- * <daff-container size="lg"></daff-container>
562
- * </my-custom-component>
563
- * ```
564
- *
565
- * ```scss
566
- * :host {
567
- * display: grid;
568
- * grid-template-columns: 1fr 1fr;
569
- * }
570
- * ```
571
- *
572
- * @example Implementing it as an Angular host directive
573
- *
574
- * ```ts
575
- * @Component({
576
- * selector: 'my-custom-component',
577
- * template: 'my-custom-component.html',
578
- * hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
579
- * })
580
- * export class MyCustomComponent { }
581
- *
582
- * ```scss
583
- * :host {
584
- * display: grid;
585
- * grid-template-columns: 1fr 1fr;
586
- * }
587
- * ```
588
- *
589
- * 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.
590
- */
591
- class DaffManageContainerLayoutDirective {
592
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffManageContainerLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
593
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffManageContainerLayoutDirective, isStandalone: true, selector: "[daffManageContainerLayout]", host: { classAttribute: "daff-manage-container-layout" }, ngImport: i0 }); }
594
- }
595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffManageContainerLayoutDirective, decorators: [{
596
- type: Directive,
597
- args: [{
598
- selector: '[daffManageContainerLayout]',
599
- host: {
600
- class: 'daff-manage-container-layout',
601
- },
602
- }]
603
- }] });
604
-
605
- /**
606
- * The `DaffArticleEncapsulatedDirective` prevents {@link DaffArticleComponent } styles from bleeding into custom components nested within an article.
607
- */
608
- class DaffArticleEncapsulatedDirective {
609
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleEncapsulatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
610
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffArticleEncapsulatedDirective, isStandalone: true, selector: "[daffArticleEncapsulated]", host: { classAttribute: "daff-ae" }, ngImport: i0 }); }
611
- }
612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffArticleEncapsulatedDirective, decorators: [{
613
- type: Directive,
614
- args: [{
615
- selector: '[daffArticleEncapsulated]',
616
- host: {
617
- class: 'daff-ae',
618
- },
619
- }]
620
- }] });
621
-
622
- /**
623
- * The possible states of a theme.
624
- */
380
+ var DaffTextAlignableDirective = class DaffTextAlignableDirective {
381
+ ngOnChanges(changes) {
382
+ if (!changes.textAlignment?.currentValue) this.textAlignment = this.defaultAlignment;
383
+ }
384
+ ngOnInit() {
385
+ validateTextAlignment(this.textAlignment);
386
+ if (!this.textAlignment) this.textAlignment = this.defaultAlignment;
387
+ }
388
+ static {
389
+ this.ɵfac = i0.ɵɵngDeclareFactory({
390
+ minVersion: "12.0.0",
391
+ version: "22.2.4",
392
+ ngImport: i0,
393
+ type: DaffTextAlignableDirective,
394
+ deps: [],
395
+ target: i0.ɵɵFactoryTarget.Directive
396
+ });
397
+ }
398
+ static {
399
+ this.ɵdir = i0.ɵɵngDeclareDirective({
400
+ minVersion: "14.0.0",
401
+ version: "22.2.4",
402
+ type: DaffTextAlignableDirective,
403
+ isStandalone: true,
404
+ selector: "[daffTextAlignable]",
405
+ inputs: { textAlignment: "textAlignment" },
406
+ host: { properties: {
407
+ "class.daff-left": "textAlignment === \"left\"",
408
+ "class.daff-center": "textAlignment === \"center\"",
409
+ "class.daff-right": "textAlignment === \"right\""
410
+ } },
411
+ usesOnChanges: true,
412
+ ngImport: i0
413
+ });
414
+ }
415
+ };
416
+ i0.ɵɵngDeclareClassMetadata({
417
+ minVersion: "12.0.0",
418
+ version: "22.2.4",
419
+ ngImport: i0,
420
+ type: DaffTextAlignableDirective,
421
+ decorators: [{
422
+ type: Directive,
423
+ args: [{
424
+ selector: "[daffTextAlignable]",
425
+ host: {
426
+ "[class.daff-left]": "textAlignment === \"left\"",
427
+ "[class.daff-center]": "textAlignment === \"center\"",
428
+ "[class.daff-right]": "textAlignment === \"right\""
429
+ }
430
+ }]
431
+ }],
432
+ propDecorators: { textAlignment: [{ type: Input }] }
433
+ });
434
+ var DaffCompactableDirective = class DaffCompactableDirective {
435
+ constructor() {
436
+ this.compact = false;
437
+ }
438
+ static {
439
+ this.ɵfac = i0.ɵɵngDeclareFactory({
440
+ minVersion: "12.0.0",
441
+ version: "22.2.4",
442
+ ngImport: i0,
443
+ type: DaffCompactableDirective,
444
+ deps: [],
445
+ target: i0.ɵɵFactoryTarget.Directive
446
+ });
447
+ }
448
+ static {
449
+ this.ɵdir = i0.ɵɵngDeclareDirective({
450
+ minVersion: "14.0.0",
451
+ version: "22.2.4",
452
+ type: DaffCompactableDirective,
453
+ isStandalone: true,
454
+ selector: "[daffCompactable]",
455
+ inputs: { compact: "compact" },
456
+ host: { properties: { "class.daff-compact": "compact" } },
457
+ ngImport: i0
458
+ });
459
+ }
460
+ };
461
+ i0.ɵɵngDeclareClassMetadata({
462
+ minVersion: "12.0.0",
463
+ version: "22.2.4",
464
+ ngImport: i0,
465
+ type: DaffCompactableDirective,
466
+ decorators: [{
467
+ type: Directive,
468
+ args: [{
469
+ selector: "[daffCompactable]",
470
+ host: { "[class.daff-compact]": "compact" }
471
+ }]
472
+ }],
473
+ propDecorators: { compact: [{ type: Input }] }
474
+ });
475
+ var DaffManageContainerLayoutDirective = class DaffManageContainerLayoutDirective {
476
+ static {
477
+ this.ɵfac = i0.ɵɵngDeclareFactory({
478
+ minVersion: "12.0.0",
479
+ version: "22.2.4",
480
+ ngImport: i0,
481
+ type: DaffManageContainerLayoutDirective,
482
+ deps: [],
483
+ target: i0.ɵɵFactoryTarget.Directive
484
+ });
485
+ }
486
+ static {
487
+ this.ɵdir = i0.ɵɵngDeclareDirective({
488
+ minVersion: "14.0.0",
489
+ version: "22.2.4",
490
+ type: DaffManageContainerLayoutDirective,
491
+ isStandalone: true,
492
+ selector: "[daffManageContainerLayout]",
493
+ host: { classAttribute: "daff-manage-container-layout" },
494
+ ngImport: i0
495
+ });
496
+ }
497
+ };
498
+ i0.ɵɵngDeclareClassMetadata({
499
+ minVersion: "12.0.0",
500
+ version: "22.2.4",
501
+ ngImport: i0,
502
+ type: DaffManageContainerLayoutDirective,
503
+ decorators: [{
504
+ type: Directive,
505
+ args: [{
506
+ selector: "[daffManageContainerLayout]",
507
+ host: { class: "daff-manage-container-layout" }
508
+ }]
509
+ }]
510
+ });
511
+ var DaffArticleEncapsulatedDirective = class DaffArticleEncapsulatedDirective {
512
+ static {
513
+ this.ɵfac = i0.ɵɵngDeclareFactory({
514
+ minVersion: "12.0.0",
515
+ version: "22.2.4",
516
+ ngImport: i0,
517
+ type: DaffArticleEncapsulatedDirective,
518
+ deps: [],
519
+ target: i0.ɵɵFactoryTarget.Directive
520
+ });
521
+ }
522
+ static {
523
+ this.ɵdir = i0.ɵɵngDeclareDirective({
524
+ minVersion: "14.0.0",
525
+ version: "22.2.4",
526
+ type: DaffArticleEncapsulatedDirective,
527
+ isStandalone: true,
528
+ selector: "[daffArticleEncapsulated]",
529
+ host: { classAttribute: "daff-ae" },
530
+ ngImport: i0
531
+ });
532
+ }
533
+ };
534
+ i0.ɵɵngDeclareClassMetadata({
535
+ minVersion: "12.0.0",
536
+ version: "22.2.4",
537
+ ngImport: i0,
538
+ type: DaffArticleEncapsulatedDirective,
539
+ decorators: [{
540
+ type: Directive,
541
+ args: [{
542
+ selector: "[daffArticleEncapsulated]",
543
+ host: { class: "daff-ae" }
544
+ }]
545
+ }]
546
+ });
625
547
  var DaffTheme;
626
- (function (DaffTheme) {
627
- DaffTheme["Light"] = "light";
628
- DaffTheme["Dark"] = "dark";
629
- DaffTheme["System"] = "system";
548
+ (function(DaffTheme) {
549
+ DaffTheme["Light"] = "light";
550
+ DaffTheme["Dark"] = "dark";
551
+ DaffTheme["System"] = "system";
630
552
  })(DaffTheme || (DaffTheme = {}));
631
-
632
- const mediaQueryDarkPreference = '(prefers-color-scheme: dark)';
553
+ const mediaQueryDarkPreference = "(prefers-color-scheme: dark)";
633
554
  const addHandlerFactory = (window) => (handler) => {
634
- const query = window.matchMedia(mediaQueryDarkPreference);
635
- return 'addEventListener' in query
636
- ? query.addEventListener('change', handler)
637
- : query.addListener(handler);
555
+ const query = window.matchMedia(mediaQueryDarkPreference);
556
+ return "addEventListener" in query ? query.addEventListener("change", handler) : query.addListener(handler);
638
557
  };
639
558
  const removeHandlerFactory = (window) => (handler) => {
640
- const query = window.matchMedia(mediaQueryDarkPreference);
641
- return 'removeEventListener' in query
642
- ? query.removeEventListener('change', handler)
643
- : query.removeListener(handler);
559
+ const query = window.matchMedia(mediaQueryDarkPreference);
560
+ return "removeEventListener" in query ? query.removeEventListener("change", handler) : query.removeListener(handler);
644
561
  };
645
- /**
646
- * A service for retrieving the operating system's theme preference.
647
- */
648
- class DaffOsThemeService {
649
- constructor(_doc) {
650
- this.doc = _doc;
651
- this.preference$ = this.doc.defaultView?.matchMedia
652
- ? fromEventPattern(addHandlerFactory(this.doc.defaultView), removeHandlerFactory(this.doc.defaultView))
653
- .pipe(startWith(this.doc.defaultView?.matchMedia(mediaQueryDarkPreference)), map((e) => e.matches), map((prefersDark) => prefersDark ? DaffTheme.Dark : DaffTheme.Light))
654
- : of(DaffTheme.System);
655
- }
656
- /**
657
- * Get the operating system's theme preference.
658
- */
659
- getThemePreference() {
660
- return this.preference$;
661
- }
662
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOsThemeService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
663
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOsThemeService, providedIn: 'root' }); }
664
- }
665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOsThemeService, decorators: [{
666
- type: Injectable,
667
- args: [{
668
- providedIn: 'root',
669
- }]
670
- }], ctorParameters: () => [{ type: undefined, decorators: [{
671
- type: Inject,
672
- args: [DOCUMENT]
673
- }] }] });
674
-
675
- const THEME_STORAGE_KEY = 'DAFF_THEME';
676
- const coerceValue = (val) => val === DaffTheme.Dark || val === DaffTheme.Light
677
- ? val
678
- : DaffTheme.System;
679
- /**
680
- * Generate a StorageEvent
681
- */
562
+ var DaffOsThemeService = class DaffOsThemeService {
563
+ constructor(_doc) {
564
+ this.doc = _doc;
565
+ this.preference$ = this.doc.defaultView?.matchMedia ? fromEventPattern(addHandlerFactory(this.doc.defaultView), removeHandlerFactory(this.doc.defaultView)).pipe(startWith(this.doc.defaultView?.matchMedia(mediaQueryDarkPreference)), map((e) => e.matches), map((prefersDark) => prefersDark ? DaffTheme.Dark : DaffTheme.Light)) : of(DaffTheme.System);
566
+ }
567
+ getThemePreference() {
568
+ return this.preference$;
569
+ }
570
+ static {
571
+ this.ɵfac = i0.ɵɵngDeclareFactory({
572
+ minVersion: "12.0.0",
573
+ version: "22.2.4",
574
+ ngImport: i0,
575
+ type: DaffOsThemeService,
576
+ deps: [{ token: DOCUMENT }],
577
+ target: i0.ɵɵFactoryTarget.Injectable
578
+ });
579
+ }
580
+ static {
581
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
582
+ minVersion: "12.0.0",
583
+ version: "22.2.4",
584
+ ngImport: i0,
585
+ type: DaffOsThemeService,
586
+ providedIn: "root"
587
+ });
588
+ }
589
+ };
590
+ i0.ɵɵngDeclareClassMetadata({
591
+ minVersion: "12.0.0",
592
+ version: "22.2.4",
593
+ ngImport: i0,
594
+ type: DaffOsThemeService,
595
+ decorators: [{
596
+ type: Injectable,
597
+ args: [{ providedIn: "root" }]
598
+ }],
599
+ ctorParameters: () => [{
600
+ type: void 0,
601
+ decorators: [{
602
+ type: Inject,
603
+ args: [DOCUMENT]
604
+ }]
605
+ }]
606
+ });
607
+ const THEME_STORAGE_KEY = "DAFF_THEME";
608
+ const coerceValue = (val) => val === DaffTheme.Dark || val === DaffTheme.Light ? val : DaffTheme.System;
682
609
  const storageEventBuilder = (value) => ({
683
- key: THEME_STORAGE_KEY,
684
- newValue: coerceValue(value) !== DaffTheme.System ? value : null,
610
+ key: THEME_STORAGE_KEY,
611
+ newValue: coerceValue(value) !== DaffTheme.System ? value : null
612
+ });
613
+ var DaffThemeStorageService = class DaffThemeStorageService {
614
+ constructor(storage, _doc) {
615
+ this.storage = storage;
616
+ this.storage$ = new Subject();
617
+ this.doc = _doc;
618
+ this.theme$ = merge(this.storage$, this.doc.defaultView ? fromEvent(this.doc.defaultView, "storage").pipe(startWith(storageEventBuilder(this.storage.getItem(THEME_STORAGE_KEY))), catchError((e) => EMPTY)) : of(storageEventBuilder(this.storage.getItem(THEME_STORAGE_KEY)))).pipe(filter((e) => e.key === THEME_STORAGE_KEY), map((e) => coerceValue(e.newValue)), shareReplay(1));
619
+ }
620
+ progressStorageEvent(theme) {
621
+ this.storage$.next(storageEventBuilder(theme));
622
+ }
623
+ getThemeAsObservable() {
624
+ return this.theme$;
625
+ }
626
+ getTheme() {
627
+ return coerceValue(this.storage.getItem(THEME_STORAGE_KEY));
628
+ }
629
+ setTheme(theme) {
630
+ this.progressStorageEvent(theme);
631
+ this.storage.setItem(THEME_STORAGE_KEY, theme);
632
+ }
633
+ removeThemeSetting() {
634
+ this.progressStorageEvent(DaffTheme.System);
635
+ this.storage.removeItem(THEME_STORAGE_KEY);
636
+ }
637
+ static {
638
+ this.ɵfac = i0.ɵɵngDeclareFactory({
639
+ minVersion: "12.0.0",
640
+ version: "22.2.4",
641
+ ngImport: i0,
642
+ type: DaffThemeStorageService,
643
+ deps: [{ token: DaffServerSafePersistenceServiceToken }, { token: DOCUMENT }],
644
+ target: i0.ɵɵFactoryTarget.Injectable
645
+ });
646
+ }
647
+ static {
648
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
649
+ minVersion: "12.0.0",
650
+ version: "22.2.4",
651
+ ngImport: i0,
652
+ type: DaffThemeStorageService,
653
+ providedIn: "root"
654
+ });
655
+ }
656
+ };
657
+ i0.ɵɵngDeclareClassMetadata({
658
+ minVersion: "12.0.0",
659
+ version: "22.2.4",
660
+ ngImport: i0,
661
+ type: DaffThemeStorageService,
662
+ decorators: [{
663
+ type: Injectable,
664
+ args: [{ providedIn: "root" }]
665
+ }],
666
+ ctorParameters: () => [{
667
+ type: void 0,
668
+ decorators: [{
669
+ type: Inject,
670
+ args: [DaffServerSafePersistenceServiceToken]
671
+ }]
672
+ }, {
673
+ type: void 0,
674
+ decorators: [{
675
+ type: Inject,
676
+ args: [DOCUMENT]
677
+ }]
678
+ }]
685
679
  });
686
- /**
687
- * A service for retrieving and managing the application's stored theme.
688
- */
689
- class DaffThemeStorageService {
690
- constructor(storage, _doc) {
691
- this.storage = storage;
692
- this.storage$ = new Subject();
693
- this.doc = _doc;
694
- this.theme$ = merge(this.storage$, this.doc.defaultView
695
- ? fromEvent(this.doc.defaultView, 'storage').pipe(startWith(storageEventBuilder(this.storage.getItem(THEME_STORAGE_KEY))), catchError((e) => EMPTY))
696
- : of(storageEventBuilder(this.storage.getItem(THEME_STORAGE_KEY)))).pipe(filter((e) => e.key === THEME_STORAGE_KEY), map((e) => coerceValue(e.newValue)), shareReplay(1));
697
- }
698
- /**
699
- * Given that Safari doesn't respect in-tab storage events, we have to manually
700
- * fire storage events in the open tab on Webkit based browsers.
701
- */
702
- progressStorageEvent(theme) {
703
- this.storage$.next(storageEventBuilder(theme));
704
- }
705
- getThemeAsObservable() {
706
- return this.theme$;
707
- }
708
- getTheme() {
709
- return coerceValue(this.storage.getItem(THEME_STORAGE_KEY));
710
- }
711
- setTheme(theme) {
712
- this.progressStorageEvent(theme);
713
- this.storage.setItem(THEME_STORAGE_KEY, theme);
714
- }
715
- removeThemeSetting() {
716
- this.progressStorageEvent(DaffTheme.System);
717
- this.storage.removeItem(THEME_STORAGE_KEY);
718
- }
719
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeStorageService, deps: [{ token: DaffServerSafePersistenceServiceToken }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
720
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeStorageService, providedIn: 'root' }); }
721
- }
722
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeStorageService, decorators: [{
723
- type: Injectable,
724
- args: [{
725
- providedIn: 'root',
726
- }]
727
- }], ctorParameters: () => [{ type: undefined, decorators: [{
728
- type: Inject,
729
- args: [DaffServerSafePersistenceServiceToken]
730
- }] }, { type: undefined, decorators: [{
731
- type: Inject,
732
- args: [DOCUMENT]
733
- }] }] });
734
-
735
- /**
736
- * Computes the appropriate application theme from the specified values.
737
- * It cascades from `storedPreference` to `osPreference` to `defaultTheme`.
738
- */
739
680
  const daffComputeThemeSetting = (osPreference, storedPreference, defaultTheme = DaffTheme.Dark) => {
740
- if (storedPreference && storedPreference !== DaffTheme.System) {
741
- return storedPreference;
742
- }
743
- if (osPreference === 'dark') {
744
- return DaffTheme.Dark;
745
- }
746
- if (osPreference === 'light') {
747
- return DaffTheme.Light;
748
- }
749
- return defaultTheme;
681
+ if (storedPreference && storedPreference !== DaffTheme.System) return storedPreference;
682
+ if (osPreference === "dark") return DaffTheme.Dark;
683
+ if (osPreference === "light") return DaffTheme.Light;
684
+ return defaultTheme;
750
685
  };
751
-
752
- /**
753
- * A service for controlling the application's theme.
754
- */
755
- class DaffThemingService {
756
- constructor(osTheme, themeStorage) {
757
- this.osTheme = osTheme;
758
- this.themeStorage = themeStorage;
759
- this.theme$ = combineLatest([
760
- this.osTheme.getThemePreference(),
761
- this.themeStorage.getThemeAsObservable(),
762
- ]).pipe(map(([osPreference, storedPreference]) => daffComputeThemeSetting(osPreference, storedPreference)));
763
- this.theme$.subscribe((theme) => {
764
- this.theme = theme;
765
- });
766
- }
767
- /**
768
- * Get the current theme.
769
- */
770
- getTheme() {
771
- return this.theme$;
772
- }
773
- /**
774
- * Get the user's stored theme preference. Emits `DaffTheme.System` when no
775
- * preference is stored and the theme follows the operating system.
776
- */
777
- getThemePreference() {
778
- return this.themeStorage.getThemeAsObservable();
779
- }
780
- /**
781
- * Set the theme to dark mode.
782
- */
783
- darkMode() {
784
- this.themeStorage.setTheme(DaffTheme.Dark);
785
- }
786
- /**
787
- * Set the theme to light mode.
788
- */
789
- lightMode() {
790
- this.themeStorage.setTheme(DaffTheme.Light);
791
- }
792
- /**
793
- * Follow the operating system's theme preference by clearing any stored theme.
794
- */
795
- systemMode() {
796
- this.themeStorage.removeThemeSetting();
797
- }
798
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemingService, deps: [{ token: DaffOsThemeService }, { token: DaffThemeStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
799
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemingService, providedIn: 'root' }); }
800
- }
801
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemingService, decorators: [{
802
- type: Injectable,
803
- args: [{
804
- providedIn: 'root',
805
- }]
806
- }], ctorParameters: () => [{ type: DaffOsThemeService }, { type: DaffThemeStorageService }] });
807
-
808
- const DAFF_THEME_DARK_CSS_CLASS = 'daff-theme-dark';
809
- const DAFF_THEME_LIGHT_CSS_CLASS = 'daff-theme-light';
810
- /**
811
- * This class updates the body of the application with the theme's appropriate class.
812
- * Note that this service is not provided tree-shakably by intention.
813
- * It is intended to be provided manually during setup.
814
- */
815
- class DaffThemeClassSetterService {
816
- constructor(_doc, rendererFactory, themingService) {
817
- this.rendererFactory = rendererFactory;
818
- this.themingService = themingService;
819
- this.doc = _doc;
820
- this.renderer = this.rendererFactory.createRenderer(null, null);
821
- }
822
- /**
823
- * This function is intended to only be called once when the service
824
- * is initialized for the very first time. This will mutate the class
825
- * on the body of the document for the appropriate theme as controlled
826
- * by the state of the application's theme.
827
- */
828
- beginThemeSync() {
829
- this.subscription = this.themingService.getTheme().subscribe((theme) => {
830
- // For simplicty, remove all previously applied themes.
831
- this.renderer.removeClass(this.doc.body, DAFF_THEME_LIGHT_CSS_CLASS);
832
- this.renderer.removeClass(this.doc.body, DAFF_THEME_DARK_CSS_CLASS);
833
- this.renderer.addClass(this.doc.body, theme === DaffTheme.Dark ? DAFF_THEME_DARK_CSS_CLASS : DAFF_THEME_LIGHT_CSS_CLASS);
834
- });
835
- }
836
- /**
837
- * This unsubscribes from the bodyClass subscription that exists.
838
- */
839
- destroy() {
840
- this.subscription?.unsubscribe();
841
- this.renderer.removeClass(this.doc.body, DAFF_THEME_LIGHT_CSS_CLASS);
842
- this.renderer.removeClass(this.doc.body, DAFF_THEME_DARK_CSS_CLASS);
843
- }
844
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeClassSetterService, deps: [{ token: DOCUMENT }, { token: i0.RendererFactory2 }, { token: DaffThemingService }], target: i0.ɵɵFactoryTarget.Injectable }); }
845
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeClassSetterService }); }
846
- }
847
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffThemeClassSetterService, decorators: [{
848
- type: Injectable
849
- }], ctorParameters: () => [{ type: undefined, decorators: [{
850
- type: Inject,
851
- args: [DOCUMENT]
852
- }] }, { type: i0.RendererFactory2 }, { type: DaffThemingService }] });
853
-
686
+ var DaffThemingService = class DaffThemingService {
687
+ constructor(osTheme, themeStorage) {
688
+ this.osTheme = osTheme;
689
+ this.themeStorage = themeStorage;
690
+ this.theme$ = combineLatest([this.osTheme.getThemePreference(), this.themeStorage.getThemeAsObservable()]).pipe(map(([osPreference, storedPreference]) => daffComputeThemeSetting(osPreference, storedPreference)));
691
+ this.theme$.subscribe((theme) => {
692
+ this.theme = theme;
693
+ });
694
+ }
695
+ getTheme() {
696
+ return this.theme$;
697
+ }
698
+ getThemePreference() {
699
+ return this.themeStorage.getThemeAsObservable();
700
+ }
701
+ darkMode() {
702
+ this.themeStorage.setTheme(DaffTheme.Dark);
703
+ }
704
+ lightMode() {
705
+ this.themeStorage.setTheme(DaffTheme.Light);
706
+ }
707
+ systemMode() {
708
+ this.themeStorage.removeThemeSetting();
709
+ }
710
+ static {
711
+ this.ɵfac = i0.ɵɵngDeclareFactory({
712
+ minVersion: "12.0.0",
713
+ version: "22.2.4",
714
+ ngImport: i0,
715
+ type: DaffThemingService,
716
+ deps: [{ token: DaffOsThemeService }, { token: DaffThemeStorageService }],
717
+ target: i0.ɵɵFactoryTarget.Injectable
718
+ });
719
+ }
720
+ static {
721
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
722
+ minVersion: "12.0.0",
723
+ version: "22.2.4",
724
+ ngImport: i0,
725
+ type: DaffThemingService,
726
+ providedIn: "root"
727
+ });
728
+ }
729
+ };
730
+ i0.ɵɵngDeclareClassMetadata({
731
+ minVersion: "12.0.0",
732
+ version: "22.2.4",
733
+ ngImport: i0,
734
+ type: DaffThemingService,
735
+ decorators: [{
736
+ type: Injectable,
737
+ args: [{ providedIn: "root" }]
738
+ }],
739
+ ctorParameters: () => [{ type: DaffOsThemeService }, { type: DaffThemeStorageService }]
740
+ });
741
+ const DAFF_THEME_DARK_CSS_CLASS = "daff-theme-dark";
742
+ const DAFF_THEME_LIGHT_CSS_CLASS = "daff-theme-light";
743
+ var DaffThemeClassSetterService = class DaffThemeClassSetterService {
744
+ constructor(_doc, rendererFactory, themingService) {
745
+ this.rendererFactory = rendererFactory;
746
+ this.themingService = themingService;
747
+ this.doc = _doc;
748
+ this.renderer = this.rendererFactory.createRenderer(null, null);
749
+ }
750
+ beginThemeSync() {
751
+ this.subscription = this.themingService.getTheme().subscribe((theme) => {
752
+ this.renderer.removeClass(this.doc.body, DAFF_THEME_LIGHT_CSS_CLASS);
753
+ this.renderer.removeClass(this.doc.body, DAFF_THEME_DARK_CSS_CLASS);
754
+ this.renderer.addClass(this.doc.body, theme === DaffTheme.Dark ? DAFF_THEME_DARK_CSS_CLASS : DAFF_THEME_LIGHT_CSS_CLASS);
755
+ });
756
+ }
757
+ destroy() {
758
+ this.subscription?.unsubscribe();
759
+ this.renderer.removeClass(this.doc.body, DAFF_THEME_LIGHT_CSS_CLASS);
760
+ this.renderer.removeClass(this.doc.body, DAFF_THEME_DARK_CSS_CLASS);
761
+ }
762
+ static {
763
+ this.ɵfac = i0.ɵɵngDeclareFactory({
764
+ minVersion: "12.0.0",
765
+ version: "22.2.4",
766
+ ngImport: i0,
767
+ type: DaffThemeClassSetterService,
768
+ deps: [
769
+ { token: DOCUMENT },
770
+ { token: i0.RendererFactory2 },
771
+ { token: DaffThemingService }
772
+ ],
773
+ target: i0.ɵɵFactoryTarget.Injectable
774
+ });
775
+ }
776
+ static {
777
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
778
+ minVersion: "12.0.0",
779
+ version: "22.2.4",
780
+ ngImport: i0,
781
+ type: DaffThemeClassSetterService
782
+ });
783
+ }
784
+ };
785
+ i0.ɵɵngDeclareClassMetadata({
786
+ minVersion: "12.0.0",
787
+ version: "22.2.4",
788
+ ngImport: i0,
789
+ type: DaffThemeClassSetterService,
790
+ decorators: [{ type: Injectable }],
791
+ ctorParameters: () => [
792
+ {
793
+ type: void 0,
794
+ decorators: [{
795
+ type: Inject,
796
+ args: [DOCUMENT]
797
+ }]
798
+ },
799
+ { type: i0.RendererFactory2 },
800
+ { type: DaffThemingService }
801
+ ]
802
+ });
854
803
  const DAFF_THEME_INIT = (classSetter) => () => classSetter.beginThemeSync();
855
- /**
856
- * The theme provider for the app.
857
- * This configures updating the body with the theme class.
858
- */
859
- const DAFF_THEME_INITIALIZER = makeEnvironmentProviders([
860
- DaffThemeClassSetterService,
861
- provideAppInitializer(() => {
862
- const initializerFn = (DAFF_THEME_INIT)(inject(DaffThemeClassSetterService));
863
- return initializerFn();
864
- }),
865
- ]);
866
-
867
- const daffFocusableElementsSelector = 'a[href],a[routerlink], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';
868
-
869
- class DaffFocusStackService {
870
- constructor(document) {
871
- this.document = document;
872
- this._stack = [];
873
- }
874
- /**
875
- * Return the current length of the stack.
876
- */
877
- length() {
878
- return this._stack.length;
879
- }
880
- /**
881
- * Adds a HTML element to a focus stack and returns the new length of the stack.
882
- *
883
- * Generally, you will probably want to call this before you transition focus
884
- * onto a new element.
885
- *
886
- * @example Using the push function
887
- * ```ts
888
- * this._focusStack.push(this._doc.activeElement);
889
- * ```
890
- */
891
- push(el = undefined) {
892
- this._stack.push(el ?? this.document.activeElement);
893
- return this._stack.length;
894
- }
895
- /**
896
- * Focuses on the HTML element at the top of a stack.
897
- *
898
- * @example Using the focus function
899
- * ```ts
900
- * this._focusStack.focus(this._doc.activeElement);
901
- * ```
902
- */
903
- focus() {
904
- if (this._stack.length >= 1) {
905
- this._stack.slice(-1)[0].focus();
906
- }
907
- else {
908
- this.document.activeElement.blur();
909
- }
910
- }
911
- /**
912
- * Removes the HMTL element at the top of a stack and focuses on it.
913
- */
914
- pop(focus = true) {
915
- let el = this._stack.pop();
916
- while (el === undefined && this._stack.length > 0) {
917
- el = this._stack.pop();
918
- }
919
- if (el) {
920
- if (focus) {
921
- el.focus();
922
- }
923
- return el;
924
- }
925
- this.document.activeElement.blur();
926
- return this.document.activeElement;
927
- }
928
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFocusStackService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
929
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFocusStackService, providedIn: 'root' }); }
930
- }
931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffFocusStackService, decorators: [{
932
- type: Injectable,
933
- args: [{ providedIn: 'root' }]
934
- }], ctorParameters: () => [{ type: undefined, decorators: [{
935
- type: Inject,
936
- args: [DOCUMENT]
937
- }] }] });
938
-
939
- /**
940
- * @deprecated Deprecated in version 0.92.1. Will be removed in version 1.0.0.
941
- */
942
- /**
943
- * @deprecated Deprecated in version 0.93.0. Will be removed in version 0.96.0.
944
- *
945
- * This enum will be removed from the public api in v1.0.0.
946
- */
804
+ const DAFF_THEME_INITIALIZER = makeEnvironmentProviders([DaffThemeClassSetterService, provideAppInitializer(() => {
805
+ return DAFF_THEME_INIT(inject(DaffThemeClassSetterService))();
806
+ })]);
807
+ const daffFocusableElementsSelector = "a[href],a[routerlink], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])";
808
+ var DaffFocusStackService = class DaffFocusStackService {
809
+ constructor(document) {
810
+ this.document = document;
811
+ this._stack = [];
812
+ }
813
+ length() {
814
+ return this._stack.length;
815
+ }
816
+ push(el = void 0) {
817
+ this._stack.push(el ?? this.document.activeElement);
818
+ return this._stack.length;
819
+ }
820
+ focus() {
821
+ if (this._stack.length >= 1) this._stack.slice(-1)[0].focus();
822
+ else this.document.activeElement.blur();
823
+ }
824
+ pop(focus = true) {
825
+ let el = this._stack.pop();
826
+ while (el === void 0 && this._stack.length > 0) el = this._stack.pop();
827
+ if (el) {
828
+ if (focus) el.focus();
829
+ return el;
830
+ }
831
+ this.document.activeElement.blur();
832
+ return this.document.activeElement;
833
+ }
834
+ static {
835
+ this.ɵfac = i0.ɵɵngDeclareFactory({
836
+ minVersion: "12.0.0",
837
+ version: "22.2.4",
838
+ ngImport: i0,
839
+ type: DaffFocusStackService,
840
+ deps: [{ token: DOCUMENT }],
841
+ target: i0.ɵɵFactoryTarget.Injectable
842
+ });
843
+ }
844
+ static {
845
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
846
+ minVersion: "12.0.0",
847
+ version: "22.2.4",
848
+ ngImport: i0,
849
+ type: DaffFocusStackService,
850
+ providedIn: "root"
851
+ });
852
+ }
853
+ };
854
+ i0.ɵɵngDeclareClassMetadata({
855
+ minVersion: "12.0.0",
856
+ version: "22.2.4",
857
+ ngImport: i0,
858
+ type: DaffFocusStackService,
859
+ decorators: [{
860
+ type: Injectable,
861
+ args: [{ providedIn: "root" }]
862
+ }],
863
+ ctorParameters: () => [{
864
+ type: void 0,
865
+ decorators: [{
866
+ type: Inject,
867
+ args: [DOCUMENT]
868
+ }]
869
+ }]
870
+ });
947
871
  var DaffSizableEnum;
948
- (function (DaffSizableEnum) {
949
- DaffSizableEnum["XSmall"] = "xs";
950
- DaffSizableEnum["Small"] = "sm";
951
- DaffSizableEnum["Medium"] = "md";
952
- DaffSizableEnum["Large"] = "lg";
953
- DaffSizableEnum["XLarge"] = "xl";
872
+ (function(DaffSizableEnum) {
873
+ DaffSizableEnum["XSmall"] = "xs";
874
+ DaffSizableEnum["Small"] = "sm";
875
+ DaffSizableEnum["Medium"] = "md";
876
+ DaffSizableEnum["Large"] = "lg";
877
+ DaffSizableEnum["XLarge"] = "xl";
954
878
  })(DaffSizableEnum || (DaffSizableEnum = {}));
955
-
956
- /**
957
- * `DaffSizableDirective` enforces consistent use of sizes across components.
958
- */
959
- class DaffSizableDirective {
960
- /**
961
- * @docs-private
962
- */
963
- ngOnChanges(changes) {
964
- if (!changes.size?.currentValue) {
965
- this.size = this.defaultSize;
966
- }
967
- }
968
- /**
969
- * @docs-private
970
- */
971
- ngOnInit() {
972
- if (!this.size) {
973
- this.size = this.defaultSize;
974
- }
975
- }
976
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
977
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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 }); }
978
- }
979
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSizableDirective, decorators: [{
980
- type: Directive,
981
- args: [{
982
- selector: '[daffSizable]',
983
- host: {
984
- '[class.daff-xs]': 'size === "xs"',
985
- '[class.daff-sm]': 'size === "sm"',
986
- '[class.daff-md]': 'size === "md"',
987
- '[class.daff-lg]': 'size === "lg"',
988
- '[class.daff-xl]': 'size === "xl"',
989
- },
990
- }]
991
- }], propDecorators: { size: [{
992
- type: Input
993
- }] } });
994
-
995
- const DaffOpenableStateError = '`open` cannot be set as an input property on the DaffOpenableDirective if it is not stateless. Did you mean to call `reveal`, `hide`, or `toggle`?';
996
-
997
- /**
998
- * A directive that opens or closes a component. It should only be used as an [Angular Host Directive](https://angular.dev/guide/directives/directive-composition-api).
999
- * This directive is stateless by default, but it supports both a state and stateless implementation. Only one version should be used within a component.
1000
- *
1001
- * @example Using the DaffOpenableDirective
1002
- * ```ts
1003
- * import {
1004
- * Component,
1005
- * ChangeDetectionStrategy,
1006
- * } from '@angular/core';
1007
- *
1008
- * import { DaffOpenableDirective } from '@daffodil/design';
1009
- *
1010
- * @Component({
1011
- * selector: 'custom-component',
1012
- * template: `
1013
- * <button (click)="toggle()">Click me!</button>
1014
- * <div class="hidden-block">This is a hidden block that can be shown by clicking the button.</div>
1015
- * `,
1016
- * styles: [`
1017
- * :host {
1018
- * .hidden-block {
1019
- * display: none;
1020
- * }
1021
- *
1022
- * &.daff-open {
1023
- * .hidden-block {
1024
- * display: block;
1025
- * }
1026
- * }
1027
- * }`],
1028
- * changeDetection: ChangeDetectionStrategy.OnPush,
1029
- * hostDirectives: [{
1030
- * directive: DaffOpenableDirective,
1031
- * }],
1032
- * })
1033
- * export class CustomComponent {
1034
- * constructor(private openDirective: DaffOpenableDirective) {}
1035
- *
1036
- * toggle() {
1037
- * this.openDirective.toggle();
1038
- * }
1039
- * }
1040
- * ```
1041
- */
1042
- class DaffOpenableDirective {
1043
- constructor() {
1044
- /** Controls whether the component is open. */
1045
- this.open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
1046
- /** Whether or not a component should handle state
1047
- *
1048
- * @example Setting the `stateless` property on a component
1049
- * ```ts
1050
- * constructor(private openDirective: DaffOpenableDirective) {
1051
- * this.openDirective.stateless = false;
1052
- * }
1053
- * ```
1054
- */
1055
- this.stateless = true;
1056
- /**
1057
- * Event fired when a component is opened (true) or closed (false)
1058
- */
1059
- this.toggled = new EventEmitter();
1060
- }
1061
- _setOpen(v) {
1062
- if (!this.stateless) {
1063
- this.open.set(v);
1064
- }
1065
- }
1066
- /**
1067
- * Open the component
1068
- */
1069
- reveal() {
1070
- this._setOpen(true);
1071
- this.toggled.emit(true);
1072
- }
1073
- /**
1074
- * Close the component
1075
- */
1076
- hide() {
1077
- this._setOpen(false);
1078
- this.toggled.emit(false);
1079
- }
1080
- /**
1081
- * Open or close the component, depending on if it's currently open or not
1082
- */
1083
- toggle() {
1084
- const state = !this.open();
1085
- this._setOpen(state);
1086
- this.toggled.emit(state);
1087
- }
1088
- /**
1089
- * @docs-private
1090
- */
1091
- ngOnChanges(changes) {
1092
- /**
1093
- * Throw an error if open is set in a component that is not stateless
1094
- */
1095
- if (changes.open.currentValue && !this.stateless) {
1096
- this.open.set(changes.open.previousValue);
1097
- if (isDevMode()) {
1098
- throw new Error(DaffOpenableStateError);
1099
- }
1100
- }
1101
- }
1102
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOpenableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1103
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffOpenableDirective, isStandalone: true, selector: "[daffOpenable]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", toggled: "toggled" }, host: { properties: { "class.daff-open": "open()" } }, usesOnChanges: true, ngImport: i0 }); }
1104
- }
1105
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOpenableDirective, decorators: [{
1106
- type: Directive,
1107
- args: [{
1108
- selector: '[daffOpenable]',
1109
- host: {
1110
- '[class.daff-open]': 'open()',
1111
- },
1112
- }]
1113
- }], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], toggled: [{
1114
- type: Output
1115
- }] } });
1116
-
1117
- /**
1118
- * @deprecated Deprecated in version 0.93.0. Will be removed in version 0.96.0.
1119
- *
1120
- * This enum will be removed from the public api in v1.0.0.
1121
- */
879
+ var DaffSizableDirective = class DaffSizableDirective {
880
+ ngOnChanges(changes) {
881
+ if (!changes.size?.currentValue) this.size = this.defaultSize;
882
+ }
883
+ ngOnInit() {
884
+ if (!this.size) this.size = this.defaultSize;
885
+ }
886
+ static {
887
+ this.ɵfac = i0.ɵɵngDeclareFactory({
888
+ minVersion: "12.0.0",
889
+ version: "22.2.4",
890
+ ngImport: i0,
891
+ type: DaffSizableDirective,
892
+ deps: [],
893
+ target: i0.ɵɵFactoryTarget.Directive
894
+ });
895
+ }
896
+ static {
897
+ this.ɵdir = i0.ɵɵngDeclareDirective({
898
+ minVersion: "14.0.0",
899
+ version: "22.2.4",
900
+ type: DaffSizableDirective,
901
+ isStandalone: true,
902
+ selector: "[daffSizable]",
903
+ inputs: { size: "size" },
904
+ host: { properties: {
905
+ "class.daff-xs": "size === \"xs\"",
906
+ "class.daff-sm": "size === \"sm\"",
907
+ "class.daff-md": "size === \"md\"",
908
+ "class.daff-lg": "size === \"lg\"",
909
+ "class.daff-xl": "size === \"xl\""
910
+ } },
911
+ usesOnChanges: true,
912
+ ngImport: i0
913
+ });
914
+ }
915
+ };
916
+ i0.ɵɵngDeclareClassMetadata({
917
+ minVersion: "12.0.0",
918
+ version: "22.2.4",
919
+ ngImport: i0,
920
+ type: DaffSizableDirective,
921
+ decorators: [{
922
+ type: Directive,
923
+ args: [{
924
+ selector: "[daffSizable]",
925
+ host: {
926
+ "[class.daff-xs]": "size === \"xs\"",
927
+ "[class.daff-sm]": "size === \"sm\"",
928
+ "[class.daff-md]": "size === \"md\"",
929
+ "[class.daff-lg]": "size === \"lg\"",
930
+ "[class.daff-xl]": "size === \"xl\""
931
+ }
932
+ }]
933
+ }],
934
+ propDecorators: { size: [{ type: Input }] }
935
+ });
936
+ const DaffOpenableStateError = "`open` cannot be set as an input property on the DaffOpenableDirective if it is not stateless. Did you mean to call `reveal`, `hide`, or `toggle`?";
937
+ var DaffOpenableDirective = class DaffOpenableDirective {
938
+ constructor() {
939
+ this.open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
940
+ this.stateless = true;
941
+ this.toggled = new EventEmitter();
942
+ }
943
+ _setOpen(v) {
944
+ if (!this.stateless) this.open.set(v);
945
+ }
946
+ reveal() {
947
+ this._setOpen(true);
948
+ this.toggled.emit(true);
949
+ }
950
+ hide() {
951
+ this._setOpen(false);
952
+ this.toggled.emit(false);
953
+ }
954
+ toggle() {
955
+ const state = !this.open();
956
+ this._setOpen(state);
957
+ this.toggled.emit(state);
958
+ }
959
+ ngOnChanges(changes) {
960
+ if (changes.open.currentValue && !this.stateless) {
961
+ this.open.set(changes.open.previousValue);
962
+ if (isDevMode()) throw new Error(DaffOpenableStateError);
963
+ }
964
+ }
965
+ static {
966
+ this.ɵfac = i0.ɵɵngDeclareFactory({
967
+ minVersion: "12.0.0",
968
+ version: "22.2.4",
969
+ ngImport: i0,
970
+ type: DaffOpenableDirective,
971
+ deps: [],
972
+ target: i0.ɵɵFactoryTarget.Directive
973
+ });
974
+ }
975
+ static {
976
+ this.ɵdir = i0.ɵɵngDeclareDirective({
977
+ minVersion: "17.1.0",
978
+ version: "22.2.4",
979
+ type: DaffOpenableDirective,
980
+ isStandalone: true,
981
+ selector: "[daffOpenable]",
982
+ inputs: { open: {
983
+ classPropertyName: "open",
984
+ publicName: "open",
985
+ isSignal: true,
986
+ isRequired: false,
987
+ transformFunction: null
988
+ } },
989
+ outputs: {
990
+ open: "openChange",
991
+ toggled: "toggled"
992
+ },
993
+ host: { properties: { "class.daff-open": "open()" } },
994
+ usesOnChanges: true,
995
+ ngImport: i0
996
+ });
997
+ }
998
+ };
999
+ i0.ɵɵngDeclareClassMetadata({
1000
+ minVersion: "12.0.0",
1001
+ version: "22.2.4",
1002
+ ngImport: i0,
1003
+ type: DaffOpenableDirective,
1004
+ decorators: [{
1005
+ type: Directive,
1006
+ args: [{
1007
+ selector: "[daffOpenable]",
1008
+ host: { "[class.daff-open]": "open()" }
1009
+ }]
1010
+ }],
1011
+ propDecorators: {
1012
+ open: [{
1013
+ type: i0.Input,
1014
+ args: [{
1015
+ isSignal: true,
1016
+ alias: "open",
1017
+ required: false
1018
+ }]
1019
+ }, {
1020
+ type: i0.Output,
1021
+ args: ["openChange"]
1022
+ }],
1023
+ toggled: [{ type: Output }]
1024
+ }
1025
+ });
1122
1026
  var DaffOrientationEnum;
1123
- (function (DaffOrientationEnum) {
1124
- DaffOrientationEnum["Horizontal"] = "horizontal";
1125
- DaffOrientationEnum["Vertical"] = "vertical";
1027
+ (function(DaffOrientationEnum) {
1028
+ DaffOrientationEnum["Horizontal"] = "horizontal";
1029
+ DaffOrientationEnum["Vertical"] = "vertical";
1126
1030
  })(DaffOrientationEnum || (DaffOrientationEnum = {}));
1127
-
1128
1031
  const orientationValues = (orientation) => Object.values(DaffOrientationEnum).includes(orientation);
1129
1032
  const validateOrientation = (orientation) => {
1130
- if (isDevMode()) {
1131
- if (orientation !== undefined && !orientationValues(orientation)) {
1132
- console.warn(`'${orientation}' is not a valid value of the orientation property. The available values are: left, center, or right.`);
1133
- }
1134
- }
1033
+ if (isDevMode()) {
1034
+ if (orientation !== void 0 && !orientationValues(orientation)) console.warn(`'${orientation}' is not a valid value of the orientation property. The available values are: left, center, or right.`);
1035
+ }
1135
1036
  };
1136
- /**
1137
- * `DaffOrientableDirective`enforces consistent use of orientation across components.
1138
- */
1139
- class DaffOrientableDirective {
1140
- /**
1141
- * @docs-private
1142
- */
1143
- ngOnInit() {
1144
- if (this.defaultOrientation && !this.orientation) {
1145
- this.orientation = this.defaultOrientation;
1146
- }
1147
- validateOrientation(this.orientation);
1148
- }
1149
- /**
1150
- * @docs-private
1151
- */
1152
- ngOnChanges(changes) {
1153
- if (!changes.orientation?.currentValue) {
1154
- this.orientation = this.defaultOrientation;
1155
- }
1156
- }
1157
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOrientableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1158
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", 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 }); }
1159
- }
1160
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffOrientableDirective, decorators: [{
1161
- type: Directive,
1162
- args: [{
1163
- selector: '[daffOrientable]',
1164
- host: {
1165
- '[class.daff-horizontal]': 'orientation === "horizontal"',
1166
- '[class.daff-vertical]': 'orientation === "vertical"',
1167
- },
1168
- }]
1169
- }], propDecorators: { orientation: [{
1170
- type: Input
1171
- }] } });
1172
-
1173
- class DaffSelectableDirective {
1174
- constructor(cd) {
1175
- this.cd = cd;
1176
- /**
1177
- * Controls whether the component is selected.
1178
- */
1179
- this.selected = false;
1180
- /**
1181
- * An event that fires after the component becomes selected.
1182
- */
1183
- this.becameSelected = new EventEmitter();
1184
- }
1185
- /**
1186
- * Selects the component and emits the `becameSelected` event.
1187
- */
1188
- select() {
1189
- this.selected = true;
1190
- this.becameSelected.emit();
1191
- this.cd.markForCheck();
1192
- return this;
1193
- }
1194
- /**
1195
- * Deselects the component.
1196
- */
1197
- deselect() {
1198
- this.selected = false;
1199
- this.cd.markForCheck();
1200
- return this;
1201
- }
1202
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSelectableDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1203
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffSelectableDirective, isStandalone: true, selector: "[daffSelected]", inputs: { selected: "selected" }, outputs: { becameSelected: "becameSelected" }, host: { properties: { "class.daff-selected": "selected" } }, ngImport: i0 }); }
1204
- }
1205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSelectableDirective, decorators: [{
1206
- type: Directive,
1207
- args: [{
1208
- selector: '[daffSelected]',
1209
- host: {
1210
- '[class.daff-selected]': 'selected',
1211
- },
1212
- }]
1213
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { selected: [{
1214
- type: Input
1215
- }], becameSelected: [{
1216
- type: Output
1217
- }] } });
1218
-
1219
- class DaffStickyTrackerDirective {
1220
- constructor(elementRef, renderer, document) {
1221
- this.elementRef = elementRef;
1222
- this.renderer = renderer;
1223
- this.document = document;
1224
- this.sticky = undefined;
1225
- this.className = 'is-pinned';
1226
- this.lastPinnedState = null;
1227
- afterNextRender({
1228
- write: () => {
1229
- this.createSentinel();
1230
- },
1231
- });
1232
- afterNextRender({
1233
- read: () => {
1234
- this.scheduleObserverCreation();
1235
- },
1236
- });
1237
- }
1238
- get isBottomSticky() {
1239
- return this.sticky === 'bottom';
1240
- }
1241
- scheduleObserverCreation() {
1242
- const defaultView = this.document.defaultView;
1243
- if (defaultView?.requestIdleCallback) {
1244
- this.idleCallbackId = defaultView.requestIdleCallback(() => {
1245
- this.createSentinelObserver();
1246
- });
1247
- }
1248
- else {
1249
- this.idleCallbackId = defaultView?.setTimeout(() => {
1250
- this.createSentinelObserver();
1251
- }, 0);
1252
- }
1253
- }
1254
- findScrollableParent() {
1255
- let parent = this.elementRef.nativeElement.parentElement;
1256
- while (parent && parent !== this.document.body) {
1257
- const computedStyle = this.document.defaultView?.getComputedStyle(parent);
1258
- const overflowY = computedStyle?.overflowY;
1259
- if (overflowY === 'auto' || overflowY === 'scroll') {
1260
- return parent;
1261
- }
1262
- parent = parent.parentElement;
1263
- }
1264
- return null;
1265
- }
1266
- createSentinel() {
1267
- const stickyElement = this.elementRef.nativeElement;
1268
- const parentElement = stickyElement.parentElement;
1269
- if (!parentElement) {
1270
- throw new Error('DaffStickyTracker: Sticky element must have a parent element');
1271
- }
1272
- this.sentinelElement = this.renderer.createElement('div');
1273
- this.renderer.setStyle(this.sentinelElement, 'width', '1px');
1274
- this.renderer.setStyle(this.sentinelElement, 'height', '1px');
1275
- this.renderer.setStyle(this.sentinelElement, 'opacity', '0');
1276
- this.renderer.setStyle(this.sentinelElement, 'pointer-events', 'none');
1277
- this.renderer.setStyle(this.sentinelElement, 'margin', '0');
1278
- this.renderer.setStyle(this.sentinelElement, 'padding', '0');
1279
- this.renderer.setStyle(this.sentinelElement, 'border', 'none');
1280
- this.renderer.setStyle(this.sentinelElement, 'overflow', 'hidden');
1281
- this.renderer.setStyle(this.sentinelElement, 'font-size', '0');
1282
- this.renderer.setStyle(this.sentinelElement, 'line-height', '0');
1283
- if (this.isBottomSticky) {
1284
- this.renderer.insertBefore(parentElement, this.sentinelElement, stickyElement.nextSibling);
1285
- }
1286
- else {
1287
- this.renderer.insertBefore(parentElement, this.sentinelElement, stickyElement);
1288
- }
1289
- }
1290
- createSentinelObserver() {
1291
- const scrollableParent = this.findScrollableParent();
1292
- const stickyElement = this.elementRef.nativeElement;
1293
- this.sentinelObserver = new IntersectionObserver(([entry]) => {
1294
- const shouldBePinned = !entry.isIntersecting;
1295
- if (this.lastPinnedState !== shouldBePinned) {
1296
- if (this.debounceTimeout) {
1297
- clearTimeout(this.debounceTimeout);
1298
- }
1299
- this.debounceTimeout = this.document.defaultView?.setTimeout(() => {
1300
- if (shouldBePinned) {
1301
- this.renderer.addClass(stickyElement, this.className);
1302
- }
1303
- else {
1304
- this.renderer.removeClass(stickyElement, this.className);
1305
- }
1306
- this.lastPinnedState = shouldBePinned;
1307
- }, 5);
1308
- }
1309
- }, {
1310
- root: scrollableParent,
1311
- threshold: 0,
1312
- rootMargin: '1px',
1313
- });
1314
- if (this.sentinelElement) {
1315
- this.sentinelObserver.observe(this.sentinelElement);
1316
- }
1317
- }
1318
- ngOnDestroy() {
1319
- if (this.idleCallbackId !== undefined) {
1320
- const defaultView = this.document.defaultView;
1321
- if (defaultView?.cancelIdleCallback) {
1322
- defaultView.cancelIdleCallback(this.idleCallbackId);
1323
- }
1324
- else {
1325
- defaultView?.clearTimeout(this.idleCallbackId);
1326
- }
1327
- }
1328
- if (this.debounceTimeout) {
1329
- clearTimeout(this.debounceTimeout);
1330
- }
1331
- if (this.sentinelObserver && this.sentinelElement) {
1332
- this.sentinelObserver.unobserve(this.sentinelElement);
1333
- }
1334
- this.sentinelObserver?.disconnect();
1335
- if (this.sentinelElement && this.sentinelElement.parentElement) {
1336
- this.renderer.removeChild(this.sentinelElement.parentElement, this.sentinelElement);
1337
- }
1338
- }
1339
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffStickyTrackerDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1340
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffStickyTrackerDirective, isStandalone: true, selector: "[daffStickyTracker]", inputs: { sticky: "sticky" }, ngImport: i0 }); }
1341
- }
1342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffStickyTrackerDirective, decorators: [{
1343
- type: Directive,
1344
- args: [{
1345
- selector: '[daffStickyTracker]',
1346
- }]
1347
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: Document, decorators: [{
1348
- type: Inject,
1349
- args: [DOCUMENT]
1350
- }] }], propDecorators: { sticky: [{
1351
- type: Input
1352
- }] } });
1353
-
1354
- /**
1355
- * Enforces consistent use of the disabled property.
1356
- */
1357
- class DaffDisableableDirective {
1358
- constructor() {
1359
- /**
1360
- * Whether the component is disabled.
1361
- */
1362
- this.disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1363
- }
1364
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffDisableableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1365
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: DaffDisableableDirective, isStandalone: true, selector: "[daffDisableable]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { properties: { "class.daff-disabled": "disabled()" } }, ngImport: i0 }); }
1366
- }
1367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffDisableableDirective, decorators: [{
1368
- type: Directive,
1369
- args: [{
1370
- selector: '[daffDisableable]',
1371
- host: {
1372
- '[class.daff-disabled]': 'disabled()',
1373
- },
1374
- }]
1375
- }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }] } });
1376
-
1377
- /**
1378
- * `DaffLoadableDirective` allows a component to display a loading UI
1379
- * by conditionally applying a CSS class. This is useful for indicating to
1380
- * users that a user action is being processed. This directive can be used to
1381
- * apply a loading UI to any component by toggling the `loading`
1382
- * input property. When `loading` is `true`, the `daff-loading` CSS class
1383
- * is applied, which should style the component to look like it's not interactable.
1384
- *
1385
- * @example Implementing it as an attribute directive
1386
- *
1387
- * ```html
1388
- * <div daffLoadable [loading]="isLoading">Content</div>
1389
- * ```
1390
- *
1391
- * @example Implementing it as an Angular host directive
1392
- *
1393
- * ```ts
1394
- * @Component({
1395
- * selector: 'custom-component',
1396
- * template: 'custom-component.html',
1397
- * hostDirectives: [
1398
- * {
1399
- * directive: DaffLoadableDirective,
1400
- * inputs: ['loading'],
1401
- * },
1402
- * ],
1403
- * })
1404
- * export class CustomComponent { }
1405
- * ```
1406
- *
1407
- * ```scss
1408
- * :host {
1409
- * .spinner {
1410
- * opacity: 0;
1411
- * }
1412
- * .daff-loading {
1413
- * .spinner {
1414
- * opacity: 1;
1415
- * }
1416
- * }
1417
- * }
1418
- * ```
1419
- *
1420
- * The directive applies the `daff-loading` class to the component. The class should be
1421
- * defined in your styles to display the loading state as desired.
1422
- */
1423
- class DaffLoadableDirective {
1424
- constructor() {
1425
- this.loading = false;
1426
- }
1427
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffLoadableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1428
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffLoadableDirective, isStandalone: true, selector: "[daffLoadable]", inputs: { loading: "loading" }, host: { properties: { "class.daff-loading": "loading" } }, ngImport: i0 }); }
1429
- }
1430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffLoadableDirective, decorators: [{
1431
- type: Directive,
1432
- args: [{
1433
- selector: '[daffLoadable]',
1434
- host: {
1435
- '[class.daff-loading]': 'loading',
1436
- },
1437
- }]
1438
- }], propDecorators: { loading: [{
1439
- type: Input
1440
- }] } });
1441
-
1442
- /**
1443
- * Allows RTI targets to inject their nearest ancestor boundary without
1444
- * creating a circular import with the boundary directive.
1445
- */
1446
- const DAFF_ROVING_TAB_INDEX_BOUNDARY = new InjectionToken('DaffRovingTabIndexBoundary');
1447
-
1448
- class DaffRovingTabIndexService {
1449
- constructor(document) {
1450
- this.document = document;
1451
- this._hierarchy = [];
1452
- this._group = signal('', ...(ngDevMode ? [{ debugName: "_group" }] : /* istanbul ignore next */ []));
1453
- this.group = this._group.asReadonly();
1454
- }
1455
- enter(group) {
1456
- if (this._group() !== group) {
1457
- this._hierarchy.push(group);
1458
- this._group.set(group);
1459
- const el = this.document.querySelector(`[data-rti="${group}"]`);
1460
- if (el) {
1461
- this.document.activeElement.blur();
1462
- el.focus();
1463
- }
1464
- }
1465
- }
1466
- leave() {
1467
- const prev = this._hierarchy.pop();
1468
- if (prev) {
1469
- const group = this._hierarchy[this._hierarchy.length - 1] || '';
1470
- this._group.set(group);
1471
- this.document.activeElement.blur();
1472
- const boundary = this.document.querySelector(`[data-rti-boundary="${prev}"][data-rti="${group}"]`);
1473
- if (boundary) {
1474
- boundary.focus();
1475
- }
1476
- else {
1477
- console.warn(`The boundary for RTI group ${prev} does not have a reference to the parent group ${group}`);
1478
- }
1479
- }
1480
- }
1481
- next() {
1482
- this._changeFocus();
1483
- }
1484
- previous() {
1485
- this._changeFocus(true);
1486
- }
1487
- _changeFocus(up = false) {
1488
- if (this._group()) {
1489
- const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1490
- const index = ary.findIndex((el) => el === this.document.activeElement);
1491
- this.document.activeElement.blur();
1492
- (up
1493
- ? ary[index === 0 ? ary.length - 1 : index - 1]
1494
- : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1495
- }
1496
- }
1497
- onKeydown(evt) {
1498
- if ('key' in evt) {
1499
- switch (evt.key) {
1500
- case 'ArrowUp':
1501
- case 'ArrowDown':
1502
- if (this._group()) {
1503
- evt.preventDefault();
1504
- const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1505
- const index = ary.findIndex((el) => el === this.document.activeElement);
1506
- this.document.activeElement.blur();
1507
- (evt.key === 'ArrowUp'
1508
- ? ary[index === 0 ? ary.length - 1 : index - 1]
1509
- : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1510
- }
1511
- break;
1512
- default:
1513
- break;
1514
- }
1515
- }
1516
- }
1517
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
1518
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexService, providedIn: 'root' }); }
1519
- }
1520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexService, decorators: [{
1521
- type: Injectable,
1522
- args: [{
1523
- providedIn: 'root',
1524
- }]
1525
- }], ctorParameters: () => [{ type: Document, decorators: [{
1526
- type: Inject,
1527
- args: [DOCUMENT]
1528
- }] }] });
1529
-
1530
- /**
1531
- * Declares that an element is an RTI target.
1532
- * Automatically applied to `<a>` and `<button>` elements.
1533
- */
1534
- class DaffRovingTabIndexDirective {
1535
- constructor(service, parent) {
1536
- this.service = service;
1537
- this.parent = parent;
1538
- /**
1539
- * Allows the RTI group to be overriden.
1540
- * By default it will be the nearest ancestor or the default root group if no boundary ancestor exists.
1541
- * @see {@link DaffRovingTabIndexBoundaryDirective}.
1542
- */
1543
- this.rti = input('', ...(ngDevMode ? [{ debugName: "rti" }] : /* istanbul ignore next */ []));
1544
- /**
1545
- * The group in which this RTI target resides.
1546
- * See {@link DaffRovingTabIndexBoundaryDirective} to make an element act as the boundary of an RTI group.
1547
- */
1548
- this.group = computed(() => this.rti() || this.parent?.effectiveBoundary() || '', ...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
1549
- /**
1550
- * @docs-private
1551
- */
1552
- this.tabindex = computed(() => this.service.group() === this.group()
1553
- ? 0
1554
- : -1, ...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
1555
- }
1556
- /**
1557
- * @docs-private
1558
- */
1559
- leaveGroup(evt) {
1560
- evt.stopPropagation();
1561
- this.service.leave();
1562
- }
1563
- /**
1564
- * @docs-private
1565
- */
1566
- next(evt) {
1567
- evt.stopPropagation();
1568
- this.service.next();
1569
- }
1570
- /**
1571
- * @docs-private
1572
- */
1573
- previous(evt) {
1574
- evt.stopPropagation();
1575
- this.service.previous();
1576
- }
1577
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexDirective, deps: [{ token: DaffRovingTabIndexService }, { token: DAFF_ROVING_TAB_INDEX_BOUNDARY, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1578
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", 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 }); }
1579
- }
1580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexDirective, decorators: [{
1581
- type: Directive,
1582
- args: [{
1583
- // eslint-disable-next-line @angular-eslint/directive-selector
1584
- selector: '[rti],a,button',
1585
- host: {
1586
- '[attr.tabindex]': 'tabindex()',
1587
- '[attr.data-rti]': 'group()',
1588
- '(keydown.escape)': 'leaveGroup($event)',
1589
- '(keydown.arrowup)': 'previous($event)',
1590
- '(keydown.arrowdown)': 'next($event)',
1591
- },
1592
- }]
1593
- }], ctorParameters: () => [{ type: DaffRovingTabIndexService }, { type: undefined, decorators: [{
1594
- type: Optional
1595
- }, {
1596
- type: SkipSelf
1597
- }, {
1598
- type: Inject,
1599
- args: [DAFF_ROVING_TAB_INDEX_BOUNDARY]
1600
- }] }], propDecorators: { rti: [{ type: i0.Input, args: [{ isSignal: true, alias: "rti", required: false }] }] } });
1601
-
1602
- /**
1603
- * Defines the boundary of an RTI group.
1604
- */
1605
- class DaffRovingTabIndexBoundaryDirective {
1606
- /**
1607
- * Don't touch this directly. Use `_uniqueId`.
1608
- */
1609
- static { this._uniqueIdCounter = 0; }
1610
- get _uniqueId() {
1611
- if (!this._cachedUniqueId) {
1612
- this._cachedUniqueId = `ε-rtiBoundary-${DaffRovingTabIndexBoundaryDirective._uniqueIdCounter++}`;
1613
- }
1614
- return this._cachedUniqueId;
1615
- }
1616
- constructor(groupService, focusTrap) {
1617
- this.groupService = groupService;
1618
- this.focusTrap = focusTrap;
1619
- /**
1620
- * The name of the group for which that this element will act as boundary.
1621
- * Optional, will be autogenerated to a unique name if omitted.
1622
- */
1623
- this.rtiBoundary = input(null, ...(ngDevMode ? [{ debugName: "rtiBoundary" }] : /* istanbul ignore next */ []));
1624
- /**
1625
- * The name of the group defined by this boundary.
1626
- */
1627
- this.effectiveBoundary = computed(() => this.rtiBoundary() || this._uniqueId, ...(ngDevMode ? [{ debugName: "effectiveBoundary" }] : /* istanbul ignore next */ []));
1628
- effect(() => {
1629
- this.focusTrap.enabled = this.effectiveBoundary() === this.groupService.group();
1630
- });
1631
- }
1632
- /**
1633
- * @docs-private
1634
- */
1635
- enterGroup(evt) {
1636
- evt.preventDefault();
1637
- evt.stopPropagation();
1638
- this.groupService.enter(this.effectiveBoundary());
1639
- }
1640
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexBoundaryDirective, deps: [{ token: DaffRovingTabIndexService }, { token: i2.CdkTrapFocus }], target: i0.ɵɵFactoryTarget.Directive }); }
1641
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", 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()" } }, providers: [
1642
- {
1643
- provide: DAFF_ROVING_TAB_INDEX_BOUNDARY,
1644
- useExisting: forwardRef((() => DaffRovingTabIndexBoundaryDirective)),
1645
- },
1646
- ], hostDirectives: [{ directive: i2.CdkTrapFocus }, { directive: DaffRovingTabIndexDirective }], ngImport: i0 }); }
1647
- }
1648
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRovingTabIndexBoundaryDirective, decorators: [{
1649
- type: Directive,
1650
- args: [{
1651
- // eslint-disable-next-line @angular-eslint/directive-selector
1652
- selector: '[rtiBoundary]',
1653
- host: {
1654
- '[attr.data-rti-boundary]': 'effectiveBoundary()',
1655
- '(keydown.space)': 'enterGroup($event)',
1656
- },
1657
- hostDirectives: [
1658
- CdkTrapFocus,
1659
- DaffRovingTabIndexDirective,
1660
- ],
1661
- providers: [
1662
- {
1663
- provide: DAFF_ROVING_TAB_INDEX_BOUNDARY,
1664
- useExisting: forwardRef((() => DaffRovingTabIndexBoundaryDirective)),
1665
- },
1666
- ],
1667
- }]
1668
- }], ctorParameters: () => [{ type: DaffRovingTabIndexService }, { type: i2.CdkTrapFocus }], propDecorators: { rtiBoundary: [{ type: i0.Input, args: [{ isSignal: true, alias: "rtiBoundary", required: false }] }] } });
1669
-
1670
- // Core
1671
-
1672
- /*
1673
- * Public API Surface of @daffodil/design
1674
- */
1675
- // Atoms
1676
-
1677
- /**
1678
- * This is a filler file for making the
1679
- * demo work in dev mode.
1680
- */
1681
-
1682
- /**
1683
- * Generated bundle index. Do not edit.
1684
- */
1037
+ var DaffOrientableDirective = class DaffOrientableDirective {
1038
+ ngOnInit() {
1039
+ if (this.defaultOrientation && !this.orientation) this.orientation = this.defaultOrientation;
1040
+ validateOrientation(this.orientation);
1041
+ }
1042
+ ngOnChanges(changes) {
1043
+ if (!changes.orientation?.currentValue) this.orientation = this.defaultOrientation;
1044
+ }
1045
+ static {
1046
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1047
+ minVersion: "12.0.0",
1048
+ version: "22.2.4",
1049
+ ngImport: i0,
1050
+ type: DaffOrientableDirective,
1051
+ deps: [],
1052
+ target: i0.ɵɵFactoryTarget.Directive
1053
+ });
1054
+ }
1055
+ static {
1056
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1057
+ minVersion: "14.0.0",
1058
+ version: "22.2.4",
1059
+ type: DaffOrientableDirective,
1060
+ isStandalone: true,
1061
+ selector: "[daffOrientable]",
1062
+ inputs: { orientation: "orientation" },
1063
+ host: { properties: {
1064
+ "class.daff-horizontal": "orientation === \"horizontal\"",
1065
+ "class.daff-vertical": "orientation === \"vertical\""
1066
+ } },
1067
+ usesOnChanges: true,
1068
+ ngImport: i0
1069
+ });
1070
+ }
1071
+ };
1072
+ i0.ɵɵngDeclareClassMetadata({
1073
+ minVersion: "12.0.0",
1074
+ version: "22.2.4",
1075
+ ngImport: i0,
1076
+ type: DaffOrientableDirective,
1077
+ decorators: [{
1078
+ type: Directive,
1079
+ args: [{
1080
+ selector: "[daffOrientable]",
1081
+ host: {
1082
+ "[class.daff-horizontal]": "orientation === \"horizontal\"",
1083
+ "[class.daff-vertical]": "orientation === \"vertical\""
1084
+ }
1085
+ }]
1086
+ }],
1087
+ propDecorators: { orientation: [{ type: Input }] }
1088
+ });
1089
+ var DaffSelectableDirective = class DaffSelectableDirective {
1090
+ constructor(cd) {
1091
+ this.cd = cd;
1092
+ this.selected = false;
1093
+ this.becameSelected = new EventEmitter();
1094
+ }
1095
+ select() {
1096
+ this.selected = true;
1097
+ this.becameSelected.emit();
1098
+ this.cd.markForCheck();
1099
+ return this;
1100
+ }
1101
+ deselect() {
1102
+ this.selected = false;
1103
+ this.cd.markForCheck();
1104
+ return this;
1105
+ }
1106
+ static {
1107
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1108
+ minVersion: "12.0.0",
1109
+ version: "22.2.4",
1110
+ ngImport: i0,
1111
+ type: DaffSelectableDirective,
1112
+ deps: [{ token: i0.ChangeDetectorRef }],
1113
+ target: i0.ɵɵFactoryTarget.Directive
1114
+ });
1115
+ }
1116
+ static {
1117
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1118
+ minVersion: "14.0.0",
1119
+ version: "22.2.4",
1120
+ type: DaffSelectableDirective,
1121
+ isStandalone: true,
1122
+ selector: "[daffSelected]",
1123
+ inputs: { selected: "selected" },
1124
+ outputs: { becameSelected: "becameSelected" },
1125
+ host: { properties: { "class.daff-selected": "selected" } },
1126
+ ngImport: i0
1127
+ });
1128
+ }
1129
+ };
1130
+ i0.ɵɵngDeclareClassMetadata({
1131
+ minVersion: "12.0.0",
1132
+ version: "22.2.4",
1133
+ ngImport: i0,
1134
+ type: DaffSelectableDirective,
1135
+ decorators: [{
1136
+ type: Directive,
1137
+ args: [{
1138
+ selector: "[daffSelected]",
1139
+ host: { "[class.daff-selected]": "selected" }
1140
+ }]
1141
+ }],
1142
+ ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
1143
+ propDecorators: {
1144
+ selected: [{ type: Input }],
1145
+ becameSelected: [{ type: Output }]
1146
+ }
1147
+ });
1148
+ var DaffStickyTrackerDirective = class DaffStickyTrackerDirective {
1149
+ constructor(elementRef, renderer, document) {
1150
+ this.elementRef = elementRef;
1151
+ this.renderer = renderer;
1152
+ this.document = document;
1153
+ this.sticky = void 0;
1154
+ this.className = "is-pinned";
1155
+ this.lastPinnedState = null;
1156
+ afterNextRender({ write: () => {
1157
+ this.createSentinel();
1158
+ } });
1159
+ afterNextRender({ read: () => {
1160
+ this.scheduleObserverCreation();
1161
+ } });
1162
+ }
1163
+ get isBottomSticky() {
1164
+ return this.sticky === "bottom";
1165
+ }
1166
+ scheduleObserverCreation() {
1167
+ const defaultView = this.document.defaultView;
1168
+ if (defaultView?.requestIdleCallback) this.idleCallbackId = defaultView.requestIdleCallback(() => {
1169
+ this.createSentinelObserver();
1170
+ });
1171
+ else this.idleCallbackId = defaultView?.setTimeout(() => {
1172
+ this.createSentinelObserver();
1173
+ }, 0);
1174
+ }
1175
+ findScrollableParent() {
1176
+ let parent = this.elementRef.nativeElement.parentElement;
1177
+ while (parent && parent !== this.document.body) {
1178
+ const overflowY = (this.document.defaultView?.getComputedStyle(parent))?.overflowY;
1179
+ if (overflowY === "auto" || overflowY === "scroll") return parent;
1180
+ parent = parent.parentElement;
1181
+ }
1182
+ return null;
1183
+ }
1184
+ createSentinel() {
1185
+ const stickyElement = this.elementRef.nativeElement;
1186
+ const parentElement = stickyElement.parentElement;
1187
+ if (!parentElement) throw new Error("DaffStickyTracker: Sticky element must have a parent element");
1188
+ this.sentinelElement = this.renderer.createElement("div");
1189
+ this.renderer.setStyle(this.sentinelElement, "width", "1px");
1190
+ this.renderer.setStyle(this.sentinelElement, "height", "1px");
1191
+ this.renderer.setStyle(this.sentinelElement, "opacity", "0");
1192
+ this.renderer.setStyle(this.sentinelElement, "pointer-events", "none");
1193
+ this.renderer.setStyle(this.sentinelElement, "margin", "0");
1194
+ this.renderer.setStyle(this.sentinelElement, "padding", "0");
1195
+ this.renderer.setStyle(this.sentinelElement, "border", "none");
1196
+ this.renderer.setStyle(this.sentinelElement, "overflow", "hidden");
1197
+ this.renderer.setStyle(this.sentinelElement, "font-size", "0");
1198
+ this.renderer.setStyle(this.sentinelElement, "line-height", "0");
1199
+ if (this.isBottomSticky) this.renderer.insertBefore(parentElement, this.sentinelElement, stickyElement.nextSibling);
1200
+ else this.renderer.insertBefore(parentElement, this.sentinelElement, stickyElement);
1201
+ }
1202
+ createSentinelObserver() {
1203
+ const scrollableParent = this.findScrollableParent();
1204
+ const stickyElement = this.elementRef.nativeElement;
1205
+ this.sentinelObserver = new IntersectionObserver(([entry]) => {
1206
+ const shouldBePinned = !entry.isIntersecting;
1207
+ if (this.lastPinnedState !== shouldBePinned) {
1208
+ if (this.debounceTimeout) clearTimeout(this.debounceTimeout);
1209
+ this.debounceTimeout = this.document.defaultView?.setTimeout(() => {
1210
+ if (shouldBePinned) this.renderer.addClass(stickyElement, this.className);
1211
+ else this.renderer.removeClass(stickyElement, this.className);
1212
+ this.lastPinnedState = shouldBePinned;
1213
+ }, 5);
1214
+ }
1215
+ }, {
1216
+ root: scrollableParent,
1217
+ threshold: 0,
1218
+ rootMargin: "1px"
1219
+ });
1220
+ if (this.sentinelElement) this.sentinelObserver.observe(this.sentinelElement);
1221
+ }
1222
+ ngOnDestroy() {
1223
+ if (this.idleCallbackId !== void 0) {
1224
+ const defaultView = this.document.defaultView;
1225
+ if (defaultView?.cancelIdleCallback) defaultView.cancelIdleCallback(this.idleCallbackId);
1226
+ else defaultView?.clearTimeout(this.idleCallbackId);
1227
+ }
1228
+ if (this.debounceTimeout) clearTimeout(this.debounceTimeout);
1229
+ if (this.sentinelObserver && this.sentinelElement) this.sentinelObserver.unobserve(this.sentinelElement);
1230
+ this.sentinelObserver?.disconnect();
1231
+ if (this.sentinelElement && this.sentinelElement.parentElement) this.renderer.removeChild(this.sentinelElement.parentElement, this.sentinelElement);
1232
+ }
1233
+ static {
1234
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1235
+ minVersion: "12.0.0",
1236
+ version: "22.2.4",
1237
+ ngImport: i0,
1238
+ type: DaffStickyTrackerDirective,
1239
+ deps: [
1240
+ { token: i0.ElementRef },
1241
+ { token: i0.Renderer2 },
1242
+ { token: DOCUMENT }
1243
+ ],
1244
+ target: i0.ɵɵFactoryTarget.Directive
1245
+ });
1246
+ }
1247
+ static {
1248
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1249
+ minVersion: "14.0.0",
1250
+ version: "22.2.4",
1251
+ type: DaffStickyTrackerDirective,
1252
+ isStandalone: true,
1253
+ selector: "[daffStickyTracker]",
1254
+ inputs: { sticky: "sticky" },
1255
+ ngImport: i0
1256
+ });
1257
+ }
1258
+ };
1259
+ i0.ɵɵngDeclareClassMetadata({
1260
+ minVersion: "12.0.0",
1261
+ version: "22.2.4",
1262
+ ngImport: i0,
1263
+ type: DaffStickyTrackerDirective,
1264
+ decorators: [{
1265
+ type: Directive,
1266
+ args: [{ selector: "[daffStickyTracker]" }]
1267
+ }],
1268
+ ctorParameters: () => [
1269
+ { type: i0.ElementRef },
1270
+ { type: i0.Renderer2 },
1271
+ {
1272
+ type: Document,
1273
+ decorators: [{
1274
+ type: Inject,
1275
+ args: [DOCUMENT]
1276
+ }]
1277
+ }
1278
+ ],
1279
+ propDecorators: { sticky: [{ type: Input }] }
1280
+ });
1281
+ var DaffDisableableDirective = class DaffDisableableDirective {
1282
+ constructor() {
1283
+ this.disabled = model(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
1284
+ }
1285
+ static {
1286
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1287
+ minVersion: "12.0.0",
1288
+ version: "22.2.4",
1289
+ ngImport: i0,
1290
+ type: DaffDisableableDirective,
1291
+ deps: [],
1292
+ target: i0.ɵɵFactoryTarget.Directive
1293
+ });
1294
+ }
1295
+ static {
1296
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1297
+ minVersion: "17.1.0",
1298
+ version: "22.2.4",
1299
+ type: DaffDisableableDirective,
1300
+ isStandalone: true,
1301
+ selector: "[daffDisableable]",
1302
+ inputs: { disabled: {
1303
+ classPropertyName: "disabled",
1304
+ publicName: "disabled",
1305
+ isSignal: true,
1306
+ isRequired: false,
1307
+ transformFunction: null
1308
+ } },
1309
+ outputs: { disabled: "disabledChange" },
1310
+ host: { properties: { "class.daff-disabled": "disabled()" } },
1311
+ ngImport: i0
1312
+ });
1313
+ }
1314
+ };
1315
+ i0.ɵɵngDeclareClassMetadata({
1316
+ minVersion: "12.0.0",
1317
+ version: "22.2.4",
1318
+ ngImport: i0,
1319
+ type: DaffDisableableDirective,
1320
+ decorators: [{
1321
+ type: Directive,
1322
+ args: [{
1323
+ selector: "[daffDisableable]",
1324
+ host: { "[class.daff-disabled]": "disabled()" }
1325
+ }]
1326
+ }],
1327
+ propDecorators: { disabled: [{
1328
+ type: i0.Input,
1329
+ args: [{
1330
+ isSignal: true,
1331
+ alias: "disabled",
1332
+ required: false
1333
+ }]
1334
+ }, {
1335
+ type: i0.Output,
1336
+ args: ["disabledChange"]
1337
+ }] }
1338
+ });
1339
+ var DaffLoadableDirective = class DaffLoadableDirective {
1340
+ constructor() {
1341
+ this.loading = false;
1342
+ }
1343
+ static {
1344
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1345
+ minVersion: "12.0.0",
1346
+ version: "22.2.4",
1347
+ ngImport: i0,
1348
+ type: DaffLoadableDirective,
1349
+ deps: [],
1350
+ target: i0.ɵɵFactoryTarget.Directive
1351
+ });
1352
+ }
1353
+ static {
1354
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1355
+ minVersion: "14.0.0",
1356
+ version: "22.2.4",
1357
+ type: DaffLoadableDirective,
1358
+ isStandalone: true,
1359
+ selector: "[daffLoadable]",
1360
+ inputs: { loading: "loading" },
1361
+ host: { properties: { "class.daff-loading": "loading" } },
1362
+ ngImport: i0
1363
+ });
1364
+ }
1365
+ };
1366
+ i0.ɵɵngDeclareClassMetadata({
1367
+ minVersion: "12.0.0",
1368
+ version: "22.2.4",
1369
+ ngImport: i0,
1370
+ type: DaffLoadableDirective,
1371
+ decorators: [{
1372
+ type: Directive,
1373
+ args: [{
1374
+ selector: "[daffLoadable]",
1375
+ host: { "[class.daff-loading]": "loading" }
1376
+ }]
1377
+ }],
1378
+ propDecorators: { loading: [{ type: Input }] }
1379
+ });
1380
+ const DAFF_ROVING_TAB_INDEX_BOUNDARY = new InjectionToken("DaffRovingTabIndexBoundary");
1381
+ var DaffRovingTabIndexService = class DaffRovingTabIndexService {
1382
+ constructor(document) {
1383
+ this.document = document;
1384
+ this._hierarchy = [];
1385
+ this._group = signal("", ...ngDevMode ? [{ debugName: "_group" }] : /* istanbul ignore next */ []);
1386
+ this.group = this._group.asReadonly();
1387
+ }
1388
+ enter(group) {
1389
+ if (this._group() !== group) {
1390
+ this._hierarchy.push(group);
1391
+ this._group.set(group);
1392
+ const el = this.document.querySelector(`[data-rti="${group}"]`);
1393
+ if (el) {
1394
+ this.document.activeElement.blur();
1395
+ el.focus();
1396
+ }
1397
+ }
1398
+ }
1399
+ leave() {
1400
+ const prev = this._hierarchy.pop();
1401
+ if (prev) {
1402
+ const group = this._hierarchy[this._hierarchy.length - 1] || "";
1403
+ this._group.set(group);
1404
+ this.document.activeElement.blur();
1405
+ const boundary = this.document.querySelector(`[data-rti-boundary="${prev}"][data-rti="${group}"]`);
1406
+ if (boundary) boundary.focus();
1407
+ else console.warn(`The boundary for RTI group ${prev} does not have a reference to the parent group ${group}`);
1408
+ }
1409
+ }
1410
+ next() {
1411
+ this._changeFocus();
1412
+ }
1413
+ previous() {
1414
+ this._changeFocus(true);
1415
+ }
1416
+ _changeFocus(up = false) {
1417
+ if (this._group()) {
1418
+ const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1419
+ const index = ary.findIndex((el) => el === this.document.activeElement);
1420
+ this.document.activeElement.blur();
1421
+ (up ? ary[index === 0 ? ary.length - 1 : index - 1] : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1422
+ }
1423
+ }
1424
+ onKeydown(evt) {
1425
+ if ("key" in evt) switch (evt.key) {
1426
+ case "ArrowUp":
1427
+ case "ArrowDown": if (this._group()) {
1428
+ evt.preventDefault();
1429
+ const ary = Array.from(this.document.querySelectorAll(`[data-rti="${this._group()}"]`));
1430
+ const index = ary.findIndex((el) => el === this.document.activeElement);
1431
+ this.document.activeElement.blur();
1432
+ (evt.key === "ArrowUp" ? ary[index === 0 ? ary.length - 1 : index - 1] : ary[index === ary.length - 1 ? 0 : index + 1]).focus();
1433
+ }
1434
+ }
1435
+ }
1436
+ static {
1437
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1438
+ minVersion: "12.0.0",
1439
+ version: "22.2.4",
1440
+ ngImport: i0,
1441
+ type: DaffRovingTabIndexService,
1442
+ deps: [{ token: DOCUMENT }],
1443
+ target: i0.ɵɵFactoryTarget.Injectable
1444
+ });
1445
+ }
1446
+ static {
1447
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1448
+ minVersion: "12.0.0",
1449
+ version: "22.2.4",
1450
+ ngImport: i0,
1451
+ type: DaffRovingTabIndexService,
1452
+ providedIn: "root"
1453
+ });
1454
+ }
1455
+ };
1456
+ i0.ɵɵngDeclareClassMetadata({
1457
+ minVersion: "12.0.0",
1458
+ version: "22.2.4",
1459
+ ngImport: i0,
1460
+ type: DaffRovingTabIndexService,
1461
+ decorators: [{
1462
+ type: Injectable,
1463
+ args: [{ providedIn: "root" }]
1464
+ }],
1465
+ ctorParameters: () => [{
1466
+ type: Document,
1467
+ decorators: [{
1468
+ type: Inject,
1469
+ args: [DOCUMENT]
1470
+ }]
1471
+ }]
1472
+ });
1473
+ var DaffRovingTabIndexDirective = class DaffRovingTabIndexDirective {
1474
+ constructor(service, parent) {
1475
+ this.service = service;
1476
+ this.parent = parent;
1477
+ this.rti = input("", ...ngDevMode ? [{ debugName: "rti" }] : /* istanbul ignore next */ []);
1478
+ this.group = computed(() => this.rti() || this.parent?.effectiveBoundary() || "", ...ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []);
1479
+ this.tabindex = computed(() => this.service.group() === this.group() ? 0 : -1, ...ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []);
1480
+ }
1481
+ leaveGroup(evt) {
1482
+ evt.stopPropagation();
1483
+ this.service.leave();
1484
+ }
1485
+ next(evt) {
1486
+ evt.stopPropagation();
1487
+ this.service.next();
1488
+ }
1489
+ previous(evt) {
1490
+ evt.stopPropagation();
1491
+ this.service.previous();
1492
+ }
1493
+ static {
1494
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1495
+ minVersion: "12.0.0",
1496
+ version: "22.2.4",
1497
+ ngImport: i0,
1498
+ type: DaffRovingTabIndexDirective,
1499
+ deps: [{ token: DaffRovingTabIndexService }, {
1500
+ token: DAFF_ROVING_TAB_INDEX_BOUNDARY,
1501
+ optional: true,
1502
+ skipSelf: true
1503
+ }],
1504
+ target: i0.ɵɵFactoryTarget.Directive
1505
+ });
1506
+ }
1507
+ static {
1508
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1509
+ minVersion: "17.1.0",
1510
+ version: "22.2.4",
1511
+ type: DaffRovingTabIndexDirective,
1512
+ isStandalone: true,
1513
+ selector: "[rti],a,button",
1514
+ inputs: { rti: {
1515
+ classPropertyName: "rti",
1516
+ publicName: "rti",
1517
+ isSignal: true,
1518
+ isRequired: false,
1519
+ transformFunction: null
1520
+ } },
1521
+ host: {
1522
+ listeners: {
1523
+ "keydown.escape": "leaveGroup($event)",
1524
+ "keydown.arrowup": "previous($event)",
1525
+ "keydown.arrowdown": "next($event)"
1526
+ },
1527
+ properties: {
1528
+ "attr.tabindex": "tabindex()",
1529
+ "attr.data-rti": "group()"
1530
+ }
1531
+ },
1532
+ ngImport: i0
1533
+ });
1534
+ }
1535
+ };
1536
+ i0.ɵɵngDeclareClassMetadata({
1537
+ minVersion: "12.0.0",
1538
+ version: "22.2.4",
1539
+ ngImport: i0,
1540
+ type: DaffRovingTabIndexDirective,
1541
+ decorators: [{
1542
+ type: Directive,
1543
+ args: [{
1544
+ selector: "[rti],a,button",
1545
+ host: {
1546
+ "[attr.tabindex]": "tabindex()",
1547
+ "[attr.data-rti]": "group()",
1548
+ "(keydown.escape)": "leaveGroup($event)",
1549
+ "(keydown.arrowup)": "previous($event)",
1550
+ "(keydown.arrowdown)": "next($event)"
1551
+ }
1552
+ }]
1553
+ }],
1554
+ ctorParameters: () => [{ type: DaffRovingTabIndexService }, {
1555
+ type: void 0,
1556
+ decorators: [
1557
+ { type: Optional },
1558
+ { type: SkipSelf },
1559
+ {
1560
+ type: Inject,
1561
+ args: [DAFF_ROVING_TAB_INDEX_BOUNDARY]
1562
+ }
1563
+ ]
1564
+ }],
1565
+ propDecorators: { rti: [{
1566
+ type: i0.Input,
1567
+ args: [{
1568
+ isSignal: true,
1569
+ alias: "rti",
1570
+ required: false
1571
+ }]
1572
+ }] }
1573
+ });
1574
+ var DaffRovingTabIndexBoundaryDirective = class DaffRovingTabIndexBoundaryDirective {
1575
+ static {
1576
+ this._uniqueIdCounter = 0;
1577
+ }
1578
+ get _uniqueId() {
1579
+ if (!this._cachedUniqueId) this._cachedUniqueId = `ε-rtiBoundary-${DaffRovingTabIndexBoundaryDirective._uniqueIdCounter++}`;
1580
+ return this._cachedUniqueId;
1581
+ }
1582
+ constructor(groupService, focusTrap) {
1583
+ this.groupService = groupService;
1584
+ this.focusTrap = focusTrap;
1585
+ this.rtiBoundary = input(null, ...ngDevMode ? [{ debugName: "rtiBoundary" }] : /* istanbul ignore next */ []);
1586
+ this.effectiveBoundary = computed(() => this.rtiBoundary() || this._uniqueId, ...ngDevMode ? [{ debugName: "effectiveBoundary" }] : /* istanbul ignore next */ []);
1587
+ effect(() => {
1588
+ this.focusTrap.enabled = this.effectiveBoundary() === this.groupService.group();
1589
+ });
1590
+ }
1591
+ enterGroup(evt) {
1592
+ evt.preventDefault();
1593
+ evt.stopPropagation();
1594
+ this.groupService.enter(this.effectiveBoundary());
1595
+ }
1596
+ static {
1597
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1598
+ minVersion: "12.0.0",
1599
+ version: "22.2.4",
1600
+ ngImport: i0,
1601
+ type: DaffRovingTabIndexBoundaryDirective,
1602
+ deps: [{ token: DaffRovingTabIndexService }, { token: i2.CdkTrapFocus }],
1603
+ target: i0.ɵɵFactoryTarget.Directive
1604
+ });
1605
+ }
1606
+ static {
1607
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1608
+ minVersion: "17.1.0",
1609
+ version: "22.2.4",
1610
+ type: DaffRovingTabIndexBoundaryDirective,
1611
+ isStandalone: true,
1612
+ selector: "[rtiBoundary]",
1613
+ inputs: { rtiBoundary: {
1614
+ classPropertyName: "rtiBoundary",
1615
+ publicName: "rtiBoundary",
1616
+ isSignal: true,
1617
+ isRequired: false,
1618
+ transformFunction: null
1619
+ } },
1620
+ host: {
1621
+ listeners: { "keydown.space": "enterGroup($event)" },
1622
+ properties: { "attr.data-rti-boundary": "effectiveBoundary()" }
1623
+ },
1624
+ providers: [{
1625
+ provide: DAFF_ROVING_TAB_INDEX_BOUNDARY,
1626
+ useExisting: forwardRef((() => DaffRovingTabIndexBoundaryDirective))
1627
+ }],
1628
+ hostDirectives: [{ directive: i2.CdkTrapFocus }, { directive: DaffRovingTabIndexDirective }],
1629
+ ngImport: i0
1630
+ });
1631
+ }
1632
+ };
1633
+ i0.ɵɵngDeclareClassMetadata({
1634
+ minVersion: "12.0.0",
1635
+ version: "22.2.4",
1636
+ ngImport: i0,
1637
+ type: DaffRovingTabIndexBoundaryDirective,
1638
+ decorators: [{
1639
+ type: Directive,
1640
+ args: [{
1641
+ selector: "[rtiBoundary]",
1642
+ host: {
1643
+ "[attr.data-rti-boundary]": "effectiveBoundary()",
1644
+ "(keydown.space)": "enterGroup($event)"
1645
+ },
1646
+ hostDirectives: [CdkTrapFocus, DaffRovingTabIndexDirective],
1647
+ providers: [{
1648
+ provide: DAFF_ROVING_TAB_INDEX_BOUNDARY,
1649
+ useExisting: forwardRef((() => DaffRovingTabIndexBoundaryDirective))
1650
+ }]
1651
+ }]
1652
+ }],
1653
+ ctorParameters: () => [{ type: DaffRovingTabIndexService }, { type: i2.CdkTrapFocus }],
1654
+ propDecorators: { rtiBoundary: [{
1655
+ type: i0.Input,
1656
+ args: [{
1657
+ isSignal: true,
1658
+ alias: "rtiBoundary",
1659
+ required: false
1660
+ }]
1661
+ }] }
1662
+ });
1663
+ export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_ROVING_TAB_INDEX_BOUNDARY, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffColorableDirective, DaffCompactableDirective, DaffDisableableDirective, DaffFocusStackService, 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 };
1685
1664
 
1686
- export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_ROVING_TAB_INDEX_BOUNDARY, 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 };
1687
- //# sourceMappingURL=daffodil-design.mjs.map
1665
+ //# sourceMappingURL=daffodil-design.mjs.map