@tarojs/components-advanced 3.8.0-canary.0 → 4.0.0-alpha.10
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/LICENSE +11 -4
- package/README.md +6 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/virtual-list/constants.d.ts +1 -2
- package/dist/components/virtual-list/dom-helpers.d.ts +1 -2
- package/dist/components/virtual-list/dom-helpers.js.map +1 -1
- package/dist/components/virtual-list/index.d.ts +9 -17
- package/dist/components/virtual-list/index.js.map +1 -1
- package/dist/components/virtual-list/list-set.d.ts +3 -3
- package/dist/components/virtual-list/list-set.js.map +1 -1
- package/dist/components/virtual-list/preset.d.ts +10 -10
- package/dist/components/virtual-list/preset.js +1 -3
- package/dist/components/virtual-list/preset.js.map +1 -1
- package/dist/components/virtual-list/react/index.d.ts +2 -2
- package/dist/components/virtual-list/react/index.js +3 -2
- package/dist/components/virtual-list/react/index.js.map +1 -1
- package/dist/components/virtual-list/react/list.d.ts +5 -10
- package/dist/components/virtual-list/react/list.js +8 -3
- package/dist/components/virtual-list/react/list.js.map +1 -1
- package/dist/components/virtual-list/react/validate.d.ts +3 -4
- package/dist/components/virtual-list/react/validate.js.map +1 -1
- package/dist/components/virtual-list/react/wrapper.d.ts +1 -1
- package/dist/components/virtual-list/react/wrapper.js +4 -2
- package/dist/components/virtual-list/react/wrapper.js.map +1 -1
- package/dist/components/virtual-list/utils.d.ts +3 -3
- package/dist/components/virtual-list/vue/index.d.ts +6 -6
- package/dist/components/virtual-list/vue/list.d.ts +24 -3
- package/dist/components/virtual-list/vue/list.js +16 -9
- package/dist/components/virtual-list/vue/list.js.map +1 -1
- package/dist/components/virtual-waterfall/constants.d.ts +1 -2
- package/dist/components/virtual-waterfall/index.d.ts +9 -17
- package/dist/components/virtual-waterfall/index.js +1 -1
- package/dist/components/virtual-waterfall/index.js.map +1 -1
- package/dist/components/virtual-waterfall/list-map.d.ts +3 -4
- package/dist/components/virtual-waterfall/list-map.js.map +1 -1
- package/dist/components/virtual-waterfall/preset.d.ts +10 -10
- package/dist/components/virtual-waterfall/preset.js +1 -3
- package/dist/components/virtual-waterfall/preset.js.map +1 -1
- package/dist/components/virtual-waterfall/react/index.d.ts +2 -2
- package/dist/components/virtual-waterfall/react/index.js +4 -3
- package/dist/components/virtual-waterfall/react/index.js.map +1 -1
- package/dist/components/virtual-waterfall/react/waterfall.d.ts +4 -9
- package/dist/components/virtual-waterfall/react/waterfall.js +6 -3
- package/dist/components/virtual-waterfall/react/waterfall.js.map +1 -1
- package/dist/components/virtual-waterfall/react/wrapper.d.ts +1 -1
- package/dist/components/virtual-waterfall/react/wrapper.js +3 -2
- package/dist/components/virtual-waterfall/react/wrapper.js.map +1 -1
- package/dist/components/virtual-waterfall/vue/index.d.ts +6 -6
- package/dist/components/virtual-waterfall/vue/waterfall.d.ts +24 -3
- package/dist/components/virtual-waterfall/vue/waterfall.js +15 -10
- package/dist/components/virtual-waterfall/vue/waterfall.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/utils/convert.d.ts +2 -3
- package/dist/utils/convert.js.map +1 -1
- package/dist/utils/dom.d.ts +3 -4
- package/dist/utils/dom.js +1 -1
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/helper.d.ts +2 -3
- package/dist/utils/helper.js.map +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/lodash.d.ts +3 -4
- package/dist/utils/lodash.js.map +1 -1
- package/dist/utils/math.d.ts +2 -3
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/timer.d.ts +3 -3
- package/dist/utils/timer.js.map +1 -1
- package/dist/utils/vue-render.d.ts +1 -2
- package/dist/utils/vue-render.js +10 -11
- package/dist/utils/vue-render.js.map +1 -1
- package/package.json +15 -23
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js +0 -296
- package/dist/node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../../src/components/virtual-list/react/list.ts"],"sourcesContent":["import 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.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 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 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\t= scrollOffset\n } else {\n option.top = scrollOffset\n }\n return getScrollViewContextNode(`#${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":";;;;;;;;;;;;;;AAqBc,MAAO,IAAK,SAAQ,KAAK,CAAC,aAA6B,CAAA;AAUnE,IAAA,OAAO,wBAAwB,CAAE,SAAiB,EAAE,SAAiB,EAAA;AACnE,QAAA,OAAO,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;KAC/C;AAKD,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC,CAAA;QAuBd,IAAO,CAAA,OAAA,GAAG,MAAK;AACb,YAAA,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE,CAAA;AACnB,aAAA;AAAM,iBAAA;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE,YAAY;AAC7B,iBAAA,CAAC,CAAC,CAAA;AACJ,aAAA;AACH,SAAC,CAAA;QAED,IAAS,CAAA,SAAA,GAAG,SAAS,CAAA;QAErB,IAA0B,CAAA,0BAAA,GAAG,IAAI,CAAA;AAEjC,QAAA,IAAA,CAAA,oBAAoB,GAAG,UAAU,CAAC,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YAC7H,kBAAkB;YAClB,iBAAiB;YACjB,UAAU;YACV,SAAS;AACV,SAAA,CAAC,CAAC,CAAA;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,MAAM;AACA,SAAA,CAAC,CAAC,CAAA;AAuCV,QAAA,IAAA,CAAA,k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AM,CAAC,KAAK,CAAC,SAAS,CAAA;AAC7F,aAAA;AACF,SAAA;AAED,QAAA,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EACxC,UAAU,EACV,IAAI,CAAC,mBAAmB,EAAE,CAC3B,CAAA;KACF;;AAxfM,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,IAAI;CAC5C,CAAA;AAofH;AACA;AACA;AACA;AACA;;;;"}
|
|
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,CAAA;KAC/C;AAKD,IAAA,WAAA,CAAa,KAAa,EAAA;QACxB,KAAK,CAAC,KAAK,CAAC,CAAA;QAuBd,IAAO,CAAA,OAAA,GAAG,MAAK;YACb,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE;gBACtC,IAAI,CAAC,WAAW,EAAE,CAAA;aACnB;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM;oBACnC,YAAY,EAAE,EAAE,YAAY;AAC7B,iBAAA,CAAC,CAAC,CAAA;aACJ;AACH,SAAC,CAAA;QAED,IAAS,CAAA,SAAA,G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AChC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,OAAO,EAChC,UAAU,EAAE,WAAW,EACvB,SAAS,EACN,EAAA,KAAK,CAEV,EAAA,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAC1C,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAC1C,SAAS;AACT,YAAA,YAAY,GACb,CAAA;QAED,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,YAAY,EAAE;AAChB,gBAAA,UAAU,CAAC,UAAU,GAAG,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAA;aAC/F;iBAAM;AACL,gBAAA,UAAU,CAAC,SAAS,GAAG,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAA;aAC7F;SACF;AAED,QAAA,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EACxC,UAAU,EACV,IAAI,CAAC,mBAAmB,EAAE,CAC3B,CAAA;KACF;;AA1fM,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,IAAI;AAC5C,CAPkB,CAOlB;AAsfH;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IProps } from
|
|
2
|
-
import { IState } from
|
|
3
|
-
declare const validateListProps: ({ item, direction, layout, itemTagName, innerTagName, outerTagName, itemSize }: IProps, { instance, }: IState) => any;
|
|
4
|
-
export { validateListProps };
|
|
1
|
+
import type { IProps } from '../preset';
|
|
2
|
+
import type { IState } from './list';
|
|
3
|
+
export declare const validateListProps: ({ item, direction, layout, itemTagName, innerTagName, outerTagName, itemSize }: IProps, { instance, }: IState) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sources":["../../../../src/components/virtual-list/react/validate.ts"],"sourcesContent":["import type { IProps } from '../preset'\nimport type { IState } from './list'\n\nlet devWarningsDirection = null\nlet devWarningsTagName = null\n\nif (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {\n devWarningsDirection = /* #__PURE__ */ new WeakSet()\n devWarningsTagName = /* #__PURE__ */ new WeakSet()\n }\n}\n\nexport const validateListProps = ({\n item,\n direction,\n layout,\n itemTagName,\n innerTagName,\n outerTagName,\n itemSize\n}: IProps, {\n instance,\n}: IState) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!['number', 'function'].includes(typeof itemSize)) {\n throw Error('An invalid \"itemSize\" prop has been specified. ' + 'Value should be a number or function. ' + `\"${itemSize === null ? 'null' : typeof itemSize}\" was specified.`)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (innerTagName != null || outerTagName != null || itemTagName != null) {\n if (devWarningsTagName && !devWarningsTagName.has(instance)) {\n devWarningsTagName.add(instance)\n console.warn('The itemTagName、innerTagName and outerTagName props have been deprecated. ' + 'Please use the itemElementType、innerElementType and outerElementType props instead.')\n }\n }\n\n switch (direction as string) {\n case 'horizontal':\n case 'vertical':\n if (devWarningsDirection && !devWarningsDirection.has(instance)) {\n devWarningsDirection.add(instance)\n console.warn('The direction prop should be either \"ltr\" (default) or \"rtl\". ' + 'Please use the layout prop to specify \"vertical\" (default) or \"horizontal\" orientation.')\n }\n\n break\n\n case 'ltr':\n case 'rtl':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"direction\" prop has been specified. ' + 'Value should be either \"ltr\" or \"rtl\". ' + `\"${direction}\" was specified.`)\n }\n\n switch (layout) {\n case 'horizontal':\n case 'vertical':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"layout\" prop has been specified. ' + 'Value should be either \"horizontal\" or \"vertical\". ' + `\"${layout}\" was specified.`)\n }\n\n if (item == null) {\n throw Error('An invalid \"item\" prop has been specified. ' + 'Value should be a React component. ' + `\"${item === null ? 'null' : typeof item}\" was specified.`)\n }\n\n // if (isHorizontal && typeof width !== 'number') {\n // throw Error('An invalid \"width\" prop has been specified. ' + 'Horizontal lists must specify a number for width. ' + `\"${width === null ? 'null' : typeof width}\" was specified.`)\n // } else if (!isHorizontal && typeof height !== 'number') {\n // throw Error('An invalid \"height\" prop has been specified. ' + 'Vertical lists must specify a number for height. ' + `\"${height === null ? 'null' : typeof height}\" was specified.`)\n // }\n }\n\n return null\n}\n"],"names":[],"mappings":"AAGA,IAAI,oBAAoB,GAAG,IAAI,CAAA;AAC/B,IAAI,kBAAkB,GAAG,IAAI,CAAA;AAE7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"validate.js","sources":["../../../../src/components/virtual-list/react/validate.ts"],"sourcesContent":["import type { IProps } from '../preset'\nimport type { IState } from './list'\n\nlet devWarningsDirection = null\nlet devWarningsTagName = null\n\nif (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {\n devWarningsDirection = /* #__PURE__ */ new WeakSet()\n devWarningsTagName = /* #__PURE__ */ new WeakSet()\n }\n}\n\nexport const validateListProps = ({\n item,\n direction,\n layout,\n itemTagName,\n innerTagName,\n outerTagName,\n itemSize\n}: IProps, {\n instance,\n}: IState) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!['number', 'function'].includes(typeof itemSize)) {\n throw Error('An invalid \"itemSize\" prop has been specified. ' + 'Value should be a number or function. ' + `\"${itemSize === null ? 'null' : typeof itemSize}\" was specified.`)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (innerTagName != null || outerTagName != null || itemTagName != null) {\n if (devWarningsTagName && !devWarningsTagName.has(instance)) {\n devWarningsTagName.add(instance)\n console.warn('The itemTagName、innerTagName and outerTagName props have been deprecated. ' + 'Please use the itemElementType、innerElementType and outerElementType props instead.')\n }\n }\n\n switch (direction as string) {\n case 'horizontal':\n case 'vertical':\n if (devWarningsDirection && !devWarningsDirection.has(instance)) {\n devWarningsDirection.add(instance)\n console.warn('The direction prop should be either \"ltr\" (default) or \"rtl\". ' + 'Please use the layout prop to specify \"vertical\" (default) or \"horizontal\" orientation.')\n }\n\n break\n\n case 'ltr':\n case 'rtl':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"direction\" prop has been specified. ' + 'Value should be either \"ltr\" or \"rtl\". ' + `\"${direction}\" was specified.`)\n }\n\n switch (layout) {\n case 'horizontal':\n case 'vertical':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"layout\" prop has been specified. ' + 'Value should be either \"horizontal\" or \"vertical\". ' + `\"${layout}\" was specified.`)\n }\n\n if (item == null) {\n throw Error('An invalid \"item\" prop has been specified. ' + 'Value should be a React component. ' + `\"${item === null ? 'null' : typeof item}\" was specified.`)\n }\n\n // if (isHorizontal && typeof width !== 'number') {\n // throw Error('An invalid \"width\" prop has been specified. ' + 'Horizontal lists must specify a number for width. ' + `\"${width === null ? 'null' : typeof width}\" was specified.`)\n // } else if (!isHorizontal && typeof height !== 'number') {\n // throw Error('An invalid \"height\" prop has been specified. ' + 'Vertical lists must specify a number for height. ' + `\"${height === null ? 'null' : typeof height}\" was specified.`)\n // }\n }\n\n return null\n}\n"],"names":[],"mappings":"AAGA,IAAI,oBAAoB,GAAG,IAAI,CAAA;AAC/B,IAAI,kBAAkB,GAAG,IAAI,CAAA;AAE7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACzC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE;AAC1E,QAAA,oBAAoB,mBAAmB,IAAI,OA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AK;AAEP,YAAA,KAAK,KAAK,CAAC;AACX,YAAA,KAAK,KAAK;;gBAER,MAAK;AAEP,YAAA;gBACE,MAAM,KAAK,CAAC,kDAAkD,GAAG,yCAAyC,GAAG,CAAI,CAAA,EAAA,SAAS,CAAkB,gBAAA,CAAA,CAAC,CAAA;SAChJ;QAED,QAAQ,MAAM;AACZ,YAAA,KAAK,YAAY,CAAC;AAClB,YAAA,KAAK,UAAU;;gBAEb,MAAK;AAEP,YAAA;gBACE,MAAM,KAAK,CAAC,+CAA+C,GAAG,qDAAqD,GAAG,CAAI,CAAA,EAAA,MAAM,CAAkB,gBAAA,CAAA,CAAC,CAAA;SACtJ;AAED,QAAA,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,MAAM,KAAK,CAAC,6CAA6C,GAAG,qCAAqC,GAAG,CAAA,CAAA,EAAI,IAAI,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,IAAI,CAAkB,gBAAA,CAAA,CAAC,CAAA;SAChK;;;;;;KAOF;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { __rest } from '
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import '../../../utils/index.js';
|
|
4
4
|
import { convertPX2Int } from '../../../utils/convert.js';
|
|
5
5
|
|
|
6
6
|
function getRenderExpandNodes({ direction, isHorizontal, isRtl, id: sid, innerElement, renderExpand, }) {
|
|
7
|
+
const id = `${sid}-${direction}`;
|
|
7
8
|
const props = {
|
|
8
|
-
|
|
9
|
+
key: id,
|
|
10
|
+
id,
|
|
9
11
|
style: {
|
|
10
12
|
visibility: 'hidden',
|
|
11
13
|
height: isHorizontal ? '100%' : 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.js","sources":["../../../../src/components/virtual-list/react/wrapper.ts"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\n\nimport { convertPX2Int } from '../../../utils'\n\nimport type { BaseEventOrig } from '@tarojs/components'\nimport type { VirtualListProps } from '..'\nimport type { IProps } from '../preset'\n\nfunction getRenderExpandNodes ({\n direction,\n isHorizontal,\n isRtl,\n id: sid,\n innerElement,\n renderExpand,\n}: {\n direction: 'top' | 'bottom' | 'left' | 'right'\n isHorizontal: boolean\n isRtl: boolean\n id: string\n innerElement: VirtualListProps['innerElementType']\n renderExpand?: VirtualListProps['renderTop'] | VirtualListProps['renderBottom']\n}) {\n const props: any = {\n
|
|
1
|
+
{"version":3,"file":"wrapper.js","sources":["../../../../src/components/virtual-list/react/wrapper.ts"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\n\nimport { convertPX2Int } from '../../../utils'\n\nimport type { BaseEventOrig } from '@tarojs/components'\nimport type { VirtualListProps } from '..'\nimport type { IProps } from '../preset'\n\nfunction getRenderExpandNodes ({\n direction,\n isHorizontal,\n isRtl,\n id: sid,\n innerElement,\n renderExpand,\n}: {\n direction: 'top' | 'bottom' | 'left' | 'right'\n isHorizontal: boolean\n isRtl: boolean\n id: string\n innerElement: VirtualListProps['innerElementType']\n renderExpand?: VirtualListProps['renderTop'] | VirtualListProps['renderBottom']\n}) {\n const id = `${sid}-${direction}`\n const props: any = {\n key: id,\n id,\n style: {\n visibility: 'hidden',\n height: isHorizontal ? '100%' : 100,\n width: isHorizontal ? 100 : '100%',\n [isHorizontal ? isRtl ? 'marginRight' : 'marginLeft' : 'marginTop']: -100,\n zIndex: -1,\n }\n }\n const expands = [renderExpand, React.createElement(\n innerElement!,\n props,\n )]\n if (isHorizontal ? isRtl ? direction === 'right' : direction === 'left' : direction === 'top') {\n expands.reverse()\n }\n return expands\n}\n\nconst outerWrapper = React.forwardRef(\n function OuterWrapper (props, ref) {\n const {\n id = '', className, style = {}, children,\n outerElementType, innerElementType,\n onScroll, onScrollNative,\n renderTop, renderBottom,\n layout, direction,\n ...rest\n } = props as PropsWithChildren<IProps>\n const handleScroll = (event: BaseEventOrig<VirtualListProps.IVirtualListEventDetail>) => {\n onScroll?.({\n ...event as any,\n currentTarget: {\n ...event.detail,\n clientWidth: convertPX2Int(style.width),\n clientHeight: convertPX2Int(style.height)\n } as any\n })\n\n if (typeof onScrollNative === 'function') {\n onScrollNative(event)\n }\n }\n const isHorizontal = layout === 'horizontal'\n const isRtl = direction === 'rtl'\n\n return React.createElement<any>(outerElementType!, {\n ref,\n id,\n className,\n style,\n scrollY: !isHorizontal,\n scrollX: isHorizontal,\n onScroll: handleScroll,\n ...rest\n }, [\n getRenderExpandNodes({\n direction: isHorizontal ? isRtl ? 'right' : 'left' : 'top',\n isHorizontal,\n isRtl,\n id,\n innerElement: innerElementType,\n renderExpand: renderTop,\n }),\n children,\n getRenderExpandNodes({\n direction: isHorizontal ? isRtl ? 'left' : 'right' : 'bottom',\n isHorizontal,\n isRtl,\n id,\n innerElement: innerElementType,\n renderExpand: renderBottom,\n }),\n ])\n }\n)\n\nexport default outerWrapper\n"],"names":[],"mappings":";;;;;AAQA,SAAS,oBAAoB,CAAE,EAC7B,SAAS,EACT,YAAY,EACZ,KAAK,EACL,EAAE,EAAE,GAAG,EACP,YAAY,EACZ,YAAY,GAQb,EAAA;AACC,IAAA,MAAM,EAAE,GAAG,CAAA,EAAG,GAAG,CAAI,CAAA,EAAA,SAAS,EAAE,CAAA;AAChC,IAAA,MAAM,KAAK,GAAQ;AACjB,QAAA,GAAG,EAAE,EAAE;QACP,EAAE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,GAAG;YACnC,KAAK,EAAE,YAAY,GAAG,GAAG,GAAG,MAAM;YAClC,CAAC,YAAY,GAAG,KAAK,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,CAAC,GAAG;YACzE,MAAM,EAAE,CAAC,CAAC;AACX,SAAA;KACF,CAAA;AACD,IAAA,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CA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AAA;SACtB;AACH,KAAC,CAAA;AACD,IAAA,MAAM,YAAY,GAAG,MAAM,KAAK,YAAY,CAAA;AAC5C,IAAA,MAAM,KAAK,GAAG,SAAS,KAAK,KAAK,CAAA;AAEjC,IAAA,OAAO,KAAK,CAAC,aAAa,CAAM,gBAAiB,kBAC/C,GAAG;QACH,EAAE;QACF,SAAS;AACT,QAAA,KAAK,EACL,OAAO,EAAE,CAAC,YAAY,EACtB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EAAA,EACnB,IAAI,CACN,EAAA;AACD,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK;YAC1D,YAAY;YACZ,KAAK;YACL,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,SAAS;SACxB,CAAC;QACF,QAAQ;AACR,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;YAC7D,YAAY;YACZ,KAAK;YACL,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,YAAY;SAC3B,CAAC;AACH,KAAA,CAAC,CAAA;AACJ,CAAC;;;;"}
|
|
@@ -2,9 +2,9 @@ interface IHorizontal {
|
|
|
2
2
|
direction?: string;
|
|
3
3
|
layout?: string;
|
|
4
4
|
}
|
|
5
|
-
declare function isHorizontalFunc({ direction, layout }: IHorizontal): boolean;
|
|
5
|
+
export declare function isHorizontalFunc({ direction, layout }: IHorizontal): boolean;
|
|
6
6
|
interface IRrl {
|
|
7
7
|
direction?: string;
|
|
8
8
|
}
|
|
9
|
-
declare function isRtlFunc({ direction }: IRrl): boolean;
|
|
10
|
-
export {
|
|
9
|
+
export declare function isRtlFunc({ direction }: IRrl): boolean;
|
|
10
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ElementAttrs, TransformReact2VueType
|
|
2
|
-
import { App } from 'vue';
|
|
3
|
-
import { VirtualListProps } from
|
|
4
|
-
type VueVirtualListProps = Omit<VirtualListProps, 'renderTop' | 'renderBottom'>;
|
|
1
|
+
import type { ElementAttrs, TransformReact2VueType } from '@tarojs/components/types/index.vue3';
|
|
2
|
+
import type { App } from 'vue';
|
|
3
|
+
import type { VirtualListProps } from '../';
|
|
4
|
+
export type VueVirtualListProps = Omit<VirtualListProps, 'renderTop' | 'renderBottom'>;
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
7
|
interface IntrinsicElements {
|
|
@@ -9,9 +9,9 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
declare const VirtualList:
|
|
12
|
+
export declare const VirtualList: DefineComponent<TransformReact2VueType<P>>;
|
|
13
13
|
declare function install(Vue: App): void;
|
|
14
14
|
declare const _default: {
|
|
15
15
|
install: typeof install;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Preset from
|
|
1
|
+
import Preset from '../preset';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
id: StringConstructor;
|
|
4
4
|
height: {
|
|
@@ -25,6 +25,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
25
25
|
type: (NumberConstructor | FunctionConstructor)[];
|
|
26
26
|
required: true;
|
|
27
27
|
};
|
|
28
|
+
queryPrefix: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
28
32
|
unlimitedSize: {
|
|
29
33
|
type: BooleanConstructor;
|
|
30
34
|
default: boolean;
|
|
@@ -84,7 +88,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
88
|
onScrollNative: FunctionConstructor;
|
|
85
89
|
onItemsRendered: FunctionConstructor;
|
|
86
90
|
}, unknown, {
|
|
87
|
-
itemList: import("../list-set
|
|
91
|
+
itemList: import("../list-set").default;
|
|
88
92
|
preset: Preset;
|
|
89
93
|
instance: import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
90
94
|
id: StringConstructor;
|
|
@@ -112,6 +116,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
116
|
type: (NumberConstructor | FunctionConstructor)[];
|
|
113
117
|
required: true;
|
|
114
118
|
};
|
|
119
|
+
queryPrefix: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
115
123
|
unlimitedSize: {
|
|
116
124
|
type: BooleanConstructor;
|
|
117
125
|
default: boolean;
|
|
@@ -196,6 +204,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
196
204
|
type: (NumberConstructor | FunctionConstructor)[];
|
|
197
205
|
required: true;
|
|
198
206
|
};
|
|
207
|
+
queryPrefix: {
|
|
208
|
+
type: StringConstructor;
|
|
209
|
+
default: string;
|
|
210
|
+
};
|
|
199
211
|
unlimitedSize: {
|
|
200
212
|
type: BooleanConstructor;
|
|
201
213
|
default: boolean;
|
|
@@ -287,6 +299,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
287
299
|
type: (NumberConstructor | FunctionConstructor)[];
|
|
288
300
|
required: true;
|
|
289
301
|
};
|
|
302
|
+
queryPrefix: {
|
|
303
|
+
type: StringConstructor;
|
|
304
|
+
default: string;
|
|
305
|
+
};
|
|
290
306
|
unlimitedSize: {
|
|
291
307
|
type: BooleanConstructor;
|
|
292
308
|
default: boolean;
|
|
@@ -401,6 +417,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
401
417
|
type: (NumberConstructor | FunctionConstructor)[];
|
|
402
418
|
required: true;
|
|
403
419
|
};
|
|
420
|
+
queryPrefix: {
|
|
421
|
+
type: StringConstructor;
|
|
422
|
+
default: string;
|
|
423
|
+
};
|
|
404
424
|
unlimitedSize: {
|
|
405
425
|
type: BooleanConstructor;
|
|
406
426
|
default: boolean;
|
|
@@ -471,6 +491,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
471
491
|
innerElementType: string;
|
|
472
492
|
itemElementType: string;
|
|
473
493
|
direction: string;
|
|
494
|
+
queryPrefix: string;
|
|
474
495
|
shouldResetStyleCacheOnItemSizeChange: boolean;
|
|
475
496
|
}>;
|
|
476
|
-
export
|
|
497
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isNumber } from '@tarojs/shared';
|
|
2
2
|
import memoizeOne from 'memoize-one';
|
|
3
3
|
import { defineComponent } from 'vue';
|
|
4
4
|
import '../../../utils/index.js';
|
|
@@ -12,7 +12,6 @@ import { defaultItemKey } from '../../../utils/helper.js';
|
|
|
12
12
|
import { convertNumber2PX } from '../../../utils/convert.js';
|
|
13
13
|
import { omit } from '../../../utils/lodash.js';
|
|
14
14
|
|
|
15
|
-
const isWeb = isWebPlatform();
|
|
16
15
|
var List = defineComponent({
|
|
17
16
|
props: {
|
|
18
17
|
id: String,
|
|
@@ -40,6 +39,10 @@ var List = defineComponent({
|
|
|
40
39
|
type: [Number, Function],
|
|
41
40
|
required: true
|
|
42
41
|
},
|
|
42
|
+
queryPrefix: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
43
46
|
unlimitedSize: {
|
|
44
47
|
type: Boolean,
|
|
45
48
|
default: false
|
|
@@ -81,15 +84,15 @@ var List = defineComponent({
|
|
|
81
84
|
},
|
|
82
85
|
outerElementType: {
|
|
83
86
|
type: String,
|
|
84
|
-
default:
|
|
87
|
+
default: process.env.TARO_PLATFORM === 'web' ? 'taro-scroll-view-core' : 'scroll-view'
|
|
85
88
|
},
|
|
86
89
|
innerElementType: {
|
|
87
90
|
type: String,
|
|
88
|
-
default:
|
|
91
|
+
default: process.env.TARO_PLATFORM === 'web' ? 'taro-view-core' : 'view'
|
|
89
92
|
},
|
|
90
93
|
itemElementType: {
|
|
91
94
|
type: String,
|
|
92
|
-
default:
|
|
95
|
+
default: process.env.TARO_PLATFORM === 'web' ? 'taro-view-core' : 'view'
|
|
93
96
|
},
|
|
94
97
|
outerTagName: String,
|
|
95
98
|
innerTagName: String,
|
|
@@ -137,7 +140,7 @@ var List = defineComponent({
|
|
|
137
140
|
else {
|
|
138
141
|
option.top = scrollOffset;
|
|
139
142
|
}
|
|
140
|
-
return getScrollViewContextNode(
|
|
143
|
+
return getScrollViewContextNode(`${this.$props.queryPrefix}#${this.preset.id}`).then((node) => node.scrollTo(option));
|
|
141
144
|
}
|
|
142
145
|
this.scrollDirection = this.scrollOffset < scrollOffset ? 'forward' : 'backward';
|
|
143
146
|
this.scrollOffset = scrollOffset;
|
|
@@ -190,7 +193,7 @@ var List = defineComponent({
|
|
|
190
193
|
return new Promise((resolve) => {
|
|
191
194
|
if (index >= 0 && index < this.$props.itemCount) {
|
|
192
195
|
const times = this.itemList.compareSize(index) ? 0 : 2;
|
|
193
|
-
getRectSizeSync(
|
|
196
|
+
getRectSizeSync(`${this.$props.queryPrefix}#${this.preset.id}-${index}`, 100, times).then(({ width, height }) => {
|
|
194
197
|
const size = isHorizontal ? width : height;
|
|
195
198
|
if (typeof size === 'number' && size > 0 && !this.itemList.compareSize(index, size)) {
|
|
196
199
|
this.itemList.setSize(index, size);
|
|
@@ -205,6 +208,8 @@ var List = defineComponent({
|
|
|
205
208
|
},
|
|
206
209
|
_onScrollHorizontal(event) {
|
|
207
210
|
const { scrollHeight, scrollWidth = this.itemList.getOffsetSizeCache(), scrollTop, scrollLeft, } = event.currentTarget;
|
|
211
|
+
if (!isNumber(scrollHeight) || !isNumber(scrollWidth))
|
|
212
|
+
return;
|
|
208
213
|
const clientWidth = this.itemList.wrapperSize;
|
|
209
214
|
this.preset.field = {
|
|
210
215
|
scrollHeight,
|
|
@@ -249,6 +254,8 @@ var List = defineComponent({
|
|
|
249
254
|
},
|
|
250
255
|
_onScrollVertical(event) {
|
|
251
256
|
const { scrollHeight = this.itemList.getOffsetSizeCache(), scrollWidth, scrollTop, scrollLeft, } = event.currentTarget;
|
|
257
|
+
if (!isNumber(scrollHeight) || !isNumber(scrollWidth))
|
|
258
|
+
return;
|
|
252
259
|
const clientHeight = this.itemList.wrapperSize;
|
|
253
260
|
if (this.$props.onScrollNative) {
|
|
254
261
|
this.$props.onScrollNative(event);
|
|
@@ -487,9 +494,9 @@ var List = defineComponent({
|
|
|
487
494
|
}
|
|
488
495
|
return render(this.preset.outerElement, outerElementProps, [
|
|
489
496
|
this.getRenderExpandNodes(isHorizontal ? isRtl ? 'right' : 'left' : 'top'),
|
|
490
|
-
|
|
497
|
+
(_b = (_a = this.$slots).top) === null || _b === void 0 ? void 0 : _b.call(_a),
|
|
491
498
|
this.getRenderColumnNode(),
|
|
492
|
-
|
|
499
|
+
(_d = (_c = this.$slots).bottom) === null || _d === void 0 ? void 0 : _d.call(_c),
|
|
493
500
|
this.getRenderExpandNodes(isHorizontal ? isRtl ? 'left' : 'right' : 'bottom'),
|
|
494
501
|
]);
|
|
495
502
|
}
|