vxe-table 3.11.35 → 3.11.37

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 (60) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +57 -33
  6. package/es/table/module/export/mixin.js +23 -20
  7. package/es/table/src/body.js +4 -4
  8. package/es/table/src/footer.js +4 -2
  9. package/es/table/src/header.js +4 -2
  10. package/es/table/src/methods.js +2 -2
  11. package/es/table/src/table.js +6 -3
  12. package/es/table/style.css +3 -25
  13. package/es/table/style.min.css +1 -1
  14. package/es/ui/index.js +1 -1
  15. package/es/ui/src/log.js +1 -1
  16. package/es/vxe-table/style.css +3 -25
  17. package/es/vxe-table/style.min.css +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.min.css +1 -1
  20. package/lib/index.umd.js +110 -64
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table/module/edit/mixin.js +67 -33
  25. package/lib/table/module/edit/mixin.min.js +1 -1
  26. package/lib/table/module/export/mixin.js +22 -19
  27. package/lib/table/module/export/mixin.min.js +1 -1
  28. package/lib/table/src/body.js +4 -3
  29. package/lib/table/src/body.min.js +1 -1
  30. package/lib/table/src/footer.js +4 -1
  31. package/lib/table/src/footer.min.js +1 -1
  32. package/lib/table/src/header.js +4 -1
  33. package/lib/table/src/header.min.js +1 -1
  34. package/lib/table/src/methods.js +2 -2
  35. package/lib/table/src/methods.min.js +1 -1
  36. package/lib/table/src/table.js +5 -3
  37. package/lib/table/src/table.min.js +1 -1
  38. package/lib/table/style/style.css +3 -25
  39. package/lib/table/style/style.min.css +1 -1
  40. package/lib/ui/index.js +1 -1
  41. package/lib/ui/index.min.js +1 -1
  42. package/lib/ui/src/log.js +1 -1
  43. package/lib/ui/src/log.min.js +1 -1
  44. package/lib/vxe-table/style/style.css +3 -25
  45. package/lib/vxe-table/style/style.min.css +1 -1
  46. package/package.json +2 -2
  47. package/packages/table/module/edit/mixin.ts +58 -33
  48. package/packages/table/module/export/mixin.ts +24 -20
  49. package/packages/table/src/body.ts +4 -3
  50. package/packages/table/src/footer.ts +4 -2
  51. package/packages/table/src/header.ts +4 -2
  52. package/packages/table/src/methods.ts +2 -2
  53. package/packages/table/src/table.ts +6 -3
  54. package/styles/components/table.scss +3 -22
  55. /package/es/{iconfont.1734517179309.ttf → iconfont.1734680280915.ttf} +0 -0
  56. /package/es/{iconfont.1734517179309.woff → iconfont.1734680280915.woff} +0 -0
  57. /package/es/{iconfont.1734517179309.woff2 → iconfont.1734680280915.woff2} +0 -0
  58. /package/lib/{iconfont.1734517179309.ttf → iconfont.1734680280915.ttf} +0 -0
  59. /package/lib/{iconfont.1734517179309.woff → iconfont.1734680280915.woff} +0 -0
  60. /package/lib/{iconfont.1734517179309.woff2 → iconfont.1734680280915.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.11.35";
2223
+ const version = "3.11.37";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2793,7 +2793,7 @@ function isNodeElement(elem) {
2793
2793
  const {
2794
2794
  log: log_log
2795
2795
  } = core_.VxeUI;
2796
- const log_version = `table v${"3.11.35"}`;
2796
+ const log_version = `table v${"3.11.37"}`;
2797
2797
  const warnLog = log_log.create('warn', log_version);
2798
2798
  const errLog = log_log.create('error', log_version);
2799
2799
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -12918,7 +12918,7 @@ const Methods = {
12918
12918
  const {
12919
12919
  visibleSize
12920
12920
  } = scrollYStore;
12921
- const fpsTime = Math.min(80, Math.floor(visibleSize * 2));
12921
+ const fpsTime = Math.min(80, Math.floor(visibleSize));
12922
12922
  if (lyTimeout) {
12923
12923
  clearTimeout(lyTimeout);
12924
12924
  }
@@ -13681,7 +13681,7 @@ const Methods = {
13681
13681
  }
13682
13682
  };
13683
13683
  // Module methods
13684
- const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
13684
+ const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,resetFilterPanel,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
13685
13685
  funcs.forEach(name => {
13686
13686
  Methods[name] = function (...args) {
13687
13687
  if (true) {
@@ -14070,7 +14070,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14070
14070
  'col--valid-error': !!errorValidItem,
14071
14071
  'col--current': currentColumn === column
14072
14072
  }, getClass(compCellClassName, params), getClass(className, params), getClass(allCellClassName, params)],
14073
- key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
14073
+ key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
14074
14074
  attrs,
14075
14075
  style: Object.assign({
14076
14076
  height: cellHeight
@@ -14094,6 +14094,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14094
14094
  expandOpts,
14095
14095
  editOpts,
14096
14096
  treeExpandedMaps,
14097
+ scrollXLoad,
14097
14098
  scrollYLoad,
14098
14099
  rowExpandedMaps,
14099
14100
  radioOpts,
@@ -14208,7 +14209,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14208
14209
  rowid
14209
14210
  },
14210
14211
  style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
14211
- key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
14212
+ key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
14212
14213
  nativeOn: trOn
14213
14214
  }, tdVNs) : h('tr', {
14214
14215
  class: trClass,
@@ -14216,7 +14217,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14216
14217
  rowid
14217
14218
  },
14218
14219
  style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
14219
- key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
14220
+ key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex,
14220
14221
  on: trOn
14221
14222
  }, tdVNs));
14222
14223
  // 如果行被展开了
@@ -14722,6 +14723,7 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
14722
14723
  align: allAlign,
14723
14724
  currentColumn,
14724
14725
  scrollXLoad,
14726
+ scrollYLoad,
14725
14727
  overflowX,
14726
14728
  scrollbarWidth,
14727
14729
  mouseConfig,
@@ -14820,7 +14822,7 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
14820
14822
  attrs: thAttrs,
14821
14823
  style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
14822
14824
  on: thOns,
14823
- key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
14825
+ key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
14824
14826
  }, [h('div', {
14825
14827
  class: ['vxe-cell', {
14826
14828
  'c--title': showTitle,
@@ -14868,6 +14870,7 @@ function renderHeads(h, _vm, headerGroups) {
14868
14870
  };
14869
14871
  if (columnOpts.drag && columnDragOpts.animation) {
14870
14872
  return h('transition-group', {
14873
+ key: $rowIndex,
14871
14874
  props: {
14872
14875
  tag: 'tr',
14873
14876
  name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
@@ -14877,6 +14880,7 @@ function renderHeads(h, _vm, headerGroups) {
14877
14880
  }, header_renderRows(h, _vm, cols, $rowIndex));
14878
14881
  }
14879
14882
  return h('tr', {
14883
+ key: $rowIndex,
14880
14884
  class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
14881
14885
  style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
14882
14886
  }, header_renderRows(h, _vm, cols, $rowIndex));
@@ -15210,6 +15214,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
15210
15214
  showFooterOverflow: allColumnFooterOverflow,
15211
15215
  currentColumn,
15212
15216
  overflowX,
15217
+ scrollYLoad,
15213
15218
  scrollbarWidth,
15214
15219
  tooltipOpts
15215
15220
  } = $xetable;
@@ -15339,7 +15344,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
15339
15344
  attrs,
15340
15345
  style: footerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle : null,
15341
15346
  on: tfOns,
15342
- key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
15347
+ key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
15343
15348
  }, [h('div', {
15344
15349
  class: ['vxe-cell', {
15345
15350
  'c--title': showTitle,
@@ -15378,6 +15383,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15378
15383
  };
15379
15384
  if (columnOpts.drag && columnDragOpts.animation) {
15380
15385
  return h('transition-group', {
15386
+ key: $rowIndex,
15381
15387
  props: {
15382
15388
  tag: 'tr',
15383
15389
  name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
@@ -15387,6 +15393,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15387
15393
  }, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
15388
15394
  }
15389
15395
  return h('tr', {
15396
+ key: $rowIndex,
15390
15397
  class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
15391
15398
  style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
15392
15399
  }, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
@@ -18902,8 +18909,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
18902
18909
  }
18903
18910
  });
18904
18911
  }
18905
- function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18906
- const $xeTable = _vm;
18912
+ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
18907
18913
  const props = $xeTable;
18908
18914
  const reactData = $xeTable;
18909
18915
  const internalData = $xeTable;
@@ -18931,14 +18937,14 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18931
18937
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
18932
18938
  records = [records];
18933
18939
  }
18934
- const newRecords = _vm.defineField(records.map(record => Object.assign(treeConfig && transform ? {
18940
+ const newRecords = $xeTable.defineField(records.map(record => Object.assign(treeConfig && transform ? {
18935
18941
  [mapChildrenField]: [],
18936
18942
  [childrenField]: []
18937
18943
  } : {}, record)));
18938
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(row)) {
18944
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(targetRow)) {
18939
18945
  // 如果为虚拟树
18940
18946
  if (treeConfig && transform) {
18941
- insertTreeRow(_vm, newRecords, false);
18947
+ insertTreeRow($xeTable, newRecords, false);
18942
18948
  } else {
18943
18949
  newRecords.forEach(item => {
18944
18950
  const rowid = getRowid($xeTable, item);
@@ -18970,10 +18976,10 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18970
18976
  });
18971
18977
  }
18972
18978
  } else {
18973
- if (row === -1) {
18979
+ if (targetRow === -1) {
18974
18980
  // 如果为虚拟树
18975
18981
  if (treeConfig && transform) {
18976
- insertTreeRow(_vm, newRecords, true);
18982
+ insertTreeRow($xeTable, newRecords, true);
18977
18983
  } else {
18978
18984
  newRecords.forEach(item => {
18979
18985
  const rowid = getRowid($xeTable, item);
@@ -19008,7 +19014,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19008
19014
  } else {
19009
19015
  // 如果为虚拟树
19010
19016
  if (treeConfig && transform) {
19011
- const matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => row[rowField] === item[rowField], {
19017
+ const matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => targetRow[rowField] === item[rowField], {
19012
19018
  children: mapChildrenField
19013
19019
  });
19014
19020
  if (matchMapObj) {
@@ -19016,10 +19022,10 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19016
19022
  parent: parentRow
19017
19023
  } = matchMapObj;
19018
19024
  const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
19019
- const parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
19025
+ const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
19020
19026
  const parentLevel = parentRest ? parentRest.level : 0;
19021
19027
  newRecords.forEach((item, i) => {
19022
- const rowid = getRowid(_vm, item);
19028
+ const rowid = getRowid($xeTable, item);
19023
19029
  if (true) {
19024
19030
  if (item[treeOpts.parentField]) {
19025
19031
  if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
@@ -19052,7 +19058,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19052
19058
  });
19053
19059
  // 源
19054
19060
  if (parentRow) {
19055
- const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => row[rowField] === item[rowField], {
19061
+ const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => targetRow[rowField] === item[rowField], {
19056
19062
  children: childrenField
19057
19063
  });
19058
19064
  if (matchObj) {
@@ -19068,7 +19074,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19068
19074
  if (true) {
19069
19075
  warnLog('vxe.error.unableInsert');
19070
19076
  }
19071
- insertTreeRow(_vm, newRecords, true);
19077
+ insertTreeRow($xeTable, newRecords, true);
19072
19078
  }
19073
19079
  } else {
19074
19080
  if (treeConfig) {
@@ -19076,12 +19082,12 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19076
19082
  }
19077
19083
  let afIndex = -1;
19078
19084
  // 如果是可视索引
19079
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
19080
- if (row < afterFullData.length) {
19081
- afIndex = row;
19085
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRow)) {
19086
+ if (targetRow < afterFullData.length) {
19087
+ afIndex = targetRow;
19082
19088
  }
19083
19089
  } else {
19084
- afIndex = _vm.findRowIndexOf(afterFullData, row);
19090
+ afIndex = $xeTable.findRowIndexOf(afterFullData, targetRow);
19085
19091
  }
19086
19092
  // 如果是插入指定行的下一行
19087
19093
  if (isInsertNextRow) {
@@ -19091,7 +19097,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19091
19097
  throw new Error(errLog('vxe.error.unableInsert'));
19092
19098
  }
19093
19099
  afterFullData.splice(afIndex, 0, ...newRecords);
19094
- tableFullData.splice(_vm.findRowIndexOf(tableFullData, row), 0, ...newRecords);
19100
+ tableFullData.splice($xeTable.findRowIndexOf(tableFullData, targetRow), 0, ...newRecords);
19095
19101
  // 刷新单元格合并
19096
19102
  mergeList.forEach(mergeItem => {
19097
19103
  const {
@@ -19114,20 +19120,20 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19114
19120
  const rowid = getRowid($xeTable, newRow);
19115
19121
  insertMaps[rowid] = newRow;
19116
19122
  });
19117
- _vm.cacheRowMap();
19118
- _vm.updateScrollYStatus();
19119
- _vm.handleTableData(treeConfig && transform);
19123
+ $xeTable.cacheRowMap();
19124
+ $xeTable.updateScrollYStatus();
19125
+ $xeTable.handleTableData(treeConfig && transform);
19120
19126
  if (!(treeConfig && transform)) {
19121
- _vm.updateAfterDataIndex();
19127
+ $xeTable.updateAfterDataIndex();
19122
19128
  }
19123
- _vm.updateFooter();
19124
- _vm.checkSelectionStatus();
19125
- if (_vm.scrollYLoad) {
19126
- _vm.updateScrollYSpace();
19129
+ $xeTable.updateFooter();
19130
+ $xeTable.checkSelectionStatus();
19131
+ if ($xeTable.scrollYLoad) {
19132
+ $xeTable.updateScrollYSpace();
19127
19133
  }
19128
- return _vm.$nextTick().then(() => {
19129
- _vm.updateCellAreas();
19130
- return _vm.recalculate();
19134
+ return $xeTable.$nextTick().then(() => {
19135
+ $xeTable.updateCellAreas();
19136
+ return $xeTable.recalculate();
19131
19137
  }).then(() => {
19132
19138
  return {
19133
19139
  row: newRecords.length ? newRecords[newRecords.length - 1] : null,
@@ -19135,6 +19141,32 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19135
19141
  };
19136
19142
  });
19137
19143
  }
19144
+ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInsertNextRow) {
19145
+ const props = $xeTable;
19146
+ const {
19147
+ treeConfig
19148
+ } = props;
19149
+ const treeOpts = $xeTable.computeTreeOpts;
19150
+ const {
19151
+ transform,
19152
+ rowField,
19153
+ parentField
19154
+ } = treeOpts;
19155
+ if (treeConfig && transform) {
19156
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
19157
+ records = [records];
19158
+ }
19159
+ return handleInsertRowAt($xeTable, records.map(item => Object.assign({}, item, {
19160
+ [parentField]: parentRow[rowField]
19161
+ })), targetRow, isInsertNextRow);
19162
+ } else {
19163
+ errLog('vxe.error.errProp', ['tree-config.treeConfig=false', 'tree-config.treeConfig=true']);
19164
+ }
19165
+ return Promise.resolve({
19166
+ row: null,
19167
+ rows: []
19168
+ });
19169
+ }
19138
19170
  /* harmony default export */ var edit_mixin = ({
19139
19171
  methods: {
19140
19172
  /**
@@ -19151,14 +19183,23 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
19151
19183
  * 如果 row 为 -1 则从插入到底部
19152
19184
  * 如果 row 为有效行则插入到该行的位置
19153
19185
  * @param {Object/Array} records 新的数据
19154
- * @param {Row} row 指定行
19186
+ * @param {Row} targetRow 指定行
19155
19187
  * @returns
19156
19188
  */
19157
- _insertAt(records, row) {
19158
- return handleInsertRowAt(this, records, row);
19189
+ _insertAt(records, targetRow) {
19190
+ return handleInsertRowAt(this, records, targetRow);
19191
+ },
19192
+ _insertNextAt(records, targetRow) {
19193
+ return handleInsertRowAt(this, records, targetRow, true);
19159
19194
  },
19160
- _insertNextAt(records, row) {
19161
- return handleInsertRowAt(this, records, row, true);
19195
+ _insertChild(records, parentRow) {
19196
+ return handleInsertChildRowAt(this, records, parentRow, null);
19197
+ },
19198
+ _insertChildAt(records, parentRow, targetRow) {
19199
+ return handleInsertChildRowAt(this, records, parentRow, targetRow);
19200
+ },
19201
+ _insertChildNextAt(records, parentRow, targetRow) {
19202
+ return handleInsertChildRowAt(this, records, parentRow, targetRow, true);
19162
19203
  },
19163
19204
  /**
19164
19205
  * 删除指定行数据
@@ -20005,7 +20046,10 @@ function toTableBorder(border) {
20005
20046
  function toBooleanValue(cellValue) {
20006
20047
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(cellValue) ? cellValue ? 'TRUE' : 'FALSE' : cellValue;
20007
20048
  }
20008
- function getBodyLabelData($xetable, opts, columns, datas) {
20049
+ const toStringValue = cellValue => {
20050
+ return eqEmptyValue(cellValue) ? '' : `${cellValue}`;
20051
+ };
20052
+ function getBodyLabelData($xeTable, opts, columns, datas) {
20009
20053
  const {
20010
20054
  isAllExpand,
20011
20055
  mode
@@ -20016,7 +20060,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20016
20060
  radioOpts,
20017
20061
  checkboxOpts,
20018
20062
  columnOpts
20019
- } = $xetable;
20063
+ } = $xeTable;
20020
20064
  const childrenField = treeOpts.children || treeOpts.childrenField;
20021
20065
  if (!htmlCellElem) {
20022
20066
  htmlCellElem = document.createElement('div');
@@ -20028,13 +20072,13 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20028
20072
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
20029
20073
  const row = item._row || item;
20030
20074
  const parentRow = parent && parent._row ? parent._row : parent;
20031
- if (isAllExpand || !parentRow || expandMaps.has(parentRow) && $xetable.isTreeExpandByRow(parentRow)) {
20032
- const hasRowChild = hasTreeChildren($xetable, row);
20075
+ if (isAllExpand || !parentRow || expandMaps.has(parentRow) && $xeTable.isTreeExpandByRow(parentRow)) {
20076
+ const hasRowChild = hasTreeChildren($xeTable, row);
20033
20077
  const item = {
20034
20078
  _row: row,
20035
20079
  _level: nodes.length - 1,
20036
20080
  _hasChild: hasRowChild,
20037
- _expand: hasRowChild && $xetable.isTreeExpandByRow(row)
20081
+ _expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
20038
20082
  };
20039
20083
  columns.forEach((column, $columnIndex) => {
20040
20084
  let cellValue = '';
@@ -20051,7 +20095,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20051
20095
  }
20052
20096
  if (bodyExportMethod) {
20053
20097
  cellValue = bodyExportMethod({
20054
- $table: $xetable,
20098
+ $table: $xeTable,
20055
20099
  row,
20056
20100
  column,
20057
20101
  options: opts
@@ -20061,18 +20105,18 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20061
20105
  case 'seq':
20062
20106
  {
20063
20107
  const seqValue = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
20064
- cellValue = mode === 'all' ? seqValue : getSeq($xetable, seqValue, row, $rowIndex, column, $columnIndex);
20108
+ cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
20065
20109
  break;
20066
20110
  }
20067
20111
  case 'checkbox':
20068
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
20112
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
20069
20113
  item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkboxOpts.labelField) : '';
20070
20114
  item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
20071
20115
  row
20072
20116
  });
20073
20117
  break;
20074
20118
  case 'radio':
20075
- cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
20119
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
20076
20120
  item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, radioOpts.labelField) : '';
20077
20121
  item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
20078
20122
  row
@@ -20082,12 +20126,12 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20082
20126
  if (opts.original) {
20083
20127
  cellValue = getCellValue(row, column);
20084
20128
  } else {
20085
- cellValue = $xetable.getCellLabel(row, column);
20129
+ cellValue = $xeTable.getCellLabel(row, column);
20086
20130
  if (column.type === 'html') {
20087
20131
  htmlCellElem.innerHTML = cellValue;
20088
20132
  cellValue = htmlCellElem.innerText.trim();
20089
20133
  } else {
20090
- const cell = $xetable.getCellElement(row, column);
20134
+ const cell = $xeTable.getCellElement(row, column);
20091
20135
  if (cell) {
20092
20136
  cellValue = cell.innerText.trim();
20093
20137
  }
@@ -20095,7 +20139,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20095
20139
  }
20096
20140
  }
20097
20141
  }
20098
- item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);
20142
+ item[column.id] = toStringValue(cellValue);
20099
20143
  });
20100
20144
  expandMaps.set(row, 1);
20101
20145
  rest.push(Object.assign(item, row));
@@ -20124,7 +20168,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20124
20168
  }
20125
20169
  if (bodyExportMethod) {
20126
20170
  cellValue = bodyExportMethod({
20127
- $table: $xetable,
20171
+ $table: $xeTable,
20128
20172
  row,
20129
20173
  column,
20130
20174
  options: opts
@@ -20134,18 +20178,18 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20134
20178
  case 'seq':
20135
20179
  {
20136
20180
  const seqValue = $rowIndex + 1;
20137
- cellValue = mode === 'all' ? seqValue : getSeq($xetable, seqValue, row, $rowIndex, column, $columnIndex);
20181
+ cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
20138
20182
  break;
20139
20183
  }
20140
20184
  case 'checkbox':
20141
- cellValue = toBooleanValue($xetable.isCheckedByCheckboxRow(row));
20185
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
20142
20186
  item._checkboxLabel = checkboxOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkboxOpts.labelField) : '';
20143
20187
  item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({
20144
20188
  row
20145
20189
  });
20146
20190
  break;
20147
20191
  case 'radio':
20148
- cellValue = toBooleanValue($xetable.isCheckedByRadioRow(row));
20192
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
20149
20193
  item._radioLabel = radioOpts.labelField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, radioOpts.labelField) : '';
20150
20194
  item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({
20151
20195
  row
@@ -20155,12 +20199,12 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20155
20199
  if (opts.original) {
20156
20200
  cellValue = getCellValue(row, column);
20157
20201
  } else {
20158
- cellValue = $xetable.getCellLabel(row, column);
20202
+ cellValue = $xeTable.getCellLabel(row, column);
20159
20203
  if (column.type === 'html') {
20160
20204
  htmlCellElem.innerHTML = cellValue;
20161
20205
  cellValue = htmlCellElem.innerText.trim();
20162
20206
  } else {
20163
- const cell = $xetable.getCellElement(row, column);
20207
+ const cell = $xeTable.getCellElement(row, column);
20164
20208
  if (cell) {
20165
20209
  cellValue = cell.innerText.trim();
20166
20210
  }
@@ -20168,7 +20212,7 @@ function getBodyLabelData($xetable, opts, columns, datas) {
20168
20212
  }
20169
20213
  }
20170
20214
  }
20171
- item[column.id] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);
20215
+ item[column.id] = toStringValue(cellValue);
20172
20216
  });
20173
20217
  return item;
20174
20218
  });
@@ -23786,10 +23830,12 @@ function handleUupdateResize(_vm) {
23786
23830
  }
23787
23831
  return false;
23788
23832
  },
23789
- tableBorder() {
23833
+ computeTableBorder() {
23834
+ const $xeTable = this;
23835
+ const props = $xeTable;
23790
23836
  const {
23791
23837
  border
23792
- } = this;
23838
+ } = props;
23793
23839
  if (border === true) {
23794
23840
  return 'full';
23795
23841
  }
@@ -24288,7 +24334,6 @@ function handleUupdateResize(_vm) {
24288
24334
  stripe,
24289
24335
  showHeader,
24290
24336
  height,
24291
- tableBorder,
24292
24337
  treeOpts,
24293
24338
  treeConfig,
24294
24339
  mouseConfig,
@@ -24328,6 +24373,7 @@ function handleUupdateResize(_vm) {
24328
24373
  const loadingSlot = $scopedSlots.loading;
24329
24374
  const currLoading = this._isLoading || loading;
24330
24375
  const vSize = computeSize;
24376
+ const tableBorder = $xeTable.computeTableBorder;
24331
24377
  const virtualScrollBars = $xeTable.computeVirtualScrollBars;
24332
24378
  const isArea = mouseConfig && mouseOpts.area;
24333
24379
  const tableStyle = $xeTable.computeTableStyle;