@agnos-ui/core 0.9.2 → 0.10.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.
- package/{accordion-CoM4efp-.js → accordion-CcirvrjR.js} +10 -15
- package/{accordion-cR5JqWJ8.cjs → accordion-yD-czBna.cjs} +10 -15
- package/{alert-DtDozJal.cjs → alert-B-jQDQcB.cjs} +1 -1
- package/{alert-YIlqdEPO.js → alert-gGz2CDS9.js} +1 -1
- package/collapse-BV4kD3j9.js +82 -0
- package/collapse-gLiT080Y.cjs +81 -0
- package/{common-BToNPUDq.cjs → common-D3QcdJ6S.cjs} +1 -1
- package/{common-BqUjUBPy.js → common-DK0ADNTX.js} +1 -1
- package/components/accordion/index.cjs +1 -1
- package/components/accordion/index.js +1 -1
- package/components/alert/index.cjs +1 -1
- package/components/alert/index.js +1 -1
- package/components/carousel/index.cjs +10 -23
- package/components/carousel/index.js +10 -23
- package/components/collapse/collapse.d.ts +132 -0
- package/components/collapse/index.cjs +5 -0
- package/components/collapse/index.d.ts +1 -0
- package/components/collapse/index.js +5 -0
- package/components/drawer/drawer.d.ts +222 -0
- package/components/drawer/index.cjs +5 -0
- package/components/drawer/index.d.ts +1 -0
- package/components/drawer/index.js +5 -0
- package/components/modal/index.cjs +2 -1
- package/components/modal/index.js +2 -1
- package/components/modal/modal.d.ts +5 -0
- package/components/pagination/index.cjs +1 -1
- package/components/pagination/index.js +1 -1
- package/components/progressbar/index.cjs +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/rating/index.cjs +1 -1
- package/components/rating/index.js +1 -1
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +1 -1
- package/components/toast/index.cjs +1 -1
- package/components/toast/index.js +1 -1
- package/components/tree/index.cjs +1 -1
- package/components/tree/index.js +1 -1
- package/config.cjs +2 -2
- package/config.d.ts +10 -0
- package/config.js +2 -2
- package/{dom-gfxqXJpK.js → dom-Bcg9ORcA.js} +64 -54
- package/{dom-CuBx1JPZ.cjs → dom-C2gi9OCP.cjs} +47 -37
- package/drawer-D5SO73ew.js +251 -0
- package/drawer-DP7UPojk.cjs +250 -0
- package/index.cjs +21 -12
- package/index.d.ts +2 -0
- package/index.js +54 -45
- package/isFocusable-Ckwus82R.js +32 -0
- package/isFocusable-DfzDLeAN.cjs +31 -0
- package/{modal-D3wGIDlj.js → modal-CAvQW-vo.js} +26 -32
- package/{modal-BEnQ6c5M.cjs → modal-DiXZXYjR.cjs} +27 -33
- package/package.json +1 -1
- package/{pagination-B97wBLok.js → pagination-BKbMROV6.js} +4 -4
- package/{pagination-C1TT-oea.cjs → pagination-DvZ2rLsz.cjs} +4 -4
- package/{progressbar-BWBlRk_Y.js → progressbar-D8zIcm9n.js} +2 -2
- package/{progressbar-CRvhNB5R.cjs → progressbar-i9xfAxb7.cjs} +2 -2
- package/{promise-XSP94FjG.js → promise-Y53vc4Ia.js} +5 -5
- package/{rating-BXvy9kXq.js → rating-DEXTGWCU.js} +2 -2
- package/{rating-DAb6nR67.cjs → rating-DmG4oUkr.cjs} +2 -2
- package/scrollbars-CT87iv_6.cjs +30 -0
- package/scrollbars-CcxSrnCx.js +31 -0
- package/{select-BdjpnE7_.js → select-Bw68Xdu5.js} +4 -5
- package/{select-C0rJJQfl.cjs → select-MFjAnIt7.cjs} +4 -5
- package/services/extendWidget.cjs +2 -2
- package/services/extendWidget.js +2 -2
- package/services/floatingUI.cjs +8 -29
- package/services/floatingUI.js +9 -30
- package/services/focusElement.cjs +46 -0
- package/services/focusElement.d.ts +9 -0
- package/services/focusElement.js +46 -0
- package/services/focustrack.cjs +1 -1
- package/services/focustrack.js +1 -1
- package/services/matchMedia.cjs +1 -1
- package/services/matchMedia.js +1 -1
- package/services/navManager.cjs +7 -37
- package/services/navManager.js +6 -36
- package/services/portal.cjs +7 -10
- package/services/portal.js +7 -10
- package/services/resizeObserver.cjs +2 -2
- package/services/resizeObserver.js +2 -2
- package/services/siblingsInert.cjs +9 -8
- package/services/siblingsInert.d.ts +13 -3
- package/services/siblingsInert.js +9 -8
- package/services/transitions/baseTransitions.cjs +9 -10
- package/services/transitions/baseTransitions.js +10 -11
- package/services/transitions/collapse.cjs +1 -1
- package/services/transitions/collapse.js +1 -1
- package/services/transitions/cssTransitions.cjs +1 -1
- package/services/transitions/cssTransitions.js +2 -2
- package/services/transitions/simpleClassTransition.cjs +1 -1
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-BmxQ3A_u.js → slider-Cx50Eghd.js} +14 -24
- package/{slider-DSx5CAce.cjs → slider-Dl4Trh32.cjs} +14 -24
- package/toaster-UDglac7x.cjs +187 -0
- package/toaster-_p1GTtHI.js +188 -0
- package/{tree-BFrXdJox.js → tree-DV0tfPlZ.js} +7 -11
- package/{tree-Pvr2rZ-D.cjs → tree-rGHtmCnS.cjs} +7 -11
- package/utils/directive.cjs +3 -1
- package/utils/directive.d.ts +47 -0
- package/utils/directive.js +14 -12
- package/utils/stores.cjs +8 -9
- package/utils/stores.js +8 -9
- package/utils/writables.cjs +1 -1
- package/utils/writables.js +1 -1
- package/{writables-Bn3uhKEG.cjs → writables-DcGT98a7.cjs} +1 -1
- package/{writables-CgpOQ4hA.js → writables-e0tyaQpe.js} +1 -1
- package/toaster-Cayg6Lbq.cjs +0 -209
- package/toaster-XfzHDqz_.js +0 -210
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { TransitionFn } from '../../services/transitions/baseTransitions';
|
|
2
|
+
import type { Directive, WidgetFactory } from '../../types';
|
|
3
|
+
import { type Widget } from '../../types';
|
|
4
|
+
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
5
|
+
/**
|
|
6
|
+
* Possible values for the drawer positions
|
|
7
|
+
*/
|
|
8
|
+
export type DrawerPositions = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
|
|
9
|
+
interface DrawerCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
10
|
+
/**
|
|
11
|
+
* Which element should contain the drawer and backdrop DOM elements.
|
|
12
|
+
* If it is not null, the drawer and backdrop DOM elements are moved to the specified container.
|
|
13
|
+
* Otherwise, they stay where the widget is located.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue
|
|
16
|
+
* ```ts
|
|
17
|
+
* typeof window !== 'undefined' ? document.body : null
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
container: HTMLElement | null;
|
|
21
|
+
/**
|
|
22
|
+
* Classes to add on the backdrop DOM element.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue `''`
|
|
25
|
+
*/
|
|
26
|
+
backdropClass: string;
|
|
27
|
+
/**
|
|
28
|
+
* If `true`, the drawer is shown; otherwise, it is hidden.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue `false`
|
|
31
|
+
*/
|
|
32
|
+
visible: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If `true`, the drawer can be resized by the user.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue `false`
|
|
37
|
+
*/
|
|
38
|
+
resizable: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface representing the properties for the Drawer component.
|
|
42
|
+
*/
|
|
43
|
+
export interface DrawerProps extends DrawerCommonPropsAndState {
|
|
44
|
+
/**
|
|
45
|
+
* The transition function will be executed when the drawer is displayed or hidden.
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue
|
|
48
|
+
* ```ts
|
|
49
|
+
* () => {}
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
transition: TransitionFn;
|
|
53
|
+
/**
|
|
54
|
+
* The transition function for vertically positioned drawer (top, bottom) that will be executed when the drawer is displayed or hidden.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue
|
|
57
|
+
* ```ts
|
|
58
|
+
* () => {}
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
verticalTransition: TransitionFn;
|
|
62
|
+
/**
|
|
63
|
+
* The transition to use for the backdrop behind the drawer (if present).
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue
|
|
66
|
+
* ```ts
|
|
67
|
+
* () => {}
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
backdropTransition: TransitionFn;
|
|
71
|
+
/**
|
|
72
|
+
* If `true` opening and closing will be animated.
|
|
73
|
+
*/
|
|
74
|
+
animated: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* aria-labelledby attribute to use for the drawer element.
|
|
77
|
+
*/
|
|
78
|
+
ariaLabelledBy: string;
|
|
79
|
+
/**
|
|
80
|
+
* aria-describedby attribute to use for the drawer element.
|
|
81
|
+
*/
|
|
82
|
+
ariaDescribedBy: string;
|
|
83
|
+
/**
|
|
84
|
+
* The width of the drawer in pixels.
|
|
85
|
+
*/
|
|
86
|
+
width: number;
|
|
87
|
+
/**
|
|
88
|
+
* The height of the drawer in pixels.
|
|
89
|
+
*/
|
|
90
|
+
height: number;
|
|
91
|
+
/**
|
|
92
|
+
* If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
|
|
93
|
+
*/
|
|
94
|
+
backdrop: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* If `true` allows body scrolling when the drawer is open.
|
|
97
|
+
*/
|
|
98
|
+
bodyScroll: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Event to be triggered when the transition is completed and the drawer is not visible.
|
|
101
|
+
*
|
|
102
|
+
* @defaultValue
|
|
103
|
+
* ```ts
|
|
104
|
+
* () => {}
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
onHidden: () => void;
|
|
108
|
+
/**
|
|
109
|
+
* Event to be triggered when the transition is completed and the drawer is visible.
|
|
110
|
+
*
|
|
111
|
+
* @defaultValue
|
|
112
|
+
* ```ts
|
|
113
|
+
* () => {}
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
onShown: () => void;
|
|
117
|
+
/**
|
|
118
|
+
* An event emitted when the width is changed.
|
|
119
|
+
*
|
|
120
|
+
* Event payload is equal to the newly selected width.
|
|
121
|
+
*
|
|
122
|
+
* @defaultValue
|
|
123
|
+
* ```ts
|
|
124
|
+
* () => {}
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
onWidthChange: (width: number) => void;
|
|
128
|
+
/**
|
|
129
|
+
* An event emitted when the height is changed.
|
|
130
|
+
*
|
|
131
|
+
* Event payload is equal to the newly selected height.
|
|
132
|
+
*
|
|
133
|
+
* @defaultValue
|
|
134
|
+
* ```ts
|
|
135
|
+
* () => {}
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
onHeightChange: (width: number) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Event to be triggered when the visible property changes.
|
|
141
|
+
*
|
|
142
|
+
* @param visible - new value of the visible propery
|
|
143
|
+
*
|
|
144
|
+
* @defaultValue
|
|
145
|
+
* ```ts
|
|
146
|
+
* () => {}
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
onVisibleChange: (visible: boolean) => void;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Represents the state of a Drawer component.
|
|
153
|
+
*/
|
|
154
|
+
export interface DrawerState extends DrawerCommonPropsAndState {
|
|
155
|
+
/**
|
|
156
|
+
* Whether the backdrop is fully hidden. This can be true either because {@link DrawerProps.backdrop|backdrop} is false or
|
|
157
|
+
* because {@link DrawerProps.visible|visible} is false and there is no current transition.
|
|
158
|
+
*/
|
|
159
|
+
backdropHidden: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Flag to show whether the drawer is fully hidden.
|
|
162
|
+
*/
|
|
163
|
+
hidden: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Interface representing the API for a Drawer component.
|
|
167
|
+
*/
|
|
168
|
+
export interface DrawerApi {
|
|
169
|
+
/**
|
|
170
|
+
* Trigger the opening of the drawer.
|
|
171
|
+
*/
|
|
172
|
+
open: () => void;
|
|
173
|
+
/**
|
|
174
|
+
* Trigger the closing of the drawer.
|
|
175
|
+
*/
|
|
176
|
+
close: () => void;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Interface representing various directives used in the Drawer component.
|
|
180
|
+
*/
|
|
181
|
+
export interface DrawerDirectives {
|
|
182
|
+
/**
|
|
183
|
+
* Directive to put on the drawer DOM element.
|
|
184
|
+
*/
|
|
185
|
+
drawerDirective: Directive;
|
|
186
|
+
/**
|
|
187
|
+
* Portal directive to put on the drawer DOM element.
|
|
188
|
+
*/
|
|
189
|
+
drawerPortalDirective: Directive;
|
|
190
|
+
/**
|
|
191
|
+
* Directive to put on the backdrop DOM element.
|
|
192
|
+
*/
|
|
193
|
+
backdropDirective: Directive;
|
|
194
|
+
/**
|
|
195
|
+
* Portal directive to put on the backdrop DOM element.
|
|
196
|
+
*/
|
|
197
|
+
backdropPortalDirective: Directive;
|
|
198
|
+
/**
|
|
199
|
+
* Directive to put on the splitter DOM element.
|
|
200
|
+
*/
|
|
201
|
+
splitterDirective: Directive;
|
|
202
|
+
/**
|
|
203
|
+
* Directive to put on the container DOM element in order for the drawer to size correctly.
|
|
204
|
+
*/
|
|
205
|
+
containerDirective: Directive;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Represents a Drawer widget component.
|
|
209
|
+
*/
|
|
210
|
+
export type DrawerWidget = Widget<DrawerProps, DrawerState, DrawerApi, DrawerDirectives>;
|
|
211
|
+
/**
|
|
212
|
+
* Retrieve a shallow copy of the default Drawer config
|
|
213
|
+
* @returns the default Drawer config
|
|
214
|
+
*/
|
|
215
|
+
export declare function getDrawerDefaultConfig(): DrawerProps;
|
|
216
|
+
/**
|
|
217
|
+
* Create a Drawer widget with given config props
|
|
218
|
+
* @param config - an optional Drawer config
|
|
219
|
+
* @returns a DrawerWidget
|
|
220
|
+
*/
|
|
221
|
+
export declare const createDrawer: WidgetFactory<DrawerWidget>;
|
|
222
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './drawer';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const modal = require("../../modal-
|
|
3
|
+
const modal = require("../../modal-DiXZXYjR.cjs");
|
|
4
4
|
exports.createModal = modal.createModal;
|
|
5
5
|
exports.getModalDefaultConfig = modal.getModalDefaultConfig;
|
|
6
6
|
exports.modalCloseButtonClick = modal.modalCloseButtonClick;
|
|
7
|
+
exports.modalCloseEscape = modal.modalCloseEscape;
|
|
7
8
|
exports.modalOutsideClick = modal.modalOutsideClick;
|
|
@@ -11,6 +11,11 @@ export declare const modalOutsideClick: unique symbol;
|
|
|
11
11
|
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click on the close button.
|
|
12
12
|
*/
|
|
13
13
|
export declare const modalCloseButtonClick: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
16
|
+
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by pressing the Escape key.
|
|
17
|
+
*/
|
|
18
|
+
export declare const modalCloseEscape: unique symbol;
|
|
14
19
|
/**
|
|
15
20
|
* Properties of the modal widget that are also in the state of the modal.
|
|
16
21
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pagination = require("../../pagination-
|
|
3
|
+
const pagination = require("../../pagination-DvZ2rLsz.cjs");
|
|
4
4
|
exports.createPagination = pagination.createPagination;
|
|
5
5
|
exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const progressbar = require("../../progressbar-
|
|
3
|
+
const progressbar = require("../../progressbar-i9xfAxb7.cjs");
|
|
4
4
|
exports.createProgressbar = progressbar.createProgressbar;
|
|
5
5
|
exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const rating = require("../../rating-
|
|
3
|
+
const rating = require("../../rating-DmG4oUkr.cjs");
|
|
4
4
|
exports.createRating = rating.createRating;
|
|
5
5
|
exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const select = require("../../select-
|
|
3
|
+
const select = require("../../select-MFjAnIt7.cjs");
|
|
4
4
|
exports.createSelect = select.createSelect;
|
|
5
5
|
exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const slider = require("../../slider-
|
|
3
|
+
const slider = require("../../slider-Dl4Trh32.cjs");
|
|
4
4
|
exports.createSlider = slider.createSlider;
|
|
5
5
|
exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const toaster = require("../../toaster-
|
|
3
|
+
const toaster = require("../../toaster-UDglac7x.cjs");
|
|
4
4
|
exports.Toaster = toaster.Toaster;
|
|
5
5
|
exports.createToast = toaster.createToast;
|
|
6
6
|
exports.defaultToasterProps = toaster.defaultToasterProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const tree = require("../../tree-
|
|
3
|
+
const tree = require("../../tree-rGHtmCnS.cjs");
|
|
4
4
|
exports.createTree = tree.createTree;
|
|
5
5
|
exports.getTreeDefaultConfig = tree.getTreeDefaultConfig;
|
package/components/tree/index.js
CHANGED
package/config.cjs
CHANGED
|
@@ -21,9 +21,9 @@ const mergeInto = (destination, source, levels = Infinity) => {
|
|
|
21
21
|
};
|
|
22
22
|
const createWidgetsConfig = (parent$, adaptParentConfig = utils_func.identity) => {
|
|
23
23
|
const own$ = tansu.writable({});
|
|
24
|
-
const adaptedParent$ = adaptParentConfig === utils_func.identity ? parent$ : tansu.computed(() => adaptParentConfig(mergeInto({}, parent
|
|
24
|
+
const adaptedParent$ = adaptParentConfig === utils_func.identity ? parent$ : tansu.computed(() => adaptParentConfig(mergeInto({}, parent$?.(), 2)));
|
|
25
25
|
return tansu.asWritable(
|
|
26
|
-
tansu.computed(() => mergeInto(mergeInto({}, adaptedParent
|
|
26
|
+
tansu.computed(() => mergeInto(mergeInto({}, adaptedParent$?.(), 2), own$(), 2)),
|
|
27
27
|
{
|
|
28
28
|
...own$,
|
|
29
29
|
own$,
|
package/config.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { SliderProps } from './components/slider/slider';
|
|
|
10
10
|
import type { ToastProps } from './components/toast/toast';
|
|
11
11
|
import type { TreeProps } from './components/tree/tree';
|
|
12
12
|
import type { CarouselProps } from './components/carousel';
|
|
13
|
+
import type { CollapseProps } from './components/collapse';
|
|
14
|
+
import type { DrawerProps } from './components/drawer/drawer';
|
|
13
15
|
/**
|
|
14
16
|
* A utility type that makes all properties of an object type `T` optional,
|
|
15
17
|
* and also makes all properties of the nested objects within `T` optional.
|
|
@@ -109,4 +111,12 @@ export type WidgetsConfig = {
|
|
|
109
111
|
* carousel widget config
|
|
110
112
|
*/
|
|
111
113
|
carousel: CarouselProps;
|
|
114
|
+
/**
|
|
115
|
+
* collapse widget config
|
|
116
|
+
*/
|
|
117
|
+
collapse: CollapseProps;
|
|
118
|
+
/**
|
|
119
|
+
* drawer widget config
|
|
120
|
+
*/
|
|
121
|
+
drawer: DrawerProps;
|
|
112
122
|
};
|
package/config.js
CHANGED
|
@@ -19,9 +19,9 @@ const mergeInto = (destination, source, levels = Infinity) => {
|
|
|
19
19
|
};
|
|
20
20
|
const createWidgetsConfig = (parent$, adaptParentConfig = identity) => {
|
|
21
21
|
const own$ = writable({});
|
|
22
|
-
const adaptedParent$ = adaptParentConfig === identity ? parent$ : computed(() => adaptParentConfig(mergeInto({}, parent
|
|
22
|
+
const adaptedParent$ = adaptParentConfig === identity ? parent$ : computed(() => adaptParentConfig(mergeInto({}, parent$?.(), 2)));
|
|
23
23
|
return asWritable(
|
|
24
|
-
computed(() => mergeInto(mergeInto({}, adaptedParent
|
|
24
|
+
computed(() => mergeInto(mergeInto({}, adaptedParent$?.(), 2), own$(), 2)),
|
|
25
25
|
{
|
|
26
26
|
...own$,
|
|
27
27
|
own$,
|
|
@@ -57,13 +57,12 @@ function clsx() {
|
|
|
57
57
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
58
58
|
return n;
|
|
59
59
|
}
|
|
60
|
-
const isBrowserHTMLElement = BROWSER ? (element) => {
|
|
61
|
-
|
|
62
|
-
const contentWindow = ((_a = element == null ? void 0 : element.ownerDocument) == null ? void 0 : _a.defaultView) ?? window;
|
|
60
|
+
const isBrowserHTMLElement = BROWSER ? ((element) => {
|
|
61
|
+
const contentWindow = element?.ownerDocument?.defaultView ?? window;
|
|
63
62
|
return element instanceof contentWindow.HTMLElement;
|
|
64
|
-
} : (
|
|
63
|
+
}) : (
|
|
65
64
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
66
|
-
(element) => false
|
|
65
|
+
((element) => false)
|
|
67
66
|
);
|
|
68
67
|
const browserDirective = BROWSER ? (directive) => (node, args) => {
|
|
69
68
|
if (isBrowserHTMLElement(node)) {
|
|
@@ -71,24 +70,22 @@ const browserDirective = BROWSER ? (directive) => (node, args) => {
|
|
|
71
70
|
}
|
|
72
71
|
} : (
|
|
73
72
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
74
|
-
(directive) => noop
|
|
73
|
+
((directive) => noop)
|
|
75
74
|
);
|
|
76
75
|
const bindDirective = (directive, directiveArg$) => (element) => {
|
|
77
76
|
let firstTime = true;
|
|
78
77
|
let instance;
|
|
79
78
|
const unsubscribe = directiveArg$.subscribe((value) => {
|
|
80
|
-
var _a;
|
|
81
79
|
if (firstTime) {
|
|
82
80
|
firstTime = false;
|
|
83
81
|
instance = directive(element, value);
|
|
84
82
|
} else {
|
|
85
|
-
|
|
83
|
+
instance?.update?.(value);
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
return {
|
|
89
87
|
destroy() {
|
|
90
|
-
|
|
91
|
-
(_a = instance == null ? void 0 : instance.destroy) == null ? void 0 : _a.call(instance);
|
|
88
|
+
instance?.destroy?.();
|
|
92
89
|
unsubscribe();
|
|
93
90
|
}
|
|
94
91
|
};
|
|
@@ -99,13 +96,9 @@ const mapDirectiveArg = (directive, fn) => (node, arg) => {
|
|
|
99
96
|
const instance = directive(node, fn(arg));
|
|
100
97
|
return {
|
|
101
98
|
update: (arg2) => {
|
|
102
|
-
|
|
103
|
-
(_a = instance == null ? void 0 : instance.update) == null ? void 0 : _a.call(instance, fn(arg2));
|
|
99
|
+
instance?.update?.(fn(arg2));
|
|
104
100
|
},
|
|
105
|
-
destroy: () =>
|
|
106
|
-
var _a;
|
|
107
|
-
return (_a = instance == null ? void 0 : instance.destroy) == null ? void 0 : _a.call(instance);
|
|
108
|
-
}
|
|
101
|
+
destroy: () => instance?.destroy?.()
|
|
109
102
|
};
|
|
110
103
|
};
|
|
111
104
|
const directiveSubscribe = (store, asyncUnsubscribe = true) => () => {
|
|
@@ -154,17 +147,45 @@ const registrationArray = () => {
|
|
|
154
147
|
}
|
|
155
148
|
});
|
|
156
149
|
};
|
|
157
|
-
const
|
|
150
|
+
const createConditionalStoreArrayDirective = () => {
|
|
158
151
|
const elements$ = registrationArray();
|
|
159
152
|
return {
|
|
160
153
|
elements$: asReadable(elements$),
|
|
161
|
-
directive: (element) =>
|
|
154
|
+
directive: (element, enabled = true) => {
|
|
155
|
+
let destroyElements;
|
|
156
|
+
const update = (newEnabled = true) => {
|
|
157
|
+
if (!!newEnabled != !!destroyElements) {
|
|
158
|
+
if (newEnabled) {
|
|
159
|
+
destroyElements = elements$.register(element);
|
|
160
|
+
} else {
|
|
161
|
+
destroyElements?.();
|
|
162
|
+
destroyElements = void 0;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
update(enabled);
|
|
167
|
+
return {
|
|
168
|
+
destroy: () => update(false),
|
|
169
|
+
update
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
const createStoreArrayDirective = () => {
|
|
175
|
+
const { directive, elements$ } = createConditionalStoreArrayDirective();
|
|
176
|
+
return {
|
|
177
|
+
directive: bindDirectiveNoArg(directive),
|
|
178
|
+
elements$
|
|
162
179
|
};
|
|
163
180
|
};
|
|
164
181
|
const createBrowserStoreArrayDirective = () => {
|
|
165
182
|
const { directive, elements$ } = createStoreArrayDirective();
|
|
166
183
|
return { directive: browserDirective(directive), elements$ };
|
|
167
184
|
};
|
|
185
|
+
const createConditionalBrowserStoreArrayDirective = () => {
|
|
186
|
+
const { directive, elements$ } = createConditionalStoreArrayDirective();
|
|
187
|
+
return { directive: browserDirective(directive), elements$ };
|
|
188
|
+
};
|
|
168
189
|
const createStoreDirective = () => {
|
|
169
190
|
const element$ = writable(null, equalOption);
|
|
170
191
|
return {
|
|
@@ -195,16 +216,10 @@ const mergeDirectives = (...args) => (element, arg) => {
|
|
|
195
216
|
const instances = batch(() => args.map((directive) => directive(element, arg)));
|
|
196
217
|
return {
|
|
197
218
|
update(arg2) {
|
|
198
|
-
batch(() => instances.forEach((instance) =>
|
|
199
|
-
var _a;
|
|
200
|
-
return (_a = instance == null ? void 0 : instance.update) == null ? void 0 : _a.call(instance, arg2);
|
|
201
|
-
}));
|
|
219
|
+
batch(() => instances.forEach((instance) => instance?.update?.(arg2)));
|
|
202
220
|
},
|
|
203
221
|
destroy() {
|
|
204
|
-
batch(() => instances.reverse().forEach((instance) =>
|
|
205
|
-
var _a;
|
|
206
|
-
return (_a = instance == null ? void 0 : instance.destroy) == null ? void 0 : _a.call(instance);
|
|
207
|
-
}));
|
|
222
|
+
batch(() => instances.reverse().forEach((instance) => instance?.destroy?.()));
|
|
208
223
|
}
|
|
209
224
|
};
|
|
210
225
|
};
|
|
@@ -212,27 +227,23 @@ const multiDirective = (element, directives) => {
|
|
|
212
227
|
const instances = [];
|
|
213
228
|
const update = (directives2) => batch(() => {
|
|
214
229
|
directives2.forEach((directiveWithArg, index) => {
|
|
215
|
-
var _a, _b, _c, _d;
|
|
216
230
|
const [directive, arg] = Array.isArray(directiveWithArg) ? directiveWithArg : [directiveWithArg, void 0];
|
|
217
231
|
const oldInstance = instances[index];
|
|
218
232
|
if (oldInstance) {
|
|
219
233
|
if (oldInstance.directive === directive) {
|
|
220
234
|
if (oldInstance.arg !== arg) {
|
|
221
|
-
|
|
235
|
+
oldInstance.instance?.update?.(arg);
|
|
222
236
|
oldInstance.arg = arg;
|
|
223
237
|
}
|
|
224
238
|
return;
|
|
225
239
|
}
|
|
226
|
-
|
|
240
|
+
oldInstance.instance?.destroy?.();
|
|
227
241
|
}
|
|
228
242
|
const instance = directive(element, arg);
|
|
229
243
|
instances[index] = { directive, instance, arg };
|
|
230
244
|
});
|
|
231
245
|
const extraInstances = instances.splice(directives2.length);
|
|
232
|
-
extraInstances.reverse().forEach(({ instance }) =>
|
|
233
|
-
var _a;
|
|
234
|
-
return (_a = instance == null ? void 0 : instance.destroy) == null ? void 0 : _a.call(instance);
|
|
235
|
-
});
|
|
246
|
+
extraInstances.reverse().forEach(({ instance }) => instance?.destroy?.());
|
|
236
247
|
});
|
|
237
248
|
update(directives);
|
|
238
249
|
return {
|
|
@@ -280,10 +291,7 @@ const attributesData = (...directives) => {
|
|
|
280
291
|
}
|
|
281
292
|
return element[ssrHTMLElementAttributesAndStyle]();
|
|
282
293
|
} finally {
|
|
283
|
-
instances.forEach((instance) =>
|
|
284
|
-
var _a;
|
|
285
|
-
return (_a = instance == null ? void 0 : instance.destroy) == null ? void 0 : _a.call(instance);
|
|
286
|
-
});
|
|
294
|
+
instances.forEach((instance) => instance?.destroy?.());
|
|
287
295
|
}
|
|
288
296
|
};
|
|
289
297
|
const classDirective = createAttributesDirective((className$) => ({
|
|
@@ -395,29 +403,31 @@ function bindClassName(node, className, value$) {
|
|
|
395
403
|
};
|
|
396
404
|
}
|
|
397
405
|
export {
|
|
406
|
+
computeCommonAncestor as A,
|
|
398
407
|
bindDirective as a,
|
|
399
408
|
browserDirective as b,
|
|
400
409
|
bindDirectiveNoArg as c,
|
|
401
410
|
directiveSubscribe as d,
|
|
402
411
|
directiveUpdate as e,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
412
|
+
createConditionalStoreArrayDirective as f,
|
|
413
|
+
createStoreArrayDirective as g,
|
|
414
|
+
createBrowserStoreArrayDirective as h,
|
|
406
415
|
isBrowserHTMLElement as i,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
416
|
+
createConditionalBrowserStoreArrayDirective as j,
|
|
417
|
+
createStoreDirective as k,
|
|
418
|
+
createBrowserStoreDirective as l,
|
|
410
419
|
mapDirectiveArg as m,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
420
|
+
mergeDirectives as n,
|
|
421
|
+
multiDirective as o,
|
|
422
|
+
createAttributesDirective as p,
|
|
423
|
+
attributesData as q,
|
|
415
424
|
registrationArray as r,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
classDirective as s,
|
|
426
|
+
directiveAttributes as t,
|
|
427
|
+
ssrAttributes as u,
|
|
428
|
+
generateId as v,
|
|
429
|
+
addEvent as w,
|
|
430
|
+
removeClasses as x,
|
|
431
|
+
addClasses as y,
|
|
432
|
+
reflow as z
|
|
423
433
|
};
|