@agnos-ui/core 0.1.1 → 0.3.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 +3 -3
- package/accordion-BaWN0_n-.js +330 -0
- package/accordion-BuIgxZ0S.cjs +329 -0
- package/alert-C4jCg9Pl.cjs +8 -0
- package/alert-Dlf-BV98.js +9 -0
- package/common-DRdsw5m8.js +76 -0
- package/common-nJRMXbwj.cjs +75 -0
- package/components/accordion/accordion.d.ts +57 -64
- package/components/accordion/index.cjs +7 -0
- package/components/accordion/index.js +7 -1
- package/components/alert/alert.d.ts +3 -12
- package/components/alert/common.d.ts +4 -13
- package/components/alert/index.cjs +10 -0
- package/components/alert/index.js +10 -2
- package/components/modal/index.cjs +7 -0
- package/components/modal/index.js +7 -1
- package/components/modal/modal.d.ts +7 -49
- package/components/pagination/index.cjs +5 -0
- package/components/pagination/index.d.ts +0 -1
- package/components/pagination/index.js +5 -2
- package/components/pagination/pagination.d.ts +107 -128
- package/components/progressbar/index.cjs +5 -0
- package/components/progressbar/index.js +5 -1
- package/components/progressbar/progressbar.d.ts +6 -22
- package/components/rating/index.cjs +5 -0
- package/components/rating/index.js +5 -1
- package/components/rating/rating.d.ts +16 -11
- package/components/select/index.cjs +6 -0
- package/components/select/index.js +6 -1
- package/components/select/select.d.ts +45 -57
- package/components/slider/index.cjs +5 -0
- package/components/slider/index.js +5 -1
- package/components/slider/slider.d.ts +63 -5
- package/components/toast/index.cjs +5 -0
- package/components/toast/index.d.ts +1 -0
- package/components/toast/index.js +5 -0
- package/components/toast/toast.d.ts +47 -0
- package/config.cjs +38 -0
- package/config.d.ts +6 -1
- package/config.js +35 -50
- package/directive-BTSEYLF3.cjs +404 -0
- package/directive-DCYlDznf.js +405 -0
- package/func-DR0n-ShK.js +7 -0
- package/func-Qd3cD9a3.cjs +6 -0
- package/index.cjs +119 -0
- package/index.d.ts +3 -1
- package/index.js +119 -31
- package/modal-BI2qUu1M.js +251 -0
- package/modal-rzMpATf5.cjs +250 -0
- package/package.json +30 -22
- package/pagination--GkwduJn.js +263 -0
- package/pagination-EWSWQT1I.cjs +262 -0
- package/progressbar-DH7DHYMp.cjs +83 -0
- package/progressbar-DuRX7_my.js +84 -0
- package/promise-BMJ8qhA8.cjs +118 -0
- package/promise-CY2U8bTP.js +119 -0
- package/rating-BR5wD7y2.js +173 -0
- package/rating-CmuYUSxy.cjs +172 -0
- package/select-BCs6HQWn.js +358 -0
- package/select-CCIKn8WR.cjs +357 -0
- package/services/extendWidget.cjs +32 -0
- package/services/extendWidget.d.ts +10 -5
- package/services/extendWidget.js +31 -34
- package/services/floatingUI.cjs +131 -0
- package/services/floatingUI.d.ts +30 -14
- package/services/floatingUI.js +128 -102
- package/services/focustrack.cjs +47 -0
- package/services/focustrack.js +45 -44
- package/services/hash.cjs +15 -0
- package/services/hash.d.ts +2 -0
- package/services/hash.js +15 -0
- package/services/intersection.cjs +53 -0
- package/services/intersection.js +48 -50
- package/services/matchMedia.cjs +13 -0
- package/services/matchMedia.d.ts +7 -0
- package/services/matchMedia.js +13 -0
- package/services/navManager.cjs +196 -0
- package/services/navManager.d.ts +24 -17
- package/services/navManager.js +186 -162
- package/services/portal.cjs +43 -0
- package/services/portal.js +41 -42
- package/services/resizeObserver.cjs +32 -0
- package/services/resizeObserver.d.ts +14 -0
- package/services/resizeObserver.js +32 -0
- package/services/siblingsInert.cjs +40 -0
- package/services/siblingsInert.js +31 -31
- package/services/transitions/baseTransitions.cjs +171 -0
- package/services/transitions/baseTransitions.d.ts +16 -16
- package/services/transitions/baseTransitions.js +159 -170
- package/services/transitions/collapse.cjs +44 -0
- package/services/transitions/collapse.js +41 -49
- package/services/transitions/cssTransitions.cjs +32 -0
- package/services/transitions/cssTransitions.d.ts +2 -1
- package/services/transitions/cssTransitions.js +29 -39
- package/services/transitions/simpleClassTransition.cjs +31 -0
- package/services/transitions/simpleClassTransition.js +30 -41
- package/slider-CA_fszn7.js +536 -0
- package/slider-DsLvT87U.cjs +535 -0
- package/toast-8tWp6x89.js +63 -0
- package/toast-Aw8o0Iwe.cjs +62 -0
- package/types.cjs +12 -0
- package/types.d.ts +21 -1
- package/types.js +11 -13
- package/utils/directive.cjs +26 -0
- package/utils/directive.d.ts +155 -4
- package/utils/directive.js +25 -189
- package/utils/internal/dom.d.ts +57 -3
- package/utils/internal/promise.d.ts +2 -2
- package/utils/internal/ssrHTMLElement.d.ts +7 -0
- package/utils/internal/textDirection.d.ts +1 -1
- package/utils/stores.cjs +163 -0
- package/utils/stores.d.ts +23 -20
- package/utils/stores.js +151 -269
- package/utils/writables.cjs +13 -0
- package/utils/writables.js +12 -71
- package/writables-D46sFgGK.cjs +85 -0
- package/writables-DoU_XYTX.js +86 -0
- package/components/accordion/accordion.js +0 -267
- package/components/alert/alert.js +0 -22
- package/components/alert/common.js +0 -69
- package/components/commonProps.js +0 -1
- package/components/modal/modal.js +0 -186
- package/components/pagination/bootstrap.d.ts +0 -8
- package/components/pagination/bootstrap.js +0 -110
- package/components/pagination/pagination.js +0 -149
- package/components/progressbar/progressbar.js +0 -78
- package/components/rating/rating.js +0 -138
- package/components/select/select.js +0 -266
- package/components/slider/slider.js +0 -415
- package/services/transitions/bootstrap/collapse.d.ts +0 -2
- package/services/transitions/bootstrap/collapse.js +0 -15
- package/services/transitions/bootstrap/fade.d.ts +0 -1
- package/services/transitions/bootstrap/fade.js +0 -7
- package/services/transitions/bootstrap.d.ts +0 -2
- package/services/transitions/bootstrap.js +0 -2
- package/utils/internal/checks.js +0 -60
- package/utils/internal/dom.js +0 -61
- package/utils/internal/func.js +0 -11
- package/utils/internal/isFocusable.js +0 -35
- package/utils/internal/math.js +0 -13
- package/utils/internal/promise.js +0 -169
- package/utils/internal/scrollbars.js +0 -33
- package/utils/internal/sort.js +0 -28
- package/utils/internal/textDirection.js +0 -7
- package/utils/internal/traversal.js +0 -105
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { computed } from
|
|
2
|
-
import { noop } from
|
|
3
|
-
import {
|
|
1
|
+
import { computed } from "@amadeus-it-group/tansu";
|
|
2
|
+
import { n as noop } from "../func-DR0n-ShK.js";
|
|
3
|
+
import { g as createBrowserStoreArrayDirective, k as mergeDirectives, d as directiveSubscribe } from "../directive-DCYlDznf.js";
|
|
4
4
|
const internalSetSiblingsInert = (element) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
recursiveHelper(parent);
|
|
5
|
+
const inertValues = /* @__PURE__ */ new Map();
|
|
6
|
+
const recursiveHelper = (element2) => {
|
|
7
|
+
const parent = element2.parentElement;
|
|
8
|
+
if (parent && element2 !== document.body) {
|
|
9
|
+
Array.from(parent.children).forEach((sibling) => {
|
|
10
|
+
if (sibling !== element2 && sibling.nodeName !== "SCRIPT") {
|
|
11
|
+
inertValues.set(sibling, sibling.hasAttribute("inert"));
|
|
12
|
+
sibling.toggleAttribute("inert", true);
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
});
|
|
15
|
+
recursiveHelper(parent);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
recursiveHelper(element);
|
|
19
|
+
return () => inertValues.forEach((value, element2) => {
|
|
20
|
+
element2.toggleAttribute("inert", value);
|
|
21
|
+
});
|
|
22
22
|
};
|
|
23
23
|
let internalRevert = noop;
|
|
24
24
|
const setSiblingsInert = (element) => {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
internalRevert();
|
|
26
|
+
internalRevert = element ? internalSetSiblingsInert(element) : noop;
|
|
27
27
|
};
|
|
28
|
-
const { directive: storeArrayDirective, elements$ } =
|
|
29
|
-
const lastElement$ = computed(
|
|
28
|
+
const { directive: storeArrayDirective, elements$ } = createBrowserStoreArrayDirective();
|
|
29
|
+
const lastElement$ = computed(
|
|
30
|
+
() => {
|
|
30
31
|
const elements = elements$();
|
|
31
32
|
return elements[elements.length - 1];
|
|
32
|
-
},
|
|
33
|
+
},
|
|
34
|
+
{ equal: Object.is }
|
|
35
|
+
);
|
|
33
36
|
const inertAction$ = computed(() => setSiblingsInert(lastElement$()));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* on which it is used, so when the last one disappears, the previous one in the list becomes the one in effect).
|
|
39
|
-
*/
|
|
40
|
-
export const sliblingsInert = mergeDirectives(storeArrayDirective, directiveSubscribe(inertAction$));
|
|
37
|
+
const sliblingsInert = mergeDirectives(storeArrayDirective, directiveSubscribe(inertAction$));
|
|
38
|
+
export {
|
|
39
|
+
sliblingsInert
|
|
40
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const tansu = require("@amadeus-it-group/tansu");
|
|
4
|
+
const utils_writables = require("../../writables-D46sFgGK.cjs");
|
|
5
|
+
const promise = require("../../promise-BMJ8qhA8.cjs");
|
|
6
|
+
const func = require("../../func-Qd3cD9a3.cjs");
|
|
7
|
+
const utils_stores = require("../../utils/stores.cjs");
|
|
8
|
+
const utils_directive = require("../../directive-BTSEYLF3.cjs");
|
|
9
|
+
const neverEndingPromise = new Promise(func.noop);
|
|
10
|
+
const noAnimation = async (element, direction) => {
|
|
11
|
+
element.style.display = direction === "show" ? "" : "none";
|
|
12
|
+
};
|
|
13
|
+
const defaultValues = {
|
|
14
|
+
animated: true,
|
|
15
|
+
animatedOnInit: false,
|
|
16
|
+
initDone: null,
|
|
17
|
+
visible: true,
|
|
18
|
+
transition: noAnimation,
|
|
19
|
+
onShown: func.noop,
|
|
20
|
+
onHidden: func.noop,
|
|
21
|
+
onVisibleChange: func.noop
|
|
22
|
+
};
|
|
23
|
+
const configValidator = {
|
|
24
|
+
animated: utils_writables.typeBoolean,
|
|
25
|
+
animatedOnInit: utils_writables.typeBoolean,
|
|
26
|
+
visible: utils_writables.typeBoolean,
|
|
27
|
+
transition: utils_writables.typeFunction,
|
|
28
|
+
onShown: utils_writables.typeFunction,
|
|
29
|
+
onHidden: utils_writables.typeFunction,
|
|
30
|
+
onVisibleChange: utils_writables.typeFunction,
|
|
31
|
+
initDone: utils_writables.typeBooleanOrNull
|
|
32
|
+
};
|
|
33
|
+
const createTransition = (config) => {
|
|
34
|
+
const [{ animated$, initDone$, visible$: requestedVisible$, transition$, onShown$, onHidden$, onVisibleChange$, animatedOnInit$ }, patch] = utils_stores.writablesForProps(defaultValues, config, configValidator);
|
|
35
|
+
const { element$, directive: storeDirective } = utils_directive.createStoreDirective();
|
|
36
|
+
const elementPresent$ = tansu.computed(() => !!element$());
|
|
37
|
+
const visible$ = utils_stores.bindableDerived(onVisibleChange$, [requestedVisible$], ([visible]) => visible);
|
|
38
|
+
const currentTransition$ = tansu.writable(
|
|
39
|
+
null
|
|
40
|
+
);
|
|
41
|
+
const transitioning$ = tansu.computed(() => !!currentTransition$());
|
|
42
|
+
const stop = () => {
|
|
43
|
+
let context;
|
|
44
|
+
currentTransition$.update((currentTransition) => {
|
|
45
|
+
currentTransition == null ? void 0 : currentTransition.abort.abort();
|
|
46
|
+
context = currentTransition == null ? void 0 : currentTransition.context;
|
|
47
|
+
return null;
|
|
48
|
+
});
|
|
49
|
+
return context;
|
|
50
|
+
};
|
|
51
|
+
const runTransition = (visible, animated, element, transitionFn) => tansu.batch(() => {
|
|
52
|
+
const abort = new AbortController();
|
|
53
|
+
const signal = abort.signal;
|
|
54
|
+
const context = stop() ?? {};
|
|
55
|
+
const { promise: promise$1, resolve } = promise.promiseWithResolve();
|
|
56
|
+
const currentTransition = {
|
|
57
|
+
abort,
|
|
58
|
+
animated,
|
|
59
|
+
visible,
|
|
60
|
+
context,
|
|
61
|
+
element,
|
|
62
|
+
transitionFn,
|
|
63
|
+
promise: promise$1
|
|
64
|
+
};
|
|
65
|
+
currentTransition$.set(currentTransition);
|
|
66
|
+
resolve(
|
|
67
|
+
(async () => {
|
|
68
|
+
var _a;
|
|
69
|
+
try {
|
|
70
|
+
await transitionFn(element, visible ? "show" : "hide", animated, signal, context);
|
|
71
|
+
} finally {
|
|
72
|
+
if (signal.aborted) {
|
|
73
|
+
await neverEndingPromise;
|
|
74
|
+
} else {
|
|
75
|
+
currentTransition$.set(null);
|
|
76
|
+
(_a = (visible ? onShown$ : onHidden$)()) == null ? void 0 : _a();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})()
|
|
80
|
+
);
|
|
81
|
+
return currentTransition;
|
|
82
|
+
});
|
|
83
|
+
const shown$ = tansu.computed(() => !transitioning$() && visible$() && elementPresent$());
|
|
84
|
+
const hidden$ = tansu.computed(() => !transitioning$() && !visible$());
|
|
85
|
+
const effectiveAnimation$ = tansu.computed(() => initDone$() ? animated$() : animatedOnInit$());
|
|
86
|
+
const animationFromToggle$ = tansu.writable(null);
|
|
87
|
+
let previousElement;
|
|
88
|
+
let previousVisible = requestedVisible$();
|
|
89
|
+
let pendingTransition = null;
|
|
90
|
+
const visibleAction$ = tansu.derived(
|
|
91
|
+
[visible$, element$, effectiveAnimation$, animationFromToggle$, transition$, currentTransition$],
|
|
92
|
+
([visible, element, animated, animationFromToggle, transition, currentTransition]) => {
|
|
93
|
+
const elementChanged = previousElement !== element;
|
|
94
|
+
previousElement = element;
|
|
95
|
+
const visibleChanged = previousVisible !== visible;
|
|
96
|
+
previousVisible = visible;
|
|
97
|
+
if (element) {
|
|
98
|
+
if (initDone$() == null) {
|
|
99
|
+
initDone$.set(true);
|
|
100
|
+
}
|
|
101
|
+
const interruptAnimation = animationFromToggle != null && currentTransition && currentTransition.animated != animationFromToggle;
|
|
102
|
+
if (elementChanged || visibleChanged || interruptAnimation) {
|
|
103
|
+
if (visibleChanged || animationFromToggle != null) {
|
|
104
|
+
pendingTransition = null;
|
|
105
|
+
}
|
|
106
|
+
const animate = animationFromToggle ?? (pendingTransition == null ? void 0 : pendingTransition.animated) ?? (elementChanged && !visible ? false : animated);
|
|
107
|
+
currentTransition = runTransition(visible, animate, element, transition);
|
|
108
|
+
pendingTransition == null ? void 0 : pendingTransition.resolve(currentTransition.promise);
|
|
109
|
+
pendingTransition = null;
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
if (elementChanged) {
|
|
113
|
+
stop();
|
|
114
|
+
currentTransition = null;
|
|
115
|
+
}
|
|
116
|
+
if (visibleChanged || visible && (pendingTransition == null ? void 0 : pendingTransition.animated) !== animationFromToggle) {
|
|
117
|
+
pendingTransition = visible && animationFromToggle != null ? {
|
|
118
|
+
// toggle was called to display the element, but the element is not yet in the DOM
|
|
119
|
+
// let's keep the animation setting from toggle and provide the promise for the end of toggle
|
|
120
|
+
animated: animationFromToggle,
|
|
121
|
+
...promise.promiseWithResolve()
|
|
122
|
+
} : null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return (pendingTransition == null ? void 0 : pendingTransition.promise) ?? (currentTransition == null ? void 0 : currentTransition.promise);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
let lastToggle = {};
|
|
129
|
+
const toggle = async (visible = !requestedVisible$(), animated = effectiveAnimation$()) => {
|
|
130
|
+
const currentToggle = {};
|
|
131
|
+
lastToggle = currentToggle;
|
|
132
|
+
try {
|
|
133
|
+
await tansu.batch(() => {
|
|
134
|
+
try {
|
|
135
|
+
animationFromToggle$.set(animated);
|
|
136
|
+
requestedVisible$.set(visible);
|
|
137
|
+
return visibleAction$();
|
|
138
|
+
} finally {
|
|
139
|
+
animationFromToggle$.set(null);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
} finally {
|
|
143
|
+
if (lastToggle !== currentToggle) {
|
|
144
|
+
await neverEndingPromise;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const directive = utils_directive.mergeDirectives(storeDirective, utils_directive.directiveUpdate(patch), utils_directive.directiveSubscribe(visibleAction$));
|
|
149
|
+
return {
|
|
150
|
+
...utils_stores.stateStores({
|
|
151
|
+
visible$,
|
|
152
|
+
element$,
|
|
153
|
+
elementPresent$,
|
|
154
|
+
transitioning$,
|
|
155
|
+
shown$,
|
|
156
|
+
hidden$
|
|
157
|
+
}),
|
|
158
|
+
patch,
|
|
159
|
+
directives: {
|
|
160
|
+
directive
|
|
161
|
+
},
|
|
162
|
+
actions: {},
|
|
163
|
+
api: {
|
|
164
|
+
show: toggle.bind(null, true),
|
|
165
|
+
hide: toggle.bind(null, false),
|
|
166
|
+
toggle
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
exports.createTransition = createTransition;
|
|
171
|
+
exports.noAnimation = noAnimation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
1
|
+
import type { Directive, PropsConfig, SSRHTMLElement, Widget } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Function that implements a transition.
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export type TransitionFn = (
|
|
|
6
6
|
/**
|
|
7
7
|
* Element on which the transition should be applied.
|
|
8
8
|
*/
|
|
9
|
-
element:
|
|
9
|
+
element: SSRHTMLElement,
|
|
10
10
|
/**
|
|
11
11
|
* Whether the element should be shown or hidden.
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@ direction: 'show' | 'hide',
|
|
|
14
14
|
/**
|
|
15
15
|
* Whether the transition should be animated.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
animated: boolean,
|
|
18
18
|
/**
|
|
19
19
|
* Signal allowing to stop the transition while running.
|
|
20
20
|
*/
|
|
@@ -35,17 +35,17 @@ export interface TransitionProps {
|
|
|
35
35
|
/**
|
|
36
36
|
* Whether the transition should be animated.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
animated: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* If the element is initially visible, whether the element should be animated when first displayed.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
animatedOnInit: boolean;
|
|
43
43
|
/**
|
|
44
|
-
* Whether initialization is finished. It determines which setting between {@link TransitionProps.
|
|
45
|
-
* and {@link TransitionProps.
|
|
44
|
+
* Whether initialization is finished. It determines which setting between {@link TransitionProps.animated}
|
|
45
|
+
* and {@link TransitionProps.animatedOnInit} is used to enable or disable animations.
|
|
46
46
|
* @remarks
|
|
47
|
-
* If it is `true`, initialization is considered finished, and {@link TransitionProps.
|
|
48
|
-
* Otherwise, initialization is considered unfinished and {@link TransitionProps.
|
|
47
|
+
* If it is `true`, initialization is considered finished, and {@link TransitionProps.animatedOnInit} is no longer used.
|
|
48
|
+
* Otherwise, initialization is considered unfinished and {@link TransitionProps.animatedOnInit} is used instead of {@link TransitionProps.animated}.
|
|
49
49
|
* If it is `null`, it will be set to `true` automatically when the directive is called with a DOM element.
|
|
50
50
|
* If it is `false`, it will not be updated automatically.
|
|
51
51
|
*/
|
|
@@ -98,31 +98,31 @@ export interface TransitionApi {
|
|
|
98
98
|
/**
|
|
99
99
|
* Runs the transition to show the element. It is equivalent to {@link TransitionApi.toggle | toggle} with true as the first parameter.
|
|
100
100
|
*
|
|
101
|
-
* @param
|
|
101
|
+
* @param animated - whether the transition should be animated. If the parameter is not defined, the {@link TransitionProps.animated | animated } property is used.
|
|
102
102
|
*
|
|
103
103
|
* @returns A promise that is fulfilled when the transition is completed. If the transition is canceled, or if the same transition was
|
|
104
104
|
* already running, the promise never completes.
|
|
105
105
|
*/
|
|
106
|
-
show: (
|
|
106
|
+
show: (animated?: boolean) => Promise<void>;
|
|
107
107
|
/**
|
|
108
108
|
* Runs the transition to hide the element. It is equivalent to {@link TransitionApi.toggle | toggle} with false as the first parameter.
|
|
109
109
|
*
|
|
110
|
-
* @param
|
|
110
|
+
* @param animated - whether the transition should be animated. If the parameter is not defined, the {@link TransitionProps.animated | animated } property is used.
|
|
111
111
|
*
|
|
112
112
|
* @returns A promise that is fulfilled when the transition is completed. If the transition is canceled, or if the same transition was
|
|
113
113
|
* already running, the promise never completes.
|
|
114
114
|
*/
|
|
115
|
-
hide: (
|
|
115
|
+
hide: (animated?: boolean) => Promise<void>;
|
|
116
116
|
/**
|
|
117
117
|
* Runs the transition to show or hide the element depending on the first parameter.
|
|
118
118
|
*
|
|
119
119
|
* @param visible - whether the element should be made visible or not. If the parameter is not defined, the opposite of the current {@link TransitionProps.visible | visible } property is used.
|
|
120
|
-
* @param
|
|
120
|
+
* @param animated - whether the transition should be animated. If the parameter is not defined, the {@link TransitionProps.animated | animated } property is used.
|
|
121
121
|
*
|
|
122
122
|
* @returns A promise that is fulfilled when the transition is completed. If the transition is canceled, or if the same transition was
|
|
123
123
|
* already running, the promise never completes.
|
|
124
124
|
*/
|
|
125
|
-
toggle: (visible?: boolean,
|
|
125
|
+
toggle: (visible?: boolean, animated?: boolean) => Promise<void>;
|
|
126
126
|
}
|
|
127
127
|
export interface TransitionDirectives {
|
|
128
128
|
/**
|
|
@@ -132,7 +132,7 @@ export interface TransitionDirectives {
|
|
|
132
132
|
}
|
|
133
133
|
export type TransitionWidget = Widget<TransitionProps, TransitionState, TransitionApi, object, TransitionDirectives>;
|
|
134
134
|
/**
|
|
135
|
-
* A transition to show / hide an element without any
|
|
135
|
+
* A transition to show / hide an element without any animated. It uses the HTML `display` attribute.
|
|
136
136
|
*
|
|
137
137
|
* @param element - the element to animate
|
|
138
138
|
* @param direction - the direction
|