@daffodil/design 0.87.2 → 0.88.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/accordion/accordion/accordion-item/accordion-item.component.d.ts +1 -9
  2. package/accordion/accordion/accordion-item-title/accordion-item-title.directive.d.ts +0 -4
  3. package/article/article/article.component.d.ts +0 -8
  4. package/article/article-meta/article-meta.directive.d.ts +0 -4
  5. package/atoms/form/form-field/form-field/form-field.component.d.ts +3 -2
  6. package/atoms/form/form-field/form-field-control.d.ts +3 -1
  7. package/atoms/form/native-select/native-select.component.d.ts +11 -0
  8. package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +0 -4
  9. package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +0 -12
  10. package/button/button/basic/button.component.d.ts +0 -4
  11. package/button/button/button-base.directive.d.ts +0 -18
  12. package/button/button/flat/flat.component.d.ts +0 -4
  13. package/button/button/icon/icon.component.d.ts +0 -4
  14. package/button/button/stroked/stroked.component.d.ts +0 -4
  15. package/button/button/underline/underline.component.d.ts +0 -4
  16. package/button/src/button/button-base.scss +3 -3
  17. package/callout/README.md +38 -40
  18. package/callout/callout/callout.component.d.ts +13 -5
  19. package/callout/callout-body/callout-body.directive.d.ts +9 -4
  20. package/callout/callout-icon/callout-icon.directive.d.ts +9 -4
  21. package/callout/callout-subtitle/callout-subtitle.directive.d.ts +8 -4
  22. package/callout/callout-tagline/callout-tagline.directive.d.ts +8 -4
  23. package/callout/callout-title/callout-title.directive.d.ts +8 -4
  24. package/card/README.md +52 -44
  25. package/card/card/basic/basic.component.d.ts +18 -4
  26. package/card/card/raised/raised.component.d.ts +3 -4
  27. package/card/card/stroked/stroked.component.d.ts +18 -4
  28. package/card/card-actions/card-actions.directive.d.ts +8 -4
  29. package/card/card-base.directive.d.ts +8 -16
  30. package/card/card-content/card-content.directive.d.ts +9 -4
  31. package/card/card-icon/card-icon.directive.d.ts +8 -4
  32. package/card/card-image/card-image.directive.d.ts +8 -4
  33. package/card/card-tagline/card-tagline.directive.d.ts +8 -4
  34. package/card/card-title/card-title.directive.d.ts +8 -4
  35. package/card/card.d.ts +1 -0
  36. package/card/examples/elevated-card/elevated-card.component.d.ts +5 -0
  37. package/card/examples/public_api.d.ts +3 -3
  38. package/card/helpers/card-orientation.d.ts +17 -0
  39. package/card/public_api.d.ts +9 -8
  40. package/card/src/card-base-theme.scss +40 -58
  41. package/container/container/container.component.d.ts +0 -4
  42. package/core/public_api.d.ts +1 -0
  43. package/core/sticky/public_api.d.ts +1 -0
  44. package/core/sticky/sticky-tracker.directive.d.ts +23 -0
  45. package/fesm2022/daffodil-design-accordion.mjs +13 -55
  46. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-article.mjs +14 -32
  48. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-breadcrumb.mjs +15 -38
  50. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-button.mjs +41 -108
  52. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-callout.mjs +91 -73
  54. package/fesm2022/daffodil-design-callout.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-card-examples.mjs +17 -32
  56. package/fesm2022/daffodil-design-card-examples.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-card.mjs +167 -145
  58. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-container.mjs +7 -13
  60. package/fesm2022/daffodil-design-container.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-form-field-examples.mjs +7 -7
  62. package/fesm2022/daffodil-design-form-field-examples.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-hero-examples.mjs +18 -1
  64. package/fesm2022/daffodil-design-hero-examples.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-hero.mjs +102 -71
  66. package/fesm2022/daffodil-design-hero.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-image.mjs +5 -12
  68. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-input-examples.mjs +6 -6
  70. package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-input.mjs +60 -35
  72. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-list-examples.mjs +14 -10
  74. package/fesm2022/daffodil-design-list-examples.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-list.mjs +111 -98
  76. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  77. package/fesm2022/daffodil-design-media-gallery.mjs +7 -17
  78. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  79. package/fesm2022/daffodil-design-menu.mjs +26 -63
  80. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  81. package/fesm2022/daffodil-design-modal.mjs +63 -130
  82. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  83. package/fesm2022/daffodil-design-navbar.mjs +7 -20
  84. package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
  85. package/fesm2022/daffodil-design-notification-examples.mjs +16 -41
  86. package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
  87. package/fesm2022/daffodil-design-notification.mjs +112 -116
  88. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  89. package/fesm2022/daffodil-design-paginator.mjs +8 -21
  90. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  91. package/fesm2022/daffodil-design-progress-bar-examples.mjs +6 -6
  92. package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +1 -1
  93. package/fesm2022/daffodil-design-progress-bar.mjs +74 -115
  94. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  95. package/fesm2022/daffodil-design-quantity-field.mjs +11 -3
  96. package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
  97. package/fesm2022/daffodil-design-select-examples.mjs +4 -4
  98. package/fesm2022/daffodil-design-select-examples.mjs.map +1 -1
  99. package/fesm2022/daffodil-design-select.mjs +50 -117
  100. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  101. package/fesm2022/daffodil-design-sidebar-examples.mjs +29 -3
  102. package/fesm2022/daffodil-design-sidebar-examples.mjs.map +1 -1
  103. package/fesm2022/daffodil-design-sidebar.mjs +39 -78
  104. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  105. package/fesm2022/daffodil-design-sticky-examples.mjs +25 -0
  106. package/fesm2022/daffodil-design-sticky-examples.mjs.map +1 -0
  107. package/fesm2022/daffodil-design-tabs.mjs +54 -131
  108. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  109. package/fesm2022/daffodil-design-text-snippet.mjs +17 -8
  110. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  111. package/fesm2022/daffodil-design-textarea-examples.mjs +3 -3
  112. package/fesm2022/daffodil-design-textarea-examples.mjs.map +1 -1
  113. package/fesm2022/daffodil-design-textarea.mjs +49 -25
  114. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  115. package/fesm2022/daffodil-design-toast.mjs +42 -128
  116. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  117. package/fesm2022/daffodil-design-tree.mjs +26 -70
  118. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  119. package/fesm2022/daffodil-design.mjs +164 -17
  120. package/fesm2022/daffodil-design.mjs.map +1 -1
  121. package/hero/README.md +39 -25
  122. package/hero/examples/basic-hero/basic-hero.component.d.ts +6 -0
  123. package/hero/examples/public_api.d.ts +1 -0
  124. package/hero/hero/hero.component.d.ts +21 -4
  125. package/hero/hero-body/hero-body.directive.d.ts +10 -4
  126. package/hero/hero-icon/hero-icon.directive.d.ts +10 -4
  127. package/hero/hero-subtitle/hero-subtitle.directive.d.ts +8 -4
  128. package/hero/hero-tagline/hero-tagline.directive.d.ts +8 -4
  129. package/hero/hero-title/hero-title.directive.d.ts +8 -4
  130. package/image/image/image.component.d.ts +0 -4
  131. package/input/input.component.d.ts +29 -9
  132. package/list/README.md +43 -13
  133. package/list/examples/multiline-list/multiline-list.component.d.ts +1 -0
  134. package/list/list/list.component.d.ts +12 -24
  135. package/list/list-item/list-item.component.d.ts +13 -20
  136. package/list/list-item-title/list-item-title.directive.d.ts +13 -0
  137. package/list/list.d.ts +8 -2
  138. package/list/list.module.d.ts +4 -3
  139. package/list/nav-list/nav-list.component.d.ts +17 -0
  140. package/list/public_api.d.ts +5 -2
  141. package/list/src/list-base.scss +40 -0
  142. package/list/src/list-theme.scss +5 -0
  143. package/media-gallery/media-gallery/media-gallery.component.d.ts +0 -6
  144. package/menu/menu/menu.component.d.ts +0 -12
  145. package/menu/menu-activator/menu-activator.component.d.ts +4 -5
  146. package/menu/menu-item/menu-item.component.d.ts +0 -10
  147. package/modal/modal/modal.component.d.ts +12 -33
  148. package/modal/modal-actions/modal-actions.component.d.ts +0 -4
  149. package/modal/modal-close/modal-close.directive.d.ts +1 -8
  150. package/modal/modal-content/modal-content.component.d.ts +0 -4
  151. package/modal/modal-header/modal-header.component.d.ts +0 -4
  152. package/modal/modal-title/modal-title.directive.d.ts +0 -11
  153. package/navbar/navbar/navbar.component.d.ts +0 -8
  154. package/navbar/src/navbar-theme.scss +2 -1
  155. package/notification/README.md +39 -24
  156. package/notification/examples/default-notification/default-notification.component.d.ts +0 -2
  157. package/notification/examples/public_api.d.ts +1 -5
  158. package/notification/helpers/notification-orientation.d.ts +17 -0
  159. package/notification/notification/notification.component.d.ts +39 -23
  160. package/notification/notification-actions/notification-actions.directive.d.ts +11 -4
  161. package/notification/notification-message/notification-message.directive.d.ts +9 -4
  162. package/notification/notification-subtitle/notification-subtitle.directive.d.ts +3 -4
  163. package/notification/notification-title/notification-title.directive.d.ts +8 -4
  164. package/notification/public_api.d.ts +6 -5
  165. package/package.json +1 -1
  166. package/paginator/paginator/paginator.component.d.ts +0 -11
  167. package/progress-bar/README.md +31 -8
  168. package/progress-bar/progress-bar-label/progress-bar-label.directive.d.ts +9 -5
  169. package/progress-bar/progress-bar.component.d.ts +39 -35
  170. package/progress-bar/public_api.d.ts +2 -2
  171. package/quantity-field/quantity-field.component.d.ts +10 -0
  172. package/scss/global.scss +0 -1
  173. package/select/select/select.component.d.ts +13 -25
  174. package/select/select.d.ts +1 -2
  175. package/sidebar/README.md +67 -72
  176. package/sidebar/examples/over-and-under-sidebars/over-and-under-sidebars.component.d.ts +0 -1
  177. package/sidebar/examples/sidebar-sides/sidebar-sides.component.d.ts +11 -0
  178. package/sidebar/sidebar/sidebar.component.d.ts +0 -9
  179. package/sidebar/sidebar-footer/sidebar-footer.component.d.ts +0 -4
  180. package/sidebar/sidebar-header/sidebar-header-action/sidebar-header-action.directive.d.ts +3 -0
  181. package/sidebar/sidebar-header/sidebar-header.component.d.ts +0 -4
  182. package/sidebar/sidebar-viewport/sidebar-viewport.component.d.ts +0 -17
  183. package/sticky/examples/basic-sticky/basic-sticky.component.d.ts +5 -0
  184. package/sticky/examples/index.d.ts +1 -0
  185. package/sticky/examples/public_api.d.ts +2 -0
  186. package/tabs/README.md +38 -14
  187. package/tabs/tabs/tab/tab.component.d.ts +4 -16
  188. package/tabs/tabs/tab-activator/tab-activator.component.d.ts +6 -27
  189. package/tabs/tabs/tab-label/tab-label.component.d.ts +5 -2
  190. package/tabs/tabs/tab-panel/tab-panel.component.d.ts +7 -24
  191. package/tabs/tabs/tabs.component.d.ts +5 -11
  192. package/text-snippet/README.md +31 -3
  193. package/text-snippet/text-snippet.component.d.ts +17 -2
  194. package/textarea/textarea.component.d.ts +25 -5
  195. package/toast/README.md +47 -21
  196. package/toast/interfaces/toast-action.d.ts +4 -5
  197. package/toast/interfaces/toast-options.d.ts +3 -1
  198. package/toast/interfaces/toast.d.ts +22 -7
  199. package/toast/service/toast.service.d.ts +3 -3
  200. package/toast/toast/toast-config.d.ts +7 -3
  201. package/toast/toast/toast-template.component.d.ts +1 -1
  202. package/toast/toast/toast.component.d.ts +0 -2
  203. package/toast/toast-actions/toast-actions.directive.d.ts +0 -4
  204. package/toast/toast-message/toast-message.directive.d.ts +0 -4
  205. package/toast/toast-title/toast-title.directive.d.ts +0 -4
  206. package/tree/tree/tree.component.d.ts +0 -6
  207. package/tree/tree-item/tree-item.directive.d.ts +7 -35
  208. package/accordion/accordion/animation/accordion-animation-state.d.ts +0 -1
  209. package/accordion/accordion/animation/accordion-animation.d.ts +0 -4
  210. package/card/examples/raised-card/raised-card.component.d.ts +0 -11
  211. package/notification/examples/notification-with-actions/notification-with-actions.component.d.ts +0 -8
  212. package/progress-bar/animation/progress-bar-animation.d.ts +0 -4
  213. package/select/animation/select-animation-state.d.ts +0 -7
  214. package/select/animation/select-animation.d.ts +0 -4
  215. package/select/animation/state.enum.d.ts +0 -4
