vxe-table 3.12.6 → 3.12.8

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.
@@ -320,6 +320,7 @@ export function rowToVisible($xeTable, row) {
320
320
  const tableBody = $xeTable.$refs.tableBody;
321
321
  const { columnStore, scrollYLoad } = reactData;
322
322
  const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData;
323
+ const { rowHeight } = scrollYStore;
323
324
  const { leftList, rightList } = columnStore;
324
325
  const bodyElem = tableBody ? tableBody.$el : null;
325
326
  const rowid = getRowid($xeTable, row);
@@ -351,19 +352,19 @@ export function rowToVisible($xeTable, row) {
351
352
  // 如果是虚拟渲染滚动
352
353
  if (scrollYLoad) {
353
354
  if (showOverflow) {
354
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight);
355
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
355
356
  }
356
357
  let scrollTop = 0;
357
- const rest = fullAllDataRowIdData[rowid];
358
- const rHeight = rest ? rest.height : 0;
358
+ const rowRest = fullAllDataRowIdData[rowid];
359
+ const rHeight = rowRest ? (rowRest.height || rowHeight) : rowHeight;
359
360
  for (let i = 0; i < afterFullData.length; i++) {
360
361
  const currRow = afterFullData[i];
361
362
  const currRowid = getRowid($xeTable, currRow);
362
363
  if (currRow === row || currRowid === rowid) {
363
364
  break;
364
365
  }
365
- const rest = fullAllDataRowIdData[currRowid];
366
- scrollTop += rest ? rest.height : 0;
366
+ const rowRest = fullAllDataRowIdData[currRowid];
367
+ scrollTop += rowRest ? (rowRest.height || rowHeight) : rowHeight;
367
368
  }
368
369
  if (scrollTop < bodyScrollTop) {
369
370
  return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
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.12.6";
3
+ export const version = "3.12.8";
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.12.6"}`;
3
+ const version = `table v${"3.12.8"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
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.12.6";
2223
+ const version = "3.12.8";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2814,7 +2814,7 @@ function isNodeElement(elem) {
2814
2814
  const {
2815
2815
  log: log_log
2816
2816
  } = core_.VxeUI;
2817
- const log_version = `table v${"3.12.6"}`;
2817
+ const log_version = `table v${"3.12.8"}`;
2818
2818
  const warnLog = log_log.create('warn', log_version);
2819
2819
  const errLog = log_log.create('error', log_version);
2820
2820
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3372,6 +3372,9 @@ function rowToVisible($xeTable, row) {
3372
3372
  scrollYStore,
3373
3373
  fullAllDataRowIdData
3374
3374
  } = internalData;
3375
+ const {
3376
+ rowHeight
3377
+ } = scrollYStore;
3375
3378
  const {
3376
3379
  leftList,
3377
3380
  rightList
@@ -3404,19 +3407,19 @@ function rowToVisible($xeTable, row) {
3404
3407
  // 如果是虚拟渲染滚动
3405
3408
  if (scrollYLoad) {
3406
3409
  if (showOverflow) {
3407
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * scrollYStore.rowHeight);
3410
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
3408
3411
  }
3409
3412
  let scrollTop = 0;
3410
- const rest = fullAllDataRowIdData[rowid];
3411
- const rHeight = rest ? rest.height : 0;
3413
+ const rowRest = fullAllDataRowIdData[rowid];
3414
+ const rHeight = rowRest ? rowRest.height || rowHeight : rowHeight;
3412
3415
  for (let i = 0; i < afterFullData.length; i++) {
3413
3416
  const currRow = afterFullData[i];
3414
3417
  const currRowid = getRowid($xeTable, currRow);
3415
3418
  if (currRow === row || currRowid === rowid) {
3416
3419
  break;
3417
3420
  }
3418
- const rest = fullAllDataRowIdData[currRowid];
3419
- scrollTop += rest ? rest.height : 0;
3421
+ const rowRest = fullAllDataRowIdData[currRowid];
3422
+ scrollTop += rowRest ? rowRest.height || rowHeight : rowHeight;
3420
3423
  }
3421
3424
  if (scrollTop < bodyScrollTop) {
3422
3425
  return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
@@ -3589,6 +3592,7 @@ function renderCellDragIcon(h, params) {
3589
3592
  const {
3590
3593
  $table
3591
3594
  } = params;
3595
+ const tableSlots = $table.$scopedSlots;
3592
3596
  const tableProps = $table;
3593
3597
  const {
3594
3598
  dragConfig
@@ -3601,6 +3605,7 @@ function renderCellDragIcon(h, params) {
3601
3605
  } = rowDragOpts;
3602
3606
  const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
3603
3607
  const isDisabled = rDisabledMethod && rDisabledMethod(params);
3608
+ const rowDragIconSlot = tableSlots.rowDragIcon || tableSlots['row-drag-icon'];
3604
3609
  const ons = {};
3605
3610
  if (trigger !== 'cell') {
3606
3611
  ons.mousedown = evnt => {
@@ -3616,7 +3621,7 @@ function renderCellDragIcon(h, params) {
3616
3621
  'is--disabled': isDisabled
3617
3622
  }],
3618
3623
  on: ons
3619
- }, [h('i', {
3624
+ }, rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params, h) : [h('i', {
3620
3625
  class: icon || (dragConfig ? dragConfig.rowIcon : '') || cell_getIcon().TABLE_DRAG_ROW
3621
3626
  })]);
3622
3627
  }
@@ -3660,6 +3665,10 @@ function renderHeaderCellDragIcon(h, params) {
3660
3665
  $table,
3661
3666
  column
3662
3667
  } = params;
3668
+ const tableSlots = $table.$scopedSlots;
3669
+ const {
3670
+ slots
3671
+ } = column;
3663
3672
  const columnOpts = $table.computeColumnOpts;
3664
3673
  const columnDragOpts = $table.computeColumnDragOpts;
3665
3674
  const {
@@ -3674,6 +3683,7 @@ function renderHeaderCellDragIcon(h, params) {
3674
3683
  if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
3675
3684
  if (!column.fixed && (isPeerDrag || isCrossDrag || !column.parentId)) {
3676
3685
  const isDisabled = disabledMethod && disabledMethod(params);
3686
+ const columnDragIconSlot = (slots ? slots.columnDragIcon || slots['column-drag-icon'] : null) || tableSlots.columnDragIcon || tableSlots['column-drag-icon'];
3677
3687
  const ons = {};
3678
3688
  if (trigger !== 'cell') {
3679
3689
  ons.mousedown = evnt => {
@@ -3689,7 +3699,7 @@ function renderHeaderCellDragIcon(h, params) {
3689
3699
  'is--disabled': isDisabled
3690
3700
  }],
3691
3701
  on: ons
3692
- }, [h('i', {
3702
+ }, columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params, h) : [h('i', {
3693
3703
  class: icon || cell_getIcon().TABLE_DRAG_COLUMN
3694
3704
  })]);
3695
3705
  }
@@ -5364,10 +5374,7 @@ function handleVirtualYVisible($xeTable) {
5364
5374
  const row = afterFullData[rIndex];
5365
5375
  const rowid = getRowid($xeTable, row);
5366
5376
  const rowRest = fullAllDataRowIdData[rowid];
5367
- if (!rowRest) {
5368
- break;
5369
- }
5370
- offsetTop += rowRest.height || rowHeight;
5377
+ offsetTop += rowRest ? rowRest.height || rowHeight : rowHeight;
5371
5378
  if (toVisibleIndex === -1 && scrollTop < offsetTop) {
5372
5379
  toVisibleIndex = rIndex;
5373
5380
  }
@@ -10488,7 +10495,7 @@ const Methods = {
10488
10495
  }
10489
10496
  vLen++;
10490
10497
  });
10491
- const isSelected = sLen >= vLen;
10498
+ const isSelected = rootList.length > 0 && sLen >= vLen;
10492
10499
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
10493
10500
  reactData.isAllSelected = isSelected;
10494
10501
  reactData.isIndeterminate = halfSelect;
@@ -13691,6 +13698,15 @@ const Methods = {
13691
13698
  */
13692
13699
  scrollToRow(row, fieldOrColumn) {
13693
13700
  const $xeTable = this;
13701
+ const props = $xeTable;
13702
+ const reactData = $xeTable;
13703
+ const {
13704
+ showOverflow
13705
+ } = props;
13706
+ const {
13707
+ scrollYLoad,
13708
+ scrollXLoad
13709
+ } = reactData;
13694
13710
  const rest = [];
13695
13711
  if (row) {
13696
13712
  if (this.treeConfig) {
@@ -13702,7 +13718,15 @@ const Methods = {
13702
13718
  if (fieldOrColumn) {
13703
13719
  rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row));
13704
13720
  }
13705
- return Promise.all(rest);
13721
+ return Promise.all(rest).then(() => {
13722
+ if (row) {
13723
+ if (!showOverflow && (scrollYLoad || scrollXLoad)) {
13724
+ calcCellHeight($xeTable);
13725
+ calcCellWidth($xeTable);
13726
+ }
13727
+ return $xeTable.$nextTick();
13728
+ }
13729
+ });
13706
13730
  },
13707
13731
  /**
13708
13732
  * 如果有滚动条,则滚动到对应的列