vxe-table 4.21.10 → 4.22.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +2 -0
  2. package/dist/all.esm.js +69 -21
  3. package/dist/style.css +1 -1
  4. package/dist/style.min.css +1 -1
  5. package/es/grid/src/grid.js +26 -0
  6. package/es/iconfont.1789131679524.ttf +0 -0
  7. package/es/iconfont.1789131679524.woff +0 -0
  8. package/es/iconfont.1789131679524.woff2 +0 -0
  9. package/es/index.css +1 -1
  10. package/es/index.min.css +1 -1
  11. package/es/style.css +1 -1
  12. package/es/style.min.css +1 -1
  13. package/es/table/module/export/hook.js +7 -2
  14. package/es/table/src/cell.js +20 -10
  15. package/es/table/src/table.js +14 -7
  16. package/es/table/style.css +3 -3
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +3 -3
  21. package/es/vxe-table/style.min.css +1 -1
  22. package/lib/grid/src/grid.js +26 -0
  23. package/lib/grid/src/grid.min.js +1 -1
  24. package/lib/iconfont.1789131679524.ttf +0 -0
  25. package/lib/iconfont.1789131679524.woff +0 -0
  26. package/lib/iconfont.1789131679524.woff2 +0 -0
  27. package/lib/index.css +1 -1
  28. package/lib/index.min.css +1 -1
  29. package/lib/index.umd.js +61 -18
  30. package/lib/index.umd.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/table/module/export/hook.js +10 -2
  34. package/lib/table/module/export/hook.min.js +1 -1
  35. package/lib/table/src/cell.js +21 -12
  36. package/lib/table/src/cell.min.js +1 -1
  37. package/lib/table/src/table.js +2 -2
  38. package/lib/table/src/table.min.js +1 -1
  39. package/lib/table/style/style.css +3 -3
  40. package/lib/table/style/style.min.css +1 -1
  41. package/lib/ui/index.js +1 -1
  42. package/lib/ui/index.min.js +1 -1
  43. package/lib/ui/src/log.js +1 -1
  44. package/lib/ui/src/log.min.js +1 -1
  45. package/lib/vxe-table/style/style.css +3 -3
  46. package/lib/vxe-table/style/style.min.css +1 -1
  47. package/package.json +2 -2
  48. package/packages/grid/src/grid.ts +26 -0
  49. package/packages/table/module/export/hook.ts +7 -2
  50. package/packages/table/src/cell.ts +22 -10
  51. package/packages/table/src/table.ts +13 -7
  52. package/styles/components/icon.scss +2 -2
  53. package/styles/components/table.scss +1 -1
  54. package/styles/icon/iconfont.ttf +0 -0
  55. package/styles/icon/iconfont.woff +0 -0
  56. package/styles/icon/iconfont.woff2 +0 -0
  57. package/es/iconfont.1789035007778.ttf +0 -0
  58. package/es/iconfont.1789035007778.woff +0 -0
  59. package/es/iconfont.1789035007778.woff2 +0 -0
  60. package/lib/iconfont.1789035007778.ttf +0 -0
  61. package/lib/iconfont.1789035007778.woff +0 -0
  62. package/lib/iconfont.1789035007778.woff2 +0 -0
package/README.md CHANGED
@@ -31,6 +31,7 @@
31
31
  * [ ] v4.? 重构虚拟渲染v7,优化百万级渲染量
32
32
  * [ ] v4.? 重构虚拟渲染v6,同时支持原生滚动条和虚拟滚动条
33
33
  * [ ] v4.? 功能需求收集中...
34
+ * [x] v4.22 编辑表格的渲染器支持 edit-render 和 edit-render 组合使用
34
35
  * [x] v4.21 重构全键盘操作,修复按键编辑为拼音输入法时首字母丢失问题;筛选支持自适应屏幕上下位置显示;优化虚拟渲染,解决滚动错位场景
35
36
  * [x] v4.20 内部重构优化,内部结构调整
36
37
  * [x] v4.19 增加对增删改操作撤销回退的支持;优化虚拟渲染,优化提升 Window/Mac 触摸板滚动流畅度
@@ -49,6 +50,7 @@
49
50
  * [ ] v3.? 重构虚拟渲染v7,优化百万级渲染量
50
51
  * [ ] v3.? 重构虚拟渲染v6,同时支持原生滚动条和虚拟滚动条
51
52
  * [ ] v3.? 功能需求收集中...
53
+ * [x] v3.24 编辑表格的渲染器支持 edit-render 和 edit-render 组合使用
52
54
  * [x] v3.23 重构全键盘操作,修复按键编辑为拼音输入法时首字母丢失问题;筛选支持自适应屏幕上下位置显示;优化虚拟渲染,解决滚动错位场景
53
55
  * [x] v3.22 内部重构优化,内部结构调整
54
56
  * [x] v3.21 增加对增删改操作撤销回退的支持;优化虚拟渲染,优化提升 Window/Mac 触摸板滚动流畅度
