vxe-table 3.13.3 → 3.13.5

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 (59) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/zh-CHT.js +1 -1
  4. package/es/locale/lang/zh-CN.js +1 -1
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/render/index.js +29 -6
  8. package/es/table/src/header.js +2 -4
  9. package/es/table/src/methods.js +40 -37
  10. package/es/table/src/table.js +1 -1
  11. package/es/table/style.css +19 -0
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +1 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +19 -0
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +75 -55
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/locale/lang/zh-CHT.js +1 -1
  22. package/lib/locale/lang/zh-CHT.min.js +1 -1
  23. package/lib/locale/lang/zh-CHT.umd.js +1 -1
  24. package/lib/locale/lang/zh-CN.js +1 -1
  25. package/lib/locale/lang/zh-CN.min.js +1 -1
  26. package/lib/locale/lang/zh-CN.umd.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/render/index.js +27 -6
  30. package/lib/table/render/index.min.js +1 -1
  31. package/lib/table/src/header.js +1 -4
  32. package/lib/table/src/header.min.js +1 -1
  33. package/lib/table/src/methods.js +41 -39
  34. package/lib/table/src/methods.min.js +1 -1
  35. package/lib/table/src/table.js +1 -1
  36. package/lib/table/src/table.min.js +1 -1
  37. package/lib/table/style/style.css +19 -0
  38. package/lib/table/style/style.min.css +1 -1
  39. package/lib/ui/index.js +1 -1
  40. package/lib/ui/index.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/lib/vxe-table/style/style.css +19 -0
  44. package/lib/vxe-table/style/style.min.css +1 -1
  45. package/package.json +2 -2
  46. package/packages/locale/lang/zh-CHT.ts +1 -1
  47. package/packages/locale/lang/zh-CN.ts +1 -1
  48. package/packages/table/render/index.ts +30 -6
  49. package/packages/table/src/header.ts +2 -4
  50. package/packages/table/src/methods.ts +42 -39
  51. package/packages/table/src/table.ts +1 -1
  52. package/styles/components/table.scss +29 -0
  53. package/styles/theme/base.scss +2 -1
  54. /package/es/{iconfont.1739938254381.ttf → iconfont.1740038065641.ttf} +0 -0
  55. /package/es/{iconfont.1739938254381.woff → iconfont.1740038065641.woff} +0 -0
  56. /package/es/{iconfont.1739938254381.woff2 → iconfont.1740038065641.woff2} +0 -0
  57. /package/lib/{iconfont.1739938254381.ttf → iconfont.1740038065641.ttf} +0 -0
  58. /package/lib/{iconfont.1739938254381.woff → iconfont.1740038065641.woff} +0 -0
  59. /package/lib/{iconfont.1739938254381.woff2 → iconfont.1740038065641.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.13.3";
2223
+ const version = "3.13.5";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
2843
2843
  const {
2844
2844
  log: log_log
2845
2845
  } = core_.VxeUI;
2846
- const log_version = `table v${"3.13.3"}`;
2846
+ const log_version = `table v${"3.13.5"}`;
2847
2847
  const warnLog = log_log.create('warn', log_version);
2848
2848
  const errLog = log_log.create('error', log_version);
2849
2849
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -7523,15 +7523,11 @@ const Methods = {
7523
7523
  internalData.tableFullData = fullData;
7524
7524
  internalData.tableFullTreeData = treeData;
7525
7525
  // 缓存数据
7526
- $xeTable.cacheRowMap(true, isReset);
7526
+ $xeTable.cacheRowMap(true);
7527
7527
  // 原始数据
7528
7528
  internalData.tableSynchData = datas;
7529
7529
  if (isReset) {
7530
7530
  internalData.isResizeCellHeight = false;
7531
- reactData.rowExpandedMaps = {};
7532
- reactData.rowExpandLazyLoadedMaps = {};
7533
- reactData.treeExpandedMaps = {};
7534
- reactData.treeExpandLazyLoadedMaps = {};
7535
7531
  }
7536
7532
  // 克隆原数据,用于显示编辑状态,与编辑值做对比
7537
7533
  if (keepSource) {
@@ -7716,22 +7712,27 @@ const Methods = {
7716
7712
  /**
7717
7713
  * 更新数据行的 Map
7718
7714
  */
7719
- cacheRowMap(isReset, isSource) {
7715
+ cacheRowMap() {
7716
+ const $xeTable = this;
7717
+ const props = $xeTable;
7718
+ const internalData = $xeTable;
7719
+ const {
7720
+ treeConfig
7721
+ } = props;
7722
+ const treeOpts = $xeTable.computeTreeOpts;
7720
7723
  const {
7721
- treeConfig,
7722
- treeOpts,
7723
- tableFullData,
7724
7724
  fullAllDataRowIdData,
7725
+ tableFullData,
7725
7726
  tableFullTreeData
7726
- } = this;
7727
+ } = internalData;
7727
7728
  const childrenField = treeOpts.children || treeOpts.childrenField;
7728
7729
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
7729
- const rowkey = getRowkey(this);
7730
+ const rowkey = getRowkey($xeTable);
7730
7731
  const isLazy = treeConfig && treeOpts.lazy;
7731
7732
  const fullAllDataRowIdMaps = {};
7732
7733
  const fullDataRowIdMaps = {};
7733
- const handleCache = (row, index, items, path, parentRow, nodes) => {
7734
- let rowid = getRowid(this, row);
7734
+ const handleRow = (row, index, items, path, parentRow, nodes) => {
7735
+ let rowid = getRowid($xeTable, row);
7735
7736
  const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
7736
7737
  const level = nodes ? nodes.length - 1 : 0;
7737
7738
  if (eqEmptyValue(rowid)) {
@@ -7741,9 +7742,9 @@ const Methods = {
7741
7742
  if (isLazy && row[hasChildField] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(row[childrenField])) {
7742
7743
  row[childrenField] = null;
7743
7744
  }
7744
- let cacheItem = fullAllDataRowIdData[rowid];
7745
- if (isReset || !cacheItem) {
7746
- cacheItem = {
7745
+ let rowRest = fullAllDataRowIdData[rowid];
7746
+ if (!rowRest) {
7747
+ rowRest = {
7747
7748
  row,
7748
7749
  rowid,
7749
7750
  seq,
@@ -7760,26 +7761,22 @@ const Methods = {
7760
7761
  expandHeight: 0
7761
7762
  };
7762
7763
  }
7763
- cacheItem.row = row;
7764
- cacheItem.items = items;
7765
- cacheItem.parent = parentRow;
7766
- cacheItem.level = level;
7767
- cacheItem.index = treeConfig && parentRow ? -1 : index;
7768
- if (isSource) {
7769
- fullDataRowIdMaps[rowid] = cacheItem;
7770
- }
7771
- fullAllDataRowIdMaps[rowid] = cacheItem;
7764
+ rowRest.row = row;
7765
+ rowRest.items = items;
7766
+ rowRest.parent = parentRow;
7767
+ rowRest.level = level;
7768
+ rowRest.index = treeConfig && parentRow ? -1 : index;
7769
+ fullDataRowIdMaps[rowid] = rowRest;
7770
+ fullAllDataRowIdMaps[rowid] = rowRest;
7772
7771
  };
7773
- if (isSource) {
7774
- this.fullDataRowIdData = fullDataRowIdMaps;
7775
- }
7776
- this.fullAllDataRowIdData = fullAllDataRowIdMaps;
7772
+ internalData.fullDataRowIdData = fullDataRowIdMaps;
7773
+ internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
7777
7774
  if (treeConfig) {
7778
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, handleCache, {
7775
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, handleRow, {
7779
7776
  children: childrenField
7780
7777
  });
7781
7778
  } else {
7782
- tableFullData.forEach(handleCache);
7779
+ tableFullData.forEach(handleRow);
7783
7780
  }
7784
7781
  },
7785
7782
  cacheSourceMap(fullData) {
@@ -8784,7 +8781,7 @@ const Methods = {
8784
8781
  treeConfig
8785
8782
  } = props;
8786
8783
  const {
8787
- fullDataRowIdData
8784
+ fullAllDataRowIdData
8788
8785
  } = internalData;
8789
8786
  const treeOpts = $xeTable.computeTreeOpts;
8790
8787
  const {
@@ -8800,7 +8797,7 @@ const Methods = {
8800
8797
  rowid = getRowid($xeTable, rowOrRowid);
8801
8798
  }
8802
8799
  if (rowid) {
8803
- const rest = fullDataRowIdData[rowid];
8800
+ const rest = fullAllDataRowIdData[rowid];
8804
8801
  const row = rest ? rest.row : null;
8805
8802
  if (row) {
8806
8803
  return row[transform ? mapChildrenField : childrenField] || [];
@@ -8820,7 +8817,7 @@ const Methods = {
8820
8817
  treeConfig
8821
8818
  } = props;
8822
8819
  const {
8823
- fullDataRowIdData
8820
+ fullAllDataRowIdData
8824
8821
  } = internalData;
8825
8822
  if (rowOrRowid && treeConfig) {
8826
8823
  let rowid;
@@ -8830,7 +8827,7 @@ const Methods = {
8830
8827
  rowid = getRowid($xeTable, rowOrRowid);
8831
8828
  }
8832
8829
  if (rowid) {
8833
- const rest = fullDataRowIdData[rowid];
8830
+ const rest = fullAllDataRowIdData[rowid];
8834
8831
  return rest ? rest.parent : null;
8835
8832
  }
8836
8833
  }
@@ -8849,10 +8846,10 @@ const Methods = {
8849
8846
  const $xeTable = this;
8850
8847
  const internalData = $xeTable;
8851
8848
  const {
8852
- fullDataRowIdData
8849
+ fullAllDataRowIdData
8853
8850
  } = internalData;
8854
8851
  const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
8855
- return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
8852
+ return fullAllDataRowIdData[rowid] ? fullAllDataRowIdData[rowid].row : null;
8856
8853
  },
8857
8854
  /**
8858
8855
  * 根据行获取行的唯一主键
@@ -13830,9 +13827,6 @@ const Methods = {
13830
13827
  const $xeTable = this;
13831
13828
  const reactData = $xeTable;
13832
13829
  const internalData = $xeTable;
13833
- const tExpandedMaps = {
13834
- ...reactData.treeExpandedMaps
13835
- };
13836
13830
  const {
13837
13831
  fullAllDataRowIdData
13838
13832
  } = internalData;
@@ -13840,7 +13834,11 @@ const Methods = {
13840
13834
  const {
13841
13835
  transform
13842
13836
  } = treeOpts;
13837
+ let tExpandedMaps = {};
13843
13838
  if (rows) {
13839
+ tExpandedMaps = {
13840
+ ...reactData.treeExpandedMaps
13841
+ };
13844
13842
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
13845
13843
  rows = [rows];
13846
13844
  }
@@ -13854,8 +13852,12 @@ const Methods = {
13854
13852
  }
13855
13853
  }
13856
13854
  });
13855
+ } else {
13856
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(fullAllDataRowIdData, rowRest => {
13857
+ rowRest.treeLoaded = false;
13858
+ });
13857
13859
  }
13858
- reactData.treeExpandedMaps = tExpandedMaps;
13860
+ reactData.treeExpandedMaps = {};
13859
13861
  if (transform) {
13860
13862
  handleVirtualTreeToList($xeTable);
13861
13863
  return $xeTable.handleTableData();
@@ -16342,7 +16344,6 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
16342
16344
  } = props;
16343
16345
  const {
16344
16346
  resizable: allResizable,
16345
- border,
16346
16347
  columnKey,
16347
16348
  headerCellClassName,
16348
16349
  headerCellStyle,
@@ -16502,9 +16503,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
16502
16503
  * 列宽拖动
16503
16504
  */
16504
16505
  !fixedHiddenColumn && showResizable ? h('div', {
16505
- class: ['vxe-cell--col-resizable', {
16506
- 'is--line': !border || border === 'none'
16507
- }],
16506
+ class: 'vxe-cell--col-resizable',
16508
16507
  on: {
16509
16508
  mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
16510
16509
  dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
@@ -26279,7 +26278,7 @@ function renderBody(h, $xeTable) {
26279
26278
  if (value && value.length >= 50000) {
26280
26279
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
26281
26280
  }
26282
- this.loadTableData(value || [], true).then(() => {
26281
+ this.loadTableData(value || [], false).then(() => {
26283
26282
  const {
26284
26283
  scrollXLoad,
26285
26284
  scrollYLoad,
@@ -29513,12 +29512,12 @@ function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
29513
29512
  function isImmediateCell(renderOpts, params) {
29514
29513
  return params.$type === 'cell' || getInputImmediateModel(renderOpts);
29515
29514
  }
29516
- function getCellLabelVNs(h, renderOpts, params, cellLabel) {
29515
+ function getCellLabelVNs(h, renderOpts, params, cellLabel, opts) {
29517
29516
  const {
29518
29517
  placeholder
29519
29518
  } = renderOpts;
29520
29519
  return [h('span', {
29521
- class: 'vxe-cell--label'
29520
+ class: ['vxe-cell--label', opts ? opts.class : '']
29522
29521
  }, placeholder && isEmptyValue(cellLabel) ? [h('span', {
29523
29522
  class: 'vxe-cell--placeholder'
29524
29523
  }, formatText(getFuncText(placeholder), 1))] : formatText(cellLabel, 1))];
@@ -30179,7 +30178,8 @@ render_renderer.mixin({
30179
30178
  renderTableEdit: defaultEditRender,
30180
30179
  renderTableCell(h, renderOpts, params) {
30181
30180
  const {
30182
- props = {}
30181
+ props = {},
30182
+ showNegativeStatus
30183
30183
  } = renderOpts;
30184
30184
  const {
30185
30185
  row,
@@ -30189,7 +30189,8 @@ render_renderer.mixin({
30189
30189
  type
30190
30190
  } = props;
30191
30191
  let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
30192
- if (cellValue) {
30192
+ let isNegative = false;
30193
+ if (!isEmptyValue(cellValue)) {
30193
30194
  const numberInputConfig = render_getConfig().numberInput || {};
30194
30195
  if (type === 'float') {
30195
30196
  const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
@@ -30198,11 +30199,22 @@ render_renderer.mixin({
30198
30199
  if (!autoFill) {
30199
30200
  cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
30200
30201
  }
30202
+ if (showNegativeStatus) {
30203
+ if (cellValue < 0) {
30204
+ isNegative = true;
30205
+ }
30206
+ }
30201
30207
  } else if (type === 'amount') {
30202
30208
  const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
30203
30209
  const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
30204
30210
  const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
30205
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue), {
30211
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
30212
+ if (showNegativeStatus) {
30213
+ if (cellValue < 0) {
30214
+ isNegative = true;
30215
+ }
30216
+ }
30217
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
30206
30218
  digits
30207
30219
  });
30208
30220
  if (!autoFill) {
@@ -30215,9 +30227,17 @@ render_renderer.mixin({
30215
30227
  if (showCurrency) {
30216
30228
  cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
30217
30229
  }
30230
+ } else {
30231
+ if (showNegativeStatus) {
30232
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
30233
+ isNegative = true;
30234
+ }
30235
+ }
30218
30236
  }
30219
30237
  }
30220
- return getCellLabelVNs(h, renderOpts, params, cellValue);
30238
+ return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative ? {
30239
+ class: 'is--negative'
30240
+ } : {});
30221
30241
  },
30222
30242
  renderTableFooter(h, renderOpts, params) {
30223
30243
  const {
@@ -30965,7 +30985,7 @@ const Toolbar = VxeToolbar;
30965
30985
  }
30966
30986
  },
30967
30987
  numberInput: {
30968
- currencySymbol: '¥'
30988
+ currencySymbol: '¥'
30969
30989
  },
30970
30990
  imagePreview: {
30971
30991
  popupTitle: '预览',