@fluentui/react-virtualizer 9.0.0-alpha.99 → 9.74.3-experimental.esm.20260709-49ee7a20cf.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.
Files changed (228) hide show
  1. package/CHANGELOG.md +171 -2
  2. package/README.md +2 -0
  3. package/dist/index.d.cts +556 -0
  4. package/dist/index.d.ts +101 -11
  5. package/lib/Hooks.js +1 -1
  6. package/lib/Hooks.js.map +1 -1
  7. package/lib/Utilities.js +1 -1
  8. package/lib/Utilities.js.map +1 -1
  9. package/lib/Virtualizer.js +1 -1
  10. package/lib/Virtualizer.js.map +1 -1
  11. package/lib/VirtualizerScrollView.js +1 -1
  12. package/lib/VirtualizerScrollView.js.map +1 -1
  13. package/lib/VirtualizerScrollViewDynamic.js +1 -1
  14. package/lib/VirtualizerScrollViewDynamic.js.map +1 -1
  15. package/lib/components/Virtualizer/Virtualizer.js +6 -5
  16. package/lib/components/Virtualizer/Virtualizer.js.map +1 -1
  17. package/lib/components/Virtualizer/Virtualizer.types.js +3 -1
  18. package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
  19. package/lib/components/Virtualizer/index.js +4 -4
  20. package/lib/components/Virtualizer/index.js.map +1 -1
  21. package/lib/components/Virtualizer/renderVirtualizer.js +8 -4
  22. package/lib/components/Virtualizer/renderVirtualizer.js.map +1 -1
  23. package/lib/components/Virtualizer/useVirtualizer.js +24 -11
  24. package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
  25. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js +15 -3
  26. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -1
  27. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js +110 -0
  28. package/lib/components/Virtualizer/useVirtualizerStyles.styles.raw.js.map +1 -0
  29. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js +6 -5
  30. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -1
  31. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js +3 -1
  32. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -1
  33. package/lib/components/VirtualizerScrollView/index.js +4 -4
  34. package/lib/components/VirtualizerScrollView/index.js.map +1 -1
  35. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js +5 -3
  36. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -1
  37. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +12 -8
  38. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
  39. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +9 -4
  40. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -1
  41. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js +46 -0
  42. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.js.map +1 -0
  43. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +9 -6
  44. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -1
  45. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +1 -1
  46. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
  47. package/lib/components/VirtualizerScrollViewDynamic/index.js +4 -4
  48. package/lib/components/VirtualizerScrollViewDynamic/index.js.map +1 -1
  49. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +5 -3
  50. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -1
  51. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +18 -11
  52. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
  53. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +9 -4
  54. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -1
  55. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js +46 -0
  56. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.js.map +1 -0
  57. package/lib/hooks/hooks.types.js +5 -1
  58. package/lib/hooks/hooks.types.js.map +1 -1
  59. package/lib/hooks/index.js +5 -5
  60. package/lib/hooks/index.js.map +1 -1
  61. package/lib/hooks/useDynamicPagination.js +7 -4
  62. package/lib/hooks/useDynamicPagination.js.map +1 -1
  63. package/lib/hooks/useDynamicVirtualizerMeasure.js +6 -5
  64. package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
  65. package/lib/hooks/useIntersectionObserver.js +10 -7
  66. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  67. package/lib/hooks/useMeasureList.js +6 -2
  68. package/lib/hooks/useMeasureList.js.map +1 -1
  69. package/lib/hooks/useMutationObserver.js +8 -6
  70. package/lib/hooks/useMutationObserver.js.map +1 -1
  71. package/lib/hooks/useResizeObserverRef.js +8 -6
  72. package/lib/hooks/useResizeObserverRef.js.map +1 -1
  73. package/lib/hooks/useStaticPagination.js +8 -5
  74. package/lib/hooks/useStaticPagination.js.map +1 -1
  75. package/lib/hooks/useVirtualizerMeasure.js +5 -4
  76. package/lib/hooks/useVirtualizerMeasure.js.map +1 -1
  77. package/lib/index.js +5 -5
  78. package/lib/index.js.map +1 -1
  79. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -1
  80. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js +1 -1
  81. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -1
  82. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -1
  83. package/lib/utilities/ImperativeScrolling/index.js +2 -2
  84. package/lib/utilities/ImperativeScrolling/index.js.map +1 -1
  85. package/lib/utilities/VirtualizerContext/VirtualizerContext.js +11 -4
  86. package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
  87. package/lib/utilities/VirtualizerContext/index.js +1 -1
  88. package/lib/utilities/VirtualizerContext/index.js.map +1 -1
  89. package/lib/utilities/VirtualizerContext/types.js +4 -1
  90. package/lib/utilities/VirtualizerContext/types.js.map +1 -1
  91. package/lib/utilities/createResizeObserverFromDocument.js +1 -0
  92. package/lib/utilities/createResizeObserverFromDocument.js.map +1 -1
  93. package/lib/utilities/debounce.js +1 -0
  94. package/lib/utilities/debounce.js.map +1 -1
  95. package/lib/utilities/index.js +2 -2
  96. package/lib/utilities/index.js.map +1 -1
  97. package/lib-commonjs/{Hooks.js → Hooks.cjs} +1 -1
  98. package/lib-commonjs/{Hooks.js.map → Hooks.cjs.map} +1 -1
  99. package/lib-commonjs/{Utilities.js → Utilities.cjs} +1 -1
  100. package/lib-commonjs/{Utilities.js.map → Utilities.cjs.map} +1 -1
  101. package/lib-commonjs/{Virtualizer.js → Virtualizer.cjs} +1 -1
  102. package/lib-commonjs/{Virtualizer.js.map → Virtualizer.cjs.map} +1 -1
  103. package/lib-commonjs/{VirtualizerScrollView.js → VirtualizerScrollView.cjs} +1 -1
  104. package/lib-commonjs/{VirtualizerScrollView.js.map → VirtualizerScrollView.cjs.map} +1 -1
  105. package/lib-commonjs/{VirtualizerScrollViewDynamic.js → VirtualizerScrollViewDynamic.cjs} +1 -1
  106. package/lib-commonjs/{VirtualizerScrollViewDynamic.js.map → VirtualizerScrollViewDynamic.cjs.map} +1 -1
  107. package/lib-commonjs/components/Virtualizer/{Virtualizer.js → Virtualizer.cjs} +4 -5
  108. package/lib-commonjs/components/Virtualizer/Virtualizer.cjs.map +1 -0
  109. package/lib-commonjs/components/Virtualizer/Virtualizer.types.cjs +6 -0
  110. package/lib-commonjs/components/Virtualizer/Virtualizer.types.cjs.map +1 -0
  111. package/lib-commonjs/components/Virtualizer/{index.js → index.cjs} +4 -4
  112. package/lib-commonjs/components/Virtualizer/{index.js.map → index.cjs.map} +1 -1
  113. package/lib-commonjs/components/Virtualizer/renderVirtualizer.cjs.map +1 -0
  114. package/lib-commonjs/components/Virtualizer/{useVirtualizer.js → useVirtualizer.cjs} +19 -8
  115. package/lib-commonjs/components/Virtualizer/useVirtualizer.cjs.map +1 -0
  116. package/lib-commonjs/components/Virtualizer/{useVirtualizerStyles.styles.js → useVirtualizerStyles.styles.cjs} +9 -1
  117. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.cjs.map +1 -0
  118. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.cjs +123 -0
  119. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.raw.cjs.map +1 -0
  120. package/lib-commonjs/components/VirtualizerScrollView/{VirtualizerScrollView.js → VirtualizerScrollView.cjs} +4 -5
  121. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.cjs.map +1 -0
  122. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.cjs +6 -0
  123. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.cjs.map +1 -0
  124. package/lib-commonjs/components/VirtualizerScrollView/{index.js → index.cjs} +4 -4
  125. package/lib-commonjs/components/VirtualizerScrollView/{index.js.map → index.cjs.map} +1 -1
  126. package/lib-commonjs/components/VirtualizerScrollView/{renderVirtualizerScrollView.js → renderVirtualizerScrollView.cjs} +1 -1
  127. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.cjs.map +1 -0
  128. package/lib-commonjs/components/VirtualizerScrollView/{useVirtualizerScrollView.js → useVirtualizerScrollView.cjs} +7 -5
  129. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.cjs.map +1 -0
  130. package/lib-commonjs/components/VirtualizerScrollView/{useVirtualizerScrollViewStyles.styles.js → useVirtualizerScrollViewStyles.styles.cjs} +3 -2
  131. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.cjs.map +1 -0
  132. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.cjs +59 -0
  133. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.raw.cjs.map +1 -0
  134. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{VirtualizerScrollViewDynamic.js → VirtualizerScrollViewDynamic.cjs} +6 -6
  135. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.cjs.map +1 -0
  136. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.cjs +4 -0
  137. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.cjs.map +1 -0
  138. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{index.js → index.cjs} +4 -4
  139. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{index.js.map → index.cjs.map} +1 -1
  140. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{renderVirtualizerScrollViewDynamic.js → renderVirtualizerScrollViewDynamic.cjs} +1 -1
  141. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.cjs.map +1 -0
  142. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{useVirtualizerScrollViewDynamic.js → useVirtualizerScrollViewDynamic.cjs} +11 -7
  143. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.cjs.map +1 -0
  144. package/lib-commonjs/components/VirtualizerScrollViewDynamic/{useVirtualizerScrollViewDynamicStyles.styles.js → useVirtualizerScrollViewDynamicStyles.styles.cjs} +3 -2
  145. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.cjs.map +1 -0
  146. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.cjs +59 -0
  147. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.raw.cjs.map +1 -0
  148. package/lib-commonjs/hooks/hooks.types.cjs +8 -0
  149. package/lib-commonjs/hooks/hooks.types.cjs.map +1 -0
  150. package/lib-commonjs/hooks/{index.js → index.cjs} +5 -5
  151. package/lib-commonjs/hooks/{index.js.map → index.cjs.map} +1 -1
  152. package/lib-commonjs/hooks/{useDynamicPagination.js → useDynamicPagination.cjs} +4 -2
  153. package/lib-commonjs/hooks/useDynamicPagination.cjs.map +1 -0
  154. package/lib-commonjs/hooks/{useDynamicVirtualizerMeasure.js → useDynamicVirtualizerMeasure.cjs} +3 -3
  155. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.cjs.map +1 -0
  156. package/lib-commonjs/hooks/{useIntersectionObserver.js → useIntersectionObserver.cjs} +5 -4
  157. package/lib-commonjs/hooks/useIntersectionObserver.cjs.map +1 -0
  158. package/lib-commonjs/hooks/{useMeasureList.js → useMeasureList.cjs} +2 -0
  159. package/lib-commonjs/hooks/useMeasureList.cjs.map +1 -0
  160. package/lib-commonjs/hooks/{useMutationObserver.js → useMutationObserver.cjs} +3 -3
  161. package/lib-commonjs/hooks/useMutationObserver.cjs.map +1 -0
  162. package/lib-commonjs/hooks/{useResizeObserverRef.js → useResizeObserverRef.cjs} +5 -4
  163. package/lib-commonjs/hooks/useResizeObserverRef.cjs.map +1 -0
  164. package/lib-commonjs/hooks/{useStaticPagination.js → useStaticPagination.cjs} +4 -2
  165. package/lib-commonjs/hooks/useStaticPagination.cjs.map +1 -0
  166. package/lib-commonjs/hooks/{useVirtualizerMeasure.js → useVirtualizerMeasure.cjs} +3 -3
  167. package/lib-commonjs/hooks/useVirtualizerMeasure.cjs.map +1 -0
  168. package/lib-commonjs/{index.js → index.cjs} +5 -5
  169. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  170. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.cjs.map +1 -0
  171. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.cjs +4 -0
  172. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.cjs.map +1 -0
  173. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.cjs.map +1 -0
  174. package/lib-commonjs/utilities/ImperativeScrolling/{index.js → index.cjs} +2 -2
  175. package/lib-commonjs/utilities/ImperativeScrolling/{index.js.map → index.cjs.map} +1 -1
  176. package/lib-commonjs/utilities/VirtualizerContext/{VirtualizerContext.js → VirtualizerContext.cjs} +1 -0
  177. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.cjs.map +1 -0
  178. package/lib-commonjs/utilities/VirtualizerContext/{index.js → index.cjs} +1 -1
  179. package/lib-commonjs/utilities/VirtualizerContext/{index.js.map → index.cjs.map} +1 -1
  180. package/lib-commonjs/utilities/VirtualizerContext/types.cjs +7 -0
  181. package/lib-commonjs/utilities/VirtualizerContext/types.cjs.map +1 -0
  182. package/lib-commonjs/utilities/{createResizeObserverFromDocument.js → createResizeObserverFromDocument.cjs} +1 -0
  183. package/lib-commonjs/utilities/createResizeObserverFromDocument.cjs.map +1 -0
  184. package/lib-commonjs/utilities/{debounce.js → debounce.cjs} +1 -0
  185. package/lib-commonjs/utilities/debounce.cjs.map +1 -0
  186. package/lib-commonjs/utilities/{index.js → index.cjs} +7 -7
  187. package/lib-commonjs/utilities/{index.js.map → index.cjs.map} +1 -1
  188. package/package.json +22 -28
  189. package/lib-commonjs/components/Virtualizer/Virtualizer.js.map +0 -1
  190. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js +0 -6
  191. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +0 -1
  192. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js.map +0 -1
  193. package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +0 -1
  194. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js.map +0 -1
  195. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +0 -1
  196. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js +0 -6
  197. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +0 -1
  198. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +0 -1
  199. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +0 -1
  200. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +0 -1
  201. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +0 -1
  202. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +0 -6
  203. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +0 -1
  204. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +0 -1
  205. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +0 -1
  206. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +0 -1
  207. package/lib-commonjs/hooks/hooks.types.js +0 -6
  208. package/lib-commonjs/hooks/hooks.types.js.map +0 -1
  209. package/lib-commonjs/hooks/useDynamicPagination.js.map +0 -1
  210. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +0 -1
  211. package/lib-commonjs/hooks/useIntersectionObserver.js.map +0 -1
  212. package/lib-commonjs/hooks/useMeasureList.js.map +0 -1
  213. package/lib-commonjs/hooks/useMutationObserver.js.map +0 -1
  214. package/lib-commonjs/hooks/useResizeObserverRef.js.map +0 -1
  215. package/lib-commonjs/hooks/useStaticPagination.js.map +0 -1
  216. package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +0 -1
  217. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js.map +0 -1
  218. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js +0 -6
  219. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +0 -1
  220. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +0 -1
  221. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +0 -1
  222. package/lib-commonjs/utilities/VirtualizerContext/types.js +0 -6
  223. package/lib-commonjs/utilities/VirtualizerContext/types.js.map +0 -1
  224. package/lib-commonjs/utilities/createResizeObserverFromDocument.js.map +0 -1
  225. package/lib-commonjs/utilities/debounce.js.map +0 -1
  226. /package/lib-commonjs/components/Virtualizer/{renderVirtualizer.js → renderVirtualizer.cjs} +0 -0
  227. /package/lib-commonjs/utilities/ImperativeScrolling/{imperativeScrolling.js → imperativeScrolling.cjs} +0 -0
  228. /package/lib-commonjs/utilities/ImperativeScrolling/{imperativeScrollingDynamic.js → imperativeScrollingDynamic.cjs} +0 -0
