@v-c/dialog 1.2.0 → 1.2.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useGetRefContext } from "../../context.js";
|
|
2
2
|
import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
|
|
3
|
-
import { classNames, clsx } from "@v-c/util";
|
|
3
|
+
import { classNames, clsx, isVueRenderable } from "@v-c/util";
|
|
4
4
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
5
5
|
import { useLockFocus } from "@v-c/util/dist/Dom/focus";
|
|
6
6
|
import { useFocusBoundaryProvider } from "@v-c/util/dist/Dom/focusBoundary";
|
|
@@ -24,11 +24,13 @@ var Panel = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
|
|
|
24
24
|
const contentStyle = {};
|
|
25
25
|
if (width !== void 0) contentStyle.width = getStylePxValue(width);
|
|
26
26
|
if (height !== void 0) contentStyle.height = getStylePxValue(height);
|
|
27
|
-
const
|
|
27
|
+
const hasFooter = isVueRenderable(footer);
|
|
28
|
+
const hasTitle = isVueRenderable(title);
|
|
29
|
+
const footerNode = hasFooter ? createVNode("div", {
|
|
28
30
|
"class": classNames(`${prefixCls}-footer`, modalClassNames?.footer),
|
|
29
31
|
"style": { ...modalStyles?.footer }
|
|
30
32
|
}, [footer]) : null;
|
|
31
|
-
const headerNode =
|
|
33
|
+
const headerNode = hasTitle ? createVNode("div", {
|
|
32
34
|
"class": classNames(`${prefixCls}-header`, modalClassNames?.header),
|
|
33
35
|
"style": { ...modalStyles?.header }
|
|
34
36
|
}, [createVNode("div", {
|
|
@@ -74,7 +76,7 @@ var Panel = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
|
|
|
74
76
|
return createVNode("div", mergeProps({
|
|
75
77
|
"key": "dialog-element",
|
|
76
78
|
"role": "dialog"
|
|
77
|
-
}, { "aria-labelledby":
|
|
79
|
+
}, { "aria-labelledby": hasTitle ? ariaId : null }, {
|
|
78
80
|
"aria-modal": "true",
|
|
79
81
|
"ref": mergeRefFun,
|
|
80
82
|
"style": {
|
package/dist/Dialog/index.js
CHANGED
|
@@ -65,7 +65,10 @@ var Dialog = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
|
|
|
65
65
|
saveLastOutSideActiveElementRef();
|
|
66
66
|
nextTick(() => {
|
|
67
67
|
const wrapEl = wrapperRef.value;
|
|
68
|
-
if (wrapEl)
|
|
68
|
+
if (wrapEl) {
|
|
69
|
+
const computedStyle = getComputedStyle(wrapEl);
|
|
70
|
+
isFixedPos.value = computedStyle.position === "fixed";
|
|
71
|
+
}
|
|
69
72
|
});
|
|
70
73
|
if (!getMotionName(props.prefixCls, props.transitionName, props.animation)) nextTick(() => {
|
|
71
74
|
onDialogVisibleChanged(true);
|
|
@@ -120,7 +123,7 @@ var Dialog = /* @__PURE__ */ defineComponent((props, { expose, slots }) => {
|
|
|
120
123
|
}), slots)])]);
|
|
121
124
|
};
|
|
122
125
|
}, {
|
|
123
|
-
props:
|
|
126
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
124
127
|
className: {
|
|
125
128
|
type: String,
|
|
126
129
|
required: false,
|
package/dist/DialogWrap.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/dialog",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/dialog",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/antdv-next/vue-components.git"
|
|
10
|
+
},
|
|
5
11
|
"exports": {
|
|
6
12
|
".": {
|
|
7
13
|
"types": "./dist/index.d.ts",
|
|
@@ -26,7 +32,7 @@
|
|
|
26
32
|
},
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"@v-c/portal": "^1.0.8",
|
|
29
|
-
"@v-c/util": "^1.0
|
|
35
|
+
"@v-c/util": "^1.2.0"
|
|
30
36
|
},
|
|
31
37
|
"scripts": {
|
|
32
38
|
"build": "vite build",
|