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
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  import { getFuncText, isEnableConf } from '../../ui/src/utils';
3
3
  import { initTpImg } from '../../ui/src/dom';
4
- import { getRowid } from './util';
4
+ import { createHandleGetRowId } from './util';
5
5
  import { VxeUI } from '../../ui';
6
6
  import methods from './methods';
7
7
  import TableBodyComponent from './body';
@@ -193,6 +193,7 @@ function renderRowExpandedVNs(h, $xeTable) {
193
193
  })
194
194
  ];
195
195
  if (expandColumn) {
196
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
196
197
  tableRowExpandedList.forEach((row) => {
197
198
  const expandOpts = $xeTable.computeExpandOpts;
198
199
  const { height: expandHeight, padding } = expandOpts;
@@ -200,7 +201,7 @@ function renderRowExpandedVNs(h, $xeTable) {
200
201
  const treeOpts = $xeTable.computeTreeOpts;
201
202
  const { transform, seqMode } = treeOpts;
202
203
  const cellStyle = {};
203
- const rowid = getRowid($xeTable, row);
204
+ const rowid = handleGetRowId(row);
204
205
  const rest = fullAllDataRowIdData[rowid];
205
206
  let rowLevel = 0;
206
207
  let seq = -1;
@@ -446,8 +447,6 @@ export default {
446
447
  isAllSelected: false,
447
448
  // 复选框属性,有选中且非全选状态
448
449
  isIndeterminate: false,
449
- // 复选框属性,已选中的行集合
450
- selectCheckboxMaps: {},
451
450
  // 当前行
452
451
  currentRow: null,
453
452
  // 单选框属性,选中列
@@ -461,16 +460,6 @@ export default {
461
460
  hasFixedColumn: false,
462
461
  // 树节点列信息
463
462
  treeNodeColumn: null,
464
- // 已展开的行集合
465
- rowExpandedMaps: {},
466
- // 懒加载中的展开行的集合
467
- rowExpandLazyLoadedMaps: {},
468
- // 已展开树节点集合
469
- treeExpandedMaps: {},
470
- // 懒加载中的树节点的集合
471
- treeExpandLazyLoadedMaps: {},
472
- // 树节点不确定状态的集合
473
- treeIndeterminateMaps: {},
474
463
  // 合并单元格的对象集
475
464
  mergeList: [],
476
465
  // 合并表尾数据的对象集
@@ -487,8 +476,6 @@ export default {
487
476
  upDataFlag: 0,
488
477
  // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
489
478
  reColumnFlag: 0,
490
- // 已标记的对象集
491
- pendingRowMaps: {},
492
479
  // 自定义列相关的信息
493
480
  customStore: {
494
481
  btnEl: null,
@@ -623,6 +610,10 @@ export default {
623
610
  isHeader: false,
624
611
  isFooter: false
625
612
  },
613
+ rowExpandedFlag: 1,
614
+ treeExpandedFlag: 1,
615
+ updateCheckboxFlag: 1,
616
+ pendingRowFlag: 1,
626
617
  rowHeightStore: {
627
618
  default: 48,
628
619
  medium: 44,
@@ -757,17 +748,29 @@ export default {
757
748
  computeCellOpts() {
758
749
  const $xeTable = this;
759
750
  const props = $xeTable;
760
- return Object.assign({}, getConfig().table.cellConfig, props.cellConfig);
751
+ const cellOpts = Object.assign({}, getConfig().table.cellConfig, props.cellConfig);
752
+ if (cellOpts.height) {
753
+ cellOpts.height = XEUtils.toNumber(cellOpts.height);
754
+ }
755
+ return cellOpts;
761
756
  },
762
757
  computeHeaderCellOpts() {
763
758
  const $xeTable = this;
764
759
  const props = $xeTable;
765
- return Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
760
+ const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
761
+ if (headerCellOpts.height) {
762
+ headerCellOpts.height = XEUtils.toNumber(headerCellOpts.height);
763
+ }
764
+ return headerCellOpts;
766
765
  },
767
766
  computeFooterCellOpts() {
768
767
  const $xeTable = this;
769
768
  const props = $xeTable;
770
- return Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig);
769
+ const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig);
770
+ if (footerCellOpts.height) {
771
+ footerCellOpts.height = XEUtils.toNumber(footerCellOpts.height);
772
+ }
773
+ return footerCellOpts;
771
774
  },
772
775
  rowOpts() {
773
776
  return this.computeRowOpts;
@@ -1036,12 +1039,15 @@ export default {
1036
1039
  computeTableRowExpandedList() {
1037
1040
  const $xeTable = this;
1038
1041
  const reactData = $xeTable;
1039
- const { rowExpandedMaps, tableData, expandColumn } = reactData;
1042
+ const internalData = $xeTable;
1043
+ const { rowExpandedFlag, tableData, expandColumn } = reactData;
1044
+ const { rowExpandedMaps } = internalData;
1045
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
1040
1046
  const expandList = [];
1041
- if (expandColumn) {
1047
+ if (expandColumn && rowExpandedFlag) {
1042
1048
  const rowKeys = {};
1043
1049
  tableData.forEach(row => {
1044
- rowKeys[getRowid($xeTable, row)] = true;
1050
+ rowKeys[handleGetRowId(row)] = true;
1045
1051
  });
1046
1052
  XEUtils.each(rowExpandedMaps, (row, rowid) => {
1047
1053
  if (rowKeys[rowid]) {
@@ -1278,13 +1284,15 @@ export default {
1278
1284
  lastScrollTop: 0,
1279
1285
  // 单选框属性,已选中保留的行
1280
1286
  radioReserveRow: null,
1281
- // 复选框属性,已选中保留的行
1287
+ // 复选框属性,已选中保留的行集合
1282
1288
  checkboxReserveRowMap: {},
1283
- // 行数据,已展开保留的行
1289
+ // 行数据,已展开保留的行集合
1284
1290
  rowExpandedReserveRowMap: {},
1285
- // 树结构数据,已展开保留的行
1291
+ // 树结构数据,已展开保留的行集合
1286
1292
  treeExpandedReserveRowMap: {},
1287
- // 完整数据、条件处理后
1293
+ // 树结构数据,不确定状态的集合
1294
+ treeIndeterminateRowMaps: {},
1295
+ // 列表完整数据、条件处理后
1288
1296
  tableFullData: [],
1289
1297
  afterFullData: [],
1290
1298
  // 列表条件处理后数据集合
@@ -1302,6 +1310,18 @@ export default {
1302
1310
  fullColumnMap: new Map(),
1303
1311
  fullColumnIdData: {},
1304
1312
  fullColumnFieldData: {},
1313
+ // 已展开的行集合
1314
+ rowExpandedMaps: {},
1315
+ // 懒加载中的展开行的集合
1316
+ rowExpandLazyLoadedMaps: {},
1317
+ // 已展开树节点集合
1318
+ treeExpandedMaps: {},
1319
+ // 懒加载中的树节点的集合
1320
+ treeExpandLazyLoadedMaps: {},
1321
+ // 复选框属性,已选中的行集合
1322
+ selectCheckboxMaps: {},
1323
+ // 已标记的对象集
1324
+ pendingRowMaps: {},
1305
1325
  swYSize: 0,
1306
1326
  swYInterval: 0,
1307
1327
  swYTotal: 0
@@ -108,7 +108,7 @@ export function createHandleUpdateRowId($xeTable) {
108
108
  return {
109
109
  rowKey,
110
110
  handleUpdateRowId(row) {
111
- return updateRId(row, rowKey);
111
+ return row ? updateRId(row, rowKey) : null;
112
112
  }
113
113
  };
114
114
  }
@@ -119,7 +119,7 @@ export function createHandleGetRowId($xeTable) {
119
119
  return {
120
120
  rowKey,
121
121
  handleGetRowId(row) {
122
- return getRId(row, rowKey);
122
+ return row ? getRId(row, rowKey) : null;
123
123
  }
124
124
  };
125
125
  }
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.14.0-beta.20";
3
+ export const version = "3.14.0-beta.21";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.14.0-beta.20"}`;
3
+ const version = `table v${"3.14.0-beta.21"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);