vxe-table 3.5.7-beta.1 → 3.5.8-beta.0

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.
Files changed (76) hide show
  1. package/lib/button/style/style.css +0 -5
  2. package/lib/button/style/style.min.css +1 -1
  3. package/lib/checkbox/src/checkbox.js +12 -2
  4. package/lib/checkbox/src/checkbox.min.js +1 -1
  5. package/lib/checkbox/src/group.js +14 -2
  6. package/lib/checkbox/src/group.min.js +1 -1
  7. package/lib/edit/src/mixin.js +1 -1
  8. package/lib/edit/src/mixin.min.js +1 -1
  9. package/lib/form/src/form-config-item.js +189 -0
  10. package/lib/form/src/form-config-item.min.js +1 -0
  11. package/lib/form/src/form-gather.js +5 -1
  12. package/lib/form/src/form-gather.min.js +1 -1
  13. package/lib/form/src/form-item.js +17 -1
  14. package/lib/form/src/form-item.min.js +1 -1
  15. package/lib/form/src/form.js +35 -149
  16. package/lib/form/src/form.min.js +1 -1
  17. package/lib/form/src/util.js +5 -3
  18. package/lib/form/src/util.min.js +1 -1
  19. package/lib/form/style/style.css +6 -6
  20. package/lib/form/style/style.min.css +1 -1
  21. package/lib/icon/style/style.css +11 -9
  22. package/lib/icon/style/style.min.css +1 -1
  23. package/lib/index.css +1 -1
  24. package/lib/index.umd.js +390 -159
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/input/src/input.js +60 -7
  27. package/lib/input/src/input.min.js +1 -1
  28. package/lib/input/style/style.css +5 -0
  29. package/lib/input/style/style.min.css +1 -1
  30. package/lib/radio/src/button.js +12 -2
  31. package/lib/radio/src/button.min.js +1 -1
  32. package/lib/radio/src/group.js +14 -2
  33. package/lib/radio/src/group.min.js +1 -1
  34. package/lib/radio/src/radio.js +12 -2
  35. package/lib/radio/src/radio.min.js +1 -1
  36. package/lib/select/src/select.js +13 -1
  37. package/lib/select/src/select.min.js +1 -1
  38. package/lib/style.css +1 -1
  39. package/lib/style.min.css +1 -1
  40. package/lib/switch/src/switch.js +14 -1
  41. package/lib/switch/src/switch.min.js +1 -1
  42. package/lib/textarea/src/textarea.js +13 -1
  43. package/lib/textarea/src/textarea.min.js +1 -1
  44. package/lib/tools/log.js +1 -1
  45. package/lib/tools/log.min.js +1 -1
  46. package/lib/v-x-e-table/index.js +1 -1
  47. package/lib/v-x-e-table/index.min.js +1 -1
  48. package/lib/validator/src/mixin.js +1 -1
  49. package/lib/validator/src/mixin.min.js +1 -1
  50. package/package.json +2 -2
  51. package/packages/checkbox/src/checkbox.js +11 -1
  52. package/packages/checkbox/src/group.js +13 -1
  53. package/packages/edit/src/mixin.js +1 -1
  54. package/packages/form/src/form-config-item.js +150 -0
  55. package/packages/form/src/form-gather.js +5 -1
  56. package/packages/form/src/form-item.js +17 -1
  57. package/packages/form/src/form.js +31 -126
  58. package/packages/form/src/util.js +5 -3
  59. package/packages/input/src/input.js +45 -6
  60. package/packages/radio/src/button.js +11 -1
  61. package/packages/radio/src/group.js +13 -1
  62. package/packages/radio/src/radio.js +11 -1
  63. package/packages/select/src/select.js +12 -0
  64. package/packages/switch/src/switch.js +12 -0
  65. package/packages/textarea/src/textarea.js +12 -0
  66. package/packages/validator/src/mixin.js +1 -1
  67. package/styles/button.scss +0 -5
  68. package/styles/form.scss +17 -19
  69. package/styles/icon.scss +10 -9
  70. package/styles/input.scss +4 -0
  71. package/styles/variable.scss +1 -0
  72. package/types/optgroup.d.ts +1 -1
  73. package/types/option.d.ts +1 -1
  74. package/types/pulldown.d.ts +1 -1
  75. package/types/radio-button.d.ts +1 -1
  76. package/types/radio-group.d.ts +1 -1
package/lib/index.umd.js CHANGED
@@ -8804,7 +8804,7 @@ var es_array_concat = __webpack_require__("99af");
8804
8804
 
8805
8805
 
8806
8806
  function getLog(message, params) {
8807
- return "[vxe-table v".concat("3.5.7-beta.1", "] ").concat(conf.i18n(message, params));
8807
+ return "[vxe-table v".concat("3.5.7", "] ").concat(conf.i18n(message, params));
8808
8808
  }
8809
8809
 
