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