@agnos-ui/core 0.4.3 → 0.5.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/README.md +2 -2
- package/{accordion-BnaSamoQ.js → accordion-BGv150k9.js} +10 -13
- package/{accordion-DmPT0O0j.cjs → accordion-Lp-LEbZ2.cjs} +10 -13
- package/{alert-CEFbEgvG.cjs → alert-Bq101evB.cjs} +1 -1
- package/{alert-DdGuK__c.js → alert-DJ2l7bcA.js} +1 -1
- package/{common-CO5b5G_J.js → common-Banw3FYN.js} +15 -14
- package/{common-nxv_hKNE.cjs → common-DvPjK7SS.cjs} +15 -14
- package/components/accordion/accordion.d.ts +35 -8
- package/components/accordion/index.cjs +1 -1
- package/components/accordion/index.js +1 -1
- package/components/alert/alert.d.ts +16 -1
- package/components/alert/common.d.ts +19 -1
- package/components/alert/index.cjs +1 -1
- package/components/alert/index.js +1 -1
- package/components/commonProps.d.ts +3 -0
- package/components/modal/index.cjs +1 -1
- package/components/modal/index.js +1 -1
- package/components/modal/modal.d.ts +3 -135
- package/components/pagination/index.cjs +1 -1
- package/components/pagination/index.js +1 -1
- package/components/pagination/pagination.d.ts +30 -217
- package/components/progressbar/index.cjs +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/progressbar/progressbar.d.ts +13 -3
- package/components/rating/index.cjs +1 -1
- package/components/rating/index.js +1 -1
- package/components/rating/rating.d.ts +26 -115
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/select/select.d.ts +21 -148
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +1 -1
- package/components/slider/slider.d.ts +31 -126
- package/components/toast/index.cjs +1 -1
- package/components/toast/index.js +1 -1
- package/components/toast/toast.d.ts +16 -1
- package/config.d.ts +17 -1
- package/{directive-3-8yr-ZK.js → directive-CKEccryv.js} +11 -5
- package/{directive-j-xRk-h3.cjs → directive-DdlwGFtf.cjs} +11 -5
- package/index.cjs +13 -13
- package/index.js +15 -15
- package/{modal-D4d8sy85.cjs → modal-DDHcrykD.cjs} +10 -21
- package/{modal-CeTI4jxI.js → modal-DP-4I7vf.js} +11 -22
- package/package.json +6 -5
- package/{pagination-B9WFv70F.cjs → pagination-CBysiPUs.cjs} +23 -35
- package/{pagination-BpPHKQsH.js → pagination-DwDRot6q.js} +23 -35
- package/{progressbar-BybOg5FE.js → progressbar-CGmNq0cS.js} +3 -4
- package/{progressbar-DXCMeJvL.cjs → progressbar-DghzCJ6_.cjs} +3 -4
- package/{rating-D6Tv_4Vx.js → rating-Da38uaZz.js} +61 -54
- package/{rating-C2Y95r50.cjs → rating-DlfOuwuX.cjs} +61 -54
- package/{select-jUrt_lSn.js → select-CAEPqdz1.js} +92 -72
- package/{select-BBiF-m3N.cjs → select-LBVhNdrd.cjs} +92 -72
- package/services/extendWidget.d.ts +37 -4
- package/services/floatingUI.cjs +3 -2
- package/services/floatingUI.d.ts +28 -27
- package/services/floatingUI.js +3 -2
- package/services/focustrack.cjs +1 -1
- package/services/focustrack.d.ts +21 -0
- package/services/focustrack.js +1 -1
- package/services/hash.d.ts +2 -1
- package/services/intersection.cjs +1 -1
- package/services/intersection.d.ts +9 -13
- package/services/intersection.js +1 -1
- package/services/matchMedia.cjs +1 -1
- package/services/matchMedia.d.ts +2 -1
- package/services/matchMedia.js +1 -1
- package/services/navManager.cjs +1 -1
- package/services/navManager.d.ts +85 -41
- package/services/navManager.js +1 -1
- package/services/portal.cjs +1 -1
- package/services/portal.d.ts +3 -0
- package/services/portal.js +1 -1
- package/services/resizeObserver.cjs +2 -2
- package/services/resizeObserver.d.ts +2 -6
- package/services/resizeObserver.js +2 -2
- package/services/siblingsInert.cjs +3 -3
- package/services/siblingsInert.d.ts +3 -5
- package/services/siblingsInert.js +3 -3
- package/services/transitions/baseTransitions.cjs +4 -5
- package/services/transitions/baseTransitions.d.ts +21 -4
- package/services/transitions/baseTransitions.js +4 -5
- package/services/transitions/collapse.cjs +1 -1
- package/services/transitions/collapse.d.ts +6 -0
- package/services/transitions/collapse.js +1 -1
- package/services/transitions/cssTransitions.cjs +1 -1
- package/services/transitions/cssTransitions.d.ts +3 -0
- package/services/transitions/cssTransitions.js +1 -1
- package/services/transitions/simpleClassTransition.cjs +1 -1
- package/services/transitions/simpleClassTransition.d.ts +9 -2
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-ByDkbyr1.js → slider-DYrwS7Mv.js} +118 -116
- package/{slider-BdsZpxJr.cjs → slider-DlOAawbZ.cjs} +118 -116
- package/{toast-BzxextBQ.js → toast-CpvsibAI.js} +3 -3
- package/{toast-Dy3ck2cM.cjs → toast-D_uSrRZL.cjs} +3 -3
- package/types.cjs +0 -8
- package/types.d.ts +151 -19
- package/types.js +1 -9
- package/utils/directive.cjs +1 -1
- package/utils/directive.d.ts +81 -32
- package/utils/directive.js +1 -1
- package/utils/internal/checks.d.ts +6 -0
- package/utils/internal/dom.d.ts +5 -5
- package/utils/internal/promise.d.ts +9 -0
- package/utils/internal/sort.d.ts +2 -2
- package/utils/internal/ssrHTMLElement.d.ts +4 -0
- package/utils/stores.cjs +1 -1
- package/utils/stores.d.ts +80 -42
- package/utils/stores.js +1 -1
- package/utils/writables.cjs +2 -1
- package/utils/writables.d.ts +52 -3
- package/utils/writables.js +2 -1
- package/{writables-D46sFgGK.cjs → writables-BPAJvaL_.cjs} +9 -0
- package/{writables-DoU_XYTX.js → writables-DCiBdIBK.js} +11 -2
package/config.d.ts
CHANGED
|
@@ -8,9 +8,22 @@ import type { AccordionProps } from './components/accordion/accordion';
|
|
|
8
8
|
import type { ProgressbarProps } from './components/progressbar/progressbar';
|
|
9
9
|
import type { SliderProps } from './components/slider/slider';
|
|
10
10
|
import type { ToastProps } from './components/toast/toast';
|
|
11
|
+
/**
|
|
12
|
+
* A utility type that makes all properties of an object type `T` optional,
|
|
13
|
+
* and also makes all properties of the nested objects within `T` optional.
|
|
14
|
+
*
|
|
15
|
+
* @template T - The object type to be transformed.
|
|
16
|
+
*/
|
|
11
17
|
export type Partial2Levels<T> = Partial<{
|
|
12
18
|
[Level1 in keyof T]: Partial<T[Level1]>;
|
|
13
19
|
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Represents a store for widget configurations with support for partial updates
|
|
22
|
+
* at two levels of depth. This store includes signals for its own state, an optional
|
|
23
|
+
* parent state, and an optional adapted parent state.
|
|
24
|
+
*
|
|
25
|
+
* @template T - The type of the widget configuration.
|
|
26
|
+
*/
|
|
14
27
|
export type WidgetsConfigStore<T> = WritableSignal<Partial2Levels<T>> & {
|
|
15
28
|
own$: WritableSignal<Partial2Levels<T>>;
|
|
16
29
|
parent$: undefined | WritableSignal<Partial2Levels<T>>;
|
|
@@ -45,7 +58,10 @@ export declare const mergeInto: <T>(destination: T, source: T | undefined, level
|
|
|
45
58
|
* parent$, adaptedParent$ (containing the value computed after the first step), and own$ (that contains only overridding properties).
|
|
46
59
|
* The resulting store is writable, its set function is actually the set function of the own$ store.
|
|
47
60
|
*/
|
|
48
|
-
export declare const createWidgetsConfig: <T>(parent$?: WidgetsConfigStore<T
|
|
61
|
+
export declare const createWidgetsConfig: <T>(parent$?: WidgetsConfigStore<T>, adaptParentConfig?: (config: Partial2Levels<T>) => Partial2Levels<T>) => WidgetsConfigStore<T>;
|
|
62
|
+
/**
|
|
63
|
+
* Configuration for various widgets used in the application.
|
|
64
|
+
*/
|
|
49
65
|
export type WidgetsConfig = {
|
|
50
66
|
/**
|
|
51
67
|
* the pagination widget config
|
|
@@ -142,13 +142,19 @@ const isBrowserHTMLElement = BROWSER ? (element) => {
|
|
|
142
142
|
var _a;
|
|
143
143
|
const contentWindow = ((_a = element == null ? void 0 : element.ownerDocument) == null ? void 0 : _a.defaultView) ?? window;
|
|
144
144
|
return element instanceof contentWindow.HTMLElement;
|
|
145
|
-
} : (
|
|
145
|
+
} : (
|
|
146
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
147
|
+
(element) => false
|
|
148
|
+
);
|
|
146
149
|
const browserDirective = BROWSER ? (directive) => (node, args) => {
|
|
147
150
|
if (isBrowserHTMLElement(node)) {
|
|
148
151
|
return directive(node, args);
|
|
149
152
|
}
|
|
150
|
-
} : (
|
|
151
|
-
|
|
153
|
+
} : (
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
155
|
+
(directive) => () => {
|
|
156
|
+
}
|
|
157
|
+
);
|
|
152
158
|
const bindDirective = (directive, directiveArg$) => (element) => {
|
|
153
159
|
let firstTime = true;
|
|
154
160
|
let instance;
|
|
@@ -189,13 +195,13 @@ const directiveSubscribe = (store, asyncUnsubscribe = true) => () => {
|
|
|
189
195
|
return {
|
|
190
196
|
destroy: async () => {
|
|
191
197
|
if (asyncUnsubscribe) {
|
|
192
|
-
await
|
|
198
|
+
await Promise.resolve();
|
|
193
199
|
}
|
|
194
200
|
unsubscribe();
|
|
195
201
|
}
|
|
196
202
|
};
|
|
197
203
|
};
|
|
198
|
-
const directiveUpdate = (update) => (
|
|
204
|
+
const directiveUpdate = (update) => (_element, arg) => {
|
|
199
205
|
update(arg);
|
|
200
206
|
return {
|
|
201
207
|
update
|
|
@@ -143,13 +143,19 @@ const isBrowserHTMLElement = esmEnv.BROWSER ? (element) => {
|
|
|
143
143
|
var _a;
|
|
144
144
|
const contentWindow = ((_a = element == null ? void 0 : element.ownerDocument) == null ? void 0 : _a.defaultView) ?? window;
|
|
145
145
|
return element instanceof contentWindow.HTMLElement;
|
|
146
|
-
} : (
|
|
146
|
+
} : (
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
148
|
+
(element) => false
|
|
149
|
+
);
|
|
147
150
|
const browserDirective = esmEnv.BROWSER ? (directive) => (node, args) => {
|
|
148
151
|
if (isBrowserHTMLElement(node)) {
|
|
149
152
|
return directive(node, args);
|
|
150
153
|
}
|
|
151
|
-
} : (
|
|
152
|
-
|
|
154
|
+
} : (
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
156
|
+
(directive) => () => {
|
|
157
|
+
}
|
|
158
|
+
);
|
|
153
159
|
const bindDirective = (directive, directiveArg$) => (element) => {
|
|
154
160
|
let firstTime = true;
|
|
155
161
|
let instance;
|
|
@@ -190,13 +196,13 @@ const directiveSubscribe = (store, asyncUnsubscribe = true) => () => {
|
|
|
190
196
|
return {
|
|
191
197
|
destroy: async () => {
|
|
192
198
|
if (asyncUnsubscribe) {
|
|
193
|
-
await
|
|
199
|
+
await Promise.resolve();
|
|
194
200
|
}
|
|
195
201
|
unsubscribe();
|
|
196
202
|
}
|
|
197
203
|
};
|
|
198
204
|
};
|
|
199
|
-
const directiveUpdate = (update) => (
|
|
205
|
+
const directiveUpdate = (update) => (_element, arg) => {
|
|
200
206
|
update(arg);
|
|
201
207
|
return {
|
|
202
208
|
update
|
package/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const types = require("./types.cjs");
|
|
4
|
-
const accordion = require("./accordion-
|
|
5
|
-
const alert = require("./alert-
|
|
6
|
-
const modal = require("./modal-
|
|
7
|
-
const pagination = require("./pagination-
|
|
8
|
-
const progressbar = require("./progressbar-
|
|
9
|
-
const rating = require("./rating-
|
|
10
|
-
const select = require("./select-
|
|
11
|
-
const slider = require("./slider-
|
|
12
|
-
const toast = require("./toast-
|
|
4
|
+
const accordion = require("./accordion-Lp-LEbZ2.cjs");
|
|
5
|
+
const alert = require("./alert-Bq101evB.cjs");
|
|
6
|
+
const modal = require("./modal-DDHcrykD.cjs");
|
|
7
|
+
const pagination = require("./pagination-CBysiPUs.cjs");
|
|
8
|
+
const progressbar = require("./progressbar-DghzCJ6_.cjs");
|
|
9
|
+
const rating = require("./rating-DlfOuwuX.cjs");
|
|
10
|
+
const select = require("./select-LBVhNdrd.cjs");
|
|
11
|
+
const slider = require("./slider-DlOAawbZ.cjs");
|
|
12
|
+
const toast = require("./toast-D_uSrRZL.cjs");
|
|
13
13
|
const config = require("./config.cjs");
|
|
14
14
|
const services_extendWidget = require("./services/extendWidget.cjs");
|
|
15
15
|
const services_floatingUI = require("./services/floatingUI.cjs");
|
|
@@ -24,11 +24,10 @@ const services_hash = require("./services/hash.cjs");
|
|
|
24
24
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
25
25
|
const services_transitions_cssTransitions = require("./services/transitions/cssTransitions.cjs");
|
|
26
26
|
const services_transitions_simpleClassTransition = require("./services/transitions/simpleClassTransition.cjs");
|
|
27
|
-
const utils_directive = require("./directive-
|
|
27
|
+
const utils_directive = require("./directive-DdlwGFtf.cjs");
|
|
28
28
|
const utils_stores = require("./utils/stores.cjs");
|
|
29
|
-
const utils_writables = require("./writables-
|
|
29
|
+
const utils_writables = require("./writables-BPAJvaL_.cjs");
|
|
30
30
|
exports.INVALID_VALUE = types.INVALID_VALUE;
|
|
31
|
-
exports.toSlotContextWidget = types.toSlotContextWidget;
|
|
32
31
|
exports.createAccordion = accordion.createAccordion;
|
|
33
32
|
exports.createAccordionItem = accordion.createAccordionItem;
|
|
34
33
|
exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
|
|
@@ -64,7 +63,7 @@ exports.getKeyName = services_navManager.getKeyName;
|
|
|
64
63
|
exports.isInternalInputNavigation = services_navManager.isInternalInputNavigation;
|
|
65
64
|
exports.portal = services_portal.portal;
|
|
66
65
|
exports.createResizeObserver = services_resizeObserver.createResizeObserver;
|
|
67
|
-
exports.
|
|
66
|
+
exports.siblingsInert = services_siblingsInert.siblingsInert;
|
|
68
67
|
exports.hash$ = services_hash.hash$;
|
|
69
68
|
exports.createTransition = services_transitions_baseTransitions.createTransition;
|
|
70
69
|
exports.noAnimation = services_transitions_baseTransitions.noAnimation;
|
|
@@ -104,6 +103,7 @@ exports.toWritableStore = utils_stores.toWritableStore;
|
|
|
104
103
|
exports.writableWithDefault = utils_stores.writableWithDefault;
|
|
105
104
|
exports.writablesForProps = utils_stores.writablesForProps;
|
|
106
105
|
exports.writablesWithDefault = utils_stores.writablesWithDefault;
|
|
106
|
+
exports.createTypeEnum = utils_writables.createTypeEnum;
|
|
107
107
|
exports.testToNormalizeValue = utils_writables.testToNormalizeValue;
|
|
108
108
|
exports.typeArray = utils_writables.typeArray;
|
|
109
109
|
exports.typeBoolean = utils_writables.typeBoolean;
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { INVALID_VALUE
|
|
2
|
-
import { a, c, f, g } from "./accordion-
|
|
3
|
-
import { c as c2, g as g2 } from "./alert-
|
|
4
|
-
import { c as c3, g as g3, a as a2, m } from "./modal-
|
|
5
|
-
import { c as c4, g as g4 } from "./pagination-
|
|
6
|
-
import { c as c5, g as g5 } from "./progressbar-
|
|
7
|
-
import { c as c6, g as g6 } from "./rating-
|
|
8
|
-
import { c as c7, g as g7 } from "./select-
|
|
9
|
-
import { c as c8, g as g8 } from "./slider-
|
|
10
|
-
import { c as c9, g as g9 } from "./toast-
|
|
1
|
+
import { INVALID_VALUE } from "./types.js";
|
|
2
|
+
import { a, c, f, g } from "./accordion-BGv150k9.js";
|
|
3
|
+
import { c as c2, g as g2 } from "./alert-DJ2l7bcA.js";
|
|
4
|
+
import { c as c3, g as g3, a as a2, m } from "./modal-DP-4I7vf.js";
|
|
5
|
+
import { c as c4, g as g4 } from "./pagination-DwDRot6q.js";
|
|
6
|
+
import { c as c5, g as g5 } from "./progressbar-CGmNq0cS.js";
|
|
7
|
+
import { c as c6, g as g6 } from "./rating-Da38uaZz.js";
|
|
8
|
+
import { c as c7, g as g7 } from "./select-CAEPqdz1.js";
|
|
9
|
+
import { c as c8, g as g8 } from "./slider-DYrwS7Mv.js";
|
|
10
|
+
import { c as c9, g as g9 } from "./toast-CpvsibAI.js";
|
|
11
11
|
import { createWidgetsConfig, mergeInto } from "./config.js";
|
|
12
12
|
import { extendWidgetProps } from "./services/extendWidget.js";
|
|
13
13
|
import { createFloatingUI } from "./services/floatingUI.js";
|
|
@@ -17,14 +17,14 @@ import { createMatchMedia } from "./services/matchMedia.js";
|
|
|
17
17
|
import { createNavManager, getKeyName, isInternalInputNavigation } from "./services/navManager.js";
|
|
18
18
|
import { portal } from "./services/portal.js";
|
|
19
19
|
import { createResizeObserver } from "./services/resizeObserver.js";
|
|
20
|
-
import {
|
|
20
|
+
import { siblingsInert } from "./services/siblingsInert.js";
|
|
21
21
|
import { hash$ } from "./services/hash.js";
|
|
22
22
|
import { createTransition, noAnimation } from "./services/transitions/baseTransitions.js";
|
|
23
23
|
import { createCSSTransition, getTransitionDurationMs, hasTransition } from "./services/transitions/cssTransitions.js";
|
|
24
24
|
import { createSimpleClassTransition } from "./services/transitions/simpleClassTransition.js";
|
|
25
|
-
import { o, a as a3, c as c10, b, p, n, g as g10, j, f as f2, h, q, d, e, i, m as m2, k, l, r, s } from "./directive-
|
|
25
|
+
import { o, a as a3, c as c10, b, p, n, g as g10, j, f as f2, h, q, d, e, i, m as m2, k, l, r, s } from "./directive-CKEccryv.js";
|
|
26
26
|
import { bindableDerived, bindableProp, createPatch, findChangedProperties, isStore, mergeConfigStores, normalizeConfigStores, stateStores, toReadableStore, toWritableStore, writableWithDefault, writablesForProps, writablesWithDefault } from "./utils/stores.js";
|
|
27
|
-
import { t, h as h2, c as c11, d as d2, f as f3, g as g11, a as a4, b as b2, e as e2 } from "./writables-
|
|
27
|
+
import { i as i2, t, h as h2, c as c11, d as d2, f as f3, g as g11, a as a4, b as b2, e as e2 } from "./writables-DCiBdIBK.js";
|
|
28
28
|
export {
|
|
29
29
|
INVALID_VALUE,
|
|
30
30
|
activeElement$,
|
|
@@ -60,6 +60,7 @@ export {
|
|
|
60
60
|
h as createStoreDirective,
|
|
61
61
|
c9 as createToast,
|
|
62
62
|
createTransition,
|
|
63
|
+
i2 as createTypeEnum,
|
|
63
64
|
createWidgetsConfig,
|
|
64
65
|
q as directiveAttributes,
|
|
65
66
|
d as directiveSubscribe,
|
|
@@ -94,12 +95,11 @@ export {
|
|
|
94
95
|
normalizeConfigStores,
|
|
95
96
|
portal,
|
|
96
97
|
r as registrationArray,
|
|
97
|
-
|
|
98
|
+
siblingsInert,
|
|
98
99
|
s as ssrAttributes,
|
|
99
100
|
stateStores,
|
|
100
101
|
t as testToNormalizeValue,
|
|
101
102
|
toReadableStore,
|
|
102
|
-
toSlotContextWidget,
|
|
103
103
|
toWritableStore,
|
|
104
104
|
h2 as typeArray,
|
|
105
105
|
c11 as typeBoolean,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const tansu = require("@amadeus-it-group/tansu");
|
|
3
|
-
const utils_writables = require("./writables-
|
|
3
|
+
const utils_writables = require("./writables-BPAJvaL_.cjs");
|
|
4
4
|
const utils_stores = require("./utils/stores.cjs");
|
|
5
5
|
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
6
6
|
const promise = require("./promise-BMJ8qhA8.cjs");
|
|
7
7
|
const func = require("./func-Qd3cD9a3.cjs");
|
|
8
|
-
const utils_directive = require("./directive-
|
|
8
|
+
const utils_directive = require("./directive-DdlwGFtf.cjs");
|
|
9
9
|
const services_portal = require("./services/portal.cjs");
|
|
10
10
|
const services_siblingsInert = require("./services/siblingsInert.cjs");
|
|
11
11
|
const internalRemoveScrollbars = () => {
|
|
@@ -179,7 +179,7 @@ function createModal(config$) {
|
|
|
179
179
|
"aria-label": ariaCloseButtonLabel$
|
|
180
180
|
},
|
|
181
181
|
events: {
|
|
182
|
-
click:
|
|
182
|
+
click: () => close(modalCloseButtonClick)
|
|
183
183
|
}
|
|
184
184
|
}));
|
|
185
185
|
const backdropAttributeDirective = utils_directive.createAttributesDirective(() => ({
|
|
@@ -192,7 +192,11 @@ function createModal(config$) {
|
|
|
192
192
|
class: className$
|
|
193
193
|
},
|
|
194
194
|
events: {
|
|
195
|
-
click:
|
|
195
|
+
click: (event) => {
|
|
196
|
+
if (event.currentTarget === event.target && closeOnOutsideClick$()) {
|
|
197
|
+
close(modalOutsideClick);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
196
200
|
}
|
|
197
201
|
}));
|
|
198
202
|
const res = {
|
|
@@ -211,13 +215,8 @@ function createModal(config$) {
|
|
|
211
215
|
directives: {
|
|
212
216
|
modalPortalDirective,
|
|
213
217
|
backdropPortalDirective,
|
|
214
|
-
backdropDirective: utils_directive.mergeDirectives(
|
|
215
|
-
modalDirective: utils_directive.mergeDirectives(
|
|
216
|
-
utils_directive.bindDirectiveNoArg(modalTransition.directives.directive),
|
|
217
|
-
services_siblingsInert.sliblingsInert,
|
|
218
|
-
utils_directive.directiveSubscribe(action$),
|
|
219
|
-
modalAttributeDirective
|
|
220
|
-
),
|
|
218
|
+
backdropDirective: utils_directive.mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
|
|
219
|
+
modalDirective: utils_directive.mergeDirectives(modalTransition.directives.directive, services_siblingsInert.siblingsInert, utils_directive.directiveSubscribe(action$), modalAttributeDirective),
|
|
221
220
|
closeButtonDirective,
|
|
222
221
|
dialogDirective: utils_directive.bindDirective(
|
|
223
222
|
utils_directive.browserDirective((dialog, visible) => {
|
|
@@ -245,16 +244,6 @@ function createModal(config$) {
|
|
|
245
244
|
return hideResult;
|
|
246
245
|
},
|
|
247
246
|
patch
|
|
248
|
-
},
|
|
249
|
-
actions: {
|
|
250
|
-
modalClick(event) {
|
|
251
|
-
if (event.currentTarget === event.target && closeOnOutsideClick$()) {
|
|
252
|
-
close(modalOutsideClick);
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
closeButtonClick(event) {
|
|
256
|
-
close(modalCloseButtonClick);
|
|
257
|
-
}
|
|
258
247
|
}
|
|
259
248
|
};
|
|
260
249
|
return res;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { computed, readable } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { c as typeBoolean, e as typeString, f as typeFunction, g as typeHTMLElementOrNull } from "./writables-
|
|
2
|
+
import { c as typeBoolean, e as typeString, f as typeFunction, g as typeHTMLElementOrNull } from "./writables-DCiBdIBK.js";
|
|
3
3
|
import { writablesForProps, stateStores } from "./utils/stores.js";
|
|
4
4
|
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
5
5
|
import { d as promiseFromStore } from "./promise-CY2U8bTP.js";
|
|
6
6
|
import { n as noop } from "./func-DR0n-ShK.js";
|
|
7
|
-
import { r as registrationArray, a as bindDirective, k as mergeDirectives,
|
|
7
|
+
import { r as registrationArray, a as bindDirective, k as mergeDirectives, d as directiveSubscribe, b as browserDirective, n as createAttributesDirective } from "./directive-CKEccryv.js";
|
|
8
8
|
import { portal } from "./services/portal.js";
|
|
9
|
-
import {
|
|
9
|
+
import { siblingsInert } from "./services/siblingsInert.js";
|
|
10
10
|
const internalRemoveScrollbars = () => {
|
|
11
11
|
const scrollbarWidth = Math.abs(window.innerWidth - document.documentElement.clientWidth);
|
|
12
12
|
const body = document.body;
|
|
@@ -178,7 +178,7 @@ function createModal(config$) {
|
|
|
178
178
|
"aria-label": ariaCloseButtonLabel$
|
|
179
179
|
},
|
|
180
180
|
events: {
|
|
181
|
-
click:
|
|
181
|
+
click: () => close(modalCloseButtonClick)
|
|
182
182
|
}
|
|
183
183
|
}));
|
|
184
184
|
const backdropAttributeDirective = createAttributesDirective(() => ({
|
|
@@ -191,7 +191,11 @@ function createModal(config$) {
|
|
|
191
191
|
class: className$
|
|
192
192
|
},
|
|
193
193
|
events: {
|
|
194
|
-
click:
|
|
194
|
+
click: (event) => {
|
|
195
|
+
if (event.currentTarget === event.target && closeOnOutsideClick$()) {
|
|
196
|
+
close(modalOutsideClick);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
195
199
|
}
|
|
196
200
|
}));
|
|
197
201
|
const res = {
|
|
@@ -210,13 +214,8 @@ function createModal(config$) {
|
|
|
210
214
|
directives: {
|
|
211
215
|
modalPortalDirective,
|
|
212
216
|
backdropPortalDirective,
|
|
213
|
-
backdropDirective: mergeDirectives(
|
|
214
|
-
modalDirective: mergeDirectives(
|
|
215
|
-
bindDirectiveNoArg(modalTransition.directives.directive),
|
|
216
|
-
sliblingsInert,
|
|
217
|
-
directiveSubscribe(action$),
|
|
218
|
-
modalAttributeDirective
|
|
219
|
-
),
|
|
217
|
+
backdropDirective: mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
|
|
218
|
+
modalDirective: mergeDirectives(modalTransition.directives.directive, siblingsInert, directiveSubscribe(action$), modalAttributeDirective),
|
|
220
219
|
closeButtonDirective,
|
|
221
220
|
dialogDirective: bindDirective(
|
|
222
221
|
browserDirective((dialog, visible) => {
|
|
@@ -244,16 +243,6 @@ function createModal(config$) {
|
|
|
244
243
|
return hideResult;
|
|
245
244
|
},
|
|
246
245
|
patch
|
|
247
|
-
},
|
|
248
|
-
actions: {
|
|
249
|
-
modalClick(event) {
|
|
250
|
-
if (event.currentTarget === event.target && closeOnOutsideClick$()) {
|
|
251
|
-
close(modalOutsideClick);
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
closeButtonClick(event) {
|
|
255
|
-
close(modalCloseButtonClick);
|
|
256
|
-
}
|
|
257
246
|
}
|
|
258
247
|
};
|
|
259
248
|
return res;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/core",
|
|
3
|
-
"description": "Framework-agnostic headless
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Framework-agnostic headless component library.",
|
|
4
|
+
"version": "0.5.0-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@amadeus-it-group/tansu": "^1.0.0",
|
|
48
|
-
"@floating-ui/dom": "^1.6.
|
|
49
|
-
"esm-env": "^1.
|
|
48
|
+
"@floating-ui/dom": "^1.6.11",
|
|
49
|
+
"esm-env": "^1.1.4"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
|
-
"homepage": "https://
|
|
52
|
+
"homepage": "https://www.agnosui.dev/latest/",
|
|
53
53
|
"bugs": "https://github.com/AmadeusITGroup/AgnosUI/issues",
|
|
54
54
|
"license": "MIT",
|
|
55
55
|
"repository": {
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"accordion",
|
|
63
63
|
"AgnosUI",
|
|
64
64
|
"alert",
|
|
65
|
+
"collapse",
|
|
65
66
|
"components",
|
|
66
67
|
"modal",
|
|
67
68
|
"pagination",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const tansu = require("@amadeus-it-group/tansu");
|
|
3
|
-
const types = require("./types.cjs");
|
|
4
3
|
const utils_stores = require("./utils/stores.cjs");
|
|
5
|
-
const utils_writables = require("./writables-
|
|
4
|
+
const utils_writables = require("./writables-BPAJvaL_.cjs");
|
|
6
5
|
const func = require("./func-Qd3cD9a3.cjs");
|
|
7
|
-
const utils_directive = require("./directive-
|
|
6
|
+
const utils_directive = require("./directive-DdlwGFtf.cjs");
|
|
8
7
|
const PAGE_LINK_DEFAULT = "#";
|
|
9
8
|
const defaultConfig = {
|
|
10
9
|
page: 1,
|
|
@@ -13,7 +12,6 @@ const defaultConfig = {
|
|
|
13
12
|
disabled: false,
|
|
14
13
|
directionLinks: true,
|
|
15
14
|
boundaryLinks: false,
|
|
16
|
-
size: null,
|
|
17
15
|
onPageChange: func.noop,
|
|
18
16
|
pagesFactory: (_page, pageCount) => {
|
|
19
17
|
const pages = [];
|
|
@@ -30,7 +28,7 @@ const defaultConfig = {
|
|
|
30
28
|
ariaNextLabel: "Action link for next page",
|
|
31
29
|
ariaLastLabel: "Action link for last page",
|
|
32
30
|
ariaEllipsisLabel: "Ellipsis page element",
|
|
33
|
-
ariaLiveLabel: (currentPage
|
|
31
|
+
ariaLiveLabel: (currentPage) => `Current page is ${currentPage}`,
|
|
34
32
|
className: "",
|
|
35
33
|
pageLink: (_page) => PAGE_LINK_DEFAULT
|
|
36
34
|
};
|
|
@@ -44,7 +42,6 @@ const configValidator = {
|
|
|
44
42
|
disabled: utils_writables.typeBoolean,
|
|
45
43
|
directionLinks: utils_writables.typeBoolean,
|
|
46
44
|
boundaryLinks: utils_writables.typeBoolean,
|
|
47
|
-
size: { normalizeValue: (value) => value === "lg" || value === "sm" || value === null ? value : types.INVALID_VALUE },
|
|
48
45
|
onPageChange: utils_writables.typeFunction,
|
|
49
46
|
pagesFactory: utils_writables.typeFunction,
|
|
50
47
|
ariaLabel: utils_writables.typeString,
|
|
@@ -56,7 +53,8 @@ const configValidator = {
|
|
|
56
53
|
ariaLastLabel: utils_writables.typeString,
|
|
57
54
|
ariaLiveLabel: utils_writables.typeFunction,
|
|
58
55
|
className: utils_writables.typeString,
|
|
59
|
-
pageLink: utils_writables.typeFunction
|
|
56
|
+
pageLink: utils_writables.typeFunction,
|
|
57
|
+
ariaEllipsisLabel: utils_writables.typeString
|
|
60
58
|
};
|
|
61
59
|
function createPagination(config) {
|
|
62
60
|
const [
|
|
@@ -110,17 +108,13 @@ function createPagination(config) {
|
|
|
110
108
|
};
|
|
111
109
|
});
|
|
112
110
|
const ariaLiveLabelText$ = tansu.computed(() => ariaLiveLabel$()(page$(), pageCount$()));
|
|
113
|
-
function handleNavigation(pageNumber, event
|
|
111
|
+
function handleNavigation(pageNumber, event) {
|
|
114
112
|
if (pagesHrefs$()[pageNumber - 1] === PAGE_LINK_DEFAULT) {
|
|
115
113
|
event == null ? void 0 : event.preventDefault();
|
|
116
114
|
}
|
|
117
115
|
if (!event || !(event.ctrlKey || event.metaKey)) {
|
|
118
116
|
event == null ? void 0 : event.preventDefault();
|
|
119
|
-
|
|
120
|
-
page$.update(pageNavigationHandler);
|
|
121
|
-
} else {
|
|
122
|
-
page$.set(pageNumber);
|
|
123
|
-
}
|
|
117
|
+
page$.set(pageNumber);
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
120
|
const widget = {
|
|
@@ -142,50 +136,44 @@ function createPagination(config) {
|
|
|
142
136
|
...stateProps
|
|
143
137
|
}),
|
|
144
138
|
patch,
|
|
145
|
-
|
|
139
|
+
api: {
|
|
146
140
|
/**
|
|
147
141
|
* Set the current page pageNumber (starting from 1)
|
|
148
142
|
* @param pageNumber - Current page number to set.
|
|
149
143
|
* Value is normalized between 1 and the number of page
|
|
150
|
-
* @param event UI event that triggered the select
|
|
151
144
|
*/
|
|
152
|
-
select(pageNumber
|
|
153
|
-
|
|
145
|
+
select(pageNumber) {
|
|
146
|
+
page$.set(pageNumber);
|
|
154
147
|
},
|
|
155
148
|
/**
|
|
156
149
|
* Select the first page
|
|
157
|
-
* @param event Event triggering the action
|
|
158
150
|
*/
|
|
159
|
-
first(
|
|
160
|
-
|
|
151
|
+
first() {
|
|
152
|
+
page$.set(1);
|
|
161
153
|
},
|
|
162
154
|
/**
|
|
163
155
|
* Select the previous page
|
|
164
|
-
* @param event Event triggering the action
|
|
165
156
|
*/
|
|
166
|
-
previous(
|
|
167
|
-
|
|
157
|
+
previous() {
|
|
158
|
+
page$.update((p) => p - 1);
|
|
168
159
|
},
|
|
169
160
|
/**
|
|
170
161
|
* Select the next page
|
|
171
|
-
* @param event Event triggering the action
|
|
172
162
|
*/
|
|
173
|
-
next(
|
|
174
|
-
|
|
163
|
+
next() {
|
|
164
|
+
page$.update((p) => p + 1);
|
|
175
165
|
},
|
|
176
166
|
/**
|
|
177
167
|
* Select the last page
|
|
178
|
-
* @param event Event triggering the action
|
|
179
168
|
*/
|
|
180
|
-
last(
|
|
181
|
-
|
|
169
|
+
last() {
|
|
170
|
+
page$.set(pageCount$());
|
|
182
171
|
}
|
|
183
172
|
},
|
|
184
|
-
api: {},
|
|
185
173
|
directives: {
|
|
186
174
|
pageLink: utils_directive.createAttributesDirective((pageLinkContext$) => ({
|
|
187
175
|
events: {
|
|
188
|
-
click: (e) =>
|
|
176
|
+
click: (e) => handleNavigation(pageLinkContext$().page, e)
|
|
189
177
|
},
|
|
190
178
|
attributes: {
|
|
191
179
|
"aria-current": tansu.computed(() => page$() === pageLinkContext$().page ? "page" : void 0),
|
|
@@ -200,7 +188,7 @@ function createPagination(config) {
|
|
|
200
188
|
})),
|
|
201
189
|
pageFirst: utils_directive.createAttributesDirective(() => ({
|
|
202
190
|
events: {
|
|
203
|
-
click: (e) =>
|
|
191
|
+
click: (e) => handleNavigation(1, e)
|
|
204
192
|
},
|
|
205
193
|
attributes: {
|
|
206
194
|
"aria-label": ariaFirstLabel$,
|
|
@@ -214,7 +202,7 @@ function createPagination(config) {
|
|
|
214
202
|
})),
|
|
215
203
|
pagePrev: utils_directive.createAttributesDirective(() => ({
|
|
216
204
|
events: {
|
|
217
|
-
click: (e) =>
|
|
205
|
+
click: (e) => handleNavigation(page$() - 1, e)
|
|
218
206
|
},
|
|
219
207
|
attributes: {
|
|
220
208
|
"aria-label": ariaPreviousLabel$,
|
|
@@ -228,7 +216,7 @@ function createPagination(config) {
|
|
|
228
216
|
})),
|
|
229
217
|
pageNext: utils_directive.createAttributesDirective(() => ({
|
|
230
218
|
events: {
|
|
231
|
-
click: (e) =>
|
|
219
|
+
click: (e) => handleNavigation(page$() + 1, e)
|
|
232
220
|
},
|
|
233
221
|
attributes: {
|
|
234
222
|
"aria-label": ariaNextLabel$,
|
|
@@ -242,7 +230,7 @@ function createPagination(config) {
|
|
|
242
230
|
})),
|
|
243
231
|
pageLast: utils_directive.createAttributesDirective(() => ({
|
|
244
232
|
events: {
|
|
245
|
-
click: (e) =>
|
|
233
|
+
click: (e) => handleNavigation(pageCount$(), e)
|
|
246
234
|
},
|
|
247
235
|
attributes: {
|
|
248
236
|
"aria-label": ariaLastLabel$,
|