@ditari/bsui 1.0.57 → 1.0.58
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 +9 -0
- package/dist/cjs/components/modal/index.d.ts +9 -0
- package/dist/esm/components/modal/Modal.d.ts +9 -0
- package/dist/esm/components/modal/Modal.esm.js +30 -25
- package/dist/esm/components/modal/index.d.ts +9 -0
- package/package.json +1 -1
- package/src/components/dic/DicReplace.tsx +2 -2
- package/src/components/modal/Modal.tsx +5 -0
|
@@ -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"),i=require("@vueuse/core"),f=require("ant-design-vue"),v=require("../theme/index.cjs.js"),r=`${v.prefixName}-modal`,m=e.defineComponent({name:"DModal",props:{title:{type:String,default:""},visible:{type:Boolean,default:()=>!1},width:{type:Number,default:()=>800},destroyOnClose:{type:Boolean,default:!0}},emits:["update:visible"],setup(l,{slots:t,emit:d}){const o=e.ref(!0),n=e.ref(0);e.watchEffect(()=>{o.value=l.visible,document.body.style.width=""});const u=e.ref(void 0);i.useResizeObserver(document.body,()=>{const{height:a}=i.useWindowSize();n.value=a.value<200?a.value:a.value-200,u.value={"max-height":n.value+"px"}});const s=()=>t.footer?t.footer&&(t==null?void 0:t.footer()):null,c=()=>{d("update:visible",o.value)};return()=>e.createVNode(e.Fragment,null,[e.createVNode(f.Modal,{visible:o.value,"onUpdate:visible":a=>o.value=a,title:l.title,centered:!0,"mask-closable":!1,wrapClassName:r,width:l.width,destroyOnClose:l.destroyOnClose,footer:s(),onCancel:c},{default:()=>e.createVNode("div",{class:[`${r}-content`],style:u.value},[t.default&&t.default(n.value)])})])}});exports.default=m;
|
|
@@ -11,6 +11,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
+
destroyOnClose: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}, () => 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
19
|
title: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -24,11 +28,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
28
|
type: NumberConstructor;
|
|
25
29
|
default: () => number;
|
|
26
30
|
};
|
|
31
|
+
destroyOnClose: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
27
35
|
}>> & {
|
|
28
36
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
37
|
}, {
|
|
30
38
|
title: string;
|
|
31
39
|
visible: boolean;
|
|
32
40
|
width: number;
|
|
41
|
+
destroyOnClose: boolean;
|
|
33
42
|
}>;
|
|
34
43
|
export default _default;
|
|
@@ -11,6 +11,10 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
+
destroyOnClose: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}, () => 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
19
|
title: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -24,11 +28,16 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
24
28
|
type: NumberConstructor;
|
|
25
29
|
default: () => number;
|
|
26
30
|
};
|
|
31
|
+
destroyOnClose: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
27
35
|
}>> & {
|
|
28
36
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
37
|
}, {
|
|
30
38
|
title: string;
|
|
31
39
|
visible: boolean;
|
|
32
40
|
width: number;
|
|
41
|
+
destroyOnClose: boolean;
|
|
33
42
|
}>>;
|
|
34
43
|
export default DModal;
|
|
@@ -11,6 +11,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
+
destroyOnClose: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}, () => 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
19
|
title: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -24,11 +28,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
28
|
type: NumberConstructor;
|
|
25
29
|
default: () => number;
|
|
26
30
|
};
|
|
31
|
+
destroyOnClose: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
27
35
|
}>> & {
|
|
28
36
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
37
|
}, {
|
|
30
38
|
title: string;
|
|
31
39
|
visible: boolean;
|
|
32
40
|
width: number;
|
|
41
|
+
destroyOnClose: boolean;
|
|
33
42
|
}>;
|
|
34
43
|
export default _default;
|
|
@@ -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 n, watchEffect as c, createVNode as i, Fragment as v } from "vue";
|
|
2
|
+
import { useResizeObserver as b, useWindowSize as p } from "@vueuse/core";
|
|
3
|
+
import { Modal as y } from "ant-design-vue";
|
|
4
|
+
import { prefixName as h } from "../theme/index.esm.js";
|
|
5
|
+
const u = `${h}-modal`, N = /* @__PURE__ */ m({
|
|
6
6
|
name: "DModal",
|
|
7
7
|
props: {
|
|
8
8
|
title: {
|
|
@@ -16,43 +16,48 @@ const d = `${y}-modal`, N = /* @__PURE__ */ c({
|
|
|
16
16
|
width: {
|
|
17
17
|
type: Number,
|
|
18
18
|
default: () => 800
|
|
19
|
+
},
|
|
20
|
+
destroyOnClose: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
emits: ["update:visible"],
|
|
22
|
-
setup(
|
|
26
|
+
setup(a, {
|
|
23
27
|
slots: e,
|
|
24
28
|
emit: r
|
|
25
29
|
}) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
const l = n(!0), o = n(0);
|
|
31
|
+
c(() => {
|
|
32
|
+
l.value = a.visible, document.body.style.width = "";
|
|
29
33
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
34
|
+
const d = n(void 0);
|
|
35
|
+
b(document.body, () => {
|
|
32
36
|
const {
|
|
33
37
|
height: t
|
|
34
|
-
} =
|
|
35
|
-
o.value = t.value < 200 ? t.value : t.value - 200,
|
|
38
|
+
} = p();
|
|
39
|
+
o.value = t.value < 200 ? t.value : t.value - 200, d.value = {
|
|
36
40
|
"max-height": o.value + "px"
|
|
37
41
|
};
|
|
38
42
|
});
|
|
39
|
-
const f = () => e.footer ? e.footer && (e == null ? void 0 : e.footer()) : null,
|
|
40
|
-
r("update:visible",
|
|
43
|
+
const f = () => e.footer ? e.footer && (e == null ? void 0 : e.footer()) : null, s = () => {
|
|
44
|
+
r("update:visible", l.value);
|
|
41
45
|
};
|
|
42
|
-
return () =>
|
|
43
|
-
visible:
|
|
44
|
-
"onUpdate:visible": (t) =>
|
|
45
|
-
title:
|
|
46
|
+
return () => i(v, null, [i(y, {
|
|
47
|
+
visible: l.value,
|
|
48
|
+
"onUpdate:visible": (t) => l.value = t,
|
|
49
|
+
title: a.title,
|
|
46
50
|
centered: !0,
|
|
47
51
|
"mask-closable": !1,
|
|
48
|
-
wrapClassName:
|
|
49
|
-
width:
|
|
52
|
+
wrapClassName: u,
|
|
53
|
+
width: a.width,
|
|
54
|
+
destroyOnClose: a.destroyOnClose,
|
|
50
55
|
footer: f(),
|
|
51
|
-
onCancel:
|
|
56
|
+
onCancel: s
|
|
52
57
|
}, {
|
|
53
|
-
default: () =>
|
|
54
|
-
class: [`${
|
|
55
|
-
style:
|
|
58
|
+
default: () => i("div", {
|
|
59
|
+
class: [`${u}-content`],
|
|
60
|
+
style: d.value
|
|
56
61
|
}, [e.default && e.default(o.value)])
|
|
57
62
|
})]);
|
|
58
63
|
}
|
|
@@ -11,6 +11,10 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
11
11
|
type: NumberConstructor;
|
|
12
12
|
default: () => number;
|
|
13
13
|
};
|
|
14
|
+
destroyOnClose: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}, () => 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
19
|
title: {
|
|
16
20
|
type: StringConstructor;
|
|
@@ -24,11 +28,16 @@ export declare const DModal: import("../../utils/install").SFCWithInstall<import
|
|
|
24
28
|
type: NumberConstructor;
|
|
25
29
|
default: () => number;
|
|
26
30
|
};
|
|
31
|
+
destroyOnClose: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
27
35
|
}>> & {
|
|
28
36
|
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
29
37
|
}, {
|
|
30
38
|
title: string;
|
|
31
39
|
visible: boolean;
|
|
32
40
|
width: number;
|
|
41
|
+
destroyOnClose: boolean;
|
|
33
42
|
}>>;
|
|
34
43
|
export default DModal;
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* 根据字典名字及对应的value替换成中文或者人能看懂的文字
|
|
4
4
|
* @author 余春林
|
|
5
5
|
*/
|
|
6
|
-
import { defineComponent,
|
|
6
|
+
import { defineComponent, ref, watchEffect } from "vue";
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
8
|
// @ts-ignore
|
|
9
|
-
import DicWorker from "./replace.worker?worker&inline";
|
|
9
|
+
// import DicWorker from "./replace.worker?worker&inline";
|
|
10
10
|
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
11
11
|
|
|
12
12
|
export default defineComponent({
|
|
@@ -20,6 +20,10 @@ export default defineComponent({
|
|
|
20
20
|
width: {
|
|
21
21
|
type: Number,
|
|
22
22
|
default: () => 800
|
|
23
|
+
},
|
|
24
|
+
destroyOnClose: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
emits: ["update:visible"],
|
|
@@ -58,6 +62,7 @@ export default defineComponent({
|
|
|
58
62
|
mask-closable={false}
|
|
59
63
|
wrapClassName={baseClassName}
|
|
60
64
|
width={props.width}
|
|
65
|
+
destroyOnClose={props.destroyOnClose}
|
|
61
66
|
footer={renderFooter()}
|
|
62
67
|
onCancel={onCancel}
|
|
63
68
|
>
|