@v-c/dialog 0.0.1 → 0.0.3
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/Dialog/Content/Panel.cjs +20 -12
- package/dist/Dialog/Content/Panel.js +9 -4
- package/dist/Dialog/Content/index.cjs +6 -3
- package/dist/Dialog/Mask.cjs +8 -5
- package/dist/Dialog/index.cjs +20 -16
- package/dist/Dialog/index.js +2 -1
- package/dist/DialogWrap.cjs +11 -11
- package/dist/DialogWrap.js +4 -7
- package/dist/IDialogPropTypes.cjs +1 -0
- package/dist/context.cjs +3 -1
- package/dist/context.d.ts +2 -1
- package/dist/context.js +2 -1
- package/dist/index.cjs +4 -1
- package/dist/util.cjs +1 -0
- package/package.json +3 -3
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../../context.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
+
let _v_c_util = require("@v-c/util");
|
|
9
|
+
let _v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
|
|
10
|
+
_v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(_v_c_util_dist_pickAttrs);
|
|
11
|
+
let _v_c_util_dist_props_util = require("@v-c/util/dist/props-util");
|
|
8
12
|
var sentinelStyle = {
|
|
9
13
|
width: 0,
|
|
10
14
|
height: 0,
|
|
@@ -35,23 +39,27 @@ var Panel = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
35
39
|
return () => {
|
|
36
40
|
const { width, height, footer, prefixCls, classNames: modalClassNames, styles: modalStyles, title, closable, closeIcon, bodyProps, bodyStyle, ariaId, style, className, forceRender, onClose, onMouseDown, onMouseUp, modalRender, animationVisible } = props;
|
|
37
41
|
const contentStyle = {};
|
|
38
|
-
if (width !== void 0) contentStyle.width = width;
|
|
39
|
-
if (height !== void 0) contentStyle.height = height;
|
|
42
|
+
if (width !== void 0) contentStyle.width = (0, _v_c_util_dist_props_util.getStylePxValue)(width);
|
|
43
|
+
if (height !== void 0) contentStyle.height = (0, _v_c_util_dist_props_util.getStylePxValue)(height);
|
|
40
44
|
const footerNode = footer ? (0, vue.createVNode)("div", {
|
|
41
|
-
"class": (0,
|
|
45
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls}-footer`, modalClassNames?.footer),
|
|
42
46
|
"style": { ...modalStyles?.footer }
|
|
43
47
|
}, [footer]) : null;
|
|
44
48
|
const headerNode = title ? (0, vue.createVNode)("div", {
|
|
45
|
-
"class": (0,
|
|
49
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls}-header`, modalClassNames?.header),
|
|
46
50
|
"style": { ...modalStyles?.header }
|
|
47
|
-
}, [
|
|
51
|
+
}, [(0, vue.createVNode)("div", {
|
|
52
|
+
"class": (0, _v_c_util.clsx)(`${prefixCls}-title`, modalClassNames?.title),
|
|
53
|
+
"id": ariaId,
|
|
54
|
+
"style": { ...modalStyles?.title }
|
|
55
|
+
}, [title])]) : null;
|
|
48
56
|
const closableFun = () => {
|
|
49
57
|
if (typeof closable === "object" && closable !== null) return closable;
|
|
50
58
|
if (closable) return { closeIcon: closeIcon ?? (0, vue.createVNode)("span", { "class": `${prefixCls}-close-x` }, null) };
|
|
51
59
|
return {};
|
|
52
60
|
};
|
|
53
61
|
const closableObj = closableFun();
|
|
54
|
-
const ariaProps = (0,
|
|
62
|
+
const ariaProps = (0, _v_c_util_dist_pickAttrs.default)(closableObj, true);
|
|
55
63
|
const closeBtnIsDisabled = typeof closable === "object" && closable?.disabled;
|
|
56
64
|
const closerNode = closable ? (0, vue.createVNode)("button", (0, vue.mergeProps)({
|
|
57
65
|
"type": "button",
|
|
@@ -62,13 +70,13 @@ var Panel = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
62
70
|
"disabled": closeBtnIsDisabled
|
|
63
71
|
}), [closableObj.closeIcon]) : null;
|
|
64
72
|
const content = (0, vue.createVNode)("div", {
|
|
65
|
-
"class": (0,
|
|
73
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls}-container`, modalClassNames?.container),
|
|
66
74
|
"style": modalStyles?.container
|
|
67
75
|
}, [
|
|
68
76
|
closerNode,
|
|
69
77
|
headerNode,
|
|
70
78
|
(0, vue.createVNode)("div", (0, vue.mergeProps)({
|
|
71
|
-
"class": (0,
|
|
79
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls}-body`, modalClassNames?.body),
|
|
72
80
|
"style": {
|
|
73
81
|
...bodyStyle,
|
|
74
82
|
...modalStyles?.body
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useGetRefContext } from "../../context.js";
|
|
2
2
|
import { createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
3
|
-
import { classNames } from "@v-c/util";
|
|
3
|
+
import { classNames, clsx } from "@v-c/util";
|
|
4
4
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
5
|
+
import { getStylePxValue } from "@v-c/util/dist/props-util";
|
|
5
6
|
var sentinelStyle = {
|
|
6
7
|
width: 0,
|
|
7
8
|
height: 0,
|
|
@@ -32,8 +33,8 @@ var Panel_default = /* @__PURE__ */ defineComponent((props, { expose, slots }) =
|
|
|
32
33
|
return () => {
|
|
33
34
|
const { width, height, footer, prefixCls, classNames: modalClassNames, styles: modalStyles, title, closable, closeIcon, bodyProps, bodyStyle, ariaId, style, className, forceRender, onClose, onMouseDown, onMouseUp, modalRender, animationVisible } = props;
|
|
34
35
|
const contentStyle = {};
|
|
35
|
-
if (width !== void 0) contentStyle.width = width;
|
|
36
|
-
if (height !== void 0) contentStyle.height = height;
|
|
36
|
+
if (width !== void 0) contentStyle.width = getStylePxValue(width);
|
|
37
|
+
if (height !== void 0) contentStyle.height = getStylePxValue(height);
|
|
37
38
|
const footerNode = footer ? createVNode("div", {
|
|
38
39
|
"class": classNames(`${prefixCls}-footer`, modalClassNames?.footer),
|
|
39
40
|
"style": { ...modalStyles?.footer }
|
|
@@ -41,7 +42,11 @@ var Panel_default = /* @__PURE__ */ defineComponent((props, { expose, slots }) =
|
|
|
41
42
|
const headerNode = title ? createVNode("div", {
|
|
42
43
|
"class": classNames(`${prefixCls}-header`, modalClassNames?.header),
|
|
43
44
|
"style": { ...modalStyles?.header }
|
|
44
|
-
}, [
|
|
45
|
+
}, [createVNode("div", {
|
|
46
|
+
"class": clsx(`${prefixCls}-title`, modalClassNames?.title),
|
|
47
|
+
"id": ariaId,
|
|
48
|
+
"style": { ...modalStyles?.title }
|
|
49
|
+
}, [title])]) : null;
|
|
45
50
|
const closableFun = () => {
|
|
46
51
|
if (typeof closable === "object" && closable !== null) return closable;
|
|
47
52
|
if (closable) return { closeIcon: closeIcon ?? createVNode("span", { "class": `${prefixCls}-close-x` }, null) };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_util = require("../../util.cjs");
|
|
4
7
|
const require_Panel = require("./Panel.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
9
|
+
let _v_c_util_dist_utils_transition = require("@v-c/util/dist/utils/transition");
|
|
7
10
|
var Content = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
8
11
|
const dialogRef = (0, vue.shallowRef)();
|
|
9
12
|
const transformOrigin = (0, vue.shallowRef)("");
|
|
@@ -24,7 +27,7 @@ var Content = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
|
24
27
|
const { prefixCls, className, style, visible, destroyOnHidden, onVisibleChanged, ariaId, title, motionName } = props;
|
|
25
28
|
const contentStyle = {};
|
|
26
29
|
if (transformOrigin.value) contentStyle.transformOrigin = transformOrigin.value;
|
|
27
|
-
return (0, vue.createVNode)(vue.Transition, (0, vue.mergeProps)((0,
|
|
30
|
+
return (0, vue.createVNode)(vue.Transition, (0, vue.mergeProps)((0, _v_c_util_dist_utils_transition.getTransitionProps)(motionName), {
|
|
28
31
|
"onBeforeEnter": onPrepare,
|
|
29
32
|
"onAfterEnter": () => onVisibleChanged?.(true),
|
|
30
33
|
"onAfterLeave": () => {
|
package/dist/Dialog/Mask.cjs
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
let vue = require("vue");
|
|
4
|
-
let
|
|
5
|
-
let
|
|
7
|
+
let _v_c_util = require("@v-c/util");
|
|
8
|
+
let _v_c_util_dist_utils_transition = require("@v-c/util/dist/utils/transition");
|
|
6
9
|
var Mask = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
7
10
|
return () => {
|
|
8
11
|
const { maskProps, prefixCls, className, style, visible, motionName } = props;
|
|
9
|
-
return (0, vue.createVNode)(vue.Transition, (0, vue.mergeProps)((0,
|
|
12
|
+
return (0, vue.createVNode)(vue.Transition, (0, vue.mergeProps)((0, _v_c_util_dist_utils_transition.getTransitionProps)(motionName), { "key": "mask" }), { default: () => [visible && (0, vue.createVNode)("div", (0, vue.mergeProps)({
|
|
10
13
|
"style": [style],
|
|
11
|
-
"class": (0,
|
|
14
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls}-mask`, className)
|
|
12
15
|
}, maskProps), null)] });
|
|
13
16
|
};
|
|
14
17
|
}, {
|
package/dist/Dialog/index.cjs
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_util = require("../util.cjs");
|
|
4
7
|
const require_index = require("./Content/index.cjs");
|
|
5
8
|
const require_Mask = require("./Mask.cjs");
|
|
6
9
|
let vue = require("vue");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
10
|
+
let _v_c_util = require("@v-c/util");
|
|
11
|
+
let _v_c_util_dist_Dom_contains = require("@v-c/util/dist/Dom/contains");
|
|
12
|
+
_v_c_util_dist_Dom_contains = require_rolldown_runtime.__toESM(_v_c_util_dist_Dom_contains);
|
|
13
|
+
let _v_c_util_dist_KeyCode = require("@v-c/util/dist/KeyCode");
|
|
14
|
+
_v_c_util_dist_KeyCode = require_rolldown_runtime.__toESM(_v_c_util_dist_KeyCode);
|
|
15
|
+
let _v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
|
|
16
|
+
_v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(_v_c_util_dist_pickAttrs);
|
|
14
17
|
var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots }) => {
|
|
15
18
|
if (process.env.NODE_ENV !== "production") {
|
|
16
19
|
[
|
|
@@ -18,9 +21,9 @@ var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
18
21
|
"bodyStyle",
|
|
19
22
|
"maskStyle"
|
|
20
23
|
].forEach((prop) => {
|
|
21
|
-
(0,
|
|
24
|
+
(0, _v_c_util.warning)(!(prop in props && props[prop]), `${prop} is deprecated, please use styles instead.`);
|
|
22
25
|
});
|
|
23
|
-
if ("wrapClassName" in props && props.wrapClassName) (0,
|
|
26
|
+
if ("wrapClassName" in props && props.wrapClassName) (0, _v_c_util.warning)(false, `wrapClassName is deprecated, please use classNames instead.`);
|
|
24
27
|
}
|
|
25
28
|
const lastOutSideActiveElementRef = (0, vue.shallowRef)(null);
|
|
26
29
|
const wrapperRef = (0, vue.shallowRef)();
|
|
@@ -28,14 +31,15 @@ var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
28
31
|
const animatedVisible = (0, vue.shallowRef)(props.visible);
|
|
29
32
|
const ariaId = (0, vue.useId)();
|
|
30
33
|
function saveLastOutSideActiveElementRef() {
|
|
31
|
-
if (!(0,
|
|
34
|
+
if (!(0, _v_c_util_dist_Dom_contains.default)(wrapperRef.value, document.activeElement)) lastOutSideActiveElementRef.value = document.activeElement;
|
|
32
35
|
}
|
|
33
36
|
function focusDialogContent() {
|
|
34
|
-
if (!(0,
|
|
37
|
+
if (!(0, _v_c_util_dist_Dom_contains.default)(wrapperRef.value, document.activeElement)) contentRef.value?.focus?.();
|
|
35
38
|
}
|
|
36
39
|
function onDialogVisibleChanged(newVisible) {
|
|
37
40
|
if (newVisible) focusDialogContent();
|
|
38
41
|
else {
|
|
42
|
+
const _animatedVisible = animatedVisible.value;
|
|
39
43
|
animatedVisible.value = false;
|
|
40
44
|
if (props.mask && lastOutSideActiveElementRef.value && props.focusTriggerAfterClose) {
|
|
41
45
|
try {
|
|
@@ -43,7 +47,7 @@ var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
43
47
|
} catch (e) {}
|
|
44
48
|
lastOutSideActiveElementRef.value = null;
|
|
45
49
|
}
|
|
46
|
-
if (
|
|
50
|
+
if (_animatedVisible) props?.afterClose?.();
|
|
47
51
|
props?.afterOpenChange?.(newVisible);
|
|
48
52
|
}
|
|
49
53
|
}
|
|
@@ -69,11 +73,11 @@ var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
69
73
|
};
|
|
70
74
|
}, { immediate: true });
|
|
71
75
|
function onWrapperKeyDown(e) {
|
|
72
|
-
if (props.keyboard && e ===
|
|
76
|
+
if (props.keyboard && e === _v_c_util_dist_KeyCode.default.ESC) {
|
|
73
77
|
e.stopPropagation();
|
|
74
78
|
onInternalClose(e);
|
|
75
79
|
}
|
|
76
|
-
if (props.visible && e.keyCode ===
|
|
80
|
+
if (props.visible && e.keyCode === _v_c_util_dist_KeyCode.default.TAB) contentRef.value?.changeActive?.(!e.shiftKey);
|
|
77
81
|
}
|
|
78
82
|
(0, vue.watch)(() => props.visible, () => {
|
|
79
83
|
if (props.visible) {
|
|
@@ -93,7 +97,7 @@ var Dialog = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, slots })
|
|
|
93
97
|
...modalStyles?.wrapper,
|
|
94
98
|
display: !animatedVisible.value ? "none" : void 0
|
|
95
99
|
};
|
|
96
|
-
return (0, vue.createVNode)("div", (0, vue.mergeProps)({ "class": [`${prefixCls}-root`, rootClassName] }, (0,
|
|
100
|
+
return (0, vue.createVNode)("div", (0, vue.mergeProps)({ "class": [`${prefixCls}-root`, rootClassName] }, (0, _v_c_util_dist_pickAttrs.default)(props, { data: true })), [(0, vue.createVNode)(require_Mask.default, {
|
|
97
101
|
"prefixCls": prefixCls,
|
|
98
102
|
"visible": !!(mask && visible),
|
|
99
103
|
"motionName": require_util.getMotionName(prefixCls, maskTransitionName, maskAnimation),
|
package/dist/Dialog/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent((props, { expose, slots })
|
|
|
31
31
|
function onDialogVisibleChanged(newVisible) {
|
|
32
32
|
if (newVisible) focusDialogContent();
|
|
33
33
|
else {
|
|
34
|
+
const _animatedVisible = animatedVisible.value;
|
|
34
35
|
animatedVisible.value = false;
|
|
35
36
|
if (props.mask && lastOutSideActiveElementRef.value && props.focusTriggerAfterClose) {
|
|
36
37
|
try {
|
|
@@ -38,7 +39,7 @@ var Dialog_default = /* @__PURE__ */ defineComponent((props, { expose, slots })
|
|
|
38
39
|
} catch (e) {}
|
|
39
40
|
lastOutSideActiveElementRef.value = null;
|
|
40
41
|
}
|
|
41
|
-
if (
|
|
42
|
+
if (_animatedVisible) props?.afterClose?.();
|
|
42
43
|
props?.afterOpenChange?.(newVisible);
|
|
43
44
|
}
|
|
44
45
|
}
|
package/dist/DialogWrap.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("./context.cjs");
|
|
4
7
|
const require_index = require("./Dialog/index.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
7
|
-
|
|
9
|
+
let _v_c_portal = require("@v-c/portal");
|
|
10
|
+
_v_c_portal = require_rolldown_runtime.__toESM(_v_c_portal);
|
|
8
11
|
var DialogWrap = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
9
12
|
const animatedVisible = (0, vue.shallowRef)(false);
|
|
10
|
-
|
|
11
|
-
(0, vue.watch)(() => props.panelRef, () => {
|
|
12
|
-
setPanelRef(props.panelRef);
|
|
13
|
-
}, { immediate: true });
|
|
13
|
+
require_context.useRefProvide(props);
|
|
14
14
|
(0, vue.watch)(() => props.visible, () => {
|
|
15
15
|
if (props.visible) animatedVisible.value = true;
|
|
16
16
|
}, { immediate: true });
|
|
17
17
|
return () => {
|
|
18
18
|
const { visible, getContainer, forceRender, destroyOnHidden = false, afterClose } = props;
|
|
19
|
-
if (!forceRender && destroyOnHidden && !animatedVisible) return null;
|
|
20
|
-
return (0, vue.createVNode)(
|
|
21
|
-
"open":
|
|
19
|
+
if (!forceRender && destroyOnHidden && !animatedVisible.value) return null;
|
|
20
|
+
return (0, vue.createVNode)(_v_c_portal.default, {
|
|
21
|
+
"open": visible || forceRender || animatedVisible.value,
|
|
22
22
|
"autoDestroy": false,
|
|
23
23
|
"getContainer": getContainer,
|
|
24
|
-
"autoLock":
|
|
24
|
+
"autoLock": visible || animatedVisible.value
|
|
25
25
|
}, { default: () => [(0, vue.createVNode)(require_index.default, (0, vue.mergeProps)(props, {
|
|
26
26
|
"destroyOnHidden": destroyOnHidden,
|
|
27
27
|
"afterClose": () => {
|
package/dist/DialogWrap.js
CHANGED
|
@@ -4,21 +4,18 @@ import { createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef, wa
|
|
|
4
4
|
import Portal from "@v-c/portal";
|
|
5
5
|
var DialogWrap_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
6
6
|
const animatedVisible = shallowRef(false);
|
|
7
|
-
|
|
8
|
-
watch(() => props.panelRef, () => {
|
|
9
|
-
setPanelRef(props.panelRef);
|
|
10
|
-
}, { immediate: true });
|
|
7
|
+
useRefProvide(props);
|
|
11
8
|
watch(() => props.visible, () => {
|
|
12
9
|
if (props.visible) animatedVisible.value = true;
|
|
13
10
|
}, { immediate: true });
|
|
14
11
|
return () => {
|
|
15
12
|
const { visible, getContainer, forceRender, destroyOnHidden = false, afterClose } = props;
|
|
16
|
-
if (!forceRender && destroyOnHidden && !animatedVisible) return null;
|
|
13
|
+
if (!forceRender && destroyOnHidden && !animatedVisible.value) return null;
|
|
17
14
|
return createVNode(Portal, {
|
|
18
|
-
"open":
|
|
15
|
+
"open": visible || forceRender || animatedVisible.value,
|
|
19
16
|
"autoDestroy": false,
|
|
20
17
|
"getContainer": getContainer,
|
|
21
|
-
"autoLock":
|
|
18
|
+
"autoLock": visible || animatedVisible.value
|
|
22
19
|
}, { default: () => [createVNode(Dialog_default, mergeProps(props, {
|
|
23
20
|
"destroyOnHidden": destroyOnHidden,
|
|
24
21
|
"afterClose": () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/context.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
2
3
|
let vue = require("vue");
|
|
3
4
|
var RefContext = Symbol("RefContext");
|
|
4
|
-
function useRefProvide() {
|
|
5
|
+
function useRefProvide(props) {
|
|
5
6
|
const panel = (0, vue.shallowRef)();
|
|
6
7
|
const setPanelRef = (el) => {
|
|
8
|
+
if (typeof props.panelRef === "function") props.panelRef(el);
|
|
7
9
|
panel.value = el;
|
|
8
10
|
};
|
|
9
11
|
(0, vue.provide)(RefContext, {
|
package/dist/context.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
|
+
import { IDialogPropTypes } from './IDialogPropTypes.ts';
|
|
2
3
|
export interface RefContextProps {
|
|
3
4
|
panel: ShallowRef<HTMLDivElement | undefined>;
|
|
4
5
|
setPanel: (panel: HTMLDivElement) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare function useRefProvide(): {
|
|
7
|
+
export declare function useRefProvide(props: IDialogPropTypes): {
|
|
7
8
|
panel: ShallowRef<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
8
9
|
setPanelRef: (el: HTMLDivElement) => void;
|
|
9
10
|
};
|
package/dist/context.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { inject, provide, shallowRef } from "vue";
|
|
2
2
|
var RefContext = Symbol("RefContext");
|
|
3
|
-
function useRefProvide() {
|
|
3
|
+
function useRefProvide(props) {
|
|
4
4
|
const panel = shallowRef();
|
|
5
5
|
const setPanelRef = (el) => {
|
|
6
|
+
if (typeof props.panelRef === "function") props.panelRef(el);
|
|
6
7
|
panel.value = el;
|
|
7
8
|
};
|
|
8
9
|
provide(RefContext, {
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_Panel = require("./Dialog/Content/Panel.cjs");
|
|
3
6
|
const require_DialogWrap = require("./DialogWrap.cjs");
|
|
4
7
|
var src_default = require_DialogWrap.default;
|
package/dist/util.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/dialog",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"vue": "^3.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@v-c/portal": "^1.0.
|
|
29
|
-
"@v-c/util": "^1.0.
|
|
28
|
+
"@v-c/portal": "^1.0.1",
|
|
29
|
+
"@v-c/util": "^1.0.7"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "vite build",
|