@kne/table-page 0.1.24 → 0.1.25
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.css +0 -25
- package/dist/index.css.map +1 -1
- package/dist/index.js +7 -363
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +5 -367
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -1
package/dist/index.modern.js
CHANGED
|
@@ -25,8 +25,9 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
25
25
|
import { createWithIntlProvider, useIntl } from '@kne/react-intl';
|
|
26
26
|
import filterZhCN from '@kne/react-filter/dist/locale/zh-CN';
|
|
27
27
|
import filterEnUS from '@kne/react-filter/dist/locale/en-US';
|
|
28
|
+
import StickyScroller, { isDocumentScrollContainer, getViewportRect } from '@kne/react-sticky-scroller';
|
|
28
29
|
import useControlValue from '@kne/use-control-value';
|
|
29
|
-
import
|
|
30
|
+
import '@kne/react-sticky-scroller/dist/index.css';
|
|
30
31
|
import '@kne/button-group/dist/index.css';
|
|
31
32
|
import '@kne/react-filter/dist/index.css';
|
|
32
33
|
import ButtonGroup from '@kne/button-group';
|
|
@@ -771,9 +772,6 @@ const parsePixelValue = value => {
|
|
|
771
772
|
const num = parseFloat(value);
|
|
772
773
|
return Number.isNaN(num) ? 0 : num;
|
|
773
774
|
};
|
|
774
|
-
const isDocumentScrollContainer = container => {
|
|
775
|
-
return !container || container === document.body || container === document.documentElement || container === document.scrollingElement;
|
|
776
|
-
};
|
|
777
775
|
const normalizeScrollTopInsetCSSValue = value => {
|
|
778
776
|
if (value == null) {
|
|
779
777
|
return undefined;
|
|
@@ -807,25 +805,6 @@ const readScrollTopInsetPixels = element => {
|
|
|
807
805
|
const fromVar = readCssVariableLength(element, '--scroll-top-inset', '0px') || readCssVariableLength(element, '--sticky-offset', '0px') || readCssVariableLength(element, '--nav-height', '0px');
|
|
808
806
|
return fromVar;
|
|
809
807
|
};
|
|
810
|
-
const getViewportRect = () => {
|
|
811
|
-
const visualViewport = window.visualViewport;
|
|
812
|
-
if (visualViewport) {
|
|
813
|
-
return {
|
|
814
|
-
top: visualViewport.offsetTop,
|
|
815
|
-
bottom: visualViewport.offsetTop + visualViewport.height,
|
|
816
|
-
left: visualViewport.offsetLeft,
|
|
817
|
-
right: visualViewport.offsetLeft + visualViewport.width,
|
|
818
|
-
height: visualViewport.height
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
return {
|
|
822
|
-
top: 0,
|
|
823
|
-
bottom: window.innerHeight,
|
|
824
|
-
left: 0,
|
|
825
|
-
right: window.innerWidth,
|
|
826
|
-
height: window.innerHeight
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
808
|
const getTableElement = root => {
|
|
830
809
|
if (!root) {
|
|
831
810
|
return null;
|
|
@@ -917,32 +896,6 @@ const scrollAnchorIntoView = (root, {
|
|
|
917
896
|
});
|
|
918
897
|
});
|
|
919
898
|
};
|
|
920
|
-
const getTableScrollElement = root => {
|
|
921
|
-
if (!root) {
|
|
922
|
-
return null;
|
|
923
|
-
}
|
|
924
|
-
return root.querySelector('.ant-table-body') || root.querySelector('.ant-table-content');
|
|
925
|
-
};
|
|
926
|
-
const getElementViewportState = element => {
|
|
927
|
-
if (!element) {
|
|
928
|
-
return {
|
|
929
|
-
isBottomInViewport: true,
|
|
930
|
-
isPartiallyInViewport: false,
|
|
931
|
-
isTopInViewport: true,
|
|
932
|
-
rect: null,
|
|
933
|
-
viewport: getViewportRect()
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
const rect = element.getBoundingClientRect();
|
|
937
|
-
const viewport = getViewportRect();
|
|
938
|
-
return {
|
|
939
|
-
isBottomInViewport: rect.bottom > viewport.top && rect.bottom <= viewport.bottom,
|
|
940
|
-
isPartiallyInViewport: rect.top < viewport.bottom && rect.bottom > viewport.top,
|
|
941
|
-
isTopInViewport: rect.top >= viewport.top && rect.top < viewport.bottom,
|
|
942
|
-
rect,
|
|
943
|
-
viewport
|
|
944
|
-
};
|
|
945
|
-
};
|
|
946
899
|
const isTopEdgeInViewport = (element, scrollMarginTop = 0, getScrollContainer) => {
|
|
947
900
|
if (!element) {
|
|
948
901
|
return true;
|
|
@@ -954,64 +907,10 @@ const isTopEdgeInViewport = (element, scrollMarginTop = 0, getScrollContainer) =
|
|
|
954
907
|
const _viewportTop = containerRect.top + scrollMarginTop;
|
|
955
908
|
return rect.top >= _viewportTop && rect.top < containerRect.bottom;
|
|
956
909
|
}
|
|
957
|
-
const
|
|
958
|
-
isTopInViewport,
|
|
959
|
-
viewport
|
|
960
|
-
} = getElementViewportState(element);
|
|
961
|
-
if (!rect) {
|
|
962
|
-
return true;
|
|
963
|
-
}
|
|
910
|
+
const viewport = getViewportRect();
|
|
964
911
|
const viewportTop = viewport.top + scrollMarginTop;
|
|
965
912
|
return rect.top >= viewportTop && rect.top < viewport.bottom;
|
|
966
913
|
};
|
|
967
|
-
const shouldShowFloatingScrollbar = (scrollEl, viewportState, getScrollContainer) => {
|
|
968
|
-
if (!scrollEl || scrollEl.scrollWidth <= scrollEl.clientWidth + 1) {
|
|
969
|
-
return false;
|
|
970
|
-
}
|
|
971
|
-
const explicitContainer = typeof getScrollContainer === 'function' ? getScrollContainer() : null;
|
|
972
|
-
if (!isDocumentScrollContainer(explicitContainer)) {
|
|
973
|
-
const rect = scrollEl.getBoundingClientRect();
|
|
974
|
-
const containerRect = explicitContainer.getBoundingClientRect();
|
|
975
|
-
return rect.top < containerRect.bottom && rect.bottom > containerRect.bottom;
|
|
976
|
-
}
|
|
977
|
-
const state = viewportState || getElementViewportState(scrollEl);
|
|
978
|
-
if (!state.isPartiallyInViewport) {
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
return !state.isBottomInViewport;
|
|
982
|
-
};
|
|
983
|
-
const observeViewportIntersection = (element, onChange) => {
|
|
984
|
-
var _window$visualViewpor, _window$visualViewpor2;
|
|
985
|
-
if (!element) {
|
|
986
|
-
return () => {};
|
|
987
|
-
}
|
|
988
|
-
const notify = entry => {
|
|
989
|
-
onChange(getElementViewportState(element));
|
|
990
|
-
};
|
|
991
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
992
|
-
notify();
|
|
993
|
-
}, {
|
|
994
|
-
root: null,
|
|
995
|
-
threshold: [0, 0.01, 0.25, 0.5, 0.75, 1]
|
|
996
|
-
});
|
|
997
|
-
observer.observe(element);
|
|
998
|
-
const handleViewportChange = () => {
|
|
999
|
-
notify();
|
|
1000
|
-
};
|
|
1001
|
-
window.addEventListener('scroll', handleViewportChange, true);
|
|
1002
|
-
window.addEventListener('resize', handleViewportChange);
|
|
1003
|
-
(_window$visualViewpor = window.visualViewport) == null || _window$visualViewpor.addEventListener('resize', handleViewportChange);
|
|
1004
|
-
(_window$visualViewpor2 = window.visualViewport) == null || _window$visualViewpor2.addEventListener('scroll', handleViewportChange);
|
|
1005
|
-
notify();
|
|
1006
|
-
return () => {
|
|
1007
|
-
var _window$visualViewpor3, _window$visualViewpor4;
|
|
1008
|
-
observer.disconnect();
|
|
1009
|
-
window.removeEventListener('scroll', handleViewportChange, true);
|
|
1010
|
-
window.removeEventListener('resize', handleViewportChange);
|
|
1011
|
-
(_window$visualViewpor3 = window.visualViewport) == null || _window$visualViewpor3.removeEventListener('resize', handleViewportChange);
|
|
1012
|
-
(_window$visualViewpor4 = window.visualViewport) == null || _window$visualViewpor4.removeEventListener('scroll', handleViewportChange);
|
|
1013
|
-
};
|
|
1014
|
-
};
|
|
1015
914
|
|
|
1016
915
|
/** 叶子去掉空 children,懒加载节点保留 [],避免 antd 把所有节点当成可展开 */
|
|
1017
916
|
const prepareAntdTreeNodes = (nodes, {
|
|
@@ -2002,268 +1901,7 @@ Table.useSelectedRow = useSelectedRow;
|
|
|
2002
1901
|
Table.useSort = useSort;
|
|
2003
1902
|
Table.sortDataSource = useSort.sortDataSource;
|
|
2004
1903
|
|
|
2005
|
-
var style$1 = {"table-page":"kne-table-page_ut9rJ","fetch-stack":"kne-table-page_dpy7d","toolbar-height-reserve":"kne-table-page_daceW","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-sticky":"kne-table-page_7lYyk","is-loading-shell":"kne-table-page_LY8zA","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-cell-skeleton":"kne-table-page_--DrO","table-skeleton-spin":"kne-table-page_cZ1zq","table-in-toolbar":"kne-table-page_sawIT","is-card-mode":"kne-table-page_kH6wM","is-card-render":"kne-table-page_-WbMN","card-mode-toggle":"kne-table-page_ostpI","mobile-load-more":"kne-table-page_UqVnb","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr"
|
|
2006
|
-
|
|
2007
|
-
const BAR_HEIGHT = 15;
|
|
2008
|
-
const THUMB_MARGIN = 2;
|
|
2009
|
-
const computeBarMetrics = (scrollEl, viewportState, getPortalContainer) => {
|
|
2010
|
-
const rect = scrollEl.getBoundingClientRect();
|
|
2011
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2012
|
-
const useEmbeddedPlacement = !isDocumentScrollContainer(portalContainer);
|
|
2013
|
-
const trackWidth = rect.width;
|
|
2014
|
-
const thumbWidth = Math.max(trackWidth * scrollEl.clientWidth / scrollEl.scrollWidth - THUMB_MARGIN * 2, 24);
|
|
2015
|
-
const maxThumbOffset = trackWidth - thumbWidth - THUMB_MARGIN * 2;
|
|
2016
|
-
const scrollRatio = scrollEl.scrollWidth > scrollEl.clientWidth ? scrollEl.scrollLeft / (scrollEl.scrollWidth - scrollEl.clientWidth) : 0;
|
|
2017
|
-
const visible = shouldShowFloatingScrollbar(scrollEl, viewportState, getPortalContainer);
|
|
2018
|
-
if (useEmbeddedPlacement) {
|
|
2019
|
-
const containerRect = portalContainer.getBoundingClientRect();
|
|
2020
|
-
return {
|
|
2021
|
-
placement: 'embedded',
|
|
2022
|
-
offsetLeft: Math.round(rect.left - containerRect.left),
|
|
2023
|
-
width: Math.round(trackWidth),
|
|
2024
|
-
thumbWidth,
|
|
2025
|
-
thumbLeft: THUMB_MARGIN + maxThumbOffset * scrollRatio,
|
|
2026
|
-
visible
|
|
2027
|
-
};
|
|
2028
|
-
}
|
|
2029
|
-
const viewport = getViewportRect();
|
|
2030
|
-
return {
|
|
2031
|
-
placement: 'fixed',
|
|
2032
|
-
left: Math.round(rect.left),
|
|
2033
|
-
width: Math.round(trackWidth),
|
|
2034
|
-
bottom: window.innerHeight - viewport.bottom,
|
|
2035
|
-
thumbWidth,
|
|
2036
|
-
thumbLeft: THUMB_MARGIN + maxThumbOffset * scrollRatio,
|
|
2037
|
-
visible
|
|
2038
|
-
};
|
|
2039
|
-
};
|
|
2040
|
-
const metricsEqual = (prev, next) => {
|
|
2041
|
-
if (!prev || !next) {
|
|
2042
|
-
return prev === next;
|
|
2043
|
-
}
|
|
2044
|
-
return prev.placement === next.placement && prev.visible === next.visible && prev.width === next.width && prev.thumbWidth === next.thumbWidth && prev.thumbLeft === next.thumbLeft && (prev.placement === 'embedded' ? prev.offsetLeft === next.offsetLeft : prev.left === next.left && prev.bottom === next.bottom);
|
|
2045
|
-
};
|
|
2046
|
-
const FloatingScrollBar = ({
|
|
2047
|
-
metrics,
|
|
2048
|
-
onThumbDrag,
|
|
2049
|
-
getPortalContainer
|
|
2050
|
-
}) => {
|
|
2051
|
-
const startRef = useRef(0);
|
|
2052
|
-
const [moving, setMoving] = useState(false);
|
|
2053
|
-
const movingRef = useRef(false);
|
|
2054
|
-
const onThumbDragRef = useRef(onThumbDrag);
|
|
2055
|
-
onThumbDragRef.current = onThumbDrag;
|
|
2056
|
-
useEffect(() => {
|
|
2057
|
-
movingRef.current = moving;
|
|
2058
|
-
}, [moving]);
|
|
2059
|
-
useEffect(() => {
|
|
2060
|
-
const moveHandler = event => {
|
|
2061
|
-
if (!movingRef.current) {
|
|
2062
|
-
return;
|
|
2063
|
-
}
|
|
2064
|
-
onThumbDragRef.current(event.clientX - startRef.current);
|
|
2065
|
-
startRef.current = event.clientX;
|
|
2066
|
-
};
|
|
2067
|
-
const upHandler = () => {
|
|
2068
|
-
setMoving(false);
|
|
2069
|
-
};
|
|
2070
|
-
document.addEventListener('mousemove', moveHandler, true);
|
|
2071
|
-
document.addEventListener('mouseup', upHandler, true);
|
|
2072
|
-
return () => {
|
|
2073
|
-
document.removeEventListener('mousemove', moveHandler, true);
|
|
2074
|
-
document.removeEventListener('mouseup', upHandler, true);
|
|
2075
|
-
};
|
|
2076
|
-
}, []);
|
|
2077
|
-
if (!(metrics != null && metrics.visible)) {
|
|
2078
|
-
return null;
|
|
2079
|
-
}
|
|
2080
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2081
|
-
const useEmbeddedPlacement = metrics.placement === 'embedded';
|
|
2082
|
-
const portalTarget = useEmbeddedPlacement && portalContainer ? portalContainer : document.body;
|
|
2083
|
-
return /*#__PURE__*/createPortal(/*#__PURE__*/jsx("div", {
|
|
2084
|
-
className: classnames(style$1['floating-scrollbar'], 'table-page-floating-scrollbar', {
|
|
2085
|
-
[style$1['floating-scrollbar-embedded']]: useEmbeddedPlacement
|
|
2086
|
-
}),
|
|
2087
|
-
style: useEmbeddedPlacement ? {
|
|
2088
|
-
marginLeft: metrics.offsetLeft,
|
|
2089
|
-
width: metrics.width,
|
|
2090
|
-
height: BAR_HEIGHT
|
|
2091
|
-
} : {
|
|
2092
|
-
left: metrics.left,
|
|
2093
|
-
width: metrics.width,
|
|
2094
|
-
height: BAR_HEIGHT,
|
|
2095
|
-
bottom: metrics.bottom
|
|
2096
|
-
},
|
|
2097
|
-
children: /*#__PURE__*/jsx("div", {
|
|
2098
|
-
className: classnames(style$1['floating-scrollbar-thumb'], {
|
|
2099
|
-
[style$1['is-moving']]: moving
|
|
2100
|
-
}),
|
|
2101
|
-
style: {
|
|
2102
|
-
width: metrics.thumbWidth,
|
|
2103
|
-
left: metrics.thumbLeft
|
|
2104
|
-
},
|
|
2105
|
-
onMouseDown: event => {
|
|
2106
|
-
event.preventDefault();
|
|
2107
|
-
startRef.current = event.clientX;
|
|
2108
|
-
setMoving(true);
|
|
2109
|
-
}
|
|
2110
|
-
})
|
|
2111
|
-
}), portalTarget);
|
|
2112
|
-
};
|
|
2113
|
-
const HorizontalScroller = /*#__PURE__*/forwardRef(({
|
|
2114
|
-
className,
|
|
2115
|
-
enabled: _enabled = true,
|
|
2116
|
-
getPortalContainer,
|
|
2117
|
-
children
|
|
2118
|
-
}, forwardedRef) => {
|
|
2119
|
-
const [metrics, setMetrics] = useState(null);
|
|
2120
|
-
const containerRef = useRef(null);
|
|
2121
|
-
const scrollElRef = useRef(null);
|
|
2122
|
-
const viewportStateRef = useRef(null);
|
|
2123
|
-
const metricsRef = useRef(null);
|
|
2124
|
-
const setContainerRef = useRefCallback(node => {
|
|
2125
|
-
containerRef.current = node;
|
|
2126
|
-
if (typeof forwardedRef === 'function') {
|
|
2127
|
-
forwardedRef(node);
|
|
2128
|
-
} else if (forwardedRef) {
|
|
2129
|
-
forwardedRef.current = node;
|
|
2130
|
-
}
|
|
2131
|
-
});
|
|
2132
|
-
const updateMetrics = useRefCallback(() => {
|
|
2133
|
-
const scrollEl = scrollElRef.current;
|
|
2134
|
-
if (!scrollEl) {
|
|
2135
|
-
metricsRef.current = null;
|
|
2136
|
-
setMetrics(null);
|
|
2137
|
-
return;
|
|
2138
|
-
}
|
|
2139
|
-
const nextMetrics = computeBarMetrics(scrollEl, viewportStateRef.current, getPortalContainer);
|
|
2140
|
-
if (metricsEqual(metricsRef.current, nextMetrics)) {
|
|
2141
|
-
return;
|
|
2142
|
-
}
|
|
2143
|
-
metricsRef.current = nextMetrics;
|
|
2144
|
-
setMetrics(nextMetrics);
|
|
2145
|
-
});
|
|
2146
|
-
const handleThumbDrag = useRefCallback(deltaX => {
|
|
2147
|
-
const scrollEl = scrollElRef.current;
|
|
2148
|
-
if (!scrollEl) {
|
|
2149
|
-
return;
|
|
2150
|
-
}
|
|
2151
|
-
const trackWidth = scrollEl.clientWidth;
|
|
2152
|
-
const scrollableWidth = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
2153
|
-
const thumbWidth = Math.max(trackWidth * scrollEl.clientWidth / scrollEl.scrollWidth - THUMB_MARGIN * 2, 24);
|
|
2154
|
-
const thumbTravel = trackWidth - thumbWidth - THUMB_MARGIN * 2;
|
|
2155
|
-
if (thumbTravel <= 0) {
|
|
2156
|
-
return;
|
|
2157
|
-
}
|
|
2158
|
-
scrollEl.scrollLeft += deltaX / thumbTravel * scrollableWidth;
|
|
2159
|
-
updateMetrics();
|
|
2160
|
-
});
|
|
2161
|
-
useEffect(() => {
|
|
2162
|
-
if (!_enabled) {
|
|
2163
|
-
scrollElRef.current = null;
|
|
2164
|
-
viewportStateRef.current = null;
|
|
2165
|
-
metricsRef.current = null;
|
|
2166
|
-
setMetrics(null);
|
|
2167
|
-
return undefined;
|
|
2168
|
-
}
|
|
2169
|
-
const root = containerRef.current;
|
|
2170
|
-
if (!root) {
|
|
2171
|
-
return undefined;
|
|
2172
|
-
}
|
|
2173
|
-
let scrollEl = null;
|
|
2174
|
-
let unobserveViewport = null;
|
|
2175
|
-
let contentResizeObserver = null;
|
|
2176
|
-
const portalContainer = typeof getPortalContainer === 'function' ? getPortalContainer() : null;
|
|
2177
|
-
const useEmbeddedPlacement = !isDocumentScrollContainer(portalContainer);
|
|
2178
|
-
const detachScrollEl = () => {
|
|
2179
|
-
var _contentResizeObserve;
|
|
2180
|
-
unobserveViewport == null || unobserveViewport();
|
|
2181
|
-
unobserveViewport = null;
|
|
2182
|
-
if (!scrollEl) {
|
|
2183
|
-
return;
|
|
2184
|
-
}
|
|
2185
|
-
scrollEl.removeEventListener('scroll', updateMetrics);
|
|
2186
|
-
(_contentResizeObserve = contentResizeObserver) == null || _contentResizeObserve.disconnect();
|
|
2187
|
-
contentResizeObserver = null;
|
|
2188
|
-
scrollElRef.current = null;
|
|
2189
|
-
viewportStateRef.current = null;
|
|
2190
|
-
scrollEl = null;
|
|
2191
|
-
};
|
|
2192
|
-
const attachScrollEl = nextScrollEl => {
|
|
2193
|
-
if (!nextScrollEl || nextScrollEl === scrollEl) {
|
|
2194
|
-
return;
|
|
2195
|
-
}
|
|
2196
|
-
detachScrollEl();
|
|
2197
|
-
scrollEl = nextScrollEl;
|
|
2198
|
-
scrollElRef.current = scrollEl;
|
|
2199
|
-
if (!useEmbeddedPlacement) {
|
|
2200
|
-
unobserveViewport = observeViewportIntersection(scrollEl, state => {
|
|
2201
|
-
viewportStateRef.current = state;
|
|
2202
|
-
updateMetrics();
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
scrollEl.addEventListener('scroll', updateMetrics, {
|
|
2206
|
-
passive: true
|
|
2207
|
-
});
|
|
2208
|
-
contentResizeObserver = new ResizeObserver(updateMetrics);
|
|
2209
|
-
contentResizeObserver.observe(scrollEl);
|
|
2210
|
-
Array.from(scrollEl.children).forEach(child => {
|
|
2211
|
-
contentResizeObserver.observe(child);
|
|
2212
|
-
});
|
|
2213
|
-
};
|
|
2214
|
-
const onLayoutChange = () => {
|
|
2215
|
-
attachScrollEl(getTableScrollElement(root));
|
|
2216
|
-
updateMetrics();
|
|
2217
|
-
};
|
|
2218
|
-
const containerResizeObserver = new ResizeObserver(onLayoutChange);
|
|
2219
|
-
containerResizeObserver.observe(root);
|
|
2220
|
-
onLayoutChange();
|
|
2221
|
-
const onWindowChange = () => {
|
|
2222
|
-
if (!useEmbeddedPlacement) {
|
|
2223
|
-
updateMetrics();
|
|
2224
|
-
}
|
|
2225
|
-
};
|
|
2226
|
-
if (!useEmbeddedPlacement) {
|
|
2227
|
-
var _window$visualViewpor, _window$visualViewpor2;
|
|
2228
|
-
window.addEventListener('scroll', onWindowChange, true);
|
|
2229
|
-
window.addEventListener('resize', onWindowChange);
|
|
2230
|
-
(_window$visualViewpor = window.visualViewport) == null || _window$visualViewpor.addEventListener('resize', onWindowChange);
|
|
2231
|
-
(_window$visualViewpor2 = window.visualViewport) == null || _window$visualViewpor2.addEventListener('scroll', onWindowChange);
|
|
2232
|
-
}
|
|
2233
|
-
if (useEmbeddedPlacement && portalContainer) {
|
|
2234
|
-
portalContainer.addEventListener('scroll', updateMetrics, {
|
|
2235
|
-
passive: true
|
|
2236
|
-
});
|
|
2237
|
-
window.addEventListener('resize', updateMetrics);
|
|
2238
|
-
}
|
|
2239
|
-
return () => {
|
|
2240
|
-
detachScrollEl();
|
|
2241
|
-
containerResizeObserver.disconnect();
|
|
2242
|
-
if (!useEmbeddedPlacement) {
|
|
2243
|
-
var _window$visualViewpor3, _window$visualViewpor4;
|
|
2244
|
-
window.removeEventListener('scroll', onWindowChange, true);
|
|
2245
|
-
window.removeEventListener('resize', onWindowChange);
|
|
2246
|
-
(_window$visualViewpor3 = window.visualViewport) == null || _window$visualViewpor3.removeEventListener('resize', onWindowChange);
|
|
2247
|
-
(_window$visualViewpor4 = window.visualViewport) == null || _window$visualViewpor4.removeEventListener('scroll', onWindowChange);
|
|
2248
|
-
}
|
|
2249
|
-
if (useEmbeddedPlacement && portalContainer) {
|
|
2250
|
-
portalContainer.removeEventListener('scroll', updateMetrics);
|
|
2251
|
-
window.removeEventListener('resize', updateMetrics);
|
|
2252
|
-
}
|
|
2253
|
-
};
|
|
2254
|
-
}, [_enabled, updateMetrics, getPortalContainer]);
|
|
2255
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
2256
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
2257
|
-
ref: setContainerRef,
|
|
2258
|
-
className: className,
|
|
2259
|
-
children: children
|
|
2260
|
-
}), _enabled ? /*#__PURE__*/jsx(FloatingScrollBar, {
|
|
2261
|
-
metrics: metrics,
|
|
2262
|
-
onThumbDrag: handleThumbDrag,
|
|
2263
|
-
getPortalContainer: getPortalContainer
|
|
2264
|
-
}) : null]
|
|
2265
|
-
});
|
|
2266
|
-
});
|
|
1904
|
+
var style$1 = {"table-page":"kne-table-page_ut9rJ","fetch-stack":"kne-table-page_dpy7d","toolbar-height-reserve":"kne-table-page_daceW","table-page-tabs-outer":"kne-table-page_IowJl","table-content":"kne-table-page_dxN6N","table-with-toolbar":"kne-table-page_sf06r","is-sticky":"kne-table-page_7lYyk","is-loading-shell":"kne-table-page_LY8zA","is-mobile-render":"kne-table-page_D6KGb","has-summary":"kne-table-page_IRdzb","table-cell-skeleton":"kne-table-page_--DrO","table-skeleton-spin":"kne-table-page_cZ1zq","table-in-toolbar":"kne-table-page_sawIT","is-card-mode":"kne-table-page_kH6wM","is-card-render":"kne-table-page_-WbMN","card-mode-toggle":"kne-table-page_ostpI","mobile-load-more":"kne-table-page_UqVnb","pagination":"kne-table-page_DSTEf","total_text":"kne-table-page_pJhKr"};
|
|
2267
1905
|
|
|
2268
1906
|
const _excluded$2 = ["size", "moreType", "showLength", "list", "getPopupContainer"];
|
|
2269
1907
|
const hasButtonGroupList = buttonGroup => Array.isArray(buttonGroup == null ? void 0 : buttonGroup.list) && buttonGroup.list.length > 0;
|
|
@@ -3537,7 +3175,7 @@ const TablePageInnerContent = withLocale(_ref => {
|
|
|
3537
3175
|
setCardMode(next);
|
|
3538
3176
|
}
|
|
3539
3177
|
}) : null;
|
|
3540
|
-
const tableMain = /*#__PURE__*/jsxs(
|
|
3178
|
+
const tableMain = /*#__PURE__*/jsxs(StickyScroller, {
|
|
3541
3179
|
ref: tableContentRef,
|
|
3542
3180
|
enabled: horizontalScroller && renderType === 'Table' && !isCardModeActive,
|
|
3543
3181
|
getPortalContainer: getScrollContainer,
|