@form-create/element-ui 2.7.4 → 2.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * FormCreate 低代码表单渲染器
3
- * @form-create/element-ui v2.7.4
3
+ * @form-create/element-ui v2.7.6
4
4
  * (c) 2018-2025 xaboy
5
5
  * Github https://github.com/xaboy/form-create
6
6
  * Site https://form-create.com/
@@ -11,7 +11,7 @@ var tr = Object.defineProperty, rr = Object.defineProperties;
11
11
  var ir = Object.getOwnPropertyDescriptors;
12
12
  var ot = Object.getOwnPropertySymbols;
13
13
  var nr = Object.prototype.hasOwnProperty, sr = Object.prototype.propertyIsEnumerable;
14
- var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, b = (t, e) => {
14
+ var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, v = (t, e) => {
15
15
  for (var r in e || (e = {}))
16
16
  nr.call(e, r) && at(t, r, e[r]);
17
17
  if (ot)
@@ -19,20 +19,20 @@ var at = (t, e, r) => e in t ? tr(t, e, { enumerable: !0, configurable: !0, writ
19
19
  sr.call(e, r) && at(t, r, e[r]);
20
20
  return t;
21
21
  }, q = (t, e) => rr(t, ir(e));
22
- import $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as B, onMounted as cr, onBeforeUnmount as fr, onUpdated as hr, nextTick as T, markRaw as ge, computed as ye, toRef as De, ref as dr } from "vue";
22
+ import $e, { getCurrentInstance as or, provide as ar, inject as lr, toRefs as lt, reactive as ne, onBeforeMount as ur, watch as L, onMounted as fr, onBeforeUnmount as cr, onUpdated as hr, nextTick as I, markRaw as ge, computed as ye, toRef as je, ref as dr } from "vue";
23
23
  function pr(t) {
24
24
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
25
25
  }
26
- function He() {
27
- return He = Object.assign ? Object.assign.bind() : function(t) {
26
+ function Ge() {
27
+ return Ge = Object.assign ? Object.assign.bind() : function(t) {
28
28
  for (var e, r = 1; r < arguments.length; r++) for (var i in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
29
29
  return t;
30
- }, He.apply(this, arguments);
30
+ }, Ge.apply(this, arguments);
31
31
  }
32
32
  var mr = ["attrs", "props", "domProps"], gr = ["class", "style", "directives"], yr = ["on", "nativeOn"], $r = function(t) {
33
33
  return t.reduce(function(e, r) {
34
34
  for (var i in r) if (!e[i]) e[i] = r[i];
35
- else if (mr.indexOf(i) !== -1) e[i] = He({}, e[i], r[i]);
35
+ else if (mr.indexOf(i) !== -1) e[i] = Ge({}, e[i], r[i]);
36
36
  else if (gr.indexOf(i) !== -1) {
37
37
  var s = e[i] instanceof Array ? e[i] : [e[i]], n = r[i] instanceof Array ? r[i] : [r[i]];
38
38
  e[i] = [].concat(s, n);
@@ -41,17 +41,17 @@ var mr = ["attrs", "props", "domProps"], gr = ["class", "style", "directives"],
41
41
  var a = e[i][o] instanceof Array ? e[i][o] : [e[i][o]], l = r[i][o] instanceof Array ? r[i][o] : [r[i][o]];
42
42
  e[i][o] = [].concat(a, l);
43
43
  } else e[i][o] = r[i][o];
44
- else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? vr(e[i][u], r[i][u]) : r[i][u];
44
+ else if (i === "hook") for (var u in r[i]) e[i][u] = e[i][u] ? br(e[i][u], r[i][u]) : r[i][u];
45
45
  else e[i] = r[i];
46
46
  return e;
47
47
  }, {});
48
- }, vr = function(t, e) {
48
+ }, br = function(t, e) {
49
49
  return function() {
50
50
  t && t.apply(this, arguments), e && e.apply(this, arguments);
51
51
  };
52
- }, br = $r;
53
- const V = /* @__PURE__ */ pr(br);
54
- function Qe(t, e) {
52
+ }, vr = $r;
53
+ const V = /* @__PURE__ */ pr(vr);
54
+ function Ze(t, e) {
55
55
  return Object.keys(t).reduce((r, i) => (r.push(t[i]), r), []);
56
56
  }
57
57
  const _r = "fcCheckbox", Cr = {
@@ -111,13 +111,13 @@ const _r = "fcCheckbox", Cr = {
111
111
  input: this.onInput
112
112
  }
113
113
  }]), [this.options().map((e, r) => {
114
- const i = b({}, e), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
114
+ const i = v({}, e), s = this.type === "button" ? "ElCheckboxButton" : "ElCheckbox";
115
115
  return delete i.value, t(s, V([{}, {
116
116
  props: i
117
117
  }, {
118
118
  key: s + r + "-" + e.value
119
119
  }]));
120
- }), Qe(this.$slots)]);
120
+ }), Ze(this.$slots)]);
121
121
  },
122
122
  mounted() {
123
123
  this.$emit("fc.el", this.$refs.el);
@@ -469,7 +469,7 @@ const wr = "fcFrame", Fr = {
469
469
  src: this.previewImage
470
470
  }
471
471
  })]), t("el-dialog", V([{}, {
472
- props: q(b({
472
+ props: q(v({
473
473
  width: i,
474
474
  title: o,
475
475
  appendToBody: !0
@@ -496,7 +496,7 @@ const wr = "fcFrame", Fr = {
496
496
  mounted() {
497
497
  this.$on("fc.closeModal", this.closeModal);
498
498
  }
499
- }, Or = "fcRadio", Rr = {
499
+ }, Or = "fcRadio", kr = {
500
500
  name: Or,
501
501
  props: {
502
502
  formCreateInject: {
@@ -550,13 +550,13 @@ const wr = "fcFrame", Fr = {
550
550
  input: this.onInput
551
551
  }
552
552
  }]), [this.options().map((e, r) => {
553
- const i = b({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
553
+ const i = v({}, e), s = this.type === "button" ? "ElRadioButton" : "ElRadio";
554
554
  return delete i.value, t(s, V([{}, {
555
555
  props: i
556
556
  }, {
557
557
  key: s + r + "-" + e.value
558
558
  }]));
559
- }), Qe(this.$slots)]);
559
+ }), Ze(this.$slots)]);
560
560
  },
561
561
  mounted() {
562
562
  this.$emit("fc.el", this.$refs.el);
@@ -626,8 +626,8 @@ const Er = "fcSelect", Sr = {
626
626
  mounted() {
627
627
  this.$emit("fc.el", this.$refs.el);
628
628
  }
629
- }, kr = "fcTree", Dr = {
630
- name: kr,
629
+ }, Rr = "fcTree", Dr = {
630
+ name: Rr,
631
631
  formCreateParser: {
632
632
  mergeProp(t) {
633
633
  const e = t.prop.props;
@@ -677,7 +677,7 @@ const Er = "fcSelect", Sr = {
677
677
  check: () => this.updateValue(),
678
678
  "node-click": () => this.updateValue()
679
679
  }
680
- }]), [Qe(this.$slots)]);
680
+ }]), [Ze(this.$slots)]);
681
681
  },
682
682
  mounted() {
683
683
  this.setValue(), this.$emit("fc.el", this.$refs.tree);
@@ -691,8 +691,8 @@ function ut(t, e) {
691
691
  uid: e
692
692
  };
693
693
  }
694
- function ct(t) {
695
- return q(b({}, t), {
694
+ function ft(t) {
695
+ return q(v({}, t), {
696
696
  file: t,
697
697
  value: t
698
698
  });
@@ -749,11 +749,11 @@ const Ar = "fcUpload", Vr = {
749
749
  };
750
750
  },
751
751
  created() {
752
- this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ct);
752
+ this.formCreateInject.prop.props.showFileList === void 0 && (this.formCreateInject.prop.props.showFileList = !1), this.formCreateInject.prop.props.fileList = H(this.value).map(ut).map(ft);
753
753
  },
754
754
  watch: {
755
755
  value(t) {
756
- this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ct), this.uploadList = this.$refs.upload.uploadFiles);
756
+ this.$refs.upload.uploadFiles.every((e) => !e.status || e.status === "success") && (this.$refs.upload.uploadFiles = H(t).map(ut).map(ft), this.uploadList = this.$refs.upload.uploadFiles);
757
757
  },
758
758
  limit(t, e) {
759
759
  (e === 1 || t === 1) && this.update();
@@ -917,7 +917,7 @@ function E(t, e, r) {
917
917
  function ie(t, e) {
918
918
  ($e.del || $e.delete)(t, e);
919
919
  }
920
- function _e(t, e = {}, r) {
920
+ function Ce(t, e = {}, r) {
921
921
  let i = !1;
922
922
  for (let s in e)
923
923
  if (Object.prototype.hasOwnProperty.call(e, s)) {
@@ -935,14 +935,14 @@ function _e(t, e = {}, r) {
935
935
  }
936
936
  else
937
937
  o && E(t, s, {});
938
- t[s] = _e(t[s], n, r);
938
+ t[s] = Ce(t[s], n, r);
939
939
  } else
940
940
  E(t, s, n), h.Undef(n) || (h.Undef(n.__json) || (t[s].__json = n.__json), h.Undef(n.__origin) || (t[s].__origin = n.__origin));
941
941
  }
942
942
  return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t;
943
943
  }
944
- function X(t) {
945
- return _e({}, { value: t }).value;
944
+ function K(t) {
945
+ return Ce({}, { value: t }).value;
946
946
  }
947
947
  const Ir = Object.assign || function(t) {
948
948
  for (let e, r = 1; r < arguments.length; r++)
@@ -953,8 +953,8 @@ const Ir = Object.assign || function(t) {
953
953
  function _() {
954
954
  return Ir.apply(this, arguments);
955
955
  }
956
- function Ge(t) {
957
- return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : b({}, t);
956
+ function Je(t) {
957
+ return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : v({}, t);
958
958
  }
959
959
  const Pr = "fcGroup", Tr = {
960
960
  name: Pr,
@@ -1038,13 +1038,13 @@ const Pr = "fcGroup", Tr = {
1038
1038
  const s = i.$f.formData();
1039
1039
  if (t === e)
1040
1040
  i.$f.deferSyncValue(() => {
1041
- _e(i.rule, t), i.$f.setValue(s);
1041
+ Ce(i.rule, t), i.$f.setValue(s);
1042
1042
  }, !0);
1043
1043
  else {
1044
1044
  const n = i.$f.formData();
1045
1045
  i.$f.once("reloading", () => {
1046
1046
  i.$f.setValue(n);
1047
- }), i.rule = X(t);
1047
+ }), i.rule = K(t);
1048
1048
  }
1049
1049
  }
1050
1050
  });
@@ -1091,7 +1091,7 @@ const Pr = "fcGroup", Tr = {
1091
1091
  if (i.filter((n) => r[n].$f).length !== i.length)
1092
1092
  return;
1093
1093
  const s = i.map((n) => {
1094
- const o = t === n ? e : b({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
1094
+ const o = t === n ? e : v({}, this.cacheRule[n].$f.form), a = this.field ? o[this.field] || null : o;
1095
1095
  return this.cache(n, a), a;
1096
1096
  });
1097
1097
  this.input(s);
@@ -1103,13 +1103,13 @@ const Pr = "fcGroup", Tr = {
1103
1103
  }), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cache(t, e), i && i.coverValue(e || {}));
1104
1104
  },
1105
1105
  addRule(t, e) {
1106
- const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? b({}, this.options) : {
1106
+ const r = this.formCreateInject.form.copyRules(this.formRule), i = this.options ? v({}, this.options) : {
1107
1107
  submitBtn: !1,
1108
1108
  resetBtn: !1
1109
1109
  };
1110
1110
  if (this.defaultValue) {
1111
1111
  i.formData || (i.formData = {});
1112
- const s = X(this.defaultValue);
1112
+ const s = K(this.defaultValue);
1113
1113
  _(i.formData, this.field ? {
1114
1114
  [this.field]: s
1115
1115
  } : s);
@@ -1133,7 +1133,10 @@ const Pr = "fcGroup", Tr = {
1133
1133
  this.$delete(this.cacheRule, t), this.$delete(this.cacheValue, t), e && this.$nextTick(() => this.$emit("remove", r));
1134
1134
  },
1135
1135
  add(t) {
1136
- this.disabled || this.onBeforeAdd(this.value) === !1 || this.addRule(t, !0);
1136
+ if (this.disabled || this.onBeforeAdd(this.value) === !1)
1137
+ return;
1138
+ const e = [...this.value];
1139
+ e.push(this.defaultValue ? K(this.defaultValue) : this.field ? null : {}), this.input(e);
1137
1140
  },
1138
1141
  del(t, e) {
1139
1142
  if (this.disabled || this.onBeforeRemove(this.value, t) === !1)
@@ -1224,7 +1227,7 @@ const Pr = "fcGroup", Tr = {
1224
1227
  const {
1225
1228
  rule: l,
1226
1229
  options: u
1227
- } = this.cacheRule[o], c = r && !s ? this.makeIcon(e.length, a, o) : [];
1230
+ } = this.cacheRule[o], f = r && !s ? this.makeIcon(e.length, a, o) : [];
1228
1231
  return t("div", {
1229
1232
  class: "_fc-group-container",
1230
1233
  key: o
@@ -1233,7 +1236,7 @@ const Pr = "fcGroup", Tr = {
1233
1236
  }, {
1234
1237
  on: {
1235
1238
  "update:value": (d) => this.formData(o, d),
1236
- "emit-event": (d, ...m) => this.emitEvent(d, m, a, o),
1239
+ "emit-event": (d, ...g) => this.emitEvent(d, g, a, o),
1237
1240
  input: (d) => this.add$f(a, o, d)
1238
1241
  }
1239
1242
  }, {}, {
@@ -1249,9 +1252,9 @@ const Pr = "fcGroup", Tr = {
1249
1252
  }
1250
1253
  }])), t("div", {
1251
1254
  class: "_fc-group-idx"
1252
- }, [a + 1]), c.length ? t("div", {
1255
+ }, [a + 1]), f.length ? t("div", {
1253
1256
  class: "_fc-group-handle fc-clock"
1254
- }, [c]) : null]);
1257
+ }, [f]) : null]);
1255
1258
  });
