@design-factory/angular 21.1.0-next.0 → 21.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/design-factory-angular-drawer.mjs +4 -4
- package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
- package/fesm2022/design-factory-angular-internals.mjs +5 -5
- package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
- package/fesm2022/design-factory-angular-sidenav.mjs +1 -1
- package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
- package/fesm2022/design-factory-angular-topnav.mjs +3 -3
- package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
- package/package.json +3 -6
- package/types/design-factory-angular-drawer.d.ts +4 -4
- package/types/design-factory-angular-internals.d.ts +3 -3
- package/types/design-factory-angular-sidenav.d.ts +3 -3
- package/node_modules/@agnos-ui/core/README.md +0 -5
- package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +0 -314
- package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +0 -315
- package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +0 -9
- package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +0 -10
- package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +0 -94
- package/node_modules/@agnos-ui/core/collapse-CP79atna.js +0 -95
- package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +0 -73
- package/node_modules/@agnos-ui/core/common-DFyZvkII.js +0 -74
- package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +0 -333
- package/node_modules/@agnos-ui/core/components/accordion/index.cjs +0 -7
- package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/accordion/index.js +0 -7
- package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +0 -37
- package/node_modules/@agnos-ui/core/components/alert/common.d.ts +0 -138
- package/node_modules/@agnos-ui/core/components/alert/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/alert/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/alert/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +0 -247
- package/node_modules/@agnos-ui/core/components/carousel/index.cjs +0 -292
- package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/carousel/index.js +0 -292
- package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +0 -135
- package/node_modules/@agnos-ui/core/components/collapse/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/collapse/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/commonProps.d.ts +0 -11
- package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +0 -279
- package/node_modules/@agnos-ui/core/components/drawer/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/drawer/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/modal/index.cjs +0 -8
- package/node_modules/@agnos-ui/core/components/modal/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/modal/index.js +0 -8
- package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +0 -245
- package/node_modules/@agnos-ui/core/components/pagination/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/pagination/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +0 -313
- package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/progressbar/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +0 -91
- package/node_modules/@agnos-ui/core/components/rating/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/rating/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/rating/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +0 -191
- package/node_modules/@agnos-ui/core/components/slider/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/slider/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/slider/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +0 -25
- package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +0 -383
- package/node_modules/@agnos-ui/core/components/toast/index.cjs +0 -7
- package/node_modules/@agnos-ui/core/components/toast/index.d.ts +0 -2
- package/node_modules/@agnos-ui/core/components/toast/index.js +0 -7
- package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +0 -66
- package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +0 -128
- package/node_modules/@agnos-ui/core/components/tree/index.cjs +0 -5
- package/node_modules/@agnos-ui/core/components/tree/index.d.ts +0 -1
- package/node_modules/@agnos-ui/core/components/tree/index.js +0 -5
- package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +0 -143
- package/node_modules/@agnos-ui/core/config.cjs +0 -36
- package/node_modules/@agnos-ui/core/config.d.ts +0 -117
- package/node_modules/@agnos-ui/core/config.js +0 -36
- package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +0 -523
- package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +0 -522
- package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +0 -328
- package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +0 -329
- package/node_modules/@agnos-ui/core/index.cjs +0 -134
- package/node_modules/@agnos-ui/core/index.d.ts +0 -29
- package/node_modules/@agnos-ui/core/index.js +0 -134
- package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +0 -32
- package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +0 -31
- package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +0 -252
- package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +0 -253
- package/node_modules/@agnos-ui/core/package.json +0 -57
- package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +0 -255
- package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +0 -254
- package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +0 -86
- package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +0 -87
- package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +0 -118
- package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +0 -119
- package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +0 -184
- package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +0 -183
- package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +0 -30
- package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +0 -31
- package/node_modules/@agnos-ui/core/services/extendWidget.cjs +0 -41
- package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +0 -31
- package/node_modules/@agnos-ui/core/services/extendWidget.js +0 -41
- package/node_modules/@agnos-ui/core/services/floatingUI.cjs +0 -111
- package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +0 -76
- package/node_modules/@agnos-ui/core/services/floatingUI.js +0 -111
- package/node_modules/@agnos-ui/core/services/focusElement.cjs +0 -46
- package/node_modules/@agnos-ui/core/services/focusElement.d.ts +0 -9
- package/node_modules/@agnos-ui/core/services/focusElement.js +0 -46
- package/node_modules/@agnos-ui/core/services/focustrack.cjs +0 -47
- package/node_modules/@agnos-ui/core/services/focustrack.d.ts +0 -40
- package/node_modules/@agnos-ui/core/services/focustrack.js +0 -47
- package/node_modules/@agnos-ui/core/services/hash.cjs +0 -15
- package/node_modules/@agnos-ui/core/services/hash.d.ts +0 -3
- package/node_modules/@agnos-ui/core/services/hash.js +0 -15
- package/node_modules/@agnos-ui/core/services/intersection.cjs +0 -53
- package/node_modules/@agnos-ui/core/services/intersection.d.ts +0 -30
- package/node_modules/@agnos-ui/core/services/intersection.js +0 -53
- package/node_modules/@agnos-ui/core/services/matchMedia.cjs +0 -14
- package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +0 -8
- package/node_modules/@agnos-ui/core/services/matchMedia.js +0 -14
- package/node_modules/@agnos-ui/core/services/navManager.cjs +0 -166
- package/node_modules/@agnos-ui/core/services/navManager.d.ts +0 -144
- package/node_modules/@agnos-ui/core/services/navManager.js +0 -166
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +0 -60
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +0 -42
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +0 -60
- package/node_modules/@agnos-ui/core/services/portal.cjs +0 -42
- package/node_modules/@agnos-ui/core/services/portal.d.ts +0 -16
- package/node_modules/@agnos-ui/core/services/portal.js +0 -42
- package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +0 -54
- package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +0 -18
- package/node_modules/@agnos-ui/core/services/resizeObserver.js +0 -54
- package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +0 -44
- package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +0 -16
- package/node_modules/@agnos-ui/core/services/siblingsInert.js +0 -44
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +0 -186
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +0 -166
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +0 -186
- package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +0 -40
- package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +0 -49
- package/node_modules/@agnos-ui/core/services/transitions/collapse.js +0 -40
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +0 -32
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +0 -25
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +0 -32
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +0 -37
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +0 -47
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +0 -37
- package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +0 -807
- package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +0 -808
- package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +0 -4
- package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +0 -3
- package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +0 -190
- package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +0 -191
- package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +0 -228
- package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +0 -229
- package/node_modules/@agnos-ui/core/types.cjs +0 -6
- package/node_modules/@agnos-ui/core/types.d.ts +0 -246
- package/node_modules/@agnos-ui/core/types.js +0 -6
- package/node_modules/@agnos-ui/core/utils/directive.cjs +0 -28
- package/node_modules/@agnos-ui/core/utils/directive.d.ts +0 -352
- package/node_modules/@agnos-ui/core/utils/directive.js +0 -28
- package/node_modules/@agnos-ui/core/utils/func.cjs +0 -7
- package/node_modules/@agnos-ui/core/utils/func.d.ts +0 -11
- package/node_modules/@agnos-ui/core/utils/func.js +0 -7
- package/node_modules/@agnos-ui/core/utils/id.cjs +0 -5
- package/node_modules/@agnos-ui/core/utils/id.d.ts +0 -6
- package/node_modules/@agnos-ui/core/utils/id.js +0 -5
- package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +0 -10
- package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +0 -57
- package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +0 -75
- package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +0 -9
- package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +0 -5
- package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +0 -98
- package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +0 -8
- package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +0 -16
- package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +0 -17
- package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +0 -7
- package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +0 -54
- package/node_modules/@agnos-ui/core/utils/stores.cjs +0 -172
- package/node_modules/@agnos-ui/core/utils/stores.d.ts +0 -224
- package/node_modules/@agnos-ui/core/utils/stores.js +0 -172
- package/node_modules/@agnos-ui/core/utils/widget.cjs +0 -8
- package/node_modules/@agnos-ui/core/utils/widget.d.ts +0 -11
- package/node_modules/@agnos-ui/core/utils/widget.js +0 -8
- package/node_modules/@agnos-ui/core/utils/writables.cjs +0 -16
- package/node_modules/@agnos-ui/core/utils/writables.d.ts +0 -95
- package/node_modules/@agnos-ui/core/utils/writables.js +0 -16
- package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +0 -103
- package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +0 -102
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { type ToastProps } from './toast';
|
|
2
|
-
import type { Directive } from '../../types';
|
|
3
|
-
import type { ReadableSignal, WritableSignal } from '@amadeus-it-group/tansu';
|
|
4
|
-
/**
|
|
5
|
-
* Represents the possible positions for displaying a toast notification.
|
|
6
|
-
*
|
|
7
|
-
* The positions are defined based on a grid layout with three horizontal
|
|
8
|
-
* alignments (left, center, right) and three vertical alignments (top, middle, bottom).
|
|
9
|
-
*
|
|
10
|
-
* Available positions:
|
|
11
|
-
* - `topLeft`: Top-left corner of the screen.
|
|
12
|
-
* - `topCenter`: Top-center of the screen.
|
|
13
|
-
* - `topRight`: Top-right corner of the screen.
|
|
14
|
-
* - `middleLeft`: Middle-left side of the screen.
|
|
15
|
-
* - `middleCenter`: Center of the screen.
|
|
16
|
-
* - `middleRight`: Middle-right side of the screen.
|
|
17
|
-
* - `bottomLeft`: Bottom-left corner of the screen.
|
|
18
|
-
* - `bottomCenter`: Bottom-center of the screen.
|
|
19
|
-
* - `bottomRight`: Bottom-right corner of the screen.
|
|
20
|
-
*/
|
|
21
|
-
export type ToastPositions = 'topLeft' | 'topCenter' | 'topRight' | 'middleLeft' | 'middleCenter' | 'middleRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
22
|
-
/**
|
|
23
|
-
* Props of the toaster
|
|
24
|
-
*/
|
|
25
|
-
export interface ToasterProps {
|
|
26
|
-
/** How much time (ms) a toast is displayed; 0 means it won't be removed until a manual action */
|
|
27
|
-
duration: number;
|
|
28
|
-
/** Where to position the toasts */
|
|
29
|
-
position: ToastPositions;
|
|
30
|
-
/** Maximum number of toasts displayed */
|
|
31
|
-
limit?: number;
|
|
32
|
-
/** Pause toast when hover */
|
|
33
|
-
pauseOnHover?: boolean;
|
|
34
|
-
/** Display a dismiss button on each toast. When duration = 0, this is enforced to true */
|
|
35
|
-
dismissible: boolean;
|
|
36
|
-
/** Add a button to close all the toasts at once */
|
|
37
|
-
closeAll?: boolean;
|
|
38
|
-
/** Close all label */
|
|
39
|
-
closeAllLabel?: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Toast object
|
|
43
|
-
* @template Props Type of the toast properties.
|
|
44
|
-
*/
|
|
45
|
-
export interface ToasterToast<Props> {
|
|
46
|
-
/** Identifier of the toasts in the toaster */
|
|
47
|
-
id: number;
|
|
48
|
-
/** Properties of the toast */
|
|
49
|
-
props: Props;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Represents a timer used by the toaster service.
|
|
53
|
-
*/
|
|
54
|
-
export interface ToasterTimer {
|
|
55
|
-
/**
|
|
56
|
-
* The timeout identifier returned by `setTimeout`.
|
|
57
|
-
*/
|
|
58
|
-
timeout: ReturnType<typeof setTimeout> | null;
|
|
59
|
-
/**
|
|
60
|
-
* The timestamp when the timer was started.
|
|
61
|
-
*/
|
|
62
|
-
started: number;
|
|
63
|
-
/**
|
|
64
|
-
* The timestamp when the timer was paused (optional).
|
|
65
|
-
*/
|
|
66
|
-
paused?: number;
|
|
67
|
-
/**
|
|
68
|
-
* The duration for which the timer is set (optional). Used internally to compute the remaining time.
|
|
69
|
-
*/
|
|
70
|
-
duration: number;
|
|
71
|
-
}
|
|
72
|
-
export declare const defaultToasterProps: ToasterProps;
|
|
73
|
-
/**
|
|
74
|
-
* Create a toaster provider with helpers and state.
|
|
75
|
-
* @param props Options for the toaster.
|
|
76
|
-
* @template Props Type of the toast properties.
|
|
77
|
-
*/
|
|
78
|
-
export declare class Toaster<Props extends Partial<ToastProps> = ToastProps> {
|
|
79
|
-
#private;
|
|
80
|
-
/**
|
|
81
|
-
* Get the toasts value from the store
|
|
82
|
-
* @returns The array of toasts.
|
|
83
|
-
*/
|
|
84
|
-
readonly toasts: ReadableSignal<ToasterToast<Props>[]>;
|
|
85
|
-
readonly options: WritableSignal<ToasterProps>;
|
|
86
|
-
/**
|
|
87
|
-
* Get the timers value from the store
|
|
88
|
-
* @returns The map of timers.
|
|
89
|
-
*/
|
|
90
|
-
get timers(): ReadonlyMap<number, ToasterTimer>;
|
|
91
|
-
constructor(props?: Partial<ToasterProps>);
|
|
92
|
-
/**
|
|
93
|
-
* Add timer for a toast
|
|
94
|
-
* @param id Id of the toast
|
|
95
|
-
* @param duration Duration of the timer, by default taken from options
|
|
96
|
-
*/
|
|
97
|
-
readonly addTimer: (id: number, duration?: number) => void;
|
|
98
|
-
/**
|
|
99
|
-
* Pause a timer for a toast
|
|
100
|
-
* @param id Id of the toast
|
|
101
|
-
*/
|
|
102
|
-
readonly pauseTimer: (id: number) => void;
|
|
103
|
-
/**
|
|
104
|
-
* Resume a timer for a toast
|
|
105
|
-
* @param id Id of the toast
|
|
106
|
-
*/
|
|
107
|
-
readonly resumeTimer: (id: number) => void;
|
|
108
|
-
/**
|
|
109
|
-
* Events directive is used to set events on the Toast component, to keep track for example of pointer enter/leave,
|
|
110
|
-
* used to pause / resume the timer in case of duration and pauseOnHover are specified.
|
|
111
|
-
*/
|
|
112
|
-
readonly eventsDirective: Directive<number>;
|
|
113
|
-
/**
|
|
114
|
-
* Helper to add a toast to the viewport.
|
|
115
|
-
* @param props Options for the toast.
|
|
116
|
-
* @returns The ID of the added toast.
|
|
117
|
-
*/
|
|
118
|
-
readonly addToast: (props: Props) => number;
|
|
119
|
-
/**
|
|
120
|
-
* Helper to remove a toast to the viewport.
|
|
121
|
-
* @param id Id of the toast to remove.
|
|
122
|
-
*/
|
|
123
|
-
readonly removeToast: (id: number) => void;
|
|
124
|
-
/** Helper to update toasts when options change */
|
|
125
|
-
readonly updateToasts: () => void;
|
|
126
|
-
/** Helper to close all toasts at once */
|
|
127
|
-
readonly closeAll: () => void;
|
|
128
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './tree';
|
|
@@ -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
|
-
};
|