@v-c/trigger 0.0.13 → 0.0.14
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/Arrow.cjs +60 -89
- package/dist/Popup/Arrow.js +58 -88
- package/dist/Popup/Mask.cjs +53 -64
- package/dist/Popup/Mask.js +49 -63
- package/dist/Popup/PopupContent.cjs +22 -27
- package/dist/Popup/PopupContent.js +18 -26
- package/dist/Popup/index.cjs +312 -366
- package/dist/Popup/index.js +304 -362
- package/dist/UniqueProvider/UniqueContainer.cjs +133 -150
- package/dist/UniqueProvider/UniqueContainer.js +128 -148
- package/dist/UniqueProvider/index.cjs +151 -216
- package/dist/UniqueProvider/index.js +144 -213
- package/dist/UniqueProvider/useTargetState.cjs +39 -39
- package/dist/UniqueProvider/useTargetState.js +37 -39
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context.cjs +17 -28
- package/dist/context.js +17 -33
- package/dist/hooks/useAction.cjs +19 -25
- package/dist/hooks/useAction.js +17 -25
- package/dist/hooks/useAlign.cjs +388 -592
- package/dist/hooks/useAlign.js +383 -590
- package/dist/hooks/useDelay.cjs +21 -24
- package/dist/hooks/useDelay.js +20 -25
- package/dist/hooks/useOffsetStyle.cjs +34 -37
- package/dist/hooks/useOffsetStyle.js +32 -37
- package/dist/hooks/useWatch.cjs +38 -34
- package/dist/hooks/useWatch.js +36 -34
- package/dist/hooks/useWinClick.cjs +54 -64
- package/dist/hooks/useWinClick.js +51 -63
- package/dist/index.cjs +605 -694
- package/dist/index.js +593 -689
- package/dist/interface.cjs +0 -1
- package/dist/interface.js +0 -1
- package/dist/util.cjs +65 -82
- package/dist/util.js +66 -87
- package/package.json +2 -2
|
@@ -1,216 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { classNames } from "@v-c/util";
|
|
4
|
-
import { isDOM } from "@v-c/util/dist/Dom/findDOMNode";
|
|
5
|
-
import { useTriggerContext, UniqueContextProvider, TriggerContextProvider } from "../context.js";
|
|
1
|
+
import { TriggerContextProvider, UniqueContextProvider, useTriggerContext } from "../context.js";
|
|
2
|
+
import { getAlignPopupClassName } from "../util.js";
|
|
6
3
|
import useAlign from "../hooks/useAlign.js";
|
|
7
4
|
import useDelay from "../hooks/useDelay.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import UniqueContainer from "./UniqueContainer.js";
|
|
5
|
+
import Popup_default from "../Popup/index.js";
|
|
6
|
+
import UniqueContainer_default from "./UniqueContainer.js";
|
|
11
7
|
import useTargetState from "./useTargetState.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"open": open.value,
|
|
153
|
-
"keepDom": true,
|
|
154
|
-
"fresh": true,
|
|
155
|
-
"autoDestroy": false,
|
|
156
|
-
"onVisibleChanged": onVisibleChanged,
|
|
157
|
-
"ready": ready.value,
|
|
158
|
-
"offsetX": offsetX.value,
|
|
159
|
-
"offsetY": offsetY.value,
|
|
160
|
-
"offsetR": offsetR.value,
|
|
161
|
-
"offsetB": offsetB.value,
|
|
162
|
-
"onAlign": onAlign,
|
|
163
|
-
"onPrepare": onPrepare,
|
|
164
|
-
"onResize": (size) => {
|
|
165
|
-
popupSize.value = {
|
|
166
|
-
width: size.offsetWidth,
|
|
167
|
-
height: size.offsetHeight
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
"arrowPos": {
|
|
171
|
-
x: arrowX.value,
|
|
172
|
-
y: arrowY.value
|
|
173
|
-
},
|
|
174
|
-
"align": alignInfo.value,
|
|
175
|
-
"zIndex": mergedOptions.value?.zIndex,
|
|
176
|
-
"mask": mergedOptions.value?.mask,
|
|
177
|
-
"arrow": mergedOptions.value?.arrow,
|
|
178
|
-
"motion": mergedOptions.value?.popupMotion,
|
|
179
|
-
"maskMotion": mergedOptions.value?.maskMotion,
|
|
180
|
-
"getPopupContainer": mergedOptions.value.getPopupContainer
|
|
181
|
-
}, {
|
|
182
|
-
default: () => [createVNode(UniqueContainer, {
|
|
183
|
-
"prefixCls": prefixCls,
|
|
184
|
-
"isMobile": false,
|
|
185
|
-
"ready": ready.value,
|
|
186
|
-
"open": open.value,
|
|
187
|
-
"align": alignInfo.value,
|
|
188
|
-
"offsetX": offsetX.value,
|
|
189
|
-
"offsetY": offsetY.value,
|
|
190
|
-
"offsetR": offsetR.value,
|
|
191
|
-
"offsetB": offsetB.value,
|
|
192
|
-
"arrowPos": {
|
|
193
|
-
x: arrowX.value,
|
|
194
|
-
y: arrowY.value
|
|
195
|
-
},
|
|
196
|
-
"popupSize": popupSize.value,
|
|
197
|
-
"motion": mergedOptions.value?.popupMotion,
|
|
198
|
-
"uniqueContainerClassName": classNames(mergedOptions.value?.uniqueContainerClassName, alignedClassName.value),
|
|
199
|
-
"uniqueContainerStyle": mergedOptions?.value?.uniqueContainerStyle
|
|
200
|
-
}, null)]
|
|
201
|
-
})]
|
|
202
|
-
})]
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
}, {
|
|
206
|
-
props: {
|
|
207
|
-
postTriggerProps: {
|
|
208
|
-
type: Function,
|
|
209
|
-
required: false,
|
|
210
|
-
default: void 0
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
export {
|
|
215
|
-
UniqueProvider as default
|
|
216
|
-
};
|
|
8
|
+
import { computed, createVNode, defineComponent, ref, shallowRef, watch } from "vue";
|
|
9
|
+
import Portal from "@v-c/portal";
|
|
10
|
+
import { classNames } from "@v-c/util";
|
|
11
|
+
import { isDOM } from "@v-c/util/dist/Dom/findDOMNode";
|
|
12
|
+
var UniqueProvider_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
13
|
+
const [trigger, open, options, onTargetVisibleChanged] = useTargetState();
|
|
14
|
+
const mergedOptions = computed(() => {
|
|
15
|
+
if (!options.value || !props.postTriggerProps) return options.value;
|
|
16
|
+
return props.postTriggerProps(options.value);
|
|
17
|
+
});
|
|
18
|
+
const popupEle = shallowRef(null);
|
|
19
|
+
const popupSize = ref(null);
|
|
20
|
+
const externalPopupRef = shallowRef(null);
|
|
21
|
+
const resolveToElement = (node) => {
|
|
22
|
+
if (!node) return null;
|
|
23
|
+
if (isDOM(node)) return node;
|
|
24
|
+
const exposed = node;
|
|
25
|
+
if (isDOM(exposed?.$el)) return exposed.$el;
|
|
26
|
+
const nativeEl = exposed?.nativeElement;
|
|
27
|
+
if (isDOM(nativeEl?.value)) return nativeEl.value;
|
|
28
|
+
if (isDOM(nativeEl)) return nativeEl;
|
|
29
|
+
if (typeof exposed?.getElement === "function") {
|
|
30
|
+
const el = exposed.getElement();
|
|
31
|
+
if (isDOM(el)) return el;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
const setPopupRef = (node) => {
|
|
36
|
+
const element = resolveToElement(node);
|
|
37
|
+
if (!element) return;
|
|
38
|
+
externalPopupRef.value = element;
|
|
39
|
+
if (popupEle.value !== element) popupEle.value = element;
|
|
40
|
+
};
|
|
41
|
+
const isOpenRef = shallowRef();
|
|
42
|
+
const delayInvoke = useDelay();
|
|
43
|
+
const show = (showOptions, isOpen) => {
|
|
44
|
+
isOpenRef.value = isOpen;
|
|
45
|
+
delayInvoke(() => {
|
|
46
|
+
trigger(showOptions);
|
|
47
|
+
}, showOptions.delay);
|
|
48
|
+
};
|
|
49
|
+
const hide = (delay) => {
|
|
50
|
+
delayInvoke(() => {
|
|
51
|
+
if (isOpenRef.value?.()) return;
|
|
52
|
+
trigger(false);
|
|
53
|
+
}, delay);
|
|
54
|
+
};
|
|
55
|
+
const onVisibleChanged = (visible) => {
|
|
56
|
+
onTargetVisibleChanged(visible);
|
|
57
|
+
};
|
|
58
|
+
const [ready, offsetX, offsetY, offsetR, offsetB, arrowX, arrowY, , , alignInfo, onAlign] = useAlign(open, popupEle, computed(() => mergedOptions.value?.target), computed(() => mergedOptions.value?.popupPlacement), computed(() => mergedOptions.value?.builtinPlacements || {}), computed(() => mergedOptions.value?.popupAlign), void 0, ref(false));
|
|
59
|
+
const alignedClassName = computed(() => {
|
|
60
|
+
if (!mergedOptions.value) return "";
|
|
61
|
+
return classNames(getAlignPopupClassName(mergedOptions.value?.builtinPlacements || {}, mergedOptions.value.prefixCls || "", alignInfo.value, false), mergedOptions.value?.getPopupClassNameFromAlign?.(alignInfo.value));
|
|
62
|
+
});
|
|
63
|
+
const contextValue = {
|
|
64
|
+
show,
|
|
65
|
+
hide
|
|
66
|
+
};
|
|
67
|
+
watch(() => mergedOptions.value?.target, () => {
|
|
68
|
+
onAlign();
|
|
69
|
+
}, { immediate: true });
|
|
70
|
+
const onPrepare = () => {
|
|
71
|
+
onAlign();
|
|
72
|
+
return Promise.resolve();
|
|
73
|
+
};
|
|
74
|
+
const subPopupElements = ref({});
|
|
75
|
+
const parentContext = useTriggerContext();
|
|
76
|
+
const triggerContextValue = computed(() => {
|
|
77
|
+
return { registerSubPopup: (id, subPopupEle) => {
|
|
78
|
+
if (subPopupEle) subPopupElements.value[id] = subPopupEle;
|
|
79
|
+
else delete subPopupElements.value[id];
|
|
80
|
+
parentContext?.value?.registerSubPopup(id, subPopupEle);
|
|
81
|
+
} };
|
|
82
|
+
});
|
|
83
|
+
return () => {
|
|
84
|
+
const prefixCls = mergedOptions?.value?.prefixCls;
|
|
85
|
+
return createVNode(UniqueContextProvider, contextValue, { default: () => [slots?.default?.(), !!mergedOptions.value && createVNode(TriggerContextProvider, triggerContextValue.value, { default: () => [createVNode(Popup_default, {
|
|
86
|
+
"ref": setPopupRef,
|
|
87
|
+
"portal": Portal,
|
|
88
|
+
"prefixCls": prefixCls,
|
|
89
|
+
"popup": mergedOptions.value?.popup,
|
|
90
|
+
"className": classNames(mergedOptions.value?.popupClassName, alignedClassName.value, `${prefixCls}-unique-controlled`),
|
|
91
|
+
"style": mergedOptions.value?.popupStyle,
|
|
92
|
+
"target": mergedOptions.value?.target,
|
|
93
|
+
"open": open.value,
|
|
94
|
+
"keepDom": true,
|
|
95
|
+
"fresh": true,
|
|
96
|
+
"autoDestroy": false,
|
|
97
|
+
"onVisibleChanged": onVisibleChanged,
|
|
98
|
+
"ready": ready.value,
|
|
99
|
+
"offsetX": offsetX.value,
|
|
100
|
+
"offsetY": offsetY.value,
|
|
101
|
+
"offsetR": offsetR.value,
|
|
102
|
+
"offsetB": offsetB.value,
|
|
103
|
+
"onAlign": onAlign,
|
|
104
|
+
"onPrepare": onPrepare,
|
|
105
|
+
"onResize": (size) => {
|
|
106
|
+
popupSize.value = {
|
|
107
|
+
width: size.offsetWidth,
|
|
108
|
+
height: size.offsetHeight
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
"arrowPos": {
|
|
112
|
+
x: arrowX.value,
|
|
113
|
+
y: arrowY.value
|
|
114
|
+
},
|
|
115
|
+
"align": alignInfo.value,
|
|
116
|
+
"zIndex": mergedOptions.value?.zIndex,
|
|
117
|
+
"mask": mergedOptions.value?.mask,
|
|
118
|
+
"arrow": mergedOptions.value?.arrow,
|
|
119
|
+
"motion": mergedOptions.value?.popupMotion,
|
|
120
|
+
"maskMotion": mergedOptions.value?.maskMotion,
|
|
121
|
+
"getPopupContainer": mergedOptions.value.getPopupContainer
|
|
122
|
+
}, { default: () => [createVNode(UniqueContainer_default, {
|
|
123
|
+
"prefixCls": prefixCls,
|
|
124
|
+
"isMobile": false,
|
|
125
|
+
"ready": ready.value,
|
|
126
|
+
"open": open.value,
|
|
127
|
+
"align": alignInfo.value,
|
|
128
|
+
"offsetX": offsetX.value,
|
|
129
|
+
"offsetY": offsetY.value,
|
|
130
|
+
"offsetR": offsetR.value,
|
|
131
|
+
"offsetB": offsetB.value,
|
|
132
|
+
"arrowPos": {
|
|
133
|
+
x: arrowX.value,
|
|
134
|
+
y: arrowY.value
|
|
135
|
+
},
|
|
136
|
+
"popupSize": popupSize.value,
|
|
137
|
+
"motion": mergedOptions.value?.popupMotion,
|
|
138
|
+
"uniqueContainerClassName": classNames(mergedOptions.value?.uniqueContainerClassName, alignedClassName.value),
|
|
139
|
+
"uniqueContainerStyle": mergedOptions?.value?.uniqueContainerStyle
|
|
140
|
+
}, null)] })] })] });
|
|
141
|
+
};
|
|
142
|
+
}, { props: { postTriggerProps: {
|
|
143
|
+
type: Function,
|
|
144
|
+
required: false,
|
|
145
|
+
default: void 0
|
|
146
|
+
} } });
|
|
147
|
+
export { UniqueProvider_default as default };
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
4
|
function useTargetState() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
5
|
+
const options = (0, vue.ref)();
|
|
6
|
+
const open = (0, vue.ref)(false);
|
|
7
|
+
const isAnimating = (0, vue.ref)(false);
|
|
8
|
+
const pendingOptionsRef = (0, vue.ref)();
|
|
9
|
+
const trigger = (nextOptions) => {
|
|
10
|
+
const wasOpen = open.value;
|
|
11
|
+
if (nextOptions === false) {
|
|
12
|
+
pendingOptionsRef.value = null;
|
|
13
|
+
open.value = false;
|
|
14
|
+
isAnimating.value = false;
|
|
15
|
+
} else if (isAnimating.value && wasOpen) pendingOptionsRef.value = nextOptions;
|
|
16
|
+
else {
|
|
17
|
+
open.value = true;
|
|
18
|
+
options.value = nextOptions;
|
|
19
|
+
pendingOptionsRef.value = null;
|
|
20
|
+
if (!wasOpen) isAnimating.value = true;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const onVisibleChanged = (visible) => {
|
|
24
|
+
if (visible) {
|
|
25
|
+
isAnimating.value = false;
|
|
26
|
+
if (pendingOptionsRef.value) {
|
|
27
|
+
options.value = pendingOptionsRef.value;
|
|
28
|
+
pendingOptionsRef.value = null;
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
isAnimating.value = false;
|
|
32
|
+
pendingOptionsRef.value = null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return [
|
|
36
|
+
trigger,
|
|
37
|
+
open,
|
|
38
|
+
options,
|
|
39
|
+
onVisibleChanged
|
|
40
|
+
];
|
|
41
41
|
}
|
|
42
42
|
exports.default = useTargetState;
|
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
function useTargetState() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
const options = ref();
|
|
4
|
+
const open = ref(false);
|
|
5
|
+
const isAnimating = ref(false);
|
|
6
|
+
const pendingOptionsRef = ref();
|
|
7
|
+
const trigger = (nextOptions) => {
|
|
8
|
+
const wasOpen = open.value;
|
|
9
|
+
if (nextOptions === false) {
|
|
10
|
+
pendingOptionsRef.value = null;
|
|
11
|
+
open.value = false;
|
|
12
|
+
isAnimating.value = false;
|
|
13
|
+
} else if (isAnimating.value && wasOpen) pendingOptionsRef.value = nextOptions;
|
|
14
|
+
else {
|
|
15
|
+
open.value = true;
|
|
16
|
+
options.value = nextOptions;
|
|
17
|
+
pendingOptionsRef.value = null;
|
|
18
|
+
if (!wasOpen) isAnimating.value = true;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const onVisibleChanged = (visible) => {
|
|
22
|
+
if (visible) {
|
|
23
|
+
isAnimating.value = false;
|
|
24
|
+
if (pendingOptionsRef.value) {
|
|
25
|
+
options.value = pendingOptionsRef.value;
|
|
26
|
+
pendingOptionsRef.value = null;
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
isAnimating.value = false;
|
|
30
|
+
pendingOptionsRef.value = null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return [
|
|
34
|
+
trigger,
|
|
35
|
+
open,
|
|
36
|
+
options,
|
|
37
|
+
onVisibleChanged
|
|
38
|
+
];
|
|
39
39
|
}
|
|
40
|
-
export {
|
|
41
|
-
useTargetState as default
|
|
42
|
-
};
|
|
40
|
+
export { useTargetState as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
9
|
+
key = keys[i];
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: ((k) => from[k]).bind(null, key),
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
value: mod,
|
|
19
|
+
enumerable: true
|
|
20
|
+
}) : target, mod));
|
|
21
|
+
exports.__toESM = __toESM;
|
package/dist/context.cjs
CHANGED
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const TriggerContextKey = Symbol("TriggerContextKey");
|
|
1
|
+
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
var TriggerContextKey = Symbol("TriggerContextKey");
|
|
5
4
|
function useTriggerContext() {
|
|
6
|
-
|
|
5
|
+
return (0, vue.inject)(TriggerContextKey, void 0);
|
|
7
6
|
}
|
|
8
|
-
const TriggerContextProvider = vue.defineComponent(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
props: ["registerSubPopup"]
|
|
17
|
-
}
|
|
18
|
-
);
|
|
7
|
+
const TriggerContextProvider = (0, vue.defineComponent)((props, { slots }) => {
|
|
8
|
+
(0, vue.provide)(TriggerContextKey, (0, vue.computed)(() => props));
|
|
9
|
+
return () => {
|
|
10
|
+
return slots?.default?.();
|
|
11
|
+
};
|
|
12
|
+
}, { props: ["registerSubPopup"] });
|
|
19
13
|
const UniqueContextKey = Symbol("UniqueContextKey");
|
|
20
14
|
function useUniqueContext() {
|
|
21
|
-
|
|
15
|
+
return (0, vue.inject)(UniqueContextKey, void 0);
|
|
22
16
|
}
|
|
23
|
-
const UniqueContextProvider = vue.defineComponent(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
props: ["show", "hide"]
|
|
32
|
-
}
|
|
33
|
-
);
|
|
17
|
+
const UniqueContextProvider = (0, vue.defineComponent)((props, { slots }) => {
|
|
18
|
+
(0, vue.provide)(UniqueContextKey, props);
|
|
19
|
+
return () => {
|
|
20
|
+
return slots?.default?.();
|
|
21
|
+
};
|
|
22
|
+
}, { props: ["show", "hide"] });
|
|
34
23
|
exports.TriggerContextProvider = TriggerContextProvider;
|
|
35
24
|
exports.UniqueContextKey = UniqueContextKey;
|
|
36
25
|
exports.UniqueContextProvider = UniqueContextProvider;
|