md-editor-v3 4.12.0-beta.2 → 4.12.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.
Files changed (43) hide show
  1. package/README.md +12 -0
  2. package/lib/cjs/DropdownToolbar.cjs +3 -1
  3. package/lib/cjs/MdCatalog.cjs +270 -1
  4. package/lib/cjs/MdEditor.cjs +3101 -58
  5. package/lib/cjs/MdModal.cjs +3 -1
  6. package/lib/cjs/MdPreview.cjs +3 -1
  7. package/lib/cjs/ModalToolbar.cjs +124 -1
  8. package/lib/cjs/NormalToolbar.cjs +61 -1
  9. package/lib/cjs/chunks/config.cjs +290 -1
  10. package/lib/cjs/chunks/dom.cjs +64 -1
  11. package/lib/cjs/chunks/index.cjs +1863 -8
  12. package/lib/cjs/chunks/index2.cjs +198 -1
  13. package/lib/cjs/chunks/index3.cjs +270 -1
  14. package/lib/cjs/chunks/index4.cjs +141 -2
  15. package/lib/cjs/chunks/vue-tsx.cjs +10 -1
  16. package/lib/cjs/config.cjs +12 -1
  17. package/lib/cjs/index.cjs +25 -1
  18. package/lib/es/DropdownToolbar.mjs +2 -2
  19. package/lib/es/MdCatalog.mjs +164 -114
  20. package/lib/es/MdEditor.mjs +2297 -1654
  21. package/lib/es/MdModal.mjs +2 -2
  22. package/lib/es/MdPreview.mjs +2 -2
  23. package/lib/es/ModalToolbar.mjs +55 -38
  24. package/lib/es/NormalToolbar.mjs +26 -18
  25. package/lib/es/chunks/config.mjs +73 -54
  26. package/lib/es/chunks/dom.mjs +57 -24
  27. package/lib/es/chunks/index.mjs +1099 -609
  28. package/lib/es/chunks/index2.mjs +126 -78
  29. package/lib/es/chunks/index3.mjs +185 -111
  30. package/lib/es/chunks/index4.mjs +124 -72
  31. package/lib/es/chunks/vue-tsx.mjs +8 -8
  32. package/lib/es/config.mjs +11 -10
  33. package/lib/es/index.mjs +23 -23
  34. package/lib/preview.css +200 -1
  35. package/lib/style.css +592 -1
  36. package/lib/types/MdEditor/components/Modal/Modal.d.ts +1 -1
  37. package/lib/types/MdEditor/components/Modal/index.d.ts +3 -3
  38. package/lib/types/MdEditor/layouts/Content/index.d.ts +9 -0
  39. package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -0
  40. package/lib/types/MdEditor/static/event-name.d.ts +1 -0
  41. package/lib/types/MdEditor/type.d.ts +10 -1
  42. package/lib/umd/index.js +75625 -114
  43. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- import { defineComponent as S, reactive as E, ref as C, watch as D, onMounted as T, onBeforeUnmount as O, cloneVNode as $, createVNode as d, inject as j } from "vue";
