tomtaw-vxe-table 3.25.15 → 3.25.16

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.
@@ -1,6 +1,6 @@
1
1
  import XEUtils from "xe-utils";
2
2
  import { VxeUI } from "@vxe-ui/core";
3
- import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from "../../ui/src/dom";
3
+ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getWheelScrollOffset, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from "../../ui/src/dom";
4
4
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue, hasEnableConf } from "../../ui/src/utils";
5
5
  import Cell from "./cell";
6
6
  import {
@@ -12590,12 +12590,14 @@ const tableMethods = {
12590
12590
  const deltaLeft = (shiftKey ? deltaX || deltaY : deltaX) * wheelSpeed;
12591
12591
  const currScrollTop = bodyScrollElem.scrollTop;
12592
12592
  const currScrollLeft = bodyScrollElem.scrollLeft;
12593
+ const pendingScrollTop = getWheelScrollOffset($xeTable, "top", currScrollTop);
12594
+ const pendingScrollLeft = getWheelScrollOffset($xeTable, "left", currScrollLeft);
12593
12595
  const maxScrollTop = Math.max(0, bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight);
12594
12596
  const maxScrollLeft = Math.max(0, bodyScrollElem.scrollWidth - bodyScrollElem.clientWidth);
12595
- const scrollTop = Math.min(maxScrollTop, Math.max(0, currScrollTop + deltaTop));
12596
- const scrollLeft = Math.min(maxScrollLeft, Math.max(0, currScrollLeft + deltaLeft));
12597
- const isRollX = overflowX && deltaLeft !== 0 && scrollLeft !== currScrollLeft;
12598
- const isRollY = overflowY && deltaTop !== 0 && scrollTop !== currScrollTop;
12597
+ const scrollTop = Math.min(maxScrollTop, Math.max(0, pendingScrollTop + deltaTop));
12598
+ const scrollLeft = Math.min(maxScrollLeft, Math.max(0, pendingScrollLeft + deltaLeft));
12599
+ const isRollX = overflowX && deltaLeft !== 0 && (scrollLeft !== currScrollLeft || pendingScrollLeft !== currScrollLeft);
12600
+ const isRollY = overflowY && deltaTop !== 0 && (scrollTop !== currScrollTop || pendingScrollTop !== currScrollTop);
12599
12601
  if (isRollX) {
12600
12602
  if (scrollXVisible === false || scrollXVisible === "hidden") {
12601
12603
  evnt.preventDefault();
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
- const version = "3.25.15";
3
+ const version = "3.25.16";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -50,6 +50,7 @@ export declare function hasAxternalInputTarget(target: EventTarget | Element | n
50
50
  export declare function scrollToView(elem: any): void;
51
51
  export declare function triggerEvent(targetElem: Element, type: string): void;
52
52
  export declare function isNodeElement(elem: any): elem is HTMLElement;
53
+ export declare function getWheelScrollOffset(owner: object, axis: 'left' | 'top', offset: number): number;
53
54
  export declare function wheelScrollLeftTo(scrollLeft: number, cb: (offsetLeft: number) => void, owner?: object): void;
54
55
  export declare function wheelScrollTopTo(scrollTop: number, cb: (offsetTop: number) => void, owner?: object): void;
55
56
  export declare function cancelWheelScroll(owner: object): void;
package/es/ui/src/dom.js CHANGED
@@ -191,18 +191,25 @@ function isNodeElement(elem) {
191
191
  }
192
192
  const wheelFrames = /* @__PURE__ */ new WeakMap();
193
193
  const defaultWheelOwner = {};
194
+ function getWheelScrollOffset(owner, axis, offset) {
195
+ var _a;
196
+ const state = wheelFrames.get(owner);
197
+ return state && state[axis] !== void 0 ? (_a = state.offsets[axis]) != null ? _a : offset : offset;
198
+ }
194
199
  function scheduleWheelFrame(owner, axis, offset, cb) {
195
200
  let state = wheelFrames.get(owner);
196
201
  if (!state) {
197
- state = {};
202
+ state = { offsets: {} };
198
203
  wheelFrames.set(owner, state);
199
204
  }
200
205
  const previous = state[axis];
201
206
  if (previous !== void 0) cancelAnimationFrame(previous);
207
+ state.offsets[axis] = offset;
202
208
  const currentState = state;
203
209
  const frame = requestAnimationFrame(() => {
204
210
  if (currentState[axis] !== frame) return;
205
211
  delete currentState[axis];
212
+ delete currentState.offsets[axis];
206
213
  cb(offset);
207
214
  });
208
215
  state[axis] = frame;
@@ -385,6 +392,7 @@ export {
385
392
  getPopupWrapperElement,
386
393
  getPropClass,
387
394
  getTpImg,
395
+ getWheelScrollOffset,
388
396
  hasAxternalInputTarget,
389
397
  hasClass,
390
398
  hasControlKey,
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from "@vxe-ui/core";
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"3.25.15"}`;
3
+ const tableVersion = `table v${"3.25.16"}`;
4
4
  function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : "";
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : "";
package/lib/index.umd.js CHANGED
@@ -323,7 +323,7 @@ function getDefaultConfig(val1, def1) {
323
323
  }
324
324
 
325
325
  // packages_temp/ui/index.ts
326
- var version = "3.25.15";
326
+ var version = "3.25.16";
327
327
  import_core2.VxeUI.version = version;
328
328
  import_core2.VxeUI.tableVersion = version;
329
329
  import_core2.VxeUI.setConfig({
@@ -977,18 +977,25 @@ function triggerEvent(targetElem, type) {
977
977
  }
978
978
  var wheelFrames = /* @__PURE__ */ new WeakMap();
979
979
  var defaultWheelOwner = {};
980
+ function getWheelScrollOffset(owner, axis, offset) {
981
+ var _a;
982
+ const state = wheelFrames.get(owner);
983
+ return state && state[axis] !== void 0 ? (_a = state.offsets[axis]) != null ? _a : offset : offset;
984
+ }
980
985
  function scheduleWheelFrame(owner, axis, offset, cb) {
981
986
  let state = wheelFrames.get(owner);
982
987
  if (!state) {
983
- state = {};
988
+ state = { offsets: {} };
984
989
  wheelFrames.set(owner, state);
985
990
  }
986
991
  const previous = state[axis];
987
992
  if (previous !== void 0) cancelAnimationFrame(previous);
993
+ state.offsets[axis] = offset;
988
994
  const currentState = state;
989
995
  const frame = requestAnimationFrame(() => {
990
996
  if (currentState[axis] !== frame) return;
991
997
  delete currentState[axis];
998
+ delete currentState.offsets[axis];
992
999
  cb(offset);
993
1000
  });
994
1001
  state[axis] = frame;
@@ -1160,7 +1167,7 @@ function getPopupAppendElement(appendTo) {
1160
1167
  // packages_temp/ui/src/log.ts
1161
1168
  var import_core3 = require("@vxe-ui/core");
1162
1169
  var { log } = import_core3.VxeUI;
1163
- var tableVersion = `table v${"3.25.15"}`;
1170
+ var tableVersion = `table v${"3.25.16"}`;
1164
1171
  function createComponentLog(name) {
1165
1172
  const uiVersion = import_core3.VxeUI.uiVersion ? `ui v${import_core3.VxeUI.uiVersion}` : "";
1166
1173
  const ganttVersion = import_core3.VxeUI.ganttVersion ? `gantt v${import_core3.VxeUI.ganttVersion}` : "";
@@ -17480,12 +17487,14 @@ var tableMethods = {
17480
17487
  const deltaLeft = (shiftKey ? deltaX || deltaY : deltaX) * wheelSpeed;
17481
17488
  const currScrollTop = bodyScrollElem.scrollTop;
17482
17489
  const currScrollLeft = bodyScrollElem.scrollLeft;
17490
+ const pendingScrollTop = getWheelScrollOffset($xeTable, "top", currScrollTop);
17491
+ const pendingScrollLeft = getWheelScrollOffset($xeTable, "left", currScrollLeft);
17483
17492
  const maxScrollTop = Math.max(0, bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight);
17484
17493
  const maxScrollLeft = Math.max(0, bodyScrollElem.scrollWidth - bodyScrollElem.clientWidth);
17485
- const scrollTop = Math.min(maxScrollTop, Math.max(0, currScrollTop + deltaTop));
17486
- const scrollLeft = Math.min(maxScrollLeft, Math.max(0, currScrollLeft + deltaLeft));
17487
- const isRollX = overflowX && deltaLeft !== 0 && scrollLeft !== currScrollLeft;
17488
- const isRollY = overflowY && deltaTop !== 0 && scrollTop !== currScrollTop;
17494
+ const scrollTop = Math.min(maxScrollTop, Math.max(0, pendingScrollTop + deltaTop));
17495
+ const scrollLeft = Math.min(maxScrollLeft, Math.max(0, pendingScrollLeft + deltaLeft));
17496
+ const isRollX = overflowX && deltaLeft !== 0 && (scrollLeft !== currScrollLeft || pendingScrollLeft !== currScrollLeft);
17497
+ const isRollY = overflowY && deltaTop !== 0 && (scrollTop !== currScrollTop || pendingScrollTop !== currScrollTop);
17489
17498
  if (isRollX) {
17490
17499
  if (scrollXVisible === false || scrollXVisible === "hidden") {
17491
17500
  evnt.preventDefault();