@pega/lists-react 9.0.0-build.6.9 → 9.0.0-build.7.1
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/lib/Core/Components/ContextMenu/ContextMenuContainer.d.ts.map +1 -1
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js +4 -2
- package/lib/Core/Components/ContextMenu/ContextMenuContainer.js.map +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js +1 -1
- package/lib/Core/Components/Grouping/GroupingMenu.js.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js +3 -16
- package/lib/Core/Components/Toolbar/AdvanceToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js +3 -1
- package/lib/Core/Components/Toolbar/SimpleToolbar.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/DateFunctionSelector.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js +1 -1
- package/lib/Core/Components/Toolbar/hooks/useGroup/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/Row.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts +6 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.d.ts.map +1 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js +17 -0
- package/lib/Core/Components/Toolbar/hooks/useWrapAction.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts +97 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js +249 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useChildrenHeightResizeObserver.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts +22 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js +45 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useLoaderPositioning.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts +49 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js +55 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts +21 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js +39 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts +38 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js +62 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts +112 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.d.ts.map +1 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js +213 -0
- package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/utils.js.map +1 -0
- package/lib/Core/Components/Virtualise/index.js +3 -11
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts +1 -1
- package/lib/Core/Components/Virtualise/utility.d.ts.map +1 -1
- package/lib/Core/Components/Virtualise/utility.js +3 -2
- package/lib/Core/Components/Virtualise/utility.js.map +1 -1
- package/lib/Core/Hooks/useDragDrop.d.ts.map +1 -1
- package/lib/Core/Hooks/useDragDrop.js +2 -0
- package/lib/Core/Hooks/useDragDrop.js.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js +1 -0
- package/lib/Core/Views/Gallery/StyledGalleryContainer.js.map +1 -1
- package/lib/Core/Views/Table/Row.d.ts +3 -1
- package/lib/Core/Views/Table/Row.d.ts.map +1 -1
- package/lib/Core/Views/Table/Row.js +5 -3
- package/lib/Core/Views/Table/Row.js.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +4 -0
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts +3 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.d.ts.map +1 -1
- package/lib/Core/Views/Table/VirtualizeWrapper.js +18 -2
- package/lib/Core/Views/Table/VirtualizeWrapper.js.map +1 -1
- package/lib/Core/Views/Table/index.d.ts.map +1 -1
- package/lib/Core/Views/Table/index.js +2 -2
- package/lib/Core/Views/Table/index.js.map +1 -1
- package/lib/Core/Views/Table/useCountChange.d.ts +10 -0
- package/lib/Core/Views/Table/useCountChange.d.ts.map +1 -0
- package/lib/Core/Views/Table/useCountChange.js +39 -0
- package/lib/Core/Views/Table/useCountChange.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { getDataIndex, getVirtualizedPaginationIndices } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the indices of items to render based on the current scroll position,
|
|
5
|
+
* buffer, and virtualization settings. It triggers data fetching via the provided `apiCallback`
|
|
6
|
+
* when pagination boundaries change or a force refresh is requested.
|
|
7
|
+
*
|
|
8
|
+
* @returns An object containing:
|
|
9
|
+
* - `triggerPagination`: Function to recalculate pagination indices and trigger data fetching.
|
|
10
|
+
* - `isForceRefreshedPagination`: Boolean indicating if the last pagination was force-refreshed.
|
|
11
|
+
*/
|
|
12
|
+
export default function usePagination({ apiCallback, id, buffer, maxItemsToPaint, startIndex, endIndex, virtualizedCount, isInfiniteMode, itemsHeight, defaultItemHeight, parentContainerRef, itemContainerRef, setStartIndex, setEndIndex, previousFirstItemDataIndexRef }) {
|
|
13
|
+
const [isForceRefreshedPagination, setIsForceRefreshedPagination] = useState(false);
|
|
14
|
+
const triggerPagination = useCallback((currentScrollTop, forceRefresh) => {
|
|
15
|
+
setIsForceRefreshedPagination(!!forceRefresh);
|
|
16
|
+
const { startIndex: newStartIndex, endIndex: newEndIndex } = getVirtualizedPaginationIndices({
|
|
17
|
+
scrollTop: currentScrollTop,
|
|
18
|
+
containerRef: parentContainerRef,
|
|
19
|
+
itemContainerRef,
|
|
20
|
+
totalItemCount: virtualizedCount,
|
|
21
|
+
itemsHeight,
|
|
22
|
+
defaultItemHeight,
|
|
23
|
+
buffer,
|
|
24
|
+
endIndexLimit: maxItemsToPaint,
|
|
25
|
+
isInfiniteMode
|
|
26
|
+
});
|
|
27
|
+
// Prevent redundant fetch
|
|
28
|
+
if (!forceRefresh && endIndex > 0 && newStartIndex >= startIndex && newEndIndex <= endIndex) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (virtualizedCount === 0) {
|
|
32
|
+
previousFirstItemDataIndexRef.current = 0;
|
|
33
|
+
}
|
|
34
|
+
else if (itemContainerRef.current?.children[0]) {
|
|
35
|
+
const firstItemDataIndex = getDataIndex(itemContainerRef.current.children[0]);
|
|
36
|
+
previousFirstItemDataIndexRef.current = firstItemDataIndex ?? 0;
|
|
37
|
+
}
|
|
38
|
+
setStartIndex(newStartIndex);
|
|
39
|
+
setEndIndex(newEndIndex);
|
|
40
|
+
apiCallback({ startIndex: newStartIndex, endIndex: newEndIndex, id }, { takeLatestAction: true });
|
|
41
|
+
}, [
|
|
42
|
+
virtualizedCount,
|
|
43
|
+
isInfiniteMode,
|
|
44
|
+
buffer,
|
|
45
|
+
maxItemsToPaint,
|
|
46
|
+
startIndex,
|
|
47
|
+
endIndex,
|
|
48
|
+
apiCallback,
|
|
49
|
+
id,
|
|
50
|
+
itemsHeight,
|
|
51
|
+
defaultItemHeight
|
|
52
|
+
]);
|
|
53
|
+
return { triggerPagination, isForceRefreshedPagination };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=usePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/usePagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI9C,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAmCxE;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,WAAW,EACX,EAAE,EACF,MAAM,EACN,eAAe,EACf,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,6BAA6B,EACZ;IACjB,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE7F,MAAM,iBAAiB,GAAG,WAAW,CACnC,CAAC,gBAAwB,EAAE,YAAsB,EAAE,EAAE;QACnD,6BAA6B,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,+BAA+B,CAAC;YAC3F,SAAS,EAAE,gBAAgB;YAC3B,YAAY,EAAE,kBAAkB;YAChC,gBAAgB;YAChB,cAAc,EAAE,gBAAgB;YAChC,WAAW;YACX,iBAAiB;YACjB,MAAM;YACN,aAAa,EAAE,eAAe;YAC9B,cAAc;SACf,CAAC,CAAC;QAEH,0BAA0B;QAC1B,IAAI,CAAC,YAAY,IAAI,QAAQ,GAAG,CAAC,IAAI,aAAa,IAAI,UAAU,IAAI,WAAW,IAAI,QAAQ,EAAE,CAAC;YAC5F,OAAO;QACT,CAAC;QAED,IAAI,gBAAgB,KAAK,CAAC,EAAE,CAAC;YAC3B,6BAA6B,CAAC,OAAO,GAAG,CAAC,CAAC;QAC5C,CAAC;aAAM,IAAI,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACjD,MAAM,kBAAkB,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9E,6BAA6B,CAAC,OAAO,GAAG,kBAAkB,IAAI,CAAC,CAAC;QAClE,CAAC;QAED,aAAa,CAAC,aAAa,CAAC,CAAC;QAC7B,WAAW,CAAC,WAAW,CAAC,CAAC;QACzB,WAAW,CACT,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,EACxD,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAC3B,CAAC;IACJ,CAAC,EACD;QACE,gBAAgB;QAChB,cAAc;QACd,MAAM;QACN,eAAe;QACf,UAAU;QACV,QAAQ;QACR,WAAW;QACX,EAAE;QACF,WAAW;QACX,iBAAiB;KAClB,CACF,CAAC;IAEF,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,CAAC;AAC3D,CAAC","sourcesContent":["import { useCallback, useState } from 'react';\nimport type { MutableRefObject, RefObject } from 'react';\n\nimport type { ItemsHeight, VariableHeightVirtualizerProps } from './VariableHeightVirtualizer';\nimport { getDataIndex, getVirtualizedPaginationIndices } from './utils';\n\ninterface PaginationParams {\n /** Callback to fetch paginated data. */\n apiCallback: VariableHeightVirtualizerProps['apiCallback'];\n /** Unique identifier for the virtualizer instance. */\n id: string;\n /** Number of items to buffer before/after the visible range. */\n buffer: number;\n /** Maximum number of items to render at once. */\n maxItemsToPaint: number;\n /** Current start index of the visible items. */\n startIndex: number;\n /** Current end index of the visible items. */\n endIndex: number;\n /** Total number of items in the virtualized list. */\n virtualizedCount: number;\n /** Whether infinite scrolling mode is enabled. */\n isInfiniteMode: boolean;\n /** Mapping of item indices and their actual height. */\n itemsHeight: ItemsHeight;\n /** Default height for items if not measured. */\n defaultItemHeight: number;\n /** Ref to the parent scrollable container element. */\n parentContainerRef: RefObject<HTMLElement>;\n /** Ref to the container holding the rendered items. */\n itemContainerRef: RefObject<HTMLElement>;\n /** Setter for the start index. */\n setStartIndex: (v: number) => void;\n /** Setter for the end index. */\n setEndIndex: (v: number) => void;\n /** Ref to track the previous first item's data index. */\n previousFirstItemDataIndexRef: MutableRefObject<number | null>;\n}\n\n/**\n * Calculates the indices of items to render based on the current scroll position,\n * buffer, and virtualization settings. It triggers data fetching via the provided `apiCallback`\n * when pagination boundaries change or a force refresh is requested.\n *\n * @returns An object containing:\n * - `triggerPagination`: Function to recalculate pagination indices and trigger data fetching.\n * - `isForceRefreshedPagination`: Boolean indicating if the last pagination was force-refreshed.\n */\nexport default function usePagination({\n apiCallback,\n id,\n buffer,\n maxItemsToPaint,\n startIndex,\n endIndex,\n virtualizedCount,\n isInfiniteMode,\n itemsHeight,\n defaultItemHeight,\n parentContainerRef,\n itemContainerRef,\n setStartIndex,\n setEndIndex,\n previousFirstItemDataIndexRef\n}: PaginationParams) {\n const [isForceRefreshedPagination, setIsForceRefreshedPagination] = useState<boolean>(false);\n\n const triggerPagination = useCallback(\n (currentScrollTop: number, forceRefresh?: boolean) => {\n setIsForceRefreshedPagination(!!forceRefresh);\n const { startIndex: newStartIndex, endIndex: newEndIndex } = getVirtualizedPaginationIndices({\n scrollTop: currentScrollTop,\n containerRef: parentContainerRef,\n itemContainerRef,\n totalItemCount: virtualizedCount,\n itemsHeight,\n defaultItemHeight,\n buffer,\n endIndexLimit: maxItemsToPaint,\n isInfiniteMode\n });\n\n // Prevent redundant fetch\n if (!forceRefresh && endIndex > 0 && newStartIndex >= startIndex && newEndIndex <= endIndex) {\n return;\n }\n\n if (virtualizedCount === 0) {\n previousFirstItemDataIndexRef.current = 0;\n } else if (itemContainerRef.current?.children[0]) {\n const firstItemDataIndex = getDataIndex(itemContainerRef.current.children[0]);\n previousFirstItemDataIndexRef.current = firstItemDataIndex ?? 0;\n }\n\n setStartIndex(newStartIndex);\n setEndIndex(newEndIndex);\n apiCallback(\n { startIndex: newStartIndex, endIndex: newEndIndex, id },\n { takeLatestAction: true }\n );\n },\n [\n virtualizedCount,\n isInfiniteMode,\n buffer,\n maxItemsToPaint,\n startIndex,\n endIndex,\n apiCallback,\n id,\n itemsHeight,\n defaultItemHeight\n ]\n );\n\n return { triggerPagination, isForceRefreshedPagination };\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
interface ScrollProps {
|
|
3
|
+
/** Ref to the parent scrollable container element. */
|
|
4
|
+
parentContainerRef: RefObject<HTMLElement>;
|
|
5
|
+
/** Ref to the container holding the rendered elements. */
|
|
6
|
+
itemContainerRef: RefObject<HTMLElement>;
|
|
7
|
+
/**
|
|
8
|
+
* Callback invoked when the scroll position is near the top or bottom threshold.
|
|
9
|
+
* @param scrollTop - The current scrollTop value of the parent container.
|
|
10
|
+
*/
|
|
11
|
+
onThresholdBreach: (scrollTop: number) => void;
|
|
12
|
+
/** Optional throttle delay for scroll events (default: 150ms). */
|
|
13
|
+
delay?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook to monitor scroll events on a parent container and trigger a callback
|
|
17
|
+
* when the scroll position approaches the top or bottom threshold of the child elements.
|
|
18
|
+
*/
|
|
19
|
+
export default function useScroll({ parentContainerRef, itemContainerRef, onThresholdBreach, delay }: ScrollProps): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScroll.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,WAAW;IACnB,sDAAsD;IACtD,kBAAkB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC3C,0DAA0D;IAC1D,gBAAgB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC;;;OAGG;IACH,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAW,EACZ,EAAE,WAAW,QAyCb"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import useThrottle from '../../../Hooks/useThrottle';
|
|
3
|
+
/**
|
|
4
|
+
* Hook to monitor scroll events on a parent container and trigger a callback
|
|
5
|
+
* when the scroll position approaches the top or bottom threshold of the child elements.
|
|
6
|
+
*/
|
|
7
|
+
export default function useScroll({ parentContainerRef, itemContainerRef, onThresholdBreach, delay = 150 }) {
|
|
8
|
+
const [scrollPos, setScrollPos] = useState();
|
|
9
|
+
useThrottle(scrollPos, () => {
|
|
10
|
+
if (!parentContainerRef.current || !itemContainerRef.current)
|
|
11
|
+
return;
|
|
12
|
+
const children = Array.from(itemContainerRef.current.children);
|
|
13
|
+
if (!children.length)
|
|
14
|
+
return;
|
|
15
|
+
const topIndex = Math.floor(children.length * 0.1);
|
|
16
|
+
const bottomIndex = Math.floor(children.length * 0.9);
|
|
17
|
+
const topAnchorElement = children[topIndex];
|
|
18
|
+
const bottomAnchorElement = children[bottomIndex];
|
|
19
|
+
const topRect = topAnchorElement.getBoundingClientRect();
|
|
20
|
+
const bottomRect = bottomAnchorElement.getBoundingClientRect();
|
|
21
|
+
const parentRect = parentContainerRef.current.getBoundingClientRect();
|
|
22
|
+
const nearTop = topRect.bottom >= parentRect.top;
|
|
23
|
+
const nearBottom = bottomRect.top <= parentRect.bottom;
|
|
24
|
+
if (nearTop || nearBottom) {
|
|
25
|
+
onThresholdBreach(parentContainerRef.current.scrollTop);
|
|
26
|
+
}
|
|
27
|
+
}, delay);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const scrollElement = parentContainerRef.current;
|
|
30
|
+
if (!scrollElement)
|
|
31
|
+
return;
|
|
32
|
+
const scrollHandler = () => setScrollPos(scrollElement.scrollTop);
|
|
33
|
+
scrollElement.addEventListener('scroll', scrollHandler, { passive: true });
|
|
34
|
+
return () => {
|
|
35
|
+
scrollElement.removeEventListener('scroll', scrollHandler);
|
|
36
|
+
};
|
|
37
|
+
}, [parentContainerRef]);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=useScroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScroll.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAgBrD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,GAAG,GAAG,EACC;IACZ,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAsB,CAAC;IAEjE,WAAW,CACT,SAAS,EACT,GAAG,EAAE;QACH,IAAI,CAAC,kBAAkB,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO;YAAE,OAAO;QAErE,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO;QAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QAEtD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAElD,MAAM,OAAO,GAAG,gBAAgB,CAAC,qBAAqB,EAAE,CAAC;QACzD,MAAM,UAAU,GAAG,mBAAmB,CAAC,qBAAqB,EAAE,CAAC;QAE/D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACtE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,GAAG,CAAC;QACjD,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;QAEvD,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;YAC1B,iBAAiB,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,EACD,KAAK,CACN,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC;QACjD,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAClE,aAAa,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3E,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC7D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport type { RefObject } from 'react';\n\nimport useThrottle from '../../../Hooks/useThrottle';\n\ninterface ScrollProps {\n /** Ref to the parent scrollable container element. */\n parentContainerRef: RefObject<HTMLElement>;\n /** Ref to the container holding the rendered elements. */\n itemContainerRef: RefObject<HTMLElement>;\n /**\n * Callback invoked when the scroll position is near the top or bottom threshold.\n * @param scrollTop - The current scrollTop value of the parent container.\n */\n onThresholdBreach: (scrollTop: number) => void;\n /** Optional throttle delay for scroll events (default: 150ms). */\n delay?: number;\n}\n\n/**\n * Hook to monitor scroll events on a parent container and trigger a callback\n * when the scroll position approaches the top or bottom threshold of the child elements.\n */\nexport default function useScroll({\n parentContainerRef,\n itemContainerRef,\n onThresholdBreach,\n delay = 150\n}: ScrollProps) {\n const [scrollPos, setScrollPos] = useState<number | undefined>();\n\n useThrottle(\n scrollPos,\n () => {\n if (!parentContainerRef.current || !itemContainerRef.current) return;\n\n const children = Array.from(itemContainerRef.current.children);\n if (!children.length) return;\n\n const topIndex = Math.floor(children.length * 0.1);\n const bottomIndex = Math.floor(children.length * 0.9);\n\n const topAnchorElement = children[topIndex];\n const bottomAnchorElement = children[bottomIndex];\n\n const topRect = topAnchorElement.getBoundingClientRect();\n const bottomRect = bottomAnchorElement.getBoundingClientRect();\n\n const parentRect = parentContainerRef.current.getBoundingClientRect();\n const nearTop = topRect.bottom >= parentRect.top;\n const nearBottom = bottomRect.top <= parentRect.bottom;\n\n if (nearTop || nearBottom) {\n onThresholdBreach(parentContainerRef.current.scrollTop);\n }\n },\n delay\n );\n useEffect(() => {\n const scrollElement = parentContainerRef.current;\n if (!scrollElement) return;\n\n const scrollHandler = () => setScrollPos(scrollElement.scrollTop);\n scrollElement.addEventListener('scroll', scrollHandler, { passive: true });\n\n return () => {\n scrollElement.removeEventListener('scroll', scrollHandler);\n };\n }, [parentContainerRef]);\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import type { LoadedDataRange } from './VariableHeightVirtualizer';
|
|
3
|
+
interface VirtualizerItemCountParams {
|
|
4
|
+
/** The starting index requested by virtualizer. */
|
|
5
|
+
startIndex: number;
|
|
6
|
+
/** The ending index requested by virtualizer. */
|
|
7
|
+
endIndex: number;
|
|
8
|
+
/** The range of items currently loaded. */
|
|
9
|
+
loadedDataRange: LoadedDataRange;
|
|
10
|
+
/** Indicates if the data is currently being fetched. */
|
|
11
|
+
isDataFetching: boolean;
|
|
12
|
+
/** Ref to the container holding rendered items. */
|
|
13
|
+
itemContainerRef: RefObject<HTMLElement>;
|
|
14
|
+
/** The rendered children items as ReactNode. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** The total number of items if known, or `null`/`undefined` for infinite mode. */
|
|
17
|
+
totalItemCount?: number | null;
|
|
18
|
+
/** Optional buffer to add to the count in infinite mode. */
|
|
19
|
+
buffer?: number;
|
|
20
|
+
/** Signal to reset the count in infinite mode. */
|
|
21
|
+
countResetSignal?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Determines the count of virtualized items in a list and whether the list is in infinite scrolling mode or not.
|
|
25
|
+
*
|
|
26
|
+
* @returns An object containing:
|
|
27
|
+
* - `isInfiniteMode`: Whether the list is in infinite scrolling mode.
|
|
28
|
+
* - `virtualizedCount`: The current count of virtualized items.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: In finite mode, the count is based on `totalItemCount`.
|
|
31
|
+
* NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.
|
|
32
|
+
*/
|
|
33
|
+
export default function useVirtualizerItemCount(params: VirtualizerItemCountParams): {
|
|
34
|
+
isInfiniteMode: boolean;
|
|
35
|
+
virtualizedCount: number;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=useVirtualizerItemCount.d.ts.map
|
package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVirtualizerItemCount.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,UAAU,0BAA0B;IAClC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,eAAe,EAAE,eAAe,CAAC;IACjC,wDAAwD;IACxD,cAAc,EAAE,OAAO,CAAC;IAExB,mDAAmD;IACnD,gBAAgB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,gDAAgD;IAChD,QAAQ,EAAE,SAAS,CAAC;IAEpB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAM,EAAE,0BAA0B,GAAG;IACnF,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAwEA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { getDataIndex } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* Determines the count of virtualized items in a list and whether the list is in infinite scrolling mode or not.
|
|
5
|
+
*
|
|
6
|
+
* @returns An object containing:
|
|
7
|
+
* - `isInfiniteMode`: Whether the list is in infinite scrolling mode.
|
|
8
|
+
* - `virtualizedCount`: The current count of virtualized items.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: In finite mode, the count is based on `totalItemCount`.
|
|
11
|
+
* NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.
|
|
12
|
+
*/
|
|
13
|
+
export default function useVirtualizerItemCount(params) {
|
|
14
|
+
const { startIndex, endIndex, loadedDataRange, isDataFetching, totalItemCount, buffer = 10, countResetSignal, itemContainerRef, children } = params;
|
|
15
|
+
const [virtualizedCount, setVirtualizedCount] = useState(totalItemCount || 0);
|
|
16
|
+
const isInfiniteMode = useMemo(() => totalItemCount === null || totalItemCount === undefined, [totalItemCount]);
|
|
17
|
+
useLayoutEffect(() => {
|
|
18
|
+
if (!isInfiniteMode) {
|
|
19
|
+
setVirtualizedCount(totalItemCount ?? 0);
|
|
20
|
+
}
|
|
21
|
+
}, [totalItemCount, isInfiniteMode]);
|
|
22
|
+
useLayoutEffect(() => {
|
|
23
|
+
if (isInfiniteMode) {
|
|
24
|
+
setVirtualizedCount(0);
|
|
25
|
+
}
|
|
26
|
+
}, [countResetSignal, isInfiniteMode]);
|
|
27
|
+
// Calculating count based on loaded items for infinite scrolling
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!isInfiniteMode || !endIndex || !loadedDataRange.endIndex || isDataFetching)
|
|
30
|
+
return;
|
|
31
|
+
const items = itemContainerRef.current?.children;
|
|
32
|
+
if (!items?.length) {
|
|
33
|
+
setVirtualizedCount(0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const lastItemDataIndex = getDataIndex(items[items.length - 1]) ?? -1;
|
|
37
|
+
const hasMoreResults = loadedDataRange.startIndex === startIndex &&
|
|
38
|
+
loadedDataRange.endIndex === endIndex &&
|
|
39
|
+
lastItemDataIndex === endIndex;
|
|
40
|
+
if (!hasMoreResults && Number.isInteger(lastItemDataIndex)) {
|
|
41
|
+
setVirtualizedCount(lastItemDataIndex + 1);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const countWithBuffer = loadedDataRange.endIndex + 1 + buffer;
|
|
45
|
+
if (hasMoreResults && countWithBuffer > virtualizedCount) {
|
|
46
|
+
setVirtualizedCount(countWithBuffer);
|
|
47
|
+
}
|
|
48
|
+
}, [
|
|
49
|
+
isDataFetching,
|
|
50
|
+
children,
|
|
51
|
+
isInfiniteMode,
|
|
52
|
+
loadedDataRange,
|
|
53
|
+
virtualizedCount,
|
|
54
|
+
itemContainerRef,
|
|
55
|
+
endIndex
|
|
56
|
+
]);
|
|
57
|
+
return {
|
|
58
|
+
isInfiniteMode,
|
|
59
|
+
virtualizedCount
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=useVirtualizerItemCount.js.map
|
package/lib/Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVirtualizerItemCount.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EAGT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyBvC;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAkC;IAIhF,MAAM,EACJ,UAAU,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,MAAM,GAAG,EAAE,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACT,GAAG,MAAM,CAAC;IAEX,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC;IAE9E,MAAM,cAAc,GAAG,OAAO,CAC5B,GAAG,EAAE,CAAC,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAC7D,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,mBAAmB,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAErC,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,cAAc,EAAE,CAAC;YACnB,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,iEAAiE;IACjE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,CAAC,QAAQ,IAAI,cAAc;YAAE,OAAO;QAExF,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;QACjD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YACnB,mBAAmB,CAAC,CAAC,CAAC,CAAC;YACvB,OAAO;QACT,CAAC;QAED,MAAM,iBAAiB,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAEtE,MAAM,cAAc,GAClB,eAAe,CAAC,UAAU,KAAK,UAAU;YACzC,eAAe,CAAC,QAAQ,KAAK,QAAQ;YACrC,iBAAiB,KAAK,QAAQ,CAAC;QAEjC,IAAI,CAAC,cAAc,IAAI,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC3D,mBAAmB,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;YAC3C,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,GAAG,CAAC,GAAG,MAAM,CAAC;QAC9D,IAAI,cAAc,IAAI,eAAe,GAAG,gBAAgB,EAAE,CAAC;YACzD,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,EAAE;QACD,cAAc;QACd,QAAQ;QACR,cAAc;QACd,eAAe;QACf,gBAAgB;QAChB,gBAAgB;QAChB,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO;QACL,cAAc;QACd,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n type ReactNode,\n type RefObject\n} from 'react';\n\nimport type { LoadedDataRange } from './VariableHeightVirtualizer';\nimport { getDataIndex } from './utils';\n\ninterface VirtualizerItemCountParams {\n /** The starting index requested by virtualizer. */\n startIndex: number;\n /** The ending index requested by virtualizer. */\n endIndex: number;\n /** The range of items currently loaded. */\n loadedDataRange: LoadedDataRange;\n /** Indicates if the data is currently being fetched. */\n isDataFetching: boolean;\n\n /** Ref to the container holding rendered items. */\n itemContainerRef: RefObject<HTMLElement>;\n /** The rendered children items as ReactNode. */\n children: ReactNode;\n\n /** The total number of items if known, or `null`/`undefined` for infinite mode. */\n totalItemCount?: number | null;\n /** Optional buffer to add to the count in infinite mode. */\n buffer?: number;\n /** Signal to reset the count in infinite mode. */\n countResetSignal?: number;\n}\n\n/**\n * Determines the count of virtualized items in a list and whether the list is in infinite scrolling mode or not.\n *\n * @returns An object containing:\n * - `isInfiniteMode`: Whether the list is in infinite scrolling mode.\n * - `virtualizedCount`: The current count of virtualized items.\n *\n * NOTE: In finite mode, the count is based on `totalItemCount`.\n * NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.\n */\nexport default function useVirtualizerItemCount(params: VirtualizerItemCountParams): {\n isInfiniteMode: boolean;\n virtualizedCount: number;\n} {\n const {\n startIndex,\n endIndex,\n loadedDataRange,\n isDataFetching,\n totalItemCount,\n buffer = 10,\n countResetSignal,\n itemContainerRef,\n children\n } = params;\n\n const [virtualizedCount, setVirtualizedCount] = useState(totalItemCount || 0);\n\n const isInfiniteMode = useMemo(\n () => totalItemCount === null || totalItemCount === undefined,\n [totalItemCount]\n );\n\n useLayoutEffect(() => {\n if (!isInfiniteMode) {\n setVirtualizedCount(totalItemCount ?? 0);\n }\n }, [totalItemCount, isInfiniteMode]);\n\n useLayoutEffect(() => {\n if (isInfiniteMode) {\n setVirtualizedCount(0);\n }\n }, [countResetSignal, isInfiniteMode]);\n\n // Calculating count based on loaded items for infinite scrolling\n useEffect(() => {\n if (!isInfiniteMode || !endIndex || !loadedDataRange.endIndex || isDataFetching) return;\n\n const items = itemContainerRef.current?.children;\n if (!items?.length) {\n setVirtualizedCount(0);\n return;\n }\n\n const lastItemDataIndex = getDataIndex(items[items.length - 1]) ?? -1;\n\n const hasMoreResults =\n loadedDataRange.startIndex === startIndex &&\n loadedDataRange.endIndex === endIndex &&\n lastItemDataIndex === endIndex;\n\n if (!hasMoreResults && Number.isInteger(lastItemDataIndex)) {\n setVirtualizedCount(lastItemDataIndex + 1);\n return;\n }\n\n const countWithBuffer = loadedDataRange.endIndex + 1 + buffer;\n if (hasMoreResults && countWithBuffer > virtualizedCount) {\n setVirtualizedCount(countWithBuffer);\n }\n }, [\n isDataFetching,\n children,\n isInfiniteMode,\n loadedDataRange,\n virtualizedCount,\n itemContainerRef,\n endIndex\n ]);\n\n return {\n isInfiniteMode,\n virtualizedCount\n };\n}\n"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { ItemsHeight } from './VariableHeightVirtualizer';
|
|
3
|
+
interface GetVirtualizedPaginationIndicesParams {
|
|
4
|
+
/** Current vertical scroll offset of the container. */
|
|
5
|
+
scrollTop: number;
|
|
6
|
+
/** Ref to the scrolling container element */
|
|
7
|
+
containerRef: RefObject<HTMLElement>;
|
|
8
|
+
/** Ref to the container holding the list items */
|
|
9
|
+
itemContainerRef: RefObject<HTMLElement>;
|
|
10
|
+
/** Total number of items. */
|
|
11
|
+
totalItemCount: number;
|
|
12
|
+
/** Mapping of item indices and their actual height. */
|
|
13
|
+
itemsHeight: ItemsHeight;
|
|
14
|
+
/** Default height for items if not measured. */
|
|
15
|
+
defaultItemHeight: number;
|
|
16
|
+
/** Number of extra items to render above and below the visible viewport for smooth scrolling. */
|
|
17
|
+
buffer: number;
|
|
18
|
+
/** Maximum allowed end index (exclusive). */
|
|
19
|
+
endIndexLimit: number;
|
|
20
|
+
/** If true, allows indices to exceed totalCount for infinite scrolling by including buffer. */
|
|
21
|
+
isInfiniteMode?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Calculates the start and end indices for virtualized pagination in a variable-height list.
|
|
25
|
+
*
|
|
26
|
+
* @returns {{ startIndex: number, endIndex: number }} Object containing the calculated start and end indices for rendering (inclusive both indices).
|
|
27
|
+
*/
|
|
28
|
+
export declare const getVirtualizedPaginationIndices: (param: GetVirtualizedPaginationIndicesParams) => {
|
|
29
|
+
startIndex: number;
|
|
30
|
+
endIndex: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Calculates the total buffer height for a list of items, using their individual heights if available,
|
|
34
|
+
* or a default height otherwise.
|
|
35
|
+
*
|
|
36
|
+
* @param totalItemCount - The total number of items in the list.
|
|
37
|
+
* @param itemsHeight - An object or array containing the heights of individual items, indexed by item position.
|
|
38
|
+
* @param defaultItemHeight - The default height to use for items whose height is not specified in `itemsHeight`.
|
|
39
|
+
* @returns The sum of all item heights, using the default height for any missing values.
|
|
40
|
+
*/
|
|
41
|
+
export declare const calculateTotalBufferHeight: (totalItemCount: number, itemsHeight: ItemsHeight, defaultItemHeight: number) => number;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a CSS-compatible max-height value based on the input.
|
|
44
|
+
*
|
|
45
|
+
* @param viewMaxHeight - The maximum height value, which can be a number (pixels), a string (CSS value), or `null`.
|
|
46
|
+
* @returns A string representing the CSS max-height value.
|
|
47
|
+
*/
|
|
48
|
+
export declare const getMaxHeight: (viewMaxHeight: number | string | null) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Calculates the vertical offset for a given item index in a list with variable item heights.
|
|
51
|
+
*
|
|
52
|
+
* @param index - The index of the item for which to calculate the offset.
|
|
53
|
+
* @param itemsHeight - Mapping of item indices and their actual height.
|
|
54
|
+
* @param defaultItemHeight - The default height to use for items not present in the cache.
|
|
55
|
+
* @returns The total offset (in pixels) from the top of the list to the specified index.
|
|
56
|
+
*/
|
|
57
|
+
export declare const getOffsetForIndex: (index: number, itemsHeight: ItemsHeight, defaultItemHeight: number) => number;
|
|
58
|
+
/**
|
|
59
|
+
* Determines whether the viewable area of a virtualized list is not fully filled with rendered items.
|
|
60
|
+
*
|
|
61
|
+
* @param totalItemCount - The total number of items that should be rendered.
|
|
62
|
+
* @param itemContainer - The HTML element containing the rendered items.
|
|
63
|
+
* @param parentContainer - The parent HTML element that contains the items and possibly the header.
|
|
64
|
+
* @param renderHeader - Indicates whether a header is rendered at the top of the parent container.
|
|
65
|
+
* @returns `true` if the view is not filled with all items, `false` otherwise.
|
|
66
|
+
*/
|
|
67
|
+
export declare const isViewNotFilled: (totalItemCount: number, itemContainer: HTMLElement, parentContainer: HTMLElement, renderHeader: boolean) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves the numeric data index from the `data-index` attribute of a given Element.
|
|
70
|
+
*
|
|
71
|
+
* @param element - The Element from which to extract the data index.
|
|
72
|
+
* @returns The parsed integer value of the `data-index` attribute, or `null` if the attribute is not present.
|
|
73
|
+
*/
|
|
74
|
+
export declare const getDataIndex: (element: Element) => number | null;
|
|
75
|
+
/**
|
|
76
|
+
* Calculates and returns an object containing the heights of items whose heights have changed
|
|
77
|
+
* compared to their previous values.
|
|
78
|
+
*
|
|
79
|
+
* @param itemContainer - The container HTMLElement whose child nodes represent items to measure.
|
|
80
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
81
|
+
* @param defaultItemHeight - The default height to use for items not present in `itemsHeight`.
|
|
82
|
+
* @returns An object mapping item indices to their new heights for items whose heights have changed.
|
|
83
|
+
*/
|
|
84
|
+
export declare function getChangedItemsHeight(itemContainer: HTMLElement, itemsHeight: ItemsHeight, defaultItemHeight: number): ItemsHeight;
|
|
85
|
+
/**
|
|
86
|
+
* Calculates the cumulative change in item heights between two sets of item height data,
|
|
87
|
+
* for a range of items starting from `startIndex` up to (but not including) `previousFirstItemDataIndex`.
|
|
88
|
+
*
|
|
89
|
+
* This function compares the current heights (`itemsHeight`) with the previous heights (`previousItemsHeight`)
|
|
90
|
+
* for each item in the specified range, using `defaultItemHeight` as a fallback if a previous height is missing.
|
|
91
|
+
* The result is the sum of the differences in height for all items in the range.
|
|
92
|
+
*
|
|
93
|
+
* @param startIndex - The index at which to start calculating the cumulative height change.
|
|
94
|
+
* @param previousFirstItemDataIndex - The index up to which to calculate (exclusive). If `null` or less than or equal to 0, returns 0.
|
|
95
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
96
|
+
* @param previousItemsHeight - An object mapping item indices of previously rendered items to their heights.
|
|
97
|
+
* @param defaultItemHeight - The default height to use if a previous height is not available.
|
|
98
|
+
* @returns The cumulative change in item heights for the specified range, or 0 if the result is not finite.
|
|
99
|
+
*/
|
|
100
|
+
export declare const calculateCumulativeItemSizeChange: (startIndex: number, previousFirstItemDataIndex: number | null, itemsHeight: ItemsHeight, previousItemsHeight: ItemsHeight, defaultItemHeight: number) => number;
|
|
101
|
+
/**
|
|
102
|
+
* Updates the position styles of child items within a container element to enable virtualized rendering.
|
|
103
|
+
* Sets the container's top offset and positions each child absolutely based on their calculated heights.
|
|
104
|
+
*
|
|
105
|
+
* @param itemContainer - The HTML element containing the list items to be positioned.
|
|
106
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
107
|
+
* @param defaultItemHeight - The default height to use for items without a specified height.
|
|
108
|
+
* @returns The total height of all items within the container, rounded down to the nearest integer.
|
|
109
|
+
*/
|
|
110
|
+
export declare const updateItemPositionStyles: (itemContainer: HTMLElement, itemsHeight: ItemsHeight, defaultItemHeight: number) => number;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,UAAU,qCAAqC;IAC7C,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,YAAY,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACrC,kDAAkD;IAClD,gBAAgB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAEzC,6BAA6B;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,iGAAiG;IACjG,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAC1C,OAAO,qCAAqC,KAC3C;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAgDxC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,GACrC,gBAAgB,MAAM,EACtB,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAOF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,eAAe,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAGpE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,MAAM,EACb,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAOF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,MAAM,EACtB,eAAe,WAAW,EAC1B,iBAAiB,WAAW,EAC5B,cAAc,OAAO,KACpB,OA2BF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,KAAG,MAAM,GAAG,IAKxD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,WAAW,EAC1B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,MAAM,GACxB,WAAW,CAkBb;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,GAC5C,YAAY,MAAM,EAClB,4BAA4B,MAAM,GAAG,IAAI,EACzC,aAAa,WAAW,EACxB,qBAAqB,WAAW,EAChC,mBAAmB,MAAM,KACxB,MAiBF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,eAAe,WAAW,EAC1B,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAwBF,CAAC"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { getScrollbarWidth } from 'pega-repeating-structures-core';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the start and end indices for virtualized pagination in a variable-height list.
|
|
4
|
+
*
|
|
5
|
+
* @returns {{ startIndex: number, endIndex: number }} Object containing the calculated start and end indices for rendering (inclusive both indices).
|
|
6
|
+
*/
|
|
7
|
+
export const getVirtualizedPaginationIndices = (param) => {
|
|
8
|
+
const { totalItemCount, buffer, itemContainerRef, scrollTop, containerRef, itemsHeight, defaultItemHeight, endIndexLimit, isInfiniteMode } = param;
|
|
9
|
+
const minimumItemsToFetchOnTop = buffer * 4;
|
|
10
|
+
if (totalItemCount === 0 || itemContainerRef.current?.childElementCount === 0) {
|
|
11
|
+
return { startIndex: 0, endIndex: minimumItemsToFetchOnTop };
|
|
12
|
+
}
|
|
13
|
+
const viewportHeight = containerRef.current?.clientHeight || 0;
|
|
14
|
+
// Find the first visible item index for the current scroll position
|
|
15
|
+
let aboveTheFoldItemsHeight = 0;
|
|
16
|
+
let visibleStartIndex = 0;
|
|
17
|
+
while (visibleStartIndex < totalItemCount &&
|
|
18
|
+
aboveTheFoldItemsHeight + (itemsHeight[visibleStartIndex] ?? defaultItemHeight) < scrollTop) {
|
|
19
|
+
aboveTheFoldItemsHeight += itemsHeight[visibleStartIndex] ?? defaultItemHeight;
|
|
20
|
+
visibleStartIndex += 1;
|
|
21
|
+
}
|
|
22
|
+
// Find the last visible item index for the current scroll position
|
|
23
|
+
let inViewItemsHeight = 0;
|
|
24
|
+
let visibleEndIndex = visibleStartIndex;
|
|
25
|
+
while (visibleEndIndex < totalItemCount && inViewItemsHeight < viewportHeight) {
|
|
26
|
+
inViewItemsHeight += itemsHeight[visibleEndIndex] ?? defaultItemHeight;
|
|
27
|
+
visibleEndIndex += 1;
|
|
28
|
+
}
|
|
29
|
+
const startIndex = Math.max(0, visibleStartIndex - buffer);
|
|
30
|
+
let endIndex = Math.min(visibleEndIndex + buffer, endIndexLimit - 1);
|
|
31
|
+
if (isInfiniteMode) {
|
|
32
|
+
endIndex = Math.max(endIndex, minimumItemsToFetchOnTop);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// In cases where the count is very less due to filters, we would fetch more items to avoid unnecessary API calls if the count after the filter removed is more
|
|
36
|
+
endIndex = Math.max(Math.min(totalItemCount - 1, endIndex), minimumItemsToFetchOnTop);
|
|
37
|
+
}
|
|
38
|
+
return { startIndex, endIndex };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Calculates the total buffer height for a list of items, using their individual heights if available,
|
|
42
|
+
* or a default height otherwise.
|
|
43
|
+
*
|
|
44
|
+
* @param totalItemCount - The total number of items in the list.
|
|
45
|
+
* @param itemsHeight - An object or array containing the heights of individual items, indexed by item position.
|
|
46
|
+
* @param defaultItemHeight - The default height to use for items whose height is not specified in `itemsHeight`.
|
|
47
|
+
* @returns The sum of all item heights, using the default height for any missing values.
|
|
48
|
+
*/
|
|
49
|
+
export const calculateTotalBufferHeight = (totalItemCount, itemsHeight, defaultItemHeight) => {
|
|
50
|
+
let totalBufferHeight = 0;
|
|
51
|
+
for (let i = 0; i < totalItemCount; i += 1) {
|
|
52
|
+
totalBufferHeight += itemsHeight[i] || defaultItemHeight;
|
|
53
|
+
}
|
|
54
|
+
return totalBufferHeight;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Returns a CSS-compatible max-height value based on the input.
|
|
58
|
+
*
|
|
59
|
+
* @param viewMaxHeight - The maximum height value, which can be a number (pixels), a string (CSS value), or `null`.
|
|
60
|
+
* @returns A string representing the CSS max-height value.
|
|
61
|
+
*/
|
|
62
|
+
export const getMaxHeight = (viewMaxHeight) => {
|
|
63
|
+
if (!viewMaxHeight)
|
|
64
|
+
return 'none';
|
|
65
|
+
return typeof viewMaxHeight === 'number' ? `${viewMaxHeight}px` : viewMaxHeight;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Calculates the vertical offset for a given item index in a list with variable item heights.
|
|
69
|
+
*
|
|
70
|
+
* @param index - The index of the item for which to calculate the offset.
|
|
71
|
+
* @param itemsHeight - Mapping of item indices and their actual height.
|
|
72
|
+
* @param defaultItemHeight - The default height to use for items not present in the cache.
|
|
73
|
+
* @returns The total offset (in pixels) from the top of the list to the specified index.
|
|
74
|
+
*/
|
|
75
|
+
export const getOffsetForIndex = (index, itemsHeight, defaultItemHeight) => {
|
|
76
|
+
let offset = 0;
|
|
77
|
+
for (let i = 0; i < index; i += 1) {
|
|
78
|
+
offset += itemsHeight[i] ?? defaultItemHeight;
|
|
79
|
+
}
|
|
80
|
+
return offset;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Determines whether the viewable area of a virtualized list is not fully filled with rendered items.
|
|
84
|
+
*
|
|
85
|
+
* @param totalItemCount - The total number of items that should be rendered.
|
|
86
|
+
* @param itemContainer - The HTML element containing the rendered items.
|
|
87
|
+
* @param parentContainer - The parent HTML element that contains the items and possibly the header.
|
|
88
|
+
* @param renderHeader - Indicates whether a header is rendered at the top of the parent container.
|
|
89
|
+
* @returns `true` if the view is not filled with all items, `false` otherwise.
|
|
90
|
+
*/
|
|
91
|
+
export const isViewNotFilled = (totalItemCount, itemContainer, parentContainer, renderHeader) => {
|
|
92
|
+
const parentContainerPosition = parentContainer.getBoundingClientRect();
|
|
93
|
+
let headerHeight = 0;
|
|
94
|
+
if (renderHeader && parentContainer.childElementCount > 1) {
|
|
95
|
+
const firstChild = parentContainer.children[0];
|
|
96
|
+
if (firstChild instanceof HTMLElement) {
|
|
97
|
+
headerHeight = firstChild.offsetHeight;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const scrollbarWidth = getScrollbarWidth();
|
|
101
|
+
const items = Array.from(itemContainer.children).filter((el) => el instanceof HTMLElement);
|
|
102
|
+
if (!items.length && !totalItemCount)
|
|
103
|
+
return false;
|
|
104
|
+
if (!items.length && totalItemCount)
|
|
105
|
+
return true;
|
|
106
|
+
return (!!totalItemCount &&
|
|
107
|
+
items.length !== totalItemCount &&
|
|
108
|
+
(Math.floor(items[items.length - 1].getBoundingClientRect().bottom) <
|
|
109
|
+
Math.floor(parentContainerPosition.bottom - scrollbarWidth) ||
|
|
110
|
+
Math.floor(items[0].getBoundingClientRect().top) >
|
|
111
|
+
Math.floor(parentContainerPosition.top + headerHeight) ||
|
|
112
|
+
items.length === 0));
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves the numeric data index from the `data-index` attribute of a given Element.
|
|
116
|
+
*
|
|
117
|
+
* @param element - The Element from which to extract the data index.
|
|
118
|
+
* @returns The parsed integer value of the `data-index` attribute, or `null` if the attribute is not present.
|
|
119
|
+
*/
|
|
120
|
+
export const getDataIndex = (element) => {
|
|
121
|
+
const dataIndexStr = element?.getAttribute('data-index');
|
|
122
|
+
if (!dataIndexStr)
|
|
123
|
+
return null;
|
|
124
|
+
const parsedDataIndex = parseInt(dataIndexStr, 10);
|
|
125
|
+
return Number.isNaN(parsedDataIndex) ? null : parsedDataIndex;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Calculates and returns an object containing the heights of items whose heights have changed
|
|
129
|
+
* compared to their previous values.
|
|
130
|
+
*
|
|
131
|
+
* @param itemContainer - The container HTMLElement whose child nodes represent items to measure.
|
|
132
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
133
|
+
* @param defaultItemHeight - The default height to use for items not present in `itemsHeight`.
|
|
134
|
+
* @returns An object mapping item indices to their new heights for items whose heights have changed.
|
|
135
|
+
*/
|
|
136
|
+
export function getChangedItemsHeight(itemContainer, itemsHeight, defaultItemHeight) {
|
|
137
|
+
if (!itemContainer)
|
|
138
|
+
return {};
|
|
139
|
+
const newHeights = {};
|
|
140
|
+
const nodes = Array.from(itemContainer.children);
|
|
141
|
+
nodes.forEach(node => {
|
|
142
|
+
const itemDataIndex = getDataIndex(node);
|
|
143
|
+
if (itemDataIndex === null)
|
|
144
|
+
return;
|
|
145
|
+
const measuredHeight = node.getBoundingClientRect().height;
|
|
146
|
+
const prevHeight = itemsHeight[itemDataIndex] ?? defaultItemHeight;
|
|
147
|
+
if (measuredHeight !== prevHeight) {
|
|
148
|
+
newHeights[itemDataIndex] = measuredHeight;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return newHeights;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Calculates the cumulative change in item heights between two sets of item height data,
|
|
155
|
+
* for a range of items starting from `startIndex` up to (but not including) `previousFirstItemDataIndex`.
|
|
156
|
+
*
|
|
157
|
+
* This function compares the current heights (`itemsHeight`) with the previous heights (`previousItemsHeight`)
|
|
158
|
+
* for each item in the specified range, using `defaultItemHeight` as a fallback if a previous height is missing.
|
|
159
|
+
* The result is the sum of the differences in height for all items in the range.
|
|
160
|
+
*
|
|
161
|
+
* @param startIndex - The index at which to start calculating the cumulative height change.
|
|
162
|
+
* @param previousFirstItemDataIndex - The index up to which to calculate (exclusive). If `null` or less than or equal to 0, returns 0.
|
|
163
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
164
|
+
* @param previousItemsHeight - An object mapping item indices of previously rendered items to their heights.
|
|
165
|
+
* @param defaultItemHeight - The default height to use if a previous height is not available.
|
|
166
|
+
* @returns The cumulative change in item heights for the specified range, or 0 if the result is not finite.
|
|
167
|
+
*/
|
|
168
|
+
export const calculateCumulativeItemSizeChange = (startIndex, previousFirstItemDataIndex, itemsHeight, previousItemsHeight, defaultItemHeight) => {
|
|
169
|
+
if (previousFirstItemDataIndex === null || previousFirstItemDataIndex <= 0) {
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
let delta = 0;
|
|
173
|
+
for (let i = startIndex; i < previousFirstItemDataIndex; i += 1) {
|
|
174
|
+
const actualHeight = itemsHeight[i];
|
|
175
|
+
const previousHeight = previousItemsHeight[i] ?? defaultItemHeight;
|
|
176
|
+
if (actualHeight !== null && actualHeight !== undefined) {
|
|
177
|
+
delta += actualHeight - previousHeight;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return Number.isFinite(delta) ? delta : 0;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Updates the position styles of child items within a container element to enable virtualized rendering.
|
|
184
|
+
* Sets the container's top offset and positions each child absolutely based on their calculated heights.
|
|
185
|
+
*
|
|
186
|
+
* @param itemContainer - The HTML element containing the list items to be positioned.
|
|
187
|
+
* @param itemsHeight - An object mapping item indices to their measured heights.
|
|
188
|
+
* @param defaultItemHeight - The default height to use for items without a specified height.
|
|
189
|
+
* @returns The total height of all items within the container, rounded down to the nearest integer.
|
|
190
|
+
*/
|
|
191
|
+
export const updateItemPositionStyles = (itemContainer, itemsHeight, defaultItemHeight) => {
|
|
192
|
+
const items = itemContainer.children;
|
|
193
|
+
if (!items?.length) {
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
const firstItemDataIndex = getDataIndex(items[0]);
|
|
197
|
+
if (firstItemDataIndex === null)
|
|
198
|
+
return 0;
|
|
199
|
+
const offset = getOffsetForIndex(firstItemDataIndex, itemsHeight, defaultItemHeight);
|
|
200
|
+
itemContainer.style.top = `${offset}px`;
|
|
201
|
+
let itemContainerCurrentHeight = 0;
|
|
202
|
+
let currentItemIndex = firstItemDataIndex;
|
|
203
|
+
Array.from(items).forEach((item) => {
|
|
204
|
+
if (!(item instanceof HTMLElement))
|
|
205
|
+
return;
|
|
206
|
+
item.style.position = 'absolute';
|
|
207
|
+
item.style.top = `${itemContainerCurrentHeight}px`;
|
|
208
|
+
itemContainerCurrentHeight += itemsHeight[currentItemIndex] ?? defaultItemHeight;
|
|
209
|
+
currentItemIndex += 1;
|
|
210
|
+
});
|
|
211
|
+
return Math.floor(itemContainerCurrentHeight);
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=utils.js.map
|