@design-factory/angular 21.0.3 → 21.1.0-next.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 (194) hide show
  1. package/drawer/README.md +54 -0
  2. package/fesm2022/design-factory-angular-drawer.mjs +202 -67
  3. package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
  4. package/fesm2022/design-factory-angular-internals.mjs +439 -17
  5. package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
  6. package/fesm2022/design-factory-angular-sidenav.mjs +223 -210
  7. package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
  8. package/fesm2022/design-factory-angular-theme.mjs +198 -0
  9. package/fesm2022/design-factory-angular-theme.mjs.map +1 -0
  10. package/fesm2022/design-factory-angular-topnav.mjs +1538 -0
  11. package/fesm2022/design-factory-angular-topnav.mjs.map +1 -0
  12. package/node_modules/@agnos-ui/core/README.md +5 -0
  13. package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +314 -0
  14. package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +315 -0
  15. package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +9 -0
  16. package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +10 -0
  17. package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +94 -0
  18. package/node_modules/@agnos-ui/core/collapse-CP79atna.js +95 -0
  19. package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +73 -0
  20. package/node_modules/@agnos-ui/core/common-DFyZvkII.js +74 -0
  21. package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +333 -0
  22. package/node_modules/@agnos-ui/core/components/accordion/index.cjs +7 -0
  23. package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +1 -0
  24. package/node_modules/@agnos-ui/core/components/accordion/index.js +7 -0
  25. package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +37 -0
  26. package/node_modules/@agnos-ui/core/components/alert/common.d.ts +138 -0
  27. package/node_modules/@agnos-ui/core/components/alert/index.cjs +5 -0
  28. package/node_modules/@agnos-ui/core/components/alert/index.d.ts +1 -0
  29. package/node_modules/@agnos-ui/core/components/alert/index.js +5 -0
  30. package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +247 -0
  31. package/node_modules/@agnos-ui/core/components/carousel/index.cjs +292 -0
  32. package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +1 -0
  33. package/node_modules/@agnos-ui/core/components/carousel/index.js +292 -0
  34. package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +135 -0
  35. package/node_modules/@agnos-ui/core/components/collapse/index.cjs +5 -0
  36. package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +1 -0
  37. package/node_modules/@agnos-ui/core/components/collapse/index.js +5 -0
  38. package/node_modules/@agnos-ui/core/components/commonProps.d.ts +11 -0
  39. package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +279 -0
  40. package/node_modules/@agnos-ui/core/components/drawer/index.cjs +5 -0
  41. package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +1 -0
  42. package/node_modules/@agnos-ui/core/components/drawer/index.js +5 -0
  43. package/node_modules/@agnos-ui/core/components/modal/index.cjs +8 -0
  44. package/node_modules/@agnos-ui/core/components/modal/index.d.ts +1 -0
  45. package/node_modules/@agnos-ui/core/components/modal/index.js +8 -0
  46. package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +245 -0
  47. package/node_modules/@agnos-ui/core/components/pagination/index.cjs +5 -0
  48. package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +1 -0
  49. package/node_modules/@agnos-ui/core/components/pagination/index.js +5 -0
  50. package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +313 -0
  51. package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +5 -0
  52. package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +1 -0
  53. package/node_modules/@agnos-ui/core/components/progressbar/index.js +5 -0
  54. package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +91 -0
  55. package/node_modules/@agnos-ui/core/components/rating/index.cjs +5 -0
  56. package/node_modules/@agnos-ui/core/components/rating/index.d.ts +1 -0
  57. package/node_modules/@agnos-ui/core/components/rating/index.js +5 -0
  58. package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +191 -0
  59. package/node_modules/@agnos-ui/core/components/slider/index.cjs +5 -0
  60. package/node_modules/@agnos-ui/core/components/slider/index.d.ts +1 -0
  61. package/node_modules/@agnos-ui/core/components/slider/index.js +5 -0
  62. package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +25 -0
  63. package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +383 -0
  64. package/node_modules/@agnos-ui/core/components/toast/index.cjs +7 -0
  65. package/node_modules/@agnos-ui/core/components/toast/index.d.ts +2 -0
  66. package/node_modules/@agnos-ui/core/components/toast/index.js +7 -0
  67. package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +66 -0
  68. package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +128 -0
  69. package/node_modules/@agnos-ui/core/components/tree/index.cjs +5 -0
  70. package/node_modules/@agnos-ui/core/components/tree/index.d.ts +1 -0
  71. package/node_modules/@agnos-ui/core/components/tree/index.js +5 -0
  72. package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +143 -0
  73. package/node_modules/@agnos-ui/core/config.cjs +36 -0
  74. package/node_modules/@agnos-ui/core/config.d.ts +117 -0
  75. package/node_modules/@agnos-ui/core/config.js +36 -0
  76. package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +523 -0
  77. package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +522 -0
  78. package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +328 -0
  79. package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +329 -0
  80. package/node_modules/@agnos-ui/core/index.cjs +134 -0
  81. package/node_modules/@agnos-ui/core/index.d.ts +29 -0
  82. package/node_modules/@agnos-ui/core/index.js +134 -0
  83. package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +32 -0
  84. package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +31 -0
  85. package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +252 -0
  86. package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +253 -0
  87. package/node_modules/@agnos-ui/core/package.json +57 -0
  88. package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +255 -0
  89. package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +254 -0
  90. package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +86 -0
  91. package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +87 -0
  92. package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +118 -0
  93. package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +119 -0
  94. package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +184 -0
  95. package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +183 -0
  96. package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +30 -0
  97. package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +31 -0
  98. package/node_modules/@agnos-ui/core/services/extendWidget.cjs +41 -0
  99. package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +31 -0
  100. package/node_modules/@agnos-ui/core/services/extendWidget.js +41 -0
  101. package/node_modules/@agnos-ui/core/services/floatingUI.cjs +111 -0
  102. package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +76 -0
  103. package/node_modules/@agnos-ui/core/services/floatingUI.js +111 -0
  104. package/node_modules/@agnos-ui/core/services/focusElement.cjs +46 -0
  105. package/node_modules/@agnos-ui/core/services/focusElement.d.ts +9 -0
  106. package/node_modules/@agnos-ui/core/services/focusElement.js +46 -0
  107. package/node_modules/@agnos-ui/core/services/focustrack.cjs +47 -0
  108. package/node_modules/@agnos-ui/core/services/focustrack.d.ts +40 -0
  109. package/node_modules/@agnos-ui/core/services/focustrack.js +47 -0
  110. package/node_modules/@agnos-ui/core/services/hash.cjs +15 -0
  111. package/node_modules/@agnos-ui/core/services/hash.d.ts +3 -0
  112. package/node_modules/@agnos-ui/core/services/hash.js +15 -0
  113. package/node_modules/@agnos-ui/core/services/intersection.cjs +53 -0
  114. package/node_modules/@agnos-ui/core/services/intersection.d.ts +30 -0
  115. package/node_modules/@agnos-ui/core/services/intersection.js +53 -0
  116. package/node_modules/@agnos-ui/core/services/matchMedia.cjs +14 -0
  117. package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +8 -0
  118. package/node_modules/@agnos-ui/core/services/matchMedia.js +14 -0
  119. package/node_modules/@agnos-ui/core/services/navManager.cjs +166 -0
  120. package/node_modules/@agnos-ui/core/services/navManager.d.ts +144 -0
  121. package/node_modules/@agnos-ui/core/services/navManager.js +166 -0
  122. package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +60 -0
  123. package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +42 -0
  124. package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +60 -0
  125. package/node_modules/@agnos-ui/core/services/portal.cjs +42 -0
  126. package/node_modules/@agnos-ui/core/services/portal.d.ts +16 -0
  127. package/node_modules/@agnos-ui/core/services/portal.js +42 -0
  128. package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +54 -0
  129. package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +18 -0
  130. package/node_modules/@agnos-ui/core/services/resizeObserver.js +54 -0
  131. package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +44 -0
  132. package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +16 -0
  133. package/node_modules/@agnos-ui/core/services/siblingsInert.js +44 -0
  134. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +186 -0
  135. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +166 -0
  136. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +186 -0
  137. package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +40 -0
  138. package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +49 -0
  139. package/node_modules/@agnos-ui/core/services/transitions/collapse.js +40 -0
  140. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +32 -0
  141. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +25 -0
  142. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +32 -0
  143. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +37 -0
  144. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +47 -0
  145. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +37 -0
  146. package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +807 -0
  147. package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +808 -0
  148. package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +4 -0
  149. package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +3 -0
  150. package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +190 -0
  151. package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +191 -0
  152. package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +228 -0
  153. package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +229 -0
  154. package/node_modules/@agnos-ui/core/types.cjs +6 -0
  155. package/node_modules/@agnos-ui/core/types.d.ts +246 -0
  156. package/node_modules/@agnos-ui/core/types.js +6 -0
  157. package/node_modules/@agnos-ui/core/utils/directive.cjs +28 -0
  158. package/node_modules/@agnos-ui/core/utils/directive.d.ts +352 -0
  159. package/node_modules/@agnos-ui/core/utils/directive.js +28 -0
  160. package/node_modules/@agnos-ui/core/utils/func.cjs +7 -0
  161. package/node_modules/@agnos-ui/core/utils/func.d.ts +11 -0
  162. package/node_modules/@agnos-ui/core/utils/func.js +7 -0
  163. package/node_modules/@agnos-ui/core/utils/id.cjs +5 -0
  164. package/node_modules/@agnos-ui/core/utils/id.d.ts +6 -0
  165. package/node_modules/@agnos-ui/core/utils/id.js +5 -0
  166. package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +10 -0
  167. package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +57 -0
  168. package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +75 -0
  169. package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +9 -0
  170. package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +5 -0
  171. package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +98 -0
  172. package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +8 -0
  173. package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +16 -0
  174. package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +17 -0
  175. package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +7 -0
  176. package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +54 -0
  177. package/node_modules/@agnos-ui/core/utils/stores.cjs +172 -0
  178. package/node_modules/@agnos-ui/core/utils/stores.d.ts +224 -0
  179. package/node_modules/@agnos-ui/core/utils/stores.js +172 -0
  180. package/node_modules/@agnos-ui/core/utils/widget.cjs +8 -0
  181. package/node_modules/@agnos-ui/core/utils/widget.d.ts +11 -0
  182. package/node_modules/@agnos-ui/core/utils/widget.js +8 -0
  183. package/node_modules/@agnos-ui/core/utils/writables.cjs +16 -0
  184. package/node_modules/@agnos-ui/core/utils/writables.d.ts +95 -0
  185. package/node_modules/@agnos-ui/core/utils/writables.js +16 -0
  186. package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +103 -0
  187. package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +102 -0
  188. package/package.json +25 -6
  189. package/schematics/collection.json +1 -1
  190. package/types/design-factory-angular-drawer.d.ts +71 -13
  191. package/types/design-factory-angular-internals.d.ts +220 -31
  192. package/types/design-factory-angular-sidenav.d.ts +15 -7
  193. package/types/design-factory-angular-theme.d.ts +122 -0
  194. package/types/design-factory-angular-topnav.d.ts +435 -0