1256
1259
  return t("div", {
1257
1260
  key: "con",
@@ -1305,7 +1308,7 @@ const Pr = "fcGroup", Tr = {
1305
1308
  submitBtn: !1,
1306
1309
  resetBtn: !1
1307
1310
  };
1308
- t.formData = b({}, this.value || {}), this.cacheRule = {
1311
+ t.formData = v({}, this.value || {}), this.cacheRule = {
1309
1312
  rule: this.rule,
1310
1313
  options: t
1311
1314
  };
@@ -1345,7 +1348,7 @@ const Pr = "fcGroup", Tr = {
1345
1348
  }, Mr = [
1346
1349
  Cr,
1347
1350
  Fr,
1348
- Rr,
1351
+ kr,
1349
1352
  Sr,
1350
1353
  Dr,
1351
1354
  Vr,
@@ -1358,242 +1361,78 @@ function se(t, e) {
1358
1361
  r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...i), e);
1359
1362
  };
1360
1363
  }
1361
- function be(t) {
1364
+ function ve(t) {
1362
1365
  let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase();
1363
1366
  return e.indexOf("-") === 0 && (e = e.substr(1)), e;
1364
1367
  }
1365
- const Se = (t, e) => {
1366
- if (!(!t || t === e || !t.$props)) {
1367
- if (t.$props.formCreateInject)
1368
- return t.$props.formCreateInject;
1369
- if (t.$parent)
1370
- return Se(t.$parent, e);
1371
- }
1372
- };
1373
- function Nr(t, e, r) {
1374
- const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
1375
- return {
1376
- name: i,
1377
- componentName: i,
1378
- model: {
1379
- prop: "api"
1380
- },
1381
- components: e,
1382
- directives: r,
1383
- provide() {
1384
- return {
1385
- $pfc: this
1386
- };
1387
- },
1388
- inject: { $pfc: { default: null } },
1389
- props: {
1390
- rule: {
1391
- type: Array,
1392
- required: !0,
1393
- default: () => []
1394
- },
1395
- option: {
1396
- type: Object,
1397
- default: () => ({})
1398
- },
1399
- extendOption: Boolean,
1400
- driver: [String, Object],
1401
- value: Object,
1402
- disabled: {
1403
- type: Boolean,
1404
- default: void 0
1405
- },
1406
- preview: {
1407
- type: Boolean,
1408
- default: void 0
1409
- },
1410
- index: [String, Number],
1411
- api: Object,
1412
- locale: [String, Object],
1413
- name: String,
1414
- subForm: {
1415
- type: Boolean,
1416
- default: !0
1417
- },
1418
- inFor: Boolean
1419
- },
1420
- render() {
1421
- return this.fc.render();
1422
- },
1423
- setup(s) {
1424
- const n = or().proxy;
1425
- ar("parentFC", n);
1426
- const o = lr("parentFC", null);
1427
- let a = o;
1428
- if (o)
1429
- for (; a.parent; )
1430
- a = a.parent;
1431
- else
1432
- a = n;
1433
- const { rule: l, value: u, subForm: c, inFor: d } = lt(s), m = ne({
1434
- ctxInject: {},
1435
- destroyed: !1,
1436
- isShow: !0,
1437
- unique: 1,
1438
- renderRule: [...l.value || []],
1439
- updateValue: JSON.stringify(u.value || {})
1440
- }), g = new t(n), $ = g.api(), w = d.value, O = () => {
1441
- if (o) {
1442
- const R = Se(n, o);
1443
- if (R) {
1444
- let S;
1445
- w ? (S = H(R.getSubForm()), S.push($)) : S = $, R.subForm(S);
1446
- }
1447
- }
1448
- }, G = () => {
1449
- const R = Se(n, o);
1450
- if (R)
1451
- if (w) {
1452
- const S = H(R.getSubForm()), N = S.indexOf($);
1453
- N > -1 && S.splice(N, 1);
1454
- } else
1455
- R.subForm();
1456
- };
1457
- let P = null;
1458
- ur(() => {
1459
- B(() => {
1460
- let R = "";
1461
- const S = s.option && s.option.globalClass || {};
1462
- Object.keys(S).forEach((N) => {
1463
- let pe = "";
1464
- S[N].style && Object.keys(S[N].style).forEach((W) => {
1465
- pe += be(W) + ":" + S[N].style[W] + ";";
1466
- }), S[N].content && (pe += S[N].content + ";"), pe && (R += `.${N}{${pe}}`);
1467
- }), s.option && s.option.style && (R += s.option.style), P || (P = document.createElement("style"), P.type = "text/css", document.head.appendChild(P)), P.innerHTML = R || "";
1468
- }, () => {
1469
- });
1470
- });
1471
- const M = se(() => {
1472
- g.bus.$emit("$loadData.$topForm");
1473
- }, 100), he = se(function() {
1474
- g.bus.$emit("$loadData.$scopeForm");
1475
- }, 100), Ae = se(() => {
1476
- g.bus.$emit("$loadData.$form");
1477
- }, 100), de = (R) => {
1478
- g.bus.$emit("change-$form." + R);
1479
- };
1480
- return cr(() => {
1481
- o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he), g.mounted();
1482
- }), fr(() => {
1483
- o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), P && document.head.removeChild(P), G(), m.destroyed = !0, g.unmount();
1484
- }), hr(() => {
1485
- g.updated();
1486
- }), B(c, (R) => {
1487
- R ? O() : G();
1488
- }, { immediate: !0 }), B(() => s.option, () => {
1489
- g.initOptions(), $.refresh();
1490
- }, { deep: !0 }), B(() => [...l.value], (R) => {
1491
- g.$handle.isBreakWatch() || R.length === m.renderRule.length && R.every((S) => m.renderRule.indexOf(S) > -1) || (g.$handle.updateAppendData(), g.$handle.reloadRule(l.value), n.renderRule());
1492
- }), B(() => [s.disabled, s.preview], () => {
1493
- $.refresh();
1494
- }), B(u, (R) => {
1495
- JSON.stringify(R || {}) !== m.updateValue && ($.config.forceCoverValue ? $.coverValue(R || {}) : $.setValue(R || {}));
1496
- }, { deep: !0, flush: "post" }), B(() => s.index, () => {
1497
- $.coverValue({}), g.$handle.updateAppendData(), T(() => {
1498
- T(() => {
1499
- $.clearValidateState();
1500
- });
1501
- });
1502
- }, { flush: "sync" }), q(b({
1503
- fc: ge(g),
1504
- parent: o && ge(o),
1505
- top: ge(a),
1506
- fapi: ge($)
1507
- }, lt(m)), {
1508
- getGroupInject: () => Se(n, o),
1509
- refresh() {
1510
- ++m.unique;
1511
- },
1512
- renderRule() {
1513
- m.renderRule = [...l.value || []];
1514
- },
1515
- updateValue(R) {
1516
- if (m.destroyed) return;
1517
- const S = JSON.stringify(R);
1518
- m.updateValue !== S && (m.updateValue = S, n.$emit("update:value", R), T(() => {
1519
- Ae(), o ? c.value || he() : (M(), he());
1520
- }));
1521
- }
1522
- });
1523
- },
1524
- created() {
1525
- this.$emit("input", this.fapi), this.fc.init();
1526
- }
1527
- };
1528
- }
1529
- const Ot = ["attrs", "props", "domProps", "scopedSlots"], Rt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], ee = (t, e = {}, r = {}) => {
1530
- const i = [...Ot, ...r.normal || []], s = [...Rt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
1368
+ const Ot = ["attrs", "props", "domProps", "scopedSlots"], kt = ["class", "style", "directives"], Et = ["on", "nativeOn", "hook"], ee = (t, e = {}, r = {}) => {
1369
+ const i = [...Ot, ...r.normal || []], s = [...kt, ...r.array || []], n = [...Et, ...r.functional || []], o = r.props || [];
1531
1370
  return t.reduce((a, l) => {
1532
1371
  for (const u in l)
1533
1372
  if (a[u])
1534
1373
  if (o.indexOf(u) > -1)
1535
1374
  a[u] = ee([l[u]], a[u]);
1536
1375
  else if (i.indexOf(u) > -1)
1537
- a[u] = b(b({}, a[u]), l[u]);
1376
+ a[u] = v(v({}, a[u]), l[u]);
1538
1377
  else if (s.indexOf(u) > -1) {
1539
- const c = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
1540
- a[u] = [...c, ...d];
1378
+ const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]];
1379
+ a[u] = [...f, ...d];
1541
1380
  } else if (n.indexOf(u) > -1)
1542
- for (const c in l[u])
1543
- if (a[u][c]) {
1544
- const d = a[u][c] instanceof Array ? a[u][c] : [a[u][c]], m = l[u][c] instanceof Array ? l[u][c] : [l[u][c]];
1545
- a[u][c] = [...d, ...m];
1381
+ for (const f in l[u])
1382
+ if (a[u][f]) {
1383
+ const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], g = l[u][f] instanceof Array ? l[u][f] : [l[u][f]];
1384
+ a[u][f] = [...d, ...g];
1546
1385
  } else
1547
- a[u][c] = l[u][c];
1386
+ a[u][f] = l[u][f];
1548
1387
  else if (u === "hook")
1549
- for (let c in l[u])
1550
- a[u][c] ? a[u][c] = qr(a[u][c], l[u][c]) : a[u][c] = l[u][c];
1388
+ for (let f in l[u])
1389
+ a[u][f] ? a[u][f] = Nr(a[u][f], l[u][f]) : a[u][f] = l[u][f];
1551
1390
  else
1552
1391
  a[u] = l[u];
1553
1392
  else
1554
- i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = b({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? b({}, l[u]) : l[u] : a[u] = l[u];
1393
+ i.indexOf(u) > -1 || n.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = v({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? v({}, l[u]) : l[u] : a[u] = l[u];
1555
1394
  return a;
1556
1395
  }, e);
1557
- }, qr = (t, e) => function() {
1396
+ }, Nr = (t, e) => function() {
1558
1397
  t && t.apply(this, arguments), e && e.apply(this, arguments);
1559
- }, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Ze = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
1560
- function kt() {
1561
- return [...St, ...Ot, ...Rt, ...Et, ...Ze, ...Ye];
1398
+ }, St = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "nativeEmit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache"], Qe = ["validate", "children", "control"], Ye = ["effect", "deep", "renderSlots"];
1399
+ function Rt() {
1400
+ return [...St, ...Ot, ...kt, ...Et, ...Qe, ...Ye];
1562
1401
  }
1563
1402
  function Dt(t, e, r) {
1564
1403
  return `[form-create ${t}]: ${e}`;
1565
1404
  }
1566
- function xe(t, e) {
1405
+ function et(t, e) {
1567
1406
  console.error(Dt("err", t));
1568
1407
  }
1569
- function Ur(t) {
1570
- xe(t.toString()), console.error(t);
1408
+ function qr(t) {
1409
+ et(t.toString()), console.error(t);
1571
1410
  }
1572
1411
  function jt(t) {
1573
1412
  return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t);
1574
1413
  }
1575
- const Je = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
1576
- function et(t, e) {
1577
- return JSON.stringify(_e(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
1414
+ const Ke = "[[FORM-CREATE-PREFIX-", We = "-FORM-CREATE-SUFFIX]]";
1415
+ function _e(t, e) {
1416
+ return JSON.stringify(Ce(Array.isArray(t) ? [] : {}, t, !0), function(r, i) {
1578
1417
  if (!(i && i._isVue === !0)) {
1579
1418
  if (typeof i != "function")
1580
1419
  return i;
1581
1420
  if (i.__json)
1582
1421
  return i.__json;
1583
1422
  if (i.__origin && (i = i.__origin), !i.__emit)
1584
- return Je + i + We;
1423
+ return Ke + i + We;
1585
1424
  }
1586
1425
  }, e);
1587
1426
  }
1588
- function Te(t) {
1427
+ function Be(t) {
1589
1428
  return new Function("return " + t)();
1590
1429
  }
1591
- function z(t, e) {
1430
+ function x(t, e) {
1592
1431
  if (t && h.String(t) && t.length > 4) {
1593
1432
  let r = t.trim(), i = !1;
1594
1433
  try {
1595
- if (r.indexOf(We) > 0 && r.indexOf(Je) === 0)
1596
- r = r.replace(We, "").replace(Je, ""), i = !0;
1434
+ if (r.indexOf(We) > 0 && r.indexOf(Ke) === 0)
1435
+ r = r.replace(We, "").replace(Ke, ""), i = !0;
1597
1436
  else if (r.indexOf("$FN:") === 0)
1598
1437
  r = r.substring(4), i = !0;
1599
1438
  else if (r.indexOf("$EXEC:") === 0)
@@ -1607,19 +1446,19 @@ function z(t, e) {
1607
1446
  }, r.__json = t, r.__inject = !0, r;
1608
1447
  } else {
1609
1448
  if (r.indexOf("$FNX:") === 0)
1610
- return r = Te("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
1449
+ return r = Be("function($inject){" + r.substring(5) + "}"), r.__json = t, r.__inject = !0, r;
1611
1450
  (!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (i = !0);
1612
1451
  }
1613
1452
  if (!i) return t;
1614
1453
  let s;
1615
1454
  try {
1616
- s = Te(r);
1455
+ s = Be(r);
1617
1456
  } catch (n) {
1618
- s = Te("function " + r);
1457
+ s = Be("function " + r);
1619
1458
  }
1620
1459
  return s.__json = t, s;
1621
1460
  } catch (s) {
1622
- xe(`解析失败:${r}
1461
+ et(`解析失败:${r}
1623
1462
 
1624
1463
  err: ${s}`);
1625
1464
  return;
@@ -1629,12 +1468,12 @@ err: ${s}`);
1629
1468
  }
1630
1469
  function At(t, e) {
1631
1470
  return JSON.parse(t, function(r, i) {
1632
- return h.Undef(i) || !i.indexOf ? i : z(i, e);
1471
+ return h.Undef(i) || !i.indexOf ? i : x(i, e);
1633
1472
  });
1634
1473
  }
1635
- let Hr = 0;
1636
- function je() {
1637
- const t = 370 + ++Hr;
1474
+ let Ur = 0;
1475
+ function Ae() {
1476
+ const t = 370 + ++Ur;
1638
1477
  return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c";
1639
1478
  }
1640
1479
  function oe(t, e, r) {
@@ -1643,7 +1482,7 @@ function oe(t, e, r) {
1643
1482
  s && ((!i[s] || typeof i[s] != "object") && E(i, s, {}), i = i[s]), s = n;
1644
1483
  }), E(i, s, r), i;
1645
1484
  }
1646
- function Ke(t, e) {
1485
+ function ze(t, e) {
1647
1486
  return {
1648
1487
  value: t,
1649
1488
  enumerable: !1,
@@ -1655,16 +1494,16 @@ function Vt(t, e) {
1655
1494
  return It([t], e || !1)[0];
1656
1495
  }
1657
1496
  function It(t, e) {
1658
- return _e([], [...t], e || !1);
1497
+ return Ce([], [...t], e || !1);
1659
1498
  }
1660
1499
  function te(t, e) {
1661
- return ee(Array.isArray(e) ? e : [e], t, { array: Ze, normal: Ye }), t;
1500
+ return ee(Array.isArray(e) ? e : [e], t, { array: Qe, normal: Ye }), t;
1662
1501
  }
1663
- function ft(t) {
1502
+ function ct(t) {
1664
1503
  const e = h.Function(t.getRule) ? t.getRule() : t;
1665
1504
  return e.type || (e.type = "input"), e;
1666
1505
  }
1667
- function Gr(t, e) {
1506
+ function Hr(t, e) {
1668
1507
  return t ? (Object.keys(e || {}).forEach((r) => {
1669
1508
  e[r] && (t[r] = te(t[r] || {}, e[r]));
1670
1509
  }), t) : e;
@@ -1676,35 +1515,35 @@ function Pt(t, e) {
1676
1515
  }
1677
1516
  }, r), {}));
1678
1517
  }
1679
- function x(t) {
1518
+ function Y(t) {
1680
1519
  return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null);
1681
1520
  }
1682
1521
  function F(t, e) {
1683
1522
  try {
1684
1523
  e = t();
1685
1524
  } catch (r) {
1686
- Ur(r);
1525
+ qr(r);
1687
1526
  }
1688
1527
  return e;
1689
1528
  }
1690
- function Xe(t, e) {
1529
+ function xe(t, e) {
1691
1530
  let r = null;
1692
- return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => Xe(i, e)) : r = t, r && e && H(r).forEach((i) => {
1531
+ return h.Function(t) ? r = t() : Array.isArray(t) ? r = t.map((i) => xe(i, e)) : r = t, r && e && H(r).forEach((i) => {
1693
1532
  (Array.isArray(i) ? i : [i]).forEach((n) => {
1694
1533
  n && typeof n == "object" && (n.data || (n.data = {}), (!n.data.slot || n.data.slot === "default") && (n.data.slot = e || "default"));
1695
1534
  });
1696
1535
  }), r;
1697
1536
  }
1698
- function Jr(t, e) {
1537
+ function Gr(t, e) {
1699
1538
  if (h.Object(t)) {
1700
1539
  const r = {};
1701
1540
  return Object.keys(t).forEach((i) => {
1702
- r[i] = Xe(t[i], i);
1541
+ r[i] = xe(t[i], i);
1703
1542
  }), r;
1704
1543
  } else
1705
- return Xe(t, e);
1544
+ return xe(t, e);
1706
1545
  }
1707
- function Oe() {
1546
+ function ke() {
1708
1547
  const t = {}, e = (r) => r || "default";
1709
1548
  return {
1710
1549
  setSlot(r, i) {
@@ -1720,7 +1559,7 @@ function Oe() {
1720
1559
  const n = s();
1721
1560
  Array.isArray(n) ? i.push(...n) : i.push(n);
1722
1561
  } else h.Undef(s) || i.push(s);
1723
- }), Jr(i, r);
1562
+ }), Gr(i, r);
1724
1563
  },
1725
1564
  getSlots() {
1726
1565
  let r = [];
@@ -1740,12 +1579,12 @@ function Oe() {
1740
1579
  }
1741
1580
  };
1742
1581
  }
1743
- function Re(t, e) {
1582
+ function Ee(t, e) {
1744
1583
  return Object.setPrototypeOf(t, e), t;
1745
1584
  }
1746
- const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, ce = {
1585
+ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, fe = {
1747
1586
  "==": (t, e) => JSON.stringify(t) === JSON.stringify(ht(t, e)),
1748
- "!=": (t, e) => !ce["=="](t, e),
1587
+ "!=": (t, e) => !fe["=="](t, e),
1749
1588
  ">": (t, e) => t > e,
1750
1589
  ">=": (t, e) => t >= e,
1751
1590
  "<": (t, e) => t < e,
@@ -1754,13 +1593,13 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
1754
1593
  return t && t.indexOf && t.indexOf(ht(t[0], e)) > -1;
1755
1594
  },
1756
1595
  notOn(t, e) {
1757
- return !ce.on(t, e);
1596
+ return !fe.on(t, e);
1758
1597
  },
1759
1598
  in(t, e) {
1760
1599
  return e && e.indexOf && e.indexOf(t) > -1;
1761
1600
  },
1762
1601
  notIn(t, e) {
1763
- return !ce.in(t, e);
1602
+ return !fe.in(t, e);
1764
1603
  },
1765
1604
  between(t, e) {
1766
1605
  return t > e[0] && t < e[1];
@@ -1778,12 +1617,12 @@ const ht = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? N
1778
1617
  return new RegExp(e, "g").test(t);
1779
1618
  }
1780
1619
  };
1781
- function L(t, e) {
1620
+ function B(t, e) {
1782
1621
  return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => {
1783
1622
  t != null && (t = t[r]);
1784
1623
  }), t;
1785
1624
  }
1786
- function Wr(t) {
1625
+ function Jr(t) {
1787
1626
  const e = /{{\s*(.*?)\s*}}/g;
1788
1627
  let r;
1789
1628
  const i = {};
@@ -1797,6 +1636,170 @@ function dt(t) {
1797
1636
  n === 0 ? i = s : i += "." + s, r.push(i);
1798
1637
  }), r.join(" && ");
1799
1638
  }
1639
+ const Re = (t, e) => {
1640
+ if (!(!t || t === e || !t.$props)) {
1641
+ if (t.$props.formCreateInject)
1642
+ return t.$props.formCreateInject;
1643
+ if (t.$parent)
1644
+ return Re(t.$parent, e);
1645
+ }
1646
+ };
1647
+ function Kr(t, e, r) {
1648
+ const i = "FormCreate" + (t.isMobile ? "Mobile" : "");
1649
+ return {
1650
+ name: i,
1651
+ componentName: i,
1652
+ model: {
1653
+ prop: "api"
1654
+ },
1655
+ components: e,
1656
+ directives: r,
1657
+ provide() {
1658
+ return {
1659
+ $pfc: this
1660
+ };
1661
+ },
1662
+ inject: { $pfc: { default: null } },
1663
+ props: {
1664
+ rule: {
1665
+ type: Array,
1666
+ required: !0,
1667
+ default: () => []
1668
+ },
1669
+ option: {
1670
+ type: Object,
1671
+ default: () => ({})
1672
+ },
1673
+ extendOption: Boolean,
1674
+ driver: [String, Object],
1675
+ value: Object,
1676
+ disabled: {
1677
+ type: Boolean,
1678
+ default: void 0
1679
+ },
1680
+ preview: {
1681
+ type: Boolean,
1682
+ default: void 0
1683
+ },
1684
+ index: [String, Number],
1685
+ api: Object,
1686
+ locale: [String, Object],
1687
+ name: String,
1688
+ subForm: {
1689
+ type: Boolean,
1690
+ default: !0
1691
+ },
1692
+ inFor: Boolean
1693
+ },
1694
+ render() {
1695
+ return this.fc.render();
1696
+ },
1697
+ setup(s) {
1698
+ const n = or().proxy;
1699
+ ar("parentFC", n);
1700
+ const o = lr("parentFC", null);
1701
+ let a = o;
1702
+ if (o)
1703
+ for (; a.parent; )
1704
+ a = a.parent;
1705
+ else
1706
+ a = n;
1707
+ const { rule: l, value: u, subForm: f, inFor: d } = lt(s), g = ne({
1708
+ ctxInject: {},
1709
+ destroyed: !1,
1710
+ isShow: !0,
1711
+ unique: 1,
1712
+ renderRule: [...l.value || []],
1713
+ updateValue: JSON.stringify(u.value || {})
1714
+ }), m = new t(n), $ = m.api(), w = d.value, O = () => {
1715
+ if (o) {
1716
+ const k = Re(n, o);
1717
+ if (k) {
1718
+ let S;
1719
+ w ? (S = H(k.getSubForm()), S.push($)) : S = $, k.subForm(S);
1720
+ }
1721
+ }
1722
+ }, G = () => {
1723
+ const k = Re(n, o);
1724
+ if (k)
1725
+ if (w) {
1726
+ const S = H(k.getSubForm()), N = S.indexOf($);
1727
+ N > -1 && S.splice(N, 1);
1728
+ } else
1729
+ k.subForm();
1730
+ };
1731
+ let T = null;
1732
+ ur(() => {
1733
+ L(() => {
1734
+ let k = "";
1735
+ const S = s.option && s.option.globalClass || {};
1736
+ Object.keys(S).forEach((N) => {
1737
+ let pe = "";
1738
+ S[N].style && Object.keys(S[N].style).forEach((W) => {
1739
+ pe += ve(W) + ":" + S[N].style[W] + ";";
1740
+ }), S[N].content && (pe += S[N].content + ";"), pe && (k += `.${N}{${pe}}`);
1741
+ }), s.option && s.option.style && (k += s.option.style), T || (T = document.createElement("style"), T.type = "text/css", document.head.appendChild(T)), T.innerHTML = k || "";
1742
+ }, () => {
1743
+ });
1744
+ });
1745
+ const M = se(() => {
1746
+ m.bus.$emit("$loadData.$topForm");
1747
+ }, 100), he = se(function() {
1748
+ m.bus.$emit("$loadData.$scopeForm");
1749
+ }, 100), Ve = se(() => {
1750
+ m.bus.$emit("$loadData.$form");
1751
+ }, 100), de = (k) => {
1752
+ m.bus.$emit("change-$form." + k);
1753
+ };
1754
+ return fr(() => {
1755
+ o && ($.top.bus.$on("$loadData.$form", M), $.top.bus.$on("change", de)), $ !== $.scope && $.scope.bus.$on("$loadData.$scopeForm", he), m.mounted();
1756
+ }), cr(() => {
1757
+ o && ($.top.bus.$off("$loadData.$form", M), $.top.bus.$off("change", de)), $ !== $.scope && $.scope.bus.$off("$loadData.$scopeForm", he), T && document.head.removeChild(T), G(), g.destroyed = !0, m.unmount();
1758
+ }), hr(() => {
1759
+ m.updated();
1760
+ }), L(f, (k) => {
1761
+ k ? O() : G();
1762
+ }, { immediate: !0 }), L(() => s.option, () => {
1763
+ m.initOptions(), $.refresh();
1764
+ }, { deep: !0 }), L(() => [...l.value], (k) => {
1765
+ m.$handle.isBreakWatch() || k.length === g.renderRule.length && k.every((S) => g.renderRule.indexOf(S) > -1) || (m.$handle.updateAppendData(), m.$handle.reloadRule(l.value), n.renderRule());
1766
+ }), L(() => [s.disabled, s.preview], () => {
1767
+ $.refresh();
1768
+ }), L(u, (k) => {
1769
+ _e(k || {}) !== g.updateValue && ($.config.forceCoverValue ? $.coverValue(k || {}) : $.setValue(k || {}));
1770
+ }, { deep: !0, flush: "post" }), L(() => s.index, () => {
1771
+ $.coverValue({}), m.$handle.updateAppendData(), I(() => {
1772
+ I(() => {
1773
+ $.clearValidateState();
1774
+ });
1775
+ });
1776
+ }, { flush: "sync" }), q(v({
1777
+ fc: ge(m),
1778
+ parent: o && ge(o),
1779
+ top: ge(a),
1780
+ fapi: ge($)
1781
+ }, lt(g)), {
1782
+ getGroupInject: () => Re(n, o),
1783
+ refresh() {
1784
+ ++g.unique;
1785
+ },
1786
+ renderRule() {
1787
+ g.renderRule = [...l.value || []];
1788
+ },
1789
+ updateValue(k) {
1790
+ if (g.destroyed) return;
1791
+ const S = _e(k);
1792
+ g.updateValue !== S && (g.updateValue = S, n.$emit("update:value", k), I(() => {
1793
+ Ve(), o ? f.value || he() : (M(), he());
1794
+ }));
1795
+ }
1796
+ });
1797
+ },
1798
+ created() {
1799
+ this.$emit("input", this.fapi), this.fc.init();
1800
+ }
1801
+ };
1802
+ }
1800
1803
  function Tt() {
1801
1804
  return {
1802
1805
  props: {},
@@ -1809,7 +1812,7 @@ function Tt() {
1809
1812
  value: void 0
1810
1813
  };
1811
1814
  }
1812
- function I(t, e) {
1815
+ function P(t, e) {
1813
1816
  return (r, i, s, n = {}) => {
1814
1817
  const o = new tt(t, r, i, s, n);
1815
1818
  return e && (h.Function(e) ? e(o) : o.props(e)), o;
@@ -1837,9 +1840,9 @@ function Bt(t) {
1837
1840
  };
1838
1841
  });
1839
1842
  }
1840
- Bt(kt());
1841
- const Lt = I("");
1842
- function Kr(t, e, r) {
1843
+ Bt(Rt());
1844
+ const Lt = P("");
1845
+ function Wr(t, e, r) {
1843
1846
  let i = Lt("", e);
1844
1847
  return i._data.type = t, i._data.title = r, i;
1845
1848
  }
@@ -1847,15 +1850,15 @@ function pt(t, e, r, i) {
1847
1850
  let s = Lt("", r);
1848
1851
  return s._data.type = "template", s._data.template = t, s._data.title = i, s._data.vm = e, s;
1849
1852
  }
1850
- function Xr() {
1853
+ function zr() {
1851
1854
  return {
1852
- create: Kr,
1855
+ create: Wr,
1853
1856
  createTmp: pt,
1854
1857
  template: pt,
1855
- factory: I
1858
+ factory: P
1856
1859
  };
1857
1860
  }
1858
- function zr(t, e, r) {
1861
+ function xr(t, e, r) {
1859
1862
  const i = `fail to ${t} ${r.status}'`, s = new Error(i);
1860
1863
  return s.status = r.status, s.url = t, s;
1861
1864
  }
@@ -1884,7 +1887,7 @@ function Mt(t) {
1884
1887
  t.onError(o);
1885
1888
  }, e.onload = function() {
1886
1889
  if (e.status < 200 || e.status >= 300)
1887
- return t.onError(zr(r, t, e), mt(e));
1890
+ return t.onError(xr(r, t, e), mt(e));
1888
1891
  t.onSuccess(mt(e));
1889
1892
  }, e.open(t.method || "get", r, !0);
1890
1893
  let i;
@@ -1898,11 +1901,11 @@ function Mt(t) {
1898
1901
  }
1899
1902
  function gt(t, e, r) {
1900
1903
  return new Promise((i, s) => {
1901
- (e || Mt)(q(b({}, t), {
1904
+ (e || Mt)(q(v({}, t), {
1902
1905
  onSuccess(n) {
1903
1906
  let o = (l) => l;
1904
- const a = z(t.parse);
1905
- h.Function(a) ? o = a : a && h.String(a) && (o = (l) => L(l, a)), i(o(n, void 0, r));
1907
+ const a = x(t.parse);
1908
+ h.Function(a) ? o = a : a && h.String(a) && (o = (l) => B(l, a)), i(o(n, void 0, r));
1906
1909
  },
1907
1910
  onError(n) {
1908
1911
  s(n);
@@ -1910,17 +1913,18 @@ function gt(t, e, r) {
1910
1913
  }));
1911
1914
  });
1912
1915
  }
1913
- function ve(t) {
1914
- return X(t);
1916
+ function be(t) {
1917
+ return K(t);
1915
1918
  }
1916
- function Qr(t) {
1919
+ function Xr(t) {
1917
1920
  function e(n) {
1918
1921
  return h.Undef(n) ? n = t.fields() : Array.isArray(n) || (n = [n]), n;
1919
1922
  }
1920
1923
  function r(n, o, a) {
1921
- e(n).forEach((l) => {
1922
- t.getCtxs(l).forEach((u) => {
1923
- E(u.rule, o, a), t.$render.clearCache(u);
1924
+ h.Undef(n) ? n = Object.keys(v(v({}, t.fieldCtx), t.nameCtx)) : Array.isArray(n) || (n = [n]), n.forEach((l) => {
1925
+ const u = t.fieldCtx[l] || t.nameCtx[l];
1926
+ u && u.forEach((f) => {
1927
+ E(f.rule, o, a), t.$render.clearCache(f);
1924
1928
  });
1925
1929
  });
1926
1930
  }
@@ -1932,6 +1936,12 @@ function Qr(t) {
1932
1936
  }, []);
1933
1937
  }
1934
1938
  const s = {
1939
+ get isScope() {
1940
+ return t.vm.$props.subForm === !1;
1941
+ },
1942
+ get isPreview() {
1943
+ return t.preview;
1944
+ },
1935
1945
  get config() {
1936
1946
  return t.options;
1937
1947
  },
@@ -1983,28 +1993,31 @@ function Qr(t) {
1983
1993
  return o > -1 ? o : void 0;
1984
1994
  }
1985
1995
  },
1996
+ get formulas() {
1997
+ return v({}, t.fc.formulas);
1998
+ },
1986
1999
  formData(n) {
1987
2000
  if (n == null || typeof n == "boolean") {
1988
2001
  const o = {};
1989
2002
  return Object.keys(t.form).forEach((a) => {
1990
- (n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = ve(t.form[a]));
2003
+ (n === !0 || t.ignoreFields.indexOf(a) === -1) && (o[a] = be(t.form[a]));
1991
2004
  }), o;
1992
2005
  } else
1993
2006
  return e(n).reduce((o, a) => (o[a] = s.getValue(a), o), {});
1994
2007
  },
1995
2008
  getValue(n) {
1996
2009
  const o = t.getFieldCtx(n);
1997
- return o ? ve(o.rule.value) : t.options.appendValue !== !1 && D(t.appendData, n) ? ve(t.appendData[n]) : void 0;
2010
+ return o ? be(o.rule.value) : t.options.appendValue !== !1 && D(t.appendData, n) ? be(t.appendData[n]) : void 0;
1998
2011
  },
1999
2012
  coverValue(n) {
2000
- const o = b({}, n || {});
2013
+ const o = v({}, n || {});
2001
2014
  t.deferSyncValue(() => {
2002
2015
  t.appendData = {}, s.fields().forEach((a) => {
2003
2016
  const l = t.fieldCtx[a];
2004
2017
  if (l) {
2005
2018
  const u = D(n, a);
2006
- l.forEach((c) => {
2007
- c.rule.value = u ? n[a] : void 0;
2019
+ l.forEach((f) => {
2020
+ f.rule.value = u ? n[a] : void 0;
2008
2021
  }), delete o[a];
2009
2022
  }
2010
2023
  }), _(t.appendData, o);
@@ -2031,7 +2044,7 @@ function Qr(t) {
2031
2044
  }, !0), o ? o.origin : void 0;
2032
2045
  },
2033
2046
  removeRule(n) {
2034
- const o = n && x(n);
2047
+ const o = n && Y(n);
2035
2048
  if (o)
2036
2049
  return o.rm(), o.origin;
2037
2050
  },
@@ -2041,24 +2054,24 @@ function Qr(t) {
2041
2054
  fields: () => t.fields(),
2042
2055
  append: (n, o, a) => {
2043
2056
  let l = t.sort.length - 1, u;
2044
- const c = t.getCtx(o);
2045
- if (c)
2057
+ const f = t.getCtx(o);
2058
+ if (f)
2046
2059
  if (a) {
2047
- if (u = c.getPending("children", c.rule.children), !Array.isArray(u)) return;
2048
- l = c.rule.children.length - 1;
2060
+ if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
2061
+ l = f.rule.children.length - 1;
2049
2062
  } else
2050
- l = c.root.indexOf(c.origin), u = c.root;
2063
+ l = f.root.indexOf(f.origin), u = f.root;
2051
2064
  else u = t.rules;
2052
2065
  u.splice(l + 1, 0, n);
2053
2066
  },
2054
2067
  prepend: (n, o, a) => {
2055
2068
  let l = 0, u;
2056
- const c = t.getCtx(o);
2057
- if (c)
2069
+ const f = t.getCtx(o);
2070
+ if (f)
2058
2071
  if (a) {
2059
- if (u = c.getPending("children", c.rule.children), !Array.isArray(u)) return;
2072
+ if (u = f.getPending("children", f.rule.children), !Array.isArray(u)) return;
2060
2073
  } else
2061
- l = c.root.indexOf(c.origin), u = c.root;
2074
+ l = f.root.indexOf(f.origin), u = f.root;
2062
2075
  else u = t.rules;
2063
2076
  u.splice(l, 0, n);
2064
2077
  },
@@ -2120,7 +2133,7 @@ function Qr(t) {
2120
2133
  n.forEach((a) => s.sync(a));
2121
2134
  return;
2122
2135
  }
2123
- let o = h.Object(n) ? x(n) : t.getCtxs(n);
2136
+ let o = h.Object(n) ? Y(n) : t.getCtxs(n);
2124
2137
  o && (o = Array.isArray(o) ? o : [o], o.forEach((a) => {
2125
2138
  if (!a.deleted) {
2126
2139
  const l = t.subForm[a.id];
@@ -2204,11 +2217,11 @@ function Qr(t) {
2204
2217
  resetFields(n) {
2205
2218
  e(n).forEach((o) => {
2206
2219
  t.getCtxs(o).forEach((a) => {
2207
- t.$render.clearCache(a), a.rule.value = ve(a.defaultValue);
2220
+ t.$render.clearCache(a), a.rule.value = be(a.defaultValue);
2208
2221
  });
2209
- }), T(() => {
2210
- T(() => {
2211
- T(() => {
2222
+ }), I(() => {
2223
+ I(() => {
2224
+ I(() => {
2212
2225
  s.clearValidateState(n);
2213
2226
  });
2214
2227
  });
@@ -2224,7 +2237,7 @@ function Qr(t) {
2224
2237
  return F(() => s.method(n, o)(...a));
2225
2238
  },
2226
2239
  toJson(n) {
2227
- return et(s.rule, n);
2240
+ return _e(s.rule, n);
2228
2241
  },
2229
2242
  trigger(n, o, ...a) {
2230
2243
  const l = s.el(n);
@@ -2243,29 +2256,29 @@ function Qr(t) {
2243
2256
  return o ? t.subForm[o.id] : void 0;
2244
2257
  },
2245
2258
  getChildrenRuleList(n) {
2246
- const o = typeof n == "object", a = o ? x(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
2259
+ const o = typeof n == "object", a = o ? Y(n) : t.getCtx(n), l = a ? a.rule : o ? n : s.getRule(n);
2247
2260
  if (!l)
2248
2261
  return [];
2249
2262
  const u = [];
2250
2263
  return ((d) => {
2251
- d && d.forEach((m) => {
2252
- typeof m == "object" && (m.field && u.push(m), u.push(...s.getChildrenRuleList(m)));
2264
+ d && d.forEach((g) => {
2265
+ typeof g == "object" && (g.field && u.push(g), u.push(...s.getChildrenRuleList(g)));
2253
2266
  });
2254
2267
  })(a ? a.loadChildrenPending() : l.children), u;
2255
2268
  },
2256
2269
  getParentRule(n) {
2257
- return (typeof n == "object" ? x(n) : t.getCtx(n)).parent.rule;
2270
+ return (typeof n == "object" ? Y(n) : t.getCtx(n)).parent.rule;
2258
2271
  },
2259
2272
  getParentSubRule(n) {
2260
- const a = typeof n == "object" ? x(n) : t.getCtx(n);
2273
+ const a = typeof n == "object" ? Y(n) : t.getCtx(n);
2261
2274
  if (a) {
2262
2275
  const l = a.getParentGroup();
2263
2276
  if (l)
2264
2277
  return l.rule;
2265
2278
  }
2266
2279
  },
2267
- getChildrenFormData(n) {
2268
- return s.getChildrenRuleList(n).reduce((a, l) => (a[l.field] = ve(l.value), a), {});
2280
+ getChildrenFormData(n, o) {
2281
+ return s.getChildrenRuleList(n).reduce((l, u) => ((u.ignore !== !0 || o === !0) && (l[u.field] = be(u.value)), l), {});
2269
2282
  },
2270
2283
  setChildrenFormData(n, o, a) {
2271
2284
  const l = s.getChildrenRuleList(n);
@@ -2278,7 +2291,7 @@ function Qr(t) {
2278
2291
  getGlobalEvent(n) {
2279
2292
  let o = s.options.globalEvent[n];
2280
2293
  if (o)
2281
- return typeof o == "object" && (o = o.handle), z(o);
2294
+ return typeof o == "object" && (o = o.handle), x(o);
2282
2295
  },
2283
2296
  getGlobalData(n) {
2284
2297
  return new Promise((o, a) => {
@@ -2289,11 +2302,11 @@ function Qr(t) {
2289
2302
  });
2290
2303
  },
2291
2304
  renderRule(n, o, a) {
2292
- const u = typeof n == "object" ? x(n) : t.getCtx(n);
2305
+ const u = typeof n == "object" ? Y(n) : t.getCtx(n);
2293
2306
  return u ? t.$render.createRuleVnode(u, o, a) : void 0;
2294
2307
  },
2295
2308
  renderChildren(n, o, a) {
2296
- const u = typeof n == "object" ? x(n) : t.getCtx(n);
2309
+ const u = typeof n == "object" ? Y(n) : t.getCtx(n);
2297
2310
  return u ? t.$render.createChildrenVnodes(u, o, a) : void 0;
2298
2311
  },
2299
2312
  nextTick(n) {
@@ -2311,21 +2324,23 @@ function Qr(t) {
2311
2324
  bus: t.bus,
2312
2325
  fetch(n) {
2313
2326
  return new Promise((o, a) => {
2314
- n = X(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
2327
+ n = K(n), n = t.loadFetchVar(n), t.beforeFetch(n).then(() => gt(n, t.fc.create.fetch, s).then((l) => {
2315
2328
  F(() => n.onSuccess && n.onSuccess(l)), o(l);
2316
2329
  }).catch((l) => {
2317
2330
  F(() => n.onError && n.onError(l)), a(l);
2318
- }));
2331
+ })).catch((l) => {
2332
+ });
2319
2333
  });
2320
2334
  },
2321
2335
  watchFetch(n, o, a, l) {
2322
- return t.fc.watchLoadData((u, c) => {
2323
- let d = X(n);
2324
- d = t.loadFetchVar(d, u), !(l && l(d, c) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((m) => {
2325
- F(() => d.onSuccess && d.onSuccess(m)), o && o(m, c);
2326
- }).catch((m) => {
2327
- F(() => d.onError && d.onError(m)), a && a(m);
2328
- }));
2336
+ return t.fc.watchLoadData((u, f) => {
2337
+ let d = K(n);
2338
+ d = t.loadFetchVar(d, u), !(l && l(d, f) === !1) && t.beforeFetch(d).then(() => gt(d, t.fc.create.fetch, s).then((g) => {
2339
+ F(() => d.onSuccess && d.onSuccess(g)), o && o(g, f);
2340
+ }).catch((g) => {
2341
+ F(() => d.onError && d.onError(g)), a && a(g);
2342
+ })).catch((g) => {
2343
+ });
2329
2344
  }, n.wait == null ? 1e3 : n.wait);
2330
2345
  },
2331
2346
  getData(n, o) {
@@ -2395,7 +2410,7 @@ function J(t) {
2395
2410
  function Nt(t) {
2396
2411
  return t.replace(t[0], t[0].toLowerCase());
2397
2412
  }
2398
- function Yr(t) {
2413
+ function Qr(t) {
2399
2414
  _(t.prototype, {
2400
2415
  initRender() {
2401
2416
  this.cacheConfig = {};
@@ -2404,7 +2419,7 @@ function Yr(t) {
2404
2419
  const r = (i) => {
2405
2420
  if (i) {
2406
2421
  let s;
2407
- return e.rule.field && (s = i.$scopedSlots["field-" + be(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + be(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
2422
+ return e.rule.field && (s = i.$scopedSlots["field-" + ve(e.rule.field)] || i.$scopedSlots["field-" + e.rule.field]), s || (s = i.$scopedSlots["type-" + ve(e.type)] || i.$scopedSlots["type-" + e.type]), s || r(i.$pfc);
2408
2423
  }
2409
2424
  };
2410
2425
  return r(this.vm);
@@ -2413,7 +2428,7 @@ function Yr(t) {
2413
2428
  if (!this.vm.isShow)
2414
2429
  return;
2415
2430
  this.$manager.beforeRender();
2416
- const e = Oe();
2431
+ const e = ke();
2417
2432
  return this.sort.forEach((r) => {
2418
2433
  this.renderSlot(e, this.$handle.ctxs[r]);
2419
2434
  }), this.$manager.render(e);
@@ -2475,10 +2490,10 @@ function Yr(t) {
2475
2490
  slotValue: l
2476
2491
  };
2477
2492
  l.length && i.slotUpdate && F(() => i.slotUpdate(u));
2478
- let c = [];
2493
+ let f = [];
2479
2494
  const d = e.loadChildrenPending();
2480
- e.parser.renderChildren ? c = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (c = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
2481
- c.push(this.renderRule({
2495
+ e.parser.renderChildren ? f = e.parser.renderChildren(d, e) : e.parser.loadChildren !== !1 && (f = this.renderChildren(d, e)), Object.keys(n.renderSlots || {}).forEach(($) => {
2496
+ f.push(this.renderRule({
2482
2497
  type: "template",
2483
2498
  slot: $
2484
2499
  }, (() => {
@@ -2488,9 +2503,9 @@ function Yr(t) {
2488
2503
  return this.renderRule(w);
2489
2504
  })()));
2490
2505
  });
2491
- const m = this.getTypeSlot(e);
2492
- let g;
2493
- return m ? (u.children = c, g = m(u)) : g = a ? e.parser.preview(Ge(c), e) : e.parser.render(Ge(c), e), g = this.renderSides(g, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), g = this.$manager.makeWrap(e, g)), e.none && (Array.isArray(g) ? g = g.map(($) => !$ || !$.tag ? $ : this.none($)) : g = this.none(g)), o && this.setCache(e, () => this.stable(g), r), g;
2506
+ const g = this.getTypeSlot(e);
2507
+ let m;
2508
+ return g ? (u.children = f, m = g(u)) : m = a ? e.parser.preview(Je(f), e) : e.parser.render(Je(f), e), m = this.renderSides(m, e), !(!e.input && h.Undef(n.native)) && n.native !== !0 && (this.fc.targetFormDriver("updateWrap", e), m = this.$manager.makeWrap(e, m)), e.none && (Array.isArray(m) ? m = m.map(($) => !$ || !$.tag ? $ : this.none($)) : m = this.none(m)), o && this.setCache(e, () => this.stable(m), r), m;
2494
2509
  }, this.setCache(e, s, r);
2495
2510
  }
2496
2511
  return (...s) => {
@@ -2557,8 +2572,8 @@ function Yr(t) {
2557
2572
  preview: e.prop.preview,
2558
2573
  options: e.prop.options,
2559
2574
  prop: function() {
2560
- const s = b({}, e.prop);
2561
- return s.on = s.on ? b({}, s.on) : {}, delete s.model, s;
2575
+ const s = v({}, e.prop);
2576
+ return s.on = s.on ? v({}, s.on) : {}, delete s.model, s;
2562
2577
  }(),
2563
2578
  children: e.loadChildrenPending()
2564
2579
  }), i;
@@ -2566,7 +2581,11 @@ function Yr(t) {
2566
2581
  ctxProp(e) {
2567
2582
  const { ref: r, key: i, rule: s } = e;
2568
2583
  this.$manager.mergeProp(e), e.parser.mergeProp(e);
2569
- const n = [
2584
+ const n = v({}, e.prop.on || {}), o = {};
2585
+ Object.keys(n).forEach((l) => {
2586
+ l.indexOf("native.") === 0 && (o[l.replace("native.", "")] = n[l], delete n[l]);
2587
+ }), e.prop.on = n;
2588
+ const a = [
2570
2589
  {
2571
2590
  ref: r,
2572
2591
  key: s.key || `${i}fc`,
@@ -2575,30 +2594,33 @@ function Yr(t) {
2575
2594
  "hook:mounted": () => {
2576
2595
  this.onMounted(e);
2577
2596
  },
2578
- "fc.updateValue": (o) => {
2579
- this.$handle.onUpdateValue(e, o);
2597
+ "fc.updateValue": (l) => {
2598
+ this.$handle.onUpdateValue(e, l);
2580
2599
  },
2581
- "fc.el": (o) => {
2582
- e.exportEl = o, o && ((o.$el || o).__rule__ = e.rule);
2600
+ "fc.el": (l) => {
2601
+ e.exportEl = l, l && ((l.$el || l).__rule__ = e.rule);
2583
2602
  }
2584
2603
  }
2604
+ },
2605
+ {
2606
+ nativeOn: o
2585
2607
  }
2586
2608
  ];
2587
2609
  if (e.input) {
2588
- const o = this.tmpInput;
2610
+ const l = this.tmpInput;
2589
2611
  this.vm.$props.disabled === !0 && (e.prop.props.disabled = !0), e.prop.model = {
2590
2612
  value: this.$handle.getFormData(e),
2591
- callback: (a) => {
2592
- o && o(e.field, a, e.rule), this.onInput(e, a);
2613
+ callback: (u) => {
2614
+ l && l(e.field, u, e.rule), this.onInput(e, u);
2593
2615
  },
2594
2616
  expression: `formData.${e.id}`
2595
- }, e.prop.modelEmit && n.push({
2617
+ }, e.prop.modelEmit && a.push({
2596
2618
  on: {
2597
2619
  [e.prop.modelEmit]: () => this.onEmitInput(e)
2598
2620
  }
2599
2621
  });
2600
2622
  }
2601
- return ee(n, e.prop), e.prop;
2623
+ return ee(a, e.prop), e.prop;
2602
2624
  },
2603
2625
  onMounted(e) {
2604
2626
  e.el = this.vm.$refs[e.ref], e.el && ((e.el.$el || e.el).__rule__ = e.rule), e.parser.mounted(e), this.$handle.effect(e, "mounted"), this.$handle.targetHook(e, "mounted");
@@ -2615,7 +2637,7 @@ function Yr(t) {
2615
2637
  },
2616
2638
  renderChildren(e, r, i) {
2617
2639
  if (!h.trueArray(e)) return [];
2618
- const s = Oe();
2640
+ const s = ke();
2619
2641
  return e.map((n) => {
2620
2642
  if (n) {
2621
2643
  if (h.String(n)) return s.setSlot(null, i ? this.renderRule({
@@ -2624,7 +2646,7 @@ function Yr(t) {
2624
2646
  }) : n);
2625
2647
  if (n.__fc__)
2626
2648
  return this.renderSlot(s, n.__fc__, r);
2627
- n.type && T(() => {
2649
+ n.type && I(() => {
2628
2650
  this.$handle.loadChildren(e, r), this.$handle.refresh();
2629
2651
  });
2630
2652
  }
@@ -2641,7 +2663,7 @@ function Yr(t) {
2641
2663
  },
2642
2664
  createRuleVnode(e, r, i) {
2643
2665
  this.force = i !== !1, this.tmpInput = r;
2644
- const s = Oe();
2666
+ const s = ke();
2645
2667
  return this.renderSlot(s, e, e.parent), this.force = !1, this.tmpInput = null, s.getSlots();
2646
2668
  },
2647
2669
  renderRule(e, r, i) {
@@ -2656,16 +2678,16 @@ function Yr(t) {
2656
2678
  a && (s = J(a));
2657
2679
  }
2658
2680
  if (!s) return;
2659
- const n = Oe();
2681
+ const n = ke();
2660
2682
  h.trueArray(e.children) && e.children.forEach((a) => {
2661
2683
  a && n.setSlot(a == null ? void 0 : a.slot, () => this.renderRule(a));
2662
2684
  });
2663
- const o = b({}, e);
2685
+ const o = v({}, e);
2664
2686
  return delete o.type, delete o.is, this.vNode.make(s, o, n.mergeBag(r).getSlots());
2665
2687
  }
2666
2688
  });
2667
2689
  }
2668
- let xr = 1;
2690
+ let Yr = 1;
2669
2691
  function rt(t) {
2670
2692
  _(this, {
2671
2693
  $handle: t,
@@ -2675,7 +2697,7 @@ function rt(t) {
2675
2697
  vNode: new t.fc.CreateNode(t.vm),
2676
2698
  force: !1,
2677
2699
  tmpInput: null,
2678
- id: xr++
2700
+ id: Yr++
2679
2701
  }), Pt(this, {
2680
2702
  options() {
2681
2703
  return t.options;
@@ -2686,7 +2708,7 @@ function rt(t) {
2686
2708
  }), this.initCache(), this.initRender();
2687
2709
  }
2688
2710
  Zr(rt);
2689
- Yr(rt);
2711
+ Qr(rt);
2690
2712
  function ei(t) {
2691
2713
  _(t.prototype, {
2692
2714
  parseInjectEvent(e, r) {
@@ -2705,26 +2727,26 @@ function ei(t) {
2705
2727
  if (!s && Array.isArray(r) && r[0] && (h.String(r[0]) || h.Function(r[0])))
2706
2728
  return this.parseEventLst(e, r, i, !0);
2707
2729
  if (h.String(r)) {
2708
- const n = z(r);
2730
+ const n = x(r);
2709
2731
  if (n && r !== n)
2710
2732
  return n.__inject ? this.parseEvent(e, n, i, !0) : n;
2711
2733
  }
2712
2734
  },
2713
2735
  parseEmit(e, r) {
2714
2736
  let i = {}, s = e.rule, { emitPrefix: n, field: o, name: a, inject: l } = s, u = s[r ? "emit" : "nativeEmit"] || [];
2715
- return h.trueArray(u) && u.forEach((c) => {
2716
- if (!c) return;
2717
- let d, m = n || o || a;
2718
- if (h.Object(c) && (d = c.inject, c = c.name, m = c.prefix || m), m) {
2719
- r || (m = `native-${m}`);
2720
- const g = be(`${m}-${c}`), $ = (...w) => {
2721
- this.vm.$emit(g, ...w), this.vm.$emit("emit-event", g, ...w), this.bus.$emit(g, ...w);
2737
+ return h.trueArray(u) && u.forEach((f) => {
2738
+ if (!f) return;
2739
+ let d, g = n || o || a;
2740
+ if (h.Object(f) && (d = f.inject, f = f.name, g = f.prefix || g), g) {
2741
+ r || (g = `native-${g}`);
2742
+ const m = ve(`${g}-${f}`), $ = (...w) => {
2743
+ this.vm.$emit(m, ...w), this.vm.$emit("emit-event", m, ...w), this.bus.$emit(m, ...w);
2722
2744
  };
2723
2745
  if ($.__emit = !0, !d && l === !1)
2724
- i[c] = $;
2746
+ i[f] = $;
2725
2747
  else {
2726
2748
  let w = d || l || this.options.injectEvent;
2727
- i[c] = h.Undef(w) ? $ : this.inject(s, $, w);
2749
+ i[f] = h.Undef(w) ? $ : this.inject(s, $, w);
2728
2750
  }
2729
2751
  }
2730
2752
  }), e.computed[r ? "on" : "nativeOn"] = i, i;
@@ -2754,21 +2776,21 @@ function ei(t) {
2754
2776
  },
2755
2777
  loadStrVar(e, r, i) {
2756
2778
  if (e && typeof e == "string" && e.indexOf("{{") > -1 && e.indexOf("}}") > -1) {
2757
- const s = e, n = Wr(e);
2779
+ const s = e, n = Jr(e);
2758
2780
  let o;
2759
2781
  if (n.forEach((a) => {
2760
2782
  const l = a.split("||"), u = l[0].trim();
2761
2783
  if (u) {
2762
- const c = (l[1] || "").trim();
2763
- let d, m = !1;
2784
+ const f = (l[1] || "").trim();
2785
+ let d, g = !1;
2764
2786
  if (i && u.indexOf("$form.") === 0) {
2765
- const g = u.split(".");
2766
- g.shift(), D(i.value, g[0]) && (m = !0, d = r ? r({
2767
- id: "$form." + g[0] + "_" + i.rule.__fc__.id,
2768
- getValue: () => L(i.value, g)
2769
- }) : L(i.value, g));
2787
+ const m = u.split(".");
2788
+ m.shift(), D(i.value, m[0]) && (g = !0, d = r ? r({
2789
+ id: "$form." + m[0] + "_" + i.rule.__fc__.id,
2790
+ getValue: () => B(i.value, m)
2791
+ }) : B(i.value, m));
2770
2792
  }
2771
- m || (d = r ? r(u, c) : this.fc.getLoadData(u, c)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
2793
+ g || (d = r ? r(u, f) : this.fc.getLoadData(u, f)), o = d, e = e.replaceAll(`{{${a}}}`, d == null ? "" : d);
2772
2794
  }
2773
2795
  }), n.length === 1 && s === `{{${n[0]}}}`)
2774
2796
  return o;
@@ -2831,13 +2853,13 @@ function ii(t) {
2831
2853
  }
2832
2854
  function ni(t) {
2833
2855
  Object.defineProperties(t.origin, {
2834
- __fc__: Ke(ge(t), !0)
2856
+ __fc__: ze(ge(t), !0)
2835
2857
  }), t.rule !== t.origin && Object.defineProperties(t.rule, {
2836
- __fc__: Ke(ge(t), !0)
2858
+ __fc__: ze(ge(t), !0)
2837
2859
  });
2838
2860
  }
2839
2861
  function qt(t, e, r) {
2840
- const i = je(), s = !!e.field;
2862
+ const i = Ae(), s = !!e.field;
2841
2863
  _(this, {
2842
2864
  id: i,
2843
2865
  ref: i,
@@ -2855,14 +2877,14 @@ function qt(t, e, r) {
2855
2877
  parent: null,
2856
2878
  group: e.subRule ? this : null,
2857
2879
  cacheConfig: null,
2858
- prop: b({}, e),
2880
+ prop: v({}, e),
2859
2881
  computed: {},
2860
2882
  payload: {},
2861
2883
  refRule: {},
2862
2884
  input: s,
2863
2885
  el: void 0,
2864
2886
  exportEl: void 0,
2865
- defaultValue: s ? X(r) : void 0,
2887
+ defaultValue: s ? K(r) : void 0,
2866
2888
  field: e.field || void 0
2867
2889
  }), this.updateKey(), ni(this), this.update(t, !0);
2868
2890
  }
@@ -2903,8 +2925,8 @@ _(qt.prototype, {
2903
2925
  rule: this.rule,
2904
2926
  api: this.$api,
2905
2927
  update: (u) => {
2906
- const c = u || i, d = this.getPending(e, i);
2907
- this.setPending(e, r, c), o && o(c, d);
2928
+ const f = u || i, d = this.getPending(e, i);
2929
+ this.setPending(e, r, f), o && o(f, d);
2908
2930
  },
2909
2931
  reload: () => {
2910
2932
  const u = this.getPending(e, i);
@@ -2912,8 +2934,8 @@ _(qt.prototype, {
2912
2934
  }
2913
2935
  }));
2914
2936
  l && h.Function(l.then) ? (l.then((u) => {
2915
- const c = u || i;
2916
- this.setPending(e, r, c), s && s(c), this.$api && this.$api.sync(this.rule);
2937
+ const f = u || i;
2938
+ this.setPending(e, r, f), s && s(f), this.$api && this.$api.sync(this.rule);
2917
2939
  }).catch((u) => {
2918
2940
  console.error(u);
2919
2941
  }), a = i, this.setPending(e, r, a)) : (a = l || i, this.setPending(e, r, a), s && s(a));
@@ -2936,7 +2958,7 @@ _(qt.prototype, {
2936
2958
  t === void 0 ? this.payload = {} : delete this.payload[t];
2937
2959
  },
2938
2960
  updateKey(t) {
2939
- this.key = je(), t && this.parent && this.parent.updateKey(t);
2961
+ this.key = Ae(), t && this.parent && this.parent.updateKey(t);
2940
2962
  },
2941
2963
  updateType() {
2942
2964
  this.originType = this.rule.type, this.type = J(this.rule.type), this.trueType = this.$handle.getType(this.originType);
@@ -2946,7 +2968,7 @@ _(qt.prototype, {
2946
2968
  },
2947
2969
  initProp() {
2948
2970
  var e, r;
2949
- const t = b({}, this.rule);
2971
+ const t = v({}, this.rule);
2950
2972
  delete t.children, delete t.validate, this.prop = te({}, [t, ...Object.keys(this.payload).map((i) => this.payload[i]), this.computed]), this.prop.validate = [...((r = (e = this.refRule) == null ? void 0 : e.__$validate) == null ? void 0 : r.value) || [], ...this.prop.validate || []];
2951
2973
  },
2952
2974
  initNone() {
@@ -3017,17 +3039,17 @@ function si(t) {
3017
3039
  _(t.prototype, {
3018
3040
  nextRefresh(e) {
3019
3041
  const r = this.loadedId;
3020
- T(() => {
3042
+ I(() => {
3021
3043
  r === this.loadedId && (e ? e() : this.refresh());
3022
3044
  });
3023
3045
  },
3024
3046
  parseRule(e) {
3025
- const r = ft(e);
3047
+ const r = ct(e);
3026
3048
  return Object.defineProperties(r, {
3027
- __origin__: Ke(e, !0)
3049
+ __origin__: ze(e, !0)
3028
3050
  }), oi(r), this.appendValue(r), [r, r.prefix, r.suffix].forEach((i) => {
3029
3051
  i && this.loadFn(i, r);
3030
- }), this.loadCtrl(r), r.update && (r.update = z(r.update)), r;
3052
+ }), this.loadCtrl(r), r.update && (r.update = x(r.update)), r;
3031
3053
  },
3032
3054
  loadFn(e, r) {
3033
3055
  ["on", "props", "nativeOn", "deep"].forEach((i) => {
@@ -3036,7 +3058,7 @@ function si(t) {
3036
3058
  },
3037
3059
  loadCtrl(e) {
3038
3060
  e.control && e.control.forEach((r) => {
3039
- r.handle && (r.handle = z(r.handle));
3061
+ r.handle && (r.handle = x(r.handle));
3040
3062
  });
3041
3063
  },
3042
3064
  syncProp(e) {
@@ -3072,37 +3094,37 @@ function si(t) {
3072
3094
  if (r && !h.Object(o) || !this.pageEnd && !r && a >= this.first) return;
3073
3095
  if (o.__fc__ && o.__fc__.root === e && this.ctxs[o.__fc__.id])
3074
3096
  return s(o.__fc__.loadChildrenPending(), o.__fc__), o.__fc__;
3075
- let l = ft(o);
3097
+ let l = ct(o);
3076
3098
  const u = () => !!(l.field && this.fieldCtx[l.field] && this.fieldCtx[l.field][0] !== o.__fc__);
3077
3099
  this.fc.targetFormDriver("loadRule", { rule: l, api: this.api }, this.fc), this.ruleEffect(l, "init", { repeat: u() }), u() && this.vm.$emit("repeat-field", o, this.api);
3078
- let c, d = !1, m = !!o.__fc__, g = l.value;
3079
- if (m) {
3080
- if (c = o.__fc__, g = c.defaultValue, c.deleted) {
3081
- if ($t(c))
3100
+ let f, d = !1, g = !!o.__fc__, m = l.value;
3101
+ if (g) {
3102
+ if (f = o.__fc__, m = f.defaultValue, f.deleted) {
3103
+ if ($t(f))
3082
3104
  return;
3083
- c.update(this);
3084
- } else if (!c.check(this)) {
3085
- if ($t(c))
3105
+ f.update(this);
3106
+ } else if (!f.check(this)) {
3107
+ if ($t(f))
3086
3108
  return;
3087
- e[a] = o = o._clone ? o._clone() : At(et(o)), c = null, d = !0;
3109
+ e[a] = o = o._clone ? o._clone() : At(_e(o)), f = null, d = !0;
3088
3110
  }
3089
3111
  }
3090
- if (c)
3091
- c.originType !== c.rule.type && c.updateType(), this.bindParser(c), this.appendValue(c.rule), c.parent && c.parent !== r && this.rmSubRuleData(c);
3112
+ if (f)
3113
+ f.originType !== f.rule.type && f.updateType(), this.bindParser(f), this.appendValue(f.rule), f.parent && f.parent !== r && this.rmSubRuleData(f);
3092
3114
  else {
3093
3115
  const O = this.parseRule(o);
3094
- c = new qt(this, O, g), this.bindParser(c);
3116
+ f = new qt(this, O, m), this.bindParser(f);
3095
3117
  }
3096
- [!1, !0].forEach((O) => this.parseEmit(c, O)), this.syncProp(c), c.parent = r || null, c.root = e, this.setCtx(c), !d && !m && (this.effect(c, "load"), this.targetHook(c, "load")), this.effect(c, "created");
3097
- const $ = c.loadChildrenPending();
3098
- if (c.parser.loadChildren === !1 || s($, c), !r) {
3118
+ [!1, !0].forEach((O) => this.parseEmit(f, O)), this.syncProp(f), f.parent = r || null, f.root = e, this.setCtx(f), !d && !g && (this.effect(f, "load"), this.targetHook(f, "load")), this.effect(f, "created");
3119
+ const $ = f.loadChildrenPending();
3120
+ if (f.parser.loadChildren === !1 || s($, f), !r) {
3099
3121
  const O = i(a);
3100
- O > -1 || !a ? this.sort.splice(O + 1, 0, c.id) : this.sort.push(c.id);
3122
+ O > -1 || !a ? this.sort.splice(O + 1, 0, f.id) : this.sort.push(f.id);
3101
3123
  }
3102
- const w = c.rule;
3103
- return c.updated || (c.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
3104
- this.refreshUpdate(c, w.value, "init");
3105
- }), this.effect(c, "loaded")), this.refreshControl(c) && (this.cycleLoad = !0), c;
3124
+ const w = f.rule;
3125
+ return f.updated || (f.updated = !0, h.Function(w.update) && this.bus.$once("load-end", () => {
3126
+ this.refreshUpdate(f, w.value, "init");
3127
+ }), this.effect(f, "loaded")), this.refreshControl(f) && (this.cycleLoad = !0), f;
3106
3128
  }).filter((o) => !!o);
3107
3129
  r && (r.children = n);
3108
3130
  },
@@ -3114,27 +3136,27 @@ function si(t) {
3114
3136
  if (!r.length) return !1;
3115
3137
  for (let a = 0; a < r.length; a++) {
3116
3138
  const l = r[a], u = l.handle || function(d) {
3117
- return (ce[l.condition || "=="] || ce["=="])(d, l.value);
3139
+ return (fe[l.condition || "=="] || fe["=="])(d, l.value);
3118
3140
  };
3119
3141
  if (!h.trueArray(l.rule)) continue;
3120
- const c = q(b({}, l), {
3142
+ const f = q(v({}, l), {
3121
3143
  valid: F(() => u(e.rule.value, s)),
3122
3144
  ctrl: li(e, l.rule),
3123
3145
  isHidden: h.String(l.rule[0])
3124
3146
  });
3125
- c.valid && c.ctrl || !c.valid && !c.ctrl && !c.isHidden || i.push(c);
3147
+ f.valid && f.ctrl || !f.valid && !f.ctrl && !f.isHidden || i.push(f);
3126
3148
  }
3127
3149
  if (!i.length) return !1;
3128
3150
  const n = [];
3129
3151
  let o = !1;
3130
3152
  return this.deferSyncValue(() => {
3131
- i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: c, append: d, child: m, ctrl: g, method: $ }) => {
3153
+ i.reverse().forEach(({ isHidden: a, valid: l, rule: u, prepend: f, append: d, child: g, ctrl: m, method: $ }) => {
3132
3154
  if (a) {
3133
3155
  l ? e.ctrlRule.push({
3134
3156
  __ctrl: !0,
3135
3157
  children: u,
3136
3158
  valid: l
3137
- }) : g && e.ctrlRule.splice(e.ctrlRule.indexOf(g) >>> 0, 1), n[l ? "push" : "unshift"](() => {
3159
+ }) : m && e.ctrlRule.splice(e.ctrlRule.indexOf(m) >>> 0, 1), n[l ? "push" : "unshift"](() => {
3138
3160
  $ === "disabled" || $ === "enabled" ? this.api.disabled(!l, u) : $ === "display" || $ === "show" ? this.api.display(l, u) : $ === "required" ? (u.forEach((w) => {
3139
3161
  this.api.setEffect(w, "required", l);
3140
3162
  }), l || this.api.clearValidateState(u)) : $ === "if" ? this.api.hidden(!l, u) : this.api.hidden(!l, u);
@@ -3150,17 +3172,17 @@ function si(t) {
3150
3172
  children: u
3151
3173
  };
3152
3174
  e.ctrlRule.push(w), this.bus.$once("load-start", () => {
3153
- c ? s.prepend(w, c, m) : d || m ? s.append(w, d || e.id, m) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
3175
+ f ? s.prepend(w, f, g) : d || g ? s.append(w, d || e.id, g) : e.root.splice(e.root.indexOf(e.origin) + 1, 0, w);
3154
3176
  });
3155
3177
  } else {
3156
- e.ctrlRule.splice(e.ctrlRule.indexOf(g), 1);
3157
- const w = x(g);
3178
+ e.ctrlRule.splice(e.ctrlRule.indexOf(m), 1);
3179
+ const w = Y(m);
3158
3180
  w && w.rm();
3159
3181
  }
3160
3182
  });
3161
3183
  }), n.length && (this.loading ? n.length && this.bus.$once("load-end", () => {
3162
3184
  n.forEach((a) => a());
3163
- }) : n.length && T(() => {
3185
+ }) : n.length && I(() => {
3164
3186
  n.forEach((a) => a());
3165
3187
  })), this.vm.$emit("control", e.origin, this.api), this.effect(e, "control"), o;
3166
3188
  },
@@ -3169,7 +3191,7 @@ function si(t) {
3169
3191
  },
3170
3192
  _reloadRule(e) {
3171
3193
  e || (e = this.rules);
3172
- const r = b({}, this.ctxs);
3194
+ const r = v({}, this.ctxs);
3173
3195
  this.clearNextTick(), this.initData(e), this.fc.rules = e, this.deferSyncValue(() => {
3174
3196
  this.bus.$once("load-end", () => {
3175
3197
  Object.keys(r).filter((i) => this.ctxs[i] === void 0).forEach((i) => this.rmCtx(r[i])), this.$render.clearCacheAll();
@@ -3209,9 +3231,9 @@ function ui(t) {
3209
3231
  rule: e.origin,
3210
3232
  api: this.api,
3211
3233
  setFlag: s || !1
3212
- }), s && T(() => {
3213
- T(() => {
3214
- T(() => {
3234
+ }), s && I(() => {
3235
+ I(() => {
3236
+ I(() => {
3215
3237
  this.api.clearValidateState(e.id);
3216
3238
  });
3217
3239
  });
@@ -3246,9 +3268,9 @@ function ui(t) {
3246
3268
  },
3247
3269
  syncForm() {
3248
3270
  const e = {}, r = this.fields(), i = [];
3249
- this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = De(this.appendData, n)), s), e), r.reduce((s, n) => {
3271
+ this.options.appendValue !== !1 && Object.keys(this.appendData).reduce((s, n) => (r.indexOf(n) === -1 && (s[n] = je(this.appendData, n)), s), e), r.reduce((s, n) => {
3250
3272
  const o = (this.fieldCtx[n] || []).filter((a) => !this.isIgnore(a.rule))[0] || this.fieldCtx[n][0];
3251
- return this.isIgnore(o.rule) && i.push(n), s[n] = De(o.rule, "value"), s;
3273
+ return this.isIgnore(o.rule) && i.push(n), s[n] = je(o.rule, "value"), s;
3252
3274
  }, e), this.form = ne(e), this.ignoreFields = i, this.syncValue();
3253
3275
  },
3254
3276
  isIgnore(e) {
@@ -3272,10 +3294,10 @@ function ui(t) {
3272
3294
  }), this.vm.updateValue(e);
3273
3295
  },
3274
3296
  isChange(e, r) {
3275
- return JSON.stringify(this.getFormData(e), vt) !== JSON.stringify(r, vt);
3297
+ return JSON.stringify(this.getFormData(e), bt) !== JSON.stringify(r, bt);
3276
3298
  },
3277
3299
  isQuote(e, r) {
3278
- return (h.Object(r) || Array.isArray(r)) && r === e.rule.value;
3300
+ return (r instanceof Function || h.Object(r) || Array.isArray(r)) && r === e.rule.value;
3279
3301
  },
3280
3302
  refreshUpdate(e, r, i, s) {
3281
3303
  if (h.Function(e.rule.update)) {
@@ -3305,10 +3327,10 @@ function ui(t) {
3305
3327
  }
3306
3328
  });
3307
3329
  }
3308
- function vt(t, e) {
3330
+ function bt(t, e) {
3309
3331
  return typeof e == "function" ? "" + e : e;
3310
3332
  }
3311
- const ke = {
3333
+ const De = {
3312
3334
  init(t) {
3313
3335
  },
3314
3336
  toFormValue(t, e) {
@@ -3327,8 +3349,8 @@ const ke = {
3327
3349
  },
3328
3350
  mergeProp(t) {
3329
3351
  }
3330
- }, ci = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
3331
- function fi(t) {
3352
+ }, fi = ["field", "value", "vm", "template", "name", "config", "control", "inject", "sync", "payload", "optionsTo", "update", "slotUpdate", "computed", "component", "cache"];
3353
+ function ci(t) {
3332
3354
  _(t.prototype, {
3333
3355
  getCtx(e) {
3334
3356
  return this.getFieldCtx(e) || this.getNameCtx(e)[0] || this.ctxs[e];
@@ -3363,7 +3385,7 @@ function fi(t) {
3363
3385
  if (n)
3364
3386
  return n;
3365
3387
  }
3366
- return r[e.originType] || r[J(e.type)] || r[e.trueType] || ke;
3388
+ return r[e.originType] || r[J(e.type)] || r[e.trueType] || De;
3367
3389
  },
3368
3390
  bindParser(e) {
3369
3391
  e.setParser(this.getParser(e));
@@ -3376,18 +3398,18 @@ function fi(t) {
3376
3398
  this.noWatchFn || (this.noWatchFn = e), F(e), this.noWatchFn === e && (this.noWatchFn = null);
3377
3399
  },
3378
3400
  watchCtx(e) {
3379
- if (kt().filter((i) => i[0] !== "_" && i[0] !== "$" && ci.indexOf(i) === -1).forEach((i) => {
3380
- const s = De(e.rule, i), n = i === "children";
3381
- e.refRule[i] = s, e.watch.push(B(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
3401
+ if (Rt().filter((i) => i[0] !== "_" && i[0] !== "$" && fi.indexOf(i) === -1).forEach((i) => {
3402
+ const s = je(e.rule, i), n = i === "children";
3403
+ e.refRule[i] = s, e.watch.push(L(n ? () => h.Function(s.value) ? s.value : [...s.value || []] : () => s.value, (o, a) => {
3382
3404
  let l = s.value;
3383
3405
  if (!this.isBreakWatch()) {
3384
3406
  if (n && e.parser.loadChildren === !1) {
3385
3407
  this.$render.clearCache(e), this.nextRefresh();
3386
3408
  return;
3387
3409
  }
3388
- if (this.watching = !0, T(() => {
3410
+ if (this.watching = !0, I(() => {
3389
3411
  this.targetHook(e, "watch", { key: i, oldValue: a, newValue: l });
3390
- }), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), T(() => {
3412
+ }), i === "hidden" && !!l != !!a && (this.$render.clearCacheAll(), I(() => {
3391
3413
  this.targetHook(e, "hidden", { value: l });
3392
3414
  })), i === "ignore" && e.input || i === "hidden" && e.input && (e.rule.ignore === "hidden" || this.options.ignoreHiddenFields))
3393
3415
  this.syncForm();
@@ -3412,29 +3434,40 @@ function fi(t) {
3412
3434
  s && (i = this.api.t(s[1]));
3413
3435
  }
3414
3436
  return i;
3415
- }), e.refRule.__$validate = ye(() => H(e.rule.validate).map((i) => {
3416
- var n, o;
3417
- const s = b({}, i);
3418
- if (s.message) {
3419
- const a = s.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
3420
- a && (s.message = this.api.t(a[1], { title: (o = (n = e.refRule) == null ? void 0 : n.__$title) == null ? void 0 : o.value }));
3421
- }
3422
- if (h.Function(s.validator)) {
3423
- const a = e;
3424
- return s.validator = function(...l) {
3425
- return i.validator.call({
3426
- that: this,
3427
- id: a.id,
3428
- field: a.field,
3429
- rule: a.rule,
3430
- api: a.$handle.api
3431
- }, ...l);
3432
- }, s;
3433
- }
3434
- return s;
3435
- })), e.input) {
3436
- const i = De(e.rule, "value");
3437
- e.watch.push(B(() => i.value, () => {
3437
+ }), e.refRule.__$validate = ye(() => {
3438
+ const i = (s) => {
3439
+ var o, a;
3440
+ const n = s.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
3441
+ return n ? this.api.t(n[1], { title: (a = (o = e.refRule) == null ? void 0 : o.__$title) == null ? void 0 : a.value }) : s;
3442
+ };
3443
+ return H(e.rule.validate).map((s) => {
3444
+ const n = v({}, s);
3445
+ if (n.message && (n.message = i(n.message)), h.Function(n.validator)) {
3446
+ const o = e;
3447
+ n.validator = function(...a) {
3448
+ return s.validator.call({
3449
+ that: this,
3450
+ id: o.id,
3451
+ field: o.field,
3452
+ rule: o.rule,
3453
+ api: o.$handle.api
3454
+ }, ...a);
3455
+ };
3456
+ }
3457
+ if (n.adapter) {
3458
+ if (typeof n.error == "object") {
3459
+ const o = v({}, n.error);
3460
+ Object.keys(o).forEach((a) => {
3461
+ o[a] = i(o[a]);
3462
+ }), n.error = o;
3463
+ }
3464
+ return this.adapterValidate(n, e);
3465
+ }
3466
+ return n;
3467
+ });
3468
+ }), e.input) {
3469
+ const i = je(e.rule, "value");
3470
+ e.watch.push(L(() => i.value, () => {
3438
3471
  let s = e.parser.toFormValue(i.value, e);
3439
3472
  this.isChange(e, s) && this.setValue(e, i.value, s, !0);
3440
3473
  }));
@@ -3451,7 +3484,7 @@ function fi(t) {
3451
3484
  }), a = (l) => {
3452
3485
  s === "value" ? this.onInput(e, l) : s[0] === "$" ? this.api.setEffect(e.id, s, l) : oe(e.rule, s, l);
3453
3486
  };
3454
- (s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== L(e.rule, s)) && a(o.value), e.watch.push(B(o, (l) => {
3487
+ (s === "value" ? [void 0, null, ""].indexOf(e.rule.value) > -1 : o.value !== B(e.rule, s)) && a(o.value), e.watch.push(L(o, (l) => {
3455
3488
  n = l, setTimeout(() => {
3456
3489
  a(l);
3457
3490
  });
@@ -3459,6 +3492,115 @@ function fi(t) {
3459
3492
  }));
3460
3493
  }), this.watchEffect(e);
3461
3494
  },
3495
+ adapterValidate(e, r) {
3496
+ const i = (s, n) => {
3497
+ if ((e.beforeValidate && F(() => e.beforeValidate({
3498
+ value: s,
3499
+ api: this.api,
3500
+ validate: e,
3501
+ rule: r.rule
3502
+ }))) === !1)
3503
+ n();
3504
+ else {
3505
+ const a = this.validator(s, e);
3506
+ if (a) {
3507
+ let l = "";
3508
+ typeof e.error == "object" && (l = e.error[a] || e.error.default), !l && typeof e.message == "string" && (l = e.message), l || (l = this.getValidateMessage(r, { key: a, rule: e[a] })), n(l);
3509
+ } else if (e.validator) {
3510
+ const l = e.validator && F(() => e.validator(s, n));
3511
+ l && h.Function(l.then) && l.then(() => n()).catch((u) => n(u));
3512
+ } else
3513
+ n();
3514
+ }
3515
+ };
3516
+ return this.$manager.adapterValidate({
3517
+ required: e.required,
3518
+ message: e.message,
3519
+ target: e.trigger
3520
+ }, i);
3521
+ },
3522
+ getValidateMessage(e, r) {
3523
+ var s, n;
3524
+ const i = Array.isArray(r.rule) ? r.rule.join(",") : "" + r.rule;
3525
+ return this.api.t(r.key === "required" ? r.key : "validate." + r.key, {
3526
+ [r.key]: i,
3527
+ title: (n = (s = e.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value
3528
+ });
3529
+ },
3530
+ validator(e, r) {
3531
+ if (h.empty(e))
3532
+ return r.required ? "required" : void 0;
3533
+ for (const [s, n] of Object.entries(r))
3534
+ switch (s) {
3535
+ case "len":
3536
+ case "maxLen":
3537
+ case "minLen":
3538
+ const o = (m) => s === "len" ? m === n : s === "maxLen" ? m <= n : m >= n;
3539
+ if (Array.isArray(e)) {
3540
+ if (!o(e.length))
3541
+ return s;
3542
+ } else {
3543
+ if (typeof e == "object")
3544
+ return s;
3545
+ if (!o(("" + e).length))
3546
+ return s;
3547
+ }
3548
+ break;
3549
+ case "pattern":
3550
+ if (!(typeof n == "string" ? new RegExp(n) : n).test("" + e))
3551
+ return s;
3552
+ break;
3553
+ case "uppercase":
3554
+ if (n && (typeof e != "string" || !/^[A-Z]*$/.test(e)))
3555
+ return s;
3556
+ break;
3557
+ case "lowercase":
3558
+ if (n && (typeof e != "string" || !/^[a-z]*$/.test(e)))
3559
+ return s;
3560
+ break;
3561
+ case "min":
3562
+ case "max":
3563
+ case "positive":
3564
+ case "negative":
3565
+ case "integer":
3566
+ case "number":
3567
+ const l = Number(e);
3568
+ if (Number.isNaN(l) || s === "min" && l < n || s === "max" && l > n || s === "positive" && l <= 0 || s === "negative" && l >= 0 || s === "integer" && !Number.isInteger(l))
3569
+ return s;
3570
+ break;
3571
+ case "equal":
3572
+ if (e !== n)
3573
+ return s;
3574
+ break;
3575
+ case "enum":
3576
+ if (Array.isArray(n) && !n.includes(e))
3577
+ return s;
3578
+ break;
3579
+ case "hasKeys":
3580
+ if (typeof e != "object" || Array.isArray(n) && n.some((m) => !(m in e)))
3581
+ return s;
3582
+ break;
3583
+ case "email":
3584
+ if (!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test("" + e))
3585
+ return s;
3586
+ break;
3587
+ case "url":
3588
+ if (!new RegExp(
3589
+ "^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
3590
+ "i"
3591
+ ).test("" + e))
3592
+ return s;
3593
+ break;
3594
+ case "ip":
3595
+ if (!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test("" + e))
3596
+ return s;
3597
+ break;
3598
+ case "phone":
3599
+ if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test("" + e))
3600
+ return s;
3601
+ break;
3602
+ }
3603
+ },
3462
3604
  compute(e, r) {
3463
3605
  let i;
3464
3606
  if (typeof r == "object") {
@@ -3467,19 +3609,19 @@ function fi(t) {
3467
3609
  return !0;
3468
3610
  const l = a.mode === "OR";
3469
3611
  let u = !0;
3470
- for (let c = 0; c < a.group.length; c++) {
3471
- const d = a.group[c];
3472
- let m, g = null;
3612
+ for (let f = 0; f < a.group.length; f++) {
3613
+ const d = a.group[f];
3614
+ let g, m = null;
3473
3615
  if (d.variable)
3474
- g = JSON.stringify(this.fc.getLoadData(d.variable) || "");
3616
+ m = JSON.stringify(this.fc.getLoadData(d.variable) || "");
3475
3617
  else if (d.field)
3476
- g = dt(d.field || "");
3477
- else
3618
+ m = dt(d.field || "");
3619
+ else if (!d.mode)
3478
3620
  return !0;
3479
3621
  let $ = d.compare;
3480
- if ($ && ($ = dt($ || "")), d.mode ? m = n(d) : ce[d.condition] ? h.Function(d.handler) ? m = F(() => d.handler(this.api, e.rule)) : m = F(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${g}, ${$ || "$val"}); }}}}`).call(this.api.form, ce, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : m = !1, l && m)
3622
+ if ($ && ($ = dt($ || "")), d.mode ? g = n(d) : fe[d.condition] ? h.Function(d.handler) ? g = F(() => d.handler(this.api, e.rule)) : g = F(() => new Function("$condition", "$val", "$form", "$scope", "$group", "$rule", `with($form){with($scope){with(this){with($group){ return $condition['${d.condition}'](${m}, ${$ || "$val"}); }}}}`).call(this.api.form, fe, d.value, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, s ? this.subRuleData[s.id] || {} : {}, e.rule)) : g = !1, l && g)
3481
3623
  return !0;
3482
- l || (u = u && m);
3624
+ l || (u = u && g);
3483
3625
  }
3484
3626
  return l ? !1 : u;
3485
3627
  };
@@ -3502,7 +3644,7 @@ function fi(t) {
3502
3644
  fc: s.fc
3503
3645
  }, ...l);
3504
3646
  }, o), {});
3505
- return new Function("$formulas", "$form", "$scope", "$group", "$rule", "$api", `with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form, n, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api);
3647
+ return F(() => new Function("$formulas", "$form", "$scope", "$group", "$rule", "$api", `with($form){with($scope){with(this){with($group){with($formulas){ return ${e} }}}}}`).call(this.api.form, n, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, i ? this.subRuleData[i.id] || {} : {}, r.rule, this.api));
3506
3648
  },
3507
3649
  updateChildren(e, r, i) {
3508
3650
  this.deferSyncValue(() => {
@@ -3549,7 +3691,7 @@ function hi(t) {
3549
3691
  emitEvent(e, ...r) {
3550
3692
  const i = this.options[e] || this.options[J("on-" + e)];
3551
3693
  if (i) {
3552
- const s = z(i);
3694
+ const s = x(i);
3553
3695
  h.Function(s) && F(() => s(...r));
3554
3696
  }
3555
3697
  this.bus.$emit(e, ...r);
@@ -3558,7 +3700,7 @@ function hi(t) {
3558
3700
  var n, o;
3559
3701
  let s = (o = (n = e.prop) == null ? void 0 : n.hook) == null ? void 0 : o[r];
3560
3702
  s && (s = Array.isArray(s) ? s : [s], s.forEach((a) => {
3561
- F(() => a(q(b({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
3703
+ F(() => a(q(v({}, i || {}), { self: e.rule, rule: e.rule, $f: this.api, api: this.api, option: this.vm.$props.option })));
3562
3704
  }));
3563
3705
  }
3564
3706
  });
@@ -3593,7 +3735,7 @@ function di(t) {
3593
3735
  }), Object.keys(e.rule).forEach((i) => {
3594
3736
  i[0] === "$" && (r[i.substr(1)] = () => e.rule[i]);
3595
3737
  }), Object.keys(r).forEach((i) => {
3596
- e.watch.push(B(r[i], (s) => {
3738
+ e.watch.push(L(r[i], (s) => {
3597
3739
  this.effect(e, "watch", { [i]: s });
3598
3740
  }, { deep: !0 }));
3599
3741
  });
@@ -3622,19 +3764,19 @@ function di(t) {
3622
3764
  },
3623
3765
  emitEffect({ ctx: e, rule: r, input: i, type: s, custom: n }, o, a) {
3624
3766
  if (!s || ["fcFragment", "fragment"].indexOf(s) > -1) return;
3625
- const l = n || Object.keys(r).reduce((u, c) => (c[0] === "$" && (u[c.substr(1)] = r[c]), u), b({}, r.effect || {}));
3767
+ const l = n || Object.keys(r).reduce((u, f) => (f[0] === "$" && (u[f.substr(1)] = r[f]), u), v({}, r.effect || {}));
3626
3768
  Object.keys(l).forEach((u) => {
3627
- const c = this.providers[u];
3628
- if (!c || c.input && !i) return;
3769
+ const f = this.providers[u];
3770
+ if (!f || f.input && !i) return;
3629
3771
  let d;
3630
- if (!c._c)
3772
+ if (!f._c)
3631
3773
  d = "*";
3632
- else if (c._used.indexOf(s) > -1)
3774
+ else if (f._used.indexOf(s) > -1)
3633
3775
  d = s;
3634
3776
  else
3635
3777
  return;
3636
- const m = b({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
3637
- e && (m.getProp = () => e.effectData(u), m.clearProp = () => e.clearEffectData(u), m.mergeProp = (g) => te(m.getProp(), [g]), m.id = e.id), this.bus.$emit(`p:${u}:${d}:${c.input ? 1 : 0}`, o, [m, r, this.api]);
3778
+ const g = v({ value: l[u], getValue: () => this.getEffect(r, u) }, a || {});
3779
+ e && (g.getProp = () => e.effectData(u), g.clearProp = () => e.clearEffectData(u), g.mergeProp = (m) => te(g.getProp(), [m]), g.id = e.id), this.bus.$emit(`p:${u}:${d}:${f.input ? 1 : 0}`, o, [g, r, this.api]);
3638
3780
  });
3639
3781
  }
3640
3782
  });
@@ -3651,7 +3793,7 @@ function mi(t) {
3651
3793
  return r.length ? r : !1;
3652
3794
  } else return h.String(e) ? [e] : !1;
3653
3795
  }
3654
- function Q(t) {
3796
+ function X(t) {
3655
3797
  Pt(this, {
3656
3798
  options() {
3657
3799
  return t.options.value || {};
@@ -3660,7 +3802,7 @@ function Q(t) {
3660
3802
  return t.bus;
3661
3803
  },
3662
3804
  preview() {
3663
- return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.options.value.preview || !1;
3805
+ return t.vm.$options.propsData.preview != null ? t.vm.$options.propsData.preview : t.vm.parent && t.vm.parent.$props.preview != null ? t.vm.parent.$props.preview : t.options.value.preview || !1;
3664
3806
  }
3665
3807
  }), _(this, {
3666
3808
  fc: t,
@@ -3689,9 +3831,9 @@ function Q(t) {
3689
3831
  }), this.initData(t.rules), this.$manager = new t.manager(this), this.$render = new rt(this), this.api = t.extendApiFn.reduce((e, r) => {
3690
3832
  const i = F(() => r(e, this));
3691
3833
  return i && i !== e && _(e, i), e;
3692
- }, Qr(this));
3834
+ }, Xr(this));
3693
3835
  }
3694
- _(Q.prototype, {
3836
+ _(X.prototype, {
3695
3837
  initData(t) {
3696
3838
  _(this, {
3697
3839
  ctxs: {},
@@ -3705,7 +3847,7 @@ _(Q.prototype, {
3705
3847
  this.updateAppendData(), this.useProvider(), this.usePage(), this.loadRule(), this.$manager.__init(), this.lifecycle("created");
3706
3848
  },
3707
3849
  updateAppendData() {
3708
- this.appendData = b(b(b({}, this.options.formData || {}), this.fc.vm.$options.propsData.value || {}), this.appendData);
3850
+ this.appendData = v(v(v({}, this.options.formData || {}), this.fc.vm.$options.propsData.value || {}), this.appendData);
3709
3851
  },
3710
3852
  isBreakWatch() {
3711
3853
  return this.loading || this.noWatchFn || this.reloading;
@@ -3721,17 +3863,23 @@ _(Q.prototype, {
3721
3863
  const i = t && t.beforeFetch && F(() => t.beforeFetch(t, { api: this.api }));
3722
3864
  i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
3723
3865
  }).then(() => this.globalBeforeFetch(t));
3866
+ },
3867
+ beforeSubmit(t) {
3868
+ return new Promise((e, r) => {
3869
+ const i = this.options.beforeSubmit && F(() => this.options.beforeSubmit(t, { api: this.api }));
3870
+ i && h.Function(i.then) ? i.then(e).catch(r) : i === !1 ? r() : e();
3871
+ });
3724
3872
  }
3725
3873
  });
3726
- ei(Q);
3727
- ti(Q);
3728
- ii(Q);
3729
- si(Q);
3730
- ui(Q);
3731
- fi(Q);
3732
- hi(Q);
3733
- di(Q);
3734
- const gi = "fcFragment", Be = {
3874
+ ei(X);
3875
+ ti(X);
3876
+ ii(X);
3877
+ si(X);
3878
+ ui(X);
3879
+ ci(X);
3880
+ hi(X);
3881
+ di(X);
3882
+ const gi = "fcFragment", Le = {
3735
3883
  name: gi,
3736
3884
  functional: !0,
3737
3885
  props: ["vnode"],
@@ -3774,7 +3922,7 @@ function $i() {
3774
3922
  },
3775
3923
  use(r) {
3776
3924
  Object.keys(r).forEach((i) => {
3777
- const s = be(i), n = jt(i).toLocaleLowerCase(), o = r[i];
3925
+ const s = ve(i), n = jt(i).toLocaleLowerCase(), o = r[i];
3778
3926
  [i, s, n].forEach((a) => {
3779
3927
  e.alias(i, o), e.prototype[a] = function(l, u) {
3780
3928
  return this.make(o, l, u);
@@ -3784,7 +3932,7 @@ function $i() {
3784
3932
  }
3785
3933
  }), e;
3786
3934
  }
3787
- function vi(t) {
3935
+ function bi(t) {
3788
3936
  class e extends Ut {
3789
3937
  }
3790
3938
  return Object.assign(e.prototype, t), e;
@@ -3805,7 +3953,7 @@ _(Ut.prototype, {
3805
3953
  this.$render = this.$handle.$render, this.$r = (...t) => this.$render.renderRule(...t);
3806
3954
  },
3807
3955
  updateKey() {
3808
- this.key = je();
3956
+ this.key = Ae();
3809
3957
  },
3810
3958
  //TODO interface
3811
3959
  init() {
@@ -3817,6 +3965,9 @@ _(Ut.prototype, {
3817
3965
  form() {
3818
3966
  return this.vm.$refs[this.ref];
3819
3967
  },
3968
+ adapterValidate(t, e) {
3969
+ return t.validator = (r, i, s) => e(i, s), t;
3970
+ },
3820
3971
  getSlot(t) {
3821
3972
  const e = (r) => {
3822
3973
  if (r) {
@@ -3845,26 +3996,27 @@ _(Ut.prototype, {
3845
3996
  render(t) {
3846
3997
  }
3847
3998
  });
3848
- const bi = function(t) {
3999
+ const vi = function(t) {
3849
4000
  const e = {
3850
4001
  name: "loadData",
3851
4002
  _fn: [],
3852
- mounted(r, i, s) {
3853
- this.deleted(r);
3854
- let n = H(r.getValue());
3855
- const o = [];
3856
- n.forEach((a) => {
3857
- if (a && (a.attr || a.template)) {
3858
- let l = (d) => {
3859
- let m;
3860
- a.template ? m = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? m = a.handler(d, i, s) : m = d(a.attr, a.default), a.copy !== !1 && (m = X(m));
3861
- const g = a.modify ? i : r.getProp();
3862
- a.to === "child" ? g.children ? E(g.children, 0, m) : E(g, "children", [m]) : oe(g, a.to || "options", m), s.sync(i);
3863
- }, u = (d) => l(d);
3864
- const c = t.watchLoadData(u);
3865
- l = se(l, a.wait || 300), a.watch !== !1 ? o.push(c) : c();
3866
- }
3867
- }), this._fn[r.id] = o;
4003
+ loaded(r, i, s) {
4004
+ this.deleted(r), I(() => {
4005
+ let n = H(r.getValue());
4006
+ const o = [];
4007
+ n.forEach((a) => {
4008
+ if (a && (a.attr || a.template)) {
4009
+ let l = (d) => {
4010
+ let g;
4011
+ a.template ? g = t.$handle.loadStrVar(a.template, d) : a.handler && h.Function(a.handler) ? g = a.handler(d, i, s) : g = d(a.attr, a.default), a.copy !== !1 && (g = K(g));
4012
+ const m = a.modify ? i : r.getProp();
4013
+ a.to === "child" ? m.children ? E(m.children, 0, g) : E(m, "children", [g]) : oe(m, a.to || "options", g), s.sync(i);
4014
+ }, u = (d) => l(d);
4015
+ const f = t.watchLoadData(u);
4016
+ l = se(l, a.wait || 300), a.watch !== !1 ? o.push(f) : f();
4017
+ }
4018
+ }), this._fn[r.id] = o;
4019
+ });
3868
4020
  },
3869
4021
  deleted(r) {
3870
4022
  this._fn[r.id] && (this._fn[r.id].forEach((i) => {
@@ -3872,7 +4024,7 @@ const bi = function(t) {
3872
4024
  }), delete this._fn[r.id]), r.clearProp();
3873
4025
  }
3874
4026
  };
3875
- return e.watch = e.mounted, e;
4027
+ return e.watch = e.loaded, e;
3876
4028
  }, _i = function(t) {
3877
4029
  const e = {
3878
4030
  name: "t",
@@ -3885,13 +4037,13 @@ const bi = function(t) {
3885
4037
  const l = n[a];
3886
4038
  if (l) {
3887
4039
  const u = typeof l == "object";
3888
- let c = (g) => {
3889
- let $ = t.t(u ? l.attr : l, u ? l.params : null, g);
4040
+ let f = (m) => {
4041
+ let $ = t.t(u ? l.attr : l, u ? l.params : null, m);
3890
4042
  const w = u && l.modify ? i : r.getProp();
3891
4043
  a === "child" ? w.children ? E(w.children, 0, $) : E(w, "children", [$]) : oe(w, a, $), s.sync(i);
3892
- }, d = (g) => c(g);
3893
- const m = t.watchLoadData(d);
3894
- c = se(c, l.wait || 300), l.watch !== !1 ? o.push(m) : m();
4044
+ }, d = (m) => f(m);
4045
+ const g = t.watchLoadData(d);
4046
+ f = se(f, l.wait || 300), l.watch !== !1 ? o.push(g) : g();
3895
4047
  }
3896
4048
  }), this._fn[r.id] = o;
3897
4049
  },
@@ -3911,9 +4063,9 @@ const bi = function(t) {
3911
4063
  else {
3912
4064
  h.Object(i) || (i = { method: i });
3913
4065
  const s = i.method;
3914
- delete i.method, t.getProp().validate = [q(b({}, i), {
4066
+ delete i.method, t.getProp().validate = [q(v({}, i), {
3915
4067
  validator(...n) {
3916
- const o = x(e);
4068
+ const o = Y(e);
3917
4069
  if (o)
3918
4070
  return r.exec(o.id, h.String(s) ? s : "formCreateValidate", ...n, {
3919
4071
  attr: t,
@@ -3944,7 +4096,7 @@ const bi = function(t) {
3944
4096
  l(void 0);
3945
4097
  return;
3946
4098
  }
3947
- if (a = X(a), a.to || (a.to = "options"), a.key) {
4099
+ if (a = K(a), a.to || (a.to = "options"), a.key) {
3948
4100
  const d = t.$handle.options.globalData[a.key];
3949
4101
  if (!d) {
3950
4102
  l(void 0);
@@ -3954,31 +4106,31 @@ const bi = function(t) {
3954
4106
  l(d.data);
3955
4107
  return;
3956
4108
  } else
3957
- a = b(b({}, a), d);
4109
+ a = v(v({}, a), d);
3958
4110
  }
3959
- const u = a.onError, c = () => {
4111
+ const u = a.onError, f = () => {
3960
4112
  if (!s.getValue())
3961
4113
  return s.clearProp(), o.sync(n), !0;
3962
4114
  };
3963
- i._fn[s.id] = t.watchLoadData(se((d, m) => {
3964
- if (m && a.watch === !1)
4115
+ i._fn[s.id] = t.watchLoadData(se((d, g) => {
4116
+ if (g && a.watch === !1)
3965
4117
  return i._fn[s.id]();
3966
- const g = t.$handle.loadFetchVar(X(a), d, n), $ = q(b({
4118
+ const m = t.$handle.loadFetchVar(K(a), d, n), $ = q(v({
3967
4119
  headers: {}
3968
- }, g), {
4120
+ }, m), {
3969
4121
  onSuccess(w, O) {
3970
- if (c()) return;
4122
+ if (f()) return;
3971
4123
  let G = (M) => O ? M : D(M, "data") ? M.data : M;
3972
- const P = z(g.parse);
3973
- h.Function(P) ? G = P : P && h.String(P) && (G = (M) => L(M, P)), l(G(w, n, o)), o.sync(n);
4124
+ const T = x(m.parse);
4125
+ h.Function(T) ? G = T : T && h.String(T) && (G = (M) => B(M, T)), l(G(w, n, o));
3974
4126
  },
3975
4127
  onError(w) {
3976
- l(void 0), !c() && (u || ((O) => xe(O.message || "fetch fail " + g.action)))(w, n, o);
4128
+ l(void 0), !f() && (u || ((O) => et(O.message || "fetch fail " + m.action)))(w, n, o);
3977
4129
  }
3978
4130
  });
3979
4131
  t.$handle.beforeFetch($, { rule: n, api: o }).then(() => {
3980
- if (h.Function(g.action)) {
3981
- g.action(n, o).then((w) => {
4132
+ if (h.Function(m.action)) {
4133
+ m.action(n, o).then((w) => {
3982
4134
  $.onSuccess(w, !0);
3983
4135
  }).catch((w) => {
3984
4136
  $.onError(w);
@@ -3986,6 +4138,7 @@ const bi = function(t) {
3986
4138
  return;
3987
4139
  }
3988
4140
  F(() => t.create.fetch($, { inject: s, rule: n, api: o }));
4141
+ }).catch((w) => {
3989
4142
  });
3990
4143
  }, a.wait || 600));
3991
4144
  }
@@ -4005,7 +4158,7 @@ const bi = function(t) {
4005
4158
  return i;
4006
4159
  }, wi = {
4007
4160
  fetch: Ci,
4008
- loadData: bi,
4161
+ loadData: vi,
4009
4162
  t: _i,
4010
4163
  componentValidate: Ht
4011
4164
  };
@@ -4033,7 +4186,7 @@ function Fi(t) {
4033
4186
  };
4034
4187
  return e;
4035
4188
  }
4036
- const Oi = "html", Ri = {
4189
+ const Oi = "html", ki = {
4037
4190
  name: Oi,
4038
4191
  loadChildren: !1,
4039
4192
  render(t, e) {
@@ -4071,7 +4224,7 @@ function Si(t) {
4071
4224
  }
4072
4225
  return null;
4073
4226
  }
4074
- function ki(t) {
4227
+ function Ri(t) {
4075
4228
  const e = sessionStorage.getItem(t);
4076
4229
  if (e)
4077
4230
  try {
@@ -4086,7 +4239,7 @@ function it(t, e) {
4086
4239
  return null;
4087
4240
  const r = e.split(".");
4088
4241
  let i = t(r.shift());
4089
- return r.length ? i == null ? null : L(i, r) : i;
4242
+ return r.length ? i == null ? null : B(i, r) : i;
4090
4243
  }
4091
4244
  function Di(t) {
4092
4245
  return it(Ei, t);
@@ -4095,19 +4248,69 @@ function ji(t) {
4095
4248
  return it(Si, t);
4096
4249
  }
4097
4250
  function Ai(t) {
4098
- return it(ki, t);
4251
+ return it(Ri, t);
4099
4252
  }
4100
- function Vi(t, e) {
4253
+ const Vi = {
4254
+ en: {
4255
+ required: "{title} is required",
4256
+ validate: {
4257
+ url: "{title} is not a valid url",
4258
+ email: "{title} is not a valid email",
4259
+ ip: "{title} {title} is not a valid ip",
4260
+ phone: "{title} {title} is not a valid phone",
4261
+ pattern: "{title} does not match pattern {pattern}",
4262
+ uppercase: "{title} must be all uppercase",
4263
+ lowercase: "{title} must be all lowercased",
4264
+ positive: "{title} is not a positive number",
4265
+ negative: "{title} is not a negative number",
4266
+ equal: "{title} is not equal to {equal}",
4267
+ min: "{title} cannot be less than {min}",
4268
+ max: "{title} cannot be greater than {max}",
4269
+ enum: "{title} must be one of {enum}",
4270
+ hasKeys: "{title} does not contain required fields {hasKeys}",
4271
+ minLen: "{title} must be at least {minLen}",
4272
+ maxLen: "{title} cannot be longer than {maxLen}",
4273
+ len: "{title} must be exactly {len}",
4274
+ integer: "{title} is not an integer",
4275
+ number: "{title} is not an number"
4276
+ }
4277
+ },
4278
+ "zh-cn": {
4279
+ required: "{title}不能为空",
4280
+ validate: {
4281
+ url: "{title}不是有效的 url 地址",
4282
+ email: "{title}不是有效的邮箱地址",
4283
+ ip: "{title}不是有效的 IP 地址",
4284
+ phone: "{title}不是正确的手机号",
4285
+ pattern: "{title}必须匹配 {pattern}",
4286
+ uppercase: "{title}必须全大写",
4287
+ lowercase: "{title}必须全小写",
4288
+ positive: "{title}不是正数",
4289
+ negative: "{title}不是负数",
4290
+ equal: "{title}必须等于 {equal}",
4291
+ min: "{title}必须大于等于 {min}",
4292
+ max: "{title}必须小于等于 {max}",
4293
+ enum: "{title}必须是 {enum} 之一",
4294
+ hasKeys: "{title}必须包含 {hasKeys} 字段",
4295
+ minLen: "{title}长度必须大于 {minLen}",
4296
+ maxLen: "{title}长度必须小于 {maxLen}",
4297
+ len: "{title}长度必须为 {len}",
4298
+ integer: "{title}必须为整数",
4299
+ number: "{title}必须为数字"
4300
+ }
4301
+ }
4302
+ };
4303
+ function Ii(t, e) {
4101
4304
  let r;
4102
4305
  return arguments.length === 2 ? (r = arguments[1], e = r[t]) : r = arguments[2], { id: e, prop: r };
4103
4306
  }
4104
- function Le() {
4105
- return Vi("name", ...arguments);
4307
+ function Me() {
4308
+ return Ii("name", ...arguments);
4106
4309
  }
4107
- function Ii(t) {
4310
+ function Pi(t) {
4108
4311
  return !t || !t.el ? window.document.body : h.Element(t.el) ? t.el : document.querySelector(t.el);
4109
4312
  }
4110
- function Pi(t, e) {
4313
+ function Ti(t, e) {
4111
4314
  const r = new Vue({
4112
4315
  data() {
4113
4316
  return { rule: t, option: e || {} };
@@ -4118,151 +4321,151 @@ function Pi(t, e) {
4118
4321
  });
4119
4322
  return r.$mount(), r;
4120
4323
  }
4121
- function Ti(t) {
4324
+ function Bi(t) {
4122
4325
  const e = t.key || [], r = t.array || [], i = t.normal || [];
4123
- St.push(...e), Ze.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
4326
+ St.push(...e), Qe.push(...r), Ye.push(...i), Bt([...e, ...r, ...i]);
4124
4327
  }
4125
- let Bi = 1;
4126
- const U = {}, Ee = Symbol("defValue");
4328
+ let Li = 1;
4329
+ const U = {}, Se = Symbol("defValue");
4127
4330
  function Gt(t) {
4128
4331
  const e = {
4129
- [Be.name]: Be
4332
+ [Le.name]: Le
4130
4333
  }, r = {}, i = {}, s = {}, n = {}, o = [], a = [], l = [
4131
4334
  t.extendApi
4132
- ], u = b({}, wi), c = Xr();
4335
+ ], u = v({}, wi), f = zr();
4133
4336
  let d = { global: {} };
4134
- const m = t.isMobile === !0, g = ne({
4135
- $mobile: m
4337
+ const g = t.isMobile === !0, m = ne({
4338
+ $mobile: g
4136
4339
  }), $ = $i(), w = {}, O = {};
4137
- Ti(t.attrs || {});
4138
- function G(f) {
4139
- const p = U[f];
4340
+ Bi(t.attrs || {});
4341
+ function G(c) {
4342
+ const p = U[c];
4140
4343
  if (Array.isArray(p))
4141
4344
  return p.map((y) => y.api());
4142
4345
  if (p)
4143
4346
  return p.api();
4144
4347
  }
4145
- function P(f) {
4146
- o.push(f);
4348
+ function T(c) {
4349
+ o.push(c);
4147
4350
  }
4148
4351
  function M() {
4149
- const f = Le(...arguments);
4150
- f.id && f.prop && (i[f.id] = f.prop);
4352
+ const c = Me(...arguments);
4353
+ c.id && c.prop && (i[c.id] = c.prop);
4151
4354
  }
4152
4355
  function he() {
4153
- const f = Le(...arguments);
4154
- f.id && f.prop && (u[f.id] = h.Function(f.prop) ? f.prop : q(b({}, f.prop), {
4155
- name: f.id
4356
+ const c = Me(...arguments);
4357
+ c.id && c.prop && (u[c.id] = h.Function(c.prop) ? c.prop : q(v({}, c.prop), {
4358
+ name: c.id
4156
4359
  }));
4157
4360
  }
4158
- function Ae(f) {
4159
- $.use(f);
4361
+ function Ve(c) {
4362
+ $.use(c);
4160
4363
  }
4161
4364
  function de() {
4162
- const f = Le(...arguments);
4163
- if (!f.id || !f.prop) return ke;
4164
- const p = J(f.id), y = f.prop, v = y.merge === !0 ? r[p] : void 0;
4165
- r[p] = Re(y, v || ke), c[p] = I(p), y.maker && _(c, y.maker);
4365
+ const c = Me(...arguments);
4366
+ if (!c.id || !c.prop) return De;
4367
+ const p = J(c.id), y = c.prop, b = y.merge === !0 ? r[p] : void 0;
4368
+ r[p] = Ee(y, b || De), f[p] = P(p), y.maker && _(f, y.maker);
4166
4369
  }
4167
- function R(f, p) {
4370
+ function k(c, p) {
4168
4371
  let y;
4169
- if (h.String(f)) {
4170
- if (y = f, p === void 0)
4372
+ if (h.String(c)) {
4373
+ if (y = c, p === void 0)
4171
4374
  return ["form-create", "formcreate"].indexOf(y) > -1 ? S() : e[y];
4172
4375
  } else
4173
- y = J(f.name), p = f;
4376
+ y = J(c.name), p = c;
4174
4377
  if (!y || !p) return;
4175
- const v = J(y);
4176
- e[y] = p, e[v] = p, delete $.aliasMap[y], delete $.aliasMap[v], delete r[y], delete r[v], p.formCreateParser && de(y, p.formCreateParser);
4378
+ const b = J(y);
4379
+ e[y] = p, e[b] = p, delete $.aliasMap[y], delete $.aliasMap[b], delete r[y], delete r[b], p.formCreateParser && de(y, p.formCreateParser);
4177
4380
  }
4178
4381
  function S() {
4179
- return Nr(Ie, e, i);
4382
+ return Kr(Pe, e, i);
4180
4383
  }
4181
4384
  function N() {
4182
- return Be;
4385
+ return Le;
4183
4386
  }
4184
- function pe(f, p) {
4185
- return h.Function(f.install) ? f.install(W, p) : h.Function(f) && f(W, p), this;
4387
+ function pe(c, p) {
4388
+ return h.Function(c.install) ? c.install(W, p) : h.Function(c) && c(W, p), this;
4186
4389
  }
4187
- function W(f, p, y) {
4188
- let v = Pi(f, p || {});
4189
- const C = v.$refs.fc.formCreate;
4190
- return C.$parent = y, Ii(C.options).appendChild(v.$el), C.api();
4390
+ function W(c, p, y) {
4391
+ let b = Ti(c, p || {});
4392
+ const C = b.$refs.fc.formCreate;
4393
+ return C.$parent = y, Pi(C.options).appendChild(b.$el), C.api();
4191
4394
  }
4192
- Re(W, O);
4193
- function Wt(f) {
4194
- let p = b({}, t);
4195
- return f ? p.inherit = {
4395
+ Ee(W, O);
4396
+ function Kt(c) {
4397
+ let p = v({}, t);
4398
+ return c ? p.inherit = {
4196
4399
  components: e,
4197
4400
  parsers: r,
4198
4401
  directives: i,
4199
4402
  modelFields: s,
4200
4403
  providers: u,
4201
4404
  useApps: o,
4202
- maker: c,
4405
+ maker: f,
4203
4406
  formulas: w,
4204
- loadData: g
4407
+ loadData: m
4205
4408
  } : delete p.inherit, Gt(p);
4206
4409
  }
4207
- function Kt(f, p) {
4208
- s[f] = p;
4410
+ function Wt(c, p) {
4411
+ s[c] = p;
4209
4412
  }
4210
- function Xt(f, p) {
4211
- w[f] = p;
4413
+ function zt(c, p) {
4414
+ w[c] = p;
4212
4415
  }
4213
- function zt(f, p) {
4214
- const y = n[f] || {}, v = y.parsers || {};
4416
+ function xt(c, p) {
4417
+ const y = n[c] || {}, b = y.parsers || {};
4215
4418
  p.parsers && Object.keys(p.parsers).forEach((C) => {
4216
- v[C] = Re(p.parsers[C], ke);
4217
- }), p.name = f, n[f] = q(b(b({}, y), p), { parsers: v });
4419
+ b[C] = Ee(p.parsers[C], De);
4420
+ }), p.name = c, n[c] = q(v(v({}, y), p), { parsers: b });
4218
4421
  }
4219
- function Ce(f) {
4220
- f && Object.keys(U).forEach((p) => {
4221
- (Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((v) => {
4222
- v.bus.$emit("$loadData." + f);
4422
+ function we(c) {
4423
+ c && Object.keys(U).forEach((p) => {
4424
+ (Array.isArray(U[p]) ? U[p] : [U[p]]).forEach((b) => {
4425
+ b.bus.$emit("$loadData." + c);
4223
4426
  });
4224
4427
  });
4225
4428
  }
4226
- function Ve(f, p) {
4227
- oe(g, f, p), Ce(f);
4429
+ function Ie(c, p) {
4430
+ oe(m, c, p), we(c);
4228
4431
  }
4229
- function we(f, p) {
4230
- const y = (...v) => F(() => p(...v));
4231
- y._driver = !0, Ve(f, y);
4432
+ function Fe(c, p) {
4433
+ const y = (...b) => F(() => p(...b));
4434
+ y._driver = !0, Ie(c, y);
4232
4435
  }
4233
- function nt(f, p) {
4234
- const y = (f || "").split(".");
4235
- f = y.shift();
4236
- const v = y.join(".");
4237
- if (D(g, f) || E(g, f, Ee), g[f] !== Ee) {
4238
- let C = g[f];
4239
- return C && C._driver ? C = C(v) : y.length && (C = L(C, y)), C == null || C === "" ? p : C;
4436
+ function nt(c, p) {
4437
+ const y = (c || "").split(".");
4438
+ c = y.shift();
4439
+ const b = y.join(".");
4440
+ if (D(m, c) || E(m, c, Se), m[c] !== Se) {
4441
+ let C = m[c];
4442
+ return C && C._driver ? C = C(b) : y.length && (C = B(C, y)), C == null || C === "" ? p : C;
4240
4443
  } else
4241
4444
  return p;
4242
4445
  }
4243
- function Qt(f) {
4244
- l.push(f);
4446
+ function Xt(c) {
4447
+ l.push(c);
4245
4448
  }
4246
- function Zt(f) {
4247
- delete g[f], Ce(f);
4449
+ function Zt(c) {
4450
+ delete m[c], we(c);
4248
4451
  }
4249
- function Yt(f, p) {
4250
- a.push({ name: f, callback: p });
4452
+ function Qt(c, p) {
4453
+ a.push({ name: c, callback: p });
4251
4454
  }
4252
- function Ie(f) {
4455
+ function Pe(c) {
4253
4456
  _(this, {
4254
- id: Bi++,
4457
+ id: Li++,
4255
4458
  create: W,
4256
- vm: f,
4257
- manager: vi(t.manager),
4459
+ vm: c,
4460
+ manager: bi(t.manager),
4258
4461
  parsers: r,
4259
4462
  providers: u,
4260
4463
  modelFields: s,
4261
4464
  formulas: w,
4262
- isMobile: m,
4263
- rules: f.$options.propsData.rule,
4264
- name: f.$options.propsData.name || je(),
4265
- inFor: f.$options.propsData.inFor,
4465
+ isMobile: g,
4466
+ rules: c.$options.propsData.rule,
4467
+ name: c.$options.propsData.name || Ae(),
4468
+ inFor: c.$options.propsData.inFor,
4266
4469
  prop: {
4267
4470
  components: e,
4268
4471
  directives: i
@@ -4270,8 +4473,8 @@ function Gt(t) {
4270
4473
  get: null,
4271
4474
  drivers: n,
4272
4475
  renderDriver: null,
4273
- refreshData: Ce,
4274
- loadData: g,
4476
+ refreshData: we,
4477
+ loadData: m,
4275
4478
  CreateNode: $,
4276
4479
  bus: new Fi(),
4277
4480
  unwatch: [],
@@ -4281,58 +4484,58 @@ function Gt(t) {
4281
4484
  tmpData: ne({})
4282
4485
  }), a.forEach((p) => {
4283
4486
  this.bus.$on(p.name, p.callback);
4284
- }), T(() => {
4285
- B(this.options, () => {
4487
+ }), I(() => {
4488
+ L(this.options, () => {
4286
4489
  this.$handle.$manager.updateOptions(this.options.value), this.api().refresh();
4287
4490
  }, { deep: !0 });
4288
- }), _(f.$options.components, e), _(f.$options.directives, i), this.$handle = new Q(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
4491
+ }), _(c.$options.components, e), _(c.$options.directives, i), this.$handle = new X(this), this.name && (this.inFor ? (U[this.name] || (U[this.name] = []), U[this.name].push(this)) : U[this.name] = this);
4289
4492
  }
4290
- Ie.isMobile = m, _(Ie.prototype, {
4493
+ Pe.isMobile = g, _(Pe.prototype, {
4291
4494
  init() {
4292
- this.isSub() && this.unwatch.push(B(() => this.vm.parent.fc.options.value, () => {
4495
+ this.isSub() && this.unwatch.push(L(() => this.vm.parent.fc.options.value, () => {
4293
4496
  this.initOptions(), this.$handle.api.refresh();
4294
- }, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
4497
+ }, { deep: !0 })), this.vm.$options.propsData.driver && (this.renderDriver = typeof this.vm.$options.propsData.driver == "object" ? this.vm.$options.propsData.driver : this.drivers[this.vm.$options.propsData.driver]), !this.renderDriver && this.vm.parent && (this.renderDriver = this.vm.parent.fc.renderDriver), this.renderDriver || (this.renderDriver = this.drivers.default), this.initOptions(), this.$handle.init();
4295
4498
  },
4296
- targetFormDriver(f, ...p) {
4297
- if (this.renderDriver && this.renderDriver[f])
4298
- return F(() => this.renderDriver[f](...p));
4499
+ targetFormDriver(c, ...p) {
4500
+ if (this.renderDriver && this.renderDriver[c])
4501
+ return F(() => this.renderDriver[c](...p));
4299
4502
  },
4300
- t(f, p, y) {
4301
- let v = y ? y("$t." + f) : this.globalLanguageDriver(f);
4302
- return v == null && (v = ""), v && p && Object.keys(p).forEach((C) => {
4503
+ t(c, p, y) {
4504
+ let b = y ? y("$t." + c) : this.globalLanguageDriver(c);
4505
+ return b == null && (b = ""), b && p && Object.keys(p).forEach((C) => {
4303
4506
  const j = new RegExp(`{${C}}`, "g");
4304
- v = v.replace(j, p[C]);
4305
- }), v;
4306
- },
4307
- globalDataDriver(f) {
4308
- let p = f.split(".");
4309
- const y = p.shift(), v = this.options.value.globalData && this.options.value.globalData[y];
4310
- if (v) {
4311
- if (v.type === "static")
4312
- return L(v.data, p);
4507
+ b = b.replace(j, p[C]);
4508
+ }), b;
4509
+ },
4510
+ globalDataDriver(c) {
4511
+ let p = c.split(".");
4512
+ const y = p.shift(), b = this.options.value.globalData && this.options.value.globalData[y];
4513
+ if (b) {
4514
+ if (b.type === "static")
4515
+ return B(b.data, p);
4313
4516
  {
4314
4517
  let C;
4315
- const j = this.fetchCache.get(v);
4518
+ const j = this.fetchCache.get(b);
4316
4519
  if (j) {
4317
- if (j.status && (C = L(j.data, p)), !j.loading)
4520
+ if (j.status && (C = B(j.data, p)), !j.loading)
4318
4521
  return C;
4319
- j.loading = !1, this.fetchCache.set(v, j);
4522
+ j.loading = !1, this.fetchCache.set(b, j);
4320
4523
  } else
4321
- this.fetchCache.set(v, { status: !1 });
4322
- const k = se(() => {
4524
+ this.fetchCache.set(b, { status: !1 });
4525
+ const R = se(() => {
4323
4526
  le();
4324
- const K = this.fetchCache.get(v);
4325
- this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(v) !== -1 ? (K && (K.loading = !0, this.fetchCache.set(v, K)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(v);
4326
- }, v.wait || 600), ae = (K) => {
4327
- this.fetchCache.set(v, { status: !0, data: K }), this.bus.$emit("$loadData.$globalData." + y);
4328
- }, Z = (K, ue) => {
4329
- if (ue && v.watch === !1)
4527
+ const z = this.fetchCache.get(b);
4528
+ this.options.value.globalData && Object.values(this.options.value.globalData).indexOf(b) !== -1 ? (z && (z.loading = !0, this.fetchCache.set(b, z)), this.bus.$emit("$loadData.$globalData." + y)) : this.fetchCache.delete(b);
4529
+ }, b.wait || 600), ae = (z) => {
4530
+ this.fetchCache.set(b, { status: !0, data: z }), this.bus.$emit("$loadData.$globalData." + y);
4531
+ }, Z = (z, ue) => {
4532
+ if (ue && b.watch === !1)
4330
4533
  return le();
4331
4534
  if (ue) {
4332
- k();
4535
+ R();
4333
4536
  return;
4334
4537
  }
4335
- const me = this.$handle.loadFetchVar(Ge(v), K);
4538
+ const me = this.$handle.loadFetchVar(Je(b), z);
4336
4539
  this.$handle.api.fetch(me).then((re) => {
4337
4540
  ae(re);
4338
4541
  }).catch((re) => {
@@ -4344,38 +4547,39 @@ function Gt(t) {
4344
4547
  }
4345
4548
  },
4346
4549
  getLocale() {
4347
- let f = this.vm.top.$props.locale;
4348
- return f && typeof f == "object" ? f.name : typeof f == "string" ? f : "zh-cn";
4550
+ let c = this.vm.top.$props.locale;
4551
+ return c && typeof c == "object" ? c.name : typeof c == "string" ? c : "zh-cn";
4349
4552
  },
4350
- globalLanguageDriver(f) {
4553
+ globalLanguageDriver(c) {
4351
4554
  let p = this.vm.top.$props.locale, y;
4352
- if (p && typeof p == "object" && (y = L(p, f)), y == null) {
4353
- const v = this.options.value.language || {}, C = this.getLocale();
4354
- y = L(v[C], f);
4555
+ if (p && typeof p == "object" && (y = B(p, c)), y == null) {
4556
+ const b = this.options.value.language || {}, C = this.getLocale();
4557
+ y = B(b[C] || {}, c), y == null && (y = B(Vi[C] || {}, c));
4355
4558
  }
4356
4559
  return y;
4357
4560
  },
4358
- globalVarDriver(f) {
4359
- const y = f.split(".").shift(), v = this.options.value.globalVariable && this.options.value.globalVariable[y];
4360
- if (v) {
4361
- const C = h.Function(v) ? v : z(v.handle);
4561
+ globalVarDriver(c) {
4562
+ let p = c.split(".");
4563
+ const y = p.shift(), b = this.options.value.globalVariable && this.options.value.globalVariable[y];
4564
+ if (b) {
4565
+ const C = h.Function(b) ? b : x(b.handle);
4362
4566
  if (C) {
4363
4567
  let j;
4364
- const k = this.watchLoadData((ae, Z) => {
4365
- Z ? (this.bus.$emit("$loadData.$var." + y), k()) : j = C(ae, this.$handle.api);
4568
+ const R = this.watchLoadData((ae, Z) => {
4569
+ Z ? (this.bus.$emit("$loadData.$var." + y), R()) : j = C(ae, this.$handle.api);
4366
4570
  });
4367
- return this.unwatch.push(k), j;
4571
+ return this.unwatch.push(R), B(j, p);
4368
4572
  }
4369
4573
  }
4370
4574
  },
4371
- setData(f, p, y) {
4372
- y ? Ve(f, p) : (oe(this.vm.top.fc.tmpData, f, p), this.bus.$emit("$loadData." + f));
4575
+ setData(c, p, y) {
4576
+ y ? Ie(c, p) : (oe(this.vm.top.fc.tmpData, c, p), this.bus.$emit("$loadData." + c));
4373
4577
  },
4374
- getLoadData(f, p) {
4578
+ getLoadData(c, p) {
4375
4579
  let y = null;
4376
- if (f != null) {
4377
- let v = f.split(".");
4378
- const C = v.shift();
4580
+ if (c != null) {
4581
+ let b = c.split(".");
4582
+ const C = b.shift();
4379
4583
  if (C === "$topForm")
4380
4584
  y = this.$handle.api.top.formData(!0);
4381
4585
  else if (C === "$scopeForm")
@@ -4385,53 +4589,53 @@ function Gt(t) {
4385
4589
  else if (C === "$options")
4386
4590
  y = this.options.value;
4387
4591
  else if (C === "$globalData")
4388
- y = this.globalDataDriver(v.join(".")), v = [];
4592
+ y = this.globalDataDriver(b.join(".")), b = [];
4389
4593
  else if (C === "$var")
4390
- y = this.globalVarDriver(v.join(".")), v = [];
4594
+ y = this.globalVarDriver(b.join(".")), b = [];
4391
4595
  else if (C === "$locale")
4392
- y = this.getLocale(), v = [];
4596
+ y = this.getLocale(), b = [];
4393
4597
  else if (C === "$t")
4394
- y = this.globalLanguageDriver(v.join(".")), v = [];
4598
+ y = this.globalLanguageDriver(b.join(".")), b = [];
4395
4599
  else {
4396
4600
  if (C === "$preview")
4397
4601
  return this.$handle.preview;
4398
4602
  {
4399
4603
  const j = this.vm.top.fc.tmpData;
4400
- D(j, C) || E(j, C, Ee), y = j[C] !== Ee ? L(j, f) : nt(f), v = [];
4604
+ D(j, C) || E(j, C, Se), y = j[C] !== Se ? B(j, c) : nt(c), b = [];
4401
4605
  }
4402
4606
  }
4403
- y && v.length && (y = L(y, v));
4607
+ y && b.length && (y = B(y, b));
4404
4608
  }
4405
4609
  return y == null || y === "" ? p : y;
4406
4610
  },
4407
- watchLoadData(f, p) {
4611
+ watchLoadData(c, p) {
4408
4612
  let y = {};
4409
- const v = (k) => {
4613
+ const b = (R) => {
4410
4614
  this.get || (this.get = C), F(() => {
4411
- f(C, k);
4615
+ c(C, R);
4412
4616
  }), this.get === C && (this.get = void 0);
4413
- }, C = (k, ae) => {
4617
+ }, C = (R, ae) => {
4414
4618
  let Z;
4415
- if (typeof k == "object" && (Z = k.getValue, k = k.id), y[k])
4416
- return y[k].val;
4417
- const le = ye(() => Z ? Z() : this.getLoadData(k, ae)), K = k.split("."), ue = K.shift(), me = K.shift() || "", re = se(() => {
4418
- const Pe = Z ? Z() : this.getLoadData(k, ae);
4419
- if (y[k])
4420
- JSON.stringify(Pe) !== JSON.stringify(y[k].val) && (y[k].val = Pe, v(!0));
4619
+ if (typeof R == "object" && (Z = R.getValue, R = R.id), y[R])
4620
+ return y[R].val;
4621
+ const le = ye(() => Z ? Z() : this.getLoadData(R, ae)), z = R.split("."), ue = z.shift(), me = z.shift() || "", re = se(() => {
4622
+ const Te = Z ? Z() : this.getLoadData(R, ae);
4623
+ if (y[R])
4624
+ JSON.stringify(Te) !== JSON.stringify(y[R].val) && (y[R].val = Te, b(!0));
4421
4625
  else return;
4422
- }, p || 0), er = B(le, (Pe) => {
4626
+ }, p || 0), er = L(le, (Te) => {
4423
4627
  re();
4424
4628
  });
4425
- return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[k] = {
4629
+ return this.bus.$on("$loadData." + ue, re), me && this.bus.$on("$loadData." + ue + "." + me, re), y[R] = {
4426
4630
  fn: () => {
4427
4631
  this.bus.$off("$loadData." + ue, re), me && this.bus.$off("$loadData." + ue + "." + me, re), er();
4428
4632
  },
4429
4633
  val: le.value
4430
4634
  }, le.value;
4431
4635
  };
4432
- v(!1);
4636
+ b(!1);
4433
4637
  const j = () => {
4434
- Object.keys(y).forEach((k) => y[k].fn()), y = {};
4638
+ Object.keys(y).forEach((R) => y[R].fn()), y = {};
4435
4639
  };
4436
4640
  return this.unwatch.push(j), j;
4437
4641
  },
@@ -4440,22 +4644,22 @@ function Gt(t) {
4440
4644
  },
4441
4645
  initOptions() {
4442
4646
  this.options.value = {};
4443
- let f = b({
4647
+ let c = v({
4444
4648
  formData: {},
4445
4649
  submitBtn: {},
4446
4650
  resetBtn: {},
4447
4651
  globalEvent: {},
4448
4652
  globalData: {}
4449
- }, X(d));
4450
- this.isSub() && (f = this.mergeOptions(f, this.vm.parent.fc.options.value || {}, !0)), f = this.mergeOptions(f, this.vm.$options.propsData.option || {}), this.updateOptions(f);
4653
+ }, K(d));
4654
+ this.isSub() && (c = this.mergeOptions(c, this.vm.parent.fc.options.value || {}, !0)), c = this.mergeOptions(c, this.vm.$options.propsData.option || {}), this.updateOptions(c);
4451
4655
  },
4452
- mergeOptions(f, p, y) {
4453
- return p = b({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((v) => {
4454
- delete p[v];
4455
- }), p.global && (f.global = Gr(f.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], f), f;
4656
+ mergeOptions(c, p, y) {
4657
+ return p = v({}, p || {}), y && ["page", "onSubmit", "onReset", "onCreated", "onChange", "onMounted", "mounted", "onReload", "reload", "formData", "el", "globalClass", "style"].forEach((b) => {
4658
+ delete p[b];
4659
+ }), p.global && (c.global = Hr(c.global, p.global), delete p.global), this.$handle.$manager.mergeOptions([p], c), c;
4456
4660
  },
4457
- updateOptions(f) {
4458
- this.options.value = this.mergeOptions(this.options.value, f), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
4661
+ updateOptions(c) {
4662
+ this.options.value = this.mergeOptions(this.options.value, c), this.$handle.$manager.updateOptions(this.options.value), this.bus.$emit("$loadData.$options");
4459
4663
  },
4460
4664
  api() {
4461
4665
  return this.$handle.api;
@@ -4469,88 +4673,88 @@ function Gt(t) {
4469
4673
  unmount() {
4470
4674
  if (this.name)
4471
4675
  if (this.inFor) {
4472
- const f = U[this.name].indexOf(this);
4473
- U[this.name].splice(f, 1);
4676
+ const c = U[this.name].indexOf(this);
4677
+ U[this.name].splice(c, 1);
4474
4678
  } else
4475
4679
  delete U[this.name];
4476
- a.forEach((f) => {
4477
- this.bus.$off(f.name, f.callback);
4478
- }), this.tmpData = {}, this.unwatch.forEach((f) => f()), this.unwatch = [], this.$handle.reloadRule([]);
4680
+ a.forEach((c) => {
4681
+ this.bus.$off(c.name, c.callback);
4682
+ }), this.tmpData = {}, this.unwatch.forEach((c) => c()), this.unwatch = [], this.$handle.reloadRule([]);
4479
4683
  },
4480
4684
  updated() {
4481
4685
  this.$handle.bindNextTick(() => this.bus.$emit("next-tick", this.$handle.api));
4482
4686
  }
4483
4687
  });
4484
- function st(f) {
4485
- _(f, {
4688
+ function st(c) {
4689
+ _(c, {
4486
4690
  version: t.version,
4487
4691
  ui: t.ui,
4488
- isMobile: m,
4489
- extendApi: Qt,
4692
+ isMobile: g,
4693
+ extendApi: Xt,
4490
4694
  getData: nt,
4491
- setDataDriver: we,
4492
- setData: Ve,
4695
+ setDataDriver: Fe,
4696
+ setData: Ie,
4493
4697
  removeData: Zt,
4494
- refreshData: Ce,
4495
- maker: c,
4496
- component: R,
4698
+ refreshData: we,
4699
+ maker: f,
4700
+ component: k,
4497
4701
  directive: M,
4498
- setModelField: Kt,
4499
- setFormula: Xt,
4500
- setDriver: zt,
4702
+ setModelField: Wt,
4703
+ setFormula: zt,
4704
+ setDriver: xt,
4501
4705
  register: he,
4502
4706
  $vnode: N,
4503
4707
  parser: de,
4504
4708
  use: pe,
4505
- factory: Wt,
4506
- componentAlias: Ae,
4709
+ factory: Kt,
4710
+ componentAlias: Ve,
4507
4711
  copyRule: Vt,
4508
4712
  copyRules: It,
4509
4713
  mergeRule: te,
4510
4714
  fetch: Mt,
4511
4715
  $form: S,
4512
- parseFn: z,
4716
+ parseFn: x,
4513
4717
  parseJson: At,
4514
- toJson: et,
4515
- useApp: P,
4718
+ toJson: _e,
4719
+ useApp: T,
4516
4720
  getApi: G,
4517
- on: Yt
4721
+ on: Qt
4518
4722
  });
4519
4723
  }
4520
- function xt(f) {
4521
- _(f, {
4724
+ function Yt(c) {
4725
+ _(c, {
4522
4726
  create: W,
4523
4727
  install(p, y) {
4524
- if (d = b(b({}, d), y || {}), p._installedFormCreate === !0) return;
4728
+ if (d = v(v({}, d), y || {}), p._installedFormCreate === !0) return;
4525
4729
  p._installedFormCreate = !0;
4526
- const v = function(j, k = {}) {
4527
- return W(j, k, this);
4730
+ const b = function(j, R = {}) {
4731
+ return W(j, R, this);
4528
4732
  };
4529
- st(v), p.prototype.$formCreate = v;
4733
+ st(b), p.prototype.$formCreate = b;
4530
4734
  const C = S();
4531
4735
  p.component(C.name, C), p.component("FcFragment", N()), o.forEach((j) => {
4532
- F(() => j(f, p));
4736
+ F(() => j(c, p));
4533
4737
  });
4534
4738
  }
4535
4739
  });
4536
4740
  }
4537
- if (st(O), xt(O), we("$cookie", Di), we("$localStorage", ji), we("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && W.use(t), de(Ri), t.inherit) {
4538
- const f = t.inherit;
4539
- f.components && _(e, f.components), f.parsers && _(r, f.parsers), f.directives && _(i, f.directives), f.modelFields && _(s, f.modelFields), f.providers && _(u, f.providers), f.useApps && _(o, f.useApps), f.maker && _(c, f.maker), f.loadData && _(g, f.loadData), f.formulas && _(w, f.formulas);
4741
+ if (st(O), Yt(O), Fe("$cookie", Di), Fe("$localStorage", ji), Fe("$sessionStorage", Ai), $.use({ fragment: "fcFragment" }), t.install && W.use(t), de(ki), t.inherit) {
4742
+ const c = t.inherit;
4743
+ c.components && _(e, c.components), c.parsers && _(r, c.parsers), c.directives && _(i, c.directives), c.modelFields && _(s, c.modelFields), c.providers && _(u, c.providers), c.useApps && _(o, c.useApps), c.maker && _(f, c.maker), c.loadData && _(m, c.loadData), c.formulas && _(w, c.formulas);
4540
4744
  }
4541
- const Fe = S();
4542
- return Re(Fe, O), Object.defineProperties(Fe, {
4745
+ const Oe = S();
4746
+ return Ee(Oe, O), Object.defineProperties(Oe, {
4543
4747
  fetch: {
4544
4748
  get() {
4545
4749
  return O.fetch;
4546
4750
  },
4547
- set(f) {
4548
- O.fetch = f;
4751
+ set(c) {
4752
+ O.fetch = c;
4549
4753
  }
4550
4754
  }
4551
- }), Fe.util = O, Fe;
4755
+ }), Oe.util = O, Oe;
4552
4756
  }
4553
- const bt = {
4757
+ const vt = {
4554
4758
  date: "yyyy-MM-dd",
4555
4759
  month: "yyyy-MM",
4556
4760
  datetime: "yyyy-MM-dd HH:mm:ss",
@@ -4559,73 +4763,73 @@ const bt = {
4559
4763
  monthrange: "yyyy-MM",
4560
4764
  datetimerange: "yyyy-MM-dd HH:mm:ss",
4561
4765
  year: "yyyy"
4562
- }, _t = "datePicker", Li = {
4766
+ }, _t = "datePicker", Mi = {
4563
4767
  name: _t,
4564
4768
  maker: function() {
4565
- return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = I(_t, { type: e.toLowerCase() }), t), {});
4769
+ return ["year", "month", "date", "dates", "week", "datetime", "datetimeRange", "dateRange", "monthRange"].reduce((t, e) => (t[e] = P(_t, { type: e.toLowerCase() }), t), {});
4566
4770
  }(),
4567
4771
  mergeProp(t) {
4568
4772
  const e = t.prop.props;
4569
- e.valueFormat || (e.valueFormat = bt[e.type] || bt.date);
4773
+ e.valueFormat || (e.valueFormat = vt[e.type] || vt.date);
4570
4774
  }
4571
- }, Me = "hidden", Mi = {
4572
- name: Me,
4775
+ }, Ne = "hidden", Ni = {
4776
+ name: Ne,
4573
4777
  maker: {
4574
- [Me]: (t, e) => I(Me)("", t, e)
4778
+ [Ne]: (t, e) => P(Ne)("", t, e)
4575
4779
  },
4576
4780
  render() {
4577
4781
  return [];
4578
4782
  }
4579
- }, Ne = "input", Ni = {
4580
- name: Ne,
4783
+ }, qe = "input", qi = {
4784
+ name: qe,
4581
4785
  maker: function() {
4582
- const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = I(Ne, { type: r }), e), {});
4583
- return t.idate = I(Ne, { type: "date" }), t;
4786
+ const t = ["password", "url", "email", "text", "textarea"].reduce((e, r) => (e[r] = P(qe, { type: r }), e), {});
4787
+ return t.idate = P(qe, { type: "date" }), t;
4584
4788
  }(),
4585
4789
  mergeProp(t) {
4586
4790
  let { props: e } = t.prop;
4587
4791
  e && e.autosize && e.autosize.minRows && (e.rows = e.autosize.minRows || 2);
4588
4792
  }
4589
- }, Ct = "slider", qi = {
4793
+ }, Ct = "slider", Ui = {
4590
4794
  name: Ct,
4591
4795
  maker: {
4592
- sliderRange: I(Ct, { range: !0 })
4796
+ sliderRange: P(Ct, { range: !0 })
4593
4797
  },
4594
4798
  toFormValue(t, e) {
4595
4799
  let r = Array.isArray(t), i = e.prop.props, s = i.min || 0, n;
4596
4800
  return i.range === !0 ? n = r ? t : [s, parseFloat(t) || s] : n = r ? parseFloat(t[0]) || s : parseFloat(t), n;
4597
4801
  }
4598
- }, qe = "timePicker", Ui = {
4599
- name: qe,
4802
+ }, Ue = "timePicker", Hi = {
4803
+ name: Ue,
4600
4804
  maker: {
4601
- time: I(qe, (t) => t.props.isRange = !1),
4602
- timeRange: I(qe, (t) => t.props.isRange = !0)
4805
+ time: P(Ue, (t) => t.props.isRange = !1),
4806
+ timeRange: P(Ue, (t) => t.props.isRange = !0)
4603
4807
  },
4604
4808
  mergeProp(t) {
4605
4809
  const e = t.prop.props;
4606
4810
  e.valueFormat || (e.valueFormat = "HH:mm:ss");
4607
4811
  }
4608
- }, Hi = {
4812
+ }, Gi = {
4609
4813
  name: "FcRow",
4610
4814
  render(t, e) {
4611
4815
  return e.vNode.col({ props: { span: 24 } }, [
4612
4816
  e.vNode.row(e.prop, t)
4613
4817
  ]);
4614
4818
  }
4615
- }, Gi = "select", Ji = {
4616
- name: Gi,
4819
+ }, Ji = "select", Ki = {
4820
+ name: Ji,
4617
4821
  toFormValue(t, e) {
4618
4822
  return e.prop.props.multiple && !Array.isArray(t) ? H(t) : t;
4619
4823
  }
4620
4824
  }, Wi = [
4621
- Li,
4622
4825
  Mi,
4623
4826
  Ni,
4624
4827
  qi,
4625
4828
  Ui,
4626
4829
  Hi,
4627
- Ji
4628
- ], A = "el", Ki = {
4830
+ Gi,
4831
+ Ki
4832
+ ], A = "el", zi = {
4629
4833
  button: A + "Button",
4630
4834
  icon: "i",
4631
4835
  slider: A + "Slider",
@@ -4658,7 +4862,7 @@ const bt = {
4658
4862
  object: "fcSubForm",
4659
4863
  subForm: "fcSubForm"
4660
4864
  };
4661
- function Xi() {
4865
+ function xi() {
4662
4866
  return {
4663
4867
  form: {
4664
4868
  inline: !1,
@@ -4692,23 +4896,23 @@ function Xi() {
4692
4896
  }
4693
4897
  };
4694
4898
  }
4695
- function zi(t) {
4899
+ function Xi(t) {
4696
4900
  return t.type === "tooltip";
4697
4901
  }
4698
4902
  function wt(t, e) {
4699
4903
  D(t, e) && h.String(t[e]) && (t[e] = { [e]: t[e], show: !0 });
4700
4904
  }
4701
- function Y(t) {
4905
+ function Q(t) {
4702
4906
  return t === !1;
4703
4907
  }
4704
- function Qi(t, e) {
4908
+ function Zi(t, e) {
4705
4909
  D(t, e) && !h.Object(t[e]) && (t[e] = { show: !!t[e] });
4706
4910
  }
4707
- function Ue(t) {
4708
- const e = b({}, t);
4911
+ function He(t) {
4912
+ const e = v({}, t);
4709
4913
  return delete e.children, e;
4710
4914
  }
4711
- const Zi = {
4915
+ const Qi = {
4712
4916
  validate() {
4713
4917
  const t = this.form();
4714
4918
  return t ? t.validate() : new Promise((e) => e());
@@ -4727,7 +4931,7 @@ const Zi = {
4727
4931
  },
4728
4932
  tidyOptions(t) {
4729
4933
  return ["submitBtn", "resetBtn", "row", "info", "wrap", "col", "title"].forEach((e) => {
4730
- Qi(t, e);
4934
+ Zi(t, e);
4731
4935
  }), t;
4732
4936
  },
4733
4937
  tidyRule({ prop: t }) {
@@ -4749,39 +4953,38 @@ const Zi = {
4749
4953
  });
4750
4954
  },
4751
4955
  getDefaultOptions() {
4752
- return Xi();
4956
+ return xi();
4753
4957
  },
4754
4958
  update() {
4755
4959
  const t = this.options.form;
4756
4960
  this.rule = {
4757
- props: b({}, t),
4961
+ props: v({}, t),
4758
4962
  nativeOn: {
4759
4963
  submit: (e) => {
4760
4964
  e.preventDefault();
4761
4965
  }
4762
4966
  },
4763
- class: [t.className, t.class, "form-create", this.$handle.preview ? "is-preview" : ""],
4764
4967
  style: t.style,
4765
4968
  type: "form"
4766
4969
  };
4767
4970
  },
4768
4971
  beforeRender() {
4769
- const { key: t, ref: e, $handle: r } = this;
4770
- _(this.rule, { key: t, ref: e }), _(this.rule.props, {
4972
+ const { key: t, ref: e, $handle: r } = this, i = this.options.form;
4973
+ _(this.rule, { key: t, ref: e, class: [i.className, i.class, "form-create", this.$handle.preview ? "is-preview" : ""] }), _(this.rule.props, {
4771
4974
  model: r.formData
4772
4975
  });
4773
4976
  },
4774
4977
  render(t) {
4775
- return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Y(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
4978
+ return t.slotLen() && !this.$handle.preview && t.setSlot(void 0, () => this.makeFormBtn()), this.$r(this.rule, Q(this.options.row.show) ? t.getSlots() : [this.makeRow(t)]);
4776
4979
  },
4777
4980
  makeWrap(t, e) {
4778
4981
  const r = t.prop, i = `${this.key}${t.key}`, s = r.col, n = this.isTitle(r) && r.wrap.title !== !1, o = !s.labelWidth && !n ? 0 : s.labelWidth, { inline: a, col: l } = this.rule.props;
4779
4982
  delete r.wrap.title;
4780
- const u = Y(r.wrap.show) ? e : this.$r(ee([r.wrap, {
4781
- props: q(b({
4983
+ const u = Q(r.wrap.show) ? e : this.$r(ee([r.wrap, {
4984
+ props: q(v({
4782
4985
  labelWidth: o === void 0 ? o : jt(o),
4783
4986
  label: n ? r.title.title : void 0
4784
- }, Ue(r.wrap || {})), {
4987
+ }, He(r.wrap || {})), {
4785
4988
  prop: t.id,
4786
4989
  rules: t.injectValidate()
4787
4990
  }),
@@ -4789,26 +4992,26 @@ const Zi = {
4789
4992
  key: `${i}fi`,
4790
4993
  ref: t.wrapRef,
4791
4994
  type: "formItem"
4792
- }]), b({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
4793
- return a === !0 || Y(l) || Y(s.show) ? u : this.makeCol(r, i, [u]);
4995
+ }]), v({ default: () => e }, n ? { label: () => this.makeInfo(r, i, t) } : {}));
4996
+ return a === !0 || Q(l) || Q(s.show) ? u : this.makeCol(r, i, [u]);
4794
4997
  },
4795
4998
  isTitle(t) {
4796
4999
  if (this.options.form.title === !1) return !1;
4797
5000
  const e = t.title;
4798
- return !(!e.title && !e.native || Y(e.show));
5001
+ return !(!e.title && !e.native || Q(e.show));
4799
5002
  },
4800
5003
  makeInfo(t, e, r) {
4801
- var c, d, m, g, $, w;
4802
- const i = b({}, t.title), s = b({}, t.info), n = zi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
4803
- title: (d = (c = r.refRule) == null ? void 0 : c.__$title) == null ? void 0 : d.value,
5004
+ var f, d, g, m, $, w;
5005
+ const i = v({}, t.title), s = v({}, t.info), n = Xi(s), o = this.options.form, a = this.getSlot("title"), l = [a ? a({
5006
+ title: (d = (f = r.refRule) == null ? void 0 : f.__$title) == null ? void 0 : d.value,
4804
5007
  rule: r.rule,
4805
5008
  options: this.options
4806
- }) : ((g = (m = r.refRule) == null ? void 0 : m.__$title) == null ? void 0 : g.value) + (o.labelSuffix || o["label-suffix"] || "")];
4807
- if (!Y(s.show) && (s.info || s.native) && !Y(s.icon)) {
5009
+ }) : ((m = (g = r.refRule) == null ? void 0 : g.__$title) == null ? void 0 : m.value) + (o.labelSuffix || o["label-suffix"] || "")];
5010
+ if (!Q(s.show) && (s.info || s.native) && !Q(s.icon)) {
4808
5011
  const O = {
4809
5012
  type: s.type || "popover",
4810
5013
  slot: "label",
4811
- props: Ue(s),
5014
+ props: He(s),
4812
5015
  key: `${e}pop`
4813
5016
  };
4814
5017
  delete O.props.icon, delete O.props.show, delete O.props.info, delete O.props.align, delete O.props.native;
@@ -4823,7 +5026,7 @@ const Zi = {
4823
5026
  ]));
4824
5027
  }
4825
5028
  const u = ee([i, {
4826
- props: Ue(i),
5029
+ props: He(i),
4827
5030
  key: `${e}tit`,
4828
5031
  class: "fc-form-title",
4829
5032
  slot: i.slot || "label",
@@ -4851,7 +5054,7 @@ const Zi = {
4851
5054
  },
4852
5055
  makeFormBtn() {
4853
5056
  let t = [];
4854
- if (Y(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Y(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
5057
+ if (Q(this.options.submitBtn.show) || t.push(this.makeSubmitBtn()), Q(this.options.resetBtn.show) || t.push(this.makeResetBtn()), !t.length)
4855
5058
  return;
4856
5059
  const e = this.$r({
4857
5060
  type: "formItem",
@@ -4866,7 +5069,7 @@ const Zi = {
4866
5069
  }, [e]);
4867
5070
  },
4868
5071
  makeResetBtn() {
4869
- const t = b({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
5072
+ const t = v({}, this.options.resetBtn), e = t.innerText || this.$handle.api.t("reset") || "重置";
4870
5073
  return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
4871
5074
  type: "button",
4872
5075
  props: t,
@@ -4882,7 +5085,7 @@ const Zi = {
4882
5085
  }, [e]);
4883
5086
  },
4884
5087
  makeSubmitBtn() {
4885
- const t = b({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
5088
+ const t = v({}, this.options.submitBtn), e = t.innerText || this.$handle.api.t("submit") || "提交";
4886
5089
  return delete t.innerText, delete t.click, delete t.col, delete t.show, this.$r({
4887
5090
  type: "button",
4888
5091
  props: t,
@@ -4898,35 +5101,35 @@ const Zi = {
4898
5101
  key: `${this.key}b1`
4899
5102
  }, [e]);
4900
5103
  }
4901
- }, fe = {};
4902
- Yi(fe);
4903
- xi(fe);
4904
- en(fe);
4905
- tn(fe);
4906
- rn(fe);
5104
+ }, ce = {};
5105
+ Yi(ce);
5106
+ en(ce);
5107
+ tn(ce);
5108
+ rn(ce);
5109
+ nn(ce);
4907
5110
  function Yi(t) {
4908
5111
  ["group", "tree", "switch", "upload", "autoComplete", "checkbox", "cascader", "colorPicker", "datePicker", "frame", "inputNumber", "radio", "rate"].forEach((e) => {
4909
- t[e] = I(e);
5112
+ t[e] = P(e);
4910
5113
  }), t.auto = t.autoComplete, t.number = t.inputNumber, t.color = t.colorPicker;
4911
5114
  }
4912
- function xi(t) {
5115
+ function en(t) {
4913
5116
  const e = "select", r = "multiple";
4914
- t.selectMultiple = I(e, { [r]: !0 }), t.selectOne = I(e, { [r]: !1 });
5117
+ t.selectMultiple = P(e, { [r]: !0 }), t.selectOne = P(e, { [r]: !1 });
4915
5118
  }
4916
- function en(t) {
5119
+ function tn(t) {
4917
5120
  const e = "tree", r = { treeSelected: "selected", treeChecked: "checked" };
4918
- Object.keys(r).reduce((i, s) => (i[s] = I(e, { type: r[s] }), i), t);
5121
+ Object.keys(r).reduce((i, s) => (i[s] = P(e, { type: r[s] }), i), t);
4919
5122
  }
4920
- function tn(t) {
5123
+ function rn(t) {
4921
5124
  const e = "upload", r = {
4922
5125
  image: ["image", 0],
4923
5126
  file: ["file", 0],
4924
5127
  uploadFileOne: ["file", 1],
4925
5128
  uploadImageOne: ["image", 1]
4926
5129
  };
4927
- Object.keys(r).reduce((i, s) => (i[s] = I(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
5130
+ Object.keys(r).reduce((i, s) => (i[s] = P(e, (n) => n.props({ uploadType: r[s][0], maxLength: r[s][1] })), i), t), t.uploadImage = t.image, t.uploadFile = t.file;
4928
5131
  }
4929
- function rn(t) {
5132
+ function nn(t) {
4930
5133
  const e = {
4931
5134
  frameInputs: ["input", 0],
4932
5135
  frameFiles: ["file", 0],
@@ -4935,12 +5138,12 @@ function rn(t) {
4935
5138
  frameFileOne: ["file", 1],
4936
5139
  frameImageOne: ["image", 1]
4937
5140
  };
4938
- return Object.keys(e).reduce((r, i) => (r[i] = I("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
5141
+ return Object.keys(e).reduce((r, i) => (r[i] = P("frame", (s) => s.props({ type: e[i][0], maxLength: e[i][1] })), r), t), t.frameInput = t.frameInputs, t.frameFile = t.frameFiles, t.frameImage = t.frameImages, t;
4939
5142
  }
4940
5143
  function Ft(t, e) {
4941
5144
  return h.Boolean(t) ? t = { show: t } : !h.Undef(t) && !h.Object(t) && (t = { show: e }), t;
4942
5145
  }
4943
- function nn(t, e) {
5146
+ function sn(t, e) {
4944
5147
  return {
4945
5148
  formEl() {
4946
5149
  return e.$manager.form();
@@ -4953,7 +5156,7 @@ function nn(t, e) {
4953
5156
  validate(r) {
4954
5157
  return new Promise((i, s) => {
4955
5158
  const n = t.children, o = [e.$manager.validate()];
4956
- n.forEach((a) => {
5159
+ n.filter((a) => !a.isScope).forEach((a) => {
4957
5160
  o.push(a.validate());
4958
5161
  }), Promise.all(o).then(() => {
4959
5162
  i(!0), r && r(!0);
@@ -4967,7 +5170,7 @@ function nn(t, e) {
4967
5170
  const o = e.getFieldCtx(r);
4968
5171
  if (!o) return;
4969
5172
  const a = e.subForm[o.id], l = [e.$manager.validateField(o.id)];
4970
- H(a).forEach((u) => {
5173
+ H(a).filter((u) => !u.isScope).forEach((u) => {
4971
5174
  l.push(u.validate());
4972
5175
  }), Promise.all(l).then(() => {
4973
5176
  s(null), i && i(null);
@@ -5025,11 +5228,14 @@ function nn(t, e) {
5025
5228
  },
5026
5229
  submit(r, i) {
5027
5230
  return new Promise((s, n) => {
5028
- t.validate().then(() => {
5029
- let o = t.formData();
5030
- h.Function(r) && F(() => r(o, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(o, t)), e.vm.$emit("submit", o, t), s(o);
5031
- }).catch((...o) => {
5032
- h.Function(i) && F(() => i(t, ...o)), n(...o);
5231
+ (e.options.validateOnSubmit === !1 ? Promise.resolve() : t.validate()).then(() => {
5232
+ let a = t.formData();
5233
+ e.beforeSubmit(a).then(() => {
5234
+ h.Function(r) && F(() => r(a, t)), h.Function(e.options.onSubmit) && F(() => e.options.onSubmit(a, t)), e.vm.$emit("submit", a, t), s(a);
5235
+ }).catch((l) => {
5236
+ });
5237
+ }).catch((...a) => {
5238
+ h.Function(i) && F(() => i(t, ...a)), n(...a);
5033
5239
  });
5034
5240
  });
5035
5241
  }
@@ -5039,14 +5245,14 @@ const Jt = {
5039
5245
  name: "required",
5040
5246
  load(t, e, r) {
5041
5247
  var s, n;
5042
- const i = sn(t.getValue());
5248
+ const i = on(t.getValue());
5043
5249
  if (i.required === !1)
5044
5250
  t.clearProp(), r.clearValidateState([e.field]);
5045
5251
  else {
5046
- const o = b({
5252
+ const o = v({
5047
5253
  required: !0,
5048
- validator(l, u, c) {
5049
- h.empty(u) ? c(o.message) : c();
5254
+ validator(l, u, f) {
5255
+ h.empty(u) ? f(o.message) : f();
5050
5256
  }
5051
5257
  }, i), a = (n = (s = e.__fc__.refRule) == null ? void 0 : s.__$title) == null ? void 0 : n.value;
5052
5258
  if (!o.message)
@@ -5063,25 +5269,25 @@ const Jt = {
5063
5269
  Jt.load(...t);
5064
5270
  }
5065
5271
  };
5066
- function sn(t) {
5272
+ function on(t) {
5067
5273
  return h.Boolean(t) ? { required: t } : h.String(t) ? { message: t } : h.Undef(t) ? { required: !1 } : h.Function(t) ? { validator: t } : h.Object(t) ? t : {};
5068
5274
  }
5069
- function on(t) {
5070
- t.componentAlias(Ki), Mr.forEach((e) => {
5275
+ function an(t) {
5276
+ t.componentAlias(zi), Mr.forEach((e) => {
5071
5277
  t.component(e.name, e);
5072
5278
  }), t.register(Jt), Wi.forEach((e) => {
5073
5279
  t.parser(e);
5074
- }), Object.keys(fe).forEach((e) => {
5075
- t.maker[e] = fe[e];
5280
+ }), Object.keys(ce).forEach((e) => {
5281
+ t.maker[e] = ce[e];
5076
5282
  });
5077
5283
  }
5078
- function an() {
5284
+ function ln() {
5079
5285
  return Gt({
5080
5286
  ui: "element-ui",
5081
- version: "2.7.4",
5082
- manager: Zi,
5083
- extendApi: nn,
5084
- install: on,
5287
+ version: "2.7.6",
5288
+ manager: Qi,
5289
+ extendApi: sn,
5290
+ install: an,
5085
5291
  attrs: {
5086
5292
  normal: ["col", "wrap"],
5087
5293
  array: ["className"],
@@ -5089,10 +5295,10 @@ function an() {
5089
5295
  }
5090
5296
  });
5091
5297
  }
5092
- const ze = an();
5093
- typeof window != "undefined" && (window.formCreate = ze, window.Vue && ze.install(window.Vue));
5094
- const cn = ze.maker;
5298
+ const Xe = ln();
5299
+ typeof window != "undefined" && (window.formCreate = Xe, window.Vue && Xe.install(window.Vue));
5300
+ const cn = Xe.maker;
5095
5301
  export {
5096
- ze as default,
5302
+ Xe as default,
5097
5303
  cn as maker
5098
5304
  };