@design-factory/core 21.1.0 → 22.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{accordion-D9ba0XYq.js → accordion-B5RqDwi3.js} +76 -15
- package/alert-Db6cG6JE.js +125 -0
- package/{collapse-Bn8iHKrd.js → collapse-D8Jo56k9.js} +2 -2
- package/{common-DFyZvkII.js → common-CP4amR0Z.js} +2 -2
- package/components/accordion/accordion.d.ts +73 -15
- package/components/accordion/index.js +1 -1
- package/components/alert/alert.d.ts +77 -8
- package/components/alert/common.d.ts +9 -9
- package/components/alert/index.js +2 -3
- package/components/carousel/index.js +2 -2
- package/components/collapse/index.js +1 -1
- package/components/drawer/drawer.d.ts +6 -0
- package/components/drawer/index.js +1 -1
- package/components/dropdown/dropdown.d.ts +110 -0
- package/components/dropdown/index.d.ts +1 -0
- package/components/dropdown/index.js +5 -0
- package/components/modal/index.js +1 -1
- package/components/pagination/index.js +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/rating/index.js +1 -1
- package/components/slider/index.js +1 -1
- package/components/slider/slider.d.ts +23 -4
- package/components/toast/index.js +1 -1
- package/components/tooltip/index.d.ts +1 -0
- package/components/tooltip/index.js +174 -0
- package/components/tooltip/tooltip.d.ts +63 -0
- package/components/tree/index.js +1 -1
- package/{directive-CNNSo5Yn.js → directive-CMT2vEDg.js} +7 -4
- package/{drawer-CoBXUPyv.js → drawer-CpGnS2ln.js} +11 -4
- package/dropdown-Bjj2ql6d.js +246 -0
- package/index.d.ts +3 -1
- package/index.js +44 -37
- package/isFocusable-C2iRr0zh.js +72 -0
- package/{modal-BH9nrwVz.js → modal-CQWh2Sm5.js} +3 -3
- package/package.json +1 -1
- package/{pagination-BQWusWXN.js → pagination-DIRcpdRE.js} +2 -2
- package/{progressbar-S1pNn5rM.js → progressbar-Bth8r3Qu.js} +2 -2
- package/{promise-D-RZVPuv.js → promise-CkIc0KKt.js} +3 -3
- package/{rating-DWgGgwk3.js → rating-DLsgFSyB.js} +2 -2
- package/services/extendWidget.d.ts +1 -1
- package/services/focusElement.js +2 -2
- package/services/focustrack.js +2 -2
- package/services/matchMedia.js +1 -1
- package/services/mousetrack.d.ts +34 -0
- package/services/mousetrack.js +41 -0
- package/services/navManager.js +2 -2
- package/services/pointerdownPosition.js +1 -1
- package/services/portal.js +1 -1
- package/services/positioning.d.ts +101 -0
- package/services/positioning.js +104 -0
- package/services/resizeObserver.js +1 -1
- package/services/siblingsInert.js +1 -1
- package/services/transitions/baseTransitions.js +3 -3
- package/services/transitions/collapse.js +4 -7
- package/services/transitions/cssTransitions.js +2 -2
- package/services/transitions/simpleClassTransition.js +1 -1
- package/{slider-Br_Qiopx.js → slider-b9cVFNAL.js} +96 -58
- package/{toaster-BUBzFeJM.js → toaster-BS9qeRLF.js} +3 -3
- package/{tree-vD7ZkV8Z.js → tree-DW6iLxdw.js} +2 -2
- package/types.d.ts +8 -1
- package/utils/debounceSignal.d.ts +11 -0
- package/utils/debounceSignal.js +18 -0
- package/utils/directive.js +1 -1
- package/utils/edgeState.d.ts +23 -0
- package/utils/edgeState.js +43 -0
- package/utils/internal/isFocusable.d.ts +40 -0
- package/utils/stores.d.ts +1 -1
- package/utils/stores.js +4 -1
- package/utils/writables.d.ts +27 -13
- package/utils/writables.js +12 -11
- package/{writables-DYGjj5T3.js → writables-_7BriMb2.js} +37 -12
- package/accordion-B0vs8JWM.cjs +0 -314
- package/alert-AhaliJ17.cjs +0 -9
- package/alert-Cb9FhbFQ.js +0 -10
- package/collapse-BnWw4Hnc.cjs +0 -94
- package/common-B5jS-Ih_.cjs +0 -73
- package/components/accordion/index.cjs +0 -7
- package/components/alert/index.cjs +0 -5
- package/components/carousel/index.cjs +0 -292
- package/components/collapse/index.cjs +0 -5
- package/components/drawer/index.cjs +0 -5
- package/components/modal/index.cjs +0 -8
- package/components/pagination/index.cjs +0 -5
- package/components/progressbar/index.cjs +0 -5
- package/components/rating/index.cjs +0 -5
- package/components/slider/index.cjs +0 -5
- package/components/toast/index.cjs +0 -7
- package/components/tree/index.cjs +0 -5
- package/config.cjs +0 -36
- package/directive-DyTodNPd.cjs +0 -523
- package/drawer-Ca_ktkEs.cjs +0 -328
- package/index.cjs +0 -134
- package/isFocusable-Ckwus82R.js +0 -32
- package/isFocusable-DfzDLeAN.cjs +0 -31
- package/modal-Dxdw2Pkv.cjs +0 -252
- package/pagination-BLVa1UsZ.cjs +0 -254
- package/progressbar-RopgvVeA.cjs +0 -86
- package/promise-CxCD3NYv.cjs +0 -118
- package/rating-DZ3OQgtt.cjs +0 -183
- package/scrollbars-f651ntzz.cjs +0 -33
- package/services/extendWidget.cjs +0 -41
- package/services/floatingUI.cjs +0 -111
- package/services/floatingUI.d.ts +0 -76
- package/services/floatingUI.js +0 -111
- package/services/focusElement.cjs +0 -46
- package/services/focustrack.cjs +0 -47
- package/services/hash.cjs +0 -15
- package/services/intersection.cjs +0 -53
- package/services/matchMedia.cjs +0 -14
- package/services/navManager.cjs +0 -166
- package/services/pointerdownPosition.cjs +0 -60
- package/services/portal.cjs +0 -42
- package/services/resizeObserver.cjs +0 -54
- package/services/siblingsInert.cjs +0 -44
- package/services/transitions/baseTransitions.cjs +0 -186
- package/services/transitions/collapse.cjs +0 -40
- package/services/transitions/cssTransitions.cjs +0 -32
- package/services/transitions/simpleClassTransition.cjs +0 -37
- package/slider-pgDq1V5r.cjs +0 -807
- package/textDirection-zqcZ5-eK.cjs +0 -3
- package/toaster-Dlube4Ya.cjs +0 -161
- package/tree-Chcy4ulJ.cjs +0 -228
- package/types.cjs +0 -6
- package/utils/directive.cjs +0 -28
- package/utils/func.cjs +0 -7
- package/utils/id.cjs +0 -5
- package/utils/stores.cjs +0 -172
- package/utils/widget.cjs +0 -8
- package/utils/writables.cjs +0 -16
- package/writables-Dt68gADJ.cjs +0 -102
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed, writable } from "@amadeus-it-group/tansu";
|
|
2
|
+
import { u as registrationArray, d as browserDirective } from "../directive-CMT2vEDg.js";
|
|
3
|
+
const evtMouseEnter = "mouseenter";
|
|
4
|
+
const evtMouseLeave = "mouseleave";
|
|
5
|
+
function createHasMouseInside() {
|
|
6
|
+
const mouseInsideSignals$ = registrationArray();
|
|
7
|
+
const directive = browserDirective((element) => {
|
|
8
|
+
const mouseInside$ = writable(false);
|
|
9
|
+
const unregister = mouseInsideSignals$.register(mouseInside$);
|
|
10
|
+
function onMouseEnter() {
|
|
11
|
+
mouseInside$.set(true);
|
|
12
|
+
}
|
|
13
|
+
function onMouseLeave() {
|
|
14
|
+
mouseInside$.set(false);
|
|
15
|
+
}
|
|
16
|
+
element.addEventListener(evtMouseEnter, onMouseEnter);
|
|
17
|
+
element.addEventListener(evtMouseLeave, onMouseLeave);
|
|
18
|
+
return {
|
|
19
|
+
destroy() {
|
|
20
|
+
element.removeEventListener(evtMouseEnter, onMouseEnter);
|
|
21
|
+
element.removeEventListener(evtMouseLeave, onMouseLeave);
|
|
22
|
+
unregister();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
const hasMouseInside$ = computed(() => {
|
|
27
|
+
for (const mouseInside$ of mouseInsideSignals$()) {
|
|
28
|
+
if (mouseInside$()) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
directive,
|
|
36
|
+
hasMouseInside$
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
createHasMouseInside
|
|
41
|
+
};
|
package/services/navManager.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable, computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { u as registrationArray, A as computeCommonAncestor, d as browserDirective } from "../directive-
|
|
3
|
-
import { i as isFocusable } from "../isFocusable-
|
|
2
|
+
import { u as registrationArray, A as computeCommonAncestor, d as browserDirective } from "../directive-CMT2vEDg.js";
|
|
3
|
+
import { i as isFocusable } from "../isFocusable-C2iRr0zh.js";
|
|
4
4
|
import { g as getTextDirection } from "../textDirection-cNgt24LJ.js";
|
|
5
5
|
const compareDomOrder = (element1, element2) => {
|
|
6
6
|
if (element1 === element2) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as browserDirective, w as addEvent } from "../directive-
|
|
1
|
+
import { d as browserDirective, w as addEvent } from "../directive-CMT2vEDg.js";
|
|
2
2
|
import { noop } from "../utils/func.js";
|
|
3
3
|
const createPointerdownPositionDirective = (onStart) => browserDirective((element, arg) => {
|
|
4
4
|
let activePointerId = null;
|
package/services/portal.js
CHANGED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Strategy } from '@floating-ui/dom';
|
|
2
|
+
import type { Directive, PickRequired, PropsConfig, SSRHTMLElement, Widget, WritableWithDefaultOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the possible placement values for a floating element relative to its reference element.
|
|
5
|
+
*
|
|
6
|
+
* Standard placements (`top`, `bottom`, `left`, `right`) position the floating element on the corresponding side.
|
|
7
|
+
* Compound placements (e.g. `top-start`, `bottom-end`) add alignment along the cross axis.
|
|
8
|
+
*
|
|
9
|
+
* The `start` and `end` placements are RTL-aware: `start` resolves to `left` in LTR and `right` in RTL,
|
|
10
|
+
* while `end` resolves to `right` in LTR and `left` in RTL.
|
|
11
|
+
*/
|
|
12
|
+
export type Placement = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end' | 'start' | 'end' | 'start-start' | 'start-end' | 'end-start' | 'end-end';
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes a single placement value, ensuring it is one of the allowed placements defined in the `Placement` type.
|
|
15
|
+
*/
|
|
16
|
+
export declare const typePlacement: PickRequired<WritableWithDefaultOptions<Placement>, 'normalizeValue'>;
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes an array of placements, allowing the input to be either a space-separated string or an array of strings.
|
|
19
|
+
*/
|
|
20
|
+
export declare const typePlacementArray: PickRequired<WritableWithDefaultOptions<Placement[]>, 'normalizeValue' | 'equal'>;
|
|
21
|
+
/**
|
|
22
|
+
* Interface representing the properties for configuring the positioning service.
|
|
23
|
+
*/
|
|
24
|
+
export interface PositioningProps {
|
|
25
|
+
/**
|
|
26
|
+
* List of placements, in order of preference.
|
|
27
|
+
* The first placement is used as the primary position, and the remaining ones serve as fallbacks
|
|
28
|
+
* when the primary placement does not fit within the available space.
|
|
29
|
+
*
|
|
30
|
+
* Placements starting with `start` or `end` are automatically converted to `left`/`right`
|
|
31
|
+
* based on the text direction (LTR or RTL) of the reference element.
|
|
32
|
+
*/
|
|
33
|
+
placement: Placement[];
|
|
34
|
+
/**
|
|
35
|
+
* The distance in pixels between the reference and floating elements. This offset is applied along the main axis of the placement.
|
|
36
|
+
* For example, if the placement is `top`, the offset will be applied vertically, creating space between the top of the reference element and the bottom of the floating element.
|
|
37
|
+
*/
|
|
38
|
+
offset?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The CSS `position` strategy used for the floating element.
|
|
41
|
+
* - `'fixed'`: the floating element uses `position: fixed`.
|
|
42
|
+
* - `'absolute'`: the floating element uses `position: absolute`.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `'fixed'`
|
|
45
|
+
*/
|
|
46
|
+
strategy?: Strategy;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents the state of the positioning service.
|
|
50
|
+
*/
|
|
51
|
+
export interface PositioningState {
|
|
52
|
+
/**
|
|
53
|
+
* The final chosen placement of the floating element, after evaluating available space
|
|
54
|
+
* and applying the flip middleware. Undefined until both reference and floating elements are attached.
|
|
55
|
+
*/
|
|
56
|
+
placement: Placement | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Indicates whether the reference element is hidden (clipped).
|
|
59
|
+
* The floating element should be consequently hidden as well in this case.
|
|
60
|
+
*/
|
|
61
|
+
referenceHidden: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Interface representing the directives used by the positioning service.
|
|
65
|
+
*/
|
|
66
|
+
export interface PositioningDirectives {
|
|
67
|
+
/**
|
|
68
|
+
* Directive to attach to the reference element.
|
|
69
|
+
* The reference element serves as the anchor from which the floating element is positioned.
|
|
70
|
+
* It is also used to determine the text direction (LTR/RTL) for resolving `start`/`end` placements.
|
|
71
|
+
*/
|
|
72
|
+
referenceDirective: Directive<void, SSRHTMLElement>;
|
|
73
|
+
/**
|
|
74
|
+
* Directive to attach to the floating element.
|
|
75
|
+
* The floating element is the one whose position is computed relative to the reference element.
|
|
76
|
+
* Its `position`, `top`, and `left` CSS properties are automatically set
|
|
77
|
+
* (`position` matches the configured `strategy`, defaulting to `'fixed'`),
|
|
78
|
+
* so consumers should not override `position` from their own stylesheets.
|
|
79
|
+
*/
|
|
80
|
+
floatingDirective: Directive<void, SSRHTMLElement>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Represents the type returned by the {@link createPositioning} function.
|
|
84
|
+
*
|
|
85
|
+
* This type defines the structure and behavior of the positioning widget.
|
|
86
|
+
*/
|
|
87
|
+
export type Positioning = Widget<PositioningProps, PositioningState, object, PositioningDirectives>;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a positioning service that manages the placement of a floating element relative to a reference element.
|
|
90
|
+
*
|
|
91
|
+
* This service wraps Floating UI and provides RTL-aware placement resolution. Placements prefixed with `start` or `end`
|
|
92
|
+
* are automatically converted to `left` or `right` based on the text direction of the reference element.
|
|
93
|
+
* The flip middleware is used to fall back to alternative placements when the preferred one does not fit.
|
|
94
|
+
*
|
|
95
|
+
* The returned service includes the patch method to update properties, stores to track state, and directives to apply
|
|
96
|
+
* to the reference, floating, and arrow DOM elements.
|
|
97
|
+
*
|
|
98
|
+
* @param propsConfig - the props config for the positioning service
|
|
99
|
+
* @returns the positioning service
|
|
100
|
+
*/
|
|
101
|
+
export declare const createPositioning: (propsConfig?: PropsConfig<PositioningProps>) => Positioning;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { computed, derived } from "@amadeus-it-group/tansu";
|
|
2
|
+
import { hide, offset, flip, autoUpdate, computePosition } from "@floating-ui/dom";
|
|
3
|
+
import { i as createBrowserStoreDirective, s as mergeDirectives, g as createAttributesDirective } from "../directive-CMT2vEDg.js";
|
|
4
|
+
import { a as promiseStoreToValueStore } from "../promise-CkIc0KKt.js";
|
|
5
|
+
import { g as getTextDirection } from "../textDirection-cNgt24LJ.js";
|
|
6
|
+
import { writablesForProps, stateStores } from "../utils/stores.js";
|
|
7
|
+
import { c as createTypeEnum, a as createTypeStringSpacedArray } from "../writables-_7BriMb2.js";
|
|
8
|
+
const typePlacement = createTypeEnum([
|
|
9
|
+
"top",
|
|
10
|
+
"bottom",
|
|
11
|
+
"left",
|
|
12
|
+
"right",
|
|
13
|
+
"top-start",
|
|
14
|
+
"top-end",
|
|
15
|
+
"bottom-start",
|
|
16
|
+
"bottom-end",
|
|
17
|
+
"left-start",
|
|
18
|
+
"left-end",
|
|
19
|
+
"right-start",
|
|
20
|
+
"right-end",
|
|
21
|
+
"start",
|
|
22
|
+
"end",
|
|
23
|
+
"start-start",
|
|
24
|
+
"start-end",
|
|
25
|
+
"end-start",
|
|
26
|
+
"end-end"
|
|
27
|
+
]);
|
|
28
|
+
const typePlacementArray = createTypeStringSpacedArray(typePlacement.normalizeValue);
|
|
29
|
+
const defaultConfig = {
|
|
30
|
+
placement: ["top"],
|
|
31
|
+
offset: 4,
|
|
32
|
+
strategy: "fixed"
|
|
33
|
+
};
|
|
34
|
+
const createPositioning = (propsConfig) => {
|
|
35
|
+
const [{ placement$: placementProp$, offset$, strategy$ }, patch] = writablesForProps(defaultConfig, propsConfig);
|
|
36
|
+
const { directive: referenceDirective, element$: referenceElement$ } = createBrowserStoreDirective();
|
|
37
|
+
const { directive: floatingDirective, element$: floatingElement$ } = createBrowserStoreDirective();
|
|
38
|
+
const isRtl$ = computed(() => {
|
|
39
|
+
const referenceElement = referenceElement$();
|
|
40
|
+
return referenceElement ? getTextDirection(referenceElement) === "rtl" : false;
|
|
41
|
+
});
|
|
42
|
+
const placementsArray$ = computed(
|
|
43
|
+
() => placementProp$().map((p) => {
|
|
44
|
+
return p.replace(/^(start|end)\b/, (match) => {
|
|
45
|
+
if (match === "start") {
|
|
46
|
+
return isRtl$() ? "right" : "left";
|
|
47
|
+
} else {
|
|
48
|
+
return isRtl$() ? "left" : "right";
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
const computePositionOptions$ = computed(() => {
|
|
54
|
+
const placements = placementsArray$();
|
|
55
|
+
return {
|
|
56
|
+
placement: placements[0],
|
|
57
|
+
strategy: strategy$(),
|
|
58
|
+
middleware: [hide(), offset({ mainAxis: offset$() }), flip({ fallbackPlacements: placements.slice(1) })]
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const promisePosition$ = derived(
|
|
62
|
+
[floatingElement$, referenceElement$, computePositionOptions$],
|
|
63
|
+
([floatingElement, referenceElement, computePositionOptions], set) => {
|
|
64
|
+
if (floatingElement && referenceElement) {
|
|
65
|
+
const clean = autoUpdate(referenceElement, floatingElement, () => {
|
|
66
|
+
set(computePosition(referenceElement, floatingElement, computePositionOptions));
|
|
67
|
+
});
|
|
68
|
+
return () => {
|
|
69
|
+
set(null);
|
|
70
|
+
clean();
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return void 0;
|
|
74
|
+
},
|
|
75
|
+
null
|
|
76
|
+
);
|
|
77
|
+
const position$ = promiseStoreToValueStore(promisePosition$, null);
|
|
78
|
+
const placement$ = computed(() => position$()?.placement);
|
|
79
|
+
const referenceHidden$ = computed(() => position$()?.middlewareData.hide?.referenceHidden ?? false);
|
|
80
|
+
const floatingStyleDirective = createAttributesDirective(() => ({
|
|
81
|
+
styles: {
|
|
82
|
+
position: strategy$,
|
|
83
|
+
left: computed(() => `${position$()?.x ?? 0}px`),
|
|
84
|
+
top: computed(() => `${position$()?.y ?? 0}px`)
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
return {
|
|
88
|
+
patch,
|
|
89
|
+
...stateStores({
|
|
90
|
+
placement$,
|
|
91
|
+
referenceHidden$
|
|
92
|
+
}),
|
|
93
|
+
directives: {
|
|
94
|
+
referenceDirective,
|
|
95
|
+
floatingDirective: mergeDirectives(floatingDirective, floatingStyleDirective)
|
|
96
|
+
},
|
|
97
|
+
api: {}
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
createPositioning,
|
|
102
|
+
typePlacement,
|
|
103
|
+
typePlacementArray
|
|
104
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { derived } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { h as createBrowserStoreArrayDirective, d as browserDirective } from "../directive-
|
|
2
|
+
import { h as createBrowserStoreArrayDirective, d as browserDirective } from "../directive-CMT2vEDg.js";
|
|
3
3
|
import { noop } from "../utils/func.js";
|
|
4
4
|
const createResizeObserverMap = () => {
|
|
5
5
|
const { elements$, directive } = createBrowserStoreArrayDirective();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed } from "@amadeus-it-group/tansu";
|
|
2
|
-
import { j as createConditionalBrowserStoreArrayDirective, s as mergeDirectives, o as directiveSubscribe } from "../directive-
|
|
2
|
+
import { j as createConditionalBrowserStoreArrayDirective, s as mergeDirectives, o as directiveSubscribe } from "../directive-CMT2vEDg.js";
|
|
3
3
|
import { noop } from "../utils/func.js";
|
|
4
4
|
const ignoreInertAttributeName = "data-agnos-ignore-inert";
|
|
5
5
|
const applyInertToSiblingsRecursively = (element) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed, writable, derived, batch } from "@amadeus-it-group/tansu";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { e as typeBooleanOrNull, f as typeFunction, d as typeBoolean } from "../../writables-_7BriMb2.js";
|
|
3
|
+
import { b as promiseWithResolve } from "../../promise-CkIc0KKt.js";
|
|
4
4
|
import { noop } from "../../utils/func.js";
|
|
5
5
|
import { writablesForProps, bindableDerived, stateStores } from "../../utils/stores.js";
|
|
6
|
-
import { m as createStoreDirective, s as mergeDirectives, o as directiveSubscribe } from "../../directive-
|
|
6
|
+
import { m as createStoreDirective, s as mergeDirectives, o as directiveSubscribe } from "../../directive-CMT2vEDg.js";
|
|
7
7
|
const neverEndingPromise = new Promise(noop);
|
|
8
8
|
const noAnimation = (element, direction) => {
|
|
9
9
|
element.style.display = direction === "show" ? "" : "none";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as isBrowserHTMLElement, x as removeClasses, y as addClasses, z as reflow } from "../../directive-
|
|
1
|
+
import { q as isBrowserHTMLElement, x as removeClasses, y as addClasses, z as reflow } from "../../directive-CMT2vEDg.js";
|
|
2
2
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
3
3
|
const createCollapseTransition = ({
|
|
4
4
|
dimension = "height",
|
|
@@ -7,20 +7,17 @@ const createCollapseTransition = ({
|
|
|
7
7
|
animationPendingClasses
|
|
8
8
|
} = {}) => createCSSTransition((element, direction, animated, context) => {
|
|
9
9
|
if (animated && isBrowserHTMLElement(element)) {
|
|
10
|
-
let { maxSize, minSize } = context;
|
|
11
10
|
removeClasses(element, animationPendingClasses);
|
|
12
11
|
removeClasses(element, hideClasses);
|
|
13
12
|
addClasses(element, showClasses);
|
|
14
|
-
maxSize = element.getBoundingClientRect()[dimension] + "px";
|
|
15
|
-
context.maxSize = maxSize;
|
|
13
|
+
context.maxSize = element.getBoundingClientRect()[dimension] + "px";
|
|
16
14
|
removeClasses(element, animationPendingClasses);
|
|
17
15
|
removeClasses(element, showClasses);
|
|
18
16
|
addClasses(element, hideClasses);
|
|
19
|
-
minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
20
|
-
context.minSize = minSize;
|
|
17
|
+
context.minSize = element.getBoundingClientRect()[dimension] + "px";
|
|
21
18
|
removeClasses(element, showClasses);
|
|
22
19
|
removeClasses(element, hideClasses);
|
|
23
|
-
const values = direction === "show" ? [minSize, maxSize] : [maxSize, minSize];
|
|
20
|
+
const values = direction === "show" ? [context.minSize, context.maxSize] : [context.maxSize, context.minSize];
|
|
24
21
|
element.style[dimension] = values[0];
|
|
25
22
|
reflow(element);
|
|
26
23
|
addClasses(element, animationPendingClasses);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as isBrowserHTMLElement } from "../../directive-
|
|
1
|
+
import { q as isBrowserHTMLElement } from "../../directive-CMT2vEDg.js";
|
|
2
2
|
import { noop } from "../../utils/func.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as promiseFromEvent, d as promiseFromTimeout } from "../../promise-CkIc0KKt.js";
|
|
4
4
|
function hasTransition(element) {
|
|
5
5
|
return window.getComputedStyle(element).transitionProperty !== "none";
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCSSTransition } from "./cssTransitions.js";
|
|
2
|
-
import { x as removeClasses, y as addClasses, z as reflow } from "../../directive-
|
|
2
|
+
import { x as removeClasses, y as addClasses, z as reflow } from "../../directive-CMT2vEDg.js";
|
|
3
3
|
const createSimpleClassTransition = (config) => {
|
|
4
4
|
const {
|
|
5
5
|
animationPendingClasses,
|