@@ -1,17 +1,53 @@
1
- import * as _agnos_ui_angular_headless from '@agnos-ui/angular-headless';
2
- import { DrawerWidget, NavManagerItemConfig } from '@agnos-ui/angular-headless';
1
+ import * as _agnos_ui_core_services_navManager from '@agnos-ui/core/services/navManager';
2
+ import { NavManagerItemConfig } from '@agnos-ui/core/services/navManager';
3
3
  import * as _angular_core from '@angular/core';
4
+ import { TemplateRef } from '@angular/core';
5
+ import { DrawerWidget, DrawerConfiguration, DrawerPosition } from '@agnos-ui/core/components/drawer';
4
6
  import { AgnosWidgetDirective } from '@design-factory/angular/internals';
5
7
 
6
8
  /**
7
- * Possible values for the drawer positions.
9
+ * Available drawer positions.
8
10
  */
9
- type DrawerPositions = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
11
+ type DfDrawerPosition = DrawerPosition;
12
+ /**
13
+ * Available drawer display configurations.
14
+ * - `'overlay'`: the drawer overlays the page content with a backdrop.
15
+ * - `'inline'`: the drawer stays in the document flow and moves content as it expands/resizes.
16
+ */
17
+ type DfDrawerConfiguration = DrawerConfiguration;
18
+ /**
19
+ * Marks an `<ng-template>` as drawer header content.
20
+ */
21
+ declare class DfDrawerHeaderTemplate {
22
+ readonly templateRef: TemplateRef<any>;
23
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfDrawerHeaderTemplate, never>;
24
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DfDrawerHeaderTemplate, "ng-template[dfDrawerHeader]", never, {}, {}, never, never, true, never>;
25
+ }
26
+ /**
27
+ * Marks an `<ng-template>` as drawer body content.
28
+ */
29
+ declare class DfDrawerBodyTemplate {
30
+ readonly templateRef: TemplateRef<any>;
31
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfDrawerBodyTemplate, never>;
32
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DfDrawerBodyTemplate, "ng-template[dfDrawerBody]", never, {}, {}, never, never, true, never>;
33
+ }
34
+ /**
35
+ * Marks an `<ng-template>` as drawer footer content.
36
+ */
37
+ declare class DfDrawerFooterTemplate {
38
+ readonly templateRef: TemplateRef<any>;
39
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfDrawerFooterTemplate, never>;
40
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DfDrawerFooterTemplate, "ng-template[dfDrawerFooter]", never, {}, {}, never, never, true, never>;
41
+ }
10
42
  /**
11
43
  * Enables users to show contextual content via a sliding panel from any screen edge.
12
44
  * @experimental
13
45
  */
