@visactor/vtable 0.14.3-alpha.3 → 0.14.3-alpha.4

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.
package/dist/vtable.js CHANGED
@@ -56257,25 +56257,30 @@
56257
56257
  const screenLeftX = screenLeft.left;
56258
56258
  proxy.screenLeftCol = screenLeftCol;
56259
56259
  const deltaCol = proxy.screenLeftCol - proxy.referenceCol;
56260
+ move$1(deltaCol, screenLeftCol, screenLeftX, x, proxy);
56261
+ proxy.table.scenegraph.updateNextFrame();
56262
+ }
56263
+ function move$1(deltaCol, screenLeftCol, screenLeftX, x, proxy) {
56260
56264
  if (deltaCol > 0) {
56261
- moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);
56265
+ moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, x, proxy);
56262
56266
  proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
56263
56267
  }
56264
56268
  else if (deltaCol < 0) {
56265
- moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);
56269
+ moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, x, proxy);
56266
56270
  proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
56267
56271
  }
56268
56272
  else {
56269
56273
  proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
56270
56274
  }
56271
- proxy.table.scenegraph.updateNextFrame();
56272
56275
  }
56273
- async function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
56276
+ async function moveColumn(count, direction, screenLeftCol, screenLeftX, x, proxy) {
56274
56277
  if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {
56275
56278
  count = proxy.bodyRightCol - proxy.colEnd;
56279
+ move$1(count, screenLeftCol, screenLeftX, x, proxy);
56276
56280
  }
56277
56281
  else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {
56278
56282
  count = proxy.colStart - proxy.bodyLeftCol;
56283
+ move$1(count, screenLeftCol, screenLeftX, x, proxy);
56279
56284
  }
56280
56285
  if (count <= 0) {
56281
56286
  return;
@@ -56462,24 +56467,29 @@
56462
56467
  const screenTopY = screenTop.top;
56463
56468
  proxy.screenTopRow = screenTopRow;
56464
56469
  const deltaRow = screenTopRow - proxy.referenceRow;
56470
+ move(deltaRow, screenTopRow, screenTopY, y, proxy);
56471
+ }
56472
+ function move(deltaRow, screenTopRow, screenTopY, y, proxy) {
56465
56473
  if (deltaRow > 0) {
56466
- moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);
56474
+ moveCell(deltaRow, 'up', screenTopRow, screenTopY, y, proxy);
56467
56475
  proxy.updateBody(y - proxy.deltaY);
56468
56476
  }
56469
56477
  else if (deltaRow < 0) {
56470
- moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);
56478
+ moveCell(-deltaRow, 'down', screenTopRow, screenTopY, y, proxy);
56471
56479
  proxy.updateBody(y - proxy.deltaY);
56472
56480
  }
56473
56481
  else {
56474
56482
  proxy.updateBody(y - proxy.deltaY);
56475
56483
  }
56476
56484
  }