@@ -2,7 +2,7 @@ import * as i1 from '@angular/cdk/overlay';
2
2
  import { OverlayModule } from '@angular/cdk/overlay';
3
3
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
4
4
  import * as i0 from '@angular/core';
5
- import { Type, TemplateRef, Injectable, HostListener, Input, HostBinding, Directive, ContentChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
5
+ import { Type, TemplateRef, Injectable, Input, Directive, ContentChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
6
6
  import { BehaviorSubject, map, Subject, takeUntil, fromEvent, filter } from 'rxjs';
7
7
  import { CommonModule } from '@angular/common';
8
8
  import * as i1$1 from '@angular/cdk/a11y';
@@ -84,12 +84,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
84
84
  }], ctorParameters: () => [{ type: i1.Overlay }, { type: i0.Injector }] });
85
85
 
86
86
  class DaffMenuActivatorDirective {
87
- /**
88
- * @docs-private
89
- */
90
- get openClass() {
91
- return this._open;
92
- }
93
87
  constructor(service, viewContainerRef, cdRef) {
94
88
  this.service = service;
95
89
  this.viewContainerRef = viewContainerRef;
@@ -107,78 +101,52 @@ class DaffMenuActivatorDirective {
107
101
  focus() {
108
102
  this.viewContainerRef.element.nativeElement.focus();
109
103
  }
110
- openMenu(event) {
104
+ /**
105
+ * @docs-private
106
+ */
107
+ onClick(event) {
111
108
  event.preventDefault();
112
109
  this.service.open(this.viewContainerRef, this.daffMenuActivator);
113
110
  }
114
111
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuActivatorDirective, deps: [{ token: DaffMenuService }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
115
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: "daffMenuActivator" }, host: { listeners: { "click": "openMenu($event)" }, properties: { "class.open": "this.openClass" } }, ngImport: i0 }); }
112
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffMenuActivatorDirective, isStandalone: true, selector: "[daffMenuActivator]", inputs: { daffMenuActivator: "daffMenuActivator" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
116
113
  }
117
114
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuActivatorDirective, decorators: [{
118
115
  type: Directive,
119
116
  args: [{
120
117
  selector: '[daffMenuActivator]',
121
- standalone: true,
118
+ host: {
119
+ '(click)': 'onClick($event)',
120
+ },
122
121
  }]
123
- }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { openClass: [{
124
- type: HostBinding,
125
- args: ['class.open']
126
- }], daffMenuActivator: [{
122
+ }], ctorParameters: () => [{ type: DaffMenuService }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { daffMenuActivator: [{
127
123
  type: Input
128
- }], openMenu: [{
129
- type: HostListener,
130
- args: ['click', ['$event']]
131
124
  }] } });
132
125
 
126
+ /* eslint-disable quote-props */
133
127
  class DaffMenuItemComponent {
134
- constructor() {
135
- /**
136
- * @docs-private
137
- */
138
- this.class = true;
139
- /**
140
- * Sets the role of the component to menuitem.
141
- *
142
- * @docs-private
143
- */
144
- this.role = 'menuitem';
145
- }
146
128
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
147
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffMenuItemComponent, isStandalone: true, selector: "a[daff-menu-item],button[daff-menu-item]", host: { properties: { "class.daff-menu-item": "this.class", "attr.role": "this.role" } }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
129
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffMenuItemComponent, isStandalone: true, selector: "a[daff-menu-item],button[daff-menu-item]", host: { attributes: { "role": "menuitem" }, classAttribute: "daff-menu-item" }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
148
130
  }
149
131
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuItemComponent, decorators: [{
150
132
  type: Component,
151
133
  args: [{ selector: 'a[daff-menu-item]' + ',' +
152
- 'button[daff-menu-item]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"] }]
153
- }], propDecorators: { class: [{
154
- type: HostBinding,
155
- args: ['class.daff-menu-item']
156
- }], role: [{
157
- type: HostBinding,
158
- args: ['attr.role']
159
- }], _prefix: [{
134
+ 'button[daff-menu-item]', host: {
135
+ 'class': 'daff-menu-item',
136
+ 'role': 'menuitem',
137
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>", styles: [":host{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;align-items:center;gap:8px;border:none;border-radius:4px;margin:0;padding:12px 16px;text-decoration:none;width:100%}.daff-menu-item__content{font-size:1rem;line-height:1.25rem;text-align:left}\n"] }]
138
+ }], propDecorators: { _prefix: [{
160
139
  type: ContentChild,
161
140
  args: [DaffPrefixDirective]
162
141
  }] } });
163
142
 
143
+ /* eslint-disable quote-props */
164
144
  class DaffMenuComponent {
165
145
  constructor(_focusTrapFactory, _ngZone, _elementRef, menuService) {
166
146
  this._focusTrapFactory = _focusTrapFactory;
167
147
  this._ngZone = _ngZone;
168
148
  this._elementRef = _elementRef;
169
149
  this.menuService = menuService;
170
- /**
171
- * @docs-private
172
- */
173
- this.class = true;
174
- /**
175
- * @docs-private
176
- */
177
- this.tabindex = 0;
178
- /**
179
- * @docs-private
180
- */
181
- this.role = 'menu';
182
150
  /**
183
151
  * Listen to `keydown` events outside the zone so that change detection is not run every
184
152
  * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.
@@ -215,23 +183,18 @@ class DaffMenuComponent {
215
183
  }
216
184
  }
217
185
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuComponent, deps: [{ token: i1$1.ConfigurableFocusTrapFactory }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: DaffMenuService }], target: i0.ɵɵFactoryTarget.Component }); }
218
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { properties: { "class.daff-menu": "this.class", "tabindex": "this.tabindex", "attr.role": "this.role" } }, ngImport: i0, template: '<ng-content select="[daff-menu-item]"></ng-content>', isInline: true, styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
186
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffMenuComponent, isStandalone: true, selector: "daff-menu", host: { attributes: { "tabindex": "0", "role": "menu" }, classAttribute: "daff-menu" }, ngImport: i0, template: "<ng-content select=\"[daff-menu-item]\"></ng-content>", styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
219
187
  }
220
188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuComponent, decorators: [{
221
189
  type: Component,
222
- args: [{ selector: 'daff-menu', template: '<ng-content select="[daff-menu-item]"></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
190
+ args: [{ selector: 'daff-menu', changeDetection: ChangeDetectionStrategy.OnPush, host: {
191
+ 'class': 'daff-menu',
192
+ 'tabindex': '0',
193
+ 'role': 'menu',
194
+ }, imports: [
223
195
  DaffMenuItemComponent,
224
- ], styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"] }]
225
- }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: DaffMenuService }], propDecorators: { class: [{
226
- type: HostBinding,
227
- args: ['class.daff-menu']
228
- }], tabindex: [{
229
- type: HostBinding,
230
- args: ['tabindex']
231
- }], role: [{
232
- type: HostBinding,
233
- args: ['attr.role']
234
- }] } });
196
+ ], template: "<ng-content select=\"[daff-menu-item]\"></ng-content>", styles: [":host{display:block;min-width:112px;max-width:320px;border-radius:4px;padding:8px}\n"] }]
197
+ }], ctorParameters: () => [{ type: i1$1.ConfigurableFocusTrapFactory }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: DaffMenuService }] });
235
198
 
236
199
  class DaffMenuModule {
237
200
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-design-menu.mjs","sources":["../../../libs/design/menu/src/helpers/create-overlay.ts","../../../libs/design/menu/src/services/menu.service.ts","../../../libs/design/menu/src/menu-activator/menu-activator.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.html","../../../libs/design/menu/src/menu/menu.component.ts","../../../libs/design/menu/src/menu.module.ts","../../../libs/design/menu/src/daffodil-design-menu.ts"],"sourcesContent":["import {\n Overlay,\n OverlayConfig,\n} from '@angular/cdk/overlay';\nimport { ElementRef } from '@angular/core';\n\nexport function daffMenuCreateOverlay(overlay: Overlay, element: ElementRef, config: OverlayConfig = {}) {\n return overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: overlay.scrollStrategies.block(),\n disposeOnNavigation: true,\n positionStrategy: overlay\n .position()\n .flexibleConnectedTo(element)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 0,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]),\n ...config,\n });\n};\n","import {\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {\n ComponentPortal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {\n ElementRef,\n Injectable,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n map,\n Observable,\n} from 'rxjs';\n\nimport { DaffLazyComponent } from '@daffodil/design';\n\nimport { daffMenuCreateOverlay } from '../helpers/public_api';\n\nexport interface DaffActivatedMenu {\n el: ElementRef;\n component: Type<unknown>;\n}\n\nexport type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;\n\n@Injectable()\nexport class DaffMenuService {\n protected _overlay: OverlayRef | null;\n private _activator: ViewContainerRef;\n\n private $_open: BehaviorSubject<boolean> = new BehaviorSubject(false);\n public open$: Observable<boolean> = this.$_open.asObservable();\n\n constructor(\n protected overlay: Overlay,\n private injector: Injector,\n ) {}\n\n protected async _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot) {\n if (!this._overlay) {\n this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);\n if(typeof component === 'object' && (<DaffLazyComponent>component)?.import) {\n component = await (<DaffLazyComponent>component).import();\n }\n\n if(component instanceof Type) {\n this._overlay.attach(new ComponentPortal(<Type<unknown>>component, null, this.injector));\n } else if (component instanceof TemplateRef) {\n this._overlay.attach(new TemplatePortal(component, activatorElement, null, this.injector));\n }\n\n this._overlay.backdropClick().pipe(\n map(() => this._destroyOverlay()),\n ).subscribe();\n }\n }\n\n protected _destroyOverlay() {\n if (this._overlay) {\n this._overlay.detach();\n this._overlay.dispose();\n this._overlay = null;\n }\n }\n\n close() {\n this._destroyOverlay();\n this.$_open.next(false);\n this._activator.element.nativeElement.focus();\n }\n\n open(activator: ViewContainerRef, component: DaffMenuSlot) {\n this._createOverlay(activator, component);\n this._activator = activator;\n this.$_open.next(true);\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n HostBinding,\n HostListener,\n Input,\n OnDestroy,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n Subject,\n takeUntil,\n} from 'rxjs';\n\nimport { DaffMenuService } from '../services/menu.service';\n\n@Directive({\n selector: '[daffMenuActivator]',\n standalone: true,\n})\nexport class DaffMenuActivatorDirective implements OnDestroy {\n\n private _destroyed$ = new Subject<boolean>();\n private _open: boolean;\n\n /**\n * @docs-private\n */\n @HostBinding('class.open') get openClass() {\n return this._open;\n }\n\n @Input() daffMenuActivator: Type<unknown> | TemplateRef<unknown>;\n\n constructor(\n private service: DaffMenuService,\n private viewContainerRef: ViewContainerRef,\n private cdRef: ChangeDetectorRef,\n ) {\n this.service.open$.pipe(\n takeUntil(this._destroyed$),\n ).subscribe((val: boolean) => {\n this._open = val;\n this.cdRef.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this._destroyed$.next(true);\n this._destroyed$.complete();\n }\n\n focus() {\n this.viewContainerRef.element.nativeElement.focus();\n }\n\n @HostListener('click', ['$event'])\n openMenu(event) {\n event.preventDefault();\n this.service.open(this.viewContainerRef, this.daffMenuActivator);\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n HostBinding,\n ContentChild,\n} from '@angular/core';\n\nimport { DaffPrefixDirective } from '@daffodil/design';\n\n@Component({\n selector: 'a[daff-menu-item]' + ',' +\n 'button[daff-menu-item]',\n templateUrl: './menu-item.component.html',\n styleUrls: ['./menu-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class DaffMenuItemComponent {\n /**\n * @docs-private\n */\n @HostBinding('class.daff-menu-item') class = true;\n\n /**\n * Sets the role of the component to menuitem.\n *\n * @docs-private\n */\n @HostBinding('attr.role') role = 'menuitem';\n\n /**\n * @docs-private\n */\n @ContentChild(DaffPrefixDirective) _prefix: DaffPrefixDirective;\n}\n","@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>","import {\n ConfigurableFocusTrapFactory,\n ConfigurableFocusTrap,\n} from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n NgZone,\n} from '@angular/core';\nimport {\n filter,\n fromEvent,\n} from 'rxjs';\n\nimport { daffFocusableElementsSelector } from '@daffodil/design';\n\nimport { DaffMenuItemComponent } from '../menu-item/menu-item.component';\nimport { DaffMenuService } from '../services/menu.service';\n\n@Component({\n selector: 'daff-menu',\n template: '<ng-content select=\"[daff-menu-item]\"></ng-content>',\n styleUrls: ['./menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DaffMenuItemComponent,\n ],\n})\nexport class DaffMenuComponent implements AfterContentInit, AfterViewInit {\n /**\n * @docs-private\n */\n @HostBinding('class.daff-menu') class = true;\n /**\n * @docs-private\n */\n @HostBinding('tabindex') tabindex = 0;\n /**\n * @docs-private\n */\n @HostBinding('attr.role') role = 'menu';\n\n private _focusTrap: ConfigurableFocusTrap;\n\n constructor(\n private _focusTrapFactory: ConfigurableFocusTrapFactory,\n private _ngZone: NgZone,\n private _elementRef: ElementRef<HTMLElement>,\n private menuService: DaffMenuService,\n ) {\n /**\n * Listen to `keydown` events outside the zone so that change detection is not run every\n * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.\n *\n */\n this._ngZone.runOutsideAngular(() => {\n fromEvent<KeyboardEvent>(this._elementRef.nativeElement, 'keyup')\n .pipe(\n filter((event) => event.key === 'Escape'),\n )\n .subscribe((event) =>\n this._ngZone.run(() => {\n this.menuService.close();\n event.stopPropagation();\n }),\n );\n });\n }\n\n /**\n * @docs-private\n */\n ngAfterContentInit() {\n this._focusTrap = this._focusTrapFactory.create(\n this._elementRef.nativeElement,\n );\n }\n\n /**\n * @docs-private\n */\n ngAfterViewInit() {\n const focusableChild = (<HTMLElement>this._elementRef.nativeElement.querySelector(\n daffFocusableElementsSelector)\n );\n\n if(focusableChild) {\n focusableChild.focus();\n } else {\n // There's a timing condition when computing HostBindings afterContentInit\n // so to allow the menu to be focused, we manually set the tabindex.\n this._elementRef.nativeElement.tabIndex = 0;\n (<HTMLElement>this._elementRef.nativeElement).focus();\n }\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMenuComponent } from './menu/menu.component';\nimport { DaffMenuActivatorDirective } from './menu-activator/menu-activator.component';\nimport { DaffMenuItemComponent } from './menu-item/menu-item.component';\nimport { DaffMenuService } from './services/menu.service';\n\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n exports: [\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n providers: [\n DaffMenuService,\n ],\n})\n\nexport class DaffMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport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,EAAA,IAAA,EAAA,cAAc,EALd,SAAA,EAAA;YACT,eAAe;AAChB,SAAA,EAAA,OAAA,EAAA,CAbC,YAAY;YACZ,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAeJ,cAAc,EAAA,UAAA,EAAA,CAAA;kBAlB1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,eAAe;AAChB,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-design-menu.mjs","sources":["../../../libs/design/menu/src/helpers/create-overlay.ts","../../../libs/design/menu/src/services/menu.service.ts","../../../libs/design/menu/src/menu-activator/menu-activator.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.ts","../../../libs/design/menu/src/menu-item/menu-item.component.html","../../../libs/design/menu/src/menu/menu.component.ts","../../../libs/design/menu/src/menu/menu.component.html","../../../libs/design/menu/src/menu.module.ts","../../../libs/design/menu/src/daffodil-design-menu.ts"],"sourcesContent":["import {\n Overlay,\n OverlayConfig,\n} from '@angular/cdk/overlay';\nimport { ElementRef } from '@angular/core';\n\nexport function daffMenuCreateOverlay(overlay: Overlay, element: ElementRef, config: OverlayConfig = {}) {\n return overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: overlay.scrollStrategies.block(),\n disposeOnNavigation: true,\n positionStrategy: overlay\n .position()\n .flexibleConnectedTo(element)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 0,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]),\n ...config,\n });\n};\n","import {\n Overlay,\n OverlayRef,\n} from '@angular/cdk/overlay';\nimport {\n ComponentPortal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {\n ElementRef,\n Injectable,\n Injector,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n map,\n Observable,\n} from 'rxjs';\n\nimport { DaffLazyComponent } from '@daffodil/design';\n\nimport { daffMenuCreateOverlay } from '../helpers/public_api';\n\nexport interface DaffActivatedMenu {\n el: ElementRef;\n component: Type<unknown>;\n}\n\nexport type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;\n\n@Injectable()\nexport class DaffMenuService {\n protected _overlay: OverlayRef | null;\n private _activator: ViewContainerRef;\n\n private $_open: BehaviorSubject<boolean> = new BehaviorSubject(false);\n public open$: Observable<boolean> = this.$_open.asObservable();\n\n constructor(\n protected overlay: Overlay,\n private injector: Injector,\n ) {}\n\n protected async _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot) {\n if (!this._overlay) {\n this._overlay = daffMenuCreateOverlay(this.overlay, activatorElement.element);\n if(typeof component === 'object' && (<DaffLazyComponent>component)?.import) {\n component = await (<DaffLazyComponent>component).import();\n }\n\n if(component instanceof Type) {\n this._overlay.attach(new ComponentPortal(<Type<unknown>>component, null, this.injector));\n } else if (component instanceof TemplateRef) {\n this._overlay.attach(new TemplatePortal(component, activatorElement, null, this.injector));\n }\n\n this._overlay.backdropClick().pipe(\n map(() => this._destroyOverlay()),\n ).subscribe();\n }\n }\n\n protected _destroyOverlay() {\n if (this._overlay) {\n this._overlay.detach();\n this._overlay.dispose();\n this._overlay = null;\n }\n }\n\n close() {\n this._destroyOverlay();\n this.$_open.next(false);\n this._activator.element.nativeElement.focus();\n }\n\n open(activator: ViewContainerRef, component: DaffMenuSlot) {\n this._createOverlay(activator, component);\n this._activator = activator;\n this.$_open.next(true);\n }\n}\n","import {\n ChangeDetectorRef,\n Directive,\n Input,\n OnDestroy,\n TemplateRef,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n Subject,\n takeUntil,\n} from 'rxjs';\n\nimport { DaffMenuService } from '../services/menu.service';\n\n@Directive({\n selector: '[daffMenuActivator]',\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class DaffMenuActivatorDirective implements OnDestroy {\n\n private _destroyed$ = new Subject<boolean>();\n private _open: boolean;\n\n @Input() daffMenuActivator: Type<unknown> | TemplateRef<unknown>;\n\n constructor(\n private service: DaffMenuService,\n private viewContainerRef: ViewContainerRef,\n private cdRef: ChangeDetectorRef,\n ) {\n this.service.open$.pipe(\n takeUntil(this._destroyed$),\n ).subscribe((val: boolean) => {\n this._open = val;\n this.cdRef.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this._destroyed$.next(true);\n this._destroyed$.complete();\n }\n\n focus() {\n this.viewContainerRef.element.nativeElement.focus();\n }\n\n /**\n * @docs-private\n */\n onClick(event: MouseEvent) {\n event.preventDefault();\n this.service.open(this.viewContainerRef, this.daffMenuActivator);\n }\n}\n","/* eslint-disable quote-props */\nimport {\n Component,\n ChangeDetectionStrategy,\n ContentChild,\n} from '@angular/core';\n\nimport { DaffPrefixDirective } from '@daffodil/design';\n\n@Component({\n selector:\n 'a[daff-menu-item]' + ',' +\n 'button[daff-menu-item]',\n templateUrl: './menu-item.component.html',\n styleUrls: ['./menu-item.component.scss'],\n host: {\n 'class': 'daff-menu-item',\n 'role': 'menuitem',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class DaffMenuItemComponent {\n /**\n * @docs-private\n */\n @ContentChild(DaffPrefixDirective) _prefix: DaffPrefixDirective;\n}\n","@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-menu-item__content\">\n <ng-content></ng-content>\n</div>","/* eslint-disable quote-props */\nimport {\n ConfigurableFocusTrapFactory,\n ConfigurableFocusTrap,\n} from '@angular/cdk/a11y';\nimport {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n} from '@angular/core';\nimport {\n filter,\n fromEvent,\n} from 'rxjs';\n\nimport { daffFocusableElementsSelector } from '@daffodil/design';\n\nimport { DaffMenuItemComponent } from '../menu-item/menu-item.component';\nimport { DaffMenuService } from '../services/menu.service';\n\n@Component({\n selector: 'daff-menu',\n templateUrl: './menu.component.html',\n styleUrl: './menu.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'daff-menu',\n 'tabindex': '0',\n 'role': 'menu',\n },\n imports: [\n DaffMenuItemComponent,\n ],\n})\nexport class DaffMenuComponent implements AfterContentInit, AfterViewInit {\n private _focusTrap: ConfigurableFocusTrap;\n\n constructor(\n private _focusTrapFactory: ConfigurableFocusTrapFactory,\n private _ngZone: NgZone,\n private _elementRef: ElementRef<HTMLElement>,\n private menuService: DaffMenuService,\n ) {\n /**\n * Listen to `keydown` events outside the zone so that change detection is not run every\n * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.\n *\n */\n this._ngZone.runOutsideAngular(() => {\n fromEvent<KeyboardEvent>(this._elementRef.nativeElement, 'keyup')\n .pipe(\n filter((event) => event.key === 'Escape'),\n )\n .subscribe((event) =>\n this._ngZone.run(() => {\n this.menuService.close();\n event.stopPropagation();\n }),\n );\n });\n }\n\n /**\n * @docs-private\n */\n ngAfterContentInit() {\n this._focusTrap = this._focusTrapFactory.create(\n this._elementRef.nativeElement,\n );\n }\n\n /**\n * @docs-private\n */\n ngAfterViewInit() {\n const focusableChild = (<HTMLElement>this._elementRef.nativeElement.querySelector(\n daffFocusableElementsSelector)\n );\n\n if(focusableChild) {\n focusableChild.focus();\n } else {\n // There's a timing condition when computing HostBindings afterContentInit\n // so to allow the menu to be focused, we manually set the tabindex.\n this._elementRef.nativeElement.tabIndex = 0;\n (<HTMLElement>this._elementRef.nativeElement).focus();\n }\n }\n}\n","<ng-content select=\"[daff-menu-item]\"></ng-content>","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMenuComponent } from './menu/menu.component';\nimport { DaffMenuActivatorDirective } from './menu-activator/menu-activator.component';\nimport { DaffMenuItemComponent } from './menu-item/menu-item.component';\nimport { DaffMenuService } from './services/menu.service';\n\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n exports: [\n DaffMenuActivatorDirective,\n DaffMenuComponent,\n DaffMenuItemComponent,\n ],\n providers: [\n DaffMenuService,\n ],\n})\n\nexport class DaffMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffMenuService","i1","i2.DaffMenuService"],"mappings":";;;;;;;;;;AAMM,SAAU,qBAAqB,CAAC,OAAgB,EAAE,OAAmB,EAAE,SAAwB,EAAE,EAAA;IACrG,OAAO,OAAO,CAAC,MAAM,CAAC;AACpB,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,aAAa,EAAE,kCAAkC;AACjD,QAAA,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE;AAChD,QAAA,mBAAmB,EAAE,IAAI;AACzB,QAAA,gBAAgB,EAAE;AACf,aAAA,QAAQ;aACR,mBAAmB,CAAC,OAAO;AAC3B,aAAA,aAAa,CAAC;AACb,YAAA;AACE,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,QAAQ,EAAE,OAAO;AACjB,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,QAAQ,EAAE,OAAO;AACjB,gBAAA,QAAQ,EAAE,QAAQ;AACnB,aAAA;SACF,CAAC;AACJ,QAAA,G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YACZ,aAAa,CAAA,EAAA,CAAA,CAAA;;4FAeJ,cAAc,EAAA,UAAA,EAAA,CAAA;kBAlB1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,0BAA0B;wBAC1B,iBAAiB;wBACjB,qBAAqB;AACtB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,eAAe;AAChB,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
@@ -5,10 +5,12 @@ import * as i4 from '@angular/cdk/portal';
5
5
  import { ComponentPortal, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
6
6
  import * as i0 from '@angular/core';
7
7
  import { Injector, Injectable, EventEmitter, HostListener, HostBinding, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, Optional, Directive, Input, NgModule } from '@angular/core';
8
+ import { Subject } from 'rxjs';
8
9
  import * as i3 from '@daffodil/design';
9
10
  import { daffFocusableElementsSelector, DaffOpenableDirective } from '@daffodil/design';
10
11
  import { trigger, state, transition, style, animate } from '@angular/animations';
11
- import { NgIf, CommonModule } from '@angular/common';
12
+ import { take } from 'rxjs/operators';
13
+ import { CommonModule } from '@angular/common';
12
14
  import { FaIconComponent, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
13
15
  import { DaffIconButtonComponent, DaffButtonModule } from '@daffodil/design/button';
14
16
  import { faXmark } from '@fortawesome/free-solid-svg-icons';
@@ -82,7 +84,7 @@ class DaffModalService {
82
84
  component.hide();
83
85
  const modal = this._modals.get(component);
84
86
  modal.overlay.detachBackdrop();
85
- component.closedAnimationCompleted.subscribe((e) => this._removeModal(modal));
87
+ component.closedAnimationCompleted$.pipe(take(1)).subscribe((e) => this._removeModal(modal));
86
88
  }
87
89
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalService, deps: [{ token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
88
90
  /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalService }); }
@@ -92,14 +94,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
92
94
  }], ctorParameters: () => [{ type: i1.Overlay }] });
93
95
 
94
96
  class DaffModalComponent {
95
- /**
96
- * The aria-labelledby for the modal. This is set by the id of
97
- * {@link DaffModalTitleDirective} when it is used.
98
- *
99
- */
100
- /**
101
- * @docs-private
102
- */
103
97
  get ariaLabelledBy() {
104
98
  return this._ariaLabelledBy;
105
99
  }
@@ -119,36 +113,19 @@ class DaffModalComponent {
119
113
  this.openDirective = openDirective;
120
114
  this._focusStack = _focusStack;
121
115
  this.changeDetector = changeDetector;
122
- /**
123
- * Sets a class of .daff-modal to the host element.
124
- */
125
- /**
126
- * @docs-private
127
- */
128
- this.modalClass = true;
129
- /**
130
- * Sets the role to dialog.
131
- */
132
- /**
133
- * @docs-private
134
- */
135
- this.role = 'dialog';
136
- /**
137
- * Sets aria-modal to true.
138
- */
139
- /**
140
- * @docs-private
141
- */
142
- this.ariaModal = true;
143
116
  this._ariaLabelledBy = null;
144
117
  /**
145
118
  * Event fired when the close animation is completed.
146
119
  */
147
120
  this.animationCompleted = new EventEmitter();
148
121
  /**
149
- * Event fired when the close animation is completed.
122
+ * Private subject for closed animation completion events.
123
+ */
124
+ this._closedAnimationCompleted = new Subject();
125
+ /**
126
+ * Observable that emits when the close animation is completed.
150
127
  */
151
- this.closedAnimationCompleted = new EventEmitter();
128
+ this.closedAnimationCompleted$ = this._closedAnimationCompleted.asObservable();
152
129
  this.openDirective.stateless = false;
153
130
  }
154
131
  /**
@@ -168,7 +145,7 @@ class DaffModalComponent {
168
145
  }
169
146
  else {
170
147
  // There's a timing condition when computing HostBindings afterContentInit
171
- // so to allow the menu to be focused, we manually set the tabindex.
148
+ // so to allow the modal to be focused, we manually set the tabindex.
172
149
  this.elementRef.nativeElement.tabIndex = 0;
173
150
  this.elementRef.nativeElement.focus();
174
151
  }
@@ -197,7 +174,8 @@ class DaffModalComponent {
197
174
  this.animationCompleted.emit(e);
198
175
  if (e.toState === 'closed') {
199
176
  this._focusStack.pop();
200
- this.closedAnimationCompleted.emit(e);
177
+ this._closedAnimationCompleted.next(e);
178
+ this._closedAnimationCompleted.complete();
201
179
  }
202
180
  }
203
181
  get open() {
@@ -224,36 +202,33 @@ class DaffModalComponent {
224
202
  this.openDirective.toggle();
225
203
  this.changeDetector.markForCheck();
226
204
  }
205
+ /**
206
+ * @docs-private
207
+ */
208
+ ngOnDestroy() {
209
+ this._closedAnimationCompleted.complete();
210
+ }
227
211
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", 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 }); }
228
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalComponent, isStandalone: true, selector: "daff-modal", host: { listeners: { "keydown.escape": "onEscape()", "@fade.done": "animationDone($event)" }, properties: { "class.daff-modal": "this.modalClass", "attr.role": "this.role", "attr.aria-modal": "this.ariaModal", "attr.aria-labelledby": "this.ariaLabelledBy", "@fade": "this.fadeState" } }, 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}@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 }], animations: [daffFadeAnimations.fade], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
212
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalComponent, isStandalone: true, selector: "daff-modal", host: { attributes: { "role": "dialog", "aria-modal": "true" }, listeners: { "keydown.escape": "onEscape()", "@fade.done": "animationDone($event)" }, properties: { "attr.aria-labelledby": "ariaLabelledBy", "@fade": "this.fadeState" }, 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}@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 }], animations: [daffFadeAnimations.fade], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
229
213
  }
230
214
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalComponent, decorators: [{
231
215
  type: Component,
232
216
  args: [{ selector: 'daff-modal', hostDirectives: [{
233
217
  directive: DaffOpenableDirective,
234
218
  outputs: ['toggled'],
235
- }], animations: [daffFadeAnimations.fade], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
219
+ }], host: {
220
+ 'class': 'daff-modal',
221
+ 'role': 'dialog',
222
+ 'aria-modal': 'true',
223
+ '[attr.aria-labelledby]': 'ariaLabelledBy',
224
+ '(keydown.escape)': 'onEscape()',
225
+ }, animations: [daffFadeAnimations.fade], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
236
226
  PortalModule,
237
227
  OverlayModule,
238
228
  ], 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}@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"] }]
239
- }], ctorParameters: () => [{ type: DaffModalService }, { type: i2.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: i3.DaffOpenableDirective }, { type: i3.DaffFocusStackService }, { type: i0.ChangeDetectorRef }], propDecorators: { modalClass: [{
240
- type: HostBinding,
241
- args: ['class.daff-modal']
242
- }], role: [{
243
- type: HostBinding,
244
- args: ['attr.role']
245
- }], ariaModal: [{
246
- type: HostBinding,
247
- args: ['attr.aria-modal']
248
- }], ariaLabelledBy: [{
249
- type: HostBinding,
250
- args: ['attr.aria-labelledby']
251
- }], _portalOutlet: [{
229
+ }], ctorParameters: () => [{ type: DaffModalService }, { type: i2.ConfigurableFocusTrapFactory }, { type: i0.ElementRef }, { type: i3.DaffOpenableDirective }, { type: i3.DaffFocusStackService }, { type: i0.ChangeDetectorRef }], propDecorators: { _portalOutlet: [{
252
230
  type: ViewChild,
253
231
  args: [CdkPortalOutlet, { static: true }]
254
- }], onEscape: [{
255
- type: HostListener,
256
- args: ['keydown.escape']
257
232
  }], fadeState: [{
258
233
  type: HostBinding,
259
234
  args: ['@fade']
@@ -262,15 +237,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
262
237
  args: ['@fade.done', ['$event']]
263
238
  }] } });
