@gopowerteam/form-render 0.0.43 → 0.0.44
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/form-render/form-collapsed-dialog.d.ts +33 -0
- package/dist/cjs/form-render/index.d.ts +18 -4
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/interfaces/form-item-options.d.ts +1 -0
- package/dist/es/form-render/form-collapsed-dialog.d.ts +33 -0
- package/dist/es/form-render/index.d.ts +18 -4
- package/dist/es/index.mjs +1189 -388
- package/dist/es/interfaces/form-item-options.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +4 -2
package/dist/es/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { DatePicker as
|
|
3
|
-
import
|
|
4
|
-
import { FormRenderResolver as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
return e ? `${
|
|
9
|
-
},
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
var
|
|
14
|
-
for (const [
|
|
15
|
-
e[
|
|
1
|
+
import { getCurrentInstance as W, inject as ne, defineComponent as P, computed as x, openBlock as S, createElementBlock as F, normalizeClass as re, normalizeStyle as z, createElementVNode as w, shallowRef as A, ref as $, provide as fe, onMounted as D, Fragment as me, renderSlot as Ee, createBlock as te, Teleport as Ae, createVNode as v, TransitionGroup as Ve, withCtx as Be, renderList as De, mergeProps as Oe, createCommentVNode as G, defineAsyncComponent as We, triggerRef as K, onUnmounted as qe, withModifiers as Ue, toDisplayString as V, resolveDynamicComponent as _e, normalizeProps as Ge, guardReactiveProps as Ye, watch as le, unref as He, isRef as oe, toRefs as Xe, customRef as Je, nextTick as Me, getCurrentScope as Ke, onScopeDispose as Qe, pushScopeId as Ze, popScopeId as et, isVNode as ve, h as tt, createTextVNode as Z, onUpdated as nt } from "vue";
|
|
2
|
+
import { DatePicker as rt, YearPicker as lt, QuarterPicker as ot, MonthPicker as at, WeekPicker as ut, Input as it, InputNumber as ct, Select as st, Option as dt, Switch as ft, RangePicker as mt, Textarea as ht, TreeSelect as vt, Cascader as pt, FormItem as je, Tabs as yt, TabPane as gt, Form as bt, Grid as kt, GridItem as xe, Button as U, Space as wt } from "@arco-design/web-vue";
|
|
3
|
+
import Ce from "dayjs";
|
|
4
|
+
import { FormRenderResolver as Hn } from "./resolver.mjs";
|
|
5
|
+
const St = Symbol("ArcoConfigProvider"), xt = "arco", Ct = "$arco", pe = (e) => {
|
|
6
|
+
var r, t, n;
|
|
7
|
+
const l = W(), a = ne(St, void 0), o = (n = (t = a == null ? void 0 : a.prefixCls) != null ? t : (r = l == null ? void 0 : l.appContext.config.globalProperties[Ct]) == null ? void 0 : r.classPrefix) != null ? n : xt;
|
|
8
|
+
return e ? `${o}-${e}` : o;
|
|
9
|
+
}, $t = Object.prototype.toString;
|
|
10
|
+
function ye(e) {
|
|
11
|
+
return $t.call(e) === "[object Number]" && e === e;
|
|
12
|
+
}
|
|
13
|
+
var ge = (e, r) => {
|
|
14
|
+
for (const [t, n] of r)
|
|
15
|
+
e[t] = n;
|
|
16
16
|
return e;
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const Ft = P({
|
|
19
19
|
name: "IconDown",
|
|
20
20
|
props: {
|
|
21
21
|
size: {
|
|
@@ -42,47 +42,47 @@ const $e = I({
|
|
|
42
42
|
click: (e) => !0
|
|
43
43
|
},
|
|
44
44
|
setup(e, {
|
|
45
|
-
emit:
|
|
45
|
+
emit: r
|
|
46
46
|
}) {
|
|
47
|
-
const
|
|
48
|
-
[`${
|
|
49
|
-
}]),
|
|
50
|
-
const
|
|
51
|
-
return e.size && (
|
|
47
|
+
const t = pe("icon"), n = x(() => [t, `${t}-down`, {
|
|
48
|
+
[`${t}-spin`]: e.spin
|
|
49
|
+
}]), l = x(() => {
|
|
50
|
+
const o = {};
|
|
51
|
+
return e.size && (o.fontSize = ye(e.size) ? `${e.size}px` : e.size), e.rotate && (o.transform = `rotate(${e.rotate}deg)`), o;
|
|
52
52
|
});
|
|
53
53
|
return {
|
|
54
|
-
cls:
|
|
55
|
-
innerStyle:
|
|
56
|
-
onClick: (
|
|
57
|
-
|
|
54
|
+
cls: n,
|
|
55
|
+
innerStyle: l,
|
|
56
|
+
onClick: (o) => {
|
|
57
|
+
r("click", o);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), Ot = ["stroke-width", "stroke-linecap", "stroke-linejoin"], _t = /* @__PURE__ */ w("path", {
|
|
62
62
|
d: "M39.6 17.443 24.043 33 8.487 17.443"
|
|
63
|
-
}, null, -1),
|
|
64
|
-
function
|
|
65
|
-
return
|
|
63
|
+
}, null, -1), Mt = [_t];
|
|
64
|
+
function jt(e, r, t, n, l, a) {
|
|
65
|
+
return S(), F("svg", {
|
|
66
66
|
viewBox: "0 0 48 48",
|
|
67
67
|
fill: "none",
|
|
68
68
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
69
|
stroke: "currentColor",
|
|
70
|
-
class:
|
|
71
|
-
style:
|
|
70
|
+
class: re(e.cls),
|
|
71
|
+
style: z(e.innerStyle),
|
|
72
72
|
"stroke-width": e.strokeWidth,
|
|
73
73
|
"stroke-linecap": e.strokeLinecap,
|
|
74
74
|
"stroke-linejoin": e.strokeLinejoin,
|
|
75
|
-
onClick:
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
var
|
|
79
|
-
const
|
|
80
|
-
install: (e,
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
e.component(
|
|
75
|
+
onClick: r[0] || (r[0] = (...o) => e.onClick && e.onClick(...o))
|
|
76
|
+
}, Mt, 14, Ot);
|
|
77
|
+
}
|
|
78
|
+
var ie = /* @__PURE__ */ ge(Ft, [["render", jt]]);
|
|
79
|
+
const It = Object.assign(ie, {
|
|
80
|
+
install: (e, r) => {
|
|
81
|
+
var t;
|
|
82
|
+
const n = (t = r == null ? void 0 : r.iconPrefix) != null ? t : "";
|
|
83
|
+
e.component(n + ie.name, ie);
|
|
84
84
|
}
|
|
85
|
-
}),
|
|
85
|
+
}), Lt = P({
|
|
86
86
|
name: "IconUp",
|
|
87
87
|
props: {
|
|
88
88
|
size: {
|
|
@@ -109,117 +109,820 @@ const xe = Object.assign(x, {
|
|
|
109
109
|
click: (e) => !0
|
|
110
110
|
},
|
|
111
111
|
setup(e, {
|
|
112
|
-
emit:
|
|
112
|
+
emit: r
|
|
113
113
|
}) {
|
|
114
|
-
const
|
|
115
|
-
[`${
|
|
116
|
-
}]),
|
|
117
|
-
const
|
|
118
|
-
return e.size && (
|
|
114
|
+
const t = pe("icon"), n = x(() => [t, `${t}-up`, {
|
|
115
|
+
[`${t}-spin`]: e.spin
|
|
116
|
+
}]), l = x(() => {
|
|
117
|
+
const o = {};
|
|
118
|
+
return e.size && (o.fontSize = ye(e.size) ? `${e.size}px` : e.size), e.rotate && (o.transform = `rotate(${e.rotate}deg)`), o;
|
|
119
119
|
});
|
|
120
120
|
return {
|
|
121
|
-
cls:
|
|
122
|
-
innerStyle:
|
|
123
|
-
onClick: (
|
|
124
|
-
|
|
121
|
+
cls: n,
|
|
122
|
+
innerStyle: l,
|
|
123
|
+
onClick: (o) => {
|
|
124
|
+
r("click", o);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
}),
|
|
128
|
+
}), Tt = ["stroke-width", "stroke-linecap", "stroke-linejoin"], zt = /* @__PURE__ */ w("path", {
|
|
129
129
|
d: "M39.6 30.557 24.043 15 8.487 30.557"
|
|
130
|
-
}, null, -1),
|
|
131
|
-
function
|
|
132
|
-
return
|
|
130
|
+
}, null, -1), Pt = [zt];
|
|
131
|
+
function Rt(e, r, t, n, l, a) {
|
|
132
|
+
return S(), F("svg", {
|
|
133
133
|
viewBox: "0 0 48 48",
|
|
134
134
|
fill: "none",
|
|
135
135
|
xmlns: "http://www.w3.org/2000/svg",
|
|
136
136
|
stroke: "currentColor",
|
|
137
|
-
class:
|
|
138
|
-
style:
|
|
137
|
+
class: re(e.cls),
|
|
138
|
+
style: z(e.innerStyle),
|
|
139
139
|
"stroke-width": e.strokeWidth,
|
|
140
140
|
"stroke-linecap": e.strokeLinecap,
|
|
141
141
|
"stroke-linejoin": e.strokeLinejoin,
|
|
142
|
-
onClick:
|
|
143
|
-
},
|
|
144
|
-
}
|
|
145
|
-
var
|
|
146
|
-
const
|
|
147
|
-
install: (e,
|
|
148
|
-
var
|
|
149
|
-
const
|
|
150
|
-
e.component(
|
|
142
|
+
onClick: r[0] || (r[0] = (...o) => e.onClick && e.onClick(...o))
|
|
143
|
+
}, Pt, 14, Tt);
|
|
144
|
+
}
|
|
145
|
+
var ce = /* @__PURE__ */ ge(Lt, [["render", Rt]]);
|
|
146
|
+
const Nt = Object.assign(ce, {
|
|
147
|
+
install: (e, r) => {
|
|
148
|
+
var t;
|
|
149
|
+
const n = (t = r == null ? void 0 : r.iconPrefix) != null ? t : "";
|
|
150
|
+
e.component(n + ce.name, ce);
|
|
151
|
+
}
|
|
152
|
+
}), Et = P({
|
|
153
|
+
name: "IconSearch",
|
|
154
|
+
props: {
|
|
155
|
+
size: {
|
|
156
|
+
type: [Number, String]
|
|
157
|
+
},
|
|
158
|
+
strokeWidth: {
|
|
159
|
+
type: Number,
|
|
160
|
+
default: 4
|
|
161
|
+
},
|
|
162
|
+
strokeLinecap: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: "butt",
|
|
165
|
+
validator: (e) => ["butt", "round", "square"].includes(e)
|
|
166
|
+
},
|
|
167
|
+
strokeLinejoin: {
|
|
168
|
+
type: String,
|
|
169
|
+
default: "miter",
|
|
170
|
+
validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
|
|
171
|
+
},
|
|
172
|
+
rotate: Number,
|
|
173
|
+
spin: Boolean
|
|
174
|
+
},
|
|
175
|
+
emits: {
|
|
176
|
+
click: (e) => !0
|
|
177
|
+
},
|
|
178
|
+
setup(e, {
|
|
179
|
+
emit: r
|
|
180
|
+
}) {
|
|
181
|
+
const t = pe("icon"), n = x(() => [t, `${t}-search`, {
|
|
182
|
+
[`${t}-spin`]: e.spin
|
|
183
|
+
}]), l = x(() => {
|
|
184
|
+
const o = {};
|
|
185
|
+
return e.size && (o.fontSize = ye(e.size) ? `${e.size}px` : e.size), e.rotate && (o.transform = `rotate(${e.rotate}deg)`), o;
|
|
186
|
+
});
|
|
187
|
+
return {
|
|
188
|
+
cls: n,
|
|
189
|
+
innerStyle: l,
|
|
190
|
+
onClick: (o) => {
|
|
191
|
+
r("click", o);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}), At = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Vt = /* @__PURE__ */ w("path", {
|
|
196
|
+
d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"
|
|
197
|
+
}, null, -1), Bt = [Vt];
|
|
198
|
+
function Dt(e, r, t, n, l, a) {
|
|
199
|
+
return S(), F("svg", {
|
|
200
|
+
viewBox: "0 0 48 48",
|
|
201
|
+
fill: "none",
|
|
202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
203
|
+
stroke: "currentColor",
|
|
204
|
+
class: re(e.cls),
|
|
205
|
+
style: z(e.innerStyle),
|
|
206
|
+
"stroke-width": e.strokeWidth,
|
|
207
|
+
"stroke-linecap": e.strokeLinecap,
|
|
208
|
+
"stroke-linejoin": e.strokeLinejoin,
|
|
209
|
+
onClick: r[0] || (r[0] = (...o) => e.onClick && e.onClick(...o))
|
|
210
|
+
}, Bt, 14, At);
|
|
211
|
+
}
|
|
212
|
+
var se = /* @__PURE__ */ ge(Et, [["render", Dt]]);
|
|
213
|
+
const Wt = Object.assign(se, {
|
|
214
|
+
install: (e, r) => {
|
|
215
|
+
var t;
|
|
216
|
+
const n = (t = r == null ? void 0 : r.iconPrefix) != null ? t : "";
|
|
217
|
+
e.component(n + se.name, se);
|
|
218
|
+
}
|
|
219
|
+
}), ae = Symbol("__MODAL__");
|
|
220
|
+
function Ie(e) {
|
|
221
|
+
return Ke() ? (Qe(e), !0) : !1;
|
|
222
|
+
}
|
|
223
|
+
function j(e) {
|
|
224
|
+
return typeof e == "function" ? e() : He(e);
|
|
225
|
+
}
|
|
226
|
+
const Le = typeof window < "u" && typeof document < "u";
|
|
227
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
228
|
+
const qt = Object.prototype.toString, Ut = (e) => qt.call(e) === "[object Object]", Gt = () => {
|
|
229
|
+
};
|
|
230
|
+
function Yt(e, r = {}) {
|
|
231
|
+
if (!oe(e))
|
|
232
|
+
return Xe(e);
|
|
233
|
+
const t = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
234
|
+
for (const n in e.value)
|
|
235
|
+
t[n] = Je(() => ({
|
|
236
|
+
get() {
|
|
237
|
+
return e.value[n];
|
|
238
|
+
},
|
|
239
|
+
set(l) {
|
|
240
|
+
var a;
|
|
241
|
+
if ((a = j(r.replaceRef)) == null || a)
|
|
242
|
+
if (Array.isArray(e.value)) {
|
|
243
|
+
const o = [...e.value];
|
|
244
|
+
o[n] = l, e.value = o;
|
|
245
|
+
} else {
|
|
246
|
+
const o = { ...e.value, [n]: l };
|
|
247
|
+
Object.setPrototypeOf(o, Object.getPrototypeOf(e.value)), e.value = o;
|
|
248
|
+
}
|
|
249
|
+
else
|
|
250
|
+
e.value[n] = l;
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
return t;
|
|
254
|
+
}
|
|
255
|
+
function Ht(e, r = !0) {
|
|
256
|
+
W() ? D(e) : r ? e() : Me(e);
|
|
257
|
+
}
|
|
258
|
+
function B(e) {
|
|
259
|
+
var r;
|
|
260
|
+
const t = j(e);
|
|
261
|
+
return (r = t == null ? void 0 : t.$el) != null ? r : t;
|
|
262
|
+
}
|
|
263
|
+
const ue = Le ? window : void 0;
|
|
264
|
+
function de(...e) {
|
|
265
|
+
let r, t, n, l;
|
|
266
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([t, n, l] = e, r = ue) : [r, t, n, l] = e, !r)
|
|
267
|
+
return Gt;
|
|
268
|
+
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
269
|
+
const a = [], o = () => {
|
|
270
|
+
a.forEach((u) => u()), a.length = 0;
|
|
271
|
+
}, f = (u, c, i, h) => (u.addEventListener(c, i, h), () => u.removeEventListener(c, i, h)), b = le(
|
|
272
|
+
() => [B(r), j(l)],
|
|
273
|
+
([u, c]) => {
|
|
274
|
+
if (o(), !u)
|
|
275
|
+
return;
|
|
276
|
+
const i = Ut(c) ? { ...c } : c;
|
|
277
|
+
a.push(
|
|
278
|
+
...t.flatMap((h) => n.map((m) => f(u, h, m, i)))
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
{ immediate: !0, flush: "post" }
|
|
282
|
+
), s = () => {
|
|
283
|
+
b(), o();
|
|
284
|
+
};
|
|
285
|
+
return Ie(s), s;
|
|
286
|
+
}
|
|
287
|
+
function Xt() {
|
|
288
|
+
const e = $(!1);
|
|
289
|
+
return W() && D(() => {
|
|
290
|
+
e.value = !0;
|
|
291
|
+
}), e;
|
|
292
|
+
}
|
|
293
|
+
function Jt(e) {
|
|
294
|
+
const r = Xt();
|
|
295
|
+
return x(() => (r.value, !!e()));
|
|
296
|
+
}
|
|
297
|
+
function Kt(e, r = {}) {
|
|
298
|
+
var t, n;
|
|
299
|
+
const {
|
|
300
|
+
pointerTypes: l,
|
|
301
|
+
preventDefault: a,
|
|
302
|
+
stopPropagation: o,
|
|
303
|
+
exact: f,
|
|
304
|
+
onMove: b,
|
|
305
|
+
onEnd: s,
|
|
306
|
+
onStart: u,
|
|
307
|
+
initialValue: c,
|
|
308
|
+
axis: i = "both",
|
|
309
|
+
draggingElement: h = ue,
|
|
310
|
+
containerElement: m,
|
|
311
|
+
handle: k = e
|
|
312
|
+
} = r, p = $(
|
|
313
|
+
(t = j(c)) != null ? t : { x: 0, y: 0 }
|
|
314
|
+
), O = $(), M = (g) => l ? l.includes(g.pointerType) : !0, y = (g) => {
|
|
315
|
+
j(a) && g.preventDefault(), j(o) && g.stopPropagation();
|
|
316
|
+
}, C = (g) => {
|
|
317
|
+
var N;
|
|
318
|
+
if (!M(g) || j(f) && g.target !== j(e))
|
|
319
|
+
return;
|
|
320
|
+
const _ = j(m), E = (N = _ == null ? void 0 : _.getBoundingClientRect) == null ? void 0 : N.call(_), L = j(e).getBoundingClientRect(), T = {
|
|
321
|
+
x: g.clientX - (_ ? L.left - E.left : L.left),
|
|
322
|
+
y: g.clientY - (_ ? L.top - E.top : L.top)
|
|
323
|
+
};
|
|
324
|
+
(u == null ? void 0 : u(T, g)) !== !1 && (O.value = T, y(g));
|
|
325
|
+
}, R = (g) => {
|
|
326
|
+
var N;
|
|
327
|
+
if (!M(g) || !O.value)
|
|
328
|
+
return;
|
|
329
|
+
const _ = j(m), E = (N = _ == null ? void 0 : _.getBoundingClientRect) == null ? void 0 : N.call(_), L = j(e).getBoundingClientRect();
|
|
330
|
+
let { x: T, y: q } = p.value;
|
|
331
|
+
(i === "x" || i === "both") && (T = g.clientX - O.value.x, _ && (T = Math.min(Math.max(0, T), E.width - L.width))), (i === "y" || i === "both") && (q = g.clientY - O.value.y, _ && (q = Math.min(Math.max(0, q), E.height - L.height))), p.value = {
|
|
332
|
+
x: T,
|
|
333
|
+
y: q
|
|
334
|
+
}, b == null || b(p.value, g), y(g);
|
|
335
|
+
}, Q = (g) => {
|
|
336
|
+
M(g) && O.value && (O.value = void 0, s == null || s(p.value, g), y(g));
|
|
337
|
+
};
|
|
338
|
+
if (Le) {
|
|
339
|
+
const g = { capture: (n = r.capture) != null ? n : !0 };
|
|
340
|
+
de(k, "pointerdown", C, g), de(h, "pointermove", R, g), de(h, "pointerup", Q, g);
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
...Yt(p),
|
|
344
|
+
position: p,
|
|
345
|
+
isDragging: x(() => !!O.value),
|
|
346
|
+
style: x(
|
|
347
|
+
() => `left:${p.value.x}px;top:${p.value.y}px;`
|
|
348
|
+
)
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function Qt(e, r, t = {}) {
|
|
352
|
+
const { window: n = ue, ...l } = t;
|
|
353
|
+
let a;
|
|
354
|
+
const o = Jt(() => n && "ResizeObserver" in n), f = () => {
|
|
355
|
+
a && (a.disconnect(), a = void 0);
|
|
356
|
+
}, b = x(() => Array.isArray(e) ? e.map((c) => B(c)) : [B(e)]), s = le(
|
|
357
|
+
b,
|
|
358
|
+
(c) => {
|
|
359
|
+
if (f(), o.value && n) {
|
|
360
|
+
a = new ResizeObserver(r);
|
|
361
|
+
for (const i of c)
|
|
362
|
+
i && a.observe(i, l);
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{ immediate: !0, flush: "post", deep: !0 }
|
|
366
|
+
), u = () => {
|
|
367
|
+
f(), s();
|
|
368
|
+
};
|
|
369
|
+
return Ie(u), {
|
|
370
|
+
isSupported: o,
|
|
371
|
+
stop: u
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function Y(e, r = { width: 0, height: 0 }, t = {}) {
|
|
375
|
+
const { window: n = ue, box: l = "content-box" } = t, a = x(() => {
|
|
376
|
+
var c, i;
|
|
377
|
+
return (i = (c = B(e)) == null ? void 0 : c.namespaceURI) == null ? void 0 : i.includes("svg");
|
|
378
|
+
}), o = $(r.width), f = $(r.height), { stop: b } = Qt(
|
|
379
|
+
e,
|
|
380
|
+
([c]) => {
|
|
381
|
+
const i = l === "border-box" ? c.borderBoxSize : l === "content-box" ? c.contentBoxSize : c.devicePixelContentBoxSize;
|
|
382
|
+
if (n && a.value) {
|
|
383
|
+
const h = B(e);
|
|
384
|
+
if (h) {
|
|
385
|
+
const m = n.getComputedStyle(h);
|
|
386
|
+
o.value = Number.parseFloat(m.width), f.value = Number.parseFloat(m.height);
|
|
387
|
+
}
|
|
388
|
+
} else if (i) {
|
|
389
|
+
const h = Array.isArray(i) ? i : [i];
|
|
390
|
+
o.value = h.reduce((m, { inlineSize: k }) => m + k, 0), f.value = h.reduce((m, { blockSize: k }) => m + k, 0);
|
|
391
|
+
} else
|
|
392
|
+
o.value = c.contentRect.width, f.value = c.contentRect.height;
|
|
393
|
+
},
|
|
394
|
+
t
|
|
395
|
+
);
|
|
396
|
+
Ht(() => {
|
|
397
|
+
const c = B(e);
|
|
398
|
+
c && (o.value = "offsetWidth" in c ? c.offsetWidth : r.width, f.value = "offsetHeight" in c ? c.offsetHeight : r.height);
|
|
399
|
+
});
|
|
400
|
+
const s = le(
|
|
401
|
+
() => B(e),
|
|
402
|
+
(c) => {
|
|
403
|
+
o.value = c ? r.width : 0, f.value = c ? r.height : 0;
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
function u() {
|
|
407
|
+
b(), s();
|
|
408
|
+
}
|
|
409
|
+
return {
|
|
410
|
+
width: o,
|
|
411
|
+
height: f,
|
|
412
|
+
stop: u
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const Zt = (e) => (Ze("data-v-d6dd5541"), e = e(), et(), e), en = { class: "title text-16px font-bold" }, tn = { class: "action" }, nn = ["form"], rn = {
|
|
416
|
+
key: 2,
|
|
417
|
+
class: "modal-loading"
|
|
418
|
+
}, ln = /* @__PURE__ */ Zt(() => /* @__PURE__ */ w("div", { class: "lds-ring" }, [
|
|
419
|
+
/* @__PURE__ */ w("div"),
|
|
420
|
+
/* @__PURE__ */ w("div"),
|
|
421
|
+
/* @__PURE__ */ w("div"),
|
|
422
|
+
/* @__PURE__ */ w("div")
|
|
423
|
+
], -1)), on = [
|
|
424
|
+
ln
|
|
425
|
+
], an = {
|
|
426
|
+
name: "ModalContainer",
|
|
427
|
+
inheritAttrs: !0
|
|
428
|
+
}, un = /* @__PURE__ */ P({
|
|
429
|
+
...an,
|
|
430
|
+
props: {
|
|
431
|
+
id: {},
|
|
432
|
+
form: {},
|
|
433
|
+
component: {},
|
|
434
|
+
componentProps: {},
|
|
435
|
+
width: {},
|
|
436
|
+
maxWidth: {},
|
|
437
|
+
maxHeight: { default: 90 },
|
|
438
|
+
sizes: {},
|
|
439
|
+
size: { default: "middle" },
|
|
440
|
+
fullscreen: { type: Boolean },
|
|
441
|
+
title: {},
|
|
442
|
+
header: { type: Boolean, default: !0 },
|
|
443
|
+
footer: { type: Boolean, default: !1 },
|
|
444
|
+
closeable: { type: Boolean, default: !0 },
|
|
445
|
+
esc: { type: Boolean, default: !1 },
|
|
446
|
+
maskClosable: { type: Boolean, default: !1 },
|
|
447
|
+
draggable: { type: Boolean, default: !1 },
|
|
448
|
+
mode: { default: "dialog" },
|
|
449
|
+
type: {},
|
|
450
|
+
offset: {},
|
|
451
|
+
backgroundColor: {},
|
|
452
|
+
bodyStyle: {},
|
|
453
|
+
submitText: { default: "确定" },
|
|
454
|
+
cancelText: { default: "取消" }
|
|
455
|
+
},
|
|
456
|
+
emits: ["submit"],
|
|
457
|
+
setup(e, { expose: r, emit: t }) {
|
|
458
|
+
const n = e, l = t, a = ne(ae), o = $(!1);
|
|
459
|
+
let f = 0, b = 0;
|
|
460
|
+
const s = A(), u = A(), c = A(), i = A(), h = A(), m = A(), { height: k } = Y(s), { height: p } = Y(c, void 0, { box: "border-box" }), { height: O } = Y(i, void 0, { box: "border-box" }), { height: M } = Y(h), { height: y } = Y(m), { x: C, y: R } = Kt(c, {
|
|
461
|
+
initialValue: { x: 0, y: 0 }
|
|
462
|
+
});
|
|
463
|
+
function Q() {
|
|
464
|
+
a == null || a.close(n.id);
|
|
465
|
+
}
|
|
466
|
+
function g(d) {
|
|
467
|
+
return typeof d == "number" ? `${d}px` : d;
|
|
468
|
+
}
|
|
469
|
+
const N = x(() => {
|
|
470
|
+
const d = {};
|
|
471
|
+
return n.mode === "dialog" && (d.justifyContent = "center"), n.mode === "drawer" && (d.justifyContent = "flex-end"), d;
|
|
472
|
+
}), _ = x(() => {
|
|
473
|
+
const d = {};
|
|
474
|
+
return n.size && (d.width = g(n.sizes[n.size])), n.width && (d.width = g(n.width)), n.maxWidth && (d.maxWidth = g(n.maxWidth)), n.fullscreen && (d.maxWidth = "unset", d.width = "100%", d.position = "fixed", d.top = 0, d.left = 0, d.bottom = 0, d.right = 0, d.borderRadius = 0), n.draggable && !n.fullscreen && n.mode === "dialog" && (d.transform = `translate3d(${C.value - f}px, ${R.value - b}px, 0px)`), n.mode === "drawer" && (d.borderRadius = 0, d.height = "100%"), n.offset && n.mode === "dialog" && (d.marginLeft = `${n.offset.x || 0}px`, d.marginTop = `${n.offset.y || 0}px`), n.backgroundColor && (d.backgroundColor = n.backgroundColor), d;
|
|
475
|
+
}), E = x(() => {
|
|
476
|
+
const d = {};
|
|
477
|
+
return n.draggable && !n.fullscreen && n.mode === "dialog" && (d.cursor = "move"), d;
|
|
478
|
+
}), L = x(() => {
|
|
479
|
+
const d = {}, I = M.value + y.value + p.value + O.value, Se = Math.floor(k.value * (Number(g(n.maxHeight).replace("%", "")) / 100));
|
|
480
|
+
return n.maxHeight && (d.maxHeight = `${Se - I}px`), n.mode === "drawer" && (d.maxHeight = "unset", d.height = `${k.value - I}px`), n.fullscreen && (d.maxHeight = "unset", d.height = `calc(100% - ${I}px)`), n.type !== "component" && (d.padding = "0"), n.bodyStyle && Object.assign(d, n.bodyStyle), d;
|
|
481
|
+
});
|
|
482
|
+
function T() {
|
|
483
|
+
const d = u.value;
|
|
484
|
+
if (n.form && d) {
|
|
485
|
+
const I = d.querySelector(`form[name="${n.form}"]`);
|
|
486
|
+
I && I.dispatchEvent(new Event("submit"));
|
|
487
|
+
}
|
|
488
|
+
l("submit");
|
|
489
|
+
}
|
|
490
|
+
function q() {
|
|
491
|
+
a == null || a.close(n.id);
|
|
492
|
+
}
|
|
493
|
+
function ze() {
|
|
494
|
+
window && window.addEventListener("resize", () => {
|
|
495
|
+
K(s), K(u), u.value && (f = u.value.offsetLeft, b = u.value.offsetTop);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
function Pe() {
|
|
499
|
+
if (n.closeable && n.esc) {
|
|
500
|
+
const d = ({ key: I }) => {
|
|
501
|
+
I === "Escape" && (a == null || a.close(n.id), window.removeEventListener("keydown", d));
|
|
502
|
+
};
|
|
503
|
+
window.addEventListener("keydown", d);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function Re() {
|
|
507
|
+
f = u.value.offsetLeft, b = u.value.offsetTop;
|
|
508
|
+
}
|
|
509
|
+
D(() => {
|
|
510
|
+
Pe(), ze();
|
|
511
|
+
}), qe(() => {
|
|
512
|
+
});
|
|
513
|
+
function Ne() {
|
|
514
|
+
return o.value = !0, () => we();
|
|
515
|
+
}
|
|
516
|
+
function we() {
|
|
517
|
+
o.value = !1;
|
|
518
|
+
}
|
|
519
|
+
return r({
|
|
520
|
+
showLoading: Ne,
|
|
521
|
+
hideLoading: we
|
|
522
|
+
}), (d, I) => (S(), F("div", {
|
|
523
|
+
ref_key: "wrapperRef",
|
|
524
|
+
ref: s,
|
|
525
|
+
class: "modal-wrapper",
|
|
526
|
+
style: z(N.value),
|
|
527
|
+
onClick: I[0] || (I[0] = Ue((Se) => d.maskClosable && Q(), ["self"]))
|
|
528
|
+
}, [
|
|
529
|
+
w("div", {
|
|
530
|
+
ref_key: "contentRef",
|
|
531
|
+
ref: u,
|
|
532
|
+
class: re(["modal-content", { [`${d.mode}-mode`]: !0 }]),
|
|
533
|
+
style: z(_.value)
|
|
534
|
+
}, [
|
|
535
|
+
d.header ? (S(), F("div", {
|
|
536
|
+
key: 0,
|
|
537
|
+
ref_key: "headerRef",
|
|
538
|
+
ref: c,
|
|
539
|
+
class: "modal-header",
|
|
540
|
+
style: z(E.value),
|
|
541
|
+
onMousedown: Re
|
|
542
|
+
}, [
|
|
543
|
+
w("div", en, V(d.title), 1),
|
|
544
|
+
w("div", tn, [
|
|
545
|
+
d.closeable ? (S(), F("div", {
|
|
546
|
+
key: 0,
|
|
547
|
+
class: "i-icon-park-outline:close block cursor-pointer",
|
|
548
|
+
onClick: Q
|
|
549
|
+
})) : G("", !0)
|
|
550
|
+
])
|
|
551
|
+
], 36)) : G("", !0),
|
|
552
|
+
w("div", {
|
|
553
|
+
id: "modal-header-slot",
|
|
554
|
+
ref_key: "headerSlotRef",
|
|
555
|
+
ref: h
|
|
556
|
+
}, null, 512),
|
|
557
|
+
w("div", {
|
|
558
|
+
class: "modal-body",
|
|
559
|
+
style: z(L.value)
|
|
560
|
+
}, [
|
|
561
|
+
(S(), te(_e(d.component), Ge(Ye(d.componentProps)), null, 16))
|
|
562
|
+
], 4),
|
|
563
|
+
w("div", {
|
|
564
|
+
id: "modal-footer-slot",
|
|
565
|
+
ref_key: "footerSlotRef",
|
|
566
|
+
ref: m
|
|
567
|
+
}, null, 512),
|
|
568
|
+
d.footer ? (S(), F("div", {
|
|
569
|
+
key: 1,
|
|
570
|
+
ref_key: "footerRef",
|
|
571
|
+
ref: i,
|
|
572
|
+
class: "modal-footer space-x-2"
|
|
573
|
+
}, [
|
|
574
|
+
w("button", {
|
|
575
|
+
class: "cancel-button",
|
|
576
|
+
type: "button",
|
|
577
|
+
onClick: q
|
|
578
|
+
}, V(d.cancelText), 1),
|
|
579
|
+
w("button", {
|
|
580
|
+
class: "submit-button",
|
|
581
|
+
form: d.form,
|
|
582
|
+
type: "submit",
|
|
583
|
+
onClick: T
|
|
584
|
+
}, V(d.submitText), 9, nn)
|
|
585
|
+
], 512)) : G("", !0),
|
|
586
|
+
o.value ? (S(), F("div", rn, on)) : G("", !0)
|
|
587
|
+
], 6)
|
|
588
|
+
], 4));
|
|
589
|
+
}
|
|
590
|
+
}), be = (e, r) => {
|
|
591
|
+
const t = e.__vccOpts || e;
|
|
592
|
+
for (const [n, l] of r)
|
|
593
|
+
t[n] = l;
|
|
594
|
+
return t;
|
|
595
|
+
}, cn = /* @__PURE__ */ be(un, [["__scopeId", "data-v-d6dd5541"]]), sn = { class: "modal-dialog" }, dn = { class: "dialog-body" }, fn = { class: "dialog-title" }, mn = { class: "dialog-content" }, hn = /* @__PURE__ */ P({
|
|
596
|
+
__name: "modal-dialog",
|
|
597
|
+
props: {
|
|
598
|
+
type: {},
|
|
599
|
+
title: {},
|
|
600
|
+
content: {},
|
|
601
|
+
okText: { default: "确定" },
|
|
602
|
+
cancelText: { default: "取消" },
|
|
603
|
+
onOk: {},
|
|
604
|
+
onCancel: {},
|
|
605
|
+
footer: {}
|
|
606
|
+
},
|
|
607
|
+
setup(e) {
|
|
608
|
+
const r = e, t = Te(), n = x(() => r.title ? r.title : {
|
|
609
|
+
confirm: "提示",
|
|
610
|
+
info: "提示",
|
|
611
|
+
warning: "警告",
|
|
612
|
+
error: "错误",
|
|
613
|
+
success: "成功"
|
|
614
|
+
}[r.type]);
|
|
615
|
+
async function l() {
|
|
616
|
+
r.onOk && await r.onOk(), t.close();
|
|
617
|
+
}
|
|
618
|
+
async function a() {
|
|
619
|
+
r.onCancel && await r.onCancel(), t.close();
|
|
620
|
+
}
|
|
621
|
+
return (o, f) => (S(), F("section", sn, [
|
|
622
|
+
w("div", dn, [
|
|
623
|
+
w("div", fn, V(n.value), 1),
|
|
624
|
+
w("div", mn, V(o.content), 1)
|
|
625
|
+
]),
|
|
626
|
+
w("div", {
|
|
627
|
+
class: "dialog-footer space-x-2",
|
|
628
|
+
style: z(o.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
|
|
629
|
+
}, [
|
|
630
|
+
o.footer ? (S(), te(_e(o.footer), { key: 0 })) : (S(), F(me, { key: 1 }, [
|
|
631
|
+
w("button", {
|
|
632
|
+
class: "submit-button",
|
|
633
|
+
type: "submit",
|
|
634
|
+
onClick: l
|
|
635
|
+
}, V(o.okText), 1),
|
|
636
|
+
o.type === "confirm" ? (S(), F("button", {
|
|
637
|
+
key: 0,
|
|
638
|
+
class: "cancel-button",
|
|
639
|
+
type: "button",
|
|
640
|
+
onClick: a
|
|
641
|
+
}, V(o.cancelText), 1)) : G("", !0)
|
|
642
|
+
], 64))
|
|
643
|
+
], 4)
|
|
644
|
+
]));
|
|
151
645
|
}
|
|
152
|
-
}),
|
|
646
|
+
}), vn = /* @__PURE__ */ be(hn, [["__scopeId", "data-v-8326e5a5"]]), pn = {
|
|
647
|
+
key: 0,
|
|
648
|
+
class: "modal-teleport"
|
|
649
|
+
}, yn = {
|
|
650
|
+
name: "ModalProvider",
|
|
651
|
+
inheritAttrs: !0
|
|
652
|
+
}, gn = /* @__PURE__ */ P({
|
|
653
|
+
...yn,
|
|
654
|
+
props: {
|
|
655
|
+
appendToBody: { type: [Boolean, String], default: !1 },
|
|
656
|
+
sizes: { default: () => ({
|
|
657
|
+
small: 520,
|
|
658
|
+
middle: 860,
|
|
659
|
+
large: 1190
|
|
660
|
+
}) },
|
|
661
|
+
maxWidth: { default: "90%" },
|
|
662
|
+
maxHeight: { default: "90%" },
|
|
663
|
+
offset: { default: () => ({ x: 0, y: 0 }) }
|
|
664
|
+
},
|
|
665
|
+
setup(e, { expose: r }) {
|
|
666
|
+
const t = A([]), n = $(!1), l = W();
|
|
667
|
+
function a(i, h = {}, m = {}) {
|
|
668
|
+
const k = We(
|
|
669
|
+
() => Promise.resolve(typeof i == "string" ? vn : i)
|
|
670
|
+
);
|
|
671
|
+
typeof i == "string" && (h.type = i, m.size = "small", m.fullscreen = !1, m.mode = "dialog", m.footer = !1, m.header = !1);
|
|
672
|
+
const p = Math.random().toString(32).slice(2), O = new Promise((M, y) => {
|
|
673
|
+
t.value.push({
|
|
674
|
+
id: p,
|
|
675
|
+
component: k,
|
|
676
|
+
props: h || {},
|
|
677
|
+
options: {
|
|
678
|
+
...m,
|
|
679
|
+
type: typeof i == "string" ? i : "component"
|
|
680
|
+
},
|
|
681
|
+
resolve: M,
|
|
682
|
+
reject: y,
|
|
683
|
+
listeners: []
|
|
684
|
+
}), K(t);
|
|
685
|
+
}).catch((M) => M === "CANCEL" ? new Promise(() => {
|
|
686
|
+
}) : Promise.reject(M));
|
|
687
|
+
return Object.assign(O, {
|
|
688
|
+
close: () => o(p)
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
function o(i, h) {
|
|
692
|
+
const m = t.value.findIndex((p) => p.id === i);
|
|
693
|
+
if (m < 0)
|
|
694
|
+
return;
|
|
695
|
+
const k = t.value[m];
|
|
696
|
+
h === void 0 ? k == null || k.reject("CANCEL") : k == null || k.resolve(h), t.value.splice(m, 1), K(t);
|
|
697
|
+
}
|
|
698
|
+
function f() {
|
|
699
|
+
!t.value || t.value.length === 0 || (t.value.forEach((i) => {
|
|
700
|
+
i == null || i.reject("CANCEL");
|
|
701
|
+
}), t.value = [], K(t));
|
|
702
|
+
}
|
|
703
|
+
function b(i, h) {
|
|
704
|
+
const m = t.value.find((p) => p.id === i);
|
|
705
|
+
if (!m)
|
|
706
|
+
return;
|
|
707
|
+
const k = m.listeners.find((p) => p.event === h);
|
|
708
|
+
k && k.callback({
|
|
709
|
+
open: a,
|
|
710
|
+
close: (p) => o(m.id, p),
|
|
711
|
+
closeAll: f,
|
|
712
|
+
showLoading: () => s(m.id),
|
|
713
|
+
hideLoading: () => u(m.id),
|
|
714
|
+
confirm: (p) => a("confirm", p),
|
|
715
|
+
success: (p) => a("success", p),
|
|
716
|
+
error: (p) => a("error", p),
|
|
717
|
+
warning: (p) => a("warning", p),
|
|
718
|
+
info: (p) => a("info", p)
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
function s(i) {
|
|
722
|
+
if (!l)
|
|
723
|
+
return;
|
|
724
|
+
const [h] = l.refs[`modal-container_${i}`];
|
|
725
|
+
if (h)
|
|
726
|
+
return h.showLoading();
|
|
727
|
+
}
|
|
728
|
+
function u(i) {
|
|
729
|
+
if (!l)
|
|
730
|
+
return;
|
|
731
|
+
const [h] = l.refs[`modal-container_${i}`];
|
|
732
|
+
if (h)
|
|
733
|
+
return h.hideLoading();
|
|
734
|
+
}
|
|
735
|
+
function c(i, h, m) {
|
|
736
|
+
const k = t.value.find((p) => p.id === i);
|
|
737
|
+
k && k.listeners.push({
|
|
738
|
+
event: h,
|
|
739
|
+
callback: m
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
return fe(ae, {
|
|
743
|
+
open: a,
|
|
744
|
+
close: o,
|
|
745
|
+
closeAll: f,
|
|
746
|
+
addEventListener: c
|
|
747
|
+
}), r({
|
|
748
|
+
elements: t,
|
|
749
|
+
open: a,
|
|
750
|
+
close: o,
|
|
751
|
+
closeAll: f
|
|
752
|
+
}), D(() => {
|
|
753
|
+
n.value = !0;
|
|
754
|
+
}), (i, h) => (S(), F(me, null, [
|
|
755
|
+
Ee(i.$slots, "default", {}, void 0, !0),
|
|
756
|
+
n.value ? (S(), F("div", pn, [
|
|
757
|
+
(S(), te(Ae, {
|
|
758
|
+
disabled: !i.appendToBody,
|
|
759
|
+
to: typeof i.appendToBody == "string" ? i.appendToBody : "body"
|
|
760
|
+
}, [
|
|
761
|
+
v(Ve, { name: "modal-fade" }, {
|
|
762
|
+
default: Be(() => [
|
|
763
|
+
(S(!0), F(me, null, De(t.value, (m) => (S(), te(cn, Oe({
|
|
764
|
+
id: m.id,
|
|
765
|
+
key: m.id,
|
|
766
|
+
ref_for: !0,
|
|
767
|
+
ref: `modal-container_${m.id}`,
|
|
768
|
+
component: m.component,
|
|
769
|
+
"component-props": m.props,
|
|
770
|
+
"max-height": i.maxHeight,
|
|
771
|
+
"max-width": i.maxWidth,
|
|
772
|
+
offset: i.offset,
|
|
773
|
+
sizes: i.sizes
|
|
774
|
+
}, m.options, {
|
|
775
|
+
onSubmit: () => b(m.id, "submit")
|
|
776
|
+
}), null, 16, ["id", "component", "component-props", "max-height", "max-width", "offset", "sizes", "onSubmit"]))), 128))
|
|
777
|
+
]),
|
|
778
|
+
_: 1
|
|
779
|
+
})
|
|
780
|
+
], 8, ["disabled", "to"]))
|
|
781
|
+
])) : G("", !0)
|
|
782
|
+
], 64));
|
|
783
|
+
}
|
|
784
|
+
}), bn = /* @__PURE__ */ be(gn, [["__scopeId", "data-v-241a8304"]]);
|
|
785
|
+
function ee(e, r) {
|
|
786
|
+
var t, n;
|
|
787
|
+
let l = e == null ? void 0 : e.parent;
|
|
788
|
+
for (; l && ((t = l == null ? void 0 : l.type) == null ? void 0 : t.name) !== r; )
|
|
789
|
+
l = l.parent;
|
|
790
|
+
return ((n = l == null ? void 0 : l.type) == null ? void 0 : n.name) === r ? l : null;
|
|
791
|
+
}
|
|
792
|
+
function Te() {
|
|
793
|
+
const e = ne(ae), r = W();
|
|
794
|
+
function t(n, l, a) {
|
|
795
|
+
if (!e)
|
|
796
|
+
throw new Error("Not Found Modal Provider Component");
|
|
797
|
+
return e.open(n, l, a);
|
|
798
|
+
}
|
|
799
|
+
return {
|
|
800
|
+
open: t,
|
|
801
|
+
close(n) {
|
|
802
|
+
var l;
|
|
803
|
+
if (!e)
|
|
804
|
+
throw new Error("Not Found Modal Provider Component");
|
|
805
|
+
const a = ee(r, "ModalContainer"), o = (l = a == null ? void 0 : a.props) == null ? void 0 : l.id;
|
|
806
|
+
if (!o)
|
|
807
|
+
throw new Error("Not Found Current Modal Container");
|
|
808
|
+
e.close(o, n);
|
|
809
|
+
},
|
|
810
|
+
closeAll() {
|
|
811
|
+
if (!e)
|
|
812
|
+
throw new Error("Not Found Modal Provider Component");
|
|
813
|
+
e.closeAll();
|
|
814
|
+
},
|
|
815
|
+
showLoading() {
|
|
816
|
+
var n;
|
|
817
|
+
if (!e)
|
|
818
|
+
throw new Error("Not Found Modal Provider Component");
|
|
819
|
+
const l = ee(r, "ModalContainer");
|
|
820
|
+
if (!((n = l == null ? void 0 : l.props) != null && n.id))
|
|
821
|
+
throw new Error("Not Found Current Modal Container");
|
|
822
|
+
l != null && l.exposed && (l == null || l.exposed.showLoading());
|
|
823
|
+
},
|
|
824
|
+
hideLoading() {
|
|
825
|
+
var n;
|
|
826
|
+
if (!e)
|
|
827
|
+
throw new Error("Not Found Modal Provider Component");
|
|
828
|
+
const l = ee(r, "ModalContainer");
|
|
829
|
+
if (!((n = l == null ? void 0 : l.props) != null && n.id))
|
|
830
|
+
throw new Error("Not Found Current Modal Container");
|
|
831
|
+
l != null && l.exposed && (l == null || l.exposed.hideLoading());
|
|
832
|
+
},
|
|
833
|
+
confirm(n) {
|
|
834
|
+
return this.open("confirm", n);
|
|
835
|
+
},
|
|
836
|
+
info(n) {
|
|
837
|
+
return this.open("info", n);
|
|
838
|
+
},
|
|
839
|
+
error(n) {
|
|
840
|
+
return this.open("error", n);
|
|
841
|
+
},
|
|
842
|
+
warning(n) {
|
|
843
|
+
return this.open("warning", n);
|
|
844
|
+
},
|
|
845
|
+
success(n) {
|
|
846
|
+
return this.open("success", n);
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
function kn(e) {
|
|
851
|
+
var r;
|
|
852
|
+
const t = ne(ae), n = W(), l = ee(n, "ModalContainer"), a = (r = l == null ? void 0 : l.props) == null ? void 0 : r.id;
|
|
853
|
+
t && a && t.addEventListener(a, "submit", e);
|
|
854
|
+
}
|
|
855
|
+
const $e = {
|
|
153
856
|
id: Symbol("ID"),
|
|
154
857
|
source: Symbol("Source")
|
|
155
858
|
};
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
return e == null || e.forEach((
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
}), [
|
|
162
|
-
|
|
859
|
+
function wn(e, r) {
|
|
860
|
+
const t = $({});
|
|
861
|
+
return e == null || e.forEach((l) => {
|
|
862
|
+
let a = null;
|
|
863
|
+
l.default && (a = (typeof l.default == "function" ? l.default() : l.default) || null), r && r[l.key] !== void 0 && (a = r[l.key]), t.value[l.key] = a;
|
|
864
|
+
}), [t, (l) => {
|
|
865
|
+
t.value = l;
|
|
163
866
|
}];
|
|
164
867
|
}
|
|
165
|
-
function
|
|
166
|
-
function t
|
|
167
|
-
return e != null && e.disabledDate ? e.disabledDate(
|
|
868
|
+
function Sn(e) {
|
|
869
|
+
function r(t, n) {
|
|
870
|
+
return e != null && e.disabledDate ? e.disabledDate(t, n) : !1;
|
|
168
871
|
}
|
|
169
|
-
return (
|
|
872
|
+
return (t, n) => {
|
|
170
873
|
switch (e == null ? void 0 : e.type) {
|
|
171
874
|
case "week":
|
|
172
|
-
return
|
|
173
|
-
modelValue:
|
|
174
|
-
"onUpdate:modelValue": (
|
|
175
|
-
"disabled-date":
|
|
875
|
+
return v(ut, {
|
|
876
|
+
modelValue: t[n.key],
|
|
877
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
878
|
+
"disabled-date": r,
|
|
176
879
|
format: e == null ? void 0 : e.labelFormat,
|
|
177
880
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
178
881
|
}, null);
|
|
179
882
|
case "month":
|
|
180
|
-
return
|
|
181
|
-
modelValue:
|
|
182
|
-
"onUpdate:modelValue": (
|
|
183
|
-
"disabled-date":
|
|
883
|
+
return v(at, {
|
|
884
|
+
modelValue: t[n.key],
|
|
885
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
886
|
+
"disabled-date": r,
|
|
184
887
|
format: e == null ? void 0 : e.labelFormat,
|
|
185
888
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
186
889
|
}, null);
|
|
187
890
|
case "quarter":
|
|
188
|
-
return
|
|
189
|
-
modelValue:
|
|
190
|
-
"onUpdate:modelValue": (
|
|
191
|
-
"disabled-date":
|
|
891
|
+
return v(ot, {
|
|
892
|
+
modelValue: t[n.key],
|
|
893
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
894
|
+
"disabled-date": r,
|
|
192
895
|
format: e == null ? void 0 : e.labelFormat,
|
|
193
896
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
194
897
|
}, null);
|
|
195
898
|
case "year":
|
|
196
|
-
return
|
|
197
|
-
modelValue:
|
|
198
|
-
"onUpdate:modelValue": (
|
|
199
|
-
"disabled-date":
|
|
899
|
+
return v(lt, {
|
|
900
|
+
modelValue: t[n.key],
|
|
901
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
902
|
+
"disabled-date": r,
|
|
200
903
|
format: e == null ? void 0 : e.labelFormat,
|
|
201
904
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
202
905
|
}, null);
|
|
203
906
|
case "date":
|
|
204
907
|
default:
|
|
205
|
-
return
|
|
908
|
+
return v(rt, {
|
|
206
909
|
"disabled-input": !0,
|
|
207
|
-
modelValue:
|
|
208
|
-
"onUpdate:modelValue": (
|
|
209
|
-
"disabled-date":
|
|
910
|
+
modelValue: t[n.key],
|
|
911
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
912
|
+
"disabled-date": r,
|
|
210
913
|
format: e == null ? void 0 : e.labelFormat,
|
|
211
914
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
212
915
|
}, null);
|
|
213
916
|
}
|
|
214
917
|
};
|
|
215
918
|
}
|
|
216
|
-
function
|
|
217
|
-
return (
|
|
919
|
+
function xn(e) {
|
|
920
|
+
return (r, t) => {
|
|
218
921
|
switch (e == null ? void 0 : e.type) {
|
|
219
922
|
case "number":
|
|
220
|
-
return
|
|
221
|
-
modelValue: t
|
|
222
|
-
"onUpdate:modelValue": (
|
|
923
|
+
return v(ct, {
|
|
924
|
+
modelValue: r[t.key],
|
|
925
|
+
"onUpdate:modelValue": (n) => r[t.key] = n,
|
|
223
926
|
hideButton: !0,
|
|
224
927
|
"read-only": e == null ? void 0 : e.readonly,
|
|
225
928
|
placeholder: e == null ? void 0 : e.placeholder,
|
|
@@ -227,9 +930,9 @@ function Pe(e) {
|
|
|
227
930
|
}, null);
|
|
228
931
|
case "string":
|
|
229
932
|
default:
|
|
230
|
-
return
|
|
231
|
-
modelValue: t
|
|
232
|
-
"onUpdate:modelValue": (
|
|
933
|
+
return v(it, {
|
|
934
|
+
modelValue: r[t.key],
|
|
935
|
+
"onUpdate:modelValue": (n) => r[t.key] = n,
|
|
233
936
|
placeholder: e == null ? void 0 : e.placeholder,
|
|
234
937
|
readonly: e == null ? void 0 : e.readonly,
|
|
235
938
|
allowClear: e == null ? void 0 : e.clearable
|
|
@@ -238,317 +941,379 @@ function Pe(e) {
|
|
|
238
941
|
};
|
|
239
942
|
}
|
|
240
943
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
function
|
|
246
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
247
|
-
}
|
|
248
|
-
const
|
|
249
|
-
function
|
|
250
|
-
const e =
|
|
251
|
-
return [e, (
|
|
252
|
-
}
|
|
253
|
-
function
|
|
254
|
-
let
|
|
255
|
-
const [
|
|
256
|
-
if (!e.autoSumbit || !
|
|
944
|
+
function ke(e, r, t) {
|
|
945
|
+
const n = le(e, (...l) => (Me(() => n()), r(...l)), t);
|
|
946
|
+
return n;
|
|
947
|
+
}
|
|
948
|
+
function Cn(e) {
|
|
949
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ve(e);
|
|
950
|
+
}
|
|
951
|
+
const H = /* @__PURE__ */ new WeakMap();
|
|
952
|
+
function $n() {
|
|
953
|
+
const e = $(/* @__PURE__ */ new Map());
|
|
954
|
+
return [e, (t) => e.value = t];
|
|
955
|
+
}
|
|
956
|
+
function Fn(e) {
|
|
957
|
+
let r, t = !1;
|
|
958
|
+
const [n, l] = $n(), a = () => {
|
|
959
|
+
if (!e.autoSumbit || !r)
|
|
257
960
|
return;
|
|
258
|
-
let
|
|
259
|
-
for (;
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
},
|
|
263
|
-
const c =
|
|
264
|
-
c instanceof Promise ? c.then(
|
|
265
|
-
},
|
|
266
|
-
const
|
|
267
|
-
switch (typeof
|
|
961
|
+
let s = r;
|
|
962
|
+
for (; s && s.$el.tagName !== "FORM"; )
|
|
963
|
+
s = s.$parent;
|
|
964
|
+
s && s.$el && s.$el.dispatchEvent(new Event("submit"));
|
|
965
|
+
}, o = (s, u) => {
|
|
966
|
+
const c = s();
|
|
967
|
+
c instanceof Promise ? c.then(u) : u(c);
|
|
968
|
+
}, f = async () => {
|
|
969
|
+
const s = H.get(e.options);
|
|
970
|
+
switch (typeof s) {
|
|
268
971
|
case "function":
|
|
269
|
-
|
|
972
|
+
H.set(e.options, l);
|
|
270
973
|
return;
|
|
271
974
|
case "object":
|
|
272
|
-
|
|
975
|
+
l(s);
|
|
273
976
|
return;
|
|
274
977
|
}
|
|
275
|
-
|
|
276
|
-
const c =
|
|
277
|
-
|
|
978
|
+
H.set(e.options, l), o(e.options, (u) => {
|
|
979
|
+
const c = H.get(e.options);
|
|
980
|
+
H.set(e.options, u), c(u);
|
|
278
981
|
});
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
|
|
982
|
+
}, b = () => {
|
|
983
|
+
o(e.options, (s) => {
|
|
984
|
+
l(s);
|
|
282
985
|
});
|
|
283
986
|
};
|
|
284
987
|
switch (!0) {
|
|
285
988
|
case e.options instanceof Function: {
|
|
286
|
-
e.cache !== !1 ?
|
|
989
|
+
e.cache !== !1 ? f() : b();
|
|
287
990
|
break;
|
|
288
991
|
}
|
|
289
|
-
case
|
|
290
|
-
|
|
291
|
-
|
|
992
|
+
case oe(e.options): {
|
|
993
|
+
ke(e.options, () => {
|
|
994
|
+
l(e.options.value);
|
|
292
995
|
}, {
|
|
293
996
|
immediate: !0
|
|
294
997
|
});
|
|
295
998
|
break;
|
|
296
999
|
}
|
|
297
1000
|
default:
|
|
298
|
-
|
|
1001
|
+
n.value = e.options;
|
|
299
1002
|
}
|
|
300
|
-
return (
|
|
1003
|
+
return (s, u) => {
|
|
301
1004
|
let c;
|
|
302
|
-
return e.default && !
|
|
303
|
-
ref: (
|
|
1005
|
+
return e.default && !t && (s[u.key] = e.default, t = !0), v(st, {
|
|
1006
|
+
ref: (i) => r = i,
|
|
304
1007
|
multiple: e.multiple,
|
|
305
|
-
modelValue: u
|
|
306
|
-
"onUpdate:modelValue": (
|
|
1008
|
+
modelValue: s[u.key],
|
|
1009
|
+
"onUpdate:modelValue": (i) => s[u.key] = i,
|
|
307
1010
|
placeholder: e.placeholder,
|
|
308
1011
|
allowClear: e.clearable,
|
|
309
1012
|
allowSearch: e.searchable,
|
|
310
1013
|
maxTagCount: e.maxTagCount ?? 2,
|
|
311
|
-
onChange:
|
|
312
|
-
},
|
|
313
|
-
key:
|
|
314
|
-
value:
|
|
315
|
-
label:
|
|
1014
|
+
onChange: a
|
|
1015
|
+
}, Cn(c = Array.from(n.value.entries()).map(([i, h]) => v(dt, {
|
|
1016
|
+
key: i,
|
|
1017
|
+
value: i,
|
|
1018
|
+
label: h
|
|
316
1019
|
}, null))) ? c : {
|
|
317
1020
|
default: () => [c]
|
|
318
1021
|
});
|
|
319
1022
|
};
|
|
320
1023
|
}
|
|
321
|
-
function
|
|
322
|
-
function
|
|
1024
|
+
function On(e) {
|
|
1025
|
+
function r() {
|
|
323
1026
|
e != null && e.autoSumbit;
|
|
324
1027
|
}
|
|
325
|
-
return (
|
|
326
|
-
modelValue:
|
|
327
|
-
"onUpdate:modelValue": (
|
|
1028
|
+
return (t, n) => (e != null && e.default && (t[n.key] = e.default), v(ft, {
|
|
1029
|
+
modelValue: t[n.key],
|
|
1030
|
+
"onUpdate:modelValue": (l) => t[n.key] = l,
|
|
328
1031
|
checkedText: (e == null ? void 0 : e.openLabel) ?? "是",
|
|
329
1032
|
uncheckedText: (e == null ? void 0 : e.closeLabel) ?? "否",
|
|
330
1033
|
checkedValue: (e == null ? void 0 : e.openValue) ?? !0,
|
|
331
1034
|
uncheckedValue: (e == null ? void 0 : e.closeValue) ?? !1,
|
|
332
|
-
onChange:
|
|
1035
|
+
onChange: r
|
|
333
1036
|
}, null));
|
|
334
1037
|
}
|
|
335
|
-
function
|
|
336
|
-
return (
|
|
337
|
-
let
|
|
338
|
-
function
|
|
339
|
-
|
|
1038
|
+
function _n(e) {
|
|
1039
|
+
return (r, t) => {
|
|
1040
|
+
let n = [];
|
|
1041
|
+
function l(f) {
|
|
1042
|
+
n = f;
|
|
340
1043
|
}
|
|
341
|
-
function
|
|
342
|
-
if (
|
|
343
|
-
const [
|
|
344
|
-
t
|
|
1044
|
+
function a(f) {
|
|
1045
|
+
if (f && f.length === 2) {
|
|
1046
|
+
const [b, s] = f.sort(), u = Ce(b).startOf("days"), c = Ce(s).endOf("days");
|
|
1047
|
+
r[t.key] = [u.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD"), c.format((e == null ? void 0 : e.valueFormat) || "YYYY-MM-DD")];
|
|
345
1048
|
}
|
|
346
1049
|
}
|
|
347
|
-
function
|
|
348
|
-
return e != null && e.disabledDate ? e.disabledDate(
|
|
1050
|
+
function o(f) {
|
|
1051
|
+
return e != null && e.disabledDate ? e.disabledDate(n, f) : !1;
|
|
349
1052
|
}
|
|
350
|
-
return
|
|
1053
|
+
return v("div", null, [v(mt, {
|
|
351
1054
|
"disabled-input": !0,
|
|
352
1055
|
style: {
|
|
353
1056
|
width: "300px"
|
|
354
1057
|
},
|
|
355
|
-
modelValue: t
|
|
356
|
-
"onUpdate:modelValue": (
|
|
357
|
-
onSelect:
|
|
358
|
-
onChange:
|
|
1058
|
+
modelValue: r[t.key],
|
|
1059
|
+
"onUpdate:modelValue": (f) => r[t.key] = f,
|
|
1060
|
+
onSelect: l,
|
|
1061
|
+
onChange: a,
|
|
359
1062
|
mode: e == null ? void 0 : e.type,
|
|
360
1063
|
allowClear: e == null ? void 0 : e.clearable,
|
|
361
|
-
"disabled-date":
|
|
1064
|
+
"disabled-date": o,
|
|
362
1065
|
format: e == null ? void 0 : e.labelFormat,
|
|
363
1066
|
"value-format": e == null ? void 0 : e.valueFormat
|
|
364
1067
|
}, null)]);
|
|
365
1068
|
};
|
|
366
1069
|
}
|
|
367
|
-
function
|
|
368
|
-
return (
|
|
369
|
-
modelValue: t
|
|
370
|
-
"onUpdate:modelValue": (
|
|
1070
|
+
function Mn(e) {
|
|
1071
|
+
return (r, t) => v(ht, {
|
|
1072
|
+
modelValue: r[t.key],
|
|
1073
|
+
"onUpdate:modelValue": (n) => r[t.key] = n,
|
|
371
1074
|
placeholder: e == null ? void 0 : e.placeholder,
|
|
372
1075
|
autoSize: e == null ? void 0 : e.autosize,
|
|
373
1076
|
maxLength: e == null ? void 0 : e.maxLength
|
|
374
1077
|
}, null);
|
|
375
1078
|
}
|
|
376
|
-
const
|
|
377
|
-
function
|
|
378
|
-
const e =
|
|
379
|
-
return [e, (
|
|
1079
|
+
const X = /* @__PURE__ */ new WeakMap();
|
|
1080
|
+
function jn() {
|
|
1081
|
+
const e = $([]);
|
|
1082
|
+
return [e, (t) => e.value = t];
|
|
380
1083
|
}
|
|
381
|
-
function
|
|
382
|
-
let
|
|
383
|
-
const [
|
|
384
|
-
if (!e.autoSumbit || !
|
|
1084
|
+
function In(e) {
|
|
1085
|
+
let r, t = !1;
|
|
1086
|
+
const [n, l] = jn(), a = () => {
|
|
1087
|
+
if (!e.autoSumbit || !r)
|
|
385
1088
|
return;
|
|
386
|
-
let
|
|
387
|
-
for (;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
const
|
|
395
|
-
switch (typeof
|
|
1089
|
+
let u = r;
|
|
1090
|
+
for (; u && u.$el.tagName !== "FORM"; )
|
|
1091
|
+
u = u.$parent;
|
|
1092
|
+
u && u.$el && u.$el.dispatchEvent(new Event("submit"));
|
|
1093
|
+
}, o = (u, c) => {
|
|
1094
|
+
const i = u();
|
|
1095
|
+
i instanceof Promise ? i.then(c) : c(i);
|
|
1096
|
+
}, f = async () => {
|
|
1097
|
+
const u = X.get(e.options);
|
|
1098
|
+
switch (typeof u) {
|
|
396
1099
|
case "function":
|
|
397
|
-
|
|
1100
|
+
X.set(e.options, l);
|
|
398
1101
|
return;
|
|
399
1102
|
case "object":
|
|
400
|
-
|
|
1103
|
+
l(u);
|
|
401
1104
|
return;
|
|
402
1105
|
}
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
|
|
1106
|
+
X.set(e.options, l), o(e.options, (c) => {
|
|
1107
|
+
const i = X.get(e.options);
|
|
1108
|
+
X.set(e.options, c), i(c);
|
|
406
1109
|
});
|
|
407
|
-
},
|
|
408
|
-
|
|
409
|
-
|
|
1110
|
+
}, b = () => {
|
|
1111
|
+
o(e.options, (u) => {
|
|
1112
|
+
l(u);
|
|
410
1113
|
});
|
|
411
1114
|
};
|
|
412
1115
|
switch (!0) {
|
|
413
1116
|
case e.options instanceof Function: {
|
|
414
|
-
e.cache !== !1 ?
|
|
1117
|
+
e.cache !== !1 ? f() : b();
|
|
415
1118
|
break;
|
|
416
1119
|
}
|
|
417
|
-
case
|
|
418
|
-
|
|
419
|
-
|
|
1120
|
+
case oe(e.options): {
|
|
1121
|
+
ke(e.options, () => {
|
|
1122
|
+
l(e.options.value);
|
|
420
1123
|
}, {
|
|
421
1124
|
immediate: !0
|
|
422
1125
|
});
|
|
423
1126
|
break;
|
|
424
1127
|
}
|
|
425
1128
|
default:
|
|
426
|
-
|
|
1129
|
+
n.value = e.options;
|
|
427
1130
|
}
|
|
428
|
-
function u
|
|
429
|
-
var
|
|
430
|
-
const
|
|
431
|
-
return
|
|
1131
|
+
function s(u, c) {
|
|
1132
|
+
var m;
|
|
1133
|
+
const i = ((m = e.fieldNames) == null ? void 0 : m.title) || "title", h = c[i];
|
|
1134
|
+
return h ? h.toLowerCase().includes(u.toLowerCase()) : !1;
|
|
432
1135
|
}
|
|
433
|
-
return (
|
|
434
|
-
ref: (
|
|
1136
|
+
return (u, c) => (e.default && !t && (u[c.key] = e.default, t = !0), v(vt, {
|
|
1137
|
+
ref: (i) => r = i,
|
|
435
1138
|
multiple: e.multiple,
|
|
436
|
-
modelValue:
|
|
437
|
-
"onUpdate:modelValue": (
|
|
1139
|
+
modelValue: u[c.key],
|
|
1140
|
+
"onUpdate:modelValue": (i) => u[c.key] = i,
|
|
438
1141
|
placeholder: e.placeholder,
|
|
439
1142
|
allowClear: e.clearable,
|
|
440
1143
|
allowSearch: e.searchable,
|
|
441
1144
|
maxTagCount: e.maxTagCount ?? 2,
|
|
442
|
-
onChange:
|
|
443
|
-
filterTreeNode:
|
|
444
|
-
data:
|
|
1145
|
+
onChange: a,
|
|
1146
|
+
filterTreeNode: s,
|
|
1147
|
+
data: n.value,
|
|
445
1148
|
fieldNames: e.fieldNames,
|
|
446
1149
|
treeProps: e.treeProps
|
|
447
1150
|
}, {
|
|
448
1151
|
...e.slots
|
|
449
1152
|
}));
|
|
450
1153
|
}
|
|
451
|
-
const
|
|
452
|
-
function
|
|
453
|
-
const e =
|
|
454
|
-
return [e, (
|
|
1154
|
+
const J = /* @__PURE__ */ new WeakMap();
|
|
1155
|
+
function Ln() {
|
|
1156
|
+
const e = $([]);
|
|
1157
|
+
return [e, (t) => e.value = t];
|
|
455
1158
|
}
|
|
456
|
-
function
|
|
457
|
-
let
|
|
458
|
-
const [
|
|
459
|
-
if (!e.autoSumbit || !
|
|
1159
|
+
function Tn(e) {
|
|
1160
|
+
let r, t = !1;
|
|
1161
|
+
const [n, l] = Ln(), a = () => {
|
|
1162
|
+
if (!e.autoSumbit || !r)
|
|
460
1163
|
return;
|
|
461
|
-
let
|
|
462
|
-
for (;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
const c =
|
|
467
|
-
c instanceof Promise ? c.then(
|
|
468
|
-
},
|
|
469
|
-
const
|
|
470
|
-
switch (typeof
|
|
1164
|
+
let s = r;
|
|
1165
|
+
for (; s && s.$el.tagName !== "FORM"; )
|
|
1166
|
+
s = s.$parent;
|
|
1167
|
+
s && s.$el && s.$el.dispatchEvent(new Event("submit"));
|
|
1168
|
+
}, o = (s, u) => {
|
|
1169
|
+
const c = s();
|
|
1170
|
+
c instanceof Promise ? c.then(u) : u(c);
|
|
1171
|
+
}, f = async () => {
|
|
1172
|
+
const s = J.get(e.options);
|
|
1173
|
+
switch (typeof s) {
|
|
471
1174
|
case "function":
|
|
472
|
-
|
|
1175
|
+
J.set(e.options, l);
|
|
473
1176
|
return;
|
|
474
1177
|
case "object":
|
|
475
|
-
|
|
1178
|
+
l(s);
|
|
476
1179
|
return;
|
|
477
1180
|
}
|
|
478
|
-
|
|
479
|
-
const c =
|
|
480
|
-
|
|
1181
|
+
J.set(e.options, l), o(e.options, (u) => {
|
|
1182
|
+
const c = J.get(e.options);
|
|
1183
|
+
J.set(e.options, u), c(u);
|
|
481
1184
|
});
|
|
482
|
-
},
|
|
483
|
-
|
|
484
|
-
|
|
1185
|
+
}, b = () => {
|
|
1186
|
+
o(e.options, (s) => {
|
|
1187
|
+
l(s);
|
|
485
1188
|
});
|
|
486
1189
|
};
|
|
487
1190
|
switch (!0) {
|
|
488
1191
|
case e.options instanceof Function: {
|
|
489
|
-
e.cache !== !1 ?
|
|
1192
|
+
e.cache !== !1 ? f() : b();
|
|
490
1193
|
break;
|
|
491
1194
|
}
|
|
492
|
-
case
|
|
493
|
-
|
|
494
|
-
|
|
1195
|
+
case oe(e.options): {
|
|
1196
|
+
ke(e.options, () => {
|
|
1197
|
+
l(e.options.value);
|
|
495
1198
|
}, {
|
|
496
1199
|
immediate: !0
|
|
497
1200
|
});
|
|
498
1201
|
break;
|
|
499
1202
|
}
|
|
500
1203
|
default:
|
|
501
|
-
|
|
1204
|
+
n.value = e.options;
|
|
502
1205
|
}
|
|
503
|
-
return (
|
|
1206
|
+
return (s, u) => (e.default && !t && (s[u.key] = e.default, t = !0), v(pt, {
|
|
504
1207
|
pathMode: e.pathMode,
|
|
505
|
-
ref: (c) =>
|
|
1208
|
+
ref: (c) => r = c,
|
|
506
1209
|
multiple: e.multiple,
|
|
507
|
-
modelValue: u
|
|
508
|
-
"onUpdate:modelValue": (c) => u
|
|
1210
|
+
modelValue: s[u.key],
|
|
1211
|
+
"onUpdate:modelValue": (c) => s[u.key] = c,
|
|
509
1212
|
placeholder: e.placeholder,
|
|
510
1213
|
allowClear: e.clearable,
|
|
511
1214
|
allowSearch: e.searchable,
|
|
512
1215
|
maxTagCount: e.maxTagCount ?? 2,
|
|
513
|
-
onChange:
|
|
514
|
-
options:
|
|
1216
|
+
onChange: a,
|
|
1217
|
+
options: n.value
|
|
515
1218
|
}, null));
|
|
516
1219
|
}
|
|
517
|
-
function
|
|
518
|
-
return (
|
|
1220
|
+
function zn(e) {
|
|
1221
|
+
return (r) => e(r);
|
|
519
1222
|
}
|
|
520
|
-
function
|
|
1223
|
+
function Pn() {
|
|
521
1224
|
return {
|
|
522
|
-
input:
|
|
523
|
-
textarea:
|
|
524
|
-
select:
|
|
525
|
-
treeSelect:
|
|
526
|
-
date:
|
|
527
|
-
switch:
|
|
528
|
-
dateRange:
|
|
529
|
-
render:
|
|
530
|
-
cascader:
|
|
1225
|
+
input: xn,
|
|
1226
|
+
textarea: Mn,
|
|
1227
|
+
select: Fn,
|
|
1228
|
+
treeSelect: In,
|
|
1229
|
+
date: Sn,
|
|
1230
|
+
switch: On,
|
|
1231
|
+
dateRange: _n,
|
|
1232
|
+
render: zn,
|
|
1233
|
+
cascader: Tn
|
|
531
1234
|
};
|
|
532
1235
|
}
|
|
533
|
-
function
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
...
|
|
1236
|
+
function Rn(e, r) {
|
|
1237
|
+
r.render || (r.render = (n) => n.input());
|
|
1238
|
+
const t = r.render({
|
|
1239
|
+
...Pn()
|
|
537
1240
|
});
|
|
538
1241
|
return {
|
|
539
|
-
default: () =>
|
|
1242
|
+
default: () => t(e, r)
|
|
540
1243
|
};
|
|
541
1244
|
}
|
|
542
|
-
function
|
|
543
|
-
return
|
|
544
|
-
field:
|
|
545
|
-
label:
|
|
546
|
-
},
|
|
1245
|
+
function Nn(e, r) {
|
|
1246
|
+
return tt(je, {
|
|
1247
|
+
field: r.key,
|
|
1248
|
+
label: r.title
|
|
1249
|
+
}, Rn(e, r));
|
|
547
1250
|
}
|
|
548
|
-
function
|
|
549
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
1251
|
+
function En(e) {
|
|
1252
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ve(e);
|
|
550
1253
|
}
|
|
551
|
-
const
|
|
1254
|
+
const An = /* @__PURE__ */ P({
|
|
1255
|
+
props: {
|
|
1256
|
+
form: {
|
|
1257
|
+
type: Object,
|
|
1258
|
+
required: !0
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
setup(e) {
|
|
1262
|
+
const r = Te(), t = e.form.map((o) => ({
|
|
1263
|
+
...o,
|
|
1264
|
+
collapsed: !1
|
|
1265
|
+
})), n = Array.from(new Set(t.map((o) => o.group).flat().filter(Boolean))), l = t.reduce((o, f) => ((f.group ? [f.group].flat() : ["默认"]).forEach((b) => {
|
|
1266
|
+
let s = o.find((u) => u.group === b);
|
|
1267
|
+
s || (s = {
|
|
1268
|
+
group: b,
|
|
1269
|
+
instance: void 0,
|
|
1270
|
+
form: []
|
|
1271
|
+
}, o.push(s)), s.form.push(f);
|
|
1272
|
+
}), o), []).sort((o, f) => o.group === "默认" ? -1 : f.group === "默认" ? 1 : o.group > f.group ? -1 : 1), a = $("默认");
|
|
1273
|
+
return kn(() => {
|
|
1274
|
+
const o = l.find((f) => f.group === a.value);
|
|
1275
|
+
if (o && o.instance) {
|
|
1276
|
+
const f = o.instance.formSource;
|
|
1277
|
+
o.instance.validate().then(() => {
|
|
1278
|
+
r.close(f);
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
}), {
|
|
1282
|
+
formItems: t,
|
|
1283
|
+
groups: n,
|
|
1284
|
+
groupForms: l,
|
|
1285
|
+
activeTab: a
|
|
1286
|
+
};
|
|
1287
|
+
},
|
|
1288
|
+
render() {
|
|
1289
|
+
const e = this.groupForms.find((r) => r.group === this.activeTab);
|
|
1290
|
+
if (this.groups.length) {
|
|
1291
|
+
let r;
|
|
1292
|
+
return v(yt, {
|
|
1293
|
+
"active-key": this.activeTab,
|
|
1294
|
+
"onUpdate:active-key": (t) => this.activeTab = t
|
|
1295
|
+
}, En(r = this.groupForms.map((t) => v(gt, {
|
|
1296
|
+
title: t.group,
|
|
1297
|
+
key: t.group
|
|
1298
|
+
}, {
|
|
1299
|
+
default: () => [v(he, {
|
|
1300
|
+
form: t.form,
|
|
1301
|
+
ref: (n) => t.instance = n
|
|
1302
|
+
}, null)]
|
|
1303
|
+
}))) ? r : {
|
|
1304
|
+
default: () => [r]
|
|
1305
|
+
});
|
|
1306
|
+
} else
|
|
1307
|
+
return v(he, {
|
|
1308
|
+
form: this.formItems,
|
|
1309
|
+
ref: (r) => e.instance = r
|
|
1310
|
+
}, null);
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
function Fe(e) {
|
|
1314
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ve(e);
|
|
1315
|
+
}
|
|
1316
|
+
const he = /* @__PURE__ */ P({
|
|
552
1317
|
props: {
|
|
553
1318
|
form: {
|
|
554
1319
|
type: Object,
|
|
@@ -586,6 +1351,11 @@ const Qe = /* @__PURE__ */ I({
|
|
|
586
1351
|
required: !1,
|
|
587
1352
|
default: `form-${Math.random().toString(32).slice(2)}`
|
|
588
1353
|
},
|
|
1354
|
+
collapsedMode: {
|
|
1355
|
+
type: String,
|
|
1356
|
+
required: !1,
|
|
1357
|
+
default: "append"
|
|
1358
|
+
},
|
|
589
1359
|
submitable: {
|
|
590
1360
|
type: Boolean,
|
|
591
1361
|
required: !1,
|
|
@@ -604,168 +1374,199 @@ const Qe = /* @__PURE__ */ I({
|
|
|
604
1374
|
},
|
|
605
1375
|
emits: ["submit", "cancel", "update:model-value"],
|
|
606
1376
|
expose: ["formSource", "updateFormField", "updateFormSource", "reset", "validate"],
|
|
607
|
-
setup(e
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const
|
|
1377
|
+
setup(e, {
|
|
1378
|
+
emit: r
|
|
1379
|
+
}) {
|
|
1380
|
+
const t = $(), [n, l] = wn(e.form, e.modelValue || e.value), a = $(e.columns || 0), o = $(!0), f = $(), b = () => o.value = !o.value;
|
|
1381
|
+
fe($e.id, e.id), fe($e.source, n);
|
|
1382
|
+
const s = () => {
|
|
1383
|
+
r("submit", n), r("update:model-value", n);
|
|
1384
|
+
}, u = x(() => {
|
|
611
1385
|
if (!a.value)
|
|
612
1386
|
return 1;
|
|
613
|
-
const
|
|
614
|
-
return a.value -
|
|
615
|
-
}),
|
|
616
|
-
function
|
|
617
|
-
var
|
|
1387
|
+
const y = e.form.reduce((C, R) => C + ((R == null ? void 0 : R.span) || 1), 0);
|
|
1388
|
+
return a.value - y % a.value;
|
|
1389
|
+
}), c = x(() => e.form.reduce((y, C) => (C.rule && (y[C.key] = C.rule), y), {}));
|
|
1390
|
+
function i() {
|
|
1391
|
+
var C;
|
|
618
1392
|
if (e.columns)
|
|
619
1393
|
return;
|
|
620
|
-
const
|
|
621
|
-
|
|
1394
|
+
const y = (C = t.value) == null ? void 0 : C.$el;
|
|
1395
|
+
y && (a.value = Math.floor(y.offsetWidth / e.minWidth));
|
|
622
1396
|
}
|
|
623
|
-
function
|
|
624
|
-
var
|
|
625
|
-
const
|
|
626
|
-
|
|
1397
|
+
function h() {
|
|
1398
|
+
var C;
|
|
1399
|
+
const y = (C = t.value) == null ? void 0 : C.$el;
|
|
1400
|
+
y && (y.id = e.id);
|
|
1401
|
+
}
|
|
1402
|
+
function m() {
|
|
1403
|
+
f.value.open(An, {
|
|
1404
|
+
form: e.form
|
|
1405
|
+
}, {
|
|
1406
|
+
title: "高级搜索",
|
|
1407
|
+
footer: !0,
|
|
1408
|
+
submitText: "搜索"
|
|
1409
|
+
}).then((y) => {
|
|
1410
|
+
y && (k(y), s());
|
|
1411
|
+
});
|
|
627
1412
|
}
|
|
628
|
-
|
|
629
|
-
|
|
1413
|
+
D(() => {
|
|
1414
|
+
i(), h();
|
|
630
1415
|
});
|
|
631
|
-
function
|
|
632
|
-
|
|
633
|
-
...
|
|
1416
|
+
function k(y) {
|
|
1417
|
+
l({
|
|
1418
|
+
...n.value,
|
|
1419
|
+
...y || {}
|
|
634
1420
|
});
|
|
635
1421
|
}
|
|
636
|
-
function
|
|
637
|
-
|
|
638
|
-
|
|
1422
|
+
function p(y, C) {
|
|
1423
|
+
n.value[y] = C, k({
|
|
1424
|
+
...n.value
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
function O() {
|
|
1428
|
+
var y;
|
|
1429
|
+
(y = t.value) == null || y.resetFields();
|
|
639
1430
|
}
|
|
640
|
-
function
|
|
641
|
-
var
|
|
642
|
-
return (
|
|
1431
|
+
function M() {
|
|
1432
|
+
var y;
|
|
1433
|
+
return (y = t.value) == null ? void 0 : y.validate();
|
|
643
1434
|
}
|
|
644
|
-
return
|
|
645
|
-
window && window.addEventListener("resize",
|
|
1435
|
+
return D(() => {
|
|
1436
|
+
window && window.addEventListener("resize", i);
|
|
646
1437
|
}), {
|
|
647
|
-
formSource:
|
|
1438
|
+
formSource: n,
|
|
648
1439
|
formInstance: t,
|
|
649
1440
|
formColumns: a,
|
|
650
|
-
formRules:
|
|
651
|
-
formCollspased:
|
|
652
|
-
formActiosSpan:
|
|
653
|
-
toggleFormCollapsed:
|
|
654
|
-
updateFormField:
|
|
655
|
-
updateFormSource:
|
|
656
|
-
reset:
|
|
657
|
-
validate:
|
|
1441
|
+
formRules: c,
|
|
1442
|
+
formCollspased: o,
|
|
1443
|
+
formActiosSpan: u,
|
|
1444
|
+
toggleFormCollapsed: b,
|
|
1445
|
+
updateFormField: p,
|
|
1446
|
+
updateFormSource: k,
|
|
1447
|
+
reset: O,
|
|
1448
|
+
validate: M,
|
|
1449
|
+
onSubmitSuccess: s,
|
|
1450
|
+
openCollapsedDialog: m,
|
|
1451
|
+
modalInstance: f
|
|
658
1452
|
};
|
|
659
1453
|
},
|
|
660
1454
|
render() {
|
|
661
1455
|
const e = () => {
|
|
662
|
-
|
|
663
|
-
}, t = () => {
|
|
664
|
-
const l = [], a = this.footer ? {
|
|
1456
|
+
const t = [], n = this.footer ? {
|
|
665
1457
|
span: this.formColumns
|
|
666
1458
|
} : {
|
|
667
1459
|
span: this.formActiosSpan
|
|
668
1460
|
};
|
|
669
|
-
if (this.searchable && (
|
|
1461
|
+
if (this.searchable && (t.push(v(U, {
|
|
670
1462
|
type: "primary",
|
|
671
1463
|
htmlType: "submit"
|
|
672
1464
|
}, {
|
|
673
|
-
default: () => [
|
|
674
|
-
})),
|
|
1465
|
+
default: () => [Z("搜索")]
|
|
1466
|
+
})), t.push(v(U, {
|
|
675
1467
|
type: "secondary",
|
|
676
1468
|
onClick: () => {
|
|
677
|
-
var
|
|
678
|
-
return (
|
|
1469
|
+
var l;
|
|
1470
|
+
return (l = this.formInstance) == null ? void 0 : l.resetFields();
|
|
679
1471
|
}
|
|
680
1472
|
}, {
|
|
681
|
-
default: () => [
|
|
682
|
-
}))), this.submitable && (
|
|
1473
|
+
default: () => [Z("重置")]
|
|
1474
|
+
}))), this.submitable && (t.push(v(U, {
|
|
683
1475
|
type: "primary",
|
|
684
1476
|
htmlType: "submit"
|
|
685
1477
|
}, {
|
|
686
|
-
default: () => [
|
|
687
|
-
})),
|
|
1478
|
+
default: () => [Z("提交")]
|
|
1479
|
+
})), t.push(v(U, {
|
|
688
1480
|
type: "secondary",
|
|
689
1481
|
onClick: () => this.$emit("cancel")
|
|
690
1482
|
}, {
|
|
691
|
-
default: () => [
|
|
692
|
-
}))), this.form.some((
|
|
1483
|
+
default: () => [Z("取消")]
|
|
1484
|
+
}))), this.form.some((l) => !!l.collapsed) && (this.collapsedMode === "append" && t.push(v(U, {
|
|
693
1485
|
onClick: this.toggleFormCollapsed
|
|
694
1486
|
}, {
|
|
695
1487
|
default: () => this.formCollspased ? "展开" : "收起",
|
|
696
|
-
icon: () => this.formCollspased ?
|
|
697
|
-
})), this
|
|
698
|
-
|
|
699
|
-
|
|
1488
|
+
icon: () => this.formCollspased ? v(It, null, null) : v(Nt, null, null)
|
|
1489
|
+
})), this.collapsedMode === "dialog" && t.push(v(U, {
|
|
1490
|
+
onClick: this.openCollapsedDialog
|
|
1491
|
+
}, {
|
|
1492
|
+
default: () => "高级搜索",
|
|
1493
|
+
icon: () => v(Wt, null, null)
|
|
1494
|
+
}))), this.$slots.actions && t.push(...this.$slots.actions()), t.length)
|
|
1495
|
+
return v(xe, n, {
|
|
1496
|
+
default: () => [v(je, {
|
|
700
1497
|
hideLabel: !0,
|
|
701
1498
|
contentClass: this.footer ? "form-footer" : ""
|
|
702
1499
|
}, {
|
|
703
|
-
default: () => [
|
|
704
|
-
default: () => [
|
|
1500
|
+
default: () => [v(wt, null, Fe(t) ? t : {
|
|
1501
|
+
default: () => [t]
|
|
705
1502
|
})]
|
|
706
1503
|
})]
|
|
707
1504
|
});
|
|
708
|
-
}, r = this.form.filter((
|
|
1505
|
+
}, r = this.form.filter((t) => this.formCollspased ? !t.collapsed : !0).filter((t) => {
|
|
709
1506
|
switch (!0) {
|
|
710
|
-
case typeof
|
|
711
|
-
return
|
|
712
|
-
case typeof
|
|
713
|
-
return
|
|
1507
|
+
case typeof t.visiable == "boolean":
|
|
1508
|
+
return t.visiable;
|
|
1509
|
+
case typeof t.visiable == "function":
|
|
1510
|
+
return t.visiable(this.formSource);
|
|
714
1511
|
default:
|
|
715
1512
|
return !0;
|
|
716
1513
|
}
|
|
717
1514
|
});
|
|
718
|
-
return
|
|
1515
|
+
return v("div", {
|
|
719
1516
|
class: "form-render"
|
|
720
|
-
}, [
|
|
721
|
-
|
|
1517
|
+
}, [v(bn, {
|
|
1518
|
+
ref: (t) => this.modalInstance = t
|
|
722
1519
|
}, {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
rules: this.formRules,
|
|
726
|
-
onSubmitSuccess: e,
|
|
727
|
-
"auto-label-width": !0,
|
|
728
|
-
ref: (l) => this.formInstance = l,
|
|
729
|
-
model: this.formSource
|
|
730
|
-
}), {
|
|
731
|
-
default: () => [i(he, {
|
|
732
|
-
cols: this.formColumns,
|
|
733
|
-
"col-gap": 24,
|
|
734
|
-
"rol-gap": 10
|
|
1520
|
+
default: () => [v(bt, Oe({
|
|
1521
|
+
name: this.name
|
|
735
1522
|
}, {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
1523
|
+
labelAlign: "left",
|
|
1524
|
+
layout: this.$props.layout,
|
|
1525
|
+
rules: this.formRules,
|
|
1526
|
+
onSubmitSuccess: this.onSubmitSuccess,
|
|
1527
|
+
"auto-label-width": !0,
|
|
1528
|
+
ref: (t) => this.formInstance = t,
|
|
1529
|
+
model: this.formSource
|
|
1530
|
+
}), {
|
|
1531
|
+
default: () => [v(kt, {
|
|
1532
|
+
cols: this.formColumns,
|
|
1533
|
+
"col-gap": 24,
|
|
1534
|
+
"rol-gap": 10
|
|
1535
|
+
}, {
|
|
1536
|
+
default: () => [r.filter(() => this.formColumns !== 0).map((t) => {
|
|
1537
|
+
let n;
|
|
1538
|
+
return v(xe, {
|
|
1539
|
+
span: t.span
|
|
1540
|
+
}, Fe(n = Nn(this.formSource, t)) ? n : {
|
|
1541
|
+
default: () => [n]
|
|
1542
|
+
});
|
|
1543
|
+
}), e()]
|
|
1544
|
+
})]
|
|
744
1545
|
})]
|
|
745
1546
|
})]);
|
|
746
1547
|
}
|
|
747
1548
|
});
|
|
748
|
-
function
|
|
1549
|
+
function Wn(e) {
|
|
749
1550
|
return e;
|
|
750
1551
|
}
|
|
751
|
-
function
|
|
752
|
-
const
|
|
753
|
-
function
|
|
754
|
-
var
|
|
755
|
-
const
|
|
756
|
-
|
|
1552
|
+
function qn(e) {
|
|
1553
|
+
const r = W(), t = $();
|
|
1554
|
+
function n() {
|
|
1555
|
+
var a, o;
|
|
1556
|
+
const l = (o = (a = r == null ? void 0 : r.proxy) == null ? void 0 : a.$refs) == null ? void 0 : o[e];
|
|
1557
|
+
l && (t.value = l);
|
|
757
1558
|
}
|
|
758
|
-
return
|
|
1559
|
+
return D(n), nt(n), t;
|
|
759
1560
|
}
|
|
760
|
-
const
|
|
761
|
-
install(e,
|
|
762
|
-
e.component("FormRender",
|
|
1561
|
+
const Un = {
|
|
1562
|
+
install(e, r) {
|
|
1563
|
+
e.component("FormRender", he);
|
|
763
1564
|
}
|
|
764
1565
|
};
|
|
765
1566
|
export {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1567
|
+
he as FormRender,
|
|
1568
|
+
Hn as FormRenderResolver,
|
|
1569
|
+
Un as default,
|
|
1570
|
+
Wn as defineForm,
|
|
1571
|
+
qn as useForm
|
|
771
1572
|
};
|