@fluentui/react-virtualizer 9.0.0-alpha.9 → 9.0.0-alpha.91

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 (183) hide show
  1. package/CHANGELOG.md +854 -9
  2. package/dist/index.d.ts +326 -33
  3. package/lib/Hooks.js +1 -2
  4. package/lib/Hooks.js.map +1 -1
  5. package/lib/Utilities.js +1 -0
  6. package/lib/Utilities.js.map +1 -0
  7. package/lib/Virtualizer.js +1 -2
  8. package/lib/Virtualizer.js.map +1 -1
  9. package/lib/VirtualizerScrollView.js +1 -0
  10. package/lib/VirtualizerScrollView.js.map +1 -0
  11. package/lib/VirtualizerScrollViewDynamic.js +1 -0
  12. package/lib/VirtualizerScrollViewDynamic.js.map +1 -0
  13. package/lib/components/Virtualizer/Virtualizer.js +6 -7
  14. package/lib/components/Virtualizer/Virtualizer.js.map +1 -1
  15. package/lib/components/Virtualizer/Virtualizer.types.js +1 -2
  16. package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
  17. package/lib/components/Virtualizer/index.js +4 -6
  18. package/lib/components/Virtualizer/index.js.map +1 -1
  19. package/lib/components/Virtualizer/renderVirtualizer.js +21 -16
  20. package/lib/components/Virtualizer/renderVirtualizer.js.map +1 -1
  21. package/lib/components/Virtualizer/useVirtualizer.js +522 -356
  22. package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
  23. package/lib/components/Virtualizer/{useVirtualizerStyles.js → useVirtualizerStyles.styles.js} +5 -4
  24. package/lib/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -0
  25. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js +12 -0
  26. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
  27. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js +1 -0
  28. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
  29. package/lib/components/VirtualizerScrollView/index.js +4 -0
  30. package/lib/components/VirtualizerScrollView/index.js.map +1 -0
  31. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js +9 -0
  32. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
  33. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +80 -0
  34. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
  35. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +46 -0
  36. package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -0
  37. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +12 -0
  38. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -0
  39. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +1 -0
  40. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -0
  41. package/lib/components/VirtualizerScrollViewDynamic/index.js +4 -0
  42. package/lib/components/VirtualizerScrollViewDynamic/index.js.map +1 -0
  43. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +9 -0
  44. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -0
  45. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +152 -0
  46. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -0
  47. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +46 -0
  48. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -0
  49. package/lib/hooks/hooks.types.js +1 -0
  50. package/lib/hooks/hooks.types.js.map +1 -0
  51. package/lib/hooks/index.js +5 -2
  52. package/lib/hooks/index.js.map +1 -1
  53. package/lib/hooks/useDynamicPagination.js +126 -0
  54. package/lib/hooks/useDynamicPagination.js.map +1 -0
  55. package/lib/hooks/useDynamicVirtualizerMeasure.js +126 -0
  56. package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -0
  57. package/lib/hooks/useIntersectionObserver.js +117 -40
  58. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  59. package/lib/hooks/useMeasureList.js +127 -0
  60. package/lib/hooks/useMeasureList.js.map +1 -0
  61. package/lib/hooks/useMutationObserver.js +38 -0
  62. package/lib/hooks/useMutationObserver.js.map +1 -0
  63. package/lib/hooks/useResizeObserverRef.js +60 -0
  64. package/lib/hooks/useResizeObserverRef.js.map +1 -0
  65. package/lib/hooks/useStaticPagination.js +102 -0
  66. package/lib/hooks/useStaticPagination.js.map +1 -0
  67. package/lib/hooks/useVirtualizerMeasure.js +62 -0
  68. package/lib/hooks/useVirtualizerMeasure.js.map +1 -0
  69. package/lib/index.js +4 -2
  70. package/lib/index.js.map +1 -1
  71. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js +32 -0
  72. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -0
  73. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js +1 -0
  74. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -0
  75. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js +45 -0
  76. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -0
  77. package/lib/utilities/ImperativeScrolling/index.js +2 -0
  78. package/lib/utilities/ImperativeScrolling/index.js.map +1 -0
  79. package/lib/utilities/VirtualizerContext/VirtualizerContext.js +26 -0
  80. package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -0
  81. package/lib/utilities/VirtualizerContext/index.js +1 -0
  82. package/lib/utilities/VirtualizerContext/index.js.map +1 -0
  83. package/lib/utilities/VirtualizerContext/types.js +1 -0
  84. package/lib/utilities/VirtualizerContext/types.js.map +1 -0
  85. package/lib/utilities/createResizeObserverFromDocument.js +13 -0
  86. package/lib/utilities/createResizeObserverFromDocument.js.map +1 -0
  87. package/lib/utilities/debounce.js +19 -0
  88. package/lib/utilities/debounce.js.map +1 -0
  89. package/lib/utilities/index.js +2 -0
  90. package/lib/utilities/index.js.map +1 -0
  91. package/lib-commonjs/Hooks.js +31 -5
  92. package/lib-commonjs/Hooks.js.map +1 -1
  93. package/lib-commonjs/Utilities.js +28 -0
  94. package/lib-commonjs/Utilities.js.map +1 -0
  95. package/lib-commonjs/Virtualizer.js +28 -5
  96. package/lib-commonjs/Virtualizer.js.map +1 -1
  97. package/lib-commonjs/VirtualizerScrollView.js +28 -0
  98. package/lib-commonjs/VirtualizerScrollView.js.map +1 -0
  99. package/lib-commonjs/VirtualizerScrollViewDynamic.js +28 -0
  100. package/lib-commonjs/VirtualizerScrollViewDynamic.js.map +1 -0
  101. package/lib-commonjs/components/Virtualizer/Virtualizer.js +17 -18
  102. package/lib-commonjs/components/Virtualizer/Virtualizer.js.map +1 -1
  103. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js +3 -3
  104. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +1 -1
  105. package/lib-commonjs/components/Virtualizer/index.js +31 -9
  106. package/lib-commonjs/components/Virtualizer/index.js.map +1 -1
  107. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js +38 -21
  108. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js.map +1 -1
  109. package/lib-commonjs/components/Virtualizer/useVirtualizer.js +531 -362
  110. package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +1 -1
  111. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js +123 -0
  112. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -0
  113. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js +21 -0
  114. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
  115. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js +6 -0
  116. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
  117. package/lib-commonjs/components/VirtualizerScrollView/index.js +31 -0
  118. package/lib-commonjs/components/VirtualizerScrollView/index.js.map +1 -0
  119. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js +19 -0
  120. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
  121. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js +91 -0
  122. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
  123. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +70 -0
  124. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -0
  125. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js +21 -0
  126. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -0
  127. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js +6 -0
  128. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -0
  129. package/lib-commonjs/components/VirtualizerScrollViewDynamic/index.js +31 -0
  130. package/lib-commonjs/components/VirtualizerScrollViewDynamic/index.js.map +1 -0
  131. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js +19 -0
  132. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -0
  133. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +162 -0
  134. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -0
  135. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +70 -0
  136. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -0
  137. package/lib-commonjs/hooks/hooks.types.js +6 -0
  138. package/lib-commonjs/hooks/hooks.types.js.map +1 -0
  139. package/lib-commonjs/hooks/index.js +35 -5
  140. package/lib-commonjs/hooks/index.js.map +1 -1
  141. package/lib-commonjs/hooks/useDynamicPagination.js +131 -0
  142. package/lib-commonjs/hooks/useDynamicPagination.js.map +1 -0
  143. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js +134 -0
  144. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +1 -0
  145. package/lib-commonjs/hooks/useIntersectionObserver.js +129 -53
  146. package/lib-commonjs/hooks/useIntersectionObserver.js.map +1 -1
  147. package/lib-commonjs/hooks/useMeasureList.js +134 -0
  148. package/lib-commonjs/hooks/useMeasureList.js.map +1 -0
  149. package/lib-commonjs/hooks/useMutationObserver.js +48 -0
  150. package/lib-commonjs/hooks/useMutationObserver.js.map +1 -0
  151. package/lib-commonjs/hooks/useResizeObserverRef.js +69 -0
  152. package/lib-commonjs/hooks/useResizeObserverRef.js.map +1 -0
  153. package/lib-commonjs/hooks/useStaticPagination.js +107 -0
  154. package/lib-commonjs/hooks/useStaticPagination.js.map +1 -0
  155. package/lib-commonjs/hooks/useVirtualizerMeasure.js +70 -0
  156. package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +1 -0
  157. package/lib-commonjs/index.js +85 -41
  158. package/lib-commonjs/index.js.map +1 -1
  159. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js +42 -0
  160. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -0
  161. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js +6 -0
  162. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -0
  163. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js +55 -0
  164. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -0
  165. package/lib-commonjs/utilities/ImperativeScrolling/index.js +20 -0
  166. package/lib-commonjs/utilities/ImperativeScrolling/index.js.map +1 -0
  167. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js +48 -0
  168. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -0
  169. package/lib-commonjs/utilities/VirtualizerContext/index.js +22 -0
  170. package/lib-commonjs/utilities/VirtualizerContext/index.js.map +1 -0
  171. package/lib-commonjs/utilities/VirtualizerContext/types.js +6 -0
  172. package/lib-commonjs/utilities/VirtualizerContext/types.js.map +1 -0
  173. package/lib-commonjs/utilities/createResizeObserverFromDocument.js +23 -0
  174. package/lib-commonjs/utilities/createResizeObserverFromDocument.js.map +1 -0
  175. package/lib-commonjs/utilities/debounce.js +29 -0
  176. package/lib-commonjs/utilities/debounce.js.map +1 -0
  177. package/lib-commonjs/utilities/index.js +29 -0
  178. package/lib-commonjs/utilities/index.js.map +1 -0
  179. package/package.json +20 -24
  180. package/CHANGELOG.json +0 -140
  181. package/lib/components/Virtualizer/useVirtualizerStyles.js.map +0 -1
  182. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.js +0 -115
  183. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/VirtualizerContext/VirtualizerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './types';\n\nconst VirtualizerContext = React.createContext<VirtualizerContextProps | undefined>(\n undefined,\n) as React.Context<VirtualizerContextProps>;\n\nexport const VirtualizerContextProvider = VirtualizerContext.Provider;\n\nexport const useVirtualizerContext_unstable = () => {\n return React.useContext(VirtualizerContext);\n};\n\nexport const useVirtualizerContextState_unstable = (\n passedContext?: VirtualizerContextProps,\n): DynamicVirtualizerContextProps => {\n const virtualizerContext = useVirtualizerContext_unstable();\n const [_contextIndex, _setContextIndex] = React.useState<number>(-1);\n const childProgressiveSizes = React.useRef<number[]>([]);\n\n /* We respect any wrapped providers while also ensuring defaults or passed through\n * Order of usage -> Passed Prop -> Provider Context -> Internal State default\n */\n const context = React.useMemo(\n () => ({\n contextIndex: passedContext?.contextIndex ?? virtualizerContext?.contextIndex ?? _contextIndex,\n setContextIndex: passedContext?.setContextIndex ?? virtualizerContext?.setContextIndex ?? _setContextIndex,\n childProgressiveSizes,\n }),\n [_contextIndex, passedContext, virtualizerContext],\n );\n\n return context;\n};\n"],"names":["VirtualizerContextProvider","useVirtualizerContextState_unstable","useVirtualizerContext_unstable","VirtualizerContext","React","createContext","undefined","Provider","useContext","passedContext","virtualizerContext","_contextIndex","_setContextIndex","useState","childProgressiveSizes","useRef","context","useMemo","contextIndex","setContextIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,0BAAAA;eAAAA;;IAMAC,mCAAAA;eAAAA;;IAJAC,8BAAAA;eAAAA;;;;iEATU;AAGvB,MAAMC,mCAAqBC,OAAMC,aAAa,CAC5CC;AAGK,MAAMN,6BAA6BG,mBAAmBI,QAAQ;AAE9D,MAAML,iCAAiC;IAC5C,OAAOE,OAAMI,UAAU,CAACL;AAC1B;AAEO,MAAMF,sCAAsC,CACjDQ;IAEA,MAAMC,qBAAqBR;IAC3B,MAAM,CAACS,eAAeC,iBAAiB,GAAGR,OAAMS,QAAQ,CAAS,CAAC;IAClE,MAAMC,wBAAwBV,OAAMW,MAAM,CAAW,EAAE;IAEvD;;GAEC,GACD,MAAMC,UAAUZ,OAAMa,OAAO,CAC3B;YACgBR,6BAAAA,MACGA,gCAAAA;eAFZ;YACLS,cAAcT,CAAAA,OAAAA,CAAAA,8BAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeS,YAAY,AAAZA,MAAY,QAA3BT,gCAAAA,KAAAA,IAAAA,8BAA+BC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBQ,YAAY,AAAZA,MAAY,QAA/DT,SAAAA,KAAAA,IAAAA,OAAmEE;YACjFQ,iBAAiBV,CAAAA,QAAAA,CAAAA,iCAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeU,eAAe,AAAfA,MAAe,QAA9BV,mCAAAA,KAAAA,IAAAA,iCAAkCC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAoBS,eAAe,AAAfA,MAAe,QAArEV,UAAAA,KAAAA,IAAAA,QAAyEG;YAC1FE;QACF;IAAA,GACA;QAACH;QAAeF;QAAeC;KAAmB;IAGpD,OAAOM;AACT"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ VirtualizerContextProvider: function() {
