vxe-table 3.12.8 → 3.12.10-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 (85) hide show
  1. package/es/grid/src/grid.js +6 -1
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/export/mixin.js +3 -3
  7. package/es/table/module/filter/mixin.js +3 -3
  8. package/es/table/module/keyboard/mixin.js +4 -4
  9. package/es/table/module/menu/mixin.js +2 -2
  10. package/es/table/module/validator/mixin.js +2 -2
  11. package/es/table/src/body.js +262 -363
  12. package/es/table/src/footer.js +135 -154
  13. package/es/table/src/header.js +120 -100
  14. package/es/table/src/methods.js +1175 -816
  15. package/es/table/src/props.js +9 -3
  16. package/es/table/src/table.js +187 -103
  17. package/es/table/src/util.js +35 -21
  18. package/es/table/style.css +146 -63
  19. package/es/table/style.min.css +1 -1
  20. package/es/ui/index.js +14 -4
  21. package/es/ui/src/log.js +1 -1
  22. package/es/vxe-table/style.css +146 -63
  23. package/es/vxe-table/style.min.css +1 -1
  24. package/lib/grid/src/grid.js +4 -1
  25. package/lib/grid/src/grid.min.js +1 -1
  26. package/lib/index.css +1 -1
  27. package/lib/index.min.css +1 -1
  28. package/lib/index.umd.js +1920 -1599
  29. package/lib/index.umd.min.js +1 -1
  30. package/lib/style.css +1 -1
  31. package/lib/style.min.css +1 -1
  32. package/lib/table/module/export/mixin.js +3 -3
  33. package/lib/table/module/export/mixin.min.js +1 -1
  34. package/lib/table/module/filter/mixin.js +4 -4
  35. package/lib/table/module/filter/mixin.min.js +1 -1
  36. package/lib/table/module/keyboard/mixin.js +5 -5
  37. package/lib/table/module/keyboard/mixin.min.js +1 -1
  38. package/lib/table/module/menu/mixin.js +2 -2
  39. package/lib/table/module/menu/mixin.min.js +1 -1
  40. package/lib/table/module/validator/mixin.js +2 -2
  41. package/lib/table/module/validator/mixin.min.js +1 -1
  42. package/lib/table/src/body.js +205 -381
  43. package/lib/table/src/body.min.js +1 -1
  44. package/lib/table/src/footer.js +124 -151
  45. package/lib/table/src/footer.min.js +1 -1
  46. package/lib/table/src/header.js +97 -74
  47. package/lib/table/src/header.min.js +1 -1
  48. package/lib/table/src/methods.js +1261 -875
  49. package/lib/table/src/methods.min.js +1 -1
  50. package/lib/table/src/props.js +9 -3
  51. package/lib/table/src/props.min.js +1 -1
  52. package/lib/table/src/table.js +171 -90
  53. package/lib/table/src/table.min.js +1 -1
  54. package/lib/table/src/util.js +38 -22
  55. package/lib/table/src/util.min.js +1 -1
  56. package/lib/table/style/style.css +146 -63
  57. package/lib/table/style/style.min.css +1 -1
  58. package/lib/ui/index.js +14 -4
  59. package/lib/ui/index.min.js +1 -1
  60. package/lib/ui/src/log.js +1 -1
  61. package/lib/ui/src/log.min.js +1 -1
  62. package/lib/vxe-table/style/style.css +146 -63
  63. package/lib/vxe-table/style/style.min.css +1 -1
  64. package/package.json +2 -2
  65. package/packages/grid/src/grid.ts +6 -1
  66. package/packages/table/module/export/mixin.ts +3 -3
  67. package/packages/table/module/filter/mixin.ts +3 -3
  68. package/packages/table/module/keyboard/mixin.ts +4 -4
  69. package/packages/table/module/menu/mixin.ts +2 -2
  70. package/packages/table/module/validator/mixin.ts +2 -2
  71. package/packages/table/src/body.ts +296 -436
  72. package/packages/table/src/footer.ts +148 -164
  73. package/packages/table/src/header.ts +135 -111
  74. package/packages/table/src/methods.ts +1249 -873
  75. package/packages/table/src/props.ts +9 -3
  76. package/packages/table/src/table.ts +195 -146
  77. package/packages/table/src/util.ts +40 -23
  78. package/packages/ui/index.ts +13 -3
  79. package/styles/components/table.scss +164 -74
  80. /package/es/{iconfont.1736406699090.ttf → iconfont.1736688976404.ttf} +0 -0
  81. /package/es/{iconfont.1736406699090.woff → iconfont.1736688976404.woff} +0 -0
  82. /package/es/{iconfont.1736406699090.woff2 → iconfont.1736688976404.woff2} +0 -0
  83. /package/lib/{iconfont.1736406699090.ttf → iconfont.1736688976404.ttf} +0 -0
  84. /package/lib/{iconfont.1736406699090.woff → iconfont.1736688976404.woff} +0 -0
  85. /package/lib/{iconfont.1736406699090.woff2 → iconfont.1736688976404.woff2} +0 -0
