vxe-table 3.5.7-beta.1 → 3.5.7-beta.2

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 (73) 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/form/src/form-config-item.js +185 -0
  8. package/lib/form/src/form-config-item.min.js +1 -0
  9. package/lib/form/src/form-gather.js +5 -1
  10. package/lib/form/src/form-gather.min.js +1 -1
  11. package/lib/form/src/form-item.js +17 -1
  12. package/lib/form/src/form-item.min.js +1 -1
  13. package/lib/form/src/form.js +35 -149
  14. package/lib/form/src/form.min.js +1 -1
  15. package/lib/form/src/util.js +3 -3
  16. package/lib/form/src/util.min.js +1 -1
  17. package/lib/form/style/style.css +6 -6
  18. package/lib/form/style/style.min.css +1 -1
  19. package/lib/icon/style/style.css +11 -9
  20. package/lib/icon/style/style.min.css +1 -1
  21. package/lib/index.css +1 -1
  22. package/lib/index.umd.js +382 -157
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/input/src/input.js +60 -7
  25. package/lib/input/src/input.min.js +1 -1
  26. package/lib/input/style/style.css +5 -0
  27. package/lib/input/style/style.min.css +1 -1
  28. package/lib/radio/src/button.js +12 -2
  29. package/lib/radio/src/button.min.js +1 -1
  30. package/lib/radio/src/group.js +14 -2
  31. package/lib/radio/src/group.min.js +1 -1
  32. package/lib/radio/src/radio.js +12 -2
  33. package/lib/radio/src/radio.min.js +1 -1
  34. package/lib/select/src/select.js +13 -1
  35. package/lib/select/src/select.min.js +1 -1
  36. package/lib/style.css +1 -1
  37. package/lib/style.min.css +1 -1
  38. package/lib/switch/src/switch.js +14 -1
  39. package/lib/switch/src/switch.min.js +1 -1
  40. package/lib/textarea/src/textarea.js +13 -1
  41. package/lib/textarea/src/textarea.min.js +1 -1
  42. package/lib/tools/log.js +1 -1
  43. package/lib/tools/log.min.js +1 -1
  44. package/lib/v-x-e-table/index.js +1 -1
  45. package/lib/v-x-e-table/index.min.js +1 -1
  46. package/lib/validator/src/mixin.js +1 -1
  47. package/lib/validator/src/mixin.min.js +1 -1
  48. package/package.json +2 -2
  49. package/packages/checkbox/src/checkbox.js +11 -1
  50. package/packages/checkbox/src/group.js +13 -1
  51. package/packages/form/src/form-config-item.js +150 -0
  52. package/packages/form/src/form-gather.js +5 -1
  53. package/packages/form/src/form-item.js +17 -1
  54. package/packages/form/src/form.js +31 -126
  55. package/packages/form/src/util.js +3 -3
  56. package/packages/input/src/input.js +45 -6
  57. package/packages/radio/src/button.js +11 -1
  58. package/packages/radio/src/group.js +13 -1
  59. package/packages/radio/src/radio.js +11 -1
  60. package/packages/select/src/select.js +12 -0
  61. package/packages/switch/src/switch.js +12 -0
  62. package/packages/textarea/src/textarea.js +12 -0
  63. package/packages/validator/src/mixin.js +1 -1
  64. package/styles/button.scss +0 -5
  65. package/styles/form.scss +17 -19
  66. package/styles/icon.scss +10 -9
  67. package/styles/input.scss +4 -0
  68. package/styles/variable.scss +1 -0
  69. package/types/optgroup.d.ts +1 -1
  70. package/types/option.d.ts +1 -1
  71. package/types/pulldown.d.ts +1 -1
  72. package/types/radio-button.d.ts +1 -1
  73. 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-beta.2", "] ").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-beta.2",
10077
10077
  reg: reg,
10078
10078
  use: use,
10079
10079
  setup: setup,