56477
- async function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
56485
+ async function moveCell(count, direction, screenTopRow, screenTopY, y, proxy) {
56478
56486
  if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {
56479
56487
  count = proxy.bodyBottomRow - proxy.rowEnd;
56488
+ return move(count, screenTopRow, screenTopY, y, proxy);
56480
56489
  }
56481
56490
  else if (direction === 'down' && proxy.rowStart - count < proxy.bodyTopRow) {
56482
56491
  count = proxy.rowStart - proxy.bodyTopRow;
56492
+ return move(count, screenTopRow, screenTopY, y, proxy);
56483
56493
  }
56484
56494
  if (count < proxy.rowEnd - proxy.rowStart) {
56485
56495
  const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;
@@ -57643,52 +57653,38 @@
57643
57653
  scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
57644
57654
  }
57645
57655
  function removeRow(row, scene) {
57646
- for (let col = 0; col < scene.table.colCount; col++) {
57647
- const colGroup = scene.getColGroup(col, false);
57648
- if (!colGroup) {
57649
- continue;
57650
- }
57651
- let cellGroup;
57652
- colGroup.forEachChildren((cell) => {
57653
- if (cell.row === row) {
57654
- cellGroup = cell;
57655
- return true;
57656
- }
57657
- return false;
57658
- });
57659
- if (cellGroup) {
57660
- colGroup.updateColumnHeight(-cellGroup.attribute.height);
57661
- colGroup.removeChild(cellGroup);
57662
- }
57663
- }
57664
- if (row <= scene.proxy.rowEnd) {
57665
- scene.proxy.rowEnd--;
57666
- scene.proxy.currentRow--;
57656
+ removeCellGroup(row, scene);
57657
+ const proxy = scene.proxy;
57658
+ if (row >= proxy.rowStart && row <= proxy.rowEnd) {
57659
+ proxy.rowEnd--;
57660
+ proxy.currentRow--;
57667
57661
  }
57668
- scene.proxy.bodyBottomRow--;
57669
- const totalActualBodyRowCount = Math.min(scene.proxy.rowLimit, scene.proxy.bodyBottomRow - scene.proxy.bodyTopRow + 1);
57670
- scene.proxy.totalActualBodyRowCount = totalActualBodyRowCount;
57671
- scene.proxy.totalRow = scene.proxy.bodyTopRow + totalActualBodyRowCount - 1;
57662
+ proxy.bodyBottomRow--;
57663
+ const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1);
57664
+ proxy.totalActualBodyRowCount = totalActualBodyRowCount;
57665
+ proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1;
57672
57666
  }
57673
57667
  function addRow(row, scene) {
57674
57668
  const proxy = scene.proxy;
57675
- scene.proxy.bodyBottomRow++;
57676
- scene.proxy.totalRow++;
57669
+ proxy.bodyBottomRow++;
57670
+ const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1);
57671
+ proxy.totalActualBodyRowCount = totalActualBodyRowCount;
57672
+ proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1;
57677
57673
  if (row < proxy.rowStart) {
57678
57674
  return undefined;
57679
57675
  }
57680
57676
  else if (row > proxy.rowEnd) {
57681
- if (proxy.rowEnd - proxy.rowStart < scene.proxy.rowLimit) {
57682
- scene.proxy.rowEnd++;
57683
- scene.proxy.currentRow++;
57677
+ if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {
57678
+ proxy.rowEnd++;
57679
+ proxy.currentRow++;
57684
57680
  addRowCellGroup(row, scene);
57685
57681
  return row;
57686
57682
  }
57687
57683
  return undefined;
57688
57684
  }
57689
- if (proxy.rowEnd - proxy.rowStart < scene.proxy.rowLimit) {
57690
- scene.proxy.rowEnd++;
57691
- scene.proxy.currentRow++;
57685
+ if (proxy.rowEnd - proxy.rowStart + 1 < proxy.rowLimit) {
57686
+ proxy.rowEnd++;
57687
+ proxy.currentRow++;
57692
57688
  addRowCellGroup(row, scene);
57693
57689
  return row;
57694
57690
  }
@@ -57807,6 +57803,26 @@
57807
57803
  }
57808
57804
  }
57809
57805
  }
57806
+ function removeCellGroup(row, scene) {
57807
+ for (let col = 0; col < scene.table.colCount; col++) {
57808
+ const colGroup = scene.getColGroup(col, false);
57809
+ if (!colGroup) {
57810
+ continue;
57811
+ }
57812
+ let cellGroup;
57813
+ colGroup.forEachChildren((cell) => {
57814
+ if (cell.row === row) {
57815
+ cellGroup = cell;
57816
+ return true;
57817
+ }
57818
+ return false;
57819
+ });
57820
+ if (cellGroup) {
57821
+ colGroup.updateColumnHeight(-cellGroup.attribute.height);
57822
+ colGroup.removeChild(cellGroup);
57823
+ }
57824
+ }
57825
+ }
57810
57826
 
57811
57827
  function handleTextStick(table) {
57812
57828
  const { changedCells } = table.internalProps.stick;
@@ -65756,7 +65772,7 @@
65756
65772
  return TABLE_EVENT_TYPE;
65757
65773
  }
65758
65774
  options;
65759
- version = "0.14.3-alpha.3";
65775
+ version = "0.14.3-alpha.4";
65760
65776
  pagination;
65761
65777
  id = `VTable${Date.now()}`;
65762
65778
  headerStyleCache;
@@ -75159,7 +75175,7 @@
75159
75175
  return new Tag$1(params ? params.attribute : {});
75160
75176
  }
75161
75177
 
75162
- const version = "0.14.3-alpha.3";
75178
+ const version = "0.14.3-alpha.4";
75163
75179
  function getIcons() {
75164
75180
  return get$1();
75165
75181
  }