vxe-table 4.8.13 → 4.8.15

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/lib/index.umd.js CHANGED
@@ -1998,7 +1998,7 @@ function eqEmptyValue(cellValue) {
1998
1998
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
1999
1999
 
2000
2000
 
2001
- const version = "4.8.13";
2001
+ const version = "4.8.15";
2002
2002
  core_.VxeUI.version = version;
2003
2003
  core_.VxeUI.tableVersion = version;
2004
2004
  core_.VxeUI.setConfig({
@@ -2389,7 +2389,7 @@ var es_array_push = __webpack_require__(4114);
2389
2389
  const {
2390
2390
  log: log_log
2391
2391
  } = core_.VxeUI;
2392
- const log_version = `table v${"4.8.13"}`;
2392
+ const log_version = `table v${"4.8.15"}`;
2393
2393
  const warnLog = log_log.create('warn', log_version);
2394
2394
  const errLog = log_log.create('error', log_version);
2395
2395
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -16483,7 +16483,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16483
16483
  let isBottomBoundary = false;
16484
16484
  let isLeftBoundary = false;
16485
16485
  let isRightBoundary = false;
16486
- console.log(222);
16487
16486
  if (isRollX) {
16488
16487
  const xThreshold = computeScrollXThreshold.value;
16489
16488
  isLeft = scrollLeft <= 0;
@@ -21275,11 +21274,11 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21275
21274
  computeMouseOpts,
21276
21275
  computeTreeOpts
21277
21276
  } = $xeTable.getComputeMaps();
21278
- function getCheckboxRangeRows(params, targetTrElem, moveRange) {
21277
+ function getCheckboxRangeRows(evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
21279
21278
  let countHeight = 0;
21280
21279
  let rangeRows = [];
21280
+ let moveSize = 0;
21281
21281
  const isDown = moveRange > 0;
21282
- const moveSize = moveRange > 0 ? moveRange : Math.abs(moveRange) + targetTrElem.offsetHeight;
21283
21282
  const {
21284
21283
  scrollYLoad
21285
21284
  } = reactData;
@@ -21288,13 +21287,23 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21288
21287
  scrollYStore
21289
21288
  } = internalData;
21290
21289
  if (scrollYLoad) {
21290
+ if (isDown) {
21291
+ moveSize = offsetClientTop + moveRange;
21292
+ } else {
21293
+ moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
21294
+ }
21291
21295
  const _rowIndex = $xeTable.getVTRowIndex(params.row);
21292
21296
  if (isDown) {
21293
21297
  rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / scrollYStore.rowHeight));
21294
21298
  } else {
21295
- rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight) + 1, _rowIndex + 1);
21299
+ rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / scrollYStore.rowHeight), _rowIndex + 1);
21296
21300
  }
21297
21301
  } else {
21302
+ if (isDown) {
21303
+ moveSize = evnt.clientY - trRect.y;
21304
+ } else {
21305
+ moveSize = trRect.y - evnt.clientY + trRect.height;
21306
+ }
21298
21307
  const siblingProp = isDown ? 'next' : 'previous';
21299
21308
  while (targetTrElem && countHeight < moveSize) {
21300
21309
  const rowNodeRest = $xeTable.getRowNode(targetTrElem);
@@ -21327,7 +21336,7 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21327
21336
  const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
21328
21337
  const domMousemove = document.onmousemove;
21329
21338
  const domMouseup = document.onmouseup;
21330
- const trElem = cell.parentNode;
21339
+ const trElem = cell.parentElement;
21331
21340
  const selectRecords = $xeTable.getCheckboxRecords();
21332
21341
  let lastRangeRows = [];
21333
21342
  const marginSize = 1;
@@ -21336,6 +21345,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21336
21345
  const startLeft = offsetRest.offsetLeft + evnt.offsetX;
21337
21346
  const startScrollTop = bodyWrapperElem.scrollTop;
21338
21347
  const rowHeight = trElem.offsetHeight;
21348
+ const trRect = trElem.getBoundingClientRect();
21349
+ const offsetClientTop = disY - trRect.y;
21339
21350
  let mouseScrollTimeout = null;
21340
21351
  let isMouseScrollDown = false;
21341
21352
  let mouseScrollSpaceSize = 1;
@@ -21383,7 +21394,7 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
21383
21394
  checkboxRangeElem.style.left = `${rangeLeft}px`;
21384
21395
  checkboxRangeElem.style.top = `${rangeTop}px`;
21385
21396
  checkboxRangeElem.style.display = 'block';
21386
- const rangeRows = getCheckboxRangeRows(params, trElem, offsetTop < marginSize ? -rangeHeight : rangeHeight);
21397
+ const rangeRows = getCheckboxRangeRows(evnt, params, trElem, trRect, offsetClientTop, offsetTop < marginSize ? -rangeHeight : rangeHeight);
21387
21398
  // 至少滑动 10px 才能有效匹配
21388
21399
  if (rangeHeight > 10 && rangeRows.length !== lastRangeRows.length) {
21389
21400
  lastRangeRows = rangeRows;