@fluentui/react-virtualizer 9.0.0-alpha.11 → 9.0.0-alpha.110

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.
Files changed (196) hide show
  1. package/CHANGELOG.md +1036 -11
  2. package/README.md +2 -0
  3. package/dist/index.d.ts +417 -34
  4. package/lib/Hooks.js +1 -2
  5. package/lib/Hooks.js.map +1 -1
  6. package/lib/Utilities.js +1 -0
  7. package/lib/Utilities.js.map +1 -0
  8. package/lib/Virtualizer.js +1 -2
  9. package/lib/Virtualizer.js.map +1 -1
  10. package/lib/VirtualizerScrollView.js +1 -0
  11. package/lib/VirtualizerScrollView.js.map +1 -0
  12. package/lib/VirtualizerScrollViewDynamic.js +1 -0
  13. package/lib/VirtualizerScrollViewDynamic.js.map +1 -0
  14. package/lib/components/Virtualizer/Virtualizer.js +10 -7
  15. package/lib/components/Virtualizer/Virtualizer.js.map +1 -1
  16. package/lib/components/Virtualizer/Virtualizer.types.js +1 -2
  17. package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
  18. package/lib/components/Virtualizer/index.js +4 -6
  19. package/lib/components/Virtualizer/index.js.map +1 -1
  20. package/lib/components/Virtualizer/renderVirtualizer.js +25 -16
  21. package/lib/components/Virtualizer/renderVirtualizer.js.map +1 -1
  22. package/lib/components/Virtualizer/useVirtualizer.js +529 -357
  23. package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
  24. package/lib/components/Virtualizer/{useVirtualizerStyles.js → useVirtualizerStyles.styles.js} +11 -4
  25. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -0
  26. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js +103 -0
  27. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js.map +1 -0
  28. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js +16 -0
  29. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
  30. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js +1 -0
  31. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
  32. package/lib/components/VirtualizerScrollView/index.js +4 -0
  33. package/lib/components/VirtualizerScrollView/index.js.map +1 -0
  34. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js +11 -0
  35. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
  36. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +83 -0
  37. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
  38. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +52 -0
  39. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -0
  40. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js +46 -0
  41. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js.map +1 -0
  42. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +18 -0
  43. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -0
  44. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +1 -0
  45. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -0
  46. package/lib/components/VirtualizerScrollViewDynamic/index.js +4 -0
  47. package/lib/components/VirtualizerScrollViewDynamic/index.js.map +1 -0
  48. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +11 -0
  49. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -0
  50. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +155 -0
  51. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -0
  52. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +52 -0
  53. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -0
  54. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js +46 -0
  55. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js.map +1 -0
  56. package/lib/hooks/hooks.types.js +1 -0
  57. package/lib/hooks/hooks.types.js.map +1 -0
  58. package/lib/hooks/index.js +5 -2
  59. package/lib/hooks/index.js.map +1 -1
  60. package/lib/hooks/useDynamicPagination.js +128 -0
  61. package/lib/hooks/useDynamicPagination.js.map +1 -0
  62. package/lib/hooks/useDynamicVirtualizerMeasure.js +129 -0
  63. package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -0
  64. package/lib/hooks/useIntersectionObserver.js +119 -40
  65. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  66. package/lib/hooks/useMeasureList.js +130 -0
  67. package/lib/hooks/useMeasureList.js.map +1 -0
  68. package/lib/hooks/useMutationObserver.js +40 -0
  69. package/lib/hooks/useMutationObserver.js.map +1 -0
  70. package/lib/hooks/useResizeObserverRef.js +61 -0
  71. package/lib/hooks/useResizeObserverRef.js.map +1 -0
  72. package/lib/hooks/useStaticPagination.js +104 -0
  73. package/lib/hooks/useStaticPagination.js.map +1 -0
  74. package/lib/hooks/useVirtualizerMeasure.js +64 -0
  75. package/lib/hooks/useVirtualizerMeasure.js.map +1 -0
  76. package/lib/index.js +4 -2
  77. package/lib/index.js.map +1 -1
  78. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js +32 -0
  79. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -0
  80. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js +1 -0
  81. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -0
  82. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js +45 -0
  83. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -0
  84. package/lib/utilities/ImperativeScrolling/index.js +2 -0
  85. package/lib/utilities/ImperativeScrolling/index.js.map +1 -0
  86. package/lib/utilities/VirtualizerContext/VirtualizerContext.js +33 -0
  87. package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -0
  88. package/lib/utilities/VirtualizerContext/index.js +1 -0
  89. package/lib/utilities/VirtualizerContext/index.js.map +1 -0
  90. package/lib/utilities/VirtualizerContext/types.js +1 -0
  91. package/lib/utilities/VirtualizerContext/types.js.map +1 -0
  92. package/lib/utilities/createResizeObserverFromDocument.js +14 -0
  93. package/lib/utilities/createResizeObserverFromDocument.js.map +1 -0
  94. package/lib/utilities/debounce.js +20 -0
  95. package/lib/utilities/debounce.js.map +1 -0
  96. package/lib/utilities/index.js +2 -0
  97. package/lib/utilities/index.js.map +1 -0
  98. package/lib-commonjs/Hooks.js +31 -5
  99. package/lib-commonjs/Hooks.js.map +1 -1
  100. package/lib-commonjs/Utilities.js +28 -0
  101. package/lib-commonjs/Utilities.js.map +1 -0
  102. package/lib-commonjs/Virtualizer.js +28 -5
  103. package/lib-commonjs/Virtualizer.js.map +1 -1
  104. package/lib-commonjs/VirtualizerScrollView.js +28 -0
  105. package/lib-commonjs/VirtualizerScrollView.js.map +1 -0
  106. package/lib-commonjs/VirtualizerScrollViewDynamic.js +28 -0
  107. package/lib-commonjs/VirtualizerScrollViewDynamic.js.map +1 -0
  108. package/lib-commonjs/components/Virtualizer/Virtualizer.js +20 -18
  109. package/lib-commonjs/components/Virtualizer/Virtualizer.js.map +1 -1
  110. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js +3 -3
  111. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +1 -1
  112. package/lib-commonjs/components/Virtualizer/index.js +31 -9
  113. package/lib-commonjs/components/Virtualizer/index.js.map +1 -1
  114. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js +38 -21
  115. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js.map +1 -1
  116. package/lib-commonjs/components/Virtualizer/useVirtualizer.js +535 -362
  117. package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +1 -1
  118. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js +124 -0
  119. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -0
  120. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.js +116 -0
  121. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.js.map +1 -0
  122. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js +24 -0
  123. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
  124. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js +6 -0
  125. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
  126. package/lib-commonjs/components/VirtualizerScrollView/index.js +31 -0
  127. package/lib-commonjs/components/VirtualizerScrollView/index.js.map +1 -0
  128. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js +19 -0
  129. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
  130. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js +92 -0
  131. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
  132. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +71 -0
  133. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -0
  134. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js +59 -0
  135. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js.map +1 -0
  136. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +25 -0
  137. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -0
  138. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +6 -0
  139. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -0
  140. package/lib-commonjs/components/VirtualizerScrollViewDynamic/index.js +31 -0
  141. package/lib-commonjs/components/VirtualizerScrollViewDynamic/index.js.map +1 -0
  142. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +19 -0
  143. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -0
  144. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +163 -0
  145. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -0
  146. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +71 -0
  147. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -0
  148. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js +59 -0
  149. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js.map +1 -0
  150. package/lib-commonjs/hooks/hooks.types.js +6 -0
  151. package/lib-commonjs/hooks/hooks.types.js.map +1 -0
  152. package/lib-commonjs/hooks/index.js +35 -5
  153. package/lib-commonjs/hooks/index.js.map +1 -1
  154. package/lib-commonjs/hooks/useDynamicPagination.js +132 -0
  155. package/lib-commonjs/hooks/useDynamicPagination.js.map +1 -0
  156. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js +134 -0
  157. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +1 -0
  158. package/lib-commonjs/hooks/useIntersectionObserver.js +129 -53
  159. package/lib-commonjs/hooks/useIntersectionObserver.js.map +1 -1
  160. package/lib-commonjs/hooks/useMeasureList.js +135 -0
  161. package/lib-commonjs/hooks/useMeasureList.js.map +1 -0
  162. package/lib-commonjs/hooks/useMutationObserver.js +48 -0
  163. package/lib-commonjs/hooks/useMutationObserver.js.map +1 -0
  164. package/lib-commonjs/hooks/useResizeObserverRef.js +69 -0
  165. package/lib-commonjs/hooks/useResizeObserverRef.js.map +1 -0
  166. package/lib-commonjs/hooks/useStaticPagination.js +108 -0
  167. package/lib-commonjs/hooks/useStaticPagination.js.map +1 -0
  168. package/lib-commonjs/hooks/useVirtualizerMeasure.js +70 -0
  169. package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +1 -0
  170. package/lib-commonjs/index.js +85 -41
  171. package/lib-commonjs/index.js.map +1 -1
  172. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js +42 -0
  173. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -0
  174. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js +6 -0
  175. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -0
  176. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js +55 -0
  177. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -0
  178. package/lib-commonjs/utilities/ImperativeScrolling/index.js +20 -0
  179. package/lib-commonjs/utilities/ImperativeScrolling/index.js.map +1 -0
  180. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js +49 -0
  181. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -0
  182. package/lib-commonjs/utilities/VirtualizerContext/index.js +22 -0
  183. package/lib-commonjs/utilities/VirtualizerContext/index.js.map +1 -0
  184. package/lib-commonjs/utilities/VirtualizerContext/types.js +6 -0
  185. package/lib-commonjs/utilities/VirtualizerContext/types.js.map +1 -0
  186. package/lib-commonjs/utilities/createResizeObserverFromDocument.js +24 -0
  187. package/lib-commonjs/utilities/createResizeObserverFromDocument.js.map +1 -0
  188. package/lib-commonjs/utilities/debounce.js +30 -0
  189. package/lib-commonjs/utilities/debounce.js.map +1 -0
  190. package/lib-commonjs/utilities/index.js +29 -0
  191. package/lib-commonjs/utilities/index.js.map +1 -0
  192. package/package.json +18 -28
  193. package/CHANGELOG.json +0 -170
  194. package/lib/components/Virtualizer/useVirtualizerStyles.js.map +0 -1
  195. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.js +0 -115
  196. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Virtualizer.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-virtualizer/src/components/Virtualizer/Virtualizer.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type VirtualizerSlots = {\n /**\n * The intersection observed 'before' element will detect when scrolling towards the beginning.\n */\n before: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace at the beginning of current DOM children.\n */\n beforeContainer: NonNullable<Slot<'div', 'tr'>>;\n /**\n * The intersection observed 'after' element will detect when scrolling towards the end.\n */\n after: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace after the end of current DOM children.\n */\n afterContainer: NonNullable<Slot<'div', 'tr'>>;\n};\n\nexport type VirtualizerState = ComponentState<VirtualizerSlots> & {\n /**\n * The current virtualized array of children to show in the DOM.\n */\n virtualizedChildren: React.ReactNode[];\n /**\n * The current start index for the virtualizer, all previous index's will be removed from DOM.\n */\n virtualizerStartIndex: number;\n /**\n * Current buffer height required at beginning of array.\n */\n afterBufferHeight: number;\n /**\n * Current buffer height required at end of array.\n */\n beforeBufferHeight: number;\n /**\n * The total current height of the scrollView/child content.\n */\n totalVirtualizerHeight: number;\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n */\n reversed?: boolean;\n /**\n * Tells the virtualizer how much\n */\n bufferSize: number;\n};\n\n// Virtualizer render function to procedurally generate children elements as rows or columns via index.\n// Q: Use generic typing and passing through object data or a simple index system?\nexport type VirtualizerChildRenderFunction = (index: number) => React.ReactNode;\n\nexport type VirtualizerProps = ComponentProps<Partial<VirtualizerSlots>> & {\n /**\n * Child render function.\n * Iteratively called to return current virtualizer DOM children.\n * Will act as a row or column indexer depending on Virtualizer settings.\n * Can be used dynamically.\n */\n children: VirtualizerChildRenderFunction;\n\n /**\n * Default cell size to use if no custom callback provided.\n * If implementing `getItemSize` this should be the initial and ideally minimum cell size.\n */\n itemSize: number;\n\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\n\n /**\n * Number of children to render in the DOM during virtualization.\n * Constraints:\n * - Large enough that the items rendered in DOM cover the viewport\n * and intersection observer buffers (buffersize) at both ends.\n */\n virtualizerLength: number;\n\n /**\n * Defaults to 1/4th of virtualizerLength.\n * Controls the number of elements rendered before the current index entering the virtualized viewport.\n * Constraints:\n * - Large enough to cover bufferSize (prevents buffers intersecting into the viewport during rest state).\n * - Small enough that the end buffer and end index (start index + virtualizerLength) is not within viewport at rest.\n */\n bufferItems?: number;\n\n /**\n * Defaults to half of bufferItems size (in pixels).\n * The length (in pixels) before the end/start DOM index where the virtualizer recalculation will be triggered.\n * Increasing this reduces whitespace on ultra-fast scroll, as additional elements\n * are buffered to appear while virtualization recalculates.\n * Constraints:\n * - At least 1px - although this will only trigger the recalculation after bookends (whitespace) enter viewport.\n * - BufferSize must be smaller than bufferItems pixel size, as it prevents bookends entering viewport at rest.\n */\n bufferSize?: number;\n\n /**\n * Enables users to override the intersectionObserverRoot.\n * @default null\n */\n intersectionObserverRoot?: React.MutableRefObject<HTMLElement | null>;\n\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n * This value should be flipped in RTL implementation (TBD whether automate RTL).\n */\n reversed?: boolean;\n\n /**\n * Callback for acquiring size of individual items\n * @param index - the index of the requested size's child\n */\n getItemSize?: (index: number) => number;\n\n /**\n * Notify users of index changes\n */\n onUpdateIndex?: (index: number, prevIndex: number) => void;\n\n /**\n * Allow users to intervene in index calculation changes\n */\n onCalculateIndex?: (newIndex: number) => number;\n};\n"]}
