@fluentui/react-virtualizer 9.0.0-alpha.80 → 9.0.0-alpha.81

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 (96) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/lib/Hooks.js.map +1 -1
  3. package/lib/Utilities.js.map +1 -1
  4. package/lib/Virtualizer.js.map +1 -1
  5. package/lib/VirtualizerScrollView.js.map +1 -1
  6. package/lib/VirtualizerScrollViewDynamic.js.map +1 -1
  7. package/lib/components/Virtualizer/Virtualizer.js.map +1 -1
  8. package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
  9. package/lib/components/Virtualizer/index.js.map +1 -1
  10. package/lib/components/Virtualizer/renderVirtualizer.js.map +1 -1
  11. package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
  12. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -1
  13. package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -1
  14. package/lib/components/VirtualizerScrollView/index.js.map +1 -1
  15. package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -1
  16. package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
  17. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -1
  18. package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
  19. package/lib/components/VirtualizerScrollViewDynamic/index.js.map +1 -1
  20. package/lib/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -1
  21. package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
  22. package/lib/hooks/hooks.types.js +4 -1
  23. package/lib/hooks/hooks.types.js.map +1 -1
  24. package/lib/hooks/index.js.map +1 -1
  25. package/lib/hooks/useDynamicPagination.js.map +1 -1
  26. package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
  27. package/lib/hooks/useIntersectionObserver.js.map +1 -1
  28. package/lib/hooks/useMeasureList.js.map +1 -1
  29. package/lib/hooks/useMutationObserver.js.map +1 -1
  30. package/lib/hooks/useResizeObserverRef.js.map +1 -1
  31. package/lib/hooks/useStaticPagination.js.map +1 -1
  32. package/lib/hooks/useVirtualizerMeasure.js.map +1 -1
  33. package/lib/index.js.map +1 -1
  34. package/lib/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -1
  35. package/lib/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -1
  36. package/lib/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -1
  37. package/lib/utilities/ImperativeScrolling/index.js.map +1 -1
  38. package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
  39. package/lib/utilities/VirtualizerContext/index.js.map +1 -1
  40. package/lib/utilities/VirtualizerContext/types.js.map +1 -1
  41. package/lib/utilities/createResizeObserverFromDocument.js.map +1 -1
  42. package/lib/utilities/debounce.js.map +1 -1
  43. package/lib/utilities/index.js.map +1 -1
  44. package/lib-commonjs/Hooks.js.map +1 -1
  45. package/lib-commonjs/Utilities.js.map +1 -1
  46. package/lib-commonjs/Virtualizer.js.map +1 -1
  47. package/lib-commonjs/VirtualizerScrollView.js.map +1 -1
  48. package/lib-commonjs/VirtualizerScrollViewDynamic.js.map +1 -1
  49. package/lib-commonjs/components/Virtualizer/Virtualizer.js.map +1 -1
  50. package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +1 -1
  51. package/lib-commonjs/components/Virtualizer/index.js.map +1 -1
  52. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js +3 -3
  53. package/lib-commonjs/components/Virtualizer/renderVirtualizer.js.map +1 -1
  54. package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +1 -1
  55. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js +3 -3
  56. package/lib-commonjs/components/Virtualizer/useVirtualizerStyles.styles.js.map +1 -1
  57. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -1
  58. package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -1
  59. package/lib-commonjs/components/VirtualizerScrollView/index.js.map +1 -1
  60. package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -1
  61. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
  62. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js +3 -3
  63. package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.styles.js.map +1 -1
  64. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.js.map +1 -1
  65. package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
  66. package/lib-commonjs/components/VirtualizerScrollViewDynamic/index.js.map +1 -1
  67. package/lib-commonjs/components/VirtualizerScrollViewDynamic/renderVirtualizerScrollViewDynamic.js.map +1 -1
  68. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
  69. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js +3 -3
  70. package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamicStyles.styles.js.map +1 -1
  71. package/lib-commonjs/hooks/hooks.types.js +4 -1
  72. package/lib-commonjs/hooks/hooks.types.js.map +1 -1
  73. package/lib-commonjs/hooks/index.js.map +1 -1
  74. package/lib-commonjs/hooks/useDynamicPagination.js.map +1 -1
  75. package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
  76. package/lib-commonjs/hooks/useIntersectionObserver.js.map +1 -1
  77. package/lib-commonjs/hooks/useMeasureList.js +3 -3
  78. package/lib-commonjs/hooks/useMeasureList.js.map +1 -1
  79. package/lib-commonjs/hooks/useMutationObserver.js.map +1 -1
  80. package/lib-commonjs/hooks/useResizeObserverRef.js.map +1 -1
  81. package/lib-commonjs/hooks/useStaticPagination.js.map +1 -1
  82. package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +1 -1
  83. package/lib-commonjs/index.js +37 -37
  84. package/lib-commonjs/index.js.map +1 -1
  85. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.js.map +1 -1
  86. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrolling.types.js.map +1 -1
  87. package/lib-commonjs/utilities/ImperativeScrolling/imperativeScrollingDynamic.js.map +1 -1
  88. package/lib-commonjs/utilities/ImperativeScrolling/index.js.map +1 -1
  89. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js +3 -3
  90. package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
  91. package/lib-commonjs/utilities/VirtualizerContext/index.js.map +1 -1
  92. package/lib-commonjs/utilities/VirtualizerContext/types.js.map +1 -1
  93. package/lib-commonjs/utilities/createResizeObserverFromDocument.js.map +1 -1
  94. package/lib-commonjs/utilities/debounce.js.map +1 -1
  95. package/lib-commonjs/utilities/index.js.map +1 -1
  96. package/package.json +4 -4
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- virtualizerClassNames: function() {
13
- return virtualizerClassNames;
14
- },
15
12
  useVirtualizerStyles_unstable: function() {
16
13
  return useVirtualizerStyles_unstable;
14
+ },
15
+ virtualizerClassNames: function() {
16
+ return virtualizerClassNames;
17
17
  }
18
18
  });
19
19
  const _react = require("@griffel/react");
