vxe-table 3.14.0-beta.20 → 3.14.0-beta.21

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 (45) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +14 -9
  3. package/es/table/module/validator/mixin.js +2 -2
  4. package/es/table/src/body.js +10 -10
  5. package/es/table/src/cell.js +15 -11
  6. package/es/table/src/methods.js +509 -458
  7. package/es/table/src/table.js +46 -26
  8. package/es/table/src/util.js +2 -2
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/index.umd.js +761 -670
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/style.css +1 -1
  14. package/lib/table/module/edit/mixin.js +16 -11
  15. package/lib/table/module/edit/mixin.min.js +1 -1
  16. package/lib/table/module/validator/mixin.js +3 -3
  17. package/lib/table/module/validator/mixin.min.js +1 -1
  18. package/lib/table/src/body.js +16 -11
  19. package/lib/table/src/body.min.js +1 -1
  20. package/lib/table/src/cell.js +22 -13
  21. package/lib/table/src/cell.min.js +1 -1
  22. package/lib/table/src/methods.js +623 -559
  23. package/lib/table/src/methods.min.js +1 -1
  24. package/lib/table/src/table.js +51 -25
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/src/util.js +2 -2
  27. package/lib/table/src/util.min.js +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/package.json +2 -2
  33. package/packages/table/module/edit/mixin.ts +17 -12
  34. package/packages/table/module/validator/mixin.ts +2 -2
  35. package/packages/table/src/body.ts +10 -10
  36. package/packages/table/src/cell.ts +15 -11
  37. package/packages/table/src/methods.ts +559 -481
  38. package/packages/table/src/table.ts +53 -31
  39. package/packages/table/src/util.ts +2 -2
  40. /package/es/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
  41. /package/es/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
  42. /package/es/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
  43. /package/lib/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
  44. /package/lib/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
  45. /package/lib/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
@@ -153,8 +153,8 @@ export default {
153
153
  const internalData = $xeTable;
154
154
  const validRest = {};
155
155
  const { editRules, treeConfig } = props;
156
- const { editStore, pendingRowMaps } = reactData;
157
- const { afterFullData } = internalData;
156
+ const { editStore } = reactData;
157
+ const { afterFullData, pendingRowMaps } = internalData;
158
158
  const { removeMaps } = editStore;
159
159
  const treeOpts = $xeTable.computeTreeOpts;
160
160
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { VxeUI } from '../../ui';
3
3
  import { isEnableConf, getClass } from '../../ui/src/utils';
4
- import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util';
4
+ import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid, createHandleGetRowId } from './util';
5
5
  import { updateCellTitle } from '../../ui/src/dom';
6
6
  import { getSlotVNs } from '../../ui/src/vn';
7
7
  const { getI18n, renderer, renderEmptyElement } = VxeUI;
@@ -14,7 +14,7 @@ const isVMScrollProcess = ($xeTable) => {
14
14
  const { lastScrollTime, isDragResize } = tableReactData;
15
15
  return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
16
16
  };