@@ -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) {
@@ -36463,9 +36594,9 @@ function destroyItem(_vm) {
36463
36594
  function assemItem(_vm) {
36464
36595
  var $el = _vm.$el,
36465
36596
  $xeform = _vm.$xeform,
36466
- xeformgather = _vm.xeformgather,
36597
+ $xeformgather = _vm.$xeformgather,
36467
36598
  itemConfig = _vm.itemConfig;
36468
- var itemGather = xeformgather ? xeformgather.itemConfig : null;
36599
+ var itemGather = $xeformgather ? $xeformgather.itemConfig : null;
36469
36600
  itemConfig.slots = _vm.$scopedSlots;
36470
36601
 
36471
36602
  if (itemGather) {
@@ -36473,7 +36604,7 @@ function assemItem(_vm) {
36473
36604
  itemGather.children = [];
36474
36605
  }
36475
36606
 
36476
- itemGather.children.splice([].indexOf.call(xeformgather.$el.children, $el), 0, itemConfig);
36607
+ itemGather.children.splice([].indexOf.call($xeformgather.$el.children, $el), 0, itemConfig);
36477
36608
  } else {
36478
36609
  $xeform.staticItems.splice([].indexOf.call($xeform.$refs.hideItem.children, $el), 0, itemConfig);
36479
36610
  }
@@ -36548,20 +36679,7 @@ function renderTitle(h, _vm, item) {
36548
36679
  }, fixVNs));
36549
36680
  return contVNs;
36550
36681
  }
36551
- // CONCATENATED MODULE: ./packages/form/src/form.js
36552
-
36553
-
36554
-
36555
-
36556
-
36557
-
36558
-
36559
-
36560
-
36561
-
36562
-
36563
-
36564
-
36682
+ // CONCATENATED MODULE: ./packages/form/src/form-config-item.js
36565
36683
 
36566
36684
 
36567
36685
 