package/dist/all.esm.js CHANGED
@@ -47,7 +47,7 @@ function getDefaultConfig(val1, def1) {
47
47
  return XEUtils.eqNull(val1) ? def1 : val1;
48
48
  }
49
49
 
50
- const version = "4.21.10";
50
+ const version = "4.22.0-beta.0";
51
51
  VxeUI.version = version;
52
52
  VxeUI.tableVersion = version;
53
53
  VxeUI.setConfig({
@@ -931,7 +931,7 @@ function getPopupWrapperElement(panelElem) {
931
931
  }
932
932
 
933
933
  const { log } = VxeUI;
934
- const tableVersion = `table v${"4.21.10"}`;
934
+ const tableVersion = `table v${"4.22.0-beta.0"}`;
935
935
  function createComponentLog(name) {
936
936
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
937
937
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -2701,18 +2701,27 @@ const Cell = {
2701
2701
  if (defaultSlot) {
2702
2702
  return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
2703
2703
  }
2704
- const renderOpts = editRenderOpts || cellRenderOpts;
2705
- // 如果是编辑表格:renderTableCell > formatter
2706
- // 如果是查看表格:renderTableDefault > formatter
2707
- if (renderOpts) {
2708
- const compConf = renderer$a.get(renderOpts.name);
2709
- if (compConf) {
2710
- const renderFn = editRenderOpts ? (compConf.renderTableCell || compConf.renderCell) : (compConf.renderTableDefault || compConf.renderDefault);
2711
- if (renderFn) {
2712
- return renderCellBaseVNs(params, getSlotVNs(renderFn(renderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
2713
- }
2704
+ // 如果是编辑模式-查看:slot default > formatter > cellRender.renderTableDefault > editRender.renderTableCell > editRender.renderTableDefault > cellRender.tableCellFormatter > editRender.tableCellFormatter > field
2705
+ // 如果是查看表格:slot default > formatter > cellRender.renderTableDefault > cellRender.tableCellFormatter > field
2706
+ const cellCompConf = cellRenderOpts ? renderer$a.get(cellRenderOpts.name) : null;
2707
+ if (cellRenderOpts) {
2708
+ const cellDefaultRenderFn = cellCompConf ? (cellCompConf.renderTableDefault || cellCompConf.renderDefault) : null;
2709
+ if (cellDefaultRenderFn && cellRenderOpts) {
2710
+ return renderCellBaseVNs(params, getSlotVNs(cellDefaultRenderFn(cellRenderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
2711
+ }
2712
+ }
2713
+ if (editRenderOpts) {
2714
+ const editCompConf = editRenderOpts ? renderer$a.get(editRenderOpts.name) : null;
2715
+ const editCellRenderFn = editCompConf
2716
+ ? ((editCompConf.renderTableCell || editCompConf.renderCell) ||
2717
+ (editCompConf.renderTableDefault || editCompConf.renderDefault))
2718
+ : null;
2719
+ if (editCellRenderFn) {
2720
+ return renderCellBaseVNs(params, getSlotVNs(editCellRenderFn(editRenderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
2714
2721
  }
2715
2722
  }
2723
+ // 如果是编辑模式-查看:cellRender.tableCellFormatter > editRender.tableCellFormatter > field
2724
+ // 如果是查看表格:cellRender.tableCellFormatter > field
2716
2725
  cellValue = $table.getCellLabel(row, column);
2717
2726
  }
2718
2727
  const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : '';
@@ -3481,6 +3490,7 @@ const Cell = {
3481
3490
  return renderCellBaseVNs(params, $table.callSlot(defaultSlot, cellParams));
3482
3491
  }
3483
3492
  }
3493
+ // slot default > formatter
3484
3494
  if (formatter) {
3485
3495
  return renderCellBaseVNs(params, [
3486
3496
  h('span', {
@@ -11086,7 +11096,7 @@ hooks$4.add('tableExportModule', {
11086
11096
  const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts;
11087
11097
  const { treeConfig } = props;
11088
11098
  const { isRowGroupStatus } = reactData;
11089
- const { fullColumnFieldData } = internalData;
11099
+ const { fullColumnFieldData, fullAllDataRowIdData } = internalData;
11090
11100
  const radioOpts = computeRadioOpts.value;
11091
11101
  const checkboxOpts = computeCheckboxOpts.value;
11092
11102
  const treeOpts = computeTreeOpts.value;
@@ -11242,6 +11252,7 @@ hooks$4.add('tableExportModule', {
11242
11252
  }
11243
11253
  if (treeConfig) {
11244
11254
  // 如果是树结构
11255
+ const { seqMode } = treeOpts;
11245
11256
  const childrenField = treeOpts.children || treeOpts.childrenField;
11246
11257
  const rest = [];
11247
11258
  const expandMaps = {};
@@ -11262,6 +11273,7 @@ hooks$4.add('tableExportModule', {
11262
11273
  _hasChild: hasRowChild,
11263
11274
  _expand: hasRowChild && $xeTable.isTreeExpandByRow(row)
11264
11275
  };
11276
+ const rowRest = fullAllDataRowIdData[rowid] || {};
11265
11277
  columns.forEach((column, $columnIndex) => {
11266
11278
  let cellValue = '';
11267
11279
  const renderOpts = column.editRender || column.cellRender;
@@ -11281,7 +11293,10 @@ hooks$4.add('tableExportModule', {
11281
11293
  else {
11282
11294
  switch (column.type) {
11283
11295
  case 'seq': {
11284
- const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
11296
+ let seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
11297
+ if (seqMode === 'increasing') {
11298
+ seqVal = rowRest ? (rowRest._index + 1) : -1;
11299
+ }
11285
11300
  cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
11286
11301
  break;
11287
11302
  }
@@ -21271,13 +21286,17 @@ var VxeTableComponent = defineVxeComponent({
21271
21286
  clOpSize = cellRender.options ? cellRender.options.length : 0;
21272
21287
  clOgSize = cellRender.optionGroups ? cellRender.optionGroups.length : 0;
21273
21288
  }
21274
- // formatter > tableCellFormatter
21275
- const renderOpts = formatter ? null : (editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null));
21276
- const compConf = renderOpts ? renderer$1.get(renderOpts.name) : null;
21277
- const tcFormatter = compConf ? compConf.tableCellFormatter : null;
21289
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
21290
+ const editRenderOpts = formatter ? null : (isEnableEdit && isEnableConf(editRender) ? editRender : null);
21291
+ const cellRenderOpts = formatter ? null : (isEnableConf(cellRender) ? cellRender : null);
21292
+ // formatter > cellRender.tableCellFormatter > editRender.tableCellFormatter
21293
+ const cellCompConf = cellRenderOpts ? renderer$1.get(cellRenderOpts.name) : null;
21294
+ const editCompConf = editRenderOpts ? renderer$1.get(editRenderOpts.name) : null;
21295
+ const cellDfFormatter = cellCompConf ? cellCompConf.tableCellFormatter : null;
21296
+ const editDfFormatter = editCompConf ? editCompConf.tableCellFormatter : null;
21278
21297
  const cellValue = getCellValue(row, column);
21279
21298
  let cellLabel = cellValue;
21280
- if (formatter || tcFormatter) {
21299
+ if (formatter || cellDfFormatter || editDfFormatter) {
21281
21300
  let formatData;
21282
21301
  const { fullAllDataRowIdData } = internalData;
21283
21302
  const rowid = getRowid($xeTable, row);
@@ -21318,8 +21337,11 @@ var VxeTableComponent = defineVxeComponent({
21318
21337
  cellLabel = formatter(formatParams);
21319
21338
  }
21320
21339
  }
21321
- else if (renderOpts && tcFormatter) {
21322
- cellLabel = tcFormatter(renderOpts, formatParams);
21340
+ else if (cellRenderOpts && cellDfFormatter) {
21341
+ cellLabel = cellDfFormatter(cellRenderOpts, formatParams);
21342
+ }
21343
+ else if (editRenderOpts && editDfFormatter) {
21344
+ cellLabel = editDfFormatter(editRenderOpts, formatParams);
21323
21345
  }
21324
21346
  if (formatData) {
21325
21347
  const ftValue = [cellValue, etOpSize, etOgSize, clOpSize, clOgSize];
@@ -32696,6 +32718,10 @@ var VxeGridComponent = defineVxeComponent({
32696
32718
  return handleZoom();
32697
32719
  },
32698
32720
  getFormData,
32721
+ /**
32722
+ * 已废弃,被 getFormFlatItems 替换
32723
+ * @deprecated
32724
+ */
32699
32725
  getFormItems(itemIndex) {
32700
32726
  const formOpts = computeFormOpts.value;
32701
32727
  const { formConfig } = props;
@@ -32704,8 +32730,30 @@ var VxeGridComponent = defineVxeComponent({
32704
32730
  XEUtils.eachTree(formConfig && isEnableConf(formOpts) && items ? items : [], item => {
32705
32731
  itemList.push(item);
32706
32732
  }, { children: 'children' });
32733
+ // errLog('vxe.error.delFunc', ['getFormItems', 'getFormFlatItems'])
32707
32734
  return XEUtils.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
32708
32735
  },
32736
+ getFormFlatItems() {
32737
+ const $form = refForm.value;
32738
+ if ($form) {
32739
+ return $form.getFlatItems();
32740
+ }
32741
+ return [];
32742
+ },
32743
+ getFormNestedItems() {
32744
+ const $form = refForm.value;
32745
+ if ($form) {
32746
+ return $form.getNestedItems();
32747
+ }
32748
+ return [];
32749
+ },
32750
+ getFormItemByField(field) {
32751
+ const $form = refForm.value;
32752
+ if ($form) {
32753
+ return $form.getItemByField(field);
32754
+ }
32755
+ return null;
32756
+ },
32709
32757
  resetForm() {
32710
32758
  const $form = refForm.value;
32711
32759
  if ($form) {