2
- import { p as c } from "./config.mjs";
3
- import { g as v } from "./vue-tsx.mjs";
4
- const B = {
1
+ import { defineComponent, reactive, ref, watch, onMounted, onBeforeUnmount, cloneVNode, createVNode, inject } from "vue";
2
+ import { p as prefix } from "./config.mjs";
3
+ import { g as getSlot } from "./vue-tsx.mjs";
4
+ const props$1 = {
5
5
  overlay: {
6
6
  type: [String, Object],
7
7
  default: ""
8
8
  },
9
9
  visible: {
10
10
  type: Boolean,
11
- default: !1
11
+ default: false
12
12
  },
13
13
  onChange: {
14
14
  type: Function,
@@ -20,61 +20,99 @@ const B = {
20
20
  type: String,
21
21
  default: "html"
22
22
  }
23
- }, F = /* @__PURE__ */ S({
24
- props: B,
25
- setup(e, a) {
26
- const i = `${c}-dropdown-hidden`, t = E({
27
- overlayClass: [i],
23
+ };
24
+ const Dropdown = /* @__PURE__ */ defineComponent({
25
+ props: props$1,
26
+ setup(props2, ctx) {
27
+ const HIDDEN_CLASS = `${prefix}-dropdown-hidden`;
28
+ const ctl = reactive({
29
+ overlayClass: [HIDDEN_CLASS],
28
30
  overlayStyle: {},
29
- triggerHover: !1,
30
- overlayHover: !1
31
- }), o = C(), n = C(), s = () => {
32
- var p;
33
- t.triggerHover = !0;
34
- const r = o.value, l = n.value;
35
- if (!r || !l)
31
+ triggerHover: false,
32
+ overlayHover: false
33
+ });
34
+ const triggerRef = ref();
35
+ const overlayRef = ref();
36
+ const triggerHandler = () => {
37
+ var _a;
38
+ ctl.triggerHover = true;
39
+ const triggerEle = triggerRef.value;
40
+ const overlayEle = overlayRef.value;
41
+ if (!triggerEle || !overlayEle) {
36
42
  return;
37
- const u = r.getBoundingClientRect(), f = r.offsetTop, b = r.offsetLeft, H = u.height, L = u.width, w = ((p = document.querySelector(e.relative)) == null ? void 0 : p.scrollLeft) || 0;
38
- t.overlayStyle = {
39
- ...t.overlayStyle,
40
- top: f + H + "px",
41
- left: b - l.offsetWidth / 2 + L / 2 - w + "px"
42
- }, e.onChange(!0);
43
- }, m = () => {
44
- t.overlayHover = !0;
43
+ }
44
+ const triggerInfo = triggerEle.getBoundingClientRect();
45
+ const triggerTop = triggerEle.offsetTop;
46
+ const triggerLeft = triggerEle.offsetLeft;
47
+ const triggerHeight = triggerInfo.height;
48
+ const triggerWidth = triggerInfo.width;
49
+ const relativecrollLeft = ((_a = document.querySelector(props2.relative)) == null ? void 0 : _a.scrollLeft) || 0;
50
+ ctl.overlayStyle = {
51
+ ...ctl.overlayStyle,
52
+ top: triggerTop + triggerHeight + "px",
53
+ left: triggerLeft - overlayEle.offsetWidth / 2 + triggerWidth / 2 - relativecrollLeft + "px"
54
+ };
55
+ props2.onChange(true);
56
+ };
57
+ const overlayHandler = () => {
58
+ ctl.overlayHover = true;
45
59
  };
46
- D(() => e.visible, (r) => {
47
- r ? t.overlayClass = t.overlayClass.filter((l) => l !== i) : t.overlayClass.push(i);
60
+ watch(() => props2.visible, (newV) => {
61
+ if (newV) {
62
+ ctl.overlayClass = ctl.overlayClass.filter((classItem) => classItem !== HIDDEN_CLASS);
63
+ } else {
64
+ ctl.overlayClass.push(HIDDEN_CLASS);
65
+ }
48
66
  });
49
- let h = -1;
50
- const g = (r) => {
51
- o.value === r.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(h), h = window.setTimeout(() => {
52
- !t.overlayHover && !t.triggerHover && e.onChange(!1);
67
+ let hiddenTimer = -1;
68
+ const leaveHidden = (e) => {
69
+ if (triggerRef.value === e.target) {
70
+ ctl.triggerHover = false;
71
+ } else {
72
+ ctl.overlayHover = false;
73
+ }
74
+ clearTimeout(hiddenTimer);
75
+ hiddenTimer = window.setTimeout(() => {
76
+ if (!ctl.overlayHover && !ctl.triggerHover) {
77
+ props2.onChange(false);
78
+ }
53
79
  }, 10);
54
80
  };
55
- return T(() => {
56
- o.value.addEventListener("mouseenter", s), o.value.addEventListener("mouseleave", g), n.value.addEventListener("mouseenter", m), n.value.addEventListener("mouseleave", g);
57
- }), O(() => {
58
- o.value.removeEventListener("mouseenter", s), o.value.removeEventListener("mouseleave", g), n.value.removeEventListener("mouseenter", m), n.value.removeEventListener("mouseleave", g);
59
- }), () => {
60
- const r = v({
61
- ctx: a
62
- }), l = v({
63
- props: e,
64
- ctx: a
65
- }, "overlay"), u = $(r instanceof Array ? r[0] : r, {
66
- ref: o
67
- }), f = d("div", {
68
- class: [`${c}-dropdown`, t.overlayClass],
69
- style: t.overlayStyle,
70
- ref: n
71
- }, [d("div", {
72
- class: `${c}-dropdown-overlay`
73
- }, [l instanceof Array ? l[0] : l])]);
74
- return [u, f];
81
+ onMounted(() => {
82
+ triggerRef.value.addEventListener("mouseenter", triggerHandler);
83
+ triggerRef.value.addEventListener("mouseleave", leaveHidden);
84
+ overlayRef.value.addEventListener("mouseenter", overlayHandler);
85
+ overlayRef.value.addEventListener("mouseleave", leaveHidden);
86
+ });
87
+ onBeforeUnmount(() => {
88
+ triggerRef.value.removeEventListener("mouseenter", triggerHandler);
89
+ triggerRef.value.removeEventListener("mouseleave", leaveHidden);
90
+ overlayRef.value.removeEventListener("mouseenter", overlayHandler);
91
+ overlayRef.value.removeEventListener("mouseleave", leaveHidden);
92
+ });
93
+ return () => {
94
+ const slotDefault = getSlot({
95
+ ctx
96
+ });
97
+ const slotOverlay = getSlot({
98
+ props: props2,
99
+ ctx
100
+ }, "overlay");
101
+ const trigger = cloneVNode(slotDefault instanceof Array ? slotDefault[0] : slotDefault, {
102
+ ref: triggerRef
103
+ });
104
+ const overlay = createVNode("div", {
105
+ "class": [`${prefix}-dropdown`, ctl.overlayClass],
106
+ "style": ctl.overlayStyle,
107
+ "ref": overlayRef
108
+ }, [createVNode("div", {
109
+ "class": `${prefix}-dropdown-overlay`
110
+ }, [slotOverlay instanceof Array ? slotOverlay[0] : slotOverlay])]);
111
+ return [trigger, overlay];
75
112
  };
76
113
  }
77
- }), I = {
114
+ });
115
+ const props = {
78
116
  title: {
79
117
  type: String,
80
118
  default: ""
@@ -111,41 +149,51 @@ const B = {
111
149
  default: {
112
150
  type: [String, Object]
113
151
  }
114
- }, y = /* @__PURE__ */ S({
152
+ };
153
+ const DropdownToolbar = /* @__PURE__ */ defineComponent({
115
154
  name: "DropdownToolbar",
116
- props: I,
155
+ props,
117
156
  emits: ["onChange"],
118
- setup(e, a) {
119
- const i = j("editorId");
157
+ setup(props2, ctx) {
158
+ const editorId = inject("editorId");
120
159
  return () => {
121
- const t = v({
122
- props: e,
123
- ctx: a
124
- }, "trigger"), o = v({
125
- props: e,
126
- ctx: a
127
- }, "overlay"), n = v({
128
- props: e,
129
- ctx: a
160
+ const Trigger = getSlot({
161
+ props: props2,
162
+ ctx
163
+ }, "trigger");
164
+ const Overlay = getSlot({
165
+ props: props2,
166
+ ctx
167
+ }, "overlay");
168
+ const Default = getSlot({
169
+ props: props2,
170
+ ctx
130
171
  });
131
- return d(F, {
132
- relative: `#${i}-toolbar-wrapper`,
133
- visible: e.visible,
134
- onChange: (s) => {
135
- e.onChange instanceof Function ? e.onChange(s) : a.emit("onChange", s);
172
+ return createVNode(Dropdown, {
173
+ "relative": `#${editorId}-toolbar-wrapper`,
174
+ "visible": props2.visible,
175
+ "onChange": (v) => {
176
+ if (props2.onChange instanceof Function) {
177
+ props2.onChange(v);
178
+ } else {
179
+ ctx.emit("onChange", v);
180
+ }
136
181
  },
137
- overlay: o
182
+ "overlay": Overlay
138
183
  }, {
139
- default: () => [d("div", {
140
- class: `${c}-toolbar-item`,
141
- title: e.title || ""
142
- }, [t, n])]
184
+ default: () => [createVNode("div", {
185
+ "class": `${prefix}-toolbar-item`,
186
+ "title": props2.title || ""
187
+ }, [Trigger, Default])]
143
188
  });
144
189
  };
145
190
  }
146
191
  });
147
- y.install = (e) => (e.component(y.name, y), e);
192
+ DropdownToolbar.install = (app) => {
193
+ app.component(DropdownToolbar.name, DropdownToolbar);
194
+ return app;
195
+ };
148
196
  export {
149
- y as D,
150
- F as a
197
+ DropdownToolbar as D,
198
+ Dropdown as a
151
199
  };
@@ -1,50 +1,57 @@
1
- import { defineComponent as y, createVNode as t, inject as S, h as w, ref as m, shallowRef as M, reactive as T, computed as H, watch as g, nextTick as p, Teleport as R } from "vue";
2
- import { p as l, e as A } from "./config.mjs";
3
- import { g as x } from "./vue-tsx.mjs";
4
- import { k as C } from "./dom.mjs";
5
- const W = /* @__PURE__ */ y({
1
+ import { defineComponent, createVNode, inject, h, ref, shallowRef, reactive, computed, watch, nextTick, onMounted, Teleport } from "vue";
2
+ import { p as prefix, e as configOption } from "./config.mjs";
3
+ import { g as getSlot } from "./vue-tsx.mjs";
4
+ import { k as keyMove } from "./dom.mjs";
5
+ const Icon$1 = /* @__PURE__ */ defineComponent({
6
6
  props: {
7
7
  name: {
8
8
  type: String,
9
9
  default: ""
10
10
  }
11
11
  },
12
- setup(e) {
13
- return () => A.iconfontType === "svg" ? t("svg", {
14
- class: `${l}-icon`,
15
- "aria-hidden": "true"
16
- }, [t("use", {
17
- "xlink:href": `#${l}-icon-${e.name}`
18
- }, null)]) : t("i", {
19
- class: `${l}-iconfont ${l}-icon-${e.name}`
20
- }, null);
12
+ setup(props2) {
13
+ return () => {
14
+ return configOption.iconfontType === "svg" ? createVNode("svg", {
15
+ "class": `${prefix}-icon`,
16
+ "aria-hidden": "true"
17
+ }, [createVNode("use", {
18
+ "xlink:href": `#${prefix}-icon-${props2.name}`
19
+ }, null)]) : createVNode("i", {
20
+ "class": `${prefix}-iconfont ${prefix}-icon-${props2.name}`
21
+ }, null);
22
+ };
21
23
  }
22
- }), P = /* @__PURE__ */ y({
24
+ });
25
+ const Icon = /* @__PURE__ */ defineComponent({
23
26
  props: {
24
27
  name: {
25
28
  type: String,
26
29
  default: ""
27
30
  }
28
31
  },
29
- setup(e) {
30
- const c = S("customIcon");
32
+ setup(props2) {
33
+ const customIcon = inject("customIcon");
31
34
  return () => {
32
- const s = c.value[e.name];
33
- return typeof s == "object" ? typeof s.component == "object" ? w(s.component, s.props) : t("span", {
34
- innerHTML: s.component
35
- }, null) : t(W, {
36
- name: e.name
35
+ const item = customIcon.value[props2.name];
36
+ if (typeof item === "object") {
37
+ return typeof item.component === "object" ? h(item.component, item.props) : createVNode("span", {
38
+ "innerHTML": item.component
39
+ }, null);
40
+ }
41
+ return createVNode(Icon$1, {
42
+ "name": props2.name
37
43
  }, null);
38
44
  };
39
45
  }
40
- }), B = {
46
+ });
47
+ const props = {
41
48
  title: {
42
49
  type: String,
43
50
  default: ""
44
51
  },
45
52
  visible: {
46
53
  type: Boolean,
47
- default: !1
54
+ default: false
48
55
  },
49
56
  width: {
50
57
  type: String,
@@ -59,11 +66,11 @@ const W = /* @__PURE__ */ y({
59
66
  },
60
67
  showAdjust: {
61
68
  type: Boolean,
62
- default: !1
69
+ default: false
63
70
  },
64
71
  isFullscreen: {
65
72
  type: Boolean,
66
- default: !1
73
+ default: false
67
74
  },
68
75
  onAdjust: {
69
76
  type: Function,
@@ -77,18 +84,28 @@ const W = /* @__PURE__ */ y({
77
84
  type: Object,
78
85
  default: () => ({})
79
86
  }
80
- }, E = `${l}-modal-container`, $ = /* @__PURE__ */ (() => {
81
- let e = 2e4;
82
- return () => ++e;
83
- })(), v = /* @__PURE__ */ y({
87
+ };
88
+ const getNextIndex = /* @__PURE__ */ (() => {
89
+ let startIndex = 2e4;
90
+ return () => {
91
+ return ++startIndex;
92
+ };
93
+ })();
94
+ const MdModal = /* @__PURE__ */ defineComponent({
84
95
  name: "MdModal",
85
- props: B,
96
+ props,
86
97
  emits: ["onClose"],
87
- setup(e, c) {
88
- const s = S("theme"), f = m(e.visible), i = m([`${l}-modal`]), r = m(), h = m(), k = M();
89
- let d = () => {
98
+ setup(props2, ctx) {
99
+ const themeRef = inject("theme");
100
+ const modalVisible = ref(props2.visible);
101
+ const modalClass = ref([`${prefix}-modal`]);
102
+ const modalRef = ref();
103
+ const modalHeaderRef = ref();
104
+ const bodyRef = ref();
105
+ const containerRef = shallowRef();
106
+ let keyMoveClear = () => {
90
107
  };
91
- const o = T({
108
+ const state = reactive({
92
109
  maskStyle: {
93
110
  zIndex: -1
94
111
  },
@@ -103,95 +120,152 @@ const W = /* @__PURE__ */ y({
103
120
  left: "0px",
104
121
  top: "0px"
105
122
  }
106
- }), I = H(() => e.isFullscreen ? {
107
- width: "100%",
108
- height: "100%"
109
- } : {
110
- width: e.width,
111
- height: e.height
112
123
  });
113
- return g(() => e.isFullscreen, (a) => {
114
- a ? d() : p(() => {
115
- d = C(h.value, (n, u) => {
116
- o.initPos.left = n + "px", o.initPos.top = u + "px";
124
+ const innerSize = computed(() => {
125
+ if (props2.isFullscreen) {
126
+ return {
127
+ width: "100%",
128
+ height: "100%"
129
+ };
130
+ } else {
131
+ return {
132
+ width: props2.width,
133
+ height: props2.height
134
+ };
135
+ }
136
+ });
137
+ watch(() => props2.isFullscreen, (nVal) => {
138
+ if (nVal) {
139
+ keyMoveClear();
140
+ } else {
141
+ nextTick(() => {
142
+ keyMoveClear = keyMove(modalHeaderRef.value, (left, top) => {
143
+ state.initPos.left = left + "px";
144
+ state.initPos.top = top + "px";
145
+ });
117
146
  });
147
+ }
148
+ });
149
+ watch(() => props2.visible, (nVal) => {
150
+ if (nVal) {
151
+ state.maskStyle.zIndex = getNextIndex();
152
+ state.modalStyle.zIndex = getNextIndex();
153
+ modalClass.value.push("zoom-in");
154
+ modalVisible.value = nVal;
155
+ nextTick(() => {
156
+ const halfWidth = modalRef.value.offsetWidth / 2;
157
+ const halfHeight = modalRef.value.offsetHeight / 2;
158
+ const halfClientWidth = document.documentElement.clientWidth / 2;
159
+ const halfClientHeight = document.documentElement.clientHeight / 2;
160
+ state.initPos.left = halfClientWidth - halfWidth + "px";
161
+ state.initPos.top = halfClientHeight - halfHeight + "px";
162
+ if (!props2.isFullscreen) {
163
+ keyMoveClear = keyMove(modalHeaderRef.value, (left, top) => {
164
+ state.initPos.left = left + "px";
165
+ state.initPos.top = top + "px";
166
+ });
167
+ }
168
+ });
169
+ setTimeout(() => {
170
+ modalClass.value = modalClass.value.filter((item) => item !== "zoom-in");
171
+ }, 140);
172
+ } else {
173
+ modalClass.value.push("zoom-out");
174
+ keyMoveClear();
175
+ setTimeout(() => {
176
+ modalClass.value = modalClass.value.filter((item) => item !== "zoom-out");
177
+ modalVisible.value = nVal;
178
+ }, 130);
179
+ }
180
+ });
181
+ onMounted(() => {
182
+ bodyRef.value = document.body;
183
+ });
184
+ return () => {
185
+ const slotDefault = getSlot({
186
+ ctx
118
187
  });
119
- }), g(() => e.visible, (a) => {
120
- a ? (o.maskStyle.zIndex = $(), o.modalStyle.zIndex = $(), i.value.push("zoom-in"), f.value = a, p(() => {
121
- const n = r.value.offsetWidth / 2, u = r.value.offsetHeight / 2, b = document.documentElement.clientWidth / 2, j = document.documentElement.clientHeight / 2;
122
- o.initPos.left = b - n + "px", o.initPos.top = j - u + "px", e.isFullscreen || (d = C(h.value, (z, F) => {
123
- o.initPos.left = z + "px", o.initPos.top = F + "px";
124
- }));
125
- }), setTimeout(() => {
126
- i.value = i.value.filter((n) => n !== "zoom-in");
127
- }, 140)) : (i.value.push("zoom-out"), d(), setTimeout(() => {
128
- i.value = i.value.filter((n) => n !== "zoom-out"), f.value = a;
129
- }, 130));
130
- }), () => {
131
- const a = x({
132
- ctx: c
133
- }), n = x({
134
- props: e,
135
- ctx: c
188
+ const slotTitle = getSlot({
189
+ props: props2,
190
+ ctx
136
191
  }, "title");
137
- return t(R, {
138
- to: document.body
192
+ return bodyRef.value ? createVNode(Teleport, {
193
+ "to": bodyRef.value
139
194
  }, {
140
- default: () => [t("div", {
141
- ref: k,
142
- class: E,
143
- "data-theme": s.value
144
- }, [t("div", {
145
- class: e.class,
146
- style: {
147
- ...e.style,
148
- display: f.value ? "block" : "none"
195
+ default: () => [createVNode("div", {
196
+ "ref": containerRef,
197
+ "class": `${prefix}-modal-container`,
198
+ "data-theme": themeRef.value
199
+ }, [createVNode("div", {
200
+ "class": props2.class,
201
+ "style": {
202
+ ...props2.style,
203
+ display: modalVisible.value ? "block" : "none"
149
204
  }
150
- }, [t("div", {
151
- class: `${l}-modal-mask`,
152
- style: o.maskStyle,
153
- onClick: () => {
154
- e.onClose ? e.onClose() : c.emit("onClose");
205
+ }, [createVNode("div", {
206
+ "class": `${prefix}-modal-mask`,
207
+ "style": state.maskStyle,
208
+ "onClick": () => {
209
+ if (props2.onClose) {
210
+ props2.onClose();
211
+ } else {
212
+ ctx.emit("onClose");
213
+ }
155
214
  }
156
- }, null), t("div", {
157
- class: i.value,
158
- style: {
159
- ...o.modalStyle,
160
- ...o.initPos,
161
- ...I.value
215
+ }, null), createVNode("div", {
216
+ "class": modalClass.value,
217
+ "style": {
218
+ ...state.modalStyle,
219
+ ...state.initPos,
220
+ ...innerSize.value
162
221
  },
163
- ref: r
164
- }, [t("div", {
165
- class: `${l}-modal-header`,
166
- ref: h
167
- }, [n || ""]), t("div", {
168
- class: `${l}-modal-body`
169
- }, [a]), t("div", {
170
- class: `${l}-modal-func`
171
- }, [e.showAdjust && t("div", {
172
- class: `${l}-modal-adjust`,
173
- onClick: (u) => {
174
- u.stopPropagation(), e.isFullscreen ? o.initPos = o.historyPos : (o.historyPos = o.initPos, o.initPos = {
175
- left: "0",
176
- top: "0"
177
- }), e.onAdjust(!e.isFullscreen);
222
+ "ref": modalRef
223
+ }, [createVNode("div", {
224
+ "class": `${prefix}-modal-header`,
225
+ "ref": modalHeaderRef
226
+ }, [slotTitle || ""]), createVNode("div", {
227
+ "class": `${prefix}-modal-body`
228
+ }, [slotDefault]), createVNode("div", {
229
+ "class": `${prefix}-modal-func`
230
+ }, [props2.showAdjust && createVNode("div", {
231
+ "class": `${prefix}-modal-adjust`,
232
+ "onClick": (e) => {
233
+ e.stopPropagation();
234
+ if (!props2.isFullscreen) {
235
+ state.historyPos = state.initPos;
236
+ state.initPos = {
237
+ left: "0",
238
+ top: "0"
239
+ };
240
+ } else {
241
+ state.initPos = state.historyPos;
242
+ }
243
+ props2.onAdjust(!props2.isFullscreen);
178
244
  }
179
- }, [t(P, {
180
- name: e.isFullscreen ? "suoxiao" : "fangda"
181
- }, null)]), t("div", {
182
- class: `${l}-modal-close`,
183
- onClick: (u) => {
184
- u.stopPropagation(), e.onClose ? e.onClose() : c.emit("onClose");
245
+ }, [createVNode(Icon, {
246
+ "name": props2.isFullscreen ? "suoxiao" : "fangda"
247
+ }, null)]), createVNode("div", {
248
+ "class": `${prefix}-modal-close`,
249
+ "onClick": (e) => {
250
+ e.stopPropagation();
251
+ if (props2.onClose) {
252
+ props2.onClose();
253
+ } else {
254
+ ctx.emit("onClose");
255
+ }
185
256
  }
186
- }, [t(P, {
187
- name: "close"
257
+ }, [createVNode(Icon, {
258
+ "name": "close"
188
259
  }, null)])])])])])]
189
- });
260
+ }) : "";
190
261
  };
191
262
  }
192
263
  });
193
- v.install = (e) => (e.component(v.name, v), e);
264
+ MdModal.install = (app) => {
265
+ app.component(MdModal.name, MdModal);
266
+ return app;
267
+ };
194
268
  export {
195
- P as I,
196
- v as M
269
+ Icon as I,
270
+ MdModal as M
197
271
  };