@lensui/lens-table 0.1.74 → 0.1.75
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/index.cjs +15 -0
- package/dist/index.css +1 -0
- package/dist/index.js +15 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1997,6 +1997,7 @@ function TableInner({
|
|
|
1997
1997
|
const rootRef = (0, import_react8.useRef)(null);
|
|
1998
1998
|
const frameRef = (0, import_react8.useRef)(null);
|
|
1999
1999
|
const textFrameRef = (0, import_react8.useRef)(null);
|
|
2000
|
+
const textLayoutScrollTopRef = (0, import_react8.useRef)(0);
|
|
2000
2001
|
const toastTimerRef = (0, import_react8.useRef)(null);
|
|
2001
2002
|
const headerTooltipTimerRef = (0, import_react8.useRef)(null);
|
|
2002
2003
|
const cellTooltipTimerRef = (0, import_react8.useRef)(null);
|
|
@@ -3034,6 +3035,13 @@ function TableInner({
|
|
|
3034
3035
|
horizontalScrollbarDragRef.current = null;
|
|
3035
3036
|
showCustomScrollbar("horizontal");
|
|
3036
3037
|
}, [showCustomScrollbar]);
|
|
3038
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
3039
|
+
textLayoutScrollTopRef.current = scrollPosition.top;
|
|
3040
|
+
const clips = rootRef.current?.querySelectorAll(".rvg-body-text-clip");
|
|
3041
|
+
clips?.forEach((clip) => {
|
|
3042
|
+
clip.style.transform = "";
|
|
3043
|
+
});
|
|
3044
|
+
}, [scrollPosition.top]);
|
|
3037
3045
|
const handleScroll = (0, import_react8.useCallback)(() => {
|
|
3038
3046
|
const element = scrollerRef.current;
|
|
3039
3047
|
if (!element) return;
|
|
@@ -3041,6 +3049,13 @@ function TableInner({
|
|
|
3041
3049
|
const scrollDeltaX = element.scrollLeft - previousScroll.left;
|
|
3042
3050
|
const scrollDeltaY = element.scrollTop - previousScroll.top;
|
|
3043
3051
|
scrollRef.current = { left: element.scrollLeft, top: element.scrollTop };
|
|
3052
|
+
const textDeltaY = element.scrollTop - textLayoutScrollTopRef.current;
|
|
3053
|
+
if (textDeltaY !== 0) {
|
|
3054
|
+
const clips = rootRef.current?.querySelectorAll(".rvg-body-text-clip");
|
|
3055
|
+
clips?.forEach((clip) => {
|
|
3056
|
+
clip.style.transform = `translate3d(0, ${-textDeltaY}px, 0)`;
|
|
3057
|
+
});
|
|
3058
|
+
}
|
|
3044
3059
|
syncSelectionEdgeTarget(element.scrollLeft, element.scrollTop);
|
|
3045
3060
|
const focus = selectionFocusRef.current;
|
|
3046
3061
|
if (focus && selection && !selectionRange) {
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1967,6 +1967,7 @@ function TableInner({
|
|
|
1967
1967
|
const rootRef = useRef4(null);
|
|
1968
1968
|
const frameRef = useRef4(null);
|
|
1969
1969
|
const textFrameRef = useRef4(null);
|
|
1970
|
+
const textLayoutScrollTopRef = useRef4(0);
|
|
1970
1971
|
const toastTimerRef = useRef4(null);
|
|
1971
1972
|
const headerTooltipTimerRef = useRef4(null);
|
|
1972
1973
|
const cellTooltipTimerRef = useRef4(null);
|
|
@@ -3004,6 +3005,13 @@ function TableInner({
|
|
|
3004
3005
|
horizontalScrollbarDragRef.current = null;
|
|
3005
3006
|
showCustomScrollbar("horizontal");
|
|
3006
3007
|
}, [showCustomScrollbar]);
|
|
3008
|
+
useLayoutEffect3(() => {
|
|
3009
|
+
textLayoutScrollTopRef.current = scrollPosition.top;
|
|
3010
|
+
const clips = rootRef.current?.querySelectorAll(".rvg-body-text-clip");
|
|
3011
|
+
clips?.forEach((clip) => {
|
|
3012
|
+
clip.style.transform = "";
|
|
3013
|
+
});
|
|
3014
|
+
}, [scrollPosition.top]);
|
|
3007
3015
|
const handleScroll = useCallback2(() => {
|
|
3008
3016
|
const element = scrollerRef.current;
|
|
3009
3017
|
if (!element) return;
|
|
@@ -3011,6 +3019,13 @@ function TableInner({
|
|
|
3011
3019
|
const scrollDeltaX = element.scrollLeft - previousScroll.left;
|
|
3012
3020
|
const scrollDeltaY = element.scrollTop - previousScroll.top;
|
|
3013
3021
|
scrollRef.current = { left: element.scrollLeft, top: element.scrollTop };
|
|
3022
|
+
const textDeltaY = element.scrollTop - textLayoutScrollTopRef.current;
|
|
3023
|
+
if (textDeltaY !== 0) {
|
|
3024
|
+
const clips = rootRef.current?.querySelectorAll(".rvg-body-text-clip");
|
|
3025
|
+
clips?.forEach((clip) => {
|
|
3026
|
+
clip.style.transform = `translate3d(0, ${-textDeltaY}px, 0)`;
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3014
3029
|
syncSelectionEdgeTarget(element.scrollLeft, element.scrollTop);
|
|
3015
3030
|
const focus = selectionFocusRef.current;
|
|
3016
3031
|
if (focus && selection && !selectionRange) {
|