@ditari/bsui 1.0.19 → 1.0.20
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 +1 @@
|
|
|
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;
|
|
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,document.body.style.width=""});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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as m, ref as i, watchEffect as
|
|
1
|
+
import { defineComponent as m, ref as i, watchEffect as c, createVNode as n, Fragment as v } from "vue";
|
|
2
2
|
import { useResizeObserver as s, useWindowSize as p } from "@vueuse/core";
|
|
3
3
|
import { Modal as b } from "ant-design-vue";
|
|
4
4
|
import { prefixName as h } from "../theme/index.esm.js";
|
|
5
|
-
const
|
|
5
|
+
const y = `${h}-modal`, N = /* @__PURE__ */ m({
|
|
6
6
|
name: "DModal",
|
|
7
7
|
props: {
|
|
8
8
|
title: {
|
|
@@ -21,11 +21,11 @@ const w = `${h}-modal`, N = /* @__PURE__ */ m({
|
|
|
21
21
|
emits: ["update:visible"],
|
|
22
22
|
setup(l, {
|
|
23
23
|
slots: e,
|
|
24
|
-
emit:
|
|
24
|
+
emit: d
|
|
25
25
|
}) {
|
|
26
26
|
const a = i(!0), o = i(0);
|
|
27
|
-
|
|
28
|
-
a.value = l.visible;
|
|
27
|
+
c(() => {
|
|
28
|
+
a.value = l.visible, document.body.style.width = "";
|
|
29
29
|
});
|
|
30
30
|
const u = i(void 0);
|
|
31
31
|
s(document.body, () => {
|
|
@@ -36,18 +36,18 @@ const w = `${h}-modal`, N = /* @__PURE__ */ m({
|
|
|
36
36
|
"max-height": o.value + "px"
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const r = () => e.footer ? e.footer && (e == null ? void 0 : e.footer()) : null, f = () => {
|
|
40
|
+
d("update:visible", a.value);
|
|
41
41
|
};
|
|
42
|
-
return () => n(
|
|
42
|
+
return () => n(v, null, [n(b, {
|
|
43
43
|
visible: a.value,
|
|
44
44
|
"onUpdate:visible": (t) => a.value = t,
|
|
45
45
|
title: l.title,
|
|
46
46
|
centered: !0,
|
|
47
47
|
"mask-closable": !1,
|
|
48
|
-
wrapClassName:
|
|
48
|
+
wrapClassName: y,
|
|
49
49
|
width: l.width,
|
|
50
|
-
footer:
|
|
50
|
+
footer: r(),
|
|
51
51
|
onCancel: f
|
|
52
52
|
}, {
|
|
53
53
|
default: () => n("div", {
|
package/package.json
CHANGED