@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,913 +1,900 @@
1
- import * as i1 from '@angular/cdk/a11y';
2
- import { A11yModule } from '@angular/cdk/a11y';
3
- import { CommonModule } from '@angular/common';
4
- import * as i0 from '@angular/core';
5
- import { EventEmitter, DOCUMENT, HostListener, Input, Output, HostBinding, Inject, ChangeDetectionStrategy, Component, Directive, ViewEncapsulation, inject, ElementRef, ContentChildren, SkipSelf, Optional, NgModule, signal } from '@angular/core';
6
- import { fromEvent, BehaviorSubject } from 'rxjs';
7
- import { filter } from 'rxjs/operators';
8
- import * as i2 from '@daffodil/design';
9
- import { daffFocusableElementsSelector, DaffOpenableDirective } from '@daffodil/design';
10
- import { trigger, state, style, transition, animate } from '@angular/animations';
11
- import { FaIconComponent } from '@fortawesome/angular-fontawesome';
12
- import { faTimes } from '@fortawesome/free-solid-svg-icons';
13
- import { createSingleInjectionToken } from '@daffodil/core';
14
-
15
- /**
16
- * Determine whether or animation states are going to an open state from a non-open state.
17
- */
1
+ import * as i1 from "@angular/cdk/a11y";
2
+ import { A11yModule } from "@angular/cdk/a11y";
3
+ import { CommonModule } from "@angular/common";
4
+ import * as i0 from "@angular/core";
5
+ import { ChangeDetectionStrategy, Component, ContentChildren, DOCUMENT, Directive, ElementRef, EventEmitter, HostBinding, HostListener, Inject, Input, NgModule, Optional, Output, SkipSelf, ViewEncapsulation, inject, signal } from "@angular/core";
6
+ import { BehaviorSubject, fromEvent } from "rxjs";
7
+ import { filter } from "rxjs/operators";
8
+ import * as i2 from "@daffodil/design";
9
+ import { DaffOpenableDirective, daffFocusableElementsSelector } from "@daffodil/design";
10
+ import { animate, state, style, transition, trigger } from "@angular/animations";
11
+ import { FaIconComponent } from "@fortawesome/angular-fontawesome";
12
+ import { faTimes } from "@fortawesome/free-solid-svg-icons";
13
+ import { createSingleInjectionToken } from "@daffodil/core";
18
14
  const isOpening = (fromState, toState) => {
19
- if (fromState === 'under-open' && toState === 'open' || fromState === 'open' && toState === 'under-open') {
20
- return false;
21
- }
22
- if (toState === 'under-open' || toState === 'open') {
23
- return true;
24
- }
25
- return false;
15
+ if (fromState === "under-open" && toState === "open" || fromState === "open" && toState === "under-open") return false;
16
+ if (toState === "under-open" || toState === "open") return true;
17
+ return false;
26
18
  };
27
-
28
- const duration = '200ms';
29
- const sidebarAnimateInTransition = 'cubic-bezier(0.0, 0.0, 0.2, 1)';
30
- const sidebarAnimateOutTransition = 'cubic-bezier(0.4, 0.0, 1, 1)';
19
+ const sidebarAnimateInTransition = "cubic-bezier(0.0, 0.0, 0.2, 1)";
31
20
  const daffSidebarAnimations = {
32
- transformSidebar: trigger('transformSidebar', [
33
- // We remove the `transform` here completely, rather than setting it to zero, because
34
- // 3d transforms causes text to appear blurry on IE and Edge.
35
- state('open', style({
36
- transform: 'none',
37
- })),
38
- state('closed', style({
39
- transform: 'translateX({{width}})',
40
- }), { params: { width: '-240px' } }),
41
- transition('open => closed', animate(duration + ' ' + sidebarAnimateOutTransition)),
42
- transition('closed => open', animate(duration + ' ' + sidebarAnimateInTransition)),
43
- ]),
44
- transformContent: trigger('transformContent', [
45
- // We remove the `transform` here completely, rather than setting it to zero, because
46
- // 3d transforms causes text to appear blurry on IE and Edge.
47
- state('closed', style({
48
- transform: 'none',
49
- })),
50
- state('open', style({
51
- transform: 'translateX({{shift}})',
52
- }), { params: { shift: '-240px' } }),
53
- transition('open => closed', animate(duration + ' ' + sidebarAnimateInTransition)),
54
- transition('closed => open', animate(duration + ' ' + sidebarAnimateOutTransition)),
55
- ]),
56
- backdropTrigger: trigger('backdropTrigger', [
57
- state('open', style({
58
- opacity: 1,
59
- })),
60
- state('closed', style({
61
- opacity: 0,
62
- })),
63
- transition('open => closed', animate(duration + ' ' + sidebarAnimateOutTransition)),
64
- transition('closed => open', animate(duration + ' ' + sidebarAnimateInTransition)),
65
- ]),
21
+ transformSidebar: trigger("transformSidebar", [
22
+ state("open", style({ transform: "none" })),
23
+ state("closed", style({ transform: "translateX({{width}})" }), { params: { width: "-240px" } }),
24
+ transition("open => closed", animate("200ms cubic-bezier(0.4, 0.0, 1, 1)")),
25
+ transition("closed => open", animate("200ms " + sidebarAnimateInTransition))
26
+ ]),
27
+ transformContent: trigger("transformContent", [
28
+ state("closed", style({ transform: "none" })),
29
+ state("open", style({ transform: "translateX({{shift}})" }), { params: { shift: "-240px" } }),
30
+ transition("open => closed", animate("200ms " + sidebarAnimateInTransition)),
31
+ transition("closed => open", animate("200ms cubic-bezier(0.4, 0.0, 1, 1)"))
32
+ ]),
33
+ backdropTrigger: trigger("backdropTrigger", [
34
+ state("open", style({ opacity: 1 })),
35
+ state("closed", style({ opacity: 0 })),
36
+ transition("open => closed", animate("200ms cubic-bezier(0.4, 0.0, 1, 1)")),
37
+ transition("closed => open", animate("200ms " + sidebarAnimateInTransition))
38
+ ])
66
39
  };
67
40
  var DaffSidebarAnimationStates;
