react-window 2.0.2-alpha.1 → 2.1.0-alpha.0
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/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +10 -2
- package/dist/react-window.js +442 -386
- package/dist/react-window.js.map +1 -1
- package/docs/assets/{AriaRolesRoute-rvLAMJGg.js → AriaRolesRoute-Dccdk77z.js} +2 -2
- package/docs/assets/{AriaRolesRoute-rvLAMJGg.js.map → AriaRolesRoute-Dccdk77z.js.map} +1 -1
- package/docs/assets/{AriaRolesRoute-DUJio_Uq.js → AriaRolesRoute-fNF-9P_q.js} +2 -2
- package/docs/assets/{AriaRolesRoute-DUJio_Uq.js.map → AriaRolesRoute-fNF-9P_q.js.map} +1 -1
- package/docs/assets/{AriaRolesRoute-Dsxt70zK.js → AriaRolesRoute-mE_5uPdh.js} +2 -2
- package/docs/assets/{AriaRolesRoute-Dsxt70zK.js.map → AriaRolesRoute-mE_5uPdh.js.map} +1 -1
- package/docs/assets/CellComponent.example-Fvf2fNMJ.js +2 -0
- package/docs/assets/{CellComponent.example-CFiu8zNV.js.map → CellComponent.example-Fvf2fNMJ.js.map} +1 -1
- package/docs/assets/{ComponentProps-BFVtvKZW.js → ComponentProps-BaSDIyGM.js} +2 -2
- package/docs/assets/{ComponentProps-BFVtvKZW.js.map → ComponentProps-BaSDIyGM.js.map} +1 -1
- package/docs/assets/ContinueLink-Bt_isYvF.js +2 -0
- package/docs/assets/{ContinueLink-DMnSPbdx.js.map → ContinueLink-Bt_isYvF.js.map} +1 -1
- package/docs/assets/{FixedRowHeightsRoute-BgFMqZ9J.js → FixedRowHeightsRoute-BWMCEZL9.js} +2 -2
- package/docs/assets/{FixedRowHeightsRoute-BgFMqZ9J.js.map → FixedRowHeightsRoute-BWMCEZL9.js.map} +1 -1
- package/docs/assets/{FormattedCode-B5NYyy8K.js → FormattedCode-C9MIMH17.js} +2 -2
- package/docs/assets/{FormattedCode-B5NYyy8K.js.map → FormattedCode-C9MIMH17.js.map} +1 -1
- package/docs/assets/{GettingStartedRoute-OLG6nuHW.js → GettingStartedRoute-0nhyOEdK.js} +2 -2
- package/docs/assets/{GettingStartedRoute-OLG6nuHW.js.map → GettingStartedRoute-0nhyOEdK.js.map} +1 -1
- package/docs/assets/Grid-CgYC2ncE.js +2 -0
- package/docs/assets/Grid-CgYC2ncE.js.map +1 -0
- package/docs/assets/{Header-B_onM2vR.js → Header-BdKWSvvb.js} +2 -2
- package/docs/assets/{Header-B_onM2vR.js.map → Header-BdKWSvvb.js.map} +1 -1
- package/docs/assets/{HorizontalListsRoute-YTu4ru_X.js → HorizontalListsRoute-DBeYXDTd.js} +2 -2
- package/docs/assets/{HorizontalListsRoute-YTu4ru_X.js.map → HorizontalListsRoute-DBeYXDTd.js.map} +1 -1
- package/docs/assets/{ImperativeApiRoute-D8HOQfr3.js → ImperativeApiRoute-CVproCzF.js} +2 -2
- package/docs/assets/{ImperativeApiRoute-D8HOQfr3.js.map → ImperativeApiRoute-CVproCzF.js.map} +1 -1
- package/docs/assets/{ImperativeApiRoute-BxC-VyUh.js → ImperativeApiRoute-rlhH1_Qi.js} +2 -2
- package/docs/assets/{ImperativeApiRoute-BxC-VyUh.js.map → ImperativeApiRoute-rlhH1_Qi.js.map} +1 -1
- package/docs/assets/List-CxgHSppl.js +2 -0
- package/docs/assets/List-CxgHSppl.js.map +1 -0
- package/docs/assets/{LoadingSpinner-BMzTPwZo.js → LoadingSpinner-tWpMuzoA.js} +2 -2
- package/docs/assets/{LoadingSpinner-BMzTPwZo.js.map → LoadingSpinner-tWpMuzoA.js.map} +1 -1
- package/docs/assets/{PageNotFound-kFYcmtEM.js → PageNotFound-mw-pBfPL.js} +2 -2
- package/docs/assets/{PageNotFound-kFYcmtEM.js.map → PageNotFound-mw-pBfPL.js.map} +1 -1
- package/docs/assets/{PlatformRequirementsRoute-D2r4s58b.js → PlatformRequirementsRoute-pGdzRelu.js} +2 -2
- package/docs/assets/{PlatformRequirementsRoute-D2r4s58b.js.map → PlatformRequirementsRoute-pGdzRelu.js.map} +1 -1
- package/docs/assets/{PropsRoute-B_3n6IE5.js → PropsRoute-DV7EZjjj.js} +2 -2
- package/docs/assets/{PropsRoute-B_3n6IE5.js.map → PropsRoute-DV7EZjjj.js.map} +1 -1
- package/docs/assets/PropsRoute-UF2eK3lu.js +2 -0
- package/docs/assets/{PropsRoute-CUL_CRSw.js.map → PropsRoute-UF2eK3lu.js.map} +1 -1
- package/docs/assets/{RTLGridsRoute-BXZTN5aZ.js → RTLGridsRoute-CTps1hK8.js} +2 -2
- package/docs/assets/{RTLGridsRoute-BXZTN5aZ.js.map → RTLGridsRoute-CTps1hK8.js.map} +1 -1
- package/docs/assets/{RenderingGridRoute-DjDJX4pV.js → RenderingGridRoute-pl69TsxS.js} +2 -2
- package/docs/assets/{RenderingGridRoute-DjDJX4pV.js.map → RenderingGridRoute-pl69TsxS.js.map} +1 -1
- package/docs/assets/{ScratchpadRoute-BvmbZ6RR.js → ScratchpadRoute-CCWpeXMB.js} +2 -2
- package/docs/assets/{ScratchpadRoute-BvmbZ6RR.js.map → ScratchpadRoute-CCWpeXMB.js.map} +1 -1
- package/docs/assets/{Select-INFvG4Rz.js → Select-DqyIzw3c.js} +2 -2
- package/docs/assets/{Select-INFvG4Rz.js.map → Select-DqyIzw3c.js.map} +1 -1
- package/docs/assets/{StickyRowsRoute-D9QBSEk_.js → StickyRowsRoute-DLva-P41.js} +2 -2
- package/docs/assets/{StickyRowsRoute-D9QBSEk_.js.map → StickyRowsRoute-DLva-P41.js.map} +1 -1
- package/docs/assets/{SupportRoute-DyO6dv_w.js → SupportRoute-Do2-2OX7.js} +2 -2
- package/docs/assets/{SupportRoute-DyO6dv_w.js.map → SupportRoute-Do2-2OX7.js.map} +1 -1
- package/docs/assets/{TabularDataRoute-CH8QvWD7.js → TabularDataRoute-DPSrWaLN.js} +2 -2
- package/docs/assets/{TabularDataRoute-CH8QvWD7.js.map → TabularDataRoute-DPSrWaLN.js.map} +1 -1
- package/docs/assets/{VariableRowHeightsRoute--1XN3vDI.js → VariableRowHeightsRoute-Di2prJCD.js} +2 -2
- package/docs/assets/{VariableRowHeightsRoute--1XN3vDI.js.map → VariableRowHeightsRoute-Di2prJCD.js.map} +1 -1
- package/docs/assets/arePropsEqual-U1Tm1J18.js +2 -0
- package/docs/assets/arePropsEqual-U1Tm1J18.js.map +1 -0
- package/docs/assets/{index-C6NWGx8D.js → index-0ZXvQVSH.js} +3 -3
- package/docs/assets/{index-C6NWGx8D.js.map → index-0ZXvQVSH.js.map} +1 -1
- package/docs/assets/{useCitiesByState-rFcDxGxC.js → useCitiesByState-CwP17AWg.js} +2 -2
- package/docs/assets/{useCitiesByState-rFcDxGxC.js.map → useCitiesByState-CwP17AWg.js.map} +1 -1
- package/docs/assets/{useContacts-Bu0Z6ao9.js → useContacts-BUeepGdf.js} +2 -2
- package/docs/assets/{useContacts-Bu0Z6ao9.js.map → useContacts-BUeepGdf.js.map} +1 -1
- package/docs/generated/js-docs/Grid.json +2 -2
- package/docs/generated/js-docs/List.json +2 -2
- package/docs/index.html +1 -1
- package/docs/stats.html +1 -1
- package/package.json +1 -1
- package/docs/assets/CellComponent.example-CFiu8zNV.js +0 -2
- package/docs/assets/ContinueLink-DMnSPbdx.js +0 -2
- package/docs/assets/Grid-BXEwl59J.js +0 -2
- package/docs/assets/Grid-BXEwl59J.js.map +0 -1
- package/docs/assets/List-CwFMf7n1.js +0 -2
- package/docs/assets/List-CwFMf7n1.js.map +0 -1
- package/docs/assets/PropsRoute-CUL_CRSw.js +0 -2
- package/docs/assets/arePropsEqual-Czc4-HWX.js +0 -2
- package/docs/assets/arePropsEqual-Czc4-HWX.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./index-C6NWGx8D.js";import{i as t}from"./useContacts-Bu0Z6ao9.js";function n({contacts:n,columnIndex:e,rowIndex:o,style:r}){const c=n[o][t(e)];return s.jsx("div",{className:"truncate",style:r,children:c})}export{n as C};
|
|
2
|
-
//# sourceMappingURL=CellComponent.example-CFiu8zNV.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,j as o}from"./index-C6NWGx8D.js";import{u as t,a as n,b as l}from"./arePropsEqual-Czc4-HWX.js";function r({cellComponent:r,cellProps:i,children:s,className:a,columnCount:c,columnWidth:d,defaultHeight:u=0,defaultWidth:f=0,dir:m,gridRef:x,onCellsRendered:h,onResize:p,overscanCount:g=3,rowCount:v,rowHeight:w,style:I,tagName:S="div",...C}){const z=t(i),T=e.useMemo(()=>e.memo(r,n),[r]),[E,b]=e.useState(null),y=function(o,t){const[n,l]=e.useState("rtl"===t);return e.useLayoutEffect(()=>{o&&(t||l(function(e){let o=e;for(;o;){if(o.dir)return"rtl"===o.dir;o=o.parentElement}return!1}(o)))},[t,o]),n}(E,m),{getCellBounds:O,getEstimatedSize:R,startIndex:j,scrollToIndex:H,stopIndex:P}=l({containerElement:E,defaultContainerSize:f,direction:"horizontal",isRtl:y,itemCount:c,itemProps:z,itemSize:d,onResize:p,overscanCount:g}),{getCellBounds:A,getEstimatedSize:L,startIndex:N,scrollToIndex:W,stopIndex:B}=l({containerElement:E,defaultContainerSize:u,direction:"vertical",itemCount:v,itemProps:z,itemSize:w,onResize:p,overscanCount:g});e.useImperativeHandle(x,()=>({get element(){return E},scrollToCell({behavior:e="auto",columnAlign:o="auto",columnIndex:t,rowAlign:n="auto",rowIndex:l}){const r=H({align:o,containerScrollOffset:E?.scrollLeft??0,index:t}),i=W({align:n,containerScrollOffset:E?.scrollTop??0,index:l});"function"==typeof E?.scrollTo&&E.scrollTo({behavior:e,left:r,top:i})},scrollToColumn({align:e="auto",behavior:o="auto",index:t}){const n=H({align:e,containerScrollOffset:E?.scrollLeft??0,index:t});"function"==typeof E?.scrollTo&&E.scrollTo({behavior:o,left:n})},scrollToRow({align:e="auto",behavior:o="auto",index:t}){const n=W({align:e,containerScrollOffset:E?.scrollTop??0,index:t});"function"==typeof E?.scrollTo&&E.scrollTo({behavior:o,top:n})}}),[E,H,W]),e.useEffect(()=>{j>=0&&P>=0&&N>=0&&B>=0&&h&&h({columnStartIndex:j,columnStopIndex:P,rowStartIndex:N,rowStopIndex:B})},[h,j,P,N,B]);const G=e.useMemo(()=>{const t=[];if(c>0&&v>0)for(let n=N;n<=B;n++){const l=A(n),r=[];for(let o=j;o<=P;o++){const t=O(o);r.push(e.createElement(T,{...z,ariaAttributes:{"aria-colindex":o+1,role:"gridcell"},columnIndex:o,key:o,rowIndex:n,style:{position:"absolute",left:y?void 0:0,right:y?0:void 0,transform:`translate(${y?-t.scrollOffset:t.scrollOffset}px, ${l.scrollOffset}px)`,height:v>1?l.size:"100%",width:t.size}}))}t.push(o.jsx("div",{role:"row","aria-rowindex":n+1,children:r},n))}return t},[T,z,c,j,P,O,A,y,v,N,B]),M=o.jsx("div",{"aria-hidden":!0,style:{height:L(),width:R(),zIndex:-1}});return e.createElement(S,{"aria-colcount":c,"aria-rowcount":v,role:"grid",...C,className:a,dir:m,ref:b,style:{position:"relative",width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...I}},G,s,M)}export{r as G};
|
|
2
|
-
//# sourceMappingURL=Grid-BXEwl59J.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Grid-BXEwl59J.js","sources":["../../lib/components/grid/Grid.tsx","../../lib/core/useIsRtl.ts","../../lib/utils/isRtl.ts"],"sourcesContent":["import {\n createElement,\n memo,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n type ReactNode\n} from \"react\";\nimport { useIsRtl } from \"../../core/useIsRtl\";\nimport { useVirtualizer } from \"../../core/useVirtualizer\";\nimport { useMemoizedObject } from \"../../hooks/useMemoizedObject\";\nimport type { Align, TagNames } from \"../../types\";\nimport { arePropsEqual } from \"../../utils/arePropsEqual\";\nimport type { GridProps } from \"./types\";\n\nexport function Grid<\n CellProps extends object,\n TagName extends TagNames = \"div\"\n>({\n cellComponent: CellComponentProp,\n cellProps: cellPropsUnstable,\n children,\n className,\n columnCount,\n columnWidth,\n defaultHeight = 0,\n defaultWidth = 0,\n dir,\n gridRef,\n onCellsRendered,\n onResize,\n overscanCount = 3,\n rowCount,\n rowHeight,\n style,\n tagName = \"div\" as TagName,\n ...rest\n}: GridProps<CellProps, TagName>) {\n const cellProps = useMemoizedObject(cellPropsUnstable);\n const CellComponent = useMemo(\n () => memo(CellComponentProp, arePropsEqual),\n [CellComponentProp]\n );\n\n const [element, setElement] = useState<HTMLDivElement | null>(null);\n\n const isRtl = useIsRtl(element, dir);\n\n const {\n getCellBounds: getColumnBounds,\n getEstimatedSize: getEstimatedWidth,\n startIndex: columnStartIndex,\n scrollToIndex: scrollToColumnIndex,\n stopIndex: columnStopIndex\n } = useVirtualizer({\n containerElement: element,\n defaultContainerSize: defaultWidth,\n direction: \"horizontal\",\n isRtl,\n itemCount: columnCount,\n itemProps: cellProps,\n itemSize: columnWidth,\n onResize,\n overscanCount\n });\n\n const {\n getCellBounds: getRowBounds,\n getEstimatedSize: getEstimatedHeight,\n startIndex: rowStartIndex,\n scrollToIndex: scrollToRowIndex,\n stopIndex: rowStopIndex\n } = useVirtualizer({\n containerElement: element,\n defaultContainerSize: defaultHeight,\n direction: \"vertical\",\n itemCount: rowCount,\n itemProps: cellProps,\n itemSize: rowHeight,\n onResize,\n overscanCount\n });\n\n useImperativeHandle(\n gridRef,\n () => ({\n get element() {\n return element;\n },\n\n scrollToCell({\n behavior = \"auto\",\n columnAlign = \"auto\",\n columnIndex,\n rowAlign = \"auto\",\n rowIndex\n }: {\n behavior?: ScrollBehavior;\n columnAlign?: Align;\n columnIndex: number;\n rowAlign?: Align;\n rowIndex: number;\n }) {\n const left = scrollToColumnIndex({\n align: columnAlign,\n containerScrollOffset: element?.scrollLeft ?? 0,\n index: columnIndex\n });\n const top = scrollToRowIndex({\n align: rowAlign,\n containerScrollOffset: element?.scrollTop ?? 0,\n index: rowIndex\n });\n\n if (typeof element?.scrollTo === \"function\") {\n element.scrollTo({\n behavior,\n left,\n top\n });\n }\n },\n\n scrollToColumn({\n align = \"auto\",\n behavior = \"auto\",\n index\n }: {\n align?: Align;\n behavior?: ScrollBehavior;\n index: number;\n }) {\n const left = scrollToColumnIndex({\n align,\n containerScrollOffset: element?.scrollLeft ?? 0,\n index\n });\n\n if (typeof element?.scrollTo === \"function\") {\n element.scrollTo({\n behavior,\n left\n });\n }\n },\n\n scrollToRow({\n align = \"auto\",\n behavior = \"auto\",\n index\n }: {\n align?: Align;\n behavior?: ScrollBehavior;\n index: number;\n }) {\n const top = scrollToRowIndex({\n align,\n containerScrollOffset: element?.scrollTop ?? 0,\n index\n });\n\n if (typeof element?.scrollTo === \"function\") {\n element.scrollTo({\n behavior,\n top\n });\n }\n }\n }),\n [element, scrollToColumnIndex, scrollToRowIndex]\n );\n\n useEffect(() => {\n if (\n columnStartIndex >= 0 &&\n columnStopIndex >= 0 &&\n rowStartIndex >= 0 &&\n rowStopIndex >= 0 &&\n onCellsRendered\n ) {\n onCellsRendered({\n columnStartIndex,\n columnStopIndex,\n rowStartIndex,\n rowStopIndex\n });\n }\n }, [\n onCellsRendered,\n columnStartIndex,\n columnStopIndex,\n rowStartIndex,\n rowStopIndex\n ]);\n\n const cells = useMemo(() => {\n const children: ReactNode[] = [];\n if (columnCount > 0 && rowCount > 0) {\n for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {\n const rowBounds = getRowBounds(rowIndex);\n\n const columns: ReactNode[] = [];\n\n for (\n let columnIndex = columnStartIndex;\n columnIndex <= columnStopIndex;\n columnIndex++\n ) {\n const columnBounds = getColumnBounds(columnIndex);\n\n columns.push(\n <CellComponent\n {...(cellProps as CellProps)}\n ariaAttributes={{\n \"aria-colindex\": columnIndex + 1,\n role: \"gridcell\"\n }}\n columnIndex={columnIndex}\n key={columnIndex}\n rowIndex={rowIndex}\n style={{\n position: \"absolute\",\n left: isRtl ? undefined : 0,\n right: isRtl ? 0 : undefined,\n transform: `translate(${isRtl ? -columnBounds.scrollOffset : columnBounds.scrollOffset}px, ${rowBounds.scrollOffset}px)`,\n height: rowCount > 1 ? rowBounds.size : \"100%\",\n width: columnBounds.size\n }}\n />\n );\n }\n\n children.push(\n <div key={rowIndex} role=\"row\" aria-rowindex={rowIndex + 1}>\n {columns}\n </div>\n );\n }\n }\n return children;\n }, [\n CellComponent,\n cellProps,\n columnCount,\n columnStartIndex,\n columnStopIndex,\n getColumnBounds,\n getRowBounds,\n isRtl,\n rowCount,\n rowStartIndex,\n rowStopIndex\n ]);\n\n const sizingElement = (\n <div\n aria-hidden\n style={{\n height: getEstimatedHeight(),\n width: getEstimatedWidth(),\n zIndex: -1\n }}\n ></div>\n );\n\n return createElement(\n tagName,\n {\n \"aria-colcount\": columnCount,\n \"aria-rowcount\": rowCount,\n role: \"grid\",\n ...rest,\n className,\n dir,\n ref: setElement,\n style: {\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n maxHeight: \"100%\",\n maxWidth: \"100%\",\n flexGrow: 1,\n overflow: \"auto\",\n ...style\n }\n },\n cells,\n children,\n sizingElement\n );\n}\n","import { useLayoutEffect, useState, type HTMLAttributes } from \"react\";\nimport { isRtl } from \"../utils/isRtl\";\n\nexport function useIsRtl(\n element: HTMLElement | null,\n dir: HTMLAttributes<HTMLElement>[\"dir\"]\n) {\n const [value, setValue] = useState(dir === \"rtl\");\n\n useLayoutEffect(() => {\n if (element) {\n if (!dir) {\n setValue(isRtl(element));\n }\n }\n }, [dir, element]);\n\n return value;\n}\n","export function isRtl(element: HTMLElement) {\n let currentElement: HTMLElement | null = element;\n while (currentElement) {\n if (currentElement.dir) {\n return currentElement.dir === \"rtl\";\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return false;\n}\n"],"names":["Grid","cellComponent","CellComponentProp","cellProps","cellPropsUnstable","children","className","columnCount","columnWidth","defaultHeight","defaultWidth","dir","gridRef","onCellsRendered","onResize","overscanCount","rowCount","rowHeight","style","tagName","rest","useMemoizedObject","CellComponent","useMemo","memo","arePropsEqual","element","setElement","useState","isRtl","value","setValue","useLayoutEffect","currentElement","parentElement","useIsRtl","getCellBounds","getColumnBounds","getEstimatedSize","getEstimatedWidth","startIndex","columnStartIndex","scrollToIndex","scrollToColumnIndex","stopIndex","columnStopIndex","useVirtualizer","containerElement","defaultContainerSize","direction","itemCount","itemProps","itemSize","getRowBounds","getEstimatedHeight","rowStartIndex","scrollToRowIndex","rowStopIndex","useImperativeHandle","scrollToCell","behavior","columnAlign","columnIndex","rowAlign","rowIndex","left","align","containerScrollOffset","scrollLeft","index","top","scrollTop","scrollTo","scrollToColumn","scrollToRow","useEffect","cells","rowBounds","columns","columnBounds","push","createElement","ariaAttributes","role","key","position","right","transform","scrollOffset","height","size","width","jsx","sizingElement","zIndex","ref","maxHeight","maxWidth","flexGrow","overflow"],"mappings":"6GAgBO,SAASA,GAIdC,cAAeC,EACfC,UAAWC,EAAAC,SACXA,EAAAC,UACAA,EAAAC,YACAA,EAAAC,YACAA,EAAAC,cACAA,EAAgB,EAAAC,aAChBA,EAAe,EAAAC,IACfA,EAAAC,QACAA,EAAAC,gBACAA,EAAAC,SACAA,EAAAC,cACAA,EAAgB,EAAAC,SAChBA,EAAAC,UACAA,EAAAC,MACAA,EAAAC,QACAA,EAAU,SACPC,IAEH,MAAMjB,EAAYkB,EAAkBjB,GAC9BkB,EAAgBC,EAAAA,QACpB,IAAMC,EAAAA,KAAKtB,EAAmBuB,GAC9B,CAACvB,KAGIwB,EAASC,GAAcC,EAAAA,SAAgC,MAExDC,EC5CD,SACLH,EACAf,GAEA,MAAOmB,EAAOC,GAAYH,EAAAA,SAAiB,QAARjB,GAUnC,OARAqB,EAAAA,gBAAgB,KACVN,IACGf,GACHoB,ECZD,SAAeL,GACpB,IAAIO,EAAqCP,EACzC,KAAOO,GAAgB,CACrB,GAAIA,EAAetB,IACjB,MAA8B,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AO,CACLuE,OAAQnC,IACRqC,MAAOpD,IACPuD,QAAQ,KAKd,OAAOb,EAAAA,cACL9D,EACA,CACE,gBAAiBZ,EACjB,gBAAiBS,EACjBmE,KAAM,UACH/D,EACHd,YACAK,MACAoF,IAAKpE,EACLT,MAAO,CACLmE,SAAU,WACVM,MAAO,OACPF,OAAQ,OACRO,UAAW,OACXC,SAAU,OACVC,SAAU,EACVC,SAAU,UACPjF,IAGP0D,EACAvE,EACAwF,EAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,j as t}from"./index-C6NWGx8D.js";import{u as o,a as s,b as n}from"./arePropsEqual-Czc4-HWX.js";function r({children:r,className:i,defaultHeight:a=0,listRef:l,onResize:c,onRowsRendered:u,overscanCount:d=3,rowComponent:m,rowCount:f,rowHeight:p,rowProps:x,tagName:h="div",style:g,...v}){const w=o(x),z=e.useMemo(()=>e.memo(m,s),[m]),[C,I]=e.useState(null),{getCellBounds:y,getEstimatedSize:E,scrollToIndex:R,startIndex:b,stopIndex:S}=n({containerElement:C,defaultContainerSize:a,direction:"vertical",itemCount:f,itemProps:w,itemSize:p,onResize:c,overscanCount:d});e.useImperativeHandle(l,()=>({get element(){return C},scrollToRow({align:e="auto",behavior:t="auto",index:o}){const s=R({align:e,containerScrollOffset:C?.scrollTop??0,index:o});"function"==typeof C?.scrollTo&&C.scrollTo({behavior:t,top:s})}}),[C,R]),e.useEffect(()=>{b>=0&&S>=0&&u&&u({startIndex:b,stopIndex:S})},[u,b,S]);const T=e.useMemo(()=>{const t=[];if(f>0)for(let o=b;o<=S;o++){const s=y(o);t.push(e.createElement(z,{...w,ariaAttributes:{"aria-posinset":o+1,"aria-setsize":f,role:"listitem"},key:o,index:o,style:{position:"absolute",left:0,transform:`translateY(${s.scrollOffset}px)`,height:s.size,width:"100%"}}))}return t},[z,y,f,w,b,S]),j=t.jsx("div",{"aria-hidden":!0,style:{height:E(),width:"100%",zIndex:-1}});return e.createElement(h,{role:"list",...v,className:i,ref:I,style:{position:"relative",maxHeight:"100%",flexGrow:1,overflowY:"auto",...g}},T,r,j)}export{r as L};
|
|
2
|
-
//# sourceMappingURL=List-CwFMf7n1.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List-CwFMf7n1.js","sources":["../../lib/components/list/List.tsx"],"sourcesContent":["import {\n createElement,\n memo,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n type ReactNode\n} from \"react\";\nimport { useVirtualizer } from \"../../core/useVirtualizer\";\nimport { useMemoizedObject } from \"../../hooks/useMemoizedObject\";\nimport type { Align, TagNames } from \"../../types\";\nimport { arePropsEqual } from \"../../utils/arePropsEqual\";\nimport type { ListProps } from \"./types\";\n\nexport function List<\n RowProps extends object,\n TagName extends TagNames = \"div\"\n>({\n children,\n className,\n defaultHeight = 0,\n listRef,\n onResize,\n onRowsRendered,\n overscanCount = 3,\n rowComponent: RowComponentProp,\n rowCount,\n rowHeight,\n rowProps: rowPropsUnstable,\n tagName = \"div\" as TagName,\n style,\n ...rest\n}: ListProps<RowProps, TagName>) {\n const rowProps = useMemoizedObject(rowPropsUnstable);\n const RowComponent = useMemo(\n () => memo(RowComponentProp, arePropsEqual),\n [RowComponentProp]\n );\n\n const [element, setElement] = useState<HTMLDivElement | null>(null);\n\n const {\n getCellBounds,\n getEstimatedSize,\n scrollToIndex,\n startIndex,\n stopIndex\n } = useVirtualizer({\n containerElement: element,\n defaultContainerSize: defaultHeight,\n direction: \"vertical\",\n itemCount: rowCount,\n itemProps: rowProps,\n itemSize: rowHeight,\n onResize,\n overscanCount\n });\n\n useImperativeHandle(\n listRef,\n () => ({\n get element() {\n return element;\n },\n\n scrollToRow({\n align = \"auto\",\n behavior = \"auto\",\n index\n }: {\n align?: Align;\n behavior?: ScrollBehavior;\n index: number;\n }) {\n const top = scrollToIndex({\n align,\n containerScrollOffset: element?.scrollTop ?? 0,\n index\n });\n\n if (typeof element?.scrollTo === \"function\") {\n element.scrollTo({\n behavior,\n top\n });\n }\n }\n }),\n [element, scrollToIndex]\n );\n\n useEffect(() => {\n if (startIndex >= 0 && stopIndex >= 0 && onRowsRendered) {\n onRowsRendered({\n startIndex,\n stopIndex\n });\n }\n }, [onRowsRendered, startIndex, stopIndex]);\n\n const rows = useMemo(() => {\n const children: ReactNode[] = [];\n if (rowCount > 0) {\n for (let index = startIndex; index <= stopIndex; index++) {\n const bounds = getCellBounds(index);\n\n children.push(\n <RowComponent\n {...(rowProps as RowProps)}\n ariaAttributes={{\n \"aria-posinset\": index + 1,\n \"aria-setsize\": rowCount,\n role: \"listitem\"\n }}\n key={index}\n index={index}\n style={{\n position: \"absolute\",\n left: 0,\n transform: `translateY(${bounds.scrollOffset}px)`,\n height: bounds.size,\n width: \"100%\"\n }}\n />\n );\n }\n }\n return children;\n }, [RowComponent, getCellBounds, rowCount, rowProps, startIndex, stopIndex]);\n\n const sizingElement = (\n <div\n aria-hidden\n style={{\n height: getEstimatedSize(),\n width: \"100%\",\n zIndex: -1\n }}\n ></div>\n );\n\n return createElement(\n tagName,\n {\n role: \"list\",\n ...rest,\n className,\n ref: setElement,\n style: {\n position: \"relative\",\n maxHeight: \"100%\",\n flexGrow: 1,\n overflowY: \"auto\",\n ...style\n }\n },\n rows,\n children,\n sizingElement\n );\n}\n"],"names":["List","children","className","defaultHeight","listRef","onResize","onRowsRendered","overscanCount","rowComponent","RowComponentProp","rowCount","rowHeight","rowProps","rowPropsUnstable","tagName","style","rest","useMemoizedObject","RowComponent","useMemo","memo","arePropsEqual","element","setElement","useState","getCellBounds","getEstimatedSize","scrollToIndex","startIndex","stopIndex","useVirtualizer","containerElement","defaultContainerSize","direction","itemCount","itemProps","itemSize","useImperativeHandle","scrollToRow","align","behavior","index","top","containerScrollOffset","scrollTop","scrollTo","useEffect","rows","bounds","push","createElement","ariaAttributes","role","key","position","left","transform","scrollOffset","height","size","width","sizingElement","jsx","zIndex","ref","maxHeight","flexGrow","overflowY"],"mappings":"6GAeO,SAASA,GAGdC,SAC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O,CACLuC,SAAU,WACVC,KAAM,EACNC,UAAW,cAAcR,EAAOS,kBAChCC,OAAQV,EAAOW,KACfC,MAAO,UAIf,CAEF,OAAO3D,GACN,CAACiB,EAAcO,EAAef,EAAUE,EAAUgB,EAAYC,IAE3DgC,EACJC,EAAAA,IAAC,MAAA,CACC,eAAW,EACX/C,MAAO,CACL2C,OAAQhC,IACRkC,MAAO,OACPG,QAAQ,KAKd,OAAOb,EAAAA,cACLpC,EACA,CACEsC,KAAM,UACHpC,EACHd,YACA8D,IAAKzC,EACLR,MAAO,CACLuC,SAAU,WACVW,UAAW,OACXC,SAAU,EACVC,UAAW,UACRpD,IAGPgC,EACA9C,EACA4D,EAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,B as a}from"./index-C6NWGx8D.js";import{C as t}from"./ContinueLink-DMnSPbdx.js";import{C as l}from"./ComponentProps-BFVtvKZW.js";import"./Header-B_onM2vR.js";const n={tags:{},filePath:"lib/components/list/List.tsx",description:"",displayName:"List",methods:[],props:JSON.parse('{"className":{"defaultValue":null,"description":"CSS class name.","name":"className","parent":{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"HTMLAttributes"},"declarations":[{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"HTMLAttributes"},{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"string | undefined","value":[{"value":"undefined"},{"value":"string"}]}},"style":{"defaultValue":null,"description":"Optional CSS properties.\\nThe list of rows will fill the height defined by this style.","name":"style","parent":{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"HTMLAttributes"},"declarations":[{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"HTMLAttributes"},{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"CSSProperties | undefined","value":[{"value":"undefined"},{"value":"CSSProperties","description":"","fullComment":"","tags":{}}]}},"children":{"defaultValue":null,"description":"Additional content to be rendered within the list (above cells).\\nThis property can be used to render things like overlays or tooltips.","name":"children","parent":{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"DOMAttributes"},"declarations":[{"fileName":"react-window/node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","name":"DOMAttributes"},{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"ReactNode","value":[{"value":"undefined"},{"value":"null"},{"value":"string"},{"value":"number"},{"value":"bigint"},{"value":"false"},{"value":"true"},{"value":"ReactElement<unknown, string | JSXElementConstructor<any>>","description":"Represents a JSX element.\\n\\nWhere {@link ReactNode} represents everything that can be rendered, `ReactElement`\\nonly represents JSX.","fullComment":"Represents a JSX element.\\n\\nWhere {@link ReactNode} represents everything that can be rendered, `ReactElement`\\nonly represents JSX.\\n@template P The type of the props object\\n@template T The type of the component or tag\\n@example ```tsx\\nconst element: ReactElement = <div />;\\n```","tags":{"template":"P The type of the props object\\nT The type of the component or tag","example":"```tsx\\nconst element: ReactElement = <div />;\\n```"}},{"value":"Iterable<ReactNode>","description":"","fullComment":"","tags":{}},{"value":"ReactPortal","description":"","fullComment":"","tags":{}},{"value":"Promise<AwaitedReactNode>","description":"Represents the completion of an asynchronous operation","fullComment":"Represents the completion of an asynchronous operation","tags":{}}]}},"defaultHeight":{"defaultValue":{"value":"0"},"description":"Default height of list for initial render.\\nThis value is important for server rendering.","name":"defaultHeight","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"number | undefined","value":[{"value":"undefined"},{"value":"number"}]}},"listRef":{"defaultValue":null,"description":"Ref used to interact with this component\'s imperative API.\\n\\nThis API has imperative methods for scrolling and a getter for the outermost DOM element.\\n\\n⚠️ The `useListRef` and `useListCallbackRef` hooks are exported for convenience use in TypeScript projects.","name":"listRef","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"Ref<ListImperativeAPI> | undefined","value":[{"value":"undefined"},{"value":"null"},{"value":"(instance: ListImperativeAPI | null) => void | (() => VoidOrUndefinedOnly)","description":"","fullComment":"","tags":{}},{"value":"RefObject<ListImperativeAPI | null>","description":"Created by {@link createRef}, or {@link useRef} when passed `null`.","fullComment":"Created by {@link createRef}, or {@link useRef} when passed `null`.\\n@template T The type of the ref\'s value.\\n@example ```tsx\\nconst ref = createRef<HTMLDivElement>();\\n\\nref.current = document.createElement(\'div\'); // Error\\n```","tags":{"template":"T The type of the ref\'s value.","example":"```tsx\\nconst ref = createRef<HTMLDivElement>();\\n\\nref.current = document.createElement(\'div\'); // Error\\n```"}}]}},"onResize":{"defaultValue":null,"description":"Callback notified when the List\'s outermost HTMLElement resizes.\\nThis may be used to (re)scroll a row into view.","name":"onResize","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"((size: { height: number; width: number; }, prevSize: { height: number; width: number; }) => void) | undefined","value":[{"value":"undefined"},{"value":"(size: { height: number; width: number; }, prevSize: { height: number; width: number; }) => void","description":"","fullComment":"","tags":{}}]}},"onRowsRendered":{"defaultValue":null,"description":"Callback notified when the range of visible rows changes.","name":"onRowsRendered","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"((args: { startIndex: number; stopIndex: number; }) => void) | undefined","value":[{"value":"undefined"},{"value":"(args: { startIndex: number; stopIndex: number; }) => void","description":"","fullComment":"","tags":{}}]}},"overscanCount":{"defaultValue":{"value":"3"},"description":"How many additional rows to render outside of the visible area.\\nThis can reduce visual flickering near the edges of a list when scrolling.","name":"overscanCount","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"number | undefined","value":[{"value":"undefined"},{"value":"number"}]}},"rowComponent":{"defaultValue":null,"description":"React component responsible for rendering a row.\\n\\nThis component will receive an `index` and `style` prop by default.\\nAdditionally it will receive prop values passed to `rowProps`.\\n\\n⚠️ The prop types for this component are exported as `RowComponentProps`","name":"rowComponent","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":true,"type":{"name":"(props: { ariaAttributes: { \\"aria-posinset\\": number; \\"aria-setsize\\": number; role: \\"listitem\\"; }; index: number; style: CSSProperties; } & RowProps) => ReactNode"}},"rowCount":{"defaultValue":null,"description":"Number of items to be rendered in the list.","name":"rowCount","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":true,"type":{"name":"number"}},"rowHeight":{"defaultValue":null,"description":"Row height; the following formats are supported:\\n- number of pixels (number)\\n- percentage of the grid\'s current height (string)\\n- function that returns the row height (in pixels) given an index and `cellProps`","name":"rowHeight","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":true,"type":{"name":"enum","raw":"string | number | ((index: number, cellProps: RowProps) => number)","value":[{"value":"string"},{"value":"number"},{"value":"(index: number, cellProps: RowProps) => number","description":"","fullComment":"","tags":{}}]}},"rowProps":{"defaultValue":null,"description":"Additional props to be passed to the row-rendering component.\\nList will automatically re-render rows when values in this object change.\\n\\n⚠️ This object must not contain either an `index` or `style` prop.","name":"rowProps","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":true,"type":{"name":"ExcludeForbiddenKeys<RowProps>"}},"tagName":{"defaultValue":{"value":"\\"div\\" as TagName"},"description":"Can be used to override the root HTML element rendered by the List component.\\nThe default value is \\"div\\", meaning that List renders an HTMLDivElement as its root.\\n\\n⚠️ In most use cases the default ARIA roles are sufficient and this prop is not needed.","name":"tagName","declarations":[{"fileName":"react-window/lib/components/list/types.ts","name":"TypeLiteral"}],"required":false,"type":{"name":"enum","raw":"keyof IntrinsicElements | undefined","value":[{"value":"undefined"},{"value":"\\"symbol\\""},{"value":"\\"object\\""},{"value":"\\"slot\\""},{"value":"\\"style\\""},{"value":"\\"title\\""},{"value":"\\"search\\""},{"value":"\\"article\\""},{"value":"\\"button\\""},{"value":"\\"dialog\\""},{"value":"\\"figure\\""},{"value":"\\"form\\""},{"value":"\\"img\\""},{"value":"\\"link\\""},{"value":"\\"main\\""},{"value":"\\"menu\\""},{"value":"\\"menuitem\\""},{"value":"\\"option\\""},{"value":"\\"switch\\""},{"value":"\\"table\\""},{"value":"\\"text\\""},{"value":"\\"time\\""},{"value":"\\"a\\""},{"value":"\\"abbr\\""},{"value":"\\"address\\""},{"value":"\\"area\\""},{"value":"\\"aside\\""},{"value":"\\"audio\\""},{"value":"\\"b\\""},{"value":"\\"base\\""},{"value":"\\"bdi\\""},{"value":"\\"bdo\\""},{"value":"\\"big\\""},{"value":"\\"blockquote\\""},{"value":"\\"body\\""},{"value":"\\"br\\""},{"value":"\\"canvas\\""},{"value":"\\"caption\\""},{"value":"\\"center\\""},{"value":"\\"cite\\""},{"value":"\\"code\\""},{"value":"\\"col\\""},{"value":"\\"colgroup\\""},{"value":"\\"data\\""},{"value":"\\"datalist\\""},{"value":"\\"dd\\""},{"value":"\\"del\\""},{"value":"\\"details\\""},{"value":"\\"dfn\\""},{"value":"\\"div\\""},{"value":"\\"dl\\""},{"value":"\\"dt\\""},{"value":"\\"em\\""},{"value":"\\"embed\\""},{"value":"\\"fieldset\\""},{"value":"\\"figcaption\\""},{"value":"\\"footer\\""},{"value":"\\"h1\\""},{"value":"\\"h2\\""},{"value":"\\"h3\\""},{"value":"\\"h4\\""},{"value":"\\"h5\\""},{"value":"\\"h6\\""},{"value":"\\"head\\""},{"value":"\\"header\\""},{"value":"\\"hgroup\\""},{"value":"\\"hr\\""},{"value":"\\"html\\""},{"value":"\\"i\\""},{"value":"\\"iframe\\""},{"value":"\\"input\\""},{"value":"\\"ins\\""},{"value":"\\"kbd\\""},{"value":"\\"keygen\\""},{"value":"\\"label\\""},{"value":"\\"legend\\""},{"value":"\\"li\\""},{"value":"\\"map\\""},{"value":"\\"mark\\""},{"value":"\\"meta\\""},{"value":"\\"meter\\""},{"value":"\\"nav\\""},{"value":"\\"noindex\\""},{"value":"\\"noscript\\""},{"value":"\\"ol\\""},{"value":"\\"optgroup\\""},{"value":"\\"output\\""},{"value":"\\"p\\""},{"value":"\\"param\\""},{"value":"\\"picture\\""},{"value":"\\"pre\\""},{"value":"\\"progress\\""},{"value":"\\"q\\""},{"value":"\\"rp\\""},{"value":"\\"rt\\""},{"value":"\\"ruby\\""},{"value":"\\"s\\""},{"value":"\\"samp\\""},{"value":"\\"script\\""},{"value":"\\"section\\""},{"value":"\\"select\\""},{"value":"\\"small\\""},{"value":"\\"source\\""},{"value":"\\"span\\""},{"value":"\\"strong\\""},{"value":"\\"sub\\""},{"value":"\\"summary\\""},{"value":"\\"sup\\""},{"value":"\\"template\\""},{"value":"\\"tbody\\""},{"value":"\\"td\\""},{"value":"\\"textarea\\""},{"value":"\\"tfoot\\""},{"value":"\\"th\\""},{"value":"\\"thead\\""},{"value":"\\"tr\\""},{"value":"\\"track\\""},{"value":"\\"u\\""},{"value":"\\"ul\\""},{"value":"\\"var\\""},{"value":"\\"video\\""},{"value":"\\"wbr\\""},{"value":"\\"webview\\""},{"value":"\\"svg\\""},{"value":"\\"animate\\""},{"value":"\\"animateMotion\\""},{"value":"\\"animateTransform\\""},{"value":"\\"circle\\""},{"value":"\\"clipPath\\""},{"value":"\\"defs\\""},{"value":"\\"desc\\""},{"value":"\\"ellipse\\""},{"value":"\\"feBlend\\""},{"value":"\\"feColorMatrix\\""},{"value":"\\"feComponentTransfer\\""},{"value":"\\"feComposite\\""},{"value":"\\"feConvolveMatrix\\""},{"value":"\\"feDiffuseLighting\\""},{"value":"\\"feDisplacementMap\\""},{"value":"\\"feDistantLight\\""},{"value":"\\"feDropShadow\\""},{"value":"\\"feFlood\\""},{"value":"\\"feFuncA\\""},{"value":"\\"feFuncB\\""},{"value":"\\"feFuncG\\""},{"value":"\\"feFuncR\\""},{"value":"\\"feGaussianBlur\\""},{"value":"\\"feImage\\""},{"value":"\\"feMerge\\""},{"value":"\\"feMergeNode\\""},{"value":"\\"feMorphology\\""},{"value":"\\"feOffset\\""},{"value":"\\"fePointLight\\""},{"value":"\\"feSpecularLighting\\""},{"value":"\\"feSpotLight\\""},{"value":"\\"feTile\\""},{"value":"\\"feTurbulence\\""},{"value":"\\"filter\\""},{"value":"\\"foreignObject\\""},{"value":"\\"g\\""},{"value":"\\"image\\""},{"value":"\\"line\\""},{"value":"\\"linearGradient\\""},{"value":"\\"marker\\""},{"value":"\\"mask\\""},{"value":"\\"metadata\\""},{"value":"\\"mpath\\""},{"value":"\\"path\\""},{"value":"\\"pattern\\""},{"value":"\\"polygon\\""},{"value":"\\"polyline\\""},{"value":"\\"radialGradient\\""},{"value":"\\"rect\\""},{"value":"\\"set\\""},{"value":"\\"stop\\""},{"value":"\\"textPath\\""},{"value":"\\"tspan\\""},{"value":"\\"use\\""},{"value":"\\"view\\""}]}}}')};function i(){return e.jsxs(a,{direction:"column",gap:4,children:[e.jsx(l,{section:"Lists",json:n}),e.jsx(t,{to:"/list/imperative-api",title:"imperative api"})]})}export{i as default};
|
|
2
|
-
//# sourceMappingURL=PropsRoute-CUL_CRSw.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,X as t,r as i,Y as n}from"./index-C6NWGx8D.js";function o({children:i,className:n,...o}){return e.jsx(t,{children:e.jsx("div",{className:`border-lg bg-black/30 text-slate-300 rounded-lg p-2 ${n}`,...o,children:i})})}function r(e){if(void 0!==e)switch(typeof e){case"number":return e;case"string":if(e.endsWith("px"))return parseFloat(e)}}let s=null;function c({containerElement:e,direction:t,isRtl:i,scrollOffset:n}){if("horizontal"===t&&i)switch(function(e=!1){if(null===s||e){const e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";const i=document.createElement("div"),n=i.style;return n.width="100px",n.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?s="positive-descending":(e.scrollLeft=1,s=0===e.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(e),s}return s}()){case"negative":return-n;case"positive-descending":if(e){const{clientWidth:t,scrollLeft:i,scrollWidth:n}=e;return n-t-i}}return n}function l(e,t="Assertion error"){if(!e)throw console.error(t),Error(t)}function a({cachedBounds:e,itemCount:t,itemSize:i}){if(0===t)return 0;if("number"==typeof i)return t*i;{const i=e.get(0===e.size?0:e.size-1);l(void 0!==i,"Unexpected bounds cache miss");return t*((i.scrollOffset+i.size)/e.size)}}function u({cachedBounds:e,containerScrollOffset:t,containerSize:i,itemCount:n,overscanCount:o}){const r=n-1;let s=0,c=-1,l=0;for(;l<r;){const i=e.get(l);if(i.scrollOffset+i.size>t)break;l++}for(s=l,s=Math.max(0,s-o);l<r;){const n=e.get(l);if(n.scrollOffset+n.size>=t+i)break;l++}return c=Math.min(r,l),c=Math.min(n-1,c+o),s<0?[0,-1]:[s,c]}function d({itemCount:e,itemProps:t,itemSize:n}){return i.useMemo(()=>function({itemCount:e,itemProps:t,itemSize:i}){const n=new Map;return{get(o){for(l(o<e,`Invalid index ${o}`);n.size-1<o;){const e=n.size;let r;switch(typeof i){case"function":r=i(e,t);break;case"number":r=i}if(0===e)n.set(e,{size:r,scrollOffset:0});else{const t=n.get(e-1);l(void 0!==t,`Unexpected bounds cache miss for index ${o}`),n.set(e,{scrollOffset:t.scrollOffset+t.size,size:r})}}const r=n.get(o);return l(void 0!==r,`Unexpected bounds cache miss for index ${o}`),r},set(e,t){n.set(e,t)},get size(){return n.size}}}({itemCount:e,itemProps:t,itemSize:n}),[e,t,n])}function f({containerElement:e,containerStyle:t,defaultContainerSize:o=0,direction:s,isRtl:f=!1,itemCount:h,itemProps:m,itemSize:g,onResize:z,overscanCount:v}){const[p,b]=i.useState([0,-1]),[S,w]=[Math.min(h-1,p[0]),Math.min(h-1,p[1])],{height:C=o,width:x=o}=function({box:e,defaultHeight:t,defaultWidth:o,disabled:s,element:c,mode:l,style:a}){const{styleHeight:u,styleWidth:d}=i.useMemo(()=>({styleHeight:r(a?.height),styleWidth:r(a?.width)}),[a?.height,a?.width]),[f,h]=i.useState({height:t,width:o}),m=s||"only-height"===l&&void 0!==u||"only-width"===l&&void 0!==d||void 0!==u&&void 0!==d;return n(()=>{if(null===c||m)return;const t=new ResizeObserver(e=>{for(const t of e){const{contentRect:e,target:i}=t;c===i&&h(t=>t.height===e.height&&t.width===e.width?t:{height:e.height,width:e.width})}});return t.observe(c,{box:e}),()=>{t?.unobserve(c)}},[e,m,c,u,d]),i.useMemo(()=>({height:u??f.height,width:d??f.width}),[f,u,d])}({defaultHeight:"vertical"===s?o:void 0,defaultWidth:"horizontal"===s?o:void 0,element:e,mode:"vertical"===s?"only-height":"only-width",style:t}),y=i.useRef({height:0,width:0}),O="vertical"===s?C:x,E=function({containerSize:e,itemSize:t}){let i;"string"==typeof t?(l(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),l(void 0!==e,"Container size must be defined if a percentage item size is specified"),i=e*parseInt(t)/100):i=t;return i}({containerSize:O,itemSize:g});i.useLayoutEffect(()=>{if("function"==typeof z){const e=y.current;e.height===C&&e.width===x||(z({height:C,width:x},{...e}),e.height=C,e.width=x)}},[C,z,x]);const M=d({itemCount:h,itemProps:m,itemSize:E}),k=i.useCallback(e=>M.get(e),[M]),B=i.useCallback(()=>a({cachedBounds:M,itemCount:h,itemSize:E}),[M,h,E]),R=i.useCallback(t=>{const i=c({containerElement:e,direction:s,isRtl:f,scrollOffset:t});return u({cachedBounds:M,containerScrollOffset:i,containerSize:O,itemCount:h,overscanCount:v})},[M,e,O,s,f,h,v]);n(()=>{b(R(("vertical"===s?e?.scrollTop:e?.scrollLeft)??0))},[e,s,R]),n(()=>{if(!e)return;const t=()=>{b(t=>{const{scrollLeft:i,scrollTop:n}=e,o=c({containerElement:e,direction:s,isRtl:f,scrollOffset:"vertical"===s?n:i}),r=u({cachedBounds:M,containerScrollOffset:o,containerSize:O,itemCount:h,overscanCount:v});return r[0]===t[0]&&r[1]===t[1]?t:r})};return e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}},[M,e,O,s,h,v]);const L=function(e){const t=i.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return n(()=>{t.current=e},[e]),i.useCallback(e=>t.current?.(e),[t])}(({align:t="auto",containerScrollOffset:i,index:n})=>{let o=function({align:e,cachedBounds:t,index:i,itemCount:n,itemSize:o,containerScrollOffset:r,containerSize:s}){const c=a({cachedBounds:t,itemCount:n,itemSize:o}),l=t.get(i),u=Math.max(0,Math.min(c-s,l.scrollOffset)),d=Math.max(0,l.scrollOffset-s+l.size);switch("smart"===e&&(e=r>=d&&r<=u?"auto":"center"),e){case"start":return u;case"end":return d;case"center":return l.scrollOffset<=s/2?0:l.scrollOffset+l.size/2>=c-s/2?c-s:l.scrollOffset+l.size/2-s/2;default:return r>=d&&r<=u?r:r<d?d:u}}({align:t,cachedBounds:M,containerScrollOffset:i,containerSize:O,index:n,itemCount:h,itemSize:E});if(e){if(o=c({containerElement:e,direction:s,isRtl:f,scrollOffset:o}),"function"!=typeof e.scrollTo){const e=R(o);e[0]===S&&e[1]===w||b(e)}return o}});return{getCellBounds:k,getEstimatedSize:B,scrollToIndex:L,startIndex:S,stopIndex:w}}function h(e){return i.useMemo(()=>e,Object.values(e))}function m(e,t){if(e===t)return!0;if(!!e!=!!t)return!1;if(l(void 0!==e),l(void 0!==t),Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Object.is(t[i],e[i]))return!1;return!0}function g(e,t){const{ariaAttributes:i,style:n,...o}=e,{ariaAttributes:r,style:s,...c}=t;return m(i,r)&&m(n,s)&&m(o,c)}export{o as B,g as a,f as b,h as u};
|
|
2
|
-
//# sourceMappingURL=arePropsEqual-Czc4-HWX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arePropsEqual-Czc4-HWX.js","sources":["../../src/components/Block.tsx","../../lib/utils/parseNumericStyleValue.ts","../../lib/utils/getRTLOffsetType.ts","../../lib/utils/adjustScrollOffsetForRtl.ts","../../lib/utils/assert.ts","../../lib/core/getEstimatedSize.ts","../../lib/core/getStartStopIndices.ts","../../lib/core/useCachedBounds.ts","../../lib/core/createCachedBounds.ts","../../lib/core/useVirtualizer.ts","../../lib/hooks/useResizeObserver.ts","../../lib/core/useItemSize.ts","../../lib/hooks/useStableCallback.ts","../../lib/core/getOffsetForIndex.ts","../../lib/hooks/useMemoizedObject.ts","../../lib/utils/shallowCompare.ts","../../lib/utils/arePropsEqual.ts"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport function Block({\n children,\n className,\n ...rest\n}: PropsWithChildren<HTMLAttributes<HTMLDivElement> & { className?: string }>) {\n return (\n <ErrorBoundary>\n <div\n className={`border-lg bg-black/30 text-slate-300 rounded-lg p-2 ${className}`}\n {...rest}\n >\n {children}\n </div>\n </ErrorBoundary>\n );\n}\n","import type { CSSProperties } from \"react\";\n\nexport function parseNumericStyleValue(\n value: CSSProperties[\"height\"]\n): number | undefined {\n if (value !== undefined) {\n switch (typeof value) {\n case \"number\": {\n return value;\n }\n case \"string\": {\n if (value.endsWith(\"px\")) {\n return parseFloat(value);\n }\n break;\n }\n }\n }\n}\n","export type RTLOffsetType =\n | \"negative\"\n | \"positive-descending\"\n | \"positive-ascending\";\n\nlet cachedRTLResult: RTLOffsetType | null = null;\n\n// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).\n// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.\n// The safest way to check this is to intentionally set a negative offset,\n// and then verify that the subsequent \"scroll\" event matches the negative offset.\n// If it does not match, then we can assume a non-standard RTL scroll implementation.\nexport function getRTLOffsetType(recalculate: boolean = false): RTLOffsetType {\n if (cachedRTLResult === null || recalculate) {\n const outerDiv = document.createElement(\"div\");\n const outerStyle = outerDiv.style;\n outerStyle.width = \"50px\";\n outerStyle.height = \"50px\";\n outerStyle.overflow = \"scroll\";\n outerStyle.direction = \"rtl\";\n\n const innerDiv = document.createElement(\"div\");\n const innerStyle = innerDiv.style;\n innerStyle.width = \"100px\";\n innerStyle.height = \"100px\";\n\n outerDiv.appendChild(innerDiv);\n\n document.body.appendChild(outerDiv);\n\n if (outerDiv.scrollLeft > 0) {\n cachedRTLResult = \"positive-descending\";\n } else {\n outerDiv.scrollLeft = 1;\n if (outerDiv.scrollLeft === 0) {\n cachedRTLResult = \"negative\";\n } else {\n cachedRTLResult = \"positive-ascending\";\n }\n }\n\n document.body.removeChild(outerDiv);\n\n return cachedRTLResult;\n }\n\n return cachedRTLResult;\n}\n","import type { Direction } from \"../core/types\";\nimport { getRTLOffsetType } from \"./getRTLOffsetType\";\n\nexport function adjustScrollOffsetForRtl({\n containerElement,\n direction,\n isRtl,\n scrollOffset\n}: {\n containerElement: HTMLElement | null;\n direction: Direction;\n isRtl: boolean;\n scrollOffset: number;\n}) {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // So we need to determine which browser behavior we're dealing with, and mimic it.\n if (direction === \"horizontal\") {\n if (isRtl) {\n switch (getRTLOffsetType()) {\n case \"negative\": {\n return -scrollOffset;\n }\n case \"positive-descending\": {\n if (containerElement) {\n const { clientWidth, scrollLeft, scrollWidth } = containerElement;\n return scrollWidth - clientWidth - scrollLeft;\n }\n break;\n }\n }\n }\n }\n return scrollOffset;\n}\n","export function assert(\n expectedCondition: unknown,\n message: string = \"Assertion error\"\n): asserts expectedCondition {\n if (!expectedCondition) {\n console.error(message);\n\n throw Error(message);\n }\n}\n","import type { CachedBounds, SizeFunction } from \"./types\";\nimport { assert } from \"../utils/assert\";\n\nexport function getEstimatedSize<Props extends object>({\n cachedBounds,\n itemCount,\n itemSize\n}: {\n cachedBounds: CachedBounds;\n itemCount: number;\n itemSize: number | SizeFunction<Props>;\n}) {\n if (itemCount === 0) {\n return 0;\n } else if (typeof itemSize === \"number\") {\n return itemCount * itemSize;\n } else {\n const bounds = cachedBounds.get(\n cachedBounds.size === 0 ? 0 : cachedBounds.size - 1\n );\n assert(bounds !== undefined, \"Unexpected bounds cache miss\");\n\n const averageItemSize =\n (bounds.scrollOffset + bounds.size) / cachedBounds.size;\n\n return itemCount * averageItemSize;\n }\n}\n","import type { CachedBounds } from \"./types\";\n\nexport function getStartStopIndices({\n cachedBounds,\n containerScrollOffset,\n containerSize,\n itemCount,\n overscanCount\n}: {\n cachedBounds: CachedBounds;\n containerScrollOffset: number;\n containerSize: number;\n itemCount: number;\n overscanCount: number;\n}): [number, number] {\n const maxIndex = itemCount - 1;\n\n let startIndex = 0;\n let stopIndex = -1;\n let currentIndex = 0;\n\n while (currentIndex < maxIndex) {\n const bounds = cachedBounds.get(currentIndex);\n\n if (bounds.scrollOffset + bounds.size > containerScrollOffset) {\n break;\n }\n\n currentIndex++;\n }\n\n startIndex = currentIndex;\n startIndex = Math.max(0, startIndex - overscanCount);\n\n while (currentIndex < maxIndex) {\n const bounds = cachedBounds.get(currentIndex);\n\n if (\n bounds.scrollOffset + bounds.size >=\n containerScrollOffset + containerSize\n ) {\n break;\n }\n\n currentIndex++;\n }\n\n stopIndex = Math.min(maxIndex, currentIndex);\n stopIndex = Math.min(itemCount - 1, stopIndex + overscanCount);\n\n return startIndex < 0 ? [0, -1] : [startIndex, stopIndex];\n}\n","import { useMemo } from \"react\";\nimport { createCachedBounds } from \"./createCachedBounds\";\nimport type { CachedBounds, SizeFunction } from \"./types\";\n\nexport function useCachedBounds<Props extends object>({\n itemCount,\n itemProps,\n itemSize\n}: {\n itemCount: number;\n itemProps: Props;\n itemSize: number | SizeFunction<Props>;\n}): CachedBounds {\n return useMemo(\n () =>\n createCachedBounds({\n itemCount,\n itemProps,\n itemSize\n }),\n [itemCount, itemProps, itemSize]\n );\n}\n","import { assert } from \"../utils/assert\";\nimport type { Bounds, CachedBounds, SizeFunction } from \"./types\";\n\nexport function createCachedBounds<Props extends object>({\n itemCount,\n itemProps,\n itemSize\n}: {\n itemCount: number;\n itemProps: Props;\n itemSize: number | SizeFunction<Props>;\n}): CachedBounds {\n const cache = new Map<number, Bounds>();\n\n return {\n get(index: number) {\n assert(index < itemCount, `Invalid index ${index}`);\n\n while (cache.size - 1 < index) {\n const currentIndex = cache.size;\n\n let size: number;\n switch (typeof itemSize) {\n case \"function\": {\n size = itemSize(currentIndex, itemProps);\n break;\n }\n case \"number\": {\n size = itemSize;\n break;\n }\n }\n\n if (currentIndex === 0) {\n cache.set(currentIndex, {\n size,\n scrollOffset: 0\n });\n } else {\n const previousRowBounds = cache.get(currentIndex - 1);\n assert(\n previousRowBounds !== undefined,\n `Unexpected bounds cache miss for index ${index}`\n );\n\n cache.set(currentIndex, {\n scrollOffset:\n previousRowBounds.scrollOffset + previousRowBounds.size,\n size\n });\n }\n }\n\n const bounds = cache.get(index);\n assert(\n bounds !== undefined,\n `Unexpected bounds cache miss for index ${index}`\n );\n\n return bounds;\n },\n set(index: number, bounds: Bounds) {\n cache.set(index, bounds);\n },\n get size() {\n return cache.size;\n }\n };\n}\n","import {\n useCallback,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties\n} from \"react\";\nimport { useIsomorphicLayoutEffect } from \"../hooks/useIsomorphicLayoutEffect\";\nimport { useResizeObserver } from \"../hooks/useResizeObserver\";\nimport { useStableCallback } from \"../hooks/useStableCallback\";\nimport type { Align } from \"../types\";\nimport { adjustScrollOffsetForRtl } from \"../utils/adjustScrollOffsetForRtl\";\nimport { getEstimatedSize as getEstimatedSizeUtil } from \"./getEstimatedSize\";\nimport { getOffsetForIndex } from \"./getOffsetForIndex\";\nimport { getStartStopIndices as getStartStopIndicesUtil } from \"./getStartStopIndices\";\nimport type { Direction, SizeFunction } from \"./types\";\nimport { useCachedBounds } from \"./useCachedBounds\";\nimport { useItemSize } from \"./useItemSize\";\n\nexport function useVirtualizer<Props extends object>({\n containerElement,\n containerStyle,\n defaultContainerSize = 0,\n direction,\n isRtl = false,\n itemCount,\n itemProps,\n itemSize: itemSizeProp,\n onResize,\n overscanCount\n}: {\n containerElement: HTMLElement | null;\n containerStyle?: CSSProperties;\n defaultContainerSize?: number;\n direction: Direction;\n isRtl?: boolean;\n itemCount: number;\n itemProps: Props;\n itemSize: number | string | SizeFunction<Props>;\n onResize:\n | ((\n size: { height: number; width: number },\n prevSize: { height: number; width: number }\n ) => void)\n | undefined;\n overscanCount: number;\n}) {\n const [indices, setIndices] = useState([0, -1]);\n\n // Guard against temporarily invalid indices that may occur when item count decreases\n // Cached bounds object will be re-created and a second render will restore things\n const [startIndex, stopIndex] = [\n Math.min(itemCount - 1, indices[0]),\n Math.min(itemCount - 1, indices[1])\n ];\n\n const { height = defaultContainerSize, width = defaultContainerSize } =\n useResizeObserver({\n defaultHeight:\n direction === \"vertical\" ? defaultContainerSize : undefined,\n defaultWidth:\n direction === \"horizontal\" ? defaultContainerSize : undefined,\n element: containerElement,\n mode: direction === \"vertical\" ? \"only-height\" : \"only-width\",\n style: containerStyle\n });\n\n const prevSizeRef = useRef<{ height: number; width: number }>({\n height: 0,\n width: 0\n });\n\n const containerSize = direction === \"vertical\" ? height : width;\n\n const itemSize = useItemSize({ containerSize, itemSize: itemSizeProp });\n\n useLayoutEffect(() => {\n if (typeof onResize === \"function\") {\n const prevSize = prevSizeRef.current;\n\n if (prevSize.height !== height || prevSize.width !== width) {\n onResize({ height, width }, { ...prevSize });\n\n prevSize.height = height;\n prevSize.width = width;\n }\n }\n }, [height, onResize, width]);\n\n const cachedBounds = useCachedBounds({\n itemCount,\n itemProps,\n itemSize\n });\n\n const getCellBounds = useCallback(\n (index: number) => cachedBounds.get(index),\n [cachedBounds]\n );\n\n const getEstimatedSize = useCallback(\n () =>\n getEstimatedSizeUtil({\n cachedBounds,\n itemCount,\n itemSize\n }),\n [cachedBounds, itemCount, itemSize]\n );\n\n const getStartStopIndices = useCallback(\n (scrollOffset: number) => {\n const containerScrollOffset = adjustScrollOffsetForRtl({\n containerElement,\n direction,\n isRtl,\n scrollOffset\n });\n\n return getStartStopIndicesUtil({\n cachedBounds,\n containerScrollOffset,\n containerSize,\n itemCount,\n overscanCount\n });\n },\n [\n cachedBounds,\n containerElement,\n containerSize,\n direction,\n isRtl,\n itemCount,\n overscanCount\n ]\n );\n\n useIsomorphicLayoutEffect(() => {\n const scrollOffset =\n (direction === \"vertical\"\n ? containerElement?.scrollTop\n : containerElement?.scrollLeft) ?? 0;\n\n setIndices(getStartStopIndices(scrollOffset));\n }, [containerElement, direction, getStartStopIndices]);\n\n useIsomorphicLayoutEffect(() => {\n if (!containerElement) {\n return;\n }\n\n const onScroll = () => {\n setIndices((prev) => {\n const { scrollLeft, scrollTop } = containerElement;\n\n const scrollOffset = adjustScrollOffsetForRtl({\n containerElement,\n direction,\n isRtl,\n scrollOffset: direction === \"vertical\" ? scrollTop : scrollLeft\n });\n\n const next = getStartStopIndicesUtil({\n cachedBounds,\n containerScrollOffset: scrollOffset,\n containerSize,\n itemCount,\n overscanCount\n });\n\n if (next[0] === prev[0] && next[1] === prev[1]) {\n return prev;\n }\n\n return next;\n });\n };\n\n containerElement.addEventListener(\"scroll\", onScroll);\n\n return () => {\n containerElement.removeEventListener(\"scroll\", onScroll);\n };\n }, [\n cachedBounds,\n containerElement,\n containerSize,\n direction,\n itemCount,\n overscanCount\n ]);\n\n const scrollToIndex = useStableCallback(\n ({\n align = \"auto\",\n containerScrollOffset,\n index\n }: {\n align?: Align;\n containerScrollOffset: number;\n index: number;\n }) => {\n let scrollOffset = getOffsetForIndex({\n align,\n cachedBounds,\n containerScrollOffset,\n containerSize,\n index,\n itemCount,\n itemSize\n });\n\n if (containerElement) {\n scrollOffset = adjustScrollOffsetForRtl({\n containerElement,\n direction,\n isRtl,\n scrollOffset\n });\n\n if (typeof containerElement.scrollTo !== \"function\") {\n // Special case for environments like jsdom that don't implement scrollTo\n const next = getStartStopIndices(scrollOffset);\n if (next[0] !== startIndex || next[1] !== stopIndex) {\n setIndices(next);\n }\n }\n\n return scrollOffset;\n }\n }\n );\n\n return {\n getCellBounds,\n getEstimatedSize,\n scrollToIndex,\n startIndex,\n stopIndex\n };\n}\n","import { useMemo, useState, type CSSProperties } from \"react\";\nimport { parseNumericStyleValue } from \"../utils/parseNumericStyleValue\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\n\nexport function useResizeObserver({\n box,\n defaultHeight,\n defaultWidth,\n disabled: disabledProp,\n element,\n mode,\n style\n}: {\n box?: ResizeObserverBoxOptions;\n defaultHeight?: number;\n defaultWidth?: number;\n disabled?: boolean;\n element: HTMLElement | null;\n mode?: \"only-height\" | \"only-width\";\n style?: CSSProperties;\n}) {\n const { styleHeight, styleWidth } = useMemo(\n () => ({\n styleHeight: parseNumericStyleValue(style?.height),\n styleWidth: parseNumericStyleValue(style?.width)\n }),\n [style?.height, style?.width]\n );\n\n const [state, setState] = useState<{\n height: number | undefined;\n width: number | undefined;\n }>({\n height: defaultHeight,\n width: defaultWidth\n });\n\n const disabled =\n disabledProp ||\n (mode === \"only-height\" && styleHeight !== undefined) ||\n (mode === \"only-width\" && styleWidth !== undefined) ||\n (styleHeight !== undefined && styleWidth !== undefined);\n\n useIsomorphicLayoutEffect(() => {\n if (element === null || disabled) {\n return;\n }\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { contentRect, target } = entry;\n if (element === target) {\n setState((prevState) => {\n if (\n prevState.height === contentRect.height &&\n prevState.width === contentRect.width\n ) {\n return prevState;\n }\n\n return {\n height: contentRect.height,\n width: contentRect.width\n };\n });\n }\n }\n });\n resizeObserver.observe(element, { box });\n\n return () => {\n resizeObserver?.unobserve(element);\n };\n }, [box, disabled, element, styleHeight, styleWidth]);\n\n return useMemo(\n () => ({\n height: styleHeight ?? state.height,\n width: styleWidth ?? state.width\n }),\n [state, styleHeight, styleWidth]\n );\n}\n","import { assert } from \"../utils/assert\";\nimport type { SizeFunction } from \"./types\";\n\nexport function useItemSize<Props extends object>({\n containerSize,\n itemSize: itemSizeProp\n}: {\n containerSize: number;\n itemSize: number | string | SizeFunction<Props>;\n}) {\n let itemSize: number | SizeFunction<Props>;\n switch (typeof itemSizeProp) {\n case \"string\": {\n assert(\n itemSizeProp.endsWith(\"%\"),\n `Invalid item size: \"${itemSizeProp}\"; string values must be percentages (e.g. \"100%\")`\n );\n assert(\n containerSize !== undefined,\n \"Container size must be defined if a percentage item size is specified\"\n );\n\n itemSize = (containerSize * parseInt(itemSizeProp)) / 100;\n break;\n }\n default: {\n itemSize = itemSizeProp;\n break;\n }\n }\n\n return itemSize;\n}\n","import { useCallback, useRef } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\n\n// Forked from useEventCallback (usehooks-ts)\nexport function useStableCallback<Args, Return>(\n fn: (args: Args) => Return\n): (args: Args) => Return {\n const ref = useRef<typeof fn>(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n\n return useCallback((args: Args) => ref.current?.(args), [ref]) as (\n args: Args\n ) => Return;\n}\n","import type { Align } from \"../types\";\nimport { getEstimatedSize } from \"./getEstimatedSize\";\nimport type { CachedBounds, SizeFunction } from \"./types\";\n\nexport function getOffsetForIndex<Props extends object>({\n align,\n cachedBounds,\n index,\n itemCount,\n itemSize,\n containerScrollOffset,\n containerSize\n}: {\n align: Align;\n cachedBounds: CachedBounds;\n index: number;\n itemCount: number;\n itemSize: number | SizeFunction<Props>;\n containerScrollOffset: number;\n containerSize: number;\n}) {\n const estimatedTotalSize = getEstimatedSize({\n cachedBounds,\n itemCount,\n itemSize\n });\n\n const bounds = cachedBounds.get(index);\n const maxOffset = Math.max(\n 0,\n Math.min(estimatedTotalSize - containerSize, bounds.scrollOffset)\n );\n const minOffset = Math.max(\n 0,\n bounds.scrollOffset - containerSize + bounds.size\n );\n\n if (align === \"smart\") {\n if (\n containerScrollOffset >= minOffset &&\n containerScrollOffset <= maxOffset\n ) {\n align = \"auto\";\n } else {\n align = \"center\";\n }\n }\n\n switch (align) {\n case \"start\": {\n return maxOffset;\n }\n case \"end\": {\n return minOffset;\n }\n case \"center\": {\n if (bounds.scrollOffset <= containerSize / 2) {\n // Too near the beginning to center-align\n return 0;\n } else if (\n bounds.scrollOffset + bounds.size / 2 >=\n estimatedTotalSize - containerSize / 2\n ) {\n // Too near the end to center-align\n return estimatedTotalSize - containerSize;\n } else {\n return bounds.scrollOffset + bounds.size / 2 - containerSize / 2;\n }\n }\n case \"auto\":\n default: {\n if (\n containerScrollOffset >= minOffset &&\n containerScrollOffset <= maxOffset\n ) {\n return containerScrollOffset;\n } else if (containerScrollOffset < minOffset) {\n return minOffset;\n } else {\n return maxOffset;\n }\n }\n }\n}\n","import { useMemo } from \"react\";\n\nexport function useMemoizedObject<Type extends object>(\n unstableObject: Type\n): Type {\n return useMemo(() => {\n return unstableObject;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, Object.values(unstableObject));\n}\n","import { assert } from \"./assert\";\n\nexport function shallowCompare<Type extends object>(\n a: Type | undefined,\n b: Type | undefined\n) {\n if (a === b) {\n return true;\n }\n\n if (!!a !== !!b) {\n return false;\n }\n\n assert(a !== undefined);\n assert(b !== undefined);\n\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (const key in a) {\n if (!Object.is(b[key], a[key])) {\n return false;\n }\n }\n\n return true;\n}\n","import type { CSSProperties } from \"react\";\nimport { shallowCompare } from \"./shallowCompare\";\n\n// Custom comparison function for React.memo()\n// It knows to compare individual style props and ignore the wrapper object.\n// See https://react.dev/reference/react/memo#memo\nexport function arePropsEqual(\n prevProps: { ariaAttributes: object; style: CSSProperties },\n nextProps: { ariaAttributes: object; style: CSSProperties }\n): boolean {\n const {\n ariaAttributes: prevAriaAttributes,\n style: prevStyle,\n ...prevRest\n } = prevProps;\n const {\n ariaAttributes: nextAriaAttributes,\n style: nextStyle,\n ...nextRest\n } = nextProps;\n\n return (\n shallowCompare(prevAriaAttributes, nextAriaAttributes) &&\n shallowCompare(prevStyle, nextStyle) &&\n shallowCompare(prevRest, nextRest)\n );\n}\n"],"names":["Block","children","className","rest","ErrorBoundary","jsx","parseNumericStyleValue","value","endsWith","parseFloat","cachedRTLResult","adjustScrollOffsetForRtl","containerElement","direction","isRtl","scrollOffset","recalculate","outerDiv","document","createElement","outerStyle","style","width","height","overflow","innerDiv","innerStyle","appendChild","body","scrollLeft","removeChild","getRTLOffsetType","clientWidth","scrollWidth","assert","expectedCondition","message","console","error","Error","getEstimatedSize","cachedBounds","itemCount","itemSize","bounds","get","size","getStartStopIndices","containerScrollOffset","containerSize","overscanCount","maxIndex","startIndex","stopIndex","currentIndex","Math","max","min","useCachedBounds","itemProps","useMemo","cache","Map","index","set","previousRowBounds","createCachedBounds","useVirtualizer","containerStyle","defaultContainerSize","itemSizeProp","onResize","indices","setIndices","useState","box","defaultHeight","defaultWidth","disabled","disabledProp","element","mode","styleHeight","styleWidth","state","setState","useIsomorphicLayoutEffect","resizeObserver","ResizeObserver","entries","entry","contentRect","target","prevState","observe","unobserve","useResizeObserver","prevSizeRef","useRef","parseInt","useItemSize","useLayoutEffect","prevSize","current","getCellBounds","useCallback","getEstimatedSizeUtil","getStartStopIndicesUtil","scrollTop","onScroll","prev","next","addEventListener","removeEventListener","scrollToIndex","fn","ref","args","useStableCallback","align","estimatedTotalSize","maxOffset","minOffset","getOffsetForIndex","scrollTo","useMemoizedObject","unstableObject","Object","values","shallowCompare","a","b","keys","length","key","is","arePropsEqual","prevProps","nextProps","ariaAttributes","prevAriaAttributes","prevStyle","prevRest","nextAriaAttributes","nextStyle","nextRest"],"mappings":"6DAGO,SAASA,GAAMC,SACpBA,EAAAC,UACAA,KACGC,IAEH,aACGC,EAAA,CACCH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