17
- function renderLine(h, _vm, params, cellHeight) {
17
+ function renderLine(h, _vm, rowid, params, cellHeight) {
18
18
  const $xeTable = _vm.$parent;
19
19
  const tableProps = $xeTable;
20
20
  const tableInternalData = $xeTable;
@@ -27,7 +27,6 @@ function renderLine(h, _vm, params, cellHeight) {
27
27
  if (slots && slots.line) {
28
28
  return $xeTable.callSlot(slots.line, params, h);
29
29
  }
30
- const rowid = getRowid($xeTable, row);
31
30
  const rest = fullAllDataRowIdData[rowid];
32
31
  let rLevel = 0;
33
32
  let prevRow = null;
@@ -267,7 +266,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
267
266
  }
268
267
  else {
269
268
  // 渲染单元格
270
- tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
269
+ tdVNs.push(...renderLine(h, _vm, rowid, cellParams, cellHeight), h('div', {
271
270
  key: 'tc',
272
271
  class: ['vxe-cell', {
273
272
  'c--title': showTitle,
@@ -388,8 +387,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
388
387
  const tableReactData = $xeTable;
389
388
  const tableInternalData = $xeTable;
390
389
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
391
- const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove, rowExpandHeightFlag } = tableReactData;
392
- const { fullAllDataRowIdData } = tableInternalData;
390
+ const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag } = tableReactData;
391
+ const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
393
392
  const checkboxOpts = $xeTable.computeCheckboxOpts;
394
393
  const radioOpts = $xeTable.computeRadioOpts;
395
394
  const treeOpts = $xeTable.computeTreeOpts;
@@ -400,6 +399,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
400
399
  const { transform, seqMode } = treeOpts;
401
400
  const childrenField = treeOpts.children || treeOpts.childrenField;
402
401
  const rows = [];
402
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
403
403
  tableData.forEach((row, $rowIndex) => {
404
404
  const trOn = {};
405
405
  let rowIndex = $rowIndex;
@@ -420,7 +420,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
420
420
  $xeTable.clearHoverRow();
421
421
  };
422
422
  }
423
- const rowid = getRowid($xeTable, row);
423
+ const rowid = handleGetRowId(row);
424
424
  const rowRest = fullAllDataRowIdData[rowid];
425
425
  let rowLevel = 0;
426
426
  let seq = -1;
@@ -437,7 +437,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
437
437
  }
438
438
  const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
439
439
  // 行是否被展开
440
- const isExpandRow = expandColumn && !!rowExpandedMaps[rowid];
440
+ const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid];
441
441
  // 树节点是否被展开
442
442
  let isExpandTree = false;
443
443
  let rowChildren = [];
@@ -448,7 +448,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
448
448
  }
449
449
  if (treeConfig && !scrollYLoad && !transform) {
450
450
  rowChildren = row[childrenField];
451
- isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
451
+ isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
452
452
  }
453
453
  // 拖拽行事件
454
454
  if (rowOpts.drag && (!treeConfig || transform)) {
@@ -467,7 +467,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
467
467
  'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
468
468
  'row--radio': radioOpts.highlight && selectRadioRow === row,
469
469
  'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
470
- 'row--pending': !!pendingRowMaps[rowid]
470
+ 'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
471
471
  },
472
472
  rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
473
473
  ];
@@ -382,8 +382,8 @@ export const Cell = {
382
382
  const { $table, isHidden } = params;
383
383
  const tableReactData = $table;
384
384
  const tableInternalData = $table;
385
- const { treeExpandedMaps, treeExpandLazyLoadedMaps } = tableReactData;
386
- const { fullAllDataRowIdData } = tableInternalData;
385
+ const { treeExpandedFlag } = tableReactData;
386
+ const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
387
387
  const treeOpts = $table.computeTreeOpts;
388
388
  const { row, column, level } = params;
389
389
  const { slots } = column;
@@ -403,7 +403,7 @@ export const Cell = {
403
403
  }
404
404
  if (!isHidden) {
405
405
  const rowid = getRowid($table, row);
406
- isActive = !!treeExpandedMaps[rowid];
406
+ isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
407
407
  if (lazy) {
408
408
  const rest = fullAllDataRowIdData[rowid];
409
409
  isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
@@ -600,8 +600,10 @@ export const Cell = {
600
600
  const { $table, row, column, isHidden } = params;
601
601
  const tableProps = $table;
602
602
  const tableReactData = $table;
603
+ const tableInternalData = $table;
603
604
  const { treeConfig } = tableProps;
604
- const { selectCheckboxMaps, treeIndeterminateMaps } = tableReactData;
605
+ const { updateCheckboxFlag } = tableReactData;
606
+ const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData;
605
607
  const checkboxOpts = $table.computeCheckboxOpts;
606
608
  const { labelField, checkMethod, visibleMethod } = checkboxOpts;
607
609
  const { slots } = column;
@@ -614,7 +616,7 @@ export const Cell = {
614
616
  const ons = {};
615
617
  if (!isHidden) {
616
618
  const rowid = getRowid($table, row);
617
- isChecked = !!selectCheckboxMaps[rowid];
619
+ isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
618
620
  ons.click = (evnt) => {
619
621
  if (!isDisabled && isVisible) {
620
622
  $table.triggerCheckRowEvent(evnt, params, !isChecked);
@@ -624,7 +626,7 @@ export const Cell = {
624
626
  isDisabled = !checkMethod({ row });
625
627
  }
626
628
  if (treeConfig) {
627
- indeterminate = !!treeIndeterminateMaps[rowid];
629
+ indeterminate = !!treeIndeterminateRowMaps[rowid];
628
630
  }
629
631
  }
630
632
  const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate });
@@ -661,8 +663,10 @@ export const Cell = {
661
663
  const { $table, row, column, isHidden } = params;
662
664
  const tableProps = $table;
663
665
  const tableReactData = $table;
666
+ const tableInternalData = $table;
664
667
  const { treeConfig } = tableProps;
665
- const { treeIndeterminateMaps } = tableReactData;
668
+ const { updateCheckboxFlag } = tableReactData;
669
+ const { treeIndeterminateRowMaps } = tableInternalData;
666
670
  const checkboxOpts = $table.computeCheckboxOpts;
667
671
  const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts;
668
672
  const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
@@ -676,7 +680,7 @@ export const Cell = {
676
680
  const ons = {};
677
681
  if (!isHidden) {
678
682
  const rowid = getRowid($table, row);
679
- isChecked = XEUtils.get(row, checkField);
683
+ isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField);
680
684
  ons.click = (evnt) => {
681
685
  if (!isDisabled && isVisible) {
682
686
  $table.triggerCheckRowEvent(evnt, params, !isChecked);
@@ -686,7 +690,7 @@ export const Cell = {
686
690
  isDisabled = !checkMethod({ row });
687
691
  }
688
692
  if (treeConfig) {
689
- isIndeterminate = !!treeIndeterminateMaps[rowid];
693
+ isIndeterminate = !!treeIndeterminateRowMaps[rowid];
690
694
  }
691
695
  }
692
696
  const checkboxParams = Object.assign(Object.assign({}, params), { checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate });
@@ -724,8 +728,8 @@ export const Cell = {
724
728
  */
725
729
  renderExpandCell(h, params) {
726
730
  const { $table, isHidden, row, column } = params;
727
- const tableReactData = $table;
728
- const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableReactData;
731
+ const tableInternalData = $table;
732
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData;
729
733
  const expandOpts = $table.computeExpandOpts;
730
734
  const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts;
731
735
  const { slots } = column;