13
+ return _VirtualizerContext.VirtualizerContextProvider;
14
+ },
15
+ useVirtualizerContextState_unstable: function() {
16
+ return _VirtualizerContext.useVirtualizerContextState_unstable;
17
+ },
18
+ useVirtualizerContext_unstable: function() {
19
+ return _VirtualizerContext.useVirtualizerContext_unstable;
20
+ }
21
+ });
22
+ const _VirtualizerContext = require("./VirtualizerContext");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/VirtualizerContext/index.ts"],"sourcesContent":["export {\n VirtualizerContextProvider,\n useVirtualizerContextState_unstable,\n useVirtualizerContext_unstable,\n} from './VirtualizerContext';\nexport type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './types';\n"],"names":["VirtualizerContextProvider","useVirtualizerContextState_unstable","useVirtualizerContext_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,0BAA0B;eAA1BA,8CAA0B;;IAC1BC,mCAAmC;eAAnCA,uDAAmC;;IACnCC,8BAA8B;eAA9BA,kDAA8B;;;oCACzB"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/VirtualizerContext/types.ts"],"sourcesContent":["import * as React from 'react';\n/**\n * {@docCategory Virtualizer}\n */\nexport type VirtualizerContextProps = {\n contextIndex: number;\n setContextIndex: (index: number) => void;\n /*\n * These optional props are used in dynamic virtualizer\n */\n childProgressiveSizes?: React.MutableRefObject<number[]>;\n};\n\n/**\n * Some props are optional on static virtualizer, but required for dynamic.\n */\nexport type DynamicVirtualizerContextProps = Required<VirtualizerContextProps>;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar
3
+ * A utility method that creates a ResizeObserver from a target document
4
+ * @param targetDocument - document to use to create the ResizeObserver
5
+ * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback
6
+ * @returns a ResizeObserver instance or null if the global does not exist on the document
7
+ */ "use strict";
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
11
+ Object.defineProperty(exports, "createResizeObserverFromDocument", {
12
+ enumerable: true,
13
+ get: function() {
14
+ return createResizeObserverFromDocument;
15
+ }
16
+ });
17
+ function createResizeObserverFromDocument(targetDocument, callback) {
18
+ var _targetDocument_defaultView;
19
+ if (!(targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.ResizeObserver)) {
20
+ return null;
21
+ }
22
+ return new targetDocument.defaultView.ResizeObserver(callback);
23
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/createResizeObserverFromDocument.ts"],"sourcesContent":["/**\n * FIXME - TS 3.8/3.9 don't have ResizeObserver types by default, move this to a shared utility once we bump the minbar\n * A utility method that creates a ResizeObserver from a target document\n * @param targetDocument - document to use to create the ResizeObserver\n * @param callback - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver#callback\n * @returns a ResizeObserver instance or null if the global does not exist on the document\n */\nexport function createResizeObserverFromDocument(\n targetDocument: Document | null | undefined,\n callback: ResizeObserverCallback,\n) {\n if (!targetDocument?.defaultView?.ResizeObserver) {\n return null;\n }\n\n return new targetDocument.defaultView.ResizeObserver(callback);\n}\n"],"names":["createResizeObserverFromDocument","targetDocument","callback","defaultView","ResizeObserver"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;CAMC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,iCACdC,cAA2C,EAC3CC,QAAgC;QAE3BD;IAAL,IAAI,CAACA,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,CAAAA,8BAAAA,eAAgBE,WAAW,AAAXA,MAAW,QAA3BF,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA6BG,cAAc,AAAdA,GAAgB;QAChD,OAAO;IACT;IAEA,OAAO,IAAIH,eAAeE,WAAW,CAACC,cAAc,CAACF;AACvD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Microtask debouncer
3
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
4
+ * @param fn - Function to debounce
5
+ * @returns debounced function
6
+ */ "use strict";
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ Object.defineProperty(exports, "debounce", {
11
+ enumerable: true,
12
+ get: function() {
13
+ return debounce;
14
+ }
15
+ });
16
+ function debounce(fn) {
17
+ let pending;
18
+ return ()=>{
19
+ if (!pending) {
20
+ pending = true;
21
+ queueMicrotask(()=>{
22
+ // Need to set pending to `false` before the debounced function is run.
23
+ // React can actually interrupt the function while it's running!
24
+ pending = false;
25
+ fn();
26
+ });
27
+ }
28
+ };
29
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","queueMicrotask"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAY;IACnC,IAAIC;IACJ,OAAO;QACL,IAAI,CAACA,SAAS;YACZA,UAAU;YACVC,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChED,UAAU;gBACVD;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ VirtualizerContextProvider: function() {
13
+ return _VirtualizerContext.VirtualizerContextProvider;
14
+ },
15
+ scrollToItemDynamic: function() {
16
+ return _ImperativeScrolling.scrollToItemDynamic;
17
+ },
18
+ scrollToItemStatic: function() {
19
+ return _ImperativeScrolling.scrollToItemStatic;
20
+ },
21
+ useVirtualizerContextState_unstable: function() {
22
+ return _VirtualizerContext.useVirtualizerContextState_unstable;
23
+ },
24
+ useVirtualizerContext_unstable: function() {
25
+ return _VirtualizerContext.useVirtualizerContext_unstable;
26
+ }
27
+ });
28
+ const _VirtualizerContext = require("./VirtualizerContext");
29
+ const _ImperativeScrolling = require("./ImperativeScrolling");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utilities/index.ts"],"sourcesContent":["export type { DynamicVirtualizerContextProps, VirtualizerContextProps } from './VirtualizerContext';\nexport {\n VirtualizerContextProvider,\n useVirtualizerContextState_unstable,\n useVirtualizerContext_unstable,\n} from './VirtualizerContext';\nexport type { ScrollToInterface, ScrollToItemDynamicParams, ScrollToItemStaticParams } from './ImperativeScrolling';\nexport { scrollToItemDynamic, scrollToItemStatic } from './ImperativeScrolling';\n"],"names":["VirtualizerContextProvider","scrollToItemDynamic","scrollToItemStatic","useVirtualizerContextState_unstable","useVirtualizerContext_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,0BAA0B;eAA1BA,8CAA0B;;IAKnBC,mBAAmB;eAAnBA,wCAAmB;;IAAEC,kBAAkB;eAAlBA,uCAAkB;;IAJ9CC,mCAAmC;eAAnCA,uDAAmC;;IACnCC,8BAA8B;eAA9BA,kDAA8B;;;oCACzB;qCAEiD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-virtualizer",
3
- "version": "9.0.0-alpha.9",
3
+ "version": "9.0.0-alpha.91",
4
4
  "description": "Generic and composable virtualizer framework built on browser intersection observer",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -11,35 +11,24 @@