@@ -1 +1 @@
1
- {"version":3,"sources":["useVirtualizerStyles.styles.js"],"sourcesContent":["import { __styles, 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 = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"ftgm304\",\n Bkecrkj: \"f1aehjj5\"\n },\n relative: {\n qhf8xq: \"f10pi13n\"\n },\n horizontal: {\n sshi5w: \"fan4evk\"\n },\n vertical: {\n Bf4jedk: \"f11qra4b\"\n }\n}, {\n d: [\".ftgm304{display:block;}\", \".f1aehjj5{pointer-events:none;}\", \".f10pi13n{position:relative;}\", \".fan4evk{min-height:100%;}\", \".f11qra4b{min-width:100%;}\"]\n});\n/**\n * Apply styling to the Virtualizer states\n */\nexport const useVirtualizerStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n const {\n reversed,\n axis,\n beforeBufferHeight,\n afterBufferHeight,\n bufferSize\n } = 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//# sourceMappingURL=useVirtualizerStyles.styles.js.map"],"names":["virtualizerClassNames","useVirtualizerStyles_unstable","virtualizerClassName","before","beforeContainer","after","afterContainer","useStyles","__styles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","mergeClasses","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"mappings":";;;;;;;;;;;IAEaA,qBAAqB;eAArBA;;IA0BAC,6BAA6B;eAA7BA;;;uBA5B0B;AACvC,MAAMC,uBAAuB;AACtB,MAAMF,wBAAwB;IACnCG,QAAQ,CAAC,EAAED,qBAAqB,QAAQ,CAAC;IACzCE,iBAAiB,CAAC,EAAEF,qBAAqB,iBAAiB,CAAC;IAC3DG,OAAO,CAAC,EAAEH,qBAAqB,OAAO,CAAC;IACvCI,gBAAgB,CA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B;IACApB,MAAMf,eAAe,CAACmC,KAAK,GAAG;QAC5BC,QAAQ1B,aAAa,SAASc;QAC9Ba,OAAO3B,aAAac,iBAAiB;QACrC,GAAGT,MAAMf,eAAe,CAACmC,KAAK;IAChC;IACApB,MAAMd,KAAK,CAACkC,KAAK,GAAG;QAClBC,QAAQ1B,aAAa,SAASiB;QAC9BU,OAAO3B,aAAaiB,sBAAsB;QAC1C,GAAGO,WAAW;QACd,GAAGnB,MAAMd,KAAK,CAACkC,KAAK;IACtB;IACApB,MAAMb,cAAc,CAACiC,KAAK,GAAG;QAC3BC,QAAQ1B,aAAa,SAASe;QAC9BY,OAAO3B,aAAae,gBAAgB;QACpC,GAAGV,MAAMb,cAAc,CAACiC,KAAK;IAC/B;IACA,OAAOpB;AACT,GACA,uDAAuD"}
1
+ {"version":3,"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"],"names":["useVirtualizerStyles_unstable","virtualizerClassNames","virtualizerClassName","before","beforeContainer","after","afterContainer","useStyles","__styles","base","mc9l5x","Bkecrkj","relative","qhf8xq","horizontal","sshi5w","vertical","Bf4jedk","d","state","styles","reversed","axis","beforeBufferHeight","afterBufferHeight","bufferSize","className","mergeClasses","beforeHeightPx","afterHeightPx","beforeBufferHeightPx","afterBufferHeightPx","bufferPx","beforeBuffer","marginBottom","marginTop","marginRight","marginLeft","afterBuffer","style","height","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAyBiBA,6BAA6B;eAA7BA;;IAvBJC,qBAAqB;eAArBA;;;uBAF4B;AACzC,MAAMC,uBAAuB;AACtB,MAAMD,wBAAwB;IACjCE,QAAQ,CAAA,EAAGD,qBAAoB,QAAA,CAAU;IACzCE,iBAAiB,CAAA,EAAGF,qBAAoB,iBAAA,CAAmB;IAC3DG,OAAO,CAAA,EAAGH,qBAAoB,OAAA,CAAS;IACvCI,gBAAgB,CAAA,EAAGJ,qBAAoB,gBAAA,CAAA;AAC3C;AACA,MAAMK,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,MAAA;QAAAC,QAAA;QAAAC,SAAA;IAAA;IAAAC,UAAA;QAAAC,QAAA;IAAA;IAAAC,YAAA;QAAAC,QAAA;IAAA;IAAAC,UAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAiBP,MAAMlB,gCAAiCmB,CAAAA;IAC9C;IACA,MAAMC,SAASb;IACf,MAAM,EAAEc,QAAQ,EAAEC,IAAI,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,UAAAA,EAAY,GAAGN;IAC9E,MAAML,aAAaQ,SAAS;IAC5BH,MAAMhB,MAAM,CAACuB,SAAS,GAAGC,IAAAA,mBAAY,EAAC1B,sBAAsBE,MAAM,EAAEi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ScrollView_unstable } from './useVirtualizerScrollView';\nimport { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';\nimport { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles.styles';\nimport * as React from 'react';\n/**\n * Virtualizer ScrollView\n */ export const VirtualizerScrollView = (props)=>{\n const state = useVirtualizerScrollView_unstable(props);\n useVirtualizerScrollViewStyles_unstable(state);\n return renderVirtualizerScrollView_unstable(state);\n};\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n"],"names":["VirtualizerScrollView","props","state","useVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","renderVirtualizerScrollView_unstable","displayName"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;0CANiC;6CACG;sDACG;iEACjC;AAGZ,MAAMA,wBAAwB,CAACC;IACtC,MAAMC,QAAQC,IAAAA,2DAAiC,EAACF;IAChDG,IAAAA,6EAAuC,EAACF;IACxC,OAAOG,IAAAA,iEAAoC,EAACH;AAChD;AACAF,sBAAsBM,WAAW,GAAG"}
1
+ {"version":3,"sources":["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';\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\n return renderVirtualizerScrollView_unstable(state);\n};\n\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n"],"names":["VirtualizerScrollView","props","state","useVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","renderVirtualizerScrollView_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;0CATqC;6CACG;sDACG;iEACjC;AAMhB,MAAMA,wBAA8D,CAACC;IAC1E,MAAMC,QAAQC,IAAAA,2DAAAA,EAAkCF;IAEhDG,IAAAA,6EAAAA,EAAwCF;IAExC,OAAOG,IAAAA,iEAAAA,EAAqCH;AAC9C;AAEAF,sBAAsBM,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["VirtualizerScrollView.types.ts"],"sourcesContent":["import 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';\nimport type { RefObject } from 'react';\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?: 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":[],"rangeMappings":"","mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './VirtualizerScrollView';\nexport * from './VirtualizerScrollView.types';\nexport * from './useVirtualizerScrollView';\nexport * from './renderVirtualizerScrollView';\nexport * from './useVirtualizerScrollViewStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './VirtualizerScrollView';\nexport * from './VirtualizerScrollView.types';\nexport * from './useVirtualizerScrollView';\nexport * from './renderVirtualizerScrollView';\nexport * from './useVirtualizerScrollViewStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderVirtualizerScrollView.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\nexport const renderVirtualizerScrollView_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.container, {\n children: renderVirtualizer_unstable(state)\n });\n};\n"],"names":["renderVirtualizerScrollView_unstable","state","assertSlots","_jsx","container","children","renderVirtualizer_unstable"],"mappings":";;;;+BAGaA;;;eAAAA;;;4BAHiB;gCACF;mCACe;AACpC,MAAMA,uCAAuC,CAACC;IACjDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,SAAS,EAAE;QACvCC,UAAUC,IAAAA,6CAA0B,EAACL;IACzC;AACJ"}
1
+ {"version":3,"sources":["renderVirtualizerScrollView.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport type { VirtualizerScrollViewSlots, VirtualizerScrollViewState } from './VirtualizerScrollView.types';\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\n\nexport const renderVirtualizerScrollView_unstable = (state: VirtualizerScrollViewState) => {\n assertSlots<VirtualizerScrollViewSlots>(state);\n\n return <state.container>{renderVirtualizer_unstable(state)}</state.container>;\n};\n"],"names":["renderVirtualizerScrollView_unstable","state","assertSlots","_jsx","container","renderVirtualizer_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;4BAPb;gCAI4B;mCACe;AAEpC,MAAMA,uCAAuC,CAACC;IACnDC,IAAAA,2BAAAA,EAAwCD;IAExC,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,SAAS,EAAA;kBAAEC,IAAAA,6CAAAA,EAA2BJ;;AACtD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useVirtualizerScrollView.js"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport { useStaticVirtualizerMeasure } from '../../Hooks';\nimport { useImperativeHandle } from 'react';\nimport { scrollToItemStatic } from '../../Utilities';\nimport { useStaticVirtualizerPagination } from '../../hooks/useStaticPagination';\nexport function useVirtualizerScrollView_unstable(props) {\n const { imperativeRef, itemSize, numItems, axis = 'vertical', reversed, enablePagination = false } = props;\n var _props_axis;\n const { virtualizerLength, bufferItems, bufferSize, scrollRef } = useStaticVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: (_props_axis = props.axis) !== null && _props_axis !== void 0 ? _props_axis : 'vertical'\n });\n // Store the virtualizer length as a ref for imperative ref access\n const virtualizerLengthRef = React.useRef(virtualizerLength);\n if (virtualizerLengthRef.current !== virtualizerLength) {\n virtualizerLengthRef.current = virtualizerLength;\n }\n const paginationRef = useStaticVirtualizerPagination({\n axis,\n itemSize\n }, enablePagination);\n const scrollViewRef = useMergedRefs(props.scrollViewRef, scrollRef, paginationRef);\n const imperativeVirtualizerRef = React.useRef(null);\n const scrollCallbackRef = React.useRef(null);\n useImperativeHandle(imperativeRef, ()=>{\n var _imperativeVirtualizerRef_current;\n return {\n scrollTo (index, behavior = 'auto', callback) {\n var _imperativeVirtualizerRef_current;\n scrollCallbackRef.current = callback !== null && callback !== void 0 ? callback : null;\n (_imperativeVirtualizerRef_current = imperativeVirtualizerRef.current) === null || _imperativeVirtualizerRef_current === void 0 ? void 0 : _imperativeVirtualizerRef_current.setFlaggedIndex(index);\n scrollToItemStatic({\n index,\n itemSize,\n totalItems: numItems,\n scrollViewRef,\n axis,\n reversed,\n behavior\n });\n },\n currentIndex: (_imperativeVirtualizerRef_current = imperativeVirtualizerRef.current) === null || _imperativeVirtualizerRef_current === void 0 ? void 0 : _imperativeVirtualizerRef_current.currentIndex,\n virtualizerLength: virtualizerLengthRef\n };\n }, [\n axis,\n scrollViewRef,\n itemSize,\n numItems,\n reversed\n ]);\n const handleRenderedIndex = (index)=>{\n if (scrollCallbackRef.current) {\n scrollCallbackRef.current(index);\n }\n };\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollViewRef,\n onRenderedFlaggedIndex: handleRenderedIndex,\n imperativeVirtualizerRef\n });\n return {\n ...virtualizerState,\n components: {\n ...virtualizerState.components,\n container: 'div'\n },\n container: slot.always(props.container, {\n defaultProps: {\n ref: scrollViewRef\n },\n elementType: 'div'\n })\n };\n}\n"],"names":["useVirtualizerScrollView_unstable","props","imperativeRef","itemSize","numItems","axis","reversed","enablePagination","_props_axis","virtualizerLength","bufferItems","bufferSize","scrollRef","useStaticVirtualizerMeasure","defaultItemSize","direction","virtualizerLengthRef","React","useRef","current","paginationRef","useStaticVirtualizerPagination","scrollViewRef","useMergedRefs","imperativeVirtualizerRef","scrollCallbackRef","useImperativeHandle","_imperativeVirtualizerRef_current","scrollTo","index","behavior","callback","setFlaggedIndex","scrollToItemStatic","totalItems","currentIndex","handleRenderedIndex","virtualizerState","useV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6BAAkB,EAAC;oBACfJ;oBACA1B;oBACA+B,YAAY9B;oBACZkB;oBACAjB;oBACAC;oBACAwB;gBACJ;YACJ;YACAK,cAAc,AAACR,CAAAA,oCAAoCH,yBAAyBL,OAAO,AAAD,MAAO,QAAQQ,sCAAsC,KAAK,IAAI,KAAK,IAAIA,kCAAkCQ,YAAY;YACvM1B,mBAAmBO;QACvB;IACJ,GAAG;QACCX;QACAiB;QACAnB;QACAC;QACAE;KACH;IACD,MAAM8B,sBAAsB,CAACP;QACzB,IAAIJ,kBAAkBN,OAAO,EAAE;YAC3BM,kBAAkBN,OAAO,CAACU;QAC9B;IACJ;IACA,MAAMQ,mBAAmBC,IAAAA,uCAAuB,EAAC;QAC7C,GAAGrC,KAAK;QACRQ;QACAC;QACAC;QACAW;QACAiB,wBAAwBH;QACxBZ;IACJ;IACA,OAAO;QACH,GAAGa,gBAAgB;QACnBG,YAAY;YACR,GAAGH,iBAAiBG,UAAU;YAC9BC,WAAW;QACf;QACAA,WAAWC,oBAAI,CAACC,MAAM,CAAC1C,MAAMwC,SAAS,EAAE;YACpCG,cAAc;gBACVC,KAAKvB;YACT;YACAwB,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useVirtualizerScrollView.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport type { VirtualizerScrollViewProps, VirtualizerScrollViewState } from './VirtualizerScrollView.types';\nimport { useStaticVirtualizerMeasure } from '../../Hooks';\nimport { useImperativeHandle } from 'react';\nimport { scrollToItemStatic } from '../../Utilities';\nimport type { VirtualizerDataRef } from '../Virtualizer/Virtualizer.types';\nimport { useStaticVirtualizerPagination } from '../../hooks/useStaticPagination';\n\nexport function useVirtualizerScrollView_unstable(props: VirtualizerScrollViewProps): VirtualizerScrollViewState {\n const { imperativeRef, itemSize, numItems, axis = 'vertical', reversed, enablePagination = false } = props;\n const { virtualizerLength, bufferItems, bufferSize, scrollRef } = useStaticVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: props.axis ?? 'vertical',\n });\n\n // Store the virtualizer length as a ref for imperative ref access\n const virtualizerLengthRef = React.useRef<number>(virtualizerLength);\n if (virtualizerLengthRef.current !== virtualizerLength) {\n virtualizerLengthRef.current = virtualizerLength;\n }\n\n const paginationRef = useStaticVirtualizerPagination({ axis, itemSize }, enablePagination);\n const scrollViewRef = useMergedRefs(props.scrollViewRef, scrollRef, paginationRef) as React.RefObject<HTMLDivElement>;\n const imperativeVirtualizerRef = React.useRef<VirtualizerDataRef | null>(null);\n const scrollCallbackRef = React.useRef<null | ((index: number) => void)>(null);\n\n useImperativeHandle(\n imperativeRef,\n () => {\n return {\n scrollTo(index: number, behavior = 'auto', callback: ((index: number) => void) | undefined) {\n scrollCallbackRef.current = callback ?? null;\n imperativeVirtualizerRef.current?.setFlaggedIndex(index);\n scrollToItemStatic({\n index,\n itemSize,\n totalItems: numItems,\n scrollViewRef,\n axis,\n reversed,\n behavior,\n });\n },\n currentIndex: imperativeVirtualizerRef.current?.currentIndex,\n virtualizerLength: virtualizerLengthRef,\n };\n },\n [axis, scrollViewRef, itemSize, numItems, reversed],\n );\n\n const handleRenderedIndex = (index: number) => {\n if (scrollCallbackRef.current) {\n scrollCallbackRef.current(index);\n }\n };\n\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollViewRef,\n onRenderedFlaggedIndex: handleRenderedIndex,\n imperativeVirtualizerRef,\n });\n\n return {\n ...virtualizerState,\n components: {\n ...virtualizerState.components,\n container: 'div',\n },\n container: slot.always(props.container, {\n defaultProps: {\n ref: scrollViewRef as React.RefObject<HTMLDivElement>,\n },\n elementType: 'div',\n }),\n };\n}\n"],"names":["useVirtualizerScrollView_unstable","props","imperativeRef","itemSize","numItems","axis","reversed","enablePagination","virtualizerLength","bufferItems","bufferSize","scrollRef","useStaticVirtualizerMeasure","defaultItemSize","direction","virtualizerLengthRef","React","useRef","current","paginationRef","useStaticVirtualizerPagination","scrollViewRef","useMergedRefs","imperativeVirtualizerRef","scrollCallbackRef","useImperativeHandle","scrollTo","index","behavior","callback","setFlaggedIndex","scrollToItemStatic","totalItems","currentIndex","handleRenderedIndex","virtualizerState","useVirtualizer_unstable","onRenderedFlaggedIndex","components","container","slot","always","defaultProps","ref","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUgBA;;;eAAAA;;;;iEAVO;gCACa;gCACI;uBAEI;2BAET;qCAEY;AAExC,SAASA,kCAAkCC,KAAiC;IACjF,MAAM,EAAEC,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,UAAU,EAAEC,QAAQ,EAAEC,mBAAmB,KAAK,EAAE,GAAGN;QAGxFA;IAFb,MAAM,EAAEO,iBAAiB,EAAEC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAE,GAAGC,IAAAA,kCAAAA,EAA4B;QAC5FC,iBAAiBZ,MAAME,QAAQ;QAC/BW,WAAWb,CAAAA,cAAAA,MAAMI,IAAI,AAAJA,MAAI,QAAVJ,gBAAAA,KAAAA,IAAAA,cAAc;IAC3B;IAEA,kEAAkE;IAClE,MAAMc,uBAAuBC,OAAMC,MAAM,CAAST;IAClD,IAAIO,qBAAqBG,OAAO,KAAKV,mBAAmB;QACtDO,qBAAqBG,OAAO,GAAGV;IACjC;IAEA,MAAMW,gBAAgBC,IAAAA,mDAAAA,EAA+B;QAAEf;QAAMF;IAAS,GAAGI;IACzE,MAAMc,gBAAgBC,IAAAA,6BAAAA,EAAcrB,MAAMoB,aAAa,EAAEV,WAAWQ;IACpE,MAAMI,2BAA2BP,OAAMC,MAAM,CAA4B;IACzE,MAAMO,oBAAoBR,OAAMC,MAAM,CAAmC;IAEzEQ,IAAAA,0BAAAA,EACEvB,eACA;YAekBqB;QAdhB,OAAO;YACLG,UAASC,KAAa,EAAEC,WAAW,MAAM,EAAEC,QAA+C;oBAExFN;gBADAC,kBAAkBN,OAAO,GAAGW,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,WAAY;gBACxCN,CAAAA,oCAAAA,yBAAyBL,OAAO,AAAPA,MAAO,QAAhCK,sCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kCAAkCO,eAAe,CAACH;gBAClDI,IAAAA,6BAAAA,EAAmB;oBACjBJ;oBACAxB;oBACA6B,YAAY5B;oBACZiB;oBACAhB;oBACAC;oBACAsB;gBACF;YACF;YACAK,cAAY,AAAEV,CAAAA,oCAAAA,yBAAyBL,OAAO,AAAPA,MAAO,QAAhCK,sCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kCAAkCU,YAAY;YAC5DzB,mBAAmBO;QACrB;IACF,GACA;QAACV;QAAMgB;QAAelB;QAAUC;QAAUE;KAAS;IAGrD,MAAM4B,sBAAsB,CAACP;QAC3B,IAAIH,kBAAkBN,OAAO,EAAE;YAC7BM,kBAAkBN,OAAO,CAACS;QAC5B;IACF;IAEA,MAAMQ,mBAAmBC,IAAAA,uCAAAA,EAAwB;QAC/C,GAAGnC,KAAK;QACRO;QACAC;QACAC;QACAW;QACAgB,wBAAwBH;QACxBX;IACF;IAEA,OAAO;QACL,GAAGY,gBAAgB;QACnBG,YAAY;YACV,GAAGH,iBAAiBG,UAAU;YAC9BC,WAAW;QACb;QACAA,WAAWC,oBAAAA,CAAKC,MAAM,CAACxC,MAAMsC,SAAS,EAAE;YACtCG,cAAc;gBACZC,KAAKtB;YACP;YACAuB,aAAa;QACf;IACF;AACF"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- virtualizerScrollViewClassNames: function() {
13
- return virtualizerScrollViewClassNames;
14
- },
15
12
  useVirtualizerScrollViewStyles_unstable: function() {
16
13
  return useVirtualizerScrollViewStyles_unstable;
14
+ },
15
+ virtualizerScrollViewClassNames: function() {
16
+ return virtualizerScrollViewClassNames;
17
17
  }
18
18
  });
19
19
  const _useVirtualizerStylesstyles = require("../Virtualizer/useVirtualizerStyles.styles");
@@ -1 +1 @@
1
- {"version":3,"sources":["useVirtualizerScrollViewStyles.styles.js"],"sourcesContent":["import { useVirtualizerStyles_unstable, virtualizerClassNames } from '../Virtualizer/useVirtualizerStyles.styles';\nimport { __styles, mergeClasses } from '@griffel/react';\nconst virtualizerScrollViewClassName = 'fui-Virtualizer-Scroll-View';\nexport const virtualizerScrollViewClassNames = {\n ...virtualizerClassNames,\n container: `${virtualizerScrollViewClassName}__container`\n};\nconst useStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n a9b677: \"fly5x3f\",\n Bqenvij: \"f1l02sjl\"\n },\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Bmxbyg5: \"f5zp4f\"\n },\n horizontal: {\n Beiy3e4: \"f1063pyq\",\n B68tc82: \"f1oy3dpc\"\n },\n verticalReversed: {\n Beiy3e4: \"f1gkdon0\",\n Bmxbyg5: \"f5zp4f\"\n },\n horizontalReversed: {\n Beiy3e4: \"f1oztnx0\",\n B68tc82: \"f1oy3dpc\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".fly5x3f{width:100%;}\", \".f1l02sjl{height:100%;}\", \".f1vx9l62{flex-direction:column;}\", \".f5zp4f{overflow-y:auto;}\", \".f1063pyq{flex-direction:row;}\", \".f1oy3dpc{overflow-x:auto;}\", \".f1gkdon0{flex-direction:column-reverse;}\", \".f1oztnx0{flex-direction:row-reverse;}\"]\n});\n/**\n * Apply styling to the Virtualizer states\n */\nexport const useVirtualizerScrollViewStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n // Default virtualizer styles base\n useVirtualizerStyles_unstable(state);\n const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;\n // Add container styles\n state.container.className = mergeClasses(virtualizerScrollViewClassNames.container, styles.base, containerStyle, state.container.className);\n return state;\n};\n//# sourceMappingURL=useVirtualizerScrollViewStyles.styles.js.map"],"names":["virtualizerScrollViewClassNames","useVirtualizerScrollViewStyles_unstable","virtualizerScrollViewClassName","virtualizerClassNames","container","useStyles","__styles","base","mc9l5x","a9b677","Bqenvij","vertical","Beiy3e4","Bmxbyg5","horizontal","B68tc82","verticalReversed","horizontalReversed","d","state","styles","useVirtualizerStyles_unstable","containerStyle","axis","reversed","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,+BAA+B;eAA/BA;;IAgCAC,uCAAuC;eAAvCA;;;4CAnCwD;uBAC9B;AACvC,MAAMC,iCAAiC;AAChC,MAAMF,kCAAkC;IAC7C,GAAGG,iDAAqB;IACxBC,WAAW,CAAC,EAAEF,+BAA+B,WAAW,CAAC;AAC3D;AACA,MAAMG,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCC,MAAM;QACJC,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;IACAC,UAAU;QACRC,SAAS;QACTC,SAAS;IACX;IACAC,YAAY;QACVF,SAAS;QACTG,SAAS;IACX;IACAC,kBAAkB;QAChBJ,SAAS;QACTC,SAAS;IACX;IACAI,oBAAoB;QAClBL,SAAS;QACTG,SAAS;IACX;AACF,GAAG;IACDG,GAAG;QAAC;QAA2B;QAAyB;QAA2B;QAAqC;QAA6B;QAAkC;QAA+B;QAA6C;KAAyC;AAC9S;AAIO,MAAMjB,0CAA0CkB,CAAAA;IACrD;IAEA,MAAMC,SAASf;IACf,kCAAkC;IAClCgB,IAAAA,yDAA6B,EAACF;IAC9B,MAAMG,iBAAiBH,MAAMI,IAAI,KAAK,eAAeJ,MAAMK,QAAQ,GAAGJ,OAAOH,kBAAkB,GAAGG,OAAON,UAAU,GAAGK,MAAMK,QAAQ,GAAGJ,OAAOJ,gBAAgB,GAAGI,OAAOT,QAAQ;IAChL,uBAAuB;IACvBQ,MAAMf,SAAS,CAACqB,SAAS,GAAGC,IAAAA,mBAAY,EAAC1B,gCAAgCI,SAAS,EAAEgB,OAAOb,IAAI,EAAEe,gBAAgBH,MAAMf,SAAS,CAACqB,SAAS;IAC1I,OAAON;AACT,GACA,iEAAiE"}
1
+ {"version":3,"sources":["useVirtualizerScrollViewStyles.styles.js"],"sourcesContent":["import { useVirtualizerStyles_unstable, virtualizerClassNames } from '../Virtualizer/useVirtualizerStyles.styles';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nconst virtualizerScrollViewClassName = 'fui-Virtualizer-Scroll-View';\nexport const virtualizerScrollViewClassNames = {\n ...virtualizerClassNames,\n container: `${virtualizerScrollViewClassName}__container`\n};\nconst useStyles = makeStyles({\n base: {\n display: 'flex',\n width: '100%',\n height: '100%'\n },\n vertical: {\n flexDirection: 'column',\n overflowY: 'auto'\n },\n horizontal: {\n flexDirection: 'row',\n overflowX: 'auto'\n },\n verticalReversed: {\n flexDirection: 'column-reverse',\n overflowY: 'auto'\n },\n horizontalReversed: {\n flexDirection: 'row-reverse',\n overflowX: 'auto'\n }\n});\n/**\n * Apply styling to the Virtualizer states\n */ export const useVirtualizerScrollViewStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n // Default virtualizer styles base\n useVirtualizerStyles_unstable(state);\n const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;\n // Add container styles\n state.container.className = mergeClasses(virtualizerScrollViewClassNames.container, styles.base, containerStyle, state.container.className);\n return state;\n};\n"],"names":["useVirtualizerScrollViewStyles_unstable","virtualizerScrollViewClassNames","virtualizerScrollViewClassName","virtualizerClassNames","container","useStyles","__styles","base","mc9l5x","a9b677","Bqenvij","vertical","Beiy3e4","Bmxbyg5","horizontal","B68tc82","verticalReversed","horizontalReversed","d","state","styles","useVirtualizerStyles_unstable","containerStyle","axis","reversed","className","mergeClasses"],"rangeMappings":";;;;;;;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ollViewDynamic';\nimport { renderVirtualizerScrollViewDynamic_unstable } from './renderVirtualizerScrollViewDynamic';\nimport { useVirtualizerScrollViewDynamicStyles_unstable } from './useVirtualizerScrollViewDynamicStyles.styles';\nimport * as React from 'react';\n/**\n * Virtualizer ScrollView\n */ export const VirtualizerScrollViewDynamic = (props, context)=>{\n const state = useVirtualizerScrollViewDynamic_unstable(props);\n useVirtualizerScrollViewDynamicStyles_unstable(state);\n return renderVirtualizerScrollViewDynamic_unstable(state);\n};\nVirtualizerScrollViewDynamic.displayName = 'VirtualizerScrollViewDynamic';\n"],"names":["VirtualizerScrollViewDynamic","props","context","state","useVirtualizerScrollViewDynamic_unstable","useVirtualizerScrollViewDynamicStyles_unstable","renderVirtualizerScrollViewDynamic_unstable","displayName"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;iDANwC;oDACG;6DACG;iEACxC;AAGZ,MAAMA,+BAA+B,CAACC,OAAOC;IACpD,MAAMC,QAAQC,IAAAA,yEAAwC,EAACH;IACvDI,IAAAA,2FAA8C,EAACF;IAC/C,OAAOG,IAAAA,+EAA2C,EAACH;AACvD;AACAH,6BAA6BO,WAAW,GAAG"}
1
+ {"version":3,"sources":["VirtualizerScrollViewDynamic.ts"],"sourcesContent":["import type { VirtualizerScrollViewDynamicProps } from './VirtualizerScrollViewDynamic.types';\nimport { useVirtualizerScrollViewDynamic_unstable } from './useVirtualizerScrollViewDynamic';\nimport { renderVirtualizerScrollViewDynamic_unstable } from './renderVirtualizerScrollViewDynamic';\nimport { useVirtualizerScrollViewDynamicStyles_unstable } from './useVirtualizerScrollViewDynamicStyles.styles';\nimport * as React from 'react';\nimport type { VirtualizerContextProps } from '../../Utilities';\n\n/**\n * Virtualizer ScrollView\n */\n\nexport const VirtualizerScrollViewDynamic: React.FC<VirtualizerScrollViewDynamicProps> = (\n props: VirtualizerScrollViewDynamicProps,\n context: React.Context<VirtualizerContextProps>,\n) => {\n const state = useVirtualizerScrollViewDynamic_unstable(props);\n\n useVirtualizerScrollViewDynamicStyles_unstable(state);\n\n return renderVirtualizerScrollViewDynamic_unstable(state);\n};\n\nVirtualizerScrollViewDynamic.displayName = 'VirtualizerScrollViewDynamic';\n"],"names":["VirtualizerScrollViewDynamic","props","context","state","useVirtualizerScrollViewDynamic_unstable","useVirtualizerScrollViewDynamicStyles_unstable","renderVirtualizerScrollViewDynamic_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iDAV4C;oDACG;6DACG;iEACxC;AAOhB,MAAMA,+BAA4E,CACvFC,OACAC;IAEA,MAAMC,QAAQC,IAAAA,yEAAAA,EAAyCH;IAEvDI,IAAAA,2FAAAA,EAA+CF;IAE/C,OAAOG,IAAAA,+EAAAA,EAA4CH;AACrD;AAEAH,6BAA6BO,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["VirtualizerScrollViewDynamic.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type {\n VirtualizerConfigProps,\n VirtualizerConfigState,\n VirtualizerChildRenderFunction,\n} from '../Virtualizer/Virtualizer.types';\n\nimport type { VirtualizerScrollViewSlots } from '../VirtualizerScrollView/VirtualizerScrollView.types';\nimport type { RefObject } from 'react';\nimport type { ScrollToInterface } from '../../Utilities';\n\nexport type VirtualizerScrollViewDynamicSlots = VirtualizerScrollViewSlots;\n\nexport type VirtualizerScrollViewDynamicProps = ComponentProps<Partial<VirtualizerScrollViewDynamicSlots>> &\n Partial<Omit<VirtualizerConfigProps, 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex'>> & {\n /**\n * Set as the minimum item size.\n * Axis: 'vertical' = Height\n * Axis: 'horizontal' = Width\n */\n itemSize: number;\n /**\n * Callback for acquiring size of individual items\n * @param index - the index of the requested size's child\n * If undefined, Virtualizer will auto-measure by default (performance tradeoff)\n */\n getItemSize?: (index: number) => 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?: RefObject<ScrollToInterface>;\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n enablePagination?: boolean;\n };\n\nexport type VirtualizerScrollViewDynamicState = ComponentState<VirtualizerScrollViewDynamicSlots> &\n VirtualizerConfigState;\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './VirtualizerScrollViewDynamic';\nexport * from './VirtualizerScrollViewDynamic.types';\nexport * from './useVirtualizerScrollViewDynamic';\nexport * from './renderVirtualizerScrollViewDynamic';\nexport * from './useVirtualizerScrollViewDynamicStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './VirtualizerScrollViewDynamic';\nexport * from './VirtualizerScrollViewDynamic.types';\nexport * from './useVirtualizerScrollViewDynamic';\nexport * from './renderVirtualizerScrollViewDynamic';\nexport * from './useVirtualizerScrollViewDynamicStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderVirtualizerScrollViewDynamic.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\nexport const renderVirtualizerScrollViewDynamic_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(state.container, {\n children: renderVirtualizer_unstable(state)\n });\n};\n"],"names":["renderVirtualizerScrollViewDynamic_unstable","state","assertSlots","_jsx","container","children","renderVirtualizer_unstable"],"mappings":";;;;+BAGaA;;;eAAAA;;;4BAHiB;gCACF;mCACe;AACpC,MAAMA,8CAA8C,CAACC;IACxDC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,eAAI,EAACF,MAAMG,SAAS,EAAE;QACvCC,UAAUC,IAAAA,6CAA0B,EAACL;IACzC;AACJ"}
1
+ {"version":3,"sources":["renderVirtualizerScrollViewDynamic.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport {\n VirtualizerScrollViewDynamicSlots,\n VirtualizerScrollViewDynamicState,\n} from './VirtualizerScrollViewDynamic.types';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\n\nexport const renderVirtualizerScrollViewDynamic_unstable = (state: VirtualizerScrollViewDynamicState) => {\n assertSlots<VirtualizerScrollViewDynamicSlots>(state);\n return <state.container>{renderVirtualizer_unstable(state)}</state.container>;\n};\n"],"names":["renderVirtualizerScrollViewDynamic_unstable","state","assertSlots","_jsx","container","renderVirtualizer_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAC4B;mCAKe;AAEpC,MAAMA,8CAA8C,CAACC;IAC1DC,IAAAA,2BAAAA,EAA+CD;IAC/C,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,SAAS,EAAA;kBAAEC,IAAAA,6CAAAA,EAA2BJ;;AACtD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useVirtualizerScrollViewDynamic.js"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport { useDynamicVirtualizerMeasure } from '../../Hooks';\nimport { useVirtualizerContextState_unstable, scrollToItemDynamic } from '../../Utilities';\nimport { useImperativeHandle, useState } from 'react';\nimport { useMeasureList } from '../../hooks/useMeasureList';\nimport { useDynamicVirtualizerPagination } from '../../hooks/useDynamicPagination';\nexport function useVirtualizerScrollViewDynamic_unstable(props) {\n 'use no memo';\n var _imperativeVirtualizerRef_current;\n const contextState = useVirtualizerContextState_unstable(props.virtualizerContext);\n const { imperativeRef, axis = 'vertical', reversed, imperativeVirtualizerRef, enablePagination = false } = props;\n let sizeTrackingArray = React.useRef(new Array(props.numItems).fill(props.itemSize));\n // This lets us trigger updates when a size change occurs.\n const [sizeUpdateCount, setSizeUpdateCount] = useState(0);\n const getChildSizeAuto = React.useCallback((index)=>{\n if (sizeTrackingArray.current.length <= index || sizeTrackingArray.current[index] <= 0) {\n // Default size for initial state or untracked\n return props.itemSize;\n }\n /* Required to be defined prior to our measure function\n * we use a sizing array ref that we will update post-render\n */ return sizeTrackingArray.current[index];\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n sizeTrackingArray,\n props.itemSize,\n sizeUpdateCount\n ]);\n var _props_axis, _props_getItemSize, _contextState_contextIndex;\n const { virtualizerLength, bufferItems, bufferSize, scrollRef } = useDynamicVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: (_props_axis = props.axis) !== null && _props_axis !== void 0 ? _props_axis : 'vertical',\n getItemSize: (_props_getItemSize = props.getItemSize) !== null && _props_getItemSize !== void 0 ? _props_getItemSize : getChildSizeAuto,\n currentIndex: (_contextState_contextIndex = contextState === null || contextState === void 0 ? void 0 : contextState.contextIndex) !== null && _contextState_contextIndex !== void 0 ? _contextState_contextIndex : 0,\n numItems: props.numItems\n });\n const _imperativeVirtualizerRef = useMergedRefs(React.useRef(null), imperativeVirtualizerRef);\n var _contextState_contextIndex1;\n const paginationRef = useDynamicVirtualizerPagination({\n axis,\n progressiveItemSizes: (_imperativeVirtualizerRef_current = _imperativeVirtualizerRef.current) === null || _imperativeVirtualizerRef_current === void 0 ? void 0 : _imperativeVirtualizerRef_current.progressiveSizes,\n virtualizerLength,\n currentIndex: (_contextState_contextIndex1 = contextState === null || contextState === void 0 ? void 0 : contextState.contextIndex) !== null && _contextState_contextIndex1 !== void 0 ? _contextState_contextIndex1 : 0\n }, enablePagination);\n // Store the virtualizer length as a ref for imperative ref access\n const virtualizerLengthRef = React.useRef(virtualizerLength);\n if (virtualizerLengthRef.current !== virtualizerLength) {\n virtualizerLengthRef.current = virtualizerLength;\n }\n const scrollViewRef = useMergedRefs(props.scrollViewRef, scrollRef, paginationRef);\n const scrollCallbackRef = React.useRef(null);\n useImperativeHandle(imperativeRef, ()=>{\n var _imperativeVirtualizerRef_current;\n return {\n scrollTo (index, behavior = 'auto', callback) {\n scrollCallbackRef.current = callback !== null && callback !== void 0 ? callback : null;\n if (_imperativeVirtualizerRef.current) {\n var _imperativeVirtualizerRef_current;\n const progressiveSizes = _imperativeVirtualizerRef.current.progressiveSizes.current;\n const totalSize = progressiveSizes && (progressiveSizes === null || progressiveSizes === void 0 ? void 0 : progressiveSizes.length) > 0 ? progressiveSizes[Math.max(progressiveSizes.length - 1, 0)] : 0;\n _imperativeVirtualizerRef.current.setFlaggedIndex(index);\n scrollToItemDynamic({\n index,\n itemSizes: (_imperativeVirtualizerRef_current = _imperativeVirtualizerRef.current) === null || _imperativeVirtualizerRef_current === void 0 ? void 0 : _imperativeVirtualizerRef_current.nodeSizes,\n totalSize,\n scrollViewRef,\n axis,\n reversed,\n behavior\n });\n }\n },\n currentIndex: (_imperativeVirtualizerRef_current = _imperativeVirtualizerRef.current) === null || _imperativeVirtualizerRef_current === void 0 ? void 0 : _imperativeVirtualizerRef_current.currentIndex,\n virtualizerLength: virtualizerLengthRef\n };\n }, [\n axis,\n scrollViewRef,\n reversed,\n _imperativeVirtualizerRef\n ]);\n const handleRenderedIndex = (index)=>{\n if (scrollCallbackRef.current) {\n scrollCallbackRef.current(index);\n }\n };\n var _props_getItemSize1;\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n getItemSize: (_props_getItemSize1 = props.getItemSize) !== null && _props_getItemSize1 !== void 0 ? _props_getItemSize1 : getChildSizeAuto,\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollViewRef,\n virtualizerContext: contextState,\n imperativeVirtualizerRef: _imperativeVirtualizerRef,\n onRenderedFlaggedIndex: handleRenderedIndex\n });\n const measureObject = useMeasureList(virtualizerState.virtualizerStartIndex, virtualizerLength, props.numItems, props.itemSize);\n if (enablePagination && measureObject.sizeUpdateCount !== sizeUpdateCount) {\n /* This enables us to let callback know that the sizes have been updated\n triggers a re-render but is only required on pagination (else index change handles) */ setSizeUpdateCount(measureObject.sizeUpdateCount);\n }\n if (axis === 'horizontal') {\n sizeTrackingArray = measureObject.widthArray;\n } else {\n sizeTrackingArray = measureObject.heightArray;\n }\n if (!props.getItemSize) {\n // Auto-measuring is required\n React.Children.map(virtualizerState.virtualizedChildren, (child, index)=>{\n if (/*#__PURE__*/ React.isValidElement(child)) {\n virtualizerState.virtualizedChildren[index] = /*#__PURE__*/ React.createElement(child.type, {\n ...child.props,\n key: child.key,\n ref: (element)=>{\n if (child.hasOwnProperty('ref')) {\n // We must access this from the child directly, not props (forward ref).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const localRef = child === null || child === void 0 ? void 0 : child.ref;\n if (typeof localRef === 'function') {\n localRef(element);\n } else if (localRef) {\n localRef.current = element;\n }\n }\n // Call the auto-measure ref attachment.\n measureObject.createIndexedRef(index)(element);\n }\n });\n }\n });\n }\n return {\n ...virtualizerState,\n components: {\n ...virtualizerState.components,\n container: 'div'\n },\n container: slot.always(props.container, {\n defaultProps: {\n ref: scrollViewRef\n },\n elementType: 'div'\n })\n };\n}\n"],"names":["useVirtualizerScrollViewDynamic_unstable","props","_imperativeVirtualizerRef_current","contextState","useVirtualizerContextState_unstable","virtualizerContext","imperativeRef","axis","reversed","imperativeVirtualizerRef","enablePagination","sizeTrackingArray","React","useRef","Array","numItems","fill","itemSize","sizeUpdateCount","setSizeUpdateCount","useState","getChildSizeAuto","useCallback","index","current","length","_props_axis","_props_getItemSize","_contextState_contextIndex","virtualizerLength","bufferItems","bufferSize","scrollRef","useDynamicVirtualizerMeasure","defaultItemSize","direction","getItemSize","currentIndex","contextIndex","_imperativeVirtualizerRef","useMergedRefs","_contextState_contextIndex1","paginationRef","useDynamicVirtualizerPagination","progressiveItemSizes","progressiveSizes","virtualizerLengthRef","scrollViewRef","scrollCallbackRef","useImperativeHandle","scrollTo","behavior","callback","totalSize","Math","max","setFlaggedIndex","scrollToItemDynamic","itemSizes","nodeSizes","handleRenderedIndex","_props_getItemSize1","virtualizerState","useVirtualizer_unstable","onRenderedFlaggedIndex","measureObject","useMeasureList","virtualizerStartIndex","widthArray","heightArray","Children","map","virtualizedChildren","child","isValidElement","createElement","type","key","ref","element","hasOwnProperty","localRef","createIndexedRef","components","container","slot","always","defaultProps","elementType"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;gCACa;gCACI;uBACK;2BAC4B;gCAE1C;sCACiB;AACzC,SAASA,yCAAyCC,KAAK;IAC1D;IACA,IAAIC;IACJ,MAAMC,eAAeC,IAAAA,8CAAmC,EAACH,MAAMI,kBAAkB;IACjF,MAAM,EAAEC,aAAa,EAAEC,OAAO,UAAU,EAAEC,QAAQ,EAAEC,wBAAwB,EAAEC,mBAAmB,KAAK,EAAE,GAAGT;IAC3G,IAAIU,oBAAoBC,OAAMC,MAAM,CAAC,IAAIC,MAAMb,MAAMc,QAAQ,EAAEC,IAAI,CAACf,MAAMgB,QAAQ;IAClF,0DAA0D;IAC1D,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGC,IAAAA,eAAQ,EAAC;IACvD,MAAMC,mBAAmBT,OAAMU,WAAW,CAAC,CAACC;QACxC,IAAIZ,kBAAkBa,OAAO,CAACC,MAAM,IAAIF,SAASZ,kBAAkBa,OAAO,CAACD,MAAM,IAAI,GAAG;YACpF,8CAA8C;YAC9C,OAAOtB,MAAMgB,QAAQ;QACzB;QACA;;OAED,GAAG,OAAON,kBAAkBa,OAAO,CAACD,MAAM;IAC7C,GAC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3D,OAAOwD;oBAC1C;gBACJ;YACJ;QACJ;IACJ;IACA,OAAO;QACH,GAAGjB,gBAAgB;QACnBqB,YAAY;YACR,GAAGrB,iBAAiBqB,UAAU;YAC9BC,WAAW;QACf;QACAA,WAAWC,oBAAI,CAACC,MAAM,CAACrF,MAAMmF,SAAS,EAAE;YACpCG,cAAc;gBACVT,KAAK/B;YACT;YACAyC,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useVirtualizerScrollViewDynamic.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport type {\n VirtualizerScrollViewDynamicProps,\n VirtualizerScrollViewDynamicState,\n} from './VirtualizerScrollViewDynamic.types';\nimport { useDynamicVirtualizerMeasure } from '../../Hooks';\nimport { useVirtualizerContextState_unstable, scrollToItemDynamic } from '../../Utilities';\nimport type { VirtualizerDataRef } from '../Virtualizer/Virtualizer.types';\nimport { useImperativeHandle, useState } from 'react';\nimport { useMeasureList } from '../../hooks/useMeasureList';\nimport type { IndexedResizeCallbackElement } from '../../hooks/useMeasureList';\nimport { useDynamicVirtualizerPagination } from '../../hooks/useDynamicPagination';\n\nexport function useVirtualizerScrollViewDynamic_unstable(\n props: VirtualizerScrollViewDynamicProps,\n): VirtualizerScrollViewDynamicState {\n 'use no memo';\n\n const contextState = useVirtualizerContextState_unstable(props.virtualizerContext);\n const { imperativeRef, axis = 'vertical', reversed, imperativeVirtualizerRef, enablePagination = false } = props;\n\n let sizeTrackingArray = React.useRef<number[]>(new Array(props.numItems).fill(props.itemSize));\n\n // This lets us trigger updates when a size change occurs.\n const [sizeUpdateCount, setSizeUpdateCount] = useState(0);\n\n const getChildSizeAuto = React.useCallback(\n (index: number) => {\n if (sizeTrackingArray.current.length <= index || sizeTrackingArray.current[index] <= 0) {\n // Default size for initial state or untracked\n return props.itemSize;\n }\n /* Required to be defined prior to our measure function\n * we use a sizing array ref that we will update post-render\n */\n return sizeTrackingArray.current[index];\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sizeTrackingArray, props.itemSize, sizeUpdateCount],\n );\n\n const { virtualizerLength, bufferItems, bufferSize, scrollRef } = useDynamicVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: props.axis ?? 'vertical',\n getItemSize: props.getItemSize ?? getChildSizeAuto,\n currentIndex: contextState?.contextIndex ?? 0,\n numItems: props.numItems,\n });\n\n const _imperativeVirtualizerRef = useMergedRefs(React.useRef<VirtualizerDataRef>(null), imperativeVirtualizerRef);\n\n const paginationRef = useDynamicVirtualizerPagination(\n {\n axis,\n progressiveItemSizes: _imperativeVirtualizerRef.current?.progressiveSizes,\n virtualizerLength,\n currentIndex: contextState?.contextIndex ?? 0,\n },\n enablePagination,\n );\n\n // Store the virtualizer length as a ref for imperative ref access\n const virtualizerLengthRef = React.useRef<number>(virtualizerLength);\n if (virtualizerLengthRef.current !== virtualizerLength) {\n virtualizerLengthRef.current = virtualizerLength;\n }\n const scrollViewRef = useMergedRefs(props.scrollViewRef, scrollRef, paginationRef) as React.RefObject<HTMLDivElement>;\n const scrollCallbackRef = React.useRef<null | ((index: number) => void)>(null);\n\n useImperativeHandle(\n imperativeRef,\n () => {\n return {\n scrollTo(index: number, behavior = 'auto', callback: undefined | ((index: number) => void)) {\n scrollCallbackRef.current = callback ?? null;\n if (_imperativeVirtualizerRef.current) {\n const progressiveSizes = _imperativeVirtualizerRef.current.progressiveSizes.current;\n const totalSize =\n progressiveSizes && progressiveSizes?.length > 0\n ? progressiveSizes[Math.max(progressiveSizes.length - 1, 0)]\n : 0;\n\n _imperativeVirtualizerRef.current.setFlaggedIndex(index);\n scrollToItemDynamic({\n index,\n itemSizes: _imperativeVirtualizerRef.current?.nodeSizes,\n totalSize,\n scrollViewRef,\n axis,\n reversed,\n behavior,\n });\n }\n },\n currentIndex: _imperativeVirtualizerRef.current?.currentIndex,\n virtualizerLength: virtualizerLengthRef,\n };\n },\n [axis, scrollViewRef, reversed, _imperativeVirtualizerRef],\n );\n\n const handleRenderedIndex = (index: number) => {\n if (scrollCallbackRef.current) {\n scrollCallbackRef.current(index);\n }\n };\n\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n getItemSize: props.getItemSize ?? getChildSizeAuto,\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollViewRef,\n virtualizerContext: contextState,\n imperativeVirtualizerRef: _imperativeVirtualizerRef,\n onRenderedFlaggedIndex: handleRenderedIndex,\n });\n\n const measureObject = useMeasureList(\n virtualizerState.virtualizerStartIndex,\n virtualizerLength,\n props.numItems,\n props.itemSize,\n );\n\n if (enablePagination && measureObject.sizeUpdateCount !== sizeUpdateCount) {\n /* This enables us to let callback know that the sizes have been updated\n triggers a re-render but is only required on pagination (else index change handles) */\n setSizeUpdateCount(measureObject.sizeUpdateCount);\n }\n\n if (axis === 'horizontal') {\n sizeTrackingArray = measureObject.widthArray;\n } else {\n sizeTrackingArray = measureObject.heightArray;\n }\n\n if (!props.getItemSize) {\n // Auto-measuring is required\n React.Children.map(virtualizerState.virtualizedChildren, (child, index) => {\n if (React.isValidElement(child)) {\n virtualizerState.virtualizedChildren[index] = (\n <child.type\n {...child.props}\n key={child.key}\n ref={(element: HTMLElement & IndexedResizeCallbackElement) => {\n if (child.hasOwnProperty('ref')) {\n // We must access this from the child directly, not props (forward ref).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const localRef = (child as any)?.ref;\n\n if (typeof localRef === 'function') {\n localRef(element);\n } else if (localRef) {\n localRef.current = element;\n }\n }\n\n // Call the auto-measure ref attachment.\n measureObject.createIndexedRef(index)(element);\n }}\n />\n );\n }\n });\n }\n\n return {\n ...virtualizerState,\n components: {\n ...virtualizerState.components,\n container: 'div',\n },\n container: slot.always(props.container, {\n defaultProps: {\n ref: scrollViewRef,\n },\n elementType: 'div',\n }),\n };\n}\n"],"names":["useVirtualizerScrollViewDynamic_unstable","props","_imperativeVirtualizerRef","contextState","useVirtualizerContextState_unstable","virtualizerContext","imperativeRef","axis","reversed","imperativeVirtualizerRef","enablePagination","sizeTrackingArray","React","useRef","Array","numItems","fill","itemSize","sizeUpdateCount","setSizeUpdateCount","useState","getChildSizeAuto","useCallback","index","current","length","virtualizerLength","bufferItems","bufferSize","scrollRef","useDynamicVirtualizerMeasure","defaultItemSize","direction","getItemSize","currentIndex","contextIndex","useMergedRefs","paginationRef","useDynamicVirtualizerPagination","progressiveItemSizes","progressiveSizes","virtualizerLengthRef","scrollViewRef","scrollCallbackRef","useImperativeHandle","scrollTo","behavior","callback","totalSize","Math","max","setFlaggedIndex","scrollToItemDynamic","itemSizes","nodeSizes","handleRenderedIndex","virtualizerState","useVirtualizer_unstable","onRenderedFlaggedIndex","measureObject","useMeasureList","virtualizerStartIndex","widthArray","heightArray","Children","map","virtualizedChildren","child","isValidElement","createElement","type","key","ref","element","hasOwnProperty","localRef","createIndexedRef","components","container","slot","always","defaultProps","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAegBA;;;eAAAA;;;;iEAfO;gCACa;gCACI;uBAKK;2BAC4B;gCAG1C;sCAEiB;AAEzC,SAASA,yCACdC,KAAwC;IAExC;QAsC0BC;IApC1B,MAAMC,eAAeC,IAAAA,8CAAAA,EAAoCH,MAAMI,kBAAkB;IACjF,MAAM,EAAEC,aAAa,EAAEC,OAAO,UAAU,EAAEC,QAAQ,EAAEC,wBAAwB,EAAEC,mBAAmB,KAAK,EAAE,GAAGT;IAE3G,IAAIU,oBAAoBC,OAAMC,MAAM,CAAW,IAAIC,MAAMb,MAAMc,QAAQ,EAAEC,IAAI,CAACf,MAAMgB,QAAQ;IAE5F,0DAA0D;IAC1D,MAAM,CAACC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AIN,MAAMO,cAAc,CAAC,QAAQ;4BAC/B,wEAAwE;4BACxE,+DAA+D;4BAC/D,MAAMC,WAAYR,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAADA,MAAgBK,GAAG;4BAEpC,IAAI,OAAOG,aAAa,YAAY;gCAClCA,SAASF;4BACX,OAAO,IAAIE,UAAU;gCACnBA,SAASnD,OAAO,GAAGiD;4BACrB;wBACF;wBAEA,wCAAwC;wBACxCd,cAAciB,gBAAgB,CAACrD,OAAOkD;oBACxC;;YAGN;QACF;IACF;IAEA,OAAO;QACL,GAAGjB,gBAAgB;QACnBqB,YAAY;YACV,GAAGrB,iBAAiBqB,UAAU;YAC9BC,WAAW;QACb;QACAA,WAAWC,oBAAAA,CAAKC,MAAM,CAAC/E,MAAM6E,SAAS,EAAE;YACtCG,cAAc;gBACZT,KAAK9B;YACP;YACAwC,aAAa;QACf;IACF;AACF"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- virtualizerScrollViewDynamicClassNames: function() {
13
- return virtualizerScrollViewDynamicClassNames;
14
- },
15
12
  useVirtualizerScrollViewDynamicStyles_unstable: function() {
16
13
  return useVirtualizerScrollViewDynamicStyles_unstable;
14
+ },
15
+ virtualizerScrollViewDynamicClassNames: function() {
16
+ return virtualizerScrollViewDynamicClassNames;
17
17
  }
18
18
  });
19
19
  const _useVirtualizerStylesstyles = require("../Virtualizer/useVirtualizerStyles.styles");
@@ -1 +1 @@
1
- {"version":3,"sources":["useVirtualizerScrollViewDynamicStyles.styles.js"],"sourcesContent":["import { useVirtualizerStyles_unstable, virtualizerClassNames } from '../Virtualizer/useVirtualizerStyles.styles';\nimport { __styles, mergeClasses } from '@griffel/react';\nconst virtualizerScrollViewDynamicClassName = 'fui-Virtualizer-Scroll-View-Dynamic';\nexport const virtualizerScrollViewDynamicClassNames = {\n ...virtualizerClassNames,\n container: `${virtualizerScrollViewDynamicClassName}__container`\n};\nconst useStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f22iagw\",\n a9b677: \"fly5x3f\",\n Bqenvij: \"f1l02sjl\"\n },\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Bmxbyg5: \"f5zp4f\"\n },\n horizontal: {\n Beiy3e4: \"f1063pyq\",\n B68tc82: \"f1oy3dpc\"\n },\n verticalReversed: {\n Beiy3e4: \"f1gkdon0\",\n Bmxbyg5: \"f5zp4f\"\n },\n horizontalReversed: {\n Beiy3e4: \"f1oztnx0\",\n B68tc82: \"f1oy3dpc\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".fly5x3f{width:100%;}\", \".f1l02sjl{height:100%;}\", \".f1vx9l62{flex-direction:column;}\", \".f5zp4f{overflow-y:auto;}\", \".f1063pyq{flex-direction:row;}\", \".f1oy3dpc{overflow-x:auto;}\", \".f1gkdon0{flex-direction:column-reverse;}\", \".f1oztnx0{flex-direction:row-reverse;}\"]\n});\n/**\n * Apply styling to the Virtualizer states\n */\nexport const useVirtualizerScrollViewDynamicStyles_unstable = state => {\n 'use no memo';\n\n const styles = useStyles();\n // Default virtualizer styles base\n useVirtualizerStyles_unstable(state);\n const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;\n // Add container styles\n state.container.className = mergeClasses(virtualizerScrollViewDynamicClassNames.container, styles.base, containerStyle, state.container.className);\n return state;\n};\n//# sourceMappingURL=useVirtualizerScrollViewDynamicStyles.styles.js.map"],"names":["virtualizerScrollViewDynamicClassNames","useVirtualizerScrollViewDynamicStyles_unstable","virtualizerScrollViewDynamicClassName","virtualizerClassNames","container","useStyles","__styles","base","mc9l5x","a9b677","Bqenvij","vertical","Beiy3e4","Bmxbyg5","horizontal","B68tc82","verticalReversed","horizontalReversed","d","state","styles","useVirtualizerStyles_unstable","containerStyle","axis","reversed","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,sCAAsC;eAAtCA;;IAgCAC,8CAA8C;eAA9CA;;;4CAnCwD;uBAC9B;AACvC,MAAMC,wCAAwC;AACvC,MAAMF,yCAAyC;IACpD,GAAGG,iDAAqB;IACxBC,WAAW,CAAC,EAAEF,sCAAsC,WAAW,CAAC;AAClE;AACA,MAAMG,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCC,MAAM;QACJC,QAAQ;QACRC,QAAQ;QACRC,SAAS;IACX;IACAC,UAAU;QACRC,SAAS;QACTC,SAAS;IACX;IACAC,YAAY;QACVF,SAAS;QACTG,SAAS;IACX;IACAC,kBAAkB;QAChBJ,SAAS;QACTC,SAAS;IACX;IACAI,oBAAoB;QAClBL,SAAS;QACTG,SAAS;IACX;AACF,GAAG;IACDG,GAAG;QAAC;QAA2B;QAAyB;QAA2B;QAAqC;QAA6B;QAAkC;QAA+B;QAA6C;KAAyC;AAC9S;AAIO,MAAMjB,iDAAiDkB,CAAAA;IAC5D;IAEA,MAAMC,SAASf;IACf,kCAAkC;IAClCgB,IAAAA,yDAA6B,EAACF;IAC9B,MAAMG,iBAAiBH,MAAMI,IAAI,KAAK,eAAeJ,MAAMK,QAAQ,GAAGJ,OAAOH,kBAAkB,GAAGG,OAAON,UAAU,GAAGK,MAAMK,QAAQ,GAAGJ,OAAOJ,gBAAgB,GAAGI,OAAOT,QAAQ;IAChL,uBAAuB;IACvBQ,MAAMf,SAAS,CAACqB,SAAS,GAAGC,IAAAA,mBAAY,EAAC1B,uCAAuCI,SAAS,EAAEgB,OAAOb,IAAI,EAAEe,gBAAgBH,MAAMf,SAAS,CAACqB,SAAS;IACjJ,OAAON;AACT,GACA,wEAAwE"}
1
+ {"version":3,"sources":["useVirtualizerScrollViewDynamicStyles.styles.js"],"sourcesContent":["import { useVirtualizerStyles_unstable, virtualizerClassNames } from '../Virtualizer/useVirtualizerStyles.styles';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nconst virtualizerScrollViewDynamicClassName = 'fui-Virtualizer-Scroll-View-Dynamic';\nexport const virtualizerScrollViewDynamicClassNames = {\n ...virtualizerClassNames,\n container: `${virtualizerScrollViewDynamicClassName}__container`\n};\nconst useStyles = makeStyles({\n base: {\n display: 'flex',\n width: '100%',\n height: '100%'\n },\n vertical: {\n flexDirection: 'column',\n overflowY: 'auto'\n },\n horizontal: {\n flexDirection: 'row',\n overflowX: 'auto'\n },\n verticalReversed: {\n flexDirection: 'column-reverse',\n overflowY: 'auto'\n },\n horizontalReversed: {\n flexDirection: 'row-reverse',\n overflowX: 'auto'\n }\n});\n/**\n * Apply styling to the Virtualizer states\n */ export const useVirtualizerScrollViewDynamicStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n // Default virtualizer styles base\n useVirtualizerStyles_unstable(state);\n const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;\n // Add container styles\n state.container.className = mergeClasses(virtualizerScrollViewDynamicClassNames.container, styles.base, containerStyle, state.container.className);\n return state;\n};\n"],"names":["useVirtualizerScrollViewDynamicStyles_unstable","virtualizerScrollViewDynamicClassNames","virtualizerScrollViewDynamicClassName","virtualizerClassNames","container","useStyles","__styles","base","mc9l5x","a9b677","Bqenvij","vertical","Beiy3e4","Bmxbyg5","horizontal","B68tc82","verticalReversed","horizontalReversed","d","state","styles","useVirtualizerStyles_unstable","containerStyle","axis","reversed","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAgCiBA,8CAA8C;eAA9CA;;IA7BJC,sCAAsC;eAAtCA;;;4CAHwD;uBAC5B;AACzC,MAAMC,wCAAwC;AACvC,MAAMD,yCAAyC;IAClD,GAAGE,iDAAqB;IACxBC,WAAW,CAAA,EAAGF,sCAAqC,WAAA,CAAA;AACvD;AACA,MAAMG,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,MAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;IAAA;IAAAC,UAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;IAAAC,YAAA;QAAAF,SAAA;QAAAG,SAAA;IAAA;IAAAC,kBAAA;QAAAJ,SAAA;QAAAC,SAAA;IAAA;IAAAI,oBAAA;QAAAL,SAAA;QAAAG,SAAA;IAAA;AAAA,GAAA;IAAAG,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAyBP,MAAMlB,iDAAkDmB,CAAAA;IAC/D;IACA,MAAMC,SAASf;IACf,kCAAA;IACAgB,IAAAA,yDAA6B,EAACF;IAC9B,MAAMG,iBAAiBH,MAAMI,IAAI,KAAK,eAAeJ,MAAMK,QAAQ,GAAGJ,OAAOH,kBAAkB,GAAGG,OAAON,UAAU,GAAGK,MAAMK,QAAQ,GAAGJ,OAAOJ,gBAAgB,GAAGI,OAAOT,QAAQ;IAChL,uBAAA;IACAQ,MAAMf,SAAS,CAACqB,SAAS,GAAGC,IAAAA,mBAAY,EAACzB,uCAAuCG,SAAS,EAAEgB,OAAOb,IAAI,EAAEe,gBAAgBH,MAAMf,SAAS,CAACqB,SAAS;IACjJ,OAAON;AACX"}
@@ -1,4 +1,7 @@
1
- "use strict";
1
+ /**
2
+ * Additional direct Ref prevents reading old resize entry data
3
+ * Backwards compatible with ResizeObserverCallback if preferred
4
+ */ "use strict";
2
5
  Object.defineProperty(exports, "__esModule", {
3
6
  value: true
4
7
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["hooks.types.ts"],"sourcesContent":["import { MutableRefObject, RefObject } from 'react';\n\nexport type VirtualizerMeasureProps = {\n defaultItemSize: number;\n direction?: 'vertical' | 'horizontal';\n};\n\nexport type VirtualizerMeasureDynamicProps = {\n defaultItemSize: number;\n currentIndex: number;\n numItems: number;\n getItemSize: (index: number) => number;\n direction?: 'vertical' | 'horizontal';\n};\n\nexport type VirtualizerStaticPaginationProps = {\n itemSize: number;\n axis?: 'vertical' | 'horizontal';\n};\n\n/**\n * Props to be passed into dynamic virtualization hooks\n * All props can be acquired from useVirtualizer hooks themselves and passed in\n */\nexport type VirtualizerDynamicPaginationProps = {\n /**\n * An array that tracks the sizing of each item in virtualizer cumulatively\n */\n progressiveItemSizes: RefObject<number[]> | undefined;\n /**\n * The current starting index of the virtualizer's DOM elements\n */\n currentIndex: number;\n /**\n * The axis we should paginate on (should match virtualizer's axis)\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * The current length of Virtualizer's actual DOM elements\n */\n virtualizerLength: number;\n};\n\n/**\n * Additional direct Ref prevents reading old resize entry data\n * Backwards compatible with ResizeObserverCallback if preferred\n */\nexport interface ResizeCallbackWithRef {\n (\n entries: ResizeObserverEntry[],\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n observer: ResizeObserver,\n scrollRef?: MutableRefObject<HTMLElement | null>,\n ): void;\n}\n"],"names":[],"rangeMappings":";;;","mappings":"AA2CA;;;CAGC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './useIntersectionObserver';\nexport * from './useVirtualizerMeasure';\nexport * from './useDynamicVirtualizerMeasure';\nexport * from './useResizeObserverRef';\nexport * from './hooks.types';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useIntersectionObserver';\nexport * from './useVirtualizerMeasure';\nexport * from './useDynamicVirtualizerMeasure';\nexport * from './useResizeObserverRef';\nexport * from './hooks.types';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDynamicPagination.js"],"sourcesContent":["import * as React from 'react';\nimport { useRef } from 'react';\nimport { useTimeout } from '@fluentui/react-utilities';\n/**\n * Optional hook that will enable pagination on the virtualizer so that it 'autoscrolls' to an items exact position\n * Sizes are dynamic so we require a progressive sizing array (passed in from Dynamic virtualizer hooks)\n * On short scrolls, we will go at minimum to the next/previous item so that arrow pagination works\n * All VirtualizerDynamicPaginationProps can be grabbed from dynamic Virtualizer hooks externally and passed in\n */ export const useDynamicVirtualizerPagination = (virtualizerProps, paginationEnabled = true)=>{\n 'use no memo';\n const { axis = 'vertical', currentIndex, progressiveItemSizes, virtualizerLength } = virtualizerProps;\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const lastScrollPos = useRef(-1);\n const lastIndexScrolled = useRef(-1);\n const scrollContainer = React.useRef(null);\n const clearListeners = ()=>{\n if (scrollContainer.current) {\n scrollContainer.current.removeEventListener('scroll', onScroll);\n scrollContainer.current = null;\n clearScrollTimer();\n }\n };\n React.useEffect(()=>{\n return ()=>{\n clearListeners();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n /**\n * Handle scroll stop event and paginate to the closest item\n * If the closest item is the same as the previous scroll end\n * we paginate to the next/previous one based on direction\n *\n * Users/Virtualizer-Hooks must pass in a cumulative array of sizes\n * This prevents the need to recalculate and ensures size arrays are synced externally\n */ const onScrollEnd = React.useCallback(()=>{\n if (!scrollContainer.current || !paginationEnabled || !(progressiveItemSizes === null || progressiveItemSizes === void 0 ? void 0 : progressiveItemSizes.current)) {\n // No container found\n return;\n }\n const currentScrollPos = Math.round(axis === 'vertical' ? scrollContainer.current.scrollTop : scrollContainer.current.scrollLeft);\n let closestItemPos = 0;\n let closestItem = 0;\n const endItem = Math.min(currentIndex + virtualizerLength, progressiveItemSizes.current.length);\n for(let i = currentIndex; i < endItem - 1; i++){\n if (currentScrollPos <= progressiveItemSizes.current[i + 1] && currentScrollPos >= progressiveItemSizes.current[i]) {\n // Found our in between position\n const distanceToPrev = Math.abs(currentScrollPos - progressiveItemSizes.current[i]);\n const distanceToNext = Math.abs(progressiveItemSizes.current[i + 1] - currentScrollPos);\n if (distanceToPrev < distanceToNext) {\n closestItem = i;\n } else {\n closestItem = i + 1;\n }\n break;\n }\n }\n let nextItem;\n if (Math.round(closestItem - lastIndexScrolled.current) === 0) {\n // Special case for go to next/previous with minimum amount of scroll needed\n const nextTarget = lastScrollPos.current < currentScrollPos ? 1 : -1;\n // This will also handle a case where we scrolled to the exact correct position (noop)\n const isSecondaryScroll = Math.round(lastScrollPos.current - currentScrollPos) === 0;\n const posMod = isSecondaryScroll ? 0 : nextTarget;\n nextItem = closestItem + posMod;\n } else {\n // Pagination for anything else can just jump to the closest!\n nextItem = closestItem;\n }\n // Safeguard nextItem\n nextItem = Math.min(Math.max(0, nextItem), progressiveItemSizes.current.length);\n closestItemPos = progressiveItemSizes.current[nextItem];\n if (axis === 'vertical') {\n scrollContainer.current.scrollTo({\n top: closestItemPos,\n behavior: 'smooth'\n });\n } else {\n scrollContainer.current.scrollTo({\n left: closestItemPos,\n behavior: 'smooth'\n });\n }\n lastScrollPos.current = progressiveItemSizes.current[nextItem];\n lastIndexScrolled.current = nextItem;\n }, [\n paginationEnabled,\n currentIndex,\n scrollContainer,\n virtualizerLength,\n axis,\n progressiveItemSizes\n ]);\n /**\n * On scroll timer that will continuously delay callback until scrolling stops\n */ const onScroll = React.useCallback((event)=>{\n clearScrollTimer();\n setScrollTimer(onScrollEnd, 100);\n }, [\n onScrollEnd,\n clearScrollTimer,\n setScrollTimer\n ]);\n /**\n * Pagination ref will ensure we attach listeners to containers on change\n * It is returned from hook and merged into the scroll container externally\n */ const paginationRef = React.useCallback((instance)=>{\n if (!paginationEnabled) {\n clearListeners();\n scrollContainer.current = null;\n return;\n }\n if (scrollContainer.current !== instance) {\n clearListeners();\n scrollContainer.current = instance;\n if (scrollContainer.current) {\n scrollContainer.current.addEventListener('scroll', onScroll);\n }\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n onScroll,\n onScrollEnd,\n paginationEnabled\n ]);\n return paginationRef;\n};\n"],"names":["useDynamicVirtualizerPagination","virtualizerProps","paginationEnabled","axis","currentIndex","progressiveItemSizes","virtualizerLength","setScrollTimer","clearScrollTimer","useTimeout","lastScrollPos","useRef","lastIndexScrolled","scrollContainer","React","clearListeners","current","removeEventListener","onScroll","useEffect","onScrollEnd","useCallback","currentScrollPos","Math","round","scrollTop","scrollLeft","closestItemPos","closestItem","endItem","min","length","i","distanceToPrev","abs","distanceToNext","nextItem","nextTarget","isSecondaryScroll","posMod","max","scrollTo","top","behavior","left","event","paginationRef","instance","addEventListener"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;gCAEI;AAMhB,MAAMA,kCAAkC,CAACC,kBAAkBC,oBAAoB,IAAI;IAC1F;IACA,MAAM,EAAEC,OAAO,UAAU,EAAEC,YAAY,EAAEC,oBAAoB,EAAEC,iBAAiB,EAAE,GAAGL;IACrF,MAAM,CAACM,gBAAgBC,iBAAiB,GAAGC,IAAAA,0BAAU;IACrD,MAAMC,gBAAgBC,IAAAA,aAAM,EAAC,CAAC;IAC9B,MAAMC,oBAAoBD,IAAAA,aAAM,EAAC,CAAC;IAClC,MAAME,kBAAkBC,OAAMH,MAAM,CAAC;IACrC,MAAMI,iBAAiB;QACnB,IAAIF,gBAAgBG,OAAO,EAAE;YACzBH,gBAAgBG,OAAO,CAACC,mBAAmB,CAAC,UAAUC;YACtDL,gBAAgBG,OAAO,GAAG;YAC1BR;QACJ;IACJ;IACAM,OAAMK,SAAS,CAAC;QACZ,OAAO;YACHJ;QACJ;IACJ,uDAAuD;IACvD,GAAG,EAAE;IACL;;;;;;;GAOD,GAAG,MAAMK,cAAcN,OAAMO,WAAW,CAAC;QACpC,IAAI,CAACR,gBAAgBG,OAAO,IAAI,CAACd,qBAAqB,CAAEG,CAAAA,yBAAyB,QAAQA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBW,OAAO,AAAD,GAAI;YAC/J,qBAAqB;YACrB;QACJ;QACA,MAAMM,mBAAmBC,KAAKC,KAAK,CAACrB,SAAS,aA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AACyB,QAAQ,CAAC;gBAC7BC,KAAKf;gBACLgB,UAAU;YACd;QACJ,OAAO;YACH9B,gBAAgBG,OAAO,CAACyB,QAAQ,CAAC;gBAC7BG,MAAMjB;gBACNgB,UAAU;YACd;QACJ;QACAjC,cAAcM,OAAO,GAAGX,qBAAqBW,OAAO,CAACoB,SAAS;QAC9DxB,kBAAkBI,OAAO,GAAGoB;IAChC,GAAG;QACClC;QACAE;QACAS;QACAP;QACAH;QACAE;KACH;IACD;;GAED,GAAG,MAAMa,WAAWJ,OAAMO,WAAW,CAAC,CAACwB;QAClCrC;QACAD,eAAea,aAAa;IAChC,GAAG;QACCA;QACAZ;QACAD;KACH;IACD;;;GAGD,GAAG,MAAMuC,gBAAgBhC,OAAMO,WAAW,CAAC,CAAC0B;QACvC,IAAI,CAAC7C,mBAAmB;YACpBa;YACAF,gBAAgBG,OAAO,GAAG;YAC1B;QACJ;QACA,IAAIH,gBAAgBG,OAAO,KAAK+B,UAAU;YACtChC;YACAF,gBAAgBG,OAAO,GAAG+B;YAC1B,IAAIlC,gBAAgBG,OAAO,EAAE;gBACzBH,gBAAgBG,OAAO,CAACgC,gBAAgB,CAAC,UAAU9B;YACvD;QACJ;IACJ,GACA;QACIA;QACAE;QACAlB;KACH;IACD,OAAO4C;AACX"}
1
+ {"version":3,"sources":["useDynamicPagination.ts"],"sourcesContent":["import * as React from 'react';\nimport { VirtualizerDynamicPaginationProps } from './hooks.types';\nimport { useRef } from 'react';\nimport { useTimeout } from '@fluentui/react-utilities';\n\n/**\n * Optional hook that will enable pagination on the virtualizer so that it 'autoscrolls' to an items exact position\n * Sizes are dynamic so we require a progressive sizing array (passed in from Dynamic virtualizer hooks)\n * On short scrolls, we will go at minimum to the next/previous item so that arrow pagination works\n * All VirtualizerDynamicPaginationProps can be grabbed from dynamic Virtualizer hooks externally and passed in\n */\nexport const useDynamicVirtualizerPagination = (\n virtualizerProps: VirtualizerDynamicPaginationProps,\n paginationEnabled: Boolean = true,\n) => {\n 'use no memo';\n\n const { axis = 'vertical', currentIndex, progressiveItemSizes, virtualizerLength } = virtualizerProps;\n\n const [setScrollTimer, clearScrollTimer] = useTimeout();\n const lastScrollPos = useRef<number>(-1);\n const lastIndexScrolled = useRef<number>(-1);\n\n const scrollContainer = React.useRef<HTMLElement | null>(null);\n\n const clearListeners = () => {\n if (scrollContainer.current) {\n scrollContainer.current.removeEventListener('scroll', onScroll);\n scrollContainer.current = null;\n clearScrollTimer();\n }\n };\n\n React.useEffect(() => {\n return () => {\n clearListeners();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /**\n * Handle scroll stop event and paginate to the closest item\n * If the closest item is the same as the previous scroll end\n * we paginate to the next/previous one based on direction\n *\n * Users/Virtualizer-Hooks must pass in a cumulative array of sizes\n * This prevents the need to recalculate and ensures size arrays are synced externally\n */\n const onScrollEnd = React.useCallback(() => {\n if (!scrollContainer.current || !paginationEnabled || !progressiveItemSizes?.current) {\n // No container found\n return;\n }\n\n const currentScrollPos = Math.round(\n axis === 'vertical' ? scrollContainer.current.scrollTop : scrollContainer.current.scrollLeft,\n );\n let closestItemPos = 0;\n let closestItem = 0;\n const endItem = Math.min(currentIndex + virtualizerLength, progressiveItemSizes.current.length);\n\n for (let i = currentIndex; i < endItem - 1; i++) {\n if (\n currentScrollPos <= progressiveItemSizes.current[i + 1] &&\n currentScrollPos >= progressiveItemSizes.current[i]\n ) {\n // Found our in between position\n const distanceToPrev = Math.abs(currentScrollPos - progressiveItemSizes.current[i]);\n const distanceToNext = Math.abs(progressiveItemSizes.current[i + 1] - currentScrollPos);\n if (distanceToPrev < distanceToNext) {\n closestItem = i;\n } else {\n closestItem = i + 1;\n }\n break;\n }\n }\n\n let nextItem;\n if (Math.round(closestItem - lastIndexScrolled.current) === 0) {\n // Special case for go to next/previous with minimum amount of scroll needed\n const nextTarget = lastScrollPos.current < currentScrollPos ? 1 : -1;\n // This will also handle a case where we scrolled to the exact correct position (noop)\n const isSecondaryScroll = Math.round(lastScrollPos.current - currentScrollPos) === 0;\n const posMod = isSecondaryScroll ? 0 : nextTarget;\n nextItem = closestItem + posMod;\n } else {\n // Pagination for anything else can just jump to the closest!\n nextItem = closestItem;\n }\n\n // Safeguard nextItem\n nextItem = Math.min(Math.max(0, nextItem), progressiveItemSizes.current.length);\n closestItemPos = progressiveItemSizes.current[nextItem];\n\n if (axis === 'vertical') {\n scrollContainer.current.scrollTo({ top: closestItemPos, behavior: 'smooth' });\n } else {\n scrollContainer.current.scrollTo({ left: closestItemPos, behavior: 'smooth' });\n }\n lastScrollPos.current = progressiveItemSizes.current[nextItem];\n lastIndexScrolled.current = nextItem;\n }, [paginationEnabled, currentIndex, scrollContainer, virtualizerLength, axis, progressiveItemSizes]);\n\n /**\n * On scroll timer that will continuously delay callback until scrolling stops\n */\n const onScroll = React.useCallback(\n event => {\n clearScrollTimer();\n setScrollTimer(onScrollEnd, 100);\n },\n [onScrollEnd, clearScrollTimer, setScrollTimer],\n );\n\n /**\n * Pagination ref will ensure we attach listeners to containers on change\n * It is returned from hook and merged into the scroll container externally\n */\n const paginationRef = React.useCallback(\n (instance: HTMLElement | HTMLDivElement | null) => {\n if (!paginationEnabled) {\n clearListeners();\n scrollContainer.current = null;\n return;\n }\n if (scrollContainer.current !== instance) {\n clearListeners();\n\n scrollContainer.current = instance;\n if (scrollContainer.current) {\n scrollContainer.current.addEventListener('scroll', onScroll);\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [onScroll, onScrollEnd, paginationEnabled],\n );\n\n return paginationRef;\n};\n"],"names":["useDynamicVirtualizerPagination","virtualizerProps","paginationEnabled","axis","currentIndex","progressiveItemSizes","virtualizerLength","setScrollTimer","clearScrollTimer","useTimeout","lastScrollPos","useRef","lastIndexScrolled","scrollContainer","React","clearListeners","current","removeEventListener","onScroll","useEffect","onScrollEnd","useCallback","currentScrollPos","Math","round","scrollTop","scrollLeft","closestItemPos","closestItem","endItem","min","length","i","distanceToPrev","abs","distanceToNext","nextItem","nextTarget","isSecondaryScroll","posMod","max","scrollTo","top","behavior","left","event","paginationRef","instance","addEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;gCAGI;AAQpB,MAAMA,kCAAkC,CAC7CC,kBACAC,oBAA6B,IAAI;IAEjC;IAEA,MAAM,EAAEC,OAAO,UAAU,EAAEC,YAAY,EAAEC,oBAAoB,EAAEC,iBAAiB,EAAE,GAAGL;IAErF,MAAM,CAACM,gBAAgBC,iBAAiB,GAAGC,IAAAA,0BAAAA;IAC3C,MAAMC,gBAAgBC,IAAAA,aAAAA,EAAe,CAAC;IACtC,MAAMC,oBAAoBD,IAAAA,aAAAA,EAAe,CAAC;IAE1C,MAAME,kBAAkBC,OAAMH,MAAM,CAAqB;IAEzD,MAAMI,iBAAiB;QACrB,IAAIF,gBAAgBG,OAAO,EAAE;YAC3BH,gBAAgBG,OAAO,CAACC,mBAAmB,CAAC,UAAUC;YACtDL,gBAAgBG,OAAO,GAAG;YAC1BR;QACF;IACF;IAEAM,OAAMK,SAAS,CAAC;QACd,OAAO;YACLJ;QACF;IACA,uDAAuD;IACzD,GAAG,EAAE;IAEL;;;;;;;GAOC,GACD,MAAMK,cAAcN,OAAMO,WAAW,CAAC;QACpC,IAAI,CAACR,gBAAgBG,OAAO,IAAI,CAACd,qBAAqB,CAACG,CAAAA,yBAAAA,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAsBW,OAAO,AAAPA,GAAS;YACpF,qBAAqB;YACrB;QACF;QAEA,MAAMM,mBAAmBC,KAAKC,KAAK,CACjCrB,SAAS,aAAaU,gBAAgBG,OAAO,CAACS,SAAS,GAAGZ,gBAAgBG,OAAO,CAACU,UAAU;QAE9F,IAA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BAAgBG,OAAO,CAACyB,QAAQ,CAAC;gBAAEG,MAAMjB;gBAAgBgB,UAAU;YAAS;QAC9E;QACAjC,cAAcM,OAAO,GAAGX,qBAAqBW,OAAO,CAACoB,SAAS;QAC9DxB,kBAAkBI,OAAO,GAAGoB;IAC9B,GAAG;QAAClC;QAAmBE;QAAcS;QAAiBP;QAAmBH;QAAME;KAAqB;IAEpG;;GAEC,GACD,MAAMa,WAAWJ,OAAMO,WAAW,CAChCwB,CAAAA;QACErC;QACAD,eAAea,aAAa;IAC9B,GACA;QAACA;QAAaZ;QAAkBD;KAAe;IAGjD;;;GAGC,GACD,MAAMuC,gBAAgBhC,OAAMO,WAAW,CACrC,CAAC0B;QACC,IAAI,CAAC7C,mBAAmB;YACtBa;YACAF,gBAAgBG,OAAO,GAAG;YAC1B;QACF;QACA,IAAIH,gBAAgBG,OAAO,KAAK+B,UAAU;YACxChC;YAEAF,gBAAgBG,OAAO,GAAG+B;YAC1B,IAAIlC,gBAAgBG,OAAO,EAAE;gBAC3BH,gBAAgBG,OAAO,CAACgC,gBAAgB,CAAC,UAAU9B;YACrD;QACF;IACF,GAEA;QAACA;QAAUE;QAAalB;KAAkB;IAG5C,OAAO4C;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDynamicVirtualizerMeasure.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useResizeObserverRef_unstable } from './useResizeObserverRef';\nimport { useRef } from 'react';\n/**\n * React hook that measures virtualized space dynamically to ensure optimized virtualization length.\n */ export const useDynamicVirtualizerMeasure = (virtualizerProps)=>{\n const { defaultItemSize, direction = 'vertical', numItems, getItemSize, currentIndex } = virtualizerProps;\n const indexRef = useRef(currentIndex);\n indexRef.current = currentIndex;\n const [state, setState] = React.useState({\n virtualizerLength: 0,\n virtualizerBufferItems: 0,\n virtualizerBufferSize: 0\n });\n const { virtualizerLength, virtualizerBufferItems, virtualizerBufferSize } = state;\n const container = React.useRef(null);\n const handleScrollResize = React.useCallback((scrollRef)=>{\n if (!(scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {\n // Error? ignore?\n return;\n }\n if (scrollRef.current !== container.current) {\n container.current = scrollRef.current;\n }\n const containerSize = direction === 'vertical' ? scrollRef.current.getBoundingClientRect().height : scrollRef.current.getBoundingClientRect().width;\n let indexSizer = 0;\n let length = 0;\n while(indexSizer <= containerSize && length < numItems){\n const iItemSize = getItemSize(indexRef.current + length);\n // Increment\n indexSizer += iItemSize;\n length++;\n }\n /*\n * Number of items to append at each end, i.e. 'preload' each side before entering view.\n */ const bufferItems = Math.max(Math.floor(length / 4), 4);\n /*\n * This is how far we deviate into the bufferItems to detect a redraw.\n */ const bufferSize = Math.max(Math.floor(length / 8 * defaultItemSize), 1);\n const totalLength = length + bufferItems * 2 + 1;\n setState({\n virtualizerLength: totalLength,\n virtualizerBufferSize: bufferSize,\n virtualizerBufferItems: bufferItems\n });\n }, [\n defaultItemSize,\n direction,\n getItemSize,\n numItems\n ]);\n const resizeCallback = React.useCallback((_entries, // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n _observer, scrollRef)=>{\n if (scrollRef) {\n handleScrollResize(scrollRef);\n }\n }, [\n handleScrollResize\n ]);\n const scrollRef = useResizeObserverRef_unstable(resizeCallback);\n useIsomorphicLayoutEffect(()=>{\n var _container_current, _container_current1;\n if (!container.current) {\n return;\n }\n const containerSize = direction === 'vertical' ? ((_container_current = container.current) === null || _container_current === void 0 ? void 0 : _container_current.getBoundingClientRect().height) * 1.5 : ((_container_current1 = container.current) === null || _container_current1 === void 0 ? void 0 : _container_current1.getBoundingClientRect().width) * 1.5;\n let couldBeSmaller = false;\n let recheckTotal = 0;\n for(let i = currentIndex; i < currentIndex + virtualizerLength; i++){\n const newItemSize = getItemSize(i);\n recheckTotal += newItemSize;\n const newLength = i - currentIndex;\n const bufferItems = Math.max(Math.floor(newLength / 4), 2);\n const totalNewLength = newLength + bufferItems * 2 + 4;\n const compareLengths = totalNewLength < virtualizerLength;\n if (recheckTotal > containerSize && compareLengths) {\n couldBeSmaller = true;\n break;\n }\n }\n // Check if the render has caused us to need a re-calc of virtualizer length\n if (recheckTotal < containerSize || couldBeSmaller) {\n handleScrollResize(container);\n }\n }, [\n getItemSize,\n currentIndex,\n direction,\n virtualizerLength,\n resizeCallback,\n handleScrollResize\n ]);\n return {\n virtualizerLength,\n bufferItems: virtualizerBufferItems,\n bufferSize: virtualizerBufferSize,\n scrollRef\n };\n};\n"],"names":["useDynamicVirtualizerMeasure","virtualizerProps","defaultItemSize","direction","numItems","getItemSize","currentIndex","indexRef","useRef","current","state","setState","React","useState","virtualizerLength","virtualizerBufferItems","virtualizerBufferSize","container","handleScrollResize","useCallback","scrollRef","containerSize","getBoundingClientRect","height","width","indexSizer","length","iItemSize","bufferItems","Math","max","floor","bufferSize","totalLength","resizeCallback","_entries","_observer","useResizeObserverRef_unstable","useIsomorphicLayoutEffect","_container_current","_container_current1","couldBeSmaller","recheckTotal","i","newItemSize","newLength","totalNewLength","compareLengths"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;gCANyB;iEACnB;sCACuB;AAInC,MAAMA,+BAA+B,CAACC;IAC7C,MAAM,EAAEC,eAAe,EAAEC,YAAY,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,YAAY,EAAE,GAAGL;IACzF,MAAMM,WAAWC,IAAAA,aAAM,EAACF;IACxBC,SAASE,OAAO,GAAGH;IACnB,MAAM,CAACI,OAAOC,SAAS,GAAGC,OAAMC,QAAQ,CAAC;QACrCC,mBAAmB;QACnBC,wBAAwB;QACxBC,uBAAuB;IAC3B;IACA,MAAM,EAAEF,iBAAiB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAE,GAAGN;IAC7E,MAAMO,YAAYL,OAAMJ,MAAM,CAAC;IAC/B,MAAMU,qBAAqBN,OAAMO,WAAW,CAAC,CAACC;QAC1C,IAAI,CAAE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,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBjB,qBAAqB,GAAGC,MAAM,AAAD,IAAK,MAAM,AAAC,CAAA,AAACiB,CAAAA,sBAAsBvB,UAAUR,OAAO,AAAD,MAAO,QAAQ+B,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBlB,qBAAqB,GAAGE,KAAK,AAAD,IAAK;QACjW,IAAIiB,iBAAiB;QACrB,IAAIC,eAAe;QACnB,IAAI,IAAIC,IAAIrC,cAAcqC,IAAIrC,eAAeQ,mBAAmB6B,IAAI;YAChE,MAAMC,cAAcvC,YAAYsC;YAChCD,gBAAgBE;YAChB,MAAMC,YAAYF,IAAIrC;YACtB,MAAMsB,cAAcC,KAAKC,GAAG,CAACD,KAAKE,KAAK,CAACc,YAAY,IAAI;YACxD,MAAMC,iBAAiBD,YAAYjB,cAAc,IAAI;YACrD,MAAMmB,iBAAiBD,iBAAiBhC;YACxC,IAAI4B,eAAerB,iBAAiB0B,gBAAgB;gBAChDN,iBAAiB;gBACjB;YACJ;QACJ;QACA,4EAA4E;QAC5E,IAAIC,eAAerB,iBAAiBoB,gBAAgB;YAChDvB,mBAAmBD;QACvB;IACJ,GAAG;QACCZ;QACAC;QACAH;QACAW;QACAoB;QACAhB;KACH;IACD,OAAO;QACHJ;QACAc,aAAab;QACbiB,YAAYhB;QACZI;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDynamicVirtualizerMeasure.ts"],"sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { VirtualizerMeasureDynamicProps } from './hooks.types';\nimport { useResizeObserverRef_unstable } from './useResizeObserverRef';\nimport { useRef } from 'react';\n\n/**\n * React hook that measures virtualized space dynamically to ensure optimized virtualization length.\n */\nexport const useDynamicVirtualizerMeasure = <TElement extends HTMLElement>(\n virtualizerProps: VirtualizerMeasureDynamicProps,\n): {\n virtualizerLength: number;\n bufferItems: number;\n bufferSize: number;\n scrollRef: (instance: TElement | null) => void;\n} => {\n const { defaultItemSize, direction = 'vertical', numItems, getItemSize, currentIndex } = virtualizerProps;\n const indexRef = useRef<number>(currentIndex);\n indexRef.current = currentIndex;\n\n const [state, setState] = React.useState({\n virtualizerLength: 0,\n virtualizerBufferItems: 0,\n virtualizerBufferSize: 0,\n });\n\n const { virtualizerLength, virtualizerBufferItems, virtualizerBufferSize } = state;\n\n const container = React.useRef<HTMLElement | null>(null);\n const handleScrollResize = React.useCallback(\n (scrollRef: React.MutableRefObject<HTMLElement | null>) => {\n if (!scrollRef?.current) {\n // Error? ignore?\n return;\n }\n\n if (scrollRef.current !== container.current) {\n container.current = scrollRef.current;\n }\n\n const containerSize =\n direction === 'vertical'\n ? scrollRef.current.getBoundingClientRect().height\n : scrollRef.current.getBoundingClientRect().width;\n\n let indexSizer = 0;\n let length = 0;\n\n while (indexSizer <= containerSize && length < numItems) {\n const iItemSize = getItemSize(indexRef.current + length);\n\n // Increment\n indexSizer += iItemSize;\n length++;\n }\n\n /*\n * Number of items to append at each end, i.e. 'preload' each side before entering view.\n */\n const bufferItems = Math.max(Math.floor(length / 4), 4);\n\n /*\n * This is how far we deviate into the bufferItems to detect a redraw.\n */\n const bufferSize = Math.max(Math.floor((length / 8) * defaultItemSize), 1);\n\n const totalLength = length + bufferItems * 2 + 1;\n setState({\n virtualizerLength: totalLength,\n virtualizerBufferSize: bufferSize,\n virtualizerBufferItems: bufferItems,\n });\n },\n [defaultItemSize, direction, getItemSize, numItems],\n );\n\n const resizeCallback = React.useCallback(\n (\n _entries: ResizeObserverEntry[],\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n _observer: ResizeObserver,\n scrollRef?: React.MutableRefObject<HTMLElement | null>,\n ) => {\n if (scrollRef) {\n handleScrollResize(scrollRef);\n }\n },\n [handleScrollResize],\n );\n\n const scrollRef = useResizeObserverRef_unstable(resizeCallback);\n\n useIsomorphicLayoutEffect(() => {\n if (!container.current) {\n return;\n }\n\n const containerSize =\n direction === 'vertical'\n ? container.current?.getBoundingClientRect().height * 1.5\n : container.current?.getBoundingClientRect().width * 1.5;\n\n let couldBeSmaller = false;\n let recheckTotal = 0;\n for (let i = currentIndex; i < currentIndex + virtualizerLength; i++) {\n const newItemSize = getItemSize(i);\n recheckTotal += newItemSize;\n\n const newLength = i - currentIndex;\n\n const bufferItems = Math.max(Math.floor(newLength / 4), 2);\n const totalNewLength = newLength + bufferItems * 2 + 4;\n const compareLengths = totalNewLength < virtualizerLength;\n\n if (recheckTotal > containerSize && compareLengths) {\n couldBeSmaller = true;\n break;\n }\n }\n\n // Check if the render has caused us to need a re-calc of virtualizer length\n if (recheckTotal < containerSize || couldBeSmaller) {\n handleScrollResize(container);\n }\n }, [getItemSize, currentIndex, direction, virtualizerLength, resizeCallback, handleScrollResize]);\n\n return {\n virtualizerLength,\n bufferItems: virtualizerBufferItems,\n bufferSize: virtualizerBufferSize,\n scrollRef,\n };\n};\n"],"names":["useDynamicVirtualizerMeasure","virtualizerProps","defaultItemSize","direction","numItems","getItemSize","currentIndex","indexRef","useRef","current","state","setState","React","useState","virtualizerLength","virtualizerBufferItems","virtualizerBufferSize","container","handleScrollResize","useCallback","scrollRef","containerSize","getBoundingClientRect","height","width","indexSizer","length","iItemSize","bufferItems","Math","max","floor","bufferSize","totalLength","resizeCallback","_entries","_observer","useResizeObserverRef_unstable","useIsomorphicLayoutEffect","couldBeSmaller","recheckTotal","i","newItemSize","newLength","totalNewLength","compareLengths"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;;gCAT6B;iEACnB;sCAEuB;AAMvC,MAAMA,+BAA+B,CAC1CC;IAOA,MAAM,EAAEC,eAAe,EAAEC,YAAY,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAE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 -1 +1 @@
1
- {"version":3,"sources":["useIntersectionObserver.js"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nconst { useCallback, useState, useRef } = React;\nimport { useMutationObserver } from './useMutationObserver';\n/**\n * This function will take the rootMargin and flip the sides if we are in RTL based on the computed reading direction of the target element.\n * @param ltrRootMargin the margin to be processed and flipped if required\n * @param target target element that will have its current reading direction determined\n * @returns the corrected rootMargin (if it was necessary to correct)\n */ export const getRTLRootMargin = (ltrRootMargin, target, win)=>{\n if (target && win) {\n // get the computed dir for the target element\n const newDir = win.getComputedStyle(target).direction;\n // If we're in rtl reading direction, we might need to flip the margins on the left/right sides\n if (newDir === 'rtl') {\n let newMargin = ltrRootMargin;\n const splitMargins = ltrRootMargin.split(' ');\n // We only need to do this if we get four values, otherwise the sides are equal and don't require flipping.\n if (splitMargins.length === 4) {\n newMargin = `${splitMargins[0]} ${splitMargins[3]} ${splitMargins[2]} ${splitMargins[1]}`;\n }\n return newMargin;\n } else {\n return ltrRootMargin;\n }\n }\n return ltrRootMargin;\n};\n/**\n * React hook that allows easy usage of the browser API IntersectionObserver within React\n * @param callback - A function called when the percentage of the target element is visible crosses a threshold.\n * @param options - An optional object which customizes the observer. If options isn't specified, the observer uses the\n * document's viewport as the root, with no margin, and a 0% threshold (meaning that even a one-pixel change is\n * enough to trigger a callback).\n * @returns An array containing a callback to update the list of Elements the observer should listen to, a callback to\n * update the init options of the IntersectionObserver and a ref to the IntersectionObserver instance itself.\n */ export const useIntersectionObserver = (callback, options)=>{\n 'use no memo';\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n const observer = useRef();\n const [observerList, setObserverList] = useState();\n const { targetDocument } = useFluent();\n const win = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView;\n var _options_rootMargin;\n // set the initial init with corrected margins based on the observed root's calculated reading direction.\n const [observerInit, setObserverInit] = useState(options && {\n ...options,\n rootMargin: getRTLRootMargin((_options_rootMargin = options.rootMargin) !== null && _options_rootMargin !== void 0 ? _options_rootMargin : '0px', options.root, win)\n });\n var _options_rootMargin1;\n // We have to assume that any values passed in for rootMargin by the consuming app are ltr values. As such we will store the ltr value.\n const ltrRootMargin = useRef((_options_rootMargin1 = options === null || options === void 0 ? void 0 : options.rootMargin) !== null && _options_rootMargin1 !== void 0 ? _options_rootMargin1 : '0px');\n // Callback function to execute when mutations are observed\n const mutationObserverCallback = useCallback((mutationList)=>{\n for (const mutation of mutationList){\n // Ensuring that the right attribute is being observed and that the root is within the tree of the element being mutated.\n if (mutation.type === 'attributes' && mutation.attributeName === 'dir' && (options === null || options === void 0 ? void 0 : options.root) && mutation.target.contains(options === null || options === void 0 ? void 0 : options.root)) {\n setObserverInit({\n ...observerInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, observerInit === null || observerInit === void 0 ? void 0 : observerInit.root, win)\n });\n }\n }\n }, [\n ltrRootMargin,\n observerInit,\n options === null || options === void 0 ? void 0 : options.root,\n win\n ]);\n // Mutation observer for dir attribute changes in the document\n useMutationObserver(targetDocument, mutationObserverCallback, {\n attributes: true,\n subtree: true,\n attributeFilter: [\n 'dir'\n ]\n });\n // Observer elements in passed in list and clean up previous list\n // This effect is only triggered when observerList is updated\n useIsomorphicLayoutEffect(()=>{\n if (!win) {\n return;\n }\n observer.current = new win.IntersectionObserver(callback, {\n ...observerInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, observerInit === null || observerInit === void 0 ? void 0 : observerInit.root, win)\n });\n // If we have an instance of IO and a list with elements, observer the elements\n if (observer.current && observerList && observerList.length > 0) {\n observerList.forEach((element)=>{\n var _observer_current;\n (_observer_current = observer.current) === null || _observer_current === void 0 ? void 0 : _observer_current.observe(element);\n });\n }\n // clean up previous elements being listened to\n return ()=>{\n if (observer.current) {\n observer.current.disconnect();\n }\n };\n }, [\n observerList,\n observerInit,\n callback,\n win\n ]);\n // Do not use internally, we need to track external settings only here\n const setObserverInitExternal = useCallback((newInit)=>{\n var _newInit_rootMargin;\n // Since we know this is coming from consumers, we can store this value as LTR somewhat safely.\n ltrRootMargin.current = (_newInit_rootMargin = newInit === null || newInit === void 0 ? void 0 : newInit.rootMargin) !== null && _newInit_rootMargin !== void 0 ? _newInit_rootMargin : '0px';\n // Call the internal setter to update the value and ensure if our calculated direction is rtl, we flip the margin\n setObserverInit({\n ...newInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, newInit === null || newInit === void 0 ? void 0 : newInit.root, win)\n });\n }, [\n ltrRootMargin,\n setObserverInit,\n win\n ]);\n return {\n setObserverList,\n setObserverInit: setObserverInitExternal,\n observer\n };\n};\n"],"names":["getRTLRootMargin","useIntersectionObserver","useCallback","useState","useRef","React","ltrRootMargin","target","win","newDir","getComputedStyle","direction","newMargin","splitMargins","split","length","callback","options","observer","observerList","setObserverList","targetDocument","useFluent","defaultView","_options_rootMargin","observerInit","setObserverInit","rootMargin","root","_options_rootMargin1","mutationObserverCallback","mutationList","mutation","type","attributeName","contains","current","useMutationObserver","attributes","subtree","attributeFilter","useIsomorphicLayoutEffect","IntersectionObserver","forEach","element","_observer_current","observe","disconnect","setObserverInitExternal","newInit","_newInit_rootMargin"],"mappings":";;;;;;;;;;;IAUiBA,gBAAgB;eAAhBA;;IA2BAC,uBAAuB;eAAvBA;;;;iEArCM;gCACmB;qCACM;qCAEZ;AADpC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,EAAE,GAAGC;AAO/B,MAAML,mBAAmB,CAACM,eAAeC,QAAQC;IACxD,IAAID,UAAUC,KAAK;QACf,8CAA8C;QAC9C,MAAMC,SAASD,IAAIE,gBAAgB,CAACH,QAAQI,SAAS;QACrD,+FAA+F;QAC/F,IAAIF,WAAW,OAAO;YAClB,IAAIG,YAAYN;YAChB,MAAMO,eAAeP,cAAcQ,KAAK,CAAC;YACzC,2GAA2G;YA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A0B9C,YAAY,CAAC+C;QACzC,IAAIC;QACJ,+FAA+F;QAC/F5C,cAAc8B,OAAO,GAAG,AAACc,CAAAA,sBAAsBD,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQtB,UAAU,AAAD,MAAO,QAAQuB,wBAAwB,KAAK,IAAIA,sBAAsB;QACxL,iHAAiH;QACjHxB,gBAAgB;YACZ,GAAGuB,OAAO;YACVtB,YAAY3B,iBAAiBM,cAAc8B,OAAO,EAAEa,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQrB,IAAI,EAAEpB;QACxH;IACJ,GAAG;QACCF;QACAoB;QACAlB;KACH;IACD,OAAO;QACHY;QACAM,iBAAiBsB;QACjB9B;IACJ;AACJ"}
1
+ {"version":3,"sources":["useIntersectionObserver.ts"],"sourcesContent":["import type { Dispatch, MutableRefObject, SetStateAction } from 'react';\nimport * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nconst { useCallback, useState, useRef } = React;\nimport { useMutationObserver } from './useMutationObserver';\n\n/**\n * This function will take the rootMargin and flip the sides if we are in RTL based on the computed reading direction of the target element.\n * @param ltrRootMargin the margin to be processed and flipped if required\n * @param target target element that will have its current reading direction determined\n * @returns the corrected rootMargin (if it was necessary to correct)\n */\nexport const getRTLRootMargin = (\n ltrRootMargin: string,\n target?: Element | Document | null | undefined,\n win?: Window | null,\n): string => {\n if (target && win) {\n // get the computed dir for the target element\n const newDir = win.getComputedStyle(target as Element).direction;\n\n // If we're in rtl reading direction, we might need to flip the margins on the left/right sides\n if (newDir === 'rtl') {\n let newMargin = ltrRootMargin;\n const splitMargins = ltrRootMargin.split(' ');\n\n // We only need to do this if we get four values, otherwise the sides are equal and don't require flipping.\n if (splitMargins.length === 4) {\n newMargin = `${splitMargins[0]} ${splitMargins[3]} ${splitMargins[2]} ${splitMargins[1]}`;\n }\n\n return newMargin;\n } else {\n return ltrRootMargin;\n }\n }\n\n return ltrRootMargin;\n};\n\n/**\n * React hook that allows easy usage of the browser API IntersectionObserver within React\n * @param callback - A function called when the percentage of the target element is visible crosses a threshold.\n * @param options - An optional object which customizes the observer. If options isn't specified, the observer uses the\n * document's viewport as the root, with no margin, and a 0% threshold (meaning that even a one-pixel change is\n * enough to trigger a callback).\n * @returns An array containing a callback to update the list of Elements the observer should listen to, a callback to\n * update the init options of the IntersectionObserver and a ref to the IntersectionObserver instance itself.\n */\n\nexport const useIntersectionObserver = (\n callback: IntersectionObserverCallback,\n options?: IntersectionObserverInit,\n): {\n setObserverList: Dispatch<SetStateAction<Element[] | undefined>>;\n setObserverInit: (newInit: IntersectionObserverInit | undefined) => void;\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n observer: MutableRefObject<IntersectionObserver | undefined>;\n} => {\n 'use no memo';\n\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n const observer = useRef<IntersectionObserver>();\n const [observerList, setObserverList] = useState<Element[]>();\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n // set the initial init with corrected margins based on the observed root's calculated reading direction.\n const [observerInit, setObserverInit] = useState<IntersectionObserverInit | undefined>(\n options && {\n ...options,\n rootMargin: getRTLRootMargin(options.rootMargin ?? '0px', options.root as Element, win),\n },\n );\n\n // We have to assume that any values passed in for rootMargin by the consuming app are ltr values. As such we will store the ltr value.\n const ltrRootMargin = useRef<string>(options?.rootMargin ?? '0px');\n\n // Callback function to execute when mutations are observed\n const mutationObserverCallback: MutationCallback = useCallback(\n mutationList => {\n for (const mutation of mutationList) {\n // Ensuring that the right attribute is being observed and that the root is within the tree of the element being mutated.\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'dir' &&\n options?.root &&\n mutation.target.contains(options?.root)\n ) {\n setObserverInit({\n ...observerInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, observerInit?.root, win),\n });\n }\n }\n },\n [ltrRootMargin, observerInit, options?.root, win],\n );\n\n // Mutation observer for dir attribute changes in the document\n useMutationObserver(targetDocument, mutationObserverCallback, {\n attributes: true,\n subtree: true,\n attributeFilter: ['dir'],\n });\n\n // Observer elements in passed in list and clean up previous list\n // This effect is only triggered when observerList is updated\n useIsomorphicLayoutEffect(() => {\n if (!win) {\n return;\n }\n\n observer.current = new win.IntersectionObserver(callback, {\n ...observerInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, observerInit?.root, win),\n });\n\n // If we have an instance of IO and a list with elements, observer the elements\n if (observer.current && observerList && observerList.length > 0) {\n observerList.forEach(element => {\n observer.current?.observe(element);\n });\n }\n\n // clean up previous elements being listened to\n return () => {\n if (observer.current) {\n observer.current.disconnect();\n }\n };\n }, [observerList, observerInit, callback, win]);\n\n // Do not use internally, we need to track external settings only here\n const setObserverInitExternal = useCallback(\n (newInit: IntersectionObserverInit | undefined) => {\n // Since we know this is coming from consumers, we can store this value as LTR somewhat safely.\n ltrRootMargin.current = newInit?.rootMargin ?? '0px';\n\n // Call the internal setter to update the value and ensure if our calculated direction is rtl, we flip the margin\n setObserverInit({\n ...newInit,\n rootMargin: getRTLRootMargin(ltrRootMargin.current, newInit?.root as Element, win),\n });\n },\n [ltrRootMargin, setObserverInit, win],\n );\n\n return { setObserverList, setObserverInit: setObserverInitExternal, observer };\n};\n"],"names":["getRTLRootMargin","useIntersectionObserver","useCallback","useState","useRef","React","ltrRootMargin","target","win","newDir","getComputedStyle","direction","newMargin","splitMargins","split","length","callback","options","observer","observerList","setObserverList","targetDocument","useFluent","defaultView","observerInit","setObserverInit","rootMargin","root","mutationObserverCallback","mutationList","mutation","type","attributeName","contains","current","useMutationObserver","attributes","subtree","attributeFilter","useIsomorphicLayoutEffect","IntersectionObserver","forEach","element","observe","disconnect","setObserverInitExternal","newInit"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAY;YACfE,YAAY1B,iBAAiBM,cAAc4B,OAAO,EAAEV,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,aAAcG,IAAI,EAAEnB;QAC1E;QAEA,+EAA+E;QAC/E,IAAIU,SAASgB,OAAO,IAAIf,gBAAgBA,aAAaJ,MAAM,GAAG,GAAG;YAC/DI,aAAasB,OAAO,CAACC,CAAAA;oBACnBxB;gBAAAA,CAAAA,oBAAAA,SAASgB,OAAO,AAAPA,MAAO,QAAhBhB,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAkByB,OAAO,CAACD;YAC5B;QACF;QAEA,+CAA+C;QAC/C,OAAO;YACL,IAAIxB,SAASgB,OAAO,EAAE;gBACpBhB,SAASgB,OAAO,CAACU,UAAU;YAC7B;QACF;IACF,GAAG;QAACzB;QAAcK;QAAcR;QAAUR;KAAI;IAE9C,sEAAsE;IACtE,MAAMqC,0BAA0B3C,YAC9B,CAAC4C;YAEyBA;QADxB,+FAA+F;QAC/FxC,cAAc4B,OAAO,GAAGY,CAAAA,sBAAAA,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASpB,UAAU,AAAVA,MAAU,QAAnBoB,wBAAAA,KAAAA,IAAAA,sBAAuB;QAE/C,iHAAiH;QACjHrB,gBAAgB;YACd,GAAGqB,OAAO;YACVpB,YAAY1B,iBAAiBM,cAAc4B,OAAO,EAAEY,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASnB,IAAI,EAAanB;QAChF;IACF,GACA;QAACF;QAAemB;QAAiBjB;KAAI;IAGvC,OAAO;QAAEY;QAAiBK,iBAAiBoB;QAAyB3B;IAAS;AAC/E"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- useMeasureList: function() {
13
- return useMeasureList;
14
- },
15
12
  createResizeObserverFromDocument: function() {
16
13
  return createResizeObserverFromDocument;
14
+ },
15
+ useMeasureList: function() {
16
+ return useMeasureList;
17
17
  }
18
18
  });
19
19
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");