@ditari/bsui 1.0.18 → 1.0.19
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/cjs/components/modal/Modal.cjs.js +1 -1
- package/dist/cjs/components/modal/Modal.d.ts +4 -2
- package/dist/cjs/components/modal/index.d.ts +4 -2
- package/dist/esm/components/modal/Modal.d.ts +4 -2
- package/dist/esm/components/modal/Modal.esm.js +27 -22
- package/dist/esm/components/modal/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/components/modal/Modal.tsx +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("@vueuse/core"),s=require("ant-design-vue"),v=require("../theme/index.cjs.js"),f=`${v.prefixName}-modal`,m=e.defineComponent({name:"DModal",props:{title:{type:String,default:""},visible:{type:Boolean,default:()=>!1},width:{type:Number,default:()=>800}},emits:["update:visible"],setup(u,{slots:t,emit:r}){const l=e.ref(!0),n=e.ref(0);e.watchEffect(()=>{l.value=u.visible});const i=e.ref(void 0);o.useResizeObserver(document.body,()=>{const{height:a}=o.useWindowSize();n.value=a.value<200?a.value:a.value-200,i.value={"max-height":n.value+"px"}});const d=()=>t.footer?t.footer&&(t==null?void 0:t.footer()):null,c=()=>{r("update:visible",l.value)};return()=>e.createVNode(e.Fragment,null,[e.createVNode(s.Modal,{visible:l.value,"onUpdate:visible":a=>l.value=a,title:u.title,centered:!0,"mask-closable":!1,wrapClassName:f,width:u.width,footer:d(),onCancel:c},{default:()=>e.createVNode("div",{class:["content"],style:i.value},[t.default&&t.default(n.value)])})])}});exports.default=m;
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:visible"[], "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
title: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -24,7 +24,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
type: NumberConstructor;
|
|
25
25
|
default: () => number;
|
|
26
26
|
};
|
|
27
|
-
}
|
|
27
|
+
}>> & {
|
|
28
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}, {
|
|
28
30
|
title: string;
|
|
29
31
|
visible: boolean;
|
|
30
32
|
width: number;
|
|
@@ -11,7 +11,7 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:visible"[], "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
title: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -24,7 +24,9 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
24
24
|
type: NumberConstructor;
|
|
25
25
|
default: () => number;
|
|
26
26
|
};
|
|
27
|
-
}
|
|
27
|
+
}>> & {
|
|
28
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}, {
|
|
28
30
|
title: string;
|
|
29
31
|
visible: boolean;
|
|
30
32
|
width: number;
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:visible"[], "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
title: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -24,7 +24,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
type: NumberConstructor;
|
|
25
25
|
default: () => number;
|
|
26
26
|
};
|
|
27
|
-
}
|
|
27
|
+
}>> & {
|
|
28
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}, {
|
|
28
30
|
title: string;
|
|
29
31
|
visible: boolean;
|
|
30
32
|
width: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useResizeObserver as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { prefixName as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as m, ref as i, watchEffect as v, createVNode as n, Fragment as c } from "vue";
|
|
2
|
+
import { useResizeObserver as s, useWindowSize as p } from "@vueuse/core";
|
|
3
|
+
import { Modal as b } from "ant-design-vue";
|
|
4
|
+
import { prefixName as h } from "../theme/index.esm.js";
|
|
5
|
+
const w = `${h}-modal`, N = /* @__PURE__ */ m({
|
|
6
6
|
name: "DModal",
|
|
7
7
|
props: {
|
|
8
8
|
title: {
|
|
@@ -18,34 +18,39 @@ const b = `${p}-modal`, x = /* @__PURE__ */ d({
|
|
|
18
18
|
default: () => 800
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
emits: ["update:visible"],
|
|
22
|
+
setup(l, {
|
|
23
|
+
slots: e,
|
|
24
|
+
emit: r
|
|
23
25
|
}) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
const a = i(!0), o = i(0);
|
|
27
|
+
v(() => {
|
|
28
|
+
a.value = l.visible;
|
|
27
29
|
});
|
|
28
30
|
const u = i(void 0);
|
|
29
|
-
|
|
31
|
+
s(document.body, () => {
|
|
30
32
|
const {
|
|
31
33
|
height: t
|
|
32
|
-
} =
|
|
34
|
+
} = p();
|
|
33
35
|
o.value = t.value < 200 ? t.value : t.value - 200, u.value = {
|
|
34
36
|
"max-height": o.value + "px"
|
|
35
37
|
};
|
|
36
38
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const d = () => e.footer ? e.footer && (e == null ? void 0 : e.footer()) : null, f = () => {
|
|
40
|
+
r("update:visible", a.value);
|
|
41
|
+
};
|
|
42
|
+
return () => n(c, null, [n(b, {
|
|
43
|
+
visible: a.value,
|
|
44
|
+
"onUpdate:visible": (t) => a.value = t,
|
|
45
|
+
title: l.title,
|
|
42
46
|
centered: !0,
|
|
43
47
|
"mask-closable": !1,
|
|
44
|
-
wrapClassName:
|
|
45
|
-
width:
|
|
46
|
-
footer:
|
|
48
|
+
wrapClassName: w,
|
|
49
|
+
width: l.width,
|
|
50
|
+
footer: d(),
|
|
51
|
+
onCancel: f
|
|
47
52
|
}, {
|
|
48
|
-
default: () =>
|
|
53
|
+
default: () => n("div", {
|
|
49
54
|
class: ["content"],
|
|
50
55
|
style: u.value
|
|
51
56
|
}, [e.default && e.default(o.value)])
|
|
@@ -53,5 +58,5 @@ const b = `${p}-modal`, x = /* @__PURE__ */ d({
|
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
export {
|
|
56
|
-
|
|
61
|
+
N as default
|
|
57
62
|
};
|
|
@@ -11,7 +11,7 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:visible"[], "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
title: {
|
|
16
16
|
type: StringConstructor;
|
|
17
17
|
default: string;
|
|
@@ -24,7 +24,9 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
24
24
|
type: NumberConstructor;
|
|
25
25
|
default: () => number;
|
|
26
26
|
};
|
|
27
|
-
}
|
|
27
|
+
}>> & {
|
|
28
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}, {
|
|
28
30
|
title: string;
|
|
29
31
|
visible: boolean;
|
|
30
32
|
width: number;
|
package/package.json
CHANGED
|
@@ -22,7 +22,8 @@ export default defineComponent({
|
|
|
22
22
|
default: () => 800
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
emits: ["update:visible"],
|
|
26
|
+
setup(props, { slots, emit }) {
|
|
26
27
|
const modalVisible = ref(true);
|
|
27
28
|
const maxHeight = ref(0);
|
|
28
29
|
watchEffect(() => {
|
|
@@ -42,6 +43,10 @@ export default defineComponent({
|
|
|
42
43
|
return slots.footer ? slots.footer && slots?.footer() : null;
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
const onCancel = () => {
|
|
47
|
+
emit("update:visible", modalVisible.value);
|
|
48
|
+
};
|
|
49
|
+
|
|
45
50
|
return () => (
|
|
46
51
|
<>
|
|
47
52
|
<Modal
|
|
@@ -52,6 +57,7 @@ export default defineComponent({
|
|
|
52
57
|
wrapClassName={baseClassName}
|
|
53
58
|
width={props.width}
|
|
54
59
|
footer={renderFooter()}
|
|
60
|
+
onCancel={onCancel}
|
|
55
61
|
>
|
|
56
62
|
{{
|
|
57
63
|
default: () => (
|