@@ -36570,91 +36688,37 @@ function renderTitle(h, _vm, item) {
36570
36688
 
36571
36689
 
36572
36690
 
36691
+ /**
36692
+ * 配置式项
36693
+ */
36573
36694
 
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;
36695
+ var VxeFormConfigItem = {
36696
+ name: 'VxeFormConfigItem',
36697
+ props: {
36698
+ itemConfig: Object
36699
+ },
36700
+ inject: {
36701
+ $xeform: {
36702
+ default: null
36606
36703
  }
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) {
36704
+ },
36705
+ provide: function provide() {
36706
+ return {
36707
+ $xeformgather: null,
36708
+ $xeformiteminfo: {
36709
+ itemConfig: this.itemConfig
36710
+ }
36711
+ };
36712
+ },
36713
+ render: function render(h) {
36714
+ var _e = this._e,
36715
+ $xeform = this.$xeform,
36716
+ item = this.itemConfig;
36717
+ var rules = $xeform.rules,
36718
+ data = $xeform.data,
36719
+ collapseAll = $xeform.collapseAll,
36720
+ validOpts = $xeform.validOpts,
36721
+ allTitleOverflow = $xeform.titleOverflow;
36658
36722
  var slots = item.slots,
36659
36723
  title = item.title,
36660
36724
  folding = item.folding,
@@ -36669,10 +36733,12 @@ function renderItems(h, _vm, itemList) {
36669
36733
  titleOverflow = item.titleOverflow,
36670
36734
  children = item.children;
36671
36735
  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;
36736
+ var span = item.span || $xeform.span;
36737
+ var align = item.align || $xeform.align;
36738
+ var titleAlign = item.titleAlign || $xeform.titleAlign;
36739
+ var titleWidth = item.titleWidth || $xeform.titleWidth;
36740
+ var titleColon = item.titleColon === null ? $xeform.titleColon : item.titleColon;
36741
+ var titleAsterisk = item.titleAsterisk === null ? $xeform.titleAsterisk : item.titleAsterisk;
36676
36742
  var itemVisibleMethod = visibleMethod;
36677
36743
  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
36744
  var showEllipsis = itemOverflow === 'ellipsis';
@@ -36684,7 +36750,7 @@ function renderItems(h, _vm, itemList) {
36684
36750
  field: field,
36685
36751
  property: field,
36686
36752
  item: item,
36687
- $form: _vm
36753
+ $form: $xeform
36688
36754
  };
36689
36755
  var isRequired;
36690
36756
 
@@ -36696,7 +36762,14 @@ function renderItems(h, _vm, itemList) {
36696
36762
  var isGather = children && children.length > 0;
36697
36763
 
36698
36764
  if (isGather) {
36699
- var childVNs = renderItems(h, _vm, item.children);
36765
+ var childVNs = item.children.map(function (childItem, index) {
36766
+ return h(VxeFormConfigItem, {
36767
+ key: index,
36768
+ props: {
36769
+ itemConfig: childItem
36770
+ }
36771
+ });
36772
+ });
36700
36773
  return childVNs.length ? h('div', {
36701
36774
  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
36775
  }, childVNs) : _e();
@@ -36719,29 +36792,34 @@ function renderItems(h, _vm, itemList) {
36719
36792
  var contentVNs = [];
36720
36793
 
36721
36794
  if (slots && slots.default) {
36722
- contentVNs = _vm.callSlot(slots.default, params, h);
36795
+ contentVNs = $xeform.callSlot(slots.default, params, h);
36723
36796
  } else if (compConf && compConf.renderItemContent) {
36724
- contentVNs = compConf.renderItemContent.call(_vm, h, itemRender, params);
36797
+ contentVNs = compConf.renderItemContent.call($xeform, h, itemRender, params);
36725
36798
  } else if (compConf && compConf.renderItem) {
36726
- contentVNs = compConf.renderItem.call(_vm, h, itemRender, params);
36799
+ contentVNs = compConf.renderItem.call($xeform, h, itemRender, params);
36727
36800
  } else if (field) {
36728
36801
  contentVNs = ["".concat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(data, field))];
36729
36802
  }
36730
36803
 
36731
36804
  var ons = showTooltip ? {
36732
36805
  mouseenter: function mouseenter(evnt) {
36733
- _vm.triggerTitleTipEvent(evnt, params);
36806
+ $xeform.triggerTitleTipEvent(evnt, params);
36734
36807
  },
36735
- mouseleave: _vm.handleTitleTipLeaveEvent
36808
+ mouseleave: $xeform.handleTitleTipLeaveEvent
36736
36809
  } : {};
36737
36810
  return h('div', {
36738
36811
  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
36812
  'is--title': title,
36813
+ 'is--colon': titleColon,
36814
+ 'is--asterisk': titleAsterisk,
36740
36815
  'is--required': isRequired,
36741
36816
  'is--hidden': folding && collapseAll,
36742
36817
  'is--active': !itemVisibleMethod || itemVisibleMethod(params),
36743
36818
  'is--error': showError
36744
36819
  }],
36820
+ props: {
36821
+ itemConfig: item
36822
+ },
36745
36823
  key: item.id
36746
36824
  }, [h('div', {
36747
36825
  class: 'vxe-form--item-inner'
@@ -36756,12 +36834,12 @@ function renderItems(h, _vm, itemList) {
36756
36834
  title: showTitle ? getFuncText(title) : null
36757
36835
  },
36758
36836
  on: ons
36759
- }, renderTitle(h, _vm, item)) : null, h('div', {
36837
+ }, renderTitle(h, $xeform, item)) : null, h('div', {
36760
36838
  class: ['vxe-form--item-content', align ? "align--".concat(align) : null]
36761
36839
  }, contentVNs.concat([collapseNode ? h('div', {
36762
36840
  class: 'vxe-form--item-trigger-node',
36763
36841
  on: {
36764
- click: _vm.toggleCollapseEvent
36842
+ click: $xeform.toggleCollapseEvent
36765
36843
  }
36766
36844
  }, [h('span', {
36767
36845
  class: 'vxe-form--item-trigger-text'
@@ -36773,7 +36851,106 @@ function renderItems(h, _vm, itemList) {
36773
36851
  width: "".concat(errRule.maxWidth, "px")
36774
36852
  } : null
36775
36853
  }, errRule.content) : null]))])]);
36776
- });
36854
+ }
36855
+ };
36856
+ /* harmony default export */ var form_config_item = (VxeFormConfigItem);
36857
+ // CONCATENATED MODULE: ./packages/form/src/form.js
36858
+
36859
+
36860
+
36861
+
36862
+
36863
+
36864
+
36865
+
36866
+
36867
+
36868
+
36869
+
36870
+
36871
+
36872
+
36873
+
36874
+
36875
+
36876
+
36877
+
36878
+
36879
+
36880
+
36881
+
36882
+
36883
+
36884
+
36885
+
36886
+ var form_Rule = /*#__PURE__*/function () {
36887
+ function Rule(rule) {
36888
+ _classCallCheck(this, Rule);
36889
+
36890
+ Object.assign(this, {
36891
+ $options: rule,
36892
+ required: rule.required,
36893
+ min: rule.min,
36894
+ max: rule.min,
36895
+ type: rule.type,
36896
+ pattern: rule.pattern,
36897
+ validator: rule.validator,
36898
+ trigger: rule.trigger,
36899
+ maxWidth: rule.maxWidth
36900
+ });
36901
+ }
36902
+
36903
+ _createClass(Rule, [{
36904
+ key: "content",
36905
+ get: function get() {
36906
+ return getFuncText(this.$options.content || this.$options.message);
36907
+ }
36908
+ }, {
36909
+ key: "message",
36910
+ get: function get() {
36911
+ return this.content;
36912
+ }
36913
+ }]);
36914
+
36915
+ return Rule;
36916
+ }();
36917
+
36918
+ function form_validErrorRuleValue(rule, val) {
36919
+ var type = rule.type,
36920
+ min = rule.min,
36921
+ max = rule.max,
36922
+ pattern = rule.pattern;
36923
+ var isNumType = type === 'number';
36924
+ 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); // 判断数值
36925
+
36926
+ if (isNumType && isNaN(val)) {
36927
+ return true;
36928
+ } // 如果存在 min,判断最小值
36929
+
36930
+
36931
+ 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)) {
36932
+ return true;
36933
+ } // 如果存在 max,判断最大值
36934
+
36935
+
36936
+ 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)) {
36937
+ return true;
36938
+ } // 如果存在 pattern,正则校验
36939
+
36940
+
36941
+ if (pattern && !(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
36942
+ return true;
36943
+ }
36944
+
36945
+ return false;
36946
+ }
36947
+
36948
+ function getResetValue(value, resetValue) {
36949
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(value)) {
36950
+ resetValue = [];
36951
+ }
36952
+
36953
+ return resetValue;
36777
36954
  }
