@v-c/trigger 1.0.10 → 1.0.12-beta.1
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/index.js +7 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { useResizeObserver } from "@v-c/resize-observer";
|
|
|
13
13
|
import { classNames } from "@v-c/util";
|
|
14
14
|
import { getShadowRoot } from "@v-c/util/dist/Dom/shadow";
|
|
15
15
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
16
|
-
import { resolveToElement } from "@v-c/util/dist/vnode";
|
|
16
|
+
import { cloneElement, resolveToElement } from "@v-c/util/dist/vnode";
|
|
17
17
|
var defaults = {
|
|
18
18
|
prefixCls: "vc-trigger-popup",
|
|
19
19
|
action: "hover",
|
|
@@ -117,6 +117,9 @@ function generateTrigger(PortalComponent = Portal) {
|
|
|
117
117
|
} else uniqueContext?.hide(props.mouseLeaveDelay || 0);
|
|
118
118
|
});
|
|
119
119
|
const openRef = shallowRef(mergedOpen.value);
|
|
120
|
+
watch(mergedOpen, () => {
|
|
121
|
+
openRef.value = mergedOpen.value;
|
|
122
|
+
});
|
|
120
123
|
const internalTriggerOpen = (nextOpen) => {
|
|
121
124
|
if (mergedOpen.value !== nextOpen) {
|
|
122
125
|
internalOpen.value = nextOpen;
|
|
@@ -323,13 +326,13 @@ function generateTrigger(PortalComponent = Portal) {
|
|
|
323
326
|
x: arrowX.value,
|
|
324
327
|
y: arrowY.value
|
|
325
328
|
};
|
|
326
|
-
const triggerNode =
|
|
329
|
+
const triggerNode = cloneElement(child, {
|
|
327
330
|
...mergedChildrenProps,
|
|
328
331
|
...passedProps,
|
|
329
332
|
ref: setTargetRef
|
|
330
|
-
});
|
|
333
|
+
}, true, true);
|
|
331
334
|
const { unique, prefixCls, popup, popupClassName, popupStyle, zIndex, fresh, onPopupClick, mask, popupMotion, maskMotion, forceRender, getPopupContainer, stretch, mobile } = props;
|
|
332
|
-
return createVNode(Fragment, null, [triggerNode, rendedRef.value &&
|
|
335
|
+
return createVNode(Fragment, null, [triggerNode, rendedRef.value && (!uniqueContext || !unique) && createVNode(TriggerContextProvider, context.value, { default: () => [createVNode(Popup_default, {
|
|
333
336
|
"portal": PortalComponent,
|
|
334
337
|
"ref": setPopupRef,
|
|
335
338
|
"prefixCls": prefixCls,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/trigger",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12-beta.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@v-c/portal": "^1.0.7",
|
|
33
33
|
"@v-c/resize-observer": "^1.0.8",
|
|
34
|
-
"@v-c/util": "^1.0.
|
|
34
|
+
"@v-c/util": "^1.0.17"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|