@ehfuse/mui-virtual-data-table 1.0.5 → 1.0.7
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.esm.js +14 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -444,6 +444,7 @@ showScrollbar = true, }, ref) => {
|
|
|
444
444
|
autoHide,
|
|
445
445
|
};
|
|
446
446
|
});
|
|
447
|
+
const wrapperRef = react.useRef(null);
|
|
447
448
|
const containerRef = react.useRef(null);
|
|
448
449
|
const contentRef = react.useRef(null);
|
|
449
450
|
const scrollbarRef = react.useRef(null);
|
|
@@ -673,12 +674,20 @@ showScrollbar = true, }, ref) => {
|
|
|
673
674
|
const containerHeight = scrollableElement.clientHeight;
|
|
674
675
|
const contentHeight = scrollableElement.scrollHeight;
|
|
675
676
|
const scrollTop = scrollableElement.scrollTop;
|
|
677
|
+
// wrapper의 패딩 계산 (상하 패딩만 필요)
|
|
678
|
+
let wrapperPaddingTopBottom = 0;
|
|
679
|
+
if (wrapperRef.current) {
|
|
680
|
+
const computedStyle = window.getComputedStyle(wrapperRef.current);
|
|
681
|
+
const paddingTop = parseFloat(computedStyle.paddingTop) || 0;
|
|
682
|
+
const paddingBottom = parseFloat(computedStyle.paddingBottom) || 0;
|
|
683
|
+
wrapperPaddingTopBottom = paddingTop + paddingBottom;
|
|
684
|
+
}
|
|
676
685
|
// 화살표와 간격 공간 계산 (화살표 + 위아래 마진, 화살표 없어도 위아래 마진)
|
|
677
686
|
const arrowSpace = showArrows
|
|
678
687
|
? finalThumbWidth * 2 + finalTrackConfig.margin * 4
|
|
679
688
|
: finalTrackConfig.margin * 2;
|
|
680
|
-
// 썸 높이 계산 (사용자 설정 최소 높이 사용, 화살표 공간
|
|
681
|
-
const availableHeight = containerHeight - arrowSpace;
|
|
689
|
+
// 썸 높이 계산 (사용자 설정 최소 높이 사용, 화살표 공간 제외, wrapper 패딩 추가)
|
|
690
|
+
const availableHeight = containerHeight - arrowSpace + wrapperPaddingTopBottom;
|
|
682
691
|
const scrollRatio = containerHeight / contentHeight;
|
|
683
692
|
const calculatedThumbHeight = Math.max(availableHeight * scrollRatio, thumbMinHeight);
|
|
684
693
|
// 썸 위치 계산 (화살표와 간격 공간 제외)
|
|
@@ -1171,11 +1180,11 @@ showScrollbar = true, }, ref) => {
|
|
|
1171
1180
|
}
|
|
1172
1181
|
};
|
|
1173
1182
|
}, []);
|
|
1174
|
-
return (jsxRuntime.jsxs("div", { className: `overlay-scrollbar-wrapper ${className}`, style: Object.assign({ display: "flex", flexDirection: "column", position: "relative", minHeight: 0, height: "100%", flex: "1 1 0%" }, style), children: [jsxRuntime.jsx("div", { ref: containerRef, className: "overlay-scrollbar-container", tabIndex: -1, onMouseDown: handleDragScrollStart, style: Object.assign({
|
|
1183
|
+
return (jsxRuntime.jsxs("div", { ref: wrapperRef, className: `overlay-scrollbar-wrapper ${className}`, style: Object.assign({ display: "flex", flexDirection: "column", position: "relative", minHeight: 0, height: "100%", flex: "1 1 0%" }, style), children: [jsxRuntime.jsx("div", { ref: containerRef, className: "overlay-scrollbar-container", tabIndex: -1, onMouseDown: handleDragScrollStart, style: Object.assign({ display: "flex", width: "100%", flex: "1 1 auto", minHeight: 0, overflow: "auto",
|
|
1175
1184
|
// 브라우저 기본 스크롤바만 숨기기
|
|
1176
1185
|
scrollbarWidth: "none", msOverflowStyle: "none",
|
|
1177
1186
|
// 키보드 포커스 스타일 (접근성)
|
|
1178
|
-
outline: "none", userSelect: isDragScrolling ? "none" : "auto" }, containerStyle), children: jsxRuntime.jsx("div", { ref: contentRef, className: "overlay-scrollbar-content", style: Object.assign({ minHeight: 0, display: "flex", flexDirection: "column" }, contentStyle), children: children }) }), showScrollbar && hasScrollableContent && (jsxRuntime.jsxs("div", { ref: scrollbarRef, className: "overlay-scrollbar-track", onMouseEnter: () => {
|
|
1187
|
+
outline: "none", userSelect: isDragScrolling ? "none" : "auto" }, containerStyle), children: jsxRuntime.jsx("div", { ref: contentRef, className: "overlay-scrollbar-content", style: Object.assign({ flex: "1 1 0%", minHeight: 0, display: "flex", flexDirection: "column" }, contentStyle), children: children }) }), showScrollbar && hasScrollableContent && (jsxRuntime.jsxs("div", { ref: scrollbarRef, className: "overlay-scrollbar-track", onMouseEnter: () => {
|
|
1179
1188
|
clearHideTimer();
|
|
1180
1189
|
setScrollbarVisible(true);
|
|
1181
1190
|
}, onMouseLeave: () => {
|
|
@@ -1313,7 +1322,7 @@ function VirtualDataTableComponent({ data, loading = false, columns, onRowClick,
|
|
|
1313
1322
|
// 각 테이블 인스턴스별로 Scroller 컴포넌트 생성 (scrollbars, paddingX를 초기값으로 고정)
|
|
1314
1323
|
const VirtuosoScroller = react.useMemo(() => react.forwardRef((props, ref) => {
|
|
1315
1324
|
const scrollContainerRef = react.useRef(null);
|
|
1316
|
-
return (jsxRuntime.jsx(OverlayScrollbar, { track: OVERLAY_SCROLLBAR_TRACK_CONFIG,
|
|
1325
|
+
return (jsxRuntime.jsx(OverlayScrollbar, { track: OVERLAY_SCROLLBAR_TRACK_CONFIG, ...scrollbars, children: jsxRuntime.jsx(material.TableContainer, { component: material.Box, ...props, ref: (node) => {
|
|
1317
1326
|
scrollContainerRef.current =
|
|
1318
1327
|
node;
|
|
1319
1328
|
if (typeof ref === "function") {
|