264
239
 
240
+ /* eslint-disable quote-props */
265
241
  class DaffModalActionsComponent {
266
- constructor() {
267
- /**
268
- * @docs-private
269
- */
270
- this.class = true;
271
- }
272
242
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
273
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalActionsComponent, isStandalone: true, selector: "daff-modal-actions", host: { properties: { "class.daff-modal-actions": "this.class" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
243
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", 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 }); }
274
244
  }
275
245
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalActionsComponent, decorators: [{
276
246
  type: Component,
@@ -278,13 +248,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
278
248
  selector: 'daff-modal-actions',
279
249
  template: '<ng-content></ng-content>',
280
250
  changeDetection: ChangeDetectionStrategy.OnPush,
281
- standalone: true,
251
+ host: {
252
+ 'class': 'daff-modal-actions',
253
+ },
282
254
  }]
283
- }], propDecorators: { class: [{
284
- type: HostBinding,
285
- args: ['class.daff-modal-actions']
286
- }] } });
255
+ }] });
287
256
 
257
+ /* eslint-disable quote-props */
288
258
  /**
289
259
  * The DaffModalCloseDirective is a helper directive that passes a click
290
260
  * event to the button it's used with to close a modal. It needs to be
@@ -295,50 +265,35 @@ class DaffModalCloseDirective {
295
265
  constructor(modalService, modal) {
296
266
  this.modalService = modalService;
297
267
  this.modal = modal;
298
- /**
299
- * Sets the button type attribute to button.
300
- */
301
- /**
302
- * @docs-private
303
- */
304
- this.typeAttribute = 'button';
305
268
  }
