@gopowerteam/form-render 0.0.81 → 0.0.82
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/index.d.ts +11 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/es/form-render/index.d.ts +11 -0
- package/dist/es/index.mjs +127 -118
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/es/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getCurrentInstance as q, inject as
|
|
2
|
-
import { DatePicker as
|
|
1
|
+
import { getCurrentInstance as q, inject as pe, defineComponent as E, computed as F, openBlock as $, createElementBlock as T, normalizeClass as le, normalizeStyle as z, createElementVNode as x, shallowRef as N, ref as _, provide as he, onMounted as W, Fragment as re, renderSlot as tt, createBlock as ne, Teleport as rt, createVNode as f, TransitionGroup as nt, withCtx as lt, renderList as at, mergeProps as ge, createCommentVNode as U, defineAsyncComponent as ut, triggerRef as Q, useCssVars as ot, onUnmounted as ct, withModifiers as it, toDisplayString as A, resolveDynamicComponent as Ee, normalizeProps as st, guardReactiveProps as dt, watch as Z, unref as Re, isRef as ae, toRefs as ft, customRef as mt, nextTick as ze, getCurrentScope as ht, onScopeDispose as vt, pushScopeId as Ae, popScopeId as Ne, isVNode as be, createTextVNode as I, h as Oe, onUpdated as yt } from "vue";
|
|
2
|
+
import { DatePicker as pt, YearPicker as gt, QuarterPicker as bt, MonthPicker as kt, WeekPicker as wt, Input as xt, InputNumber as Be, Select as Ct, Option as St, Switch as _t, RangePicker as $t, Textarea as Ft, TreeSelect as Ot, Cascader as Yt, FormItem as ve, Divider as Ye, Button as D, Tabs as Mt, TabPane as Tt, Form as Pt, Grid as jt, GridItem as ce, Space as Me, Tag as Lt } from "@arco-design/web-vue";
|
|
3
3
|
import S from "dayjs";
|
|
4
4
|
import { FormRenderResolver as Cn } from "./resolver.mjs";
|
|
5
5
|
const It = Symbol("ArcoConfigProvider"), Dt = "arco", Et = "$arco", ke = (e) => {
|
|
6
6
|
var n, r, t;
|
|
7
|
-
const a = q(), u =
|
|
7
|
+
const a = q(), u = pe(It, void 0);
|
|
8
8
|
return `${(t = (r = u == null ? void 0 : u.prefixCls) != null ? r : (n = a == null ? void 0 : a.appContext.config.globalProperties[Et]) == null ? void 0 : n.classPrefix) != null ? t : Dt}-${e}`;
|
|
9
9
|
}, Rt = Object.prototype.toString;
|
|
10
10
|
function we(e) {
|
|
@@ -60,8 +60,8 @@ const zt = E({
|
|
|
60
60
|
}
|
|
61
61
|
}), At = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Nt = /* @__PURE__ */ x("path", {
|
|
62
62
|
d: "M39.6 17.443 24.043 33 8.487 17.443"
|
|
63
|
-
}, null, -1),
|
|
64
|
-
function
|
|
63
|
+
}, null, -1), Bt = [Nt];
|
|
64
|
+
function Vt(e, n, r, t, a, u) {
|
|
65
65
|
return $(), T("svg", {
|
|
66
66
|
viewBox: "0 0 48 48",
|
|
67
67
|
fill: "none",
|
|
@@ -73,9 +73,9 @@ function Bt(e, n, r, t, a, u) {
|
|
|
73
73
|
"stroke-linecap": e.strokeLinecap,
|
|
74
74
|
"stroke-linejoin": e.strokeLinejoin,
|
|
75
75
|
onClick: n[0] || (n[0] = (...l) => e.onClick && e.onClick(...l))
|
|
76
|
-
},
|
|
76
|
+
}, Bt, 14, At);
|
|
77
77
|
}
|
|
78
|
-
var ie = /* @__PURE__ */ xe(zt, [["render",
|
|
78
|
+
var ie = /* @__PURE__ */ xe(zt, [["render", Vt]]);
|
|
79
79
|
const Ut = Object.assign(ie, {
|
|
80
80
|
install: (e, n) => {
|
|
81
81
|
var r;
|
|
@@ -217,7 +217,7 @@ const rr = Object.assign(de, {
|
|
|
217
217
|
e.component(t + de.name, de);
|
|
218
218
|
}
|
|
219
219
|
}), Ce = Symbol("__MODAL__");
|
|
220
|
-
function
|
|
220
|
+
function Ve(e) {
|
|
221
221
|
return ht() ? (vt(e), !0) : !1;
|
|
222
222
|
}
|
|
223
223
|
function M(e) {
|
|
@@ -258,7 +258,7 @@ function or(e, n = {}) {
|
|
|
258
258
|
function cr(e, n = !0, r) {
|
|
259
259
|
ur() ? W(e, r) : n ? e() : ze(e);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function B(e) {
|
|
262
262
|
var n;
|
|
263
263
|
const r = M(e);
|
|
264
264
|
return (n = r == null ? void 0 : r.$el) != null ? n : r;
|
|
@@ -272,7 +272,7 @@ function fe(...e) {
|
|
|
272
272
|
const u = [], l = () => {
|
|
273
273
|
u.forEach((o) => o()), u.length = 0;
|
|
274
274
|
}, i = (o, s, d, m) => (o.addEventListener(s, d, m), () => o.removeEventListener(s, d, m)), h = Z(
|
|
275
|
-
() => [
|
|
275
|
+
() => [B(n), M(a)],
|
|
276
276
|
([o, s]) => {
|
|
277
277
|
if (l(), !o)
|
|
278
278
|
return;
|
|
@@ -285,7 +285,7 @@ function fe(...e) {
|
|
|
285
285
|
), c = () => {
|
|
286
286
|
h(), l();
|
|
287
287
|
};
|
|
288
|
-
return
|
|
288
|
+
return Ve(c), c;
|
|
289
289
|
}
|
|
290
290
|
function ir() {
|
|
291
291
|
const e = _(!1), n = q();
|
|
@@ -312,7 +312,7 @@ function dr(e, n = {}) {
|
|
|
312
312
|
draggingElement: m = ue,
|
|
313
313
|
containerElement: v,
|
|
314
314
|
handle: k = e
|
|
315
|
-
} = n,
|
|
315
|
+
} = n, p = _(
|
|
316
316
|
(r = M(s)) != null ? r : { x: 0, y: 0 }
|
|
317
317
|
), C = _(), j = (w) => a ? a.includes(w.pointerType) : !0, P = (w) => {
|
|
318
318
|
M(u) && w.preventDefault(), M(l) && w.stopPropagation();
|
|
@@ -329,24 +329,24 @@ function dr(e, n = {}) {
|
|
|
329
329
|
if (M(n.disabled) || !j(w) || !C.value)
|
|
330
330
|
return;
|
|
331
331
|
const g = M(v), b = M(e).getBoundingClientRect();
|
|
332
|
-
let { x: O, y: Y } =
|
|
333
|
-
(d === "x" || d === "both") && (O = w.clientX - C.value.x, g && (O = Math.min(Math.max(0, O), g.scrollWidth - b.width))), (d === "y" || d === "both") && (Y = w.clientY - C.value.y, g && (Y = Math.min(Math.max(0, Y), g.scrollHeight - b.height))),
|
|
332
|
+
let { x: O, y: Y } = p.value;
|
|
333
|
+
(d === "x" || d === "both") && (O = w.clientX - C.value.x, g && (O = Math.min(Math.max(0, O), g.scrollWidth - b.width))), (d === "y" || d === "both") && (Y = w.clientY - C.value.y, g && (Y = Math.min(Math.max(0, Y), g.scrollHeight - b.height))), p.value = {
|
|
334
334
|
x: O,
|
|
335
335
|
y: Y
|
|
336
|
-
}, h == null || h(
|
|
337
|
-
},
|
|
338
|
-
M(n.disabled) || !j(w) || C.value && (C.value = void 0, c == null || c(
|
|
336
|
+
}, h == null || h(p.value, w), P(w);
|
|
337
|
+
}, V = (w) => {
|
|
338
|
+
M(n.disabled) || !j(w) || C.value && (C.value = void 0, c == null || c(p.value, w), P(w));
|
|
339
339
|
};
|
|
340
340
|
if (Ue) {
|
|
341
341
|
const w = { capture: (t = n.capture) != null ? t : !0 };
|
|
342
|
-
fe(k, "pointerdown", R, w), fe(m, "pointermove", H, w), fe(m, "pointerup",
|
|
342
|
+
fe(k, "pointerdown", R, w), fe(m, "pointermove", H, w), fe(m, "pointerup", V, w);
|
|
343
343
|
}
|
|
344
344
|
return {
|
|
345
|
-
...or(
|
|
346
|
-
position:
|
|
345
|
+
...or(p),
|
|
346
|
+
position: p,
|
|
347
347
|
isDragging: F(() => !!C.value),
|
|
348
348
|
style: F(
|
|
349
|
-
() => `left:${
|
|
349
|
+
() => `left:${p.value.x}px;top:${p.value.y}px;`
|
|
350
350
|
)
|
|
351
351
|
};
|
|
352
352
|
}
|
|
@@ -355,7 +355,7 @@ function fr(e, n, r = {}) {
|
|
|
355
355
|
let u;
|
|
356
356
|
const l = sr(() => t && "ResizeObserver" in t), i = () => {
|
|
357
357
|
u && (u.disconnect(), u = void 0);
|
|
358
|
-
}, h = F(() => Array.isArray(e) ? e.map((s) =>
|
|
358
|
+
}, h = F(() => Array.isArray(e) ? e.map((s) => B(s)) : [B(e)]), c = Z(
|
|
359
359
|
h,
|
|
360
360
|
(s) => {
|
|
361
361
|
if (i(), l.value && t) {
|
|
@@ -368,7 +368,7 @@ function fr(e, n, r = {}) {
|
|
|
368
368
|
), o = () => {
|
|
369
369
|
i(), c();
|
|
370
370
|
};
|
|
371
|
-
return
|
|
371
|
+
return Ve(o), {
|
|
372
372
|
isSupported: l,
|
|
373
373
|
stop: o
|
|
374
374
|
};
|
|
@@ -376,13 +376,13 @@ function fr(e, n, r = {}) {
|
|
|
376
376
|
function G(e, n = { width: 0, height: 0 }, r = {}) {
|
|
377
377
|
const { window: t = ue, box: a = "content-box" } = r, u = F(() => {
|
|
378
378
|
var s, d;
|
|
379
|
-
return (d = (s =
|
|
379
|
+
return (d = (s = B(e)) == null ? void 0 : s.namespaceURI) == null ? void 0 : d.includes("svg");
|
|
380
380
|
}), l = _(n.width), i = _(n.height), { stop: h } = fr(
|
|
381
381
|
e,
|
|
382
382
|
([s]) => {
|
|
383
383
|
const d = a === "border-box" ? s.borderBoxSize : a === "content-box" ? s.contentBoxSize : s.devicePixelContentBoxSize;
|
|
384
384
|
if (t && u.value) {
|
|
385
|
-
const m =
|
|
385
|
+
const m = B(e);
|
|
386
386
|
if (m) {
|
|
387
387
|
const v = t.getComputedStyle(m);
|
|
388
388
|
l.value = Number.parseFloat(v.width), i.value = Number.parseFloat(v.height);
|
|
@@ -396,11 +396,11 @@ function G(e, n = { width: 0, height: 0 }, r = {}) {
|
|
|
396
396
|
r
|
|
397
397
|
);
|
|
398
398
|
cr(() => {
|
|
399
|
-
const s =
|
|
399
|
+
const s = B(e);
|
|
400
400
|
s && (l.value = "offsetWidth" in s ? s.offsetWidth : n.width, i.value = "offsetHeight" in s ? s.offsetHeight : n.height);
|
|
401
401
|
});
|
|
402
402
|
const c = Z(
|
|
403
|
-
() =>
|
|
403
|
+
() => B(e),
|
|
404
404
|
(s) => {
|
|
405
405
|
l.value = s ? n.width : 0, i.value = s ? n.height : 0;
|
|
406
406
|
}
|
|
@@ -414,7 +414,7 @@ function G(e, n = { width: 0, height: 0 }, r = {}) {
|
|
|
414
414
|
stop: o
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "title text-16px font-bold" }, vr = { class: "action" },
|
|
417
|
+
const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "title text-16px font-bold" }, vr = { class: "action" }, yr = ["form"], pr = {
|
|
418
418
|
key: 2,
|
|
419
419
|
class: "modal-loading"
|
|
420
420
|
}, gr = /* @__PURE__ */ mr(() => /* @__PURE__ */ x("div", { class: "lds-ring" }, [
|
|
@@ -462,47 +462,47 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
462
462
|
},
|
|
463
463
|
emits: ["submit"],
|
|
464
464
|
setup(e, { expose: n, emit: r }) {
|
|
465
|
-
ot((
|
|
466
|
-
"053e5c1d":
|
|
465
|
+
ot((y) => ({
|
|
466
|
+
"053e5c1d": y.zIndex
|
|
467
467
|
}));
|
|
468
|
-
const t = e, a = r, u =
|
|
468
|
+
const t = e, a = r, u = pe(Ce), l = _(!1);
|
|
469
469
|
let i = 0, h = 0;
|
|
470
|
-
const c = N(), o = N(), s = N(), d = N(), m = N(), v = N(), { height: k } = G(c), { height:
|
|
470
|
+
const c = N(), o = N(), s = N(), d = N(), m = N(), v = N(), { height: k } = G(c), { height: p } = G(s, void 0, { box: "border-box" }), { height: C } = G(d, void 0, { box: "border-box" }), { height: j } = G(m), { height: P } = G(v), { x: R, y: H } = dr(s, {
|
|
471
471
|
initialValue: { x: 0, y: 0 }
|
|
472
472
|
});
|
|
473
|
-
function
|
|
473
|
+
function V() {
|
|
474
474
|
u == null || u.close(t.id);
|
|
475
475
|
}
|
|
476
|
-
function w(
|
|
477
|
-
return typeof
|
|
476
|
+
function w(y) {
|
|
477
|
+
return typeof y == "number" ? `${y}px` : y;
|
|
478
478
|
}
|
|
479
479
|
const g = F(() => {
|
|
480
|
-
const
|
|
481
|
-
return t.mode === "dialog" && (
|
|
480
|
+
const y = {};
|
|
481
|
+
return t.mode === "dialog" && (y.justifyContent = "center"), t.mode === "drawer" && (y.justifyContent = {
|
|
482
482
|
left: "flex-start",
|
|
483
483
|
right: "flex-end",
|
|
484
484
|
top: "flex-start",
|
|
485
485
|
bottom: "flex-end"
|
|
486
|
-
}[t.position],
|
|
486
|
+
}[t.position], y.flexDirection = {
|
|
487
487
|
left: "row",
|
|
488
488
|
right: "row",
|
|
489
489
|
top: "column",
|
|
490
490
|
bottom: "column"
|
|
491
|
-
}[t.position]),
|
|
491
|
+
}[t.position]), y;
|
|
492
492
|
}), b = F(() => {
|
|
493
|
-
const
|
|
494
|
-
return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ?
|
|
493
|
+
const y = {};
|
|
494
|
+
return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ? y.maxHeight = w(t.maxHeight) : (y.width = w(t.sizes[t.size]), y.maxWidth = w(t.maxWidth)), t.width && (y.width = w(t.width)), t.height && (y.height = w(t.height)), t.fullscreen && (y.maxWidth = "unset", y.width = "100%", y.position = "fixed", y.top = 0, y.left = 0, y.bottom = 0, y.right = 0, y.borderRadius = 0), t.draggable && !t.fullscreen && t.mode === "dialog" && (y.transform = `translate3d(${R.value - i}px, ${H.value - h}px, 0px)`), t.mode === "drawer" && (y.borderRadius = 0, ["left", "right"].includes(t.position) ? y.height = "100%" : y.width = "100%"), t.offset && t.mode === "dialog" && (y.marginLeft = `${t.offset.x || 0}px`, y.marginTop = `${t.offset.y || 0}px`), t.backgroundColor && (y.backgroundColor = t.backgroundColor), y;
|
|
495
495
|
}), O = F(() => {
|
|
496
|
-
const
|
|
497
|
-
return t.draggable && !t.fullscreen && t.mode === "dialog" && (
|
|
496
|
+
const y = {};
|
|
497
|
+
return t.draggable && !t.fullscreen && t.mode === "dialog" && (y.cursor = "move"), y;
|
|
498
498
|
}), Y = F(() => {
|
|
499
|
-
const
|
|
500
|
-
return t.maxHeight && (
|
|
499
|
+
const y = {}, L = j.value + P.value + p.value + C.value, Fe = Math.floor(k.value * (Number(w(t.maxHeight).replace("%", "")) / 100));
|
|
500
|
+
return t.maxHeight && (y.maxHeight = `${Fe - L}px`), t.mode === "drawer" && (y.maxHeight = "unset", ["left", "right"].includes(t.position) && (y.height = `${k.value - L}px`)), t.fullscreen && (y.maxHeight = "unset", y.height = `calc(100% - ${L}px)`), t.type !== "component" && (y.padding = "0"), t.bodyStyle && Object.assign(y, t.bodyStyle), y;
|
|
501
501
|
});
|
|
502
502
|
function ee() {
|
|
503
|
-
const
|
|
504
|
-
if (t.form &&
|
|
505
|
-
const L =
|
|
503
|
+
const y = o.value;
|
|
504
|
+
if (t.form && y) {
|
|
505
|
+
const L = y.querySelector(`form[name="${t.form}"]`);
|
|
506
506
|
L && L.dispatchEvent(new Event("submit"));
|
|
507
507
|
}
|
|
508
508
|
t.onOk && t.onOk({
|
|
@@ -519,10 +519,10 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
519
519
|
}
|
|
520
520
|
function Qe() {
|
|
521
521
|
if (t.closeable && t.esc) {
|
|
522
|
-
const
|
|
523
|
-
L === "Escape" && (u == null || u.close(t.id), window.removeEventListener("keydown",
|
|
522
|
+
const y = ({ key: L }) => {
|
|
523
|
+
L === "Escape" && (u == null || u.close(t.id), window.removeEventListener("keydown", y));
|
|
524
524
|
};
|
|
525
|
-
window.addEventListener("keydown",
|
|
525
|
+
window.addEventListener("keydown", y);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
function Ze() {
|
|
@@ -541,20 +541,20 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
541
541
|
return n({
|
|
542
542
|
showLoading: et,
|
|
543
543
|
hideLoading: $e
|
|
544
|
-
}), (
|
|
544
|
+
}), (y, L) => ($(), T("div", {
|
|
545
545
|
ref_key: "wrapperRef",
|
|
546
546
|
ref: c,
|
|
547
547
|
class: "modal-wrapper",
|
|
548
548
|
style: z(g.value),
|
|
549
|
-
onClick: L[0] || (L[0] = it((Fe) =>
|
|
549
|
+
onClick: L[0] || (L[0] = it((Fe) => y.maskClosable && V(), ["self"]))
|
|
550
550
|
}, [
|
|
551
551
|
x("div", {
|
|
552
552
|
ref_key: "contentRef",
|
|
553
553
|
ref: o,
|
|
554
|
-
class: le(["modal-content", { [`${
|
|
554
|
+
class: le(["modal-content", { [`${y.mode}-mode`]: !0, [`${y.position}-position`]: !0 }]),
|
|
555
555
|
style: z(b.value)
|
|
556
556
|
}, [
|
|
557
|
-
|
|
557
|
+
y.header ? ($(), T("div", {
|
|
558
558
|
key: 0,
|
|
559
559
|
ref_key: "headerRef",
|
|
560
560
|
ref: s,
|
|
@@ -562,12 +562,12 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
562
562
|
style: z(O.value),
|
|
563
563
|
onMousedown: Ze
|
|
564
564
|
}, [
|
|
565
|
-
x("div", hr, A(
|
|
565
|
+
x("div", hr, A(y.title), 1),
|
|
566
566
|
x("div", vr, [
|
|
567
|
-
|
|
567
|
+
y.closeable ? ($(), T("div", {
|
|
568
568
|
key: 0,
|
|
569
569
|
class: "i-icon-park-outline:close block cursor-pointer",
|
|
570
|
-
onClick:
|
|
570
|
+
onClick: V
|
|
571
571
|
})) : U("", !0)
|
|
572
572
|
])
|
|
573
573
|
], 36)) : U("", !0),
|
|
@@ -580,14 +580,14 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
580
580
|
class: "modal-body",
|
|
581
581
|
style: z(Y.value)
|
|
582
582
|
}, [
|
|
583
|
-
($(), ne(Ee(
|
|
583
|
+
($(), ne(Ee(y.component), st(dt(y.componentProps)), null, 16))
|
|
584
584
|
], 4),
|
|
585
585
|
x("div", {
|
|
586
586
|
id: "modal-footer-slot",
|
|
587
587
|
ref_key: "footerSlotRef",
|
|
588
588
|
ref: v
|
|
589
589
|
}, null, 512),
|
|
590
|
-
|
|
590
|
+
y.footer ? ($(), T("div", {
|
|
591
591
|
key: 1,
|
|
592
592
|
ref_key: "footerRef",
|
|
593
593
|
ref: d,
|
|
@@ -597,15 +597,15 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
597
597
|
class: "cancel-button",
|
|
598
598
|
type: "button",
|
|
599
599
|
onClick: Xe
|
|
600
|
-
}, A(
|
|
600
|
+
}, A(y.cancelText), 1),
|
|
601
601
|
x("button", {
|
|
602
602
|
class: "submit-button",
|
|
603
|
-
form:
|
|
603
|
+
form: y.form,
|
|
604
604
|
type: "submit",
|
|
605
605
|
onClick: ee
|
|
606
|
-
}, A(
|
|
606
|
+
}, A(y.submitText), 9, yr)
|
|
607
607
|
], 512)) : U("", !0),
|
|
608
|
-
l.value ? ($(), T("div",
|
|
608
|
+
l.value ? ($(), T("div", pr, br)) : U("", !0)
|
|
609
609
|
], 6)
|
|
610
610
|
], 4));
|
|
611
611
|
}
|
|
@@ -709,11 +709,11 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
709
709
|
() => Promise.resolve(typeof d == "string" ? Or : d)
|
|
710
710
|
);
|
|
711
711
|
typeof d == "string" && (m.type = d, v.size = "small", v.fullscreen = !1, v.mode = "dialog", v.footer = !1, v.header = !1);
|
|
712
|
-
const
|
|
712
|
+
const p = Math.random().toString(32).slice(2), C = Object.assign({
|
|
713
713
|
zIndex: typeof d == "string" ? 1100 : 1e3
|
|
714
714
|
}, v), j = new Promise((P, R) => {
|
|
715
715
|
r.value.push({
|
|
716
|
-
id:
|
|
716
|
+
id: p,
|
|
717
717
|
component: k,
|
|
718
718
|
props: m || {},
|
|
719
719
|
options: {
|
|
@@ -727,11 +727,11 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
727
727
|
}).catch((P) => P === "CANCEL" ? new Promise(() => {
|
|
728
728
|
}) : Promise.reject(P));
|
|
729
729
|
return Object.assign(j, {
|
|
730
|
-
close: () => l(
|
|
730
|
+
close: () => l(p)
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
function l(d, m) {
|
|
734
|
-
const v = r.value.findIndex((
|
|
734
|
+
const v = r.value.findIndex((p) => p.id === d);
|
|
735
735
|
if (v < 0)
|
|
736
736
|
return;
|
|
737
737
|
const k = r.value[v];
|
|
@@ -743,21 +743,21 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
743
743
|
}), r.value = [], Q(r));
|
|
744
744
|
}
|
|
745
745
|
function h(d, m) {
|
|
746
|
-
const v = r.value.find((
|
|
746
|
+
const v = r.value.find((p) => p.id === d);
|
|
747
747
|
if (!v)
|
|
748
748
|
return;
|
|
749
|
-
const k = v.listeners.find((
|
|
749
|
+
const k = v.listeners.find((p) => p.event === m);
|
|
750
750
|
k && k.callback({
|
|
751
751
|
open: u,
|
|
752
|
-
close: (
|
|
752
|
+
close: (p) => l(v.id, p),
|
|
753
753
|
closeAll: i,
|
|
754
754
|
showLoading: () => c(v.id),
|
|
755
755
|
hideLoading: () => o(v.id),
|
|
756
|
-
confirm: (
|
|
757
|
-
success: (
|
|
758
|
-
error: (
|
|
759
|
-
warning: (
|
|
760
|
-
info: (
|
|
756
|
+
confirm: (p) => u("confirm", p),
|
|
757
|
+
success: (p) => u("success", p),
|
|
758
|
+
error: (p) => u("error", p),
|
|
759
|
+
warning: (p) => u("warning", p),
|
|
760
|
+
info: (p) => u("info", p)
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
function c(d, m) {
|
|
@@ -791,7 +791,7 @@ const mr = (e) => (Ae("data-v-d520be96"), e = e(), Ne(), e), hr = { class: "titl
|
|
|
791
791
|
return m.hideLoading();
|
|
792
792
|
}
|
|
793
793
|
function s(d, m, v) {
|
|
794
|
-
const k = r.value.find((
|
|
794
|
+
const k = r.value.find((p) => p.id === d);
|
|
795
795
|
k && k.listeners.push({
|
|
796
796
|
event: m,
|
|
797
797
|
callback: v
|
|
@@ -850,7 +850,7 @@ function me(e, n) {
|
|
|
850
850
|
return ((t = a == null ? void 0 : a.type) == null ? void 0 : t.name) === n ? a : null;
|
|
851
851
|
}
|
|
852
852
|
function qe() {
|
|
853
|
-
const e =
|
|
853
|
+
const e = pe(Ce), n = q();
|
|
854
854
|
function r(t, a, u) {
|
|
855
855
|
if (!e)
|
|
856
856
|
throw new Error("Not Found Modal Provider Component");
|
|
@@ -1003,7 +1003,7 @@ var He = { exports: {} };
|
|
|
1003
1003
|
});
|
|
1004
1004
|
})(He);
|
|
1005
1005
|
var Nr = He.exports;
|
|
1006
|
-
const
|
|
1006
|
+
const Br = /* @__PURE__ */ We(Nr);
|
|
1007
1007
|
var Ge = { exports: {} };
|
|
1008
1008
|
(function(e, n) {
|
|
1009
1009
|
(function(r, t) {
|
|
@@ -1031,9 +1031,9 @@ var Ge = { exports: {} };
|
|
|
1031
1031
|
};
|
|
1032
1032
|
});
|
|
1033
1033
|
})(Ge);
|
|
1034
|
-
var
|
|
1035
|
-
const Ur = /* @__PURE__ */ We(
|
|
1036
|
-
S.extend(
|
|
1034
|
+
var Vr = Ge.exports;
|
|
1035
|
+
const Ur = /* @__PURE__ */ We(Vr);
|
|
1036
|
+
S.extend(Br);
|
|
1037
1037
|
S.extend(Ur);
|
|
1038
1038
|
S.locale("zh-cn", {
|
|
1039
1039
|
weekStart: 1
|
|
@@ -1096,7 +1096,7 @@ function qr(e) {
|
|
|
1096
1096
|
}, null);
|
|
1097
1097
|
case "date":
|
|
1098
1098
|
default:
|
|
1099
|
-
return f(
|
|
1099
|
+
return f(pt, ge({
|
|
1100
1100
|
"disabled-input": !0,
|
|
1101
1101
|
modelValue: r[t.key],
|
|
1102
1102
|
"onUpdate:modelValue": (l) => r[t.key] = l,
|
|
@@ -1180,7 +1180,7 @@ function Xr(e) {
|
|
|
1180
1180
|
function l() {
|
|
1181
1181
|
switch (e == null ? void 0 : e.type) {
|
|
1182
1182
|
case "number":
|
|
1183
|
-
return f(
|
|
1183
|
+
return f(Be, {
|
|
1184
1184
|
ref: (i) => n = i,
|
|
1185
1185
|
modelValue: r[t.key],
|
|
1186
1186
|
"onUpdate:modelValue": (i) => r[t.key] = i,
|
|
@@ -1288,8 +1288,8 @@ function Zr(e) {
|
|
|
1288
1288
|
"allow-create": e.createable,
|
|
1289
1289
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1290
1290
|
onChange: u
|
|
1291
|
-
}, Jr(m = Array.from(t.value.entries()).map(([v, k],
|
|
1292
|
-
key:
|
|
1291
|
+
}, Jr(m = Array.from(t.value.entries()).map(([v, k], p) => f(St, {
|
|
1292
|
+
key: p,
|
|
1293
1293
|
value: v,
|
|
1294
1294
|
label: k
|
|
1295
1295
|
}, null))) ? m : {
|
|
@@ -1508,21 +1508,21 @@ function an(e) {
|
|
|
1508
1508
|
return (o, s) => {
|
|
1509
1509
|
e.default && !r && (o[s.key] = e.default, r = !0);
|
|
1510
1510
|
function d() {
|
|
1511
|
-
const v = o[s.key], k = (
|
|
1511
|
+
const v = o[s.key], k = (p) => {
|
|
1512
1512
|
const [C] = Ke({
|
|
1513
1513
|
data: t.value,
|
|
1514
1514
|
labelProp: "title",
|
|
1515
1515
|
valueProp: "key",
|
|
1516
|
-
key:
|
|
1516
|
+
key: p
|
|
1517
1517
|
}).reverse() || [];
|
|
1518
1518
|
return C == null ? void 0 : C.title;
|
|
1519
1519
|
};
|
|
1520
1520
|
if (e.multiple) {
|
|
1521
|
-
const
|
|
1522
|
-
return f("span", null, [
|
|
1521
|
+
const p = v.map((C) => k(C));
|
|
1522
|
+
return f("span", null, [p.join(", ")]);
|
|
1523
1523
|
} else {
|
|
1524
|
-
const
|
|
1525
|
-
return f("span", null, [
|
|
1524
|
+
const p = k(v);
|
|
1525
|
+
return f("span", null, [p]);
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
1528
|
function m() {
|
|
@@ -1610,33 +1610,33 @@ function on(e) {
|
|
|
1610
1610
|
return (c, o) => {
|
|
1611
1611
|
e.default && !r && (c[o.key] = e.default, r = !0);
|
|
1612
1612
|
function s() {
|
|
1613
|
-
const m = c[o.key], v = (
|
|
1613
|
+
const m = c[o.key], v = (p) => Ke({
|
|
1614
1614
|
data: t.value,
|
|
1615
1615
|
labelProp: "label",
|
|
1616
1616
|
valueProp: "value",
|
|
1617
|
-
key:
|
|
1618
|
-
}).map((j) => j.label).join("/"), k = (
|
|
1617
|
+
key: p
|
|
1618
|
+
}).map((j) => j.label).join("/"), k = (p) => nn({
|
|
1619
1619
|
data: t.value,
|
|
1620
1620
|
labelProp: "label",
|
|
1621
1621
|
valueProp: "value",
|
|
1622
|
-
path:
|
|
1622
|
+
path: p
|
|
1623
1623
|
}).map((j) => j.label).join("/");
|
|
1624
1624
|
switch (!0) {
|
|
1625
1625
|
case (!e.pathMode && !e.multiple): {
|
|
1626
|
-
const
|
|
1627
|
-
return f("span", null, [
|
|
1626
|
+
const p = v(m);
|
|
1627
|
+
return f("span", null, [p]);
|
|
1628
1628
|
}
|
|
1629
1629
|
case (!e.pathMode && e.multiple): {
|
|
1630
|
-
const
|
|
1631
|
-
return f("span", null, [
|
|
1630
|
+
const p = m.map((C) => v(C));
|
|
1631
|
+
return f("span", null, [p.join(", ")]);
|
|
1632
1632
|
}
|
|
1633
1633
|
case (e.pathMode && !e.multiple): {
|
|
1634
|
-
const
|
|
1635
|
-
return f("span", null, [
|
|
1634
|
+
const p = k(m);
|
|
1635
|
+
return f("span", null, [p]);
|
|
1636
1636
|
}
|
|
1637
1637
|
case (e.pathMode && e.multiple): {
|
|
1638
|
-
const
|
|
1639
|
-
return f("span", null, [
|
|
1638
|
+
const p = m.map((C) => k(C));
|
|
1639
|
+
return f("span", null, [p.join(", ")]);
|
|
1640
1640
|
}
|
|
1641
1641
|
default:
|
|
1642
1642
|
return f("span", null, null);
|
|
@@ -1716,7 +1716,7 @@ function dn(e) {
|
|
|
1716
1716
|
return f("span", null, [a(h.value.toString()), o()]);
|
|
1717
1717
|
}
|
|
1718
1718
|
function d() {
|
|
1719
|
-
return f(
|
|
1719
|
+
return f(Be, {
|
|
1720
1720
|
modelValue: h.value,
|
|
1721
1721
|
"onUpdate:modelValue": (m) => h.value = m,
|
|
1722
1722
|
formatter: a,
|
|
@@ -1834,7 +1834,7 @@ const hn = /* @__PURE__ */ E({
|
|
|
1834
1834
|
title: r.group,
|
|
1835
1835
|
key: r.group
|
|
1836
1836
|
}, {
|
|
1837
|
-
default: () => [f(
|
|
1837
|
+
default: () => [f(ye, {
|
|
1838
1838
|
form: r.form,
|
|
1839
1839
|
value: this.value,
|
|
1840
1840
|
ref: (t) => r.instance = t
|
|
@@ -1858,7 +1858,7 @@ const hn = /* @__PURE__ */ E({
|
|
|
1858
1858
|
default: () => [n]
|
|
1859
1859
|
});
|
|
1860
1860
|
} else
|
|
1861
|
-
return f(re, null, [f(
|
|
1861
|
+
return f(re, null, [f(ye, {
|
|
1862
1862
|
form: this.formItems,
|
|
1863
1863
|
value: this.value,
|
|
1864
1864
|
ref: (n) => e.instance = n
|
|
@@ -1883,7 +1883,7 @@ const hn = /* @__PURE__ */ E({
|
|
|
1883
1883
|
function De(e) {
|
|
1884
1884
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !be(e);
|
|
1885
1885
|
}
|
|
1886
|
-
const
|
|
1886
|
+
const ye = /* @__PURE__ */ E({
|
|
1887
1887
|
props: {
|
|
1888
1888
|
form: {
|
|
1889
1889
|
type: Object,
|
|
@@ -1939,6 +1939,11 @@ const pe = /* @__PURE__ */ E({
|
|
|
1939
1939
|
required: !1,
|
|
1940
1940
|
default: !1
|
|
1941
1941
|
},
|
|
1942
|
+
resetable: {
|
|
1943
|
+
type: Boolean,
|
|
1944
|
+
required: !1,
|
|
1945
|
+
default: !0
|
|
1946
|
+
},
|
|
1942
1947
|
footer: {
|
|
1943
1948
|
type: Boolean,
|
|
1944
1949
|
required: !1,
|
|
@@ -1976,7 +1981,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
1976
1981
|
return Y(t.value);
|
|
1977
1982
|
}
|
|
1978
1983
|
} : g, k = F(() => e.form.reduce((g, b) => (b.rule && (Array.isArray(b.rule) ? g[b.key] = b.rule.map(v) : g[b.key] = v(b.rule)), g), {}));
|
|
1979
|
-
function
|
|
1984
|
+
function p() {
|
|
1980
1985
|
var b;
|
|
1981
1986
|
if (e.columns)
|
|
1982
1987
|
return;
|
|
@@ -2002,7 +2007,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
2002
2007
|
}
|
|
2003
2008
|
W(() => {
|
|
2004
2009
|
const g = Math.random().toString(32).slice(2);
|
|
2005
|
-
c.value = e.id ?? g, o.value = e.name ?? g,
|
|
2010
|
+
c.value = e.id ?? g, o.value = e.name ?? g, p(), C(), window && window.addEventListener("resize", p);
|
|
2006
2011
|
});
|
|
2007
2012
|
function P(g) {
|
|
2008
2013
|
a({
|
|
@@ -2019,7 +2024,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
2019
2024
|
const b = e.form.find((Y) => Y.key === g), O = (typeof b.default == "function" ? b.default() : b.default) || null;
|
|
2020
2025
|
R(g, O);
|
|
2021
2026
|
}
|
|
2022
|
-
function
|
|
2027
|
+
function V() {
|
|
2023
2028
|
var g;
|
|
2024
2029
|
(g = r.value) == null || g.resetFields();
|
|
2025
2030
|
}
|
|
@@ -2041,7 +2046,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
2041
2046
|
updateFormField: R,
|
|
2042
2047
|
resetFormField: H,
|
|
2043
2048
|
updateFormSource: P,
|
|
2044
|
-
reset:
|
|
2049
|
+
reset: V,
|
|
2045
2050
|
validate: w,
|
|
2046
2051
|
onSubmitSuccess: s,
|
|
2047
2052
|
openCollapsedDialog: j,
|
|
@@ -2071,7 +2076,8 @@ const pe = /* @__PURE__ */ E({
|
|
|
2071
2076
|
span: this.formColumns
|
|
2072
2077
|
}, {
|
|
2073
2078
|
default: () => [f(ve, {
|
|
2074
|
-
label: "搜索条件"
|
|
2079
|
+
label: "搜索条件",
|
|
2080
|
+
class: "mb-0!"
|
|
2075
2081
|
}, {
|
|
2076
2082
|
default: () => [f("div", {
|
|
2077
2083
|
class: "w-full mt-5px text-left"
|
|
@@ -2112,7 +2118,7 @@ const pe = /* @__PURE__ */ E({
|
|
|
2112
2118
|
htmlType: "submit"
|
|
2113
2119
|
}, {
|
|
2114
2120
|
default: () => [I("搜索")]
|
|
2115
|
-
})), r.push(f(D, {
|
|
2121
|
+
})), this.resetable && r.push(f(D, {
|
|
2116
2122
|
type: "secondary",
|
|
2117
2123
|
onClick: () => {
|
|
2118
2124
|
var a;
|
|
@@ -2152,7 +2158,10 @@ const pe = /* @__PURE__ */ E({
|
|
|
2152
2158
|
});
|
|
2153
2159
|
};
|
|
2154
2160
|
return f("div", {
|
|
2155
|
-
class:
|
|
2161
|
+
class: {
|
|
2162
|
+
"form-render": !0,
|
|
2163
|
+
"no-rules": Object.keys(this.formRules).length === 0
|
|
2164
|
+
}
|
|
2156
2165
|
}, [f(Rr, {
|
|
2157
2166
|
ref: (r) => this.modalInstance = r
|
|
2158
2167
|
}, {
|
|
@@ -2195,15 +2204,15 @@ function bn(e) {
|
|
|
2195
2204
|
const a = (l = (u = n == null ? void 0 : n.proxy) == null ? void 0 : u.$refs) == null ? void 0 : l[e];
|
|
2196
2205
|
a && (r.value = a);
|
|
2197
2206
|
}
|
|
2198
|
-
return W(t),
|
|
2207
|
+
return W(t), yt(t), r;
|
|
2199
2208
|
}
|
|
2200
2209
|
const kn = {
|
|
2201
2210
|
install(e, n) {
|
|
2202
|
-
e.component("FormRender",
|
|
2211
|
+
e.component("FormRender", ye);
|
|
2203
2212
|
}
|
|
2204
2213
|
};
|
|
2205
2214
|
export {
|
|
2206
|
-
|
|
2215
|
+
ye as FormRender,
|
|
2207
2216
|
Cn as FormRenderResolver,
|
|
2208
2217
|
kn as default,
|
|
2209
2218
|
gn as defineForm,
|