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