306
269
  /**
307
- * Event fired when the button the directive is attached to is clicked. This is used to close a modal.
270
+ * @docs-private
308
271
  */
309
- _onCloseModal(event) {
272
+ onClick(event) {
310
273
  if (this.modal) {
311
274
  this.modalService.close(this.modal);
312
275
  }
313
276
  }
314
277
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalCloseDirective, deps: [{ token: DaffModalService }, { token: DaffModalComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
315
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalCloseDirective, isStandalone: true, selector: "button[daffModalClose]", host: { listeners: { "click": "_onCloseModal()" }, properties: { "attr.type": "this.typeAttribute" } }, ngImport: i0 }); }
278
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalCloseDirective, isStandalone: true, selector: "button[daffModalClose]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
316
279
  }
317
280
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalCloseDirective, decorators: [{
318
281
  type: Directive,
319
282
  args: [{
320
283
  selector: 'button[daffModalClose]',
321
- standalone: true,
284
+ host: {
285
+ 'type': 'button',
286
+ '(click)': 'onClick($event)',
287
+ },
322
288
  }]
323
289
  }], ctorParameters: () => [{ type: DaffModalService }, { type: DaffModalComponent, decorators: [{
324
290
  type: Optional
325
- }] }], propDecorators: { _onCloseModal: [{
326
- type: HostListener,
327
- args: ['click']
328
- }], typeAttribute: [{
329
- type: HostBinding,
330
- args: ['attr.type']
331
- }] } });
291
+ }] }] });
332
292
 
