@form-create/view-design 2.5.8 → 2.5.12

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,5 +1,5 @@
1
1
  /*!
2
- * @form-create/view-design v2.5.8
2
+ * @form-create/view-design v2.5.12
3
3
  * (c) 2018-2021 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -255,17 +255,9 @@
255
255
  var Checkbox = {
256
256
  name: NAME,
257
257
  props: {
258
- formCreateRule: {
258
+ formCreateInject: {
259
259
  type: Object,
260
- "default": function _default() {
261
- return {};
262
- }
263
- },
264
- formCreateOptions: {
265
- type: Array,
266
- "default": function _default() {
267
- return [];
268
- }
260
+ required: true
269
261
  },
270
262
  value: {
271
263
  type: Array,
@@ -284,9 +276,15 @@
284
276
  trueValue: []
285
277
  };
286
278
  },
279
+ computed: {
280
+ options: function options() {
281
+ var opt = this.formCreateInject.options;
282
+ return Array.isArray(opt) ? opt : [];
283
+ }
284
+ },
287
285
  methods: {
288
286
  onInput: function onInput(n) {
289
- this.$emit('input', this.formCreateOptions.filter(function (opt) {
287
+ this.$emit('input', this.options.filter(function (opt) {
290
288
  return n.indexOf(opt.label) !== -1;
291
289
  }).map(function (opt) {
292
290
  return opt.value;
@@ -297,7 +295,7 @@
297
295
  update: function update() {
298
296
  var _this = this;
299
297
 
300
- this.trueValue = this.value ? this.formCreateOptions.filter(function (opt) {
298
+ this.trueValue = this.value ? this.options.filter(function (opt) {
301
299
  return _this.value.indexOf(opt.value) !== -1;
302
300
  }).map(function (option) {
303
301
  return option.label;
@@ -309,14 +307,14 @@
309
307
  },
310
308
  render: function render() {
311
309
  var h = arguments[0];
312
- return h("CheckboxGroup", helper([{}, this.formCreateRule, {
310
+ return h("CheckboxGroup", helper([{}, this.formCreateInject.prop, {
313
311
  "attrs": {
314
312
  "value": this.trueValue
315
313
  },
316
314
  "on": {
317
315
  "input": this.onInput
318
316
  }
319
- }]), [this.formCreateOptions.map(function (opt, index) {
317
+ }]), [this.options.map(function (opt, index) {
320
318
  var props = _objectSpread2({}, opt);
321
319
 
322
320
  delete props.value;
@@ -369,7 +367,10 @@
369
367
  return {
370
368
  name: NAME$1,
371
369
  props: {
372
- formCreateField: String,
370
+ formCreateInject: {
371
+ type: Object,
372
+ required: true
373
+ },
373
374
  type: {
374
375
  type: String,
375
376
  "default": 'input'
@@ -559,7 +560,7 @@
559
560
  }, _toConsumableArray(children));
560
561
  },
561
562
  valid: function valid(f) {
562
- var field = this.formCreateField || this.field;
563
+ var field = this.formCreateInject.field || this.field;
563
564
  if (field && f !== field) throw new Error('[frame]无效的字段值');
564
565
  },
565
566
  makeIcons: function makeIcons(val, index) {
@@ -660,7 +661,6 @@
660
661
  }]))]);
661
662
  },
662
663
  handleClick: function handleClick(src) {
663
- if (this.disabled) return;
664
664
  return this.onHandle(src);
665
665
  },
666
666
  handleRemove: function handleRemove(src) {
@@ -830,17 +830,9 @@
830
830
  var Radio = {
831
831
  name: NAME$2,
832
832
  props: {
833
- formCreateRule: {
833
+ formCreateInject: {
834
834
  type: Object,
835
- "default": function _default() {
836
- return {};
837
- }
838
- },
839
- formCreateOptions: {
840
- type: Array,
841
- "default": function _default() {
842
- return [];
843
- }
835
+ required: true
844
836
  },
845
837
  value: {}
846
838
  },
@@ -854,9 +846,15 @@
854
846
  trueValue: []
855
847
  };
856
848
  },
849
+ computed: {
850
+ options: function options() {
851
+ var opt = this.formCreateInject.options;
852
+ return Array.isArray(opt) ? opt : [];
853
+ }
854
+ },
857
855
  methods: {
858
856
  onInput: function onInput(n) {
859
- this.$emit('input', this.formCreateOptions.filter(function (opt) {
857
+ this.$emit('input', this.options.filter(function (opt) {
860
858
  return opt.label === n;
861
859
  }).reduce(function (initial, opt) {
862
860
  return opt.value;
@@ -865,7 +863,7 @@
865
863
  update: function update() {
866
864
  var _this = this;
867
865
 
868
- this.trueValue = this.formCreateOptions.filter(function (opt) {
866
+ this.trueValue = this.options.filter(function (opt) {
869
867
  return opt.value === _this.value;
870
868
  }).reduce(function (initial, opt) {
871
869
  return opt.label;
@@ -877,14 +875,14 @@
877
875
  },
878
876
  render: function render() {
879
877
  var h = arguments[0];
880
- return h("RadioGroup", helper([{}, this.formCreateRule, {
878
+ return h("RadioGroup", helper([{}, this.formCreateInject.prop, {
881
879
  "attrs": {
882
880
  "value": this.trueValue
883
881
  },
884
882
  "on": {
885
883
  "input": this.onInput
886
884
  }
887
- }]), [this.formCreateOptions.map(function (opt, index) {
885
+ }]), [this.options.map(function (opt, index) {
888
886
  var props = _objectSpread2({}, opt);
889
887
 
890
888
  delete props.value;
@@ -924,15 +922,14 @@
924
922
  name: NAME$3,
925
923
  functional: true,
926
924
  props: {
927
- formCreateOptions: {
928
- type: Array,
929
- "default": function _default() {
930
- return [];
931
- }
925
+ formCreateInject: {
926
+ type: Object,
927
+ required: true
932
928
  }
933
929
  },
934
930
  render: function render(h, ctx) {
935
- return h("Select", helper([{}, ctx.data]), [ctx.props.formCreateOptions.map(function (props, index) {
931
+ var options = ctx.props.formCreateInject.options;
932
+ return h("Select", helper([{}, ctx.data]), [(Array.isArray(options) ? options : []).map(function (props, index) {
936
933
  var slot = props.slot;
937
934
  return h("Option", {
938
935
  "props": _objectSpread2({}, props),
@@ -948,13 +945,9 @@
948
945
  var Tree = {
949
946
  name: NAME$4,
950
947
  props: {
951
- formCreateRule: {
948
+ formCreateInject: {
952
949
  type: Object,
953
- "default": function _default() {
954
- return {
955
- props: {}
956
- };
957
- }
950
+ required: true
958
951
  },
959
952
  type: {
960
953
  type: String,
@@ -983,7 +976,7 @@
983
976
  methods: {
984
977
  setStatus: function setStatus(value) {
985
978
  var n = toArray(value);
986
- var data = this.formCreateRule.props.data;
979
+ var data = this.formCreateInject.prop.props.data;
987
980
  this.type === 'selected' ? this.checked(data, n, 'selected') : this.checked(data, n, 'checked');
988
981
  this.$forceUpdate();
989
982
  },
@@ -1012,14 +1005,11 @@
1012
1005
  on['on-check-change'] = this.onInput;
1013
1006
  }
1014
1007
 
1015
- return h("Tree", helper([{}, this.formCreateRule, {
1008
+ return h("Tree", helper([{}, this.formCreateInject.prop, {
1016
1009
  "ref": "tree"
1017
1010
  }, {
1018
1011
  "on": on
1019
1012
  }]), [getSlot(this.$slots)]);
1020
- },
1021
- mounted: function mounted() {
1022
- this.onInput(this.type === 'selected' ? this.$refs.tree.getSelectedNodes() : this.$refs.tree.getCheckedNodes());
1023
1013
  }
1024
1014
  };
1025
1015
 
@@ -1042,13 +1032,9 @@
1042
1032
  return {
1043
1033
  name: NAME$5,
1044
1034
  props: {
1045
- formCreateRule: {
1035
+ formCreateInject: {
1046
1036
  type: Object,
1047
- "default": function _default() {
1048
- return {
1049
- props: {}
1050
- };
1051
- }
1037
+ required: true
1052
1038
  },
1053
1039
  onHandle: {
1054
1040
  type: Function,
@@ -1086,8 +1072,8 @@
1086
1072
  };
1087
1073
  },
1088
1074
  created: function created() {
1089
- if (this.formCreateRule.props.showUploadList === undefined) this.formCreateRule.props.showUploadList = false;
1090
- this.formCreateRule.props.defaultFileList = toArray(this.value).map(parseFile);
1075
+ if (this.formCreateInject.prop.props.showUploadList === undefined) this.formCreateInject.prop.props.showUploadList = false;
1076
+ this.formCreateInject.prop.props.defaultFileList = toArray(this.value).map(parseFile);
1091
1077
  },
1092
1078
  watch: {
1093
1079
  value: function value(n) {
@@ -1107,14 +1093,13 @@
1107
1093
  return unique;
1108
1094
  },
1109
1095
  isDisabled: function isDisabled() {
1110
- return this.formCreateRule.props.disabled === true;
1096
+ return this.formCreateInject.prop.props.disabled === true;
1111
1097
  },
1112
1098
  onRemove: function onRemove(file) {
1113
1099
  if (this.isDisabled()) return;
1114
1100
  this.$refs.upload.handleRemove(file);
1115
1101
  },
1116
1102
  handleClick: function handleClick(file) {
1117
- if (this.isDisabled()) return;
1118
1103
  this.onHandle(file);
1119
1104
  },
1120
1105
  makeItem: function makeItem(file, index) {
@@ -1207,7 +1192,7 @@
1207
1192
  makeUpload: function makeUpload() {
1208
1193
  var h = this.$createElement;
1209
1194
  var isShow = !this.maxLength || this.maxLength > this.uploadList.length;
1210
- return h("Upload", helper([{}, this.formCreateRule, {
1195
+ return h("Upload", helper([{}, this.formCreateInject.prop, {
1211
1196
  "ref": "upload",
1212
1197
  "style": {
1213
1198
  display: 'inline-block'
@@ -1242,13 +1227,13 @@
1242
1227
  var h = arguments[0];
1243
1228
 
1244
1229
  if (this.$refs.upload) {
1245
- if (this.formCreateRule.props.showUploadList === undefined) this.formCreateRule.props.showUploadList = this.$refs.upload.showUploadList;
1246
- this.formCreateRule.props.defaultFileList = this.$refs.upload.defaultFileList;
1230
+ if (this.formCreateInject.prop.props.showUploadList === undefined) this.formCreateInject.prop.props.showUploadList = this.$refs.upload.showUploadList;
1231
+ this.formCreateInject.prop.props.defaultFileList = this.$refs.upload.defaultFileList;
1247
1232
  }
1248
1233
 
1249
1234
  return h("div", {
1250
1235
  "class": "_fc-upload"
1251
- }, [[this.formCreateRule.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], h("Modal", {
1236
+ }, [[this.formCreateInject.prop.props.showUploadList ? [] : this.makeFiles(), this.makeUpload()], h("Modal", {
1252
1237
  "attrs": {
1253
1238
  "title": this.modalTitle,
1254
1239
  "footerHide": true
@@ -1301,7 +1286,10 @@
1301
1286
  rules: Array,
1302
1287
  expand: Number,
1303
1288
  options: Object,
1304
- formCreate: Object,
1289
+ formCreateInject: {
1290
+ type: Object,
1291
+ required: true
1292
+ },
1305
1293
  button: {
1306
1294
  type: Boolean,
1307
1295
  "default": true
@@ -1345,7 +1333,8 @@
1345
1333
  return {
1346
1334
  len: 0,
1347
1335
  cacheRule: {},
1348
- cacheValue: {}
1336
+ cacheValue: {},
1337
+ type: undefined
1349
1338
  };
1350
1339
  },
1351
1340
  computed: {
@@ -1459,7 +1448,7 @@
1459
1448
  addRule: function addRule(i, emit) {
1460
1449
  var _this3 = this;
1461
1450
 
1462
- var rule = this.$formCreate.copyRules(this.formRule);
1451
+ var rule = this.formCreateInject.form.copyRules(this.formRule);
1463
1452
  var options = this.options ? _objectSpread2({}, this.options) : {
1464
1453
  submitBtn: false,
1465
1454
  resetBtn: false
@@ -1492,7 +1481,7 @@
1492
1481
  subForm: function subForm() {
1493
1482
  var _this5 = this;
1494
1483
 
1495
- this.$emit('fc.sub-form', Object.keys(this.cacheRule).map(function (k) {
1484
+ this.formCreateInject.subForm(Object.keys(this.cacheRule).map(function (k) {
1496
1485
  return _this5.cacheRule[k].$f;
1497
1486
  }));
1498
1487
  },
@@ -1517,7 +1506,7 @@
1517
1506
  this.addRule(i, true);
1518
1507
  },
1519
1508
  del: function del(index, key) {
1520
- if (this.disabled || false === this.onBeforeRemove(this.value)) {
1509
+ if (this.disabled || false === this.onBeforeRemove(this.value, index)) {
1521
1510
  return;
1522
1511
  }
1523
1512
 
@@ -1590,6 +1579,7 @@
1590
1579
  }
1591
1580
  },
1592
1581
  created: function created() {
1582
+ this.type = this.formCreateInject.form.$form();
1593
1583
  var d = (this.expand || 0) - this.value.length;
1594
1584
 
1595
1585
  if (d > 0) {
@@ -1606,6 +1596,7 @@
1606
1596
  var h = arguments[0];
1607
1597
  var keys = Object.keys(this.cacheRule);
1608
1598
  var button = this.button;
1599
+ var Type = this.type;
1609
1600
  return keys.length === 0 ? this.$scopedSlots["default"] ? this.$scopedSlots["default"]({
1610
1601
  vm: this,
1611
1602
  add: this.add
@@ -1635,7 +1626,7 @@
1635
1626
  "attrs": {
1636
1627
  "span": button ? 20 : 24
1637
1628
  }
1638
- }, [h("FormItem", [h("FormCreate", helper([{
1629
+ }, [h("FormItem", [h(Type, helper([{
1639
1630
  "key": key
1640
1631
  }, {
1641
1632
  "on": {
@@ -1686,7 +1677,10 @@
1686
1677
  props: {
1687
1678
  rule: Array,
1688
1679
  options: Object,
1689
- formCreate: Object,
1680
+ formCreateInject: {
1681
+ type: Object,
1682
+ required: true
1683
+ },
1690
1684
  value: {
1691
1685
  type: Object,
1692
1686
  "default": function _default() {
@@ -1696,17 +1690,22 @@
1696
1690
  disabled: {
1697
1691
  type: Boolean,
1698
1692
  "default": false
1693
+ },
1694
+ syncDisabled: {
1695
+ type: Boolean,
1696
+ "default": true
1699
1697
  }
1700
1698
  },
1701
1699
  data: function data() {
1702
1700
  return {
1703
1701
  cacheRule: {},
1704
- cacheValue: {}
1702
+ cacheValue: {},
1703
+ type: undefined
1705
1704
  };
1706
1705
  },
1707
1706
  watch: {
1708
1707
  disabled: function disabled(n) {
1709
- this.cacheRule.$f.disabled(n);
1708
+ this.syncDisabled && this.cacheRule.$f.disabled(n);
1710
1709
  },
1711
1710
  value: function value(n) {
1712
1711
  this.setValue(n);
@@ -1745,13 +1744,13 @@
1745
1744
  this.cacheRule.$f = $f;
1746
1745
  this.subForm();
1747
1746
  this.$nextTick(function () {
1748
- $f.disabled(_this.disabled);
1747
+ _this.syncDisabled && $f.disabled(_this.disabled);
1749
1748
 
1750
1749
  _this.$emit('itemMounted', $f);
1751
1750
  });
1752
1751
  },
1753
1752
  subForm: function subForm() {
1754
- this.$emit('fc.sub-form', this.cacheRule.$f);
1753
+ this.formCreateInject.subForm(this.cacheRule.$f);
1755
1754
  },
1756
1755
  emitEvent: function emitEvent(name) {
1757
1756
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -1763,13 +1762,15 @@
1763
1762
  },
1764
1763
  created: function created() {
1765
1764
  this.addRule();
1765
+ this.type = this.formCreateInject.form.$form();
1766
1766
  },
1767
1767
  render: function render() {
1768
1768
  var h = arguments[0];
1769
1769
  var _this$cacheRule = this.cacheRule,
1770
1770
  rule = _this$cacheRule.rule,
1771
1771
  options = _this$cacheRule.options;
1772
- return h("FormCreate", helper([{}, {
1772
+ var Type = this.type;
1773
+ return h(Type, helper([{}, {
1773
1774
  "on": {
1774
1775
  'update:value': this.formData,
1775
1776
  'emit-event': this.emitEvent,
@@ -1850,6 +1851,7 @@
1850
1851
  isShow: true,
1851
1852
  unique: 1,
1852
1853
  renderRule: _toConsumableArray(this.rule || []),
1854
+ ctxInject: {},
1853
1855
  updateValue: ''
1854
1856
  };
1855
1857
  },
@@ -1900,10 +1902,8 @@
1900
1902
 
1901
1903
  var _this$$options$propsD = this.$options.propsData,
1902
1904
  rule = _this$$options$propsD.rule,
1903
- option = _this$$options$propsD.option,
1904
- value = _this$$options$propsD.value;
1905
+ option = _this$$options$propsD.option;
1905
1906
  this.formCreate = new FormCreate(this, rule, option);
1906
- extend(this.formCreate.options.formData, value || {});
1907
1907
  Object.keys(this.formCreate.prop).forEach(function (k) {
1908
1908
  extend(_this2.$options[k], _this2.formCreate.prop[k]);
1909
1909
  });
@@ -1982,7 +1982,7 @@
1982
1982
 
1983
1983
  var keyAttrs = ['type', 'slot', 'emitPrefix', 'value', 'name', 'native', 'hidden', 'display', 'inject', 'options', 'emit', 'nativeEmit', 'link', 'prefix', 'suffix', 'update', 'sync', 'optionsTo', 'key'];
1984
1984
  var arrayAttrs = ['validate', 'children', 'control'];
1985
- var normalAttrs = ['effect'];
1985
+ var normalAttrs = ['effect', 'deep'];
1986
1986
  function attrs() {
1987
1987
  return [].concat(keyAttrs, _toConsumableArray(normalMerge$1), _toConsumableArray(toArrayMerge$1), _toConsumableArray(functionalMerge$1), arrayAttrs, normalAttrs);
1988
1988
  }
@@ -2015,6 +2015,12 @@
2015
2015
  }
2016
2016
 
2017
2017
  origin[key] = deepExtend(origin[key], clone, mode);
2018
+ } else if (is.Undef(clone)) {
2019
+ $set(origin, key, clone);
2020
+ } else if (clone.__json !== undefined) {
2021
+ $set(origin, key, clone.__json);
2022
+ } else if (clone.__origin !== undefined) {
2023
+ $set(origin, key, clone.__origin);
2018
2024
  } else {
2019
2025
  $set(origin, key, clone);
2020
2026
  }
@@ -2048,6 +2054,7 @@
2048
2054
  var PREFIX = '[[FORM-CREATE-PREFIX-';
2049
2055
  var SUFFIX = '-FORM-CREATE-SUFFIX]]';
2050
2056
  var $T = '$FN:';
2057
+ var $TX = '$FNX:';
2051
2058
  var FUNCTION = 'function';
2052
2059
  function toJson(obj, space) {
2053
2060
  return JSON.stringify(deepExtend([], obj, true), function (key, val) {
@@ -2057,7 +2064,11 @@
2057
2064
  return val;
2058
2065
  }
2059
2066
 
2060
- if (val.__inject) val = val.__origin;
2067
+ if (hasProperty(val, '__json')) {
2068
+ return val.__json;
2069
+ }
2070
+
2071
+ if (val.__origin) val = val.__origin;
2061
2072
  if (val.__emit) return undefined;
2062
2073
  return PREFIX + val + SUFFIX;
2063
2074
  }, space);
@@ -2068,26 +2079,32 @@
2068
2079
  }
2069
2080
 
2070
2081
  function parseFn(fn, mode) {
2071
- if (fn && is.String(fn)) {
2082
+ if (fn && is.String(fn) && fn.length > 4) {
2072
2083
  var v = fn.trim();
2073
2084
  var flag = false;
2074
2085
 
2075
- if (v.indexOf(SUFFIX) > 0 && v.indexOf(PREFIX) === 0) {
2076
- v = v.replace(SUFFIX, '').replace(PREFIX, '');
2077
- flag = true;
2078
- } else if (v.indexOf($T) === 0) {
2079
- v = v.replace($T, '');
2080
- flag = true;
2081
- } else if (!mode && v.indexOf(FUNCTION) === 0 && v !== FUNCTION) {
2082
- flag = true;
2083
- }
2084
-
2085
- if (!flag) return fn;
2086
-
2087
2086
  try {
2088
- return makeFn(v.indexOf(FUNCTION) === -1 && v.indexOf('(') !== 0 ? FUNCTION + ' ' + v : v);
2087
+ if (v.indexOf(SUFFIX) > 0 && v.indexOf(PREFIX) === 0) {
2088
+ v = v.replace(SUFFIX, '').replace(PREFIX, '');
2089
+ flag = true;
2090
+ } else if (v.indexOf($T) === 0) {
2091
+ v = v.replace($T, '');
2092
+ flag = true;
2093
+ } else if (v.indexOf($TX) === 0) {
2094
+ v = makeFn('function($inject){' + v.replace($TX, '') + '}');
2095
+ v.__json = fn;
2096
+ v.__inject = true;
2097
+ return v;
2098
+ } else if (!mode && v.indexOf(FUNCTION) === 0 && v !== FUNCTION) {
2099
+ flag = true;
2100
+ }
2101
+
2102
+ if (!flag) return fn;
2103
+ var val = makeFn(v.indexOf(FUNCTION) === -1 && v.indexOf('(') !== 0 ? FUNCTION + ' ' + v : v);
2104
+ val.__json = fn;
2105
+ return val;
2089
2106
  } catch (e) {
2090
- err("\u89E3\u6790\u5931\u8D25:".concat(v));
2107
+ err("\u89E3\u6790\u5931\u8D25:".concat(v, "\n\nerr: ").concat(e));
2091
2108
  return undefined;
2092
2109
  }
2093
2110
  }
@@ -2100,6 +2117,7 @@
2100
2117
  return parseFn(v, mode);
2101
2118
  });
2102
2119
  }
2120
+
2103
2121
  function enumerable(value, writable) {
2104
2122
  return {
2105
2123
  value: value,
@@ -2177,7 +2195,7 @@
2177
2195
  to;
2178
2196
  (idx || '').split('.').forEach(function (v) {
2179
2197
  if (to) {
2180
- if (!_data[to]) {
2198
+ if (!_data[to] || _typeof(_data[to]) != 'object') {
2181
2199
  _data[to] = {};
2182
2200
  }
2183
2201
 
@@ -2275,13 +2293,6 @@
2275
2293
  return deepCopy(value);
2276
2294
  }
2277
2295
 
2278
- function byRules(ctxs, origin) {
2279
- return Object.keys(ctxs).reduce(function (initial, key) {
2280
- initial[key] = origin ? ctxs[key].origin : ctxs[key].rule;
2281
- return initial;
2282
- }, {});
2283
- }
2284
-
2285
2296
  function Api(h) {
2286
2297
  function tidyFields(fields) {
2287
2298
  if (is.Undef(fields)) fields = h.fields();else if (!Array.isArray(fields)) fields = [fields];
@@ -2290,10 +2301,10 @@
2290
2301
 
2291
2302
  function props(fields, key, val) {
2292
2303
  tidyFields(fields).forEach(function (field) {
2293
- var ctx = h.getCtx(field);
2294
- if (!ctx) return;
2295
- $set(ctx.rule, key, val);
2296
- h.$render.clearCache(ctx);
2304
+ h.getCtxs(field).forEach(function (ctx) {
2305
+ $set(ctx.rule, key, val);
2306
+ h.$render.clearCache(ctx);
2307
+ });
2297
2308
  });
2298
2309
  }
2299
2310
 
@@ -2339,23 +2350,26 @@
2339
2350
 
2340
2351
  formData: function formData(fields) {
2341
2352
  return tidyFields(fields).reduce(function (initial, id) {
2342
- var ctx = h.fieldCtx[id];
2353
+ var ctx = h.getFieldCtx(id);
2343
2354
  if (!ctx) return initial;
2344
2355
  initial[ctx.field] = copy(ctx.rule.value);
2345
2356
  return initial;
2346
- }, {});
2357
+ }, copy(h.appendData));
2347
2358
  },
2348
2359
  getValue: function getValue(field) {
2349
- var ctx = h.fieldCtx[field];
2360
+ var ctx = h.getFieldCtx(field);
2350
2361
  if (!ctx) return;
2351
2362
  return copy(ctx.rule.value);
2352
2363
  },
2353
2364
  coverValue: function coverValue(formData) {
2354
2365
  h.deferSyncValue(function () {
2355
- Object.keys(h.fieldCtx).forEach(function (key) {
2356
- var ctx = h.fieldCtx[key];
2357
- if (!ctx) return h.appendData[key] = formData[key];
2358
- ctx.rule.value = hasProperty(formData, key) ? formData[key] : undefined;
2366
+ api.fields().forEach(function (key) {
2367
+ var ctxs = h.fieldCtx[key];
2368
+ if (!ctxs) return h.appendData[key] = formData[key];
2369
+ var flag = hasProperty(formData, key);
2370
+ ctxs.forEach(function (ctx) {
2371
+ ctx.rule.value = flag ? formData[key] : undefined;
2372
+ });
2359
2373
  });
2360
2374
  });
2361
2375
  },
@@ -2364,17 +2378,22 @@
2364
2378
  if (arguments.length >= 2) formData = _defineProperty({}, field, arguments[1]);
2365
2379
  h.deferSyncValue(function () {
2366
2380
  Object.keys(formData).forEach(function (key) {
2367
- var ctx = h.fieldCtx[key];
2368
- if (!ctx) return h.appendData[key] = formData[key];
2369
- ctx.rule.value = formData[key];
2381
+ var ctxs = h.fieldCtx[key];
2382
+ if (!ctxs) return h.appendData[key] = formData[key];
2383
+ ctxs.forEach(function (ctx) {
2384
+ ctx.rule.value = formData[key];
2385
+ });
2370
2386
  });
2371
2387
  });
2372
2388
  },
2373
2389
  removeField: function removeField(field) {
2374
2390
  var ctx = h.getCtx(field);
2375
- if (!ctx) return;
2376
- ctx.rm();
2377
- return ctx.origin;
2391
+ h.deferSyncValue(function () {
2392
+ h.getCtxs(field).forEach(function (ctx) {
2393
+ ctx.rm();
2394
+ });
2395
+ }, true);
2396
+ return ctx ? ctx.origin : undefined;
2378
2397
  },
2379
2398
  removeRule: function removeRule(rule) {
2380
2399
  var ctx = rule && byCtx(rule);
@@ -2390,10 +2409,8 @@
2390
2409
  return h.fields();
2391
2410
  },
2392
2411
  append: function append(rule, after, child) {
2393
- var fields = Object.keys(h.fieldCtx),
2394
- index = h.sort.length - 1,
2412
+ var index = h.sort.length - 1,
2395
2413
  rules;
2396
- if (rule.field && fields.indexOf(rule.field) > -1) return err("".concat(rule.field, " \u5B57\u6BB5\u5DF2\u5B58\u5728"), rule);
2397
2414
  var ctx = h.getCtx(after);
2398
2415
 
2399
2416
  if (ctx) {
@@ -2409,10 +2426,8 @@
2409
2426
  rules.splice(index + 1, 0, rule);
2410
2427
  },
2411
2428
  prepend: function prepend(rule, after, child) {
2412
- var fields = Object.keys(h.fieldCtx),
2413
- index = 0,
2429
+ var index = 0,
2414
2430
  rules;
2415
- if (rule.field && fields.indexOf(rule.field) > -1) return err("".concat(rule.field, " \u5B57\u6BB5\u5DF2\u5B58\u5728"), rule);
2416
2431
  var ctx = h.getCtx(after);
2417
2432
 
2418
2433
  if (ctx) {
@@ -2446,17 +2461,27 @@
2446
2461
  },
2447
2462
  disabled: function disabled(_disabled, fields) {
2448
2463
  tidyFields(fields).forEach(function (field) {
2449
- var ctx = h.fieldCtx[field];
2450
- if (!ctx) return;
2451
- $set(ctx.rule.props, 'disabled', !!_disabled);
2464
+ h.getCtxs(field).forEach(function (ctx) {
2465
+ $set(ctx.rule.props, 'disabled', !!_disabled);
2466
+ });
2452
2467
  });
2453
2468
  h.refresh();
2454
2469
  },
2455
2470
  model: function model(origin) {
2456
- return byRules(h.fieldCtx, origin);
2471
+ return h.fields().reduce(function (initial, key) {
2472
+ var ctx = h.fieldCtx[key][0];
2473
+ initial[key] = origin ? ctx.origin : ctx.rule;
2474
+ return initial;
2475
+ }, {});
2457
2476
  },
2458
2477
  component: function component(origin) {
2459
- return byRules(h.nameCtx, origin);
2478
+ return Object.keys(h.nameCtx).reduce(function (initial, key) {
2479
+ var ctx = h.nameCtx[key].map(function (ctx) {
2480
+ return origin ? ctx.origin : ctx.rule;
2481
+ });
2482
+ initial[key] = ctx.length === 1 ? ctx[0] : ctx;
2483
+ return initial;
2484
+ }, {});
2460
2485
  },
2461
2486
  bind: function bind() {
2462
2487
  return api.form;
@@ -2474,25 +2499,39 @@
2474
2499
  });
2475
2500
  },
2476
2501
  sync: function sync(field) {
2477
- var ctx = is.Object(field) ? byCtx(field) : h.getCtx(field);
2502
+ if (Array.isArray(field)) {
2503
+ field.forEach(function (v) {
2504
+ return api.sync(v);
2505
+ });
2506
+ return;
2507
+ }
2478
2508
 
2479
- if (ctx && !ctx.deleted) {
2480
- var subForm = h.subForm[field];
2509
+ var ctxs = is.Object(field) ? byCtx(field) : h.getCtxs(field);
2481
2510
 
2482
- if (subForm) {
2483
- if (Array.isArray(subForm)) {
2484
- subForm.forEach(function (form) {
2485
- form.refresh();
2486
- });
2487
- } else if (subForm) {
2488
- subForm.refresh();
2489
- }
2490
- } //ctx.updateKey(true);
2511
+ if (!ctxs) {
2512
+ return;
2513
+ }
2491
2514
 
2515
+ ctxs = Array.isArray(ctxs) ? ctxs : [ctxs];
2516
+ ctxs.forEach(function (ctx) {
2517
+ if (!ctx.deleted) {
2518
+ var subForm = h.subForm[ctx.id];
2519
+
2520
+ if (subForm) {
2521
+ if (Array.isArray(subForm)) {
2522
+ subForm.forEach(function (form) {
2523
+ form.refresh();
2524
+ });
2525
+ } else if (subForm) {
2526
+ subForm.refresh();
2527
+ }
2528
+ } //ctx.updateKey(true);
2492
2529
 
2493
- h.$render.clearCache(ctx);
2494
- h.refresh();
2495
- }
2530
+
2531
+ h.$render.clearCache(ctx);
2532
+ }
2533
+ });
2534
+ h.refresh();
2496
2535
  },
2497
2536
  refresh: function refresh() {
2498
2537
  allSubForm().forEach(function (sub) {
@@ -2515,8 +2554,9 @@
2515
2554
  h.changeStatus = false;
2516
2555
  },
2517
2556
  updateRule: function updateRule(id, rule) {
2518
- var r = api.getRule(id);
2519
- r && extend(r, rule);
2557
+ h.getCtxs(id).forEach(function (ctx) {
2558
+ extend(ctx.rule, rule);
2559
+ });
2520
2560
  },
2521
2561
  updateRules: function updateRules(rules) {
2522
2562
  Object.keys(rules).forEach(function (id) {
@@ -2524,8 +2564,9 @@
2524
2564
  });
2525
2565
  },
2526
2566
  mergeRule: function mergeRule$1(id, rule) {
2527
- var ctx = h.getCtx(id);
2528
- ctx && mergeRule(ctx.rule, rule);
2567
+ h.getCtxs(id).forEach(function (ctx) {
2568
+ mergeRule(ctx.rule, rule);
2569
+ });
2529
2570
  },
2530
2571
  mergeRules: function mergeRules(rules) {
2531
2572
  Object.keys(rules).forEach(function (id) {
@@ -2558,13 +2599,12 @@
2558
2599
  api.refresh();
2559
2600
  },
2560
2601
  resetFields: function resetFields(fields) {
2561
- var ctxs = h.fieldCtx;
2562
2602
  tidyFields(fields).forEach(function (field) {
2563
- var ctx = ctxs[field];
2564
- if (!ctx) return;
2565
- h.$render.clearCache(ctx);
2566
- ctx.rule.value = copy(ctx.defaultValue);
2567
- h.refreshControl(ctx);
2603
+ h.getCtxs(field).forEach(function (ctx) {
2604
+ h.$render.clearCache(ctx);
2605
+ ctx.rule.value = copy(ctx.defaultValue);
2606
+ h.refreshControl(ctx);
2607
+ });
2568
2608
  });
2569
2609
  },
2570
2610
  method: function method(id, name) {
@@ -2604,7 +2644,8 @@
2604
2644
  el && el.$emit && el.$emit('close-modal');
2605
2645
  },
2606
2646
  getSubForm: function getSubForm(field) {
2607
- return h.subForm[field];
2647
+ var ctx = h.getCtx(field);
2648
+ return ctx ? h.subForm[ctx.id] : undefined;
2608
2649
  },
2609
2650
  nextTick: function nextTick(fn) {
2610
2651
  h.bus.$once('next-tick', fn);
@@ -2652,7 +2693,8 @@
2652
2693
  this.cache[ctx.id] = {
2653
2694
  vnode: vnode,
2654
2695
  use: false,
2655
- parent: parent
2696
+ parent: parent,
2697
+ slot: ctx.rule.slot
2656
2698
  };
2657
2699
  },
2658
2700
  getCache: function getCache(ctx) {
@@ -2673,46 +2715,20 @@
2673
2715
  return str.replace(str[0], str[0].toLowerCase());
2674
2716
  }
2675
2717
 
2676
- function setTempProps(vm, ctx, api) {
2677
- if (!vm.$props) return;
2678
- var prop = ctx.prop;
2679
- var keys = Object.keys(vm.$props);
2680
- var inject = injectProp(ctx, api);
2681
- var injectKeys = Object.keys(inject);
2682
- keys.forEach(function (key) {
2683
- if (hasProperty(prop.props, key)) vm.$props[key] = prop.props[key];else if (injectKeys.indexOf(key) > -1) vm.$props[key] = inject[key];
2684
- });
2685
- var key = vm.$options.model && vm.$options.model.prop || 'value';
2686
-
2687
- if (keys.indexOf(key) > -1) {
2688
- vm.$props[key] = prop.value;
2689
- }
2690
- }
2691
-
2692
- function injectProp(ctx, api) {
2693
- return {
2694
- formCreate: api,
2695
- formCreateField: ctx.field,
2696
- formCreateOptions: ctx.prop.options,
2697
- formCreateRule: function () {
2698
- var temp = _objectSpread2({}, ctx.prop);
2699
-
2700
- return temp.on = temp.on ? _objectSpread2({}, temp.on) : {}, temp;
2701
- }()
2702
- };
2703
- }
2704
-
2705
2718
  function useRender(Render) {
2706
2719
  extend(Render.prototype, {
2707
2720
  initRender: function initRender() {
2708
- this.renderList = {};
2721
+ this.tempList = {};
2709
2722
  this.clearOrgChildren();
2710
2723
  },
2711
2724
  initOrgChildren: function initOrgChildren() {
2712
2725
  var ctxs = this.$handle.ctxs;
2713
2726
  this.orgChildren = Object.keys(ctxs).reduce(function (initial, id) {
2714
- var children = ctxs[id].rule.children;
2715
- initial[id] = is.trueArray(children) ? _toConsumableArray(children) : [];
2727
+ if (ctxs[id].parser.loadChildren !== false) {
2728
+ var children = ctxs[id].rule.children;
2729
+ initial[id] = is.trueArray(children) ? _toConsumableArray(children) : [];
2730
+ }
2731
+
2716
2732
  return initial;
2717
2733
  }, {});
2718
2734
  },
@@ -2728,19 +2744,47 @@
2728
2744
 
2729
2745
  this.$h = this.vm.$createElement;
2730
2746
  this.$manager.beforeRender();
2731
- var vn = this.sort.map(function (id) {
2732
- return _this.renderCtx(_this.$handle.ctxs[id]);
2747
+ var vn;
2748
+
2749
+ var make = function make() {
2750
+ return _this.renderList();
2751
+ };
2752
+
2753
+ make.renderSlot = function (slot) {
2754
+ return _this.renderList(slot);
2755
+ };
2756
+
2757
+ make.renderName = function (name) {
2758
+ return _this.renderId(name);
2759
+ };
2760
+
2761
+ make.renderField = function (field) {
2762
+ return _this.renderId(field, 'field');
2763
+ };
2764
+
2765
+ if (this.vm.$scopedSlots.container) {
2766
+ vn = [this.vm.$scopedSlots.container(make)];
2767
+ } else {
2768
+ vn = make();
2769
+ }
2770
+
2771
+ return this.$manager.render(vn);
2772
+ },
2773
+ renderList: function renderList(slot) {
2774
+ var _this2 = this;
2775
+
2776
+ return this.sort.map(function (id) {
2777
+ return slot ? _this2.renderSlot(_this2.$handle.ctxs[id], slot) : _this2.renderCtx(_this2.$handle.ctxs[id]);
2733
2778
  }).filter(function (val) {
2734
2779
  return val !== undefined;
2735
2780
  });
2736
- return this.$manager.render(vn);
2737
2781
  },
2738
2782
  makeVm: function makeVm(rule) {
2739
- var _this2 = this;
2783
+ var _this3 = this;
2740
2784
 
2741
2785
  var vm = rule.vm;
2742
2786
  if (!vm) return new _vue();else if (is.Function(vm)) return invoke(function () {
2743
- return vm(_this2.$handle.getInjectData(rule));
2787
+ return rule.vm(_this3.$handle.getInjectData(rule));
2744
2788
  });else if (!vm._isVue) return new _vue(vm);
2745
2789
  return vm;
2746
2790
  },
@@ -2756,8 +2800,31 @@
2756
2800
  deepSet(ctx.prop, ctx.prop.optionsTo, ctx.prop.options);
2757
2801
  }
2758
2802
  },
2803
+ deepSet: function deepSet$1(ctx) {
2804
+ var deep = ctx.rule.deep;
2805
+ deep && Object.keys(deep).sort(function (a, b) {
2806
+ return a.length < b.length ? -1 : 1;
2807
+ }).forEach(function (str) {
2808
+ deepSet(ctx.prop, str, deep[str]);
2809
+ });
2810
+ },
2811
+ setTempProps: function setTempProps(vm, ctx) {
2812
+ if (!vm.$props) return;
2813
+ var prop = ctx.prop;
2814
+ var keys = Object.keys(vm.$props);
2815
+ var inject = this.injectProp(ctx);
2816
+ var injectKeys = Object.keys(inject);
2817
+ keys.forEach(function (key) {
2818
+ if (hasProperty(prop.props, key)) vm.$props[key] = prop.props[key];else if (injectKeys.indexOf(key) > -1) vm.$props[key] = inject[key];
2819
+ });
2820
+ var key = vm.$options.model && vm.$options.model.prop || 'value';
2821
+
2822
+ if (keys.indexOf(key) > -1) {
2823
+ vm.$props[key] = prop.value;
2824
+ }
2825
+ },
2759
2826
  renderTemp: function renderTemp(ctx) {
2760
- var _this3 = this;
2827
+ var _this4 = this;
2761
2828
 
2762
2829
  if (!_vue.compile) {
2763
2830
  tip('当前使用的Vue构建版本不支持compile,无法使用template功能');
@@ -2768,7 +2835,7 @@
2768
2835
  var id = ctx.id,
2769
2836
  key = ctx.key;
2770
2837
 
2771
- if (!this.renderList[id]) {
2838
+ if (!this.tempList[id]) {
2772
2839
  if (!ctx.el) {
2773
2840
  ctx.el = this.makeVm(rule);
2774
2841
  this.vm.$nextTick(function () {
@@ -2778,18 +2845,18 @@
2778
2845
 
2779
2846
  var _vm = ctx.el;
2780
2847
  if (ctx.input) _vm.$on(_vm.$options.model && _vm.$options.model.event || 'input', function (value) {
2781
- _this3.onInput(ctx, value);
2848
+ _this4.onInput(ctx, value);
2782
2849
  });
2783
- this.renderList[id] = {
2850
+ this.tempList[id] = {
2784
2851
  vm: _vm,
2785
2852
  template: _vue.compile(rule.template)
2786
2853
  };
2787
2854
  }
2788
2855
 
2789
- var _this$renderList$id = this.renderList[id],
2790
- vm = _this$renderList$id.vm,
2791
- template = _this$renderList$id.template;
2792
- setTempProps(vm, ctx, this.$handle.api);
2856
+ var _this$tempList$id = this.tempList[id],
2857
+ vm = _this$tempList$id.vm,
2858
+ template = _this$tempList$id.template;
2859
+ this.setTempProps(vm, ctx);
2793
2860
  var vn = template.render.call(vm);
2794
2861
  if (is.Undef(vn.data)) vn.data = {};
2795
2862
  vn.key = key;
@@ -2797,20 +2864,35 @@
2797
2864
  vn.data.key = key;
2798
2865
  return vn;
2799
2866
  },
2867
+ parseSide: function parseSide(side) {
2868
+ return is.Object(side) ? mergeRule({}, side) : side;
2869
+ },
2800
2870
  renderSides: function renderSides(vn, ctx, temp) {
2801
2871
  var prop = ctx[temp ? 'rule' : 'prop'];
2802
- return [this.renderRule(prop.prefix), vn, this.renderRule(prop.suffix)];
2872
+ return [this.renderRule(this.parseSide(prop.prefix)), vn, this.renderRule(this.parseSide(prop.suffix))];
2873
+ },
2874
+ renderSlot: function renderSlot(ctx, slot) {
2875
+ return ctx.rule.slot === slot ? this.renderCtx(ctx) : undefined;
2876
+ },
2877
+ renderId: function renderId(name, type) {
2878
+ var _this5 = this;
2879
+
2880
+ var ctxs = this.$handle[type === 'field' ? 'fieldCtx' : 'nameCtx'][name];
2881
+ return ctxs ? ctxs.map(function (ctx) {
2882
+ return _this5.renderCtx(ctx, ctx.parent);
2883
+ }) : undefined;
2803
2884
  },
2804
2885
  renderCtx: function renderCtx(ctx, parent) {
2805
2886
  if (ctx.type === 'hidden') return;
2887
+ var rule = ctx.rule;
2806
2888
 
2807
- if (!this.cache[ctx.id]) {
2889
+ if (!this.cache[ctx.id] || this.cache[ctx.id].slot !== rule.slot) {
2808
2890
  var vn;
2809
2891
  var cacheFlag = true;
2810
2892
  var _type = ctx.trueType;
2811
- var none = !(is.Undef(ctx.rule.display) || !!ctx.rule.display);
2893
+ var none = !(is.Undef(rule.display) || !!rule.display);
2812
2894
 
2813
- if (_type === 'template' && !ctx.rule.template) {
2895
+ if (_type === 'template' && !rule.template) {
2814
2896
  vn = this.renderSides(this.renderChildren(ctx), ctx, true);
2815
2897
 
2816
2898
  if (none) {
@@ -2824,9 +2906,11 @@
2824
2906
  ctx.initProp();
2825
2907
  this.mergeGlobal(ctx);
2826
2908
  this.$manager.tidyRule(ctx);
2909
+ this.deepSet(ctx);
2827
2910
  this.setOptions(ctx);
2828
2911
  this.ctxProp(ctx);
2829
2912
  var prop = ctx.prop;
2913
+ prop.props.formCreateInject = this.injectProp(ctx);
2830
2914
 
2831
2915
  if (prop.hidden) {
2832
2916
  this.setCache(ctx, undefined, parent);
@@ -2837,7 +2921,27 @@
2837
2921
  vn = this.renderTemp(ctx);
2838
2922
  cacheFlag = false;
2839
2923
  } else {
2840
- vn = ctx.parser.render(this.renderChildren(ctx), ctx);
2924
+ var children = [];
2925
+
2926
+ if (ctx.parser.renderChildren) {
2927
+ children = ctx.parser.renderChildren(ctx);
2928
+ } else if (ctx.parser.loadChildren !== false) {
2929
+ children = this.renderChildren(ctx);
2930
+ }
2931
+
2932
+ var slot = 'type-' + toLine(ctx.type);
2933
+
2934
+ if (this.vm.$scopedSlots[slot]) {
2935
+ vn = this.vm.$scopedSlots[slot]({
2936
+ rule: rule,
2937
+ prop: prop,
2938
+ children: children,
2939
+ api: this.$handle.api,
2940
+ model: prop.model || {}
2941
+ });
2942
+ } else {
2943
+ vn = ctx.parser.render(children, ctx);
2944
+ }
2841
2945
  }
2842
2946
 
2843
2947
  vn = this.renderSides(vn, ctx);
@@ -2863,13 +2967,13 @@
2863
2967
  return this.getCache(ctx);
2864
2968
  },
2865
2969
  display: function display(vn) {
2866
- var _this4 = this;
2970
+ var _this6 = this;
2867
2971
 
2868
2972
  if (Array.isArray(vn)) {
2869
2973
  var data = [];
2870
2974
  vn.forEach(function (v) {
2871
- if (Array.isArray(v)) return _this4.display(v);
2872
- if (_this4.none(v)) data.push(v);
2975
+ if (Array.isArray(v)) return _this6.display(v);
2976
+ if (_this6.none(v)) data.push(v);
2873
2977
  });
2874
2978
  return data;
2875
2979
  } else {
@@ -2897,8 +3001,36 @@
2897
3001
  key: ctx.key
2898
3002
  }, [vn]);
2899
3003
  },
3004
+ injectProp: function injectProp(ctx) {
3005
+ var _this7 = this;
3006
+
3007
+ if (!this.vm.ctxInject[ctx.id]) {
3008
+ $set(this.vm.ctxInject, ctx.id, {});
3009
+ }
3010
+
3011
+ var inject = this.vm.ctxInject[ctx.id];
3012
+ extend(inject, {
3013
+ api: this.$handle.api,
3014
+ form: this.fc.create,
3015
+ subForm: function subForm(_subForm) {
3016
+ _this7.$handle.addSubForm(ctx, _subForm);
3017
+ },
3018
+ field: ctx.field,
3019
+ options: ctx.prop.options,
3020
+ children: ctx.rule.children,
3021
+ rule: ctx.rule,
3022
+ prop: function () {
3023
+ var temp = _objectSpread2({}, ctx.prop);
3024
+
3025
+ temp.on = temp.on ? _objectSpread2({}, temp.on) : {};
3026
+ delete temp.model;
3027
+ return temp;
3028
+ }()
3029
+ });
3030
+ return inject;
3031
+ },
2900
3032
  ctxProp: function ctxProp(ctx, custom) {
2901
- var _this5 = this;
3033
+ var _this8 = this;
2902
3034
 
2903
3035
  var ref = ctx.ref,
2904
3036
  key = ctx.key,
@@ -2906,29 +3038,28 @@
2906
3038
  this.$manager.mergeProp(ctx, custom);
2907
3039
  ctx.parser.mergeProp(ctx, custom);
2908
3040
  var props = [{
2909
- props: injectProp(ctx, this.$handle.api),
2910
3041
  ref: ref,
2911
3042
  key: rule.key || "".concat(key, "fc"),
2912
- slot: undefined
3043
+ slot: undefined,
3044
+ on: {
3045
+ 'hook:mounted': function hookMounted() {
3046
+ _this8.onMounted(ctx);
3047
+ },
3048
+ 'fc.sub-form': function fcSubForm(subForm) {
3049
+ _this8.$handle.addSubForm(ctx, subForm);
3050
+ }
3051
+ }
2913
3052
  }];
2914
3053
 
2915
- if (!custom) {
3054
+ if (!custom && ctx.input) {
2916
3055
  props.push({
2917
- on: {
2918
- 'hook:mounted': function hookMounted() {
2919
- _this5.onMounted(ctx);
2920
- },
2921
- 'fc.sub-form': function fcSubForm(subForm) {
2922
- _this5.$handle.addSubForm(ctx, subForm);
2923
- }
2924
- },
2925
- model: ctx.input ? {
3056
+ model: {
2926
3057
  value: this.$handle.getFormData(ctx),
2927
3058
  callback: function callback(value) {
2928
- _this5.onInput(ctx, value);
3059
+ _this8.onInput(ctx, value);
2929
3060
  },
2930
- expression: "formData.".concat(ctx.field)
2931
- } : undefined
3061
+ expression: "formData.".concat(ctx.id)
3062
+ }
2932
3063
  });
2933
3064
  }
2934
3065
 
@@ -2937,6 +3068,11 @@
2937
3068
  },
2938
3069
  onMounted: function onMounted(ctx) {
2939
3070
  ctx.el = this.vm.$refs[ctx.ref];
3071
+
3072
+ if (ctx.el) {
3073
+ (ctx.el.$el || ctx.el).__rule__ = ctx.rule;
3074
+ }
3075
+
2940
3076
  ctx.parser.mounted(ctx);
2941
3077
  this.$handle.effect(ctx, 'mounted');
2942
3078
  },
@@ -2944,13 +3080,13 @@
2944
3080
  this.$handle.onInput(ctx, value);
2945
3081
  },
2946
3082
  renderChildren: function renderChildren(ctx) {
2947
- var _this6 = this;
3083
+ var _this9 = this;
2948
3084
 
2949
3085
  var children = ctx.rule.children,
2950
3086
  orgChildren = this.orgChildren[ctx.id];
2951
3087
 
2952
3088
  var isRm = function isRm(child) {
2953
- return !is.String(child) && child.__fc__ && !_this6.$handle.ctxs[child.__fc__.id];
3089
+ return !is.String(child) && child.__fc__ && !_this9.$handle.ctxs[child.__fc__.id];
2954
3090
  };
2955
3091
 
2956
3092
  if (!is.trueArray(children) && orgChildren) {
@@ -2959,7 +3095,7 @@
2959
3095
  if (!child) return;
2960
3096
 
2961
3097
  if (isRm(child)) {
2962
- _this6.$handle.rmCtx(child.__fc__);
3098
+ _this9.$handle.rmCtx(child.__fc__);
2963
3099
  }
2964
3100
  });
2965
3101
  });
@@ -2972,7 +3108,7 @@
2972
3108
  if (!child) return;
2973
3109
 
2974
3110
  if (children.indexOf(child) === -1 && isRm(child)) {
2975
- _this6.$handle.rmCtx(child.__fc__);
3111
+ _this9.$handle.rmCtx(child.__fc__);
2976
3112
  }
2977
3113
  });
2978
3114
  });
@@ -2981,14 +3117,14 @@
2981
3117
  if (is.String(child)) return child;
2982
3118
 
2983
3119
  if (child.__fc__) {
2984
- return _this6.renderCtx(child.__fc__, ctx);
3120
+ return _this9.renderCtx(child.__fc__, ctx);
2985
3121
  }
2986
3122
 
2987
- if (!_this6.$handle.isRepeatRule(child.__origin__ || child) && child.type) {
2988
- _this6.vm.$nextTick(function () {
2989
- _this6.$handle.loadChildren(children, ctx);
3123
+ if (child.type) {
3124
+ _this9.vm.$nextTick(function () {
3125
+ _this9.$handle.loadChildren(children, ctx);
2990
3126
 
2991
- _this6.$handle.refresh();
3127
+ _this9.$handle.refresh();
2992
3128
  });
2993
3129
  }
2994
3130
  });
@@ -3000,7 +3136,7 @@
3000
3136
  return this.vNode.make(lower(ctx.originType), prop, children);
3001
3137
  },
3002
3138
  renderRule: function renderRule(rule, children, origin) {
3003
- var _this7 = this;
3139
+ var _this10 = this;
3004
3140
 
3005
3141
  if (!rule) return undefined;
3006
3142
  if (is.String(rule)) return rule;
@@ -3023,7 +3159,7 @@
3023
3159
 
3024
3160
  if (is.trueArray(rule.children)) {
3025
3161
  data.push(rule.children.map(function (v) {
3026
- return _this7.renderRule(v);
3162
+ return _this10.renderRule(v);
3027
3163
  }));
3028
3164
  }
3029
3165
 
@@ -3057,15 +3193,33 @@
3057
3193
  function useInject(Handler) {
3058
3194
  extend(Handler.prototype, {
3059
3195
  parseInjectEvent: function parseInjectEvent(rule, on) {
3196
+ var inject = rule.inject || this.options.injectEvent;
3197
+ return this.parseEventLst(rule, on, inject);
3198
+ },
3199
+ parseEventLst: function parseEventLst(rule, data, inject, deep) {
3060
3200
  var _this = this;
3061
3201
 
3062
- if (rule.inject === false) return;
3063
- var inject = rule.inject || this.options.injectEvent;
3064
- if (is.Undef(inject)) return;
3065
- Object.keys(on).forEach(function (k) {
3066
- if (is.Function(on[k])) on[k] = _this.inject(rule, on[k], inject);
3202
+ Object.keys(data).forEach(function (k) {
3203
+ var fn = _this.parseEvent(rule, data[k], inject, deep);
3204
+
3205
+ if (fn) {
3206
+ data[k] = fn;
3207
+ }
3067
3208
  });
3068
- return on;
3209
+ return data;
3210
+ },
3211
+ parseEvent: function parseEvent(rule, fn, inject, deep) {
3212
+ if (is.Function(fn) && (inject !== false && !is.Undef(inject) || fn.__inject)) {
3213
+ return this.inject(rule, fn, inject);
3214
+ } else if (!deep && Array.isArray(fn) && fn[0] && (is.String(fn[0]) || is.Function(fn[0]))) {
3215
+ return this.parseEventLst(rule, fn, inject, true);
3216
+ } else if (is.String(fn)) {
3217
+ var val = parseFn(fn);
3218
+
3219
+ if (val && fn !== val) {
3220
+ return val.__inject ? this.parseEvent(rule, val, inject, true) : val;
3221
+ }
3222
+ }
3069
3223
  },
3070
3224
  parseEmit: function parseEmit(ctx, on) {
3071
3225
  var _this2 = this;
@@ -3127,6 +3281,7 @@
3127
3281
  option = _this$vm$$options$pro.option,
3128
3282
  rule = _this$vm$$options$pro.rule;
3129
3283
  return {
3284
+ api: this.api,
3130
3285
  $f: this.api,
3131
3286
  rule: rule,
3132
3287
  self: self.__origin__,
@@ -3135,7 +3290,7 @@
3135
3290
  };
3136
3291
  },
3137
3292
  inject: function inject(self, _fn, _inject2) {
3138
- if (_fn.__inject) {
3293
+ if (_fn.__origin) {
3139
3294
  if (this.watching && !this.loading) return _fn;
3140
3295
  _fn = _fn.__origin;
3141
3296
  }
@@ -3143,16 +3298,19 @@
3143
3298
  var h = this;
3144
3299
 
3145
3300
  var fn = function fn() {
3301
+ var data = h.getInjectData(self, _inject2);
3302
+
3146
3303
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3147
3304
  args[_key2] = arguments[_key2];
3148
3305
  }
3149
3306
 
3150
- args.unshift(h.getInjectData(self, _inject2));
3307
+ data.args = [].concat(args);
3308
+ args.unshift(data);
3151
3309
  return _fn.apply(this, args);
3152
3310
  };
3153
3311
 
3154
- fn.__inject = true;
3155
3312
  fn.__origin = _fn;
3313
+ fn.__json = _fn.__json;
3156
3314
  return fn;
3157
3315
  }
3158
3316
  });
@@ -3297,7 +3455,10 @@
3297
3455
  initProp: function initProp() {
3298
3456
  var _this = this;
3299
3457
 
3300
- this.prop = mergeProps([this.rule].concat(_toConsumableArray(Object.keys(this.payload).map(function (k) {
3458
+ var rule = _objectSpread2({}, this.rule);
3459
+
3460
+ delete rule.children;
3461
+ this.prop = mergeProps([rule].concat(_toConsumableArray(Object.keys(this.payload).map(function (k) {
3301
3462
  return _this.payload[k];
3302
3463
  })), [this.computed]));
3303
3464
  },
@@ -3344,7 +3505,7 @@
3344
3505
  },
3345
3506
  rmCtrl: function rmCtrl() {
3346
3507
  this.ctrlRule.forEach(function (ctrl) {
3347
- return ctrl.__fc__.rm();
3508
+ return ctrl.__fc__ && ctrl.__fc__.rm();
3348
3509
  });
3349
3510
  this.ctrlRule = [];
3350
3511
  },
@@ -3357,7 +3518,7 @@
3357
3518
  if (index > -1) {
3358
3519
  _this2.root.splice(index, 1);
3359
3520
 
3360
- _this2.$handle.refresh();
3521
+ _this2.$handle && _this2.$handle.refresh();
3361
3522
  }
3362
3523
  };
3363
3524
 
@@ -3378,7 +3539,7 @@
3378
3539
  extend(_this2, {
3379
3540
  root: []
3380
3541
  });
3381
- });
3542
+ }, _this2.input);
3382
3543
  });
3383
3544
  },
3384
3545
  update: function update(handle, init) {
@@ -3416,23 +3577,39 @@
3416
3577
  __origin__: enumerable(_rule, true)
3417
3578
  });
3418
3579
  fullRule(rule);
3419
- if (rule.field && hasProperty(this.options.formData || {}, rule.field)) rule.value = this.options.formData[rule.field];
3580
+ this.appendValue(rule);
3420
3581
  rule.options = Array.isArray(rule.options) ? rule.options : [];
3421
- ['on', 'props', 'nativeOn'].forEach(function (k) {
3422
- var v = rule[k];
3582
+ [rule, rule['prefix'], rule['suffix']].forEach(function (item) {
3583
+ if (!item) {
3584
+ return;
3585
+ }
3423
3586
 
3424
- if (v) {
3425
- Object.keys(v).forEach(function (n) {
3426
- v[n] = parseFn(v[n]);
3427
- });
3587
+ _this2.loadFn(item, rule);
3588
+ });
3589
+ this.loadCtrl(rule);
3590
+
3591
+ if (rule.update) {
3592
+ rule.update = parseFn(rule.update);
3593
+ }
3428
3594
 
3429
- _this2.parseInjectEvent(rule, v);
3595
+ return rule;
3596
+ },
3597
+ loadFn: function loadFn(item, rule) {
3598
+ var _this3 = this;
3599
+
3600
+ ['on', 'props', 'nativeOn', 'deep'].forEach(function (k) {
3601
+ item[k] && _this3.parseInjectEvent(rule, item[k]);
3602
+ });
3603
+ },
3604
+ loadCtrl: function loadCtrl(rule) {
3605
+ rule.control && rule.control.forEach(function (ctrl) {
3606
+ if (ctrl.handle) {
3607
+ ctrl.handle = parseFn(ctrl.handle);
3430
3608
  }
3431
3609
  });
3432
- return rule;
3433
3610
  },
3434
3611
  syncProp: function syncProp(ctx) {
3435
- var _this3 = this;
3612
+ var _this4 = this;
3436
3613
 
3437
3614
  var rule = ctx.rule;
3438
3615
  is.trueArray(rule.sync) && mergeProps([{
@@ -3440,18 +3617,15 @@
3440
3617
  pre["update:".concat(prop)] = function (val) {
3441
3618
  rule.props[prop] = val;
3442
3619
 
3443
- _this3.vm.$emit('sync', prop, val, rule, _this3.fapi);
3620
+ _this4.vm.$emit('sync', prop, val, rule, _this4.fapi);
3444
3621
  };
3445
3622
 
3446
3623
  return pre;
3447
3624
  }, {})
3448
3625
  }], ctx.computed);
3449
3626
  },
3450
- isRepeatRule: function isRepeatRule(rule) {
3451
- return this.repeatRule.indexOf(rule) > -1;
3452
- },
3453
3627
  loadRule: function loadRule() {
3454
- var _this4 = this;
3628
+ var _this5 = this;
3455
3629
 
3456
3630
  // console.warn('%c load', 'color:blue');
3457
3631
  this.cycleLoad = false;
@@ -3462,23 +3636,23 @@
3462
3636
  }
3463
3637
 
3464
3638
  this.deferSyncValue(function () {
3465
- _this4._loadRule(_this4.rules);
3639
+ _this5._loadRule(_this5.rules);
3466
3640
 
3467
- _this4.loading = false;
3641
+ _this5.loading = false;
3468
3642
 
3469
- if (_this4.cycleLoad && _this4.pageEnd) {
3470
- return _this4.loadRule();
3643
+ if (_this5.cycleLoad && _this5.pageEnd) {
3644
+ return _this5.loadRule();
3471
3645
  }
3472
3646
 
3473
- if (_this4.pageEnd) {
3474
- _this4.bus.$emit('load-end');
3647
+ if (_this5.pageEnd) {
3648
+ _this5.bus.$emit('load-end');
3475
3649
  }
3476
3650
 
3477
- _this4.vm._renderRule();
3651
+ _this5.vm._renderRule();
3478
3652
 
3479
- _this4.$render.initOrgChildren();
3653
+ _this5.$render.initOrgChildren();
3480
3654
 
3481
- _this4.syncForm();
3655
+ _this5.syncForm();
3482
3656
  });
3483
3657
  },
3484
3658
  loadChildren: function loadChildren(children, parent) {
@@ -3500,7 +3674,7 @@
3500
3674
  this.$render.clearCache(parent);
3501
3675
  },
3502
3676
  _loadRule: function _loadRule(rules, parent) {
3503
- var _this5 = this;
3677
+ var _this6 = this;
3504
3678
 
3505
3679
  var preIndex = function preIndex(i) {
3506
3680
  var pre = rules[i - 1];
@@ -3509,45 +3683,48 @@
3509
3683
  return i > 0 ? preIndex(i - 1) : -1;
3510
3684
  }
3511
3685
 
3512
- var index = _this5.sort.indexOf(pre.__fc__.id);
3686
+ var index = _this6.sort.indexOf(pre.__fc__.id);
3513
3687
 
3514
3688
  return index > -1 ? index : preIndex(i - 1);
3515
3689
  };
3516
3690
 
3517
3691
  var loadChildren = function loadChildren(children, parent) {
3518
3692
  if (is.trueArray(children)) {
3519
- _this5._loadRule(children, parent);
3693
+ _this6._loadRule(children, parent);
3520
3694
  }
3521
3695
  };
3522
3696
 
3523
- var initEvent = function initEvent(rule) {
3524
- return _this5.ruleEffect(rule, 'init');
3525
- };
3526
-
3527
3697
  rules.map(function (_rule, index) {
3528
3698
  if (parent && (is.String(_rule) || is.Undef(_rule))) return;
3529
- if (!_this5.pageEnd && !parent && index >= _this5.first) return;
3699
+ if (!_this6.pageEnd && !parent && index >= _this6.first) return;
3530
3700
  if (!is.Object(_rule) || !getRule(_rule).type) return err('未定义生成规则的 type 字段', _rule);
3531
3701
 
3532
- if (_rule.__fc__ && _rule.__fc__.root === rules && _this5.ctxs[_rule.__fc__.id]) {
3702
+ if (_rule.__fc__ && _rule.__fc__.root === rules && _this6.ctxs[_rule.__fc__.id]) {
3533
3703
  loadChildren(_rule.__fc__.rule.children, _rule.__fc__);
3534
3704
  return _rule.__fc__;
3535
3705
  }
3536
3706
 
3537
3707
  var rule = getRule(_rule);
3538
- if (!_rule.__fc__) initEvent(rule);
3539
3708
 
3540
- if (rule.field && _this5.fieldCtx[rule.field] && _this5.fieldCtx[rule.field] !== _rule.__fc__) {
3541
- _this5.repeatRule.push(_rule);
3709
+ var isRepeat = function isRepeat() {
3710
+ return !!(rule.field && _this6.fieldCtx[rule.field] && _this6.fieldCtx[rule.field][0] !== _rule.__fc__);
3711
+ };
3542
3712
 
3543
- return err("".concat(rule.field, " \u5B57\u6BB5\u5DF2\u5B58\u5728"), _rule);
3713
+ _this6.ruleEffect(rule, 'init', {
3714
+ repeat: isRepeat()
3715
+ });
3716
+
3717
+ if (isRepeat()) {
3718
+ _this6.vm.$emit('repeat-field', _rule, _this6.api);
3544
3719
  }
3545
3720
 
3546
3721
  var ctx;
3722
+ var isCopy = false;
3723
+ var isInit = !!_rule.__fc__;
3547
3724
 
3548
- if (_rule.__fc__) {
3725
+ if (isInit) {
3549
3726
  ctx = _rule.__fc__;
3550
- var check = !ctx.check(_this5);
3727
+ var check = !ctx.check(_this6);
3551
3728
 
3552
3729
  if (ctx.deleted) {
3553
3730
  if (check) {
@@ -3555,7 +3732,7 @@
3555
3732
  return;
3556
3733
  }
3557
3734
 
3558
- ctx.update(_this5);
3735
+ ctx.update(_this6);
3559
3736
  }
3560
3737
  } else {
3561
3738
  if (check) {
@@ -3564,44 +3741,47 @@
3564
3741
  }
3565
3742
 
3566
3743
  rules[index] = _rule = _rule._clone ? _rule._clone() : copyRule(_rule);
3567
- initEvent(getRule(_rule));
3568
3744
  ctx = null;
3745
+ isCopy = true;
3569
3746
  }
3570
3747
  }
3571
3748
  }
3572
3749
 
3573
3750
  if (!ctx) {
3574
- ctx = new RuleContext(_this5, _this5.parseRule(_rule));
3751
+ ctx = new RuleContext(_this6, _this6.parseRule(_rule));
3575
3752
 
3576
- _this5.bindParser(ctx);
3577
- } else if (ctx.originType !== ctx.rule.type) {
3578
- ctx.updateType();
3753
+ _this6.bindParser(ctx);
3754
+ } else {
3755
+ if (ctx.originType !== ctx.rule.type) {
3756
+ ctx.updateType();
3579
3757
 
3580
- _this5.bindParser(ctx);
3581
- }
3758
+ _this6.bindParser(ctx);
3759
+ }
3582
3760
 
3583
- _this5.appendValue(ctx.rule);
3761
+ _this6.appendValue(ctx.rule);
3762
+ }
3584
3763
 
3585
3764
  [false, true].forEach(function (b) {
3586
- return _this5.parseEmit(ctx, b);
3765
+ return _this6.parseEmit(ctx, b);
3587
3766
  });
3588
3767
 
3589
- _this5.syncProp(ctx);
3768
+ _this6.syncProp(ctx);
3590
3769
 
3591
3770
  ctx.parent = parent || null;
3592
3771
  ctx.root = rules;
3593
3772
 
3594
- _this5.setCtx(ctx);
3773
+ _this6.setCtx(ctx);
3595
3774
 
3596
- loadChildren(ctx.rule.children, ctx);
3775
+ !isCopy && !isInit && _this6.effect(ctx, 'load');
3776
+ ctx.parser.loadChildren === false || loadChildren(ctx.rule.children, ctx);
3597
3777
 
3598
3778
  if (!parent) {
3599
3779
  var _preIndex = preIndex(index);
3600
3780
 
3601
3781
  if (_preIndex > -1 || !index) {
3602
- _this5.sort.splice(_preIndex + 1, 0, ctx.id);
3782
+ _this6.sort.splice(_preIndex + 1, 0, ctx.id);
3603
3783
  } else {
3604
- _this5.sort.push(ctx.id);
3784
+ _this6.sort.push(ctx.id);
3605
3785
  }
3606
3786
  }
3607
3787
 
@@ -3611,16 +3791,16 @@
3611
3791
  ctx.updated = true;
3612
3792
 
3613
3793
  if (is.Function(r.update)) {
3614
- _this5.bus.$once('load-end', function () {
3615
- _this5.refreshUpdate(ctx, r.value);
3794
+ _this6.bus.$once('load-end', function () {
3795
+ _this6.refreshUpdate(ctx, r.value);
3616
3796
  });
3617
3797
  }
3618
3798
 
3619
- _this5.effect(ctx, 'loaded');
3799
+ _this6.effect(ctx, 'loaded');
3620
3800
  }
3621
3801
 
3622
- if (ctx.input) Object.defineProperty(r, 'value', _this5.valueHandle(ctx));
3623
- if (_this5.refreshControl(ctx)) _this5.cycleLoad = true;
3802
+ if (ctx.input) Object.defineProperty(r, 'value', _this6.valueHandle(ctx));
3803
+ if (_this6.refreshControl(ctx)) _this6.cycleLoad = true;
3624
3804
  return ctx;
3625
3805
  });
3626
3806
  },
@@ -3628,7 +3808,7 @@
3628
3808
  return ctx.input && ctx.rule.control && this.useCtrl(ctx);
3629
3809
  },
3630
3810
  useCtrl: function useCtrl(ctx) {
3631
- var _this6 = this;
3811
+ var _this7 = this;
3632
3812
 
3633
3813
  var controls = getCtrl(ctx),
3634
3814
  validate = [],
@@ -3641,14 +3821,17 @@
3641
3821
  return val === control.value;
3642
3822
  };
3643
3823
 
3824
+ if (!is.trueArray(control.rule)) return "continue";
3825
+
3644
3826
  var data = _objectSpread2(_objectSpread2({}, control), {}, {
3645
3827
  valid: invoke(function () {
3646
3828
  return handleFn(ctx.rule.value, api);
3647
3829
  }),
3648
- ctrl: findCtrl(ctx, control.rule)
3830
+ ctrl: findCtrl(ctx, control.rule),
3831
+ isHidden: is.String(control.rule[0])
3649
3832
  });
3650
3833
 
3651
- if (data.valid && data.ctrl || !data.valid && !data.ctrl) return "continue";
3834
+ if (data.valid && data.ctrl || !data.valid && !data.ctrl && !data.isHidden) return "continue";
3652
3835
  validate.push(data);
3653
3836
  };
3654
3837
 
@@ -3660,39 +3843,56 @@
3660
3843
 
3661
3844
  if (!validate.length) return false;
3662
3845
  var flag = false;
3663
- validate.reverse().forEach(function (_ref) {
3664
- var valid = _ref.valid,
3665
- rule = _ref.rule,
3666
- prepend = _ref.prepend,
3667
- append = _ref.append,
3668
- child = _ref.child,
3669
- ctrl = _ref.ctrl;
3846
+ this.deferSyncValue(function () {
3847
+ validate.reverse().forEach(function (_ref) {
3848
+ var isHidden = _ref.isHidden,
3849
+ valid = _ref.valid,
3850
+ rule = _ref.rule,
3851
+ prepend = _ref.prepend,
3852
+ append = _ref.append,
3853
+ child = _ref.child,
3854
+ ctrl = _ref.ctrl;
3855
+
3856
+ if (isHidden) {
3857
+ valid ? ctx.ctrlRule.push({
3858
+ __ctrl: true,
3859
+ children: rule,
3860
+ valid: valid
3861
+ }) : ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
3862
+
3863
+ _this7.vm.$nextTick(function () {
3864
+ _this7.api.hidden(!valid, rule);
3865
+ });
3670
3866
 
3671
- if (valid) {
3672
- flag = true;
3673
- var ruleCon = {
3674
- type: 'fcFragment',
3675
- "native": true,
3676
- __ctrl: true,
3677
- children: rule
3678
- };
3679
- ctx.ctrlRule.push(ruleCon);
3680
-
3681
- _this6.bus.$once('load-start', function () {
3682
- // this.cycleLoad = true;
3683
- if (prepend) {
3684
- api.prepend(ruleCon, prepend, child);
3685
- } else if (append || child) {
3686
- api.append(ruleCon, append || ctx.id, child);
3687
- } else {
3688
- ctx.root.splice(ctx.root.indexOf(ctx.origin) + 1, 0, ruleCon);
3689
- }
3690
- });
3691
- } else {
3692
- ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
3693
- var ctrlCtx = byCtx(ctrl);
3694
- ctrlCtx && ctrlCtx.rm();
3695
- }
3867
+ return;
3868
+ }
3869
+
3870
+ if (valid) {
3871
+ flag = true;
3872
+ var ruleCon = {
3873
+ type: 'fcFragment',
3874
+ "native": true,
3875
+ __ctrl: true,
3876
+ children: rule
3877
+ };
3878
+ ctx.ctrlRule.push(ruleCon);
3879
+
3880
+ _this7.bus.$once('load-start', function () {
3881
+ // this.cycleLoad = true;
3882
+ if (prepend) {
3883
+ api.prepend(ruleCon, prepend, child);
3884
+ } else if (append || child) {
3885
+ api.append(ruleCon, append || ctx.id, child);
3886
+ } else {
3887
+ ctx.root.splice(ctx.root.indexOf(ctx.origin) + 1, 0, ruleCon);
3888
+ }
3889
+ });
3890
+ } else {
3891
+ ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
3892
+ var ctrlCtx = byCtx(ctrl);
3893
+ ctrlCtx && ctrlCtx.rm();
3894
+ }
3895
+ });
3696
3896
  });
3697
3897
  this.vm.$emit('control', ctx.origin, this.api);
3698
3898
  this.effect(ctx, 'control');
@@ -3702,7 +3902,7 @@
3702
3902
  return this._reloadRule(rules);
3703
3903
  },
3704
3904
  _reloadRule: function _reloadRule(rules) {
3705
- var _this7 = this;
3905
+ var _this8 = this;
3706
3906
 
3707
3907
  // console.warn('%c reload', 'color:red');
3708
3908
  if (!rules) rules = this.rules;
@@ -3715,12 +3915,12 @@
3715
3915
  this.fc.rules = rules;
3716
3916
  this.bus.$once('load-end', function () {
3717
3917
  Object.keys(ctxs).filter(function (id) {
3718
- return _this7.ctxs[id] === undefined;
3918
+ return _this8.ctxs[id] === undefined;
3719
3919
  }).forEach(function (id) {
3720
- return _this7.rmCtx(ctxs[id]);
3920
+ return _this8.rmCtx(ctxs[id]);
3721
3921
  });
3722
3922
 
3723
- _this7.$render.clearCacheAll();
3923
+ _this8.$render.clearCacheAll();
3724
3924
  });
3725
3925
  this.reloading = true;
3726
3926
  this.loadRule();
@@ -3789,18 +3989,19 @@
3789
3989
  }
3790
3990
  },
3791
3991
  setFormData: function setFormData(ctx, value) {
3792
- $set(this.formData, ctx.field, value);
3992
+ $set(this.formData, ctx.id, value);
3793
3993
  },
3794
3994
  getFormData: function getFormData(ctx) {
3795
- return this.formData[ctx.field];
3995
+ return this.formData[ctx.id];
3796
3996
  },
3797
3997
  validate: function validate() {
3798
3998
  var _this = this;
3799
3999
 
3800
4000
  toEmpty(this.vm.validate);
3801
- Object.keys(this.fieldCtx).forEach(function (id) {
3802
- var ctx = _this.fieldCtx[id];
3803
- _this.vm.validate[ctx.field] = toArray(ctx.rule.validate);
4001
+ this.fields().forEach(function (id) {
4002
+ _this.fieldCtx[id].forEach(function (ctx) {
4003
+ _this.vm.validate[ctx.id] = toArray(ctx.rule.validate);
4004
+ });
3804
4005
  });
3805
4006
  return this.vm.validate;
3806
4007
  },
@@ -3808,15 +4009,27 @@
3808
4009
  var _this2 = this;
3809
4010
 
3810
4011
  toEmpty(this.form);
3811
- Object.defineProperties(this.form, Object.keys(this.formData).reduce(function (initial, field) {
3812
- var ctx = _this2.getCtx(field);
4012
+ Object.defineProperties(this.form, this.fields().reduce(function (initial, field) {
4013
+ var ctx = _this2.getFieldCtx(field);
3813
4014
 
3814
4015
  var handle = _this2.valueHandle(ctx);
3815
4016
 
3816
4017
  handle.configurable = true;
3817
4018
  initial[field] = handle;
3818
4019
  return initial;
3819
- }, {}));
4020
+ }, Object.keys(this.appendData).reduce(function (initial, field) {
4021
+ initial[field] = {
4022
+ enumerable: true,
4023
+ configurable: true,
4024
+ get: function get() {
4025
+ return _this2.appendData[field];
4026
+ },
4027
+ set: function set(val) {
4028
+ _this2.appendData[field] = val;
4029
+ }
4030
+ };
4031
+ return initial;
4032
+ }, {})));
3820
4033
  this.syncValue();
3821
4034
  },
3822
4035
  valueHandle: function valueHandle(ctx) {
@@ -3840,13 +4053,19 @@
3840
4053
  delete this.appendData[rule.field];
3841
4054
  },
3842
4055
  addSubForm: function addSubForm(ctx, subForm) {
3843
- this.subForm[ctx.field] = subForm;
4056
+ if (ctx.input) {
4057
+ this.subForm[ctx.id] = subForm;
4058
+ }
3844
4059
  },
3845
- deferSyncValue: function deferSyncValue(fn) {
4060
+ deferSyncValue: function deferSyncValue(fn, sync) {
3846
4061
  if (!this.deferSyncFn) {
3847
4062
  this.deferSyncFn = fn;
3848
4063
  }
3849
4064
 
4065
+ if (!this.deferSyncFn.sync) {
4066
+ this.deferSyncFn.sync = sync;
4067
+ }
4068
+
3850
4069
  invoke(fn);
3851
4070
 
3852
4071
  if (this.deferSyncFn === fn) {
@@ -3873,11 +4092,9 @@
3873
4092
  refreshUpdate: function refreshUpdate(ctx, val) {
3874
4093
  var _this4 = this;
3875
4094
 
3876
- var fn = ctx.rule.update;
3877
-
3878
- if (is.Function(fn)) {
4095
+ if (is.Function(ctx.rule.update)) {
3879
4096
  var state = invoke(function () {
3880
- return fn(val, ctx.origin, _this4.api);
4097
+ return ctx.rule.update(val, ctx.origin, _this4.api);
3881
4098
  });
3882
4099
  if (state === undefined) return;
3883
4100
  ctx.rule.hidden = state === true;
@@ -3913,7 +4130,7 @@
3913
4130
  });
3914
4131
  },
3915
4132
  fields: function fields() {
3916
- return Object.keys(this.formData);
4133
+ return Object.keys(this.fieldCtx);
3917
4134
  }
3918
4135
  });
3919
4136
  }
@@ -3924,49 +4141,6 @@
3924
4141
  });
3925
4142
  }
3926
4143
 
3927
- function useHelper(rules) {
3928
- if (!Array.isArray(rules) || rules.findField) return;
3929
- Object.defineProperties(rules, {
3930
- findField: enumerable(findField),
3931
- findName: enumerable(findName),
3932
- setValue: enumerable(setValue)
3933
- });
3934
- }
3935
-
3936
- function find(field, name, origin) {
3937
- if (!this.length) return;
3938
- var children = [];
3939
-
3940
- for (var i = 0; i < this.length; i++) {
3941
- if (!is.Object(this[i])) continue;
3942
- var rule = getRule(this[i]);
3943
- if (rule[name] === field) return origin ? rule : this[i];
3944
- if (is.trueArray(rule.children)) children = children.concat(rule.children);
3945
- is.trueArray(rule.control) && rule.control.forEach(function (r) {
3946
- children = children.concat(r.rule);
3947
- });
3948
- }
3949
-
3950
- return find.call(children, field, name, origin);
3951
- }
3952
-
3953
- function findField(field) {
3954
- return find.call(this, field, 'field');
3955
- }
3956
-
3957
- function findName(field) {
3958
- return find.call(this, field, 'name');
3959
- }
3960
-
3961
- function setValue(formData) {
3962
- var _this = this;
3963
-
3964
- Object.keys(formData).forEach(function (field) {
3965
- var rule = find.call(_this, field, 'field', true);
3966
- if (rule) rule.value = formData[field];
3967
- });
3968
- }
3969
-
3970
4144
  var BaseParser = {
3971
4145
  init: function init(ctx) {},
3972
4146
  toFormValue: function toFormValue(value, ctx) {
@@ -3985,7 +4159,37 @@
3985
4159
  function useContext(Handler) {
3986
4160
  extend(Handler.prototype, {
3987
4161
  getCtx: function getCtx(id) {
3988
- return this.fieldCtx[id] || this.nameCtx[id] || this.ctxs[id];
4162
+ return this.getFieldCtx(id) || this.getNameCtx(id)[0] || this.ctxs[id];
4163
+ },
4164
+ getCtxs: function getCtxs(id) {
4165
+ return this.fieldCtx[id] || this.nameCtx[id] || (this.ctxs[id] ? [this.ctxs[id]] : []);
4166
+ },
4167
+ setIdCtx: function setIdCtx(ctx, key, type) {
4168
+ var field = "".concat(type, "Ctx");
4169
+
4170
+ if (!this[field][key]) {
4171
+ this[field][key] = [ctx];
4172
+ } else {
4173
+ this[field][key].push(ctx);
4174
+ }
4175
+ },
4176
+ rmIdCtx: function rmIdCtx(ctx, key, type) {
4177
+ var field = "".concat(type, "Ctx");
4178
+ var lst = this[field][key];
4179
+ if (!lst) return false;
4180
+ var flag = lst.splice(lst.indexOf(ctx) >>> 0, 1).length > 0;
4181
+
4182
+ if (!lst.length) {
4183
+ delete this[field][key];
4184
+ }
4185
+
4186
+ return flag;
4187
+ },
4188
+ getFieldCtx: function getFieldCtx(field) {
4189
+ return (this.fieldCtx[field] || [])[0];
4190
+ },
4191
+ getNameCtx: function getNameCtx(name) {
4192
+ return this.nameCtx[name] || [];
3989
4193
  },
3990
4194
  setCtx: function setCtx(ctx) {
3991
4195
  var id = ctx.id,
@@ -3993,9 +4197,9 @@
3993
4197
  name = ctx.name,
3994
4198
  rule = ctx.rule;
3995
4199
  this.ctxs[id] = ctx;
3996
- if (name) $set(this.nameCtx, name, ctx);
4200
+ name && this.setIdCtx(ctx, name, 'name');
3997
4201
  if (!ctx.input) return;
3998
- this.fieldCtx[field] = ctx;
4202
+ this.setIdCtx(ctx, field, 'field');
3999
4203
  this.setFormData(ctx, ctx.parser.toFormValue(rule.value, ctx));
4000
4204
 
4001
4205
  if (this.isMounted && !this.reloading) {
@@ -4029,7 +4233,7 @@
4029
4233
  var _this = this;
4030
4234
 
4031
4235
  var vm = this.vm;
4032
- var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo'];
4236
+ var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update'];
4033
4237
  Object.keys(ctx.rule).filter(function (k) {
4034
4238
  return none.indexOf(k) === -1;
4035
4239
  }).forEach(function (key) {
@@ -4038,6 +4242,15 @@
4038
4242
  return ctx.rule[key];
4039
4243
  }, function (n, o) {
4040
4244
  if (_this.loading || _this.noWatchFn || _this.reloading) return;
4245
+
4246
+ if (flag && ctx.parser.loadChildren === false) {
4247
+ _this.$render.clearCache(ctx);
4248
+
4249
+ _this.nextRefresh();
4250
+
4251
+ return;
4252
+ }
4253
+
4041
4254
  _this.watching = true; // if (key === 'hidden')
4042
4255
  // ctx.updateKey(true);
4043
4256
  // else
@@ -4045,13 +4258,13 @@
4045
4258
  if (key === 'link') {
4046
4259
  ctx.link();
4047
4260
  return;
4048
- } else if (['props', 'on', 'nativeOn'].indexOf(key) > -1) {
4261
+ } else if (['props', 'on', 'nativeOn', 'deep'].indexOf(key) > -1) {
4049
4262
  _this.parseInjectEvent(ctx.rule, n || {});
4050
4263
 
4051
4264
  if (key === 'props' && ctx.input) {
4052
4265
  _this.setFormData(ctx, ctx.parser.toFormValue(ctx.rule.value, ctx));
4053
4266
  }
4054
- } else if (['emit', 'nativeEmit'].indexOf(key) > -1) _this.parseEmit(ctx, key === 'emit');else if (key === 'type') {
4267
+ } else if (['emit', 'nativeEmit'].indexOf(key) > -1) _this.parseEmit(ctx, key === 'emit');else if (['prefix', 'suffix'].indexOf(key) > -1) n && _this.loadFn(n, ctx.rule);else if (key === 'type') {
4055
4268
  ctx.updateType();
4056
4269
 
4057
4270
  _this.bindParser(ctx);
@@ -4092,6 +4305,7 @@
4092
4305
  if (ctx.deleted) return;
4093
4306
  var id = ctx.id,
4094
4307
  field = ctx.field,
4308
+ input = ctx.input,
4095
4309
  name = ctx.name;
4096
4310
 
4097
4311
  if (ctx.input) {
@@ -4102,41 +4316,29 @@
4102
4316
  }
4103
4317
 
4104
4318
  $del(this.ctxs, id);
4105
- $del(this.$render.renderList, id);
4319
+ $del(this.$render.tempList, id);
4106
4320
  $del(this.$render.orgChildren, id);
4321
+ $del(this.vm.ctxInject, id);
4322
+ $del(this.formData, id);
4323
+ $del(this.subForm, id);
4107
4324
  $del(ctx, 'cacheValue');
4108
- var f = this.fieldCtx[field];
4109
-
4110
- if (field && (!f || f === ctx)) {
4111
- $del(this.formData, field);
4112
- $del(this.form, field);
4113
- $del(this.fieldCtx, field);
4114
- $del(this.subForm, field);
4115
- this.vm.$nextTick(function () {
4116
- return _this3.vm.$emit('removeField', field, ctx.rule, _this3.api);
4117
- });
4118
- }
4119
-
4120
- if (name && this.nameCtx[name] === ctx) {
4121
- $del(this.nameCtx, name);
4122
- }
4123
-
4124
- if (!this.reloading) {
4125
- this.deferSyncValue(function () {
4126
- if (is.trueArray(ctx.rule.children)) {
4127
- ctx.rule.children.forEach(function (h) {
4128
- return h.__fc__ && _this3.rmCtx(h.__fc__);
4129
- });
4325
+ input && this.rmIdCtx(ctx, field, 'field');
4326
+ name && this.rmIdCtx(ctx, name, 'name');
4327
+ this.deferSyncValue(function () {
4328
+ if (!_this3.reloading) {
4329
+ if (ctx.parser.loadChildren !== false) {
4330
+ if (is.trueArray(ctx.rule.children)) {
4331
+ ctx.rule.children.forEach(function (h) {
4332
+ return h.__fc__ && _this3.rmCtx(h.__fc__);
4333
+ });
4334
+ }
4130
4335
  }
4131
4336
 
4132
- _this3.syncValue();
4133
- });
4134
-
4135
- if (ctx.root === this.rules) {
4136
- this.vm._renderRule();
4337
+ if (ctx.root === _this3.rules) {
4338
+ _this3.vm._renderRule();
4339
+ }
4137
4340
  }
4138
- }
4139
-
4341
+ }, input);
4140
4342
  var index = this.sort.indexOf(id);
4141
4343
 
4142
4344
  if (index > -1) {
@@ -4146,9 +4348,8 @@
4146
4348
  this.$render.clearCache(ctx);
4147
4349
  ctx["delete"]();
4148
4350
  this.effect(ctx, 'deleted');
4149
- this.vm.$nextTick(function () {
4150
- return _this3.vm.$emit('removeRule', ctx.rule, _this3.api);
4151
- });
4351
+ input && !this.fieldCtx[field] && this.vm.$emit('removeField', field, ctx.rule, this.api);
4352
+ ctx.rule.__ctrl || this.vm.$emit('removeRule', ctx.rule, this.api);
4152
4353
  return ctx;
4153
4354
  }
4154
4355
  });
@@ -4227,6 +4428,13 @@
4227
4428
  }));
4228
4429
  });
4229
4430
  },
4431
+ ruleEffect: function ruleEffect(rule, event, append) {
4432
+ this.emitEffect({
4433
+ rule: rule,
4434
+ input: !!rule.field,
4435
+ type: this.getType(rule.type)
4436
+ }, event, append);
4437
+ },
4230
4438
  effect: function effect(ctx, event, custom) {
4231
4439
  this.emitEffect({
4232
4440
  rule: ctx.rule,
@@ -4236,17 +4444,10 @@
4236
4444
  custom: custom
4237
4445
  }, event);
4238
4446
  },
4239
- ruleEffect: function ruleEffect(rule, event) {
4240
- this.emitEffect({
4241
- rule: rule,
4242
- input: !!rule.field,
4243
- type: this.getType(rule.type)
4244
- }, event);
4245
- },
4246
4447
  getEffect: function getEffect(rule, name) {
4247
4448
  if (hasProperty(rule, 'effect') && hasProperty(rule.effect, name)) return rule.effect[name];else return undefined;
4248
4449
  },
4249
- emitEffect: function emitEffect(_ref, event) {
4450
+ emitEffect: function emitEffect(_ref, event, append) {
4250
4451
  var _this4 = this;
4251
4452
 
4252
4453
  var ctx = _ref.ctx,
@@ -4270,12 +4471,12 @@
4270
4471
  return;
4271
4472
  }
4272
4473
 
4273
- var data = {
4474
+ var data = _objectSpread2({
4274
4475
  value: effect[attr],
4275
4476
  getValue: function getValue() {
4276
4477
  return _this4.getEffect(rule, attr);
4277
4478
  }
4278
- };
4479
+ }, append || {});
4279
4480
 
4280
4481
  if (ctx) {
4281
4482
  data.getProp = function () {
@@ -4352,16 +4553,15 @@
4352
4553
  extend(Handler.prototype, {
4353
4554
  initData: function initData(rules) {
4354
4555
  extend(this, {
4355
- fieldCtx: {},
4356
4556
  ctxs: {},
4557
+ fieldCtx: {},
4357
4558
  nameCtx: {},
4358
4559
  sort: [],
4359
- rules: rules,
4360
- repeatRule: []
4560
+ rules: rules
4361
4561
  });
4362
- useHelper(rules);
4363
4562
  },
4364
4563
  init: function init() {
4564
+ this.appendData = _objectSpread2(_objectSpread2(_objectSpread2({}, this.fc.options.formData || {}), this.vm.value || {}), this.appendData);
4365
4565
  this.useProvider();
4366
4566
  this.usePage();
4367
4567
  this.loadRule();
@@ -4455,8 +4655,9 @@
4455
4655
  var fragment = {
4456
4656
  name: NAME$9,
4457
4657
  functional: true,
4658
+ props: ['vnode'],
4458
4659
  render: function render(h, ctx) {
4459
- return ctx.children;
4660
+ return ctx.props.vnode ? ctx.props.vnode : ctx.children;
4460
4661
  }
4461
4662
  };
4462
4663
 
@@ -4788,6 +4989,10 @@
4788
4989
 
4789
4990
  function $form() {
4790
4991
  return _vue.extend($FormCreate(FormCreate));
4992
+ }
4993
+
4994
+ function $vnode() {
4995
+ return _vue.extend(fragment);
4791
4996
  } //todo 检查回调函数作用域
4792
4997
 
4793
4998
 
@@ -4806,9 +5011,14 @@
4806
5011
  return _this.api();
4807
5012
  }
4808
5013
 
5014
+ function factory() {
5015
+ return FormCreateFactory(config);
5016
+ }
5017
+
4809
5018
  function FormCreate(vm, rules, options) {
4810
5019
  extend(this, {
4811
5020
  vm: vm,
5021
+ create: create,
4812
5022
  manager: createManager(config.manager),
4813
5023
  parsers: parsers,
4814
5024
  providers: providers,
@@ -4925,8 +5135,10 @@
4925
5135
  component: component,
4926
5136
  directive: directive,
4927
5137
  register: register,
5138
+ $vnode: $vnode,
4928
5139
  parser: parser,
4929
5140
  use: use,
5141
+ factory: factory,
4930
5142
  componentAlias: componentAlias,
4931
5143
  copyRule: copyRule,
4932
5144
  copyRules: copyRules,
@@ -4977,6 +5189,7 @@
4977
5189
  useAttr($formCreate);
4978
5190
  Vue.prototype.$formCreate = $formCreate;
4979
5191
  Vue.component('FormCreate', $form());
5192
+ Vue.component('FcFragment', $vnode());
4980
5193
  }
4981
5194
  });
4982
5195
  }
@@ -5347,10 +5560,9 @@
5347
5560
  _col = _this$rule$props.col;
5348
5561
  var item = isFalse(rule.wrap.show) ? children : this.$r(mergeProps([rule.wrap, {
5349
5562
  props: _objectSpread2(_objectSpread2({
5350
- label: rule.title.title,
5351
5563
  labelWidth: labelWidth
5352
5564
  }, rule.wrap || {}), {}, {
5353
- prop: ctx.field,
5565
+ prop: ctx.id,
5354
5566
  rules: rule.validate
5355
5567
  }),
5356
5568
  "class": rule.className,
@@ -5361,6 +5573,7 @@
5361
5573
  return inline === true || isFalse(_col) || isFalse(col.show) ? item : this.makeCol(rule, uni, [item]);
5362
5574
  },
5363
5575
  isTitle: function isTitle(rule) {
5576
+ if (this.options.form.title === false) return false;
5364
5577
  var title = rule.title;
5365
5578
  return !(!title.title && !title["native"] || isFalse(title.show));
5366
5579
  },
@@ -5598,7 +5811,7 @@
5598
5811
  useFrame(maker);
5599
5812
  useTimePicker(maker);
5600
5813
 
5601
- var css_248z$2 = ".form-create .form-create .ivu-form-item {\n margin-bottom: 24px;\n}\n\n.form-create .form-create .ivu-form-item .ivu-form-item {\n margin-bottom: 0px;\n}\n";
5814
+ var css_248z$2 = ".form-create .form-create .ivu-form-item {\n margin-bottom: 24px;\n}\n\n.form-create .form-create .ivu-form-item .ivu-form-item {\n margin-bottom: 0px;\n}\n\n.form-create{\n transform: rotateZ(0);\n}\n";
5602
5815
  styleInject(css_248z$2);
5603
5816
 
5604
5817
  function tidyBtnProp(btn, def) {
@@ -5627,7 +5840,7 @@
5627
5840
  flag = args;
5628
5841
  }
5629
5842
 
5630
- callback.apply(void 0, _toConsumableArray(flag));
5843
+ callback && callback.apply(void 0, _toConsumableArray(flag));
5631
5844
  });
5632
5845
  };
5633
5846
 
@@ -5660,13 +5873,14 @@
5660
5873
  }
5661
5874
  },
5662
5875
  validateField: function validateField(field, callback) {
5663
- if (!h.fieldCtx[field]) return;
5664
- var sub = h.subForm[field];
5876
+ var ctx = h.getFieldCtx(field);
5877
+ if (!ctx) return;
5878
+ var sub = h.subForm[ctx.id];
5665
5879
  var len = 0;
5666
5880
  var flag;
5667
5881
 
5668
5882
  var validate = function validate() {
5669
- h.$manager.validateField(field, function () {
5883
+ h.$manager.validateField(ctx.id, function () {
5670
5884
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
5671
5885
  args[_key3] = arguments[_key3];
5672
5886
  }
@@ -5674,10 +5888,10 @@
5674
5888
  if (args[0]) {
5675
5889
  flag = args;
5676
5890
  } else if (flag) {
5677
- return callback('子表单验证未通过');
5891
+ return callback && callback('子表单验证未通过');
5678
5892
  }
5679
5893
 
5680
- callback.apply(void 0, _toConsumableArray(flag || args));
5894
+ callback && callback.apply(void 0, _toConsumableArray(flag || args));
5681
5895
  });
5682
5896
  };
5683
5897
 
@@ -5716,23 +5930,25 @@
5716
5930
  var clearSub = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
5717
5931
  api.helper.tidyFields(fields).forEach(function (field) {
5718
5932
  if (clearSub) _this.clearSubValidateState(field);
5719
- var ctx = h.fieldCtx[field];
5720
- if (!ctx) return;
5721
- h.$manager.clearValidateState(ctx);
5933
+ h.getCtxs(field).forEach(function (ctx) {
5934
+ h.$manager.clearValidateState(ctx);
5935
+ });
5722
5936
  });
5723
5937
  },
5724
5938
  clearSubValidateState: function clearSubValidateState(fields) {
5725
5939
  api.helper.tidyFields(fields).forEach(function (field) {
5726
- var subForm = h.subForm[field];
5727
- if (!subForm) return;
5940
+ h.getCtxs(field).forEach(function (ctx) {
5941
+ var subForm = h.subForm[ctx.id];
5942
+ if (!subForm) return;
5728
5943
 
5729
- if (Array.isArray(subForm)) {
5730
- subForm.forEach(function (form) {
5731
- form.clearValidateState();
5732
- });
5733
- } else if (subForm) {
5734
- subForm.clearValidateState();
5735
- }
5944
+ if (Array.isArray(subForm)) {
5945
+ subForm.forEach(function (form) {
5946
+ form.clearValidateState();
5947
+ });
5948
+ } else if (subForm) {
5949
+ subForm.clearValidateState();
5950
+ }
5951
+ });
5736
5952
  });
5737
5953
  },
5738
5954
  btn: {
@@ -5835,7 +6051,7 @@
5835
6051
  function ivuFormCreate() {
5836
6052
  return FormCreateFactory({
5837
6053
  ui: "".concat("view-design"),
5838
- version: "".concat("2.5.8"),
6054
+ version: "".concat("2.5.12"),
5839
6055
  manager: manager,
5840
6056
  install: install,
5841
6057
  extendApi: extendApi,