68
- (function (DaffSidebarAnimationStates) {
69
- DaffSidebarAnimationStates["OPEN"] = "open";
70
- DaffSidebarAnimationStates["CLOSED"] = "closed";
71
- DaffSidebarAnimationStates["UNDEROPEN"] = "under-open";
72
- DaffSidebarAnimationStates["UNDERCLOSED"] = "under-closed";
73
- DaffSidebarAnimationStates["SIDEFIXEDOPEN"] = "side-fixed-open";
74
- DaffSidebarAnimationStates["SIDEFIXEDCLOSED"] = "side-fixed-closed";
75
- DaffSidebarAnimationStates["NONE"] = "none";
41
+ (function(DaffSidebarAnimationStates) {
42
+ DaffSidebarAnimationStates["OPEN"] = "open";
43
+ DaffSidebarAnimationStates["CLOSED"] = "closed";
44
+ DaffSidebarAnimationStates["UNDEROPEN"] = "under-open";
45
+ DaffSidebarAnimationStates["UNDERCLOSED"] = "under-closed";
46
+ DaffSidebarAnimationStates["SIDEFIXEDOPEN"] = "side-fixed-open";
47
+ DaffSidebarAnimationStates["SIDEFIXEDCLOSED"] = "side-fixed-closed";
48
+ DaffSidebarAnimationStates["NONE"] = "none";
76
49
  })(DaffSidebarAnimationStates || (DaffSidebarAnimationStates = {}));
77
-
78
50
  const getAnimationState$1 = (open, mode) => {
79
- if (mode === 'side') {
80
- return 'none';
81
- }
82
- if (mode === 'side-fixed' && open) {
83
- return 'side-fixed-open';
84
- }
85
- if (mode === 'side-fixed' && !open) {
86
- return 'side-fixed-closed';
87
- }
88
- if (open && mode === 'under') {
89
- return 'under-open';
90
- }
91
- if (!open && mode === 'under') {
92
- return 'under-closed';
93
- }
94
- if (open) {
95
- return 'open';
96
- }
97
- else {
98
- return 'closed';
99
- }
51
+ if (mode === "side") return "none";
52
+ if (mode === "side-fixed" && open) return "side-fixed-open";
53
+ if (mode === "side-fixed" && !open) return "side-fixed-closed";
54
+ if (open && mode === "under") return "under-open";
55
+ if (!open && mode === "under") return "under-closed";
56
+ if (open) return "open";
57
+ else return "closed";
100
58
  };
101
-
102
- const getSidebarAnimationWidth = (side, width) => side === 'left' ? -1 * width + 'px' : width + 'px';
103
-
104
- /**
105
- * DaffSidebarComponent is heavily based upon the work done by the `@angular/components`
106
- * team on `mat-drawer` and `mat-sidenav`. It's intended to be a simplified version
107
- * (with a different design) of `mat-drawer`.
108
- *
109
- * ```html
110
- * <daff-sidebar></daff-sidebar>
111
- * ```
112
- */
113
- class DaffSidebarComponent {
114
- /**
115
- * @docs-private
116
- *
117
- * The animation state of the sidebar.
118
- */
119
- get transformSidebar() {
120
- return {
121
- value: getAnimationState$1(this.openDirective.open(), this.mode),
122
- params: { width: getSidebarAnimationWidth(this.side, this.width) },
123
- };
124
- }
125
- /**
126
- * @docs-private
127
- *
128
- * The width of the sidebar.
129
- */
130
- get width() {
131
- return this._elementRef.nativeElement.offsetWidth;
132
- }
133
- /**
134
- * @docs-private
135
- */
136
- get open() {
137
- return this.openDirective.open;
138
- }
139
- constructor(_elementRef, _ngZone, _focusTrapFactory, _focusStack, openDirective, _doc) {
140
- this._elementRef = _elementRef;
141
- this._ngZone = _ngZone;
142
- this._focusTrapFactory = _focusTrapFactory;
143
- this._focusStack = _focusStack;
144
- this.openDirective = openDirective;
145
- this._doc = _doc;
146
- /**
147
- * Event fired when `ESC` key is pressed when the sidebar has focus.
148
- */
149
- this.escapePressed = new EventEmitter();
150
- /**
151
- * What side of the viewport to show the sidebar on.
152
- */
153
- this.side = 'left';
154
- /**
155
- * The mode of the sidebar.
156
- */
157
- this.mode = 'side';
158
- /**
159
- * Listen to `keydown` events outside the zone so that change detection is not run every
160
- * time a key is pressed. Instead we re-enter the zone only if the `ESC` key is pressed.
161
- *
162
- */
163
- this._ngZone.runOutsideAngular(() => {
164
- fromEvent(this._elementRef.nativeElement, 'keydown').pipe(filter(event => event.key === 'Escape')).subscribe(event => this._ngZone.run(() => {
165
- this.escapePressed.emit();
166
- event.stopPropagation();
167
- }));
168
- });
169
- }
170
- /**
171
- * @docs-private
172
- *
173
- * Animation event that can be used to hook into when the transformSidebar
174
- * animation begins. This is used in sidebar to determine when to show the
175
- * visibility of the sidebar so that the animation does not jump as the element is shown.
176
- */
177
- onAnimationStart(e) {
178
- if (e.toState === 'open' || e.toState === 'under-open' || e.toState === 'side-fixed-open') {
179
- this._elementRef.nativeElement.style.visibility = 'visible';
180
- }
181
- }
182
- /**
183
- * @docs-private
184
- *
185
- * Animation event that can be used to hook into when the
186
- * transformSidebar animation is complete.
187
- */
188
- onAnimationComplete(e) {
189
- if (isOpening(e.fromState, e.toState)) {
190
- this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
191
- const focusableChild = this._elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
192
- this._focusStack.push(this._doc.activeElement);
193
- if (focusableChild) {
194
- focusableChild.focus();
195
- }
196
- else {
197
- this._elementRef.nativeElement.tabIndex = 0;
198
- this._elementRef.nativeElement.focus();
199
- }
200
- }
201
- else {
202
- if (this._focusTrap) {
203
- this._focusTrap.destroy();
204
- this._focusTrap = undefined;
205
- this._focusStack.pop();
206
- }
207
- }
208
- /**
209
- * @docs-private
210
- *
211
- * This is used in sidebar to determine when to hide the visibility
212
- * of the sidebar so that the animation does not jump as the element is hidden.
213
- */
214
- if (e.toState === 'closed' || e.toState === 'under-closed' || e.toState === 'side-fixed-closed') {
215
- this._elementRef.nativeElement.style.visibility = 'hidden';
216
- }
217
- else {
218
- this._elementRef.nativeElement.style.visibility = null;
219
- }
220
- }
221
- /**
222
- * Reveal the contents of the sidebar.
223
- */
224
- reveal() {
225
- this.openDirective.reveal();
226
- }
227
- /**
228
- * Hide the contents of the sidebar.
229
- */
230
- hide() {
231
- this.openDirective.hide();
232
- }
233
- /**
234
- * Toggle the visibility of the sidebar.
235
- */
236
- toggle() {
237
- this.openDirective.toggle();
238
- }
239
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.ConfigurableFocusTrapFactory }, { token: i2.DaffFocusStackService }, { token: i2.DaffOpenableDirective }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
240
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffSidebarComponent, isStandalone: true, selector: "daff-sidebar", inputs: { side: "side", mode: "mode" }, outputs: { escapePressed: "escapePressed" }, host: { listeners: { "@transformSidebar.start": "onAnimationStart($event)", "@transformSidebar.done": "onAnimationComplete($event)" }, properties: { "class.side": "mode === \"side\"", "class.over": "mode === \"over\"", "class.under": "mode === \"under\"", "class.side-fixed": "mode === \"side-fixed\"", "class.left": "side === \"left\"", "class.right": "side === \"right\"", "@transformSidebar": "this.transformSidebar" }, classAttribute: "daff-sidebar" }, hostDirectives: [{ directive: i2.DaffOpenableDirective, inputs: ["open", "open"], outputs: ["toggled", "toggled"] }], ngImport: i0, template: "<ng-content select=\"daff-sidebar-header\"></ng-content>\n<div class=\"daff-sidebar__body\">\n\t<ng-content></ng-content>\n</div>\n<ng-content select=\"daff-sidebar-footer\"></ng-content>", styles: [":host{display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;width:15rem}:host.left{width:var(--daff-sidebar-left-width, 15rem)}:host.right{width:var(--daff-sidebar-right-width, 15rem)}:host.side-fixed{visibility:hidden;position:fixed;bottom:0;z-index:5;top:var(--daff-sidebar-side-fixed-top-shift, 64px);height:calc(100dvh - var(--daff-sidebar-side-fixed-top-shift, 64px))}:host.side-fixed.left{left:0}:host.side-fixed.right{right:0}@media(min-width:1024px){:host.side-fixed{visibility:visible}}:host.over,:host.under{position:fixed;top:0;bottom:0}:host.over.left,:host.under.left{left:0}:host.over.right,:host.under.right{right:0}:host.over{z-index:7}:host.under{z-index:2}.daff-sidebar__body{flex-grow:1;height:100%;overflow-y:auto}\n"], animations: [
241
- daffSidebarAnimations.transformSidebar,
242
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
243
- }
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarComponent, decorators: [{
245
- type: Component,
246
- args: [{ selector: 'daff-sidebar', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [{
247
- directive: DaffOpenableDirective,
248
- inputs: ['open'],
249
- outputs: ['toggled'],
250
- }], host: {
251
- 'class': 'daff-sidebar',
252
- '[class.side]': 'mode === "side"',
253
- '[class.over]': 'mode === "over"',
254
- '[class.under]': 'mode === "under"',
255
- '[class.side-fixed]': 'mode === "side-fixed"',
256
- '[class.left]': 'side === "left"',
257
- '[class.right]': 'side === "right"',
258
- }, animations: [
259
- daffSidebarAnimations.transformSidebar,
260
- ], template: "<ng-content select=\"daff-sidebar-header\"></ng-content>\n<div class=\"daff-sidebar__body\">\n\t<ng-content></ng-content>\n</div>\n<ng-content select=\"daff-sidebar-footer\"></ng-content>", styles: [":host{display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;width:15rem}:host.left{width:var(--daff-sidebar-left-width, 15rem)}:host.right{width:var(--daff-sidebar-right-width, 15rem)}:host.side-fixed{visibility:hidden;position:fixed;bottom:0;z-index:5;top:var(--daff-sidebar-side-fixed-top-shift, 64px);height:calc(100dvh - var(--daff-sidebar-side-fixed-top-shift, 64px))}:host.side-fixed.left{left:0}:host.side-fixed.right{right:0}@media(min-width:1024px){:host.side-fixed{visibility:visible}}:host.over,:host.under{position:fixed;top:0;bottom:0}:host.over.left,:host.under.left{left:0}:host.over.right,:host.under.right{right:0}:host.over{z-index:7}:host.under{z-index:2}.daff-sidebar__body{flex-grow:1;height:100%;overflow-y:auto}\n"] }]
261
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.ConfigurableFocusTrapFactory }, { type: i2.DaffFocusStackService }, { type: i2.DaffOpenableDirective }, { type: undefined, decorators: [{
262
- type: Inject,
263
- args: [DOCUMENT]
264
- }] }], propDecorators: { transformSidebar: [{
265
- type: HostBinding,
266
- args: ['@transformSidebar']
267
- }], escapePressed: [{
268
- type: Output
269
- }], side: [{
270
- type: Input
271
- }], mode: [{
272
- type: Input
273
- }], onAnimationStart: [{
274
- type: HostListener,
275
- args: ['@transformSidebar.start', ['$event']]
276
- }], onAnimationComplete: [{
277
- type: HostListener,
278
- args: ['@transformSidebar.done', ['$event']]
279
- }] } });
280
-
281
- /* eslint-disable quote-props */
282
- /**
283
- * Sidebar footer is a child component of the sidebar that is used to display a
284
- * footer container, positioned at the bottom of a sidebar.
285
- *
286
- * ```html
287
- * <daff-sidebar-footer></daff-sidebar-footer>
288
- * ```
289
- */
290
- class DaffSidebarFooterComponent {
291
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
292
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffSidebarFooterComponent, isStandalone: true, selector: "daff-sidebar-footer", host: { classAttribute: "daff-sidebar-footer" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;width:100%;flex-grow:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
293
- }
294
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarFooterComponent, decorators: [{
295
- type: Component,
296
- args: [{ selector: 'daff-sidebar-footer', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, host: {
297
- 'class': 'daff-sidebar-footer',
298
- }, styles: [":host{display:block;width:100%;flex-grow:0}\n"] }]
299
- }] });
300
-
301
- /**
302
- * Sidebar header title is a child directive of `DaffSidebarHeaderComponent`
303
- * that can be used to provide a title for the sidebar.
304
- *
305
- * ```html
306
- * <div daffSidebarHeaderTitle>Title</div>
307
- * ```
308
- */
309
- class DaffSidebarHeaderTitleDirective {
310
- constructor() {
311
- /**
312
- * @docs-private
313
- */
314
- this.class = true;
315
- }
316
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarHeaderTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
317
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: DaffSidebarHeaderTitleDirective, isStandalone: true, selector: "[daffSidebarHeaderTitle]", host: { properties: { "class.daff-sidebar-header__title": "this.class" } }, ngImport: i0 }); }
318
- }
319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarHeaderTitleDirective, decorators: [{
320
- type: Directive,
321
- args: [{
322
- selector: '[daffSidebarHeaderTitle]',
323
- }]
324
- }], propDecorators: { class: [{
325
- type: HostBinding,
326
- args: ['class.daff-sidebar-header__title']
327
- }] } });
328
-
329
- /* eslint-disable quote-props */
330
- /**
331
- * Sidebar header is a child component of the sidebar that is used to display a header container,
332
- * positioned at the top of a sidebar. It includes an optional title (`[daffSidebarHeaderTitle]`)
333
- * slot and a slot to render any custom content.
334
- *
335
- * ```html
336
- * <daff-sidebar-header></daff-sidebar-header>
337
- * ```
338
- */
339
- class DaffSidebarHeaderComponent {
340
- constructor() {
341
- /**
342
- * @docs-private
343
- */
344
- this.faTimes = faTimes;
345
- /** Whether or not a sidebar header should display the close icon. */
346
- this.dismissible = false;
347
- /**
348
- * Output event triggered when the close icon is clicked.
349
- */
350
- this.closeSidebar = new EventEmitter();
351
- }
352
- /**
353
- * @docs-private
354
- */
355
- onCloseSidebar(event) {
356
- this.closeSidebar.emit();
357
- }
358
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
359
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffSidebarHeaderComponent, isStandalone: true, selector: "daff-sidebar-header", inputs: { dismissible: "dismissible" }, outputs: { closeSidebar: "closeSidebar" }, host: { properties: { "class.dismissible": "dismissible" }, classAttribute: "daff-sidebar-header" }, ngImport: i0, template: "@if (dismissible) {\n <button class=\"daff-sidebar-header__close-icon\" aria-label=\"Close Sidebar\" (click)=\"onCloseSidebar($event)\">\n <fa-icon [icon]=\"faTimes\" [fixedWidth]=\"true\" size=\"lg\"></fa-icon>\n </button>\n}\n<div class=\"daff-sidebar-header__content\">\n <ng-content></ng-content>\n</div>", styles: [".daff-sidebar-header{display:flex;align-items:center;position:relative;padding:0 1rem;min-height:3rem;max-height:3rem;width:100%}.daff-sidebar-header__close-icon{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;appearance:none;background:none;border:none;color:currentColor;height:3rem;margin:0;min-height:3rem;min-width:3rem;padding:0;width:3rem;left:initial;right:0;top:0}.daff-sidebar-header__title,.daff-sidebar-header__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1rem;font-weight:500}.daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 1.75rem 0 0}.daff-sidebar.right .daff-sidebar-header__close-icon{left:0;right:initial}.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__title,.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 0 0 1.75rem}\n"], dependencies: [{ 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
360
- }
361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarHeaderComponent, decorators: [{
362
- type: Component,
363
- args: [{ selector: 'daff-sidebar-header', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
364
- 'class': 'daff-sidebar-header',
365
- '[class.dismissible]': 'dismissible',
366
- }, imports: [
367
- FaIconComponent,
368
- ], template: "@if (dismissible) {\n <button class=\"daff-sidebar-header__close-icon\" aria-label=\"Close Sidebar\" (click)=\"onCloseSidebar($event)\">\n <fa-icon [icon]=\"faTimes\" [fixedWidth]=\"true\" size=\"lg\"></fa-icon>\n </button>\n}\n<div class=\"daff-sidebar-header__content\">\n <ng-content></ng-content>\n</div>", styles: [".daff-sidebar-header{display:flex;align-items:center;position:relative;padding:0 1rem;min-height:3rem;max-height:3rem;width:100%}.daff-sidebar-header__close-icon{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;appearance:none;background:none;border:none;color:currentColor;height:3rem;margin:0;min-height:3rem;min-width:3rem;padding:0;width:3rem;left:initial;right:0;top:0}.daff-sidebar-header__title,.daff-sidebar-header__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1rem;font-weight:500}.daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 1.75rem 0 0}.daff-sidebar.right .daff-sidebar-header__close-icon{left:0;right:initial}.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__title,.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 0 0 1.75rem}\n"] }]
369
- }], propDecorators: { dismissible: [{
370
- type: Input
371
- }], closeSidebar: [{
372
- type: Output
373
- }] } });
374
-
375
- /**
376
- * Fallback function for determining whether or not a viewport has a parent viewport.
377
- * This is really only used in the Daffodil docs when the injector heirarchy
378
- * doesn't act as anticipated as a result of custom elements.
379
- */
59
+ const getSidebarAnimationWidth = (side, width) => side === "left" ? -1 * width + "px" : width + "px";
60
+ var DaffSidebarComponent = class DaffSidebarComponent {
61
+ get transformSidebar() {
62
+ return {
63
+ value: getAnimationState$1(this.openDirective.open(), this.mode),
64
+ params: { width: getSidebarAnimationWidth(this.side, this.width) }
65
+ };
66
+ }
67
+ get width() {
68
+ return this._elementRef.nativeElement.offsetWidth;
69
+ }
70
+ get open() {
71
+ return this.openDirective.open;
72
+ }
73
+ constructor(_elementRef, _ngZone, _focusTrapFactory, _focusStack, openDirective, _doc) {
74
+ this._elementRef = _elementRef;
75
+ this._ngZone = _ngZone;
76
+ this._focusTrapFactory = _focusTrapFactory;
77
+ this._focusStack = _focusStack;
78
+ this.openDirective = openDirective;
79
+ this._doc = _doc;
80
+ this.escapePressed = new EventEmitter();
81
+ this.side = "left";
82
+ this.mode = "side";
83
+ this._ngZone.runOutsideAngular(() => {
84
+ fromEvent(this._elementRef.nativeElement, "keydown").pipe(filter((event) => event.key === "Escape")).subscribe((event) => this._ngZone.run(() => {
85
+ this.escapePressed.emit();
86
+ event.stopPropagation();
87
+ }));
88
+ });
89
+ }
90
+ onAnimationStart(e) {
91
+ if (e.toState === "open" || e.toState === "under-open" || e.toState === "side-fixed-open") this._elementRef.nativeElement.style.visibility = "visible";
92
+ }
93
+ onAnimationComplete(e) {
94
+ if (isOpening(e.fromState, e.toState)) {
95
+ this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
96
+ const focusableChild = this._elementRef.nativeElement.querySelector(daffFocusableElementsSelector);
97
+ this._focusStack.push(this._doc.activeElement);
98
+ if (focusableChild) focusableChild.focus();
99
+ else {
100
+ this._elementRef.nativeElement.tabIndex = 0;
101
+ this._elementRef.nativeElement.focus();
102
+ }
103
+ } else if (this._focusTrap) {
104
+ this._focusTrap.destroy();
105
+ this._focusTrap = void 0;
106
+ this._focusStack.pop();
107
+ }
108
+ if (e.toState === "closed" || e.toState === "under-closed" || e.toState === "side-fixed-closed") this._elementRef.nativeElement.style.visibility = "hidden";
109
+ else this._elementRef.nativeElement.style.visibility = null;
110
+ }
111
+ reveal() {
112
+ this.openDirective.reveal();
113
+ }
114
+ hide() {
115
+ this.openDirective.hide();
116
+ }
117
+ toggle() {
118
+ this.openDirective.toggle();
119
+ }
120
+ static {
121
+ this.ɵfac = i0.ɵɵngDeclareFactory({
122
+ minVersion: "12.0.0",
123
+ version: "22.2.4",
124
+ ngImport: i0,
125
+ type: DaffSidebarComponent,
126
+ deps: [
127
+ { token: i0.ElementRef },
128
+ { token: i0.NgZone },
129
+ { token: i1.ConfigurableFocusTrapFactory },
130
+ { token: i2.DaffFocusStackService },
131
+ { token: i2.DaffOpenableDirective },
132
+ { token: DOCUMENT }
133
+ ],
134
+ target: i0.ɵɵFactoryTarget.Component
135
+ });
136
+ }
137
+ static {
138
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
139
+ minVersion: "14.0.0",
140
+ version: "22.2.4",
141
+ type: DaffSidebarComponent,
142
+ isStandalone: true,
143
+ selector: "daff-sidebar",
144
+ inputs: {
145
+ side: "side",
146
+ mode: "mode"
147
+ },
148
+ outputs: { escapePressed: "escapePressed" },
149
+ host: {
150
+ listeners: {
151
+ "@transformSidebar.start": "onAnimationStart($event)",
152
+ "@transformSidebar.done": "onAnimationComplete($event)"
153
+ },
154
+ properties: {
155
+ "class.side": "mode === \"side\"",
156
+ "class.over": "mode === \"over\"",
157
+ "class.under": "mode === \"under\"",
158
+ "class.side-fixed": "mode === \"side-fixed\"",
159
+ "class.left": "side === \"left\"",
160
+ "class.right": "side === \"right\"",
161
+ "@transformSidebar": "this.transformSidebar"
162
+ },
163
+ classAttribute: "daff-sidebar"
164
+ },
165
+ hostDirectives: [{
166
+ directive: i2.DaffOpenableDirective,
167
+ inputs: ["open", "open"],
168
+ outputs: ["toggled", "toggled"]
169
+ }],
170
+ ngImport: i0,
171
+ template: "<ng-content select=\"daff-sidebar-header\"></ng-content>\n<div class=\"daff-sidebar__body\">\n <ng-content></ng-content>\n</div>\n<ng-content select=\"daff-sidebar-footer\"></ng-content>",
172
+ styles: [":host{display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;width:15rem}:host.left{width:var(--daff-sidebar-left-width, 15rem)}:host.right{width:var(--daff-sidebar-right-width, 15rem)}:host.side-fixed{visibility:hidden;position:fixed;bottom:0;z-index:5;top:var(--daff-sidebar-side-fixed-top-shift, 64px);height:calc(100dvh - var(--daff-sidebar-side-fixed-top-shift, 64px))}:host.side-fixed.left{left:0}:host.side-fixed.right{right:0}@media(min-width:1024px){:host.side-fixed{visibility:visible}}:host.over,:host.under{position:fixed;top:0;bottom:0}:host.over.left,:host.under.left{left:0}:host.over.right,:host.under.right{right:0}:host.over{z-index:7}:host.under{z-index:2}.daff-sidebar__body{flex-grow:1;height:100%;overflow-y:auto}\n"],
173
+ animations: [daffSidebarAnimations.transformSidebar],
174
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
175
+ });
176
+ }
177
+ };
178
+ i0.ɵɵngDeclareClassMetadata({
179
+ minVersion: "12.0.0",
180
+ version: "22.2.4",
181
+ ngImport: i0,
182
+ type: DaffSidebarComponent,
183
+ decorators: [{
184
+ type: Component,
185
+ args: [{
186
+ selector: "daff-sidebar",
187
+ changeDetection: ChangeDetectionStrategy.OnPush,
188
+ hostDirectives: [{
189
+ directive: DaffOpenableDirective,
190
+ inputs: ["open"],
191
+ outputs: ["toggled"]
192
+ }],
193
+ host: {
194
+ "class": "daff-sidebar",
195
+ "[class.side]": "mode === \"side\"",
196
+ "[class.over]": "mode === \"over\"",
197
+ "[class.under]": "mode === \"under\"",
198
+ "[class.side-fixed]": "mode === \"side-fixed\"",
199
+ "[class.left]": "side === \"left\"",
200
+ "[class.right]": "side === \"right\""
201
+ },
202
+ animations: [daffSidebarAnimations.transformSidebar],
203
+ template: "<ng-content select=\"daff-sidebar-header\"></ng-content>\n<div class=\"daff-sidebar__body\">\n <ng-content></ng-content>\n</div>\n<ng-content select=\"daff-sidebar-footer\"></ng-content>",
204
+ styles: [":host{display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;width:15rem}:host.left{width:var(--daff-sidebar-left-width, 15rem)}:host.right{width:var(--daff-sidebar-right-width, 15rem)}:host.side-fixed{visibility:hidden;position:fixed;bottom:0;z-index:5;top:var(--daff-sidebar-side-fixed-top-shift, 64px);height:calc(100dvh - var(--daff-sidebar-side-fixed-top-shift, 64px))}:host.side-fixed.left{left:0}:host.side-fixed.right{right:0}@media(min-width:1024px){:host.side-fixed{visibility:visible}}:host.over,:host.under{position:fixed;top:0;bottom:0}:host.over.left,:host.under.left{left:0}:host.over.right,:host.under.right{right:0}:host.over{z-index:7}:host.under{z-index:2}.daff-sidebar__body{flex-grow:1;height:100%;overflow-y:auto}\n"]
205
+ }]
206
+ }],
207
+ ctorParameters: () => [
208
+ { type: i0.ElementRef },
209
+ { type: i0.NgZone },
210
+ { type: i1.ConfigurableFocusTrapFactory },
211
+ { type: i2.DaffFocusStackService },
212
+ { type: i2.DaffOpenableDirective },
213
+ {
214
+ type: void 0,
215
+ decorators: [{
216
+ type: Inject,
217
+ args: [DOCUMENT]
218
+ }]
219
+ }
220
+ ],
221
+ propDecorators: {
222
+ transformSidebar: [{
223
+ type: HostBinding,
224
+ args: ["@transformSidebar"]
225
+ }],
226
+ escapePressed: [{ type: Output }],
227
+ side: [{ type: Input }],
228
+ mode: [{ type: Input }],
229
+ onAnimationStart: [{
230
+ type: HostListener,
231
+ args: ["@transformSidebar.start", ["$event"]]
232
+ }],
233
+ onAnimationComplete: [{
234
+ type: HostListener,
235
+ args: ["@transformSidebar.done", ["$event"]]
236
+ }]
237
+ }
238
+ });
239
+ var DaffSidebarFooterComponent = class DaffSidebarFooterComponent {
240
+ static {
241
+ this.ɵfac = i0.ɵɵngDeclareFactory({
242
+ minVersion: "12.0.0",
243
+ version: "22.2.4",
244
+ ngImport: i0,
245
+ type: DaffSidebarFooterComponent,
246
+ deps: [],
247
+ target: i0.ɵɵFactoryTarget.Component
248
+ });
249
+ }
250
+ static {
251
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
252
+ minVersion: "14.0.0",
253
+ version: "22.2.4",
254
+ type: DaffSidebarFooterComponent,
255
+ isStandalone: true,
256
+ selector: "daff-sidebar-footer",
257
+ host: { classAttribute: "daff-sidebar-footer" },
258
+ ngImport: i0,
259
+ template: "<ng-content></ng-content>",
260
+ isInline: true,
261
+ styles: [":host{display:block;width:100%;flex-grow:0}\n"],
262
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
263
+ });
264
+ }
265
+ };
266
+ i0.ɵɵngDeclareClassMetadata({
267
+ minVersion: "12.0.0",
268
+ version: "22.2.4",
269
+ ngImport: i0,
270
+ type: DaffSidebarFooterComponent,
271
+ decorators: [{
272
+ type: Component,
273
+ args: [{
274
+ selector: "daff-sidebar-footer",
275
+ template: "<ng-content></ng-content>",
276
+ changeDetection: ChangeDetectionStrategy.OnPush,
277
+ host: { "class": "daff-sidebar-footer" },
278
+ styles: [":host{display:block;width:100%;flex-grow:0}\n"]
279
+ }]
280
+ }]
281
+ });
282
+ var DaffSidebarHeaderTitleDirective = class DaffSidebarHeaderTitleDirective {
283
+ constructor() {
284
+ this.class = true;
285
+ }
286
+ static {
287
+ this.ɵfac = i0.ɵɵngDeclareFactory({
288
+ minVersion: "12.0.0",
289
+ version: "22.2.4",
290
+ ngImport: i0,
291
+ type: DaffSidebarHeaderTitleDirective,
292
+ deps: [],
293
+ target: i0.ɵɵFactoryTarget.Directive
294
+ });
295
+ }
296
+ static {
297
+ this.ɵdir = i0.ɵɵngDeclareDirective({
298
+ minVersion: "14.0.0",
299
+ version: "22.2.4",
300
+ type: DaffSidebarHeaderTitleDirective,
301
+ isStandalone: true,
302
+ selector: "[daffSidebarHeaderTitle]",
303
+ host: { properties: { "class.daff-sidebar-header__title": "this.class" } },
304
+ ngImport: i0
305
+ });
306
+ }
307
+ };
308
+ i0.ɵɵngDeclareClassMetadata({
309
+ minVersion: "12.0.0",
310
+ version: "22.2.4",
311
+ ngImport: i0,
312
+ type: DaffSidebarHeaderTitleDirective,
313
+ decorators: [{
314
+ type: Directive,
315
+ args: [{ selector: "[daffSidebarHeaderTitle]" }]
316
+ }],
317
+ propDecorators: { class: [{
318
+ type: HostBinding,
319
+ args: ["class.daff-sidebar-header__title"]
320
+ }] }
321
+ });
322
+ var DaffSidebarHeaderComponent = class DaffSidebarHeaderComponent {
323
+ constructor() {
324
+ this.faTimes = faTimes;
325
+ this.dismissible = false;
326
+ this.closeSidebar = new EventEmitter();
327
+ }
328
+ onCloseSidebar(event) {
329
+ this.closeSidebar.emit();
330
+ }
331
+ static {
332
+ this.ɵfac = i0.ɵɵngDeclareFactory({
333
+ minVersion: "12.0.0",
334
+ version: "22.2.4",
335
+ ngImport: i0,
336
+ type: DaffSidebarHeaderComponent,
337
+ deps: [],
338
+ target: i0.ɵɵFactoryTarget.Component
339
+ });
340
+ }
341
+ static {
342
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
343
+ minVersion: "17.0.0",
344
+ version: "22.2.4",
345
+ type: DaffSidebarHeaderComponent,
346
+ isStandalone: true,
347
+ selector: "daff-sidebar-header",
348
+ inputs: { dismissible: "dismissible" },
349
+ outputs: { closeSidebar: "closeSidebar" },
350
+ host: {
351
+ properties: { "class.dismissible": "dismissible" },
352
+ classAttribute: "daff-sidebar-header"
353
+ },
354
+ ngImport: i0,
355
+ template: "@if (dismissible) {\n <button class=\"daff-sidebar-header__close-icon\" aria-label=\"Close Sidebar\" (click)=\"onCloseSidebar($event)\">\n <fa-icon [icon]=\"faTimes\" [fixedWidth]=\"true\" size=\"lg\"></fa-icon>\n </button>\n}\n<div class=\"daff-sidebar-header__content\">\n <ng-content></ng-content>\n</div>",
356
+ styles: [".daff-sidebar-header{display:flex;align-items:center;position:relative;padding:0 1rem;min-height:3rem;max-height:3rem;width:100%}.daff-sidebar-header__close-icon{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;appearance:none;background:none;border:none;color:currentColor;height:3rem;margin:0;min-height:3rem;min-width:3rem;padding:0;width:3rem;left:initial;right:0;top:0}.daff-sidebar-header__title,.daff-sidebar-header__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1rem;font-weight:500}.daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 1.75rem 0 0}.daff-sidebar.right .daff-sidebar-header__close-icon{left:0;right:initial}.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__title,.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 0 0 1.75rem}\n"],
357
+ dependencies: [{
358
+ kind: "component",
359
+ type: FaIconComponent,
360
+ selector: "fa-icon",
361
+ inputs: [
362
+ "icon",
363
+ "title",
364
+ "animation",
365
+ "mask",
366
+ "flip",
367
+ "size",
368
+ "pull",
369
+ "border",
370
+ "inverse",
371
+ "symbol",
372
+ "rotate",
373
+ "fixedWidth",
374
+ "transform",
375
+ "a11yRole"
376
+ ],
377
+ outputs: [
378
+ "iconChange",
379
+ "titleChange",
380
+ "animationChange",
381
+ "maskChange",
382
+ "flipChange",
383
+ "sizeChange",
384
+ "pullChange",
385
+ "borderChange",
386
+ "inverseChange",
387
+ "symbolChange",
388
+ "rotateChange",
389
+ "fixedWidthChange",
390
+ "transformChange",
391
+ "a11yRoleChange"
392
+ ]
393
+ }],
394
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
395
+ encapsulation: i0.ViewEncapsulation.None
396
+ });
397
+ }
398
+ };
399
+ i0.ɵɵngDeclareClassMetadata({
400
+ minVersion: "12.0.0",
401
+ version: "22.2.4",
402
+ ngImport: i0,
403
+ type: DaffSidebarHeaderComponent,
404
+ decorators: [{
405
+ type: Component,
406
+ args: [{
407
+ selector: "daff-sidebar-header",
408
+ encapsulation: ViewEncapsulation.None,
409
+ changeDetection: ChangeDetectionStrategy.OnPush,
410
+ host: {
411
+ "class": "daff-sidebar-header",
412
+ "[class.dismissible]": "dismissible"
413
+ },
414
+ imports: [FaIconComponent],
415
+ template: "@if (dismissible) {\n <button class=\"daff-sidebar-header__close-icon\" aria-label=\"Close Sidebar\" (click)=\"onCloseSidebar($event)\">\n <fa-icon [icon]=\"faTimes\" [fixedWidth]=\"true\" size=\"lg\"></fa-icon>\n </button>\n}\n<div class=\"daff-sidebar-header__content\">\n <ng-content></ng-content>\n</div>",
416
+ styles: [".daff-sidebar-header{display:flex;align-items:center;position:relative;padding:0 1rem;min-height:3rem;max-height:3rem;width:100%}.daff-sidebar-header__close-icon{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;appearance:none;background:none;border:none;color:currentColor;height:3rem;margin:0;min-height:3rem;min-width:3rem;padding:0;width:3rem;left:initial;right:0;top:0}.daff-sidebar-header__title,.daff-sidebar-header__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1rem;font-weight:500}.daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 1.75rem 0 0}.daff-sidebar.right .daff-sidebar-header__close-icon{left:0;right:initial}.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__title,.daff-sidebar.right .daff-sidebar-header__close-icon+.daff-sidebar-header__content{margin:0 0 0 1.75rem}\n"]
417
+ }]
418
+ }],
419
+ propDecorators: {
420
+ dismissible: [{ type: Input }],
421
+ closeSidebar: [{ type: Output }]
422
+ }
423
+ });
380
424
  const hasParentViewport = (element) => {
381
- let currentElement = element.parentElement;
382
- while (currentElement !== null) {
383
- if (currentElement.tagName === 'DAFF-SIDEBAR-VIEWPORT') {
384
- return true;
385
- }
386
- currentElement = currentElement.parentElement;
387
- }
388
- return false;
425
+ let currentElement = element.parentElement;
426
+ while (currentElement !== null) {
427
+ if (currentElement.tagName === "DAFF-SIDEBAR-VIEWPORT") return true;
428
+ currentElement = currentElement.parentElement;
429
+ }
430
+ return false;
389
431
  };
