@design-factory/angular 21.1.0-next.0 → 21.1.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 (191) hide show
  1. package/fesm2022/design-factory-angular-drawer.mjs +22 -29
  2. package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
  3. package/fesm2022/design-factory-angular-internals.mjs +5 -5
  4. package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
  5. package/fesm2022/design-factory-angular-sidenav.mjs +139 -62
  6. package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
  7. package/fesm2022/design-factory-angular-theme.mjs +1 -1
  8. package/fesm2022/design-factory-angular-theme.mjs.map +1 -1
  9. package/fesm2022/design-factory-angular-topnav.mjs +152 -75
  10. package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
  11. package/package.json +3 -6
  12. package/types/design-factory-angular-drawer.d.ts +13 -14
  13. package/types/design-factory-angular-internals.d.ts +3 -3
  14. package/types/design-factory-angular-sidenav.d.ts +19 -6
  15. package/types/design-factory-angular-topnav.d.ts +13 -6
  16. package/node_modules/@agnos-ui/core/README.md +0 -5
  17. package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +0 -314
  18. package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +0 -315
  19. package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +0 -9
  20. package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +0 -10
  21. package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +0 -94
  22. package/node_modules/@agnos-ui/core/collapse-CP79atna.js +0 -95
  23. package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +0 -73
  24. package/node_modules/@agnos-ui/core/common-DFyZvkII.js +0 -74
  25. package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +0 -333
  26. package/node_modules/@agnos-ui/core/components/accordion/index.cjs +0 -7
  27. package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +0 -1
  28. package/node_modules/@agnos-ui/core/components/accordion/index.js +0 -7
  29. package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +0 -37
  30. package/node_modules/@agnos-ui/core/components/alert/common.d.ts +0 -138
  31. package/node_modules/@agnos-ui/core/components/alert/index.cjs +0 -5
  32. package/node_modules/@agnos-ui/core/components/alert/index.d.ts +0 -1
  33. package/node_modules/@agnos-ui/core/components/alert/index.js +0 -5
  34. package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +0 -247
  35. package/node_modules/@agnos-ui/core/components/carousel/index.cjs +0 -292
  36. package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +0 -1
  37. package/node_modules/@agnos-ui/core/components/carousel/index.js +0 -292
  38. package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +0 -135
  39. package/node_modules/@agnos-ui/core/components/collapse/index.cjs +0 -5
  40. package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +0 -1
  41. package/node_modules/@agnos-ui/core/components/collapse/index.js +0 -5
  42. package/node_modules/@agnos-ui/core/components/commonProps.d.ts +0 -11
  43. package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +0 -279
  44. package/node_modules/@agnos-ui/core/components/drawer/index.cjs +0 -5
  45. package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +0 -1
  46. package/node_modules/@agnos-ui/core/components/drawer/index.js +0 -5
  47. package/node_modules/@agnos-ui/core/components/modal/index.cjs +0 -8
  48. package/node_modules/@agnos-ui/core/components/modal/index.d.ts +0 -1
  49. package/node_modules/@agnos-ui/core/components/modal/index.js +0 -8
  50. package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +0 -245
  51. package/node_modules/@agnos-ui/core/components/pagination/index.cjs +0 -5
  52. package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +0 -1
  53. package/node_modules/@agnos-ui/core/components/pagination/index.js +0 -5
  54. package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +0 -313
  55. package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +0 -5
  56. package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +0 -1
  57. package/node_modules/@agnos-ui/core/components/progressbar/index.js +0 -5
  58. package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +0 -91
  59. package/node_modules/@agnos-ui/core/components/rating/index.cjs +0 -5
  60. package/node_modules/@agnos-ui/core/components/rating/index.d.ts +0 -1
  61. package/node_modules/@agnos-ui/core/components/rating/index.js +0 -5
  62. package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +0 -191
  63. package/node_modules/@agnos-ui/core/components/slider/index.cjs +0 -5
  64. package/node_modules/@agnos-ui/core/components/slider/index.d.ts +0 -1
  65. package/node_modules/@agnos-ui/core/components/slider/index.js +0 -5
  66. package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +0 -25
  67. package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +0 -383
  68. package/node_modules/@agnos-ui/core/components/toast/index.cjs +0 -7
  69. package/node_modules/@agnos-ui/core/components/toast/index.d.ts +0 -2
  70. package/node_modules/@agnos-ui/core/components/toast/index.js +0 -7
  71. package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +0 -66
  72. package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +0 -128
  73. package/node_modules/@agnos-ui/core/components/tree/index.cjs +0 -5
  74. package/node_modules/@agnos-ui/core/components/tree/index.d.ts +0 -1
  75. package/node_modules/@agnos-ui/core/components/tree/index.js +0 -5
  76. package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +0 -143
  77. package/node_modules/@agnos-ui/core/config.cjs +0 -36
  78. package/node_modules/@agnos-ui/core/config.d.ts +0 -117
  79. package/node_modules/@agnos-ui/core/config.js +0 -36
  80. package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +0 -523
  81. package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +0 -522
  82. package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +0 -328
  83. package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +0 -329
  84. package/node_modules/@agnos-ui/core/index.cjs +0 -134
  85. package/node_modules/@agnos-ui/core/index.d.ts +0 -29
  86. package/node_modules/@agnos-ui/core/index.js +0 -134
  87. package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +0 -32
  88. package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +0 -31
  89. package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +0 -252
  90. package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +0 -253
  91. package/node_modules/@agnos-ui/core/package.json +0 -57
  92. package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +0 -255
  93. package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +0 -254
  94. package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +0 -86
  95. package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +0 -87
  96. package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +0 -118
  97. package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +0 -119
  98. package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +0 -184
  99. package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +0 -183
  100. package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +0 -30
  101. package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +0 -31
  102. package/node_modules/@agnos-ui/core/services/extendWidget.cjs +0 -41
  103. package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +0 -31
  104. package/node_modules/@agnos-ui/core/services/extendWidget.js +0 -41
  105. package/node_modules/@agnos-ui/core/services/floatingUI.cjs +0 -111
  106. package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +0 -76
  107. package/node_modules/@agnos-ui/core/services/floatingUI.js +0 -111
  108. package/node_modules/@agnos-ui/core/services/focusElement.cjs +0 -46
  109. package/node_modules/@agnos-ui/core/services/focusElement.d.ts +0 -9
  110. package/node_modules/@agnos-ui/core/services/focusElement.js +0 -46
  111. package/node_modules/@agnos-ui/core/services/focustrack.cjs +0 -47
  112. package/node_modules/@agnos-ui/core/services/focustrack.d.ts +0 -40
  113. package/node_modules/@agnos-ui/core/services/focustrack.js +0 -47
  114. package/node_modules/@agnos-ui/core/services/hash.cjs +0 -15
  115. package/node_modules/@agnos-ui/core/services/hash.d.ts +0 -3
  116. package/node_modules/@agnos-ui/core/services/hash.js +0 -15
  117. package/node_modules/@agnos-ui/core/services/intersection.cjs +0 -53
  118. package/node_modules/@agnos-ui/core/services/intersection.d.ts +0 -30
  119. package/node_modules/@agnos-ui/core/services/intersection.js +0 -53
  120. package/node_modules/@agnos-ui/core/services/matchMedia.cjs +0 -14
  121. package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +0 -8
  122. package/node_modules/@agnos-ui/core/services/matchMedia.js +0 -14
  123. package/node_modules/@agnos-ui/core/services/navManager.cjs +0 -166
  124. package/node_modules/@agnos-ui/core/services/navManager.d.ts +0 -144
  125. package/node_modules/@agnos-ui/core/services/navManager.js +0 -166
  126. package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +0 -60
  127. package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +0 -42
  128. package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +0 -60
  129. package/node_modules/@agnos-ui/core/services/portal.cjs +0 -42
  130. package/node_modules/@agnos-ui/core/services/portal.d.ts +0 -16
  131. package/node_modules/@agnos-ui/core/services/portal.js +0 -42
  132. package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +0 -54
  133. package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +0 -18
  134. package/node_modules/@agnos-ui/core/services/resizeObserver.js +0 -54
  135. package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +0 -44
  136. package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +0 -16
  137. package/node_modules/@agnos-ui/core/services/siblingsInert.js +0 -44
  138. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +0 -186
  139. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +0 -166
  140. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +0 -186
  141. package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +0 -40
  142. package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +0 -49
  143. package/node_modules/@agnos-ui/core/services/transitions/collapse.js +0 -40
  144. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +0 -32
  145. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +0 -25
  146. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +0 -32
  147. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +0 -37
  148. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +0 -47
  149. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +0 -37
  150. package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +0 -807
  151. package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +0 -808
  152. package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +0 -4
  153. package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +0 -3
  154. package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +0 -190
  155. package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +0 -191
  156. package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +0 -228
  157. package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +0 -229
  158. package/node_modules/@agnos-ui/core/types.cjs +0 -6
  159. package/node_modules/@agnos-ui/core/types.d.ts +0 -246
  160. package/node_modules/@agnos-ui/core/types.js +0 -6
  161. package/node_modules/@agnos-ui/core/utils/directive.cjs +0 -28
  162. package/node_modules/@agnos-ui/core/utils/directive.d.ts +0 -352
  163. package/node_modules/@agnos-ui/core/utils/directive.js +0 -28
  164. package/node_modules/@agnos-ui/core/utils/func.cjs +0 -7
  165. package/node_modules/@agnos-ui/core/utils/func.d.ts +0 -11
  166. package/node_modules/@agnos-ui/core/utils/func.js +0 -7
  167. package/node_modules/@agnos-ui/core/utils/id.cjs +0 -5
  168. package/node_modules/@agnos-ui/core/utils/id.d.ts +0 -6
  169. package/node_modules/@agnos-ui/core/utils/id.js +0 -5
  170. package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +0 -10
  171. package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +0 -57
  172. package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +0 -75
  173. package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +0 -9
  174. package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +0 -5
  175. package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +0 -98
  176. package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +0 -8
  177. package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +0 -16
  178. package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +0 -17
  179. package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +0 -7
  180. package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +0 -54
  181. package/node_modules/@agnos-ui/core/utils/stores.cjs +0 -172
  182. package/node_modules/@agnos-ui/core/utils/stores.d.ts +0 -224
  183. package/node_modules/@agnos-ui/core/utils/stores.js +0 -172
  184. package/node_modules/@agnos-ui/core/utils/widget.cjs +0 -8
  185. package/node_modules/@agnos-ui/core/utils/widget.d.ts +0 -11
  186. package/node_modules/@agnos-ui/core/utils/widget.js +0 -8
  187. package/node_modules/@agnos-ui/core/utils/writables.cjs +0 -16
  188. package/node_modules/@agnos-ui/core/utils/writables.d.ts +0 -95
  189. package/node_modules/@agnos-ui/core/utils/writables.js +0 -16
  190. package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +0 -103
  191. package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +0 -102