14
- declare class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {
46
+ declare class DfDrawer extends AgnosWidgetDirective<DrawerWidget> {
47
+ protected readonly headerTemplate: _angular_core.Signal<DfDrawerHeaderTemplate | undefined>;
48
+ protected readonly bodyTemplate: _angular_core.Signal<DfDrawerBodyTemplate | undefined>;
49
+ protected readonly footerTemplate: _angular_core.Signal<DfDrawerFooterTemplate | undefined>;
50
+ protected readonly hasSectionTemplates: _angular_core.Signal<boolean>;
15
51
  /**
16
52
  * CSS classes to be applied on the widget main container
17
53
  *
@@ -63,9 +99,23 @@ declare class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {
63
99
  * If `true`, the drawer element is kept in the DOM when it is not visible.
64
100
  * This can be useful to preserve the state of the drawer content when it is hidden.
65
101
  *
66
- * @defaultValue `true`
102
+ * @defaultValue `false`
67
103
  */
68
104
  readonly keepInDom: _angular_core.InputSignalWithTransform<boolean, unknown>;
105
+ /**
106
+ * The display configuration of the drawer.
107
+ * - `'overlay'` (default): the drawer overlays the page content with a backdrop.
108
+ * - `'inline'`: the drawer stays in the document flow and moves content as it expands/resizes.
109
+ *
110
+ * @defaultValue `'overlay'`
111
+ */
112
+ readonly configuration: _angular_core.InputSignal<DrawerConfiguration>;
113
+ /**
114
+ * The position of the drawer on the screen.
115
+ *
116
+ * @defaultValue `'inline-start'`
117
+ */
118
+ readonly position: _angular_core.InputSignal<DrawerPosition>;
69
119
  /**
70
120
  * An event emitted when the width is changed.
71
121
  *
@@ -121,7 +171,7 @@ declare class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {
121
171
  * @defaultValue `true`
122
172
  */
123
173
  readonly focusOnInit: _angular_core.InputSignalWithTransform<boolean, unknown>;
124
- protected readonly navManager: _agnos_ui_angular_headless.NavManager<unknown>;
174
+ protected readonly navManager: _agnos_ui_core_services_navManager.NavManager<unknown>;
125
175
  protected readonly navManagerConfig: NavManagerItemConfig;
126
176
  /**
127
177
  * Event to be triggered when the minimum size is reached.
@@ -138,15 +188,23 @@ declare class DfDrawerComponent extends AgnosWidgetDirective<DrawerWidget> {
138
188
  constructor();
139
189
  /**
140
190
  * Trigger the opening of the drawer.
191
+ *
192
+ * @param animated - whether the transition should be animated. If the parameter is not defined, the `animated` is defined by the component input or the default config.
193
+ *
194
+ * @returns A promise that resolves once the opening transition has finished.
141
195
  */
142
- open(): void;
196
+ open(animated?: boolean): Promise<void>;
143
197
  /**
144
198
  * Trigger the closing of the drawer.
199
+ *
200
+ * @param animated - whether the transition should be animated. If the parameter is not defined, the `animated` is defined by the component input or the default config.
201
+ *
202
+ * @returns A promise that resolves once the closing transition has finished.
145
203
  */
146
- close(): void;
147
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfDrawerComponent, never>;
148
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DfDrawerComponent, "df-drawer", never, { "className": { "alias": "className"; "required": false; "isSignal": true; }; "bodyScroll": { "alias": "bodyScroll"; "required": false; "isSignal": true; }; "backdrop": { "alias": "backdrop"; "required": false; "isSignal": true; }; "container": { "alias": "container"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "keepInDom": { "alias": "keepInDom"; "required": false; "isSignal": true; }; "focusOnInit": { "alias": "focusOnInit"; "required": false; "isSignal": true; }; }, { "size": "sizeChange"; "sizeChange": "sizeChange"; "visibleChange": "visibleChange"; "minimizedChange": "minimizedChange"; "maximizedChange": "maximizedChange"; "resizingChange": "resizingChange"; "minSize": "minSize"; "maxSize": "maxSize"; }, never, ["*", "df-drawer-splitter-content"], true, never>;
204
+ close(animated?: boolean): Promise<void>;
205
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfDrawer, never>;
206
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DfDrawer, "df-drawer", never, { "className": { "alias": "className"; "required": false; "isSignal": true; }; "bodyScroll": { "alias": "bodyScroll"; "required": false; "isSignal": true; }; "backdrop": { "alias": "backdrop"; "required": false; "isSignal": true; }; "container": { "alias": "container"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "keepInDom": { "alias": "keepInDom"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "focusOnInit": { "alias": "focusOnInit"; "required": false; "isSignal": true; }; }, { "size": "sizeChange"; "sizeChange": "sizeChange"; "visibleChange": "visibleChange"; "minimizedChange": "minimizedChange"; "maximizedChange": "maximizedChange"; "resizingChange": "resizingChange"; "minSize": "minSize"; "maxSize": "maxSize"; }, ["headerTemplate", "bodyTemplate", "footerTemplate"], ["*", "df-drawer-splitter-content"], true, never>;
149
207
  }
150
208
 
151
- export { DfDrawerComponent };
152
- export type { DrawerPositions };
209
+ export { DfDrawer, DfDrawerBodyTemplate, DfDrawerFooterTemplate, DfDrawerHeaderTemplate };
210
+ export type { DfDrawerConfiguration, DfDrawerPosition };
@@ -1,19 +1,47 @@
1
- import * as _angular_core from '@angular/core';
2
- import { FactoryProvider, OnChanges, OnInit, AfterContentChecked, SimpleChanges } from '@angular/core';
3
- import * as _agnos_ui_angular_headless from '@agnos-ui/angular-headless';
4
- import { WidgetsConfigStore, Widget, AngularWidget } from '@agnos-ui/angular-headless';
5
- import { ReadableSignal } from '@amadeus-it-group/tansu';
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, FactoryProvider, OnChanges, WritableSignal as WritableSignal$1, OnInit, SimpleChanges } from '@angular/core';
3
+ import * as _amadeus_it_group_tansu from '@amadeus-it-group/tansu';
4
+ import { ReadableSignal, WritableSignal } from '@amadeus-it-group/tansu';
5
+ import * as _agnos_ui_core_types from '@agnos-ui/core/types';
6
+ import { Widget, WidgetState, WidgetFactory, WidgetProps, Directive, DirectiveAndParam, DirectivesAndOptParam } from '@agnos-ui/core/types';
6
7
 
7
- declare const provideWidgetsConfig: (adaptParentConfig?: ((config: Partial<{
8
- [x: string]: object;
9
- }>) => Partial<{
10
- [x: string]: object;
11
- }>) | undefined) => FactoryProvider;
12
- declare const injectWidgetsConfig: (config?: Partial<{
13
- [x: string]: object;
14
- }> | undefined) => WidgetsConfigStore<{
15
- [widgetName: string]: object;
16
- }>;
8
+ /**
9
+ * Represents the state of an Angular widget, where each key in the widget's state
10
+ * is mapped to a Signal of the corresponding state value.
11
+ *
12
+ * @template W - The type of the widget.
13
+ */
14
+ type AngularState<W extends Widget> = {
15
+ [key in keyof WidgetState<W>]: Signal<WidgetState<W>[key]>;
16
+ };
17
+ /**
18
+ * Represents an Angular widget that extends a base widget type.
19
+ *
20
+ * @template W - The type of the base widget.
21
+ */
22
+ interface AngularWidget<W extends Widget> extends Pick<W, 'api' | 'directives' | 'patch'> {
23
+ /**
24
+ * A promise that resolves when the widget is initialized
25
+ */
26
+ initialized: Promise<void>;
27
+ /**
28
+ * The state of the widget. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}
29
+ */
30
+ state: AngularState<W>;
31
+ /**
32
+ * A function to initialize the Angular widget.
33
+ */
34
+ ngInit: () => void;
35
+ }
36
+
37
+ /**
38
+ * Injects the configuration for a specific widget.
39
+ *
40
+ * @template T - The type of the widget configuration to be injected.
41
+ * @param widgetName - The name of the widget whose configuration is to be injected.
42
+ * @returns A `ReadableSignal` that provides a partial configuration of the specified widget or `undefined` if the configuration is not available.
43
+ */
44
+ declare const injectWidgetConfig: <T>(widgetName: string) => ReadableSignal<Partial<T> | undefined>;
17
45
  /**
18
46
  * Creates and initializes a widget using the provided factory and configuration options.
19
47
  *
@@ -24,18 +52,14 @@ declare const injectWidgetsConfig: (config?: Partial<{
24
52
  * @param options - The options for creating the widget.
25
53
  * @param options.defaultConfig - The default configuration for the widget.
26
54
  * @param options.events - The event handlers for the widget.
27
- * @param options.slotTemplates - A function that returns the slot templates for the widget.
28
- * @param options.slotChildren - A function that returns the slot children for the widget.
29
55
  * @param options.afterInit - A callback function to be called after the widget is initialized.
30
56
  * @returns The initialized widget.
31
57
  */
32
- declare const callWidgetFactory: <W extends _agnos_ui_angular_headless.Widget>(factory: _agnos_ui_angular_headless.WidgetFactory<W>, options?: {
33
- defaultConfig?: Partial<_agnos_ui_angular_headless.WidgetProps<W>> | ReadableSignal<Partial<_agnos_ui_angular_headless.WidgetProps<W>> | undefined>;
34
- events?: Partial<Pick<_agnos_ui_angular_headless.WidgetProps<W>, keyof _agnos_ui_angular_headless.WidgetProps<W> & `on${string}`>>;
35
- afterInit?: (widget: _agnos_ui_angular_headless.AngularWidget<W>) => void;
36
- slotTemplates?: () => { [K in keyof _agnos_ui_angular_headless.WidgetProps<W> as _agnos_ui_angular_headless.IsSlotContent<_agnos_ui_angular_headless.WidgetProps<W>[K]> extends 0 ? never : K]: _agnos_ui_angular_headless.WidgetProps<W>[K] extends _agnos_ui_angular_headless.SlotContent<infer U> ? _angular_core.TemplateRef<U> | undefined : never; };
37
- slotChildren?: () => _angular_core.TemplateRef<void> | undefined;
38
- }) => _agnos_ui_angular_headless.AngularWidget<W>;
58
+ declare const callWidgetFactory: <W extends Widget>(factory: WidgetFactory<W>, options?: {
59
+ defaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;
60
+ events?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;
61
+ afterInit?: (widget: AngularWidget<W>) => void;
62
+ }) => AngularWidget<W>;
39
63
  /**
40
64
  * Utility to provide configuration for a specific DF component.
41
65
  *
@@ -59,7 +83,140 @@ declare const provideDfComponentConfig: <T>(componentKey: string) => (config?: P
59
83
  * @param componentKey the key of the component in the global configuration
60
84
  * @returns the inject function that returns the writable component configuration
61
85
  */
62
- declare const injectDfComponentConfig: <T>(componentKey: string) => () => _angular_core.WritableSignal<Partial<T>>;
86
+ declare const injectDfComponentConfig: <T>(componentKey: string) => () => i0.WritableSignal<Partial<T>>;
87
+
88
+ /**
89
+ * A utility function to manage the lifecycle of a directive for a host element.
90
+ *
91
+ * This function handles the creation, updating, and destruction of a directive instance
92
+ * associated with a host element. It ensures that the directive is called appropriately
93
+ * based on the platform (server or client) and manages the directive's lifecycle within
94
+ * the Angular injection context.
95
+ *
96
+ * @template T - The type of parameters that the directive accepts.
97
+ *
98
+ * @param [directive] - The directive to be applied to the host element.
99
+ * @param [params] - The parameters to be passed to the directive.
100
+ *
101
+ * @returns An object containing an `update` function to update the directive and its parameters.
102
+ */
103
+ declare const useDirectiveForHost: <T>(directive?: Directive<T>, params?: T) => {
104
+ update: (newDirective?: Directive<T>, newParams?: T) => void;
105
+ };
106
+ /**
107
+ * A directive that allows the use of another directive with optional parameters.
108
+ *
109
+ * @template T - The type of the parameter that can be passed to the directive.
110
+ *
111
+ * @remarks
112
+ * This directive uses a private instance of {@link useDirectiveForHost} to manage the directive and its parameter.
113
+ */
114
+ declare class UseDirective<T> implements OnChanges {
115
+ #private;
116
+ readonly use: i0.InputSignal<Directive | DirectiveAndParam<T>>;
117
+ /** @internal */
118
+ ngOnChanges(): void;
119
+ static ɵfac: i0.ɵɵFactoryDeclaration<UseDirective<any>, never>;
120
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UseDirective<any>, "[dfUse]", never, { "use": { "alias": "dfUse"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
121
+ }
122
+ /**
123
+ * A directive that allows the use of multiple directives on a host element.
124
+ *
125
+ * @template T - A tuple type representing the directives and their optional parameters.
126
+ */
127
+ declare class UseMultiDirective<T extends any[]> implements OnChanges {
128
+ #private;
129
+ /**
130
+ * An input property that takes a tuple of directives and their optional parameters.
131
+ */
132
+ readonly useMulti: i0.InputSignal<DirectivesAndOptParam<T, _agnos_ui_core_types.SSRHTMLElement>>;
133
+ /** @internal */
134
+ ngOnChanges(): void;
135
+ static ɵfac: i0.ɵɵFactoryDeclaration<UseMultiDirective<any>, never>;
136
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UseMultiDirective<any>, "[dfUseMulti]", never, { "useMulti": { "alias": "dfUseMulti"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
137
+ }
138
+
139
+ /**
140
+ * Converts a Tansu `ReadableSignal` to an Angular `Signal`.
141
+ *
142
+ * This function wraps the provided Tansu signal in an Angular signal. It subscribes to the
143
+ * Tansu signal and updates the Angular signal with the received values. The equality function
144
+ * for the Angular signal is set to always return false, ensuring that every new value from the
145
+ * Tansu signal triggers an update.
146
+ *
147
+ * @template T - The type of the value emitted by the signals.
148
+ * @param tansuSignal - The Tansu signal to convert.
149
+ * @returns - The resulting Angular signal.
150
+ */
151
+ declare const toAngularSignal: <T>(tansuSignal: ReadableSignal<T>) => Signal<T>;
152
+ /**
153
+ * Converts a Tansu `WritableSignal` to an Angular `WritableSignal`.
154
+ *
155
+ * This function wraps the provided Tansu signal in an Angular signal. It subscribes to the
156
+ * Tansu signal and updates the Angular signal with the received values. The equality function
157
+ * for the Angular signal is set to always return false, ensuring that every new value from the
158
+ * Tansu signal triggers an update.
159
+ *
160
+ * @template T - The type of the value emitted by the signals.
161
+ * @param tansuSignal - The Tansu signal to convert.
162
+ * @returns - The resulting Angular signal.
163
+ */
164
+ declare const toAngularWritableSignal: <T>(tansuSignal: WritableSignal<T>) => WritableSignal$1<T>;
165
+
166
+ /**
167
+ * Call a widget factory using provided configs.
168
+ *
169
+ * The resulting widget can be easily hooked into the lifecycle of an Angular component through {@link BaseWidgetDirective}.
170
+ *
171
+ * @param factory - the widget factory to call
172
+ * @param options - the options
173
+ * @param options.defaultConfig - the default config of the widget
174
+ * @param options.widgetConfig - the config of the widget, overriding the defaultConfig
175
+ * @param options.events - the events of the widget
176
+ * @param options.afterInit - a callback to call after successful setup of the widget
177
+ * @returns the widget
178
+ */
179
+ declare const callWidgetFactoryWithConfig: <W extends Widget>(factory: WidgetFactory<W>, options?: {
180
+ defaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;
181
+ widgetConfig?: null | undefined | ReadableSignal<Partial<WidgetProps<W>> | undefined>;
182
+ events?: Partial<Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}`>>;
183
+ afterInit?: (widget: AngularWidget<W>) => void;
184
+ }) => AngularWidget<W>;
185
+ /**
186
+ * An abstract base class for widget directives, providing common functionality
187
+ * for Angular components that interact with widgets.
188
+ *
189
+ * @template W - The type of the widget.
190
+ */
191
+ declare abstract class BaseWidgetDirective<W extends Widget> implements OnChanges, OnInit {
192
+ private readonly _widget;
193
+ private readonly propRenames?;
194
+ constructor(_widget: AngularWidget<W>, propRenames?: Record<string, string> | undefined);
195
+ /**
196
+ * Retrieves the widget api
197
+ * @returns the widget api
198
+ */
199
+ get api(): W['api'];
200
+ /**
201
+ * Retrieves the widget state. Each property of the state is exposed through an Angular {@link https://angular.dev/api/core/Signal | Signal}
202
+ * @returns the widget state
203
+ */
204
+ get state(): AngularState<W>;
205
+ /**
206
+ * Retrieves the widget directives
207
+ * @returns the widget directives
208
+ */
209
+ get directives(): W['directives'];
210
+ /**
211
+ * @inheritdoc
212
+ * @internal
213
+ */
214
+ ngOnChanges(changes: SimpleChanges): void;
215
+ /** @internal */
216
+ ngOnInit(): void;
217
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseWidgetDirective<any>, never>;
218
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseWidgetDirective<any>, never, never, {}, {}, never, never, true, never>;
219
+ }
63
220
 
64
221
  /**
65
222
  * An abstract base class for widget directives, providing common functionality
@@ -67,17 +224,49 @@ declare const injectDfComponentConfig: <T>(componentKey: string) => () => _angul
67
224
  *
68
225
  * @template W - The type of the widget.
69
226
  */
70
- declare abstract class AgnosWidgetDirective<W extends Widget> implements OnChanges, OnInit, AfterContentChecked {
227
+ declare abstract class AgnosWidgetDirective<W extends Widget> implements OnChanges, OnInit {
71
228
  protected readonly _agnosWidget: AngularWidget<W>;
72
229
  constructor(_agnosWidget: AngularWidget<W>);
73
230
  /** @internal */
74
231
  ngOnChanges(changes: SimpleChanges): void;
75
232
  /** @internal */
76
233
  ngOnInit(): void;
77
- /** @internal */
78
- ngAfterContentChecked(): void;
79
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgnosWidgetDirective<any>, never>;
80
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AgnosWidgetDirective<any>, never, never, {}, {}, never, never, true, never>;
234
+ /**
235
+ * Access to the widget state.
236
+ */
237
+ protected get state(): AngularWidget<W>['state'];
238
+ /**
239
+ * Access to the widget API.
240
+ */
241
+ protected get api(): AngularWidget<W>['api'];
242
+ /**
243
+ * Access to the widget directives.
244
+ */
245
+ protected get directives(): AngularWidget<W>['directives'];
246
+ static ɵfac: i0.ɵɵFactoryDeclaration<AgnosWidgetDirective<any>, never>;
247
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AgnosWidgetDirective<any>, never, never, {}, {}, never, never, true, never>;
81
248
  }
82
249
 
83
- export { AgnosWidgetDirective, callWidgetFactory, injectDfComponentConfig, injectWidgetsConfig, provideDfComponentConfig, provideWidgetsConfig };
250
+ /**
251
+ * sm breakpoint,
252
+ * tansu signal that returns true when the viewport is at least 576px wide
253
+ */
254
+ declare const sm$: _amadeus_it_group_tansu.ReadableSignal<boolean>;
255
+ /**
256
+ * md breakpoint,
257
+ * tansu signal that returns true when the viewport is at least 768px wide
258
+ */
259
+ declare const md$: _amadeus_it_group_tansu.ReadableSignal<boolean>;
260
+ /**
261
+ * lg breakpoint,
262
+ * tansu signal that returns true when the viewport is at least 992px wide
263
+ */
264
+ declare const lg$: _amadeus_it_group_tansu.ReadableSignal<boolean>;
265
+ /**
266
+ * xl breakpoint,
267
+ * tansu signal that returns true when the viewport is at least 1200px wide
268
+ */
269
+ declare const xl$: _amadeus_it_group_tansu.ReadableSignal<boolean>;
270
+
271
+ export { AgnosWidgetDirective, BaseWidgetDirective, UseDirective, UseMultiDirective, callWidgetFactory, callWidgetFactoryWithConfig, injectDfComponentConfig, injectWidgetConfig, lg$, md$, provideDfComponentConfig, sm$, toAngularSignal, toAngularWritableSignal, useDirectiveForHost, xl$ };
272
+ export type { AngularState, AngularWidget };
@@ -1,5 +1,5 @@
1
- import * as _agnos_ui_angular_headless from '@agnos-ui/angular-headless';
2
- import { NavManagerItemConfig } from '@agnos-ui/angular-headless';
1
+ import * as _agnos_ui_core_services_navManager from '@agnos-ui/core/services/navManager';
2
+ import { NavManagerItemConfig } from '@agnos-ui/core/services/navManager';
3
3
  import * as _angular_core from '@angular/core';
4
4
  import { ElementRef, Signal, AfterContentInit } from '@angular/core';
5
5
  import { IsActiveMatchOptions } from '@angular/router';
@@ -35,7 +35,6 @@ declare abstract class DfSidenavLinkBaseComponent {
35
35
  readonly routerLinkActiveOptions: _angular_core.InputSignal<IsActiveMatchOptions | {
36
36
  exact: boolean;
37
37
  }>;
38
- protected readonly isSmallScreen: _angular_core.Signal<boolean>;
39
38
  protected readonly sidenav: DfSidenavComponent;
40
39
  protected readonly parentItem: DfSidenavItemComponent | null;
41
40
  protected readonly isFirstLevel: boolean;
@@ -44,6 +43,7 @@ declare abstract class DfSidenavLinkBaseComponent {
44
43
  * Computed signal indicating if the link is visible based on search term
45
44
  */
46
45
  protected readonly isVisible: _angular_core.Signal<boolean>;
46
+ protected toggleSidenavOnSmallScreen(): boolean;
47
47
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfSidenavLinkBaseComponent, never>;
48
48
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DfSidenavLinkBaseComponent, never, never, { "linkPath": { "alias": "linkPath"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "wrapperHasIconContent": { "alias": "wrapperHasIconContent"; "required": false; "isSignal": true; }; "routerLinkActiveOptions": { "alias": "routerLinkActiveOptions"; "required": false; "isSignal": true; }; }, {}, ["iconContent"], never, true, never>;
49
49
  }
@@ -276,6 +276,12 @@ declare class DfSidenavComponent implements AfterContentInit {
276
276
  * @default true
277
277
  */
278
278
  readonly enableMobile: _angular_core.InputSignalWithTransform<boolean, unknown>;
279
+ /**
280
+ * @since 21.1.0
281
+ *
282
+ * Flag to disable the automatic scroll to active link on desktop when the sidenav is initialized.
283
+ */
284
+ readonly disableInitialDesktopAutoScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
279
285
  protected readonly _isMinimized: _angular_core.WritableSignal<boolean>;
280
286
  /**
281
287
  * Flag to indicate if the sidenav is minimized
@@ -293,20 +299,22 @@ declare class DfSidenavComponent implements AfterContentInit {
293
299
  protected readonly searchTerm: _angular_core.WritableSignal<string>;
294
300
  protected readonly mobileNavigationStack: _angular_core.WritableSignal<(DfSidenavItemComponent | null | undefined)[]>;
295
301
  protected readonly currentMobilePanel: Signal<DfSidenavItemComponent | null | undefined>;
302
+ private readonly isMd;
303
+ private readonly isLg;
296
304
  protected readonly isSmallScreen: Signal<boolean>;
297
305
  protected readonly isMediumScreen: Signal<boolean>;
298
306
  protected readonly isLargeUpScreen: Signal<boolean>;
299
307
  protected readonly isMobileOrSmallScreen: Signal<boolean>;
300
308
  protected readonly backdrop: Signal<boolean>;
301
- protected readonly navManager: _agnos_ui_angular_headless.NavManager<unknown>;
309
+ protected readonly navManager: _agnos_ui_core_services_navManager.NavManager<unknown>;
302
310
  protected readonly navManagerConfig: NavManagerItemConfig;
303
311
  private readonly injector;
304
312
  constructor();
305
313
  ngAfterContentInit(): void;
306
314
  /**
307
315
  * This method allows to center and show the active link, when the sidenav is used in desktop and a large screen.
308
- * It collapses all items and expands only the parents of the active link.
309
- * Also, it scrolls to the active link to make it visible.
316
+ *
317
+ * It collapses all items and expands only the parents of the active link and scrolls to the active link to make it visible.
310
318
  */
311
319
  private initializeDesktopNavigation;
312
320
  /**
@@ -345,7 +353,7 @@ declare class DfSidenavComponent implements AfterContentInit {
345
353
  private navigateToActiveItem;
346
354
  protected readonly contentHasIcons: Signal<boolean>;
347
355
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DfSidenavComponent, never>;
348
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DfSidenavComponent, "df-sidenav", never, { "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "enableMobile": { "alias": "enableMobile"; "required": false; "isSignal": true; }; }, {}, ["allLinks", "allItems"], ["*"], true, never>;
356
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DfSidenavComponent, "df-sidenav", never, { "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "enableMobile": { "alias": "enableMobile"; "required": false; "isSignal": true; }; "disableInitialDesktopAutoScroll": { "alias": "disableInitialDesktopAutoScroll"; "required": false; "isSignal": true; }; }, {}, ["allLinks", "allItems"], ["*"], true, never>;
349
357
  }
350
358
 
351
359
  /**
@@ -0,0 +1,122 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, WritableSignal } from '@angular/core';
3
+
4
+ /**
5
+ * The view transition animation configuration for {@link DfThemeService}.
6
+ *
7
+ * @since 21.1
8
+ */
9
+ type DfViewTransitionAnimation<T extends string> = {
10
+ /**
11
+ * The setup function is called before the view transition starts. It can be used to prepare the DOM for the upcoming theme change, e.g. by adding necessary styles or classes.
12
+ */
13
+ setup?: () => Promise<void> | void;
14
+ /**
15
+ * The animation function is called after the view transition has started. It can be used to perform any necessary animations during the theme change. The function receives the theme that is being applied as an argument.
16
+ */
17
+ animation: (theme: T) => Promise<void> | void;
18
+ /**
19
+ * The cleanup function is called after the view transition has completed. It can be used to remove any temporary styles or classes added during the setup or animation phases.
20
+ */
21
+ cleanup?: () => Promise<void> | void;
22
+ };
23
+ /**
24
+ * The DfThemeService is an abstract service that manages the theme state of the application.
25
+ *
26
+ * It provides functionality to select and apply themes, persist user preferences, and handle system theme changes.
27
+ *
28
+ * @since 21.1
29
+ */
30
+ declare abstract class DfThemeService<ThemeMode extends string> {
31
+ #private;
32
+ /**
33
+ * The default light theme.
34
+ */
35
+ private readonly defaultLight;
36
+ /**
37
+ * The default dark theme.
38
+ */
39
+ private readonly defaultDark;
40
+ /**
41
+ * An array of all available theme options. Must include at least the default light and dark themes, and optionally 'auto' if the service should support automatic theme selection based on system preferences.
42
+ */
43
+ abstract readonly allOptions: ThemeMode[];
44
+ /**
45
+ * The key used to store the user's theme preference in local storage. This is required if `syncLocalStorage` is true.
46
+ */
47
+ abstract readonly storageKey: string;
48
+ /**
49
+ * Whether to synchronize the user's theme selection with local storage. If true, the service will persist the selected theme in local storage and listen for changes to update the theme across tabs/frames.
50
+ */
51
+ abstract readonly syncLocalStorage: boolean;
52
+ /**
53
+ * The view transition animation configuration. If provided, the service will use the View Transitions API to animate theme changes. If not provided, theme changes will be applied immediately without animation.
54
+ */
55
+ abstract readonly viewTransitionAnimation: DfViewTransitionAnimation<Exclude<ThemeMode, 'auto'>> | undefined;
56
+ /**
57
+ * The currently selected theme option by the user.
58
+ */
59
+ readonly selected: Signal<ThemeMode>;
60
+ /**
61
+ * The currently applied theme. This signal is triggered after the view transition has started.
62
+ */
63
+ readonly applied: WritableSignal<Exclude<ThemeMode, 'auto'>>;
64
+ constructor(
65
+ /**
66
+ * The default light theme.
67
+ */
68
+ defaultLight: Exclude<ThemeMode, 'auto'>,
69
+ /**
70
+ * The default dark theme.
71
+ */
72
+ defaultDark: Exclude<ThemeMode, 'auto'>);
73
+ protected init(): void;
74
+ setTheme(theme: ThemeMode): void;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<DfThemeService<any>, never>;
76
+ static ɵprov: i0.ɵɵInjectableDeclaration<DfThemeService<any>>;
77
+ }
78
+ /**
79
+ * The modes supported by the {@link DfThemeDefaultService}.
80
+ *
81
+ * @since 21.1
82
+ */
83
+ type DfThemeDefaultMode = 'auto' | 'light' | 'dark';
84
+ /**
85
+ * The storage key used by the {@link DfThemeDefaultService} to persist the user's theme selection in local storage.
86
+ *
87
+ * @since 21.1
88
+ */
89
+ declare const DF_THEME_DEFAULT_STORAGE_KEY = "df-theme";
90
+ /**
91
+ * The default {@link DfThemeService} implementation.
92
+ *
93
+ * - It supports the modes `auto`, `light` and `dark`, and uses local storage to persist the user's selection.
94
+ * - It provides a cross fade transition when changing themes.
95
+ *
96
+ * @since 21.1
97
+ */
98
+ declare class DfThemeDefaultService extends DfThemeService<DfThemeDefaultMode> {
99
+ readonly allOptions: ("auto" | "light" | "dark")[];
100
+ readonly storageKey = "df-theme";
101
+ readonly syncLocalStorage = true;
102
+ private styleElement;
103
+ readonly viewTransitionAnimation: {
104
+ setup: () => void;
105
+ animation: () => void;
106
+ cleanup: () => void;
107
+ };
108
+ constructor();
109
+ static ɵfac: i0.ɵɵFactoryDeclaration<DfThemeDefaultService, never>;
110
+ static ɵprov: i0.ɵɵInjectableDeclaration<DfThemeDefaultService>;
111
+ }
112
+ /**
113
+ * Provides the {@link DfThemeService} and initializes it on app startup.
114
+ *
115
+ * This should be included in the providers array of the root module or component to ensure the theme service is available and initialized when the application starts.
116
+ *
117
+ * @since 21.1
118
+ */
119
+ declare const provideDfThemeService: () => i0.EnvironmentProviders;
120
+
121
+ export { DF_THEME_DEFAULT_STORAGE_KEY, DfThemeDefaultService, DfThemeService, provideDfThemeService };
122
+ export type { DfThemeDefaultMode, DfViewTransitionAnimation };