36778
36955
 
36779
36956
  /* harmony default export */ var src_form = ({
@@ -36864,7 +37041,10 @@ function renderItems(h, _vm, itemList) {
36864
37041
  },
36865
37042
  provide: function provide() {
36866
37043
  return {
36867
- $xeform: this
37044
+ $xeform: this,
37045
+ $xeformgather: null,
37046
+ $xeformitem: null,
37047
+ $xeformiteminfo: null
36868
37048
  };
36869
37049
  },
36870
37050
  computed: {
@@ -36911,22 +37091,30 @@ function renderItems(h, _vm, itemList) {
36911
37091
  formItems = this.formItems,
36912
37092
  customLayout = this.customLayout;
36913
37093
  var hasUseTooltip = v_x_e_table._tooltip;
37094
+ var defaultSlot = this.$scopedSlots.default;
36914
37095
  return h('form', {
36915
37096
  class: ['vxe-form', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(className) ? className({
36916
37097
  items: formItems,
36917
37098
  data: data,
36918
37099
  $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)],
37100
+ }) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--loading', loading), _ref)],
36920
37101
  on: {
36921
37102
  submit: this.submitEvent,
36922
37103
  reset: this.resetEvent
36923
37104
  }
36924
37105
  }, [h('div', {
36925
37106
  class: 'vxe-form--wrapper vxe-row'
36926
- }, customLayout ? this.$slots.default : renderItems(h, this, formItems)), h('div', {
37107
+ }, customLayout ? defaultSlot ? defaultSlot.call(this, h, {}) : [] : formItems.map(function (item, index) {
37108
+ return h(form_config_item, {
37109
+ key: index,
37110
+ props: {
37111
+ itemConfig: item
37112
+ }
37113
+ });
37114
+ })), h('div', {
36927
37115
  class: 'vxe-form-slots',
36928
37116
  ref: 'hideItem'
36929
- }, customLayout ? [] : this.$slots.default), h('div', {
37117
+ }, customLayout ? [] : defaultSlot ? defaultSlot.call(this, h, {}) : []), h('div', {
36930
37118
  class: ['vxe-loading', {
36931
37119
  'is--visible': loading
36932
37120
  }]
@@ -37305,7 +37493,7 @@ function renderItems(h, _vm, itemList) {
37305
37493
  }
37306
37494
  } else {
37307
37495
  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);
37496
+ 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
37497
 
37310
37498
  if (required ? hasEmpty || form_validErrorRuleValue(rule, itemValue) : !hasEmpty && form_validErrorRuleValue(rule, itemValue)) {
37311
37499
  errorRules.push(new form_Rule(rule));
@@ -37366,24 +37554,16 @@ function renderItems(h, _vm, itemList) {
37366
37554
  }
37367
37555
  });
37368
37556
  },
37369
-
37370
- /**
37371
- * 更新项状态
37372
- * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
37373
- * 如果单元格配置了校验规则,则会进行校验
37374
- */
37375
- updateStatus: function updateStatus(scope, itemValue) {
37557
+ triggerItemEvent: function triggerItemEvent(evnt, field, itemValue) {
37376
37558
  var _this9 = this;
37377
37559
 
37378
- var property = scope.property;
37379
-
37380
- if (property) {
37381
- this.validItemRules('change', property, itemValue).then(function () {
37382
- _this9.clearValidate(property);
37560
+ if (field) {
37561
+ return this.validItemRules(evnt ? evnt.type : 'all', field, itemValue).then(function () {
37562
+ _this9.clearValidate(field);
37383
37563
  }).catch(function (_ref3) {
37384
37564
  var rule = _ref3.rule;
37385
37565
 
37386
- var item = _this9.getItemByField(property);
37566
+ var item = _this9.getItemByField(field);
37387
37567
 
37388
37568
  if (item) {
37389
37569
  item.showError = true;
@@ -37391,6 +37571,18 @@ function renderItems(h, _vm, itemList) {
37391
37571
  }
37392
37572
  });
37393
37573
  }
37574
+
37575
+ return this.$nextTick();
37576
+ },
37577
+
37578
+ /**
37579
+ * 更新项状态
37580
+ * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
37581
+ * 如果单元格配置了校验规则,则会进行校验
37582
+ */
37583
+ updateStatus: function updateStatus(scope, itemValue) {
37584
+ var field = scope.field;
37585
+ return this.triggerItemEvent(new Event('change'), field, itemValue);
37394
37586
  }
37395
37587
  }
37396
37588
  });
@@ -37424,6 +37616,14 @@ var form_item_props = {
37424
37616
  align: String,
37425
37617
  titleAlign: String,
37426
37618
  titleWidth: [String, Number],
37619
+ titleColon: {
37620
+ type: Boolean,
37621
+ default: null
37622
+ },
37623
+ titleAsterisk: {
37624
+ type: Boolean,
37625
+ default: null
37626
+ },
37427
37627
  className: [String, Function],
37428
37628
  titleOverflow: {
37429
37629
  type: [Boolean, String],
@@ -37565,10 +37765,18 @@ var form_item_renderItem = function renderItem(h, _vm, item, slots) {
37565
37765
  $xeform: {
37566
37766
  default: null
37567
37767
  },
37568
- xeformgather: {
37768
+ $xeformgather: {
37569
37769
  default: null
37570
37770
  }
37571
37771
  },
37772
+ provide: function provide() {
37773
+ return {
37774
+ $xeformitem: this,
37775
+ $xeformiteminfo: {
37776
+ itemConfig: this.itemConfig
37777
+ }
37778
+ };
37779
+ },
37572
37780
  data: function data() {
37573
37781
  return {
37574
37782
  itemConfig: null
@@ -37607,7 +37815,11 @@ var FormItem = Object.assign(form_item, {
37607
37815
  extends: form_item,
37608
37816
  provide: function provide() {
37609
37817
  return {
37610
- xeformgather: this
37818
+ $xeformgather: this,
37819
+ xeformitem: null,
37820
+ $xeformiteminfo: {
37821
+ itemConfig: this.itemConfig
37822
+ }
37611
37823
  };
37612
37824
  },
37613
37825
  created: function created() {
@@ -37753,6 +37965,14 @@ var Option = Object.assign(src_option, {
37753
37965
  openIcon: String,
37754
37966
  closeIcon: String
37755
37967
  },
37968
+ inject: {
37969
+ $xeform: {
37970
+ default: null
37971
+ },
37972
+ $xeformiteminfo: {
37973
+ default: null
37974
+ }
37975
+ },
37756
37976
  data: function data() {
37757
37977
  return {
37758
37978
  isActivated: false,
@@ -37843,7 +38063,12 @@ var Option = Object.assign(src_option, {
37843
38063
  this.$emit('change', {
37844
38064
  value: value,
37845
38065
  $event: evnt
37846
- });
38066
+ }); // 自动更新校验状态
38067
+
38068
+ if (this.$xeform && this.$xeformiteminfo) {
38069
+ this.$xeform.triggerItemEvent(evnt, this.$xeformiteminfo.itemConfig.field, value);
38070
+ }
38071
+
37847
38072
  this.activeTimeout = setTimeout(function () {
37848
38073
  _this2.hasAnimat = false;
37849
38074
  }, 400);