11
11
  "url": "https://github.com/microsoft/fluentui"
12
12
  },
13
13
  "license": "MIT",
14
- "scripts": {
15
- "build": "just-scripts build",
16
- "clean": "just-scripts clean",
17
- "code-style": "just-scripts code-style",
18
- "just": "just-scripts",
19
- "lint": "just-scripts lint",
20
- "test": "jest --passWithNoTests",
21
- "storybook": "start-storybook",
22
- "start": "yarn storybook",
23
- "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor",
24
- "type-check": "tsc -b tsconfig.json"
25
- },
26
14
  "devDependencies": {
27
15
  "@fluentui/eslint-plugin": "*",
28
16
  "@fluentui/react-conformance": "*",
29
- "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
30
- "@fluentui/scripts-api-extractor": "*",
31
- "@fluentui/scripts-tasks": "*"
17
+ "@fluentui/react-conformance-griffel": "*",
18
+ "@fluentui/scripts-api-extractor": "*"
32
19
  },
33
20
  "dependencies": {
34
- "@fluentui/react-utilities": "^9.6.1",
35
- "@griffel/react": "^1.5.2",
36
- "tslib": "^2.1.0"
21
+ "@fluentui/react-jsx-runtime": "^9.0.50",
22
+ "@fluentui/react-utilities": "^9.18.20",
23
+ "@fluentui/react-shared-contexts": "^9.21.2",
24
+ "@griffel/react": "^1.5.22",
25
+ "@swc/helpers": "^0.5.1"
37
26
  },