@@ -1,10 +1,12 @@
1
- import * as React from 'react';
2
- import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
3
- import { useVirtualizerContextState_unstable } from '../../Utilities';
4
- import { slot, useTimeout } from '@fluentui/react-utilities';
5
- import { flushSync } from 'react-dom';
6
- export function useVirtualizer_unstable(props) {
7
- 'use no memo';
1
+ 'use client';
2
+ import * as React from "react";
3
+ import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js";
4
+ import { useVirtualizerContextState_unstable } from "../../Utilities.js";
5
+ import { slot, useTimeout } from "@fluentui/react-utilities";
6
+ import { flushSync } from "react-dom";
7
+ /**
8
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
9
+ */ export function useVirtualizer_unstable(props) {
8
10
  const { itemSize, numItems, virtualizerLength, children: renderChild, getItemSize, bufferItems = Math.round(virtualizerLength / 4.0), bufferSize = Math.floor(bufferItems / 2.0) * itemSize, axis = 'vertical', reversed = false, virtualizerContext, onRenderedFlaggedIndex, imperativeVirtualizerRef, containerSizeRef, scrollViewRef, enableScrollLoad, updateScrollPosition, gap = 0 } = props;
9
11
  /* The context is optional, it's useful for injecting additional index logic, or performing uniform state updates*/ const _virtualizerContext = useVirtualizerContextState_unstable(virtualizerContext);
10
12
  // We use this ref as a constant source to access the virtualizer's state imperatively
@@ -12,7 +14,9 @@ export function useVirtualizer_unstable(props) {
12
14
  const flaggedIndex = React.useRef(null);
13
15
  const actualIndex = _virtualizerContext.contextIndex;
14
16
  // Just in case our ref gets out of date vs the context during a re-render
17
+ // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring
15
18
  if (_virtualizerContext.contextIndex !== actualIndexRef.current) {
19
+ // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring
16
20
  actualIndexRef.current = _virtualizerContext.contextIndex;
17
21
  }
18
22
  const setActualIndex = React.useCallback((index)=>{
@@ -30,6 +34,7 @@ export function useVirtualizer_unstable(props) {
30
34
  /* We keep track of the progressive sizing/placement down the list,
31
35
  this helps us skip re-calculations unless children/size changes */ const childProgressiveSizes = React.useRef(new Array(getItemSize ? numItems : 0));
32
36
  if (virtualizerContext === null || virtualizerContext === void 0 ? void 0 : virtualizerContext.childProgressiveSizes) {
37
+ // eslint-disable-next-line react-hooks/immutability, react-hooks/refs -- deprecated package, not worth refactoring
33
38
  virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;
34
39
  }
35
40
  // The internal tracking REF for child array (updates often).
@@ -45,6 +50,7 @@ export function useVirtualizer_unstable(props) {
45
50
  if (numItems !== childProgressiveSizes.current.length) {
46
51
  childProgressiveSizes.current = new Array(numItems);
47
52
  if (virtualizerContext === null || virtualizerContext === void 0 ? void 0 : virtualizerContext.childProgressiveSizes) {
53
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
48
54
  virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;
49
55
  }
50
56
  }
@@ -90,6 +96,7 @@ export function useVirtualizer_unstable(props) {
90
96
  enableScrollLoad
91
97
  ]);
92
98
  React.useEffect(()=>{
99
+ // eslint-disable-next-line react-hooks/set-state-in-effect -- deprecated package, not worth refactoring
93
100
  initializeScrollingTimer();
94
101
  }, [
95
102
  actualIndex,
@@ -172,6 +179,7 @@ export function useVirtualizer_unstable(props) {
172
179
  better to reduce checks if it's right on the boundary. */ return midpoint;
173
180
  }
174
181
  if (indexValue > scrollPos) {
182
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
175
183
  return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);
176
184
  } else {
177
185
  return findIndexRecursive(scrollPos, midpoint + 1, highIndex);
@@ -253,9 +261,10 @@ export function useVirtualizer_unstable(props) {
253
261
  virtualizerLength,
254
262
  gap
255
263
  ]);
264
+ // We store the number of items since last render, we will allow an update if the number of items changes
265
+ const previousNumItems = React.useRef(numItems);
256
266
  // Observe intersections of virtualized components
257
267
  const { setObserverList } = useIntersectionObserver(React.useCallback(// TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286
258
- // eslint-disable-next-line no-restricted-globals
259
268
  (entries, observer)=>{
260
269
  /* Sanity check - do we even need virtualization? */ if (virtualizerLength > numItems) {
261
270
  if (actualIndex !== 0) {
@@ -344,10 +353,12 @@ export function useVirtualizer_unstable(props) {
344
353
  const newStartIndex = Math.min(Math.max(startIndex, 0), maxIndex);
345
354
  flushSync(()=>{
346
355
  // Callback to allow measure functions to check virtualizer length
347
- if (newStartIndex + virtualizerLength >= numItems && actualIndex + virtualizerLength >= numItems) {
356
+ if (previousNumItems.current === numItems && newStartIndex + virtualizerLength >= numItems && actualIndex + virtualizerLength >= numItems) {
348
357
  // We've already hit the end, no need to update state.
349
358
  return;
350
359
  }
360
+ // We should ensure we update virtualizer calculations if the length changes
361
+ previousNumItems.current = virtualizerLength;
351
362
  updateScrollPosition === null || updateScrollPosition === void 0 ? void 0 : updateScrollPosition(measurementPos);
352
363
  if (actualIndex !== newStartIndex) {
353
364
  batchUpdateNewIndex(newStartIndex);
@@ -370,6 +381,7 @@ export function useVirtualizer_unstable(props) {
370
381
  getIndexFromScrollPosition,
371
382
  updateCurrentItemSizes
372
383
  ]), {
384
+ // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring
373
385
  root: scrollViewRef ? scrollViewRef === null || scrollViewRef === void 0 ? void 0 : scrollViewRef.current : null,
374
386
  rootMargin: '0px',
375
387
  threshold: 0
@@ -447,6 +459,7 @@ export function useVirtualizer_unstable(props) {
447
459
  renderChild,
448
460
  isScrolling
449
461
  ]);
462
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
450
463
  React.useEffect(()=>{
451
464
  // Ensure we repopulate if getItemSize callback changes
452
465
  populateSizeArrays();
@@ -471,7 +484,7 @@ export function useVirtualizer_unstable(props) {
471
484
  virtualizerLength
472
485
  ]);
473
486
  // Ensure we have run through and updated the whole size list array at least once.
474
- initializeSizeArray();
487
+ /* eslint-disable react-hooks/refs -- deprecated package, not worth refactoring */ initializeSizeArray();
475
488
  if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {
476
489
  // Child length mismatch, repopulate size arrays.
477
490
  populateSizeArrays();
@@ -526,4 +539,4 @@ export function useVirtualizer_unstable(props) {
526
539
  childSizes,
527
540
  childProgressiveSizes
528
541
  };
529
- }
542
+ /* eslint-enable react-hooks/refs */ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Virtualizer/useVirtualizer.ts"],"sourcesContent":["import * as React from 'react';\nimport type { VirtualizerProps, VirtualizerState } from './Virtualizer.types';\n\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { useVirtualizerContextState_unstable } from '../../Utilities';\nimport { slot, useTimeout } from '@fluentui/react-utilities';\nimport { flushSync } from 'react-dom';\n\nexport function useVirtualizer_unstable(props: VirtualizerProps): VirtualizerState {\n 'use no memo';\n\n const {\n itemSize,\n numItems,\n virtualizerLength,\n children: renderChild,\n getItemSize,\n bufferItems = Math.round(virtualizerLength / 4.0),\n bufferSize = Math.floor(bufferItems / 2.0) * itemSize,\n axis = 'vertical',\n reversed = false,\n virtualizerContext,\n onRenderedFlaggedIndex,\n imperativeVirtualizerRef,\n containerSizeRef,\n scrollViewRef,\n enableScrollLoad,\n updateScrollPosition,\n gap = 0,\n } = props;\n\n /* The context is optional, it's useful for injecting additional index logic, or performing uniform state updates*/\n const _virtualizerContext = useVirtualizerContextState_unstable(virtualizerContext);\n\n // We use this ref as a constant source to access the virtualizer's state imperatively\n const actualIndexRef = React.useRef<number>(_virtualizerContext.contextIndex);\n\n const flaggedIndex = React.useRef<number | null>(null);\n const actualIndex = _virtualizerContext.contextIndex;\n\n // Just in case our ref gets out of date vs the context during a re-render\n if (_virtualizerContext.contextIndex !== actualIndexRef.current) {\n actualIndexRef.current = _virtualizerContext.contextIndex;\n }\n const setActualIndex = React.useCallback(\n (index: number) => {\n actualIndexRef.current = index;\n _virtualizerContext.setContextIndex(index);\n },\n [_virtualizerContext],\n );\n\n // Store ref to before padding element\n const beforeElementRef = React.useRef<HTMLElement | null>(null);\n\n // Store ref to before padding element\n const afterElementRef = React.useRef<HTMLElement | null>(null);\n\n // We need to store an array to track dynamic sizes, we can use this to incrementally update changes\n const childSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n\n /* We keep track of the progressive sizing/placement down the list,\n this helps us skip re-calculations unless children/size changes */\n const childProgressiveSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n if (virtualizerContext?.childProgressiveSizes) {\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n\n // The internal tracking REF for child array (updates often).\n const childArray = React.useRef<React.ReactNode[]>(new Array(virtualizerLength));\n\n const populateSizeArrays = () => {\n if (!getItemSize) {\n // Static sizes, never mind!\n return;\n }\n\n if (numItems !== childSizes.current.length) {\n childSizes.current = new Array<number>(numItems);\n }\n\n if (numItems !== childProgressiveSizes.current.length) {\n childProgressiveSizes.current = new Array<number>(numItems);\n if (virtualizerContext?.childProgressiveSizes) {\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n }\n\n for (let index = 0; index < numItems; index++) {\n const _gap = index < numItems - 1 ? gap : 0;\n childSizes.current[index] = getItemSize(index) + _gap;\n if (index === 0) {\n childProgressiveSizes.current[index] = childSizes.current[index];\n } else {\n childProgressiveSizes.current[index] = childProgressiveSizes.current[index - 1] + childSizes.current[index];\n }\n }\n };\n\n const [isScrolling, setIsScrolling] = React.useState<boolean>(false);\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const scrollCounter = React.useRef<number>(0);\n\n const initializeScrollingTimer = React.useCallback(() => {\n if (!enableScrollLoad) {\n // Disabled by default for reduction of render callbacks\n setIsScrolling(false);\n clearScrollTimer();\n return;\n }\n /*\n * This can be considered the 'velocity' required to start 'isScrolling'\n * INIT_SCROLL_FLAG_REQ: Number of renders required to activate isScrolling\n * INIT_SCROLL_FLAG_DELAY: Amount of time (ms) before current number of renders is reset\n * - Maybe we should let users customize these in the future.\n */\n const INIT_SCROLL_FLAG_REQ = 10;\n const INIT_SCROLL_FLAG_DELAY = 100;\n\n scrollCounter.current++;\n if (scrollCounter.current >= INIT_SCROLL_FLAG_REQ) {\n setIsScrolling(true);\n }\n clearScrollTimer();\n setScrollTimer(() => {\n setIsScrolling(false);\n scrollCounter.current = 0;\n }, INIT_SCROLL_FLAG_DELAY);\n }, [clearScrollTimer, setScrollTimer, enableScrollLoad]);\n\n React.useEffect(() => {\n initializeScrollingTimer();\n }, [actualIndex, initializeScrollingTimer]);\n\n const updateChildRows = React.useCallback(\n (newIndex: number) => {\n if (numItems === 0) {\n /* Nothing to virtualize */\n return;\n }\n\n /*\n We reset the array every time to ensure children are re-rendered\n This function should only be called when update is nessecary\n */\n childArray.current = new Array(virtualizerLength);\n const _actualIndex = Math.max(newIndex, 0);\n const end = Math.min(_actualIndex + virtualizerLength, numItems);\n for (let i = _actualIndex; i < end; i++) {\n childArray.current[i - _actualIndex] = renderChild(i, isScrolling);\n }\n },\n [isScrolling, numItems, renderChild, virtualizerLength],\n );\n\n const updateCurrentItemSizes = React.useCallback(\n (newIndex: number) => {\n if (!getItemSize) {\n // Static sizes, not required.\n return;\n }\n // We should always call our size function on index change (only for the items that will be rendered)\n // This ensures we request the latest data for incoming items in case sizing has changed.\n const endIndex = Math.min(newIndex + virtualizerLength, numItems);\n const startIndex = Math.max(newIndex, 0);\n\n let didUpdate = false;\n for (let i = startIndex; i < endIndex; i++) {\n const _gap = i < numItems - 1 ? gap : 0;\n const newSize = getItemSize(i) + _gap;\n if (newSize !== childSizes.current[i]) {\n childSizes.current[i] = newSize;\n didUpdate = true;\n }\n }\n\n if (didUpdate) {\n // Update our progressive size array\n for (let i = startIndex; i < numItems; i++) {\n const prevSize = i > 0 ? childProgressiveSizes.current[i - 1] : 0;\n childProgressiveSizes.current[i] = prevSize + childSizes.current[i];\n }\n }\n },\n [getItemSize, numItems, virtualizerLength, gap],\n );\n\n const batchUpdateNewIndex = React.useCallback(\n (index: number) => {\n // Local updates\n updateChildRows(index);\n updateCurrentItemSizes(index);\n\n // State setters\n setActualIndex(index);\n },\n [setActualIndex, updateChildRows, updateCurrentItemSizes],\n );\n\n const findIndexRecursive = React.useCallback(\n (scrollPos: number, lowIndex: number, highIndex: number): number => {\n if (lowIndex > highIndex) {\n // We shouldn't get here - but no-op the index if we do.\n return actualIndex;\n }\n const midpoint = Math.floor((lowIndex + highIndex) / 2);\n const iBefore = Math.max(midpoint - 1, 0);\n const iAfter = Math.min(midpoint + 1, childProgressiveSizes.current.length - 1);\n const indexValue = childProgressiveSizes.current[midpoint];\n const afterIndexValue = childProgressiveSizes.current[iAfter];\n const beforeIndexValue = childProgressiveSizes.current[iBefore];\n if (scrollPos <= afterIndexValue && scrollPos >= beforeIndexValue) {\n /* We've found our index - if we are exactly matching before/after index that's ok,\n better to reduce checks if it's right on the boundary. */\n return midpoint;\n }\n\n if (indexValue > scrollPos) {\n return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);\n } else {\n return findIndexRecursive(scrollPos, midpoint + 1, highIndex);\n }\n },\n [actualIndex],\n );\n\n const getIndexFromSizeArray = React.useCallback(\n (scrollPos: number): number => {\n /* Quick searches our progressive height array */\n if (\n scrollPos === 0 ||\n childProgressiveSizes.current.length === 0 ||\n scrollPos <= childProgressiveSizes.current[0]\n ) {\n // Check start\n return 0;\n }\n\n if (scrollPos >= childProgressiveSizes.current[childProgressiveSizes.current.length - 1]) {\n // Check end\n return childProgressiveSizes.current.length - 1;\n }\n\n return findIndexRecursive(scrollPos, 0, childProgressiveSizes.current.length - 1);\n },\n [findIndexRecursive],\n );\n const getIndexFromScrollPosition = React.useCallback(\n (scrollPos: number) => {\n if (!getItemSize) {\n return Math.round(scrollPos / (itemSize + gap));\n }\n\n return getIndexFromSizeArray(scrollPos);\n },\n [getIndexFromSizeArray, getItemSize, itemSize, gap],\n );\n\n const calculateTotalSize = React.useCallback(() => {\n if (!getItemSize) {\n return (itemSize + gap) * numItems;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1];\n }, [getItemSize, itemSize, numItems, gap]);\n\n const calculateBefore = React.useCallback(() => {\n const currentIndex = Math.min(actualIndex, numItems - 1);\n\n if (!getItemSize) {\n // The missing items from before virtualization starts height\n return currentIndex * (itemSize + gap);\n }\n\n if (currentIndex <= 0) {\n return 0;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[currentIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, gap]);\n\n const calculateAfter = React.useCallback(() => {\n if (numItems === 0 || actualIndex + virtualizerLength >= numItems) {\n return 0;\n }\n\n const lastItemIndex = Math.min(actualIndex + virtualizerLength, numItems);\n if (!getItemSize) {\n // The missing items from after virtualization ends height\n const remainingItems = numItems - lastItemIndex;\n return remainingItems * (itemSize + gap) - gap;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, virtualizerLength, gap]);\n\n // Observe intersections of virtualized components\n const { setObserverList } = useIntersectionObserver(\n React.useCallback(\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n /* Sanity check - do we even need virtualization? */\n if (virtualizerLength > numItems) {\n if (actualIndex !== 0) {\n batchUpdateNewIndex(0);\n }\n // No-op\n return;\n }\n\n if (entries.length === 0) {\n // No entries found, return.\n return;\n }\n // Find the latest entry that is intersecting\n const sortedEntries = entries.sort((entry1, entry2) => entry2.time - entry1.time);\n const latestEntry = sortedEntries.find(entry => {\n return entry.isIntersecting;\n });\n\n if (!latestEntry) {\n return;\n }\n\n // We have to be sure our item sizes are up to date with current indexed ref before calculation\n // Check if we still need\n updateCurrentItemSizes(actualIndexRef.current);\n\n const calculateOverBuffer = (): number => {\n /**\n * We avoid using the scroll ref scrollTop, it may be incorrect\n * as virtualization may exist within a scroll view with other elements\n * The benefit of using IO is that we can detect relative scrolls,\n * so any items can be placed around the virtualizer in the scroll view\n */\n let measurementPos = 0;\n if (latestEntry.target === afterElementRef.current) {\n // Get after buffers position\n measurementPos = calculateTotalSize() - calculateAfter();\n\n // Get exact intersection position based on overflow size (how far into IO did we scroll?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n // Add to original after position\n measurementPos += overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos -= bufferSize;\n // we hit the after buffer and detected the end of view, we need to find the start index.\n measurementPos -= containerSizeRef.current ?? 0;\n\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const hOverflowReversed = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const wOverflow = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const wOverflowReversed = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n } else if (latestEntry.target === beforeElementRef.current) {\n // Get before buffers position\n measurementPos = calculateBefore();\n\n // Get exact intersection position based on overflow size (how far into window did we scroll IO?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n\n // Minus from original before position\n measurementPos -= overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos += bufferSize;\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const hOverflowReversed = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const wOverflow = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const wOverflowReversed = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n }\n\n return measurementPos;\n };\n\n // Get exact relative 'scrollTop' via IO values\n const measurementPos = calculateOverBuffer();\n\n const maxIndex = Math.max(numItems - virtualizerLength, 0);\n\n const startIndex = getIndexFromScrollPosition(measurementPos) - bufferItems;\n\n // Safety limits\n const newStartIndex = Math.min(Math.max(startIndex, 0), maxIndex);\n flushSync(() => {\n // Callback to allow measure functions to check virtualizer length\n if (newStartIndex + virtualizerLength >= numItems && actualIndex + virtualizerLength >= numItems) {\n // We've already hit the end, no need to update state.\n return;\n }\n updateScrollPosition?.(measurementPos);\n if (actualIndex !== newStartIndex) {\n batchUpdateNewIndex(newStartIndex);\n }\n });\n },\n [\n actualIndex,\n virtualizerLength,\n axis,\n reversed,\n numItems,\n bufferSize,\n bufferItems,\n containerSizeRef,\n updateScrollPosition,\n batchUpdateNewIndex,\n calculateAfter,\n calculateBefore,\n calculateTotalSize,\n getIndexFromScrollPosition,\n updateCurrentItemSizes,\n ],\n ),\n {\n root: scrollViewRef ? scrollViewRef?.current : null,\n rootMargin: '0px',\n threshold: 0,\n },\n );\n\n const setBeforeRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || beforeElementRef.current === element) {\n return;\n }\n beforeElementRef.current = element;\n const newList = [];\n\n newList.push(beforeElementRef.current);\n\n if (afterElementRef.current) {\n newList.push(afterElementRef.current);\n }\n\n // Ensure we update array if before element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n const setAfterRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || afterElementRef.current === element) {\n return;\n }\n afterElementRef.current = element;\n const newList = [];\n\n if (beforeElementRef.current) {\n newList.push(beforeElementRef.current);\n }\n\n newList.push(afterElementRef.current);\n\n // Ensure we update array if after element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n // Initialize the size array before first render.\n const hasInitialized = React.useRef<boolean>(false);\n const initializeSizeArray = () => {\n if (hasInitialized.current === false) {\n hasInitialized.current = true;\n populateSizeArrays();\n }\n };\n\n React.useImperativeHandle(\n imperativeVirtualizerRef,\n () => {\n return {\n progressiveSizes: childProgressiveSizes,\n nodeSizes: childSizes,\n setFlaggedIndex: (index: number | null) => (flaggedIndex.current = index),\n currentIndex: actualIndexRef,\n };\n },\n [childProgressiveSizes, childSizes],\n );\n\n // Initialization on mount - update array index to 0 (ready state).\n // Only fire on mount (no deps).\n React.useEffect(() => {\n if (actualIndex < 0) {\n batchUpdateNewIndex(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /*\n * forceUpdate:\n * We only want to trigger this when child render or scroll loading changes,\n * it will force re-render all children elements\n */\n const forceUpdate = React.useReducer(() => ({}), {})[1];\n // If the user passes in an updated renderChild function - update current children\n React.useEffect(() => {\n if (actualIndex >= 0) {\n updateChildRows(actualIndex);\n forceUpdate();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [renderChild, isScrolling]);\n\n React.useEffect(() => {\n // Ensure we repopulate if getItemSize callback changes\n populateSizeArrays();\n\n // We only run this effect on getItemSize change (recalc dynamic sizes)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getItemSize, gap]);\n\n // Effect to check flag index on updates\n React.useEffect(() => {\n if (!onRenderedFlaggedIndex || flaggedIndex.current === null) {\n return;\n }\n if (actualIndex <= flaggedIndex.current && actualIndex + virtualizerLength >= flaggedIndex.current) {\n onRenderedFlaggedIndex(flaggedIndex.current);\n flaggedIndex.current = null;\n }\n }, [actualIndex, onRenderedFlaggedIndex, virtualizerLength]);\n\n // Ensure we have run through and updated the whole size list array at least once.\n initializeSizeArray();\n\n if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {\n // Child length mismatch, repopulate size arrays.\n populateSizeArrays();\n }\n\n // Ensure we recalc if virtualizer length changes\n const maxCompare = Math.min(virtualizerLength, numItems);\n if (childArray.current.length !== maxCompare && actualIndex + childArray.current.length < numItems) {\n updateChildRows(actualIndex);\n }\n\n const isFullyInitialized = hasInitialized.current && actualIndex >= 0;\n return {\n components: {\n before: 'div',\n after: 'div',\n beforeContainer: 'div',\n afterContainer: 'div',\n },\n virtualizedChildren: childArray.current,\n before: slot.always(props.before, {\n defaultProps: {\n ref: setBeforeRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n after: slot.always(props.after, {\n defaultProps: {\n ref: setAfterRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeContainer: slot.always(props.beforeContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n afterContainer: slot.always(props.afterContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeBufferHeight: isFullyInitialized ? calculateBefore() : 0,\n afterBufferHeight: isFullyInitialized ? calculateAfter() : 0,\n totalVirtualizerHeight: isFullyInitialized ? calculateTotalSize() : virtualizerLength * itemSize,\n virtualizerStartIndex: actualIndex,\n axis,\n bufferSize,\n reversed,\n childSizes,\n childProgressiveSizes,\n };\n}\n"],"names":["React","useIntersectionObserver","useVirtualizerContextState_unstable","slot","useTimeout","flushSync","useVirtualizer_unstable","props","itemSize","numItems","virtualizerLength","children","renderChild","getItemSize","bufferItems","Math","round","bufferSize","floor","axis","reversed","virtualizerContext","onRenderedFlaggedIndex","imperativeVirtualizerRef","containerSizeRef","scrollViewRef","enableScrollLoad","updateScrollPosition","gap","_virtualizerContext","actualIndexRef","useRef","contextIndex","flaggedIndex","actualIndex","current","setActualIndex","useCallback","index","setContextIndex","beforeElementRef","afterElementRef","childSizes","Array","childProgressiveSizes","childArray","populateSizeArrays","length","_gap","isScrolling","setIsScrolling","useState","setScrollTimer","clearScrollTimer","scrollCounter","initializeScrollingTimer","INIT_SCROLL_FLAG_REQ","INIT_SCROLL_FLAG_DELAY","useEffect","updateChildRows","newIndex","_actualIndex","max","end","min","i","updateCurrentItemSizes","endIndex","startIndex","didUpdate","newSize","prevSize","batchUpdateNewIndex","findIndexRecursive","scrollPos","lowIndex","highIndex","midpoint","iBefore","iAfter","indexValue","afterIndexValue","beforeIndexValue","getIndexFromSizeArray","getIndexFromScrollPosition","calculateTotalSize","calculateBefore","currentIndex","calculateAfter","lastItemIndex","remainingItems","setObserverList","entries","observer","sortedEntries","sort","entry1","entry2","time","latestEntry","find","entry","isIntersecting","calculateOverBuffer","measurementPos","target","overflowAmount","intersectionRect","height","width","hOverflow","boundingClientRect","top","hOverflowReversed","bottom","wOverflow","left","wOverflowReversed","right","widthOverflow","heightOverflow","additionalOverflow","maxIndex","newStartIndex","root","rootMargin","threshold","setBeforeRef","element","newList","push","setAfterRef","hasInitialized","initializeSizeArray","useImperativeHandle","progressiveSizes","nodeSizes","setFlaggedIndex","forceUpdate","useReducer","maxCompare","isFullyInitialized","components","before","after","beforeContainer","afterContainer","virtualizedChildren","always","defaultProps","ref","role","elementType","beforeBufferHeight","afterBufferHeight","totalVirtualizerHeight","virtualizerStartIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,uBAAuB,QAAQ,sCAAsC;AAC9E,SAASC,mCAAmC,QAAQ,kBAAkB;AACtE,SAASC,IAAI,EAAEC,UAAU,QAAQ,4BAA4B;AAC7D,SAASC,SAAS,QAAQ,YAAY;AAEtC,OAAO,SAASC,wBAAwBC,KAAuB;IAC7D;IAEA,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACRC,iBAAiB,EACjBC,UAAUC,WAAW,EACrBC,WAAW,EACXC,cAAcC,KAAKC,KAAK,CAACN,oBAAoB,IAAI,EACjDO,aAAaF,KAAKG,KAAK,CAACJ,cAAc,OAAON,QAAQ,EACrDW,OAAO,UAAU,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,EACxBC,gB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oB,MAAM;YACR;YACAC,aAAa;QACf;QACAP,iBAAiB9I,KAAKiJ,MAAM,CAAC7I,MAAM0I,eAAe,EAAE;YAClDI,cAAc;gBACZE,MAAM;YACR;YACAC,aAAa;QACf;QACAN,gBAAgB/I,KAAKiJ,MAAM,CAAC7I,MAAM2I,cAAc,EAAE;YAChDG,cAAc;gBACZE,MAAM;YACR;YACAC,aAAa;QACf;QACAC,oBAAoBZ,qBAAqBvD,oBAAoB;QAC7DoE,mBAAmBb,qBAAqBrD,mBAAmB;QAC3DmE,wBAAwBd,qBAAqBxD,uBAAuB3E,oBAAoBF;QACxFoJ,uBAAuB1H;QACvBf;QACAF;QACAG;QACAsB;QACAE;IACF;AACF"}
1
+ {"version":3,"sources":["../src/components/Virtualizer/useVirtualizer.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { VirtualizerProps, VirtualizerState } from './Virtualizer.types';\n\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { useVirtualizerContextState_unstable } from '../../Utilities';\nimport { slot, useTimeout } from '@fluentui/react-utilities';\nimport { flushSync } from 'react-dom';\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport function useVirtualizer_unstable(props: VirtualizerProps): VirtualizerState {\n const {\n itemSize,\n numItems,\n virtualizerLength,\n children: renderChild,\n getItemSize,\n bufferItems = Math.round(virtualizerLength / 4.0),\n bufferSize = Math.floor(bufferItems / 2.0) * itemSize,\n axis = 'vertical',\n reversed = false,\n virtualizerContext,\n onRenderedFlaggedIndex,\n imperativeVirtualizerRef,\n containerSizeRef,\n scrollViewRef,\n enableScrollLoad,\n updateScrollPosition,\n gap = 0,\n } = props;\n\n /* The context is optional, it's useful for injecting additional index logic, or performing uniform state updates*/\n const _virtualizerContext = useVirtualizerContextState_unstable(virtualizerContext);\n\n // We use this ref as a constant source to access the virtualizer's state imperatively\n const actualIndexRef = React.useRef<number>(_virtualizerContext.contextIndex);\n\n const flaggedIndex = React.useRef<number | null>(null);\n const actualIndex = _virtualizerContext.contextIndex;\n\n // Just in case our ref gets out of date vs the context during a re-render\n // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring\n if (_virtualizerContext.contextIndex !== actualIndexRef.current) {\n // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring\n actualIndexRef.current = _virtualizerContext.contextIndex;\n }\n const setActualIndex = React.useCallback(\n (index: number) => {\n actualIndexRef.current = index;\n _virtualizerContext.setContextIndex(index);\n },\n [_virtualizerContext],\n );\n\n // Store ref to before padding element\n const beforeElementRef = React.useRef<HTMLElement | null>(null);\n\n // Store ref to before padding element\n const afterElementRef = React.useRef<HTMLElement | null>(null);\n\n // We need to store an array to track dynamic sizes, we can use this to incrementally update changes\n const childSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n\n /* We keep track of the progressive sizing/placement down the list,\n this helps us skip re-calculations unless children/size changes */\n const childProgressiveSizes = React.useRef<number[]>(new Array<number>(getItemSize ? numItems : 0));\n if (virtualizerContext?.childProgressiveSizes) {\n // eslint-disable-next-line react-hooks/immutability, react-hooks/refs -- deprecated package, not worth refactoring\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n\n // The internal tracking REF for child array (updates often).\n const childArray = React.useRef<React.ReactNode[]>(new Array(virtualizerLength));\n\n const populateSizeArrays = () => {\n if (!getItemSize) {\n // Static sizes, never mind!\n return;\n }\n\n if (numItems !== childSizes.current.length) {\n childSizes.current = new Array<number>(numItems);\n }\n\n if (numItems !== childProgressiveSizes.current.length) {\n childProgressiveSizes.current = new Array<number>(numItems);\n if (virtualizerContext?.childProgressiveSizes) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n virtualizerContext.childProgressiveSizes.current = childProgressiveSizes.current;\n }\n }\n\n for (let index = 0; index < numItems; index++) {\n const _gap = index < numItems - 1 ? gap : 0;\n childSizes.current[index] = getItemSize(index) + _gap;\n if (index === 0) {\n childProgressiveSizes.current[index] = childSizes.current[index];\n } else {\n childProgressiveSizes.current[index] = childProgressiveSizes.current[index - 1] + childSizes.current[index];\n }\n }\n };\n\n const [isScrolling, setIsScrolling] = React.useState<boolean>(false);\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const scrollCounter = React.useRef<number>(0);\n\n const initializeScrollingTimer = React.useCallback(() => {\n if (!enableScrollLoad) {\n // Disabled by default for reduction of render callbacks\n setIsScrolling(false);\n clearScrollTimer();\n return;\n }\n /*\n * This can be considered the 'velocity' required to start 'isScrolling'\n * INIT_SCROLL_FLAG_REQ: Number of renders required to activate isScrolling\n * INIT_SCROLL_FLAG_DELAY: Amount of time (ms) before current number of renders is reset\n * - Maybe we should let users customize these in the future.\n */\n const INIT_SCROLL_FLAG_REQ = 10;\n const INIT_SCROLL_FLAG_DELAY = 100;\n\n scrollCounter.current++;\n if (scrollCounter.current >= INIT_SCROLL_FLAG_REQ) {\n setIsScrolling(true);\n }\n clearScrollTimer();\n setScrollTimer(() => {\n setIsScrolling(false);\n scrollCounter.current = 0;\n }, INIT_SCROLL_FLAG_DELAY);\n }, [clearScrollTimer, setScrollTimer, enableScrollLoad]);\n\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- deprecated package, not worth refactoring\n initializeScrollingTimer();\n }, [actualIndex, initializeScrollingTimer]);\n\n const updateChildRows = React.useCallback(\n (newIndex: number) => {\n if (numItems === 0) {\n /* Nothing to virtualize */\n return;\n }\n\n /*\n We reset the array every time to ensure children are re-rendered\n This function should only be called when update is nessecary\n */\n childArray.current = new Array(virtualizerLength);\n const _actualIndex = Math.max(newIndex, 0);\n const end = Math.min(_actualIndex + virtualizerLength, numItems);\n for (let i = _actualIndex; i < end; i++) {\n childArray.current[i - _actualIndex] = renderChild(i, isScrolling);\n }\n },\n [isScrolling, numItems, renderChild, virtualizerLength],\n );\n\n const updateCurrentItemSizes = React.useCallback(\n (newIndex: number) => {\n if (!getItemSize) {\n // Static sizes, not required.\n return;\n }\n // We should always call our size function on index change (only for the items that will be rendered)\n // This ensures we request the latest data for incoming items in case sizing has changed.\n const endIndex = Math.min(newIndex + virtualizerLength, numItems);\n const startIndex = Math.max(newIndex, 0);\n\n let didUpdate = false;\n for (let i = startIndex; i < endIndex; i++) {\n const _gap = i < numItems - 1 ? gap : 0;\n const newSize = getItemSize(i) + _gap;\n if (newSize !== childSizes.current[i]) {\n childSizes.current[i] = newSize;\n didUpdate = true;\n }\n }\n\n if (didUpdate) {\n // Update our progressive size array\n for (let i = startIndex; i < numItems; i++) {\n const prevSize = i > 0 ? childProgressiveSizes.current[i - 1] : 0;\n childProgressiveSizes.current[i] = prevSize + childSizes.current[i];\n }\n }\n },\n [getItemSize, numItems, virtualizerLength, gap],\n );\n\n const batchUpdateNewIndex = React.useCallback(\n (index: number) => {\n // Local updates\n updateChildRows(index);\n updateCurrentItemSizes(index);\n\n // State setters\n setActualIndex(index);\n },\n [setActualIndex, updateChildRows, updateCurrentItemSizes],\n );\n\n const findIndexRecursive = React.useCallback(\n (scrollPos: number, lowIndex: number, highIndex: number): number => {\n if (lowIndex > highIndex) {\n // We shouldn't get here - but no-op the index if we do.\n return actualIndex;\n }\n const midpoint = Math.floor((lowIndex + highIndex) / 2);\n const iBefore = Math.max(midpoint - 1, 0);\n const iAfter = Math.min(midpoint + 1, childProgressiveSizes.current.length - 1);\n const indexValue = childProgressiveSizes.current[midpoint];\n const afterIndexValue = childProgressiveSizes.current[iAfter];\n const beforeIndexValue = childProgressiveSizes.current[iBefore];\n if (scrollPos <= afterIndexValue && scrollPos >= beforeIndexValue) {\n /* We've found our index - if we are exactly matching before/after index that's ok,\n better to reduce checks if it's right on the boundary. */\n return midpoint;\n }\n\n if (indexValue > scrollPos) {\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);\n } else {\n return findIndexRecursive(scrollPos, midpoint + 1, highIndex);\n }\n },\n [actualIndex],\n );\n\n const getIndexFromSizeArray = React.useCallback(\n (scrollPos: number): number => {\n /* Quick searches our progressive height array */\n if (\n scrollPos === 0 ||\n childProgressiveSizes.current.length === 0 ||\n scrollPos <= childProgressiveSizes.current[0]\n ) {\n // Check start\n return 0;\n }\n\n if (scrollPos >= childProgressiveSizes.current[childProgressiveSizes.current.length - 1]) {\n // Check end\n return childProgressiveSizes.current.length - 1;\n }\n\n return findIndexRecursive(scrollPos, 0, childProgressiveSizes.current.length - 1);\n },\n [findIndexRecursive],\n );\n const getIndexFromScrollPosition = React.useCallback(\n (scrollPos: number) => {\n if (!getItemSize) {\n return Math.round(scrollPos / (itemSize + gap));\n }\n\n return getIndexFromSizeArray(scrollPos);\n },\n [getIndexFromSizeArray, getItemSize, itemSize, gap],\n );\n\n const calculateTotalSize = React.useCallback(() => {\n if (!getItemSize) {\n return (itemSize + gap) * numItems;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1];\n }, [getItemSize, itemSize, numItems, gap]);\n\n const calculateBefore = React.useCallback(() => {\n const currentIndex = Math.min(actualIndex, numItems - 1);\n\n if (!getItemSize) {\n // The missing items from before virtualization starts height\n return currentIndex * (itemSize + gap);\n }\n\n if (currentIndex <= 0) {\n return 0;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[currentIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, gap]);\n\n const calculateAfter = React.useCallback(() => {\n if (numItems === 0 || actualIndex + virtualizerLength >= numItems) {\n return 0;\n }\n\n const lastItemIndex = Math.min(actualIndex + virtualizerLength, numItems);\n if (!getItemSize) {\n // The missing items from after virtualization ends height\n const remainingItems = numItems - lastItemIndex;\n return remainingItems * (itemSize + gap) - gap;\n }\n\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex - 1];\n }, [actualIndex, getItemSize, itemSize, numItems, virtualizerLength, gap]);\n\n // We store the number of items since last render, we will allow an update if the number of items changes\n const previousNumItems = React.useRef<number>(numItems);\n // Observe intersections of virtualized components\n const { setObserverList } = useIntersectionObserver(\n React.useCallback(\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n /* Sanity check - do we even need virtualization? */\n if (virtualizerLength > numItems) {\n if (actualIndex !== 0) {\n batchUpdateNewIndex(0);\n }\n // No-op\n return;\n }\n\n if (entries.length === 0) {\n // No entries found, return.\n return;\n }\n // Find the latest entry that is intersecting\n const sortedEntries = entries.sort((entry1, entry2) => entry2.time - entry1.time);\n const latestEntry = sortedEntries.find(entry => {\n return entry.isIntersecting;\n });\n\n if (!latestEntry) {\n return;\n }\n\n // We have to be sure our item sizes are up to date with current indexed ref before calculation\n // Check if we still need\n updateCurrentItemSizes(actualIndexRef.current);\n\n const calculateOverBuffer = (): number => {\n /**\n * We avoid using the scroll ref scrollTop, it may be incorrect\n * as virtualization may exist within a scroll view with other elements\n * The benefit of using IO is that we can detect relative scrolls,\n * so any items can be placed around the virtualizer in the scroll view\n */\n let measurementPos = 0;\n if (latestEntry.target === afterElementRef.current) {\n // Get after buffers position\n measurementPos = calculateTotalSize() - calculateAfter();\n\n // Get exact intersection position based on overflow size (how far into IO did we scroll?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n // Add to original after position\n measurementPos += overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos -= bufferSize;\n // we hit the after buffer and detected the end of view, we need to find the start index.\n measurementPos -= containerSizeRef.current ?? 0;\n\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const hOverflowReversed = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const wOverflow = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const wOverflowReversed = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n } else if (latestEntry.target === beforeElementRef.current) {\n // Get before buffers position\n measurementPos = calculateBefore();\n\n // Get exact intersection position based on overflow size (how far into window did we scroll IO?)\n const overflowAmount =\n axis === 'vertical' ? latestEntry.intersectionRect.height : latestEntry.intersectionRect.width;\n\n // Minus from original before position\n measurementPos -= overflowAmount;\n // Ignore buffer size (IO offset)\n measurementPos += bufferSize;\n // Calculate how far past the window bounds we are (this will be zero if IO is within window)\n const hOverflow = latestEntry.boundingClientRect.bottom - latestEntry.intersectionRect.bottom;\n const hOverflowReversed = latestEntry.boundingClientRect.top - latestEntry.intersectionRect.top;\n const wOverflow = latestEntry.boundingClientRect.right - latestEntry.intersectionRect.right;\n const wOverflowReversed = latestEntry.boundingClientRect.left - latestEntry.intersectionRect.left;\n const widthOverflow = reversed ? wOverflowReversed : wOverflow;\n const heightOverflow = reversed ? hOverflowReversed : hOverflow;\n const additionalOverflow = axis === 'vertical' ? heightOverflow : widthOverflow;\n\n if (reversed) {\n measurementPos += additionalOverflow;\n } else {\n measurementPos -= additionalOverflow;\n }\n }\n\n return measurementPos;\n };\n\n // Get exact relative 'scrollTop' via IO values\n const measurementPos = calculateOverBuffer();\n\n const maxIndex = Math.max(numItems - virtualizerLength, 0);\n\n const startIndex = getIndexFromScrollPosition(measurementPos) - bufferItems;\n\n // Safety limits\n const newStartIndex = Math.min(Math.max(startIndex, 0), maxIndex);\n flushSync(() => {\n // Callback to allow measure functions to check virtualizer length\n if (\n previousNumItems.current === numItems &&\n newStartIndex + virtualizerLength >= numItems &&\n actualIndex + virtualizerLength >= numItems\n ) {\n // We've already hit the end, no need to update state.\n return;\n }\n // We should ensure we update virtualizer calculations if the length changes\n previousNumItems.current = virtualizerLength;\n updateScrollPosition?.(measurementPos);\n if (actualIndex !== newStartIndex) {\n batchUpdateNewIndex(newStartIndex);\n }\n });\n },\n [\n actualIndex,\n virtualizerLength,\n axis,\n reversed,\n numItems,\n bufferSize,\n bufferItems,\n containerSizeRef,\n updateScrollPosition,\n batchUpdateNewIndex,\n calculateAfter,\n calculateBefore,\n calculateTotalSize,\n getIndexFromScrollPosition,\n updateCurrentItemSizes,\n ],\n ),\n {\n // eslint-disable-next-line react-hooks/refs -- deprecated package, not worth refactoring\n root: scrollViewRef ? scrollViewRef?.current : null,\n rootMargin: '0px',\n threshold: 0,\n },\n );\n\n const setBeforeRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || beforeElementRef.current === element) {\n return;\n }\n beforeElementRef.current = element;\n const newList = [];\n\n newList.push(beforeElementRef.current);\n\n if (afterElementRef.current) {\n newList.push(afterElementRef.current);\n }\n\n // Ensure we update array if before element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n const setAfterRef = React.useCallback(\n (element: HTMLDivElement) => {\n if (!element || afterElementRef.current === element) {\n return;\n }\n afterElementRef.current = element;\n const newList = [];\n\n if (beforeElementRef.current) {\n newList.push(beforeElementRef.current);\n }\n\n newList.push(afterElementRef.current);\n\n // Ensure we update array if after element changed\n setObserverList(newList);\n },\n [setObserverList],\n );\n\n // Initialize the size array before first render.\n const hasInitialized = React.useRef<boolean>(false);\n const initializeSizeArray = () => {\n if (hasInitialized.current === false) {\n hasInitialized.current = true;\n populateSizeArrays();\n }\n };\n\n React.useImperativeHandle(\n imperativeVirtualizerRef,\n () => {\n return {\n progressiveSizes: childProgressiveSizes,\n nodeSizes: childSizes,\n setFlaggedIndex: (index: number | null) => (flaggedIndex.current = index),\n currentIndex: actualIndexRef,\n };\n },\n [childProgressiveSizes, childSizes],\n );\n\n // Initialization on mount - update array index to 0 (ready state).\n // Only fire on mount (no deps).\n React.useEffect(() => {\n if (actualIndex < 0) {\n batchUpdateNewIndex(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /*\n * forceUpdate:\n * We only want to trigger this when child render or scroll loading changes,\n * it will force re-render all children elements\n */\n const forceUpdate = React.useReducer(() => ({}), {})[1];\n // If the user passes in an updated renderChild function - update current children\n React.useEffect(() => {\n if (actualIndex >= 0) {\n updateChildRows(actualIndex);\n forceUpdate();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [renderChild, isScrolling]);\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n React.useEffect(() => {\n // Ensure we repopulate if getItemSize callback changes\n populateSizeArrays();\n\n // We only run this effect on getItemSize change (recalc dynamic sizes)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getItemSize, gap]);\n\n // Effect to check flag index on updates\n React.useEffect(() => {\n if (!onRenderedFlaggedIndex || flaggedIndex.current === null) {\n return;\n }\n if (actualIndex <= flaggedIndex.current && actualIndex + virtualizerLength >= flaggedIndex.current) {\n onRenderedFlaggedIndex(flaggedIndex.current);\n flaggedIndex.current = null;\n }\n }, [actualIndex, onRenderedFlaggedIndex, virtualizerLength]);\n\n // Ensure we have run through and updated the whole size list array at least once.\n /* eslint-disable react-hooks/refs -- deprecated package, not worth refactoring */\n initializeSizeArray();\n\n if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {\n // Child length mismatch, repopulate size arrays.\n populateSizeArrays();\n }\n\n // Ensure we recalc if virtualizer length changes\n const maxCompare = Math.min(virtualizerLength, numItems);\n if (childArray.current.length !== maxCompare && actualIndex + childArray.current.length < numItems) {\n updateChildRows(actualIndex);\n }\n\n const isFullyInitialized = hasInitialized.current && actualIndex >= 0;\n return {\n components: {\n before: 'div',\n after: 'div',\n beforeContainer: 'div',\n afterContainer: 'div',\n },\n virtualizedChildren: childArray.current,\n before: slot.always(props.before, {\n defaultProps: {\n ref: setBeforeRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n after: slot.always(props.after, {\n defaultProps: {\n ref: setAfterRef,\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeContainer: slot.always(props.beforeContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n afterContainer: slot.always(props.afterContainer, {\n defaultProps: {\n role: 'none',\n },\n elementType: 'div',\n }),\n beforeBufferHeight: isFullyInitialized ? calculateBefore() : 0,\n afterBufferHeight: isFullyInitialized ? calculateAfter() : 0,\n totalVirtualizerHeight: isFullyInitialized ? calculateTotalSize() : virtualizerLength * itemSize,\n virtualizerStartIndex: actualIndex,\n axis,\n bufferSize,\n reversed,\n childSizes,\n childProgressiveSizes,\n };\n /* eslint-enable react-hooks/refs */\n}\n"],"names":["React","useIntersectionObserver","useVirtualizerContextState_unstable","slot","useTimeout","flushSync","useVirtualizer_unstable","props","itemSize","numItems","virtualizerLength","children","renderChild","getItemSize","bufferItems","Math","round","bufferSize","floor","axis","reversed","virtualizerContext","onRenderedFlaggedIndex","imperativeVirtualizerRef","containerSizeRef","scrollViewRef","enableScrollLoad","updateScrollPosition","gap","_virtualizerContext","actualIndexRef","useRef","contextIndex","flaggedIndex","actualIndex","current","setActualIndex","useCallback","index","setContextIndex","beforeElementRef","afterElementRef","childSizes","Array","childProgressiveSizes","childArray","populateSizeArrays","length","_gap","isScrolling","setIsScrolling","useState","setScrollTimer","clearScrollTimer","scrollCounter","initializeScrollingTimer","INIT_SCROLL_FLAG_REQ","INIT_SCROLL_FLAG_DELAY","useEffect","updateChildRows","newIndex","_actualIndex","max","end","min","i","updateCurrentItemSizes","endIndex","startIndex","didUpdate","newSize","prevSize","batchUpdateNewIndex","findIndexRecursive","scrollPos","lowIndex","highIndex","midpoint","iBefore","iAfter","indexValue","afterIndexValue","beforeIndexValue","getIndexFromSizeArray","getIndexFromScrollPosition","calculateTotalSize","calculateBefore","currentIndex","calculateAfter","lastItemIndex","remainingItems","previousNumItems","setObserverList","entries","observer","sortedEntries","sort","entry1","entry2","time","latestEntry","find","entry","isIntersecting","calculateOverBuffer","measurementPos","target","overflowAmount","intersectionRect","height","width","hOverflow","boundingClientRect","top","hOverflowReversed","bottom","wOverflow","left","wOverflowReversed","right","widthOverflow","heightOverflow","additionalOverflow","maxIndex","newStartIndex","root","rootMargin","threshold","setBeforeRef","element","newList","push","setAfterRef","hasInitialized","initializeSizeArray","useImperativeHandle","progressiveSizes","nodeSizes","setFlaggedIndex","forceUpdate","useReducer","maxCompare","isFullyInitialized","components","before","after","beforeContainer","afterContainer","virtualizedChildren","always","defaultProps","ref","role","elementType","beforeBufferHeight","afterBufferHeight","totalVirtualizerHeight","virtualizerStartIndex"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,uBAAuB,QAAQ,yCAAsC;AAC9E,SAASC,mCAAmC,QAAQ,qBAAkB;AACtE,SAASC,IAAI,EAAEC,UAAU,QAAQ,4BAA4B;AAC7D,SAASC,SAAS,QAAQ,YAAY;AAEtC;;CAEC,GACD,OAAO,SAASC,wBAAwBC,KAAuB;IAC7D,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACRC,iBAAiB,EACjBC,UAAUC,WAAW,EACrBC,WAAW,EACXC,cAAcC,KAAKC,KAAK,CAACN,oBAAoB,IAAI,EACjDO,aAAaF,KAAKG,KAAK,CAACJ,cAAc,OAAON,QAAQ,EACrDW,OAAO,UAAU,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,EACxBC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,EAChBC,oBAAoB,EACpBC,MAAM,CAAC,EACR,GAAGrB;IAEJ,iHAAiH,GACjH,MAAMsB,sBAAsB3B,oCAAoCmB;IAEhE,sFAAsF;IACtF,MAAMS,iBAAiB9B,MAAM+B,MAAM,CAASF,oBAAoBG,YAAY;IAE5E,MAAMC,eAAejC,MAAM+B,MAAM,CAAgB;IACjD,MAAMG,cAAcL,oBAAoBG,YAAY;IAEpD,0EAA0E;IAC1E,yFAAyF;IACzF,IAAIH,oBAAoBG,YAAY,KAAKF,eAAeK,OAAO,EAAE;QAC/D,yFAA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YACR;YACAC,aAAa;QACf;QACAN,gBAAgBhJ,KAAKkJ,MAAM,CAAC9I,MAAM4I,cAAc,EAAE;YAChDG,cAAc;gBACZE,MAAM;YACR;YACAC,aAAa;QACf;QACAC,oBAAoBZ,qBAAqBxD,oBAAoB;QAC7DqE,mBAAmBb,qBAAqBtD,mBAAmB;QAC3DoE,wBAAwBd,qBAAqBzD,uBAAuB3E,oBAAoBF;QACxFqJ,uBAAuB3H;QACvBf;QACAF;QACAG;QACAsB;QACAE;IACF;AACA,kCAAkC,GACpC"}
@@ -1,5 +1,10 @@
1
- import { __styles, mergeClasses } from '@griffel/react';
1
+ 'use client';
2
+
3
+ import { __styles, mergeClasses } from "@griffel/react";
2
4
  const virtualizerClassName = 'fui-Virtualizer';
5
+ /**
6
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
7
+ */
3
8
  export const virtualizerClassNames = {
4
9
  before: `${virtualizerClassName}__before`,
5
10
  beforeContainer: `${virtualizerClassName}__beforeContainer`,
@@ -25,10 +30,9 @@ const useStyles = /*#__PURE__*/__styles({
25
30
  });
26
31
  /**
27
32
  * Apply styling to the Virtualizer states
33
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
28
34
  */
29
35
  export const useVirtualizerStyles_unstable = state => {
30
- 'use no memo';
31
-
32
36
  const styles = useStyles();
33
37
  const {
34
38
  reversed,
@@ -38,9 +42,13 @@ export const useVirtualizerStyles_unstable = state => {
38
42
  bufferSize
39
43
  } = state;
40
44
  const horizontal = axis === 'horizontal';
45
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
41
46
  state.before.className = mergeClasses(virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);
47
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
42
48
  state.after.className = mergeClasses(virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);
49
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
43
50
  state.beforeContainer.className = mergeClasses(virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);
51
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
44
52
  state.afterContainer.className = mergeClasses(virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);
45
53
  const beforeHeightPx = beforeBufferHeight + 'px';
46
54
  const afterHeightPx = afterBufferHeight + 'px';
@@ -83,23 +91,27 @@ export const useVirtualizerStyles_unstable = state => {
83
91
  marginRight: `-${bufferPx}`
84
92
  })
85
93
  };
94
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
86
95
  state.before.style = {
87
96
  height: horizontal ? '100%' : beforeBufferHeightPx,
88
97
  width: horizontal ? beforeBufferHeightPx : '100%',
89
98
  ...beforeBuffer,
90
99
  ...state.before.style
91
100
  };
101
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
92
102
  state.beforeContainer.style = {
93
103
  height: horizontal ? 'auto' : beforeHeightPx,
94
104
  width: horizontal ? beforeHeightPx : 'auto',
95
105
  ...state.beforeContainer.style
96
106
  };
107
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
97
108
  state.after.style = {
98
109
  height: horizontal ? '100%' : afterBufferHeightPx,
99
110
  width: horizontal ? afterBufferHeightPx : '100%',
100
111
  ...afterBuffer,
101
112
  ...state.after.style
102
113
  };
114
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
103
115
  state.afterContainer.style = {
104
116
  height: horizontal ? 'auto' : afterHeightPx,
105
117
  width: horizontal ? afterHeightPx : 'auto',
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","virtualizerClassName","virtualizerClassNames","before","beforeContainer","after","afterContainer","useStyles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","useVirtualizerStyles_unstable","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"sources":["useVirtualizerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nconst virtualizerClassName = 'fui-Virtualizer';\nexport const virtualizerClassNames = {\n before: `${virtualizerClassName}__before`,\n beforeContainer: `${virtualizerClassName}__beforeContainer`,\n after: `${virtualizerClassName}__after`,\n afterContainer: `${virtualizerClassName}__afterContainer`\n};\nconst useStyles = makeStyles({\n base: {\n display: 'block',\n pointerEvents: 'none'\n },\n relative: {\n position: 'relative'\n },\n horizontal: {\n minHeight: '100%'\n },\n vertical: {\n minWidth: '100%'\n }\n});\n/**\n * Apply styling to the Virtualizer states\n */ export const useVirtualizerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const { reversed, axis, beforeBufferHeight, afterBufferHeight, bufferSize } = state;\n const horizontal = axis === 'horizontal';\n state.before.className = mergeClasses(virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);\n state.after.className = mergeClasses(virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);\n state.beforeContainer.className = mergeClasses(virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);\n state.afterContainer.className = mergeClasses(virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);\n const beforeHeightPx = beforeBufferHeight + 'px';\n const afterHeightPx = afterBufferHeight + 'px';\n const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';\n const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';\n const bufferPx = bufferSize + 'px';\n const beforeBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginRight: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n }\n };\n const afterBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginRight: `-${bufferPx}`\n }\n };\n state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style\n };\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style\n };\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style\n };\n state.afterContainer.style = {\n height: horizontal ? 'auto' : afterHeightPx,\n width: horizontal ? afterHeightPx : 'auto',\n ...state.afterContainer.style\n };\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,MAAMC,oBAAoB,GAAG,iBAAiB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,MAAM,EAAE,GAAGF,oBAAoB,UAAU;EACzCG,eAAe,EAAE,GAAGH,oBAAoB,mBAAmB;EAC3DI,KAAK,EAAE,GAAGJ,oBAAoB,SAAS;EACvCK,cAAc,EAAE,GAAGL,oBAAoB;AAC3C,CAAC;AACD,MAAMM,SAAS,gBAAGR,QAAA;EAAAS,IAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,MAAA;EAAA;EAAAC,UAA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AE1B,UAAU,GAAG,MAAM,GAAGgB,oBAAoB;IAClDW,KAAK,EAAE3B,UAAU,GAAGgB,oBAAoB,GAAG,MAAM;IACjD,GAAGG,YAAY;IACf,GAAGb,KAAK,CAAChB,MAAM,CAACmC;EACpB,CAAC;EACDnB,KAAK,CAACf,eAAe,CAACkC,KAAK,GAAG;IAC1BC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGc,cAAc;IAC5Ca,KAAK,EAAE3B,UAAU,GAAGc,cAAc,GAAG,MAAM;IAC3C,GAAGR,KAAK,CAACf,eAAe,CAACkC;EAC7B,CAAC;EACDnB,KAAK,CAACd,KAAK,CAACiC,KAAK,GAAG;IAChBC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGiB,mBAAmB;IACjDU,KAAK,EAAE3B,UAAU,GAAGiB,mBAAmB,GAAG,MAAM;IAChD,GAAGO,WAAW;IACd,GAAGlB,KAAK,CAACd,KAAK,CAACiC;EACnB,CAAC;EACDnB,KAAK,CAACb,cAAc,CAACgC,KAAK,GAAG;IACzBC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGe,aAAa;IAC3CY,KAAK,EAAE3B,UAAU,GAAGe,aAAa,GAAG,MAAM;IAC1C,GAAGT,KAAK,CAACb,cAAc,CAACgC;EAC5B,CAAC;EACD,OAAOnB,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","virtualizerClassName","virtualizerClassNames","before","beforeContainer","after","afterContainer","useStyles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","useVirtualizerStyles_unstable","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"sources":["useVirtualizerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nconst virtualizerClassName = 'fui-Virtualizer';\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */ export const virtualizerClassNames = {\n before: `${virtualizerClassName}__before`,\n beforeContainer: `${virtualizerClassName}__beforeContainer`,\n after: `${virtualizerClassName}__after`,\n afterContainer: `${virtualizerClassName}__afterContainer`\n};\nconst useStyles = makeStyles({\n base: {\n display: 'block',\n pointerEvents: 'none'\n },\n relative: {\n position: 'relative'\n },\n horizontal: {\n minHeight: '100%'\n },\n vertical: {\n minWidth: '100%'\n }\n});\n/**\n * Apply styling to the Virtualizer states\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */ export const useVirtualizerStyles_unstable = (state)=>{\n const styles = useStyles();\n const { reversed, axis, beforeBufferHeight, afterBufferHeight, bufferSize } = state;\n const horizontal = axis === 'horizontal';\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.before.className = mergeClasses(virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.after.className = mergeClasses(virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.beforeContainer.className = mergeClasses(virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.afterContainer.className = mergeClasses(virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);\n const beforeHeightPx = beforeBufferHeight + 'px';\n const afterHeightPx = afterBufferHeight + 'px';\n const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';\n const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';\n const bufferPx = bufferSize + 'px';\n const beforeBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginRight: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n }\n };\n const afterBuffer = {\n // Column\n ...!reversed && !horizontal && {\n marginTop: `-${bufferPx}`\n },\n // Column-Reverse\n ...reversed && !horizontal && {\n marginBottom: `-${bufferPx}`\n },\n // Row\n ...!reversed && horizontal && {\n marginLeft: `-${bufferPx}`\n },\n // Row-Reverse\n ...reversed && horizontal && {\n marginRight: `-${bufferPx}`\n }\n };\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style\n };\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style\n };\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style\n };\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.afterContainer.style = {\n height: horizontal ? 'auto' : afterHeightPx,\n width: horizontal ? afterHeightPx : 'auto',\n ...state.afterContainer.style\n };\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,MAAMC,oBAAoB,GAAG,iBAAiB;AAC9C;AACA;AACA;AAAI,OAAO,MAAMC,qBAAqB,GAAG;EACrCC,MAAM,EAAE,GAAGF,oBAAoB,UAAU;EACzCG,eAAe,E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,IAAG,CAACV,QAAQ,IAAIR,UAAU,IAAI;MAC1BuB,UAAU,EAAE,IAAIL,QAAQ;IAC5B,CAAC;IACD;IACA,IAAGV,QAAQ,IAAIR,UAAU,IAAI;MACzBsB,WAAW,EAAE,IAAIJ,QAAQ;IAC7B,CAAC;EACL,CAAC;EACD;EACAZ,KAAK,CAAChB,MAAM,CAACmC,KAAK,GAAG;IACjBC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGgB,oBAAoB;IAClDW,KAAK,EAAE3B,UAAU,GAAGgB,oBAAoB,GAAG,MAAM;IACjD,GAAGG,YAAY;IACf,GAAGb,KAAK,CAAChB,MAAM,CAACmC;EACpB,CAAC;EACD;EACAnB,KAAK,CAACf,eAAe,CAACkC,KAAK,GAAG;IAC1BC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGc,cAAc;IAC5Ca,KAAK,EAAE3B,UAAU,GAAGc,cAAc,GAAG,MAAM;IAC3C,GAAGR,KAAK,CAACf,eAAe,CAACkC;EAC7B,CAAC;EACD;EACAnB,KAAK,CAACd,KAAK,CAACiC,KAAK,GAAG;IAChBC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGiB,mBAAmB;IACjDU,KAAK,EAAE3B,UAAU,GAAGiB,mBAAmB,GAAG,MAAM;IAChD,GAAGO,WAAW;IACd,GAAGlB,KAAK,CAACd,KAAK,CAACiC;EACnB,CAAC;EACD;EACAnB,KAAK,CAACb,cAAc,CAACgC,KAAK,GAAG;IACzBC,MAAM,EAAE1B,UAAU,GAAG,MAAM,GAAGe,aAAa;IAC3CY,KAAK,EAAE3B,UAAU,GAAGe,aAAa,GAAG,MAAM;IAC1C,GAAGT,KAAK,CAACb,cAAc,CAACgC;EAC5B,CAAC;EACD,OAAOnB,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,110 @@
1
+ 'use client';
2
+ import { makeStyles, mergeClasses } from "@griffel/react";
3
+ const virtualizerClassName = 'fui-Virtualizer';
4
+ /**
5
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
6
+ */ export const virtualizerClassNames = {
7
+ before: `${virtualizerClassName}__before`,
8
+ beforeContainer: `${virtualizerClassName}__beforeContainer`,
9
+ after: `${virtualizerClassName}__after`,
10
+ afterContainer: `${virtualizerClassName}__afterContainer`
11
+ };
12
+ const useStyles = makeStyles({
13
+ base: {
14
+ display: 'block',
15
+ pointerEvents: 'none'
16
+ },
17
+ relative: {
18
+ position: 'relative'
19
+ },
20
+ horizontal: {
21
+ minHeight: '100%'
22
+ },
23
+ vertical: {
24
+ minWidth: '100%'
25
+ }
26
+ });
27
+ /**
28
+ * Apply styling to the Virtualizer states
29
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
30
+ */ export const useVirtualizerStyles_unstable = (state)=>{
31
+ const styles = useStyles();
32
+ const { reversed, axis, beforeBufferHeight, afterBufferHeight, bufferSize } = state;
33
+ const horizontal = axis === 'horizontal';
34
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
35
+ state.before.className = mergeClasses(virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);
36
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
37
+ state.after.className = mergeClasses(virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);
38
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
39
+ state.beforeContainer.className = mergeClasses(virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);
40
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
41
+ state.afterContainer.className = mergeClasses(virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);
42
+ const beforeHeightPx = beforeBufferHeight + 'px';
43
+ const afterHeightPx = afterBufferHeight + 'px';
44
+ const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';
45
+ const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';
46
+ const bufferPx = bufferSize + 'px';
47
+ const beforeBuffer = {
48
+ // Column
49
+ ...!reversed && !horizontal && {
50
+ marginBottom: `-${bufferPx}`
51
+ },
52
+ // Column-Reverse
53
+ ...reversed && !horizontal && {
54
+ marginTop: `-${bufferPx}`
55
+ },
56
+ // Row
57
+ ...!reversed && horizontal && {
58
+ marginRight: `-${bufferPx}`
59
+ },
60
+ // Row-Reverse
61
+ ...reversed && horizontal && {
62
+ marginLeft: `-${bufferPx}`
63
+ }
64
+ };
65
+ const afterBuffer = {
66
+ // Column
67
+ ...!reversed && !horizontal && {
68
+ marginTop: `-${bufferPx}`
69
+ },
70
+ // Column-Reverse
71
+ ...reversed && !horizontal && {
72
+ marginBottom: `-${bufferPx}`
73
+ },
74
+ // Row
75
+ ...!reversed && horizontal && {
76
+ marginLeft: `-${bufferPx}`
77
+ },
78
+ // Row-Reverse
79
+ ...reversed && horizontal && {
80
+ marginRight: `-${bufferPx}`
81
+ }
82
+ };
83
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
84
+ state.before.style = {
85
+ height: horizontal ? '100%' : beforeBufferHeightPx,
86
+ width: horizontal ? beforeBufferHeightPx : '100%',
87
+ ...beforeBuffer,
88
+ ...state.before.style
89
+ };
90
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
91
+ state.beforeContainer.style = {
92
+ height: horizontal ? 'auto' : beforeHeightPx,
93
+ width: horizontal ? beforeHeightPx : 'auto',
94
+ ...state.beforeContainer.style
95
+ };
96
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
97
+ state.after.style = {
98
+ height: horizontal ? '100%' : afterBufferHeightPx,
99
+ width: horizontal ? afterBufferHeightPx : '100%',
100
+ ...afterBuffer,
101
+ ...state.after.style
102
+ };
103
+ // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring
104
+ state.afterContainer.style = {
105
+ height: horizontal ? 'auto' : afterHeightPx,
106
+ width: horizontal ? afterHeightPx : 'auto',
107
+ ...state.afterContainer.style
108
+ };
109
+ return state;
110
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Virtualizer/useVirtualizerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nconst virtualizerClassName = 'fui-Virtualizer';\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const virtualizerClassNames: SlotClassNames<VirtualizerSlots> = {\n before: `${virtualizerClassName}__before`,\n beforeContainer: `${virtualizerClassName}__beforeContainer`,\n after: `${virtualizerClassName}__after`,\n afterContainer: `${virtualizerClassName}__afterContainer`,\n};\n\nconst useStyles = makeStyles({\n base: {\n display: 'block',\n pointerEvents: 'none',\n },\n relative: {\n position: 'relative',\n },\n horizontal: {\n minHeight: '100%',\n },\n vertical: {\n minWidth: '100%',\n },\n});\n\n/**\n * Apply styling to the Virtualizer states\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const useVirtualizerStyles_unstable = (state: VirtualizerState): VirtualizerState => {\n const styles = useStyles();\n const { reversed, axis, beforeBufferHeight, afterBufferHeight, bufferSize } = state;\n const horizontal = axis === 'horizontal';\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.before.className = mergeClasses(\n virtualizerClassNames.before,\n styles.base,\n styles.relative,\n horizontal ? styles.horizontal : styles.vertical,\n state.before.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.after.className = mergeClasses(\n virtualizerClassNames.after,\n styles.base,\n styles.relative,\n horizontal ? styles.horizontal : styles.vertical,\n state.after.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.beforeContainer.className = mergeClasses(\n virtualizerClassNames.beforeContainer,\n styles.base,\n horizontal ? styles.horizontal : styles.vertical,\n state.beforeContainer.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.afterContainer.className = mergeClasses(\n virtualizerClassNames.afterContainer,\n styles.base,\n horizontal ? styles.horizontal : styles.vertical,\n state.afterContainer.className,\n );\n\n const beforeHeightPx = beforeBufferHeight + 'px';\n const afterHeightPx = afterBufferHeight + 'px';\n const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';\n const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';\n const bufferPx = bufferSize + 'px';\n\n const beforeBuffer = {\n // Column\n ...(!reversed && !horizontal && { marginBottom: `-${bufferPx}` }),\n // Column-Reverse\n ...(reversed && !horizontal && { marginTop: `-${bufferPx}` }),\n // Row\n ...(!reversed && horizontal && { marginRight: `-${bufferPx}` }),\n // Row-Reverse\n ...(reversed && horizontal && { marginLeft: `-${bufferPx}` }),\n };\n\n const afterBuffer = {\n // Column\n ...(!reversed && !horizontal && { marginTop: `-${bufferPx}` }),\n // Column-Reverse\n ...(reversed && !horizontal && { marginBottom: `-${bufferPx}` }),\n // Row\n ...(!reversed && horizontal && { marginLeft: `-${bufferPx}` }),\n // Row-Reverse\n ...(reversed && horizontal && { marginRight: `-${bufferPx}` }),\n };\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style,\n };\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style,\n };\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style,\n };\n\n // eslint-disable-next-line react-hooks/immutability -- deprecated package, not worth refactoring\n state.afterContainer.style = {\n height: horizontal ? 'auto' : afterHeightPx,\n width: horizontal ? afterHeightPx : 'auto',\n ...state.afterContainer.style,\n };\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","virtualizerClassName","virtualizerClassNames","before","beforeContainer","after","afterContainer","useStyles","base","display","pointerEvents","relative","position","horizontal","minHeight","vertical","minWidth","useVirtualizerStyles_unstable","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI1D,MAAMC,uBAAuB;AAC7B;;CAEC,GACD,OAAO,MAAMC,wBAA0D;IACrEC,QAAQ,GAAGF,qBAAqB,QAAQ,CAAC;IACzCG,iBAAiB,GAAGH,qBAAqB,iBAAiB,CAAC;IAC3DI,OAAO,GAAGJ,qBAAqB,OAAO,CAAC;IACvCK,gBAAgB,GAAGL,qBAAqB,gBAAgB,CAAC;AAC3D,EAAE;AAEF,MAAMM,YAAYR,WAAW;IAC3BS,MAAM;QACJC,SAAS;QACTC,eAAe;IACjB;IACAC,UAAU;QACRC,UAAU;IACZ;IACAC,YAAY;QACVC,WAAW;IACb;IACAC,UAAU;QACRC,UAAU;IACZ;AACF;AAEA;;;CAGC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAMC,SAASZ;IACf,MAAM,EAAEa,QAAQ,EAAEC,IAAI,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,UAAU,EAAE,GAAGN;IAC9E,MAAML,aAAaQ,SAAS;IAE5B,iGAAiG;IACjGH,MAAMf,MAAM,CAACsB,SAAS,GAAGzB,aACvB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tualizerScrollView_unstable } from './useVirtualizerScrollView';
2
- import { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';
3
- import { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles.styles';
4
- import * as React from 'react';
5
- import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
1
+ 'use client';
2
+ import { useVirtualizerScrollView_unstable } from "./useVirtualizerScrollView.js";
3
+ import { renderVirtualizerScrollView_unstable } from "./renderVirtualizerScrollView.js";
4
+ import { useVirtualizerScrollViewStyles_unstable } from "./useVirtualizerScrollViewStyles.styles.js";
5
+ import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
6
6
  /**
7
7
  * Virtualizer ScrollView
8
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
8
9
  */ export const VirtualizerScrollView = (props)=>{
9
10
  const state = useVirtualizerScrollView_unstable(props);
10
11
  useVirtualizerScrollViewStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.ts"],"sourcesContent":["import type { VirtualizerScrollViewProps } from './VirtualizerScrollView.types';\nimport { useVirtualizerScrollView_unstable } from './useVirtualizerScrollView';\nimport { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';\nimport { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles.styles';\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Virtualizer ScrollView\n */\n\nexport const VirtualizerScrollView: React.FC<VirtualizerScrollViewProps> = (props: VirtualizerScrollViewProps) => {\n const state = useVirtualizerScrollView_unstable(props);\n\n useVirtualizerScrollViewStyles_unstable(state);\n useCustomStyleHook_unstable('useVirtualizerScrollViewStyles_unstable')(state);\n\n return renderVirtualizerScrollView_unstable(state);\n};\n\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n"],"names":["useVirtualizerScrollView_unstable","renderVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","React","useCustomStyleHook_unstable","VirtualizerScrollView","props","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AACA,SAASA,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,uCAAuC,QAAQ,0CAA0C;AAClG,YAAYC,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GAED,OAAO,MAAMC,wBAA8D,CAACC;IAC1E,MAAMC,QAAQP,kCAAkCM;IAEhDJ,wCAAwCK;IACxCH,4BAA4B,2CAA2CG;IAEvE,OAAON,qCAAqCM;AAC9C,EAAE;AAEFF,sBAAsBG,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.ts"],"sourcesContent":["'use client';\n\nimport type { VirtualizerScrollViewProps } from './VirtualizerScrollView.types';\nimport { useVirtualizerScrollView_unstable } from './useVirtualizerScrollView';\nimport { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';\nimport { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles.styles';\nimport type * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Virtualizer ScrollView\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport const VirtualizerScrollView: React.FC<VirtualizerScrollViewProps> = (props: VirtualizerScrollViewProps) => {\n const state = useVirtualizerScrollView_unstable(props);\n\n useVirtualizerScrollViewStyles_unstable(state);\n useCustomStyleHook_unstable('useVirtualizerScrollViewStyles_unstable')(state);\n\n return renderVirtualizerScrollView_unstable(state);\n};\n\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n"],"names":["useVirtualizerScrollView_unstable","renderVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","useCustomStyleHook_unstable","VirtualizerScrollView","props","state","displayName"],"mappings":"AAAA;AAGA,SAASA,iCAAiC,QAAQ,gCAA6B;AAC/E,SAASC,oCAAoC,QAAQ,mCAAgC;AACrF,SAASC,uCAAuC,QAAQ,6CAA0C;AAElG,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,wBAA8D,CAACC;IAC1E,MAAMC,QAAQN,kCAAkCK;IAEhDH,wCAAwCI;IACxCH,4BAA4B,2CAA2CG;IAEvE,OAAOL,qCAAqCK;AAC9C,EAAE;AAEFF,sBAAsBG,WAAW,GAAG"}
@@ -1 +1,3 @@
1
- import * as React from 'react';
1
+ /**
2
+ * @deprecated migrated to \@fluentui\-contrib/react\-virtualizer for stable release.
3
+ */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type {\n VirtualizerSlots,\n VirtualizerConfigProps,\n VirtualizerConfigState,\n VirtualizerChildRenderFunction,\n} from '../Virtualizer/Virtualizer.types';\nimport type { ScrollToInterface } from '../../Utilities';\n\nexport type VirtualizerScrollViewSlots = VirtualizerSlots & {\n /**\n * The root container that provides embedded scrolling.\n */\n container: NonNullable<Slot<'div'>>;\n};\n\nexport type VirtualizerScrollViewProps = ComponentProps<Partial<VirtualizerScrollViewSlots>> &\n Partial<\n Omit<\n VirtualizerConfigProps,\n 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex' | 'imperativeVirtualizerRef'\n >\n > & {\n /**\n * Virtualizer item size in pixels - static.\n * Axis: 'vertical' = Height\n * Axis: 'horizontal' = Width\n */\n itemSize: number;\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\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 */\n children: VirtualizerChildRenderFunction;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeRef?: React.RefObject<ScrollToInterface>;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n enablePagination?: boolean;\n };\n\nexport type VirtualizerScrollViewState = ComponentState<VirtualizerScrollViewSlots> & VirtualizerConfigState;\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/VirtualizerScrollView/VirtualizerScrollView.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type {\n VirtualizerSlots,\n VirtualizerConfigProps,\n VirtualizerConfigState,\n VirtualizerChildRenderFunction,\n} from '../Virtualizer/Virtualizer.types';\nimport type { ScrollToInterface } from '../../Utilities';\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerScrollViewSlots = VirtualizerSlots & {\n /**\n * The root container that provides embedded scrolling.\n */\n container: NonNullable<Slot<'div'>>;\n};\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerScrollViewProps = ComponentProps<Partial<VirtualizerScrollViewSlots>> &\n Partial<\n Omit<\n VirtualizerConfigProps,\n 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex' | 'imperativeVirtualizerRef'\n >\n > & {\n /**\n * Virtualizer item size in pixels - static.\n * Axis: 'vertical' = Height\n * Axis: 'horizontal' = Width\n */\n itemSize: number;\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\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 */\n children: VirtualizerChildRenderFunction;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeRef?: React.RefObject<ScrollToInterface | null>;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n enablePagination?: boolean;\n };\n\n/**\n * @deprecated migrated to \\@fluentui\\-contrib/react\\-virtualizer for stable release.\n */\nexport type VirtualizerScrollViewState = ComponentState<VirtualizerScrollViewSlots> & VirtualizerConfigState;\n"],"names":[],"mappings":"AAwDA;;CAEC,GACD,WAA6G"}
@@ -1,4 +1,4 @@
1
- export { VirtualizerScrollView } from './VirtualizerScrollView';
2
- export { useVirtualizerScrollView_unstable } from './useVirtualizerScrollView';
3
- export { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';
4
- export { useVirtualizerScrollViewStyles_unstable, virtualizerScrollViewClassNames } from './useVirtualizerScrollViewStyles.styles';
1
+ export { VirtualizerScrollView } from "./VirtualizerScrollView.js";
2
+ export { useVirtualizerScrollView_unstable } from "./useVirtualizerScrollView.js";
3
+ export { renderVirtualizerScrollView_unstable } from "./renderVirtualizerScrollView.js";
4
+ export { useVirtualizerScrollViewStyles_unstable, virtualizerScrollViewClassNames } from "./useVirtualizerScrollViewStyles.styles.js";