@daffodil/design 0.94.1 → 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,454 +1,684 @@
1
- import * as i2 from '@angular/cdk/a11y';
2
- import * as i1 from '@angular/cdk/overlay';
3
- import { GlobalPositionStrategy, OverlayModule } from '@angular/cdk/overlay';
4
- import * as i4 from '@angular/cdk/portal';
5
- import { ComponentPortal, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
6
- import * as i0 from '@angular/core';
7
- import { Injector, Injectable, signal, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, Optional, Directive, Input, NgModule } from '@angular/core';
8
- import { Subject } from 'rxjs';
9
- import { take, delay } from 'rxjs/operators';
10
- import * as i3 from '@daffodil/design';
11
- import { daffFocusableElementsSelector, DaffOpenableDirective } from '@daffodil/design';
12
- import { CommonModule } from '@angular/common';
13
- import { FaIconComponent, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
14
- import { DaffIconButtonComponent, DaffButtonModule } from '@daffodil/design/button';
15
- import { faXmark } from '@fortawesome/free-solid-svg-icons';
16
-
17
- class DaffModalService {
18
- constructor(overlay) {
19
- this.overlay = overlay;
20
- this._modals = new Map();
21
- this.defaultConfiguration = {};
22
- }
23
- _attachModal(overlayRef) {
24
- const modal = overlayRef.attach(new ComponentPortal(DaffModalComponent, undefined, Injector.create({
25
- providers: [{
26
- provide: DaffModalService,
27
- useValue: this,
28
- }],
29
- })));
30
- modal.instance.reveal();
31
- return modal;
32
- }
33
- _attachModalContent(component, modal) {
34
- return modal.instance.attachContent(new ComponentPortal(component));
35
- }
36
- _createPositionStrategy(position) {
37
- // Horizontal position is always center
38
- const strategy = new GlobalPositionStrategy().centerHorizontally();
39
- // Handle vertical positioning
40
- if (position?.vertical === 'top') {
41
- strategy.top(position.offsetTop ?? '15vh');
42
- }
43
- else {
44
- // Default to center
45
- strategy.centerVertically();
46
- }
47
- return strategy;
48
- }
49
- _createOverlayRef(config) {
50
- const positionStrategy = this._createPositionStrategy(config?.position);
51
- return this.overlay.create({
52
- hasBackdrop: true,
53
- positionStrategy,
54
- scrollStrategy: this.overlay.scrollStrategies.block(),
55
- });
56
- }
57
- _removeModal(modal) {
58
- if (!this._modals.has(modal.modal.instance)) {
59
- throw new Error('The Modal that you are trying to remove does not exist.');
60
- }
61
- this._modals.delete(modal.modal.instance);
62
- modal.overlay.dispose();
63
- }
64
- _closeAllModals() {
65
- const modals = Array.from(this._modals.values());
66
- modals.forEach((modal) => this.close(modal.modal.instance));
67
- }
68
- open(component, configuration) {
69
- this._closeAllModals();
70
- const config = { ...this.defaultConfiguration, ...configuration };
71
- const _ref = this._createOverlayRef(config);
72
- const _modal = this._attachModal(_ref);
73
- const _contentRef = this._attachModalContent(component, _modal);
74
- if (configuration?.ariaLabelledBy) {
75
- _modal.instance.ariaLabelledBy = configuration.ariaLabelledBy;
76
- }
77
- const modal = {
78
- modal: _modal,
79
- overlay: _ref,
80
- };
81
- this._modals.set(modal.modal.instance, modal);
82
- _ref
83
- .backdropClick()
84
- .subscribe(() => config.onBackdropClicked
85
- ? config.onBackdropClicked()
86
- : this.close(modal.modal.instance));
87
- return {
88
- instance: _contentRef.instance,
89
- close: () => this.close(modal.modal.instance),
90
- afterClosed: modal.modal.instance.closedAnimationCompleted$,
91
- };
92
- }
93
- close(component) {
94
- const modal = this._modals.get(component);
95
- modal.overlay.detachBackdrop();
96
- component.closedAnimationCompleted$.pipe(take(1)).subscribe(() => this._removeModal(modal));
97
- component.hide();
98
- }
99
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
100
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalService }); }
101
- }
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalService, decorators: [{
103
- type: Injectable
104
- }], ctorParameters: () => [{ type: i1.Overlay }] });
105
-
106
- /* eslint-disable quote-props */
107
- class DaffModalComponent {
108
- /**
109
- * @docs-private
110
- *
111
- * By default, the `aria-labelledby` of the modal is set to the `id` of the modal title.
112
- */
113
- get ariaLabelledBy() {
114
- return this._ariaLabelledBy;
115
- }
116
- set ariaLabelledBy(value) {
117
- this._ariaLabelledBy = value;
118
- }
119
- /**
120
- * @docs-private
121
- */
122
- onEscape() {
123
- this.modalService.close(this);
124
- }
125
- constructor(modalService, _focusTrapFactory, elementRef, openDirective, _focusStack, changeDetector) {
126
- this.modalService = modalService;
127
- this._focusTrapFactory = _focusTrapFactory;
128
- this.elementRef = elementRef;
129
- this.openDirective = openDirective;
130
- this._focusStack = _focusStack;
131
- this.changeDetector = changeDetector;
132
- /**
133
- * @docs-private
134
- */
135
- this.closing = signal(false, ...(ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []));
136
- this._ariaLabelledBy = null;
137
- /**
138
- * Private subject for closed animation completion events.
139
- */
140
- this._closedAnimationCompleted = new Subject();
141
- /**
142
- * Observable that emits when the close animation is completed.
143
- */
144
- this.closedAnimationCompleted$ = this._closedAnimationCompleted.asObservable().pipe(delay(300));
145
- this.openDirective.stateless = false;
146
- }
147
- /**
148
- * @docs-private
149
- */
150
- ngAfterContentInit() {
151
- this._focusTrap = this._focusTrapFactory.create(this.elementRef.nativeElement);
152
- this._focusStack.push();
153
- }
154
- /**
155
- * @docs-private
156
- */
157
- ngAfterViewInit() {
158
- const focusableChild = this.elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
159
- if (focusableChild) {
160
- focusableChild.focus();
161
- }
162
- else {
163
- // There's a timing condition when computing HostBindings afterContentInit
164
- // so to allow the modal to be focused, we manually set the tabindex.
165
- this.elementRef.nativeElement.tabIndex = 0;
166
- this.elementRef.nativeElement.focus();
167
- }
168
- }
169
- /**
170
- * @docs-private
171
- *
172
- * Helper method to attach portable content to modal.
173
- */
174
- attachContent(portal) {
175
- const attachContent = this._portalOutlet.attachComponentPortal(portal);
176
- return attachContent;
177
- }
178
- /**
179
- * Tracks the open state of the modal.
180
- */
181
- get open() {
182
- return this.openDirective.open;
183
- }
184
- /**
185
- * @docs-private
186
- *
187
- * Reveals the modal.
188
- */
189
- reveal() {
190
- this.openDirective.reveal();
191
- this.changeDetector.markForCheck();
192
- }
193
- /**
194
- * @docs-private
195
- *
196
- * Hides the modal.
197
- */
198
- hide() {
199
- this.openDirective.hide();
200
- this.closing.set(true);
201
- this._closedAnimationCompleted.next(true);
202
- this._focusTrap?.destroy();
203
- this._focusStack.pop();
204
- this.changeDetector.markForCheck();
205
- }
206
- /**
207
- * @docs-private
208
- *
209
- * Toggles the visibility of the modal.
210
- */
211
- toggle() {
212
- this.openDirective.toggle();
213
- this.changeDetector.markForCheck();
214
- }
215
- /**
216
- * @docs-private
217
- */
218
- ngOnDestroy() {
219
- this._closedAnimationCompleted.complete();
220
- }
221
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalComponent, deps: [{ token: DaffModalService }, { token: i2.ConfigurableFocusTrapFactory }, { token: i0.ElementRef }, { token: i3.DaffOpenableDirective }, { token: i3.DaffFocusStackService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
222
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffModalComponent, isStandalone: true, selector: "daff-modal", host: { attributes: { "role": "dialog", "aria-modal": "true" }, listeners: { "keydown.escape": "onEscape()" }, properties: { "attr.aria-labelledby": "ariaLabelledBy", "animate.enter": "\"opening\"", "class.closing": "closing()" }, classAttribute: "daff-modal" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], hostDirectives: [{ directive: i3.DaffOpenableDirective, outputs: ["toggled", "toggled"] }], ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: [".daff-modal{display:flex;flex-direction:column;justify-content:space-between;border-radius:.25rem;max-height:90vh;max-width:90vw;overflow:hidden;z-index:3}.daff-modal.opening{animation:opening .3s}@keyframes opening{0%{opacity:0}to{opacity:1}}.daff-modal.closing{opacity:0;animation:closing .3s}@keyframes closing{0%{opacity:1}to{opacity:0}}@media screen and (prefers-reduced-motion:reduce){.daff-modal.opening,.daff-modal.closing{animation:none}}@media(min-width:480px){.daff-modal{max-height:80vh;max-width:80vw}}.daff-modal>*{display:inherit;flex-direction:inherit;justify-content:inherit;border-radius:inherit;max-height:inherit;max-width:inherit;overflow:inherit;z-index:inherit}@media(min-width:480px){.daff-modal>*{max-height:inherit;max-width:inherit}}.daff-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1.5rem;position:relative}.daff-modal-header .daff-modal-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.25rem;font-weight:500;line-height:1.5rem;margin:0;padding:0 2rem 0 0}.daff-modal-header__dismiss-button{position:absolute;right:7px;top:12px}.daff-modal-content{display:block;flex-grow:1;max-height:60vh;overflow-y:auto;padding:1.5rem}.daff-modal-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;padding:1.5rem}.daff-modal-content+.daff-modal-actions{padding:0 1.5rem 1.5rem}.daff-modal-header+.daff-modal-content{padding-top:0}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: OverlayModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
223
- }
224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalComponent, decorators: [{
225
- type: Component,
226
- args: [{ selector: 'daff-modal', hostDirectives: [{
227
- directive: DaffOpenableDirective,
228
- outputs: ['toggled'],
229
- }], host: {
230
- 'class': 'daff-modal',
231
- 'role': 'dialog',
232
- 'aria-modal': 'true',
233
- '[attr.aria-labelledby]': 'ariaLabelledBy',
234
- '(keydown.escape)': 'onEscape()',
235
- '[animate.enter]': '"opening"',
236
- '[class.closing]': 'closing()',
237
- }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
238
- PortalModule,
239
- OverlayModule,
240
- ], template: "<ng-template cdkPortalOutlet></ng-template>\n", styles: [".daff-modal{display:flex;flex-direction:column;justify-content:space-between;border-radius:.25rem;max-height:90vh;max-width:90vw;overflow:hidden;z-index:3}.daff-modal.opening{animation:opening .3s}@keyframes opening{0%{opacity:0}to{opacity:1}}.daff-modal.closing{opacity:0;animation:closing .3s}@keyframes closing{0%{opacity:1}to{opacity:0}}@media screen and (prefers-reduced-motion:reduce){.daff-modal.opening,.daff-modal.closing{animation:none}}@media(min-width:480px){.daff-modal{max-height:80vh;max-width:80vw}}.daff-modal>*{display:inherit;flex-direction:inherit;justify-content:inherit;border-radius:inherit;max-height:inherit;max-width:inherit;overflow:inherit;z-index:inherit}@media(min-width:480px){.daff-modal>*{max-height:inherit;max-width:inherit}}.daff-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1.5rem;position:relative}.daff-modal-header .daff-modal-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.25rem;font-weight:500;line-height:1.5rem;margin:0;padding:0 2rem 0 0}.daff-modal-header__dismiss-button{position:absolute;right:7px;top:12px}.daff-modal-content{display:block;flex-grow:1;max-height:60vh;overflow-y:auto;padding:1.5rem}.daff-modal-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;padding:1.5rem}.daff-modal-content+.daff-modal-actions{padding:0 1.5rem 1.5rem}.daff-modal-header+.daff-modal-content{padding-top:0}\n"] }]
241
- }], ctorParameters: () => [{ type: DaffModalService }, { type: i2.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: i3.DaffOpenableDirective }, { type: i3.DaffFocusStackService }, { type: i0.ChangeDetectorRef }], propDecorators: { _portalOutlet: [{
242
- type: ViewChild,
243
- args: [CdkPortalOutlet, { static: true }]
244
- }] } });
245
-
246
- /* eslint-disable quote-props */
247
- class DaffModalActionsComponent {
248
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
249
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffModalActionsComponent, isStandalone: true, selector: "daff-modal-actions", host: { classAttribute: "daff-modal-actions" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
250
- }
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalActionsComponent, decorators: [{
252
- type: Component,
253
- args: [{
254
- selector: 'daff-modal-actions',
255
- template: '<ng-content></ng-content>',
256
- changeDetection: ChangeDetectionStrategy.OnPush,
257
- host: {
258
- 'class': 'daff-modal-actions',
259
- },
260
- }]
261
- }] });
262
-
263
- /* eslint-disable quote-props */
264
- /**
265
- * The DaffModalCloseDirective is a helper directive that passes a click
266
- * event to the button it's used with to close a modal. It needs to be
267
- * implemented with the `<button>` HTML element to work. This helps to
268
- * reduce code duplication.
269
- */
270
- class DaffModalCloseDirective {
271
- constructor(modalService, modal) {
272
- this.modalService = modalService;
273
- this.modal = modal;
274
- }
275
- /**
276
- * @docs-private
277
- */
278
- onClick(event) {
279
- if (this.modal) {
280
- this.modalService.close(this.modal);
281
- }
282
- }
283
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalCloseDirective, deps: [{ token: DaffModalService }, { token: DaffModalComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
284
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffModalCloseDirective, isStandalone: true, selector: "button[daffModalClose]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
285
- }
286
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalCloseDirective, decorators: [{
287
- type: Directive,
288
- args: [{
289
- selector: 'button[daffModalClose]',
290
- host: {
291
- 'type': 'button',
292
- '(click)': 'onClick($event)',
293
- },
294
- }]
295
- }], ctorParameters: () => [{ type: DaffModalService }, { type: DaffModalComponent, decorators: [{
296
- type: Optional
297
- }] }] });
298
-
299
- /* eslint-disable quote-props */
300
- class DaffModalContentComponent {
301
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
302
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffModalContentComponent, isStandalone: true, selector: "daff-modal-content", host: { classAttribute: "daff-modal-content" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
303
- }
304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalContentComponent, decorators: [{
305
- type: Component,
306
- args: [{
307
- selector: 'daff-modal-content',
308
- template: '<ng-content></ng-content>',
309
- changeDetection: ChangeDetectionStrategy.OnPush,
310
- host: {
311
- 'class': 'daff-modal-content',
312
- },
313
- }]
314
- }] });
315
-
316
- /* eslint-disable quote-props */
317
- class DaffModalHeaderComponent {
318
- constructor() {
319
- this.faXmark = faXmark;
320
- /**
321
- * Whether or not a modal is dismissible.
322
- */
323
- this.dismissible = true;
324
- }
325
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
326
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffModalHeaderComponent, isStandalone: true, selector: "daff-modal-header", inputs: { dismissible: "dismissible" }, host: { classAttribute: "daff-modal-header" }, ngImport: i0, template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n@if (dismissible) {\n\t<button daff-icon-button color=\"theme-contrast\"\n\t\tdaffModalClose\n\t\tclass=\"daff-modal-header__dismiss-button\"\n\t\taria-label=\"Close modal\">\n\t\t\t<fa-icon [icon]=\"faXmark\" size=\"lg\"></fa-icon>\n\t</button>\n}", dependencies: [{ kind: "component", type: DaffIconButtonComponent, selector: "button[daff-icon-button],a[daff-icon-button]" }, { 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: DaffModalCloseDirective, selector: "button[daffModalClose]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
327
- }
328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalHeaderComponent, decorators: [{
329
- type: Component,
330
- args: [{ selector: 'daff-modal-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
331
- 'class': 'daff-modal-header',
332
- }, imports: [
333
- DaffIconButtonComponent,
334
- FaIconComponent,
335
- DaffModalCloseDirective,
336
- ], template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n@if (dismissible) {\n\t<button daff-icon-button color=\"theme-contrast\"\n\t\tdaffModalClose\n\t\tclass=\"daff-modal-header__dismiss-button\"\n\t\taria-label=\"Close modal\">\n\t\t\t<fa-icon [icon]=\"faXmark\" size=\"lg\"></fa-icon>\n\t</button>\n}" }]
337
- }], propDecorators: { dismissible: [{
338
- type: Input
339
- }] } });
340
-
1
+ import * as i2 from "@angular/cdk/a11y";
2
+ import * as i1 from "@angular/cdk/overlay";
3
+ import { GlobalPositionStrategy, OverlayModule } from "@angular/cdk/overlay";
4
+ import * as i4 from "@angular/cdk/portal";
5
+ import { CdkPortalOutlet, ComponentPortal, PortalModule } from "@angular/cdk/portal";
6
+ import * as i0 from "@angular/core";
7
+ import { ChangeDetectionStrategy, Component, Directive, Injectable, Injector, Input, NgModule, Optional, ViewChild, ViewEncapsulation, signal } from "@angular/core";
8
+ import { Subject } from "rxjs";
9
+ import { delay, take } from "rxjs/operators";
10
+ import * as i3 from "@daffodil/design";
11
+ import { DaffOpenableDirective, daffFocusableElementsSelector } from "@daffodil/design";
12
+ import { CommonModule } from "@angular/common";
13
+ import { FaIconComponent, FontAwesomeModule } from "@fortawesome/angular-fontawesome";
14
+ import { DaffButtonModule, DaffIconButtonComponent } from "@daffodil/design/button";
15
+ import { faXmark } from "@fortawesome/free-solid-svg-icons";
16
+ var DaffModalService = class DaffModalService {
17
+ constructor(overlay) {
18
+ this.overlay = overlay;
19
+ this._modals = /* @__PURE__ */ new Map();
20
+ this.defaultConfiguration = {};
21
+ }
22
+ _attachModal(overlayRef) {
23
+ const modal = overlayRef.attach(new ComponentPortal(DaffModalComponent, void 0, Injector.create({ providers: [{
24
+ provide: DaffModalService,
25
+ useValue: this
26
+ }] })));
27
+ modal.instance.reveal();
28
+ return modal;
29
+ }
30
+ _attachModalContent(component, modal) {
31
+ return modal.instance.attachContent(new ComponentPortal(component));
32
+ }
33
+ _createPositionStrategy(position) {
34
+ const strategy = new GlobalPositionStrategy().centerHorizontally();
35
+ if (position?.vertical === "top") strategy.top(position.offsetTop ?? "15vh");
36
+ else strategy.centerVertically();
37
+ return strategy;
38
+ }
39
+ _createOverlayRef(config) {
40
+ const positionStrategy = this._createPositionStrategy(config?.position);
41
+ return this.overlay.create({
42
+ hasBackdrop: true,
43
+ positionStrategy,
44
+ scrollStrategy: this.overlay.scrollStrategies.block()
45
+ });
46
+ }
47
+ _removeModal(modal) {
48
+ if (!this._modals.has(modal.modal.instance)) throw new Error("The Modal that you are trying to remove does not exist.");
49
+ this._modals.delete(modal.modal.instance);
50
+ modal.overlay.dispose();
51
+ }
52
+ _closeAllModals() {
53
+ Array.from(this._modals.values()).forEach((modal) => this.close(modal.modal.instance));
54
+ }
55
+ open(component, configuration) {
56
+ this._closeAllModals();
57
+ const config = {
58
+ ...this.defaultConfiguration,
59
+ ...configuration
60
+ };
61
+ const _ref = this._createOverlayRef(config);
62
+ const _modal = this._attachModal(_ref);
63
+ const _contentRef = this._attachModalContent(component, _modal);
64
+ if (configuration?.ariaLabelledBy) _modal.instance.ariaLabelledBy = configuration.ariaLabelledBy;
65
+ const modal = {
66
+ modal: _modal,
67
+ overlay: _ref
68
+ };
69
+ this._modals.set(modal.modal.instance, modal);
70
+ _ref.backdropClick().subscribe(() => config.onBackdropClicked ? config.onBackdropClicked() : this.close(modal.modal.instance));
71
+ return {
72
+ instance: _contentRef.instance,
73
+ close: () => this.close(modal.modal.instance),
74
+ afterClosed: modal.modal.instance.closedAnimationCompleted$
75
+ };
76
+ }
77
+ close(component) {
78
+ const modal = this._modals.get(component);
79
+ modal.overlay.detachBackdrop();
80
+ component.closedAnimationCompleted$.pipe(take(1)).subscribe(() => this._removeModal(modal));
81
+ component.hide();
82
+ }
83
+ static {
84
+ this.ɵfac = i0.ɵɵngDeclareFactory({
85
+ minVersion: "12.0.0",
86
+ version: "22.2.4",
87
+ ngImport: i0,
88
+ type: DaffModalService,
89
+ deps: [{ token: i1.Overlay }],
90
+ target: i0.ɵɵFactoryTarget.Injectable
91
+ });
92
+ }
93
+ static {
94
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
95
+ minVersion: "12.0.0",
96
+ version: "22.2.4",
97
+ ngImport: i0,
98
+ type: DaffModalService
99
+ });
100
+ }
101
+ };
102
+ i0.ɵɵngDeclareClassMetadata({
103
+ minVersion: "12.0.0",
104
+ version: "22.2.4",
105
+ ngImport: i0,
106
+ type: DaffModalService,
107
+ decorators: [{ type: Injectable }],
108
+ ctorParameters: () => [{ type: i1.Overlay }]
109
+ });
110
+ var DaffModalComponent = class DaffModalComponent {
111
+ get ariaLabelledBy() {
112
+ return this._ariaLabelledBy;
113
+ }
114
+ set ariaLabelledBy(value) {
115
+ this._ariaLabelledBy = value;
116
+ }
117
+ onEscape() {
118
+ this.modalService.close(this);
119
+ }
120
+ constructor(modalService, _focusTrapFactory, elementRef, openDirective, _focusStack, changeDetector) {
121
+ this.modalService = modalService;
122
+ this._focusTrapFactory = _focusTrapFactory;
123
+ this.elementRef = elementRef;
124
+ this.openDirective = openDirective;
125
+ this._focusStack = _focusStack;
126
+ this.changeDetector = changeDetector;
127
+ this.closing = signal(false, ...ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []);
128
+ this._ariaLabelledBy = null;
129
+ this._closedAnimationCompleted = new Subject();
130
+ this.closedAnimationCompleted$ = this._closedAnimationCompleted.asObservable().pipe(delay(300));
131
+ this.openDirective.stateless = false;
132
+ }
133
+ ngAfterContentInit() {
134
+ this._focusTrap = this._focusTrapFactory.create(this.elementRef.nativeElement);
135
+ this._focusStack.push();
136
+ }
137
+ ngAfterViewInit() {
138
+ const focusableChild = this.elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
139
+ if (focusableChild) focusableChild.focus();
140
+ else {
141
+ this.elementRef.nativeElement.tabIndex = 0;
142
+ this.elementRef.nativeElement.focus();
143
+ }
144
+ }
145
+ attachContent(portal) {
146
+ return this._portalOutlet.attachComponentPortal(portal);
147
+ }
148
+ get open() {
149
+ return this.openDirective.open;
150
+ }
151
+ reveal() {
152
+ this.openDirective.reveal();
153
+ this.changeDetector.markForCheck();
154
+ }
155
+ hide() {
156
+ this.openDirective.hide();
157
+ this.closing.set(true);
158
+ this._closedAnimationCompleted.next(true);
159
+ this._focusTrap?.destroy();
160
+ this._focusStack.pop();
161
+ this.changeDetector.markForCheck();
162
+ }
163
+ toggle() {
164
+ this.openDirective.toggle();
165
+ this.changeDetector.markForCheck();
166
+ }
167
+ ngOnDestroy() {
168
+ this._closedAnimationCompleted.complete();
169
+ }
170
+ static {
171
+ this.ɵfac = i0.ɵɵngDeclareFactory({
172
+ minVersion: "12.0.0",
173
+ version: "22.2.4",
174
+ ngImport: i0,
175
+ type: DaffModalComponent,
176
+ deps: [
177
+ { token: DaffModalService },
178
+ { token: i2.ConfigurableFocusTrapFactory },
179
+ { token: i0.ElementRef },
180
+ { token: i3.DaffOpenableDirective },
181
+ { token: i3.DaffFocusStackService },
182
+ { token: i0.ChangeDetectorRef }
183
+ ],
184
+ target: i0.ɵɵFactoryTarget.Component
185
+ });
186
+ }
187
+ static {
188
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
189
+ minVersion: "14.0.0",
190
+ version: "22.2.4",
191
+ type: DaffModalComponent,
192
+ isStandalone: true,
193
+ selector: "daff-modal",
194
+ host: {
195
+ attributes: {
196
+ "role": "dialog",
197
+ "aria-modal": "true"
198
+ },
199
+ listeners: { "keydown.escape": "onEscape()" },
200
+ properties: {
201
+ "attr.aria-labelledby": "ariaLabelledBy",
202
+ "animate.enter": "\"opening\"",
203
+ "class.closing": "closing()"
204
+ },
205
+ classAttribute: "daff-modal"
206
+ },
207
+ viewQueries: [{
208
+ propertyName: "_portalOutlet",
209
+ first: true,
210
+ predicate: CdkPortalOutlet,
211
+ descendants: true,
212
+ static: true
213
+ }],
214
+ hostDirectives: [{
215
+ directive: i3.DaffOpenableDirective,
216
+ outputs: ["toggled", "toggled"]
217
+ }],
218
+ ngImport: i0,
219
+ template: "<ng-template cdkPortalOutlet></ng-template>\n",
220
+ styles: [".daff-modal{display:flex;flex-direction:column;justify-content:space-between;border-radius:.25rem;max-height:90vh;max-width:90vw;overflow:hidden;z-index:3}.daff-modal.opening{animation:opening .3s}@keyframes opening{0%{opacity:0}to{opacity:1}}.daff-modal.closing{opacity:0;animation:closing .3s}@keyframes closing{0%{opacity:1}to{opacity:0}}@media screen and (prefers-reduced-motion:reduce){.daff-modal.opening,.daff-modal.closing{animation:none}}@media(min-width:480px){.daff-modal{max-height:80vh;max-width:80vw}}.daff-modal>*{display:inherit;flex-direction:inherit;justify-content:inherit;border-radius:inherit;max-height:inherit;max-width:inherit;overflow:inherit;z-index:inherit}@media(min-width:480px){.daff-modal>*{max-height:inherit;max-width:inherit}}.daff-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1.5rem;position:relative}.daff-modal-header .daff-modal-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.25rem;font-weight:500;line-height:1.5rem;margin:0;padding:0 2rem 0 0}.daff-modal-header__dismiss-button{position:absolute;right:.5rem;top:.75rem}.daff-modal-content{display:block;flex-grow:1;max-height:60vh;overflow-y:auto;padding:1.5rem}.daff-modal-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;padding:1.5rem}.daff-modal-content+.daff-modal-actions{padding:0 1.5rem 1.5rem}.daff-modal-header+.daff-modal-content{padding-top:0}\n"],
221
+ dependencies: [
222
+ {
223
+ kind: "ngmodule",
224
+ type: PortalModule
225
+ },
226
+ {
227
+ kind: "directive",
228
+ type: i4.CdkPortalOutlet,
229
+ selector: "[cdkPortalOutlet]",
230
+ inputs: ["cdkPortalOutlet"],
231
+ outputs: ["attached"],
232
+ exportAs: ["cdkPortalOutlet"]
233
+ },
234
+ {
235
+ kind: "ngmodule",
236
+ type: OverlayModule
237
+ }
238
+ ],
239
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
240
+ encapsulation: i0.ViewEncapsulation.None
241
+ });
242
+ }
243
+ };
244
+ i0.ɵɵngDeclareClassMetadata({
245
+ minVersion: "12.0.0",
246
+ version: "22.2.4",
247
+ ngImport: i0,
248
+ type: DaffModalComponent,
249
+ decorators: [{
250
+ type: Component,
251
+ args: [{
252
+ selector: "daff-modal",
253
+ hostDirectives: [{
254
+ directive: DaffOpenableDirective,
255
+ outputs: ["toggled"]
256
+ }],
257
+ host: {
258
+ "class": "daff-modal",
259
+ "role": "dialog",
260
+ "aria-modal": "true",
261
+ "[attr.aria-labelledby]": "ariaLabelledBy",
262
+ "(keydown.escape)": "onEscape()",
263
+ "[animate.enter]": "\"opening\"",
264
+ "[class.closing]": "closing()"
265
+ },
266
+ changeDetection: ChangeDetectionStrategy.OnPush,
267
+ encapsulation: ViewEncapsulation.None,
268
+ imports: [PortalModule, OverlayModule],
269
+ template: "<ng-template cdkPortalOutlet></ng-template>\n",
270
+ styles: [".daff-modal{display:flex;flex-direction:column;justify-content:space-between;border-radius:.25rem;max-height:90vh;max-width:90vw;overflow:hidden;z-index:3}.daff-modal.opening{animation:opening .3s}@keyframes opening{0%{opacity:0}to{opacity:1}}.daff-modal.closing{opacity:0;animation:closing .3s}@keyframes closing{0%{opacity:1}to{opacity:0}}@media screen and (prefers-reduced-motion:reduce){.daff-modal.opening,.daff-modal.closing{animation:none}}@media(min-width:480px){.daff-modal{max-height:80vh;max-width:80vw}}.daff-modal>*{display:inherit;flex-direction:inherit;justify-content:inherit;border-radius:inherit;max-height:inherit;max-width:inherit;overflow:inherit;z-index:inherit}@media(min-width:480px){.daff-modal>*{max-height:inherit;max-width:inherit}}.daff-modal-header{display:flex;align-items:center;justify-content:space-between;padding:1.5rem;position:relative}.daff-modal-header .daff-modal-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.25rem;font-weight:500;line-height:1.5rem;margin:0;padding:0 2rem 0 0}.daff-modal-header__dismiss-button{position:absolute;right:.5rem;top:.75rem}.daff-modal-content{display:block;flex-grow:1;max-height:60vh;overflow-y:auto;padding:1.5rem}.daff-modal-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;padding:1.5rem}.daff-modal-content+.daff-modal-actions{padding:0 1.5rem 1.5rem}.daff-modal-header+.daff-modal-content{padding-top:0}\n"]
271
+ }]
272
+ }],
273
+ ctorParameters: () => [
274
+ { type: DaffModalService },
275
+ { type: i2.ConfigurableFocusTrapFactory },
276
+ { type: i0.ElementRef },
277
+ { type: i3.DaffOpenableDirective },
278
+ { type: i3.DaffFocusStackService },
279
+ { type: i0.ChangeDetectorRef }
280
+ ],
281
+ propDecorators: { _portalOutlet: [{
282
+ type: ViewChild,
283
+ args: [CdkPortalOutlet, { static: true }]
284
+ }] }
285
+ });
286
+ var DaffModalActionsComponent = class DaffModalActionsComponent {
287
+ static {
288
+ this.ɵfac = i0.ɵɵngDeclareFactory({
289
+ minVersion: "12.0.0",
290
+ version: "22.2.4",
291
+ ngImport: i0,
292
+ type: DaffModalActionsComponent,
293
+ deps: [],
294
+ target: i0.ɵɵFactoryTarget.Component
295
+ });
296
+ }
297
+ static {
298
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
299
+ minVersion: "14.0.0",
300
+ version: "22.2.4",
301
+ type: DaffModalActionsComponent,
302
+ isStandalone: true,
303
+ selector: "daff-modal-actions",
304
+ host: { classAttribute: "daff-modal-actions" },
305
+ ngImport: i0,
306
+ template: "<ng-content></ng-content>",
307
+ isInline: true,
308
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
309
+ });
310
+ }
311
+ };
312
+ i0.ɵɵngDeclareClassMetadata({
313
+ minVersion: "12.0.0",
314
+ version: "22.2.4",
315
+ ngImport: i0,
316
+ type: DaffModalActionsComponent,
317
+ decorators: [{
318
+ type: Component,
319
+ args: [{
320
+ selector: "daff-modal-actions",
321
+ template: "<ng-content></ng-content>",
322
+ changeDetection: ChangeDetectionStrategy.OnPush,
323
+ host: { "class": "daff-modal-actions" }
324
+ }]
325
+ }]
326
+ });
327
+ var DaffModalCloseDirective = class DaffModalCloseDirective {
328
+ constructor(modalService, modal) {
329
+ this.modalService = modalService;
330
+ this.modal = modal;
331
+ }
332
+ onClick(event) {
333
+ if (this.modal) this.modalService.close(this.modal);
334
+ }
335
+ static {
336
+ this.ɵfac = i0.ɵɵngDeclareFactory({
337
+ minVersion: "12.0.0",
338
+ version: "22.2.4",
339
+ ngImport: i0,
340
+ type: DaffModalCloseDirective,
341
+ deps: [{ token: DaffModalService }, {
342
+ token: DaffModalComponent,
343
+ optional: true
344
+ }],
345
+ target: i0.ɵɵFactoryTarget.Directive
346
+ });
347
+ }
348
+ static {
349
+ this.ɵdir = i0.ɵɵngDeclareDirective({
350
+ minVersion: "14.0.0",
351
+ version: "22.2.4",
352
+ type: DaffModalCloseDirective,
353
+ isStandalone: true,
354
+ selector: "button[daffModalClose]",
355
+ host: {
356
+ attributes: { "type": "button" },
357
+ listeners: { "click": "onClick($event)" }
358
+ },
359
+ ngImport: i0
360
+ });
361
+ }
362
+ };
363
+ i0.ɵɵngDeclareClassMetadata({
364
+ minVersion: "12.0.0",
365
+ version: "22.2.4",
366
+ ngImport: i0,
367
+ type: DaffModalCloseDirective,
368
+ decorators: [{
369
+ type: Directive,
370
+ args: [{
371
+ selector: "button[daffModalClose]",
372
+ host: {
373
+ "type": "button",
374
+ "(click)": "onClick($event)"
375
+ }
376
+ }]
377
+ }],
378
+ ctorParameters: () => [{ type: DaffModalService }, {
379
+ type: DaffModalComponent,
380
+ decorators: [{ type: Optional }]
381
+ }]
382
+ });
383
+ var DaffModalContentComponent = class DaffModalContentComponent {
384
+ static {
385
+ this.ɵfac = i0.ɵɵngDeclareFactory({
386
+ minVersion: "12.0.0",
387
+ version: "22.2.4",
388
+ ngImport: i0,
389
+ type: DaffModalContentComponent,
390
+ deps: [],
391
+ target: i0.ɵɵFactoryTarget.Component
392
+ });
393
+ }
394
+ static {
395
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
396
+ minVersion: "14.0.0",
397
+ version: "22.2.4",
398
+ type: DaffModalContentComponent,
399
+ isStandalone: true,
400
+ selector: "daff-modal-content",
401
+ host: { classAttribute: "daff-modal-content" },
402
+ ngImport: i0,
403
+ template: "<ng-content></ng-content>",
404
+ isInline: true,
405
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
406
+ });
407
+ }
408
+ };
409
+ i0.ɵɵngDeclareClassMetadata({
410
+ minVersion: "12.0.0",
411
+ version: "22.2.4",
412
+ ngImport: i0,
413
+ type: DaffModalContentComponent,
414
+ decorators: [{
415
+ type: Component,
416
+ args: [{
417
+ selector: "daff-modal-content",
418
+ template: "<ng-content></ng-content>",
419
+ changeDetection: ChangeDetectionStrategy.OnPush,
420
+ host: { "class": "daff-modal-content" }
421
+ }]
422
+ }]
423
+ });
424
+ var DaffModalHeaderComponent = class DaffModalHeaderComponent {
425
+ constructor() {
426
+ this.faXmark = faXmark;
427
+ this.dismissible = true;
428
+ }
429
+ static {
430
+ this.ɵfac = i0.ɵɵngDeclareFactory({
431
+ minVersion: "12.0.0",
432
+ version: "22.2.4",
433
+ ngImport: i0,
434
+ type: DaffModalHeaderComponent,
435
+ deps: [],
436
+ target: i0.ɵɵFactoryTarget.Component
437
+ });
438
+ }
439
+ static {
440
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
441
+ minVersion: "17.0.0",
442
+ version: "22.2.4",
443
+ type: DaffModalHeaderComponent,
444
+ isStandalone: true,
445
+ selector: "daff-modal-header",
446
+ inputs: { dismissible: "dismissible" },
447
+ host: { classAttribute: "daff-modal-header" },
448
+ ngImport: i0,
449
+ template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n@if (dismissible) {\n <button daff-icon-button color=\"theme-contrast\"\n daffModalClose\n class=\"daff-modal-header__dismiss-button\"\n aria-label=\"Close modal\">\n <fa-icon [icon]=\"faXmark\" size=\"lg\"></fa-icon>\n </button>\n}",
450
+ dependencies: [
451
+ {
452
+ kind: "component",
453
+ type: DaffIconButtonComponent,
454
+ selector: "button[daff-icon-button],a[daff-icon-button]"
455
+ },
456
+ {
457
+ kind: "component",
458
+ type: FaIconComponent,
459
+ selector: "fa-icon",
460
+ inputs: [
461
+ "icon",
462
+ "title",
463
+ "animation",
464
+ "mask",
465
+ "flip",
466
+ "size",
467
+ "pull",
468
+ "border",
469
+ "inverse",
470
+ "symbol",
471
+ "rotate",
472
+ "fixedWidth",
473
+ "transform",
474
+ "a11yRole"
475
+ ],
476
+ outputs: [
477
+ "iconChange",
478
+ "titleChange",
479
+ "animationChange",
480
+ "maskChange",
481
+ "flipChange",
482
+ "sizeChange",
483
+ "pullChange",
484
+ "borderChange",
485
+ "inverseChange",
486
+ "symbolChange",
487
+ "rotateChange",
488
+ "fixedWidthChange",
489
+ "transformChange",
490
+ "a11yRoleChange"
491
+ ]
492
+ },
493
+ {
494
+ kind: "directive",
495
+ type: DaffModalCloseDirective,
496
+ selector: "button[daffModalClose]"
497
+ }
498
+ ],
499
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
500
+ encapsulation: i0.ViewEncapsulation.None
501
+ });
502
+ }
503
+ };
504
+ i0.ɵɵngDeclareClassMetadata({
505
+ minVersion: "12.0.0",
506
+ version: "22.2.4",
507
+ ngImport: i0,
508
+ type: DaffModalHeaderComponent,
509
+ decorators: [{
510
+ type: Component,
511
+ args: [{
512
+ selector: "daff-modal-header",
513
+ encapsulation: ViewEncapsulation.None,
514
+ changeDetection: ChangeDetectionStrategy.OnPush,
515
+ host: { "class": "daff-modal-header" },
516
+ imports: [
517
+ DaffIconButtonComponent,
518
+ FaIconComponent,
519
+ DaffModalCloseDirective
520
+ ],
521
+ template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n@if (dismissible) {\n <button daff-icon-button color=\"theme-contrast\"\n daffModalClose\n class=\"daff-modal-header__dismiss-button\"\n aria-label=\"Close modal\">\n <fa-icon [icon]=\"faXmark\" size=\"lg\"></fa-icon>\n </button>\n}"
522
+ }]
523
+ }],
524
+ propDecorators: { dismissible: [{ type: Input }] }
525
+ });
341
526
  let modalTitleId = 0;
342
- /**
343
- * Title of a modal.
344
- */
345
- class DaffModalTitleDirective {
346
- constructor(modal) {
347
- this.modal = modal;
348
- /**
349
- * @docs-private
350
- */
351
- this._id = '';
352
- modalTitleId++;
353
- this._id = 'daff-modal-title-' + modalTitleId;
354
- /**
355
- * Sets the ariaLabelledBy of the modal to the id of the modal title.
356
- */
357
- if (this.modal) {
358
- this.modal.ariaLabelledBy = this._id;
359
- }
360
- }
361
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalTitleDirective, deps: [{ token: DaffModalComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
362
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffModalTitleDirective, isStandalone: true, selector: "[daffModalTitle]", host: { properties: { "attr.id": "_id" }, classAttribute: "daff-modal-title" }, ngImport: i0 }); }
363
- }
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalTitleDirective, decorators: [{
365
- type: Directive,
366
- args: [{
367
- selector: '[daffModalTitle]',
368
- host: {
369
- class: 'daff-modal-title',
370
- '[attr.id]': '_id',
371
- },
372
- }]
373
- }], ctorParameters: () => [{ type: DaffModalComponent, decorators: [{
374
- type: Optional
375
- }] }] });
376
-
377
- /**
378
- * @deprecated in favor of {@link DAFF_MODAL_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
379
- */
380
- class DaffModalModule {
381
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
382
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffModalModule, imports: [CommonModule,
383
- PortalModule,
384
- OverlayModule,
385
- DaffButtonModule,
386
- FontAwesomeModule,
387
- DaffModalComponent,
388
- DaffModalHeaderComponent,
389
- DaffModalTitleDirective,
390
- DaffModalContentComponent,
391
- DaffModalActionsComponent,
392
- DaffModalCloseDirective], exports: [DaffModalComponent,
393
- DaffModalHeaderComponent,
394
- DaffModalTitleDirective,
395
- DaffModalContentComponent,
396
- DaffModalActionsComponent,
397
- DaffModalCloseDirective] }); }
398
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalModule, providers: [
399
- DaffModalService,
400
- ], imports: [CommonModule,
401
- PortalModule,
402
- OverlayModule,
403
- DaffButtonModule,
404
- FontAwesomeModule,
405
- DaffModalComponent,
406
- DaffModalHeaderComponent] }); }
407
- }
408
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffModalModule, decorators: [{
409
- type: NgModule,
410
- args: [{
411
- imports: [
412
- CommonModule,
413
- PortalModule,
414
- OverlayModule,
415
- DaffButtonModule,
416
- FontAwesomeModule,
417
- DaffModalComponent,
418
- DaffModalHeaderComponent,
419
- DaffModalTitleDirective,
420
- DaffModalContentComponent,
421
- DaffModalActionsComponent,
422
- DaffModalCloseDirective,
423
- ],
424
- exports: [
425
- DaffModalComponent,
426
- DaffModalHeaderComponent,
427
- DaffModalTitleDirective,
428
- DaffModalContentComponent,
429
- DaffModalActionsComponent,
430
- DaffModalCloseDirective,
431
- ],
432
- providers: [
433
- DaffModalService,
434
- ],
435
- }]
436
- }] });
437
-
438
- /**
439
- * @docs-private
440
- */
527
+ var DaffModalTitleDirective = class DaffModalTitleDirective {
528
+ constructor(modal) {
529
+ this.modal = modal;
530
+ this._id = "";
531
+ modalTitleId++;
532
+ this._id = "daff-modal-title-" + modalTitleId;
533
+ if (this.modal) this.modal.ariaLabelledBy = this._id;
534
+ }
535
+ static {
536
+ this.ɵfac = i0.ɵɵngDeclareFactory({
537
+ minVersion: "12.0.0",
538
+ version: "22.2.4",
539
+ ngImport: i0,
540
+ type: DaffModalTitleDirective,
541
+ deps: [{
542
+ token: DaffModalComponent,
543
+ optional: true
544
+ }],
545
+ target: i0.ɵɵFactoryTarget.Directive
546
+ });
547
+ }
548
+ static {
549
+ this.ɵdir = i0.ɵɵngDeclareDirective({
550
+ minVersion: "14.0.0",
551
+ version: "22.2.4",
552
+ type: DaffModalTitleDirective,
553
+ isStandalone: true,
554
+ selector: "[daffModalTitle]",
555
+ host: {
556
+ properties: { "attr.id": "_id" },
557
+ classAttribute: "daff-modal-title"
558
+ },
559
+ ngImport: i0
560
+ });
561
+ }
562
+ };
563
+ i0.ɵɵngDeclareClassMetadata({
564
+ minVersion: "12.0.0",
565
+ version: "22.2.4",
566
+ ngImport: i0,
567
+ type: DaffModalTitleDirective,
568
+ decorators: [{
569
+ type: Directive,
570
+ args: [{
571
+ selector: "[daffModalTitle]",
572
+ host: {
573
+ class: "daff-modal-title",
574
+ "[attr.id]": "_id"
575
+ }
576
+ }]
577
+ }],
578
+ ctorParameters: () => [{
579
+ type: DaffModalComponent,
580
+ decorators: [{ type: Optional }]
581
+ }]
582
+ });
583
+ var DaffModalModule = class DaffModalModule {
584
+ static {
585
+ this.ɵfac = i0.ɵɵngDeclareFactory({
586
+ minVersion: "12.0.0",
587
+ version: "22.2.4",
588
+ ngImport: i0,
589
+ type: DaffModalModule,
590
+ deps: [],
591
+ target: i0.ɵɵFactoryTarget.NgModule
592
+ });
593
+ }
594
+ static {
595
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
596
+ minVersion: "14.0.0",
597
+ version: "22.2.4",
598
+ ngImport: i0,
599
+ type: DaffModalModule,
600
+ imports: [
601
+ CommonModule,
602
+ PortalModule,
603
+ OverlayModule,
604
+ DaffButtonModule,
605
+ FontAwesomeModule,
606
+ DaffModalComponent,
607
+ DaffModalHeaderComponent,
608
+ DaffModalTitleDirective,
609
+ DaffModalContentComponent,
610
+ DaffModalActionsComponent,
611
+ DaffModalCloseDirective
612
+ ],
613
+ exports: [
614
+ DaffModalComponent,
615
+ DaffModalHeaderComponent,
616
+ DaffModalTitleDirective,
617
+ DaffModalContentComponent,
618
+ DaffModalActionsComponent,
619
+ DaffModalCloseDirective
620
+ ]
621
+ });
622
+ }
623
+ static {
624
+ this.ɵinj = i0.ɵɵngDeclareInjector({
625
+ minVersion: "12.0.0",
626
+ version: "22.2.4",
627
+ ngImport: i0,
628
+ type: DaffModalModule,
629
+ providers: [DaffModalService],
630
+ imports: [
631
+ CommonModule,
632
+ PortalModule,
633
+ OverlayModule,
634
+ DaffButtonModule,
635
+ FontAwesomeModule,
636
+ DaffModalComponent,
637
+ DaffModalHeaderComponent
638
+ ]
639
+ });
640
+ }
641
+ };
642
+ i0.ɵɵngDeclareClassMetadata({
643
+ minVersion: "12.0.0",
644
+ version: "22.2.4",
645
+ ngImport: i0,
646
+ type: DaffModalModule,
647
+ decorators: [{
648
+ type: NgModule,
649
+ args: [{
650
+ imports: [
651
+ CommonModule,
652
+ PortalModule,
653
+ OverlayModule,
654
+ DaffButtonModule,
655
+ FontAwesomeModule,
656
+ DaffModalComponent,
657
+ DaffModalHeaderComponent,
658
+ DaffModalTitleDirective,
659
+ DaffModalContentComponent,
660
+ DaffModalActionsComponent,
661
+ DaffModalCloseDirective
662
+ ],
663
+ exports: [
664
+ DaffModalComponent,
665
+ DaffModalHeaderComponent,
666
+ DaffModalTitleDirective,
667
+ DaffModalContentComponent,
668
+ DaffModalActionsComponent,
669
+ DaffModalCloseDirective
670
+ ],
671
+ providers: [DaffModalService]
672
+ }]
673
+ }]
674
+ });
441
675
  const DAFF_MODAL_COMPONENTS = [
442
- DaffModalHeaderComponent,
443
- DaffModalTitleDirective,
444
- DaffModalContentComponent,
445
- DaffModalActionsComponent,
446
- DaffModalCloseDirective,
676
+ DaffModalHeaderComponent,
677
+ DaffModalTitleDirective,
678
+ DaffModalContentComponent,
679
+ DaffModalActionsComponent,
680
+ DaffModalCloseDirective
447
681
  ];
448
-
449
- /**
450
- * Generated bundle index. Do not edit.
451
- */
452
-
453
682
  export { DAFF_MODAL_COMPONENTS, DaffModalActionsComponent, DaffModalCloseDirective, DaffModalComponent, DaffModalContentComponent, DaffModalHeaderComponent, DaffModalModule, DaffModalService, DaffModalTitleDirective };
454
- //# sourceMappingURL=daffodil-design-modal.mjs.map
683
+
684
+ //# sourceMappingURL=daffodil-design-modal.mjs.map