vxe-table 3.4.12-beta.2 → 3.4.14-beta.1

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 (68) hide show
  1. package/README.en.md +3 -1
  2. package/README.md +5 -3
  3. package/README.zh-TW.md +5 -3
  4. package/lib/edit/src/mixin.js +39 -13
  5. package/lib/edit/src/mixin.min.js +1 -1
  6. package/lib/export/src/mixin.js +15 -10
  7. package/lib/export/src/mixin.min.js +1 -1
  8. package/lib/export/style/style.css +2 -0
  9. package/lib/export/style/style.min.css +1 -1
  10. package/lib/filter/style/style.css +2 -0
  11. package/lib/filter/style/style.min.css +1 -1
  12. package/lib/footer/src/footer.js +11 -0
  13. package/lib/footer/src/footer.min.js +1 -1
  14. package/lib/form/src/form.js +6 -1
  15. package/lib/form/src/form.min.js +1 -1
  16. package/lib/grid/src/grid.js +5 -2
  17. package/lib/grid/src/grid.min.js +1 -1
  18. package/lib/header/src/header.js +12 -0
  19. package/lib/header/src/header.min.js +1 -1
  20. package/lib/index.css +1 -1
  21. package/lib/index.umd.js +198 -74
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/input/src/input.js +12 -20
  24. package/lib/input/src/input.min.js +1 -1
  25. package/lib/modal/src/modal.js +1 -1
  26. package/lib/modal/src/modal.min.js +1 -1
  27. package/lib/pulldown/src/pulldown.js +13 -0
  28. package/lib/pulldown/src/pulldown.min.js +1 -1
  29. package/lib/style.css +1 -1
  30. package/lib/style.min.css +1 -1
  31. package/lib/table/src/body.js +24 -5
  32. package/lib/table/src/body.min.js +1 -1
  33. package/lib/table/src/cell.js +5 -6
  34. package/lib/table/src/cell.min.js +1 -1
  35. package/lib/table/src/methods.js +56 -16
  36. package/lib/table/src/methods.min.js +1 -1
  37. package/lib/table/style/style.css +2 -0
  38. package/lib/table/style/style.min.css +1 -1
  39. package/lib/toolbar/style/style.css +2 -0
  40. package/lib/toolbar/style/style.min.css +1 -1
  41. package/lib/tools/src/utils.js +1 -0
  42. package/lib/tools/src/utils.min.js +1 -1
  43. package/lib/validator/src/mixin.js +2 -0
  44. package/lib/validator/src/mixin.min.js +1 -1
  45. package/package.json +4 -4
  46. package/packages/edit/src/mixin.js +20 -11
  47. package/packages/export/src/mixin.js +16 -9
  48. package/packages/footer/src/footer.js +10 -0
  49. package/packages/form/src/form.js +6 -4
  50. package/packages/grid/src/grid.js +3 -2
  51. package/packages/header/src/header.js +11 -0
  52. package/packages/input/src/input.js +11 -18
  53. package/packages/modal/src/modal.js +1 -1
  54. package/packages/pulldown/src/pulldown.js +12 -0
  55. package/packages/table/src/body.js +41 -7
  56. package/packages/table/src/cell.js +4 -6
  57. package/packages/table/src/methods.js +40 -14
  58. package/packages/tools/src/utils.js +1 -0
  59. package/packages/validator/src/mixin.js +11 -1
  60. package/styles/base/checked.scss +5 -0
  61. package/styles/button.scss +4 -4
  62. package/styles/modal.scss +14 -13
  63. package/styles/table.scss +4 -4
  64. package/styles/variable.scss +8 -0
  65. package/types/all.d.ts +1 -0
  66. package/types/column.d.ts +7 -1
  67. package/types/form.d.ts +2 -1
  68. package/types/table.d.ts +6 -2