8810
8810
  function outLog(type) {
@@ -10073,7 +10073,7 @@ function _t(key, args) {
10073
10073
  var v = 'v3';
10074
10074
  var VXETable = {
10075
10075
  v: v,
10076
- version: "3.5.7-beta.1",
10076
+ version: "3.5.7",
10077
10077
  reg: reg,
10078
10078
  use: use,
10079
10079
  setup: setup,
@@ -22895,7 +22895,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
22895
22895
  * 激活行编辑
22896
22896
  */
22897
22897
  _setEditRow: function _setEditRow(row) {
22898
- return this.setActiveCell(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
22898
+ return this.setEditCell(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.find(this.visibleColumn, function (column) {
22899
22899
  return isEnableConf(column.editRender);
22900
22900
  }));
22901
22901
  },
@@ -24920,7 +24920,9 @@ function renderNumberIcon(h, _vm) {
24920
24920
  return h('span', {
24921
24921
  class: 'vxe-input--number-suffix'
24922
24922
  }, [h('span', {
24923
- class: 'vxe-input--number-prev is--prev',
24923
+ class: ['vxe-input--number-prev is--prev', {
24924
+ 'is--disabled': _vm.isDisabledAddNumber
24925
+ }],
24924
24926
  on: {
24925
24927
  mousedown: _vm.numberMousedownEvent,
24926
24928
  mouseup: _vm.numberStopDown,
@@ -24929,7 +24931,9 @@ function renderNumberIcon(h, _vm) {
24929
24931
  }, [h('i', {
24930
24932
  class: ['vxe-input--number-prev-icon', conf.icon.INPUT_PREV_NUM]
24931
24933
  })]), h('span', {
24932
- class: 'vxe-input--number-next is--next',
24934
+ class: ['vxe-input--number-next is--next', {
24935
+ 'is--disabled': _vm.isDisabledSubtractNumber
24936
+ }],
24933
24937
  on: {
24934
24938
  mousedown: _vm.numberMousedownEvent,
24935
24939
  mouseup: _vm.numberStopDown,
@@ -25195,6 +25199,14 @@ function renderExtraSuffixIcon(h, _vm) {
25195
25199
  }
25196
25200
  }
25197
25201
  },
25202
+ inject: {
25203
+ $xeform: {
25204
+ default: null
25205
+ },
25206
+ $xeformiteminfo: {
25207
+ default: null
25208
+ }
25209
+ },
25198
25210
  data: function data() {
25199
25211
  return {
25200
25212
  panelIndex: 0,
@@ -25643,6 +25655,41 @@ function renderExtraSuffixIcon(h, _vm) {
25643
25655
  editable = this.editable,
25644
25656
  multiple = this.multiple;
25645
25657
  return readonly || multiple || !editable || type === 'week' || type === 'quarter';
25658
+ },
25659
+ numValue: function numValue() {
25660
+ var type = this.type,
25661
+ isNumType = this.isNumType,
25662
+ inputValue = this.inputValue;
25663
+
25664
+ if (isNumType) {
25665
+ return type === 'integer' ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toInteger(handleNumber(inputValue)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(handleNumber(inputValue));
25666
+ }
25667
+
25668
+ return 0;
25669
+ },
25670
+ isDisabledSubtractNumber: function isDisabledSubtractNumber() {
25671
+ var min = this.min,
25672
+ isNumType = this.isNumType,
25673
+ inputValue = this.inputValue,
25674
+ numValue = this.numValue; // 当有值时再进行判断
25675
+
25676
+ if ((inputValue || inputValue === 0) && isNumType && min !== null) {
25677
+ return numValue <= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min);
25678
+ }
25679
+
25680
+ return false;
25681
+ },
25682
+ isDisabledAddNumber: function isDisabledAddNumber() {
25683
+ var max = this.max,
25684
+ isNumType = this.isNumType,
25685
+ inputValue = this.inputValue,
25686
+ numValue = this.numValue; // 当有值时再进行判断
25687
+
25688
+ if ((inputValue || inputValue === 0) && isNumType && max !== null) {
25689
+ return numValue >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max);
25690
+ }
25691
+
25692
+ return false;
25646
25693
  }
25647
25694
  },
25648
25695
  watch: {
@@ -25807,7 +25854,11 @@ function renderExtraSuffixIcon(h, _vm) {
25807
25854
  this.$emit('change', {
25808
25855
  value: value,
25809
25856
  $event: evnt
25810
- });
25857
+ }); // 自动更新校验状态
25858
+
25859
+ if (this.$xeform && this.$xeformiteminfo) {
25860
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
25861
+ }
25811
25862
  }
25812
25863
  },
25813
25864
  emitInputEvent: function emitInputEvent(value, evnt) {
@@ -26180,10 +26231,11 @@ function renderExtraSuffixIcon(h, _vm) {
26180
26231
  },
26181
26232
  numberPrevEvent: function numberPrevEvent(evnt) {
26182
26233
  var disabled = this.disabled,
26183
- readonly = this.readonly;
26234
+ readonly = this.readonly,
26235
+ isDisabledAddNumber = this.isDisabledAddNumber;
26184
26236
  clearTimeout(this.downbumTimeout);
26185
26237
 
26186
- if (!disabled && !readonly) {
26238
+ if (!disabled && !readonly && !isDisabledAddNumber) {
26187
26239
  this.numberChange(true, evnt);
26188
26240
  }
26189
26241
 
@@ -26193,10 +26245,11 @@ function renderExtraSuffixIcon(h, _vm) {
26193
26245
  },
26194
26246
  numberNextEvent: function numberNextEvent(evnt) {
26195
26247
  var disabled = this.disabled,
26196
- readonly = this.readonly;
26248
+ readonly = this.readonly,
26249
+ isDisabledSubtractNumber = this.isDisabledSubtractNumber;
26197
26250
  clearTimeout(this.downbumTimeout);
26198
26251
 
26199
- if (!disabled && !readonly) {
26252
+ if (!disabled && !readonly && !isDisabledSubtractNumber) {
26200
26253
  this.numberChange(false, evnt);
26201
26254
  }
26202
26255
 
@@ -27002,6 +27055,12 @@ function renderExtraSuffixIcon(h, _vm) {
27002
27055
  inject: {
27003
27056
  $xecheckboxgroup: {
27004
27057
  default: null
27058
+ },
27059
+ $xeform: {
27060
+ default: null
27061
+ },
27062
+ $xeformiteminfo: {
27063
+ default: null
27005
27064
  }
27006
27065
  },
27007
27066
  computed: {
@@ -27073,10 +27132,14 @@ function renderExtraSuffixIcon(h, _vm) {
27073
27132
  };
27074
27133
 
27075
27134
  if (isGroup) {
27076
- $xecheckboxgroup.handleChecked(params);
27135
+ $xecheckboxgroup.handleChecked(params, evnt);
27077
27136
  } else {
27078
27137
  this.$emit('input', value);
27079
- this.$emit('change', params);
27138
+ this.$emit('change', params); // 自动更新校验状态
27139
+
27140
+ if (this.$xeform && this.$xeformiteminfo) {
27141
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
27142
+ }
27080
27143
  }
27081
27144
  }
27082
27145
  }
@@ -27394,6 +27457,14 @@ function select_renderOpts(h, _vm) {
27394
27457
  components: {
27395
27458
  VxeInput: input
27396
27459
  },
27460
+ inject: {
27461
+ $xeform: {
27462
+ default: null
27463
+ },
27464
+ $xeformiteminfo: {
27465
+ default: null
27466
+ }
27467
+ },
27397
27468
  provide: function provide() {
27398
27469
  return {
27399
27470
  $xeselect: this
@@ -27686,7 +27757,11 @@ function select_renderOpts(h, _vm) {
27686
27757
  this.$emit('change', {
27687
27758
  value: selectValue,
27688
27759
  $event: evnt
27689
- });
27760
+ }); // 自动更新校验状态
27761
+
27762
+ if (this.$xeform && this.$xeformiteminfo) {
27763
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, selectValue);
27764
+ }
27690
27765
  }
27691
27766
  },
27692
27767
  mousedownOptionEvent: function mousedownOptionEvent(evnt) {
@@ -28580,6 +28655,12 @@ Object.keys(option_props).forEach(function (name) {
28580
28655
  inject: {
28581
28656
  $xeradiogroup: {
28582
28657
  default: null
28658
+ },
28659
+ $xeform: {
28660
+ default: null
28661
+ },
28662
+ $xeformiteminfo: {
28663
+ default: null
28583
28664
  }
28584
28665
  },
28585
28666
  computed: {
@@ -28642,10 +28723,14 @@ Object.keys(option_props).forEach(function (name) {
28642
28723
  };
28643
28724
 
28644
28725
  if ($xeradiogroup) {
28645
- $xeradiogroup.handleChecked(params);
28726
+ $xeradiogroup.handleChecked(params, evnt);
28646
28727
  } else {
28647
28728
  this.$emit('input', label);
28648
- this.$emit('change', params);
28729
+ this.$emit('change', params); // 自动更新校验状态
28730
+
28731
+ if (this.$xeform && this.$xeformiteminfo) {
28732
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, label);
28733
+ }
28649
28734
  }
28650
28735
  },
28651
28736
  changeEvent: function changeEvent(evnt) {
@@ -31631,7 +31716,7 @@ function validErrorRuleValue(rule, val) {
31631
31716
  }
31632
31717
  } else {
31633
31718
  var isArrType = type === 'array';
31634
- var hasEmpty = isArrType ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : eqEmptyValue(cellValue);
31719
+ var hasEmpty = isArrType || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(cellValue) || !cellValue.length : eqEmptyValue(cellValue);
31635
31720
 
31636
31721
  if (required ? hasEmpty || validErrorRuleValue(rule, cellValue) : !hasEmpty && validErrorRuleValue(rule, cellValue)) {
31637
31722
  _this3.validRuleErr = true;
@@ -34893,6 +34978,14 @@ var Checkbox = Object.assign(src_checkbox, {
34893
34978
  }
34894
34979
  }
34895
34980
  },
34981
+ inject: {
34982
+ $xeform: {
34983
+ default: null
34984
+ },
34985
+ $xeformiteminfo: {
34986
+ default: null
34987
+ }
34988
+ },
34896
34989
  provide: function provide() {
34897
34990
  return {
34898
34991
  $xecheckboxgroup: this
@@ -34910,7 +35003,7 @@ var Checkbox = Object.assign(src_checkbox, {
34910
35003
  }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
34911
35004
  },
34912
35005
  methods: {
34913
- handleChecked: function handleChecked(params) {
35006
+ handleChecked: function handleChecked(params, evnt) {
34914
35007
  var checked = params.checked,
34915
35008
  label = params.label;
34916
35009
  var checklist = this.value || [];
@@ -34927,7 +35020,11 @@ var Checkbox = Object.assign(src_checkbox, {
34927
35020
  this.$emit('input', checklist);
34928
35021
  this.$emit('change', Object.assign({
34929
35022
  checklist: checklist
34930
- }, params));
35023
+ }, params)); // 自动更新校验状态
35024
+
35025
+ if (this.$xeform && this.$xeformiteminfo) {
35026
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, checklist);
35027
+ }
34931
35028
  }
34932
35029
  }
34933
35030
  });
@@ -34973,6 +35070,14 @@ var Radio = Object.assign(src_radio, {
34973
35070
  }
34974
35071
  }
34975
35072
  },
35073
+ inject: {
35074
+ $xeform: {
35075
+ default: null
35076
+ },
35077
+ $xeformiteminfo: {
35078
+ default: null
35079
+ }
35080
+ },
34976
35081
  provide: function provide() {
34977
35082
  return {
34978
35083
  $xeradiogroup: this
@@ -34995,9 +35100,13 @@ var Radio = Object.assign(src_radio, {
34995
35100
  }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : []);
34996
35101
  },
34997
35102
  methods: {
34998
- handleChecked: function handleChecked(params) {
35103
+ handleChecked: function handleChecked(params, evnt) {
34999
35104
  this.$emit('input', params.label);
35000
- this.$emit('change', params);
35105
+ this.$emit('change', params); // 自动更新校验状态
35106
+
35107
+ if (this.$xeform && this.$xeformiteminfo) {
35108
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, params.label);
35109
+ }
35001
35110
  }
35002
35111
  }
35003
35112
  });
@@ -35041,6 +35150,12 @@ var RadioGroup = Object.assign(radio_src_group, {
35041
35150
  inject: {
35042
35151
  $xeradiogroup: {
35043
35152
  default: null
35153
+ },
35154
+ $xeform: {
35155
+ default: null
35156
+ },
35157
+ $xeformiteminfo: {
35158
+ default: null
35044
35159
  }
35045
35160
  },
35046
35161
  computed: {
@@ -35103,10 +35218,14 @@ var RadioGroup = Object.assign(radio_src_group, {
35103
35218
  };
35104
35219
 
35105
35220
  if ($xeradiogroup) {
35106
- $xeradiogroup.handleChecked(params);
35221
+ $xeradiogroup.handleChecked(params, evnt);
35107
35222
  } else {
35108
35223
  this.$emit('input', label);
35109
- this.$emit('change', params);
35224
+ this.$emit('change', params); // 自动更新校验状态
35225
+
35226
+ if (this.$xeform && this.$xeformiteminfo) {
35227
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, label);
35228
+ }
35110
35229
  }
35111
35230
  },
35112
35231
  changeEvent: function changeEvent(evnt) {
@@ -35207,6 +35326,14 @@ var autoTxtElem;
35207
35326
  }
35208
35327
  }
35209
35328
  },
35329
+ inject: {
35330
+ $xeform: {
35331
+ default: null
35332
+ },
35333
+ $xeformiteminfo: {
35334
+ default: null
35335
+ }
35336
+ },
35210
35337
  data: function data() {
35211
35338
  return {
35212
35339
  inputValue: this.value
@@ -35333,7 +35460,11 @@ var autoTxtElem;
35333
35460
  this.$emit('change', {
35334
35461
  value: value,
35335
35462
  $event: evnt
35336
- });
35463
+ }); // 自动更新校验状态
35464
+
35465
+ if (this.$xeform && this.$xeformiteminfo) {
35466
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
35467
+ }
35337
35468
  }
35338
35469
  },
35339
35470
  inputEvent: function inputEvent(evnt) {
@@ -36403,6 +36534,8 @@ var util_ItemConfig = /*#__PURE__*/function () {
36403
36534
  align: item.align,
36404
36535
  titleAlign: item.titleAlign,
36405
36536
  titleWidth: item.titleWidth,
36537
+ titleColon: item.titleColon,
36538
+ titleAsterisk: item.titleAsterisk,
36406
36539
  titlePrefix: item.titlePrefix,
36407
36540
  titleSuffix: item.titleSuffix,
36408
36541
  titleOverflow: item.titleOverflow,
@@ -36463,9 +36596,9 @@ function destroyItem(_vm) {
36463
36596
  function assemItem(_vm) {
36464
36597
  var $el = _vm.$el,
36465
36598
  $xeform = _vm.$xeform,
36466
- xeformgather = _vm.xeformgather,
36599
+ $xeformgather = _vm.$xeformgather,
36467
36600
  itemConfig = _vm.itemConfig;
36468
- var itemGather = xeformgather ? xeformgather.itemConfig : null;
36601
+ var itemGather = $xeformgather ? $xeformgather.itemConfig : null;
36469
36602
  itemConfig.slots = _vm.$scopedSlots;
36470
36603
 
36471
36604
  if (itemGather) {
@@ -36473,7 +36606,7 @@ function assemItem(_vm) {
36473
36606
  itemGather.children = [];
36474
36607
  }
36475
36608
 
36476
- itemGather.children.splice([].indexOf.call(xeformgather.$el.children, $el), 0, itemConfig);
36609
+ itemGather.children.splice([].indexOf.call($xeformgather.$el.children, $el), 0, itemConfig);
36477
36610
  } else {
36478
36611
  $xeform.staticItems.splice([].indexOf.call($xeform.$refs.hideItem.children, $el), 0, itemConfig);
36479
36612
  }
@@ -36548,20 +36681,7 @@ function renderTitle(h, _vm, item) {
36548
36681
  }, fixVNs));
36549
36682
  return contVNs;
36550
36683
  }
36551
- // CONCATENATED MODULE: ./packages/form/src/form.js
36552
-
36553
-
36554
-
36555
-
36556
-
36557
-
36558
-
36559
-
36560
-
36561
-
36562
-
36563
-
36564
-
36684
+ // CONCATENATED MODULE: ./packages/form/src/form-config-item.js
36565
36685
 
36566
36686
 
36567
36687
 
@@ -36570,91 +36690,41 @@ function renderTitle(h, _vm, item) {
36570
36690
 
36571
36691
 
36572
36692
 
36693
+ /**
36694
+ * 配置式项
36695
+ */
36573
36696
 
36574
-
36575
-
36576
-
36577
-
36578
-
36579
-
36580
- var form_Rule = /*#__PURE__*/function () {
36581
- function Rule(rule) {
36582
- _classCallCheck(this, Rule);
36583
-
36584
- Object.assign(this, {
36585
- $options: rule,
36586
- required: rule.required,
36587
- min: rule.min,
36588
- max: rule.min,
36589
- type: rule.type,
36590
- pattern: rule.pattern,
36591
- validator: rule.validator,
36592
- trigger: rule.trigger,
36593
- maxWidth: rule.maxWidth
36594
- });
36595
- }
36596
-
36597
- _createClass(Rule, [{
36598
- key: "content",
36599
- get: function get() {
36600
- return getFuncText(this.$options.content || this.$options.message);
36601
- }
36602
- }, {
36603
- key: "message",
36604
- get: function get() {
36605
- return this.content;
36697
+ var VxeFormConfigItem = {
36698
+ name: 'VxeFormConfigItem',
36699
+ props: {
36700
+ itemConfig: Object
36701
+ },
36702
+ inject: {
36703
+ $xeform: {
36704
+ default: null
36606
36705
  }
36607
- }]);
36608
-
36609
- return Rule;
36610
- }();
36611
-
36612
- function form_validErrorRuleValue(rule, val) {
36613
- var type = rule.type,
36614
- min = rule.min,
36615
- max = rule.max,
36616
- pattern = rule.pattern;
36617
- var isNumType = type === 'number';
36618
- var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(val); // 判断数值
36619
-
36620
- if (isNumType && isNaN(val)) {
36621
- return true;
36622
- } // 如果存在 min,判断最小值
36623
-
36624
-
36625
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(min) && numVal < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min)) {
36626
- return true;
36627
- } // 如果存在 max,判断最大值
36628
-
36629
-
36630
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(max) && numVal > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max)) {
36631
- return true;
36632
- } // 如果存在 pattern,正则校验
36633
-
36634
-
36635
- if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
36636
- return true;
36637
- }
36638
-
36639
- return false;
36640
- }
36641
-
36642
- function getResetValue(value, resetValue) {
36643
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
36644
- resetValue = [];
36645
- }
36646
-
36647
- return resetValue;
36648
- }
36649
-
36650
- function renderItems(h, _vm, itemList) {
36651
- var _e = _vm._e,
36652
- rules = _vm.rules,
36653
- data = _vm.data,
36654
- collapseAll = _vm.collapseAll,
36655
- validOpts = _vm.validOpts,
36656
- allTitleOverflow = _vm.titleOverflow;
36657
- return itemList.map(function (item) {
36706
+ },
36707
+ provide: function provide() {
36708
+ return {
36709
+ $xeformgather: null,
36710
+ $xeformiteminfo: {
36711
+ itemConfig: this.itemConfig
36712
+ }
36713
+ };
36714
+ },
36715
+ render: function render(h) {
36716
+ var _e = this._e,
36717
+ $xeform = this.$xeform,
36718
+ item = this.itemConfig;
36719
+ var rules = $xeform.rules,
36720
+ data = $xeform.data,
36721
+ collapseAll = $xeform.collapseAll,
36722
+ validOpts = $xeform.validOpts,
36723
+ allTitleAlign = $xeform.titleAlign,
36724
+ allTitleWidth = $xeform.titleWidth,
36725
+ allTitleColon = $xeform.titleColon,
36726
+ allTitleAsterisk = $xeform.titleAsterisk,
36727
+ allTitleOverflow = $xeform.titleOverflow;
36658
36728
  var slots = item.slots,
36659
36729
  title = item.title,
36660
36730
  folding = item.folding,
@@ -36669,10 +36739,12 @@ function renderItems(h, _vm, itemList) {
36669
36739
  titleOverflow = item.titleOverflow,
36670
36740
  children = item.children;
36671
36741
  var compConf = isEnableConf(itemRender) ? v_x_e_table.renderer.get(itemRender.name) : null;
36672
- var span = item.span || _vm.span;
36673
- var align = item.align || _vm.align;
36674
- var titleAlign = item.titleAlign || _vm.titleAlign;
36675
- var titleWidth = item.titleWidth || _vm.titleWidth;
36742
+ var span = item.span || $xeform.span;
36743
+ var align = item.align || $xeform.align;
36744
+ var titleAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAlign) ? allTitleAlign : item.titleAlign;
36745
+ var titleWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleWidth) ? allTitleWidth : item.titleWidth;
36746
+ var titleColon = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleColon) ? allTitleColon : item.titleColon;
36747
+ var titleAsterisk = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(item.titleAsterisk) ? allTitleAsterisk : item.titleAsterisk;
36676
36748
  var itemVisibleMethod = visibleMethod;
36677
36749
  var itemOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isUndefined(titleOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNull(titleOverflow) ? allTitleOverflow : titleOverflow;
36678
36750
  var showEllipsis = itemOverflow === 'ellipsis';
@@ -36684,7 +36756,7 @@ function renderItems(h, _vm, itemList) {
36684
36756
  field: field,
36685
36757
  property: field,
36686
36758
  item: item,
36687
- $form: _vm
36759
+ $form: $xeform
36688
36760
  };
36689
36761
  var isRequired;
36690
36762
 
@@ -36696,7 +36768,14 @@ function renderItems(h, _vm, itemList) {
36696
36768
  var isGather = children && children.length > 0;
36697
36769
 
36698
36770
  if (isGather) {
36699
- var childVNs = renderItems(h, _vm, item.children);
36771
+ var childVNs = item.children.map(function (childItem, index) {
36772
+ return h(VxeFormConfigItem, {
36773
+ key: index,
36774
+ props: {
36775
+ itemConfig: childItem
36776
+ }
36777
+ });
36778
+ });
36700
36779
  return childVNs.length ? h('div', {
36701
36780
  class: ['vxe-form--gather vxe-row', item.id, span ? "vxe-col--".concat(span, " is--span") : '', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '']
36702
36781
  }, childVNs) : _e();
@@ -36719,29 +36798,34 @@ function renderItems(h, _vm, itemList) {
36719
36798
  var contentVNs = [];
36720
36799
 
36721
36800
  if (slots && slots.default) {
36722
- contentVNs = _vm.callSlot(slots.default, params, h);
36801
+ contentVNs = $xeform.callSlot(slots.default, params, h);
36723
36802
  } else if (compConf && compConf.renderItemContent) {
36724
- contentVNs = compConf.renderItemContent.call(_vm, h, itemRender, params);
36803
+ contentVNs = compConf.renderItemContent.call($xeform, h, itemRender, params);
36725
36804
  } else if (compConf && compConf.renderItem) {
36726
- contentVNs = compConf.renderItem.call(_vm, h, itemRender, params);
36805
+ contentVNs = compConf.renderItem.call($xeform, h, itemRender, params);
36727
36806
  } else if (field) {
36728
- contentVNs = ["".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
36807
+ contentVNs = [external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toValueString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
36729
36808
  }
36730
36809
 
36731
36810
  var ons = showTooltip ? {
36732
36811
  mouseenter: function mouseenter(evnt) {
36733
- _vm.triggerTitleTipEvent(evnt, params);
36812
+ $xeform.triggerTitleTipEvent(evnt, params);
36734
36813
  },
36735
- mouseleave: _vm.handleTitleTipLeaveEvent
36814
+ mouseleave: $xeform.handleTitleTipLeaveEvent
36736
36815
  } : {};
36737
36816
  return h('div', {
36738
36817
  class: ['vxe-form--item', item.id, span ? "vxe-col--".concat(span, " is--span") : null, className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className(params) : className : '', {
36739
36818
  'is--title': title,
36819
+ 'is--colon': titleColon,
36820
+ 'is--asterisk': titleAsterisk,
36740
36821
  'is--required': isRequired,
36741
36822
  'is--hidden': folding && collapseAll,
36742
36823
  'is--active': !itemVisibleMethod || itemVisibleMethod(params),
36743
36824
  'is--error': showError
36744
36825
  }],
36826
+ props: {
36827
+ itemConfig: item
36828
+ },
36745
36829
  key: item.id
36746
36830
  }, [h('div', {
36747
36831
  class: 'vxe-form--item-inner'
@@ -36756,12 +36840,12 @@ function renderItems(h, _vm, itemList) {
36756
36840
  title: showTitle ? getFuncText(title) : null
36757
36841
  },
36758
36842
  on: ons
36759
- }, renderTitle(h, _vm, item)) : null, h('div', {
36843
+ }, renderTitle(h, $xeform, item)) : null, h('div', {
36760
36844
  class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
36761
36845
  }, contentVNs.concat([collapseNode ? h('div', {
36762
36846
  class: 'vxe-form--item-trigger-node',
36763
36847
  on: {
36764
- click: _vm.toggleCollapseEvent
36848
+ click: $xeform.toggleCollapseEvent
36765
36849
  }
36766
36850
  }, [h('span', {
36767
36851
  class: 'vxe-form--item-trigger-text'
@@ -36773,7 +36857,106 @@ function renderItems(h, _vm, itemList) {
36773
36857
  width: "".concat(errRule.maxWidth, "px")
36774
36858
  } : null
36775
36859
  }, errRule.content) : null]))])]);
36776
- });
36860
+ }
36861
+ };
36862
+ /* harmony default export */ var form_config_item = (VxeFormConfigItem);
36863
+ // CONCATENATED MODULE: ./packages/form/src/form.js
36864
+
36865
+
36866
+
36867
+
36868
+
36869
+
36870
+
36871
+
36872
+
36873
+
36874
+
36875
+
36876
+
36877
+
36878
+
36879
+
36880
+
36881
+
36882
+
36883
+
36884
+
36885
+
36886
+
36887
+
36888
+
36889
+
36890
+
36891
+
36892
+ var form_Rule = /*#__PURE__*/function () {
36893
+ function Rule(rule) {
36894
+ _classCallCheck(this, Rule);
36895
+
36896
+ Object.assign(this, {
36897
+ $options: rule,
36898
+ required: rule.required,
36899
+ min: rule.min,
36900
+ max: rule.min,
36901
+ type: rule.type,
36902
+ pattern: rule.pattern,
36903
+ validator: rule.validator,
36904
+ trigger: rule.trigger,
36905
+ maxWidth: rule.maxWidth
36906
+ });
36907
+ }
36908
+
36909
+ _createClass(Rule, [{
36910
+ key: "content",
36911
+ get: function get() {
36912
+ return getFuncText(this.$options.content || this.$options.message);
36913
+ }
36914
+ }, {
36915
+ key: "message",
36916
+ get: function get() {
36917
+ return this.content;
36918
+ }
36919
+ }]);
36920
+
36921
+ return Rule;
36922
+ }();
36923
+
36924
+ function form_validErrorRuleValue(rule, val) {
36925
+ var type = rule.type,
36926
+ min = rule.min,
36927
+ max = rule.max,
36928
+ pattern = rule.pattern;
36929
+ var isNumType = type === 'number';
36930
+ var numVal = isNumType ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(val) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.getSize(val); // 判断数值
36931
+
36932
+ if (isNumType && isNaN(val)) {
36933
+ return true;
36934
+ } // 如果存在 min,判断最小值
36935
+
36936
+
36937
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(min) && numVal < external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(min)) {
36938
+ return true;
36939
+ } // 如果存在 max,判断最大值
36940
+
36941
+
36942
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(max) && numVal > external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toNumber(max)) {
36943
+ return true;
36944
+ } // 如果存在 pattern,正则校验
36945
+
36946
+
36947
+ if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
36948
+ return true;
36949
+ }
36950
+
36951
+ return false;
36952
+ }
36953
+
36954
+ function getResetValue(value, resetValue) {
36955
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
36956
+ resetValue = [];
36957
+ }
36958
+
36959
+ return resetValue;
36777
36960
  }
36778
36961
 
36779
36962
  /* harmony default export */ var src_form = ({
@@ -36864,7 +37047,10 @@ function renderItems(h, _vm, itemList) {
36864
37047
  },
36865
37048
  provide: function provide() {
36866
37049
  return {
36867
- $xeform: this
37050
+ $xeform: this,
37051
+ $xeformgather: null,
37052
+ $xeformitem: null,
37053
+ $xeformiteminfo: null
36868
37054
  };
36869
37055
  },
36870
37056
  computed: {
@@ -36911,22 +37097,30 @@ function renderItems(h, _vm, itemList) {
36911
37097
  formItems = this.formItems,
36912
37098
  customLayout = this.customLayout;
36913
37099
  var hasUseTooltip = v_x_e_table._tooltip;
37100
+ var defaultSlot = this.$scopedSlots.default;
36914
37101
  return h('form', {
36915
37102
  class: ['vxe-form', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
36916
37103
  items: formItems,
36917
37104
  data: data,
36918
37105
  $form: this
36919
- }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--colon', this.titleColon), _defineProperty(_ref, 'is--asterisk', this.titleAsterisk), _defineProperty(_ref, 'is--loading', loading), _ref)],
37106
+ }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--loading', loading), _ref)],
36920
37107
  on: {
36921
37108
  submit: this.submitEvent,
36922
37109
  reset: this.resetEvent
36923
37110
  }
36924
37111
  }, [h('div', {
36925
37112
  class: 'vxe-form--wrapper vxe-row'
36926
- }, customLayout ? this.$slots.default : renderItems(h, this, formItems)), h('div', {
37113
+ }, customLayout ? defaultSlot ? defaultSlot.call(this, h, {}) : [] : formItems.map(function (item, index) {
37114
+ return h(form_config_item, {
37115
+ key: index,
37116
+ props: {
37117
+ itemConfig: item
37118
+ }
37119
+ });
37120
+ })), h('div', {
36927
37121
  class: 'vxe-form-slots',
36928
37122
  ref: 'hideItem'
36929
- }, customLayout ? [] : this.$slots.default), h('div', {
37123
+ }, customLayout ? [] : defaultSlot ? defaultSlot.call(this, h, {}) : []), h('div', {
36930
37124
  class: ['vxe-loading', {
36931
37125
  'is--visible': loading
36932
37126
  }]
@@ -37305,7 +37499,7 @@ function renderItems(h, _vm, itemList) {
37305
37499
  }
37306
37500
  } else {
37307
37501
  var isArrType = type === 'array';
37308
- var hasEmpty = isArrType ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(itemValue) || !itemValue.length : eqEmptyValue(itemValue);
37502
+ var hasEmpty = isArrType || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(itemValue) ? !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(itemValue) || !itemValue.length : eqEmptyValue(itemValue);
37309
37503
 
37310
37504
  if (required ? hasEmpty || form_validErrorRuleValue(rule, itemValue) : !hasEmpty && form_validErrorRuleValue(rule, itemValue)) {
37311
37505
  errorRules.push(new form_Rule(rule));
@@ -37366,24 +37560,16 @@ function renderItems(h, _vm, itemList) {
37366
37560
  }
37367
37561
  });
37368
37562
  },
37369
-
37370
- /**
37371
- * 更新项状态
37372
- * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
37373
- * 如果单元格配置了校验规则,则会进行校验
37374
- */
37375
- updateStatus: function updateStatus(scope, itemValue) {
37563
+ triggerItemEvent: function triggerItemEvent(evnt, field, itemValue) {
37376
37564
  var _this9 = this;
37377
37565
 
37378
- var property = scope.property;
37379
-
37380
- if (property) {
37381
- this.validItemRules('change', property, itemValue).then(function () {
37382
- _this9.clearValidate(property);
37566
+ if (field) {
37567
+ return this.validItemRules(evnt ? evnt.type : 'all', field, itemValue).then(function () {
37568
+ _this9.clearValidate(field);
37383
37569
  }).catch(function (_ref3) {
37384
37570
  var rule = _ref3.rule;
37385
37571
 
37386
- var item = _this9.getItemByField(property);
37572
+ var item = _this9.getItemByField(field);
37387
37573
 
37388
37574
  if (item) {
37389
37575
  item.showError = true;
@@ -37391,6 +37577,18 @@ function renderItems(h, _vm, itemList) {
37391
37577
  }
37392
37578
  });
37393
37579
  }
37580
+
37581
+ return this.$nextTick();
37582
+ },
37583
+
37584
+ /**
37585
+ * 更新项状态
37586
+ * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
37587
+ * 如果单元格配置了校验规则,则会进行校验
37588
+ */
37589
+ updateStatus: function updateStatus(scope, itemValue) {
37590
+ var field = scope.field;
37591
+ return this.triggerItemEvent(new Event('change'), field, itemValue);
37394
37592
  }
37395
37593
  }
37396
37594
  });
@@ -37424,6 +37622,14 @@ var form_item_props = {
37424
37622
  align: String,
37425
37623
  titleAlign: String,
37426
37624
  titleWidth: [String, Number],
37625
+ titleColon: {
37626
+ type: Boolean,
37627
+ default: null
37628
+ },
37629
+ titleAsterisk: {
37630
+ type: Boolean,
37631
+ default: null
37632
+ },
37427
37633
  className: [String, Function],
37428
37634
  titleOverflow: {
37429
37635
  type: [Boolean, String],
@@ -37565,10 +37771,18 @@ var form_item_renderItem = function renderItem(h, _vm, item, slots) {
37565
37771
  $xeform: {
37566
37772
  default: null
37567
37773
  },
37568
- xeformgather: {
37774
+ $xeformgather: {
37569
37775
  default: null
37570
37776
  }
37571
37777
  },
37778
+ provide: function provide() {
37779
+ return {
37780
+ $xeformitem: this,
37781
+ $xeformiteminfo: {
37782
+ itemConfig: this.itemConfig
37783
+ }
37784
+ };
37785
+ },
37572
37786
  data: function data() {
37573
37787
  return {
37574
37788
  itemConfig: null
@@ -37607,7 +37821,11 @@ var FormItem = Object.assign(form_item, {
37607
37821
  extends: form_item,
37608
37822
  provide: function provide() {
37609
37823
  return {
37610
- xeformgather: this
37824
+ $xeformgather: this,
37825
+ xeformitem: null,
37826
+ $xeformiteminfo: {
37827
+ itemConfig: this.itemConfig
37828
+ }
37611
37829
  };
37612
37830
  },
37613
37831
  created: function created() {
@@ -37753,6 +37971,14 @@ var Option = Object.assign(src_option, {
37753
37971
  openIcon: String,
37754
37972
  closeIcon: String
37755
37973
  },
37974
+ inject: {
37975
+ $xeform: {
37976
+ default: null
37977
+ },
37978
+ $xeformiteminfo: {
37979
+ default: null
37980
+ }
37981
+ },
37756
37982
  data: function data() {
37757
37983
  return {
37758
37984
  isActivated: false,
@@ -37843,7 +38069,12 @@ var Option = Object.assign(src_option, {
37843
38069
  this.$emit('change', {
37844
38070
  value: value,
37845
38071
  $event: evnt
37846
- });
38072
+ }); // 自动更新校验状态
38073
+
38074
+ if (this.$xeform && this.$xeformiteminfo) {
38075
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
38076
+ }
38077
+
37847
38078
  this.activeTimeout = setTimeout(function () {
37848
38079
  _this2.hasAnimat = false;
37849
38080
  }, 400);