@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
|
@@ -2,8 +2,8 @@ import { writablesForProps, idWithDefault, stateStores, true$, mergeConfigStores
|
|
|
2
2
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
3
3
|
import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
|
|
4
4
|
import { noop } from "./utils/func.js";
|
|
5
|
-
import { e as typeString, g as typeFunction, c as typeBoolean } from "./writables-
|
|
6
|
-
import {
|
|
5
|
+
import { e as typeString, g as typeFunction, c as typeBoolean } from "./writables-e0tyaQpe.js";
|
|
6
|
+
import { n as mergeDirectives, p as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-Bcg9ORcA.js";
|
|
7
7
|
import { createWidgetFactory } from "./utils/widget.js";
|
|
8
8
|
function adjustItemsCloseOthers(items, openItems, oldOpen) {
|
|
9
9
|
let keepOpen;
|
|
@@ -236,16 +236,13 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
236
236
|
patch,
|
|
237
237
|
api: {
|
|
238
238
|
expand: (id) => {
|
|
239
|
-
|
|
240
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.expand();
|
|
239
|
+
getItem(itemWidgets$(), id)?.api.expand();
|
|
241
240
|
},
|
|
242
241
|
collapse: (id) => {
|
|
243
|
-
|
|
244
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.collapse();
|
|
242
|
+
getItem(itemWidgets$(), id)?.api.collapse();
|
|
245
243
|
},
|
|
246
244
|
toggle: (id) => {
|
|
247
|
-
|
|
248
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.toggle();
|
|
245
|
+
getItem(itemWidgets$(), id)?.api.toggle();
|
|
249
246
|
},
|
|
250
247
|
expandAll: () => {
|
|
251
248
|
itemWidgets$().forEach((i) => i.api.expand());
|
|
@@ -255,23 +252,22 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
255
252
|
},
|
|
256
253
|
registerItem: (propsConfig) => {
|
|
257
254
|
const itemProps = accordionItemProps;
|
|
258
|
-
const config2 = mergeConfigStores(itemProps, normalizeConfigStores(itemProps, propsConfig
|
|
255
|
+
const config2 = mergeConfigStores(itemProps, normalizeConfigStores(itemProps, propsConfig?.config), accordionItemConfig);
|
|
259
256
|
const [{ onHidden$, onShown$ }] = writablesForProps(
|
|
260
257
|
{
|
|
261
258
|
onHidden: defaultItemConfig.onHidden,
|
|
262
259
|
onShown: defaultItemConfig.onShown
|
|
263
260
|
},
|
|
264
|
-
{ config: config2, props: propsConfig
|
|
261
|
+
{ config: config2, props: propsConfig?.props }
|
|
265
262
|
);
|
|
266
263
|
const item = itemFactory({
|
|
267
264
|
config: config2,
|
|
268
265
|
props: {
|
|
269
|
-
...propsConfig
|
|
266
|
+
...propsConfig?.props,
|
|
270
267
|
onHidden: asWritable(
|
|
271
268
|
readable(() => {
|
|
272
|
-
var _a;
|
|
273
269
|
onItemHidden$()(item.stores.id$());
|
|
274
|
-
|
|
270
|
+
onHidden$()?.();
|
|
275
271
|
}),
|
|
276
272
|
(val) => {
|
|
277
273
|
onItemHidden$.set(val);
|
|
@@ -279,9 +275,8 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
279
275
|
),
|
|
280
276
|
onShown: asWritable(
|
|
281
277
|
readable(() => {
|
|
282
|
-
var _a;
|
|
283
278
|
onItemShown$()(item.stores.id$());
|
|
284
|
-
|
|
279
|
+
onShown$()?.();
|
|
285
280
|
}),
|
|
286
281
|
(val) => {
|
|
287
282
|
onItemShown$.set(val);
|
|
@@ -3,8 +3,8 @@ const utils_stores = require("./utils/stores.cjs");
|
|
|
3
3
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
4
4
|
const tansu = require("@amadeus-it-group/tansu");
|
|
5
5
|
const utils_func = require("./utils/func.cjs");
|
|
6
|
-
const utils_writables = require("./writables-
|
|
7
|
-
const utils_directive = require("./dom-
|
|
6
|
+
const utils_writables = require("./writables-DcGT98a7.cjs");
|
|
7
|
+
const utils_directive = require("./dom-C2gi9OCP.cjs");
|
|
8
8
|
const utils_widget = require("./utils/widget.cjs");
|
|
9
9
|
function adjustItemsCloseOthers(items, openItems, oldOpen) {
|
|
10
10
|
let keepOpen;
|
|
@@ -237,16 +237,13 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
237
237
|
patch,
|
|
238
238
|
api: {
|
|
239
239
|
expand: (id) => {
|
|
240
|
-
|
|
241
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.expand();
|
|
240
|
+
getItem(itemWidgets$(), id)?.api.expand();
|
|
242
241
|
},
|
|
243
242
|
collapse: (id) => {
|
|
244
|
-
|
|
245
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.collapse();
|
|
243
|
+
getItem(itemWidgets$(), id)?.api.collapse();
|
|
246
244
|
},
|
|
247
245
|
toggle: (id) => {
|
|
248
|
-
|
|
249
|
-
(_a = getItem(itemWidgets$(), id)) == null ? void 0 : _a.api.toggle();
|
|
246
|
+
getItem(itemWidgets$(), id)?.api.toggle();
|
|
250
247
|
},
|
|
251
248
|
expandAll: () => {
|
|
252
249
|
itemWidgets$().forEach((i) => i.api.expand());
|
|
@@ -256,23 +253,22 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
256
253
|
},
|
|
257
254
|
registerItem: (propsConfig) => {
|
|
258
255
|
const itemProps = accordionItemProps;
|
|
259
|
-
const config2 = utils_stores.mergeConfigStores(itemProps, utils_stores.normalizeConfigStores(itemProps, propsConfig
|
|
256
|
+
const config2 = utils_stores.mergeConfigStores(itemProps, utils_stores.normalizeConfigStores(itemProps, propsConfig?.config), accordionItemConfig);
|
|
260
257
|
const [{ onHidden$, onShown$ }] = utils_stores.writablesForProps(
|
|
261
258
|
{
|
|
262
259
|
onHidden: defaultItemConfig.onHidden,
|
|
263
260
|
onShown: defaultItemConfig.onShown
|
|
264
261
|
},
|
|
265
|
-
{ config: config2, props: propsConfig
|
|
262
|
+
{ config: config2, props: propsConfig?.props }
|
|
266
263
|
);
|
|
267
264
|
const item = itemFactory({
|
|
268
265
|
config: config2,
|
|
269
266
|
props: {
|
|
270
|
-
...propsConfig
|
|
267
|
+
...propsConfig?.props,
|
|
271
268
|
onHidden: tansu.asWritable(
|
|
272
269
|
tansu.readable(() => {
|
|
273
|
-
var _a;
|
|
274
270
|
onItemHidden$()(item.stores.id$());
|
|
275
|
-
|
|
271
|
+
onHidden$()?.();
|
|
276
272
|
}),
|
|
277
273
|
(val) => {
|
|
278
274
|
onItemHidden$.set(val);
|
|
@@ -280,9 +276,8 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
|
|
|
280
276
|
),
|
|
281
277
|
onShown: tansu.asWritable(
|
|
282
278
|
tansu.readable(() => {
|
|
283
|
-
var _a;
|
|
284
279
|
onItemShown$()(item.stores.id$());
|
|
285
|
-
|
|
280
|
+
onShown$()?.();
|
|
286
281
|
}),
|
|
287
282
|
(val) => {
|
|
288
283
|
onItemShown$.set(val);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-
|
|
1
|
+
import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-DK0ADNTX.js";
|
|
2
2
|
import { createWidgetFactory } from "./utils/widget.js";
|
|
3
3
|
function getAlertDefaultConfig() {
|
|
4
4
|
return { ...getCommonAlertDefaultConfig() };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
|
+
import { writablesForProps, idWithDefault, stateStores } from "./utils/stores.js";
|
|
3
|
+
import { p as createAttributesDirective, n as mergeDirectives } from "./dom-Bcg9ORcA.js";
|
|
4
|
+
import { g as typeFunction, e as typeString, c as typeBoolean } from "./writables-e0tyaQpe.js";
|
|
5
|
+
import { computed } from "@amadeus-it-group/tansu";
|
|
6
|
+
import { noop } from "./utils/func.js";
|
|
7
|
+
import { createWidgetFactory } from "./utils/widget.js";
|
|
8
|
+
const defaultCollapseConfig = {
|
|
9
|
+
visible: false,
|
|
10
|
+
onVisibleChange: noop,
|
|
11
|
+
onShown: noop,
|
|
12
|
+
onHidden: noop,
|
|
13
|
+
animated: true,
|
|
14
|
+
animatedOnInit: false,
|
|
15
|
+
id: "",
|
|
16
|
+
transition: noop
|
|
17
|
+
};
|
|
18
|
+
function getCollapseDefaultConfig() {
|
|
19
|
+
return { ...defaultCollapseConfig };
|
|
20
|
+
}
|
|
21
|
+
const commonCollapseConfigValidator = {
|
|
22
|
+
onVisibleChange: typeFunction,
|
|
23
|
+
onHidden: typeFunction,
|
|
24
|
+
onShown: typeFunction,
|
|
25
|
+
animatedOnInit: typeBoolean,
|
|
26
|
+
animated: typeBoolean,
|
|
27
|
+
visible: typeBoolean,
|
|
28
|
+
id: typeString,
|
|
29
|
+
transition: typeFunction
|
|
30
|
+
};
|
|
31
|
+
const createCollapse = createWidgetFactory("collapse", (config) => {
|
|
32
|
+
const [
|
|
33
|
+
{ transition$, animatedOnInit$, animated$, visible$: requestedVisible$, onVisibleChange$, onHidden$, onShown$, id$: _dirtyId$, ...stateProps },
|
|
34
|
+
patch
|
|
35
|
+
] = writablesForProps(defaultCollapseConfig, config, commonCollapseConfigValidator);
|
|
36
|
+
const id$ = idWithDefault(_dirtyId$);
|
|
37
|
+
const transition = createTransition({
|
|
38
|
+
props: {
|
|
39
|
+
transition: transition$,
|
|
40
|
+
visible: requestedVisible$,
|
|
41
|
+
animated: animated$,
|
|
42
|
+
animatedOnInit: animatedOnInit$,
|
|
43
|
+
onVisibleChange: onVisibleChange$,
|
|
44
|
+
onHidden: onHidden$,
|
|
45
|
+
onShown: onShown$
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const visible$ = transition.stores.visible$;
|
|
49
|
+
const hidden$ = transition.stores.hidden$;
|
|
50
|
+
return {
|
|
51
|
+
...stateStores({ ...stateProps, visible$, hidden$ }),
|
|
52
|
+
patch,
|
|
53
|
+
api: {
|
|
54
|
+
open: transition.api.show,
|
|
55
|
+
close: transition.api.hide,
|
|
56
|
+
toggle: transition.api.toggle
|
|
57
|
+
},
|
|
58
|
+
directives: {
|
|
59
|
+
collapseDirective: mergeDirectives(
|
|
60
|
+
transition.directives.directive,
|
|
61
|
+
createAttributesDirective(() => ({
|
|
62
|
+
attributes: {
|
|
63
|
+
id: id$
|
|
64
|
+
}
|
|
65
|
+
}))
|
|
66
|
+
),
|
|
67
|
+
triggerDirective: createAttributesDirective(() => ({
|
|
68
|
+
attributes: {
|
|
69
|
+
"aria-expanded": computed(() => `${visible$()}`),
|
|
70
|
+
"aria-controls": id$
|
|
71
|
+
},
|
|
72
|
+
events: {
|
|
73
|
+
click: () => transition.api.toggle()
|
|
74
|
+
}
|
|
75
|
+
}))
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
createCollapse as c,
|
|
81
|
+
getCollapseDefaultConfig as g
|
|
82
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
|
+
const utils_stores = require("./utils/stores.cjs");
|
|
4
|
+
const utils_directive = require("./dom-C2gi9OCP.cjs");
|
|
5
|
+
const utils_writables = require("./writables-DcGT98a7.cjs");
|
|
6
|
+
const tansu = require("@amadeus-it-group/tansu");
|
|
7
|
+
const utils_func = require("./utils/func.cjs");
|
|
8
|
+
const utils_widget = require("./utils/widget.cjs");
|
|
9
|
+
const defaultCollapseConfig = {
|
|
10
|
+
visible: false,
|
|
11
|
+
onVisibleChange: utils_func.noop,
|
|
12
|
+
onShown: utils_func.noop,
|
|
13
|
+
onHidden: utils_func.noop,
|
|
14
|
+
animated: true,
|
|
15
|
+
animatedOnInit: false,
|
|
16
|
+
id: "",
|
|
17
|
+
transition: utils_func.noop
|
|
18
|
+
};
|
|
19
|
+
function getCollapseDefaultConfig() {
|
|
20
|
+
return { ...defaultCollapseConfig };
|
|
21
|
+
}
|
|
22
|
+
const commonCollapseConfigValidator = {
|
|
23
|
+
onVisibleChange: utils_writables.typeFunction,
|
|
24
|
+
onHidden: utils_writables.typeFunction,
|
|
25
|
+
onShown: utils_writables.typeFunction,
|
|
26
|
+
animatedOnInit: utils_writables.typeBoolean,
|
|
27
|
+
animated: utils_writables.typeBoolean,
|
|
28
|
+
visible: utils_writables.typeBoolean,
|
|
29
|
+
id: utils_writables.typeString,
|
|
30
|
+
transition: utils_writables.typeFunction
|
|
31
|
+
};
|
|
32
|
+
const createCollapse = utils_widget.createWidgetFactory("collapse", (config) => {
|
|
33
|
+
const [
|
|
34
|
+
{ transition$, animatedOnInit$, animated$, visible$: requestedVisible$, onVisibleChange$, onHidden$, onShown$, id$: _dirtyId$, ...stateProps },
|
|
35
|
+
patch
|
|
36
|
+
] = utils_stores.writablesForProps(defaultCollapseConfig, config, commonCollapseConfigValidator);
|
|
37
|
+
const id$ = utils_stores.idWithDefault(_dirtyId$);
|
|
38
|
+
const transition = services_transitions_baseTransitions.createTransition({
|
|
39
|
+
props: {
|
|
40
|
+
transition: transition$,
|
|
41
|
+
visible: requestedVisible$,
|
|
42
|
+
animated: animated$,
|
|
43
|
+
animatedOnInit: animatedOnInit$,
|
|
44
|
+
onVisibleChange: onVisibleChange$,
|
|
45
|
+
onHidden: onHidden$,
|
|
46
|
+
onShown: onShown$
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const visible$ = transition.stores.visible$;
|
|
50
|
+
const hidden$ = transition.stores.hidden$;
|
|
51
|
+
return {
|
|
52
|
+
...utils_stores.stateStores({ ...stateProps, visible$, hidden$ }),
|
|
53
|
+
patch,
|
|
54
|
+
api: {
|
|
55
|
+
open: transition.api.show,
|
|
56
|
+
close: transition.api.hide,
|
|
57
|
+
toggle: transition.api.toggle
|
|
58
|
+
},
|
|
59
|
+
directives: {
|
|
60
|
+
collapseDirective: utils_directive.mergeDirectives(
|
|
61
|
+
transition.directives.directive,
|
|
62
|
+
utils_directive.createAttributesDirective(() => ({
|
|
63
|
+
attributes: {
|
|
64
|
+
id: id$
|
|
65
|
+
}
|
|
66
|
+
}))
|
|
67
|
+
),
|
|
68
|
+
triggerDirective: utils_directive.createAttributesDirective(() => ({
|
|
69
|
+
attributes: {
|
|
70
|
+
"aria-expanded": tansu.computed(() => `${visible$()}`),
|
|
71
|
+
"aria-controls": id$
|
|
72
|
+
},
|
|
73
|
+
events: {
|
|
74
|
+
click: () => transition.api.toggle()
|
|
75
|
+
}
|
|
76
|
+
}))
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
exports.createCollapse = createCollapse;
|
|
81
|
+
exports.getCollapseDefaultConfig = getCollapseDefaultConfig;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
3
|
const utils_func = require("./utils/func.cjs");
|
|
4
4
|
const utils_stores = require("./utils/stores.cjs");
|
|
5
|
-
const utils_writables = require("./writables-
|
|
5
|
+
const utils_writables = require("./writables-DcGT98a7.cjs");
|
|
6
6
|
const defaultCommonAlertConfig = {
|
|
7
7
|
visible: true,
|
|
8
8
|
dismissible: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
2
|
import { noop } from "./utils/func.js";
|
|
3
3
|
import { writablesForProps, stateStores } from "./utils/stores.js";
|
|
4
|
-
import { e as typeString, c as typeBoolean, g as typeFunction } from "./writables-
|
|
4
|
+
import { e as typeString, c as typeBoolean, g as typeFunction } from "./writables-e0tyaQpe.js";
|
|
5
5
|
const defaultCommonAlertConfig = {
|
|
6
6
|
visible: true,
|
|
7
7
|
dismissible: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const accordion = require("../../accordion-
|
|
3
|
+
const accordion = require("../../accordion-yD-czBna.cjs");
|
|
4
4
|
exports.createAccordion = accordion.createAccordion;
|
|
5
5
|
exports.createAccordionItem = accordion.createAccordionItem;
|
|
6
6
|
exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const alert = require("../../alert-
|
|
3
|
+
const alert = require("../../alert-B-jQDQcB.cjs");
|
|
4
4
|
exports.createAlert = alert.createAlert;
|
|
5
5
|
exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils_stores = require("../../utils/stores.cjs");
|
|
4
|
-
const utils_directive = require("../../dom-
|
|
4
|
+
const utils_directive = require("../../dom-C2gi9OCP.cjs");
|
|
5
5
|
const EmblaCarousel = require("embla-carousel");
|
|
6
6
|
const tansu = require("@amadeus-it-group/tansu");
|
|
7
|
-
const utils_writables = require("../../writables-
|
|
7
|
+
const utils_writables = require("../../writables-DcGT98a7.cjs");
|
|
8
8
|
const services_navManager = require("../../services/navManager.cjs");
|
|
9
9
|
const utils_widget = require("../../utils/widget.cjs");
|
|
10
10
|
const defaultConfig = {
|
|
@@ -94,7 +94,7 @@ function createEmblaCarousel(options$, plugins$) {
|
|
|
94
94
|
emblaApi.reInit(options2, plugins2);
|
|
95
95
|
},
|
|
96
96
|
destroy: () => {
|
|
97
|
-
emblaApi
|
|
97
|
+
emblaApi?.destroy();
|
|
98
98
|
emblaApi = void 0;
|
|
99
99
|
initialized$.set(false);
|
|
100
100
|
scrolling$.set(false);
|
|
@@ -176,21 +176,15 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
|
|
|
176
176
|
patch,
|
|
177
177
|
api: {
|
|
178
178
|
scrollPrev: (jump) => {
|
|
179
|
-
|
|
180
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev) == null ? void 0 : _b.call(_a, jump);
|
|
179
|
+
emblaCarousel.api?.scrollPrev?.(jump);
|
|
181
180
|
},
|
|
182
181
|
scrollNext: (jump) => {
|
|
183
|
-
|
|
184
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext) == null ? void 0 : _b.call(_a, jump);
|
|
182
|
+
emblaCarousel.api?.scrollNext?.(jump);
|
|
185
183
|
},
|
|
186
184
|
scrollTo: (index, jump) => {
|
|
187
|
-
|
|
188
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, index, jump);
|
|
189
|
-
},
|
|
190
|
-
plugins: () => {
|
|
191
|
-
var _a, _b;
|
|
192
|
-
return (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.plugins) == null ? void 0 : _b.call(_a);
|
|
185
|
+
emblaCarousel.api?.scrollTo?.(index, jump);
|
|
193
186
|
},
|
|
187
|
+
plugins: () => emblaCarousel.api?.plugins?.(),
|
|
194
188
|
emblaApi: () => emblaCarousel.api
|
|
195
189
|
},
|
|
196
190
|
directives: {
|
|
@@ -213,10 +207,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
|
|
|
213
207
|
disabled: tansu.computed(() => !emblaCarousel.stores.canScrollPrev$() || void 0)
|
|
214
208
|
},
|
|
215
209
|
events: {
|
|
216
|
-
click: () =>
|
|
217
|
-
var _a;
|
|
218
|
-
return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev();
|
|
219
|
-
},
|
|
210
|
+
click: () => emblaCarousel.api?.scrollPrev(),
|
|
220
211
|
pointerdown: (event) => event.preventDefault(),
|
|
221
212
|
touchstart: (event) => event.stopPropagation()
|
|
222
213
|
}
|
|
@@ -227,10 +218,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
|
|
|
227
218
|
disabled: tansu.computed(() => !emblaCarousel.stores.canScrollNext$() || void 0)
|
|
228
219
|
},
|
|
229
220
|
events: {
|
|
230
|
-
click: () =>
|
|
231
|
-
var _a;
|
|
232
|
-
return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext();
|
|
233
|
-
},
|
|
221
|
+
click: () => emblaCarousel.api?.scrollNext(),
|
|
234
222
|
pointerdown: (event) => event.preventDefault(),
|
|
235
223
|
touchstart: (event) => event.stopPropagation()
|
|
236
224
|
}
|
|
@@ -254,8 +242,7 @@ const createCarousel = utils_widget.createWidgetFactory("carousel", (config) =>
|
|
|
254
242
|
tabIndicator: utils_directive.createAttributesDirective((slide$) => ({
|
|
255
243
|
events: {
|
|
256
244
|
click: () => {
|
|
257
|
-
|
|
258
|
-
(_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo(slide$().index, slide$().jump ?? true);
|
|
245
|
+
emblaCarousel.api?.scrollTo(slide$().index, slide$().jump ?? true);
|
|
259
246
|
}
|
|
260
247
|
},
|
|
261
248
|
attributes: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writablesForProps, stateStores, true$ } from "../../utils/stores.js";
|
|
2
|
-
import { a as bindDirective, b as browserDirective,
|
|
2
|
+
import { a as bindDirective, b as browserDirective, p as createAttributesDirective, n as mergeDirectives } from "../../dom-Bcg9ORcA.js";
|
|
3
3
|
import EmblaCarousel from "embla-carousel";
|
|
4
4
|
import { writable, computed, asReadable, readable } from "@amadeus-it-group/tansu";
|
|
5
|
-
import { g as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, j as createTypeEnum, f as typeStringOrNull, i as typeArray } from "../../writables-
|
|
5
|
+
import { g as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, j as createTypeEnum, f as typeStringOrNull, i as typeArray } from "../../writables-e0tyaQpe.js";
|
|
6
6
|
import { createNavManager } from "../../services/navManager.js";
|
|
7
7
|
import { createWidgetFactory } from "../../utils/widget.js";
|
|
8
8
|
const defaultConfig = {
|
|
@@ -92,7 +92,7 @@ function createEmblaCarousel(options$, plugins$) {
|
|
|
92
92
|
emblaApi.reInit(options2, plugins2);
|
|
93
93
|
},
|
|
94
94
|
destroy: () => {
|
|
95
|
-
emblaApi
|
|
95
|
+
emblaApi?.destroy();
|
|
96
96
|
emblaApi = void 0;
|
|
97
97
|
initialized$.set(false);
|
|
98
98
|
scrolling$.set(false);
|
|
@@ -174,21 +174,15 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
|
|
|
174
174
|
patch,
|
|
175
175
|
api: {
|
|
176
176
|
scrollPrev: (jump) => {
|
|
177
|
-
|
|
178
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev) == null ? void 0 : _b.call(_a, jump);
|
|
177
|
+
emblaCarousel.api?.scrollPrev?.(jump);
|
|
179
178
|
},
|
|
180
179
|
scrollNext: (jump) => {
|
|
181
|
-
|
|
182
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext) == null ? void 0 : _b.call(_a, jump);
|
|
180
|
+
emblaCarousel.api?.scrollNext?.(jump);
|
|
183
181
|
},
|
|
184
182
|
scrollTo: (index, jump) => {
|
|
185
|
-
|
|
186
|
-
(_b = (_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, index, jump);
|
|
187
|
-
},
|
|
188
|
-
plugins: () => {
|
|
189
|
-
var _a, _b;
|
|
190
|
-
return (_b = (_a = emblaCarousel.api) == null ? void 0 : _a.plugins) == null ? void 0 : _b.call(_a);
|
|
183
|
+
emblaCarousel.api?.scrollTo?.(index, jump);
|
|
191
184
|
},
|
|
185
|
+
plugins: () => emblaCarousel.api?.plugins?.(),
|
|
192
186
|
emblaApi: () => emblaCarousel.api
|
|
193
187
|
},
|
|
194
188
|
directives: {
|
|
@@ -211,10 +205,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
|
|
|
211
205
|
disabled: computed(() => !emblaCarousel.stores.canScrollPrev$() || void 0)
|
|
212
206
|
},
|
|
213
207
|
events: {
|
|
214
|
-
click: () =>
|
|
215
|
-
var _a;
|
|
216
|
-
return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollPrev();
|
|
217
|
-
},
|
|
208
|
+
click: () => emblaCarousel.api?.scrollPrev(),
|
|
218
209
|
pointerdown: (event) => event.preventDefault(),
|
|
219
210
|
touchstart: (event) => event.stopPropagation()
|
|
220
211
|
}
|
|
@@ -225,10 +216,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
|
|
|
225
216
|
disabled: computed(() => !emblaCarousel.stores.canScrollNext$() || void 0)
|
|
226
217
|
},
|
|
227
218
|
events: {
|
|
228
|
-
click: () =>
|
|
229
|
-
var _a;
|
|
230
|
-
return (_a = emblaCarousel.api) == null ? void 0 : _a.scrollNext();
|
|
231
|
-
},
|
|
219
|
+
click: () => emblaCarousel.api?.scrollNext(),
|
|
232
220
|
pointerdown: (event) => event.preventDefault(),
|
|
233
221
|
touchstart: (event) => event.stopPropagation()
|
|
234
222
|
}
|
|
@@ -252,8 +240,7 @@ const createCarousel = createWidgetFactory("carousel", (config) => {
|
|
|
252
240
|
tabIndicator: createAttributesDirective((slide$) => ({
|
|
253
241
|
events: {
|
|
254
242
|
click: () => {
|
|
255
|
-
|
|
256
|
-
(_a = emblaCarousel.api) == null ? void 0 : _a.scrollTo(slide$().index, slide$().jump ?? true);
|
|
243
|
+
emblaCarousel.api?.scrollTo(slide$().index, slide$().jump ?? true);
|
|
257
244
|
}
|
|
258
245
|
},
|
|
259
246
|
attributes: {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type TransitionFn } from '../../services/transitions/baseTransitions';
|
|
2
|
+
import type { Directive, Widget, WidgetFactory } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the common properties and state for a collapse component.
|
|
5
|
+
*/
|
|
6
|
+
interface CollapseCommonPropsAndState {
|
|
7
|
+
/**
|
|
8
|
+
* If `true` the collapse is visible to the user
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue `true`
|
|
11
|
+
*/
|
|
12
|
+
visible: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents the state of a Collapse component.
|
|
16
|
+
*/
|
|
17
|
+
export interface CollapseState extends CollapseCommonPropsAndState {
|
|
18
|
+
/**
|
|
19
|
+
* Is `true` when the collapse is hidden. Compared to `visible`, this is updated after the transition is executed.
|
|
20
|
+
*/
|
|
21
|
+
hidden: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Properties for the Collapse component.
|
|
25
|
+
*/
|
|
26
|
+
export interface CollapseProps extends CollapseCommonPropsAndState {
|
|
27
|
+
/**
|
|
28
|
+
* Callback called when the collapse visibility changed.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue
|
|
31
|
+
* ```ts
|
|
32
|
+
* () => {}
|
|
33
|
+
* ```
|
|
34
|
+
* @param visible - The new visibility state of the collapse.
|
|
35
|
+
*/
|
|
36
|
+
onVisibleChange: (visible: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Callback called when the collapse is hidden.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue
|
|
41
|
+
* ```ts
|
|
42
|
+
* () => {}
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
onHidden: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback called when the collapse is shown.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue
|
|
50
|
+
* ```ts
|
|
51
|
+
* () => {}
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
onShown: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* If `true`, collapse opening will be animated at init time.
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue `false`
|
|
59
|
+
*/
|
|
60
|
+
animatedOnInit: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If `true`, collapse closing and opening will be animated.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue `true`
|
|
65
|
+
*/
|
|
66
|
+
animated: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* id of the collapse
|
|
69
|
+
*
|
|
70
|
+
* @defaultValue `''`
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
/**
|
|
74
|
+
* The transition function will be executed when the collapse is displayed or hidden.
|
|
75
|
+
*
|
|
76
|
+
* Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue `() => {}`
|
|
79
|
+
*/
|
|
80
|
+
transition: TransitionFn;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Interface representing the API for a collapsible component.
|
|
84
|
+
*/
|
|
85
|
+
export interface CollapseApi {
|
|
86
|
+
/**
|
|
87
|
+
* Triggers collapse closing programmatically.
|
|
88
|
+
*/
|
|
89
|
+
close(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Triggers the collapse content to be displayed for the user.
|
|
92
|
+
*/
|
|
93
|
+
open(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Toggles the collapse content visibility.
|
|
96
|
+
*/
|
|
97
|
+
toggle(): void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Interface representing the directives used in a collapse component.
|
|
101
|
+
*/
|
|
102
|
+
export interface CollapseDirectives {
|
|
103
|
+
/**
|
|
104
|
+
* Directive to apply the collapse.
|
|
105
|
+
*/
|
|
106
|
+
collapseDirective: Directive;
|
|
107
|
+
/**
|
|
108
|
+
* Directive to apply to a trigger;
|
|
109
|
+
*/
|
|
110
|
+
triggerDirective: Directive;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Represents a widget for handling collapse functionality.
|
|
114
|
+
*
|
|
115
|
+
* This type defines the structure of a CollapseWidget, which includes properties, state, API, and directives
|
|
116
|
+
* necessary for managing the collapse behavior in the UI.
|
|
117
|
+
*
|
|
118
|
+
* @type {Widget<CollapseProps, CollapseState, CollapseApi, CollapseDirectives>}
|
|
119
|
+
*/
|
|
120
|
+
export type CollapseWidget = Widget<CollapseProps, CollapseState, CollapseApi, CollapseDirectives>;
|
|
121
|
+
/**
|
|
122
|
+
* Retrieve a shallow copy of the default collapse config
|
|
123
|
+
* @returns the default collapse config
|
|
124
|
+
*/
|
|
125
|
+
export declare function getCollapseDefaultConfig(): CollapseProps;
|
|
126
|
+
/**
|
|
127
|
+
* Create an CollapseWidget factory
|
|
128
|
+
* @param transitionFn - the transition function that will be used for the collapse
|
|
129
|
+
* @returns an CollapseWidget
|
|
130
|
+
*/
|
|
131
|
+
export declare const createCollapse: WidgetFactory<CollapseWidget>;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './collapse';
|