najm-kit 2.2.5 → 2.2.6
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.mjs +8 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12738,7 +12738,7 @@ function useTable(effectiveViewModeOverride) {
|
|
|
12738
12738
|
const dynamicPageSizeTarget = renderedMode === "cards" ? calculatedCardPageSize : calculatedPageSize;
|
|
12739
12739
|
const geometryKey = `${Math.round(measuredBodyWidth / GEOMETRY_BUCKET_PX)}x${Math.round(measuredBodyHeight / GEOMETRY_BUCKET_PX)}`;
|
|
12740
12740
|
const reportedGeometryRef = useRef(null);
|
|
12741
|
-
|
|
12741
|
+
useLayoutEffect(() => {
|
|
12742
12742
|
if (!manualPagination || !dynamicHeight) return;
|
|
12743
12743
|
if (cardPagination.mode !== "paged") return;
|
|
12744
12744
|
if (!hasMeasuredLayout || measuredBodyHeight <= 0) return;
|
|
@@ -12746,12 +12746,16 @@ function useTable(effectiveViewModeOverride) {
|
|
|
12746
12746
|
if (dynamicPageSizeTarget === storePagination.pageSize) return;
|
|
12747
12747
|
const reported = reportedGeometryRef.current;
|
|
12748
12748
|
if (reported?.key === geometryKey && reported.count >= MAX_PAGE_SIZE_REPORTS_PER_GEOMETRY) return;
|
|
12749
|
-
const
|
|
12750
|
-
const timer = setTimeout(() => {
|
|
12749
|
+
const commit = () => {
|
|
12751
12750
|
const current = reportedGeometryRef.current;
|
|
12752
12751
|
reportedGeometryRef.current = current?.key === geometryKey ? { key: geometryKey, count: current.count + 1 } : { key: geometryKey, count: 1 };
|
|
12753
12752
|
setPagination({ pageIndex: storePagination.pageIndex, pageSize: dynamicPageSizeTarget });
|
|
12754
|
-
}
|
|
12753
|
+
};
|
|
12754
|
+
if (!reported) {
|
|
12755
|
+
commit();
|
|
12756
|
+
return;
|
|
12757
|
+
}
|
|
12758
|
+
const timer = setTimeout(commit, DYNAMIC_PAGE_SIZE_DEBOUNCE_MS);
|
|
12755
12759
|
return () => clearTimeout(timer);
|
|
12756
12760
|
}, [
|
|
12757
12761
|
manualPagination,
|