@@ -214,11 +214,17 @@ export default {
214
214
  // 空内容渲染配置项
215
215
  emptyRender: [Boolean, Object],
216
216
  // 自定义列配置项
217
- customConfig: [Boolean, Object],
218
- // 横向虚拟滚动配置项
217
+ customConfig: Object,
218
+ // (即将废弃)横向虚拟滚动配置项
219
219
  scrollX: Object,
220
- // 纵向虚拟滚动配置项
220
+ // (即将废弃)纵向虚拟滚动配置项
221
221
  scrollY: Object,
222
+ // 横向虚拟滚动配置项
223
+ virtualXConfig: Object,
224
+ // 纵向虚拟滚动配置项
225
+ virtualYConfig: Object,
226
+ // 滚动条配置项
227
+ scrollbarConfig: Object,
222
228
  // (即将废弃)优化相关
223
229
  animat: { type: Boolean, default: () => getConfig().table.animat },
224
230
  // (可能会被废弃的参数,不要使用)
@@ -32,10 +32,11 @@ const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globa
32
32
  */
33
33
  function renderFixed(h, $xetable, fixedType) {
34
34
  const { _e, tableData, tableColumn, tableGroupColumn, vSize, showHeader, showFooter, columnStore, footerTableData } = $xetable;
35
+ const isFixedLeft = fixedType === 'left';
35
36
  const fixedColumn = columnStore[`${fixedType}List`];
36
37
  return h('div', {
37
- class: `vxe-table--fixed-${fixedType}-wrapper`,
38
- ref: `${fixedType}Container`
38
+ ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
39
+ class: `vxe-table--fixed-${fixedType}-wrapper`
39
40
  }, [
40
41
  showHeader
41
42
  ? h(TableHeaderComponent, {
@@ -202,7 +203,9 @@ export default {
202
203
  }
203
204
  },
204
205
  data() {
206
+ const xID = XEUtils.uniqueId();
205
207
  return {
208
+ xID,
206
209
  tId: `${XEUtils.uniqueId()}`,
207
210
  isCalcColumn: false,
208
211
  // 低性能的静态列
@@ -423,7 +426,7 @@ export default {
423
426
  dragCol: null,
424
427
  dragTipText: '',
425
428
  _isResize: false,
426
- _isLoading: false
429
+ isLoading: false
427
430
  };
428
431
  },
429
432
  computed: Object.assign(Object.assign({}, {}), { tableId() {
@@ -449,7 +452,7 @@ export default {
449
452
  return this.computeSXOpts;
450
453
  },
451
454
  computeSXOpts() {
452
- return Object.assign({}, getConfig().table.scrollX, this.scrollX);
455
+ return this.computeVirtualXOpts;
453
456
  },
454
457
  computeScrollXThreshold() {
455
458
  const $xeTable = this;
@@ -464,7 +467,22 @@ export default {
464
467
  return this.computeSYOpts;
465
468
  },
466
469
  computeSYOpts() {
467
- return Object.assign({}, getConfig().table.scrollY, this.scrollY);
470
+ return this.computeVirtualYOpts;
471
+ },
472
+ computeVirtualXOpts() {
473
+ const $xeTable = this;
474
+ const props = $xeTable;
475
+ return Object.assign({}, getConfig().table.scrollX, getConfig().table.virtualXConfig, props.scrollX, props.virtualXConfig);
476
+ },
477
+ computeVirtualYOpts() {
478
+ const $xeTable = this;
479
+ const props = $xeTable;
480
+ return Object.assign({}, getConfig().table.scrollY, getConfig().table.virtualYConfig, props.scrollY, props.virtualYConfig);
481
+ },
482
+ computeScrollbarOpts() {
483
+ const $xeTable = this;
484
+ const props = $xeTable;
485
+ return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig);
468
486
  },
469
487
  computeScrollYThreshold() {
470
488
  const $xeTable = this;
@@ -486,6 +504,12 @@ export default {
486
504
  mini: 36
487
505
  };
488
506
  },
507
+ computeDefaultRowHeight() {
508
+ const $xeTable = this;
509
+ const vSize = $xeTable.computeSize;
510
+ const rowHeightMaps = $xeTable.computeRowHeightMaps;
511
+ return rowHeightMaps[vSize || 'default'];
512
+ },
489
513
  columnOpts() {
490
514
  return this.computeColumnOpts;
491
515
  },
@@ -627,6 +651,30 @@ export default {
627
651
  computeMenuOpts() {
628
652
  return Object.assign({}, getConfig().table.menuConfig, this.contextMenu, this.menuConfig);
629
653
  },
654
+ computeLeftFixedWidth() {
655
+ const $xeTable = this;
656
+ const reactData = $xeTable;
657
+ const { columnStore } = reactData;
658
+ const { leftList } = columnStore;
659
+ let leftWidth = 0;
660
+ for (let i = 0; i < leftList.length; i++) {
661
+ const column = leftList[i];
662
+ leftWidth += column.renderWidth;
663
+ }
664
+ return leftWidth;
665
+ },
666
+ computeRightFixedWidth() {
667
+ const $xeTable = this;
668
+ const reactData = $xeTable;
669
+ const { columnStore } = reactData;
670
+ const { rightList } = columnStore;
671
+ let leftWidth = 0;
672
+ for (let i = 0; i < rightList.length; i++) {
673
+ const column = rightList[i];
674
+ leftWidth += column.renderWidth;
675
+ }
676
+ return leftWidth;
677
+ },
630
678
  exportOpts() {
631
679
  return this.computeExportOpts;
632
680
  },
@@ -669,7 +717,7 @@ export default {
669
717
  computeLoadingOpts() {
670
718
  return Object.assign({}, getConfig().table.loadingConfig, this.loadingConfig);
671
719
  },
672
- cellOffsetWidth() {
720
+ computeCellOffsetWidth() {
673
721
  return this.border ? Math.max(2, Math.ceil(this.scrollbarWidth / this.tableColumn.length)) : 1;
674
722
  },
675
723
  customOpts() {
@@ -842,16 +890,21 @@ export default {
842
890
  elemStore: {},
843
891
  // 存放横向 X 虚拟滚动相关的信息
844
892
  scrollXStore: {
893
+ preloadSize: 0,
845
894
  offsetSize: 0,
846
895
  visibleSize: 0,
896
+ visibleStartIndex: 0,
897
+ visibleEndIndex: 0,
847
898
  startIndex: 0,
848
899
  endIndex: 0
849
900
  },
850
901
  // 存放纵向 Y 虚拟滚动相关信息
851
902
  scrollYStore: {
852
- rowHeight: 0,
903
+ preloadSize: 0,
853
904
  offsetSize: 0,
854
905
  visibleSize: 0,
906
+ visibleStartIndex: 0,
907
+ visibleEndIndex: 0,
855
908
  startIndex: 0,
856
909
  endIndex: 0
857
910
  },
@@ -893,7 +946,10 @@ export default {
893
946
  fullDataRowIdData: {},
894
947
  fullColumnMap: new Map(),
895
948
  fullColumnIdData: {},
896
- fullColumnFieldData: {}
949
+ fullColumnFieldData: {},
950
+ swYSize: 0,
951
+ swYInterval: 0,
952
+ swYTotal: 0
897
953
  });
898
954
  if (process.env.NODE_ENV === 'development') {
899
955
  if (this.rowId) {
@@ -1163,18 +1219,34 @@ export default {
1163
1219
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
1164
1220
  const $xeTable = this;
1165
1221
  const $xeGrid = $xeTable.$xeGrid;
1166
- const { _e, $scopedSlots, tId, isCalcColumn, tableData, tableColumn, tableGroupColumn, isGroup, loading, stripe, showHeader, height, treeOpts, treeConfig, mouseConfig, mouseOpts, areaOpts, computeSize, validOpts, showFooter, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, validTipOpts, initStore, columnStore, filterStore, customStore, ctxMenuStore, ctxMenuOpts, footerTableData, columnOpts, rowOpts, checkboxOpts, loadingOpts, resizableOpts, editRules } = $xeTable;
1222
+ const props = $xeTable;
1223
+ const slots = $xeTable.$scopedSlots;
1224
+ const reactData = $xeTable;
1225
+ const { xID } = $xeTable;
1226
+ const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
1227
+ const { isCalcColumn, isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore, customStore, tooltipStore } = reactData;
1167
1228
  const { leftList, rightList } = columnStore;
1168
- const loadingSlot = $scopedSlots.loading;
1169
- const currLoading = this._isLoading || loading;
1170
- const vSize = computeSize;
1229
+ const loadingSlot = slots.loading;
1230
+ const tooltipOpts = $xeTable.computeTooltipOpts;
1231
+ const validOpts = $xeTable.computeValidOpts;
1232
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
1233
+ const treeOpts = $xeTable.computeTreeOpts;
1234
+ const rowOpts = $xeTable.computeRowOpts;
1235
+ const columnOpts = $xeTable.computeColumnOpts;
1236
+ const vSize = $xeTable.computeSize;
1171
1237
  const tableBorder = $xeTable.computeTableBorder;
1172
- const virtualScrollBars = $xeTable.computeVirtualScrollBars;
1238
+ const mouseOpts = $xeTable.computeMouseOpts;
1239
+ const areaOpts = $xeTable.computeAreaOpts;
1240
+ const loadingOpts = $xeTable.computeLoadingOpts;
1241
+ const isMenu = $xeTable.computeIsMenu;
1242
+ const currLoading = reactData.isLoading || loading;
1243
+ const resizableOpts = $xeTable.computeResizableOpts;
1173
1244
  const isArea = mouseConfig && mouseOpts.area;
1174
1245
  const columnDragOpts = $xeTable.computeColumnDragOpts;
1175
1246
  return h('div', {
1176
1247
  ref: 'refElem',
1177
- class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
1248
+ class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
1249
+ [`size--${vSize}`]: vSize,
1178
1250
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
1179
1251
  'vxe-editable': !!editConfig,
1180
1252
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete',
@@ -1194,9 +1266,9 @@ export default {
1194
1266
  'is--tree-line': treeConfig && (treeOpts.showLine || treeOpts.line),
1195
1267
  'is--fixed-left': leftList.length,
1196
1268
  'is--fixed-right': rightList.length,
1197
- 'is--animat': !!this.animat,
1198
- 'is--padding': this.padding,
1199
- 'is--round': this.round,
1269
+ 'is--animat': !!props.animat,
1270
+ 'is--padding': props.padding,
1271
+ 'is--round': props.round,
1200
1272
  'is--stripe': !treeConfig && stripe,
1201
1273
  'is--loading': currLoading,
1202
1274
  'is--empty': !currLoading && !tableData.length,
@@ -1224,100 +1296,112 @@ export default {
1224
1296
  class: 'vxe-table--render-wrapper'
1225
1297
  }, [
1226
1298
  h('div', {
1227
- class: 'vxe-table--main-wrapper'
1299
+ ref: 'refTableViewportElem',
1300
+ class: 'vxe-table--viewport-wrapper'
1228
1301
  }, [
1229
- /**
1230
- * 表头
1231
- */
1232
- showHeader
1233
- ? h(TableHeaderComponent, {
1234
- ref: 'tableHeader',
1302
+ h('div', {
1303
+ class: 'vxe-table--main-wrapper'
1304
+ }, [
1305
+ /**
1306
+ * 表头
1307
+ */
1308
+ showHeader
1309
+ ? h(TableHeaderComponent, {
1310
+ ref: 'refTableHeader',
1311
+ props: {
1312
+ tableData,
1313
+ tableColumn,
1314
+ tableGroupColumn,
1315
+ size: vSize
1316
+ }
1317
+ })
1318
+ : renderEmptyElement($xeTable),
1319
+ /**
1320
+ * 表体
1321
+ */
1322
+ h(TableBodyComponent, {
1323
+ ref: 'refTableBody',
1235
1324
  props: {
1236
1325
  tableData,
1237
1326
  tableColumn,
1238
- tableGroupColumn,
1239
1327
  size: vSize
1240
1328
  }
1241
- })
1242
- : _e(),
1243
- /**
1244
- * 表体
1245
- */
1246
- h(TableBodyComponent, {
1247
- ref: 'tableBody',
1248
- props: {
1249
- tableData,
1250
- tableColumn,
1251
- size: vSize
1252
- }
1253
- }),
1254
- /**
1255
- * 表尾
1256
- */
1257
- showFooter
1258
- ? h(TableFooterComponent, {
1259
- ref: 'tableFooter',
1260
- props: {
1261
- footerTableData,
1262
- tableColumn,
1263
- size: vSize
1264
- }
1265
- })
1266
- : _e()
1267
- ]),
1268
- h('div', {
1269
- class: 'vxe-table--fixed-wrapper'
1270
- }, [
1271
- leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(),
1272
- rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e()
1273
- ])
1274
- ]),
1275
- virtualScrollBars.x
1276
- ? h('div', {
1277
- key: 'vx',
1278
- ref: 'refScrollXVirtualElem',
1279
- class: 'vxe-table--scroll-x-virtual'
1280
- }, [
1329
+ }),
1330
+ /**
1331
+ * 表尾
1332
+ */
1333
+ showFooter
1334
+ ? h(TableFooterComponent, {
1335
+ ref: 'refTableFooter',
1336
+ props: {
1337
+ footerTableData,
1338
+ tableColumn,
1339
+ size: vSize
1340
+ }
1341
+ })
1342
+ : renderEmptyElement($xeTable)
1343
+ ]),
1281
1344
  h('div', {
1282
- ref: 'refScrollXHandleElem',
1283
- class: 'vxe-table--scroll-x-handle',
1284
- on: {
1285
- scroll: $xeTable.scrollXEvent
1286
- }
1345
+ class: 'vxe-table--fixed-wrapper'
1287
1346
  }, [
1288
- h('div', {
1289
- ref: 'refScrollXSpaceElem',
1290
- class: 'vxe-table--scroll-x-space'
1291
- })
1347
+ leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : renderEmptyElement($xeTable),
1348
+ rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : renderEmptyElement($xeTable)
1292
1349
  ])
1293
- ])
1294
- : renderEmptyElement($xeTable),
1295
- virtualScrollBars.y
1296
- ? h('div', {
1297
- key: 'vy',
1350
+ ]),
1351
+ h('div', {
1298
1352
  ref: 'refScrollYVirtualElem',
1299
1353
  class: 'vxe-table--scroll-y-virtual'
1300
1354
  }, [
1355
+ h('div', {
1356
+ ref: 'refScrollYTopCornerElem',
1357
+ class: 'vxe-table--scroll-y-top-corner'
1358
+ }),
1301
1359
  h('div', {
1302
1360
  ref: 'refScrollYHandleElem',
1303
1361
  class: 'vxe-table--scroll-y-handle',
1304
1362
  on: {
1305
- scroll: $xeTable.scrollYEvent
1363
+ scroll: this.scrollYEvent
1306
1364
  }
1307
1365
  }, [
1308
1366
  h('div', {
1309
1367
  ref: 'refScrollYSpaceElem',
1310
1368
  class: 'vxe-table--scroll-y-space'
1311
1369
  })
1312
- ])
1370
+ ]),
1371
+ h('div', {
1372
+ ref: 'refScrollYBottomCornerElem',
1373
+ class: 'vxe-table--scroll-y-bottom-corner'
1374
+ })
1313
1375
  ])
1314
- : renderEmptyElement($xeTable),
1376
+ ]),
1377
+ h('div', {
1378
+ key: 'vx',
1379
+ ref: 'refScrollXVirtualElem',
1380
+ class: 'vxe-table--scroll-x-virtual'
1381
+ }, [
1382
+ h('div', {
1383
+ ref: 'refScrollXHandleElem',
1384
+ class: 'vxe-table--scroll-x-handle',
1385
+ on: {
1386
+ scroll: this.scrollXEvent
1387
+ }
1388
+ }, [
1389
+ h('div', {
1390
+ ref: 'refScrollXSpaceElem',
1391
+ class: 'vxe-table--scroll-x-space'
1392
+ })
1393
+ ]),
1394
+ h('div', {
1395
+ ref: 'refScrollXRightCornerElem',
1396
+ class: 'vxe-table--scroll-x-right-corner'
1397
+ })
1398
+ ]),
1315
1399
  /**
1316
1400
  * 空数据
1317
1401
  */
1318
1402
  h('div', {
1319
1403
  key: 'tn',
1320
- ref: 'emptyPlaceholder',
1404
+ ref: 'refEmptyPlaceholder',
1321
1405
  class: 'vxe-table--empty-placeholder'
1322
1406
  }, [
1323
1407
  h('div', {
@@ -1336,19 +1420,19 @@ export default {
1336
1420
  */
1337
1421
  h('div', {
1338
1422
  key: 'cl',
1423
+ ref: 'refCellResizeBar',
1339
1424
  class: 'vxe-table--resizable-bar',
1340
1425
  style: overflowX
1341
1426
  ? {
1342
1427
  'padding-bottom': `${scrollbarHeight}px`
1343
1428
  }
1344
- : {},
1345
- ref: 'resizeBar'
1429
+ : undefined
1346
1430
  }, resizableOpts.showDragTip
1347
1431
  ? [
1348
1432
  h('div', {
1349
1433
  ref: 'refCellResizeTip',
1350
1434
  class: 'vxe-table--resizable-number-tip'
1351
- }, '23432px')
1435
+ })
1352
1436
  ]
1353
1437
  : []),
1354
1438
  /**
@@ -1399,7 +1483,7 @@ export default {
1399
1483
  filterStore
1400
1484
  }
1401
1485
  })
1402
- : _e(),
1486
+ : renderEmptyElement($xeTable),
1403
1487
  /**
1404
1488
  * 导入
1405
1489
  */
@@ -1411,7 +1495,7 @@ export default {
1411
1495
  storeData: this.importStore
1412
1496
  }
1413
1497
  })
1414
- : _e(),
1498
+ : renderEmptyElement($xeTable),
1415
1499
  /**
1416
1500
  * 导出
1417
1501
  */
@@ -1423,20 +1507,20 @@ export default {
1423
1507
  storeData: this.exportStore
1424
1508
  }
1425
1509
  })
1426
- : _e(),
1510
+ : renderEmptyElement($xeTable),
1427
1511
  /**
1428
- * 快捷菜单
1429
- */
1430
- ctxMenuStore.visible && this.isCtxMenu
1512
+ * 快捷菜单
1513
+ */
1514
+ isMenu
1431
1515
  ? h(TableMenuPanelComponent, {
1432
1516
  key: 'tm',
1433
- ref: 'ctxWrapper',
1517
+ ref: 'refTableMenu',
1434
1518
  props: {
1435
- ctxMenuStore,
1436
- ctxMenuOpts
1519
+ ctxMenuStore: this.ctxMenuStore,
1520
+ ctxMenuOpts: this.ctxMenuOpts
1437
1521
  }
1438
1522
  })
1439
- : _e(),
1523
+ : renderEmptyElement($xeTable),
1440
1524
  /**
1441
1525
  * 拖拽提示
1442
1526
  */
@@ -1448,13 +1532,13 @@ export default {
1448
1532
  VxeUITooltipComponent
1449
1533
  ? h(VxeUITooltipComponent, {
1450
1534
  key: 'ctp',
1451
- ref: 'commTip',
1535
+ ref: 'refCommTooltip',
1452
1536
  props: {
1453
1537
  isArrow: false,
1454
1538
  enterable: false
1455
1539
  }
1456
1540
  })
1457
- : _e(),
1541
+ : renderEmptyElement($xeTable),
1458
1542
  /**
1459
1543
  * 工具提示
1460
1544
  */
@@ -1462,22 +1546,22 @@ export default {
1462
1546
  ? h(VxeUITooltipComponent, {
1463
1547
  key: 'btp',
1464
1548
  ref: 'tooltip',
1465
- props: Object.assign({}, this.tipConfig, this.tooltipStore.currOpts)
1549
+ props: Object.assign({}, tooltipOpts, tooltipStore.currOpts)
1466
1550
  })
1467
- : _e(),
1551
+ : renderEmptyElement($xeTable),
1468
1552
  /**
1469
1553
  * 校验提示
1470
1554
  */
1471
1555
  VxeUITooltipComponent && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip')
1472
1556
  ? h(VxeUITooltipComponent, {
1473
1557
  key: 'vtp',
1474
- ref: 'validTip',
1558
+ ref: 'refValidTooltip',
1475
1559
  class: [{
1476
1560
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
1477
1561
  }, 'vxe-table--valid-error'],
1478
- props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null
1562
+ props: validOpts.message === 'tooltip' || tableData.length === 1 ? Object.assign({ isArrow: false }, tooltipOpts) : {}
1479
1563
  })
1480
- : _e()
1564
+ : renderEmptyElement($xeTable)
1481
1565
  ])
1482
1566
  ]);
1483
1567
  },
@@ -61,11 +61,6 @@ export const convertHeaderColumnToRows = (originColumns) => {
61
61
  });
62
62
  return rows;
63
63
  };
64
- const lineOffsetSizes = {
65
- mini: 3,
66
- small: 2,
67
- medium: 1
68
- };
69
64
  export function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
70
65
  const internalData = $xeTable;
71
66
  return $xeTable.clearScroll().then(() => {
@@ -73,10 +68,13 @@ export function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
73
68
  // 重置最后滚动状态
74
69
  internalData.lastScrollLeft = 0;
75
70
  internalData.lastScrollTop = 0;
71
+ internalData.intoRunScroll = false;
76
72
  internalData.inVirtualScroll = false;
73
+ internalData.inWheelScroll = false;
74
+ internalData.inHeaderScroll = false;
77
75
  internalData.inBodyScroll = false;
78
76
  internalData.inFooterScroll = false;
79
- internalData.bodyScrollType = '';
77
+ internalData.scrollRenderType = '';
80
78
  // 还原滚动状态
81
79
  return $xeTable.scrollTo(scrollLeft, scrollTop);
82
80
  }
@@ -214,8 +212,8 @@ export function getColReMinWidth(params) {
214
212
  }
215
213
  // 如果设置最小宽
216
214
  if (colMinWidth) {
217
- const { tableBody } = $table.$refs;
218
- const bodyElem = tableBody ? tableBody.$el : null;
215
+ const { refTableBody } = $table.$refs;
216
+ const bodyElem = refTableBody ? refTableBody.$el : null;
219
217
  if (bodyElem) {
220
218
  if (isScale(colMinWidth)) {
221
219
  const bodyWidth = bodyElem.clientWidth - 1;
@@ -229,15 +227,21 @@ export function getColReMinWidth(params) {
229
227
  }
230
228
  return mWidth;
231
229
  }
230
+ const lineOffsetSizes = {
231
+ mini: 3,
232
+ small: 2,
233
+ medium: 1
234
+ };
232
235
  function countTreeExpand(prevRow, params) {
233
236
  let count = 1;
234
237
  if (!prevRow) {
235
238
  return count;
236
239
  }
237
240
  const { $table } = params;
238
- const { treeOpts } = $table;
241
+ const treeOpts = $table.computeTreeOpts;
242
+ const { transform, mapChildrenField } = treeOpts;
239
243
  const childrenField = treeOpts.children || treeOpts.childrenField;
240
- const rowChildren = prevRow[childrenField];
244
+ const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
241
245
  if (rowChildren && $table.isTreeExpandByRow(prevRow)) {
242
246
  for (let index = 0; index < rowChildren.length; index++) {
243
247
  count += countTreeExpand(rowChildren[index], params);
@@ -245,17 +249,21 @@ function countTreeExpand(prevRow, params) {
245
249
  }
246
250
  return count;
247
251
  }
248
- export function getOffsetSize($xetable) {
249
- const vSize = $xetable.computeSize;
250
- return lineOffsetSizes[vSize] || 0;
252
+ export function getOffsetSize($xeTable) {
253
+ const vSize = $xeTable.computeSize;
254
+ if (vSize) {
255
+ return lineOffsetSizes[vSize] || 0;
256
+ }
257
+ return 0;
251
258
  }
252
- export function calcTreeLine(params, items, rIndex) {
259
+ export function calcTreeLine(params, prevRow) {
253
260
  const { $table } = params;
261
+ const tableReactData = $table;
254
262
  let expandSize = 1;
255
- if (rIndex) {
256
- expandSize = countTreeExpand(items[rIndex - 1], params);
263
+ if (prevRow) {
264
+ expandSize = countTreeExpand(prevRow, params);
257
265
  }
258
- return $table.rowHeight * expandSize - (rIndex ? 1 : (12 - getOffsetSize($table)));
266
+ return tableReactData.rowHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
259
267
  }
260
268
  export function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
261
269
  for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -276,6 +284,12 @@ export function getCellValue(row, column) {
276
284
  export function setCellValue(row, column, value) {
277
285
  return XEUtils.set(row, column.field, value);
278
286
  }
287
+ export function getRefElem(refEl) {
288
+ if (refEl) {
289
+ return (refEl.$el || refEl);
290
+ }
291
+ return null;
292
+ }
279
293
  export function clearTableDefaultStatus(_vm) {
280
294
  _vm.initStatus = false;
281
295
  _vm.clearSort();
@@ -317,12 +331,12 @@ export function rowToVisible($xeTable, row) {
317
331
  const internalData = $xeTable;
318
332
  const tableProps = $xeTable;
319
333
  const { showOverflow } = tableProps;
320
- const tableBody = $xeTable.$refs.tableBody;
334
+ const refTableBody = $xeTable.$refs.refTableBody;
321
335
  const { columnStore, scrollYLoad } = reactData;
322
336
  const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData;
323
337
  const { rowHeight } = scrollYStore;
324
338
  const { leftList, rightList } = columnStore;
325
- const bodyElem = tableBody ? tableBody.$el : null;
339
+ const bodyElem = refTableBody ? refTableBody.$el : null;
326
340
  const rowid = getRowid($xeTable, row);
327
341
  let offsetFixedLeft = 0;
328
342
  leftList.forEach((item) => {
@@ -377,9 +391,9 @@ export function rowToVisible($xeTable, row) {
377
391
  }
378
392
  export function colToVisible($xeTable, column, row) {
379
393
  const { columnStore, scrollXLoad, visibleColumn } = $xeTable;
380
- const tableBody = $xeTable.$refs.tableBody;
394
+ const refTableBody = $xeTable.$refs.refTableBody;
381
395
  const { leftList, rightList } = columnStore;
382
- const bodyElem = tableBody ? tableBody.$el : null;
396
+ const bodyElem = refTableBody ? refTableBody.$el : null;
383
397
  if (column.fixed) {
384
398
  return Promise.resolve();
385
399
  }