@fluentui/react-virtualizer 9.0.0-alpha.13 → 9.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/index.d.ts +90 -27
- package/lib/VirtualizerScrollView.js +2 -0
- package/lib/VirtualizerScrollView.js.map +1 -0
- package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
- package/lib/components/Virtualizer/useVirtualizer.js +10 -5
- package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
- package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js +14 -0
- package/lib/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
- package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js +2 -0
- package/lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
- package/lib/components/VirtualizerScrollView/index.js +6 -0
- package/lib/components/VirtualizerScrollView/index.js.map +1 -0
- package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js +11 -0
- package/lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +38 -0
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.js +46 -0
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.js.map +1 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useIntersectionObserver.js +0 -8
- package/lib/hooks/useIntersectionObserver.js.map +1 -1
- package/lib/hooks/useVirtualizerMeasure.js +76 -0
- package/lib/hooks/useVirtualizerMeasure.js.map +1 -0
- package/lib/hooks/useVirtualizerMeasure.types.js +2 -0
- package/lib/hooks/useVirtualizerMeasure.types.js.map +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/utilities/debounce.js +20 -0
- package/lib/utilities/debounce.js.map +1 -0
- package/lib-commonjs/VirtualizerScrollView.js +9 -0
- package/lib-commonjs/VirtualizerScrollView.js.map +1 -0
- package/lib-commonjs/components/Virtualizer/useVirtualizer.js +15 -5
- package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +1 -1
- package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js +21 -0
- package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.js.map +1 -0
- package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js +7 -0
- package/lib-commonjs/components/VirtualizerScrollView/VirtualizerScrollView.types.js.map +1 -0
- package/lib-commonjs/components/VirtualizerScrollView/index.js +13 -0
- package/lib-commonjs/components/VirtualizerScrollView/index.js.map +1 -0
- package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js +18 -0
- package/lib-commonjs/components/VirtualizerScrollView/renderVirtualizerScrollView.js.map +1 -0
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js +43 -0
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -0
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.js +69 -0
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.js.map +1 -0
- package/lib-commonjs/hooks/index.js +1 -0
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useIntersectionObserver.js +0 -8
- package/lib-commonjs/hooks/useIntersectionObserver.js.map +1 -1
- package/lib-commonjs/hooks/useVirtualizerMeasure.js +75 -0
- package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +1 -0
- package/lib-commonjs/hooks/useVirtualizerMeasure.types.js +7 -0
- package/lib-commonjs/hooks/useVirtualizerMeasure.types.js.map +1 -0
- package/lib-commonjs/index.js +8 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/debounce.js +29 -0
- package/lib-commonjs/utilities/debounce.js.map +1 -0
- package/package.json +2 -1
|
@@ -14,14 +14,6 @@ const {
|
|
|
14
14
|
* update the init options of the IntersectionObserver and a ref to the IntersectionObserver instance itself.
|
|
15
15
|
*/
|
|
16
16
|
export const useIntersectionObserver = (callback, options) => {
|
|
17
|
-
// export const useIntersectionObserver = (
|
|
18
|
-
// callback: IntersectionObserverCallback,
|
|
19
|
-
// options?: IntersectionObserverInit,
|
|
20
|
-
// ): [
|
|
21
|
-
// Dispatch<SetStateAction<Element[] | undefined>>,
|
|
22
|
-
// Dispatch<SetStateAction<IntersectionObserverInit | undefined>>,
|
|
23
|
-
// MutableRefObject<IntersectionObserver | undefined>,
|
|
24
|
-
// ] => {
|
|
25
17
|
const observer = useRef();
|
|
26
18
|
const [observerList, setObserverList] = useState();
|
|
27
19
|
const [observerInit, setObserverInit] = useState(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useIsomorphicLayoutEffect","useState","useRef","useIntersectionObserver","callback","options","observer","observerList","setObserverList","observerInit","setObserverInit","current","IntersectionObserver","length","forEach","element","_observer_current","observe","disconnect"],"sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import type { Dispatch, MutableRefObject, SetStateAction } from 'react';\nimport * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n\nconst { useState, useRef } = React;\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: Dispatch<SetStateAction<IntersectionObserverInit | undefined>>;\n observer: MutableRefObject<IntersectionObserver | undefined>;\n} => {\n
|
|
1
|
+
{"version":3,"names":["React","useIsomorphicLayoutEffect","useState","useRef","useIntersectionObserver","callback","options","observer","observerList","setObserverList","observerInit","setObserverInit","current","IntersectionObserver","length","forEach","element","_observer_current","observe","disconnect"],"sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import type { Dispatch, MutableRefObject, SetStateAction } from 'react';\nimport * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n\nconst { useState, useRef } = React;\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: Dispatch<SetStateAction<IntersectionObserverInit | undefined>>;\n observer: MutableRefObject<IntersectionObserver | undefined>;\n} => {\n const observer = useRef<IntersectionObserver>();\n const [observerList, setObserverList] = useState<Element[]>();\n const [observerInit, setObserverInit] = useState<IntersectionObserverInit | undefined>(options);\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 observer.current = new IntersectionObserver(callback, observerInit);\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]);\n\n return { setObserverList, setObserverInit, observer };\n};\n"],"mappings":"AACA,YAAYA,KAAA,MAAW;AACvB,SAASC,yBAAyB,QAAQ;AAE1C,MAAM;EAAEC,QAAA;EAAUC;AAAM,CAAE,GAAGH,KAAA;AAE7B;;;;;;;;;AAUA,OAAO,MAAMI,uBAAA,GAA0BA,CACrCC,QAAA,EACAC,OAAA,KAKG;EACH,MAAMC,QAAA,GAAWJ,MAAA;EACjB,MAAM,CAACK,YAAA,EAAcC,eAAA,CAAgB,GAAGP,QAAA;EACxC,MAAM,CAACQ,YAAA,EAAcC,eAAA,CAAgB,GAAGT,QAAA,CAA+CI,OAAA;EAEvF;EACA;EACAL,yBAAA,CAA0B,MAAM;IAC9BM,QAAA,CAASK,OAAO,GAAG,IAAIC,oBAAA,CAAqBR,QAAA,EAAUK,YAAA;IAEtD;IACA,IAAIH,QAAA,CAASK,OAAO,IAAIJ,YAAA,IAAgBA,YAAA,CAAaM,MAAM,GAAG,GAAG;MAC/DN,YAAA,CAAaO,OAAO,CAACC,OAAA,IAAW;YAC9BC,iBAAA;QAAA,CAAAA,iBAAA,GAAAV,QAAA,CAASK,OAAO,cAAhBK,iBAAA,uBAAAA,iBAAA,CAAkBC,OAAA,CAAQF,OAAA;MAC5B;IACF;IAEA;IACA,OAAO,MAAM;MACX,IAAIT,QAAA,CAASK,OAAO,EAAE;QACpBL,QAAA,CAASK,OAAO,CAACO,UAAU;MAC7B;IACF;EACF,GAAG,CAACX,YAAA,EAAcE,YAAA,EAAcL,QAAA,CAAS;EAEzC,OAAO;IAAEI,eAAA;IAAiBE,eAAA;IAAiBJ;EAAS;AACtD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { canUseDOM } from '@fluentui/react-utilities';
|
|
3
|
+
import { debounce } from '../utilities/debounce';
|
|
4
|
+
/**
|
|
5
|
+
* React hook that measures virtualized space based on a static size to ensure optimized virtualization length.
|
|
6
|
+
*/
|
|
7
|
+
export const useStaticVirtualizerMeasure = virtualizerProps => {
|
|
8
|
+
const {
|
|
9
|
+
defaultItemSize,
|
|
10
|
+
direction = 'vertical'
|
|
11
|
+
} = virtualizerProps;
|
|
12
|
+
const [state, setState] = React.useState({
|
|
13
|
+
virtualizerLength: 0,
|
|
14
|
+
bufferSize: 0,
|
|
15
|
+
bufferItems: 0
|
|
16
|
+
});
|
|
17
|
+
const {
|
|
18
|
+
virtualizerLength,
|
|
19
|
+
bufferItems,
|
|
20
|
+
bufferSize
|
|
21
|
+
} = state;
|
|
22
|
+
// The ref the user sets on their scrollView - Defaults to document.body to ensure no null on init
|
|
23
|
+
const container = React.useRef(null);
|
|
24
|
+
const resizeCallback = () => {
|
|
25
|
+
if (!container.current) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const containerSize = direction === 'vertical' ? container.current.getBoundingClientRect().height : container.current.getBoundingClientRect().width;
|
|
29
|
+
/*
|
|
30
|
+
* Number of items required to cover viewport.
|
|
31
|
+
*/
|
|
32
|
+
const length = Math.ceil(containerSize / defaultItemSize + 1);
|
|
33
|
+
/*
|
|
34
|
+
* Number of items to append at each end, i.e. 'preload' each side before entering view.
|
|
35
|
+
*/
|
|
36
|
+
const newBufferItems = Math.max(Math.floor(length / 4), 2);
|
|
37
|
+
/*
|
|
38
|
+
* This is how far we deviate into the bufferItems to detect a redraw.
|
|
39
|
+
*/
|
|
40
|
+
const newBufferSize = Math.max(Math.floor(length / 8 * defaultItemSize), 1);
|
|
41
|
+
const totalLength = length + newBufferItems * 2 + 1;
|
|
42
|
+
setState({
|
|
43
|
+
virtualizerLength: totalLength,
|
|
44
|
+
bufferItems: newBufferItems,
|
|
45
|
+
bufferSize: newBufferSize
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
// the handler for resize observer
|
|
49
|
+
const handleResize = debounce(resizeCallback);
|
|
50
|
+
// Keep the reference of ResizeObserver in the state, as it should live through renders
|
|
51
|
+
const [resizeObserver] = React.useState(canUseDOM() ? new ResizeObserver(handleResize) : undefined);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
return () => {
|
|
54
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
|
|
55
|
+
};
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, []);
|
|
58
|
+
const scrollRef = React.useCallback(el => {
|
|
59
|
+
if (container.current !== el) {
|
|
60
|
+
if (container.current) {
|
|
61
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.unobserve(container.current);
|
|
62
|
+
}
|
|
63
|
+
container.current = el;
|
|
64
|
+
if (container.current) {
|
|
65
|
+
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe(container.current);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, [resizeObserver]);
|
|
69
|
+
return {
|
|
70
|
+
virtualizerLength,
|
|
71
|
+
bufferItems,
|
|
72
|
+
bufferSize,
|
|
73
|
+
scrollRef
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=useVirtualizerMeasure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","canUseDOM","debounce","useStaticVirtualizerMeasure","virtualizerProps","defaultItemSize","direction","state","setState","useState","virtualizerLength","bufferSize","bufferItems","container","useRef","resizeCallback","current","containerSize","getBoundingClientRect","height","width","length","Math","ceil","newBufferItems","max","floor","newBufferSize","totalLength","handleResize","resizeObserver","ResizeObserver","undefined","useEffect","disconnect","scrollRef","useCallback","el","unobserve","observe"],"sources":["../../src/hooks/useVirtualizerMeasure.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { VirtualizerMeasureProps } from './useVirtualizerMeasure.types';\nimport { debounce } from '../utilities/debounce';\n\n/**\n * React hook that measures virtualized space based on a static size to ensure optimized virtualization length.\n */\nexport const useStaticVirtualizerMeasure = (\n virtualizerProps: VirtualizerMeasureProps,\n): {\n virtualizerLength: number;\n bufferItems: number;\n bufferSize: number;\n scrollRef: (instance: HTMLElement | HTMLDivElement | null) => void;\n} => {\n const { defaultItemSize, direction = 'vertical' } = virtualizerProps;\n\n const [state, setState] = React.useState({\n virtualizerLength: 0,\n bufferSize: 0,\n bufferItems: 0,\n });\n\n const { virtualizerLength, bufferItems, bufferSize } = state;\n\n // The ref the user sets on their scrollView - Defaults to document.body to ensure no null on init\n const container = React.useRef<HTMLElement | null>(null);\n\n const resizeCallback = () => {\n if (!container.current) {\n return;\n }\n\n const containerSize =\n direction === 'vertical'\n ? container.current.getBoundingClientRect().height\n : container.current.getBoundingClientRect().width;\n\n /*\n * Number of items required to cover viewport.\n */\n const length = Math.ceil(containerSize / defaultItemSize + 1);\n\n /*\n * Number of items to append at each end, i.e. 'preload' each side before entering view.\n */\n const newBufferItems = Math.max(Math.floor(length / 4), 2);\n\n /*\n * This is how far we deviate into the bufferItems to detect a redraw.\n */\n const newBufferSize = Math.max(Math.floor((length / 8) * defaultItemSize), 1);\n\n const totalLength = length + newBufferItems * 2 + 1;\n\n setState({\n virtualizerLength: totalLength,\n bufferItems: newBufferItems,\n bufferSize: newBufferSize,\n });\n };\n\n // the handler for resize observer\n const handleResize = debounce(resizeCallback);\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(canUseDOM() ? new ResizeObserver(handleResize) : undefined);\n\n React.useEffect(() => {\n return () => {\n resizeObserver?.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const scrollRef = React.useCallback(\n (el: HTMLElement | null) => {\n if (container.current !== el) {\n if (container.current) {\n resizeObserver?.unobserve(container.current);\n }\n\n container.current = el;\n if (container.current) {\n resizeObserver?.observe(container.current);\n }\n }\n },\n [resizeObserver],\n );\n\n return {\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollRef,\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,SAAS,QAAQ;AAE1B,SAASC,QAA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9B,KAAA,CAAMS,QAAQ,CAACR,SAAA,KAAc,IAAI8B,cAAA,CAAeF,YAAA,IAAgBG,SAAS;EAElGhC,KAAA,CAAMiC,SAAS,CAAC,MAAM;IACpB,OAAO,MAAM;MACXH,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBI,UAAU;IAC5B;IACA;EACF,GAAG,EAAE;EAEL,MAAMC,SAAA,GAAYnC,KAAA,CAAMoC,WAAW,CAChCC,EAAA,IAA2B;IAC1B,IAAIxB,SAAA,CAAUG,OAAO,KAAKqB,EAAA,EAAI;MAC5B,IAAIxB,SAAA,CAAUG,OAAO,EAAE;QACrBc,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBQ,SAAS,CAACzB,SAAA,CAAUG,OAAO;MAC7C;MAEAH,SAAA,CAAUG,OAAO,GAAGqB,EAAA;MACpB,IAAIxB,SAAA,CAAUG,OAAO,EAAE;QACrBc,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBS,OAAO,CAAC1B,SAAA,CAAUG,OAAO;MAC3C;IACF;EACF,GACA,CAACc,cAAA,CAAe;EAGlB,OAAO;IACLpB,iBAAA;IACAE,WAAA;IACAD,UAAA;IACAwB;EACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/hooks/useVirtualizerMeasure.types.ts"],"sourcesContent":["export type VirtualizerMeasureProps = {\n defaultItemSize: number;\n direction?: 'vertical' | 'horizontal';\n};\n"],"mappings":"AAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Virtualizer, virtualizerClassNames, useVirtualizer_unstable, renderVirtualizer_unstable, useVirtualizerStyles_unstable } from './Virtualizer';
|
|
2
|
-
export { useIntersectionObserver } from './Hooks';
|
|
2
|
+
export { useIntersectionObserver, useStaticVirtualizerMeasure } from './Hooks';
|
|
3
|
+
export { VirtualizerScrollView, virtualizerScrollViewClassNames, useVirtualizerScrollView_unstable, renderVirtualizerScrollView_unstable, useVirtualizerScrollViewStyles_unstable } from './VirtualizerScrollView';
|
|
3
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Virtualizer","virtualizerClassNames","useVirtualizer_unstable","renderVirtualizer_unstable","useVirtualizerStyles_unstable","useIntersectionObserver"],"sources":["../src/index.ts"],"sourcesContent":["export {\n Virtualizer,\n virtualizerClassNames,\n useVirtualizer_unstable,\n renderVirtualizer_unstable,\n useVirtualizerStyles_unstable,\n} from './Virtualizer';\nexport type {\n VirtualizerProps,\n VirtualizerState,\n VirtualizerSlots,\n VirtualizerChildRenderFunction,\n} from './Virtualizer';\nexport { useIntersectionObserver } from './Hooks';\n"],"mappings":"AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,6BAA6B,QACxB;AAOP,SAASC,uBAAuB,QAAQ"}
|
|
1
|
+
{"version":3,"names":["Virtualizer","virtualizerClassNames","useVirtualizer_unstable","renderVirtualizer_unstable","useVirtualizerStyles_unstable","useIntersectionObserver","useStaticVirtualizerMeasure","VirtualizerScrollView","virtualizerScrollViewClassNames","useVirtualizerScrollView_unstable","renderVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export {\n Virtualizer,\n virtualizerClassNames,\n useVirtualizer_unstable,\n renderVirtualizer_unstable,\n useVirtualizerStyles_unstable,\n} from './Virtualizer';\nexport type {\n VirtualizerProps,\n VirtualizerState,\n VirtualizerSlots,\n VirtualizerChildRenderFunction,\n} from './Virtualizer';\nexport { useIntersectionObserver, useStaticVirtualizerMeasure } from './Hooks';\n\nexport {\n VirtualizerScrollView,\n virtualizerScrollViewClassNames,\n useVirtualizerScrollView_unstable,\n renderVirtualizerScrollView_unstable,\n useVirtualizerScrollViewStyles_unstable,\n} from './VirtualizerScrollView';\n\nexport type {\n VirtualizerScrollViewProps,\n VirtualizerScrollViewState,\n VirtualizerScrollViewSlots,\n} from './VirtualizerScrollView';\n"],"mappings":"AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,6BAA6B,QACxB;AAOP,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ;AAErE,SACEC,qBAAqB,EACrBC,+BAA+B,EAC/BC,iCAAiC,EACjCC,oCAAoC,EACpCC,uCAAuC,QAClC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Microtask debouncer
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide
|
|
4
|
+
* @param fn - Function to debounce
|
|
5
|
+
* @returns debounced function
|
|
6
|
+
*/export function debounce(fn) {
|
|
7
|
+
let pending;
|
|
8
|
+
return () => {
|
|
9
|
+
if (!pending) {
|
|
10
|
+
pending = true;
|
|
11
|
+
queueMicrotask(() => {
|
|
12
|
+
// Need to set pending to `false` before the debounced function is run.
|
|
13
|
+
// React can actually interrupt the function while it's running!
|
|
14
|
+
pending = false;
|
|
15
|
+
fn();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["debounce","fn","pending","queueMicrotask"],"sources":["../../src/utilities/debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"mappings":"AAAA;;;;;GAMA,OAAO,SAASA,SAASC,EAAY,EAAE;EACrC,IAAIC,OAAA;EACJ,OAAO,MAAM;IACX,IAAI,CAACA,OAAA,EAAS;MACZA,OAAA,GAAU,IAAI;MACdC,cAAA,CAAe,MAAM;QACnB;QACA;QACAD,OAAA,GAAU,KAAK;QACfD,EAAA;MACF;IACF;EACF;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/VirtualizerScrollView/index"), exports);
|
|
7
|
+
//# sourceMappingURL=VirtualizerScrollView.js.map
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=VirtualizerScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/VirtualizerScrollView.js"],"sourcesContent":["export * from './components/VirtualizerScrollView/index';\n//# sourceMappingURL=VirtualizerScrollView.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iDAAiD"}
|
|
@@ -11,7 +11,7 @@ const _react = require("react");
|
|
|
11
11
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
12
|
const _reactDom = require("react-dom");
|
|
13
13
|
function useVirtualizer_unstable(props) {
|
|
14
|
-
const { itemSize , numItems , virtualizerLength , children: renderChild , getItemSize , bufferItems =Math.round(virtualizerLength / 4.0) , bufferSize =Math.floor(bufferItems / 2.0) * itemSize ,
|
|
14
|
+
const { itemSize , numItems , virtualizerLength , children: renderChild , getItemSize , bufferItems =Math.round(virtualizerLength / 4.0) , bufferSize =Math.floor(bufferItems / 2.0) * itemSize , scrollViewRef , axis ='vertical' , reversed =false , onUpdateIndex , onCalculateIndex } = props;
|
|
15
15
|
// Tracks the initial item to start virtualizer at, -1 implies first render cycle
|
|
16
16
|
const [virtualizerStartIndex, setVirtualizerStartIndex] = (0, _react.useState)(-1);
|
|
17
17
|
// Store ref to before padding element
|
|
@@ -136,7 +136,7 @@ function useVirtualizer_unstable(props) {
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
}, {
|
|
139
|
-
root:
|
|
139
|
+
root: scrollViewRef ? scrollViewRef === null || scrollViewRef === void 0 ? void 0 : scrollViewRef.current : null,
|
|
140
140
|
rootMargin: '0px',
|
|
141
141
|
threshold: 0
|
|
142
142
|
});
|
|
@@ -209,7 +209,7 @@ function useVirtualizer_unstable(props) {
|
|
|
209
209
|
// Time for custom size calcs
|
|
210
210
|
return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex];
|
|
211
211
|
};
|
|
212
|
-
const updateChildRows = (newIndex)=>{
|
|
212
|
+
const updateChildRows = (0, _react.useCallback)((newIndex)=>{
|
|
213
213
|
if (numItems === 0) {
|
|
214
214
|
/* Nothing to virtualize */ return [];
|
|
215
215
|
}
|
|
@@ -221,7 +221,11 @@ function useVirtualizer_unstable(props) {
|
|
|
221
221
|
for(let i = actualIndex; i < end; i++){
|
|
222
222
|
childArray.current[i - actualIndex] = renderChild(i);
|
|
223
223
|
}
|
|
224
|
-
}
|
|
224
|
+
}, [
|
|
225
|
+
numItems,
|
|
226
|
+
renderChild,
|
|
227
|
+
virtualizerLength
|
|
228
|
+
]);
|
|
225
229
|
const setBeforeRef = (0, _react.useCallback)((element)=>{
|
|
226
230
|
if (!element || beforeElementRef.current === element) {
|
|
227
231
|
return;
|
|
@@ -301,7 +305,8 @@ function useVirtualizer_unstable(props) {
|
|
|
301
305
|
}
|
|
302
306
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
303
307
|
}, [
|
|
304
|
-
renderChild
|
|
308
|
+
renderChild,
|
|
309
|
+
updateChildRows
|
|
305
310
|
]);
|
|
306
311
|
// Ensure we have run through and updated the whole size list array at least once.
|
|
307
312
|
initializeSizeArray();
|
|
@@ -309,6 +314,11 @@ function useVirtualizer_unstable(props) {
|
|
|
309
314
|
// Child length mismatch, repopulate size arrays.
|
|
310
315
|
populateSizeArrays();
|
|
311
316
|
}
|
|
317
|
+
// Ensure we recalc if virtualizer length changes
|
|
318
|
+
const maxCompare = Math.min(virtualizerLength, numItems);
|
|
319
|
+
if (childArray.current.length !== maxCompare && virtualizerStartIndex + childArray.current.length < numItems) {
|
|
320
|
+
updateChildRows(virtualizerStartIndex);
|
|
321
|
+
}
|
|
312
322
|
const isFullyInitialized = hasInitialized.current && virtualizerStartIndex >= 0;
|
|
313
323
|
return {
|
|
314
324
|
components: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Virtualizer/useVirtualizer.js"],"sourcesContent":["import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { useEffect, useRef, useState, useCallback, useReducer } from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { flushSync } from 'react-dom';\nexport function useVirtualizer_unstable(props) {\n const {\n itemSize,\n numItems,\n virtualizerLength,\n children: renderChild,\n getItemSize,\n bufferItems = Math.round(virtualizerLength / 4.0),\n bufferSize = Math.floor(bufferItems / 2.0) * itemSize,\n intersectionObserverRoot,\n axis = 'vertical',\n reversed = false,\n onUpdateIndex,\n onCalculateIndex\n } = props;\n // Tracks the initial item to start virtualizer at, -1 implies first render cycle\n const [virtualizerStartIndex, setVirtualizerStartIndex] = useState(-1);\n // Store ref to before padding element\n const beforeElementRef = useRef(null);\n // Store ref to before padding element\n const afterElementRef = useRef(null);\n // We need to store an array to track dynamic sizes, we can use this to incrementally update changes\n const childSizes = useRef(new Array(getItemSize ? numItems : 0));\n /* We keep track of the progressive sizing/placement down the list,\n this helps us skip re-calculations unless children/size changes */\n const childProgressiveSizes = useRef(new Array(getItemSize ? numItems : 0));\n // The internal tracking REF for child array (updates often).\n const childArray = useRef(new Array(virtualizerLength));\n // We want to be methodical about updating the render with child reference array\n const forceUpdate = useReducer(() => ({}), {})[1];\n const horizontal = axis === 'horizontal';\n const populateSizeArrays = () => {\n if (!getItemSize) {\n // Static sizes, never mind!\n return;\n }\n if (numItems !== childSizes.current.length) {\n childSizes.current = new Array(numItems);\n }\n if (numItems !== childProgressiveSizes.current.length) {\n childProgressiveSizes.current = new Array(numItems);\n }\n for (let index = 0; index < numItems; index++) {\n childSizes.current[index] = getItemSize(index);\n if (index === 0) {\n childProgressiveSizes.current[index] = childSizes.current[index];\n } else {\n childProgressiveSizes.current[index] = childProgressiveSizes.current[index - 1] + childSizes.current[index];\n }\n }\n };\n const batchUpdateNewIndex = index => {\n // Local updates\n onUpdateIndex === null || onUpdateIndex === void 0 ? void 0 : onUpdateIndex(index, virtualizerStartIndex);\n updateChildRows(index);\n updateCurrentItemSizes(index);\n // State setters\n setVirtualizerStartIndex(index);\n };\n // Observe intersections of virtualized components\n const {\n setObserverList\n } = useIntersectionObserver((entries, observer) => {\n /* Sanity check - do we even need virtualization? */if (virtualizerLength > numItems) {\n if (virtualizerStartIndex !== 0) {\n batchUpdateNewIndex(0);\n }\n // No-op\n return;\n }\n /* IO initiates this function when needed (bookend entering view) */\n let measurementPos = 0;\n let bufferCount = bufferItems;\n // Grab latest entry that is intersecting\n const latestEntry = entries.length === 1 ? entries[0] : entries.sort((entry1, entry2) => entry2.time - entry1.time).find(entry => {\n return entry.intersectionRatio > 0;\n });\n if (!latestEntry) {\n // If we don't find an intersecting area, ignore for now.\n return;\n }\n if (latestEntry.target === afterElementRef.current) {\n // We need to inverse the buffer count\n bufferCount = virtualizerLength - bufferItems;\n measurementPos = reversed ? calculateAfter() : calculateTotalSize() - calculateAfter();\n if (!horizontal) {\n if (reversed) {\n // Scrolling 'up' and hit the after element below\n measurementPos -= Math.abs(latestEntry.boundingClientRect.bottom);\n } else if (latestEntry.boundingClientRect.top < 0) {\n // Scrolling 'down' and hit the after element above top: 0\n measurementPos -= latestEntry.boundingClientRect.top;\n }\n } else {\n if (reversed) {\n // Scrolling 'left' and hit the after element\n measurementPos -= Math.abs(latestEntry.boundingClientRect.right);\n } else if (latestEntry.boundingClientRect.left < 0) {\n // Scrolling 'right' and hit the after element\n measurementPos -= latestEntry.boundingClientRect.left;\n }\n }\n } else if (latestEntry.target === beforeElementRef.current) {\n measurementPos = reversed ? calculateTotalSize() - calculateBefore() : calculateBefore();\n if (!horizontal) {\n if (!reversed) {\n measurementPos -= Math.abs(latestEntry.boundingClientRect.bottom);\n } else if (latestEntry.boundingClientRect.top < 0) {\n // Scrolling 'down' in reverse order and hit the before element above top: 0\n measurementPos -= latestEntry.boundingClientRect.top;\n }\n } else {\n if (!reversed) {\n measurementPos -= Math.abs(latestEntry.boundingClientRect.right);\n } else if (latestEntry.boundingClientRect.left < 0) {\n // Scrolling 'left' and hit before element\n measurementPos -= latestEntry.boundingClientRect.left;\n }\n }\n }\n if (reversed) {\n // We're reversed, up is down, left is right, invert the scroll measure.\n measurementPos = Math.max(calculateTotalSize() - Math.abs(measurementPos), 0);\n }\n // For now lets use hardcoded size to assess current element to paginate on\n const startIndex = getIndexFromScrollPosition(measurementPos);\n let bufferedIndex = Math.max(startIndex - bufferCount, 0);\n if (onCalculateIndex) {\n // User has chance to intervene/customize prior to render\n // They may want to normalize this value.\n bufferedIndex = onCalculateIndex(bufferedIndex);\n }\n // Safety limits\n const maxIndex = Math.max(numItems - virtualizerLength, 0);\n const newStartIndex = Math.min(Math.max(bufferedIndex, 0), maxIndex);\n if (virtualizerStartIndex !== newStartIndex) {\n // We flush sync this and perform an immediate state update\n // due to virtualizerStartIndex invalidation.\n flushSync(() => {\n batchUpdateNewIndex(newStartIndex);\n });\n }\n }, {\n root: intersectionObserverRoot ? intersectionObserverRoot === null || intersectionObserverRoot === void 0 ? void 0 : intersectionObserverRoot.current : null,\n rootMargin: '0px',\n threshold: 0\n });\n const findIndexRecursive = (scrollPos, lowIndex, highIndex) => {\n if (lowIndex > highIndex) {\n // We shouldn't get here - but no-op the index if we do.\n return virtualizerStartIndex;\n }\n const midpoint = Math.floor((lowIndex + highIndex) / 2);\n const iBefore = Math.max(midpoint - 1, 0);\n const iAfter = Math.min(midpoint + 1, childProgressiveSizes.current.length - 1);\n const indexValue = childProgressiveSizes.current[midpoint];\n const afterIndexValue = childProgressiveSizes.current[iAfter];\n const beforeIndexValue = childProgressiveSizes.current[iBefore];\n if (scrollPos <= afterIndexValue && scrollPos >= beforeIndexValue) {\n /* We've found our index - if we are exactly matching before/after index that's ok,\n better to reduce checks if it's right on the boundary. */\n return midpoint;\n }\n if (indexValue > scrollPos) {\n return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);\n } else {\n return findIndexRecursive(scrollPos, midpoint + 1, highIndex);\n }\n };\n const getIndexFromSizeArray = scrollPos => {\n /* Quick searches our progressive height array */if (scrollPos === 0 || childProgressiveSizes.current.length === 0 || scrollPos <= childProgressiveSizes.current[0]) {\n // Check start\n return 0;\n }\n if (scrollPos >= childProgressiveSizes.current[childProgressiveSizes.current.length - 1]) {\n // Check end\n return childProgressiveSizes.current.length - 1;\n }\n return findIndexRecursive(scrollPos, 0, childProgressiveSizes.current.length - 1);\n };\n const getIndexFromScrollPosition = scrollPos => {\n if (!getItemSize) {\n return Math.round(scrollPos / itemSize);\n }\n return getIndexFromSizeArray(scrollPos);\n };\n const calculateTotalSize = () => {\n if (!getItemSize) {\n return itemSize * numItems;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1];\n };\n const calculateBefore = () => {\n if (!getItemSize) {\n // The missing items from before virtualization starts height\n return virtualizerStartIndex * itemSize;\n }\n if (virtualizerStartIndex <= 0) {\n return 0;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[virtualizerStartIndex - 1];\n };\n const calculateAfter = () => {\n if (numItems === 0) {\n return 0;\n }\n const lastItemIndex = Math.min(virtualizerStartIndex + virtualizerLength, numItems - 1);\n if (!getItemSize) {\n // The missing items from after virtualization ends height\n const remainingItems = numItems - lastItemIndex - 1;\n return remainingItems * itemSize;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex];\n };\n const updateChildRows = newIndex => {\n if (numItems === 0) {\n /* Nothing to virtualize */return [];\n }\n if (childArray.current.length !== numItems) {\n childArray.current = new Array(virtualizerLength);\n }\n const actualIndex = Math.max(newIndex, 0);\n const end = Math.min(actualIndex + virtualizerLength, numItems);\n for (let i = actualIndex; i < end; i++) {\n childArray.current[i - actualIndex] = renderChild(i);\n }\n };\n const setBeforeRef = useCallback(element => {\n if (!element || beforeElementRef.current === element) {\n return;\n }\n beforeElementRef.current = element;\n const newList = [];\n newList.push(beforeElementRef.current);\n if (afterElementRef.current) {\n newList.push(afterElementRef.current);\n }\n // Ensure we update array if before element changed\n setObserverList(newList);\n }, [setObserverList]);\n const setAfterRef = useCallback(element => {\n if (!element || afterElementRef.current === element) {\n return;\n }\n afterElementRef.current = element;\n const newList = [];\n if (beforeElementRef.current) {\n newList.push(beforeElementRef.current);\n }\n newList.push(afterElementRef.current);\n // Ensure we update array if after element changed\n setObserverList(newList);\n }, [setObserverList]);\n const updateCurrentItemSizes = newIndex => {\n if (!getItemSize) {\n // Static sizes, not required.\n return;\n }\n // We should always call our size function on index change (only for the items that will be rendered)\n // This ensures we request the latest data for incoming items in case sizing has changed.\n const endIndex = Math.min(newIndex + virtualizerLength, numItems);\n const startIndex = Math.max(newIndex, 0);\n let didUpdate = false;\n for (let i = startIndex; i < endIndex; i++) {\n const newSize = getItemSize(i);\n if (newSize !== childSizes.current[i]) {\n childSizes.current[i] = newSize;\n didUpdate = true;\n }\n }\n if (didUpdate) {\n // Update our progressive size array\n for (let i = startIndex; i < numItems; i++) {\n const prevSize = i > 0 ? childProgressiveSizes.current[i - 1] : 0;\n childProgressiveSizes.current[i] = prevSize + childSizes.current[i];\n }\n }\n };\n // Initialize the size array before first render.\n const hasInitialized = useRef(false);\n const initializeSizeArray = () => {\n if (hasInitialized.current === false) {\n hasInitialized.current = true;\n populateSizeArrays();\n }\n };\n // Initialization on mount - update array index to 0 (ready state).\n // Only fire on mount (no deps).\n useEffect(() => {\n if (virtualizerStartIndex < 0) {\n batchUpdateNewIndex(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n // If the user passes in an updated renderChild function - update current children\n useEffect(() => {\n if (virtualizerStartIndex >= 0) {\n updateChildRows(virtualizerStartIndex);\n forceUpdate();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [renderChild]);\n // Ensure we have run through and updated the whole size list array at least once.\n initializeSizeArray();\n if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {\n // Child length mismatch, repopulate size arrays.\n populateSizeArrays();\n }\n const isFullyInitialized = hasInitialized.current && virtualizerStartIndex >= 0;\n return {\n components: {\n before: 'div',\n after: 'div',\n beforeContainer: 'div',\n afterContainer: 'div'\n },\n virtualizedChildren: childArray.current,\n before: resolveShorthand(props.before, {\n required: true,\n defaultProps: {\n ref: setBeforeRef,\n role: 'none'\n }\n }),\n after: resolveShorthand(props.after, {\n required: true,\n defaultProps: {\n ref: setAfterRef,\n role: 'none'\n }\n }),\n beforeContainer: resolveShorthand(props.beforeContainer, {\n required: true,\n defaultProps: {\n role: 'none'\n }\n }),\n afterContainer: resolveShorthand(props.afterContainer, {\n required: true,\n defaultProps: {\n role: 'none'\n }\n }),\n beforeBufferHeight: isFullyInitialized ? calculateBefore() : 0,\n afterBufferHeight: isFullyInitialized ? calculateAfter() : 0,\n totalVirtualizerHeight: isFullyInitialized ? calculateTotalSize() : virtualizerLength * itemSize,\n virtualizerStartIndex,\n axis,\n bufferSize,\n reversed\n };\n}\n//# sourceMappingURL=useVirtualizer.js.map"],"names":["useVirtualizer_unstable","props","itemSize","numItems","virtualizerLength","children","renderChild","getItemSize","bufferItems","Math","round","bufferSize","floor","intersectionObserverRoot","axis","reversed","onUpdateIndex","onCalculateIndex","virtualizerStartIndex","setVirtualizerStartIndex","useState","beforeElementRef","useRef","afterElementRef","childSizes","Array","childProgressiveSizes","childArray","forceUpdate","useReducer","horizontal","populateSizeArrays","current","length","index","batchUpdateNewIndex","updateChildRows","updateCurrentItemSizes","setObserverList","useIntersectionObserver","entries","observer","measurementPos","bufferCount","latestEntry","sort","entry1","entry2","time","find","entry","intersectionRatio","target","calculateAfter","calculateTotalSize","abs","boundingClientRect","bottom","top","right","left","calculateBefore","max","startIndex","getIndexFromScrollPosition","bufferedIndex","maxIndex","newStartIndex","min","flushSync","root","rootMargin","threshold","findIndexRecursive","scrollPos","lowIndex","highIndex","midpoint","iBefore","iAfter","indexValue","afterIndexValue","beforeIndexValue","getIndexFromSizeArray","lastItemIndex","remainingItems","newIndex","actualIndex","end","i","setBeforeRef","useCallback","element","newList","push","setAfterRef","endIndex","didUpdate","newSize","prevSize","hasInitialized","initializeSizeArray","useEffect","isFullyInitialized","components","before","after","beforeContainer","afterContainer","virtualizedChildren","resolveShorthand","required","defaultProps","ref","role","beforeBufferHeight","afterBufferHeight","totalVirtualizerHeight"],"mappings":";;;;+BAIgBA;;aAAAA;;yCAJwB;uBAC6B;gCACpC;0BACP;AACnB,SAASA,wBAAwBC,KAAK,EAAE;IAC7C,MAAM,EACJC,SAAQ,EACRC,SAAQ,EACRC,kBAAiB,EACjBC,UAAUC,YAAW,EACrBC,YAAW,EACXC,aAAcC,KAAKC,KAAK,CAACN,oBAAoB,KAAI,EACjDO,YAAaF,KAAKG,KAAK,CAACJ,cAAc,OAAON,SAAQ,EACrDW,yBAAwB,EACxBC,MAAO,WAAU,EACjBC,UAAW,KAAK,CAAA,EAChBC,cAAa,EACbC,iBAAgB,EACjB,GAAGhB;IACJ,iFAAiF;IACjF,MAAM,CAACiB,uBAAuBC,yBAAyB,GAAGC,IAAAA,eAAQ,EAAC,CAAC;IACpE,sCAAsC;IACtC,MAAMC,mBAAmBC,IAAAA,aAAM,EAAC,IAAI;IACpC,sCAAsC;IACtC,MAAMC,kBAAkBD,IAAAA,aAAM,EAAC,IAAI;IACnC,oGAAoG;IACpG,MAAME,aAAaF,IAAAA,aAAM,EAAC,IAAIG,MAAMlB,cAAcJ,WAAW,CAAC;IAC9D;kEACgE,GAChE,MAAMuB,wBAAwBJ,I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AiB;YACjBC,gBAAgB;QAClB;QACAC,qBAAqBlF,WAAWK,OAAO;QACvCyE,QAAQK,IAAAA,gCAAgB,EAAC7G,MAAMwG,MAAM,EAAE;YACrCM,UAAU,IAAI;YACdC,cAAc;gBACZC,KAAKvB;gBACLwB,MAAM;YACR;QACF;QACAR,OAAOI,IAAAA,gCAAgB,EAAC7G,MAAMyG,KAAK,EAAE;YACnCK,UAAU,IAAI;YACdC,cAAc;gBACZC,KAAKlB;gBACLmB,MAAM;YACR;QACF;QACAP,iBAAiBG,IAAAA,gCAAgB,EAAC7G,MAAM0G,eAAe,EAAE;YACvDI,UAAU,IAAI;YACdC,cAAc;gBACZE,MAAM;YACR;QACF;QACAN,gBAAgBE,IAAAA,gCAAgB,EAAC7G,MAAM2G,cAAc,EAAE;YACrDG,UAAU,IAAI;YACdC,cAAc;gBACZE,MAAM;YACR;QACF;QACAC,oBAAoBZ,qBAAqB1C,oBAAoB,CAAC;QAC9DuD,mBAAmBb,qBAAqBlD,mBAAmB,CAAC;QAC5DgE,wBAAwBd,qBAAqBjD,uBAAuBlD,oBAAoBF,QAAQ;QAChGgB;QACAJ;QACAH;QACAI;IACF;AACF,EACA,0CAA0C"}
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Virtualizer/useVirtualizer.js"],"sourcesContent":["import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { useEffect, useRef, useState, useCallback, useReducer } from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { flushSync } from 'react-dom';\nexport function useVirtualizer_unstable(props) {\n const {\n itemSize,\n numItems,\n virtualizerLength,\n children: renderChild,\n getItemSize,\n bufferItems = Math.round(virtualizerLength / 4.0),\n bufferSize = Math.floor(bufferItems / 2.0) * itemSize,\n scrollViewRef,\n axis = 'vertical',\n reversed = false,\n onUpdateIndex,\n onCalculateIndex\n } = props;\n // Tracks the initial item to start virtualizer at, -1 implies first render cycle\n const [virtualizerStartIndex, setVirtualizerStartIndex] = useState(-1);\n // Store ref to before padding element\n const beforeElementRef = useRef(null);\n // Store ref to before padding element\n const afterElementRef = useRef(null);\n // We need to store an array to track dynamic sizes, we can use this to incrementally update changes\n const childSizes = useRef(new Array(getItemSize ? numItems : 0));\n /* We keep track of the progressive sizing/placement down the list,\n this helps us skip re-calculations unless children/size changes */\n const childProgressiveSizes = useRef(new Array(getItemSize ? numItems : 0));\n // The internal tracking REF for child array (updates often).\n const childArray = useRef(new Array(virtualizerLength));\n // We want to be methodical about updating the render with child reference array\n const forceUpdate = useReducer(() => ({}), {})[1];\n const horizontal = axis === 'horizontal';\n const populateSizeArrays = () => {\n if (!getItemSize) {\n // Static sizes, never mind!\n return;\n }\n if (numItems !== childSizes.current.length) {\n childSizes.current = new Array(numItems);\n }\n if (numItems !== childProgressiveSizes.current.length) {\n childProgressiveSizes.current = new Array(numItems);\n }\n for (let index = 0; index < numItems; index++) {\n childSizes.current[index] = getItemSize(index);\n if (index === 0) {\n childProgressiveSizes.current[index] = childSizes.current[index];\n } else {\n childProgressiveSizes.current[index] = childProgressiveSizes.current[index - 1] + childSizes.current[index];\n }\n }\n };\n const batchUpdateNewIndex = index => {\n // Local updates\n onUpdateIndex === null || onUpdateIndex === void 0 ? void 0 : onUpdateIndex(index, virtualizerStartIndex);\n updateChildRows(index);\n updateCurrentItemSizes(index);\n // State setters\n setVirtualizerStartIndex(index);\n };\n // Observe intersections of virtualized components\n const {\n setObserverList\n } = useIntersectionObserver((entries, observer) => {\n /* Sanity check - do we even need virtualization? */if (virtualizerLength > numItems) {\n if (virtualizerStartIndex !== 0) {\n batchUpdateNewIndex(0);\n }\n // No-op\n return;\n }\n /* IO initiates this function when needed (bookend entering view) */\n let measurementPos = 0;\n let bufferCount = bufferItems;\n // Grab latest entry that is intersecting\n const latestEntry = entries.length === 1 ? entries[0] : entries.sort((entry1, entry2) => entry2.time - entry1.time).find(entry => {\n return entry.intersectionRatio > 0;\n });\n if (!latestEntry) {\n // If we don't find an intersecting area, ignore for now.\n return;\n }\n if (latestEntry.target === afterElementRef.current) {\n // We need to inverse the buffer count\n bufferCount = virtualizerLength - bufferItems;\n measurementPos = reversed ? calculateAfter() : calculateTotalSize() - calculateAfter();\n if (!horizontal) {\n if (reversed) {\n // Scrolling 'up' and hit the after element below\n measurementPos -= Math.abs(latestEntry.boundingClientRect.bottom);\n } else if (latestEntry.boundingClientRect.top < 0) {\n // Scrolling 'down' and hit the after element above top: 0\n measurementPos -= latestEntry.boundingClientRect.top;\n }\n } else {\n if (reversed) {\n // Scrolling 'left' and hit the after element\n measurementPos -= Math.abs(latestEntry.boundingClientRect.right);\n } else if (latestEntry.boundingClientRect.left < 0) {\n // Scrolling 'right' and hit the after element\n measurementPos -= latestEntry.boundingClientRect.left;\n }\n }\n } else if (latestEntry.target === beforeElementRef.current) {\n measurementPos = reversed ? calculateTotalSize() - calculateBefore() : calculateBefore();\n if (!horizontal) {\n if (!reversed) {\n measurementPos -= Math.abs(latestEntry.boundingClientRect.bottom);\n } else if (latestEntry.boundingClientRect.top < 0) {\n // Scrolling 'down' in reverse order and hit the before element above top: 0\n measurementPos -= latestEntry.boundingClientRect.top;\n }\n } else {\n if (!reversed) {\n measurementPos -= Math.abs(latestEntry.boundingClientRect.right);\n } else if (latestEntry.boundingClientRect.left < 0) {\n // Scrolling 'left' and hit before element\n measurementPos -= latestEntry.boundingClientRect.left;\n }\n }\n }\n if (reversed) {\n // We're reversed, up is down, left is right, invert the scroll measure.\n measurementPos = Math.max(calculateTotalSize() - Math.abs(measurementPos), 0);\n }\n // For now lets use hardcoded size to assess current element to paginate on\n const startIndex = getIndexFromScrollPosition(measurementPos);\n let bufferedIndex = Math.max(startIndex - bufferCount, 0);\n if (onCalculateIndex) {\n // User has chance to intervene/customize prior to render\n // They may want to normalize this value.\n bufferedIndex = onCalculateIndex(bufferedIndex);\n }\n // Safety limits\n const maxIndex = Math.max(numItems - virtualizerLength, 0);\n const newStartIndex = Math.min(Math.max(bufferedIndex, 0), maxIndex);\n if (virtualizerStartIndex !== newStartIndex) {\n // We flush sync this and perform an immediate state update\n // due to virtualizerStartIndex invalidation.\n flushSync(() => {\n batchUpdateNewIndex(newStartIndex);\n });\n }\n }, {\n root: scrollViewRef ? scrollViewRef === null || scrollViewRef === void 0 ? void 0 : scrollViewRef.current : null,\n rootMargin: '0px',\n threshold: 0\n });\n const findIndexRecursive = (scrollPos, lowIndex, highIndex) => {\n if (lowIndex > highIndex) {\n // We shouldn't get here - but no-op the index if we do.\n return virtualizerStartIndex;\n }\n const midpoint = Math.floor((lowIndex + highIndex) / 2);\n const iBefore = Math.max(midpoint - 1, 0);\n const iAfter = Math.min(midpoint + 1, childProgressiveSizes.current.length - 1);\n const indexValue = childProgressiveSizes.current[midpoint];\n const afterIndexValue = childProgressiveSizes.current[iAfter];\n const beforeIndexValue = childProgressiveSizes.current[iBefore];\n if (scrollPos <= afterIndexValue && scrollPos >= beforeIndexValue) {\n /* We've found our index - if we are exactly matching before/after index that's ok,\n better to reduce checks if it's right on the boundary. */\n return midpoint;\n }\n if (indexValue > scrollPos) {\n return findIndexRecursive(scrollPos, lowIndex, midpoint - 1);\n } else {\n return findIndexRecursive(scrollPos, midpoint + 1, highIndex);\n }\n };\n const getIndexFromSizeArray = scrollPos => {\n /* Quick searches our progressive height array */if (scrollPos === 0 || childProgressiveSizes.current.length === 0 || scrollPos <= childProgressiveSizes.current[0]) {\n // Check start\n return 0;\n }\n if (scrollPos >= childProgressiveSizes.current[childProgressiveSizes.current.length - 1]) {\n // Check end\n return childProgressiveSizes.current.length - 1;\n }\n return findIndexRecursive(scrollPos, 0, childProgressiveSizes.current.length - 1);\n };\n const getIndexFromScrollPosition = scrollPos => {\n if (!getItemSize) {\n return Math.round(scrollPos / itemSize);\n }\n return getIndexFromSizeArray(scrollPos);\n };\n const calculateTotalSize = () => {\n if (!getItemSize) {\n return itemSize * numItems;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1];\n };\n const calculateBefore = () => {\n if (!getItemSize) {\n // The missing items from before virtualization starts height\n return virtualizerStartIndex * itemSize;\n }\n if (virtualizerStartIndex <= 0) {\n return 0;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[virtualizerStartIndex - 1];\n };\n const calculateAfter = () => {\n if (numItems === 0) {\n return 0;\n }\n const lastItemIndex = Math.min(virtualizerStartIndex + virtualizerLength, numItems - 1);\n if (!getItemSize) {\n // The missing items from after virtualization ends height\n const remainingItems = numItems - lastItemIndex - 1;\n return remainingItems * itemSize;\n }\n // Time for custom size calcs\n return childProgressiveSizes.current[numItems - 1] - childProgressiveSizes.current[lastItemIndex];\n };\n const updateChildRows = useCallback(newIndex => {\n if (numItems === 0) {\n /* Nothing to virtualize */return [];\n }\n if (childArray.current.length !== numItems) {\n childArray.current = new Array(virtualizerLength);\n }\n const actualIndex = Math.max(newIndex, 0);\n const end = Math.min(actualIndex + virtualizerLength, numItems);\n for (let i = actualIndex; i < end; i++) {\n childArray.current[i - actualIndex] = renderChild(i);\n }\n }, [numItems, renderChild, virtualizerLength]);\n const setBeforeRef = useCallback(element => {\n if (!element || beforeElementRef.current === element) {\n return;\n }\n beforeElementRef.current = element;\n const newList = [];\n newList.push(beforeElementRef.current);\n if (afterElementRef.current) {\n newList.push(afterElementRef.current);\n }\n // Ensure we update array if before element changed\n setObserverList(newList);\n }, [setObserverList]);\n const setAfterRef = useCallback(element => {\n if (!element || afterElementRef.current === element) {\n return;\n }\n afterElementRef.current = element;\n const newList = [];\n if (beforeElementRef.current) {\n newList.push(beforeElementRef.current);\n }\n newList.push(afterElementRef.current);\n // Ensure we update array if after element changed\n setObserverList(newList);\n }, [setObserverList]);\n const updateCurrentItemSizes = newIndex => {\n if (!getItemSize) {\n // Static sizes, not required.\n return;\n }\n // We should always call our size function on index change (only for the items that will be rendered)\n // This ensures we request the latest data for incoming items in case sizing has changed.\n const endIndex = Math.min(newIndex + virtualizerLength, numItems);\n const startIndex = Math.max(newIndex, 0);\n let didUpdate = false;\n for (let i = startIndex; i < endIndex; i++) {\n const newSize = getItemSize(i);\n if (newSize !== childSizes.current[i]) {\n childSizes.current[i] = newSize;\n didUpdate = true;\n }\n }\n if (didUpdate) {\n // Update our progressive size array\n for (let i = startIndex; i < numItems; i++) {\n const prevSize = i > 0 ? childProgressiveSizes.current[i - 1] : 0;\n childProgressiveSizes.current[i] = prevSize + childSizes.current[i];\n }\n }\n };\n // Initialize the size array before first render.\n const hasInitialized = useRef(false);\n const initializeSizeArray = () => {\n if (hasInitialized.current === false) {\n hasInitialized.current = true;\n populateSizeArrays();\n }\n };\n // Initialization on mount - update array index to 0 (ready state).\n // Only fire on mount (no deps).\n useEffect(() => {\n if (virtualizerStartIndex < 0) {\n batchUpdateNewIndex(0);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n // If the user passes in an updated renderChild function - update current children\n useEffect(() => {\n if (virtualizerStartIndex >= 0) {\n updateChildRows(virtualizerStartIndex);\n forceUpdate();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [renderChild, updateChildRows]);\n // Ensure we have run through and updated the whole size list array at least once.\n initializeSizeArray();\n if (getItemSize && (numItems !== childSizes.current.length || numItems !== childProgressiveSizes.current.length)) {\n // Child length mismatch, repopulate size arrays.\n populateSizeArrays();\n }\n // Ensure we recalc if virtualizer length changes\n const maxCompare = Math.min(virtualizerLength, numItems);\n if (childArray.current.length !== maxCompare && virtualizerStartIndex + childArray.current.length < numItems) {\n updateChildRows(virtualizerStartIndex);\n }\n const isFullyInitialized = hasInitialized.current && virtualizerStartIndex >= 0;\n return {\n components: {\n before: 'div',\n after: 'div',\n beforeContainer: 'div',\n afterContainer: 'div'\n },\n virtualizedChildren: childArray.current,\n before: resolveShorthand(props.before, {\n required: true,\n defaultProps: {\n ref: setBeforeRef,\n role: 'none'\n }\n }),\n after: resolveShorthand(props.after, {\n required: true,\n defaultProps: {\n ref: setAfterRef,\n role: 'none'\n }\n }),\n beforeContainer: resolveShorthand(props.beforeContainer, {\n required: true,\n defaultProps: {\n role: 'none'\n }\n }),\n afterContainer: resolveShorthand(props.afterContainer, {\n required: true,\n defaultProps: {\n role: 'none'\n }\n }),\n beforeBufferHeight: isFullyInitialized ? calculateBefore() : 0,\n afterBufferHeight: isFullyInitialized ? calculateAfter() : 0,\n totalVirtualizerHeight: isFullyInitialized ? calculateTotalSize() : virtualizerLength * itemSize,\n virtualizerStartIndex,\n axis,\n bufferSize,\n reversed\n };\n}\n//# sourceMappingURL=useVirtualizer.js.map"],"names":["useVirtualizer_unstable","props","itemSize","numItems","virtualizerLength","children","renderChild","getItemSize","bufferItems","Math","round","bufferSize","floor","scrollViewRef","axis","reversed","onUpdateIndex","onCalculateIndex","virtualizerStartIndex","setVirtualizerStartIndex","useState","beforeElementRef","useRef","afterElementRef","childSizes","Array","childProgressiveSizes","childArray","forceUpdate","useReducer","horizontal","populateSizeArrays","current","length","index","batchUpdateNewIndex","updateChildRows","updateCurrentItemSizes","setObserverList","useIntersectionObserver","entries","observer","measurementPos","bufferCount","latestEntry","sort","entry1","entry2","time","find","entry","intersectionRatio","target","calculateAfter","calculateTotalSize","abs","boundingClientRect","bottom","top","right","left","calculateBefore","max","startIndex","getIndexFromScrollPosition","bufferedIndex","maxIndex","newStartIndex","min","flushSync","root","rootMargin","threshold","findIndexRecursive","scrollPos","lowIndex","highIndex","midpoint","iBefore","iAfter","indexValue","afterIndexValue","beforeIndexValue","getIndexFromSizeArray","lastItemIndex","remainingItems","useCallback","newIndex","actualIndex","end","i","setBeforeRef","element","newList","push","setAfterRef","endIndex","didUpdate","newSize","prevSize","hasInitialized","initializeSizeArray","useEffect","maxCompare","isFullyInitialized","components","before","after","beforeContainer","afterContainer","virtualizedChildren","resolveShorthand","required","defaultProps","ref","role","beforeBufferHeight","afterBufferHeight","totalVirtualizerHeight"],"mappings":";;;;+BAIgBA;;aAAAA;;yCAJwB;uBAC6B;gCACpC;0BACP;AACnB,SAASA,wBAAwBC,KAAK,EAAE;IAC7C,MAAM,EACJC,SAAQ,EACRC,SAAQ,EACRC,kBA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,EAAE;YACvDI,UAAU,IAAI;YACdC,cAAc;gBACZE,MAAM;YACR;QACF;QACAN,gBAAgBE,IAAAA,gCAAgB,EAAC9G,MAAM4G,cAAc,EAAE;YACrDG,UAAU,IAAI;YACdC,cAAc;gBACZE,MAAM;YACR;QACF;QACAC,oBAAoBZ,qBAAqB3C,oBAAoB,CAAC;QAC9DwD,mBAAmBb,qBAAqBnD,mBAAmB,CAAC;QAC5DiE,wBAAwBd,qBAAqBlD,uBAAuBlD,oBAAoBF,QAAQ;QAChGgB;QACAJ;QACAH;QACAI;IACF;AACF,EACA,0CAA0C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "VirtualizerScrollView", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>VirtualizerScrollView
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _useVirtualizerScrollView = require("./useVirtualizerScrollView");
|
|
11
|
+
const _renderVirtualizerScrollView = require("./renderVirtualizerScrollView");
|
|
12
|
+
const _useVirtualizerScrollViewStyles = require("./useVirtualizerScrollViewStyles");
|
|
13
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
14
|
+
const VirtualizerScrollView = (props)=>{
|
|
15
|
+
const state = (0, _useVirtualizerScrollView.useVirtualizerScrollView_unstable)(props);
|
|
16
|
+
(0, _useVirtualizerScrollViewStyles.useVirtualizerScrollViewStyles_unstable)(state);
|
|
17
|
+
return (0, _renderVirtualizerScrollView.renderVirtualizerScrollView_unstable)(state);
|
|
18
|
+
};
|
|
19
|
+
VirtualizerScrollView.displayName = 'VirtualizerScrollView'; //# sourceMappingURL=VirtualizerScrollView.js.map
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=VirtualizerScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/VirtualizerScrollView.js"],"sourcesContent":["import { useVirtualizerScrollView_unstable } from './useVirtualizerScrollView';\nimport { renderVirtualizerScrollView_unstable } from './renderVirtualizerScrollView';\nimport { useVirtualizerScrollViewStyles_unstable } from './useVirtualizerScrollViewStyles';\nimport * as React from 'react';\n/**\n * Virtualizer ScrollView\n */\nexport const VirtualizerScrollView = props => {\n const state = useVirtualizerScrollView_unstable(props);\n useVirtualizerScrollViewStyles_unstable(state);\n return renderVirtualizerScrollView_unstable(state);\n};\nVirtualizerScrollView.displayName = 'VirtualizerScrollView';\n//# sourceMappingURL=VirtualizerScrollView.js.map"],"names":["VirtualizerScrollView","props","state","useVirtualizerScrollView_unstable","useVirtualizerScrollViewStyles_unstable","renderVirtualizerScrollView_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;0CAPqC;6CACG;gDACG;6DACjC;AAIhB,MAAMA,wBAAwBC,CAAAA,QAAS;IAC5C,MAAMC,QAAQC,IAAAA,2DAAiC,EAACF;IAChDG,IAAAA,uEAAuC,EAACF;IACxC,OAAOG,IAAAA,iEAAoC,EAACH;AAC9C;AACAF,sBAAsBM,WAAW,GAAG,yBACpC,iDAAiD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/VirtualizerScrollView.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=VirtualizerScrollView.types.js.map"],"names":[],"mappings":";;;;CACA,uDAAuD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./VirtualizerScrollView"), exports);
|
|
7
|
+
_exportStar(require("./VirtualizerScrollView.types"), exports);
|
|
8
|
+
_exportStar(require("./useVirtualizerScrollView"), exports);
|
|
9
|
+
_exportStar(require("./renderVirtualizerScrollView"), exports);
|
|
10
|
+
_exportStar(require("./useVirtualizerScrollViewStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/index.js"],"sourcesContent":["export * from './VirtualizerScrollView';\nexport * from './VirtualizerScrollView.types';\nexport * from './useVirtualizerScrollView';\nexport * from './renderVirtualizerScrollView';\nexport * from './useVirtualizerScrollViewStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderVirtualizerScrollView_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderVirtualizerScrollView_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _renderVirtualizer = require("../Virtualizer/renderVirtualizer");
|
|
13
|
+
const renderVirtualizerScrollView_unstable = (state)=>{
|
|
14
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ _react.createElement(slots.container, slotProps.container, (0, _renderVirtualizer.renderVirtualizer_unstable)(state));
|
|
16
|
+
}; //# sourceMappingURL=renderVirtualizerScrollView.js.map
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=renderVirtualizerScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/renderVirtualizerScrollView.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { renderVirtualizer_unstable } from '../Virtualizer/renderVirtualizer';\nexport const renderVirtualizerScrollView_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.container, slotProps.container, renderVirtualizer_unstable(state));\n};\n//# sourceMappingURL=renderVirtualizerScrollView.js.map"],"names":["renderVirtualizerScrollView_unstable","state","slots","slotProps","getSlots","React","createElement","container","renderVirtualizer_unstable"],"mappings":";;;;+BAGaA;;aAAAA;;;6DAHU;gCACE;mCACkB;AACpC,MAAMA,uCAAuCC,CAAAA,QAAS;IAC3D,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,SAAS,EAAEJ,UAAUI,SAAS,EAAEC,IAAAA,6CAA0B,EAACP;AAC3G,GACA,uDAAuD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useVirtualizerScrollView_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useVirtualizerScrollView_unstable
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _useVirtualizer = require("../Virtualizer/useVirtualizer");
|
|
13
|
+
const _hooks = require("../../Hooks");
|
|
14
|
+
function useVirtualizerScrollView_unstable(props) {
|
|
15
|
+
var _props_axis;
|
|
16
|
+
const { virtualizerLength , bufferItems , bufferSize , scrollRef } = (0, _hooks.useStaticVirtualizerMeasure)({
|
|
17
|
+
defaultItemSize: props.itemSize,
|
|
18
|
+
direction: (_props_axis = props.axis) !== null && _props_axis !== void 0 ? _props_axis : 'vertical'
|
|
19
|
+
});
|
|
20
|
+
const iScrollRef = (0, _reactUtilities.useMergedRefs)(_react.useRef(null), scrollRef);
|
|
21
|
+
const virtualizerState = (0, _useVirtualizer.useVirtualizer_unstable)({
|
|
22
|
+
...props,
|
|
23
|
+
virtualizerLength,
|
|
24
|
+
bufferItems,
|
|
25
|
+
bufferSize,
|
|
26
|
+
scrollViewRef: iScrollRef
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
...virtualizerState,
|
|
30
|
+
components: {
|
|
31
|
+
...virtualizerState.components,
|
|
32
|
+
container: 'div'
|
|
33
|
+
},
|
|
34
|
+
container: (0, _reactUtilities.resolveShorthand)(props.container, {
|
|
35
|
+
required: true,
|
|
36
|
+
defaultProps: {
|
|
37
|
+
ref: iScrollRef
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
} //# sourceMappingURL=useVirtualizerScrollView.js.map
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=useVirtualizerScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/useVirtualizerScrollView.js"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand, useMergedRefs } from '@fluentui/react-utilities';\nimport { useVirtualizer_unstable } from '../Virtualizer/useVirtualizer';\nimport { useStaticVirtualizerMeasure } from '../../Hooks';\nexport function useVirtualizerScrollView_unstable(props) {\n var _props_axis;\n const {\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollRef\n } = useStaticVirtualizerMeasure({\n defaultItemSize: props.itemSize,\n direction: (_props_axis = props.axis) !== null && _props_axis !== void 0 ? _props_axis : 'vertical'\n });\n const iScrollRef = useMergedRefs(React.useRef(null), scrollRef);\n const virtualizerState = useVirtualizer_unstable({\n ...props,\n virtualizerLength,\n bufferItems,\n bufferSize,\n scrollViewRef: iScrollRef\n });\n return {\n ...virtualizerState,\n components: {\n ...virtualizerState.components,\n container: 'div'\n },\n container: resolveShorthand(props.container, {\n required: true,\n defaultProps: {\n ref: iScrollRef\n }\n })\n };\n}\n//# sourceMappingURL=useVirtualizerScrollView.js.map"],"names":["useVirtualizerScrollView_unstable","props","_props_axis","virtualizerLength","bufferItems","bufferSize","scrollRef","useStaticVirtualizerMeasure","defaultItemSize","itemSize","direction","axis","iScrollRef","useMergedRefs","React","useRef","virtualizerState","useVirtualizer_unstable","scrollViewRef","components","container","resolveShorthand","required","defaultProps","ref"],"mappings":";;;;+BAIgBA;;aAAAA;;;6DAJO;gCACyB;gCACR;uBACI;AACrC,SAASA,kCAAkCC,KAAK,EAAE;IACvD,IAAIC;IACJ,MAAM,EACJC,kBAAiB,EACjBC,YAAW,EACXC,WAAU,EACVC,UAAS,EACV,GAAGC,IAAAA,kCAA2B,EAAC;QAC9BC,iBAAiBP,MAAMQ,QAAQ;QAC/BC,WAAW,AAACR,CAAAA,cAAcD,MAAMU,IAAI,AAAD,MAAO,IAAI,IAAIT,gBAAgB,KAAK,IAAIA,cAAc,UAAU;IACrG;IACA,MAAMU,aAAaC,IAAAA,6BAAa,EAACC,OAAMC,MAAM,CAAC,IAAI,GAAGT;IACrD,MAAMU,mBAAmBC,IAAAA,uCAAuB,EAAC;QAC/C,GAAGhB,KAAK;QACRE;QACAC;QACAC;QACAa,eAAeN;IACjB;IACA,OAAO;QACL,GAAGI,gBAAgB;QACnBG,YAAY;YACV,GAAGH,iBAAiBG,UAAU;YAC9BC,WAAW;QACb;QACAA,WAAWC,IAAAA,gCAAgB,EAACpB,MAAMmB,SAAS,EAAE;YAC3CE,UAAU,IAAI;YACdC,cAAc;gBACZC,KAAKZ;YACP;QACF;IACF;AACF,EACA,oDAAoD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
virtualizerScrollViewClassNames: ()=>virtualizerScrollViewClassNames,
|
|
13
|
+
useVirtualizerScrollViewStyles_unstable: ()=>useVirtualizerScrollViewStyles_unstable
|
|
14
|
+
});
|
|
15
|
+
const _useVirtualizerStyles = require("../Virtualizer/useVirtualizerStyles");
|
|
16
|
+
const _react = require("@griffel/react");
|
|
17
|
+
const virtualizerScrollViewClassName = 'fui-Virtualizer-Scroll-View';
|
|
18
|
+
const virtualizerScrollViewClassNames = {
|
|
19
|
+
..._useVirtualizerStyles.virtualizerClassNames,
|
|
20
|
+
container: `${virtualizerScrollViewClassName}__container`
|
|
21
|
+
};
|
|
22
|
+
const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
23
|
+
base: {
|
|
24
|
+
mc9l5x: "f22iagw",
|
|
25
|
+
a9b677: "fly5x3f",
|
|
26
|
+
Bqenvij: "f1l02sjl",
|
|
27
|
+
Eiaeu8: "f1115ve7"
|
|
28
|
+
},
|
|
29
|
+
vertical: {
|
|
30
|
+
Beiy3e4: "f1vx9l62",
|
|
31
|
+
Eiaeu8: "f1115ve7",
|
|
32
|
+
Bmxbyg5: "f5zp4f"
|
|
33
|
+
},
|
|
34
|
+
horizontal: {
|
|
35
|
+
Beiy3e4: "f1063pyq",
|
|
36
|
+
B68tc82: "f1oy3dpc"
|
|
37
|
+
},
|
|
38
|
+
verticalReversed: {
|
|
39
|
+
Beiy3e4: "f1gkdon0",
|
|
40
|
+
Bmxbyg5: "f5zp4f"
|
|
41
|
+
},
|
|
42
|
+
horizontalReversed: {
|
|
43
|
+
Beiy3e4: "f1oztnx0",
|
|
44
|
+
B68tc82: "f1oy3dpc"
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
d: [
|
|
48
|
+
".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}",
|
|
49
|
+
".fly5x3f{width:100%;}",
|
|
50
|
+
".f1l02sjl{height:100%;}",
|
|
51
|
+
".f1115ve7{overflow-anchor:none;}",
|
|
52
|
+
".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}",
|
|
53
|
+
".f5zp4f{overflow-y:auto;}",
|
|
54
|
+
".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}",
|
|
55
|
+
".f1oy3dpc{overflow-x:auto;}",
|
|
56
|
+
".f1gkdon0{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;}",
|
|
57
|
+
".f1oztnx0{-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;}"
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
const useVirtualizerScrollViewStyles_unstable = (state)=>{
|
|
61
|
+
const styles = useStyles();
|
|
62
|
+
// For now - just return default style mods
|
|
63
|
+
(0, _useVirtualizerStyles.useVirtualizerStyles_unstable)(state);
|
|
64
|
+
const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;
|
|
65
|
+
state.container.className = (0, _react.mergeClasses)(virtualizerScrollViewClassNames.container, styles.base, containerStyle, state.container.className);
|
|
66
|
+
return state;
|
|
67
|
+
}; //# sourceMappingURL=useVirtualizerScrollViewStyles.js.map
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=useVirtualizerScrollViewStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/VirtualizerScrollView/useVirtualizerScrollViewStyles.js"],"sourcesContent":["import { useVirtualizerStyles_unstable, virtualizerClassNames } from '../Virtualizer/useVirtualizerStyles';\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 Eiaeu8: \"f1115ve7\"\n },\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Eiaeu8: \"f1115ve7\",\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:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".fly5x3f{width:100%;}\", \".f1l02sjl{height:100%;}\", \".f1115ve7{overflow-anchor:none;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".f5zp4f{overflow-y:auto;}\", \".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}\", \".f1oy3dpc{overflow-x:auto;}\", \".f1gkdon0{-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;}\", \".f1oztnx0{-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;}\"]\n});\n/**\n * Apply styling to the Virtualizer states\n */\nexport const useVirtualizerScrollViewStyles_unstable = state => {\n const styles = useStyles();\n // For now - just return default style mods\n useVirtualizerStyles_unstable(state);\n const containerStyle = state.axis === 'horizontal' ? state.reversed ? styles.horizontalReversed : styles.horizontal : state.reversed ? styles.verticalReversed : styles.vertical;\n state.container.className = mergeClasses(virtualizerScrollViewClassNames.container, styles.base, containerStyle, state.container.className);\n return state;\n};\n//# sourceMappingURL=useVirtualizerScrollViewStyles.js.map"],"names":["virtualizerScrollViewClassNames","useVirtualizerScrollViewStyles_unstable","virtualizerScrollViewClassName","virtualizerClassNames","container","useStyles","__styles","base","mc9l5x","a9b677","Bqenvij","Eiaeu8","vertical","Beiy3e4","Bmxbyg5","horizontal","B68tc82","verticalReversed","horizontalReversed","d","state","styles","useVirtualizerStyles_unstable","containerStyle","axis","reversed","className","mergeClasses"],"mappings":";;;;;;;;;;;IAGaA,+BAA+B,MAA/BA;IAkCAC,uCAAuC,MAAvCA;;sCArCwD;uBAC9B;AACvC,MAAMC,iCAAiC;AAChC,MAAMF,kCAAkC;IAC7C,GAAGG,2CAAqB;IACxBC,WAAW,CAAC,EAAEF,+BAA+B,WAAW,CAAC;AAC3D;AACA,MAAMG,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,MAAM;QACJC,QAAQ;QACRC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;IACAC,UAAU;QACRC,SAAS;QACTF,QAAQ;QACRG,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;QAAwF;QAAyB;QAA2B;QAAoC;QAA6F;QAA6B;QAAoF;QAA+B;QAAqH;KAA2G;AACnoB;AAIO,MAAMlB,0CAA0CmB,CAAAA,QAAS;IAC9D,MAAMC,SAAShB;IACf,2CAA2C;IAC3CiB,IAAAA,mDAA6B,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;IAChLQ,MAAMhB,SAAS,CAACsB,SAAS,GAAGC,IAAAA,mBAAY,EAAC3B,gCAAgCI,SAAS,EAAEiB,OAAOd,IAAI,EAAEgB,gBAAgBH,MAAMhB,SAAS,CAACsB,SAAS;IAC1I,OAAON;AACT,GACA,0DAA0D"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./useIntersectionObserver"), exports);
|
|
7
|
+
_exportStar(require("./useVirtualizerMeasure"), exports);
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../lib/hooks/index.js"],"sourcesContent":["export * from './useIntersectionObserver';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
|
|
1
|
+
{"version":3,"sources":["../../lib/hooks/index.js"],"sourcesContent":["export * from './useIntersectionObserver';\nexport * from './useVirtualizerMeasure';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;CACd,iCAAiC"}
|