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