@@ -1,143 +0,0 @@
1
- import type { Directive, WidgetFactory } from '../../types';
2
- import { type Widget } from '../../types';
3
- import type { WidgetsCommonPropsAndState } from '../commonProps';
4
- /**
5
- * Represents a tree item component.
6
- */
7
- export interface TreeItem {
8
- /**
9
- * Optional accessibility label for the node
10
- */
11
- ariaLabel?: string;
12
- /**
13
- * Optional array of children nodes
14
- */
15
- children?: TreeItem[];
16
- /**
17
- * If `true` the node is expanded
18
- */
19
- isExpanded?: boolean;
20
- /**
21
- * String title of the node
22
- */
23
- label: string;
24
- }
25
- /**
26
- * Normalized TreeItem object
27
- */
28
- export interface NormalizedTreeItem extends TreeItem {
29
- /**
30
- * Accessibility label for the node
31
- */
32
- ariaLabel: string;
33
- /**
34
- * Level in the hierarchy, starts with 0 for a root node
35
- */
36
- level: number;
37
- /**
38
- * An array of children nodes
39
- */
40
- children: NormalizedTreeItem[];
41
- }
42
- interface TreeCommonPropsAndState extends WidgetsCommonPropsAndState {
43
- }
44
- /**
45
- * Interface representing the properties for the Tree component.
46
- */
47
- export interface TreeProps extends TreeCommonPropsAndState {
48
- /**
49
- * Array of the tree nodes to display
50
- *
51
- * @defaultValue `[]`
52
- */
53
- nodes: TreeItem[];
54
- /**
55
- * An event emitted when the user toggles the expand of the TreeItem.
56
- *
57
- * Event payload is equal to the TreeItem clicked.
58
- *
59
- * @defaultValue
60
- * ```ts
61
- * () => {}
62
- * ```
63
- */
64
- onExpandToggle: (node: NormalizedTreeItem) => void;
65
- /**
66
- * Retrieves expand items of the TreeItem
67
- *
68
- * @param node - HTML element that is representing the expand item
69
- *
70
- * @defaultValue
71
- * ```ts
72
- * (node: HTMLElement) => node.querySelectorAll('button')
73
- * ```
74
- */
75
- navSelector(node: HTMLElement): NodeListOf<HTMLElement>;
76
- /**
77
- * Return the value for the 'aria-label' attribute of the toggle
78
- * @param label - tree item label
79
- *
80
- * @defaultValue
81
- * ```ts
82
- * (label: string) => `Toggle ${label}`
83
- * ```
84
- */
85
- ariaLabelToggleFn: (label: string) => string;
86
- }
87
- /**
88
- * Represents the state of a Tree component.
89
- */
90
- export interface TreeState extends TreeCommonPropsAndState {
91
- /**
92
- * Array of normalized tree nodes
93
- */
94
- normalizedNodes: NormalizedTreeItem[];
95
- /**
96
- * Getter of expanded state for each tree node
97
- */
98
- expandedMap: {
99
- get(item: NormalizedTreeItem): boolean | undefined;
100
- };
101
- }
102
- /**
103
- * Interface representing the API for a Tree component.
104
- */
105
- export interface TreeApi {
106
- }
107
- /**
108
- * Interface representing various directives used in the Tree component.
109
- */
110
- export interface TreeDirectives {
111
- /**
112
- * Directive to attach navManager for the tree
113
- */
114
- navigationDirective: Directive;
115
- /**
116
- * Directive to handle toggle for the tree item
117
- */
118
- itemToggleDirective: Directive<{
119
- item: NormalizedTreeItem;
120
- }>;
121
- /**
122
- * Directive to handle attributes for the tree item
123
- */
124
- itemAttributesDirective: Directive<{
125
- item: NormalizedTreeItem;
126
- }>;
127
- }
128
- /**
129
- * Represents a Tree widget component.
130
- */
131
- export type TreeWidget = Widget<TreeProps, TreeState, TreeApi, TreeDirectives>;
132
- /**
133
- * Retrieve a shallow copy of the default Tree config
134
- * @returns the default Tree config
135
- */
136
- export declare function getTreeDefaultConfig(): TreeProps;
137
- /**
138
- * Create a tree widget with given config props
139
- * @param config - an optional tree config
140
- * @returns a TreeWidget
141
- */
142
- export declare const createTree: WidgetFactory<TreeWidget>;
143
- export {};
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tansu = require("@amadeus-it-group/tansu");
4
- const utils_func = require("./utils/func.cjs");
5
- const mergeInto = (destination, source, levels = Infinity) => {
6
- if (source !== void 0) {
7
- if (typeof source === "object" && source && levels >= 1) {
8
- if (!destination) {
9
- destination = {};
10
- }
11
- for (const key of Object.keys(source)) {
12
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
13
- if (key === "__proto__" || key === "constructor") continue;
14
- destination[key] = mergeInto(destination[key], source[key], levels - 1);
15
- }
16
- } else {
17
- return source;
18
- }
19
- }
20
- return destination;
21
- };
22
- const createWidgetsConfig = (parent$, adaptParentConfig = utils_func.identity) => {
23
- const own$ = tansu.writable({});
24
- const adaptedParent$ = adaptParentConfig === utils_func.identity ? parent$ : tansu.computed(() => adaptParentConfig(mergeInto({}, parent$?.(), 2)));
25
- return tansu.asWritable(
26
- tansu.computed(() => mergeInto(mergeInto({}, adaptedParent$?.(), 2), own$(), 2)),
27
- {
28
- ...own$,
29
- own$,
30
- adaptedParent$,
31
- parent$
32
- }
33
- );
34
- };
35
- exports.createWidgetsConfig = createWidgetsConfig;
36
- exports.mergeInto = mergeInto;
@@ -1,117 +0,0 @@
1
- import type { ReadableSignal, WritableSignal } from '@amadeus-it-group/tansu';
2
- import type { ModalProps } from './components/modal/modal';
3
- import type { AlertProps } from './components/alert/alert';
4
- import type { PaginationProps } from './components/pagination/pagination';
5
- import type { RatingProps } from './components/rating/rating';
6
- import type { AccordionProps } from './components/accordion/accordion';
7
- import type { ProgressbarProps } from './components/progressbar/progressbar';
8
- import type { SliderProps } from './components/slider/slider';
9
- import type { ToastProps } from './components/toast/toast';
10
- import type { TreeProps } from './components/tree/tree';
11
- import type { CarouselProps } from './components/carousel';
12
- import type { CollapseProps } from './components/collapse';
13
- import type { DrawerProps } from './components/drawer/drawer';
14
- /**
15
- * A utility type that makes all properties of an object type `T` optional,
16
- * and also makes all properties of the nested objects within `T` optional.
17
- *
18
- * @template T - The object type to be transformed.
19
- */
20
- export type Partial2Levels<T> = Partial<{
21
- [Level1 in keyof T]: Partial<T[Level1]>;
22
- }>;
23
- /**
24
- * Represents a store for widget configurations with support for partial updates
25
- * at two levels of depth. This store includes signals for its own state, an optional
26
- * parent state, and an optional adapted parent state.
27
- *
28
- * @template T - The type of the widget configuration.
29
- */
30
- export type WidgetsConfigStore<T> = WritableSignal<Partial2Levels<T>> & {
31
- own$: WritableSignal<Partial2Levels<T>>;
32
- parent$: undefined | WritableSignal<Partial2Levels<T>>;
33
- adaptedParent$: undefined | ReadableSignal<Partial2Levels<T>>;
34
- };
35
- /**
36
- * Merges source object into destination object, up to the provided number of levels.
37
- * @param destination - destination object
38
- * @param source - source object
39
- * @param levels - number of levels to merge
40
- * @returns the destination object in most cases, or the source in some cases (if the source is not undefined and either levels is smaller than 1
41
- * or the source is not an object)
42
- */
43
- export declare const mergeInto: <T>(destination: T, source: T | undefined, levels?: number) => T;
44
- /**
45
- * Creates a new widgets default configuration store, optionally inheriting from a parent store, and containing
46
- * its own set of widgets configuration properties that override the same properties form the parent configuration.
47
- *
48
- * @remarks
49
- * The resulting store has a value computed from the parent store in two steps:
50
- * - first step: the parent configuration is transformed by the adaptParentConfig function (if specified).
51
- * If adaptParentConfig is not specified, this step is skipped.
52
- * - second step: the configuration from step 1 is merged (2-levels deep) with the own$ store. The own$ store initially contains
53
- * an empty object (i.e. no property from the parent is overridden). It can be changed by calling set on the store returned by this function.
54
- *
55
- * @param parent$ - optional parent widgets default configuration store.
56
- * @param adaptParentConfig - optional function that receives a 2-levels copy of the widgets default configuration
57
- * from parent$ (or an empty object if parent$ is not specified) and returns the widgets default configuration to be used.
58
- * It is called only if the configuration is needed, and was not yet computed for the current value of the parent configuration.
59
- * It is called in a tansu reactive context, so it can use any tansu store and will be called again if those stores change.
60
- * @returns the resulting widgets default configuration store, which contains 3 additional properties that are stores:
61
- * parent$, adaptedParent$ (containing the value computed after the first step), and own$ (that contains only overridding properties).
62
- * The resulting store is writable, its set function is actually the set function of the own$ store.
63
- */
64
- export declare const createWidgetsConfig: <T>(parent$?: WidgetsConfigStore<T>, adaptParentConfig?: (config: Partial2Levels<T>) => Partial2Levels<T>) => WidgetsConfigStore<T>;
65
- /**
66
- * Configuration for various widgets used in the application.
67
- */
68
- export type WidgetsConfig = {
69
- /**
70
- * the pagination widget config
71
- */
72
- pagination: PaginationProps;
73
- /**
74
- * the rating widget config
75
- */
76
- rating: RatingProps;
77
- /**
78
- * the modal widget config
79
- */
80
- modal: ModalProps;
81
- /**
82
- * the alert widget config
83
- */
84
- alert: AlertProps;
85
- /**
86
- * the accordion widget config
87
- */
88
- accordion: AccordionProps;
89
- /**
90
- * the progress bar widget config
91
- */
92
- progressbar: ProgressbarProps;
93
- /**
94
- * slider widget config
95
- */
96
- slider: SliderProps;
97
- /**
98
- * toast widget config
99
- */
100
- toast: ToastProps;
101
- /**
102
- * tree widget config
103
- */
104
- tree: TreeProps;
105
- /**
106
- * carousel widget config
107
- */
108
- carousel: CarouselProps;
109
- /**
110
- * collapse widget config
111
- */
112
- collapse: CollapseProps;
113
- /**
114
- * drawer widget config
115
- */
116
- drawer: DrawerProps;
117
- };
@@ -1,36 +0,0 @@
1
- import { writable, computed, asWritable } from "@amadeus-it-group/tansu";
2
- import { identity } from "./utils/func.js";
3
- const mergeInto = (destination, source, levels = Infinity) => {
4
- if (source !== void 0) {
5
- if (typeof source === "object" && source && levels >= 1) {
6
- if (!destination) {
7
- destination = {};
8
- }
9
- for (const key of Object.keys(source)) {
10
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
11
- if (key === "__proto__" || key === "constructor") continue;
12
- destination[key] = mergeInto(destination[key], source[key], levels - 1);
13
- }
14
- } else {
15
- return source;
16
- }
17
- }
18
- return destination;
19
- };
20
- const createWidgetsConfig = (parent$, adaptParentConfig = identity) => {
21
- const own$ = writable({});
22
- const adaptedParent$ = adaptParentConfig === identity ? parent$ : computed(() => adaptParentConfig(mergeInto({}, parent$?.(), 2)));
23
- return asWritable(
24
- computed(() => mergeInto(mergeInto({}, adaptedParent$?.(), 2), own$(), 2)),
25
- {
26
- ...own$,
27
- own$,
28
- adaptedParent$,
29
- parent$
30
- }
31
- );
32
- };
33
- export {
34
- createWidgetsConfig,
35
- mergeInto
36
- };