@tarojs/components-advanced 4.3.3-alpha.0 → 4.3.3-beta.1
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/dist/components/virtual-list/react/list.d.ts +4 -0
- package/dist/components/virtual-list/react/list.js +25 -0
- package/dist/components/virtual-list/react/list.js.map +1 -1
- package/dist/components/virtual-waterfall/react/waterfall.d.ts +4 -0
- package/dist/components/virtual-waterfall/react/waterfall.js +25 -0
- package/dist/components/virtual-waterfall/react/waterfall.js.map +1 -1
- package/dist/components/water-flow/flow-item.js +8 -3
- package/dist/components/water-flow/flow-item.js.map +1 -1
- package/dist/components/water-flow/interface.d.ts +2 -1
- package/dist/components/water-flow/node.d.ts +1 -1
- package/dist/components/water-flow/node.js +3 -2
- package/dist/components/water-flow/node.js.map +1 -1
- package/dist/components/water-flow/water-flow.js +56 -10
- package/dist/components/water-flow/water-flow.js.map +1 -1
- package/package.json +9 -9
|
@@ -16,7 +16,10 @@ export default class List extends React.PureComponent<IProps, IState> {
|
|
|
16
16
|
itemList: ListSet;
|
|
17
17
|
preset: Preset;
|
|
18
18
|
constructor(props: IProps);
|
|
19
|
+
_isRendering: boolean;
|
|
20
|
+
_hasPendingRefresh: boolean;
|
|
19
21
|
refresh: () => void;
|
|
22
|
+
_flushPendingRefresh(): void;
|
|
20
23
|
_outerRef: any;
|
|
21
24
|
_resetIsScrollingTimeoutId: any;
|
|
22
25
|
_callOnItemsRendered: import("memoize-one").MemoizedFn<(this: any, overscanStartIndex: any, overscanStopIndex: any, startIndex: any, stopIndex: any) => any>;
|
|
@@ -37,4 +40,5 @@ export default class List extends React.PureComponent<IProps, IState> {
|
|
|
37
40
|
getRenderItemNode(index: number, type?: 'node' | 'placeholder'): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
38
41
|
getRenderColumnNode(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
39
42
|
render(): React.ReactElement<{}, string | React.JSXElementConstructor<any>>;
|
|
43
|
+
_renderList(): React.ReactElement<{}, string | React.JSXElementConstructor<any>>;
|
|
40
44
|
}
|
|
@@ -19,7 +19,15 @@ class List extends React.PureComponent {
|
|
|
19
19
|
}
|
|
20
20
|
constructor(props) {
|
|
21
21
|
super(props);
|
|
22
|
+
this._isRendering = false;
|
|
23
|
+
this._hasPendingRefresh = false;
|
|
22
24
|
this.refresh = () => {
|
|
25
|
+
// Note: ListSet records the size of newly measured items while rendering and asks for a refresh,
|
|
26
|
+
// updating state at that point is illegal, so wait until the current render has been committed.
|
|
27
|
+
if (this._isRendering) {
|
|
28
|
+
this._hasPendingRefresh = true;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
23
31
|
if (process.env.FRAMEWORK === 'preact') {
|
|
24
32
|
this.forceUpdate();
|
|
25
33
|
}
|
|
@@ -179,6 +187,12 @@ class List extends React.PureComponent {
|
|
|
179
187
|
refreshCount: 0,
|
|
180
188
|
};
|
|
181
189
|
}
|
|
190
|
+
_flushPendingRefresh() {
|
|
191
|
+
if (this._hasPendingRefresh) {
|
|
192
|
+
this._hasPendingRefresh = false;
|
|
193
|
+
this.refresh();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
182
196
|
_callPropsCallbacks(prevProps = {}, prevState = {}) {
|
|
183
197
|
if (typeof this.props.onItemsRendered === 'function') {
|
|
184
198
|
if (this.props.itemCount > 0) {
|
|
@@ -261,6 +275,7 @@ class List extends React.PureComponent {
|
|
|
261
275
|
}
|
|
262
276
|
this._callPropsCallbacks();
|
|
263
277
|
this.preset.boundaryDetection();
|
|
278
|
+
this._flushPendingRefresh();
|
|
264
279
|
}
|
|
265
280
|
componentDidUpdate(prevProps, prevState) {
|
|
266
281
|
const { scrollOffset, scrollUpdateWasRequested } = this.state;
|
|
@@ -293,6 +308,7 @@ class List extends React.PureComponent {
|
|
|
293
308
|
}
|
|
294
309
|
}
|
|
295
310
|
this._callPropsCallbacks(prevProps, prevState);
|
|
311
|
+
this._flushPendingRefresh();
|
|
296
312
|
}
|
|
297
313
|
componentWillUnmount() {
|
|
298
314
|
if (this._resetIsScrollingTimeoutId !== null) {
|
|
@@ -375,6 +391,15 @@ class List extends React.PureComponent {
|
|
|
375
391
|
return React.createElement(this.preset.innerElement, columnProps, items);
|
|
376
392
|
}
|
|
377
393
|
render() {
|
|
394
|
+
this._isRendering = true;
|
|
395
|
+
try {
|
|
396
|
+
return this._renderList();
|
|
397
|
+
}
|
|
398
|
+
finally {
|
|
399
|
+
this._isRendering = false;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
_renderList() {
|
|
378
403
|
const _a = omit(this.props, [
|
|
379
404
|
'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',
|
|
380
405
|
'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../../src/components/virtual-list/react/list.ts"],"sourcesContent":["import { isNumber } from '@tarojs/shared'\nimport memoizeOne from 'memoize-one'\nimport React from 'react'\n\nimport { cancelTimeout, convertNumber2PX, defaultItemKey, getRectSizeSync, getScrollViewContextNode, omit, requestTimeout } from '../../../utils'\nimport { IS_SCROLLING_DEBOUNCE_INTERVAL } from '../constants'\nimport { getRTLOffsetType } from '../dom-helpers'\nimport ListSet from '../list-set'\nimport Preset from '../preset'\nimport { validateListProps } from './validate'\n\nimport type { IProps } from '../preset'\n\nexport interface IState {\n instance: List\n isScrolling: boolean\n scrollDirection: 'forward' | 'backward'\n scrollOffset: number\n scrollUpdateWasRequested: boolean\n refreshCount: number\n}\n\nexport default class List extends React.PureComponent<IProps, IState> {\n static defaultProps: IProps = {\n direction: 'ltr',\n itemData: undefined,\n layout: 'vertical',\n overscanCount: 2,\n useIsScrolling: false,\n shouldResetStyleCacheOnItemSizeChange: true\n }\n\n static getDerivedStateFromProps (nextProps: IProps, prevState: IState) {\n return validateListProps(nextProps, prevState)\n }\n\n itemList: ListSet\n preset: Preset\n\n constructor (props: IProps) {\n super(props)\n\n this.preset = new Preset(\n props,\n this.refresh,\n )\n this.itemList = this.preset.itemList\n const id = this.props.id || this.preset.id\n this.preset.updateWrapper(id)\n\n this.state = {\n instance: this,\n isScrolling: false,\n scrollDirection: 'forward',\n scrollOffset:\n typeof this.props.initialScrollOffset === 'number'\n ? this.props.initialScrollOffset\n : 0,\n scrollUpdateWasRequested: false,\n refreshCount: 0,\n }\n }\n\n refresh = () => {\n if (process.env.FRAMEWORK === 'preact') {\n this.forceUpdate()\n } else {\n this.setState(({ refreshCount }) => ({\n refreshCount: ++refreshCount\n }))\n }\n }\n\n _outerRef = undefined\n\n _resetIsScrollingTimeoutId = null\n\n _callOnItemsRendered = memoizeOne((overscanStartIndex, overscanStopIndex, startIndex, stopIndex) => this.props.onItemsRendered({\n overscanStartIndex,\n overscanStopIndex,\n startIndex,\n stopIndex\n }))\n\n _callOnScroll = memoizeOne((scrollDirection, scrollOffset, scrollUpdateWasRequested, detail) => this.props.onScroll({\n scrollDirection,\n scrollOffset,\n scrollUpdateWasRequested,\n detail\n } as any))\n\n _callPropsCallbacks (prevProps: any = {}, prevState: any = {}) {\n if (typeof this.props.onItemsRendered === 'function') {\n if (this.props.itemCount > 0) {\n if (prevProps && prevProps.itemCount !== this.props.itemCount) {\n const [overscanStartIndex, overscanStopIndex, startIndex, stopIndex] = this._getRangeToRender()\n\n this._callOnItemsRendered(overscanStartIndex, overscanStopIndex, startIndex, stopIndex)\n }\n }\n }\n\n if (typeof this.props.onScroll === 'function') {\n if (!prevState ||\n prevState.scrollDirection !== this.state.scrollDirection ||\n prevState.scrollOffset !== this.state.scrollOffset ||\n prevState.scrollUpdateWasRequested !== this.state.scrollUpdateWasRequested\n ) {\n this._callOnScroll(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.scrollUpdateWasRequested,\n this.preset.field\n )\n }\n }\n\n if (this.itemList.isUnlimitedMode) {\n setTimeout(() => {\n const [startIndex, stopIndex] = this._getRangeToRender()\n const isHorizontal = this.preset.isHorizontal\n for (let index = startIndex; index <= stopIndex; index++) {\n this._getSizeUploadSync(index, isHorizontal)\n }\n }, 0)\n }\n }\n\n _getSizeUploadSync = (index: number, isHorizontal: boolean) => {\n return new Promise((resolve) => {\n if (index >= 0 && index < this.props.itemCount) {\n const times = this.itemList.compareSize(index) ? 3 : 0\n getRectSizeSync(`${this.props.queryPrefix}#${this.preset.id}-${index}`, 100, times).then(({ width, height }) => {\n const size = isHorizontal ? width : height\n if (typeof size === 'number' && size > 0 && !this.itemList.compareSize(index, size)) {\n this.itemList.setSize(index, size)\n resolve(this.itemList.getSize(index))\n }\n })\n }\n })\n }\n\n // Lazily create and cache item styles while scrolling,\n // So that pure component sCU will prevent re-renders.\n // We maintain this cache, and pass a style prop rather than index,\n // So that List can clear cached styles and force item re-render if necessary.\n _getRangeToRender () {\n return this.itemList.getRangeToRender(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.isScrolling\n )\n }\n\n _onScrollHorizontal = event => {\n const {\n scrollHeight,\n scrollWidth = this.itemList.getOffsetSizeCache(),\n scrollTop,\n scrollLeft,\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientWidth = this.itemList.wrapperSize\n this.preset.field = {\n scrollHeight,\n scrollWidth,\n scrollTop,\n scrollLeft,\n clientHeight: scrollHeight,\n clientWidth: scrollWidth\n }\n this.setState((prevState: any) => {\n const diffOffset = this.preset.field.scrollLeft - scrollLeft\n if (prevState.scrollOffset === scrollLeft || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n\n let scrollOffset = scrollLeft\n\n if (this.preset.isRtl) {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.\n // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.\n switch (getRTLOffsetType()) {\n case 'negative':\n scrollOffset = -scrollLeft\n break\n\n case 'positive-descending':\n scrollOffset = scrollWidth - clientWidth - scrollLeft\n break\n }\n } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n\n this.preset.field = {\n scrollWidth: scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollLeft ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n _onScrollVertical = event => {\n const {\n scrollHeight = this.itemList.getOffsetSizeCache(),\n scrollWidth,\n scrollTop,\n scrollLeft\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientHeight = this.itemList.wrapperSize\n this.setState((prevState: IState) => {\n const diffOffset = this.preset.field.scrollTop - scrollTop\n if (prevState.scrollOffset === scrollTop || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n // FIXME preact 中使用时,该组件会出现触底滚动事件重复触发导致的抖动问题,后续修复\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight))\n this.preset.field = {\n scrollHeight,\n scrollWidth,\n scrollTop: scrollOffset,\n scrollLeft,\n clientHeight,\n clientWidth: scrollWidth,\n diffOffset: this.preset.field.scrollTop - scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n _outerRefSetter = ref => {\n const {\n outerRef\n } = this.props\n this._outerRef = ref\n\n if (typeof outerRef === 'function') {\n outerRef(ref)\n } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {\n // @ts-ignore\n outerRef.current = ref\n }\n }\n\n _resetIsScrollingDebounced = () => {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n\n this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL)\n }\n\n _resetIsScrolling = () => {\n this._resetIsScrollingTimeoutId = null\n this.setState({\n isScrolling: false\n }, () => {\n // Clear style cache after state update has been committed.\n // This way we don't break pure sCU for items that don't use isScrolling param.\n this.preset.resetCache()\n })\n }\n\n public scrollTo (scrollOffset = 0, enhanced = this.preset.enhanced) {\n scrollOffset = Math.max(0, scrollOffset)\n if (this.state.scrollOffset === scrollOffset) return\n\n if (enhanced) {\n const isHorizontal = this.preset.isHorizontal\n const option: any = {\n animated: true,\n duration: 300,\n }\n if (isHorizontal) {\n option.left = scrollOffset\n } else {\n option.top = scrollOffset\n }\n return getScrollViewContextNode(`${this.props.queryPrefix}#${this.preset.id}`).then((node: any) => node.scrollTo(option))\n }\n\n this.setState((prevState: IState) => {\n if (prevState.scrollOffset === scrollOffset) {\n return null\n }\n\n return {\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: true\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollToItem (index: number, align = 'auto', enhanced = this.preset.enhanced) {\n const { itemCount } = this.props\n const { scrollOffset } = this.state\n index = Math.max(0, Math.min(index, itemCount - 1))\n this.scrollTo(this.itemList.getOffsetForIndexAndAlignment(index, align, scrollOffset), enhanced)\n }\n\n componentDidMount () {\n const { initialScrollOffset } = this.props\n\n if (typeof initialScrollOffset === 'number' && this._outerRef != null) {\n const outerRef = this._outerRef\n\n if (this.preset.isHorizontal) {\n outerRef.scrollLeft = initialScrollOffset\n } else {\n outerRef.scrollTop = initialScrollOffset\n }\n }\n\n this._callPropsCallbacks()\n this.preset.boundaryDetection()\n }\n\n componentDidUpdate (prevProps: IProps, prevState: IState) {\n const { scrollOffset, scrollUpdateWasRequested } = this.state\n\n this.preset.update(this.props)\n\n if (scrollUpdateWasRequested && this._outerRef != null) {\n const outerRef = this._outerRef\n\n if (this.preset.isHorizontal) {\n if (this.preset.isRtl) {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // So we need to determine which browser behavior we're dealing with, and mimic it.\n switch (getRTLOffsetType()) {\n case 'negative':\n outerRef.scrollLeft = -scrollOffset\n break\n\n case 'positive-ascending':\n outerRef.scrollLeft = scrollOffset\n break\n\n default:\n outerRef.scrollLeft = outerRef.scrollWidth - outerRef.clientWidth - scrollOffset\n break\n }\n } else {\n outerRef.scrollLeft = scrollOffset\n }\n } else {\n outerRef.scrollTop = scrollOffset\n }\n }\n\n this._callPropsCallbacks(prevProps, prevState)\n }\n\n componentWillUnmount () {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n this.preset.dispose()\n }\n\n getRenderItemNode (index: number, type: 'node' | 'placeholder' = 'node') {\n const { item, itemData, itemKey = defaultItemKey, useIsScrolling } = this.props\n const { isScrolling } = this.state\n const key = itemKey(index, itemData)\n\n const style = this.preset.getItemStyle(index)\n if (type === 'placeholder') {\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${index}-wrapper`,\n style: this.preset.isBrick ? style : { display: 'none' }\n })\n }\n\n return React.createElement<any>(this.preset.itemElement, {\n key: itemKey(index, itemData),\n id: `${this.preset.id}-${index}-wrapper`,\n style\n }, React.createElement(item, {\n id: `${this.preset.id}-${index}`,\n data: itemData,\n index,\n isScrolling: useIsScrolling ? isScrolling : undefined\n }))\n }\n\n getRenderColumnNode () {\n const { isScrolling } = this.state\n const { innerRef, itemCount } = this.props\n const isHorizontal = this.preset.isHorizontal\n // Read this value AFTER items have been created,\n // So their actual sizes (if variable) are taken into consideration.\n const estimatedTotalSize = convertNumber2PX(this.itemList.getOffsetSize())\n const columnProps: any = {\n ref: innerRef,\n key: `${this.preset.id}-inner`,\n id: `${this.preset.id}-inner`,\n style: {\n height: isHorizontal ? '100%' : estimatedTotalSize,\n width: !isHorizontal ? '100%' : estimatedTotalSize,\n position: 'relative',\n pointerEvents: isScrolling ? 'none' : 'auto',\n }\n }\n\n const [startIndex, stopIndex] = this._getRangeToRender()\n const items = []\n\n if (this.preset.isRelative && !this.preset.isBrick) {\n const pre = convertNumber2PX(this.itemList.getOffsetSizeCache(startIndex))\n items.push(\n React.createElement<any>(this.preset.itemElement, {\n key: `${this.preset.id}-pre`,\n id: `${this.preset.id}-pre`,\n style: {\n height: isHorizontal ? '100%' : pre,\n width: !isHorizontal ? '100%' : pre\n }\n })\n )\n }\n\n const placeholderCount = this.preset.placeholderCount\n const restCount = itemCount - stopIndex\n const prevPlaceholder = startIndex < placeholderCount ? startIndex : placeholderCount\n const postPlaceholder = restCount < placeholderCount ? restCount : placeholderCount\n\n for (let itemIndex = 0; itemIndex < stopIndex + postPlaceholder; itemIndex++) {\n if (!this.preset.isBrick) {\n if (itemIndex < startIndex - prevPlaceholder) {\n itemIndex = startIndex - prevPlaceholder\n continue\n }\n }\n\n if (itemIndex < startIndex || itemIndex > stopIndex) {\n items.push(this.getRenderItemNode(itemIndex, 'placeholder'))\n } else {\n items.push(this.getRenderItemNode(itemIndex))\n }\n }\n return React.createElement<any>(this.preset.innerElement, columnProps, items)\n }\n\n render () {\n const {\n className,\n direction,\n height,\n layout,\n style,\n width,\n enhanced = false,\n outerWrapper,\n renderTop,\n renderBottom,\n ...rest\n } = omit(this.props, [\n 'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',\n 'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',\n 'outerElementType', 'outerTagName', 'onScrollToLower', 'onScrollToUpper',\n 'upperThreshold', 'lowerThreshold',\n 'position', 'innerRef',\n ])\n const {\n scrollOffset,\n scrollUpdateWasRequested\n } = this.state\n\n const isHorizontal = this.preset.isHorizontal\n\n const outerProps: any = {\n ...rest,\n id: this.preset.id,\n className,\n onScroll: isHorizontal ? this._onScrollHorizontal : this._onScrollVertical,\n ref: this._outerRefSetter,\n layout,\n enhanced,\n style: {\n position: 'relative',\n height: convertNumber2PX(height),\n width: convertNumber2PX(width),\n overflow: 'auto',\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform',\n direction,\n ...style\n },\n outerElementType: this.preset.outerElement,\n innerElementType: this.preset.innerElement,\n renderTop,\n renderBottom,\n }\n\n if (!enhanced) {\n if (isHorizontal) {\n outerProps.scrollLeft = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollLeft\n } else {\n outerProps.scrollTop = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollTop\n }\n }\n\n return React.createElement(\n outerWrapper || this.preset.outerElement,\n outerProps,\n this.getRenderColumnNode(),\n )\n }\n}\n\n// NOTE: I considered further wrapping individual items with a pure ListItem component.\n// This would avoid ever calling the render function for the same index more than once,\n// But it would also add the overhead of a lot of components/fibers.\n// I assume people already do this (render function returning a class component),\n// So my doing it would just unnecessarily double the wrappers.\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAqB,IAAK,SAAQ,KAAK,CAAC,aAA6B,CAAA;AAUnE,IAAA,OAAO,wBAAwB,CAAE,SAAiB,EAAE,SAAiB,EAAA;AACnE,QAAA,OAAO,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC;;AAMhD,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC;QAuBd,IAAO,CAAA,OAAA,GAAG,MAAK;YACb,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE;;iBACb;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE;AACjB,iBAAA,CAAC,CAAC;;AAEP,SAAC;QAED,IAAS,CAAA,SAAA,GAAG,SA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list/react/list.ts"],"sourcesContent":["import { isNumber } from '@tarojs/shared'\nimport memoizeOne from 'memoize-one'\nimport React from 'react'\n\nimport { cancelTimeout, convertNumber2PX, defaultItemKey, getRectSizeSync, getScrollViewContextNode, omit, requestTimeout } from '../../../utils'\nimport { IS_SCROLLING_DEBOUNCE_INTERVAL } from '../constants'\nimport { getRTLOffsetType } from '../dom-helpers'\nimport ListSet from '../list-set'\nimport Preset from '../preset'\nimport { validateListProps } from './validate'\n\nimport type { IProps } from '../preset'\n\nexport interface IState {\n instance: List\n isScrolling: boolean\n scrollDirection: 'forward' | 'backward'\n scrollOffset: number\n scrollUpdateWasRequested: boolean\n refreshCount: number\n}\n\nexport default class List extends React.PureComponent<IProps, IState> {\n static defaultProps: IProps = {\n direction: 'ltr',\n itemData: undefined,\n layout: 'vertical',\n overscanCount: 2,\n useIsScrolling: false,\n shouldResetStyleCacheOnItemSizeChange: true\n }\n\n static getDerivedStateFromProps (nextProps: IProps, prevState: IState) {\n return validateListProps(nextProps, prevState)\n }\n\n itemList: ListSet\n preset: Preset\n\n constructor (props: IProps) {\n super(props)\n\n this.preset = new Preset(\n props,\n this.refresh,\n )\n this.itemList = this.preset.itemList\n const id = this.props.id || this.preset.id\n this.preset.updateWrapper(id)\n\n this.state = {\n instance: this,\n isScrolling: false,\n scrollDirection: 'forward',\n scrollOffset:\n typeof this.props.initialScrollOffset === 'number'\n ? this.props.initialScrollOffset\n : 0,\n scrollUpdateWasRequested: false,\n refreshCount: 0,\n }\n }\n\n _isRendering = false\n\n _hasPendingRefresh = false\n\n refresh = () => {\n // Note: ListSet records the size of newly measured items while rendering and asks for a refresh,\n // updating state at that point is illegal, so wait until the current render has been committed.\n if (this._isRendering) {\n this._hasPendingRefresh = true\n return\n }\n\n if (process.env.FRAMEWORK === 'preact') {\n this.forceUpdate()\n } else {\n this.setState(({ refreshCount }) => ({\n refreshCount: ++refreshCount\n }))\n }\n }\n\n _flushPendingRefresh () {\n if (this._hasPendingRefresh) {\n this._hasPendingRefresh = false\n this.refresh()\n }\n }\n\n _outerRef = undefined\n\n _resetIsScrollingTimeoutId = null\n\n _callOnItemsRendered = memoizeOne((overscanStartIndex, overscanStopIndex, startIndex, stopIndex) => this.props.onItemsRendered({\n overscanStartIndex,\n overscanStopIndex,\n startIndex,\n stopIndex\n }))\n\n _callOnScroll = memoizeOne((scrollDirection, scrollOffset, scrollUpdateWasRequested, detail) => this.props.onScroll({\n scrollDirection,\n scrollOffset,\n scrollUpdateWasRequested,\n detail\n } as any))\n\n _callPropsCallbacks (prevProps: any = {}, prevState: any = {}) {\n if (typeof this.props.onItemsRendered === 'function') {\n if (this.props.itemCount > 0) {\n if (prevProps && prevProps.itemCount !== this.props.itemCount) {\n const [overscanStartIndex, overscanStopIndex, startIndex, stopIndex] = this._getRangeToRender()\n\n this._callOnItemsRendered(overscanStartIndex, overscanStopIndex, startIndex, stopIndex)\n }\n }\n }\n\n if (typeof this.props.onScroll === 'function') {\n if (!prevState ||\n prevState.scrollDirection !== this.state.scrollDirection ||\n prevState.scrollOffset !== this.state.scrollOffset ||\n prevState.scrollUpdateWasRequested !== this.state.scrollUpdateWasRequested\n ) {\n this._callOnScroll(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.scrollUpdateWasRequested,\n this.preset.field\n )\n }\n }\n\n if (this.itemList.isUnlimitedMode) {\n setTimeout(() => {\n const [startIndex, stopIndex] = this._getRangeToRender()\n const isHorizontal = this.preset.isHorizontal\n for (let index = startIndex; index <= stopIndex; index++) {\n this._getSizeUploadSync(index, isHorizontal)\n }\n }, 0)\n }\n }\n\n _getSizeUploadSync = (index: number, isHorizontal: boolean) => {\n return new Promise((resolve) => {\n if (index >= 0 && index < this.props.itemCount) {\n const times = this.itemList.compareSize(index) ? 3 : 0\n getRectSizeSync(`${this.props.queryPrefix}#${this.preset.id}-${index}`, 100, times).then(({ width, height }) => {\n const size = isHorizontal ? width : height\n if (typeof size === 'number' && size > 0 && !this.itemList.compareSize(index, size)) {\n this.itemList.setSize(index, size)\n resolve(this.itemList.getSize(index))\n }\n })\n }\n })\n }\n\n // Lazily create and cache item styles while scrolling,\n // So that pure component sCU will prevent re-renders.\n // We maintain this cache, and pass a style prop rather than index,\n // So that List can clear cached styles and force item re-render if necessary.\n _getRangeToRender () {\n return this.itemList.getRangeToRender(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.isScrolling\n )\n }\n\n _onScrollHorizontal = event => {\n const {\n scrollHeight,\n scrollWidth = this.itemList.getOffsetSizeCache(),\n scrollTop,\n scrollLeft,\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientWidth = this.itemList.wrapperSize\n this.preset.field = {\n scrollHeight,\n scrollWidth,\n scrollTop,\n scrollLeft,\n clientHeight: scrollHeight,\n clientWidth: scrollWidth\n }\n this.setState((prevState: any) => {\n const diffOffset = this.preset.field.scrollLeft - scrollLeft\n if (prevState.scrollOffset === scrollLeft || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n\n let scrollOffset = scrollLeft\n\n if (this.preset.isRtl) {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.\n // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.\n switch (getRTLOffsetType()) {\n case 'negative':\n scrollOffset = -scrollLeft\n break\n\n case 'positive-descending':\n scrollOffset = scrollWidth - clientWidth - scrollLeft\n break\n }\n } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n\n this.preset.field = {\n scrollWidth: scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollLeft ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n _onScrollVertical = event => {\n const {\n scrollHeight = this.itemList.getOffsetSizeCache(),\n scrollWidth,\n scrollTop,\n scrollLeft\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientHeight = this.itemList.wrapperSize\n this.setState((prevState: IState) => {\n const diffOffset = this.preset.field.scrollTop - scrollTop\n if (prevState.scrollOffset === scrollTop || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n // FIXME preact 中使用时,该组件会出现触底滚动事件重复触发导致的抖动问题,后续修复\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight))\n this.preset.field = {\n scrollHeight,\n scrollWidth,\n scrollTop: scrollOffset,\n scrollLeft,\n clientHeight,\n clientWidth: scrollWidth,\n diffOffset: this.preset.field.scrollTop - scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n _outerRefSetter = ref => {\n const {\n outerRef\n } = this.props\n this._outerRef = ref\n\n if (typeof outerRef === 'function') {\n outerRef(ref)\n } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {\n // @ts-ignore\n outerRef.current = ref\n }\n }\n\n _resetIsScrollingDebounced = () => {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n\n this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL)\n }\n\n _resetIsScrolling = () => {\n this._resetIsScrollingTimeoutId = null\n this.setState({\n isScrolling: false\n }, () => {\n // Clear style cache after state update has been committed.\n // This way we don't break pure sCU for items that don't use isScrolling param.\n this.preset.resetCache()\n })\n }\n\n public scrollTo (scrollOffset = 0, enhanced = this.preset.enhanced) {\n scrollOffset = Math.max(0, scrollOffset)\n if (this.state.scrollOffset === scrollOffset) return\n\n if (enhanced) {\n const isHorizontal = this.preset.isHorizontal\n const option: any = {\n animated: true,\n duration: 300,\n }\n if (isHorizontal) {\n option.left = scrollOffset\n } else {\n option.top = scrollOffset\n }\n return getScrollViewContextNode(`${this.props.queryPrefix}#${this.preset.id}`).then((node: any) => node.scrollTo(option))\n }\n\n this.setState((prevState: IState) => {\n if (prevState.scrollOffset === scrollOffset) {\n return null\n }\n\n return {\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: true\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollToItem (index: number, align = 'auto', enhanced = this.preset.enhanced) {\n const { itemCount } = this.props\n const { scrollOffset } = this.state\n index = Math.max(0, Math.min(index, itemCount - 1))\n this.scrollTo(this.itemList.getOffsetForIndexAndAlignment(index, align, scrollOffset), enhanced)\n }\n\n componentDidMount () {\n const { initialScrollOffset } = this.props\n\n if (typeof initialScrollOffset === 'number' && this._outerRef != null) {\n const outerRef = this._outerRef\n\n if (this.preset.isHorizontal) {\n outerRef.scrollLeft = initialScrollOffset\n } else {\n outerRef.scrollTop = initialScrollOffset\n }\n }\n\n this._callPropsCallbacks()\n this.preset.boundaryDetection()\n this._flushPendingRefresh()\n }\n\n componentDidUpdate (prevProps: IProps, prevState: IState) {\n const { scrollOffset, scrollUpdateWasRequested } = this.state\n\n this.preset.update(this.props)\n\n if (scrollUpdateWasRequested && this._outerRef != null) {\n const outerRef = this._outerRef\n\n if (this.preset.isHorizontal) {\n if (this.preset.isRtl) {\n // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).\n // So we need to determine which browser behavior we're dealing with, and mimic it.\n switch (getRTLOffsetType()) {\n case 'negative':\n outerRef.scrollLeft = -scrollOffset\n break\n\n case 'positive-ascending':\n outerRef.scrollLeft = scrollOffset\n break\n\n default:\n outerRef.scrollLeft = outerRef.scrollWidth - outerRef.clientWidth - scrollOffset\n break\n }\n } else {\n outerRef.scrollLeft = scrollOffset\n }\n } else {\n outerRef.scrollTop = scrollOffset\n }\n }\n\n this._callPropsCallbacks(prevProps, prevState)\n this._flushPendingRefresh()\n }\n\n componentWillUnmount () {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n this.preset.dispose()\n }\n\n getRenderItemNode (index: number, type: 'node' | 'placeholder' = 'node') {\n const { item, itemData, itemKey = defaultItemKey, useIsScrolling } = this.props\n const { isScrolling } = this.state\n const key = itemKey(index, itemData)\n\n const style = this.preset.getItemStyle(index)\n if (type === 'placeholder') {\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${index}-wrapper`,\n style: this.preset.isBrick ? style : { display: 'none' }\n })\n }\n\n return React.createElement<any>(this.preset.itemElement, {\n key: itemKey(index, itemData),\n id: `${this.preset.id}-${index}-wrapper`,\n style\n }, React.createElement(item, {\n id: `${this.preset.id}-${index}`,\n data: itemData,\n index,\n isScrolling: useIsScrolling ? isScrolling : undefined\n }))\n }\n\n getRenderColumnNode () {\n const { isScrolling } = this.state\n const { innerRef, itemCount } = this.props\n const isHorizontal = this.preset.isHorizontal\n // Read this value AFTER items have been created,\n // So their actual sizes (if variable) are taken into consideration.\n const estimatedTotalSize = convertNumber2PX(this.itemList.getOffsetSize())\n const columnProps: any = {\n ref: innerRef,\n key: `${this.preset.id}-inner`,\n id: `${this.preset.id}-inner`,\n style: {\n height: isHorizontal ? '100%' : estimatedTotalSize,\n width: !isHorizontal ? '100%' : estimatedTotalSize,\n position: 'relative',\n pointerEvents: isScrolling ? 'none' : 'auto',\n }\n }\n\n const [startIndex, stopIndex] = this._getRangeToRender()\n const items = []\n\n if (this.preset.isRelative && !this.preset.isBrick) {\n const pre = convertNumber2PX(this.itemList.getOffsetSizeCache(startIndex))\n items.push(\n React.createElement<any>(this.preset.itemElement, {\n key: `${this.preset.id}-pre`,\n id: `${this.preset.id}-pre`,\n style: {\n height: isHorizontal ? '100%' : pre,\n width: !isHorizontal ? '100%' : pre\n }\n })\n )\n }\n\n const placeholderCount = this.preset.placeholderCount\n const restCount = itemCount - stopIndex\n const prevPlaceholder = startIndex < placeholderCount ? startIndex : placeholderCount\n const postPlaceholder = restCount < placeholderCount ? restCount : placeholderCount\n\n for (let itemIndex = 0; itemIndex < stopIndex + postPlaceholder; itemIndex++) {\n if (!this.preset.isBrick) {\n if (itemIndex < startIndex - prevPlaceholder) {\n itemIndex = startIndex - prevPlaceholder\n continue\n }\n }\n\n if (itemIndex < startIndex || itemIndex > stopIndex) {\n items.push(this.getRenderItemNode(itemIndex, 'placeholder'))\n } else {\n items.push(this.getRenderItemNode(itemIndex))\n }\n }\n return React.createElement<any>(this.preset.innerElement, columnProps, items)\n }\n\n render () {\n this._isRendering = true\n try {\n return this._renderList()\n } finally {\n this._isRendering = false\n }\n }\n\n _renderList () {\n const {\n className,\n direction,\n height,\n layout,\n style,\n width,\n enhanced = false,\n outerWrapper,\n renderTop,\n renderBottom,\n ...rest\n } = omit(this.props, [\n 'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',\n 'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',\n 'outerElementType', 'outerTagName', 'onScrollToLower', 'onScrollToUpper',\n 'upperThreshold', 'lowerThreshold',\n 'position', 'innerRef',\n ])\n const {\n scrollOffset,\n scrollUpdateWasRequested\n } = this.state\n\n const isHorizontal = this.preset.isHorizontal\n\n const outerProps: any = {\n ...rest,\n id: this.preset.id,\n className,\n onScroll: isHorizontal ? this._onScrollHorizontal : this._onScrollVertical,\n ref: this._outerRefSetter,\n layout,\n enhanced,\n style: {\n position: 'relative',\n height: convertNumber2PX(height),\n width: convertNumber2PX(width),\n overflow: 'auto',\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform',\n direction,\n ...style\n },\n outerElementType: this.preset.outerElement,\n innerElementType: this.preset.innerElement,\n renderTop,\n renderBottom,\n }\n\n if (!enhanced) {\n if (isHorizontal) {\n outerProps.scrollLeft = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollLeft\n } else {\n outerProps.scrollTop = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollTop\n }\n }\n\n return React.createElement(\n outerWrapper || this.preset.outerElement,\n outerProps,\n this.getRenderColumnNode(),\n )\n }\n}\n\n// NOTE: I considered further wrapping individual items with a pure ListItem component.\n// This would avoid ever calling the render function for the same index more than once,\n// But it would also add the overhead of a lot of components/fibers.\n// I assume people already do this (render function returning a class component),\n// So my doing it would just unnecessarily double the wrappers.\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAqB,IAAK,SAAQ,KAAK,CAAC,aAA6B,CAAA;AAUnE,IAAA,OAAO,wBAAwB,CAAE,SAAiB,EAAE,SAAiB,EAAA;AACnE,QAAA,OAAO,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC;;AAMhD,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC;QAuBd,IAAY,CAAA,YAAA,GAAG,KAAK;QAEpB,IAAkB,CAAA,kBAAA,GAAG,KAAK;QAE1B,IAAO,CAAA,OAAA,GAAG,MAAK;;;AAGb,YAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,gBAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;gBAC9B;;YAGF,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE;;iBACb;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE;AACjB,iBAAA,CAAC,CAAC;;AAEP,SAAC;QASD,IAAS,CAAA,SAAA,GAAG,SAAS;QAErB,IAA0B,CAAA,0BAAA,GAAG,IAAI;AAEjC,QAAA,IAAA,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B,EAAE,CAC3B;;;AAthBI,IAAA,CAAA,YAAY,GAAW;AAC5B,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,aAAa,EAAE,CAAC;AAChB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,qCAAqC,EAAE;AACxC,CAPkB;AA0hBrB;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -14,7 +14,10 @@ export default class Waterfall extends React.PureComponent<IProps, IState> {
|
|
|
14
14
|
itemMap: ListMap;
|
|
15
15
|
preset: Preset;
|
|
16
16
|
constructor(props: IProps);
|
|
17
|
+
_isRendering: boolean;
|
|
18
|
+
_hasPendingRefresh: boolean;
|
|
17
19
|
refresh: () => void;
|
|
20
|
+
_flushPendingRefresh(): void;
|
|
18
21
|
_outerRef: any;
|
|
19
22
|
_resetIsScrollingTimeoutId: any;
|
|
20
23
|
_callOnItemsRendered: import("memoize-one").MemoizedFn<(this: any, columnIndex: any, overscanStartIndex: any, overscanStopIndex: any) => any>;
|
|
@@ -33,5 +36,6 @@ export default class Waterfall extends React.PureComponent<IProps, IState> {
|
|
|
33
36
|
getRenderItemNode(itemIndex: number, type?: 'node' | 'placeholder'): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
34
37
|
getRenderColumnNode(columnIndex: number): React.ReactElement<{}, string | React.JSXElementConstructor<any>>;
|
|
35
38
|
render(): React.ReactElement<{}, string | React.JSXElementConstructor<any>>;
|
|
39
|
+
_renderWaterfall(): React.ReactElement<{}, string | React.JSXElementConstructor<any>>;
|
|
36
40
|
}
|
|
37
41
|
export {};
|
|
@@ -15,7 +15,15 @@ import { omit } from '../../../utils/lodash.js';
|
|
|
15
15
|
class Waterfall extends React.PureComponent {
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
18
|
+
this._isRendering = false;
|
|
19
|
+
this._hasPendingRefresh = false;
|
|
18
20
|
this.refresh = () => {
|
|
21
|
+
// Note: ListMap records the size of newly laid out items while rendering and asks for a refresh,
|
|
22
|
+
// updating state at that point is illegal, so wait until the current render has been committed.
|
|
23
|
+
if (this._isRendering) {
|
|
24
|
+
this._hasPendingRefresh = true;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
19
27
|
if (process.env.FRAMEWORK === 'preact') {
|
|
20
28
|
this.forceUpdate();
|
|
21
29
|
}
|
|
@@ -114,6 +122,12 @@ class Waterfall extends React.PureComponent {
|
|
|
114
122
|
refreshCount: 0,
|
|
115
123
|
};
|
|
116
124
|
}
|
|
125
|
+
_flushPendingRefresh() {
|
|
126
|
+
if (this._hasPendingRefresh) {
|
|
127
|
+
this._hasPendingRefresh = false;
|
|
128
|
+
this.refresh();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
117
131
|
_callPropsCallbacks(prevProps = {}, prevState = {}) {
|
|
118
132
|
if (typeof this.props.onItemsRendered === 'function') {
|
|
119
133
|
if (this.props.itemCount > 0) {
|
|
@@ -195,6 +209,7 @@ class Waterfall extends React.PureComponent {
|
|
|
195
209
|
}
|
|
196
210
|
this._callPropsCallbacks();
|
|
197
211
|
this.preset.boundaryDetection();
|
|
212
|
+
this._flushPendingRefresh();
|
|
198
213
|
}
|
|
199
214
|
componentDidUpdate(prevProps, prevState) {
|
|
200
215
|
const { scrollOffset, scrollUpdateWasRequested } = this.state;
|
|
@@ -203,6 +218,7 @@ class Waterfall extends React.PureComponent {
|
|
|
203
218
|
this._outerRef.scrollTop = scrollOffset;
|
|
204
219
|
}
|
|
205
220
|
this._callPropsCallbacks(prevProps, prevState);
|
|
221
|
+
this._flushPendingRefresh();
|
|
206
222
|
}
|
|
207
223
|
componentWillUnmount() {
|
|
208
224
|
if (this._resetIsScrollingTimeoutId !== null) {
|
|
@@ -282,6 +298,15 @@ class Waterfall extends React.PureComponent {
|
|
|
282
298
|
return React.createElement(this.preset.innerElement, columnProps, items);
|
|
283
299
|
}
|
|
284
300
|
render() {
|
|
301
|
+
this._isRendering = true;
|
|
302
|
+
try {
|
|
303
|
+
return this._renderWaterfall();
|
|
304
|
+
}
|
|
305
|
+
finally {
|
|
306
|
+
this._isRendering = false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
_renderWaterfall() {
|
|
285
310
|
const _a = omit(this.props, [
|
|
286
311
|
'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',
|
|
287
312
|
'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waterfall.js","sources":["../../../../src/components/virtual-waterfall/react/waterfall.ts"],"sourcesContent":["import { isNumber } from '@tarojs/shared'\nimport classNames from 'classnames'\nimport memoizeOne from 'memoize-one'\nimport React from 'react'\n\nimport { cancelTimeout, convertNumber2PX, defaultItemKey, getRectSizeSync, getScrollViewContextNode, omit, requestTimeout } from '../../../utils'\nimport { IS_SCROLLING_DEBOUNCE_INTERVAL } from '../constants'\nimport ListMap from '../list-map'\nimport Preset, { type IProps } from '../preset'\n\ninterface IState {\n instance: Waterfall\n isScrolling: boolean\n scrollDirection: 'forward' | 'backward'\n scrollOffset: number\n scrollUpdateWasRequested: boolean\n refreshCount: number\n}\n\nexport default class Waterfall extends React.PureComponent<IProps, IState> {\n static defaultProps: IProps = {\n itemData: undefined,\n overscanDistance: 50,\n useIsScrolling: false,\n shouldResetStyleCacheOnItemSizeChange: true\n }\n\n itemMap: ListMap\n preset: Preset\n\n constructor (props: IProps) {\n super(props)\n\n this.preset = new Preset(\n props,\n this.refresh,\n )\n const id = this.props.id || this.preset.id\n this.preset.updateWrapper(id)\n this.itemMap = this.preset.itemMap\n\n this.state = {\n instance: this,\n isScrolling: false,\n scrollDirection: 'forward',\n scrollOffset:\n typeof this.props.initialScrollOffset === 'number'\n ? this.props.initialScrollOffset\n : 0,\n scrollUpdateWasRequested: false,\n refreshCount: 0,\n }\n }\n\n refresh = () => {\n if (process.env.FRAMEWORK === 'preact') {\n this.forceUpdate()\n } else {\n this.setState(({ refreshCount }) => ({\n refreshCount: ++refreshCount\n }))\n }\n }\n\n _outerRef = undefined\n\n _resetIsScrollingTimeoutId = null\n\n _callOnItemsRendered = memoizeOne((columnIndex, overscanStartIndex, overscanStopIndex) => this.props.onItemsRendered({\n columnIndex,\n overscanStartIndex,\n overscanStopIndex,\n }))\n\n _callOnScroll = memoizeOne((scrollDirection, scrollOffset, scrollUpdateWasRequested, detail) => this.props.onScroll({\n scrollDirection,\n scrollOffset,\n scrollUpdateWasRequested,\n detail\n } as any))\n\n _callPropsCallbacks (prevProps: any = {}, prevState: any = {}) {\n if (typeof this.props.onItemsRendered === 'function') {\n if (this.props.itemCount > 0) {\n if (prevProps && prevProps.itemCount !== this.props.itemCount) {\n for (let columnIndex = 0; columnIndex < this.itemMap.columns; columnIndex++) {\n const [overscanStartIndex, overscanStopIndex] = this._getRangeToRender(columnIndex)\n this._callOnItemsRendered(columnIndex, overscanStartIndex, overscanStopIndex)\n }\n }\n }\n }\n\n if (typeof this.props.onScroll === 'function') {\n if (!prevState ||\n prevState.scrollDirection !== this.state.scrollDirection ||\n prevState.scrollOffset !== this.state.scrollOffset ||\n prevState.scrollUpdateWasRequested !== this.state.scrollUpdateWasRequested\n ) {\n this._callOnScroll(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.scrollUpdateWasRequested,\n this.preset.field\n )\n }\n }\n\n if (this.itemMap.isUnlimitedMode) {\n setTimeout(() => {\n for (let column = 0; column < this.itemMap.columns; column++) {\n const [startIndex, stopIndex] = this._getRangeToRender(column)\n for (let row = startIndex; row <= stopIndex; row++) {\n const itemIndex = this.itemMap.getItemIndexByPosition(column, row)\n if (itemIndex >= 0 && itemIndex < this.props.itemCount) {\n const times = this.itemMap.compareSizeByPosition(column, row) ? 3 : 0\n getRectSizeSync(`${this.props.queryPrefix}#${this.preset.id}-${itemIndex}`, 100, times).then(({ height }) => {\n if (typeof height === 'number' && height > 0 && !this.itemMap.compareSizeByPosition(column, row, height)) {\n this.itemMap.setSizeByPosition(column, row, height)\n }\n })\n }\n }\n }\n }, 0)\n }\n }\n\n // Lazily create and cache item styles while scrolling,\n // So that pure component sCU will prevent re-renders.\n // We maintain this cache, and pass a style prop rather than index,\n // So that List can clear cached styles and force item re-render if necessary.\n _getRangeToRender (columnIndex = 0) {\n return this.itemMap.getRangeToRender(\n this.state.scrollDirection,\n columnIndex,\n this.state.scrollOffset,\n this.state.isScrolling,\n )\n }\n\n _outerRefSetter = ref => {\n const { outerRef } = this.props\n this._outerRef = ref\n\n if (typeof outerRef === 'function') {\n outerRef(ref)\n } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {\n // @ts-ignore\n outerRef.current = ref\n }\n }\n\n _resetIsScrollingDebounced = () => {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n\n this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL)\n }\n\n _resetIsScrolling = () => {\n this._resetIsScrollingTimeoutId = null\n this.setState({\n isScrolling: false\n }, () => {\n // Clear style cache after state update has been committed.\n // This way we don't break pure sCU for items that don't use isScrolling param.\n this.preset.resetCache()\n })\n }\n\n _onScroll = event => {\n const {\n scrollHeight = this.itemMap.maxColumnSize,\n scrollWidth,\n scrollTop,\n scrollLeft\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientHeight = this.itemMap.wrapperHeight\n const clientWidth = this.itemMap.wrapperWidth\n this.setState((prevState: IState) => {\n const diffOffset = this.preset.field.scrollTop - scrollTop\n if (prevState.scrollOffset === scrollTop || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n // FIXME preact 中使用时,该组件会出现触底滚动事件重复触发导致的抖动问题,后续修复\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight))\n this.preset.field = {\n scrollHeight: this.itemMap.maxColumnSize,\n scrollWidth,\n scrollTop: scrollOffset,\n scrollLeft,\n clientHeight,\n clientWidth,\n diffOffset: this.preset.field.scrollTop - scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollTo (scrollOffset = 0, enhanced = this.preset.enhanced) {\n scrollOffset = Math.max(0, scrollOffset)\n if (this.state.scrollOffset === scrollOffset) return\n\n if (enhanced) {\n const option: any = {\n animated: true,\n duration: 300,\n }\n option.top = scrollOffset\n return getScrollViewContextNode(`${this.props.queryPrefix}#${this.preset.id}`).then((node: any) => node.scrollTo(option))\n }\n\n this.setState((prevState: IState) => {\n if (prevState.scrollOffset === scrollOffset) {\n return null\n }\n\n return {\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: true\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollToItem (index: number, align = 'auto', enhanced = this.preset.enhanced) {\n const { itemCount } = this.props\n const { scrollOffset } = this.state\n index = Math.max(0, Math.min(index, itemCount - 1))\n this.scrollTo(this.itemMap.getOffsetForIndexAndAlignment(index, align, scrollOffset), enhanced)\n }\n\n componentDidMount () {\n const { initialScrollOffset } = this.props\n\n if (typeof initialScrollOffset === 'number' && this._outerRef != null) {\n this._outerRef.scrollTop = initialScrollOffset\n }\n\n this._callPropsCallbacks()\n this.preset.boundaryDetection()\n }\n\n componentDidUpdate (prevProps: IProps, prevState: IState) {\n const { scrollOffset, scrollUpdateWasRequested } = this.state\n\n this.preset.update(this.props)\n\n if (scrollUpdateWasRequested && this._outerRef != null) {\n this._outerRef.scrollTop = scrollOffset\n }\n\n this._callPropsCallbacks(prevProps, prevState)\n }\n\n componentWillUnmount () {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n this.preset.dispose()\n }\n\n getRenderItemNode (itemIndex: number, type: 'node' | 'placeholder' = 'node') {\n const { item, itemData, itemKey = defaultItemKey, useIsScrolling } = this.props\n const { isScrolling } = this.state\n const key = itemKey(itemIndex, itemData)\n\n const style = this.preset.getItemStyle(itemIndex)\n if (type === 'placeholder') {\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${itemIndex}-wrapper`,\n style: this.preset.isBrick ? style : { display: 'none' }\n })\n }\n\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${itemIndex}-wrapper`,\n style\n }, React.createElement(item, {\n id: `${this.preset.id}-${itemIndex}`,\n data: itemData,\n index: itemIndex,\n isScrolling: useIsScrolling ? isScrolling : undefined\n }))\n }\n\n getRenderColumnNode (columnIndex: number) {\n const columnProps: any = {\n key: `${this.preset.id}-column-${columnIndex}`,\n id: `${this.preset.id}-column-${columnIndex}`,\n style: {\n height: '100%',\n position: 'relative',\n width: convertNumber2PX(this.itemMap.columnWidth)\n }\n }\n\n const [startIndex, stopIndex] = this._getRangeToRender(columnIndex)\n const items = []\n if (this.preset.isRelative && !this.preset.isBrick) {\n const pre = convertNumber2PX(this.itemMap.getOffsetSizeCache(columnIndex, startIndex))\n items.push(\n React.createElement<any>(this.preset.itemElement, {\n key: `${this.preset.id}-${columnIndex}-pre`,\n id: `${this.preset.id}-${columnIndex}-pre`,\n style: {\n height: pre,\n width: '100%'\n }\n })\n )\n }\n const placeholderCount = this.preset.placeholderCount\n const restCount = this.itemMap.getColumnLength(columnIndex) - stopIndex\n const prevPlaceholder = startIndex < placeholderCount ? startIndex : placeholderCount\n const postPlaceholder = restCount < placeholderCount ? restCount : placeholderCount\n const visibleItem = (stopIndex + postPlaceholder) * this.itemMap.columns + columnIndex\n this.itemMap.updateItem(visibleItem)\n for (let row = 0; row < stopIndex + postPlaceholder; row++) {\n const itemIndex = this.itemMap.getItemIndexByPosition(columnIndex, row)\n if (itemIndex >= 0 && itemIndex < this.props.itemCount) {\n if (!this.preset.isBrick) {\n if (row < startIndex - prevPlaceholder) {\n row = startIndex - prevPlaceholder\n continue\n }\n }\n\n if (row < startIndex || row > stopIndex) {\n items.push(this.getRenderItemNode(itemIndex, 'placeholder'))\n } else {\n items.push(this.getRenderItemNode(itemIndex))\n }\n }\n }\n return React.createElement(this.preset.innerElement, columnProps, items)\n }\n\n render () {\n const {\n className,\n style,\n height,\n width,\n enhanced,\n outerWrapper,\n renderTop,\n renderBottom,\n ...rest\n } = omit(this.props, [\n 'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',\n 'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',\n 'outerElementType', 'outerTagName', 'onScrollToLower', 'onScrollToUpper',\n 'upperThreshold', 'lowerThreshold',\n 'position',\n ])\n const {\n isScrolling,\n scrollOffset,\n scrollUpdateWasRequested\n } = this.state\n\n const estimatedHeight = convertNumber2PX(this.itemMap.maxColumnSize)\n const outerProps: any = {\n ...rest,\n id: this.preset.id,\n className: classNames(className, 'virtual-waterfall'),\n onScroll: this._onScroll,\n ref: this._outerRefSetter,\n style: {\n height: convertNumber2PX(height),\n width: convertNumber2PX(width),\n overflow: 'auto',\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform',\n ...style\n },\n enhanced,\n outerElementType: this.preset.outerElement,\n innerElementType: this.preset.innerElement,\n renderTop,\n renderBottom,\n }\n\n if (!this.preset.enhanced) {\n outerProps.scrollTop = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollTop\n }\n\n const columnNodes: React.ReactNode[] = []\n for (let i = 0; i < this.itemMap.columns; i++) {\n columnNodes.push(this.getRenderColumnNode(i))\n }\n\n return React.createElement(\n outerWrapper || this.preset.outerElement,\n outerProps,\n React.createElement(this.preset.innerElement, {\n key: `${this.preset.id}-wrapper`,\n id: `${this.preset.id}-wrapper`,\n className: classNames(className, 'virtual-waterfall-wrapper'),\n style: {\n display: 'flex',\n justifyContent: 'space-evenly',\n pointerEvents: isScrolling ? 'none' : 'auto',\n position: 'relative',\n height: estimatedHeight,\n width: '100%',\n ...style\n },\n } as any, columnNodes),\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmBA,MAAqB,SAAU,SAAQ,KAAK,CAAC,aAA6B,CAAA;AAWxE,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC;QAuBd,IAAO,CAAA,OAAA,GAAG,MAAK;YACb,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE;;iBACb;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE;AACjB,iBAAA,CAAC,CAAC;;AAEP,SAAC;QAED,IAAS,CAAA,SAAA,GAAG,SAAS;QAErB,IAA0B,CAAA,0BAAA,GAAG,IAAI;AAEjC,QAAA,IAAA,CAAA,oBAAoB,GAAG,UAAU,CAAC,CAAC,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,KAAK,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YACnH,WAAW;YACX,kBAAkB;YAClB,iBAAiB;AAClB,SAAA,CAAC,CAAC;AAEH,QAAA,IAAA,CAAA,aAAa,GAAG,UAAU,CAAC,CAAC,eAAe,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAClH,eAAe;YACf,YAAY;YACZ,wBAAwB;YACxB;AACM,SAAA,CAAC,CAAC;QA8DV,IAAe,CAAA,eAAA,GAAG,GAAG,IAAG;AACtB,YAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;AAC/B,YAAA,IAAI,CAAC,SAAS,GAAG,GAAG;AAEpB,YAAA,IAAI,OAAO,QAAQ,KAAK,UAAU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ACrB,IAAA,qCAAqC,EAAE;AACxC,CALkB;;;;"}
|
|
1
|
+
{"version":3,"file":"waterfall.js","sources":["../../../../src/components/virtual-waterfall/react/waterfall.ts"],"sourcesContent":["import { isNumber } from '@tarojs/shared'\nimport classNames from 'classnames'\nimport memoizeOne from 'memoize-one'\nimport React from 'react'\n\nimport { cancelTimeout, convertNumber2PX, defaultItemKey, getRectSizeSync, getScrollViewContextNode, omit, requestTimeout } from '../../../utils'\nimport { IS_SCROLLING_DEBOUNCE_INTERVAL } from '../constants'\nimport ListMap from '../list-map'\nimport Preset, { type IProps } from '../preset'\n\ninterface IState {\n instance: Waterfall\n isScrolling: boolean\n scrollDirection: 'forward' | 'backward'\n scrollOffset: number\n scrollUpdateWasRequested: boolean\n refreshCount: number\n}\n\nexport default class Waterfall extends React.PureComponent<IProps, IState> {\n static defaultProps: IProps = {\n itemData: undefined,\n overscanDistance: 50,\n useIsScrolling: false,\n shouldResetStyleCacheOnItemSizeChange: true\n }\n\n itemMap: ListMap\n preset: Preset\n\n constructor (props: IProps) {\n super(props)\n\n this.preset = new Preset(\n props,\n this.refresh,\n )\n const id = this.props.id || this.preset.id\n this.preset.updateWrapper(id)\n this.itemMap = this.preset.itemMap\n\n this.state = {\n instance: this,\n isScrolling: false,\n scrollDirection: 'forward',\n scrollOffset:\n typeof this.props.initialScrollOffset === 'number'\n ? this.props.initialScrollOffset\n : 0,\n scrollUpdateWasRequested: false,\n refreshCount: 0,\n }\n }\n\n _isRendering = false\n\n _hasPendingRefresh = false\n\n refresh = () => {\n // Note: ListMap records the size of newly laid out items while rendering and asks for a refresh,\n // updating state at that point is illegal, so wait until the current render has been committed.\n if (this._isRendering) {\n this._hasPendingRefresh = true\n return\n }\n\n if (process.env.FRAMEWORK === 'preact') {\n this.forceUpdate()\n } else {\n this.setState(({ refreshCount }) => ({\n refreshCount: ++refreshCount\n }))\n }\n }\n\n _flushPendingRefresh () {\n if (this._hasPendingRefresh) {\n this._hasPendingRefresh = false\n this.refresh()\n }\n }\n\n _outerRef = undefined\n\n _resetIsScrollingTimeoutId = null\n\n _callOnItemsRendered = memoizeOne((columnIndex, overscanStartIndex, overscanStopIndex) => this.props.onItemsRendered({\n columnIndex,\n overscanStartIndex,\n overscanStopIndex,\n }))\n\n _callOnScroll = memoizeOne((scrollDirection, scrollOffset, scrollUpdateWasRequested, detail) => this.props.onScroll({\n scrollDirection,\n scrollOffset,\n scrollUpdateWasRequested,\n detail\n } as any))\n\n _callPropsCallbacks (prevProps: any = {}, prevState: any = {}) {\n if (typeof this.props.onItemsRendered === 'function') {\n if (this.props.itemCount > 0) {\n if (prevProps && prevProps.itemCount !== this.props.itemCount) {\n for (let columnIndex = 0; columnIndex < this.itemMap.columns; columnIndex++) {\n const [overscanStartIndex, overscanStopIndex] = this._getRangeToRender(columnIndex)\n this._callOnItemsRendered(columnIndex, overscanStartIndex, overscanStopIndex)\n }\n }\n }\n }\n\n if (typeof this.props.onScroll === 'function') {\n if (!prevState ||\n prevState.scrollDirection !== this.state.scrollDirection ||\n prevState.scrollOffset !== this.state.scrollOffset ||\n prevState.scrollUpdateWasRequested !== this.state.scrollUpdateWasRequested\n ) {\n this._callOnScroll(\n this.state.scrollDirection,\n this.state.scrollOffset,\n this.state.scrollUpdateWasRequested,\n this.preset.field\n )\n }\n }\n\n if (this.itemMap.isUnlimitedMode) {\n setTimeout(() => {\n for (let column = 0; column < this.itemMap.columns; column++) {\n const [startIndex, stopIndex] = this._getRangeToRender(column)\n for (let row = startIndex; row <= stopIndex; row++) {\n const itemIndex = this.itemMap.getItemIndexByPosition(column, row)\n if (itemIndex >= 0 && itemIndex < this.props.itemCount) {\n const times = this.itemMap.compareSizeByPosition(column, row) ? 3 : 0\n getRectSizeSync(`${this.props.queryPrefix}#${this.preset.id}-${itemIndex}`, 100, times).then(({ height }) => {\n if (typeof height === 'number' && height > 0 && !this.itemMap.compareSizeByPosition(column, row, height)) {\n this.itemMap.setSizeByPosition(column, row, height)\n }\n })\n }\n }\n }\n }, 0)\n }\n }\n\n // Lazily create and cache item styles while scrolling,\n // So that pure component sCU will prevent re-renders.\n // We maintain this cache, and pass a style prop rather than index,\n // So that List can clear cached styles and force item re-render if necessary.\n _getRangeToRender (columnIndex = 0) {\n return this.itemMap.getRangeToRender(\n this.state.scrollDirection,\n columnIndex,\n this.state.scrollOffset,\n this.state.isScrolling,\n )\n }\n\n _outerRefSetter = ref => {\n const { outerRef } = this.props\n this._outerRef = ref\n\n if (typeof outerRef === 'function') {\n outerRef(ref)\n } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {\n // @ts-ignore\n outerRef.current = ref\n }\n }\n\n _resetIsScrollingDebounced = () => {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n\n this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL)\n }\n\n _resetIsScrolling = () => {\n this._resetIsScrollingTimeoutId = null\n this.setState({\n isScrolling: false\n }, () => {\n // Clear style cache after state update has been committed.\n // This way we don't break pure sCU for items that don't use isScrolling param.\n this.preset.resetCache()\n })\n }\n\n _onScroll = event => {\n const {\n scrollHeight = this.itemMap.maxColumnSize,\n scrollWidth,\n scrollTop,\n scrollLeft\n } = event.currentTarget\n if (!isNumber(scrollHeight) || !isNumber(scrollWidth)) return\n const clientHeight = this.itemMap.wrapperHeight\n const clientWidth = this.itemMap.wrapperWidth\n this.setState((prevState: IState) => {\n const diffOffset = this.preset.field.scrollTop - scrollTop\n if (prevState.scrollOffset === scrollTop || this.preset.isShaking(diffOffset)) {\n // Scroll position may have been updated by cDM/cDU,\n // In which case we don't need to trigger another render,\n // And we don't want to update state.isScrolling.\n return null\n }\n // FIXME preact 中使用时,该组件会出现触底滚动事件重复触发导致的抖动问题,后续修复\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight))\n this.preset.field = {\n scrollHeight: this.itemMap.maxColumnSize,\n scrollWidth,\n scrollTop: scrollOffset,\n scrollLeft,\n clientHeight,\n clientWidth,\n diffOffset: this.preset.field.scrollTop - scrollOffset,\n }\n return {\n isScrolling: true,\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: false\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollTo (scrollOffset = 0, enhanced = this.preset.enhanced) {\n scrollOffset = Math.max(0, scrollOffset)\n if (this.state.scrollOffset === scrollOffset) return\n\n if (enhanced) {\n const option: any = {\n animated: true,\n duration: 300,\n }\n option.top = scrollOffset\n return getScrollViewContextNode(`${this.props.queryPrefix}#${this.preset.id}`).then((node: any) => node.scrollTo(option))\n }\n\n this.setState((prevState: IState) => {\n if (prevState.scrollOffset === scrollOffset) {\n return null\n }\n\n return {\n scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',\n scrollOffset,\n scrollUpdateWasRequested: true\n }\n }, this._resetIsScrollingDebounced)\n }\n\n public scrollToItem (index: number, align = 'auto', enhanced = this.preset.enhanced) {\n const { itemCount } = this.props\n const { scrollOffset } = this.state\n index = Math.max(0, Math.min(index, itemCount - 1))\n this.scrollTo(this.itemMap.getOffsetForIndexAndAlignment(index, align, scrollOffset), enhanced)\n }\n\n componentDidMount () {\n const { initialScrollOffset } = this.props\n\n if (typeof initialScrollOffset === 'number' && this._outerRef != null) {\n this._outerRef.scrollTop = initialScrollOffset\n }\n\n this._callPropsCallbacks()\n this.preset.boundaryDetection()\n this._flushPendingRefresh()\n }\n\n componentDidUpdate (prevProps: IProps, prevState: IState) {\n const { scrollOffset, scrollUpdateWasRequested } = this.state\n\n this.preset.update(this.props)\n\n if (scrollUpdateWasRequested && this._outerRef != null) {\n this._outerRef.scrollTop = scrollOffset\n }\n\n this._callPropsCallbacks(prevProps, prevState)\n this._flushPendingRefresh()\n }\n\n componentWillUnmount () {\n if (this._resetIsScrollingTimeoutId !== null) {\n cancelTimeout(this._resetIsScrollingTimeoutId)\n }\n this.preset.dispose()\n }\n\n getRenderItemNode (itemIndex: number, type: 'node' | 'placeholder' = 'node') {\n const { item, itemData, itemKey = defaultItemKey, useIsScrolling } = this.props\n const { isScrolling } = this.state\n const key = itemKey(itemIndex, itemData)\n\n const style = this.preset.getItemStyle(itemIndex)\n if (type === 'placeholder') {\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${itemIndex}-wrapper`,\n style: this.preset.isBrick ? style : { display: 'none' }\n })\n }\n\n return React.createElement<any>(this.preset.itemElement, {\n key,\n id: `${this.preset.id}-${itemIndex}-wrapper`,\n style\n }, React.createElement(item, {\n id: `${this.preset.id}-${itemIndex}`,\n data: itemData,\n index: itemIndex,\n isScrolling: useIsScrolling ? isScrolling : undefined\n }))\n }\n\n getRenderColumnNode (columnIndex: number) {\n const columnProps: any = {\n key: `${this.preset.id}-column-${columnIndex}`,\n id: `${this.preset.id}-column-${columnIndex}`,\n style: {\n height: '100%',\n position: 'relative',\n width: convertNumber2PX(this.itemMap.columnWidth)\n }\n }\n\n const [startIndex, stopIndex] = this._getRangeToRender(columnIndex)\n const items = []\n if (this.preset.isRelative && !this.preset.isBrick) {\n const pre = convertNumber2PX(this.itemMap.getOffsetSizeCache(columnIndex, startIndex))\n items.push(\n React.createElement<any>(this.preset.itemElement, {\n key: `${this.preset.id}-${columnIndex}-pre`,\n id: `${this.preset.id}-${columnIndex}-pre`,\n style: {\n height: pre,\n width: '100%'\n }\n })\n )\n }\n const placeholderCount = this.preset.placeholderCount\n const restCount = this.itemMap.getColumnLength(columnIndex) - stopIndex\n const prevPlaceholder = startIndex < placeholderCount ? startIndex : placeholderCount\n const postPlaceholder = restCount < placeholderCount ? restCount : placeholderCount\n const visibleItem = (stopIndex + postPlaceholder) * this.itemMap.columns + columnIndex\n this.itemMap.updateItem(visibleItem)\n for (let row = 0; row < stopIndex + postPlaceholder; row++) {\n const itemIndex = this.itemMap.getItemIndexByPosition(columnIndex, row)\n if (itemIndex >= 0 && itemIndex < this.props.itemCount) {\n if (!this.preset.isBrick) {\n if (row < startIndex - prevPlaceholder) {\n row = startIndex - prevPlaceholder\n continue\n }\n }\n\n if (row < startIndex || row > stopIndex) {\n items.push(this.getRenderItemNode(itemIndex, 'placeholder'))\n } else {\n items.push(this.getRenderItemNode(itemIndex))\n }\n }\n }\n return React.createElement(this.preset.innerElement, columnProps, items)\n }\n\n render () {\n this._isRendering = true\n try {\n return this._renderWaterfall()\n } finally {\n this._isRendering = false\n }\n }\n\n _renderWaterfall () {\n const {\n className,\n style,\n height,\n width,\n enhanced,\n outerWrapper,\n renderTop,\n renderBottom,\n ...rest\n } = omit(this.props, [\n 'item', 'itemCount', 'itemData', 'itemKey', 'useIsScrolling',\n 'innerElementType', 'innerTagName', 'itemElementType', 'itemTagName',\n 'outerElementType', 'outerTagName', 'onScrollToLower', 'onScrollToUpper',\n 'upperThreshold', 'lowerThreshold',\n 'position',\n ])\n const {\n isScrolling,\n scrollOffset,\n scrollUpdateWasRequested\n } = this.state\n\n const estimatedHeight = convertNumber2PX(this.itemMap.maxColumnSize)\n const outerProps: any = {\n ...rest,\n id: this.preset.id,\n className: classNames(className, 'virtual-waterfall'),\n onScroll: this._onScroll,\n ref: this._outerRefSetter,\n style: {\n height: convertNumber2PX(height),\n width: convertNumber2PX(width),\n overflow: 'auto',\n WebkitOverflowScrolling: 'touch',\n willChange: 'transform',\n ...style\n },\n enhanced,\n outerElementType: this.preset.outerElement,\n innerElementType: this.preset.innerElement,\n renderTop,\n renderBottom,\n }\n\n if (!this.preset.enhanced) {\n outerProps.scrollTop = scrollUpdateWasRequested ? scrollOffset : this.preset.field.scrollTop\n }\n\n const columnNodes: React.ReactNode[] = []\n for (let i = 0; i < this.itemMap.columns; i++) {\n columnNodes.push(this.getRenderColumnNode(i))\n }\n\n return React.createElement(\n outerWrapper || this.preset.outerElement,\n outerProps,\n React.createElement(this.preset.innerElement, {\n key: `${this.preset.id}-wrapper`,\n id: `${this.preset.id}-wrapper`,\n className: classNames(className, 'virtual-waterfall-wrapper'),\n style: {\n display: 'flex',\n justifyContent: 'space-evenly',\n pointerEvents: isScrolling ? 'none' : 'auto',\n position: 'relative',\n height: estimatedHeight,\n width: '100%',\n ...style\n },\n } as any, columnNodes),\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmBA,MAAqB,SAAU,SAAQ,KAAK,CAAC,aAA6B,CAAA;AAWxE,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC;QAuBd,IAAY,CAAA,YAAA,GAAG,KAAK;QAEpB,IAAkB,CAAA,kBAAA,GAAG,KAAK;QAE1B,IAAO,CAAA,OAAA,GAAG,MAAK;;;AAGb,YAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,gBAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI;gBAC9B;;YAGF,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE;;iBACb;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE;AACjB,iBAAA,CAAC,CAAC;;AAEP,SAAC;QASD,IAAS,CAAA,SAAA,GAAG,SAAS;QAErB,IAA0B,CAAA,0BAAA,GAAG,IAAI;AAEjC,QAAA,IAAA,CAAA,oBAAoB,GAAG,UAAU,CAAC,CAAC,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,KAAK,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YACnH,WAAW;YACX,kBAAkB;YAClB,iBAAiB;AAClB,SAAA,CAAC,CAAC;AAEH,QAAA,IAAA,CAAA,aAAa,GAAG,UAAU,CAAC,CAAC,eAAe,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAClH,eAAe;YACf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AAC5C,YAAA,GAAG,EAAE,CAAG,EAAA,IAAI,CAAC,MAAM,CAAC,EAAE,CAAU,QAAA,CAAA;AAChC,YAAA,EAAE,EAAE,CAAG,EAAA,IAAI,CAAC,MAAM,CAAC,EAAE,CAAU,QAAA,CAAA;AAC/B,YAAA,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,2BAA2B,CAAC;AAC7D,YAAA,KAAK,EACH,MAAA,CAAA,MAAA,CAAA,EAAA,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,EAC5C,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,EAAA,EACV,KAAK,CACT;SACK,EAAE,WAAW,CAAC,CACvB;;;AAjbI,SAAA,CAAA,YAAY,GAAW;AAC5B,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,qCAAqC,EAAE;AACxC,CALkB;;;;"}
|
|
@@ -45,8 +45,9 @@ function FlowItemContainer(_a) {
|
|
|
45
45
|
}, [top$, layouted$, height$]);
|
|
46
46
|
const setInnerMeasureRef = useMemoizedFn((el) => {
|
|
47
47
|
const innerRef = refFlowItem;
|
|
48
|
+
const previousEl = innerRef.current;
|
|
48
49
|
innerRef.current = el !== null && el !== void 0 ? el : undefined;
|
|
49
|
-
node.attachMeasureElement(el);
|
|
50
|
+
node.attachMeasureElement(el, previousEl);
|
|
50
51
|
});
|
|
51
52
|
useEffect(() => {
|
|
52
53
|
let observer;
|
|
@@ -61,11 +62,15 @@ function FlowItemContainer(_a) {
|
|
|
61
62
|
if (observer) {
|
|
62
63
|
observer.disconnect();
|
|
63
64
|
}
|
|
64
|
-
node.attachMeasureElement(null);
|
|
65
65
|
};
|
|
66
66
|
}, [node]);
|
|
67
67
|
useLayoutEffect(() => {
|
|
68
|
-
node.
|
|
68
|
+
if (node.getState().layouted) {
|
|
69
|
+
node.pub(NodeEvents.Resize);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
node.measure().catch(() => { });
|
|
73
|
+
}
|
|
69
74
|
}, [node]);
|
|
70
75
|
return createElement(View, { style: itemStyle, key: node.id }, createElement(View, { id: node.id, ref: setInnerMeasureRef }, createElement(FlowItemContext.Provider, { value: { node } }, children)));
|
|
71
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-item.js","sources":["../../../src/components/water-flow/flow-item.ts"],"sourcesContent":["import { View } from '@tarojs/components'\nimport {\n type CSSProperties,\n type PropsWithChildren,\n createContext,\n createElement,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react'\n\nimport { Node, NodeEvents } from './node'\nimport { useMemoizedFn } from './use-memoized-fn'\nimport { useObservedAttr } from './use-observed-attr'\nimport { isWeb } from './utils'\n\nimport type { FlowItemContainerProps } from './interface'\n\nconst FlowItemContext = createContext<{ node: Node }>(Object.create(null))\nexport const useFlowItemPositioner = () => {\n const nodeModel = useContext(FlowItemContext).node\n const width$ = useObservedAttr(nodeModel, 'width')\n const height$ = useObservedAttr(nodeModel, 'height')\n const top$ = useObservedAttr(nodeModel, 'top')\n const scrollTop$ = useObservedAttr(nodeModel, 'scrollTop')\n\n return {\n resize: useMemoizedFn(() => {\n nodeModel.pub(NodeEvents.Resize)\n }),\n top: top$,\n scrollTop: scrollTop$,\n width: width$,\n height: height$,\n }\n}\n\nexport function FlowItemContainer({\n children,\n ...props\n}: PropsWithChildren<FlowItemContainerProps>) {\n const { node } = props\n const layouted$ = useObservedAttr(node, 'layouted')\n const top$ = useObservedAttr(node, 'top')\n const height$ = useObservedAttr(node, 'height')\n const refFlowItem = useRef<HTMLElement>()\n\n const itemStyle: CSSProperties = useMemo(() => {\n const baseStyle: CSSProperties = {\n width: '100%',\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translate3d(0px, ${top$}px, 0px)`,\n }\n if (!layouted$) {\n return {\n ...baseStyle,\n minHeight: node.section.defaultSize,\n }\n }\n return {\n ...baseStyle,\n height: height$,\n }\n }, [top$, layouted$, height$])\n\n const setInnerMeasureRef = useMemoizedFn((el: HTMLElement | null) => {\n const innerRef = refFlowItem as React.MutableRefObject<HTMLElement | undefined>\n innerRef.current = el ?? undefined\n node.attachMeasureElement(el)\n })\n\n useEffect(() => {\n let observer: ResizeObserver\n const el = refFlowItem.current\n if (isWeb() && typeof ResizeObserver !== 'undefined' && el) {\n observer = new ResizeObserver(() => {\n node.pub(NodeEvents.Resize)\n })\n observer.observe(el)\n }\n return () => {\n if (observer) {\n observer.disconnect()\n }\n
|
|
1
|
+
{"version":3,"file":"flow-item.js","sources":["../../../src/components/water-flow/flow-item.ts"],"sourcesContent":["import { View } from '@tarojs/components'\nimport {\n type CSSProperties,\n type PropsWithChildren,\n createContext,\n createElement,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react'\n\nimport { Node, NodeEvents } from './node'\nimport { useMemoizedFn } from './use-memoized-fn'\nimport { useObservedAttr } from './use-observed-attr'\nimport { isWeb } from './utils'\n\nimport type { FlowItemContainerProps } from './interface'\n\nconst FlowItemContext = createContext<{ node: Node }>(Object.create(null))\nexport const useFlowItemPositioner = () => {\n const nodeModel = useContext(FlowItemContext).node\n const width$ = useObservedAttr(nodeModel, 'width')\n const height$ = useObservedAttr(nodeModel, 'height')\n const top$ = useObservedAttr(nodeModel, 'top')\n const scrollTop$ = useObservedAttr(nodeModel, 'scrollTop')\n\n return {\n resize: useMemoizedFn(() => {\n nodeModel.pub(NodeEvents.Resize)\n }),\n top: top$,\n scrollTop: scrollTop$,\n width: width$,\n height: height$,\n }\n}\n\nexport function FlowItemContainer({\n children,\n ...props\n}: PropsWithChildren<FlowItemContainerProps>) {\n const { node } = props\n const layouted$ = useObservedAttr(node, 'layouted')\n const top$ = useObservedAttr(node, 'top')\n const height$ = useObservedAttr(node, 'height')\n const refFlowItem = useRef<HTMLElement>()\n\n const itemStyle: CSSProperties = useMemo(() => {\n const baseStyle: CSSProperties = {\n width: '100%',\n position: 'absolute',\n top: 0,\n left: 0,\n transform: `translate3d(0px, ${top$}px, 0px)`,\n }\n if (!layouted$) {\n return {\n ...baseStyle,\n minHeight: node.section.defaultSize,\n }\n }\n return {\n ...baseStyle,\n height: height$,\n }\n }, [top$, layouted$, height$])\n\n const setInnerMeasureRef = useMemoizedFn((el: HTMLElement | null) => {\n const innerRef = refFlowItem as React.MutableRefObject<HTMLElement | undefined>\n const previousEl = innerRef.current\n innerRef.current = el ?? undefined\n node.attachMeasureElement(el, previousEl)\n })\n\n useEffect(() => {\n let observer: ResizeObserver\n const el = refFlowItem.current\n if (isWeb() && typeof ResizeObserver !== 'undefined' && el) {\n observer = new ResizeObserver(() => {\n node.pub(NodeEvents.Resize)\n })\n observer.observe(el)\n }\n return () => {\n if (observer) {\n observer.disconnect()\n }\n }\n }, [node])\n\n useLayoutEffect(() => {\n if (node.getState().layouted) {\n node.pub(NodeEvents.Resize)\n } else {\n node.measure().catch(() => {})\n }\n }, [node])\n\n return createElement(\n View,\n { style: itemStyle, key: node.id },\n createElement(\n View,\n { id: node.id, ref: setInnerMeasureRef as any },\n createElement(FlowItemContext.Provider, { value: { node } }, children)\n )\n )\n}\n\nexport function FlowItem(props: PropsWithChildren) {\n return props.children\n}\n"],"names":[],"mappings":";;;;;;;;AAoBA,MAAM,eAAe,GAAG,aAAa,CAAiB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnE,MAAM,qBAAqB,GAAG,MAAK;IACxC,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,IAAI;IAClD,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC;IAClD,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC;IACpD,MAAM,IAAI,GAAG,eAAe,CAAC,SAAS,EAAE,K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EV,OAAO,aAAa,CAClB,IAAI,EACJ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,EAClC,aAAa,CACX,IAAI,EACJ,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,kBAAyB,EAAE,EAC/C,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC,CACvE,CACF;AACH;AAEM,SAAU,QAAQ,CAAC,KAAwB,EAAA;IAC/C,OAAO,KAAK,CAAC,QAAQ;AACvB;;;;"}
|
|
@@ -45,7 +45,7 @@ export declare class Node extends StatefulEventBus<NodeState> {
|
|
|
45
45
|
*/
|
|
46
46
|
col: number;
|
|
47
47
|
constructor(root: Root, section: Section, props: NodeProps);
|
|
48
|
-
attachMeasureElement(el: HTMLElement | null): void;
|
|
48
|
+
attachMeasureElement(el: HTMLElement | null, previousEl?: HTMLElement): void;
|
|
49
49
|
private setupSubscriptions;
|
|
50
50
|
/**
|
|
51
51
|
* 测量节点的尺寸信息
|
|
@@ -26,8 +26,9 @@ class Node extends StatefulEventBus {
|
|
|
26
26
|
Object.assign(this, { id: nodeId, childIndex, order, col });
|
|
27
27
|
this.setupSubscriptions();
|
|
28
28
|
}
|
|
29
|
-
attachMeasureElement(el) {
|
|
30
|
-
this._measureEl
|
|
29
|
+
attachMeasureElement(el, previousEl) {
|
|
30
|
+
if (el || this._measureEl === previousEl)
|
|
31
|
+
this._measureEl = el;
|
|
31
32
|
}
|
|
32
33
|
setupSubscriptions() {
|
|
33
34
|
this.sub('layouted', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":["../../../src/components/water-flow/node.ts"],"sourcesContent":["import { getRectSizeSync, weappScope } from '../../utils'\nimport { Root } from './root'\nimport { Section, SectionEvents } from './section'\nimport { StatefulEventBus } from './stateful-event-bus'\nimport { isWeapp, isWeb } from './utils'\n\ninterface NodeProps {\n /**\n * 原始索引,即一维数组中的索引\n */\n childIndex: number\n /**\n * 在列里的顺序\n */\n order: number\n /**\n * 位于哪一列\n */\n col: number\n height: number\n}\n\ntype NodeState = {\n top: number\n width: number\n height: number\n layouted: boolean\n scrollTop: number\n};\n\nexport const NodeEvents = {\n Resize: Symbol.for('resize'),\n}\n\nexport class Node extends StatefulEventBus<NodeState> {\n /** 小程序:测量用内层 View 的 DOM;H5:getBoundingClientRect 用 */\n private _measureEl: HTMLElement | null = null\n\n id: string\n /**\n * 原始索引,即一维数组中的索引\n */\n childIndex: number\n /**\n * 在列里的顺序\n */\n order: number\n /**\n * 位于哪一列\n */\n col: number\n constructor(public root: Root, public section: Section, props: NodeProps) {\n const { height, childIndex, order, col } = props\n super({\n top: 0,\n width: 0,\n height,\n scrollTop: 0,\n layouted: false,\n })\n const nodeId = `${root.id}-${section.id}-item-${childIndex}`\n Object.assign(this, { id: nodeId, childIndex, order, col })\n this.setupSubscriptions()\n }\n\n attachMeasureElement (el: HTMLElement | null) {\n this._measureEl = el\n }\n\n private setupSubscriptions() {\n this.sub('layouted', () => {\n /**\n * 如果当前分组所有的节点都完成布局计算,那么向分组推送 `AllNodesLayouted` 事件,section会在这个时机做一些计算\n */\n if (\n [...this.section.nodes.values()].every(\n (node) => node.getState().layouted\n )\n ) {\n this.section.notify(SectionEvents.AllNodesLayouted)\n }\n })\n\n /**\n * 如果节点的尺寸发生了变化(这通常出现在节点内容包含网络数据的情况下,比如图片,这时要求用户调用 useFlowItemPositioner 返回的 resize 方法通知数据模型去重新计算布局)\n *\n * - 更新当前节点所在列之后的所有节点的位置信息\n *\n * - 通知 section 更新布局\n */\n this.sub(NodeEvents.Resize, async () => {\n const { width, height } = this.getState()\n const newSize = await this.measure()\n if (newSize.height === height && newSize.width === width) {\n return\n }\n this.updateBehindNodesPosition()\n this.section.pub(SectionEvents.Resize, {\n node: this,\n newSize,\n originalSize: { width, height },\n })\n })\n }\n\n /**\n * 测量节点的尺寸信息\n */\n public async measure() {\n let width: number | undefined\n let height: number | undefined\n if (isWeb() && this._measureEl) {\n const r = this._measureEl.getBoundingClientRect()\n width = r.width\n height = r.height\n } else if (isWeapp && this._measureEl) {\n const scope = weappScope({ current: this._measureEl as any })\n const res = await getRectSizeSync(`#${this.id}`, 100, 3, scope)\n width = res.width\n height = res.height\n } else {\n const res = await getRectSizeSync(`#${this.id}`, 100, 3)\n width = res.width\n height = res.height\n }\n if (\n typeof width !== 'number' ||\n typeof height !== 'number' ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n width <= 0 ||\n height <= 0\n ) {\n const s = this.getState()\n return { width: s.width, height: s.height }\n }\n this.setStateBatch({\n width,\n height,\n layouted: true,\n })\n return { width, height }\n }\n\n /**\n * 更新节点所在列后面的节点的位置\n */\n updateBehindNodesPosition() {\n const currentColumn = this.section.columnMap[this.col]\n let start = this.order + 1\n\n if (start > currentColumn.length - 1) {\n return\n }\n for (; start < currentColumn.length; start++) {\n const node = currentColumn[start]\n const previousNode = currentColumn[start - 1]\n const {\n top: previousNodeTop,\n height: previousNodeHeight,\n scrollTop: previousNodeScrollTop,\n } = previousNode.getState()\n const rowGap = this.section.rowGap\n node.setStateBatch({\n top: previousNodeTop + previousNodeHeight + rowGap,\n scrollTop: previousNodeScrollTop + previousNodeHeight + rowGap,\n })\n }\n }\n\n /**\n * 节点是否可见\n */\n get isInRange() {\n const { scrollBoundaryStart, scrollBoundaryEnd } = this.root\n const { height: nodeHeight, scrollTop: nodeScrollTop } = this.getState()\n return (\n nodeScrollTop < scrollBoundaryEnd &&\n nodeScrollTop + nodeHeight > scrollBoundaryStart\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;AA8Ba,MAAA,UAAU,GAAG;AACxB,IAAA,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;;AAGxB,MAAO,IAAK,SAAQ,gBAA2B,CAAA;AAiBnD,IAAA,WAAA,CAAmB,IAAU,EAAS,OAAgB,EAAE,KAAgB,EAAA;QACtE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK;AAChD,QAAA,KAAK,CAAC;AACJ,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,KAAK,EAAE,CAAC;YACR,MAAM;AACN,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,QAAQ,EAAE,KAAK;AAChB,SAAA,CAAC;QARe,IAAI,CAAA,IAAA,GAAJ,IAAI;QAAe,IAAO,CAAA,OAAA,GAAP,OAAO;;QAfrC,IAAU,CAAA,UAAA,GAAuB,IAAI;AAwB3C,QAAA,MAAM,MAAM,GAAG,CAAG,EAAA,IAAI,CAAC,EAAE,CAAI,CAAA,EAAA,OAAO,CAAC,EAAE,CAAS,MAAA,EAAA,UAAU,EAAE;AAC5D,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QAC3D,IAAI,CAAC,kBAAkB,EAAE;;
|
|
1
|
+
{"version":3,"file":"node.js","sources":["../../../src/components/water-flow/node.ts"],"sourcesContent":["import { getRectSizeSync, weappScope } from '../../utils'\nimport { Root } from './root'\nimport { Section, SectionEvents } from './section'\nimport { StatefulEventBus } from './stateful-event-bus'\nimport { isWeapp, isWeb } from './utils'\n\ninterface NodeProps {\n /**\n * 原始索引,即一维数组中的索引\n */\n childIndex: number\n /**\n * 在列里的顺序\n */\n order: number\n /**\n * 位于哪一列\n */\n col: number\n height: number\n}\n\ntype NodeState = {\n top: number\n width: number\n height: number\n layouted: boolean\n scrollTop: number\n};\n\nexport const NodeEvents = {\n Resize: Symbol.for('resize'),\n}\n\nexport class Node extends StatefulEventBus<NodeState> {\n /** 小程序:测量用内层 View 的 DOM;H5:getBoundingClientRect 用 */\n private _measureEl: HTMLElement | null = null\n\n id: string\n /**\n * 原始索引,即一维数组中的索引\n */\n childIndex: number\n /**\n * 在列里的顺序\n */\n order: number\n /**\n * 位于哪一列\n */\n col: number\n constructor(public root: Root, public section: Section, props: NodeProps) {\n const { height, childIndex, order, col } = props\n super({\n top: 0,\n width: 0,\n height,\n scrollTop: 0,\n layouted: false,\n })\n const nodeId = `${root.id}-${section.id}-item-${childIndex}`\n Object.assign(this, { id: nodeId, childIndex, order, col })\n this.setupSubscriptions()\n }\n\n attachMeasureElement (el: HTMLElement | null, previousEl?: HTMLElement) {\n if (el || this._measureEl === previousEl) this._measureEl = el\n }\n\n private setupSubscriptions() {\n this.sub('layouted', () => {\n /**\n * 如果当前分组所有的节点都完成布局计算,那么向分组推送 `AllNodesLayouted` 事件,section会在这个时机做一些计算\n */\n if (\n [...this.section.nodes.values()].every(\n (node) => node.getState().layouted\n )\n ) {\n this.section.notify(SectionEvents.AllNodesLayouted)\n }\n })\n\n /**\n * 如果节点的尺寸发生了变化(这通常出现在节点内容包含网络数据的情况下,比如图片,这时要求用户调用 useFlowItemPositioner 返回的 resize 方法通知数据模型去重新计算布局)\n *\n * - 更新当前节点所在列之后的所有节点的位置信息\n *\n * - 通知 section 更新布局\n */\n this.sub(NodeEvents.Resize, async () => {\n const { width, height } = this.getState()\n const newSize = await this.measure()\n if (newSize.height === height && newSize.width === width) {\n return\n }\n this.updateBehindNodesPosition()\n this.section.pub(SectionEvents.Resize, {\n node: this,\n newSize,\n originalSize: { width, height },\n })\n })\n }\n\n /**\n * 测量节点的尺寸信息\n */\n public async measure() {\n let width: number | undefined\n let height: number | undefined\n if (isWeb() && this._measureEl) {\n const r = this._measureEl.getBoundingClientRect()\n width = r.width\n height = r.height\n } else if (isWeapp && this._measureEl) {\n const scope = weappScope({ current: this._measureEl as any })\n const res = await getRectSizeSync(`#${this.id}`, 100, 3, scope)\n width = res.width\n height = res.height\n } else {\n const res = await getRectSizeSync(`#${this.id}`, 100, 3)\n width = res.width\n height = res.height\n }\n if (\n typeof width !== 'number' ||\n typeof height !== 'number' ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n width <= 0 ||\n height <= 0\n ) {\n const s = this.getState()\n return { width: s.width, height: s.height }\n }\n this.setStateBatch({\n width,\n height,\n layouted: true,\n })\n return { width, height }\n }\n\n /**\n * 更新节点所在列后面的节点的位置\n */\n updateBehindNodesPosition() {\n const currentColumn = this.section.columnMap[this.col]\n let start = this.order + 1\n\n if (start > currentColumn.length - 1) {\n return\n }\n for (; start < currentColumn.length; start++) {\n const node = currentColumn[start]\n const previousNode = currentColumn[start - 1]\n const {\n top: previousNodeTop,\n height: previousNodeHeight,\n scrollTop: previousNodeScrollTop,\n } = previousNode.getState()\n const rowGap = this.section.rowGap\n node.setStateBatch({\n top: previousNodeTop + previousNodeHeight + rowGap,\n scrollTop: previousNodeScrollTop + previousNodeHeight + rowGap,\n })\n }\n }\n\n /**\n * 节点是否可见\n */\n get isInRange() {\n const { scrollBoundaryStart, scrollBoundaryEnd } = this.root\n const { height: nodeHeight, scrollTop: nodeScrollTop } = this.getState()\n return (\n nodeScrollTop < scrollBoundaryEnd &&\n nodeScrollTop + nodeHeight > scrollBoundaryStart\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;AA8Ba,MAAA,UAAU,GAAG;AACxB,IAAA,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;;AAGxB,MAAO,IAAK,SAAQ,gBAA2B,CAAA;AAiBnD,IAAA,WAAA,CAAmB,IAAU,EAAS,OAAgB,EAAE,KAAgB,EAAA;QACtE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK;AAChD,QAAA,KAAK,CAAC;AACJ,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,KAAK,EAAE,CAAC;YACR,MAAM;AACN,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,QAAQ,EAAE,KAAK;AAChB,SAAA,CAAC;QARe,IAAI,CAAA,IAAA,GAAJ,IAAI;QAAe,IAAO,CAAA,OAAA,GAAP,OAAO;;QA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,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;QACxE,QACE,aAAa,GAAG,iBAAiB;AACjC,YAAA,aAAa,GAAG,UAAU,GAAG,mBAAmB;;AAGrD;;;;"}
|
|
@@ -23,6 +23,10 @@ getSysInfo();
|
|
|
23
23
|
function pickControlledScrollOffset(value) {
|
|
24
24
|
return typeof value === 'number' && !Number.isNaN(value) ? value : undefined;
|
|
25
25
|
}
|
|
26
|
+
function normalizeColumn(column) {
|
|
27
|
+
const value = Number(column !== null && column !== void 0 ? column : 1);
|
|
28
|
+
return Number.isFinite(value) ? Math.max(1, Math.floor(value)) : 1;
|
|
29
|
+
}
|
|
26
30
|
const InnerWaterFlow = (_a, ref) => {
|
|
27
31
|
var _b, _c, _d, _e;
|
|
28
32
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
@@ -146,11 +150,11 @@ const InnerWaterFlow = (_a, ref) => {
|
|
|
146
150
|
});
|
|
147
151
|
const controlledScrollTop = pickControlledScrollOffset(scrollTop);
|
|
148
152
|
const controlledScrollLeft = pickControlledScrollOffset(scrollLeft);
|
|
153
|
+
const warnedShrinks = useRef(null);
|
|
149
154
|
const sections = useMemo(() => {
|
|
150
155
|
var _a;
|
|
151
156
|
const [start, end] = renderRange$;
|
|
152
157
|
return (_a = Children.map(children, (child, order) => {
|
|
153
|
-
var _a;
|
|
154
158
|
if (Object.is(child, null)) {
|
|
155
159
|
return null;
|
|
156
160
|
}
|
|
@@ -171,10 +175,10 @@ const InnerWaterFlow = (_a, ref) => {
|
|
|
171
175
|
order,
|
|
172
176
|
col: autoColumn
|
|
173
177
|
? getFeedColumn(Taro.getSystemInfoSync().windowWidth)
|
|
174
|
-
: (
|
|
178
|
+
: normalizeColumn(sectionProps.column),
|
|
175
179
|
rowGap: sectionProps.rowGap || 0,
|
|
176
180
|
columnGap: sectionProps.columnGap || 0,
|
|
177
|
-
count:
|
|
181
|
+
count: childCount,
|
|
178
182
|
});
|
|
179
183
|
}
|
|
180
184
|
// 同步只读控制字段(纯赋值,不触发 pub);autoColumn 下列数由 useResize/reflow 驱动
|
|
@@ -185,26 +189,44 @@ const InnerWaterFlow = (_a, ref) => {
|
|
|
185
189
|
}, [renderRange$[0], renderRange$[1], children, root, props.id]);
|
|
186
190
|
/** autoColumn:监听窗口变化,组件内部算列数并原地 reflow,不依赖业务改 props */
|
|
187
191
|
useResize(useMemoizedFn((res) => {
|
|
188
|
-
var _a, _b, _c;
|
|
189
|
-
const width =
|
|
192
|
+
var _a, _b, _c, _d;
|
|
193
|
+
const width = isH5
|
|
194
|
+
? Taro.getSystemInfoSync().windowWidth
|
|
195
|
+
: ((_b = (_a = res === null || res === void 0 ? void 0 : res.size) === null || _a === void 0 ? void 0 : _a.windowWidth) !== null && _b !== void 0 ? _b : Taro.getSystemInfoSync().windowWidth);
|
|
190
196
|
const nextCol = getFeedColumn(width);
|
|
191
197
|
let changed = false;
|
|
192
198
|
for (const section of root.sectionMap.values()) {
|
|
193
199
|
if (section.autoColumn && section.col !== nextCol) {
|
|
194
200
|
section.reflow(nextCol);
|
|
195
201
|
changed = true;
|
|
202
|
+
if (isH5)
|
|
203
|
+
(_c = section.onColumnChange) === null || _c === void 0 ? void 0 : _c.call(section, nextCol);
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
206
|
if (changed) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
207
|
+
if (isH5) {
|
|
208
|
+
root.updateScrollHeight(true);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
root.setStateIn('renderRange', root.getSectionRenderRange());
|
|
212
|
+
for (const section of root.sectionMap.values()) {
|
|
213
|
+
if (section.autoColumn)
|
|
214
|
+
(_d = section.onColumnChange) === null || _d === void 0 ? void 0 : _d.call(section, nextCol);
|
|
215
|
+
}
|
|
203
216
|
}
|
|
204
217
|
}
|
|
205
218
|
}));
|
|
206
219
|
/** 配对 pushNodesStructuralOnly:在 layout 阶段完成 Section 状态,避免 useMemo 内 setState 告警 */
|
|
207
220
|
useLayoutEffect(() => {
|
|
221
|
+
let changed = false;
|
|
222
|
+
let autoColumnCount;
|
|
223
|
+
const getAutoColumnCount = () => {
|
|
224
|
+
autoColumnCount !== null && autoColumnCount !== void 0 ? autoColumnCount : (autoColumnCount = getFeedColumn(Taro.getSystemInfoSync().windowWidth));
|
|
225
|
+
return autoColumnCount;
|
|
226
|
+
};
|
|
227
|
+
if (warnedShrinks.current === null)
|
|
228
|
+
warnedShrinks.current = new Map();
|
|
229
|
+
const warnedCounts = warnedShrinks.current;
|
|
208
230
|
Children.forEach(children, (child, order) => {
|
|
209
231
|
var _a;
|
|
210
232
|
if (Object.is(child, null)) {
|
|
@@ -212,8 +234,32 @@ const InnerWaterFlow = (_a, ref) => {
|
|
|
212
234
|
}
|
|
213
235
|
const sectionProps = child.props;
|
|
214
236
|
const sectionId = sectionProps.id || `section-${order}`;
|
|
215
|
-
|
|
237
|
+
const section = root.findSection(sectionId);
|
|
238
|
+
if (!section)
|
|
239
|
+
return;
|
|
240
|
+
section.finalizePushNodesStateIfNeeded();
|
|
241
|
+
const childCount = Children.count(sectionProps.children);
|
|
242
|
+
if (childCount >= section.count) {
|
|
243
|
+
warnedCounts.delete(sectionId);
|
|
244
|
+
}
|
|
245
|
+
else if (process.env.NODE_ENV !== 'production' && warnedCounts.get(sectionId) !== childCount) {
|
|
246
|
+
warnedCounts.set(sectionId, childCount);
|
|
247
|
+
console.warn(`[WaterFlow] FlowSection ${sectionId} 已注册 ${section.count} 个节点,当前收到 ${childCount} 个子项;减少数据后请重建 WaterFlow。`);
|
|
248
|
+
}
|
|
249
|
+
if (!isH5)
|
|
250
|
+
return;
|
|
251
|
+
const nextCol = section.autoColumn
|
|
252
|
+
? getAutoColumnCount()
|
|
253
|
+
: normalizeColumn(sectionProps.column);
|
|
254
|
+
if (section.col === nextCol)
|
|
255
|
+
return;
|
|
256
|
+
section.reflow(nextCol);
|
|
257
|
+
changed = true;
|
|
258
|
+
if (section.autoColumn)
|
|
259
|
+
(_a = section.onColumnChange) === null || _a === void 0 ? void 0 : _a.call(section, nextCol);
|
|
216
260
|
});
|
|
261
|
+
if (changed)
|
|
262
|
+
root.updateScrollHeight(true);
|
|
217
263
|
}, [children, root]);
|
|
218
264
|
const scrollTo = useMemoizedFn((scrollOffset = 0) => {
|
|
219
265
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"water-flow.js","sources":["../../../src/components/water-flow/water-flow.ts"],"sourcesContent":["import { BaseEventOrig, ScrollView, ScrollViewProps, View } from '@tarojs/components'\nimport Taro, { nextTick, useResize } from '@tarojs/taro'\nimport {\n Children,\n cloneElement,\n createElement,\n forwardRef,\n PropsWithChildren,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react'\n\nimport { debounce, getScrollViewContextNode, weappScope } from '../../utils'\nimport {\n type ScrollElementContextValueShape,\n ScrollElementContextOrFallback,\n} from '../../utils/scrollElementContext'\nimport { useMeasureStartOffset } from '../list/hooks/useMeasureStartOffset'\nimport { useMeasureStartOffsetWeapp } from '../list/hooks/useMeasureStartOffsetWeapp'\nimport { useScrollParentAutoFind } from '../list/hooks/useScrollParentAutoFind'\nimport { getFeedColumn } from './feed-column'\nimport { _FlowSectionProps } from './flow-section'\nimport { Root, RootEvents } from './root'\nimport { Section } from './section'\nimport { useMemoizedFn } from './use-memoized-fn'\nimport { useObservedAttr } from './use-observed-attr'\nimport { getSysInfo, isH5, isWeapp } from './utils'\nimport { createWaterFlowNodeCacheControl } from './water-flow-node-cache'\n\nimport type { ScrollDirection, WaterFlowProps } from './interface'\n\ngetSysInfo()\n\n/** 仅有效数字才作为 ScrollView 受控滚动偏移,避免 undefined/null 在 H5 经 Number(null)→0 归顶 */\nfunction pickControlledScrollOffset (value: unknown): number | undefined {\n return typeof value === 'number' && !Number.isNaN(value) ? value : undefined\n}\n\nconst InnerWaterFlow = (\n { children, ...props }: PropsWithChildren<WaterFlowProps>,\n ref: React.ForwardedRef<HTMLElement>\n) => {\n const {\n id,\n style = {},\n className,\n cacheCount = 1,\n onScrollToUpper,\n onScrollToLower,\n upperThresholdCount,\n lowerThresholdCount,\n scrollIntoView,\n nestedScroll,\n scrollElement,\n startOffset,\n containerHeight,\n onScrollHeightChange,\n onScrollIntoViewComplete,\n onScroll: onScrollProp,\n scrollTop,\n scrollLeft,\n ...rest\n } = props\n const flowType = nestedScroll === true ? 'nested' : 'default'\n // 从 ScrollElementContext 获取 scrollRef(List/ScrollView 内嵌时提供);无 Context 时兜底为 fallback\n const scrollElementCtx = useContext(ScrollElementContextOrFallback) as ScrollElementContextValueShape | null\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n const scrollViewShellRef = useRef<HTMLElement | null>(null)\n const setContainerRef = useCallback(\n (el: HTMLElement | null) => {\n (contentWrapperRef as React.MutableRefObject<HTMLElement | null>).current = el\n if (typeof ref === 'function') ref(el)\n else if (ref) (ref as React.MutableRefObject<HTMLElement | null>).current = el\n },\n [ref]\n )\n const defaultId = useId().replace(/:/g, '')\n /** 仅在原有 id 后追加同一实例内共享的随机数尾缀,不替换原 id 串 */\n const instanceIdSuffixRef = useRef<string | null>(null)\n if (instanceIdSuffixRef.current === null) {\n instanceIdSuffixRef.current = String(Math.floor(Math.random() * 1e9))\n }\n const instanceSuffix = instanceIdSuffixRef.current\n const contentId = useMemo(\n () => `${id ?? defaultId}_${instanceSuffix}`,\n [id, defaultId, instanceSuffix]\n )\n const needAutoFind =\n flowType === 'nested' &&\n !scrollElement &&\n !scrollElementCtx?.scrollRef &&\n (isH5 || isWeapp)\n const { scrollParentRef: autoFoundRef, status: autoFindStatus } = useScrollParentAutoFind(\n contentWrapperRef,\n {\n enabled: !!needAutoFind,\n isHorizontal: false,\n contentId: isWeapp ? contentId : undefined,\n excludeScrollElement: scrollViewShellRef\n }\n )\n const effectiveScrollElement =\n scrollElement ??\n scrollElementCtx?.scrollRef ??\n (needAutoFind && autoFindStatus === 'found' ? autoFoundRef : null)\n const ctxStart = scrollElementCtx?.startOffset\n const hasExplicitStartOffset = ctxStart != null && ctxStart > 0\n const needMeasureStartOffset =\n flowType === 'nested' &&\n effectiveScrollElement &&\n isH5 &&\n startOffset == null &&\n !hasExplicitStartOffset\n const needMeasureStartOffsetWeapp =\n flowType === 'nested' &&\n effectiveScrollElement &&\n isWeapp &&\n startOffset == null &&\n !hasExplicitStartOffset\n const measuredStartOffset = useMeasureStartOffset(\n effectiveScrollElement ?? { current: null },\n contentWrapperRef,\n { enabled: !!needMeasureStartOffset, isHorizontal: false }\n )\n const effectiveStartOffsetRef = useRef(0)\n const measuredStartOffsetWeapp = useMeasureStartOffsetWeapp(\n effectiveScrollElement ?? { current: null },\n contentId,\n { enabled: !!needMeasureStartOffsetWeapp, isHorizontal: false, startOffsetRef: effectiveStartOffsetRef }\n )\n const effectiveStartOffset =\n startOffset ??\n (ctxStart != null && ctxStart > 0 ? ctxStart : null) ??\n measuredStartOffset ??\n measuredStartOffsetWeapp ??\n 0\n\n const effectiveContainerHeight = containerHeight ?? scrollElementCtx?.containerHeight\n\n const startOffsetRef = useRef(effectiveStartOffset)\n const containerHeightRef = useRef(effectiveContainerHeight)\n const lastReportedHeightRef = useRef<number>(0)\n startOffsetRef.current = effectiveStartOffset\n if (!needMeasureStartOffsetWeapp) {\n effectiveStartOffsetRef.current = effectiveStartOffset\n }\n containerHeightRef.current = effectiveContainerHeight\n\n const useScrollElementMode =\n flowType === 'nested' && !!(effectiveScrollElement && (isH5 || isWeapp))\n const renderView =\n useScrollElementMode || (!!needAutoFind && autoFindStatus === 'pending')\n if (flowType === 'nested' && !effectiveScrollElement && (isH5 || isWeapp) && autoFindStatus === 'not-found') {\n // eslint-disable-next-line no-console\n console.warn('[WaterFlow] nestedScroll 模式但无 scrollElement(props/Context/自动查找),回退为 default,将渲染自有 ScrollView')\n }\n /**\n * 初始化数据模型\n */\n const root = useMemo(() => {\n return new Root({\n id: contentId,\n cacheCount,\n upperThresholdCount,\n lowerThresholdCount,\n skipContainerMeasure: useScrollElementMode || (!!needAutoFind && autoFindStatus === 'pending'),\n })\n }, [contentId, upperThresholdCount, lowerThresholdCount, useScrollElementMode, needAutoFind, autoFindStatus])\n\n /** props 动态修改 cacheCount 时同步到 Root,避免重建 Root;并收敛快滑单边放大到新的基线 */\n useLayoutEffect(() => {\n root.cacheCount = cacheCount\n root.setNodeCacheRange(cacheCount, cacheCount)\n }, [root, cacheCount])\n const isScrolling$ = useObservedAttr(root, 'isScrolling')\n const scrollHeight$ = useObservedAttr(root, 'scrollHeight')\n const renderRange$ = useObservedAttr(root, 'renderRange')\n const refEventOrig = useRef<BaseEventOrig>()\n const nodeCacheCtlRef = useRef<ReturnType<typeof createWaterFlowNodeCacheControl> | null>(null)\n\n useLayoutEffect(() => {\n if (root.skipContainerMeasure) return\n const shell = renderView ? contentWrapperRef.current : scrollViewShellRef.current\n root.measureContainerSize(shell as HTMLElement | null).catch(() => {})\n }, [root, renderView, needAutoFind, autoFindStatus])\n\n useEffect(() => {\n const ctl = createWaterFlowNodeCacheControl(root, () => root.cacheCount)\n nodeCacheCtlRef.current = ctl\n return () => {\n ctl.dispose()\n nodeCacheCtlRef.current = null\n }\n }, [root])\n\n /**\n * 滚动事件\n */\n const handleScroll = useMemoizedFn((ev: BaseEventOrig<ScrollViewProps.onScrollDetail>) => {\n refEventOrig.current = ev\n const { scrollTop: detailScrollTop } = ev.detail\n nodeCacheCtlRef.current?.onScrollSample(detailScrollTop)\n const scrollDirection: ScrollDirection = root.getState().scrollOffset < detailScrollTop ? 'forward' : 'backward'\n root.setStateBatch({\n scrollDirection: scrollDirection,\n scrollOffset: detailScrollTop,\n isScrolling: true,\n })\n })\n\n const onScrollMerged = useMemoizedFn((ev: BaseEventOrig<ScrollViewProps.onScrollDetail>) => {\n handleScroll(ev)\n onScrollProp?.(ev)\n })\n\n const controlledScrollTop = pickControlledScrollOffset(scrollTop)\n const controlledScrollLeft = pickControlledScrollOffset(scrollLeft)\n\n const sections = useMemo(() => {\n const [start, end] = renderRange$\n return Children.map(children, (child: ReactElement<PropsWithChildren<_FlowSectionProps>>, order) => {\n if (Object.is(child, null)) {\n return null\n }\n const sectionProps = child.props\n const sectionId = sectionProps.id || `section-${order}`\n const childCount = Children.count(sectionProps.children)\n const autoColumn = !!sectionProps.autoColumn\n let section = root.findSection(sectionId)\n if (section) {\n const originalCount = section.count\n if (childCount > originalCount) {\n section.pushNodesStructuralOnly(childCount - originalCount)\n }\n } else {\n section = new Section(root, {\n id: sectionId,\n order,\n col: autoColumn\n ? getFeedColumn(Taro.getSystemInfoSync().windowWidth)\n : (sectionProps.column ?? 1),\n rowGap: sectionProps.rowGap || 0,\n columnGap: sectionProps.columnGap || 0,\n count: Children.count(sectionProps.children),\n })\n }\n // 同步只读控制字段(纯赋值,不触发 pub);autoColumn 下列数由 useResize/reflow 驱动\n section.autoColumn = autoColumn\n section.onColumnChange = sectionProps.onColumnChange\n\n return cloneElement(child, { section, key: `${props.id}-${order}` })\n })?.slice(start, end + 1)\n }, [renderRange$[0], renderRange$[1], children, root, props.id])\n\n /** autoColumn:监听窗口变化,组件内部算列数并原地 reflow,不依赖业务改 props */\n useResize(useMemoizedFn((res: Taro.PageResizeObject) => {\n const width = res?.size?.windowWidth ?? Taro.getSystemInfoSync().windowWidth\n const nextCol = getFeedColumn(width)\n let changed = false\n for (const section of root.sectionMap.values()) {\n if (section.autoColumn && section.col !== nextCol) {\n section.reflow(nextCol)\n changed = true\n }\n }\n if (changed) {\n root.setStateIn('renderRange', root.getSectionRenderRange())\n for (const section of root.sectionMap.values()) {\n if (section.autoColumn) section.onColumnChange?.(nextCol)\n }\n }\n }))\n\n /** 配对 pushNodesStructuralOnly:在 layout 阶段完成 Section 状态,避免 useMemo 内 setState 告警 */\n useLayoutEffect(() => {\n Children.forEach(children, (child: ReactElement<PropsWithChildren<_FlowSectionProps>>, order) => {\n if (Object.is(child, null)) {\n return\n }\n const sectionProps = child.props\n const sectionId = sectionProps.id || `section-${order}`\n root.findSection(sectionId)?.finalizePushNodesStateIfNeeded()\n })\n }, [children, root])\n\n const scrollTo = useMemoizedFn((scrollOffset = 0) => {\n scrollOffset = Math.max(0, scrollOffset)\n if (root.getState().scrollOffset === scrollOffset) return\n if (useScrollElementMode && effectiveScrollElement?.current) {\n const el = effectiveScrollElement.current as any\n const startOff = isWeapp ? effectiveStartOffsetRef.current : (startOffsetRef.current ?? 0)\n const scrollTarget = scrollOffset + startOff\n if (isH5) {\n el.scrollTo({ top: scrollTarget })\n } else if (isWeapp) {\n const scrollViewId = el.id || `_wf_${contentId}`\n if (!el.id) el.id = scrollViewId\n getScrollViewContextNode(`#${scrollViewId}`).then((node: any) => {\n node?.scrollTo?.({ top: scrollTarget, animated: true, duration: 300 })\n })\n }\n root.setStateBatch({ scrollOffset, isScrolling: true })\n return\n }\n getScrollViewContextNode(`#${root.id}`).then((node: any) => {\n node.scrollTo({\n animated: true,\n duration: 300,\n top: scrollOffset,\n })\n })\n })\n\n const resetScrolling = useMemoizedFn(() => {\n root.setStateIn('isScrolling', false)\n })\n\n const debouncedResetScrolling = debounce(resetScrolling)\n\n useEffect(() => {\n debouncedResetScrolling()\n }, [isScrolling$])\n\n /**\n * 处理滚动阈值\n * root 需入参:autoFind 从 pending→found 时 root 会重建,必须对新 root 重新订阅\n */\n useEffect(() => {\n const disposers = [\n root.sub(\n RootEvents.ReachUpperThreshold,\n debounce(() => {\n onScrollToUpper?.(refEventOrig.current!)\n })\n ),\n root.sub(\n RootEvents.ReachLowerThreshold,\n debounce(() => {\n onScrollToLower?.(refEventOrig.current!)\n })\n ),\n ]\n return () => {\n disposers.forEach((disposer) => {\n disposer()\n })\n }\n }, [root, onScrollToUpper, onScrollToLower])\n\n /**\n * 处理 scrollIntoView\n * 竞态:快速切换目标时,取消前一次滚动,避免后发先至\n */\n useEffect(() => {\n let cancelled = false\n handleScrollIntoView()\n async function handleScrollIntoView() {\n if (!scrollIntoView) return\n const targetNode = root.findNode(scrollIntoView)\n if (!targetNode) {\n nextTick(() => { if (!cancelled) onScrollIntoViewComplete?.() })\n return\n }\n const targetSection = targetNode.section\n const doScroll = () => {\n if (cancelled) return\n scrollTo(targetNode.getState().scrollTop)\n if (cancelled) return\n nextTick(() => { if (!cancelled) onScrollIntoViewComplete?.() })\n }\n if (!targetSection.getState().layouted) {\n const order = targetSection.order\n root.setStateIn('renderRange', [\n Math.min(renderRange$[0], order),\n Math.max(renderRange$[1], order),\n ])\n nextTick(async () => {\n await targetNode.section.layoutedSignal.promise\n if (cancelled) return\n doScroll()\n })\n return\n }\n await targetSection.layoutedSignal.promise\n if (cancelled) return\n doScroll()\n }\n return () => { cancelled = true }\n }, [scrollIntoView, renderRange$[0], renderRange$[1], onScrollIntoViewComplete])\n\n // scrollElement 模式下监听外部滚动,更新 root.scrollOffset;effectiveStartOffset 变化时重新同步;内嵌时 scrollRef 可能尚未就绪,需重试\n useEffect(() => {\n if (!useScrollElementMode || !effectiveScrollElement) return\n\n let cancelled = false\n let teardown: (() => void) | null = null\n const maxRetries = 20\n\n const tryAttach = (retryCount = 0) => {\n if (cancelled) return\n const target = effectiveScrollElement.current as any\n if (!target) {\n if (retryCount < maxRetries) {\n setTimeout(() => tryAttach(retryCount + 1), 50)\n }\n return\n }\n\n const getStartOffset = () => (isWeapp ? effectiveStartOffsetRef.current : (startOffsetRef.current ?? 0))\n\n const handler = (e?: any) => {\n const scrollTop = isWeapp\n ? (e?.target?.scrollTop ?? e?.mpEvent?.detail?.scrollTop ?? 0)\n : target.scrollTop\n const offset = scrollTop - getStartOffset()\n const effectiveOffset = Math.max(0, offset)\n const prevOffset = root.getState().scrollOffset\n const scrollDirection: ScrollDirection = prevOffset < effectiveOffset ? 'forward' : 'backward'\n\n nodeCacheCtlRef.current?.onScrollSample(effectiveOffset)\n root.setStateBatch({\n scrollDirection,\n scrollOffset: effectiveOffset,\n isScrolling: true,\n })\n }\n\n if (isWeapp) {\n if (!target.id) target.id = `_wf_${contentId}`\n const scrollViewId = target.id\n const scope = weappScope({ current: target })\n const query = scope != null\n ? Taro.createSelectorQuery().in(scope as any)\n : Taro.createSelectorQuery()\n query.select(`#${scrollViewId}`).scrollOffset().exec((res) => {\n if (cancelled) return\n const info = res?.[0]\n if (info) {\n const scrollTopVal = info.scrollTop ?? 0\n const initialOffset = Math.max(0, scrollTopVal - getStartOffset())\n root.setStateBatch({ scrollOffset: initialOffset, isScrolling: true })\n }\n })\n } else {\n const initialOffset = Math.max(0, target.scrollTop - getStartOffset())\n root.setStateBatch({ scrollOffset: initialOffset, isScrolling: true })\n }\n\n target.addEventListener('scroll', handler, isWeapp ? undefined : { passive: true })\n teardown = () => target.removeEventListener('scroll', handler)\n }\n\n tryAttach()\n return () => {\n cancelled = true\n teardown?.()\n }\n }, [useScrollElementMode, effectiveScrollElement, root, effectiveStartOffset, contentId])\n\n // scrollHeight 变化时回调(props 优先,其次从 Context),便于 List 动高联动;防抖 150ms 上报\n const reportHeight = onScrollHeightChange ?? scrollElementCtx?.reportNestedHeightChange\n useEffect(() => {\n if (!reportHeight || scrollHeight$ <= 0) return\n const timer = setTimeout(() => {\n if (Math.abs(lastReportedHeightRef.current - scrollHeight$) < 1) return\n lastReportedHeightRef.current = scrollHeight$\n reportHeight(scrollHeight$)\n }, 150)\n return () => clearTimeout(timer)\n }, [scrollHeight$, reportHeight])\n\n // scrollElement 模式下监听容器尺寸:H5 用 ResizeObserver,小程序用 createSelectorQuery 轮询\n useEffect(() => {\n if (!useScrollElementMode || !effectiveScrollElement) return\n const el = effectiveScrollElement.current as any\n if (!el) return\n\n if (isWeapp) {\n if (!el.id) el.id = `_wf_${contentId}`\n const scrollViewId = el.id\n const measure = () => {\n const scope = weappScope({ current: el })\n const query = scope != null\n ? Taro.createSelectorQuery().in(scope as any)\n : Taro.createSelectorQuery()\n query.select(`#${scrollViewId}`).boundingClientRect().exec((res) => {\n const rect = res?.[0]\n if (rect && rect.height > 0 && rect.width > 0) {\n const height = containerHeightRef.current ?? rect.height\n root.setStateIn('containerSize', { width: rect.width, height })\n }\n })\n }\n measure()\n const interval = setInterval(measure, 150)\n return () => clearInterval(interval)\n }\n\n if (typeof ResizeObserver === 'undefined') return\n const update = () => {\n const height = containerHeightRef.current ?? el.clientHeight\n const width = el.clientWidth\n if (height > 0 && width > 0) {\n root.setStateIn('containerSize', { width, height })\n }\n }\n update()\n const ro = new ResizeObserver(update)\n ro.observe(el)\n return () => ro.disconnect()\n }, [useScrollElementMode, effectiveScrollElement, root, effectiveContainerHeight, contentId])\n\n if (renderView) {\n return createElement(\n View,\n {\n ref: setContainerRef as any,\n id: root.id,\n style: {\n ...style,\n width: '100%',\n position: 'relative',\n height: scrollHeight$,\n pointerEvents: isScrolling$ ? 'none' : 'auto',\n },\n className,\n },\n sections\n )\n }\n\n return createElement(\n ScrollView,\n {\n id: root.id,\n ref: (el: any) => {\n scrollViewShellRef.current = el\n },\n style: {\n WebkitOverflowScrolling: 'touch',\n overflow: 'auto',\n ...style,\n },\n className,\n scrollY: true,\n onScroll: onScrollMerged,\n ...(controlledScrollTop !== undefined ? { scrollTop: controlledScrollTop } : {}),\n ...(controlledScrollLeft !== undefined ? { scrollLeft: controlledScrollLeft } : {}),\n ...rest,\n },\n createElement(\n View,\n {\n ref: setContainerRef as any,\n id: `waterflow-root_${instanceSuffix}`,\n style: {\n width: '100%',\n position: 'relative',\n height: scrollHeight$,\n pointerEvents: isScrolling$ ? 'none' : 'auto',\n },\n },\n sections\n )\n )\n}\n\nexport const WaterFlow = forwardRef<HTMLElement, PropsWithChildren<WaterFlowProps>>(InnerWaterFlow)\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,UAAU,EAAE;AAEZ;AACA,SAAS,0BAA0B,CAAE,KAAc,EAAA;IACjD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,SAAS;AA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GAAG,EAAE,SAAS,EAAE,mBAAmB,EAAE,GAAG,EAAE,EAC5E,GAAC,oBAAoB,KAAK,SAAS,GAAG,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,EAAE,EAAC,EAChF,IAAI,CAAA,EAET,aAAa,CACX,IAAI,EACJ;AACE,QAAA,GAAG,EAAE,eAAsB;QAC3B,EAAE,EAAE,CAAkB,eAAA,EAAA,cAAc,CAAE,CAAA;AACtC,QAAA,KAAK,EAAE;AACL,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,QAAQ,EAAE,UAAU;AACpB,YAAA,MAAM,EAAE,aAAa;YACrB,aAAa,EAAE,YAAY,GAAG,MAAM,GAAG,MAAM;AAC9C,SAAA;KACF,EACD,QAAQ,CACT,CACF;AACH,CAAC;MAEY,SAAS,GAAG,UAAU,CAAiD,cAAc;;;;"}
|
|
1
|
+
{"version":3,"file":"water-flow.js","sources":["../../../src/components/water-flow/water-flow.ts"],"sourcesContent":["import { BaseEventOrig, ScrollView, ScrollViewProps, View } from '@tarojs/components'\nimport Taro, { nextTick, useResize } from '@tarojs/taro'\nimport {\n Children,\n cloneElement,\n createElement,\n forwardRef,\n PropsWithChildren,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react'\n\nimport { debounce, getScrollViewContextNode, weappScope } from '../../utils'\nimport {\n type ScrollElementContextValueShape,\n ScrollElementContextOrFallback,\n} from '../../utils/scrollElementContext'\nimport { useMeasureStartOffset } from '../list/hooks/useMeasureStartOffset'\nimport { useMeasureStartOffsetWeapp } from '../list/hooks/useMeasureStartOffsetWeapp'\nimport { useScrollParentAutoFind } from '../list/hooks/useScrollParentAutoFind'\nimport { getFeedColumn } from './feed-column'\nimport { _FlowSectionProps } from './flow-section'\nimport { Root, RootEvents } from './root'\nimport { Section } from './section'\nimport { useMemoizedFn } from './use-memoized-fn'\nimport { useObservedAttr } from './use-observed-attr'\nimport { getSysInfo, isH5, isWeapp } from './utils'\nimport { createWaterFlowNodeCacheControl } from './water-flow-node-cache'\n\nimport type { ScrollDirection, WaterFlowProps } from './interface'\n\ngetSysInfo()\n\n/** 仅有效数字才作为 ScrollView 受控滚动偏移,避免 undefined/null 在 H5 经 Number(null)→0 归顶 */\nfunction pickControlledScrollOffset (value: unknown): number | undefined {\n return typeof value === 'number' && !Number.isNaN(value) ? value : undefined\n}\n\nfunction normalizeColumn (column: number | undefined): number {\n const value = Number(column ?? 1)\n return Number.isFinite(value) ? Math.max(1, Math.floor(value)) : 1\n}\n\nconst InnerWaterFlow = (\n { children, ...props }: PropsWithChildren<WaterFlowProps>,\n ref: React.ForwardedRef<HTMLElement>\n) => {\n const {\n id,\n style = {},\n className,\n cacheCount = 1,\n onScrollToUpper,\n onScrollToLower,\n upperThresholdCount,\n lowerThresholdCount,\n scrollIntoView,\n nestedScroll,\n scrollElement,\n startOffset,\n containerHeight,\n onScrollHeightChange,\n onScrollIntoViewComplete,\n onScroll: onScrollProp,\n scrollTop,\n scrollLeft,\n ...rest\n } = props\n const flowType = nestedScroll === true ? 'nested' : 'default'\n // 从 ScrollElementContext 获取 scrollRef(List/ScrollView 内嵌时提供);无 Context 时兜底为 fallback\n const scrollElementCtx = useContext(ScrollElementContextOrFallback) as ScrollElementContextValueShape | null\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n const scrollViewShellRef = useRef<HTMLElement | null>(null)\n const setContainerRef = useCallback(\n (el: HTMLElement | null) => {\n (contentWrapperRef as React.MutableRefObject<HTMLElement | null>).current = el\n if (typeof ref === 'function') ref(el)\n else if (ref) (ref as React.MutableRefObject<HTMLElement | null>).current = el\n },\n [ref]\n )\n const defaultId = useId().replace(/:/g, '')\n /** 仅在原有 id 后追加同一实例内共享的随机数尾缀,不替换原 id 串 */\n const instanceIdSuffixRef = useRef<string | null>(null)\n if (instanceIdSuffixRef.current === null) {\n instanceIdSuffixRef.current = String(Math.floor(Math.random() * 1e9))\n }\n const instanceSuffix = instanceIdSuffixRef.current\n const contentId = useMemo(\n () => `${id ?? defaultId}_${instanceSuffix}`,\n [id, defaultId, instanceSuffix]\n )\n const needAutoFind =\n flowType === 'nested' &&\n !scrollElement &&\n !scrollElementCtx?.scrollRef &&\n (isH5 || isWeapp)\n const { scrollParentRef: autoFoundRef, status: autoFindStatus } = useScrollParentAutoFind(\n contentWrapperRef,\n {\n enabled: !!needAutoFind,\n isHorizontal: false,\n contentId: isWeapp ? contentId : undefined,\n excludeScrollElement: scrollViewShellRef\n }\n )\n const effectiveScrollElement =\n scrollElement ??\n scrollElementCtx?.scrollRef ??\n (needAutoFind && autoFindStatus === 'found' ? autoFoundRef : null)\n const ctxStart = scrollElementCtx?.startOffset\n const hasExplicitStartOffset = ctxStart != null && ctxStart > 0\n const needMeasureStartOffset =\n flowType === 'nested' &&\n effectiveScrollElement &&\n isH5 &&\n startOffset == null &&\n !hasExplicitStartOffset\n const needMeasureStartOffsetWeapp =\n flowType === 'nested' &&\n effectiveScrollElement &&\n isWeapp &&\n startOffset == null &&\n !hasExplicitStartOffset\n const measuredStartOffset = useMeasureStartOffset(\n effectiveScrollElement ?? { current: null },\n contentWrapperRef,\n { enabled: !!needMeasureStartOffset, isHorizontal: false }\n )\n const effectiveStartOffsetRef = useRef(0)\n const measuredStartOffsetWeapp = useMeasureStartOffsetWeapp(\n effectiveScrollElement ?? { current: null },\n contentId,\n { enabled: !!needMeasureStartOffsetWeapp, isHorizontal: false, startOffsetRef: effectiveStartOffsetRef }\n )\n const effectiveStartOffset =\n startOffset ??\n (ctxStart != null && ctxStart > 0 ? ctxStart : null) ??\n measuredStartOffset ??\n measuredStartOffsetWeapp ??\n 0\n\n const effectiveContainerHeight = containerHeight ?? scrollElementCtx?.containerHeight\n\n const startOffsetRef = useRef(effectiveStartOffset)\n const containerHeightRef = useRef(effectiveContainerHeight)\n const lastReportedHeightRef = useRef<number>(0)\n startOffsetRef.current = effectiveStartOffset\n if (!needMeasureStartOffsetWeapp) {\n effectiveStartOffsetRef.current = effectiveStartOffset\n }\n containerHeightRef.current = effectiveContainerHeight\n\n const useScrollElementMode =\n flowType === 'nested' && !!(effectiveScrollElement && (isH5 || isWeapp))\n const renderView =\n useScrollElementMode || (!!needAutoFind && autoFindStatus === 'pending')\n if (flowType === 'nested' && !effectiveScrollElement && (isH5 || isWeapp) && autoFindStatus === 'not-found') {\n // eslint-disable-next-line no-console\n console.warn('[WaterFlow] nestedScroll 模式但无 scrollElement(props/Context/自动查找),回退为 default,将渲染自有 ScrollView')\n }\n /**\n * 初始化数据模型\n */\n const root = useMemo(() => {\n return new Root({\n id: contentId,\n cacheCount,\n upperThresholdCount,\n lowerThresholdCount,\n skipContainerMeasure: useScrollElementMode || (!!needAutoFind && autoFindStatus === 'pending'),\n })\n }, [contentId, upperThresholdCount, lowerThresholdCount, useScrollElementMode, needAutoFind, autoFindStatus])\n\n /** props 动态修改 cacheCount 时同步到 Root,避免重建 Root;并收敛快滑单边放大到新的基线 */\n useLayoutEffect(() => {\n root.cacheCount = cacheCount\n root.setNodeCacheRange(cacheCount, cacheCount)\n }, [root, cacheCount])\n const isScrolling$ = useObservedAttr(root, 'isScrolling')\n const scrollHeight$ = useObservedAttr(root, 'scrollHeight')\n const renderRange$ = useObservedAttr(root, 'renderRange')\n const refEventOrig = useRef<BaseEventOrig>()\n const nodeCacheCtlRef = useRef<ReturnType<typeof createWaterFlowNodeCacheControl> | null>(null)\n\n useLayoutEffect(() => {\n if (root.skipContainerMeasure) return\n const shell = renderView ? contentWrapperRef.current : scrollViewShellRef.current\n root.measureContainerSize(shell as HTMLElement | null).catch(() => {})\n }, [root, renderView, needAutoFind, autoFindStatus])\n\n useEffect(() => {\n const ctl = createWaterFlowNodeCacheControl(root, () => root.cacheCount)\n nodeCacheCtlRef.current = ctl\n return () => {\n ctl.dispose()\n nodeCacheCtlRef.current = null\n }\n }, [root])\n\n /**\n * 滚动事件\n */\n const handleScroll = useMemoizedFn((ev: BaseEventOrig<ScrollViewProps.onScrollDetail>) => {\n refEventOrig.current = ev\n const { scrollTop: detailScrollTop } = ev.detail\n nodeCacheCtlRef.current?.onScrollSample(detailScrollTop)\n const scrollDirection: ScrollDirection = root.getState().scrollOffset < detailScrollTop ? 'forward' : 'backward'\n root.setStateBatch({\n scrollDirection: scrollDirection,\n scrollOffset: detailScrollTop,\n isScrolling: true,\n })\n })\n\n const onScrollMerged = useMemoizedFn((ev: BaseEventOrig<ScrollViewProps.onScrollDetail>) => {\n handleScroll(ev)\n onScrollProp?.(ev)\n })\n\n const controlledScrollTop = pickControlledScrollOffset(scrollTop)\n const controlledScrollLeft = pickControlledScrollOffset(scrollLeft)\n const warnedShrinks = useRef<Map<string, number> | null>(null)\n\n const sections = useMemo(() => {\n const [start, end] = renderRange$\n return Children.map(children, (child: ReactElement<PropsWithChildren<_FlowSectionProps>>, order) => {\n if (Object.is(child, null)) {\n return null\n }\n const sectionProps = child.props\n const sectionId = sectionProps.id || `section-${order}`\n const childCount = Children.count(sectionProps.children)\n const autoColumn = !!sectionProps.autoColumn\n let section = root.findSection(sectionId)\n if (section) {\n const originalCount = section.count\n if (childCount > originalCount) {\n section.pushNodesStructuralOnly(childCount - originalCount)\n }\n } else {\n section = new Section(root, {\n id: sectionId,\n order,\n col: autoColumn\n ? getFeedColumn(Taro.getSystemInfoSync().windowWidth)\n : normalizeColumn(sectionProps.column),\n rowGap: sectionProps.rowGap || 0,\n columnGap: sectionProps.columnGap || 0,\n count: childCount,\n })\n }\n // 同步只读控制字段(纯赋值,不触发 pub);autoColumn 下列数由 useResize/reflow 驱动\n section.autoColumn = autoColumn\n section.onColumnChange = sectionProps.onColumnChange\n\n return cloneElement(child, { section, key: `${props.id}-${order}` })\n })?.slice(start, end + 1)\n }, [renderRange$[0], renderRange$[1], children, root, props.id])\n\n /** autoColumn:监听窗口变化,组件内部算列数并原地 reflow,不依赖业务改 props */\n useResize(useMemoizedFn((res: Taro.PageResizeObject) => {\n const width = isH5\n ? Taro.getSystemInfoSync().windowWidth\n : (res?.size?.windowWidth ?? Taro.getSystemInfoSync().windowWidth)\n const nextCol = getFeedColumn(width)\n let changed = false\n for (const section of root.sectionMap.values()) {\n if (section.autoColumn && section.col !== nextCol) {\n section.reflow(nextCol)\n changed = true\n if (isH5) section.onColumnChange?.(nextCol)\n }\n }\n if (changed) {\n if (isH5) {\n root.updateScrollHeight(true)\n } else {\n root.setStateIn('renderRange', root.getSectionRenderRange())\n for (const section of root.sectionMap.values()) {\n if (section.autoColumn) section.onColumnChange?.(nextCol)\n }\n }\n }\n }))\n\n /** 配对 pushNodesStructuralOnly:在 layout 阶段完成 Section 状态,避免 useMemo 内 setState 告警 */\n useLayoutEffect(() => {\n let changed = false\n let autoColumnCount: number | undefined\n const getAutoColumnCount = () => {\n autoColumnCount ??= getFeedColumn(Taro.getSystemInfoSync().windowWidth)\n return autoColumnCount\n }\n if (warnedShrinks.current === null) warnedShrinks.current = new Map()\n const warnedCounts = warnedShrinks.current\n Children.forEach(children, (child: ReactElement<PropsWithChildren<_FlowSectionProps>>, order) => {\n if (Object.is(child, null)) {\n return\n }\n const sectionProps = child.props\n const sectionId = sectionProps.id || `section-${order}`\n const section = root.findSection(sectionId)\n if (!section) return\n section.finalizePushNodesStateIfNeeded()\n const childCount = Children.count(sectionProps.children)\n if (childCount >= section.count) {\n warnedCounts.delete(sectionId)\n } else if (process.env.NODE_ENV !== 'production' && warnedCounts.get(sectionId) !== childCount) {\n warnedCounts.set(sectionId, childCount)\n console.warn(`[WaterFlow] FlowSection ${sectionId} 已注册 ${section.count} 个节点,当前收到 ${childCount} 个子项;减少数据后请重建 WaterFlow。`)\n }\n if (!isH5) return\n const nextCol = section.autoColumn\n ? getAutoColumnCount()\n : normalizeColumn(sectionProps.column)\n if (section.col === nextCol) return\n section.reflow(nextCol)\n changed = true\n if (section.autoColumn) section.onColumnChange?.(nextCol)\n })\n if (changed) root.updateScrollHeight(true)\n }, [children, root])\n\n const scrollTo = useMemoizedFn((scrollOffset = 0) => {\n scrollOffset = Math.max(0, scrollOffset)\n if (root.getState().scrollOffset === scrollOffset) return\n if (useScrollElementMode && effectiveScrollElement?.current) {\n const el = effectiveScrollElement.current as any\n const startOff = isWeapp ? effectiveStartOffsetRef.current : (startOffsetRef.current ?? 0)\n const scrollTarget = scrollOffset + startOff\n if (isH5) {\n el.scrollTo({ top: scrollTarget })\n } else if (isWeapp) {\n const scrollViewId = el.id || `_wf_${contentId}`\n if (!el.id) el.id = scrollViewId\n getScrollViewContextNode(`#${scrollViewId}`).then((node: any) => {\n node?.scrollTo?.({ top: scrollTarget, animated: true, duration: 300 })\n })\n }\n root.setStateBatch({ scrollOffset, isScrolling: true })\n return\n }\n getScrollViewContextNode(`#${root.id}`).then((node: any) => {\n node.scrollTo({\n animated: true,\n duration: 300,\n top: scrollOffset,\n })\n })\n })\n\n const resetScrolling = useMemoizedFn(() => {\n root.setStateIn('isScrolling', false)\n })\n\n const debouncedResetScrolling = debounce(resetScrolling)\n\n useEffect(() => {\n debouncedResetScrolling()\n }, [isScrolling$])\n\n /**\n * 处理滚动阈值\n * root 需入参:autoFind 从 pending→found 时 root 会重建,必须对新 root 重新订阅\n */\n useEffect(() => {\n const disposers = [\n root.sub(\n RootEvents.ReachUpperThreshold,\n debounce(() => {\n onScrollToUpper?.(refEventOrig.current!)\n })\n ),\n root.sub(\n RootEvents.ReachLowerThreshold,\n debounce(() => {\n onScrollToLower?.(refEventOrig.current!)\n })\n ),\n ]\n return () => {\n disposers.forEach((disposer) => {\n disposer()\n })\n }\n }, [root, onScrollToUpper, onScrollToLower])\n\n /**\n * 处理 scrollIntoView\n * 竞态:快速切换目标时,取消前一次滚动,避免后发先至\n */\n useEffect(() => {\n let cancelled = false\n handleScrollIntoView()\n async function handleScrollIntoView() {\n if (!scrollIntoView) return\n const targetNode = root.findNode(scrollIntoView)\n if (!targetNode) {\n nextTick(() => { if (!cancelled) onScrollIntoViewComplete?.() })\n return\n }\n const targetSection = targetNode.section\n const doScroll = () => {\n if (cancelled) return\n scrollTo(targetNode.getState().scrollTop)\n if (cancelled) return\n nextTick(() => { if (!cancelled) onScrollIntoViewComplete?.() })\n }\n if (!targetSection.getState().layouted) {\n const order = targetSection.order\n root.setStateIn('renderRange', [\n Math.min(renderRange$[0], order),\n Math.max(renderRange$[1], order),\n ])\n nextTick(async () => {\n await targetNode.section.layoutedSignal.promise\n if (cancelled) return\n doScroll()\n })\n return\n }\n await targetSection.layoutedSignal.promise\n if (cancelled) return\n doScroll()\n }\n return () => { cancelled = true }\n }, [scrollIntoView, renderRange$[0], renderRange$[1], onScrollIntoViewComplete])\n\n // scrollElement 模式下监听外部滚动,更新 root.scrollOffset;effectiveStartOffset 变化时重新同步;内嵌时 scrollRef 可能尚未就绪,需重试\n useEffect(() => {\n if (!useScrollElementMode || !effectiveScrollElement) return\n\n let cancelled = false\n let teardown: (() => void) | null = null\n const maxRetries = 20\n\n const tryAttach = (retryCount = 0) => {\n if (cancelled) return\n const target = effectiveScrollElement.current as any\n if (!target) {\n if (retryCount < maxRetries) {\n setTimeout(() => tryAttach(retryCount + 1), 50)\n }\n return\n }\n\n const getStartOffset = () => (isWeapp ? effectiveStartOffsetRef.current : (startOffsetRef.current ?? 0))\n\n const handler = (e?: any) => {\n const scrollTop = isWeapp\n ? (e?.target?.scrollTop ?? e?.mpEvent?.detail?.scrollTop ?? 0)\n : target.scrollTop\n const offset = scrollTop - getStartOffset()\n const effectiveOffset = Math.max(0, offset)\n const prevOffset = root.getState().scrollOffset\n const scrollDirection: ScrollDirection = prevOffset < effectiveOffset ? 'forward' : 'backward'\n\n nodeCacheCtlRef.current?.onScrollSample(effectiveOffset)\n root.setStateBatch({\n scrollDirection,\n scrollOffset: effectiveOffset,\n isScrolling: true,\n })\n }\n\n if (isWeapp) {\n if (!target.id) target.id = `_wf_${contentId}`\n const scrollViewId = target.id\n const scope = weappScope({ current: target })\n const query = scope != null\n ? Taro.createSelectorQuery().in(scope as any)\n : Taro.createSelectorQuery()\n query.select(`#${scrollViewId}`).scrollOffset().exec((res) => {\n if (cancelled) return\n const info = res?.[0]\n if (info) {\n const scrollTopVal = info.scrollTop ?? 0\n const initialOffset = Math.max(0, scrollTopVal - getStartOffset())\n root.setStateBatch({ scrollOffset: initialOffset, isScrolling: true })\n }\n })\n } else {\n const initialOffset = Math.max(0, target.scrollTop - getStartOffset())\n root.setStateBatch({ scrollOffset: initialOffset, isScrolling: true })\n }\n\n target.addEventListener('scroll', handler, isWeapp ? undefined : { passive: true })\n teardown = () => target.removeEventListener('scroll', handler)\n }\n\n tryAttach()\n return () => {\n cancelled = true\n teardown?.()\n }\n }, [useScrollElementMode, effectiveScrollElement, root, effectiveStartOffset, contentId])\n\n // scrollHeight 变化时回调(props 优先,其次从 Context),便于 List 动高联动;防抖 150ms 上报\n const reportHeight = onScrollHeightChange ?? scrollElementCtx?.reportNestedHeightChange\n useEffect(() => {\n if (!reportHeight || scrollHeight$ <= 0) return\n const timer = setTimeout(() => {\n if (Math.abs(lastReportedHeightRef.current - scrollHeight$) < 1) return\n lastReportedHeightRef.current = scrollHeight$\n reportHeight(scrollHeight$)\n }, 150)\n return () => clearTimeout(timer)\n }, [scrollHeight$, reportHeight])\n\n // scrollElement 模式下监听容器尺寸:H5 用 ResizeObserver,小程序用 createSelectorQuery 轮询\n useEffect(() => {\n if (!useScrollElementMode || !effectiveScrollElement) return\n const el = effectiveScrollElement.current as any\n if (!el) return\n\n if (isWeapp) {\n if (!el.id) el.id = `_wf_${contentId}`\n const scrollViewId = el.id\n const measure = () => {\n const scope = weappScope({ current: el })\n const query = scope != null\n ? Taro.createSelectorQuery().in(scope as any)\n : Taro.createSelectorQuery()\n query.select(`#${scrollViewId}`).boundingClientRect().exec((res) => {\n const rect = res?.[0]\n if (rect && rect.height > 0 && rect.width > 0) {\n const height = containerHeightRef.current ?? rect.height\n root.setStateIn('containerSize', { width: rect.width, height })\n }\n })\n }\n measure()\n const interval = setInterval(measure, 150)\n return () => clearInterval(interval)\n }\n\n if (typeof ResizeObserver === 'undefined') return\n const update = () => {\n const height = containerHeightRef.current ?? el.clientHeight\n const width = el.clientWidth\n if (height > 0 && width > 0) {\n root.setStateIn('containerSize', { width, height })\n }\n }\n update()\n const ro = new ResizeObserver(update)\n ro.observe(el)\n return () => ro.disconnect()\n }, [useScrollElementMode, effectiveScrollElement, root, effectiveContainerHeight, contentId])\n\n if (renderView) {\n return createElement(\n View,\n {\n ref: setContainerRef as any,\n id: root.id,\n style: {\n ...style,\n width: '100%',\n position: 'relative',\n height: scrollHeight$,\n pointerEvents: isScrolling$ ? 'none' : 'auto',\n },\n className,\n },\n sections\n )\n }\n\n return createElement(\n ScrollView,\n {\n id: root.id,\n ref: (el: any) => {\n scrollViewShellRef.current = el\n },\n style: {\n WebkitOverflowScrolling: 'touch',\n overflow: 'auto',\n ...style,\n },\n className,\n scrollY: true,\n onScroll: onScrollMerged,\n ...(controlledScrollTop !== undefined ? { scrollTop: controlledScrollTop } : {}),\n ...(controlledScrollLeft !== undefined ? { scrollLeft: controlledScrollLeft } : {}),\n ...rest,\n },\n createElement(\n View,\n {\n ref: setContainerRef as any,\n id: `waterflow-root_${instanceSuffix}`,\n style: {\n width: '100%',\n position: 'relative',\n height: scrollHeight$,\n pointerEvents: isScrolling$ ? 'none' : 'auto',\n },\n },\n sections\n )\n )\n}\n\nexport const WaterFlow = forwardRef<HTMLElement, PropsWithChildren<WaterFlowProps>>(InnerWaterFlow)\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,UAAU,EAAE;AAEZ;AACA,SAAS,0BAA0B,CAAE,KAAc,EAAA;IACjD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,SAAS;AAC9E;AAEA,SAAS,eAAe,CAAE,MAA0B,EAAA;AAClD,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,KAAA,CAAA,GAAN,MAAM,GAAI,CAAC,CAAC;IACjC,OA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name": "@tarojs/components-advanced",
|
|
3
|
-
"version": "4.3.3-
|
|
3
|
+
"version": "4.3.3-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"csstype": "^3.1.1",
|
|
21
21
|
"memoize-one": "^6.0.0",
|
|
22
22
|
"tslib": "^2.6.2",
|
|
23
|
-
"@tarojs/components": "4.3.3-
|
|
24
|
-
"@tarojs/components
|
|
23
|
+
"@tarojs/components-react": "4.3.3-beta.1",
|
|
24
|
+
"@tarojs/components": "4.3.3-beta.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"vue": "3.2.47",
|
|
28
|
-
"@tarojs/runtime": "4.3.3-
|
|
29
|
-
"@tarojs/
|
|
30
|
-
"@tarojs/
|
|
28
|
+
"@tarojs/runtime": "4.3.3-beta.1",
|
|
29
|
+
"@tarojs/shared": "4.3.3-beta.1",
|
|
30
|
+
"@tarojs/taro": "4.3.3-beta.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=18",
|
|
34
|
-
"@tarojs/runtime": "~4.3.3-
|
|
35
|
-
"@tarojs/shared": "~4.3.3-
|
|
36
|
-
"@tarojs/taro": "~4.3.3-
|
|
34
|
+
"@tarojs/runtime": "~4.3.3-beta.1",
|
|
35
|
+
"@tarojs/shared": "~4.3.3-beta.1",
|
|
36
|
+
"@tarojs/taro": "~4.3.3-beta.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"react": {
|