390
-
391
- /**
392
- * The placement of the nav in relation to the sidebar.
393
- * See {@link DaffNavPlacement }
394
- */
395
432
  var DaffNavPlacementEnum;
396
- (function (DaffNavPlacementEnum) {
397
- DaffNavPlacementEnum["ABOVE"] = "above";
398
- DaffNavPlacementEnum["BESIDE"] = "beside";
433
+ (function(DaffNavPlacementEnum) {
434
+ DaffNavPlacementEnum["ABOVE"] = "above";
435
+ DaffNavPlacementEnum["BESIDE"] = "beside";
399
436
  })(DaffNavPlacementEnum || (DaffNavPlacementEnum = {}));
400
-
401
- const {
402
- /**
403
- * An injection token that can be used within a sidebar to determine
404
- * what to do enabling and disabling scrolling. By default, the body
405
- * is the element where scrolling is controlled.
406
- */
407
- token: DAFF_SIDEBAR_SCROLL_TOKEN,
408
- /**
409
- * Provider function for {@link DAFF_SIDEBAR_SCROLL_TOKEN}.
410
- */
411
- provider: provideDaffSidebarScrollToken, } = createSingleInjectionToken('DAFF_SIDEBAR_SCROLL_TOKEN', {
412
- providedIn: 'root',
413
- factory: () => {
414
- const document = inject(DOCUMENT);
415
- return {
416
- enable: () => {
417
- document.body.style.overflow = null;
418
- },
419
- disable: () => {
420
- document.body.style.overflow = 'hidden';
421
- },
422
- };
423
- },
437
+ const { token: DAFF_SIDEBAR_SCROLL_TOKEN, provider: provideDaffSidebarScrollToken } = createSingleInjectionToken("DAFF_SIDEBAR_SCROLL_TOKEN", {
438
+ providedIn: "root",
439
+ factory: () => {
440
+ const document = inject(DOCUMENT);
441
+ return {
442
+ enable: () => {
443
+ document.body.style.overflow = null;
444
+ },
445
+ disable: () => {
446
+ document.body.style.overflow = "hidden";
447
+ }
448
+ };
449
+ }
424
450
  });
425
- /**
426
- * A factory function that return a DaffSidebarScroll
427
- * for the current sidebar viewport.
428
- *
429
- * See the providers of {@link DaffSidebarViewportComponent}
430
- */
431
451
  const daffSidebarViewportScrollFactory = () => {
432
- const element = inject(ElementRef).nativeElement;
433
- return {
434
- enable: () => {
435
- element.style.overflow = null;
436
- },
437
- disable: () => {
438
- element.style.overflow = 'hidden';
439
- },
440
- };
452
+ const element = inject(ElementRef).nativeElement;
453
+ return {
454
+ enable: () => {
455
+ element.style.overflow = null;
456
+ },
457
+ disable: () => {
458
+ element.style.overflow = "hidden";
459
+ }
460
+ };
441
461
  };
442
-
443
- /**
444
- * Determines, given a list of sidebars, whether or not the backdrop is interactable (typically clickable).
445
- */
446
- const sidebarViewportBackdropInteractable = (sidebars) => sidebars.reduce((acc, sidebar) => ((sidebar.mode === 'over' || sidebar.mode === 'under') && sidebar.open()) || acc, false);
447
-
448
- /**
449
- * Given a list of sidebars, compute the whether or not the content is padded.
450
- */
462
+ const sidebarViewportBackdropInteractable = (sidebars) => sidebars.reduce((acc, sidebar) => (sidebar.mode === "over" || sidebar.mode === "under") && sidebar.open() || acc, false);
451
463
  const isSidebarViewportContentPadded = (sidebars, side) => sidebars.reduce((acc, sidebar) => {
452
- if (!(sidebar.mode === "side-fixed" /* DaffSidebarModeEnum.SideFixed */ && sidebar.open())) {
453
- return acc || false;
454
- }
455
- if (sidebar.side === side) {
456
- return true;
457
- }
458
- else {
459
- // This component is "stateless", its possible to have two open "under" sidebars.
460
- // As such, we defer to "left" being open by default.
461
- return acc;
462
- }
464
+ if (!(sidebar.mode === "side-fixed" && sidebar.open())) return acc || false;
465
+ if (sidebar.side === side) return true;
466
+ else return acc;
463
467
  }, false);
464
-
465
- const isViewportContentShifted = (mode, open) => (mode === 'under' && open);
466
- /**
467
- * Given a list of sidebars, compute the associated content shift.
468
- */
468
+ const isViewportContentShifted = (mode, open) => mode === "under" && open;
469
469
  const sidebarViewportContentShift = (sidebars) => sidebars.reduce((acc, sidebar) => {
470
- if (!isViewportContentShifted(sidebar.mode, sidebar.open())) {
471
- return acc;
472
- }
473
- if (sidebar.side === 'left') {
474
- return sidebar.width;
475
- }
476
- else if (sidebar.side === 'right' && acc === 0) {
477
- return -1 * sidebar.width;
478
- }
479
- else {
480
- // This component is "stateless", its possible to have two open "under" sidebars.
481
- // As such, we defer to "left" being open by default.
482
- return acc;
483
- }
470
+ if (!isViewportContentShifted(sidebar.mode, sidebar.open())) return acc;
471
+ if (sidebar.side === "left") return sidebar.width;
472
+ else if (sidebar.side === "right" && acc === 0) return -1 * sidebar.width;
473
+ else return acc;
484
474
  }, 0);
485
-
486
- ;
487
475
  const getSidebarViewportAnimationState = (open) => open ? DaffSidebarAnimationStates.OPEN : DaffSidebarAnimationStates.CLOSED;
488
-
489
- const animationDuration = '350ms';
490
- const backdropTransitionOut = 'cubic-bezier(0.4, 0.0, 1, 1)';
491
- const backdropTransitionIn = 'cubic-bezier(0.0, 0.0, 0.2, 1)';
492
- const daffSidebarViewportBackdropAnimations = {
493
- fadeBackdrop: trigger('fadeBackdrop', [
494
- state('interactable', style({ opacity: 1 })),
495
- state('non-interactable', style({ opacity: 0 })),
496
- transition('interactable => non-interactable', animate(animationDuration + ' ' + backdropTransitionOut)),
497
- transition('non-interactable => interactable', animate(animationDuration + ' ' + backdropTransitionIn)),
498
- transition(':enter', [
499
- style({ opacity: 0 }),
500
- animate(animationDuration + ' ' + backdropTransitionIn, style({ opacity: 1 })),
501
- ]),
502
- transition(':leave', [
503
- animate(animationDuration + ' ' + backdropTransitionOut, style({ opacity: 0 })),
504
- ]),
505
- ]),
476
+ const backdropTransitionOut = "cubic-bezier(0.4, 0.0, 1, 1)";
477
+ const backdropTransitionIn = "cubic-bezier(0.0, 0.0, 0.2, 1)";
478
+ const daffSidebarViewportBackdropAnimations = { fadeBackdrop: trigger("fadeBackdrop", [
479
+ state("interactable", style({ opacity: 1 })),
480
+ state("non-interactable", style({ opacity: 0 })),
481
+ transition("interactable => non-interactable", animate("350ms " + backdropTransitionOut)),
482
+ transition("non-interactable => interactable", animate("350ms " + backdropTransitionIn)),
483
+ transition(":enter", [style({ opacity: 0 }), animate("350ms " + backdropTransitionIn, style({ opacity: 1 }))]),
484
+ transition(":leave", [animate("350ms " + backdropTransitionOut, style({ opacity: 0 }))])
485
+ ]) };
486
+ const getAnimationState = (interactable) => interactable ? "interactable" : "non-interactable";
487
+ var DaffSidebarViewportBackdropComponent = class DaffSidebarViewportBackdropComponent {
488
+ constructor() {
489
+ this.interactableClass = true;
490
+ this.transparent = false;
491
+ this.interactable = true;
492
+ this.fullscreen = false;
493
+ this.backdropClicked = new EventEmitter();
494
+ }
495
+ ngOnInit() {
496
+ this.interactableClass = this.interactable;
497
+ }
498
+ get fadeBackdropTrigger() {
499
+ return getAnimationState(this.interactable);
500
+ }
501
+ animationDone(e) {
502
+ this.interactableClass = !(e.toState === ":leave" || e.toState === "non-interactable");
503
+ }
504
+ animationStart(e) {
505
+ if (e.toState === ":enter" || e.toState === "interactable") this.interactableClass = true;
506
+ }
507
+ onBackdropClicked() {
508
+ this.backdropClicked.emit();
509
+ }
510
+ static {
511
+ this.ɵfac = i0.ɵɵngDeclareFactory({
512
+ minVersion: "12.0.0",
513
+ version: "22.2.4",
514
+ ngImport: i0,
515
+ type: DaffSidebarViewportBackdropComponent,
516
+ deps: [],
517
+ target: i0.ɵɵFactoryTarget.Component
518
+ });
519
+ }
520
+ static {
521
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
522
+ minVersion: "14.0.0",
523
+ version: "22.2.4",
524
+ type: DaffSidebarViewportBackdropComponent,
525
+ isStandalone: true,
526
+ selector: "daff-sidebar-viewport-backdrop",
527
+ inputs: {
528
+ transparent: "transparent",
529
+ interactable: "interactable",
530
+ fullscreen: "fullscreen"
531
+ },
532
+ outputs: { backdropClicked: "backdropClicked" },
533
+ host: {
534
+ listeners: {
535
+ "@fadeBackdrop.done": "animationDone($event)",
536
+ "@fadeBackdrop.start": "animationStart($event)",
537
+ "click": "onBackdropClicked()"
538
+ },
539
+ properties: {
540
+ "class.interactable": "this.interactableClass",
541
+ "class.transparent": "this.transparent",
542
+ "class.fullscreen": "this.fullscreen",
543
+ "@fadeBackdrop": "this.fadeBackdropTrigger"
544
+ }
545
+ },
546
+ ngImport: i0,
547
+ template: "<ng-content></ng-content>",
548
+ isInline: true,
549
+ styles: [":host{display:block;background:#0000004d;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;pointer-events:auto;height:100%;width:100%;visibility:hidden;z-index:6}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.transparent{background:none}:host:focus,:host:active,:host:visited{outline:0}:host.fullscreen{position:absolute}\n"],
550
+ animations: [daffSidebarViewportBackdropAnimations.fadeBackdrop],
551
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
552
+ });
553
+ }
506
554
  };
507
-
508
- const getAnimationState = (interactable) => interactable ? 'interactable' : 'non-interactable';
509
-
510
- class DaffSidebarViewportBackdropComponent {
511
- constructor() {
512
- /**
513
- * @docs-private
514
- */
515
- this.interactableClass = true;
516
- /**
517
- * Determines whether or not the backdrop is transparent.
518
- */
519
- this.transparent = false;
520
- /**
521
- * Determines whether or not the backdrop is interactable.
522
- */
523
- this.interactable = true;
524
- /**
525
- * Boolean property that determines whether or not the
526
- * backdrop should fill up its containing window.
527
- */
528
- this.fullscreen = false;
529
- /**
530
- * Output event triggered when the backdrop is clicked.
531
- */
532
- this.backdropClicked = new EventEmitter();
533
- }
534
- /**
535
- * @docs-private
536
- */
537
- ngOnInit() {
538
- this.interactableClass = this.interactable;
539
- }
540
- /**
541
- * @docs-private
542
- *
543
- * Animation hook for that controls the backdrops
544
- * entrance and fade animations.
545
- */
546
- get fadeBackdropTrigger() {
547
- return getAnimationState(this.interactable);
548
- }
549
- /**
550
- * @docs-private
551
- */
552
- animationDone(e) {
553
- this.interactableClass = !(e.toState === ':leave' || e.toState === 'non-interactable');
554
- }
555
- /**
556
- * @docs-private
557
- */
558
- animationStart(e) {
559
- if (e.toState === ':enter' || e.toState === 'interactable') {
560
- this.interactableClass = true;
561
- }
562
- }
563
- /**
564
- * @docs-private
565
- */
566
- onBackdropClicked() {
567
- this.backdropClicked.emit();
568
- }
569
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarViewportBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffSidebarViewportBackdropComponent, isStandalone: true, selector: "daff-sidebar-viewport-backdrop", inputs: { transparent: "transparent", interactable: "interactable", fullscreen: "fullscreen" }, outputs: { backdropClicked: "backdropClicked" }, host: { listeners: { "@fadeBackdrop.done": "animationDone($event)", "@fadeBackdrop.start": "animationStart($event)", "click": "onBackdropClicked()" }, properties: { "class.interactable": "this.interactableClass", "class.transparent": "this.transparent", "class.fullscreen": "this.fullscreen", "@fadeBackdrop": "this.fadeBackdropTrigger" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;background:#0000004d;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;pointer-events:auto;height:100%;width:100%;visibility:hidden;z-index:6}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.transparent{background:none}:host:focus,:host:active,:host:visited{outline:0}:host.fullscreen{position:absolute}\n"], animations: [
571
- daffSidebarViewportBackdropAnimations.fadeBackdrop,
572
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
573
- }
574
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarViewportBackdropComponent, decorators: [{
575
- type: Component,
576
- args: [{ selector: 'daff-sidebar-viewport-backdrop', template: '<ng-content></ng-content>', animations: [
577
- daffSidebarViewportBackdropAnimations.fadeBackdrop,
578
- ], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;background:#0000004d;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;pointer-events:auto;height:100%;width:100%;visibility:hidden;z-index:6}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.transparent{background:none}:host:focus,:host:active,:host:visited{outline:0}:host.fullscreen{position:absolute}\n"] }]
579
- }], propDecorators: { interactableClass: [{
580
- type: HostBinding,
581
- args: ['class.interactable']
582
- }], transparent: [{
583
- type: Input
584
- }, {
585
- type: HostBinding,
586
- args: ['class.transparent']
587
- }], interactable: [{
588
- type: Input
589
- }], fullscreen: [{
590
- type: Input
591
- }, {
592
- type: HostBinding,
593
- args: ['class.fullscreen']
594
- }], backdropClicked: [{
595
- type: Output
596
- }], fadeBackdropTrigger: [{
597
- type: HostBinding,
598
- args: ['@fadeBackdrop']
599
- }], animationDone: [{
600
- type: HostListener,
601
- args: ['@fadeBackdrop.done', ['$event']]
602
- }], animationStart: [{
603
- type: HostListener,
604
- args: ['@fadeBackdrop.start', ['$event']]
605
- }], onBackdropClicked: [{
606
- type: HostListener,
607
- args: ['click']
608
- }] } });
609
-
610
- /**
611
- * DaffSidebarViewportComponent serves as the container for managing sidebars across an entire application.
612
- * Because it's a functional component, it supports multiple simultaneously open sidebar and is designed to
613
- * handle these scenarios gracefully.
614
- *
615
- * > However, there is one key contraint: only one sidebar per **mode** is allowed
616
- * on each **side** (e.g., left or right) at any given time.
617
- *
618
- * If this constraint is violated, the component will throw an exception to prevent unintended behavior.
619
- *
620
- * ```html
621
- * <daff-sidebar-viewport>
622
- * <daff-sidebar></daff-sidebar>
623
- * <div>Site content</div>
624
- * </daff-sidebar-viewport>
625
- * ```
626
- */
627
- class DaffSidebarViewportComponent {
628
- /**
629
- * @docs-private
630
- */
631
- onContentAnimationStart(e) {
632
- if (e.toState === 'open') {
633
- this._elementRef.nativeElement.style.overflow = 'clip';
634
- }
635
- }
636
- /**
637
- * @docs-private
638
- */
639
- onContentAnimationDone(e) {
640
- if (e.toState === 'closed') {
641
- this._elementRef.nativeElement.style.overflow = null;
642
- }
643
- }
644
- constructor(cdRef, _elementRef, bodyScroll, parentViewport, scroll) {
645
- this.cdRef = cdRef;
646
- this._elementRef = _elementRef;
647
- this.bodyScroll = bodyScroll;
648
- this.parentViewport = parentViewport;
649
- this.scroll = scroll;
650
- /**
651
- * The placement of the nav in relation to the sidebar. Note that this is really only available when there is a `side-fixed` sidebar.
652
- */
653
- this.navPlacement = DaffNavPlacementEnum.ABOVE;
654
- /**
655
- * The number of pixels that the main content of the page should be shifted to
656
- * right when there are child sidebars.
657
- */
658
- this._shift = '0px';
659
- /**
660
- * @docs-private
661
- */
662
- this._isPaddedLeft = false;
663
- /**
664
- * @docs-private
665
- */
666
- this._isPaddedRight = false;
667
- /**
668
- * @docs-private
669
- *
670
- * Whether or not the backdrop is interactable
671
- */
672
- this._backdropInteractable = false;
673
- /**
674
- * @docs-private
675
- *
676
- * The animation state
677
- */
678
- this._animationState = { value: DaffSidebarAnimationStates.CLOSED, params: { shift: '0px' } };
679
- /**
680
- * Event fired when the backdrop is clicked. This is often used to close the sidebar.
681
- */
682
- this.backdropClicked = new EventEmitter();
683
- }
684
- /**
685
- * @docs-private
686
- */
687
- ngAfterContentChecked() {
688
- const nextShift = sidebarViewportContentShift(this.sidebars) + 'px';
689
- if (this._shift !== nextShift) {
690
- this._shift = nextShift;
691
- this.updateAnimationState();
692
- this.cdRef.markForCheck();
693
- }
694
- const nextBackdropInteractable = sidebarViewportBackdropInteractable(this.sidebars);
695
- if (this._backdropInteractable !== nextBackdropInteractable) {
696
- this._backdropInteractable = nextBackdropInteractable;
697
- this.updateAnimationState();
698
- this.cdRef.markForCheck();
699
- if (nextBackdropInteractable) {
700
- if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) {
701
- this.bodyScroll.disable();
702
- }
703
- else {
704
- this.scroll.disable();
705
- }
706
- }
707
- else { //if we are hiding the sidebars
708
- if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) {
709
- this.bodyScroll.enable();
710
- }
711
- else {
712
- this.scroll.enable();
713
- }
714
- }
715
- }
716
- ;
717
- this._isPaddedLeft = isSidebarViewportContentPadded(this.sidebars, 'left');
718
- this._isPaddedRight = isSidebarViewportContentPadded(this.sidebars, 'right');
719
- }
720
- /**
721
- * @docs-private
722
- */
723
- ngOnDestroy() {
724
- if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) {
725
- this.bodyScroll.enable();
726
- }
727
- else {
728
- this.scroll.enable();
729
- }
730
- }
731
- /**
732
- * @docs-private
733
- *
734
- * Updates the animation state of the viewport depending upon the state
735
- * of all sidebars within the viewport.
736
- */
737
- updateAnimationState() {
738
- this._animationState = {
739
- value: getSidebarViewportAnimationState(this.sidebars.reduce((acc, sidebar) => acc || isViewportContentShifted(sidebar.mode, sidebar.open()), false)),
740
- params: { shift: this._shift },
741
- };
742
- }
743
- /**
744
- * @docs-private
745
- *
746
- * Called when the backdrop of the viewport is clicked upon.
747
- */
748
- _backdropClicked() {
749
- this.backdropClicked.emit();
750
- }
751
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarViewportComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: DAFF_SIDEBAR_SCROLL_TOKEN, skipSelf: true }, { token: DaffSidebarViewportComponent, optional: true, skipSelf: true }, { token: DAFF_SIDEBAR_SCROLL_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
752
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: DaffSidebarViewportComponent, isStandalone: true, selector: "daff-sidebar-viewport", inputs: { navPlacement: "navPlacement" }, outputs: { backdropClicked: "backdropClicked" }, host: { properties: { "class.beside": "navPlacement === \"beside\"", "class.above": "navPlacement === \"above\"", "class.pad-left": "_isPaddedLeft", "class.pad-right": "_isPaddedRight" }, classAttribute: "daff-sidebar-viewport" }, providers: [
753
- {
754
- provide: DAFF_SIDEBAR_SCROLL_TOKEN,
755
- useFactory: daffSidebarViewportScrollFactory,
756
- },
757
- ], queries: [{ propertyName: "sidebars", predicate: DaffSidebarComponent }], ngImport: i0, template: "<daff-sidebar-viewport-backdrop\n [@transformContent]=\"_animationState\"\n [interactable]=\"_backdropInteractable\"\n (backdropClicked)=\"_backdropClicked()\">\n</daff-sidebar-viewport-backdrop>\n\n<div class=\"daff-sidebar-viewport__nav\"\n [@transformContent]=\"_animationState\">\n <ng-content select=\"[daff-sidebar-viewport-nav]\"></ng-content>\n</div>\n\n<ng-content select=\"daff-sidebar:not([side=right])\"></ng-content>\n\n<div class=\"daff-sidebar-viewport__content\"\n [@transformContent]=\"_animationState\"\n (@transformContent.start)=\"onContentAnimationStart($event)\"\n (@transformContent.done)=\"onContentAnimationDone($event)\">\n <div class=\"daff-sidebar-viewport__inner\">\n <ng-content></ng-content>\n <div class=\"daff-sidebar-viewport__footer\">\n <ng-content select=\"[daff-sidebar-viewport-footer]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-content select=\"daff-sidebar[side=right]\"></ng-content>\n", styles: [":host{display:flex;min-height:100dvh;position:relative;width:100%;z-index:1}:host .daff-sidebar-viewport__inner{display:flex;flex-direction:column;height:100%}:host.pad-left .daff-sidebar-viewport__inner{padding-left:0}@media(min-width:1024px){:host.pad-left .daff-sidebar-viewport__inner{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:0}@media(min-width:1024px){:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-right .daff-sidebar-viewport__inner{padding-right:0}@media(min-width:1024px){:host.pad-right .daff-sidebar-viewport__inner{padding-right:var(--daff-sidebar-right-width, 240px)}}:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:0}@media(min-width:1024px){:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:var(--daff-sidebar-right-width, 240px)}}.daff-sidebar-viewport__content{flex:0 1 auto;width:100%;z-index:3;min-height:100%}.daff-sidebar-viewport__nav{position:fixed;top:0;width:100%;z-index:4}.daff-sidebar-viewport__nav:empty{display:none}.daff-sidebar-viewport__nav:not(:empty)~.daff-sidebar-viewport__content{margin-top:var(--daff-sidebar-side-fixed-top-shift, 64px)}.daff-sidebar-viewport__footer{margin-top:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport){transform:translate(0);min-height:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport) .daff-sidebar-viewport__inner{padding-left:0!important;padding-right:0!important}\n"], dependencies: [{ kind: "component", type: DaffSidebarViewportBackdropComponent, selector: "daff-sidebar-viewport-backdrop", inputs: ["transparent", "interactable", "fullscreen"], outputs: ["backdropClicked"] }], animations: [
758
- daffSidebarAnimations.transformContent,
759
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
760
- }
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarViewportComponent, decorators: [{
762
- type: Component,
763
- args: [{ selector: 'daff-sidebar-viewport', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
764
- daffSidebarAnimations.transformContent,
765
- ], providers: [
766
- {
767
- provide: DAFF_SIDEBAR_SCROLL_TOKEN,
768
- useFactory: daffSidebarViewportScrollFactory,
769
- },
770
- ], host: {
771
- 'class': 'daff-sidebar-viewport',
772
- '[class.beside]': 'navPlacement === "beside"',
773
- '[class.above]': 'navPlacement === "above"',
774
- '[class.pad-left]': '_isPaddedLeft',
775
- '[class.pad-right]': '_isPaddedRight',
776
- }, imports: [
777
- DaffSidebarViewportBackdropComponent,
778
- ], template: "<daff-sidebar-viewport-backdrop\n [@transformContent]=\"_animationState\"\n [interactable]=\"_backdropInteractable\"\n (backdropClicked)=\"_backdropClicked()\">\n</daff-sidebar-viewport-backdrop>\n\n<div class=\"daff-sidebar-viewport__nav\"\n [@transformContent]=\"_animationState\">\n <ng-content select=\"[daff-sidebar-viewport-nav]\"></ng-content>\n</div>\n\n<ng-content select=\"daff-sidebar:not([side=right])\"></ng-content>\n\n<div class=\"daff-sidebar-viewport__content\"\n [@transformContent]=\"_animationState\"\n (@transformContent.start)=\"onContentAnimationStart($event)\"\n (@transformContent.done)=\"onContentAnimationDone($event)\">\n <div class=\"daff-sidebar-viewport__inner\">\n <ng-content></ng-content>\n <div class=\"daff-sidebar-viewport__footer\">\n <ng-content select=\"[daff-sidebar-viewport-footer]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-content select=\"daff-sidebar[side=right]\"></ng-content>\n", styles: [":host{display:flex;min-height:100dvh;position:relative;width:100%;z-index:1}:host .daff-sidebar-viewport__inner{display:flex;flex-direction:column;height:100%}:host.pad-left .daff-sidebar-viewport__inner{padding-left:0}@media(min-width:1024px){:host.pad-left .daff-sidebar-viewport__inner{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:0}@media(min-width:1024px){:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-right .daff-sidebar-viewport__inner{padding-right:0}@media(min-width:1024px){:host.pad-right .daff-sidebar-viewport__inner{padding-right:var(--daff-sidebar-right-width, 240px)}}:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:0}@media(min-width:1024px){:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:var(--daff-sidebar-right-width, 240px)}}.daff-sidebar-viewport__content{flex:0 1 auto;width:100%;z-index:3;min-height:100%}.daff-sidebar-viewport__nav{position:fixed;top:0;width:100%;z-index:4}.daff-sidebar-viewport__nav:empty{display:none}.daff-sidebar-viewport__nav:not(:empty)~.daff-sidebar-viewport__content{margin-top:var(--daff-sidebar-side-fixed-top-shift, 64px)}.daff-sidebar-viewport__footer{margin-top:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport){transform:translate(0);min-height:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport) .daff-sidebar-viewport__inner{padding-left:0!important;padding-right:0!important}\n"] }]
779
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
780
- type: Inject,
781
- args: [DAFF_SIDEBAR_SCROLL_TOKEN]
782
- }, {
783
- type: SkipSelf
784
- }] }, { type: undefined, decorators: [{
785
- type: Inject,
786
- args: [DaffSidebarViewportComponent]
787
- }, {
788
- type: SkipSelf
789
- }, {
790
- type: Optional
791
- }] }, { type: undefined, decorators: [{
792
- type: Inject,
793
- args: [DAFF_SIDEBAR_SCROLL_TOKEN]
794
- }] }], propDecorators: { navPlacement: [{
795
- type: Input
796
- }], sidebars: [{
797
- type: ContentChildren,
798
- args: [DaffSidebarComponent, { descendants: false }]
799
- }], backdropClicked: [{
800
- type: Output
801
- }] } });
802
-
803
- /**
804
- * @deprecated in favor of {@link DAFF_SIDEBAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
805
- */
806
- class DaffSidebarModule {
807
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
808
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarModule, imports: [CommonModule,
809
- A11yModule,
810
- DaffSidebarComponent,
811
- DaffSidebarViewportComponent,
812
- DaffSidebarHeaderComponent,
813
- DaffSidebarFooterComponent,
814
- DaffSidebarHeaderTitleDirective], exports: [DaffSidebarComponent,
815
- DaffSidebarViewportComponent,
816
- DaffSidebarHeaderComponent,
817
- DaffSidebarFooterComponent,
818
- DaffSidebarHeaderTitleDirective] }); }
819
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarModule, imports: [CommonModule,
820
- A11yModule,
821
- DaffSidebarHeaderComponent] }); }
822
- }
823
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSidebarModule, decorators: [{
824
- type: NgModule,
825
- args: [{
826
- imports: [
827
- CommonModule,
828
- A11yModule,
829
- DaffSidebarComponent,
830
- DaffSidebarViewportComponent,
831
- DaffSidebarHeaderComponent,
832
- DaffSidebarFooterComponent,
833
- DaffSidebarHeaderTitleDirective,
834
- ],
835
- exports: [
836
- DaffSidebarComponent,
837
- DaffSidebarViewportComponent,
838
- DaffSidebarHeaderComponent,
839
- DaffSidebarFooterComponent,
840
- DaffSidebarHeaderTitleDirective,
841
- ],
842
- }]
843
- }] });
844
-
845
- /**
846
- * A service that stores the open state and ID of the currently opened sidebar.
847
- *
848
- * A default sidebar ID can be passed to the constructor that will be the initial value of `$id`.
849
- */
850
- class DaffSidebarService {
851
- get isOpen() {
852
- return this._open.asReadonly();
853
- }
854
- constructor(defaultId = null) {
855
- this._open = signal(false, ...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
856
- this._id$ = new BehaviorSubject(defaultId);
857
- this.id$ = this._id$.asObservable();
858
- }
859
- /**
860
- * Opens the specified sidebar.
861
- *
862
- * @param id The optional sidebar ID. If omitted the most recently passed opened sidebar ID will persist (or the default if none was passed).
863
- */
864
- open(id) {
865
- if (id) {
866
- this._id$.next(id);
867
- }
868
- this._open.set(true);
869
- }
870
- ;
871
- /**
872
- * Closes the sidebar. Does not clear the ID.
873
- */
874
- close() {
875
- this._open.set(false);
876
- }
877
- }
878
-
879
- const DOCKED_MODES = [
880
- "side" /* DaffSidebarModeEnum.Side */,
881
- "side-fixed" /* DaffSidebarModeEnum.SideFixed */,
882
- ];
883
- /**
884
- * Returns whether the passed mode is a docked mode, i.e. side or side-fixed.
885
- */
555
+ i0.ɵɵngDeclareClassMetadata({
556
+ minVersion: "12.0.0",
557
+ version: "22.2.4",
558
+ ngImport: i0,
559
+ type: DaffSidebarViewportBackdropComponent,
560
+ decorators: [{
561
+ type: Component,
562
+ args: [{
563
+ selector: "daff-sidebar-viewport-backdrop",
564
+ template: "<ng-content></ng-content>",
565
+ animations: [daffSidebarViewportBackdropAnimations.fadeBackdrop],
566
+ changeDetection: ChangeDetectionStrategy.OnPush,
567
+ styles: [":host{display:block;background:#0000004d;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;pointer-events:auto;height:100%;width:100%;visibility:hidden;z-index:6}:host.interactable{visibility:visible;pointer-events:all;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.transparent{background:none}:host:focus,:host:active,:host:visited{outline:0}:host.fullscreen{position:absolute}\n"]
568
+ }]
569
+ }],
570
+ propDecorators: {
571
+ interactableClass: [{
572
+ type: HostBinding,
573
+ args: ["class.interactable"]
574
+ }],
575
+ transparent: [{ type: Input }, {
576
+ type: HostBinding,
577
+ args: ["class.transparent"]
578
+ }],
579
+ interactable: [{ type: Input }],
580
+ fullscreen: [{ type: Input }, {
581
+ type: HostBinding,
582
+ args: ["class.fullscreen"]
583
+ }],
584
+ backdropClicked: [{ type: Output }],
585
+ fadeBackdropTrigger: [{
586
+ type: HostBinding,
587
+ args: ["@fadeBackdrop"]
588
+ }],
589
+ animationDone: [{
590
+ type: HostListener,
591
+ args: ["@fadeBackdrop.done", ["$event"]]
592
+ }],
593
+ animationStart: [{
594
+ type: HostListener,
595
+ args: ["@fadeBackdrop.start", ["$event"]]
596
+ }],
597
+ onBackdropClicked: [{
598
+ type: HostListener,
599
+ args: ["click"]
600
+ }]
601
+ }
602
+ });
603
+ var DaffSidebarViewportComponent = class DaffSidebarViewportComponent {
604
+ onContentAnimationStart(e) {
605
+ if (e.toState === "open") this._elementRef.nativeElement.style.overflow = "clip";
606
+ }
607
+ onContentAnimationDone(e) {
608
+ if (e.toState === "closed") this._elementRef.nativeElement.style.overflow = null;
609
+ }
610
+ constructor(cdRef, _elementRef, bodyScroll, parentViewport, scroll) {
611
+ this.cdRef = cdRef;
612
+ this._elementRef = _elementRef;
613
+ this.bodyScroll = bodyScroll;
614
+ this.parentViewport = parentViewport;
615
+ this.scroll = scroll;
616
+ this.navPlacement = DaffNavPlacementEnum.ABOVE;
617
+ this._shift = "0px";
618
+ this._isPaddedLeft = false;
619
+ this._isPaddedRight = false;
620
+ this._backdropInteractable = false;
621
+ this._animationState = {
622
+ value: DaffSidebarAnimationStates.CLOSED,
623
+ params: { shift: "0px" }
624
+ };
625
+ this.backdropClicked = new EventEmitter();
626
+ }
627
+ ngAfterContentChecked() {
628
+ const nextShift = sidebarViewportContentShift(this.sidebars) + "px";
629
+ if (this._shift !== nextShift) {
630
+ this._shift = nextShift;
631
+ this.updateAnimationState();
632
+ this.cdRef.markForCheck();
633
+ }
634
+ const nextBackdropInteractable = sidebarViewportBackdropInteractable(this.sidebars);
635
+ if (this._backdropInteractable !== nextBackdropInteractable) {
636
+ this._backdropInteractable = nextBackdropInteractable;
637
+ this.updateAnimationState();
638
+ this.cdRef.markForCheck();
639
+ if (nextBackdropInteractable) {
640
+ if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) this.bodyScroll.disable();
641
+ else this.scroll.disable();
642
+ } else if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) this.bodyScroll.enable();
643
+ else this.scroll.enable();
644
+ }
645
+ this._isPaddedLeft = isSidebarViewportContentPadded(this.sidebars, "left");
646
+ this._isPaddedRight = isSidebarViewportContentPadded(this.sidebars, "right");
647
+ }
648
+ ngOnDestroy() {
649
+ if (!this.parentViewport && !hasParentViewport(this._elementRef.nativeElement)) this.bodyScroll.enable();
650
+ else this.scroll.enable();
651
+ }
652
+ updateAnimationState() {
653
+ this._animationState = {
654
+ value: getSidebarViewportAnimationState(this.sidebars.reduce((acc, sidebar) => acc || isViewportContentShifted(sidebar.mode, sidebar.open()), false)),
655
+ params: { shift: this._shift }
656
+ };
657
+ }
658
+ _backdropClicked() {
659
+ this.backdropClicked.emit();
660
+ }
661
+ static {
662
+ this.ɵfac = i0.ɵɵngDeclareFactory({
663
+ minVersion: "12.0.0",
664
+ version: "22.2.4",
665
+ ngImport: i0,
666
+ type: DaffSidebarViewportComponent,
667
+ deps: [
668
+ { token: i0.ChangeDetectorRef },
669
+ { token: i0.ElementRef },
670
+ {
671
+ token: DAFF_SIDEBAR_SCROLL_TOKEN,
672
+ skipSelf: true
673
+ },
674
+ {
675
+ token: DaffSidebarViewportComponent,
676
+ optional: true,
677
+ skipSelf: true
678
+ },
679
+ { token: DAFF_SIDEBAR_SCROLL_TOKEN }
680
+ ],
681
+ target: i0.ɵɵFactoryTarget.Component
682
+ });
683
+ }
684
+ static {
685
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
686
+ minVersion: "14.0.0",
687
+ version: "22.2.4",
688
+ type: DaffSidebarViewportComponent,
689
+ isStandalone: true,
690
+ selector: "daff-sidebar-viewport",
691
+ inputs: { navPlacement: "navPlacement" },
692
+ outputs: { backdropClicked: "backdropClicked" },
693
+ host: {
694
+ properties: {
695
+ "class.beside": "navPlacement === \"beside\"",
696
+ "class.above": "navPlacement === \"above\"",
697
+ "class.pad-left": "_isPaddedLeft",
698
+ "class.pad-right": "_isPaddedRight"
699
+ },
700
+ classAttribute: "daff-sidebar-viewport"
701
+ },
702
+ providers: [{
703
+ provide: DAFF_SIDEBAR_SCROLL_TOKEN,
704
+ useFactory: daffSidebarViewportScrollFactory
705
+ }],
706
+ queries: [{
707
+ propertyName: "sidebars",
708
+ predicate: DaffSidebarComponent
709
+ }],
710
+ ngImport: i0,
711
+ template: "<daff-sidebar-viewport-backdrop\n [@transformContent]=\"_animationState\"\n [interactable]=\"_backdropInteractable\"\n (backdropClicked)=\"_backdropClicked()\">\n</daff-sidebar-viewport-backdrop>\n\n<div class=\"daff-sidebar-viewport__nav\"\n [@transformContent]=\"_animationState\">\n <ng-content select=\"[daff-sidebar-viewport-nav]\"></ng-content>\n</div>\n\n<ng-content select=\"daff-sidebar:not([side=right])\"></ng-content>\n\n<div class=\"daff-sidebar-viewport__content\"\n [@transformContent]=\"_animationState\"\n (@transformContent.start)=\"onContentAnimationStart($event)\"\n (@transformContent.done)=\"onContentAnimationDone($event)\">\n <div class=\"daff-sidebar-viewport__inner\">\n <ng-content></ng-content>\n <div class=\"daff-sidebar-viewport__footer\">\n <ng-content select=\"[daff-sidebar-viewport-footer]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-content select=\"daff-sidebar[side=right]\"></ng-content>\n",
712
+ styles: [":host{display:flex;min-height:100dvh;position:relative;width:100%;z-index:1}:host .daff-sidebar-viewport__inner{display:flex;flex-direction:column;height:100%}:host.pad-left .daff-sidebar-viewport__inner{padding-left:0}@media(min-width:1024px){:host.pad-left .daff-sidebar-viewport__inner{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:0}@media(min-width:1024px){:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-right .daff-sidebar-viewport__inner{padding-right:0}@media(min-width:1024px){:host.pad-right .daff-sidebar-viewport__inner{padding-right:var(--daff-sidebar-right-width, 240px)}}:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:0}@media(min-width:1024px){:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:var(--daff-sidebar-right-width, 240px)}}.daff-sidebar-viewport__content{flex:0 1 auto;width:100%;z-index:3;min-height:100%}.daff-sidebar-viewport__nav{position:fixed;top:0;width:100%;z-index:4}.daff-sidebar-viewport__nav:empty{display:none}.daff-sidebar-viewport__nav:not(:empty)~.daff-sidebar-viewport__content{margin-top:var(--daff-sidebar-side-fixed-top-shift, 64px)}.daff-sidebar-viewport__footer{margin-top:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport){transform:translate(0);min-height:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport) .daff-sidebar-viewport__inner{padding-left:0!important;padding-right:0!important}\n"],
713
+ dependencies: [{
714
+ kind: "component",
715
+ type: DaffSidebarViewportBackdropComponent,
716
+ selector: "daff-sidebar-viewport-backdrop",
717
+ inputs: [
718
+ "transparent",
719
+ "interactable",
720
+ "fullscreen"
721
+ ],
722
+ outputs: ["backdropClicked"]
723
+ }],
724
+ animations: [daffSidebarAnimations.transformContent],
725
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
726
+ });
727
+ }
728
+ };
729
+ i0.ɵɵngDeclareClassMetadata({
730
+ minVersion: "12.0.0",
731
+ version: "22.2.4",
732
+ ngImport: i0,
733
+ type: DaffSidebarViewportComponent,
734
+ decorators: [{
735
+ type: Component,
736
+ args: [{
737
+ selector: "daff-sidebar-viewport",
738
+ changeDetection: ChangeDetectionStrategy.OnPush,
739
+ animations: [daffSidebarAnimations.transformContent],
740
+ providers: [{
741
+ provide: DAFF_SIDEBAR_SCROLL_TOKEN,
742
+ useFactory: daffSidebarViewportScrollFactory
743
+ }],
744
+ host: {
745
+ "class": "daff-sidebar-viewport",
746
+ "[class.beside]": "navPlacement === \"beside\"",
747
+ "[class.above]": "navPlacement === \"above\"",
748
+ "[class.pad-left]": "_isPaddedLeft",
749
+ "[class.pad-right]": "_isPaddedRight"
750
+ },
751
+ imports: [DaffSidebarViewportBackdropComponent],
752
+ template: "<daff-sidebar-viewport-backdrop\n [@transformContent]=\"_animationState\"\n [interactable]=\"_backdropInteractable\"\n (backdropClicked)=\"_backdropClicked()\">\n</daff-sidebar-viewport-backdrop>\n\n<div class=\"daff-sidebar-viewport__nav\"\n [@transformContent]=\"_animationState\">\n <ng-content select=\"[daff-sidebar-viewport-nav]\"></ng-content>\n</div>\n\n<ng-content select=\"daff-sidebar:not([side=right])\"></ng-content>\n\n<div class=\"daff-sidebar-viewport__content\"\n [@transformContent]=\"_animationState\"\n (@transformContent.start)=\"onContentAnimationStart($event)\"\n (@transformContent.done)=\"onContentAnimationDone($event)\">\n <div class=\"daff-sidebar-viewport__inner\">\n <ng-content></ng-content>\n <div class=\"daff-sidebar-viewport__footer\">\n <ng-content select=\"[daff-sidebar-viewport-footer]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-content select=\"daff-sidebar[side=right]\"></ng-content>\n",
753
+ styles: [":host{display:flex;min-height:100dvh;position:relative;width:100%;z-index:1}:host .daff-sidebar-viewport__inner{display:flex;flex-direction:column;height:100%}:host.pad-left .daff-sidebar-viewport__inner{padding-left:0}@media(min-width:1024px){:host.pad-left .daff-sidebar-viewport__inner{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:0}@media(min-width:1024px){:host.pad-left.beside .daff-sidebar-viewport__nav{padding-left:var(--daff-sidebar-left-width, 240px)}}:host.pad-right .daff-sidebar-viewport__inner{padding-right:0}@media(min-width:1024px){:host.pad-right .daff-sidebar-viewport__inner{padding-right:var(--daff-sidebar-right-width, 240px)}}:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:0}@media(min-width:1024px){:host.pad-right.beside .daff-sidebar-viewport__nav{padding-right:var(--daff-sidebar-right-width, 240px)}}.daff-sidebar-viewport__content{flex:0 1 auto;width:100%;z-index:3;min-height:100%}.daff-sidebar-viewport__nav{position:fixed;top:0;width:100%;z-index:4}.daff-sidebar-viewport__nav:empty{display:none}.daff-sidebar-viewport__nav:not(:empty)~.daff-sidebar-viewport__content{margin-top:var(--daff-sidebar-side-fixed-top-shift, 64px)}.daff-sidebar-viewport__footer{margin-top:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport){transform:translate(0);min-height:auto}:host-context(daff-sidebar-viewport daff-sidebar-viewport) .daff-sidebar-viewport__inner{padding-left:0!important;padding-right:0!important}\n"]
754
+ }]
755
+ }],
756
+ ctorParameters: () => [
757
+ { type: i0.ChangeDetectorRef },
758
+ { type: i0.ElementRef },
759
+ {
760
+ type: void 0,
761
+ decorators: [{
762
+ type: Inject,
763
+ args: [DAFF_SIDEBAR_SCROLL_TOKEN]
764
+ }, { type: SkipSelf }]
765
+ },
766
+ {
767
+ type: void 0,
768
+ decorators: [
769
+ {
770
+ type: Inject,
771
+ args: [DaffSidebarViewportComponent]
772
+ },
773
+ { type: SkipSelf },
774
+ { type: Optional }
775
+ ]
776
+ },
777
+ {
778
+ type: void 0,
779
+ decorators: [{
780
+ type: Inject,
781
+ args: [DAFF_SIDEBAR_SCROLL_TOKEN]
782
+ }]
783
+ }
784
+ ],
785
+ propDecorators: {
786
+ navPlacement: [{ type: Input }],
787
+ sidebars: [{
788
+ type: ContentChildren,
789
+ args: [DaffSidebarComponent, { descendants: false }]
790
+ }],
791
+ backdropClicked: [{ type: Output }]
792
+ }
793
+ });
794
+ var DaffSidebarModule = class DaffSidebarModule {
795
+ static {
796
+ this.ɵfac = i0.ɵɵngDeclareFactory({
797
+ minVersion: "12.0.0",
798
+ version: "22.2.4",
799
+ ngImport: i0,
800
+ type: DaffSidebarModule,
801
+ deps: [],
802
+ target: i0.ɵɵFactoryTarget.NgModule
803
+ });
804
+ }
805
+ static {
806
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
807
+ minVersion: "14.0.0",
808
+ version: "22.2.4",
809
+ ngImport: i0,
810
+ type: DaffSidebarModule,
811
+ imports: [
812
+ CommonModule,
813
+ A11yModule,
814
+ DaffSidebarComponent,
815
+ DaffSidebarViewportComponent,
816
+ DaffSidebarHeaderComponent,
817
+ DaffSidebarFooterComponent,
818
+ DaffSidebarHeaderTitleDirective
819
+ ],
820
+ exports: [
821
+ DaffSidebarComponent,
822
+ DaffSidebarViewportComponent,
823
+ DaffSidebarHeaderComponent,
824
+ DaffSidebarFooterComponent,
825
+ DaffSidebarHeaderTitleDirective
826
+ ]
827
+ });
828
+ }
829
+ static {
830
+ this.ɵinj = i0.ɵɵngDeclareInjector({
831
+ minVersion: "12.0.0",
832
+ version: "22.2.4",
833
+ ngImport: i0,
834
+ type: DaffSidebarModule,
835
+ imports: [
836
+ CommonModule,
837
+ A11yModule,
838
+ DaffSidebarHeaderComponent
839
+ ]
840
+ });
841
+ }
842
+ };
843
+ i0.ɵɵngDeclareClassMetadata({
844
+ minVersion: "12.0.0",
845
+ version: "22.2.4",
846
+ ngImport: i0,
847
+ type: DaffSidebarModule,
848
+ decorators: [{
849
+ type: NgModule,
850
+ args: [{
851
+ imports: [
852
+ CommonModule,
853
+ A11yModule,
854
+ DaffSidebarComponent,
855
+ DaffSidebarViewportComponent,
856
+ DaffSidebarHeaderComponent,
857
+ DaffSidebarFooterComponent,
858
+ DaffSidebarHeaderTitleDirective
859
+ ],
860
+ exports: [
861
+ DaffSidebarComponent,
862
+ DaffSidebarViewportComponent,
863
+ DaffSidebarHeaderComponent,
864
+ DaffSidebarFooterComponent,
865
+ DaffSidebarHeaderTitleDirective
866
+ ]
867
+ }]
868
+ }]
869
+ });
870
+ var DaffSidebarService = class {
871
+ get isOpen() {
872
+ return this._open.asReadonly();
873
+ }
874
+ constructor(defaultId = null) {
875
+ this._open = signal(false, ...ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []);
876
+ this._id$ = new BehaviorSubject(defaultId);
877
+ this.id$ = this._id$.asObservable();
878
+ }
879
+ open(id) {
880
+ if (id) this._id$.next(id);
881
+ this._open.set(true);
882
+ }
883
+ close() {
884
+ this._open.set(false);
885
+ }
886
+ };
887
+ const DOCKED_MODES = ["side", "side-fixed"];
886
888
  const daffSidebarIsDockedMode = (mode) => DOCKED_MODES.includes(mode);
