@v-c/trigger 0.0.11 → 0.0.12
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/dist/Popup/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ const defaults = {
|
|
|
14
14
|
};
|
|
15
15
|
const Popup = /* @__PURE__ */ vue.defineComponent((props, {
|
|
16
16
|
attrs,
|
|
17
|
+
slots,
|
|
17
18
|
expose
|
|
18
19
|
}) => {
|
|
19
20
|
const popupContent = vue.computed(() => typeof props.popup === "function" ? props.popup() : props.popup);
|
|
@@ -169,7 +170,7 @@ const Popup = /* @__PURE__ */ vue.defineComponent((props, {
|
|
|
169
170
|
default: () => [popupContent.value]
|
|
170
171
|
})]), [[vue.vShow, open.value]])]
|
|
171
172
|
})]
|
|
172
|
-
})]
|
|
173
|
+
}), slots?.default?.()]
|
|
173
174
|
});
|
|
174
175
|
};
|
|
175
176
|
}, {
|
package/dist/Popup/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const defaults = {
|
|
|
12
12
|
};
|
|
13
13
|
const Popup = /* @__PURE__ */ defineComponent((props, {
|
|
14
14
|
attrs,
|
|
15
|
+
slots,
|
|
15
16
|
expose
|
|
16
17
|
}) => {
|
|
17
18
|
const popupContent = computed(() => typeof props.popup === "function" ? props.popup() : props.popup);
|
|
@@ -167,7 +168,7 @@ const Popup = /* @__PURE__ */ defineComponent((props, {
|
|
|
167
168
|
default: () => [popupContent.value]
|
|
168
169
|
})]), [[vShow, open.value]])]
|
|
169
170
|
})]
|
|
170
|
-
})]
|
|
171
|
+
}), slots?.default?.()]
|
|
171
172
|
});
|
|
172
173
|
};
|
|
173
174
|
}, {
|
|
@@ -23,12 +23,11 @@ const UniqueContainer = /* @__PURE__ */ vue.defineComponent((props) => {
|
|
|
23
23
|
cachedOffsetStyleRef.value = offsetStyle.value;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
vue.watch(open, (nextVisible) => {
|
|
26
|
+
vue.watch(open, async (nextVisible) => {
|
|
27
|
+
await vue.nextTick();
|
|
27
28
|
if (nextVisible) {
|
|
28
29
|
motionVisible.value = true;
|
|
29
30
|
}
|
|
30
|
-
}, {
|
|
31
|
-
immediate: true
|
|
32
31
|
});
|
|
33
32
|
return () => {
|
|
34
33
|
const {
|
|
@@ -47,18 +46,10 @@ const UniqueContainer = /* @__PURE__ */ vue.defineComponent((props) => {
|
|
|
47
46
|
const baseTransitionProps = transition.getTransitionProps(motion?.name, motion);
|
|
48
47
|
const mergedTransitionProps = {
|
|
49
48
|
...baseTransitionProps,
|
|
50
|
-
onBeforeAppear: (element) => {
|
|
51
|
-
motionVisible.value = true;
|
|
52
|
-
baseTransitionProps.onBeforeAppear?.(element);
|
|
53
|
-
},
|
|
54
49
|
onBeforeEnter: (element) => {
|
|
55
50
|
motionVisible.value = true;
|
|
56
51
|
baseTransitionProps.onBeforeEnter?.(element);
|
|
57
52
|
},
|
|
58
|
-
onAfterAppear: (element) => {
|
|
59
|
-
motionVisible.value = true;
|
|
60
|
-
baseTransitionProps.onAfterAppear?.(element);
|
|
61
|
-
},
|
|
62
53
|
onAfterEnter: (element) => {
|
|
63
54
|
motionVisible.value = true;
|
|
64
55
|
baseTransitionProps.onAfterEnter?.(element);
|
|
@@ -72,8 +63,8 @@ const UniqueContainer = /* @__PURE__ */ vue.defineComponent((props) => {
|
|
|
72
63
|
return vue.createVNode(vue.Transition, mergedTransitionProps, {
|
|
73
64
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
74
65
|
"class": [containerCls, uniqueContainerClassName, {
|
|
75
|
-
[`${containerCls}-visible`]: motionVisible.value
|
|
76
|
-
[`${containerCls}-hidden`]: !motionVisible.value
|
|
66
|
+
[`${containerCls}-visible`]: motionVisible.value
|
|
67
|
+
// [`${containerCls}-hidden`]: !motionVisible.value,
|
|
77
68
|
}],
|
|
78
69
|
"style": [{
|
|
79
70
|
"--arrow-x": `${arrowPos?.x || 0}px`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, shallowRef, watchEffect, watch, createVNode, Transition, withDirectives, vShow } from "vue";
|
|
1
|
+
import { defineComponent, shallowRef, watchEffect, watch, nextTick, createVNode, Transition, withDirectives, vShow } from "vue";
|
|
2
2
|
import { toPropsRefs } from "@v-c/util/dist/props-util";
|
|
3
3
|
import { getTransitionProps } from "@v-c/util/dist/utils/transition";
|
|
4
4
|
import useOffsetStyle from "../hooks/useOffsetStyle.js";
|
|
@@ -21,12 +21,11 @@ const UniqueContainer = /* @__PURE__ */ defineComponent((props) => {
|
|
|
21
21
|
cachedOffsetStyleRef.value = offsetStyle.value;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
watch(open, (nextVisible) => {
|
|
24
|
+
watch(open, async (nextVisible) => {
|
|
25
|
+
await nextTick();
|
|
25
26
|
if (nextVisible) {
|
|
26
27
|
motionVisible.value = true;
|
|
27
28
|
}
|
|
28
|
-
}, {
|
|
29
|
-
immediate: true
|
|
30
29
|
});
|
|
31
30
|
return () => {
|
|
32
31
|
const {
|
|
@@ -45,18 +44,10 @@ const UniqueContainer = /* @__PURE__ */ defineComponent((props) => {
|
|
|
45
44
|
const baseTransitionProps = getTransitionProps(motion?.name, motion);
|
|
46
45
|
const mergedTransitionProps = {
|
|
47
46
|
...baseTransitionProps,
|
|
48
|
-
onBeforeAppear: (element) => {
|
|
49
|
-
motionVisible.value = true;
|
|
50
|
-
baseTransitionProps.onBeforeAppear?.(element);
|
|
51
|
-
},
|
|
52
47
|
onBeforeEnter: (element) => {
|
|
53
48
|
motionVisible.value = true;
|
|
54
49
|
baseTransitionProps.onBeforeEnter?.(element);
|
|
55
50
|
},
|
|
56
|
-
onAfterAppear: (element) => {
|
|
57
|
-
motionVisible.value = true;
|
|
58
|
-
baseTransitionProps.onAfterAppear?.(element);
|
|
59
|
-
},
|
|
60
51
|
onAfterEnter: (element) => {
|
|
61
52
|
motionVisible.value = true;
|
|
62
53
|
baseTransitionProps.onAfterEnter?.(element);
|
|
@@ -70,8 +61,8 @@ const UniqueContainer = /* @__PURE__ */ defineComponent((props) => {
|
|
|
70
61
|
return createVNode(Transition, mergedTransitionProps, {
|
|
71
62
|
default: () => [withDirectives(createVNode("div", {
|
|
72
63
|
"class": [containerCls, uniqueContainerClassName, {
|
|
73
|
-
[`${containerCls}-visible`]: motionVisible.value
|
|
74
|
-
[`${containerCls}-hidden`]: !motionVisible.value
|
|
64
|
+
[`${containerCls}-visible`]: motionVisible.value
|
|
65
|
+
// [`${containerCls}-hidden`]: !motionVisible.value,
|
|
75
66
|
}],
|
|
76
67
|
"style": [{
|
|
77
68
|
"--arrow-x": `${arrowPos?.x || 0}px`,
|
|
@@ -84,9 +84,9 @@ const UniqueProvider = /* @__PURE__ */ vue.defineComponent((props, {
|
|
|
84
84
|
offsetB,
|
|
85
85
|
arrowX,
|
|
86
86
|
arrowY,
|
|
87
|
-
// scaleX - not used in UniqueProvider
|
|
88
87
|
,
|
|
89
88
|
,
|
|
89
|
+
// scaleX - not used in UniqueProvider
|
|
90
90
|
// scaleY - not used in UniqueProvider
|
|
91
91
|
alignInfo,
|
|
92
92
|
onAlign
|
|
@@ -82,9 +82,9 @@ const UniqueProvider = /* @__PURE__ */ defineComponent((props, {
|
|
|
82
82
|
offsetB,
|
|
83
83
|
arrowX,
|
|
84
84
|
arrowY,
|
|
85
|
-
// scaleX - not used in UniqueProvider
|
|
86
85
|
,
|
|
87
86
|
,
|
|
87
|
+
// scaleX - not used in UniqueProvider
|
|
88
88
|
// scaleY - not used in UniqueProvider
|
|
89
89
|
alignInfo,
|
|
90
90
|
onAlign
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/trigger",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/portal": "0.0.
|
|
33
|
-
"@v-c/
|
|
34
|
-
"@v-c/
|
|
32
|
+
"@v-c/portal": "0.0.4",
|
|
33
|
+
"@v-c/util": "0.0.13",
|
|
34
|
+
"@v-c/resize-observer": "0.0.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|