@daffodil/design 0.94.1-rc.0 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,250 +1,397 @@
1
- import * as i1 from '@angular/cdk/layout';
2
- import * as i1$2 from '@angular/cdk/overlay';
3
- import { GlobalPositionStrategy } from '@angular/cdk/overlay';
4
- import { ComponentPortal } from '@angular/cdk/portal';
5
- import * as i0 from '@angular/core';
6
- import { Inject, Injectable, Directive, contentChild, input, ChangeDetectionStrategy, ViewEncapsulation, Component, EventEmitter, Input, Output, Optional, SkipSelf } from '@angular/core';
7
- import { merge, of, EMPTY } from 'rxjs';
8
- import { filter, map, tap, delay, take } from 'rxjs/operators';
9
- import * as i2 from '@daffodil/design';
10
- import { DaffBreakpoints, DaffPrefixDirective, DaffArticleEncapsulatedDirective, DaffStatusableDirective } from '@daffodil/design';
11
- import { createConfigInjectionToken } from '@daffodil/core';
12
- import { NgTemplateOutlet, SlicePipe } from '@angular/common';
13
- import { FaIconComponent } from '@fortawesome/angular-fontawesome';
14
- import { faTimes } from '@fortawesome/free-solid-svg-icons';
15
- import * as i2$1 from '@daffodil/design/button';
16
- import { DAFF_BUTTON_COMPONENTS } from '@daffodil/design/button';
17
- import * as i1$1 from '@angular/cdk/a11y';
18
-
1
+ import * as i1$2 from "@angular/cdk/layout";
2
+ import * as i1 from "@angular/cdk/overlay";
3
+ import { GlobalPositionStrategy } from "@angular/cdk/overlay";
4
+ import { ComponentPortal } from "@angular/cdk/portal";
5
+ import * as i0 from "@angular/core";
6
+ import { ChangeDetectionStrategy, Component, Directive, EventEmitter, Inject, Injectable, Input, Optional, Output, SkipSelf, ViewEncapsulation, contentChild, input } from "@angular/core";
7
+ import { EMPTY, merge, of } from "rxjs";
8
+ import { delay, filter, map, take, tap } from "rxjs/operators";
9
+ import * as i2$1 from "@daffodil/design";
10
+ import { DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffPrefixDirective, DaffStatusableDirective } from "@daffodil/design";
11
+ import { createConfigInjectionToken } from "@daffodil/core";
12
+ import { NgTemplateOutlet, SlicePipe } from "@angular/common";
13
+ import { FaIconComponent } from "@fortawesome/angular-fontawesome";
14
+ import { faTimes } from "@fortawesome/free-solid-svg-icons";
15
+ import * as i2 from "@daffodil/design/button";
16
+ import { DAFF_BUTTON_COMPONENTS } from "@daffodil/design/button";
17
+ import * as i1$1 from "@angular/cdk/a11y";
19
18
  const daffToastChangesFocus = (toast) => toast.actions?.length > 0;
20
-
21
19
  const createPositionStrategy = (position) => {
22
- const strat = new GlobalPositionStrategy();
23
- switch (position.horizontal) {
24
- case 'left':
25
- strat.left('48px');
26
- break;
27
- case 'right':
28
- strat.right('48px');
29
- break;
30
- case 'center':
31
- strat.centerHorizontally();
32
- break;
33
- default:
34
- strat.right('48px');
35
- }
36
- switch (position.vertical) {
37
- case 'top':
38
- strat.top('80px');
39
- break;
40
- case 'bottom':
41
- strat.bottom('48px');
42
- break;
43
- default:
44
- strat.top('80px');
45
- }
46
- return strat;
20
+ const strat = new GlobalPositionStrategy();
21
+ switch (position.horizontal) {
22
+ case "left":
23
+ strat.left("48px");
24
+ break;
25
+ case "right":
26
+ strat.right("48px");
27
+ break;
28
+ case "center":
29
+ strat.centerHorizontally();
30
+ break;
31
+ default: strat.right("48px");
32
+ }
33
+ switch (position.vertical) {
34
+ case "top":
35
+ strat.top("80px");
36
+ break;
37
+ case "bottom":
38
+ strat.bottom("48px");
39
+ break;
40
+ default: strat.top("80px");
41
+ }
42
+ return strat;
47
43
  };
48
-
49
- ;
50
- ;
51
44
  const daffToastDefaultOptions = {
52
- position: {
53
- vertical: 'top',
54
- horizontal: 'right',
55
- },
56
- useParent: true,
45
+ position: {
46
+ vertical: "top",
47
+ horizontal: "right"
48
+ },
49
+ useParent: true
57
50
  };