887
-
888
- const FLOATING_MODES = [
889
- "under" /* DaffSidebarModeEnum.Under */,
890
- "over" /* DaffSidebarModeEnum.Over */,
891
- ];
892
- /**
893
- * Returns whether the passed mode is a floating mode, i.e. under or over.
894
- */
889
+ const FLOATING_MODES = ["under", "over"];
895
890
  const daffSidebarIsFloatingMode = (mode) => FLOATING_MODES.includes(mode);
896
-
897
- /**
898
- * @docs-private
899
- */
900
891
  const DAFF_SIDEBAR_COMPONENTS = [
901
- DaffSidebarComponent,
902
- DaffSidebarViewportComponent,
903
- DaffSidebarHeaderComponent,
904
- DaffSidebarFooterComponent,
905
- DaffSidebarHeaderTitleDirective,
892
+ DaffSidebarComponent,
893
+ DaffSidebarViewportComponent,
894
+ DaffSidebarHeaderComponent,
895
+ DaffSidebarFooterComponent,
896
+ DaffSidebarHeaderTitleDirective
906
897
  ];
907
-
908
- /**
909
- * Generated bundle index. Do not edit.
910
- */
911
-
912
898
  export { DAFF_SIDEBAR_COMPONENTS, DaffSidebarComponent, DaffSidebarFooterComponent, DaffSidebarHeaderComponent, DaffSidebarHeaderTitleDirective, DaffSidebarModule, DaffSidebarService, DaffSidebarViewportComponent, daffSidebarIsDockedMode, daffSidebarIsFloatingMode };
913
- //# sourceMappingURL=daffodil-design-sidebar.mjs.map
899
+
900
+ //# sourceMappingURL=daffodil-design-sidebar.mjs.map