@ehfuse/mui-virtual-data-table 1.0.7 → 1.0.8
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 +7 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -425,7 +425,7 @@ const OverlayScrollbar = forwardRef(({ className = "", style = {}, containerStyl
|
|
|
425
425
|
// 그룹화된 설정 객체들
|
|
426
426
|
thumb = DEFAULT_THUMB_CONFIG, track = DEFAULT_TRACK_CONFIG, arrows = DEFAULT_ARROWS_CONFIG, dragScroll = DEFAULT_DRAG_SCROLL_CONFIG, autoHide = DEFAULT_AUTO_HIDE_CONFIG,
|
|
427
427
|
// 기타 설정들
|
|
428
|
-
showScrollbar = true, }, ref) => {
|
|
428
|
+
showScrollbar = true, detectInnerScroll = false, }, ref) => {
|
|
429
429
|
// props 변경 추적용 ref
|
|
430
430
|
const prevPropsRef = useRef({});
|
|
431
431
|
// 렌더링 시 어떤 prop이 변경되었는지 체크
|
|
@@ -592,6 +592,11 @@ showScrollbar = true, }, ref) => {
|
|
|
592
592
|
cachedScrollContainerRef.current = containerRef.current;
|
|
593
593
|
return containerRef.current;
|
|
594
594
|
}
|
|
595
|
+
// detectInnerScroll 옵션이 활성화된 경우에만 children 내부의 스크롤 요소 찾기
|
|
596
|
+
// (가상 테이블 등 내부에서 스크롤을 처리하는 경우에 사용)
|
|
597
|
+
if (!detectInnerScroll) {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
595
600
|
// children 요소에서 스크롤 가능한 요소 찾기
|
|
596
601
|
// 중첩된 OverlayScrollbar의 영역은 제외 (다른 OverlayScrollbar의 container는 스킵)
|
|
597
602
|
const childScrollableElements = containerRef.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');
|
|
@@ -1310,17 +1315,10 @@ const OVERLAY_SCROLLBAR_TRACK_CONFIG = {
|
|
|
1310
1315
|
* 데이터 기반 무한 스크롤 및 가상화를 지원하는 테이블 컴포넌트
|
|
1311
1316
|
*/
|
|
1312
1317
|
function VirtualDataTableComponent({ data, loading = false, columns, onRowClick, rowHeight = 50, columnHeight = 56, striped, rowDivider = true, onSort, onLoadMore, sortBy, sortDirection, showPaper = true, paddingX = "1rem", paddingTop = 0, paddingBottom = 0, rowHoverColor, rowHoverOpacity, scrollbars, emptyMessage = "NO DATA", LoadingComponent, }) {
|
|
1313
|
-
// console.log("=== VirtualDataTable 렌더링 ===", {
|
|
1314
|
-
// dataLength: data.length,
|
|
1315
|
-
// loading,
|
|
1316
|
-
// onLoadMore: !!onLoadMore,
|
|
1317
|
-
// columnsLength: columns.length,
|
|
1318
|
-
// timestamp: new Date().toISOString(),
|
|
1319
|
-
// });
|
|
1320
1318
|
// 각 테이블 인스턴스별로 Scroller 컴포넌트 생성 (scrollbars, paddingX를 초기값으로 고정)
|
|
1321
1319
|
const VirtuosoScroller = useMemo(() => forwardRef((props, ref) => {
|
|
1322
1320
|
const scrollContainerRef = useRef(null);
|
|
1323
|
-
return (jsx(OverlayScrollbar, { track: OVERLAY_SCROLLBAR_TRACK_CONFIG, ...scrollbars, children: jsx(TableContainer, { component: Box, ...props, ref: (node) => {
|
|
1321
|
+
return (jsx(OverlayScrollbar, { detectInnerScroll: true, track: OVERLAY_SCROLLBAR_TRACK_CONFIG, ...scrollbars, children: jsx(TableContainer, { component: Box, ...props, ref: (node) => {
|
|
1324
1322
|
scrollContainerRef.current =
|
|
1325
1323
|
node;
|
|
1326
1324
|
if (typeof ref === "function") {
|