@visactor/vtable 1.6.2 → 1.6.3-alpha.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.
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +1 -0
- package/cjs/dataset/dataset-pivot-table.js.map +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +0 -4
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +5 -1
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/scroll.d.ts +2 -1
- package/cjs/event/scroll.js +2 -2
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/state/state.d.ts +4 -4
- package/cjs/state/state.js +7 -3
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/events.d.ts +1 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +142 -138
- package/dist/vtable.min.js +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +1 -0
- package/es/dataset/dataset-pivot-table.js.map +1 -1
- package/es/event/event.js +1 -1
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +0 -3
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +5 -0
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/scroll.d.ts +2 -1
- package/es/event/scroll.js +2 -2
- package/es/event/scroll.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/state/state.d.ts +4 -4
- package/es/state/state.js +7 -3
- package/es/state/state.js.map +1 -1
- package/es/ts-types/events.d.ts +1 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
package/cjs/vrender.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAA8F;AAC9F,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;IAGf,IAAA,+BAAU,GAAE,CAAC;AACf,CAAC;AAjCD,gDAiCC;AAGD,uDAAqD;AAA5C,2GAAA,WAAW,OAAA;AACpB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.6.
|
|
1
|
+
{"version":3,"sources":["../src/vrender.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qEAA0D;AAC1D,kCAAgC;AAChC,yDAA8F;AAC9F,yDAqBgC;AAIhC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,SAAgB,kBAAkB;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IACD,QAAQ,GAAG,IAAI,CAAC;IAEhB,IAAA,+BAAgB,GAAE,CAAC;IAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;QAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;KAC3B;SAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;QACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;KACxB;IACD,IAAA,0BAAW,GAAE,CAAC;IAGd,IAAA,6BAAc,GAAE,CAAC;IAEjB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IAIf,IAAA,2BAAY,GAAE,CAAC;IAEf,IAAA,+BAAgB,GAAE,CAAC;IACnB,IAAA,iCAAkB,GAAE,CAAC;IACrB,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;IAGf,IAAA,+BAAU,GAAE,CAAC;AACf,CAAC;AAjCD,gDAiCC;AAGD,uDAAqD;AAA5C,2GAAA,WAAW,OAAA;AACpB,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AAErB,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C","file":"vrender.js","sourcesContent":["import { loadPoptip } from '@visactor/vrender-components';\nimport '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport {\n loadBrowserEnv,\n loadNodeEnv,\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\n// export const version = \"1.6.3-alpha.0\";\n\nlet registed = false;\nexport function registerForVrender() {\n if (registed) {\n return;\n }\n registed = true;\n // 注册内置组件\n preLoadAllModule();\n\n if (isBrowserEnv()) {\n loadBrowserEnv(container);\n } else if (isNodeEnv()) {\n loadNodeEnv(container);\n }\n registerArc();\n // registerArc3d();\n // registerArea();\n registerCircle();\n // registerGlyph();\n registerGroup();\n registerImage();\n registerLine();\n // registerPath();\n // registerPolygon();\n // registerPyramid3d();\n registerRect();\n // registerRect3d();\n registerRichtext();\n registerShadowRoot();\n registerSymbol();\n registerText();\n // registerWrapText();\n\n loadPoptip();\n}\n\nexport type { Direction, Timeline } from '@visactor/vrender-core';\nexport { GroupFadeIn } from '@visactor/vrender-core';\nexport { GroupFadeOut } from '@visactor/vrender-core';\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-components';\n"]}
|
package/dist/vtable.js
CHANGED
|
@@ -48023,7 +48023,7 @@
|
|
|
48023
48023
|
checkCellRangeInSelect(cellPosStart, cellPosEnd) {
|
|
48024
48024
|
return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
|
|
48025
48025
|
}
|
|
48026
|
-
updateHoverIcon(col, row, target, cellGroup
|
|
48026
|
+
updateHoverIcon(col, row, target, cellGroup) {
|
|
48027
48027
|
if (this.residentHoverIcon?.icon && target === this.residentHoverIcon?.icon) {
|
|
48028
48028
|
return;
|
|
48029
48029
|
}
|
|
@@ -48294,6 +48294,7 @@
|
|
|
48294
48294
|
this.table.scenegraph.proxy.deltaY = 0;
|
|
48295
48295
|
this.updateHoverPos(-1, -1);
|
|
48296
48296
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
48297
|
+
event: undefined,
|
|
48297
48298
|
scrollTop: this.scroll.verticalBarPos,
|
|
48298
48299
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
48299
48300
|
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
@@ -48319,6 +48320,7 @@
|
|
|
48319
48320
|
this.table.scenegraph.proxy.deltaX = 0;
|
|
48320
48321
|
this.updateHoverPos(-1, -1);
|
|
48321
48322
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
48323
|
+
event: undefined,
|
|
48322
48324
|
scrollTop: this.scroll.verticalBarPos,
|
|
48323
48325
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
48324
48326
|
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
@@ -48332,7 +48334,7 @@
|
|
|
48332
48334
|
this.checkHorizontalScrollBarEnd();
|
|
48333
48335
|
}
|
|
48334
48336
|
}
|
|
48335
|
-
setScrollTop(top) {
|
|
48337
|
+
setScrollTop(top, event) {
|
|
48336
48338
|
const totalHeight = this.table.getAllRowsHeight();
|
|
48337
48339
|
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
48338
48340
|
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance));
|
|
@@ -48350,6 +48352,7 @@
|
|
|
48350
48352
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
48351
48353
|
if (oldVerticalBarPos !== top) {
|
|
48352
48354
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
48355
|
+
event: event?.nativeEvent,
|
|
48353
48356
|
scrollTop: this.scroll.verticalBarPos,
|
|
48354
48357
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
48355
48358
|
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
@@ -48362,7 +48365,7 @@
|
|
|
48362
48365
|
this.checkVerticalScrollBarEnd();
|
|
48363
48366
|
}
|
|
48364
48367
|
}
|
|
48365
|
-
setScrollLeft(left) {
|
|
48368
|
+
setScrollLeft(left, event) {
|
|
48366
48369
|
this.table.scrollLeft;
|
|
48367
48370
|
const totalWidth = this.table.getAllColsWidth();
|
|
48368
48371
|
this.table.getFrozenColsWidth();
|
|
@@ -48382,6 +48385,7 @@
|
|
|
48382
48385
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
48383
48386
|
if (oldHorizontalBarPos !== left) {
|
|
48384
48387
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
48388
|
+
event: event?.nativeEvent,
|
|
48385
48389
|
scrollTop: this.scroll.verticalBarPos,
|
|
48386
48390
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
48387
48391
|
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
@@ -48854,6 +48858,132 @@
|
|
|
48854
48858
|
});
|
|
48855
48859
|
}
|
|
48856
48860
|
|
|
48861
|
+
function handleWhell(event, state, isWheelEvent = true) {
|
|
48862
|
+
let { deltaX, deltaY } = event;
|
|
48863
|
+
if (event.shiftKey && event.deltaY) {
|
|
48864
|
+
deltaX = deltaY;
|
|
48865
|
+
deltaY = 0;
|
|
48866
|
+
}
|
|
48867
|
+
const [optimizedDeltaX, optimizedDeltaY] = optimizeScrollXY(deltaX, deltaY, { horizontal: 1, vertical: 1 });
|
|
48868
|
+
if (optimizedDeltaX || optimizedDeltaY) {
|
|
48869
|
+
if (state.interactionState !== InteractionState.scrolling) {
|
|
48870
|
+
state.updateInteractionState(InteractionState.scrolling);
|
|
48871
|
+
}
|
|
48872
|
+
}
|
|
48873
|
+
if (optimizedDeltaX) {
|
|
48874
|
+
state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX, event);
|
|
48875
|
+
state.showHorizontalScrollBar(true);
|
|
48876
|
+
}
|
|
48877
|
+
if (optimizedDeltaY) {
|
|
48878
|
+
state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY, event);
|
|
48879
|
+
state.showVerticalScrollBar(true);
|
|
48880
|
+
}
|
|
48881
|
+
isWheelEvent && state.resetInteractionState();
|
|
48882
|
+
if (event.cancelable &&
|
|
48883
|
+
(state.table.internalProps.overscrollBehavior === 'none' ||
|
|
48884
|
+
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, state)) ||
|
|
48885
|
+
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, state)))) {
|
|
48886
|
+
event.preventDefault();
|
|
48887
|
+
}
|
|
48888
|
+
}
|
|
48889
|
+
function optimizeScrollXY(x, y, ratio) {
|
|
48890
|
+
const ANGLE = 2;
|
|
48891
|
+
const angle = Math.abs(x / y);
|
|
48892
|
+
const deltaX = angle <= 1 / ANGLE ? 0 : x;
|
|
48893
|
+
const deltaY = angle > ANGLE ? 0 : y;
|
|
48894
|
+
return [Math.ceil(deltaX * (ratio.horizontal ?? 0)), Math.ceil(deltaY * (ratio.vertical ?? 0))];
|
|
48895
|
+
}
|
|
48896
|
+
function isVerticalScrollable(deltaY, state) {
|
|
48897
|
+
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
48898
|
+
if (totalHeight === 0) {
|
|
48899
|
+
return false;
|
|
48900
|
+
}
|
|
48901
|
+
return !isScrollToTop(deltaY, state) && !isScrollToBottom(deltaY, state);
|
|
48902
|
+
}
|
|
48903
|
+
function isHorizontalScrollable(deltaX, state) {
|
|
48904
|
+
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
48905
|
+
if (totalWidth === 0) {
|
|
48906
|
+
return false;
|
|
48907
|
+
}
|
|
48908
|
+
return !isScrollToLeft(deltaX, state) && !isScrollToRight(deltaX, state);
|
|
48909
|
+
}
|
|
48910
|
+
function isScrollToTop(deltaY, state) {
|
|
48911
|
+
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
48912
|
+
return totalHeight !== 0 && deltaY <= 0 && state.scroll.verticalBarPos < 1;
|
|
48913
|
+
}
|
|
48914
|
+
function isScrollToBottom(deltaY, state) {
|
|
48915
|
+
const sizeTolerance = state.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
48916
|
+
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
48917
|
+
return totalHeight !== 0 && deltaY >= 0 && Math.abs(state.scroll.verticalBarPos - totalHeight) < 1 + sizeTolerance;
|
|
48918
|
+
}
|
|
48919
|
+
function isScrollToLeft(deltaX, state) {
|
|
48920
|
+
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
48921
|
+
return totalWidth !== 0 && deltaX <= 0 && state.scroll.horizontalBarPos < 1;
|
|
48922
|
+
}
|
|
48923
|
+
function isScrollToRight(deltaX, state) {
|
|
48924
|
+
const sizeTolerance = state.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
48925
|
+
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
48926
|
+
return totalWidth !== 0 && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1 + sizeTolerance;
|
|
48927
|
+
}
|
|
48928
|
+
class InertiaScroll {
|
|
48929
|
+
friction;
|
|
48930
|
+
lastTime;
|
|
48931
|
+
speedX;
|
|
48932
|
+
speedY;
|
|
48933
|
+
stateManager;
|
|
48934
|
+
runingId;
|
|
48935
|
+
scrollHandle;
|
|
48936
|
+
constructor(stateManager) {
|
|
48937
|
+
this.stateManager = stateManager;
|
|
48938
|
+
}
|
|
48939
|
+
setScrollHandle(scrollHandle) {
|
|
48940
|
+
this.scrollHandle = scrollHandle;
|
|
48941
|
+
}
|
|
48942
|
+
startInertia(speedX, speedY, friction) {
|
|
48943
|
+
this.lastTime = Date.now();
|
|
48944
|
+
this.speedX = speedX;
|
|
48945
|
+
this.speedY = speedY;
|
|
48946
|
+
this.friction = friction;
|
|
48947
|
+
if (!this.runingId) {
|
|
48948
|
+
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
48949
|
+
}
|
|
48950
|
+
}
|
|
48951
|
+
inertia() {
|
|
48952
|
+
const now = Date.now();
|
|
48953
|
+
const dffTime = now - this.lastTime;
|
|
48954
|
+
let stopped = true;
|
|
48955
|
+
const f = Math.pow(this.friction, dffTime / 16);
|
|
48956
|
+
const newSpeedX = f * this.speedX;
|
|
48957
|
+
const newSpeedY = f * this.speedY;
|
|
48958
|
+
let dx = 0;
|
|
48959
|
+
let dy = 0;
|
|
48960
|
+
if (Math.abs(newSpeedX) > 0.05) {
|
|
48961
|
+
stopped = false;
|
|
48962
|
+
dx = ((this.speedX + newSpeedX) / 2) * dffTime;
|
|
48963
|
+
}
|
|
48964
|
+
if (Math.abs(newSpeedY) > 0.05) {
|
|
48965
|
+
stopped = false;
|
|
48966
|
+
dy = ((this.speedY + newSpeedY) / 2) * dffTime;
|
|
48967
|
+
}
|
|
48968
|
+
this.scrollHandle?.(dx, dy);
|
|
48969
|
+
if (stopped) {
|
|
48970
|
+
this.runingId = null;
|
|
48971
|
+
return;
|
|
48972
|
+
}
|
|
48973
|
+
this.lastTime = now;
|
|
48974
|
+
this.speedX = newSpeedX;
|
|
48975
|
+
this.speedY = newSpeedY;
|
|
48976
|
+
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
48977
|
+
}
|
|
48978
|
+
endInertia() {
|
|
48979
|
+
cancelAnimationFrame(this.runingId);
|
|
48980
|
+
this.runingId = null;
|
|
48981
|
+
}
|
|
48982
|
+
isInertiaScrolling() {
|
|
48983
|
+
return !!this.runingId;
|
|
48984
|
+
}
|
|
48985
|
+
}
|
|
48986
|
+
|
|
48857
48987
|
function bindTableGroupListener(eventManager) {
|
|
48858
48988
|
const table = eventManager.table;
|
|
48859
48989
|
const stateManager = table.stateManager;
|
|
@@ -49553,6 +49683,12 @@
|
|
|
49553
49683
|
table.fireListeners(TABLE_EVENT_TYPE.RADIO_STATE_CHANGE, cellsEvent);
|
|
49554
49684
|
table.scenegraph.updateNextFrame();
|
|
49555
49685
|
});
|
|
49686
|
+
table.scenegraph.stage.addEventListener('wheel', (e) => {
|
|
49687
|
+
table.editorManager?.completeEdit();
|
|
49688
|
+
if (table.eventManager._enableTableScroll) {
|
|
49689
|
+
handleWhell(e, stateManager);
|
|
49690
|
+
}
|
|
49691
|
+
});
|
|
49556
49692
|
}
|
|
49557
49693
|
function bindGesture(eventManager) {
|
|
49558
49694
|
const table = eventManager.table;
|
|
@@ -49757,132 +49893,6 @@
|
|
|
49757
49893
|
});
|
|
49758
49894
|
}
|
|
49759
49895
|
|
|
49760
|
-
function handleWhell(event, state, isWheelEvent = true) {
|
|
49761
|
-
let { deltaX, deltaY } = event;
|
|
49762
|
-
if (event.shiftKey && event.deltaY) {
|
|
49763
|
-
deltaX = deltaY;
|
|
49764
|
-
deltaY = 0;
|
|
49765
|
-
}
|
|
49766
|
-
const [optimizedDeltaX, optimizedDeltaY] = optimizeScrollXY(deltaX, deltaY, { horizontal: 1, vertical: 1 });
|
|
49767
|
-
if (optimizedDeltaX || optimizedDeltaY) {
|
|
49768
|
-
if (state.interactionState !== InteractionState.scrolling) {
|
|
49769
|
-
state.updateInteractionState(InteractionState.scrolling);
|
|
49770
|
-
}
|
|
49771
|
-
}
|
|
49772
|
-
if (optimizedDeltaX) {
|
|
49773
|
-
state.setScrollLeft(state.scroll.horizontalBarPos + optimizedDeltaX);
|
|
49774
|
-
state.showHorizontalScrollBar(true);
|
|
49775
|
-
}
|
|
49776
|
-
if (optimizedDeltaY) {
|
|
49777
|
-
state.setScrollTop(state.scroll.verticalBarPos + optimizedDeltaY);
|
|
49778
|
-
state.showVerticalScrollBar(true);
|
|
49779
|
-
}
|
|
49780
|
-
isWheelEvent && state.resetInteractionState();
|
|
49781
|
-
if (event.cancelable &&
|
|
49782
|
-
(state.table.internalProps.overscrollBehavior === 'none' ||
|
|
49783
|
-
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, state)) ||
|
|
49784
|
-
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, state)))) {
|
|
49785
|
-
event.preventDefault();
|
|
49786
|
-
}
|
|
49787
|
-
}
|
|
49788
|
-
function optimizeScrollXY(x, y, ratio) {
|
|
49789
|
-
const ANGLE = 2;
|
|
49790
|
-
const angle = Math.abs(x / y);
|
|
49791
|
-
const deltaX = angle <= 1 / ANGLE ? 0 : x;
|
|
49792
|
-
const deltaY = angle > ANGLE ? 0 : y;
|
|
49793
|
-
return [Math.ceil(deltaX * (ratio.horizontal ?? 0)), Math.ceil(deltaY * (ratio.vertical ?? 0))];
|
|
49794
|
-
}
|
|
49795
|
-
function isVerticalScrollable(deltaY, state) {
|
|
49796
|
-
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
49797
|
-
if (totalHeight === 0) {
|
|
49798
|
-
return false;
|
|
49799
|
-
}
|
|
49800
|
-
return !isScrollToTop(deltaY, state) && !isScrollToBottom(deltaY, state);
|
|
49801
|
-
}
|
|
49802
|
-
function isHorizontalScrollable(deltaX, state) {
|
|
49803
|
-
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
49804
|
-
if (totalWidth === 0) {
|
|
49805
|
-
return false;
|
|
49806
|
-
}
|
|
49807
|
-
return !isScrollToLeft(deltaX, state) && !isScrollToRight(deltaX, state);
|
|
49808
|
-
}
|
|
49809
|
-
function isScrollToTop(deltaY, state) {
|
|
49810
|
-
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
49811
|
-
return totalHeight !== 0 && deltaY <= 0 && state.scroll.verticalBarPos < 1;
|
|
49812
|
-
}
|
|
49813
|
-
function isScrollToBottom(deltaY, state) {
|
|
49814
|
-
const sizeTolerance = state.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
49815
|
-
const totalHeight = state.table.getAllRowsHeight() - state.table.scenegraph.height;
|
|
49816
|
-
return totalHeight !== 0 && deltaY >= 0 && Math.abs(state.scroll.verticalBarPos - totalHeight) < 1 + sizeTolerance;
|
|
49817
|
-
}
|
|
49818
|
-
function isScrollToLeft(deltaX, state) {
|
|
49819
|
-
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
49820
|
-
return totalWidth !== 0 && deltaX <= 0 && state.scroll.horizontalBarPos < 1;
|
|
49821
|
-
}
|
|
49822
|
-
function isScrollToRight(deltaX, state) {
|
|
49823
|
-
const sizeTolerance = state.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
|
|
49824
|
-
const totalWidth = state.table.getAllColsWidth() - state.table.scenegraph.width;
|
|
49825
|
-
return totalWidth !== 0 && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1 + sizeTolerance;
|
|
49826
|
-
}
|
|
49827
|
-
class InertiaScroll {
|
|
49828
|
-
friction;
|
|
49829
|
-
lastTime;
|
|
49830
|
-
speedX;
|
|
49831
|
-
speedY;
|
|
49832
|
-
stateManager;
|
|
49833
|
-
runingId;
|
|
49834
|
-
scrollHandle;
|
|
49835
|
-
constructor(stateManager) {
|
|
49836
|
-
this.stateManager = stateManager;
|
|
49837
|
-
}
|
|
49838
|
-
setScrollHandle(scrollHandle) {
|
|
49839
|
-
this.scrollHandle = scrollHandle;
|
|
49840
|
-
}
|
|
49841
|
-
startInertia(speedX, speedY, friction) {
|
|
49842
|
-
this.lastTime = Date.now();
|
|
49843
|
-
this.speedX = speedX;
|
|
49844
|
-
this.speedY = speedY;
|
|
49845
|
-
this.friction = friction;
|
|
49846
|
-
if (!this.runingId) {
|
|
49847
|
-
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
49848
|
-
}
|
|
49849
|
-
}
|
|
49850
|
-
inertia() {
|
|
49851
|
-
const now = Date.now();
|
|
49852
|
-
const dffTime = now - this.lastTime;
|
|
49853
|
-
let stopped = true;
|
|
49854
|
-
const f = Math.pow(this.friction, dffTime / 16);
|
|
49855
|
-
const newSpeedX = f * this.speedX;
|
|
49856
|
-
const newSpeedY = f * this.speedY;
|
|
49857
|
-
let dx = 0;
|
|
49858
|
-
let dy = 0;
|
|
49859
|
-
if (Math.abs(newSpeedX) > 0.05) {
|
|
49860
|
-
stopped = false;
|
|
49861
|
-
dx = ((this.speedX + newSpeedX) / 2) * dffTime;
|
|
49862
|
-
}
|
|
49863
|
-
if (Math.abs(newSpeedY) > 0.05) {
|
|
49864
|
-
stopped = false;
|
|
49865
|
-
dy = ((this.speedY + newSpeedY) / 2) * dffTime;
|
|
49866
|
-
}
|
|
49867
|
-
this.scrollHandle?.(dx, dy);
|
|
49868
|
-
if (stopped) {
|
|
49869
|
-
this.runingId = null;
|
|
49870
|
-
return;
|
|
49871
|
-
}
|
|
49872
|
-
this.lastTime = now;
|
|
49873
|
-
this.speedX = newSpeedX;
|
|
49874
|
-
this.speedY = newSpeedY;
|
|
49875
|
-
this.runingId = requestAnimationFrame(this.inertia.bind(this));
|
|
49876
|
-
}
|
|
49877
|
-
endInertia() {
|
|
49878
|
-
cancelAnimationFrame(this.runingId);
|
|
49879
|
-
this.runingId = null;
|
|
49880
|
-
}
|
|
49881
|
-
isInertiaScrolling() {
|
|
49882
|
-
return !!this.runingId;
|
|
49883
|
-
}
|
|
49884
|
-
}
|
|
49885
|
-
|
|
49886
49896
|
let defaultPixelRatio = 1;
|
|
49887
49897
|
function getPixelRatio() {
|
|
49888
49898
|
if (isNode) {
|
|
@@ -49905,12 +49915,6 @@
|
|
|
49905
49915
|
handler.on(table.getElement(), 'blur', (e) => {
|
|
49906
49916
|
eventManager.dealTableHover();
|
|
49907
49917
|
});
|
|
49908
|
-
handler.on(table.getElement(), 'wheel', (e) => {
|
|
49909
|
-
table.editorManager?.completeEdit();
|
|
49910
|
-
if (table.eventManager._enableTableScroll) {
|
|
49911
|
-
handleWhell(e, stateManager);
|
|
49912
|
-
}
|
|
49913
|
-
});
|
|
49914
49918
|
handler.on(table.getElement(), 'keydown', (e) => {
|
|
49915
49919
|
if (e.key === 'a' && (e.ctrlKey || e.metaKey)) {
|
|
49916
49920
|
if (table.keyboardOptions?.selectAllOnCtrlA) {
|
|
@@ -50906,7 +50910,7 @@
|
|
|
50906
50910
|
dealIconHover(eventArgsSet) {
|
|
50907
50911
|
const { eventArgs } = eventArgsSet;
|
|
50908
50912
|
if (eventArgs) {
|
|
50909
|
-
this.table.stateManager.updateHoverIcon(eventArgs.col, eventArgs.row, eventArgs.target, eventArgs.targetCell
|
|
50913
|
+
this.table.stateManager.updateHoverIcon(eventArgs.col, eventArgs.row, eventArgs.target, eventArgs.targetCell);
|
|
50910
50914
|
}
|
|
50911
50915
|
else {
|
|
50912
50916
|
this.table.stateManager.updateHoverIcon(-1, -1, undefined, undefined);
|
|
@@ -55156,7 +55160,7 @@
|
|
|
55156
55160
|
return TABLE_EVENT_TYPE;
|
|
55157
55161
|
}
|
|
55158
55162
|
options;
|
|
55159
|
-
version = "1.6.
|
|
55163
|
+
version = "1.6.3-alpha.0";
|
|
55160
55164
|
pagination;
|
|
55161
55165
|
id = `VTable${Date.now()}`;
|
|
55162
55166
|
headerStyleCache;
|
|
@@ -75651,7 +75655,7 @@
|
|
|
75651
75655
|
}
|
|
75652
75656
|
|
|
75653
75657
|
registerForVrender();
|
|
75654
|
-
const version = "1.6.
|
|
75658
|
+
const version = "1.6.3-alpha.0";
|
|
75655
75659
|
function getIcons() {
|
|
75656
75660
|
return get$2();
|
|
75657
75661
|
}
|