@agnos-ui/core 0.4.4 → 0.5.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/services/intersection.js
CHANGED
|
@@ -42,7 +42,7 @@ const createIntersection = (config) => {
|
|
|
42
42
|
/**
|
|
43
43
|
* Store of map that contains the visible elements (for the key) and the corresponding entries
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry | MDN documentation}
|
|
46
46
|
*/
|
|
47
47
|
visibleElements$: asReadable(visibleElements$),
|
|
48
48
|
patch
|
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("../directive-
|
|
5
|
+
const utils_directive = require("../directive-DdlwGFtf.cjs");
|
|
6
6
|
const createMatchMedia = (query) => esmEnv.BROWSER ? tansu.readable(false, {
|
|
7
7
|
onUse({ set }) {
|
|
8
8
|
const mql = window.matchMedia(query.trim());
|
package/services/matchMedia.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type ReadableSignal } from '@amadeus-it-group/tansu';
|
|
1
2
|
/**
|
|
2
3
|
* Create a store tracking the state of a {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia | matchMedia} query.
|
|
3
4
|
*
|
|
4
5
|
* @param query - the query to match
|
|
5
6
|
* @returns a readable store tracking the match media query state
|
|
6
7
|
*/
|
|
7
|
-
export declare const createMatchMedia: (query: string) =>
|
|
8
|
+
export declare const createMatchMedia: (query: string) => ReadableSignal<boolean>;
|
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 { u as addEvent } from "../directive-
|
|
3
|
+
import { u as addEvent } from "../directive-CKEccryv.js";
|
|
4
4
|
const createMatchMedia = (query) => BROWSER ? readable(false, {
|
|
5
5
|
onUse({ set }) {
|
|
6
6
|
const mql = window.matchMedia(query.trim());
|
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("../directive-
|
|
4
|
+
const utils_directive = require("../directive-DdlwGFtf.cjs");
|
|
5
5
|
const isInertOrInvisible = (element) => {
|
|
6
6
|
let curElement = element;
|
|
7
7
|
while (curElement) {
|
package/services/navManager.d.ts
CHANGED
|
@@ -1,4 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReadableSignal } from '@amadeus-it-group/tansu';
|
|
2
|
+
import type { Directive, SSRHTMLElement } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* A type representing a function that determines the neighboring element to focus on.
|
|
5
|
+
* @returns The next HTMLElement to focus on, or null if no suitable element is found.
|
|
6
|
+
*/
|
|
7
|
+
export type FocusNeighbour = (arg?: {
|
|
8
|
+
event?: Event;
|
|
9
|
+
referenceElement?: HTMLElement | null;
|
|
10
|
+
}) => HTMLElement | null;
|
|
11
|
+
/**
|
|
12
|
+
* A type representing a function that focuses on the end element.
|
|
13
|
+
* @returns The HTMLElement that was focused, or null if no element was focused.
|
|
14
|
+
*/
|
|
15
|
+
export type FocusEnd = (arg?: {
|
|
16
|
+
event?: Event;
|
|
17
|
+
}) => HTMLElement | null;
|
|
18
|
+
/**
|
|
19
|
+
* Represents a navigation manager that handles focusable elements in the DOM.
|
|
20
|
+
*
|
|
21
|
+
* @template T - The type of the configuration for the navigation manager items.
|
|
22
|
+
*/
|
|
23
|
+
export type NavManager<T> = {
|
|
24
|
+
/**
|
|
25
|
+
* Store containing the navigable elements in DOM order
|
|
26
|
+
*/
|
|
27
|
+
elementsInDomOrder$: ReadableSignal<HTMLElement[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Directive to attach the nav manager
|
|
30
|
+
*/
|
|
31
|
+
directive: Directive<NavManagerItemConfig<T>, SSRHTMLElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Refresh the elements list.
|
|
34
|
+
* @param now force the instant refresh of the elements
|
|
35
|
+
*/
|
|
36
|
+
refreshElements: (now?: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Focus the element at the given idex.
|
|
39
|
+
* If the element at the given index is not focusable, use the moveDirection to step into the next focusable element.
|
|
40
|
+
* @param index the index of the element to focus
|
|
41
|
+
* @param moveDirection a move direction
|
|
42
|
+
* @returns the new focusable element if found, null otherwise
|
|
43
|
+
*/
|
|
44
|
+
focusIndex: (index: number, moveDirection: -1 | 0 | 1) => HTMLElement | null;
|
|
45
|
+
/**
|
|
46
|
+
* Focus the previous element, respecting the anscestor direction.
|
|
47
|
+
*/
|
|
48
|
+
focusPrevious: FocusNeighbour;
|
|
49
|
+
/**
|
|
50
|
+
* Focus the next element, respecting the anscestor direction.
|
|
51
|
+
*/
|
|
52
|
+
focusNext: FocusNeighbour;
|
|
53
|
+
/**
|
|
54
|
+
* Focus the first element, respecting the anscestor direction.
|
|
55
|
+
*/
|
|
56
|
+
focusFirst: FocusEnd;
|
|
57
|
+
/**
|
|
58
|
+
* Focus the element at the left-end of the list.
|
|
59
|
+
*/
|
|
60
|
+
focusFirstLeft: FocusEnd;
|
|
61
|
+
/**
|
|
62
|
+
* Focus the element at the right-end of the list.
|
|
63
|
+
*/
|
|
64
|
+
focusFirstRight: FocusEnd;
|
|
65
|
+
/**
|
|
66
|
+
* Focus the last element, respecting the anscestor direction.
|
|
67
|
+
*/
|
|
68
|
+
focusLast: FocusEnd;
|
|
69
|
+
/**
|
|
70
|
+
* Focus the next focusable element to the left of the currently focused element.
|
|
71
|
+
*/
|
|
72
|
+
focusLeft: FocusNeighbour;
|
|
73
|
+
/**
|
|
74
|
+
* Focus the next focusable element to the right of the currently focused element.
|
|
75
|
+
*/
|
|
76
|
+
focusRight: FocusNeighbour;
|
|
77
|
+
};
|
|
2
78
|
/**
|
|
3
79
|
* Returns the key name given the keyboard event. The key name is built using event.key (such as ArrowLeft, PageDown...),
|
|
4
80
|
* prefixed with the modifiers. If present, modifiers are always in the same order: Meta+Ctrl+Alt+Shift+...
|
|
@@ -21,15 +97,18 @@ export declare const isInternalInputNavigation: (event: KeyboardEvent) => boolea
|
|
|
21
97
|
* - event: key event
|
|
22
98
|
* - directiveElement: DOM element which has the navigation manager directive
|
|
23
99
|
* - navManager: navigation manager instance
|
|
100
|
+
* @template T - The type of the context object, defaults to `any`.
|
|
24
101
|
*/
|
|
25
102
|
export type NavManagerKeyHandler<T = any> = (info: {
|
|
26
103
|
directiveElement: HTMLElement;
|
|
27
104
|
event: Event;
|
|
28
|
-
navManager: NavManager
|
|
105
|
+
navManager: NavManager<T>;
|
|
29
106
|
context?: T;
|
|
30
107
|
}) => void;
|
|
31
108
|
/**
|
|
32
|
-
*
|
|
109
|
+
* Configuration object for a navigation manager item.
|
|
110
|
+
*
|
|
111
|
+
* @template T - The type of the context object.
|
|
33
112
|
*/
|
|
34
113
|
export interface NavManagerItemConfig<T = any> {
|
|
35
114
|
/**
|
|
@@ -59,42 +138,7 @@ export interface NavManagerItemConfig<T = any> {
|
|
|
59
138
|
*
|
|
60
139
|
* It provides some utilities to move the focus between those elements (focusFirst/focusLast, focusLeft/focusRight, focusPrevious/focusNext).
|
|
61
140
|
*
|
|
62
|
-
* @
|
|
141
|
+
* @template T - The type of the context object used in the navigation manager.
|
|
142
|
+
* @returns An object containing methods and properties for managing focus navigation.
|
|
63
143
|
*/
|
|
64
|
-
export declare const createNavManager: () =>
|
|
65
|
-
elementsInDomOrder$: import("@amadeus-it-group/tansu").ReadableSignal<HTMLElement[]>;
|
|
66
|
-
directive: <T = any>(node: import("..").SSRHTMLElement, args: NavManagerItemConfig<T>) => void | {
|
|
67
|
-
update?: ((args: NavManagerItemConfig<T>) => void) | undefined;
|
|
68
|
-
destroy?: () => void;
|
|
69
|
-
};
|
|
70
|
-
focusIndex: (index: number, moveDirection?: -1 | 0 | 1) => HTMLElement | null;
|
|
71
|
-
focusPrevious: ({ event, referenceElement, }?: {
|
|
72
|
-
event?: Event;
|
|
73
|
-
referenceElement?: HTMLElement | null;
|
|
74
|
-
}) => HTMLElement | null;
|
|
75
|
-
focusNext: ({ event, referenceElement, }?: {
|
|
76
|
-
event?: Event;
|
|
77
|
-
referenceElement?: HTMLElement | null;
|
|
78
|
-
}) => HTMLElement | null;
|
|
79
|
-
focusFirst: ({ event }?: {
|
|
80
|
-
event?: Event;
|
|
81
|
-
}) => HTMLElement | null;
|
|
82
|
-
focusFirstLeft: (args_0?: {
|
|
83
|
-
event?: Event;
|
|
84
|
-
} | undefined) => HTMLElement | null;
|
|
85
|
-
focusFirstRight: (args_0?: {
|
|
86
|
-
event?: Event;
|
|
87
|
-
} | undefined) => HTMLElement | null;
|
|
88
|
-
focusLast: ({ event }?: {
|
|
89
|
-
event?: Event;
|
|
90
|
-
}) => HTMLElement | null;
|
|
91
|
-
focusLeft: (args_0?: {
|
|
92
|
-
event?: Event;
|
|
93
|
-
referenceElement?: HTMLElement | null;
|
|
94
|
-
} | undefined) => HTMLElement | null;
|
|
95
|
-
focusRight: (args_0?: {
|
|
96
|
-
event?: Event;
|
|
97
|
-
referenceElement?: HTMLElement | null;
|
|
98
|
-
} | undefined) => HTMLElement | null;
|
|
99
|
-
refreshElements: (now?: boolean) => void;
|
|
100
|
-
};
|
|
144
|
+
export declare const createNavManager: <T>() => NavManager<T>;
|
package/services/navManager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writable, computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { r as registrationArray, y as computeCommonAncestor, b as browserDirective } from "../directive-
|
|
2
|
+
import { r as registrationArray, y as computeCommonAncestor, b as browserDirective } from "../directive-CKEccryv.js";
|
|
3
3
|
const isInertOrInvisible = (element) => {
|
|
4
4
|
let curElement = element;
|
|
5
5
|
while (curElement) {
|
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("../directive-
|
|
3
|
+
const utils_directive = require("../directive-DdlwGFtf.cjs");
|
|
4
4
|
const portal = utils_directive.browserDirective((content, newArg) => {
|
|
5
5
|
let arg;
|
|
6
6
|
let replaceComment;
|
package/services/portal.d.ts
CHANGED
package/services/portal.js
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("../directive-
|
|
4
|
+
const utils_directive = require("../directive-DdlwGFtf.cjs");
|
|
5
5
|
const func = require("../func-Qd3cD9a3.cjs");
|
|
6
6
|
const createResizeObserver = () => {
|
|
7
7
|
const { element$, directive } = utils_directive.createBrowserStoreDirective();
|
|
@@ -22,7 +22,7 @@ const createResizeObserver = () => {
|
|
|
22
22
|
return {
|
|
23
23
|
/**
|
|
24
24
|
* Store which contains the dimensions of the observed element (ResizeObserverEntry type)
|
|
25
|
-
*
|
|
25
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry | MDN documentation}
|
|
26
26
|
*/
|
|
27
27
|
dimensions$: observedElement$,
|
|
28
28
|
/** Directive to be attached to html element in order to listen to resize events */
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
2
|
+
import type { Directive, SSRHTMLElement } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Create a resize observer object
|
|
4
5
|
* @returns An object containing the store with the dimentions of observed element (ResizeObserverEntry), the directive to be applied to the html element to be observed
|
|
5
6
|
*/
|
|
6
7
|
export declare const createResizeObserver: () => {
|
|
7
|
-
/**
|
|
8
|
-
* Store which contains the dimensions of the observed element (ResizeObserverEntry type)
|
|
9
|
-
* See the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
|
|
10
|
-
*/
|
|
11
8
|
dimensions$: ReadableSignal<ResizeObserverEntry | undefined>;
|
|
12
|
-
|
|
13
|
-
directive: import("..").Directive<void, import("..").SSRHTMLElement>;
|
|
9
|
+
directive: Directive<void, SSRHTMLElement>;
|
|
14
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { derived } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { j as createBrowserStoreDirective } from "../directive-
|
|
2
|
+
import { j as createBrowserStoreDirective } from "../directive-CKEccryv.js";
|
|
3
3
|
import { n as noop } from "../func-DR0n-ShK.js";
|
|
4
4
|
const createResizeObserver = () => {
|
|
5
5
|
const { element$, directive } = createBrowserStoreDirective();
|
|
@@ -20,7 +20,7 @@ const createResizeObserver = () => {
|
|
|
20
20
|
return {
|
|
21
21
|
/**
|
|
22
22
|
* Store which contains the dimensions of the observed element (ResizeObserverEntry type)
|
|
23
|
-
*
|
|
23
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry | MDN documentation}
|
|
24
24
|
*/
|
|
25
25
|
dimensions$: observedElement$,
|
|
26
26
|
/** Directive to be attached to html element in order to listen to resize events */
|
|
@@ -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 func = require("../func-Qd3cD9a3.cjs");
|
|
5
|
-
const utils_directive = require("../directive-
|
|
5
|
+
const utils_directive = require("../directive-DdlwGFtf.cjs");
|
|
6
6
|
const internalSetSiblingsInert = (element) => {
|
|
7
7
|
const inertValues = /* @__PURE__ */ new Map();
|
|
8
8
|
const recursiveHelper = (element2) => {
|
|
@@ -36,5 +36,5 @@ const lastElement$ = tansu.computed(
|
|
|
36
36
|
{ equal: Object.is }
|
|
37
37
|
);
|
|
38
38
|
const inertAction$ = tansu.computed(() => setSiblingsInert(lastElement$()));
|
|
39
|
-
const
|
|
40
|
-
exports.
|
|
39
|
+
const siblingsInert = utils_directive.mergeDirectives(storeArrayDirective, utils_directive.directiveSubscribe(inertAction$));
|
|
40
|
+
exports.siblingsInert = siblingsInert;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Directive } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* In case it is used on multiple elements, only the last one has an effect (the directive keeps a stack of elements
|
|
6
|
-
* on which it is used, so when the last one disappears, the previous one in the list becomes the one in effect).
|
|
3
|
+
* A directive that sets the `inert` attribute on all sibling elements of the given element recursively up the DOM tree,
|
|
4
|
+
* excluding the element itself and any `<script>` elements.
|
|
7
5
|
*/
|
|
8
|
-
export declare const
|
|
6
|
+
export declare const siblingsInert: Directive;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed } from "@amadeus-it-group/tansu";
|
|
2
2
|
import { n as noop } from "../func-DR0n-ShK.js";
|
|
3
|
-
import { g as createBrowserStoreArrayDirective, k as mergeDirectives, d as directiveSubscribe } from "../directive-
|
|
3
|
+
import { g as createBrowserStoreArrayDirective, k as mergeDirectives, d as directiveSubscribe } from "../directive-CKEccryv.js";
|
|
4
4
|
const internalSetSiblingsInert = (element) => {
|
|
5
5
|
const inertValues = /* @__PURE__ */ new Map();
|
|
6
6
|
const recursiveHelper = (element2) => {
|
|
@@ -34,7 +34,7 @@ const lastElement$ = computed(
|
|
|
34
34
|
{ equal: Object.is }
|
|
35
35
|
);
|
|
36
36
|
const inertAction$ = computed(() => setSiblingsInert(lastElement$()));
|
|
37
|
-
const
|
|
37
|
+
const siblingsInert = mergeDirectives(storeArrayDirective, directiveSubscribe(inertAction$));
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
siblingsInert
|
|
40
40
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
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-BPAJvaL_.cjs");
|
|
5
5
|
const promise = require("../../promise-BMJ8qhA8.cjs");
|
|
6
6
|
const func = require("../../func-Qd3cD9a3.cjs");
|
|
7
7
|
const utils_stores = require("../../utils/stores.cjs");
|
|
8
|
-
const utils_directive = require("../../directive-
|
|
8
|
+
const utils_directive = require("../../directive-DdlwGFtf.cjs");
|
|
9
9
|
const neverEndingPromise = new Promise(func.noop);
|
|
10
|
-
const noAnimation =
|
|
10
|
+
const noAnimation = (element, direction) => {
|
|
11
11
|
element.style.display = direction === "show" ? "" : "none";
|
|
12
12
|
};
|
|
13
13
|
const defaultValues = {
|
|
@@ -145,7 +145,7 @@ const createTransition = (config) => {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
const directive = utils_directive.mergeDirectives(storeDirective, utils_directive.
|
|
148
|
+
const directive = utils_directive.mergeDirectives(storeDirective, utils_directive.directiveSubscribe(visibleAction$));
|
|
149
149
|
return {
|
|
150
150
|
...utils_stores.stateStores({
|
|
151
151
|
visible$,
|
|
@@ -159,7 +159,6 @@ const createTransition = (config) => {
|
|
|
159
159
|
directives: {
|
|
160
160
|
directive
|
|
161
161
|
},
|
|
162
|
-
actions: {},
|
|
163
162
|
api: {
|
|
164
163
|
show: toggle.bind(null, true),
|
|
165
164
|
hide: toggle.bind(null, false),
|
|
@@ -22,7 +22,10 @@ signal: AbortSignal,
|
|
|
22
22
|
/**
|
|
23
23
|
* Context of the current transition. It is reused between calls if the previous transition was stopped while running on the same element.
|
|
24
24
|
*/
|
|
25
|
-
context: object) => Promise<void
|
|
25
|
+
context: object) => Promise<void> | void;
|
|
26
|
+
/**
|
|
27
|
+
* Properties for configuring a transition.
|
|
28
|
+
*/
|
|
26
29
|
export interface TransitionProps {
|
|
27
30
|
/**
|
|
28
31
|
* Transition to be called.
|
|
@@ -61,7 +64,7 @@ export interface TransitionProps {
|
|
|
61
64
|
/**
|
|
62
65
|
* Function to be called when the visible property changes.
|
|
63
66
|
*
|
|
64
|
-
* @param visible - new value of the visible
|
|
67
|
+
* @param visible - new value of the visible property
|
|
65
68
|
*/
|
|
66
69
|
onVisibleChange: (visible: boolean) => void;
|
|
67
70
|
}
|
|
@@ -94,6 +97,9 @@ export interface TransitionState {
|
|
|
94
97
|
*/
|
|
95
98
|
hidden: boolean;
|
|
96
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Interface representing the API for managing transitions of an element.
|
|
102
|
+
*/
|
|
97
103
|
export interface TransitionApi {
|
|
98
104
|
/**
|
|
99
105
|
* Runs the transition to show the element. It is equivalent to {@link TransitionApi.toggle | toggle} with true as the first parameter.
|
|
@@ -124,13 +130,24 @@ export interface TransitionApi {
|
|
|
124
130
|
*/
|
|
125
131
|
toggle: (visible?: boolean, animated?: boolean) => Promise<void>;
|
|
126
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Interface representing transition directives.
|
|
135
|
+
*/
|
|
127
136
|
export interface TransitionDirectives {
|
|
128
137
|
/**
|
|
129
138
|
* the transition directive
|
|
130
139
|
*/
|
|
131
|
-
directive: Directive
|
|
140
|
+
directive: Directive;
|
|
132
141
|
}
|
|
133
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Represents a widget that handles transitions.
|
|
144
|
+
*
|
|
145
|
+
* @template TransitionProps - The properties required for the transition.
|
|
146
|
+
* @template TransitionState - The state management for the transition.
|
|
147
|
+
* @template TransitionApi - The API interface for the transition.
|
|
148
|
+
* @template TransitionDirectives - The directives used in the transition.
|
|
149
|
+
*/
|
|
150
|
+
export type TransitionWidget = Widget<TransitionProps, TransitionState, TransitionApi, TransitionDirectives>;
|
|
134
151
|
/**
|
|
135
152
|
* A transition to show / hide an element without any animated. It uses the HTML `display` attribute.
|
|
136
153
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed, writable, derived, batch } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { c as typeBoolean, f as typeFunction, d as typeBooleanOrNull } from "../../writables-
|
|
2
|
+
import { c as typeBoolean, f as typeFunction, d as typeBooleanOrNull } from "../../writables-DCiBdIBK.js";
|
|
3
3
|
import { c as promiseWithResolve } from "../../promise-CY2U8bTP.js";
|
|
4
4
|
import { n as noop } from "../../func-DR0n-ShK.js";
|
|
5
5
|
import { writablesForProps, bindableDerived, stateStores } from "../../utils/stores.js";
|
|
6
|
-
import { h as createStoreDirective, k as mergeDirectives, d as directiveSubscribe
|
|
6
|
+
import { h as createStoreDirective, k as mergeDirectives, d as directiveSubscribe } from "../../directive-CKEccryv.js";
|
|
7
7
|
const neverEndingPromise = new Promise(noop);
|
|
8
|
-
const noAnimation =
|
|
8
|
+
const noAnimation = (element, direction) => {
|
|
9
9
|
element.style.display = direction === "show" ? "" : "none";
|
|
10
10
|
};
|
|
11
11
|
const defaultValues = {
|
|
@@ -143,7 +143,7 @@ const createTransition = (config) => {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
|
-
const directive = mergeDirectives(storeDirective,
|
|
146
|
+
const directive = mergeDirectives(storeDirective, directiveSubscribe(visibleAction$));
|
|
147
147
|
return {
|
|
148
148
|
...stateStores({
|
|
149
149
|
visible$,
|
|
@@ -157,7 +157,6 @@ const createTransition = (config) => {
|
|
|
157
157
|
directives: {
|
|
158
158
|
directive
|
|
159
159
|
},
|
|
160
|
-
actions: {},
|
|
161
160
|
api: {
|
|
162
161
|
show: toggle.bind(null, true),
|
|
163
162
|
hide: toggle.bind(null, false),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../../directive-
|
|
3
|
+
const utils_directive = require("../../directive-DdlwGFtf.cjs");
|
|
4
4
|
const services_transitions_cssTransitions = require("./cssTransitions.cjs");
|
|
5
5
|
const createCollapseTransition = ({
|
|
6
6
|
dimension = "height",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { TransitionFn } from './baseTransitions';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the context for a collapsible element.
|
|
4
|
+
*/
|
|
2
5
|
export interface CollapseContext {
|
|
3
6
|
/**
|
|
4
7
|
* the maximum size of the collapseable content.
|
|
@@ -9,6 +12,9 @@ export interface CollapseContext {
|
|
|
9
12
|
*/
|
|
10
13
|
minSize?: string;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for the collapse transition.
|
|
17
|
+
*/
|
|
12
18
|
export interface CollapseConfig {
|
|
13
19
|
/**
|
|
14
20
|
* the direction in which the collapsing is performed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isBrowserHTMLElement, v as removeClasses, w as addClasses, x as reflow } from "../../directive-
|
|
1
|
+
import { i as isBrowserHTMLElement, v as removeClasses, w as addClasses, x as reflow } from "../../directive-CKEccryv.js";
|
|
2
2
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
3
3
|
const createCollapseTransition = ({
|
|
4
4
|
dimension = "height",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const utils_directive = require("../../directive-
|
|
3
|
+
const utils_directive = require("../../directive-DdlwGFtf.cjs");
|
|
4
4
|
const func = require("../../func-Qd3cD9a3.cjs");
|
|
5
5
|
const promise = require("../../promise-BMJ8qhA8.cjs");
|
|
6
6
|
function hasTransition(element) {
|
|
@@ -12,6 +12,9 @@ export declare function hasTransition(element: HTMLElement): boolean;
|
|
|
12
12
|
* @returns transition duration in milli seconds
|
|
13
13
|
*/
|
|
14
14
|
export declare function getTransitionDurationMs(element: HTMLElement): number;
|
|
15
|
+
/**
|
|
16
|
+
* Defines a function type for CSS transitions.
|
|
17
|
+
*/
|
|
15
18
|
export type CSSTransitionFn = (element: SSRHTMLElement, direction: 'show' | 'hide', animated: boolean, context: object) => void | (() => void);
|
|
16
19
|
/**
|
|
17
20
|
* Create a simple css transition.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isBrowserHTMLElement } from "../../directive-
|
|
1
|
+
import { i as isBrowserHTMLElement } from "../../directive-CKEccryv.js";
|
|
2
2
|
import { n as noop } from "../../func-DR0n-ShK.js";
|
|
3
3
|
import { a as promiseFromEvent, b as promiseFromTimeout } from "../../promise-CY2U8bTP.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("../../directive-
|
|
4
|
+
const utils_directive = require("../../directive-DdlwGFtf.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,3 +1,7 @@
|
|
|
1
|
+
import type { TransitionFn } from './baseTransitions';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration interface for simple class-based transitions.
|
|
4
|
+
*/
|
|
1
5
|
export interface SimpleClassTransitionConfig {
|
|
2
6
|
/**
|
|
3
7
|
* a list of classes to add to the collapsable element while transitioning
|
|
@@ -20,6 +24,9 @@ export interface SimpleClassTransitionConfig {
|
|
|
20
24
|
*/
|
|
21
25
|
hideClasses?: string[];
|
|
22
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Represents the context for a simple class transition.
|
|
29
|
+
*/
|
|
23
30
|
export interface SimpleClassTransitionContext {
|
|
24
31
|
/**
|
|
25
32
|
* `true` is the transition has started
|
|
@@ -31,10 +38,10 @@ export interface SimpleClassTransitionContext {
|
|
|
31
38
|
*
|
|
32
39
|
* The config includes the classes that will be attached / removed depending on the transition state.
|
|
33
40
|
* `animationPendingClasses` are the classes attached when the transition is in a pending state
|
|
34
|
-
* `animationPendingShowClasses` and `animationPendingHideClasses` are attached when
|
|
41
|
+
* `animationPendingShowClasses` and `animationPendingHideClasses` are attached when transitioning towards one direction
|
|
35
42
|
* `showClasses` and `hideClasses` are attached when the transition has reached the show or hide state respectively
|
|
36
43
|
*
|
|
37
44
|
* @param config - the transition config
|
|
38
45
|
* @returns the simple class transition
|
|
39
46
|
*/
|
|
40
|
-
export declare const createSimpleClassTransition: (config: SimpleClassTransitionConfig) =>
|
|
47
|
+
export declare const createSimpleClassTransition: (config: SimpleClassTransitionConfig) => TransitionFn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
2
|
-
import { v as removeClasses, w as addClasses, x as reflow } from "../../directive-
|
|
2
|
+
import { v as removeClasses, w as addClasses, x as reflow } from "../../directive-CKEccryv.js";
|
|
3
3
|
const createSimpleClassTransition = (config) => {
|
|
4
4
|
const { animationPendingClasses, animationPendingShowClasses, animationPendingHideClasses, showClasses, hideClasses } = config;
|
|
5
5
|
return createCSSTransition((element, direction, animated, context) => {
|