@agnos-ui/core 0.10.0-next.1 → 0.10.0-next.3
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-_zen-g8l.js → accordion-47EpOD36.js} +4 -3
- package/{accordion-B5LiN1uy.cjs → accordion-nxveC0GZ.cjs} +4 -3
- package/{alert-B-jQDQcB.cjs → alert-AhaliJ17.cjs} +1 -1
- package/{alert-gGz2CDS9.js → alert-anMaigvi.js} +1 -1
- package/{collapse-BV4kD3j9.js → collapse-CrfvGo_T.js} +2 -2
- package/{collapse-gLiT080Y.cjs → collapse-Da_27YUU.cjs} +2 -2
- package/{common-D3QcdJ6S.cjs → common-B5jS-Ih_.cjs} +1 -1
- package/{common-DK0ADNTX.js → common-CCxNtFNM.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 +2 -2
- package/components/carousel/index.js +2 -2
- package/components/collapse/index.cjs +1 -1
- package/components/collapse/index.js +1 -1
- package/components/drawer/drawer.d.ts +32 -25
- package/components/drawer/index.cjs +1 -1
- package/components/drawer/index.js +1 -1
- package/components/modal/index.cjs +1 -1
- package/components/modal/index.js +1 -1
- 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/{dom-C2gi9OCP.cjs → dom-Cm9_uROp.cjs} +76 -6
- package/{dom-Bcg9ORcA.js → dom-DD1hAVZy.js} +76 -6
- package/drawer-Caz4Uypu.js +291 -0
- package/{drawer-DP7UPojk.cjs → drawer-DOi0TqZC.cjs} +131 -91
- package/index.cjs +16 -14
- package/index.js +21 -19
- package/{modal-DiXZXYjR.cjs → modal-B_3Uxplo.cjs} +5 -5
- package/{modal-CAvQW-vo.js → modal-cKd3qUn1.js} +5 -5
- package/package.json +1 -1
- package/{pagination-DvZ2rLsz.cjs → pagination-2Vor6JPZ.cjs} +2 -2
- package/{pagination-BKbMROV6.js → pagination-DlOyP_2C.js} +2 -2
- package/{progressbar-D8zIcm9n.js → progressbar-B5g76eMV.js} +2 -2
- package/{progressbar-i9xfAxb7.cjs → progressbar-DyBRINco.cjs} +2 -2
- package/{rating-DmG4oUkr.cjs → rating-C0y1j4SC.cjs} +2 -2
- package/{rating-DEXTGWCU.js → rating-C7C4-p4B.js} +2 -2
- package/{select-MFjAnIt7.cjs → select-Dhsb9msC.cjs} +1 -1
- package/{select-Bw68Xdu5.js → select-nnl00UWY.js} +1 -1
- package/services/floatingUI.cjs +1 -1
- package/services/floatingUI.js +1 -1
- package/services/focusElement.cjs +1 -1
- package/services/focusElement.js +1 -1
- 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 +1 -1
- package/services/navManager.js +1 -1
- package/services/pointerdownPosition.cjs +60 -0
- package/services/pointerdownPosition.d.ts +42 -0
- package/services/pointerdownPosition.js +60 -0
- package/services/portal.cjs +1 -1
- package/services/portal.js +1 -1
- package/services/resizeObserver.cjs +40 -20
- package/services/resizeObserver.d.ts +10 -2
- package/services/resizeObserver.js +41 -21
- package/services/siblingsInert.cjs +1 -1
- package/services/siblingsInert.js +1 -1
- package/services/transitions/baseTransitions.cjs +2 -2
- package/services/transitions/baseTransitions.js +2 -2
- package/services/transitions/collapse.cjs +11 -15
- package/services/transitions/collapse.js +11 -15
- package/services/transitions/cssTransitions.cjs +1 -1
- package/services/transitions/cssTransitions.js +1 -1
- package/services/transitions/simpleClassTransition.cjs +1 -1
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-Cx50Eghd.js → slider-B4WrdTeE.js} +121 -170
- package/{slider-Dl4Trh32.cjs → slider-DTO58syz.cjs} +120 -169
- package/{toaster-_p1GTtHI.js → toaster-CRPErgI2.js} +3 -3
- package/{toaster-UDglac7x.cjs → toaster-CT148JSJ.cjs} +3 -3
- package/{tree-rGHtmCnS.cjs → tree-C4l2Wqny.cjs} +2 -2
- package/{tree-DV0tfPlZ.js → tree-CHpFqJPx.js} +2 -2
- package/types.cjs +2 -2
- package/types.d.ts +22 -3
- package/types.js +2 -2
- package/utils/directive.cjs +1 -1
- package/utils/directive.d.ts +2 -2
- package/utils/directive.js +1 -1
- package/utils/internal/dom.d.ts +2 -0
- package/utils/internal/ssrHTMLElement.d.ts +7 -1
- package/utils/stores.cjs +1 -1
- package/utils/stores.js +1 -1
- package/utils/writables.cjs +2 -1
- package/utils/writables.d.ts +7 -0
- package/utils/writables.js +6 -5
- package/{writables-DcGT98a7.cjs → writables-Dt68gADJ.cjs} +4 -0
- package/{writables-e0tyaQpe.js → writables-Is1bF1Vt.js} +10 -6
- package/drawer-D5SO73ew.js +0 -251
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../dom-
|
|
3
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
4
4
|
const isFocusable = require("../isFocusable-DfzDLeAN.cjs");
|
|
5
5
|
const stack = [];
|
|
6
6
|
let stackProcessPlanned = false;
|
package/services/focusElement.js
CHANGED
package/services/focustrack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
-
const utils_directive = require("../dom-
|
|
4
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
5
5
|
const esmEnv = require("esm-env");
|
|
6
6
|
const evtFocusIn = "focusin";
|
|
7
7
|
const evtFocusOut = "focusout";
|
package/services/focustrack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readable, computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { h as createBrowserStoreArrayDirective } from "../dom-
|
|
2
|
+
import { h as createBrowserStoreArrayDirective } from "../dom-DD1hAVZy.js";
|
|
3
3
|
import { BROWSER } from "esm-env";
|
|
4
4
|
const evtFocusIn = "focusin";
|
|
5
5
|
const evtFocusOut = "focusout";
|
package/services/matchMedia.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
4
|
const esmEnv = require("esm-env");
|
|
5
|
-
const utils_directive = require("../dom-
|
|
5
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
6
6
|
const utils_stores = require("../utils/stores.cjs");
|
|
7
7
|
const createMatchMedia = (query) => esmEnv.BROWSER ? tansu.readable(false, {
|
|
8
8
|
onUse({ set }) {
|
package/services/matchMedia.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readable } from "@amadeus-it-group/tansu";
|
|
2
2
|
import { BROWSER } from "esm-env";
|
|
3
|
-
import { w as addEvent } from "../dom-
|
|
3
|
+
import { w as addEvent } from "../dom-DD1hAVZy.js";
|
|
4
4
|
import { false$ } from "../utils/stores.js";
|
|
5
5
|
const createMatchMedia = (query) => BROWSER ? readable(false, {
|
|
6
6
|
onUse({ set }) {
|
package/services/navManager.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
-
const utils_directive = require("../dom-
|
|
4
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
5
5
|
const isFocusable = require("../isFocusable-DfzDLeAN.cjs");
|
|
6
6
|
const compareDomOrder = (element1, element2) => {
|
|
7
7
|
if (element1 === element2) {
|
package/services/navManager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writable, computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { r as registrationArray, A as computeCommonAncestor, b as browserDirective } from "../dom-
|
|
2
|
+
import { r as registrationArray, A as computeCommonAncestor, b as browserDirective } from "../dom-DD1hAVZy.js";
|
|
3
3
|
import { i as isFocusable } from "../isFocusable-Ckwus82R.js";
|
|
4
4
|
const compareDomOrder = (element1, element2) => {
|
|
5
5
|
if (element1 === element2) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
4
|
+
const utils_func = require("../utils/func.cjs");
|
|
5
|
+
const createPointerdownPositionDirective = (onStart) => utils_directive.browserDirective((element, arg) => {
|
|
6
|
+
let activePointerId = null;
|
|
7
|
+
let activeHandlers = null;
|
|
8
|
+
let removePointerMoveEvent = utils_func.noop;
|
|
9
|
+
let removePointerUpEvent = utils_func.noop;
|
|
10
|
+
let removePointerCancelEvent = utils_func.noop;
|
|
11
|
+
const onMove = (e) => {
|
|
12
|
+
if (e.pointerId === activePointerId) {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
activeHandlers?.onMove?.(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const endCurrent = (e) => {
|
|
18
|
+
removePointerMoveEvent();
|
|
19
|
+
removePointerUpEvent();
|
|
20
|
+
removePointerCancelEvent();
|
|
21
|
+
removePointerMoveEvent = utils_func.noop;
|
|
22
|
+
removePointerUpEvent = utils_func.noop;
|
|
23
|
+
removePointerCancelEvent = utils_func.noop;
|
|
24
|
+
const handlers = activeHandlers;
|
|
25
|
+
activeHandlers = null;
|
|
26
|
+
activePointerId = null;
|
|
27
|
+
handlers?.onEnd?.(e);
|
|
28
|
+
};
|
|
29
|
+
const onEnd = (e) => {
|
|
30
|
+
if (e.pointerId === activePointerId) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
endCurrent(e);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const removePointerDownEvent = utils_directive.addEvent(element, "pointerdown", (e) => {
|
|
36
|
+
if (activeHandlers) {
|
|
37
|
+
endCurrent();
|
|
38
|
+
}
|
|
39
|
+
const pointerId = e.pointerId;
|
|
40
|
+
const startResult = onStart(e, arg);
|
|
41
|
+
if (startResult) {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
activePointerId = pointerId;
|
|
44
|
+
activeHandlers = startResult;
|
|
45
|
+
removePointerMoveEvent = utils_directive.addEvent(document, "pointermove", onMove);
|
|
46
|
+
removePointerUpEvent = utils_directive.addEvent(document, "pointerup", onEnd);
|
|
47
|
+
removePointerCancelEvent = utils_directive.addEvent(document, "pointercancel", onEnd);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
update(newArg) {
|
|
52
|
+
arg = newArg;
|
|
53
|
+
},
|
|
54
|
+
destroy() {
|
|
55
|
+
removePointerDownEvent();
|
|
56
|
+
endCurrent();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
exports.createPointerdownPositionDirective = createPointerdownPositionDirective;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Directive } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for tracking pointer position after a pointerdown event.
|
|
4
|
+
*/
|
|
5
|
+
export interface PointerPositionHandlers {
|
|
6
|
+
/**
|
|
7
|
+
* Callback function invoked when the mouse moves after a pointerdown event.
|
|
8
|
+
* @param position - The current mouse position information including origin and current coordinates.
|
|
9
|
+
*/
|
|
10
|
+
onMove?: (event: PointerEvent) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Callback function invoked when the move ends after a pointerdown event.
|
|
13
|
+
*/
|
|
14
|
+
onEnd?: (event?: PointerEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a directive for tracking pointer position during drag operations.
|
|
18
|
+
*
|
|
19
|
+
* This function sets up event listeners that track pointer movements from an initial pointerdown event
|
|
20
|
+
* through pointermover and pointerup events. It provides a directive that can be attached to DOM elements
|
|
21
|
+
* to enable drag tracking functionality.
|
|
22
|
+
*
|
|
23
|
+
* @param onStart - Callback function invoked when the pointerdown event happens.
|
|
24
|
+
*
|
|
25
|
+
* @returns The pointerdownPositionDirective that can be applied to elements.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const pointerPositionDirective = createPointerdownPositionDirective((event) => {
|
|
30
|
+
* console.log(`Drag started at (${event.clientX}, ${event.clientY})`);
|
|
31
|
+
* return {
|
|
32
|
+
* onMove: (event) => {
|
|
33
|
+
* console.log(`Dragging: ${event.clientX}, dy=${event.clientY}`);
|
|
34
|
+
* },
|
|
35
|
+
* onEnd: () => {
|
|
36
|
+
* console.log(`Drag ended`);
|
|
37
|
+
* }
|
|
38
|
+
* };
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare const createPointerdownPositionDirective: <T = void>(onStart: (position: PointerEvent, arg: T) => PointerPositionHandlers | undefined) => Directive<T>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { b as browserDirective, w as addEvent } from "../dom-DD1hAVZy.js";
|
|
2
|
+
import { noop } from "../utils/func.js";
|
|
3
|
+
const createPointerdownPositionDirective = (onStart) => browserDirective((element, arg) => {
|
|
4
|
+
let activePointerId = null;
|
|
5
|
+
let activeHandlers = null;
|
|
6
|
+
let removePointerMoveEvent = noop;
|
|
7
|
+
let removePointerUpEvent = noop;
|
|
8
|
+
let removePointerCancelEvent = noop;
|
|
9
|
+
const onMove = (e) => {
|
|
10
|
+
if (e.pointerId === activePointerId) {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
activeHandlers?.onMove?.(e);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const endCurrent = (e) => {
|
|
16
|
+
removePointerMoveEvent();
|
|
17
|
+
removePointerUpEvent();
|
|
18
|
+
removePointerCancelEvent();
|
|
19
|
+
removePointerMoveEvent = noop;
|
|
20
|
+
removePointerUpEvent = noop;
|
|
21
|
+
removePointerCancelEvent = noop;
|
|
22
|
+
const handlers = activeHandlers;
|
|
23
|
+
activeHandlers = null;
|
|
24
|
+
activePointerId = null;
|
|
25
|
+
handlers?.onEnd?.(e);
|
|
26
|
+
};
|
|
27
|
+
const onEnd = (e) => {
|
|
28
|
+
if (e.pointerId === activePointerId) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
endCurrent(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const removePointerDownEvent = addEvent(element, "pointerdown", (e) => {
|
|
34
|
+
if (activeHandlers) {
|
|
35
|
+
endCurrent();
|
|
36
|
+
}
|
|
37
|
+
const pointerId = e.pointerId;
|
|
38
|
+
const startResult = onStart(e, arg);
|
|
39
|
+
if (startResult) {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
activePointerId = pointerId;
|
|
42
|
+
activeHandlers = startResult;
|
|
43
|
+
removePointerMoveEvent = addEvent(document, "pointermove", onMove);
|
|
44
|
+
removePointerUpEvent = addEvent(document, "pointerup", onEnd);
|
|
45
|
+
removePointerCancelEvent = addEvent(document, "pointercancel", onEnd);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
update(newArg) {
|
|
50
|
+
arg = newArg;
|
|
51
|
+
},
|
|
52
|
+
destroy() {
|
|
53
|
+
removePointerDownEvent();
|
|
54
|
+
endCurrent();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
createPointerdownPositionDirective
|
|
60
|
+
};
|
package/services/portal.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../dom-
|
|
3
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
4
4
|
const portal = utils_directive.browserDirective((content, newArg) => {
|
|
5
5
|
let arg;
|
|
6
6
|
let replaceComment;
|
package/services/portal.js
CHANGED
|
@@ -1,32 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
-
const utils_directive = require("../dom-
|
|
4
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
5
5
|
const utils_func = require("../utils/func.cjs");
|
|
6
|
-
const
|
|
7
|
-
const {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
(
|
|
11
|
-
|
|
6
|
+
const createResizeObserverMap = () => {
|
|
7
|
+
const { elements$, directive } = utils_directive.createBrowserStoreArrayDirective();
|
|
8
|
+
const dimensionsMap$ = tansu.derived(
|
|
9
|
+
elements$,
|
|
10
|
+
(elements, set) => {
|
|
11
|
+
const dimensionsMap = /* @__PURE__ */ new Map();
|
|
12
|
+
if (elements.length === 0) {
|
|
13
|
+
set(dimensionsMap);
|
|
12
14
|
return utils_func.noop;
|
|
13
15
|
}
|
|
14
16
|
const observer = new ResizeObserver((entries) => {
|
|
15
|
-
set(
|
|
17
|
+
entries.forEach((entry) => dimensionsMap.set(entry.target, entry));
|
|
18
|
+
set(dimensionsMap);
|
|
16
19
|
});
|
|
17
|
-
observer.observe(element);
|
|
18
|
-
return () => observer
|
|
20
|
+
elements.forEach((element) => observer.observe(element));
|
|
21
|
+
return () => observer.disconnect();
|
|
19
22
|
},
|
|
20
|
-
|
|
23
|
+
/* @__PURE__ */ new Map()
|
|
21
24
|
);
|
|
22
|
-
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
return { dimensionsMap$, directive };
|
|
26
|
+
};
|
|
27
|
+
const createResizeObserver = () => {
|
|
28
|
+
const { dimensionsMap$, directive: arrayDirective } = createResizeObserverMap();
|
|
29
|
+
let firstElement = null;
|
|
30
|
+
const directive = utils_directive.browserDirective((element) => {
|
|
31
|
+
if (firstElement === null) {
|
|
32
|
+
firstElement = element;
|
|
33
|
+
} else {
|
|
34
|
+
console.error("createResizeObserver directive can only be applied to a single element. Use createResizeObserverMap for multiple elements.");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const result = arrayDirective(element);
|
|
38
|
+
if (!result) return;
|
|
39
|
+
const originalDestroy = result.destroy;
|
|
40
|
+
return {
|
|
41
|
+
...result,
|
|
42
|
+
destroy: () => {
|
|
43
|
+
firstElement = null;
|
|
44
|
+
originalDestroy?.();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const dimensions$ = tansu.derived(dimensionsMap$, (map) => firstElement ? map.get(firstElement) : void 0, void 0);
|
|
49
|
+
return { dimensions$, directive };
|
|
31
50
|
};
|
|
32
51
|
exports.createResizeObserver = createResizeObserver;
|
|
52
|
+
exports.createResizeObserverMap = createResizeObserverMap;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
2
2
|
import type { Directive, SSRHTMLElement } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* Create a resize observer
|
|
5
|
-
* @returns An object containing the store with the
|
|
4
|
+
* Create a resize observer that can be applied to multiple elements
|
|
5
|
+
* @returns An object containing the store with the dimensions map of observed elements (ResizeObserverEntry), the directive to be applied to the html element to be observed
|
|
6
|
+
*/
|
|
7
|
+
export declare const createResizeObserverMap: () => {
|
|
8
|
+
dimensionsMap$: ReadableSignal<Map<HTMLElement, ResizeObserverEntry>>;
|
|
9
|
+
directive: Directive<void, SSRHTMLElement>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Create a resize observer object for a single element
|
|
13
|
+
* @returns An object containing the store with the dimensions of observed element (ResizeObserverEntry), the directive to be applied to the html element to be observed
|
|
6
14
|
*/
|
|
7
15
|
export declare const createResizeObserver: () => {
|
|
8
16
|
dimensions$: ReadableSignal<ResizeObserverEntry | undefined>;
|
|
@@ -1,32 +1,52 @@
|
|
|
1
1
|
import { derived } from "@amadeus-it-group/tansu";
|
|
2
|
-
import {
|
|
2
|
+
import { h as createBrowserStoreArrayDirective, b as browserDirective } from "../dom-DD1hAVZy.js";
|
|
3
3
|
import { noop } from "../utils/func.js";
|
|
4
|
-
const
|
|
5
|
-
const {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
(
|
|
9
|
-
|
|
4
|
+
const createResizeObserverMap = () => {
|
|
5
|
+
const { elements$, directive } = createBrowserStoreArrayDirective();
|
|
6
|
+
const dimensionsMap$ = derived(
|
|
7
|
+
elements$,
|
|
8
|
+
(elements, set) => {
|
|
9
|
+
const dimensionsMap = /* @__PURE__ */ new Map();
|
|
10
|
+
if (elements.length === 0) {
|
|
11
|
+
set(dimensionsMap);
|
|
10
12
|
return noop;
|
|
11
13
|
}
|
|
12
14
|
const observer = new ResizeObserver((entries) => {
|
|
13
|
-
set(
|
|
15
|
+
entries.forEach((entry) => dimensionsMap.set(entry.target, entry));
|
|
16
|
+
set(dimensionsMap);
|
|
14
17
|
});
|
|
15
|
-
observer.observe(element);
|
|
16
|
-
return () => observer
|
|
18
|
+
elements.forEach((element) => observer.observe(element));
|
|
19
|
+
return () => observer.disconnect();
|
|
17
20
|
},
|
|
18
|
-
|
|
21
|
+
/* @__PURE__ */ new Map()
|
|
19
22
|
);
|
|
20
|
-
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
return { dimensionsMap$, directive };
|
|
24
|
+
};
|
|
25
|
+
const createResizeObserver = () => {
|
|
26
|
+
const { dimensionsMap$, directive: arrayDirective } = createResizeObserverMap();
|
|
27
|
+
let firstElement = null;
|
|
28
|
+
const directive = browserDirective((element) => {
|
|
29
|
+
if (firstElement === null) {
|
|
30
|
+
firstElement = element;
|
|
31
|
+
} else {
|
|
32
|
+
console.error("createResizeObserver directive can only be applied to a single element. Use createResizeObserverMap for multiple elements.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const result = arrayDirective(element);
|
|
36
|
+
if (!result) return;
|
|
37
|
+
const originalDestroy = result.destroy;
|
|
38
|
+
return {
|
|
39
|
+
...result,
|
|
40
|
+
destroy: () => {
|
|
41
|
+
firstElement = null;
|
|
42
|
+
originalDestroy?.();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const dimensions$ = derived(dimensionsMap$, (map) => firstElement ? map.get(firstElement) : void 0, void 0);
|
|
47
|
+
return { dimensions$, directive };
|
|
29
48
|
};
|
|
30
49
|
export {
|
|
31
|
-
createResizeObserver
|
|
50
|
+
createResizeObserver,
|
|
51
|
+
createResizeObserverMap
|
|
32
52
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
-
const utils_directive = require("../dom-
|
|
4
|
+
const utils_directive = require("../dom-Cm9_uROp.cjs");
|
|
5
5
|
const utils_func = require("../utils/func.cjs");
|
|
6
6
|
const ignoreInertAttributeName = "data-agnos-ignore-inert";
|
|
7
7
|
const applyInertToSiblingsRecursively = (element) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { j as createConditionalBrowserStoreArrayDirective, n as mergeDirectives, d as directiveSubscribe } from "../dom-
|
|
2
|
+
import { j as createConditionalBrowserStoreArrayDirective, n as mergeDirectives, d as directiveSubscribe } from "../dom-DD1hAVZy.js";
|
|
3
3
|
import { noop } from "../utils/func.js";
|
|
4
4
|
const ignoreInertAttributeName = "data-agnos-ignore-inert";
|
|
5
5
|
const applyInertToSiblingsRecursively = (element) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
-
const utils_writables = require("../../writables-
|
|
4
|
+
const utils_writables = require("../../writables-Dt68gADJ.cjs");
|
|
5
5
|
const promise = require("../../promise-CxCD3NYv.cjs");
|
|
6
6
|
const utils_func = require("../../utils/func.cjs");
|
|
7
7
|
const utils_stores = require("../../utils/stores.cjs");
|
|
8
|
-
const utils_directive = require("../../dom-
|
|
8
|
+
const utils_directive = require("../../dom-Cm9_uROp.cjs");
|
|
9
9
|
const neverEndingPromise = new Promise(utils_func.noop);
|
|
10
10
|
const noAnimation = (element, direction) => {
|
|
11
11
|
element.style.display = direction === "show" ? "" : "none";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed, writable, derived, batch } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { d as typeBooleanOrNull,
|
|
2
|
+
import { d as typeBooleanOrNull, h as typeFunction, c as typeBoolean } from "../../writables-Is1bF1Vt.js";
|
|
3
3
|
import { d as promiseWithResolve } from "../../promise-Y53vc4Ia.js";
|
|
4
4
|
import { noop } from "../../utils/func.js";
|
|
5
5
|
import { writablesForProps, bindableDerived, stateStores } from "../../utils/stores.js";
|
|
6
|
-
import { k as createStoreDirective, n as mergeDirectives, d as directiveSubscribe } from "../../dom-
|
|
6
|
+
import { k as createStoreDirective, n as mergeDirectives, d as directiveSubscribe } from "../../dom-DD1hAVZy.js";
|
|
7
7
|
const neverEndingPromise = new Promise(noop);
|
|
8
8
|
const noAnimation = (element, direction) => {
|
|
9
9
|
element.style.display = direction === "show" ? "" : "none";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../../dom-
|
|
3
|
+
const utils_directive = require("../../dom-Cm9_uROp.cjs");
|
|
4
4
|
const services_transitions_cssTransitions = require("./cssTransitions.cjs");
|
|
5
5
|
const createCollapseTransition = ({
|
|
6
6
|
dimension = "height",
|
|
@@ -10,20 +10,16 @@ const createCollapseTransition = ({
|
|
|
10
10
|
} = {}) => services_transitions_cssTransitions.createCSSTransition((element, direction, animated, context) => {
|
|
11
11
|
if (animated && utils_directive.isBrowserHTMLElement(element)) {
|
|
12
12
|
let { maxSize, minSize } = context;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
utils_directive.addClasses(element, hideClasses);
|
|
24
|
-
minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
25
|
-
context.minSize = minSize;
|
|
26
|
-
}
|
|
13
|
+
utils_directive.removeClasses(element, animationPendingClasses);
|
|
14
|
+
utils_directive.removeClasses(element, hideClasses);
|
|
15
|
+
utils_directive.addClasses(element, showClasses);
|
|
16
|
+
maxSize = element.getBoundingClientRect()[dimension] + "px";
|
|
17
|
+
context.maxSize = maxSize;
|
|
18
|
+
utils_directive.removeClasses(element, animationPendingClasses);
|
|
19
|
+
utils_directive.removeClasses(element, showClasses);
|
|
20
|
+
utils_directive.addClasses(element, hideClasses);
|
|
21
|
+
minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
22
|
+
context.minSize = minSize;
|
|
27
23
|
utils_directive.removeClasses(element, showClasses);
|
|
28
24
|
utils_directive.removeClasses(element, hideClasses);
|
|
29
25
|
const values = direction === "show" ? [minSize, maxSize] : [maxSize, minSize];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isBrowserHTMLElement, x as removeClasses, y as addClasses, z as reflow } from "../../dom-
|
|
1
|
+
import { i as isBrowserHTMLElement, x as removeClasses, y as addClasses, z as reflow } from "../../dom-DD1hAVZy.js";
|
|
2
2
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
3
3
|
const createCollapseTransition = ({
|
|
4
4
|
dimension = "height",
|
|
@@ -8,20 +8,16 @@ const createCollapseTransition = ({
|
|
|
8
8
|
} = {}) => createCSSTransition((element, direction, animated, context) => {
|
|
9
9
|
if (animated && isBrowserHTMLElement(element)) {
|
|
10
10
|
let { maxSize, minSize } = context;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
addClasses(element, hideClasses);
|
|
22
|
-
minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
23
|
-
context.minSize = minSize;
|
|
24
|
-
}
|
|
11
|
+
removeClasses(element, animationPendingClasses);
|
|
12
|
+
removeClasses(element, hideClasses);
|
|
13
|
+
addClasses(element, showClasses);
|
|
14
|
+
maxSize = element.getBoundingClientRect()[dimension] + "px";
|
|
15
|
+
context.maxSize = maxSize;
|
|
16
|
+
removeClasses(element, animationPendingClasses);
|
|
17
|
+
removeClasses(element, showClasses);
|
|
18
|
+
addClasses(element, hideClasses);
|
|
19
|
+
minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
20
|
+
context.minSize = minSize;
|
|
25
21
|
removeClasses(element, showClasses);
|
|
26
22
|
removeClasses(element, hideClasses);
|
|
27
23
|
const values = direction === "show" ? [minSize, maxSize] : [maxSize, minSize];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../../dom-
|
|
3
|
+
const utils_directive = require("../../dom-Cm9_uROp.cjs");
|
|
4
4
|
const utils_func = require("../../utils/func.cjs");
|
|
5
5
|
const promise = require("../../promise-CxCD3NYv.cjs");
|
|
6
6
|
function hasTransition(element) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isBrowserHTMLElement } from "../../dom-
|
|
1
|
+
import { i as isBrowserHTMLElement } from "../../dom-DD1hAVZy.js";
|
|
2
2
|
import { noop } from "../../utils/func.js";
|
|
3
3
|
import { b as promiseFromEvent, c as promiseFromTimeout } from "../../promise-Y53vc4Ia.js";
|
|
4
4
|
function hasTransition(element) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const services_transitions_cssTransitions = require("./cssTransitions.cjs");
|
|
4
|
-
const utils_directive = require("../../dom-
|
|
4
|
+
const utils_directive = require("../../dom-Cm9_uROp.cjs");
|
|
5
5
|
const createSimpleClassTransition = (config) => {
|
|
6
6
|
const { animationPendingClasses, animationPendingShowClasses, animationPendingHideClasses, showClasses, hideClasses } = config;
|
|
7
7
|
return services_transitions_cssTransitions.createCSSTransition((element, direction, animated, context) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
2
|
-
import { x as removeClasses, y as addClasses, z as reflow } from "../../dom-
|
|
2
|
+
import { x as removeClasses, y as addClasses, z as reflow } from "../../dom-DD1hAVZy.js";
|
|
3
3
|
const createSimpleClassTransition = (config) => {
|
|
4
4
|
const { animationPendingClasses, animationPendingShowClasses, animationPendingHideClasses, showClasses, hideClasses } = config;
|
|
5
5
|
return createCSSTransition((element, direction, animated, context) => {
|