293
+ /* eslint-disable quote-props */
333
294
  class DaffModalContentComponent {
334
- constructor() {
335
- /**
336
- * @docs-private
337
- */
338
- this.class = true;
339
- }
340
295
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
341
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalContentComponent, isStandalone: true, selector: "daff-modal-content", host: { properties: { "class.daff-modal-content": "this.class" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
296
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", 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 }); }
342
297
  }
343
298
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalContentComponent, decorators: [{
344
299
  type: Component,
@@ -346,40 +301,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
346
301
  selector: 'daff-modal-content',
347
302
  template: '<ng-content></ng-content>',
348
303
  changeDetection: ChangeDetectionStrategy.OnPush,
349
- standalone: true,
304
+ host: {
305
+ 'class': 'daff-modal-content',
306
+ },
350
307
  }]
351
- }], propDecorators: { class: [{
352
- type: HostBinding,
353
- args: ['class.daff-modal-content']
354
- }] } });
308
+ }] });
355
309
 
310
+ /* eslint-disable quote-props */
356
311
  class DaffModalHeaderComponent {
357
312
  constructor() {
358
313
  this.faXmark = faXmark;
359
- /**
360
- * @docs-private
361
- */
362
- this.class = true;
363
314
  /**
364
315
  * Whether or not a modal is dismissible.
365
316
  */
366
317
  this.dismissible = true;
367
318
  }
368
319
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
369
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalHeaderComponent, isStandalone: true, selector: "daff-modal-header", inputs: { dismissible: "dismissible" }, host: { properties: { "class.daff-modal-header": "this.class" } }, ngImport: i0, template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n<ng-container *ngIf=\"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</ng-container>", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"] }, { kind: "directive", type: DaffModalCloseDirective, selector: "button[daffModalClose]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
320
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", 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"] }, { kind: "directive", type: DaffModalCloseDirective, selector: "button[daffModalClose]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
370
321
  }