package/lib/index.umd.js CHANGED
@@ -8931,6 +8931,7 @@ var utils_ColumnInfo = /*#__PURE__*/function () {
8931
8931
  // 基本属性
8932
8932
  type: _vm.type,
8933
8933
  property: _vm.field,
8934
+ field: _vm.field,
8934
8935
  title: _vm.title,
8935
8936
  width: _vm.width,
8936
8937
  minWidth: _vm.minWidth,
@@ -9801,14 +9802,14 @@ function getChangeEvent(renderOpts) {
9801
9802
  return 'change';
9802
9803
  }
9803
9804
 
9804
- function parseDate(value, props) {
9805
+ function renderer_parseDate(value, props) {
9805
9806
  return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, props.valueFormat) : value;
9806
9807
  }
9807
9808
 
9808
9809
  function getFormatDate(value, props, defaultFormat) {
9809
9810
  var _props$dateConfig = props.dateConfig,
9810
9811
  dateConfig = _props$dateConfig === void 0 ? {} : _props$dateConfig;
9811
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
9812
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toDateString(renderer_parseDate(value, props), dateConfig.labelFormat || defaultFormat);
9812
9813
  }
9813
9814
 
9814
9815
  function getLabelFormatDate(value, props) {
@@ -11496,6 +11497,19 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11496
11497
  this.$el._onscroll = null;
11497
11498
  this.$el.onscroll = null;
11498
11499
  },
11500
+ destroyed: function destroyed() {
11501
+ var $xetable = this.$parent,
11502
+ fixedType = this.fixedType;
11503
+ var elemStore = $xetable.elemStore;
11504
+ var prefix = "".concat(fixedType || 'main', "-body-");
11505
+ elemStore["".concat(prefix, "wrapper")] = null;
11506
+ elemStore["".concat(prefix, "table")] = null;
11507
+ elemStore["".concat(prefix, "colgroup")] = null;
11508
+ elemStore["".concat(prefix, "list")] = null;
11509
+ elemStore["".concat(prefix, "xSpace")] = null;
11510
+ elemStore["".concat(prefix, "ySpace")] = null;
11511
+ elemStore["".concat(prefix, "emptyBlock")] = null;
11512
+ },
11499
11513
  render: function render(h) {
11500
11514
  var _e = this._e,
11501
11515
  $xetable = this.$parent,
@@ -11662,8 +11676,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11662
11676
  var rightElem = rightBody ? rightBody.$el : null;
11663
11677
  var bodyYElem = elemStore['main-body-ySpace'];
11664
11678
  var bodyXElem = elemStore['main-body-xSpace'];
11665
- var bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0;
11666
- var bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0;
11679
+ var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
11680
+ var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
11667
11681
  var scrollTop = scrollBodyElem.scrollTop;
11668
11682
  var scrollLeft = bodyElem.scrollLeft;
11669
11683
  var isRollX = scrollLeft !== lastScrollLeft;
@@ -11719,6 +11733,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11719
11733
  fixed: fixedType,
11720
11734
  scrollTop: scrollTop,
11721
11735
  scrollLeft: scrollLeft,
11736
+ scrollHeight: bodyElem.scrollHeight,
11737
+ scrollWidth: bodyElem.scrollWidth,
11722
11738
  bodyHeight: bodyHeight,
11723
11739
  bodyWidth: bodyWidth,
11724
11740
  isX: isRollX,
@@ -11730,7 +11746,9 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11730
11746
 
11731
11747
  var $xetable = this.$parent;
11732
11748
  var $refs = $xetable.$refs,
11733
- elemStore = $xetable.elemStore;
11749
+ elemStore = $xetable.elemStore,
11750
+ scrollYLoad = $xetable.scrollYLoad,
11751
+ scrollXLoad = $xetable.scrollXLoad;
11734
11752
  var tableBody = $refs.tableBody,
11735
11753
  leftBody = $refs.leftBody,
11736
11754
  rightBody = $refs.rightBody;
@@ -11740,8 +11758,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11740
11758
  var remainSize = this.isPrevWheelTop === isTopWheel ? Math.max(0, this.wheelYSize - this.wheelYTotal) : 0;
11741
11759
  var bodyYElem = elemStore['main-body-ySpace'];
11742
11760
  var bodyXElem = elemStore['main-body-xSpace'];
11743
- var bodyHeight = bodyYElem ? bodyYElem.clientHeight : 0;
11744
- var bodyWidth = bodyXElem ? bodyXElem.clientWidth : 0;
11761
+ var bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
11762
+ var bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
11745
11763
  this.isPrevWheelTop = isTopWheel;
11746
11764
  this.wheelYSize = Math.abs(isTopWheel ? deltaTop - remainSize : deltaTop + remainSize);
11747
11765
  this.wheelYInterval = 0;
@@ -11787,6 +11805,8 @@ function syncBodyScroll(scrollTop, elem1, elem2) {
11787
11805
  fixed: fixedType,
11788
11806
  scrollTop: bodyElem.scrollTop,
11789
11807
  scrollLeft: bodyElem.scrollLeft,
11808
+ scrollHeight: bodyElem.scrollHeight,
11809
+ scrollWidth: bodyElem.scrollWidth,
11790
11810
  bodyHeight: bodyHeight,
11791
11811
  bodyWidth: bodyWidth,
11792
11812
  isX: isRollX,
@@ -12352,29 +12372,28 @@ var Cell = {
12352
12372
  var $table = params.$table,
12353
12373
  column = params.column,
12354
12374
  isHidden = params.isHidden;
12355
- var isAllCheckboxIndeterminate = $table.isIndeterminate,
12375
+ var isAllCheckboxSelected = $table.isAllSelected,
12376
+ isAllCheckboxIndeterminate = $table.isIndeterminate,
12356
12377
  isAllCheckboxDisabled = $table.isAllCheckboxDisabled;
12357
12378
  var slots = column.slots;
12358
12379
  var headerSlot = slots ? slots.header : null;
12359
12380
  var titleSlot = slots ? slots.title : null;
12360
12381
  var checkboxOpts = $table.checkboxOpts;
12361
12382
  var headerTitle = column.getTitle();
12362
- var isChecked = false;
12363
12383
  var on;
12364
12384
 
12365
12385
  if (!isHidden) {
12366
- isChecked = isAllCheckboxDisabled ? false : $table.isAllSelected;
12367
12386
  on = {
12368
12387
  click: function click(evnt) {
12369
12388
  if (!isAllCheckboxDisabled) {
12370
- $table.triggerCheckAllEvent(evnt, !isChecked);
12389
+ $table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
12371
12390
  }
12372
12391
  }
12373
12392
  };
12374
12393
  }
12375
12394
 
12376
12395
  var checkboxParams = _objectSpread2(_objectSpread2({}, params), {}, {
12377
- checked: isChecked,
12396
+ checked: isAllCheckboxSelected,
12378
12397
  disabled: isAllCheckboxDisabled,
12379
12398
  indeterminate: isAllCheckboxIndeterminate
12380
12399
  });
@@ -12391,7 +12410,7 @@ var Cell = {
12391
12410
 
12392
12411
  return renderTitleContent(h, checkboxParams, [h('span', {
12393
12412
  class: ['vxe-cell--checkbox', {
12394
- 'is--checked': isChecked,
12413
+ 'is--checked': isAllCheckboxSelected,
12395
12414
  'is--disabled': isAllCheckboxDisabled,
12396
12415
  'is--indeterminate': isAllCheckboxIndeterminate
12397
12416
  }],
@@ -14227,16 +14246,23 @@ var Methods = {
14227
14246
  afterFullData = this.afterFullData,
14228
14247
  treeConfig = this.treeConfig,
14229
14248
  treeOpts = this.treeOpts,
14230
- checkboxOpts = this.checkboxOpts;
14249
+ checkboxOpts = this.checkboxOpts,
14250
+ tableFullTreeData = this.tableFullTreeData,
14251
+ afterTreeFullData = this.afterTreeFullData;
14252
+ var transform = treeOpts.transform,
14253
+ children = treeOpts.children,
14254
+ mapChildren = treeOpts.mapChildren;
14231
14255
  var property = checkboxOpts.checkField;
14232
- var currTableData = isFull ? tableFullData : afterFullData;
14256
+ var currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
14233
14257
  var rowList = [];
14234
14258
 
14235
14259
  if (property) {
14236
14260
  if (treeConfig) {
14237
14261
  rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
14238
14262
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
14239
- }, treeOpts);
14263
+ }, {
14264
+ children: transform ? mapChildren : children
14265
+ });
14240
14266
  } else {
14241
14267
  rowList = currTableData.filter(function (row) {
14242
14268
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, property);
@@ -14248,7 +14274,9 @@ var Methods = {
14248
14274
  if (treeConfig) {
14249
14275
  rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.filterTree(currTableData, function (row) {
14250
14276
  return selection.indexOf(row) > -1;
14251
- }, treeOpts);
14277
+ }, {
14278
+ children: transform ? mapChildren : children
14279
+ });
14252
14280
  } else {
14253
14281
  rowList = currTableData.filter(function (row) {
14254
14282
  return selection.indexOf(row) > -1;
@@ -14314,7 +14342,8 @@ var Methods = {
14314
14342
  var filterColumns = [];
14315
14343
  var orderColumns = [];
14316
14344
  tableFullColumn.forEach(function (column) {
14317
- var sortable = column.sortable,
14345
+ var property = column.property,
14346
+ sortable = column.sortable,
14318
14347
  order = column.order,
14319
14348
  filters = column.filters;
14320
14349
 
@@ -14340,7 +14369,8 @@ var Methods = {
14340
14369
  if (!allRemoteSort && sortable && order) {
14341
14370
  orderColumns.push({
14342
14371
  column: column,
14343
- property: column.property,
14372
+ field: column.property,
14373
+ property: property,
14344
14374
  order: order
14345
14375
  });
14346
14376
  }
@@ -16056,7 +16086,9 @@ var Methods = {
16056
16086
  // 如果是按下非功能键之外允许直接编辑
16057
16087
 
16058
16088
  if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
16059
- if (!editOpts.activeMethod || editOpts.activeMethod(selected.args)) {
16089
+ if (!editOpts.activeMethod || editOpts.activeMethod(_objectSpread2(_objectSpread2({}, selected.args), {}, {
16090
+ $table: _this26
16091
+ }))) {
16060
16092
  if (editMethod) {
16061
16093
  editMethod({
16062
16094
  row: selected.row,
@@ -16779,17 +16811,31 @@ var Methods = {
16779
16811
  checkMethod = checkboxOpts.checkMethod;
16780
16812
 
16781
16813
  if (!checkStrictly) {
16814
+ var disableRows = [];
16815
+ var checkRows = [];
16816
+ var isAllResolve = false;
16782
16817
  var isAllSelected = false;
16783
16818
  var isIndeterminate = false;
16784
16819
 
16785
16820
  if (checkField) {
16786
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
16787
- return !checkMethod({
16821
+ isAllResolve = afterFullData.every(checkMethod ? function (row) {
16822
+ if (!checkMethod({
16788
16823
  row: row
16789
- }) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
16824
+ })) {
16825
+ disableRows.push(row);
16826
+ return true;
16827
+ }
16828
+
16829
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField)) {
16830
+ checkRows.push(row);
16831
+ return true;
16832
+ }
16833
+
16834
+ return false;
16790
16835
  } : function (row) {
16791
16836
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.get(row, checkField);
16792
16837
  });
16838
+ isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
16793
16839
 
16794
16840
  if (treeConfig) {
16795
16841
  if (halfField) {
@@ -16813,13 +16859,24 @@ var Methods = {
16813
16859
  }
16814
16860
  }
16815
16861
  } else {
16816
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
16817
- return !checkMethod({
16862
+ isAllResolve = afterFullData.every(checkMethod ? function (row) {
16863
+ if (!checkMethod({
16818
16864
  row: row
16819
- }) || selection.indexOf(row) > -1;
16865
+ })) {
16866
+ disableRows.push(row);
16867
+ return true;
16868
+ }
16869
+
16870
+ if (selection.indexOf(row) > -1) {
16871
+ checkRows.push(row);
16872
+ return true;
16873
+ }
16874
+
16875
+ return false;
16820
16876
  } : function (row) {
16821
16877
  return selection.indexOf(row) > -1;
16822
16878
  });
16879
+ isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
16823
16880
 
16824
16881
  if (treeConfig) {
16825
16882
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
@@ -17657,12 +17714,14 @@ var Methods = {
17657
17714
  getSortColumns: function getSortColumns() {
17658
17715
  var sortList = [];
17659
17716
  this.tableFullColumn.forEach(function (column) {
17660
- var order = column.order;
17717
+ var property = column.property,
17718
+ order = column.order;
17661
17719
 
17662
17720
  if ((column.sortable || column.remoteSort) && order) {
17663
17721
  sortList.push({
17664
17722
  column: column,
17665
- property: column.property,
17723
+ field: column.property,
17724
+ property: property,
17666
17725
  order: order
17667
17726
  });
17668
17727
  }
@@ -19080,7 +19139,7 @@ var Methods = {
19080
19139
  }
19081
19140
  }; // Module methods
19082
19141
 
19083
- var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
19142
+ var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
19084
19143
  funcs.forEach(function (name) {
19085
19144
  Methods[name] = function () {
19086
19145
  if (false) {}
@@ -21460,6 +21519,7 @@ var Menu = {
21460
21519
 
21461
21520
 
21462
21521
 
21522
+
21463
21523
  var mixin_getRowid = UtilTools.getRowid;
21464
21524
 
21465
21525
  function insertTreeRow(_vm, newRecords, isAppend) {
@@ -21468,22 +21528,28 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21468
21528
  fullDataRowIdData = _vm.fullDataRowIdData,
21469
21529
  fullAllDataRowIdData = _vm.fullAllDataRowIdData,
21470
21530
  treeOpts = _vm.treeOpts;
21531
+ var rowField = treeOpts.rowField,
21532
+ parentField = treeOpts.parentField,
21533
+ children = treeOpts.children,
21534
+ mapChildren = treeOpts.mapChildren;
21471
21535
  var funcName = isAppend ? 'push' : 'unshift';
21472
21536
  newRecords.forEach(function (item) {
21473
- var parentRowId = item[treeOpts.parentField];
21537
+ var parentRowId = item[parentField];
21474
21538
  var rowid = mixin_getRowid(_vm, item);
21475
21539
  var matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
21476
- return parentRowId === item[treeOpts.rowField];
21477
- }, treeOpts) : null;
21540
+ return parentRowId === item[rowField];
21541
+ }, {
21542
+ children: mapChildren
21543
+ }) : null;
21478
21544
 
21479
21545
  if (matchObj) {
21480
21546
  var parentRow = matchObj.item;
21481
21547
  var parentRest = fullAllDataRowIdData[mixin_getRowid(_vm, parentRow)];
21482
21548
  var parentLevel = parentRest ? parentRest.level : 0;
21483
- var parentChilds = parentRow[treeOpts.children];
21549
+ var parentChilds = parentRow[children];
21484
21550
 
21485
21551
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(parentChilds)) {
21486
- parentChilds = parentRow[treeOpts.children] = [];
21552
+ parentChilds = parentRow[children] = [];
21487
21553
  }
21488
21554
 
21489
21555
  parentChilds[funcName](item);
@@ -21554,7 +21620,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21554
21620
  fullDataRowIdData = this.fullDataRowIdData,
21555
21621
  fullAllDataRowIdData = this.fullAllDataRowIdData,
21556
21622
  treeOpts = this.treeOpts;
21557
- var transform = treeOpts.transform;
21623
+ var transform = treeOpts.transform,
21624
+ rowField = treeOpts.rowField,
21625
+ mapChildren = treeOpts.mapChildren;
21558
21626
 
21559
21627
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(records)) {
21560
21628
  records = [records];
@@ -21602,8 +21670,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21602
21670
  // 如果为虚拟树
21603
21671
  if (treeConfig && transform) {
21604
21672
  var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.findTree(tableFullTreeData, function (item) {
21605
- return row[treeOpts.rowField] === item[treeOpts.rowField];
21606
- }, treeOpts);
21673
+ return row[rowField] === item[rowField];
21674
+ }, {
21675
+ children: mapChildren
21676
+ });
21607
21677
 
21608
21678
  if (matchObj) {
21609
21679
  var parentRow = matchObj.parent;
@@ -21616,7 +21686,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21616
21686
  if (false) {}
21617
21687
 
21618
21688
  if (parentRow) {
21619
- item[treeOpts.parentField] = parentRow[treeOpts.rowField];
21689
+ item[treeOpts.parentField] = parentRow[rowField];
21620
21690
  }
21621
21691
 
21622
21692
  parentChilds.splice(matchObj.index + i, 0, item);
@@ -21644,7 +21714,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21644
21714
  throw new Error(UtilTools.getLog('vxe.error.noTree', ['insert']));
21645
21715
  }
21646
21716
 
21647
- var afIndex = afterFullData.indexOf(row);
21717
+ var afIndex = -1; // 如果是可视索引
21718
+
21719
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isNumber(row)) {
21720
+ if (row < afterFullData.length) {
21721
+ afIndex = row;
21722
+ }
21723
+ } else {
21724
+ afIndex = afterFullData.indexOf(row);
21725
+ }
21648
21726
 
21649
21727
  if (afIndex === -1) {
21650
21728
  throw new Error(UtilTools.error('vxe.error.unableInsert'));
@@ -21995,7 +22073,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21995
22073
  // 判断是否禁用编辑
21996
22074
  var type = 'edit-disabled';
21997
22075
 
21998
- if (!activeMethod || activeMethod(params)) {
22076
+ if (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
22077
+ $table: this
22078
+ }))) {
21999
22079
  if (mouseConfig) {
22000
22080
  this.clearSelected(evnt);
22001
22081
  this.clearCellAreas(evnt);
@@ -23178,7 +23258,7 @@ var msgQueue = [];
23178
23258
 
23179
23259
  return this.$nextTick().then(function () {
23180
23260
  if (!_this7.zoomLocat) {
23181
- var marginSize = _this7.marginSize;
23261
+ var marginSize = Math.max(0, _this7.marginSize);
23182
23262
 
23183
23263
  var modalBoxElem = _this7.getBox();
23184
23264
 
@@ -24519,18 +24599,11 @@ function renderExtraSuffixIcon(h, _vm) {
24519
24599
  dateValue: function dateValue() {
24520
24600
  var value = this.value,
24521
24601
  isDatePickerType = this.isDatePickerType,
24522
- type = this.type,
24523
24602
  dateValueFormat = this.dateValueFormat;
24524
24603
  var val = null;
24525
24604
 
24526
24605
  if (value && isDatePickerType) {
24527
- var date;
24528
-
24529
- if (type === 'time') {
24530
- date = toStringTimeDate(value);
24531
- } else {
24532
- date = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, dateValueFormat);
24533
- }
24606
+ var date = this.parseDate(value, dateValueFormat);
24534
24607
 
24535
24608
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(date)) {
24536
24609
  val = date;
@@ -25165,6 +25238,15 @@ function renderExtraSuffixIcon(h, _vm) {
25165
25238
  $event: evnt
25166
25239
  });
25167
25240
  },
25241
+ parseDate: function parseDate(value, format) {
25242
+ var type = this.type;
25243
+
25244
+ if (type === 'time') {
25245
+ return toStringTimeDate(value);
25246
+ }
25247
+
25248
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(value, format);
25249
+ },
25168
25250
 
25169
25251
  /**
25170
25252
  * 检查初始值
@@ -25239,13 +25321,7 @@ function renderExtraSuffixIcon(h, _vm) {
25239
25321
  if (inputValue) {
25240
25322
  if (type === 'week' || type === 'quarter') {// 周和季度选择器不支持解析,无需处理
25241
25323
  } else {
25242
- var inpDateVal;
25243
-
25244
- if (type === 'time') {
25245
- inpDateVal = toStringTimeDate(inputValue);
25246
- } else {
25247
- inpDateVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(inputValue, dateLabelFormat);
25248
- }
25324
+ var inpDateVal = this.parseDate(inputValue, dateLabelFormat);
25249
25325
 
25250
25326
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(inpDateVal)) {
25251
25327
  if (type === 'time') {
@@ -25673,11 +25749,7 @@ function renderExtraSuffixIcon(h, _vm) {
25673
25749
  var dLabel = '';
25674
25750
 
25675
25751
  if (date) {
25676
- if (type === 'time') {
25677
- dValue = toStringTimeDate(date);
25678
- } else {
25679
- dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.toStringDate(date, valueFormat);
25680
- }
25752
+ dValue = this.parseDate(date, valueFormat);
25681
25753
  }
25682
25754
 
25683
25755
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isValidDate(dValue)) {
@@ -28022,6 +28094,7 @@ var es_string_repeat = __webpack_require__("38cf");
28022
28094
 
28023
28095
 
28024
28096
 
28097
+
28025
28098
 
28026
28099
 
28027
28100
  var mixin_formatText = UtilTools.formatText; // 默认导出或打印的 HTML 样式
@@ -28057,16 +28130,18 @@ function hasTreeChildren($xetable, row) {
28057
28130
  return row[treeOpts.children] && row[treeOpts.children].length > 0;
28058
28131
  }
28059
28132
 
28060
- function getSeq($xetable, row, rowIndex, column, columnIndex) {
28133
+ function getSeq($xetable, row, $rowIndex, column, $columnIndex) {
28061
28134
  var seqOpts = $xetable.seqOpts;
28062
28135
  var seqMethod = seqOpts.seqMethod || column.seqMethod;
28063
28136
 
28064
28137
  if (seqMethod) {
28065
28138
  return seqMethod({
28066
28139
  row: row,
28067
- rowIndex: rowIndex,
28140
+ rowIndex: $xetable.getRowIndex(row),
28141
+ $rowIndex: $rowIndex,
28068
28142
  column: column,
28069
- columnIndex: columnIndex
28143
+ columnIndex: $xetable.getColumnIndex(column),
28144
+ $columnIndex: $columnIndex
28070
28145
  });
28071
28146
  }
28072
28147
 
@@ -28094,7 +28169,8 @@ function toBooleanValue(cellValue) {
28094
28169
  }
28095
28170
 
28096
28171
  function getLabelData($xetable, opts, columns, datas) {
28097
- var isAllExpand = opts.isAllExpand;
28172
+ var isAllExpand = opts.isAllExpand,
28173
+ mode = opts.mode;
28098
28174
  var treeConfig = $xetable.treeConfig,
28099
28175
  treeOpts = $xetable.treeOpts,
28100
28176
  radioOpts = $xetable.radioOpts,
@@ -28108,7 +28184,7 @@ function getLabelData($xetable, opts, columns, datas) {
28108
28184
  // 如果是树表格只允许导出数据源
28109
28185
  var rest = [];
28110
28186
  var expandMaps = new Map();
28111
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, rowIndex, items, path, parent, nodes) {
28187
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(datas, function (item, $rowIndex, items, path, parent, nodes) {
28112
28188
  var row = item._row || item;
28113
28189
  var parentRow = parent && parent._row ? parent._row : parent;
28114
28190
 
@@ -28120,7 +28196,7 @@ function getLabelData($xetable, opts, columns, datas) {
28120
28196
  _hasChild: hasRowChild,
28121
28197
  _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
28122
28198
  };
28123
- columns.forEach(function (column, columnIndex) {
28199
+ columns.forEach(function (column, $columnIndex) {
28124
28200
  var cellValue = '';
28125
28201
  var renderOpts = column.editRender || column.cellRender;
28126
28202
  var exportLabelMethod = column.exportMethod;
@@ -28143,7 +28219,9 @@ function getLabelData($xetable, opts, columns, datas) {
28143
28219
  } else {
28144
28220
  switch (column.type) {
28145
28221
  case 'seq':
28146
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
28222
+ cellValue = mode === 'all' ? path.map(function (num, i) {
28223
+ return i % 2 === 0 ? Number(num) + 1 : '.';
28224
+ }).join('') : getSeq($xetable, row, $rowIndex, column, $columnIndex);
28147
28225
  break;
28148
28226
 
28149
28227
  case 'checkbox':
@@ -28192,11 +28270,11 @@ function getLabelData($xetable, opts, columns, datas) {
28192
28270
  return rest;
28193
28271
  }
28194
28272
 
28195
- return datas.map(function (row, rowIndex) {
28273
+ return datas.map(function (row, $rowIndex) {
28196
28274
  var item = {
28197
28275
  _row: row
28198
28276
  };
28199
- columns.forEach(function (column, columnIndex) {
28277
+ columns.forEach(function (column, $columnIndex) {
28200
28278
  var cellValue = '';
28201
28279
  var renderOpts = column.editRender || column.cellRender;
28202
28280
  var exportLabelMethod = column.exportMethod;
@@ -28219,7 +28297,7 @@ function getLabelData($xetable, opts, columns, datas) {
28219
28297
  } else {
28220
28298
  switch (column.type) {
28221
28299
  case 'seq':
28222
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
28300
+ cellValue = mode === 'all' ? $rowIndex + 1 : getSeq($xetable, row, $rowIndex, column, $columnIndex);
28223
28301
  break;
28224
28302
 
28225
28303
  case 'checkbox':
@@ -30578,6 +30656,7 @@ function validErrorRuleValue(rule, val) {
30578
30656
  row: row,
30579
30657
  columnIndex: _this2.getColumnIndex(column),
30580
30658
  column: column,
30659
+ field: column.property,
30581
30660
  $table: _this2
30582
30661
  };
30583
30662
 
@@ -30725,6 +30804,7 @@ function validErrorRuleValue(rule, val) {
30725
30804
  rowIndex: _this3.getRowIndex(row),
30726
30805
  column: column,
30727
30806
  columnIndex: _this3.getColumnIndex(column),
30807
+ field: column.property,
30728
30808
  $table: _this3
30729
30809
  });
30730
30810
 
@@ -31008,6 +31088,18 @@ var cellType = 'header';
31008
31088
  elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
31009
31089
  elemStore["".concat(prefix, "repair")] = $refs.repair;
31010
31090
  },
31091
+ destroyed: function destroyed() {
31092
+ var $xetable = this.$parent,
31093
+ fixedType = this.fixedType;
31094
+ var elemStore = $xetable.elemStore;
31095
+ var prefix = "".concat(fixedType || 'main', "-header-");
31096
+ elemStore["".concat(prefix, "wrapper")] = null;
31097
+ elemStore["".concat(prefix, "table")] = null;
31098
+ elemStore["".concat(prefix, "colgroup")] = null;
31099
+ elemStore["".concat(prefix, "list")] = null;
31100
+ elemStore["".concat(prefix, "xSpace")] = null;
31101
+ elemStore["".concat(prefix, "repair")] = null;
31102
+ },
31011
31103
  render: function render(h) {
31012
31104
  var _this = this;
31013
31105
 
@@ -31377,6 +31469,17 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
31377
31469
  elemStore["".concat(prefix, "list")] = $refs.tfoot;
31378
31470
  elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
31379
31471
  },
31472
+ destroyed: function destroyed() {
31473
+ var $xetable = this.$parent,
31474
+ fixedType = this.fixedType;
31475
+ var elemStore = $xetable.elemStore;
31476
+ var prefix = "".concat(fixedType || 'main', "-footer-");
31477
+ elemStore["".concat(prefix, "wrapper")] = null;
31478
+ elemStore["".concat(prefix, "table")] = null;
31479
+ elemStore["".concat(prefix, "colgroup")] = null;
31480
+ elemStore["".concat(prefix, "list")] = null;
31481
+ elemStore["".concat(prefix, "xSpace")] = null;
31482
+ },
31380
31483
  render: function render(h) {
31381
31484
  var _e = this._e,
31382
31485
  $xetable = this.$parent,
@@ -32192,7 +32295,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
32192
32295
  proxyConfig = this.proxyConfig;
32193
32296
 
32194
32297
  if (proxyConfig && (data || proxyOpts.form && formOpts.data)) {
32195
- console.error('[vxe-grid] There is a conflict between the props proxy-config and data.');
32298
+ UtilTools.error('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config']);
32196
32299
  }
32197
32300
 
32198
32301
  if (false) {}
@@ -32343,7 +32446,9 @@ Object.keys(packages_table.methods).forEach(function (name) {
32343
32446
  handleActiveMethod: function handleActiveMethod(params) {
32344
32447
  var editConfig = this.editConfig;
32345
32448
  var activeMethod = editConfig ? editConfig.activeMethod : null;
32346
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(params));
32449
+ return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
32450
+ $grid: this
32451
+ })));
32347
32452
  },
32348
32453
  initToolbar: function initToolbar() {
32349
32454
  var _this3 = this;
@@ -32553,6 +32658,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
32553
32658
 
32554
32659
  sortList = defaultSort.map(function (item) {
32555
32660
  return {
32661
+ field: item.field,
32556
32662
  property: item.field,
32557
32663
  order: item.order
32558
32664
  };
@@ -36130,6 +36236,7 @@ function renderItems(h, _vm, itemList) {
36130
36236
  var hasEllipsis = showTitle || showTooltip || showEllipsis;
36131
36237
  var params = {
36132
36238
  data: data,
36239
+ field: field,
36133
36240
  property: field,
36134
36241
  item: item,
36135
36242
  $form: _vm
@@ -36463,6 +36570,7 @@ function renderItems(h, _vm, itemList) {
36463
36570
  evnt.preventDefault();
36464
36571
 
36465
36572
  if (!this.preventSubmit) {
36573
+ this.clearValidate();
36466
36574
  this.beginValidate(this.getItems()).then(function () {
36467
36575
  _this3.$emit('submit', {
36468
36576
  data: _this3.data,
@@ -36497,6 +36605,7 @@ function renderItems(h, _vm, itemList) {
36497
36605
  if (compConf && compConf.itemResetMethod) {
36498
36606
  compConf.itemResetMethod({
36499
36607
  data: data,
36608
+ field: field,
36500
36609
  property: field,
36501
36610
  item: item,
36502
36611
  $form: _this4
@@ -36607,6 +36716,7 @@ function renderItems(h, _vm, itemList) {
36607
36716
  return this.$nextTick();
36608
36717
  },
36609
36718
  validate: function validate(callback) {
36719
+ this.clearValidate();
36610
36720
  return this.beginValidate(this.getItems(), '', callback);
36611
36721
  },
36612
36722
  validateField: function validateField(field, callback) {
@@ -36623,7 +36733,6 @@ function renderItems(h, _vm, itemList) {
36623
36733
  var validRest = {};
36624
36734
  var validFields = [];
36625
36735
  var itemValids = [];
36626
- this.clearValidate();
36627
36736
  clearTimeout(this.showErrTime);
36628
36737
 
36629
36738
  if (data && formRules) {
@@ -36640,6 +36749,7 @@ function renderItems(h, _vm, itemList) {
36640
36749
  rule: rule,
36641
36750
  rules: rules,
36642
36751
  data: data,
36752
+ field: field,
36643
36753
  property: field,
36644
36754
  $form: _this7
36645
36755
  };
@@ -36731,6 +36841,7 @@ function renderItems(h, _vm, itemList) {
36731
36841
  rule: rule,
36732
36842
  rules: rules,
36733
36843
  data: data,
36844
+ field: property,
36734
36845
  property: property,
36735
36846
  $form: _this8
36736
36847
  });
@@ -37723,6 +37834,7 @@ var List = Object.assign(src_list, {
37723
37834
  name: 'VxePulldown',
37724
37835
  mixins: [size],
37725
37836
  props: {
37837
+ value: Boolean,
37726
37838
  disabled: Boolean,
37727
37839
  placement: String,
37728
37840
  size: {
@@ -37746,6 +37858,15 @@ var List = Object.assign(src_list, {
37746
37858
  isActivated: false
37747
37859
  };
37748
37860
  },
37861
+ watch: {
37862
+ value: function value(_value) {
37863
+ if (_value) {
37864
+ this.showPanel();
37865
+ } else {
37866
+ this.hidePanel();
37867
+ }
37868
+ }
37869
+ },
37749
37870
  created: function created() {
37750
37871
  GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent);
37751
37872
  GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent);
@@ -37886,6 +38007,8 @@ var List = Object.assign(src_list, {
37886
38007
  setTimeout(function () {
37887
38008
  _this.visiblePanel = true;
37888
38009
 
38010
+ _this.$emit('update:input', true);
38011
+
37889
38012
  _this.updatePlacement();
37890
38013
 
37891
38014
  setTimeout(function () {
@@ -37907,6 +38030,7 @@ var List = Object.assign(src_list, {
37907
38030
  var _this2 = this;
37908
38031
 
37909
38032
  this.visiblePanel = false;
38033
+ this.$emit('update:input', false);
37910
38034
  return new Promise(function (resolve) {
37911
38035
  if (_this2.animatVisible) {
37912
38036
  _this2.hidePanelTimeout = setTimeout(function () {