@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.js
CHANGED
|
@@ -427,7 +427,7 @@ const OverlayScrollbar = react.forwardRef(({ className = "", style = {}, contain
|
|
|
427
427
|
// 그룹화된 설정 객체들
|
|
428
428
|
thumb = DEFAULT_THUMB_CONFIG, track = DEFAULT_TRACK_CONFIG, arrows = DEFAULT_ARROWS_CONFIG, dragScroll = DEFAULT_DRAG_SCROLL_CONFIG, autoHide = DEFAULT_AUTO_HIDE_CONFIG,
|
|
429
429
|
// 기타 설정들
|
|
430
|
-
showScrollbar = true, }, ref) => {
|
|
430
|
+
showScrollbar = true, detectInnerScroll = false, }, ref) => {
|
|
431
431
|
// props 변경 추적용 ref
|
|
432
432
|
const prevPropsRef = react.useRef({});
|
|
433
433
|
// 렌더링 시 어떤 prop이 변경되었는지 체크
|
|
@@ -594,6 +594,11 @@ showScrollbar = true, }, ref) => {
|
|
|
594
594
|
cachedScrollContainerRef.current = containerRef.current;
|
|
595
595
|
return containerRef.current;
|
|
596
596
|
}
|
|
597
|
+
// detectInnerScroll 옵션이 활성화된 경우에만 children 내부의 스크롤 요소 찾기
|
|
598
|
+
// (가상 테이블 등 내부에서 스크롤을 처리하는 경우에 사용)
|
|
599
|
+
if (!detectInnerScroll) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
597
602
|
// children 요소에서 스크롤 가능한 요소 찾기
|
|
598
603
|
// 중첩된 OverlayScrollbar의 영역은 제외 (다른 OverlayScrollbar의 container는 스킵)
|
|
599
604
|
const childScrollableElements = containerRef.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');
|
|
@@ -1312,17 +1317,10 @@ const OVERLAY_SCROLLBAR_TRACK_CONFIG = {
|
|
|
1312
1317
|
* 데이터 기반 무한 스크롤 및 가상화를 지원하는 테이블 컴포넌트
|
|
1313
1318
|
*/
|
|
1314
1319
|
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, }) {
|
|
1315
|
-
// console.log("=== VirtualDataTable 렌더링 ===", {
|
|
1316
|
-
// dataLength: data.length,
|
|
1317
|
-
// loading,
|
|
1318
|
-
// onLoadMore: !!onLoadMore,
|
|
1319
|
-
// columnsLength: columns.length,
|
|
1320
|
-
// timestamp: new Date().toISOString(),
|
|
1321
|
-
// });
|
|
1322
1320
|
// 각 테이블 인스턴스별로 Scroller 컴포넌트 생성 (scrollbars, paddingX를 초기값으로 고정)
|
|
1323
1321
|
const VirtuosoScroller = react.useMemo(() => react.forwardRef((props, ref) => {
|
|
1324
1322
|
const scrollContainerRef = react.useRef(null);
|
|
1325
|
-
return (jsxRuntime.jsx(OverlayScrollbar, { track: OVERLAY_SCROLLBAR_TRACK_CONFIG, ...scrollbars, children: jsxRuntime.jsx(material.TableContainer, { component: material.Box, ...props, ref: (node) => {
|
|
1323
|
+
return (jsxRuntime.jsx(OverlayScrollbar, { detectInnerScroll: true, track: OVERLAY_SCROLLBAR_TRACK_CONFIG, ...scrollbars, children: jsxRuntime.jsx(material.TableContainer, { component: material.Box, ...props, ref: (node) => {
|
|
1326
1324
|
scrollContainerRef.current =
|
|
1327
1325
|
node;
|
|
1328
1326
|
if (typeof ref === "function") {
|