58
- const { token: DAFF_TOAST_OPTIONS, provider: provideDaffToastOptions, } = createConfigInjectionToken(daffToastDefaultOptions, 'DAFF_TOAST_OPTIONS');
59
-
60
- class DaffToastPositionService {
61
- constructor(options, mediaQuery) {
62
- this.options = options;
63
- this.mediaQuery = mediaQuery;
64
- this._config = options.position;
65
- }
66
- /**
67
- * Reads the current position of the toast. Defaults to bottom center on mobile devices.
68
- */
69
- get config() {
70
- return this.mediaQuery.isMatched(DaffBreakpoints.MOBILE)
71
- ? this._position ?? this._config
72
- : { vertical: 'bottom', horizontal: 'center' };
73
- }
74
- set config(val) {
75
- this._config = val;
76
- }
77
- /**
78
- * Changes the position of the toast.
79
- *
80
- * @param position The position of the toast.
81
- */
82
- setPosition(position) {
83
- this._position = position;
84
- }
85
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastPositionService, deps: [{ token: DAFF_TOAST_OPTIONS }, { token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable }); }
86
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastPositionService }); }
87
- }
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastPositionService, decorators: [{
89
- type: Injectable
90
- }], ctorParameters: () => [{ type: undefined, decorators: [{
91
- type: Inject,
92
- args: [DAFF_TOAST_OPTIONS]
93
- }] }, { type: i1.BreakpointObserver }] });
94
-
51
+ const { token: DAFF_TOAST_OPTIONS, provider: provideDaffToastOptions } = createConfigInjectionToken(daffToastDefaultOptions, "DAFF_TOAST_OPTIONS");
52
+ var DaffToastPositionService = class DaffToastPositionService {
53
+ constructor(options, mediaQuery) {
54
+ this.options = options;
55
+ this.mediaQuery = mediaQuery;
56
+ this._config = options.position;
57
+ }
58
+ get config() {
59
+ return this.mediaQuery.isMatched(DaffBreakpoints.MOBILE) ? this._position ?? this._config : {
60
+ vertical: "bottom",
61
+ horizontal: "center"
62
+ };
63
+ }
64
+ set config(val) {
65
+ this._config = val;
66
+ }
67
+ setPosition(position) {
68
+ this._position = position;
69
+ }
70
+ static {
71
+ this.ɵfac = i0.ɵɵngDeclareFactory({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.4",
74
+ ngImport: i0,
75
+ type: DaffToastPositionService,
76
+ deps: [{ token: DAFF_TOAST_OPTIONS }, { token: i1$2.BreakpointObserver }],
77
+ target: i0.ɵɵFactoryTarget.Injectable
78
+ });
79
+ }
80
+ static {
81
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
82
+ minVersion: "12.0.0",
83
+ version: "22.2.4",
84
+ ngImport: i0,
85
+ type: DaffToastPositionService
86
+ });
87
+ }
88
+ };
89
+ i0.ɵɵngDeclareClassMetadata({
90
+ minVersion: "12.0.0",
91
+ version: "22.2.4",
92
+ ngImport: i0,
93
+ type: DaffToastPositionService,
94
+ decorators: [{ type: Injectable }],
95
+ ctorParameters: () => [{
96
+ type: void 0,
97
+ decorators: [{
98
+ type: Inject,
99
+ args: [DAFF_TOAST_OPTIONS]
100
+ }]
101
+ }, { type: i1$2.BreakpointObserver }]
102
+ });
95
103
  const daffDefaultToastConfiguration = {};