371
322
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalHeaderComponent, decorators: [{
372
323
  type: Component,
373
- args: [{ selector: 'daff-modal-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
374
- NgIf,
324
+ args: [{ selector: 'daff-modal-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
325
+ 'class': 'daff-modal-header',
326
+ }, imports: [
375
327
  DaffIconButtonComponent,
376
328
  FaIconComponent,
377
329
  DaffModalCloseDirective,
378
- ], template: "<ng-content select=\"[daffModalTitle]\"></ng-content>\n<ng-container *ngIf=\"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</ng-container>" }]
379
- }], propDecorators: { class: [{
380
- type: HostBinding,
381
- args: ['class.daff-modal-header']
382
- }], dismissible: [{
330
+ ], 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}" }]
331
+ }], propDecorators: { dismissible: [{
383
332
  type: Input
384
333
  }] } });
385
334
 
@@ -388,21 +337,8 @@ let modalTitleId = 0;
388
337
  * Title of a modal.
389
338
  */
390
339
  class DaffModalTitleDirective {
391
- /**
392
- * The html `id` of the modal title.
393
- */
394
- /**
395
- * @docs-private
396
- */
397
- get uniqueId() {
398
- return this._id;
399
- }
400
340
  constructor(modal) {
401
341
  this.modal = modal;
402
- /**
403
- * @docs-private
404
- */
405
- this.class = true;
406
342
  this._id = '';
407
343
  modalTitleId++;
408
344
  this._id = 'daff-modal-title-' + modalTitleId;
@@ -410,27 +346,24 @@ class DaffModalTitleDirective {
410
346
  * Sets the ariaLabelledBy of the modal to the id of the modal title.
411
347
  */
412
348
  if (this.modal) {
413
- this.modal.ariaLabelledBy = this.uniqueId;
349
+ this.modal.ariaLabelledBy = this._id;
414
350
  }
415
351
  }
416
352
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalTitleDirective, deps: [{ token: DaffModalComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
417
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalTitleDirective, isStandalone: true, selector: "[daffModalTitle]", host: { properties: { "class.daff-modal-title": "this.class", "attr.id": "this.uniqueId" } }, ngImport: i0 }); }
353
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffModalTitleDirective, isStandalone: true, selector: "[daffModalTitle]", host: { properties: { "attr.id": "_id" }, classAttribute: "daff-modal-title" }, ngImport: i0 }); }
418
354
  }
419
355
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffModalTitleDirective, decorators: [{
420
356
  type: Directive,
421
357
  args: [{
422
358
  selector: '[daffModalTitle]',
423
- standalone: true,
359
+ host: {
360
+ class: 'daff-modal-title',
361
+ '[attr.id]': '_id',
362
+ },
424
363
  }]
425
364
  }], ctorParameters: () => [{ type: DaffModalComponent, decorators: [{
426
365
  type: Optional
427
- }] }], propDecorators: { class: [{
428
- type: HostBinding,
429
- args: ['class.daff-modal-title']
430
- }], uniqueId: [{
431
- type: HostBinding,
432
- args: ['attr.id']
433
- }] } });
366
+ }] }] });
434
367
 
435
368
  /**
436
369
  * @deprecated in favor of {@link DAFF_MODAL_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.