1
+ {"version":3,"sources":["../src/components/Virtualizer/Virtualizer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { VirtualizerContextProps } from '../../Utilities';\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerSlots = {\n /**\n * The intersection observed 'before' element will detect when scrolling towards the beginning.\n */\n before: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace at the beginning of current DOM children.\n */\n beforeContainer: NonNullable<Slot<'div', 'tr'>>;\n /**\n * The intersection observed 'after' element will detect when scrolling towards the end.\n */\n after: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace after the end of current DOM children.\n */\n afterContainer: NonNullable<Slot<'div', 'tr'>>;\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerConfigState = {\n /**\n * The current virtualized array of children to show in the DOM.\n */\n virtualizedChildren: React.ReactNode[];\n /**\n * The current start index for the virtualizer, all previous index's will be removed from DOM.\n */\n virtualizerStartIndex: number;\n /**\n * Current buffer height required at beginning of array.\n */\n afterBufferHeight: number;\n /**\n * Current buffer height required at end of array.\n */\n beforeBufferHeight: number;\n /**\n * The total current height of the scrollView/child content.\n */\n totalVirtualizerHeight: number;\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n */\n reversed?: boolean;\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n /**\n * Pixel size of intersection observers and how much they 'cross over' into the bufferItems index.\n * Minimum 1px.\n */\n bufferSize: number;\n /**\n * Ref for access to internal size knowledge, can be used to measure updates\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n childSizes: React.MutableRefObject<number[]>;\n /**\n * Ref for access to internal progressive size knowledge, can be used to measure updates\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n childProgressiveSizes: React.MutableRefObject<number[]>;\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerState = ComponentState<VirtualizerSlots> & VirtualizerConfigState;\n\n/**\n * The main child render method of Virtualization\n * isScrolling will only be enabled when enableScrollLoad is set to true.\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerChildRenderFunction = (index: number, isScrolling: boolean) => React.ReactNode;\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerDataRef = {\n progressiveSizes: React.RefObject<number[]>;\n nodeSizes: React.RefObject<number[]>;\n setFlaggedIndex: (index: number | null) => void;\n currentIndex: React.RefObject<number>;\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerConfigProps = {\n /**\n * Child render function.\n * Iteratively called to return current virtualizer DOM children.\n * Will act as a row or column indexer depending on Virtualizer settings.\n * Can be used dynamically.\n */\n children: VirtualizerChildRenderFunction;\n\n /**\n * Default cell size to use if no custom callback provided.\n * If implementing `getItemSize` this should be the initial and ideally minimum cell size.\n */\n itemSize: number;\n\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\n\n /**\n * Number of children to render in the DOM during virtualization.\n * Constraints:\n * - Large enough that the items rendered in DOM cover the viewport\n * and intersection observer buffers (buffersize) at both ends.\n */\n virtualizerLength: number;\n\n /**\n * Defaults to 1/4th (or 1/3rd for dynamic items) of virtualizerLength.\n * RECOMMEND: Override this with a consistent value if using a dynamic virtualizer.\n *\n * Controls the number of elements rendered before the current index entering the virtualized viewport.\n * Constraints:\n * - Large enough to cover bufferSize (prevents buffers intersecting into the viewport during rest state).\n * - Small enough that the virtualizer only renders a few items outside of view.\n */\n bufferItems?: number;\n\n /**\n * Defaults to half of bufferItems * itemSize size (in pixels).\n * RECOMMEND: Override this with a consistent minimum item size value if using a dynamic virtualizer.\n * The length (in pixels) before the end/start DOM index where the virtualizer recalculation will be triggered.\n * Increasing this reduces whitespace on ultra-fast scroll, as additional elements\n * are buffered to appear while virtualization recalculates.\n * Constraints:\n * - At least 1px - although this will only trigger the recalculation after bookends (whitespace) enter viewport.\n * - BufferSize must be smaller than bufferItems pixel size, as it prevents bookends entering viewport at rest.\n */\n bufferSize?: number;\n\n /**\n * Enables users to override the intersectionObserverRoot.\n * We recommend passing this in for accurate distance assessment in IO\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n scrollViewRef?: React.MutableRefObject<HTMLElement | null>;\n\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n * This value should be flipped in RTL implementation (TBD whether automate RTL).\n */\n reversed?: boolean;\n\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n\n /**\n * Callback for acquiring size of individual items\n * @param index - the index of the requested size's child\n */\n getItemSize?: (index: number) => number;\n\n /**\n * Virtualizer context can be passed as a prop for extended class use\n */\n virtualizerContext?: VirtualizerContextProps;\n\n /**\n * Callback for notifying when a flagged index has been rendered\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onRenderedFlaggedIndex?: (index: number) => void;\n\n /*\n * Callback for notifying when a flagged index has been rendered\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n flaggedIndex?: React.MutableRefObject<number | null>;\n\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeVirtualizerRef?: React.RefObject<VirtualizerDataRef | null>;\n\n /**\n * A ref that provides the size of container (vertical - height, horizontal - width), set by a resize observer.\n * Virtualizer Measure hooks provide a suitable reference.\n */\n containerSizeRef: React.RefObject<number>;\n\n /**\n * A callback that enables updating scroll position for calculating required dynamic lengths,\n * this should be passed in from useDynamicVirtualizerMeasure\n */\n updateScrollPosition?: (position: number) => void;\n\n /**\n * Spacing between rendered children for calculation, should match the container's gap CSS value.\n */\n gap?: number;\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerProps = ComponentProps<Partial<VirtualizerSlots>> & VirtualizerConfigProps;\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
@@ -1,6 +1,4 @@
1
- export * from './Virtualizer';
2
- export * from './Virtualizer.types';
3
- export * from './useVirtualizer';
4
- export * from './renderVirtualizer';
5
- export * from './useVirtualizerStyles';
6
- //# sourceMappingURL=index.js.map
1
+ export { Virtualizer } from './Virtualizer';
2
+ export { useVirtualizer_unstable } from './useVirtualizer';
3
+ export { renderVirtualizerChildPlaceholder, renderVirtualizer_unstable } from './renderVirtualizer';
4
+ export { useVirtualizerStyles_unstable, virtualizerClassNames } from './useVirtualizerStyles.styles';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-virtualizer/src/components/Virtualizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './Virtualizer';\nexport * from './Virtualizer.types';\nexport * from './useVirtualizer';\nexport * from './renderVirtualizer';\nexport * from './useVirtualizerStyles';\n"]}
1
+ {"version":3,"sources":["../src/components/Virtualizer/index.ts"],"sourcesContent":["export { Virtualizer } from './Virtualizer';\nexport type {\n VirtualizerChildRenderFunction,\n VirtualizerConfigProps,\n VirtualizerConfigState,\n VirtualizerDataRef,\n VirtualizerProps,\n VirtualizerSlots,\n VirtualizerState,\n} from './Virtualizer.types';\nexport { useVirtualizer_unstable } from './useVirtualizer';\nexport { renderVirtualizerChildPlaceholder, renderVirtualizer_unstable } from './renderVirtualizer';\nexport { useVirtualizerStyles_unstable, virtualizerClassNames } from './useVirtualizerStyles.styles';\n"],"names":["Virtualizer","useVirtualizer_unstable","renderVirtualizerChildPlaceholder","renderVirtualizer_unstable","useVirtualizerStyles_unstable","virtualizerClassNames"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAU5C,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,iCAAiC,EAAEC,0BAA0B,QAAQ,sBAAsB;AACpG,SAASC,6BAA6B,EAAEC,qBAAqB,QAAQ,gCAAgC"}
@@ -1,18 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
1
2
  import * as React from 'react';
2
- import { getSlots } from '@fluentui/react-utilities';
3
- export const renderVirtualizer_unstable = state => {
4
- const {
5
- slots,
6
- slotProps
7
- } = getSlots(state);
8
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(slots.beforeContainer, {
9
- ...slotProps.beforeContainer
10
- }, /*#__PURE__*/React.createElement(slots.before, {
11
- ...slotProps.before
12
- })), state.virtualizedChildren, /*#__PURE__*/React.createElement(slots.afterContainer, {
13
- ...slotProps.afterContainer
14
- }, /*#__PURE__*/React.createElement(slots.after, {
15
- ...slotProps.after
16
- })));
3
+ import { assertSlots } from '@fluentui/react-utilities';
4
+ /**
5
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
6
+ */ export const renderVirtualizer_unstable = (state)=>{
7
+ assertSlots(state);
8
+ return /*#__PURE__*/ _jsxs(React.Fragment, {
9
+ children: [
10
+ /*#__PURE__*/ _jsx(state.beforeContainer, {
11
+ children: /*#__PURE__*/ _jsx(state.before, {})
12
+ }),
13
+ state.virtualizedChildren,
14
+ /*#__PURE__*/ _jsx(state.afterContainer, {
15
+ children: /*#__PURE__*/ _jsx(state.after, {})
16
+ })
17
+ ]
18
+ });
19
+ };
20
+ /**
21
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
22
+ */ export const renderVirtualizerChildPlaceholder = (child, index)=>{
23
+ return /*#__PURE__*/ _jsx(React.Suspense, {
24
+ fallback: null,
25
+ children: child
26
+ }, `fui-virtualizer-placeholder-${index}`);
17
27
  };
18
- //# sourceMappingURL=renderVirtualizer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderVirtualizer_unstable","state","slots","slotProps","createElement","Fragment","beforeContainer","before","virtualizedChildren","afterContainer","after"],"sources":["../src/packages/react-components/react-virtualizer/src/components/Virtualizer/renderVirtualizer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\n\nexport const renderVirtualizer_unstable = (state: VirtualizerState) => {\n const { slots, slotProps } = getSlots<VirtualizerSlots>(state);\n\n return (\n <React.Fragment>\n {/* The 'before' bookend to hold items in place and detect scroll previous */}\n <slots.beforeContainer {...slotProps.beforeContainer}>\n <slots.before {...slotProps.before} />\n </slots.beforeContainer>\n {/* The reduced list of non-virtualized children to be rendered */}\n {state.virtualizedChildren}\n {/* The 'after' bookend to hold items in place and detect scroll next */}\n <slots.afterContainer {...slotProps.afterContainer}>\n <slots.after {...slotProps.after} />\n </slots.afterContainer>\n </React.Fragment>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAmBE,KAAK,CAAC;EAE9D,oBACEH,KAAA,CAAAM,aAAA,CAACN,KAAK,CAACO,QAAQ,qBAEbP,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,eAAe;IAAA,GAAKH,SAAS,CAACG;EAAe,gBAClDR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,MAAM;IAAA,GAAKJ,SAAS,CAACI;EAAM,EAAI,CAChB,EAEvBN,KAAK,CAACO,mBAAmB,eAE1BV,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACO,cAAc;IAAA,GAAKN,SAAS,CAACM;EAAc,gBAChDX,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACQ,KAAK;IAAA,GAAKP,SAAS,CAACO;EAAK,EAAI,CACf,CACR;AAErB,CAAC"}
1
+ {"version":3,"sources":["../src/components/Virtualizer/renderVirtualizer.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport type { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\n\nimport { assertSlots } from '@fluentui/react-utilities';\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const renderVirtualizer_unstable = (state: VirtualizerState): React.ReactElement => {\n assertSlots<VirtualizerSlots>(state);\n return (\n <React.Fragment>\n {/* The 'before' bookend to hold items in place and detect scroll previous */}\n <state.beforeContainer>\n <state.before />\n </state.beforeContainer>\n {/* The reduced list of non-virtualized children to be rendered */}\n {state.virtualizedChildren}\n {/* The 'after' bookend to hold items in place and detect scroll next */}\n <state.afterContainer>\n <state.after />\n </state.afterContainer>\n </React.Fragment>\n );\n};\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const renderVirtualizerChildPlaceholder = (child: React.ReactNode, index: number): React.ReactElement => {\n return (\n <React.Suspense key={`fui-virtualizer-placeholder-${index}`} fallback={null}>\n {child}\n </React.Suspense>\n );\n};\n"],"names":["React","assertSlots","renderVirtualizer_unstable","state","Fragment","beforeContainer","before","virtualizedChildren","afterContainer","after","renderVirtualizerChildPlaceholder","child","index","Suspense","fallback"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,YAAYA,WAAW,QAAQ;AAG/B,SAASC,WAAW,QAAQ,4BAA4B;AAExD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAC9B,qBACE,MAACH,MAAMI,QAAQ;;0BAEb,KAACD,MAAME,eAAe;0BACpB,cAAA,KAACF,MAAMG,MAAM;;YAGdH,MAAMI,mBAAmB;0BAE1B,KAACJ,MAAMK,cAAc;0BACnB,cAAA,KAACL,MAAMM,KAAK;;;;AAIpB,EAAE;AACF;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC,OAAwBC;IACxE,qBACE,KAACZ,MAAMa,QAAQ;QAA8CC,UAAU;kBACpEH;OADkB,CAAC,4BAA4B,EAAEC,OAAO;AAI/D,EAAE"}