@mantine-vue/hooks 3.0.0 → 3.1.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/cjs/index.cjs +5 -3
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +5 -3
- package/esm/index.mjs.map +1 -1
- package/lib/use-collapse/use-collapse.d.ts +2 -2
- package/package.json +1 -1
package/cjs/index.cjs
CHANGED
|
@@ -3042,6 +3042,8 @@ function getCssSize(size) {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
function createCollapse({ dimension, getElementSize, expanded, transitionDuration, transitionTimingFunction = "ease", onTransitionEnd, onTransitionStart, keepMounted }) {
|
|
3044
3044
|
const isExpanded = () => (0, vue.toValue)(expanded);
|
|
3045
|
+
const getTransitionDuration = () => (0, vue.toValue)(transitionDuration);
|
|
3046
|
+
const getTransitionTimingFunction = () => (0, vue.toValue)(transitionTimingFunction) ?? "ease";
|
|
3045
3047
|
const collapsedStyles = {
|
|
3046
3048
|
[dimension]: 0,
|
|
3047
3049
|
overflow: "hidden",
|
|
@@ -3070,12 +3072,12 @@ function createCollapse({ dimension, getElementSize, expanded, transitionDuratio
|
|
|
3070
3072
|
});
|
|
3071
3073
|
};
|
|
3072
3074
|
const getTransitionStyles = (size) => {
|
|
3073
|
-
const duration =
|
|
3074
|
-
return { transition: `${dimension} ${duration}ms ${
|
|
3075
|
+
const duration = getTransitionDuration() ?? getAutoSizeDuration(size);
|
|
3076
|
+
return { transition: `${dimension} ${duration}ms ${getTransitionTimingFunction()}, opacity ${duration}ms ${getTransitionTimingFunction()}` };
|
|
3075
3077
|
};
|
|
3076
3078
|
(0, vue.watch)(() => isExpanded(), (value, oldValue) => {
|
|
3077
3079
|
if (value === oldValue) return;
|
|
3078
|
-
if (
|
|
3080
|
+
if (getTransitionDuration() !== 0) onTransitionStart?.();
|
|
3079
3081
|
if (value) raf(() => {
|
|
3080
3082
|
state.value = "entering";
|
|
3081
3083
|
mergeStyles({
|