38
27
  "peerDependencies": {
39
- "@types/react": ">=16.8.0 <19.0.0",
40
- "@types/react-dom": ">=16.8.0 <19.0.0",
41
- "react": ">=16.8.0 <19.0.0",
42
- "react-dom": ">=16.8.0 <19.0.0"
28
+ "@types/react": ">=16.14.0 <19.0.0",
29
+ "@types/react-dom": ">=16.9.0 <19.0.0",
30
+ "react": ">=16.14.0 <19.0.0",
31
+ "react-dom": ">=16.14.0 <19.0.0"
43
32
  },
44
33
  "beachball": {
45
34
  "disallowedChangeTypes": [
@@ -51,9 +40,16 @@
51
40
  "exports": {
52
41
  ".": {
53
42
  "types": "./dist/index.d.ts",
43
+ "node": "./lib-commonjs/index.js",
54
44
  "import": "./lib/index.js",
55
45
  "require": "./lib-commonjs/index.js"
56
46
  },
57
47
  "./package.json": "./package.json"
58
- }
48
+ },
49
+ "files": [
50
+ "*.md",
51
+ "dist/*.d.ts",
52
+ "lib",
53
+ "lib-commonjs"
54
+ ]
59
55
  }
package/CHANGELOG.json DELETED
@@ -1,140 +0,0 @@
1
- {
2
- "name": "@fluentui/react-virtualizer",
3
- "entries": [
4
- {
5
- "date": "Wed, 08 Mar 2023 17:39:19 GMT",
6
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.9",
7
- "version": "9.0.0-alpha.9",
8
- "comments": {
9
- "prerelease": [
10
- {
11
- "author": "beachball",
12
- "package": "@fluentui/react-virtualizer",
13
- "comment": "Bump @fluentui/react-utilities to v9.6.1",
14
- "commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
15
- }
16
- ]
17
- }
18
- },
19
- {
20
- "date": "Thu, 16 Feb 2023 19:18:49 GMT",
21
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.8",
22
- "version": "9.0.0-alpha.8",
23
- "comments": {
24
- "prerelease": [
25
- {
26
- "author": "mgodbolt@microsoft.com",
27
- "package": "@fluentui/react-virtualizer",
28
- "commit": "c6f47613e95f8e43ef00792ea673d673881e14fb",
29
- "comment": "fixing build issues"
30
- }
31
- ]
32
- }
33
- },
34
- {
35
- "date": "Thu, 16 Feb 2023 16:18:01 GMT",
36
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.7",
37
- "version": "9.0.0-alpha.7",
38
- "comments": {
39
- "prerelease": [
40
- {
41
- "author": "mgodbolt@microsoft.com",
42
- "package": "@fluentui/react-virtualizer",
43
- "commit": "4af9156bc869948b12610689f15b2a778aa690ca",
44
- "comment": "fix: Updating peer dependencies to support React 18."
45
- }
46
- ]
47
- }
48
- },
49
- {
50
- "date": "Wed, 15 Feb 2023 11:44:52 GMT",
51
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.6",
52
- "version": "9.0.0-alpha.6",
53
- "comments": {
54
- "prerelease": [
55
- {
56
- "author": "beachball",
57
- "package": "@fluentui/react-virtualizer",
58
- "comment": "Bump @fluentui/react-utilities to v9.6.0",
59
- "commit": "087d981aab96bef2e332a373069a19bc702a7ca2"
60
- }
61
- ]
62
- }
63
- },
64
- {
65
- "date": "Mon, 13 Feb 2023 23:43:14 GMT",
66
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.5",
67
- "version": "9.0.0-alpha.5",
68
- "comments": {
69
- "prerelease": [
70
- {
71
- "author": "beachball",
72
- "package": "@fluentui/react-virtualizer",
73
- "comment": "Bump @fluentui/react-utilities to v9.5.3",
74
- "commit": "29e62b13706c2845b21d665d43cdacf1ef1b1513"
75
- }
76
- ]
77
- }
78
- },
79
- {
80
- "date": "Fri, 10 Feb 2023 08:50:02 GMT",
81
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.4",
82
- "version": "9.0.0-alpha.4",
83
- "comments": {
84
- "prerelease": [
85
- {
86
- "author": "beachball",
87
- "package": "@fluentui/react-virtualizer",
88
- "comment": "Bump @fluentui/react-utilities to v9.5.2",
89
- "commit": "cc62f050f8231e8f21a2cf7dddf33003e0ba3931"
90
- }
91
- ]
92
- }
93
- },
94
- {
95
- "date": "Tue, 31 Jan 2023 19:53:58 GMT",
96
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.3",
97
- "version": "9.0.0-alpha.3",
98
- "comments": {
99
- "prerelease": [
100
- {
101
- "author": "beachball",
102
- "package": "@fluentui/react-virtualizer",
103
- "comment": "Bump @fluentui/react-utilities to v9.5.1",
104
- "commit": "794d9e845cb952f597ba786e70cd8d248be62746"
105
- }
106
- ]
107
- }
108
- },
109
- {
110
- "date": "Thu, 26 Jan 2023 13:31:03 GMT",
111
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.2",
112
- "version": "9.0.0-alpha.2",
113
- "comments": {
114
- "prerelease": [
115
- {
116
- "author": "beachball",
117
- "package": "@fluentui/react-virtualizer",
118
- "comment": "Bump @fluentui/react-utilities to v9.5.0",
119
- "commit": "403e1370f1effca7d3db131eda381abf31cf66b1"
120
- }
121
- ]
122
- }
123
- },
124
- {
125
- "date": "Mon, 23 Jan 2023 16:43:12 GMT",
126
- "tag": "@fluentui/react-virtualizer_v9.0.0-alpha.1",
127
- "version": "9.0.0-alpha.1",
128
- "comments": {
129
- "prerelease": [
130
- {
131
- "author": "mifraser@microsoft.com",
132
- "package": "@fluentui/react-virtualizer",
133
- "commit": "547235ce85eef5fc65ed0cdd51ef5244d480b4b6",
134
- "comment": "feat: Initial unstable release of the Virtualizer"
135
- }
136
- ]
137
- }
138
- }
139
- ]
140
- }
@@ -1 +0,0 @@
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","marginLeft","marginRight","afterBuffer","style","height","width"],"sources":["../src/packages/react-components/react-virtualizer/src/components/Virtualizer/useVirtualizerStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nconst virtualizerClassName = 'fui-Virtualizer';\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 */\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 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 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 state.beforeContainer.className = mergeClasses(\n virtualizerClassNames.beforeContainer,\n styles.base,\n horizontal ? styles.horizontal : styles.vertical,\n state.beforeContainer.className,\n );\n\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 && { marginLeft: `-${bufferPx}` }),\n // Row-Reverse\n ...(reversed && horizontal && { marginRight: `-${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 state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style,\n };\n\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style,\n };\n\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style,\n };\n\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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AAIzD,MAAMC,oBAAoB,GAAG,iBAAiB;AAC9C,OAAO,MAAMC,qBAAqB,GAAqC;EACrEC,MAAM,EAAE,GAAGF,oBAAoB,UAAU;EACzCG,eAAe,EAAE,GAAGH,oBAAoB,mBAAmB;EAC3DI,KAAK,EAAE,GAAGJ,oBAAoB,SAAS;EACvCK,cAAc,EAAE,GAAGL,oBAAoB;CACxC;AAED,MAAMM,SAAS,gBAAGR,QAAA;EAAAS,IAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAchB;AAEF;;;AAGA,OAAO,MAAMC,6BAA6B,GAAIC,KAAuB,IAAsB;EACzF,MAAMC,MAAM,GAAGb,SAAS,EAAE;EAC1B,MAAM;IAAEc,QAAQ;IAAEC,IAAI;IAAEC,kBAAkB;IAAEC,iBAAiB;IAAEC;EAAU,CAAE,GAAGN,KAAK;EACnF,MAAMN,UAAU,GAAGS,IAAI,KAAK,YAAY;EAExCH,KAAK,CAAChB,MAAM,CAACuB,SAAS,GAAG1B,YAAY,CACnCE,qBAAqB,CAACC,MAAM,EAC5BiB,MAAM,CAACZ,IAAI,EACXY,MAAM,CAACT,QAAQ,EACfE,UAAU,GAAGO,MAAM,CAACP,UAAU,GAAGO,MAAM,CAACL,QAAQ,EAChDI,KAAK,CAAChB,MAAM,CAACuB,SAAS,CACvB;EAEDP,KAAK,CAACd,KAAK,CAACqB,SAAS,GAAG1B,YAAY,CAClCE,qBAAqB,CAACG,KAAK,EAC3Be,MAAM,CAACZ,IAAI,EACXY,MAAM,CA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AAE3B,UAAU,GAAGe,aAAa,GAAG,MAAM;IAC1C,GAAGT,KAAK,CAACb,cAAc,CAACgC;GACzB;EAED,OAAOnB,KAAK;AACd,CAAC"}
@@ -1,115 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useVirtualizerStyles_unstable = exports.virtualizerClassNames = void 0;
7
- const react_1 = /*#__PURE__*/require("@griffel/react");
8
- const virtualizerClassName = 'fui-Virtualizer';
9
- exports.virtualizerClassNames = {
10
- before: `${virtualizerClassName}__before`,
11
- beforeContainer: `${virtualizerClassName}__beforeContainer`,
12
- after: `${virtualizerClassName}__after`,
13
- afterContainer: `${virtualizerClassName}__afterContainer`
14
- };
15
- const useStyles = /*#__PURE__*/react_1.__styles({
16
- base: {
17
- mc9l5x: "ftgm304",
18
- Bkecrkj: "f1aehjj5"
19
- },
20
- relative: {
21
- qhf8xq: "f10pi13n"
22
- },
23
- horizontal: {
24
- sshi5w: "fan4evk"
25
- },
26
- vertical: {
27
- Bf4jedk: "f11qra4b"
28
- }
29
- }, {
30
- d: [".ftgm304{display:block;}", ".f1aehjj5{pointer-events:none;}", ".f10pi13n{position:relative;}", ".fan4evk{min-height:100%;}", ".f11qra4b{min-width:100%;}"]
31
- });
32
- /**
33
- * Apply styling to the Virtualizer states
34
- */
35
- const useVirtualizerStyles_unstable = state => {
36
- const styles = useStyles();
37
- const {
38
- reversed,
39
- axis,
40
- beforeBufferHeight,
41
- afterBufferHeight,
42
- bufferSize
43
- } = state;
44
- const horizontal = axis === 'horizontal';
45
- state.before.className = react_1.mergeClasses(exports.virtualizerClassNames.before, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.before.className);
46
- state.after.className = react_1.mergeClasses(exports.virtualizerClassNames.after, styles.base, styles.relative, horizontal ? styles.horizontal : styles.vertical, state.after.className);
47
- state.beforeContainer.className = react_1.mergeClasses(exports.virtualizerClassNames.beforeContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.beforeContainer.className);
48
- state.afterContainer.className = react_1.mergeClasses(exports.virtualizerClassNames.afterContainer, styles.base, horizontal ? styles.horizontal : styles.vertical, state.afterContainer.className);
49
- const beforeHeightPx = beforeBufferHeight + 'px';
50
- const afterHeightPx = afterBufferHeight + 'px';
51
- const beforeBufferHeightPx = beforeBufferHeight + bufferSize + 'px';
52
- const afterBufferHeightPx = afterBufferHeight + bufferSize + 'px';
53
- const bufferPx = bufferSize + 'px';
54
- const beforeBuffer = {
55
- // Column
56
- ...(!reversed && !horizontal && {
57
- marginBottom: `-${bufferPx}`
58
- }),
59
- // Column-Reverse
60
- ...(reversed && !horizontal && {
61
- marginTop: `-${bufferPx}`
62
- }),
63
- // Row
64
- ...(!reversed && horizontal && {
65
- marginLeft: `-${bufferPx}`
66
- }),
67
- // Row-Reverse
68
- ...(reversed && horizontal && {
69
- marginRight: `-${bufferPx}`
70
- })
71
- };
72
- const afterBuffer = {
73
- // Column
74
- ...(!reversed && !horizontal && {
75
- marginTop: `-${bufferPx}`
76
- }),
77
- // Column-Reverse
78
- ...(reversed && !horizontal && {
79
- marginBottom: `-${bufferPx}`
80
- }),
81
- // Row
82
- ...(!reversed && horizontal && {
83
- marginLeft: `-${bufferPx}`
84
- }),
85
- // Row-Reverse
86
- ...(reversed && horizontal && {
87
- marginRight: `-${bufferPx}`
88
- })
89
- };
90
- state.before.style = {
91
- height: horizontal ? '100%' : beforeBufferHeightPx,
92
- width: horizontal ? beforeBufferHeightPx : '100%',
93
- ...beforeBuffer,
94
- ...state.before.style
95
- };
96
- state.beforeContainer.style = {
97
- height: horizontal ? 'auto' : beforeHeightPx,
98
- width: horizontal ? beforeHeightPx : 'auto',
99
- ...state.beforeContainer.style
100
- };
101
- state.after.style = {
102
- height: horizontal ? '100%' : afterBufferHeightPx,
103
- width: horizontal ? afterBufferHeightPx : '100%',
104
- ...afterBuffer,
105
- ...state.after.style
106
- };
107
- state.afterContainer.style = {
108
- height: horizontal ? 'auto' : afterHeightPx,
109
- width: horizontal ? afterHeightPx : 'auto',
110
- ...state.afterContainer.style
111
- };
112
- return state;
113
- };
114
- exports.useVirtualizerStyles_unstable = useVirtualizerStyles_unstable;
115
- //# sourceMappingURL=useVirtualizerStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["react_1","require","virtualizerClassName","exports","virtualizerClassNames","before","beforeContainer","after","afterContainer","useStyles","__styles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","useVirtualizerStyles_unstable","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","mergeClasses","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginLeft","marginRight","afterBuffer","style","height","width"],"sources":["../src/packages/react-components/react-virtualizer/src/components/Virtualizer/useVirtualizerStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { VirtualizerSlots, VirtualizerState } from './Virtualizer.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nconst virtualizerClassName = 'fui-Virtualizer';\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 */\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 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 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 state.beforeContainer.className = mergeClasses(\n virtualizerClassNames.beforeContainer,\n styles.base,\n horizontal ? styles.horizontal : styles.vertical,\n state.beforeContainer.className,\n );\n\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 && { marginLeft: `-${bufferPx}` }),\n // Row-Reverse\n ...(reversed && horizontal && { marginRight: `-${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 state.before.style = {\n height: horizontal ? '100%' : beforeBufferHeightPx,\n width: horizontal ? beforeBufferHeightPx : '100%',\n ...beforeBuffer,\n ...state.before.style,\n };\n\n state.beforeContainer.style = {\n height: horizontal ? 'auto' : beforeHeightPx,\n width: horizontal ? beforeHeightPx : 'auto',\n ...state.beforeContainer.style,\n };\n\n state.after.style = {\n height: horizontal ? '100%' : afterBufferHeightPx,\n width: horizontal ? afterBufferHeightPx : '100%',\n ...afterBuffer,\n ...state.after.style,\n };\n\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"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAIA,MAAMC,oBAAoB,GAAG,iBAAiB;AACjCC,OAAA,CAAAC,qBAAqB,GAAqC;EACrEC,MAAM,EAAE,GAAGH,oBAAoB,UAAU;EACzCI,eAAe,EAAE,GAAGJ,oBAAoB,mBAAmB;EAC3DK,KAAK,EAAE,GAAGL,oBAAoB,SAAS;EACvCM,cAAc,EAAE,GAAGN,oBAAoB;CACxC;AAED,MAAMO,SAAS,gBAAGT,OAAA,CAAAU,QAAU;EAAAC,IAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAc1B;AAEF;;;AAGO,MAAMC,6BAA6B,GAAIC,KAAuB,IAAsB;EACzF,MAAMC,MAAM,GAAGd,SAAS,EAAE;EAC1B,MAAM;IAAEe,QAAQ;IAAEC,IAAI;IAAEC,kBAAkB;IAAEC,iBAAiB;IAAEC;EAAU,CAAE,GAAGN,KAAK;EACnF,MAAMN,UAAU,GAAGS,IAAI,KAAK,YAAY;EAExCH,KAAK,CAACjB,MAAM,CAACwB,SAAS,GAAG7B,OAAA,CAAA8B,YAAY,CACnC3B,OAAA,CAAAC,qBAAqB,CAACC,MAAM,EAC5BkB,MAAM,CAACZ,IAAI,EACXY,MAAM,CAACT,QAAQ,EACfE,UAAU,GAAGO,MAAM,CAACP,UAAU,GAAGO,MAAM,CAACL,QAAQ,EAChDI,KAAK,CAACjB,MAAM,CAACwB,SAAS,CACvB;EAEDP,KAAK,CAACf,KAAK,CAACsB,SAAS,GAAG7B,OAAA,CAAA8B,YAAY,CAClC3B,OAAA,CAAAC,qBAAqB,C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