@economic/taco 2.53.0-virtualiser.3 → 2.53.0-virtualiser.4

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.
@@ -44,7 +44,7 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
44
44
  return tableMeta.rowHeight.height ? ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] : ROW_HEIGHT_ESTIMATES.medium;
45
45
  },
46
46
  getScrollElement: () => tableRef.current,
47
- overscan: tableMeta.printing.isPrinting ? count : undefined,
47
+ overscan: tableMeta.printing.isPrinting ? count : 8,
48
48
  rangeExtractor,
49
49
  // correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list
50
50
  scrollPaddingStart,
@@ -1 +1 @@
1
- {"version":3,"file":"useTableRenderer.js","sources":["../../../../../../../../../src/primitives/Table/Core/features/useTableRenderer.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta, Row as ReactTableRow } from '@tanstack/react-table';\nimport { useVirtualizer, defaultRangeExtractor, ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';\nimport { ROW_HEIGHT_ESTIMATES } from '../util/rows';\nimport { Row } from '../components/Row/Row';\nimport { useTableRenderers, useTableRenderOptions } from '../types';\nimport { TableRef } from '../../types';\nimport { SkeletonRow } from '../components/Row/BuiltIns/SkeletonRow';\n\n// scroll padding end is designed to always show half of the next row\nfunction getScrollPaddingEndOffset<TType = unknown>(table: ReactTable<TType>) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n let offset = 2;\n\n if (tableMeta.footer.isEnabled) {\n offset += 1;\n }\n\n if (table.getHeaderGroups().length > 1) {\n offset += table.getHeaderGroups().length - 1;\n }\n\n let height = ROW_HEIGHT_ESTIMATES.medium * offset;\n\n const bottomRows = table.getBottomRows();\n\n if (bottomRows.length) {\n // 1.4 offsets for half rows and also accounts for increased row heights (which is likely in pinned rows)\n height += ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] * 1.4 * bottomRows.length;\n }\n\n return height;\n}\n\n// scroll padding end is designed to always show half of the next row\nfunction getPaddingEndOffset<TType = unknown>(table: ReactTable<TType>, options?: useTableRenderOptions) {\n const bottomRows = table.getBottomRows() ?? [];\n return ROW_HEIGHT_ESTIMATES.medium * (options?.virtualiserPaddingEndOffset ?? 1) * bottomRows.length;\n}\n\nexport function useTableRenderer<TType = unknown>(\n renderers: useTableRenderers<TType>,\n table: ReactTable<TType>,\n tableRef: React.RefObject<TableRef>,\n length: number,\n defaultRowActiveIndex?: number | undefined,\n options?: useTableRenderOptions\n) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const isTableRowGrouped = !!table.getState().grouping?.length;\n const rows = table.getCenterRows() ?? [];\n\n // row groups\n const rangeExtractor = useRowGroupVirtualisation<TType>(table);\n\n // account for thead and tfoot in the scroll area - both are always medium row height\n const scrollPaddingStart = ROW_HEIGHT_ESTIMATES.medium;\n\n const count = tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2 ? length : rows.length;\n\n const virtualiser = useVirtualizer({\n count,\n estimateSize: () => {\n return tableMeta.rowHeight.height ? ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] : ROW_HEIGHT_ESTIMATES.medium;\n },\n getScrollElement: () => tableRef.current,\n overscan: tableMeta.printing.isPrinting ? count : undefined,\n rangeExtractor,\n // correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list\n scrollPaddingStart,\n scrollPaddingEnd: getScrollPaddingEndOffset(table),\n paddingEnd: getPaddingEndOffset(table, options),\n });\n\n React.useEffect(() => {\n virtualiser.measure();\n }, [table.getState().expanded]);\n\n const totalSize = virtualiser.getTotalSize();\n const virtualItems = virtualiser.getVirtualItems();\n\n const scrollToIndex = React.useCallback(\n (index: number, options: ReactVirtualScrollToOptions = { align: 'auto', behavior: 'smooth' }) => {\n const notSmooth: ReactVirtualScrollToOptions = { ...options, behavior: 'auto' };\n\n if (tableRef.current) {\n if (index === 0) {\n virtualiser.scrollToOffset(0, notSmooth);\n } else if (index === count - 1) {\n // sometimes the last row doesn't fully show, so we just force scroll to the bottom\n tableRef.current.scrollTop = tableRef.current.scrollHeight;\n } else {\n virtualiser.scrollToIndex(index, options);\n }\n }\n },\n [virtualItems.length, tableRef.current, totalSize, count]\n );\n\n // use row 1 not 0, because 0 might be sticky in grouped tables and it's start value will always be 0\n const paddingStartIndex = isTableRowGrouped && count > 1 ? 1 : 0;\n\n const startValue = isTableRowGrouped\n ? virtualItems[paddingStartIndex]?.start - virtualItems[paddingStartIndex]?.size\n : virtualItems[paddingStartIndex]?.start;\n\n // styling for offsetting rows - this \"is\" the virtualisation\n const [paddingTop, paddingBottom] =\n virtualItems.length > 0\n ? [Math.max(0, startValue ?? 0), Math.max(0, totalSize - (virtualItems[virtualItems.length - 1]?.end ?? 0))]\n : [0, 0];\n\n // ensure default active rows are scrolled to\n React.useEffect(() => {\n if (defaultRowActiveIndex) {\n scrollToIndex(defaultRowActiveIndex, { align: 'center', behavior: 'auto' });\n }\n }, []);\n\n // rendered output\n let style: CSSProperties = {};\n let content: (JSX.Element | null)[] | null = null;\n\n // bottom rows aren't virtualised (they're sticky) but we need to set the height\n if (count || table.getBottomRows().length) {\n style = {\n height: totalSize,\n paddingBottom: isNaN(paddingBottom) ? 0 : paddingBottom,\n paddingTop: isNaN(paddingTop) ? 0 : paddingTop,\n };\n }\n\n // only render non sticky rows\n if (count) {\n content = virtualItems.map(virtualRow => {\n // there appears to be a react-virtual bug where it inserts a single `undefined` item at the end of the row, which crashes here\n if (!virtualRow) {\n return null;\n }\n\n let row: ReactTableRow<TType> | undefined;\n\n if (tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2) {\n const currentPageIndex =\n (Math.floor(virtualRow.index / tableMeta.server.pageSize) * tableMeta.server.pageSize) /\n tableMeta.server.pageSize;\n const pagePosition = tableMeta.server.pages?.indexOf(currentPageIndex) ?? -1;\n\n if (pagePosition > -1) {\n // \"flatten\" row indexes down into the dataloader2 dataset size\n // for example, with a page size of 100...\n // row index 14267 is actually one of index 67, 167, 267 etc within the dataset (depending on number of pages stored)\n const fakeIndex = pagePosition * tableMeta.server.pageSize + (virtualRow.index % tableMeta.server.pageSize);\n row = rows[fakeIndex];\n }\n } else {\n row = rows[virtualRow.index];\n }\n\n if (!row?.original) {\n return (\n <SkeletonRow\n key={virtualRow.index}\n index={virtualRow.index}\n scrollDirection={virtualiser.scrollDirection ?? undefined}\n table={table}\n />\n );\n }\n\n return (\n <Row\n key={row.id}\n row={row}\n index={virtualRow.index}\n scrollDirection={virtualiser.scrollDirection ?? undefined}\n table={table}\n measureRow={virtualiser.resizeItem}\n renderer={renderers.row}\n cellRenderer={renderers.cell}\n />\n );\n });\n }\n\n return {\n rows: content,\n style,\n scrollToIndex,\n };\n}\n\n// support virtualised row groups (where the row group headers are sticky)\nfunction useRowGroupVirtualisation<TType = unknown>(table: ReactTable<TType>) {\n const rows = table.getRowModel().rows;\n const isTableGrouped = !!table.getState().grouping.length;\n\n const rowGroupIndexes = React.useMemo(() => {\n const indexes: number[] = [];\n\n if (isTableGrouped) {\n rows.forEach((row, index) => {\n if (row.getIsGrouped()) {\n indexes.push(index);\n }\n });\n }\n\n return indexes;\n }, [rows]);\n\n // this is taken from the react-virtual docs/examples\n const rangeExtractor = React.useCallback(\n range => {\n const activeRowGroupIndex =\n [...rowGroupIndexes].reverse().find(index => range.startIndex >= index) ?? rowGroupIndexes[0];\n\n const next = new Set([activeRowGroupIndex, ...defaultRangeExtractor(range)]);\n return [...next].sort((a, b) => a - b);\n },\n [rowGroupIndexes]\n );\n\n return isTableGrouped ? rangeExtractor : undefined;\n}\n"],"names":["getScrollPaddingEndOffset","table","tableMeta","options","meta","offset","footer","isEnabled","getHeaderGroups","length","height","ROW_HEIGHT_ESTIMATES","medium","bottomRows","getBottomRows","rowHeight","getPaddingEndOffset","_table$getBottomRows","_options$virtualiserP","virtualiserPaddingEndOffset","useTableRenderer","renderers","tableRef","defaultRowActiveIndex","isTableRowGrouped","_table$getState$group","getState","grouping","rows","_table$getCenterRows","getCenterRows","rangeExtractor","useRowGroupVirtualisation","scrollPaddingStart","count","server","_experimentalDataLoader2","virtualiser","useVirtualizer","estimateSize","getScrollElement","current","overscan","printing","isPrinting","undefined","scrollPaddingEnd","paddingEnd","React","useEffect","measure","expanded","totalSize","getTotalSize","virtualItems","getVirtualItems","scrollToIndex","useCallback","index","align","behavior","notSmooth","scrollToOffset","scrollTop","scrollHeight","paddingStartIndex","startValue","_virtualItems$padding","start","_virtualItems$padding2","size","_virtualItems$padding3","paddingTop","paddingBottom","Math","max","_virtualItems$end","_virtualItems","end","style","content","isNaN","map","virtualRow","row","_tableMeta$server$pag","_tableMeta$server$pag2","currentPageIndex","floor","pageSize","pagePosition","pages","indexOf","fakeIndex","_row","original","_virtualiser$scrollDi","SkeletonRow","key","scrollDirection","Row","id","_virtualiser$scrollDi2","measureRow","resizeItem","renderer","cellRenderer","cell","getRowModel","isTableGrouped","rowGroupIndexes","useMemo","indexes","forEach","getIsGrouped","push","range","activeRowGroupIndex","_reverse$find","reverse","find","startIndex","next","Set","defaultRangeExtractor","sort","a","b"],"mappings":";;;;;;AASA;AACA,SAASA,yBAAyBA,CAAkBC,KAAwB;EACxE,MAAMC,SAAS,GAAGD,KAAK,CAACE,OAAO,CAACC,IAA6B;EAC7D,IAAIC,MAAM,GAAG,CAAC;EAEd,IAAIH,SAAS,CAACI,MAAM,CAACC,SAAS,EAAE;IAC5BF,MAAM,IAAI,CAAC;;EAGf,IAAIJ,KAAK,CAACO,eAAe,EAAE,CAACC,MAAM,GAAG,CAAC,EAAE;IACpCJ,MAAM,IAAIJ,KAAK,CAACO,eAAe,EAAE,CAACC,MAAM,GAAG,CAAC;;EAGhD,IAAIC,MAAM,GAAGC,oBAAoB,CAACC,MAAM,GAAGP,MAAM;EAEjD,MAAMQ,UAAU,GAAGZ,KAAK,CAACa,aAAa,EAAE;EAExC,IAAID,U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I,CAACqF,OAAO,CAAC,CAAC7B,GAAG,EAAE1B,KAAK;QACpB,IAAI0B,GAAG,CAAC8B,YAAY,EAAE,EAAE;UACpBF,OAAO,CAACG,IAAI,CAACzD,KAAK,CAAC;;OAE1B,CAAC;;IAGN,OAAOsD,OAAO;GACjB,EAAE,CAACpF,IAAI,CAAC,CAAC;;EAGV,MAAMG,cAAc,GAAGiB,cAAK,CAACS,WAAW,CACpC2D,KAAK;;IACD,MAAMC,mBAAmB,IAAAC,aAAA,GACrB,CAAC,GAAGR,eAAe,CAAC,CAACS,OAAO,EAAE,CAACC,IAAI,CAAC9D,KAAK,IAAI0D,KAAK,CAACK,UAAU,IAAI/D,KAAK,CAAC,cAAA4D,aAAA,cAAAA,aAAA,GAAIR,eAAe,CAAC,CAAC,CAAC;IAEjG,MAAMY,IAAI,GAAG,IAAIC,GAAG,CAAC,CAACN,mBAAmB,EAAE,GAAGO,qBAAqB,CAACR,KAAK,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAGM,IAAI,CAAC,CAACG,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;GACzC,EACD,CAACjB,eAAe,CAAC,CACpB;EAED,OAAOD,cAAc,GAAG9E,cAAc,GAAGc,SAAS;AACtD;;;;"}
1
+ {"version":3,"file":"useTableRenderer.js","sources":["../../../../../../../../../src/primitives/Table/Core/features/useTableRenderer.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta, Row as ReactTableRow } from '@tanstack/react-table';\nimport { useVirtualizer, defaultRangeExtractor, ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';\nimport { ROW_HEIGHT_ESTIMATES } from '../util/rows';\nimport { Row } from '../components/Row/Row';\nimport { useTableRenderers, useTableRenderOptions } from '../types';\nimport { TableRef } from '../../types';\nimport { SkeletonRow } from '../components/Row/BuiltIns/SkeletonRow';\n\n// scroll padding end is designed to always show half of the next row\nfunction getScrollPaddingEndOffset<TType = unknown>(table: ReactTable<TType>) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n let offset = 2;\n\n if (tableMeta.footer.isEnabled) {\n offset += 1;\n }\n\n if (table.getHeaderGroups().length > 1) {\n offset += table.getHeaderGroups().length - 1;\n }\n\n let height = ROW_HEIGHT_ESTIMATES.medium * offset;\n\n const bottomRows = table.getBottomRows();\n\n if (bottomRows.length) {\n // 1.4 offsets for half rows and also accounts for increased row heights (which is likely in pinned rows)\n height += ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] * 1.4 * bottomRows.length;\n }\n\n return height;\n}\n\n// scroll padding end is designed to always show half of the next row\nfunction getPaddingEndOffset<TType = unknown>(table: ReactTable<TType>, options?: useTableRenderOptions) {\n const bottomRows = table.getBottomRows() ?? [];\n return ROW_HEIGHT_ESTIMATES.medium * (options?.virtualiserPaddingEndOffset ?? 1) * bottomRows.length;\n}\n\nexport function useTableRenderer<TType = unknown>(\n renderers: useTableRenderers<TType>,\n table: ReactTable<TType>,\n tableRef: React.RefObject<TableRef>,\n length: number,\n defaultRowActiveIndex?: number | undefined,\n options?: useTableRenderOptions\n) {\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const isTableRowGrouped = !!table.getState().grouping?.length;\n const rows = table.getCenterRows() ?? [];\n\n // row groups\n const rangeExtractor = useRowGroupVirtualisation<TType>(table);\n\n // account for thead and tfoot in the scroll area - both are always medium row height\n const scrollPaddingStart = ROW_HEIGHT_ESTIMATES.medium;\n\n const count = tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2 ? length : rows.length;\n\n const virtualiser = useVirtualizer({\n count,\n estimateSize: () => {\n return tableMeta.rowHeight.height ? ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] : ROW_HEIGHT_ESTIMATES.medium;\n },\n getScrollElement: () => tableRef.current,\n overscan: tableMeta.printing.isPrinting ? count : 8,\n rangeExtractor,\n // correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list\n scrollPaddingStart,\n scrollPaddingEnd: getScrollPaddingEndOffset(table),\n paddingEnd: getPaddingEndOffset(table, options),\n });\n\n React.useEffect(() => {\n virtualiser.measure();\n }, [table.getState().expanded]);\n\n const totalSize = virtualiser.getTotalSize();\n const virtualItems = virtualiser.getVirtualItems();\n\n const scrollToIndex = React.useCallback(\n (index: number, options: ReactVirtualScrollToOptions = { align: 'auto', behavior: 'smooth' }) => {\n const notSmooth: ReactVirtualScrollToOptions = { ...options, behavior: 'auto' };\n\n if (tableRef.current) {\n if (index === 0) {\n virtualiser.scrollToOffset(0, notSmooth);\n } else if (index === count - 1) {\n // sometimes the last row doesn't fully show, so we just force scroll to the bottom\n tableRef.current.scrollTop = tableRef.current.scrollHeight;\n } else {\n virtualiser.scrollToIndex(index, options);\n }\n }\n },\n [virtualItems.length, tableRef.current, totalSize, count]\n );\n\n // use row 1 not 0, because 0 might be sticky in grouped tables and it's start value will always be 0\n const paddingStartIndex = isTableRowGrouped && count > 1 ? 1 : 0;\n\n const startValue = isTableRowGrouped\n ? virtualItems[paddingStartIndex]?.start - virtualItems[paddingStartIndex]?.size\n : virtualItems[paddingStartIndex]?.start;\n\n // styling for offsetting rows - this \"is\" the virtualisation\n const [paddingTop, paddingBottom] =\n virtualItems.length > 0\n ? [Math.max(0, startValue ?? 0), Math.max(0, totalSize - (virtualItems[virtualItems.length - 1]?.end ?? 0))]\n : [0, 0];\n\n // ensure default active rows are scrolled to\n React.useEffect(() => {\n if (defaultRowActiveIndex) {\n scrollToIndex(defaultRowActiveIndex, { align: 'center', behavior: 'auto' });\n }\n }, []);\n\n // rendered output\n let style: CSSProperties = {};\n let content: (JSX.Element | null)[] | null = null;\n\n // bottom rows aren't virtualised (they're sticky) but we need to set the height\n if (count || table.getBottomRows().length) {\n style = {\n height: totalSize,\n paddingBottom: isNaN(paddingBottom) ? 0 : paddingBottom,\n paddingTop: isNaN(paddingTop) ? 0 : paddingTop,\n };\n }\n\n // only render non sticky rows\n if (count) {\n content = virtualItems.map(virtualRow => {\n // there appears to be a react-virtual bug where it inserts a single `undefined` item at the end of the row, which crashes here\n if (!virtualRow) {\n return null;\n }\n\n let row: ReactTableRow<TType> | undefined;\n\n if (tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2) {\n const currentPageIndex =\n (Math.floor(virtualRow.index / tableMeta.server.pageSize) * tableMeta.server.pageSize) /\n tableMeta.server.pageSize;\n const pagePosition = tableMeta.server.pages?.indexOf(currentPageIndex) ?? -1;\n\n if (pagePosition > -1) {\n // \"flatten\" row indexes down into the dataloader2 dataset size\n // for example, with a page size of 100...\n // row index 14267 is actually one of index 67, 167, 267 etc within the dataset (depending on number of pages stored)\n const fakeIndex = pagePosition * tableMeta.server.pageSize + (virtualRow.index % tableMeta.server.pageSize);\n row = rows[fakeIndex];\n }\n } else {\n row = rows[virtualRow.index];\n }\n\n if (!row?.original) {\n return (\n <SkeletonRow\n key={virtualRow.index}\n index={virtualRow.index}\n scrollDirection={virtualiser.scrollDirection ?? undefined}\n table={table}\n />\n );\n }\n\n return (\n <Row\n key={row.id}\n row={row}\n index={virtualRow.index}\n scrollDirection={virtualiser.scrollDirection ?? undefined}\n table={table}\n measureRow={virtualiser.resizeItem}\n renderer={renderers.row}\n cellRenderer={renderers.cell}\n />\n );\n });\n }\n\n return {\n rows: content,\n style,\n scrollToIndex,\n };\n}\n\n// support virtualised row groups (where the row group headers are sticky)\nfunction useRowGroupVirtualisation<TType = unknown>(table: ReactTable<TType>) {\n const rows = table.getRowModel().rows;\n const isTableGrouped = !!table.getState().grouping.length;\n\n const rowGroupIndexes = React.useMemo(() => {\n const indexes: number[] = [];\n\n if (isTableGrouped) {\n rows.forEach((row, index) => {\n if (row.getIsGrouped()) {\n indexes.push(index);\n }\n });\n }\n\n return indexes;\n }, [rows]);\n\n // this is taken from the react-virtual docs/examples\n const rangeExtractor = React.useCallback(\n range => {\n const activeRowGroupIndex =\n [...rowGroupIndexes].reverse().find(index => range.startIndex >= index) ?? rowGroupIndexes[0];\n\n const next = new Set([activeRowGroupIndex, ...defaultRangeExtractor(range)]);\n return [...next].sort((a, b) => a - b);\n },\n [rowGroupIndexes]\n );\n\n return isTableGrouped ? rangeExtractor : undefined;\n}\n"],"names":["getScrollPaddingEndOffset","table","tableMeta","options","meta","offset","footer","isEnabled","getHeaderGroups","length","height","ROW_HEIGHT_ESTIMATES","medium","bottomRows","getBottomRows","rowHeight","getPaddingEndOffset","_table$getBottomRows","_options$virtualiserP","virtualiserPaddingEndOffset","useTableRenderer","renderers","tableRef","defaultRowActiveIndex","isTableRowGrouped","_table$getState$group","getState","grouping","rows","_table$getCenterRows","getCenterRows","rangeExtractor","useRowGroupVirtualisation","scrollPaddingStart","count","server","_experimentalDataLoader2","virtualiser","useVirtualizer","estimateSize","getScrollElement","current","overscan","printing","isPrinting","scrollPaddingEnd","paddingEnd","React","useEffect","measure","expanded","totalSize","getTotalSize","virtualItems","getVirtualItems","scrollToIndex","useCallback","index","align","behavior","notSmooth","scrollToOffset","scrollTop","scrollHeight","paddingStartIndex","startValue","_virtualItems$padding","start","_virtualItems$padding2","size","_virtualItems$padding3","paddingTop","paddingBottom","Math","max","_virtualItems$end","_virtualItems","end","style","content","isNaN","map","virtualRow","row","_tableMeta$server$pag","_tableMeta$server$pag2","currentPageIndex","floor","pageSize","pagePosition","pages","indexOf","fakeIndex","_row","original","_virtualiser$scrollDi","SkeletonRow","key","scrollDirection","undefined","Row","id","_virtualiser$scrollDi2","measureRow","resizeItem","renderer","cellRenderer","cell","getRowModel","isTableGrouped","rowGroupIndexes","useMemo","indexes","forEach","getIsGrouped","push","range","activeRowGroupIndex","_reverse$find","reverse","find","startIndex","next","Set","defaultRangeExtractor","sort","a","b"],"mappings":";;;;;;AASA;AACA,SAASA,yBAAyBA,CAAkBC,KAAwB;EACxE,MAAMC,SAAS,GAAGD,KAAK,CAACE,OAAO,CAACC,IAA6B;EAC7D,IAAIC,MAAM,GAAG,CAAC;EAEd,IAAIH,SA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ACA,SAASvB,yBAAyBA,CAAkB/B,KAAwB;EACxE,MAAM2B,IAAI,GAAG3B,KAAK,CAAC2G,WAAW,EAAE,CAAChF,IAAI;EACrC,MAAMiF,cAAc,GAAG,CAAC,CAAC5G,KAAK,CAACyB,QAAQ,EAAE,CAACC,QAAQ,CAAClB,MAAM;EAEzD,MAAMqG,eAAe,GAAG/D,cAAK,CAACgE,OAAO,CAAC;IAClC,MAAMC,OAAO,GAAa,EAAE;IAE5B,IAAIH,cAAc,EAAE;MAChBjF,IAAI,CAACqF,OAAO,CAAC,CAAC9B,GAAG,EAAE1B,KAAK;QACpB,IAAI0B,GAAG,CAAC+B,YAAY,EAAE,EAAE;UACpBF,OAAO,CAACG,IAAI,CAAC1D,KAAK,CAAC;;OAE1B,CAAC;;IAGN,OAAOuD,OAAO;GACjB,EAAE,CAACpF,IAAI,CAAC,CAAC;;EAGV,MAAMG,cAAc,GAAGgB,cAAK,CAACS,WAAW,CACpC4D,KAAK;;IACD,MAAMC,mBAAmB,IAAAC,aAAA,GACrB,CAAC,GAAGR,eAAe,CAAC,CAACS,OAAO,EAAE,CAACC,IAAI,CAAC/D,KAAK,IAAI2D,KAAK,CAACK,UAAU,IAAIhE,KAAK,CAAC,cAAA6D,aAAA,cAAAA,aAAA,GAAIR,eAAe,CAAC,CAAC,CAAC;IAEjG,MAAMY,IAAI,GAAG,IAAIC,GAAG,CAAC,CAACN,mBAAmB,EAAE,GAAGO,qBAAqB,CAACR,KAAK,CAAC,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAGM,IAAI,CAAC,CAACG,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;GACzC,EACD,CAACjB,eAAe,CAAC,CACpB;EAED,OAAOD,cAAc,GAAG9E,cAAc,GAAGoE,SAAS;AACtD;;;;"}
@@ -12460,7 +12460,7 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
12460
12460
  return tableMeta.rowHeight.height ? ROW_HEIGHT_ESTIMATES[tableMeta.rowHeight.height] : ROW_HEIGHT_ESTIMATES.medium;
12461
12461
  },
12462
12462
  getScrollElement: () => tableRef.current,
12463
- overscan: tableMeta.printing.isPrinting ? count : undefined,
12463
+ overscan: tableMeta.printing.isPrinting ? count : 8,
12464
12464
  rangeExtractor,
12465
12465
  // correctly sets the scroll padding offset, e.g. when keyboard navigating rows in the list
12466
12466
  scrollPaddingStart,