96
-
97
- class DaffToastActionsDirective {
98
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
99
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffToastActionsDirective, isStandalone: true, selector: "[daffToastActions]", host: { classAttribute: "daff-toast__actions" }, ngImport: i0 }); }
100
- }
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastActionsDirective, decorators: [{
102
- type: Directive,
103
- args: [{
104
- selector: '[daffToastActions]',
105
- host: {
106
- class: 'daff-toast__actions',
107
- },
108
- }]
109
- }] });
110
-
111
- /**
112
- * @docs-private
113
- *
114
- * DaffToastComponent provides a way to display and
115
- * communicate information for user actions or system updates.
116
- */
117
- class DaffToastComponent {
118
- /**
119
- * @docs-private
120
- */
121
- onEscape() {
122
- this.toast().dismiss();
123
- }
124
- constructor(_elementRef, _focusTrapFactory, _focusStack) {
125
- this._elementRef = _elementRef;
126
- this._focusTrapFactory = _focusTrapFactory;
127
- this._focusStack = _focusStack;
128
- /**
129
- * @docs-private
130
- */
131
- this._actions = contentChild(DaffToastActionsDirective, ...(ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []));
132
- /**
133
- * @docs-private
134
- */
135
- this._prefix = contentChild(DaffPrefixDirective, ...(ngDevMode ? [{ debugName: "_prefix" }] : /* istanbul ignore next */ []));
136
- this.toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : /* istanbul ignore next */ []));
137
- }
138
- /**
139
- * @docs-private
140
- */
141
- ngAfterContentInit() {
142
- if (daffToastChangesFocus(this.toast())) {
143
- this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
144
- }
145
- }
146
- /**
147
- * @docs-private
148
- */
149
- ngAfterViewInit() {
150
- if (daffToastChangesFocus(this.toast())) {
151
- this._focusStack.push();
152
- this._focusTrap.focusFirstTabbableElementWhenReady();
153
- }
154
- }
155
- /**
156
- * @docs-private
157
- */
158
- ngOnDestroy() {
159
- if (daffToastChangesFocus(this.toast())) {
160
- this._focusTrap.destroy();
161
- }
162
- }
163
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.ConfigurableFocusTrapFactory }, { token: i2.DaffFocusStackService }], target: i0.ɵɵFactoryTarget.Component }); }
164
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffToastComponent, isStandalone: true, selector: "daff-toast", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "onEscape()" }, classAttribute: "daff-toast" }, queries: [{ propertyName: "_actions", first: true, predicate: DaffToastActionsDirective, descendants: true, isSignal: true }, { propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: i2.DaffArticleEncapsulatedDirective }, { directive: i2.DaffStatusableDirective, inputs: ["status", "status"] }], ngImport: i0, template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n", styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
165
- }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastComponent, decorators: [{
167
- type: Component,
168
- args: [{ selector: 'daff-toast', hostDirectives: [
169
- { directive: DaffArticleEncapsulatedDirective },
170
- {
171
- directive: DaffStatusableDirective,
172
- inputs: ['status'],
173
- },
174
- ], host: {
175
- class: 'daff-toast',
176
- '(keydown.escape)': 'onEscape()',
177
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n", styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"] }]
178
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.ConfigurableFocusTrapFactory }, { type: i2.DaffFocusStackService }], propDecorators: { _actions: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DaffToastActionsDirective), { isSignal: true }] }], _prefix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DaffPrefixDirective), { isSignal: true }] }], toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }] } });
179
-
180
- /* eslint-disable quote-props */
181
- class DaffToastMessageDirective {
182
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastMessageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
183
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffToastMessageDirective, isStandalone: true, selector: "[daffToastMessage]", host: { classAttribute: "daff-toast__message" }, ngImport: i0 }); }
184
- }
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastMessageDirective, decorators: [{
186
- type: Directive,
187
- args: [{
188
- selector: '[daffToastMessage]',
189
- host: {
190
- 'class': 'daff-toast__message',
191
- },
192
- }]
193
- }] });
194
-
195
- /* eslint-disable quote-props */
196
- class DaffToastTitleDirective {
197
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
198
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffToastTitleDirective, isStandalone: true, selector: "[daffToastTitle]", host: { classAttribute: "daff-toast__title" }, ngImport: i0 }); }
199
- }
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastTitleDirective, decorators: [{
201
- type: Directive,
202
- args: [{
203
- selector: '[daffToastTitle]',
204
- host: {
205
- 'class': 'daff-toast__title',
206
- },
207
- }]
208
- }] });
209
-
210
- class DaffToastTemplateComponent {
211
- constructor(cd, options, toastPosition) {
212
- this.cd = cd;
213
- this.options = options;
214
- this.toastPosition = toastPosition;
215
- this.faTimes = faTimes;
216
- this._items = [];
217
- this.closeToast = new EventEmitter();
218
- }
219
- onCloseToast(event) {
220
- this.closeToast.emit();
221
- }
222
- getAnimationDirection() {
223
- const position = this.toastPosition.config.horizontal + '-' + this.toastPosition.config.vertical;
224
- switch (position) {
225
- case 'left-top':
226
- case 'left-bottom':
227
- return 'left';
228
- case 'right-top':
229
- case 'right-bottom':
230
- return 'right';
231
- case 'center-top':
232
- return 'top';
233
- case 'center-bottom':
234
- return 'bottom';
235
- default:
236
- return 'left';
237
- }
238
- }
239
- get items() {
240
- return this._items;
241
- }
242
- set items(value) {
243
- this._items = value;
244
- this.cd.markForCheck();
245
- }
246
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastTemplateComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: DAFF_TOAST_OPTIONS }, { token: DaffToastPositionService }], target: i0.ɵɵFactoryTarget.Component }); }
247
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffToastTemplateComponent, isStandalone: true, selector: "ng-component", inputs: { items: "items" }, outputs: { closeToast: "closeToast" }, ngImport: i0, template: `
104
+ var DaffToastActionsDirective = class DaffToastActionsDirective {
105
+ static {
106
+ this.ɵfac = i0.ɵɵngDeclareFactory({
107
+ minVersion: "12.0.0",
108
+ version: "22.2.4",
109
+ ngImport: i0,
110
+ type: DaffToastActionsDirective,
111
+ deps: [],
112
+ target: i0.ɵɵFactoryTarget.Directive
113
+ });
114
+ }
115
+ static {
116
+ this.ɵdir = i0.ɵɵngDeclareDirective({
117
+ minVersion: "14.0.0",
118
+ version: "22.2.4",
119
+ type: DaffToastActionsDirective,
120
+ isStandalone: true,
121
+ selector: "[daffToastActions]",
122
+ host: { classAttribute: "daff-toast__actions" },
123
+ ngImport: i0
124
+ });
125
+ }
126
+ };
127
+ i0.ɵɵngDeclareClassMetadata({
128
+ minVersion: "12.0.0",
129
+ version: "22.2.4",
130
+ ngImport: i0,
131
+ type: DaffToastActionsDirective,
132
+ decorators: [{
133
+ type: Directive,
134
+ args: [{
135
+ selector: "[daffToastActions]",
136
+ host: { class: "daff-toast__actions" }
137
+ }]
138
+ }]
139
+ });
140
+ var DaffToastComponent = class DaffToastComponent {
141
+ onEscape() {
142
+ this.toast().dismiss();
143
+ }
144
+ constructor(_elementRef, _focusTrapFactory, _focusStack) {
145
+ this._elementRef = _elementRef;
146
+ this._focusTrapFactory = _focusTrapFactory;
147
+ this._focusStack = _focusStack;
148
+ this._actions = contentChild(DaffToastActionsDirective, ...ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []);
149
+ this._prefix = contentChild(DaffPrefixDirective, ...ngDevMode ? [{ debugName: "_prefix" }] : /* istanbul ignore next */ []);
150
+ this.toast = input.required(...ngDevMode ? [{ debugName: "toast" }] : /* istanbul ignore next */ []);
151
+ }
152
+ ngAfterContentInit() {
153
+ if (daffToastChangesFocus(this.toast())) this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
154
+ }
155
+ ngAfterViewInit() {
156
+ if (daffToastChangesFocus(this.toast())) {
157
+ this._focusStack.push();
158
+ this._focusTrap.focusFirstTabbableElementWhenReady();
159
+ }
160
+ }
161
+ ngOnDestroy() {
162
+ if (daffToastChangesFocus(this.toast())) this._focusTrap.destroy();
163
+ }
164
+ static {
165
+ this.ɵfac = i0.ɵɵngDeclareFactory({
166
+ minVersion: "12.0.0",
167
+ version: "22.2.4",
168
+ ngImport: i0,
169
+ type: DaffToastComponent,
170
+ deps: [
171
+ { token: i0.ElementRef },
172
+ { token: i1$1.ConfigurableFocusTrapFactory },
173
+ { token: i2$1.DaffFocusStackService }
174
+ ],
175
+ target: i0.ɵɵFactoryTarget.Component
176
+ });
177
+ }
178
+ static {
179
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
180
+ minVersion: "17.0.0",
181
+ version: "22.2.4",
182
+ type: DaffToastComponent,
183
+ isStandalone: true,
184
+ selector: "daff-toast",
185
+ inputs: { toast: {
186
+ classPropertyName: "toast",
187
+ publicName: "toast",
188
+ isSignal: true,
189
+ isRequired: true,
190
+ transformFunction: null
191
+ } },
192
+ host: {
193
+ listeners: { "keydown.escape": "onEscape()" },
194
+ classAttribute: "daff-toast"
195
+ },
196
+ queries: [{
197
+ propertyName: "_actions",
198
+ first: true,
199
+ predicate: DaffToastActionsDirective,
200
+ descendants: true,
201
+ isSignal: true
202
+ }, {
203
+ propertyName: "_prefix",
204
+ first: true,
205
+ predicate: DaffPrefixDirective,
206
+ descendants: true,
207
+ isSignal: true
208
+ }],
209
+ hostDirectives: [{ directive: i2$1.DaffArticleEncapsulatedDirective }, {
210
+ directive: i2$1.DaffStatusableDirective,
211
+ inputs: ["status", "status"]
212
+ }],
213
+ ngImport: i0,
214
+ template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n",
215
+ styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"],
216
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
217
+ encapsulation: i0.ViewEncapsulation.None
218
+ });
219
+ }
220
+ };
221
+ i0.ɵɵngDeclareClassMetadata({
222
+ minVersion: "12.0.0",
223
+ version: "22.2.4",
224
+ ngImport: i0,
225
+ type: DaffToastComponent,
226
+ decorators: [{
227
+ type: Component,
228
+ args: [{
229
+ selector: "daff-toast",
230
+ hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }, {
231
+ directive: DaffStatusableDirective,
232
+ inputs: ["status"]
233
+ }],
234
+ host: {
235
+ class: "daff-toast",
236
+ "(keydown.escape)": "onEscape()"
237
+ },
238
+ encapsulation: ViewEncapsulation.None,
239
+ changeDetection: ChangeDetectionStrategy.OnPush,
240
+ template: "@if (_prefix()) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-toast__details\">\n <div class=\"daff-toast__content\">\n <ng-content select=\"[daffToastTitle]\"></ng-content>\n <ng-content select=\"[daffToastMessage]\"></ng-content>\n </div>\n <ng-content select=\"[daffToastActions]\"></ng-content>\n</div>\n<ng-content></ng-content>\n",
241
+ styles: [".daff-toast{display:flex;border-radius:.25rem;font-size:1rem;line-height:1.5rem;position:relative;min-width:15rem;max-width:90vw}@media(min-width:480px){.daff-toast{max-width:22rem}}.daff-toast+div+.daff-toast{margin-top:.75rem}.daff-toast+div+div+.daff-toast{margin-top:.75rem}.daff-toast+.daff-toast{margin-top:.75rem}.daff-toast:before{content:\"\";border-radius:.25rem 0 0 .25rem;position:absolute;height:100%;left:0;top:0;width:.25rem}.daff-toast .daff-prefix{padding:1rem 0 1rem 1rem}.daff-toast__close-button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;background:none;border:none;color:currentColor;margin:0;min-height:3rem;height:3rem;min-width:3rem;width:3rem}.daff-toast__details{display:block;font-size:1rem;line-height:1.5rem;width:100%}.daff-toast__content{display:flex;flex-direction:column;gap:.25rem;padding:1rem}.daff-toast__title{font-weight:600}.daff-toast__message{font-weight:400;line-height:1.25rem}.daff-toast__actions{display:flex;align-items:center;gap:.5rem;min-height:3rem;padding:0 1rem 1rem}@keyframes slideInLeft{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideInRight{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideInTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.daff-toast.slide-in-left{animation:slideInLeft .3s ease-out}.daff-toast.slide-in-right{animation:slideInRight .3s ease-out}.daff-toast.slide-in-top{animation:slideInTop .3s ease-out}.daff-toast.slide-in-bottom{animation:slideInBottom .3s ease-out}@media screen and (prefers-reduced-motion:reduce){.daff-toast.slide-in-left,.daff-toast.slide-in-right,.daff-toast.slide-in-top,.daff-toast.slide-in-bottom{animation:none}}\n"]
242
+ }]
243
+ }],
244
+ ctorParameters: () => [
245
+ { type: i0.ElementRef },
246
+ { type: i1$1.ConfigurableFocusTrapFactory },
247
+ { type: i2$1.DaffFocusStackService }
248
+ ],
249
+ propDecorators: {
250
+ _actions: [{
251
+ type: i0.ContentChild,
252
+ args: [i0.forwardRef(() => DaffToastActionsDirective), { isSignal: true }]
253
+ }],
254
+ _prefix: [{
255
+ type: i0.ContentChild,
256
+ args: [i0.forwardRef(() => DaffPrefixDirective), { isSignal: true }]
257
+ }],
258
+ toast: [{
259
+ type: i0.Input,
260
+ args: [{
261
+ isSignal: true,
262
+ alias: "toast",
263
+ required: true
264
+ }]
265
+ }]
266
+ }
267
+ });
268
+ var DaffToastMessageDirective = class DaffToastMessageDirective {
269
+ static {
270
+ this.ɵfac = i0.ɵɵngDeclareFactory({
271
+ minVersion: "12.0.0",
272
+ version: "22.2.4",
273
+ ngImport: i0,
274
+ type: DaffToastMessageDirective,
275
+ deps: [],
276
+ target: i0.ɵɵFactoryTarget.Directive
277
+ });
278
+ }
279
+ static {
280
+ this.ɵdir = i0.ɵɵngDeclareDirective({
281
+ minVersion: "14.0.0",
282
+ version: "22.2.4",
283
+ type: DaffToastMessageDirective,
284
+ isStandalone: true,
285
+ selector: "[daffToastMessage]",
286
+ host: { classAttribute: "daff-toast__message" },
287
+ ngImport: i0
288
+ });
289
+ }
290
+ };
291
+ i0.ɵɵngDeclareClassMetadata({
292
+ minVersion: "12.0.0",
293
+ version: "22.2.4",
294
+ ngImport: i0,
295
+ type: DaffToastMessageDirective,
296
+ decorators: [{
297
+ type: Directive,
298
+ args: [{
299
+ selector: "[daffToastMessage]",
300
+ host: { "class": "daff-toast__message" }
301
+ }]
302
+ }]
303
+ });
304
+ var DaffToastTitleDirective = class DaffToastTitleDirective {
305
+ static {
306
+ this.ɵfac = i0.ɵɵngDeclareFactory({
307
+ minVersion: "12.0.0",
308
+ version: "22.2.4",
309
+ ngImport: i0,
310
+ type: DaffToastTitleDirective,
311
+ deps: [],
312
+ target: i0.ɵɵFactoryTarget.Directive
313
+ });
314
+ }
315
+ static {
316
+ this.ɵdir = i0.ɵɵngDeclareDirective({
317
+ minVersion: "14.0.0",
318
+ version: "22.2.4",
319
+ type: DaffToastTitleDirective,
320
+ isStandalone: true,
321
+ selector: "[daffToastTitle]",
322
+ host: { classAttribute: "daff-toast__title" },
323
+ ngImport: i0
324
+ });
325
+ }
326
+ };
327
+ i0.ɵɵngDeclareClassMetadata({
328
+ minVersion: "12.0.0",
329
+ version: "22.2.4",
330
+ ngImport: i0,
331
+ type: DaffToastTitleDirective,
332
+ decorators: [{
333
+ type: Directive,
334
+ args: [{
335
+ selector: "[daffToastTitle]",
336
+ host: { "class": "daff-toast__title" }
337
+ }]
338
+ }]
339
+ });
340
+ var DaffToastTemplateComponent = class DaffToastTemplateComponent {
341
+ constructor(cd, options, toastPosition) {
342
+ this.cd = cd;
343
+ this.options = options;
344
+ this.toastPosition = toastPosition;
345
+ this.faTimes = faTimes;
346
+ this._items = [];
347
+ this.closeToast = new EventEmitter();
348
+ }
349
+ onCloseToast(event) {
350
+ this.closeToast.emit();
351
+ }
352
+ getAnimationDirection() {
353
+ switch (this.toastPosition.config.horizontal + "-" + this.toastPosition.config.vertical) {
354
+ case "left-top":
355
+ case "left-bottom": return "left";
356
+ case "right-top":
357
+ case "right-bottom": return "right";
358
+ case "center-top": return "top";
359
+ case "center-bottom": return "bottom";
360
+ default: return "left";
361
+ }
362
+ }
363
+ get items() {
364
+ return this._items;
365
+ }
366
+ set items(value) {
367
+ this._items = value;
368
+ this.cd.markForCheck();
369
+ }
370
+ static {
371
+ this.ɵfac = i0.ɵɵngDeclareFactory({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.4",
374
+ ngImport: i0,
375
+ type: DaffToastTemplateComponent,
376
+ deps: [
377
+ { token: i0.ChangeDetectorRef },
378
+ { token: DAFF_TOAST_OPTIONS },
379
+ { token: DaffToastPositionService }
380
+ ],
381
+ target: i0.ɵɵFactoryTarget.Component
382
+ });
383
+ }
384
+ static {
385
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
386
+ minVersion: "17.0.0",
387
+ version: "22.2.4",
388
+ type: DaffToastTemplateComponent,
389
+ isStandalone: true,
390
+ selector: "ng-component",
391
+ inputs: { items: "items" },
392
+ outputs: { closeToast: "closeToast" },
393
+ ngImport: i0,
394
+ template: `
248
395
  @for (item of items | slice:0:3; track item) {
249
396
  <daff-toast
250
397
  [toast]="item"
@@ -296,16 +443,6 @@ class DaffToastTemplateComponent {
296
443
  {{ action.content }}
297
444
  </button>
298
445
  }
299
- @case ('underline') {
300
- <button type="button" daff-underline-button
301
- [status]="action.status"
302
- [color]="action.color"
303
- [size]="action.size"
304
- [attr.aria-label]="action.content"
305
- (click)="action.eventEmitter?.emit({ event: $event, action})">
306
- {{ action.content }}
307
- </button>
308
- }
309
446
  @default {
310
447
  <button type="button" daff-button
311
448
  [status]="action.status"
@@ -318,13 +455,119 @@ class DaffToastTemplateComponent {
318
455
  }
319
456
  }
320
457
  </ng-template>
321
- `, isInline: true, dependencies: [{ kind: "component", type: i2$1.DaffButtonComponent, selector: "button[daff-button],a[daff-button]", inputs: ["elevated"] }, { kind: "component", type: i2$1.DaffFlatButtonComponent, selector: "button[daff-flat-button],a[daff-flat-button]" }, { kind: "component", type: i2$1.DaffIconButtonComponent, selector: "button[daff-icon-button],a[daff-icon-button]" }, { kind: "component", type: i2$1.DaffStrokedButtonComponent, selector: "button[daff-stroked-button],a[daff-stroked-button]", inputs: ["elevated"] }, { kind: "component", type: i2$1.DaffUnderlineButtonComponent, selector: "button[daff-underline-button],a[daff-underline-button]" }, { kind: "component", type: DaffToastComponent, selector: "daff-toast", inputs: ["toast"] }, { kind: "directive", type: DaffToastActionsDirective, selector: "[daffToastActions]" }, { kind: "directive", type: DaffToastTitleDirective, selector: "[daffToastTitle]" }, { kind: "directive", type: DaffToastMessageDirective, selector: "[daffToastMessage]" }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SlicePipe, name: "slice" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
322
- }
323
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastTemplateComponent, decorators: [{
324
- type: Component,
325
- args: [{
326
- changeDetection: ChangeDetectionStrategy.OnPush,
327
- template: `
458
+ `,
459
+ isInline: true,
460
+ dependencies: [
461
+ {
462
+ kind: "component",
463
+ type: i2.DaffButtonComponent,
464
+ selector: "button[daff-button],a[daff-button]",
465
+ inputs: ["elevated"]
466
+ },
467
+ {
468
+ kind: "component",
469
+ type: i2.DaffFlatButtonComponent,
470
+ selector: "button[daff-flat-button],a[daff-flat-button]"
471
+ },
472
+ {
473
+ kind: "component",
474
+ type: i2.DaffIconButtonComponent,
475
+ selector: "button[daff-icon-button],a[daff-icon-button]"
476
+ },
477
+ {
478
+ kind: "component",
479
+ type: i2.DaffStrokedButtonComponent,
480
+ selector: "button[daff-stroked-button],a[daff-stroked-button]",
481
+ inputs: ["elevated"]
482
+ },
483
+ {
484
+ kind: "component",
485
+ type: DaffToastComponent,
486
+ selector: "daff-toast",
487
+ inputs: ["toast"]
488
+ },
489
+ {
490
+ kind: "directive",
491
+ type: DaffToastActionsDirective,
492
+ selector: "[daffToastActions]"
493
+ },
494
+ {
495
+ kind: "directive",
496
+ type: DaffToastTitleDirective,
497
+ selector: "[daffToastTitle]"
498
+ },
499
+ {
500
+ kind: "directive",
501
+ type: DaffToastMessageDirective,
502
+ selector: "[daffToastMessage]"
503
+ },
504
+ {
505
+ kind: "component",
506
+ type: FaIconComponent,
507
+ selector: "fa-icon",
508
+ inputs: [
509
+ "icon",
510
+ "title",
511
+ "animation",
512
+ "mask",
513
+ "flip",
514
+ "size",
515
+ "pull",
516
+ "border",
517
+ "inverse",
518
+ "symbol",
519
+ "rotate",
520
+ "fixedWidth",
521
+ "transform",
522
+ "a11yRole"
523
+ ],
524
+ outputs: [
525
+ "iconChange",
526
+ "titleChange",
527
+ "animationChange",
528
+ "maskChange",
529
+ "flipChange",
530
+ "sizeChange",
531
+ "pullChange",
532
+ "borderChange",
533
+ "inverseChange",
534
+ "symbolChange",
535
+ "rotateChange",
536
+ "fixedWidthChange",
537
+ "transformChange",
538
+ "a11yRoleChange"
539
+ ]
540
+ },
541
+ {
542
+ kind: "directive",
543
+ type: NgTemplateOutlet,
544
+ selector: "[ngTemplateOutlet]",
545
+ inputs: [
546
+ "ngTemplateOutletContext",
547
+ "ngTemplateOutlet",
548
+ "ngTemplateOutletInjector"
549
+ ]
550
+ },
551
+ {
552
+ kind: "pipe",
553
+ type: SlicePipe,
554
+ name: "slice"
555
+ }
556
+ ],
557
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
558
+ });
559
+ }
560
+ };
561
+ i0.ɵɵngDeclareClassMetadata({
562
+ minVersion: "12.0.0",
563
+ version: "22.2.4",
564
+ ngImport: i0,
565
+ type: DaffToastTemplateComponent,
566
+ decorators: [{
567
+ type: Component,
568
+ args: [{
569
+ changeDetection: ChangeDetectionStrategy.OnPush,
570
+ template: `
328
571
  @for (item of items | slice:0:3; track item) {
329
572
  <daff-toast
330
573
  [toast]="item"
@@ -376,16 +619,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
376
619
  {{ action.content }}
377
620
  </button>
378
621
  }
379
- @case ('underline') {
380
- <button type="button" daff-underline-button
381
- [status]="action.status"
382
- [color]="action.color"
383
- [size]="action.size"
384
- [attr.aria-label]="action.content"
385
- (click)="action.eventEmitter?.emit({ event: $event, action})">
386
- {{ action.content }}
387
- </button>
388
- }
389
622
  @default {
390
623
  <button type="button" daff-button
391
624
  [status]="action.status"
@@ -399,219 +632,163 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
399
632
  }
400
633
  </ng-template>
401
634
  `,
402
- imports: [
403
- DAFF_BUTTON_COMPONENTS,
404
- DaffToastComponent,
405
- DaffToastActionsDirective,
406
- DaffToastTitleDirective,
407
- DaffToastMessageDirective,
408
- FaIconComponent,
409
- SlicePipe,
410
- NgTemplateOutlet,
411
- ],
412
- }]
413
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
414
- type: Inject,
415
- args: [DAFF_TOAST_OPTIONS]
416
- }] }, { type: DaffToastPositionService }], propDecorators: { closeToast: [{
417
- type: Output
418
- }], items: [{
419
- type: Input
420
- }] } });
421
-
422
- /**
423
- * Service to display toasts.
424
- *
425
- * @example
426
- * ```ts
427
- * import {
428
- * ChangeDetectionStrategy,
429
- * Component,
430
- * EventEmitter,
431
- * OnInit,
432
- * } from '@angular/core';
433
- *
434
- * import {
435
- * DaffToast,
436
- * DaffToastAction,
437
- * DaffToastService,
438
- * } from '@daffodil/design/toast';
439
- *
440
- * @Component({
441
- * selector: 'default-toast',
442
- * templateUrl: './default-toast.component.html',
443
- * styles: [],
444
- * changeDetection: ChangeDetectionStrategy.OnPush,
445
- * })
446
- * export class DefaultToastComponent implements OnInit {
447
- * private toast: DaffToast;
448
- *
449
- * constructor(private toastService: DaffToastService) {}
450
- *
451
- * closeToast = new EventEmitter<DaffToastAction>();
452
- *
453
- * open() {
454
- * this.toast = this.toastService.open({
455
- * title: 'Update Available',
456
- * message: 'A new version of this page is available.',
457
- * actions: [
458
- * { content: 'Remind me later', type: 'flat', size: 'sm', eventEmitter: this.closeToast },
459
- * ],
460
- * });
461
- * }
462
- *
463
- * ngOnInit() {
464
- * this.closeToast.subscribe(() => {
465
- * this.toastService.close(this.toast);
466
- * });
467
- * }
468
- * }
469
- * ```
470
- */
471
- class DaffToastService {
472
- constructor(overlay, options, _parentToast, mediaQuery, toastPosition, focusStack, injector) {
473
- this.overlay = overlay;
474
- this.options = options;
475
- this._parentToast = _parentToast;
476
- this.mediaQuery = mediaQuery;
477
- this.toastPosition = toastPosition;
478
- this.focusStack = focusStack;
479
- this.injector = injector;
480
- this._toasts = [];
481
- this._sub = this.mediaQuery.observe(DaffBreakpoints.MOBILE).pipe(filter(() => this._overlayRef !== undefined), map((position) => createPositionStrategy(this.toastPosition.config)), tap((strategy) => this._overlayRef.updatePositionStrategy(strategy))).subscribe();
482
- }
483
- /**
484
- * @docs-private
485
- */
486
- ngOnDestroy() {
487
- this._sub.unsubscribe();
488
- }
489
- _attachToastTemplate(overlayRef) {
490
- const template = overlayRef.attach(new ComponentPortal(DaffToastTemplateComponent, null, this.injector));
491
- return template;
492
- }
493
- _createOverlayRef() {
494
- return this.overlay.create({
495
- hasBackdrop: false,
496
- scrollStrategy: this.overlay.scrollStrategies.noop(),
497
- positionStrategy: createPositionStrategy(this.toastPosition.config),
498
- });
499
- }
500
- /**
501
- * Opens a toast.
502
- *
503
- * @param toast Data that can be shown on a toast.
504
- * @param configuration Additional configuration options such as duration. The default duration is set to `5000ms`.
505
- */
506
- open(toast, configuration) {
507
- if (this._parentToast && this.options.useParent) {
508
- return this._parentToast.open(toast, configuration);
509
- }
510
- const config = {
511
- ...daffDefaultToastConfiguration,
512
- // sets the default duration to 5000ms if a toast does not have actions
513
- duration: toast.actions?.length > 0 ? undefined : 5000,
514
- ...configuration,
515
- };
516
- if (this._toasts.length === 0) {
517
- this._overlayRef = this._createOverlayRef();
518
- this._template = this._attachToastTemplate(this._overlayRef);
519
- }
520
- const dismissEvent = new EventEmitter();
521
- const _toastPlus = {
522
- dismissible: true,
523
- ...toast,
524
- dismiss: () => {
525
- dismissEvent.emit();
526
- },
527
- dismissalStream: merge(config.duration ? of(undefined).pipe(delay(config.duration)) : EMPTY, dismissEvent).pipe(take(1)),
528
- };
529
- _toastPlus.dismissalStream.subscribe(() => {
530
- this.close(_toastPlus);
531
- });
532
- this._toasts = [
533
- _toastPlus,
534
- ...this._toasts,
535
- ];
536
- this._template.instance.items = this._toasts;
537
- return _toastPlus;
538
- }
539
- /**
540
- * Closes a toast.
541
- *
542
- * @param toast The instance of toast that you wish to close.
543
- */
544
- close(toast) {
545
- if (this._parentToast && this.options.useParent) {
546
- this._parentToast.close(toast);
547
- return;
548
- }
549
- if (daffToastChangesFocus(toast)) {
550
- this.focusStack.pop();
551
- }
552
- const index = this._toasts.indexOf(toast);
553
- if (index === -1) {
554
- throw new Error('The Toast that you are trying to remove does not exist.');
555
- }
556
- this._toasts = this._toasts.filter(m => m !== toast);
557
- this._template.instance.items = [...this._toasts];
558
- if (this._toasts.length === 0) {
559
- this._overlayRef.dispose();
560
- this._template.destroy();
561
- this._overlayRef = undefined;
562
- this._template = undefined;
563
- }
564
- }
565
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService, deps: [{ token: i1$2.Overlay }, { token: DAFF_TOAST_OPTIONS }, { token: DaffToastService, optional: true, skipSelf: true }, { token: i1.BreakpointObserver }, { token: DaffToastPositionService }, { token: i2.DaffFocusStackService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
566
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService }); }
567
- }
568
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffToastService, decorators: [{
569
- type: Injectable
570
- }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: undefined, decorators: [{
571
- type: Inject,
572
- args: [DAFF_TOAST_OPTIONS]
573
- }] }, { type: DaffToastService, decorators: [{
574
- type: Optional
575
- }, {
576
- type: SkipSelf
577
- }] }, { type: i1.BreakpointObserver }, { type: DaffToastPositionService }, { type: i2.DaffFocusStackService }, { type: i0.Injector }] });
578
-
579
- /**
580
- * Registers the `DaffToastService` for displaying a toast. This provider ensures
581
- * toasts function correctly within your application.
582
- *
583
- * ```ts
584
- * import { provideDaffToast } from '@daffodil/design/toast';
585
- *
586
- * @NgModule({
587
- * providers: [
588
- * provideDaffToast({
589
- * position: {
590
- * vertical: 'bottom',
591
- * horizontal: 'left',
592
- * },
593
- * }),
594
- * ]
595
- * )}
596
- *
597
- * export class AppModule {}
598
- * ```
599
- * @param config Sets the configuration for all toasts.
600
- * Toasts are displayed in the top-right corner of the screen by default on desktop devices.
601
- *
602
- * On mobile devices, toasts will always appear in the bottom-center position,
603
- * regardless of configuration settings.
604
- *
605
- */
635
+ imports: [
636
+ DAFF_BUTTON_COMPONENTS,
637
+ DaffToastComponent,
638
+ DaffToastActionsDirective,
639
+ DaffToastTitleDirective,
640
+ DaffToastMessageDirective,
641
+ FaIconComponent,
642
+ SlicePipe,
643
+ NgTemplateOutlet
644
+ ]
645
+ }]
646
+ }],
647
+ ctorParameters: () => [
648
+ { type: i0.ChangeDetectorRef },
649
+ {
650
+ type: void 0,
651
+ decorators: [{
652
+ type: Inject,
653
+ args: [DAFF_TOAST_OPTIONS]
654
+ }]
655
+ },
656
+ { type: DaffToastPositionService }
657
+ ],
658
+ propDecorators: {
659
+ closeToast: [{ type: Output }],
660
+ items: [{ type: Input }]
661
+ }
662
+ });
663
+ var DaffToastService = class DaffToastService {
664
+ constructor(overlay, options, _parentToast, mediaQuery, toastPosition, focusStack, injector) {
665
+ this.overlay = overlay;
666
+ this.options = options;
667
+ this._parentToast = _parentToast;
668
+ this.mediaQuery = mediaQuery;
669
+ this.toastPosition = toastPosition;
670
+ this.focusStack = focusStack;
671
+ this.injector = injector;
672
+ this._toasts = [];
673
+ this._sub = this.mediaQuery.observe(DaffBreakpoints.MOBILE).pipe(filter(() => this._overlayRef !== void 0), map((position) => createPositionStrategy(this.toastPosition.config)), tap((strategy) => this._overlayRef.updatePositionStrategy(strategy))).subscribe();
674
+ }
675
+ ngOnDestroy() {
676
+ this._sub.unsubscribe();
677
+ }
678
+ _attachToastTemplate(overlayRef) {
679
+ return overlayRef.attach(new ComponentPortal(DaffToastTemplateComponent, null, this.injector));
680
+ }
681
+ _createOverlayRef() {
682
+ return this.overlay.create({
683
+ hasBackdrop: false,
684
+ scrollStrategy: this.overlay.scrollStrategies.noop(),
685
+ positionStrategy: createPositionStrategy(this.toastPosition.config)
686
+ });
687
+ }
688
+ open(toast, configuration) {
689
+ if (this._parentToast && this.options.useParent) return this._parentToast.open(toast, configuration);
690
+ const config = {
691
+ ...daffDefaultToastConfiguration,
692
+ duration: toast.actions?.length > 0 ? void 0 : 5e3,
693
+ ...configuration
694
+ };
695
+ if (this._toasts.length === 0) {
696
+ this._overlayRef = this._createOverlayRef();
697
+ this._template = this._attachToastTemplate(this._overlayRef);
698
+ }
699
+ const dismissEvent = new EventEmitter();
700
+ const _toastPlus = {
701
+ dismissible: true,
702
+ ...toast,
703
+ dismiss: () => {
704
+ dismissEvent.emit();
705
+ },
706
+ dismissalStream: merge(config.duration ? of(void 0).pipe(delay(config.duration)) : EMPTY, dismissEvent).pipe(take(1))
707
+ };
708
+ _toastPlus.dismissalStream.subscribe(() => {
709
+ this.close(_toastPlus);
710
+ });
711
+ this._toasts = [_toastPlus, ...this._toasts];
712
+ this._template.instance.items = this._toasts;
713
+ return _toastPlus;
714
+ }
715
+ close(toast) {
716
+ if (this._parentToast && this.options.useParent) {
717
+ this._parentToast.close(toast);
718
+ return;
719
+ }
720
+ if (daffToastChangesFocus(toast)) this.focusStack.pop();
721
+ if (this._toasts.indexOf(toast) === -1) throw new Error("The Toast that you are trying to remove does not exist.");
722
+ this._toasts = this._toasts.filter((m) => m !== toast);
723
+ this._template.instance.items = [...this._toasts];
724
+ if (this._toasts.length === 0) {
725
+ this._overlayRef.dispose();
726
+ this._template.destroy();
727
+ this._overlayRef = void 0;
728
+ this._template = void 0;
729
+ }
730
+ }
731
+ static {
732
+ this.ɵfac = i0.ɵɵngDeclareFactory({
733
+ minVersion: "12.0.0",
734
+ version: "22.2.4",
735
+ ngImport: i0,
736
+ type: DaffToastService,
737
+ deps: [
738
+ { token: i1.Overlay },
739
+ { token: DAFF_TOAST_OPTIONS },
740
+ {
741
+ token: DaffToastService,
742
+ optional: true,
743
+ skipSelf: true
744
+ },
745
+ { token: i1$2.BreakpointObserver },
746
+ { token: DaffToastPositionService },
747
+ { token: i2$1.DaffFocusStackService },
748
+ { token: i0.Injector }
749
+ ],
750
+ target: i0.ɵɵFactoryTarget.Injectable
751
+ });
752
+ }
753
+ static {
754
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
755
+ minVersion: "12.0.0",
756
+ version: "22.2.4",
757
+ ngImport: i0,
758
+ type: DaffToastService
759
+ });
760
+ }
761
+ };
762
+ i0.ɵɵngDeclareClassMetadata({
763
+ minVersion: "12.0.0",
764
+ version: "22.2.4",
765
+ ngImport: i0,
766
+ type: DaffToastService,
767
+ decorators: [{ type: Injectable }],
768
+ ctorParameters: () => [
769
+ { type: i1.Overlay },
770
+ {
771
+ type: void 0,
772
+ decorators: [{
773
+ type: Inject,
774
+ args: [DAFF_TOAST_OPTIONS]
775
+ }]
776
+ },
777
+ {
778
+ type: DaffToastService,
779
+ decorators: [{ type: Optional }, { type: SkipSelf }]
780
+ },
781
+ { type: i1$2.BreakpointObserver },
782
+ { type: DaffToastPositionService },
783
+ { type: i2$1.DaffFocusStackService },
784
+ { type: i0.Injector }
785
+ ]
786
+ });
606
787
  const provideDaffToast = (config = daffToastDefaultOptions) => [
607
- DaffToastService,
608
- DaffToastPositionService,
609
- provideDaffToastOptions(config),
788
+ DaffToastService,
789
+ DaffToastPositionService,
790
+ provideDaffToastOptions(config)
610
791
  ];
611
-
612
- /**
613
- * Generated bundle index. Do not edit.
614
- */
615
-
616
792
  export { DaffToastService, provideDaffToast };
617
- //# sourceMappingURL=daffodil-design-toast.mjs.map
793
+
794
+ //# sourceMappingURL=daffodil-design-toast.mjs.map