@tarojs/components-advanced 4.1.4-beta.2 → 4.1.4-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/components/virtual-list/dom-helpers.js.map +1 -1
  2. package/dist/components/virtual-list/index.d.ts +5 -5
  3. package/dist/components/virtual-list/index.js.map +1 -1
  4. package/dist/components/virtual-list/list-set.js.map +1 -1
  5. package/dist/components/virtual-list/preset.js.map +1 -1
  6. package/dist/components/virtual-list/react/index.js.map +1 -1
  7. package/dist/components/virtual-list/react/list.js.map +1 -1
  8. package/dist/components/virtual-list/react/validate.js.map +1 -1
  9. package/dist/components/virtual-list/react/wrapper.js.map +1 -1
  10. package/dist/components/virtual-list/utils.js.map +1 -1
  11. package/dist/components/virtual-list/vue/list.js.map +1 -1
  12. package/dist/components/virtual-waterfall/index.js.map +1 -1
  13. package/dist/components/virtual-waterfall/list-map.js.map +1 -1
  14. package/dist/components/virtual-waterfall/preset.js.map +1 -1
  15. package/dist/components/virtual-waterfall/react/index.js.map +1 -1
  16. package/dist/components/virtual-waterfall/react/waterfall.js.map +1 -1
  17. package/dist/components/virtual-waterfall/react/wrapper.js.map +1 -1
  18. package/dist/components/virtual-waterfall/vue/waterfall.js.map +1 -1
  19. package/dist/components/water-flow/flow-item.js.map +1 -1
  20. package/dist/components/water-flow/flow-section.js +2 -2
  21. package/dist/components/water-flow/flow-section.js.map +1 -1
  22. package/dist/components/water-flow/node.js.map +1 -1
  23. package/dist/components/water-flow/root.d.ts +1 -1
  24. package/dist/components/water-flow/root.js +11 -23
  25. package/dist/components/water-flow/root.js.map +1 -1
  26. package/dist/components/water-flow/section.d.ts +2 -0
  27. package/dist/components/water-flow/section.js +28 -21
  28. package/dist/components/water-flow/section.js.map +1 -1
  29. package/dist/components/water-flow/stateful-event-bus.js.map +1 -1
  30. package/dist/components/water-flow/use-observed-attr.js.map +1 -1
  31. package/dist/components/water-flow/utils.js.map +1 -1
  32. package/dist/components/water-flow/water-flow.js +22 -9
  33. package/dist/components/water-flow/water-flow.js.map +1 -1
  34. package/dist/utils/dom.js.map +1 -1
  35. package/dist/utils/math.js.map +1 -1
  36. package/dist/utils/vue-render.js.map +1 -1
  37. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"dom-helpers.js","sources":["../../../src/components/virtual-list/dom-helpers.ts"],"sourcesContent":["// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).\n// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.\n// The safest way to check this is to intentionally set a negative offset,\n// and then verify that the subsequent \"scroll\" event matches the negative offset.\n// If it does not match, then we can assume a non-standard RTL scroll implementation.\n\nlet cachedRTLResult = null\n\nexport function getRTLOffsetType (recalculate = false) {\n if (cachedRTLResult === null || recalculate) {\n const outerDiv = document.createElement('div')\n const outerStyle = outerDiv.style\n outerStyle.width = '50px'\n outerStyle.height = '50px'\n outerStyle.overflow = 'scroll'\n outerStyle.direction = 'rtl'\n const innerDiv = document.createElement('div')\n const innerStyle = innerDiv.style\n innerStyle.width = '100px'\n innerStyle.height = '100px'\n outerDiv.appendChild(innerDiv)\n document.body.appendChild(outerDiv)\n\n if (outerDiv.scrollLeft > 0) {\n cachedRTLResult = 'positive-descending'\n } else {\n outerDiv.scrollLeft = 1\n\n if (outerDiv.scrollLeft === 0) {\n cachedRTLResult = 'negative'\n } else {\n cachedRTLResult = 'positive-ascending'\n }\n }\n\n document.body.removeChild(outerDiv)\n return cachedRTLResult\n }\n\n return cachedRTLResult\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,eAAe,GAAG,IAAI;AAEpB,SAAU,gBAAgB,CAAE,WAAW,GAAG,KAAK,EAAA;AACnD,IAAA,IAAI,eAAe,KAAK,IAAI,IAAI,WAAW,EAAE;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK;AACjC,QAAA,UAAU,CAAC,KAAK,GAAG,MAAM;AACzB,QAAA,UAAU,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAA,UAAU,CAAC,QAAQ,GAAG,QAAQ;AAC9B,QAAA,UAAU,CAAC,SAAS,GAAG,KAAK;QAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK;AACjC,QAAA,UAAU,CAAC,KAAK,GAAG,OAAO;AAC1B,QAAA,UAAU,CAAC,MAAM,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC;AAC9B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;AAEnC,QAAA,IAAI,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE;YAC3B,eAAe,GAAG,qBAAqB;;aAClC;AACL,YAAA,QAAQ,CAAC,UAAU,GAAG,CAAC;AAEvB,YAAA,IAAI,QAAQ,CAAC,UAAU,KAAK,CAAC,EAAE;gBAC7B,eAAe,GAAG,UAAU;;iBACvB;gBACL,eAAe,GAAG,oBAAoB;;;AAI1C,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;AACnC,QAAA,OAAO,eAAe;;AAGxB,IAAA,OAAO,eAAe;AACxB;;;;"}
1
+ {"version":3,"file":"dom-helpers.js","sources":["../../../src/components/virtual-list/dom-helpers.ts"],"sourcesContent":["// TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.\n// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).\n// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.\n// The safest way to check this is to intentionally set a negative offset,\n// and then verify that the subsequent \"scroll\" event matches the negative offset.\n// If it does not match, then we can assume a non-standard RTL scroll implementation.\n\nlet cachedRTLResult = null\n\nexport function getRTLOffsetType (recalculate = false) {\n if (cachedRTLResult === null || recalculate) {\n const outerDiv = document.createElement('div')\n const outerStyle = outerDiv.style\n outerStyle.width = '50px'\n outerStyle.height = '50px'\n outerStyle.overflow = 'scroll'\n outerStyle.direction = 'rtl'\n const innerDiv = document.createElement('div')\n const innerStyle = innerDiv.style\n innerStyle.width = '100px'\n innerStyle.height = '100px'\n outerDiv.appendChild(innerDiv)\n document.body.appendChild(outerDiv)\n\n if (outerDiv.scrollLeft > 0) {\n cachedRTLResult = 'positive-descending'\n } else {\n outerDiv.scrollLeft = 1\n\n if (outerDiv.scrollLeft === 0) {\n cachedRTLResult = 'negative'\n } else {\n cachedRTLResult = 'positive-ascending'\n }\n }\n\n document.body.removeChild(outerDiv)\n return cachedRTLResult\n }\n\n return cachedRTLResult\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,eAAe,GAAG,IAAI;AAEV,SAAA,gBAAgB,CAAE,WAAW,GAAG,KAAK,EAAA;AACnD,IAAA,IAAI,eAAe,KAAK,IAAI,IAAI,WAAW,EAAE;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK;AACjC,QAAA,UAAU,CAAC,KAAK,GAAG,MAAM;AACzB,QAAA,UAAU,CAAC,MAAM,GAAG,MAAM;AAC1B,QAAA,UAAU,CAAC,QAAQ,GAAG,QAAQ;AAC9B,QAAA,UAAU,CAAC,SAAS,GAAG,KAAK;QAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9C,QAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK;AACjC,QAAA,UAAU,CAAC,KAAK,GAAG,OAAO;AAC1B,QAAA,UAAU,CAAC,MAAM,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC;AAC9B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;AAEnC,QAAA,IAAI,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE;YAC3B,eAAe,GAAG,qBAAqB;;aAClC;AACL,YAAA,QAAQ,CAAC,UAAU,GAAG,CAAC;AAEvB,YAAA,IAAI,QAAQ,CAAC,UAAU,KAAK,CAAC,EAAE;gBAC7B,eAAe,GAAG,UAAU;;iBACvB;gBACL,eAAe,GAAG,oBAAoB;;;AAI1C,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;AACnC,QAAA,OAAO,eAAe;;AAGxB,IAAA,OAAO,eAAe;AACxB;;;;"}
@@ -27,7 +27,7 @@ interface VirtualListProps<T = any> extends Omit<StandardProps, 'children'> {
27
27
  * > - 非 unlimitedSize 模式下如果传入函数,为避免性能问题,每个节点只会调用一次用于设置初始值
28
28
  */
29
29
  itemSize: number | ((index?: number, itemData?: T[]) => number);
30
- /** 解开高度列表单项大小限制,默认值使用: itemSize。
30
+ /** 解开高度列表单项大小限制,默认值使用:itemSize。
31
31
  *
32
32
  * > Note: 通过 itemSize 设置的初始高度与子节点实际高度差异过大会导致隐患,建议将单页大小设置接近于现实高度,在该模式下可以提升用户体验。
33
33
  * @default false
@@ -55,7 +55,7 @@ interface VirtualListProps<T = any> extends Omit<StandardProps, 'children'> {
55
55
  * @default 50
56
56
  */
57
57
  lowerThreshold?: number;
58
- /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder 时比较有用。 */
58
+ /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder)时比较有用。 */
59
59
  useIsScrolling?: boolean;
60
60
  /** 通过 ScrollViewContext 优化组件滚动性能
61
61
  * @default false
@@ -103,7 +103,7 @@ declare namespace VirtualListProps {
103
103
  diffOffset: number;
104
104
  }
105
105
  interface IVirtualListEvent<T extends ScrollViewProps.onScrollDetail = ScrollViewProps.onScrollDetail> extends BaseEventOrig {
106
- /** 滚动方向,可能值为 forward 往前, backward 往后。 */
106
+ /** 滚动方向,可能值为 forward 往前,backward 往后。 */
107
107
  scrollDirection: 'forward' | 'backward';
108
108
  /** 滚动距离 */
109
109
  scrollOffset: number;
@@ -118,7 +118,7 @@ declare namespace VirtualListProps {
118
118
  * @supported weapp, swan, alipay, tt, qq, jd, h5
119
119
  * @example_react
120
120
  * ```tsx
121
- * import VirtualList from `@tarojs/components/virtual-list`
121
+ * import { VirtualList } from `@tarojs/components-advanced`
122
122
  *
123
123
  * function buildData (offset = 0) {
124
124
  * return Array(100).fill(0).map((_, i) => i + offset);
@@ -157,7 +157,7 @@ declare namespace VirtualListProps {
157
157
  * ```js
158
158
  * // app.js 入口文件
159
159
  * import Vue from 'vue'
160
- * import VirtualList from '@tarojs/components/virtual-list'
160
+ * import { VirtualList } from '@tarojs/components-advanced'
161
161
  *
162
162
  * Vue.use(VirtualList)
163
163
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/virtual-list/index.ts"],"sourcesContent":["import type { BaseEventOrig, BaseEventOrigFunction, ScrollViewProps, StandardProps } from '@tarojs/components'\nimport type { Component, ComponentType, CSSProperties, ReactNode } from 'react'\n\ninterface VirtualListProps<T = any> extends Omit<StandardProps, 'children'> {\n /** 列表的高度。 */\n height: string | number\n /** 列表的宽度。 */\n width: string | number\n /** 子组件 */\n item: ComponentType<{\n /** 组件 ID */\n id: string\n /** 组件渲染的数据 */\n data: T[]\n /** 组件渲染数据的索引 */\n index: number\n /** 组件是否正在滚动,当 useIsScrolling 值为 true 时返回布尔值,否则返回 undefined */\n isScrolling?: boolean\n }>\n /** 列表的长度 */\n itemCount: number\n /** 渲染数据 */\n itemData: T[]\n /** 列表单项的大小,垂直滚动时为高度,水平滚动时为宽度。\n *\n * > Note:\n * > - unlimitedSize 模式下如果传入函数,只会调用一次用于设置初始值\n * > - 非 unlimitedSize 模式下如果传入函数,为避免性能问题,每个节点只会调用一次用于设置初始值\n */\n itemSize: number | ((index?: number, itemData?: T[]) => number)\n /** 解开高度列表单项大小限制,默认值使用: itemSize。\n *\n * > Note: 通过 itemSize 设置的初始高度与子节点实际高度差异过大会导致隐患,建议将单页大小设置接近于现实高度,在该模式下可以提升用户体验。\n * @default false\n */\n unlimitedSize?: boolean\n /** 布局方式\n * @default \"absolute\"\n */\n position?: 'absolute' | 'relative' | 'brick'\n /** 滚动方向。vertical 为垂直滚动,horizontal 为平行滚动。\n * @default \"vertical\"\n */\n layout?: 'vertical' | 'horizontal'\n /** 初始滚动偏移值,水平滚动影响 scrollLeft,垂直滚动影响 scrollTop。 */\n initialScrollOffset?: number\n /** 在可视区域之外渲染的列表单项数量,值设置得越高,快速滚动时出现白屏的概率就越小,相应地,每次滚动的性能会变得越差。 */\n overscanCount?: number\n /** 上下滚动预占位节点 */\n placeholderCount?: number\n /** 触顶事件触发时距页面顶部距离\n * @default 50\n */\n upperThreshold?: number\n /** 触底事件触发时距页面底部距离\n * @default 50\n */\n lowerThreshold?: number\n /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder 时比较有用。 */\n useIsScrolling?: boolean\n /** 通过 ScrollViewContext 优化组件滚动性能\n * @default false\n * @note 部分平台不支持,使用时请注意甄别\n */\n enhanced?: boolean\n /** 列表外部容器组件类型。\n * @default ScrollView\n */\n outerElementType?: ComponentType | string\n /** 列表内部容器组件类型。\n * @default View\n */\n innerElementType?: ComponentType | string\n /** 列表子节点容器组件类型。\n * @default View\n */\n itemElementType?: ComponentType | string\n /** 顶部区域 */\n renderTop?: ReactNode\n /** 底部区域 */\n renderBottom?: ReactNode\n /** 列表滚动时调用函数 */\n onScroll?: (event: VirtualListProps.IVirtualListEvent<VirtualListProps.IVirtualListEventDetail>) => void\n /** 调用平台原生的滚动监听函数。 */\n onScrollNative?: BaseEventOrigFunction<ScrollViewProps.onScrollDetail>\n /** 触顶事件 */\n onScrollToUpper?: () => void\n /** 触底事件 */\n onScrollToLower?: () => void\n style?: CSSProperties\n /** 这是一个 fix 类型的参数,针对于各端小程序,在层级太深的情况下会生成 Taro 的自定义组件,导致一般的选择器字符会查询不到对应的元素,需要加上类似 #container >>> 的查询前缀\n * @default ''\n */\n queryPrefix?: string\n}\n\ndeclare namespace VirtualListProps {\n interface IVirtualListEventDetail extends ScrollViewProps.onScrollDetail {\n scrollLeft: number\n scrollTop: number\n scrollHeight: number\n scrollWidth: number\n clientHeight: number\n clientWidth: number\n diffOffset: number\n }\n\n interface IVirtualListEvent<T extends ScrollViewProps.onScrollDetail = ScrollViewProps.onScrollDetail> extends BaseEventOrig {\n /** 滚动方向,可能值为 forward 往前, backward 往后。 */\n scrollDirection: 'forward' | 'backward'\n /** 滚动距离 */\n scrollOffset: number\n /** 当滚动是由 scrollTo() 或 scrollToItem() 调用时返回 true,否则返回 false */\n scrollUpdateWasRequested: boolean\n /** 滚动信息 */\n detail: T\n }\n}\n\n/** 虚拟列表\n * @classification viewContainer\n * @supported weapp, swan, alipay, tt, qq, jd, h5\n * @example_react\n * ```tsx\n * import VirtualList from `@tarojs/components/virtual-list`\n *\n * function buildData (offset = 0) {\n * return Array(100).fill(0).map((_, i) => i + offset);\n * }\n *\n * const Row = React.memo(({ id, index, data }) => {\n * return (\n * <View id={id} className={index % 2 ? 'ListItemOdd' : 'ListItemEven'}>\n * Row {index}\n * </View>\n * );\n * })\n *\n * export default class Index extends Component {\n * state = {\n * data: buildData(0),\n * }\n *\n * render() {\n * const { data } = this.state\n * const dataLen = data.length\n * return (\n * <VirtualList\n * height={500} // 列表的高度\n * width='100%' // 列表的宽度\n * item={Row} // 列表单项组件,这里只能传入一个组件\n * itemData={data} // 渲染列表的数据\n * itemCount={dataLen} // 渲染列表的长度\n * itemSize={100} // 列表单项的高度\n * />\n * );\n * }\n * }\n * ```\n * @example_vue\n * ```js\n * // app.js 入口文件\n * import Vue from 'vue'\n * import VirtualList from '@tarojs/components/virtual-list'\n *\n * Vue.use(VirtualList)\n * ```\n * ```js\n * <! –– row.vue 单项组件 ––>\n * <template>\n * <view\n * :class=\"index % 2 ? 'ListItemOdd' : 'ListItemEven'\"\n * >\n * Row {{ index }} : {{ data[index] }}\n * </view>\n * </template>\n *\n * <script>\n * export default {\n * props: ['index', 'data']\n * }\n * </script>\n * ```\n * ```js\n * <! –– page.vue 页面组件 ––>\n * <template>\n * <virtual-list\n * :height=\"500\"\n * :item-data=\"list\"\n * :item-count=\"list.length\"\n * :item-size=\"100\"\n * :item=\"Row\"\n * width=\"100%\"\n * />\n * </template>\n *\n * <script>\n * import Row from './row.vue'\n * import { markRaw } from 'vue'\n *\n * function buildData (offset = 0) {\n * return Array(100).fill(0).map((_, i) => i + offset)\n * }\n *\n * export default {\n * data() {\n * return {\n * Row: markRaw(Row),\n * list: buildData(0)\n * }\n * },\n * }\n * </script>\n * ```\n * @see https://taro-docs.jd.com/docs/virtual-list\n */\ndeclare class VirtualListComponent extends Component<VirtualListProps> {\n /**\n * 滚动到指定的地点。\n */\n public scrollTo(scrollOffset: number, enhanced?: boolean): void\n\n /** 滚动到指定的条目。\n * @param index 指定条目的索引。\n * @param align 滚动到指定条目时,指定条目的位置。默认值为 auto。\n *\n * - start:指定条目在可视区域的顶部。\n * - end:指定条目在可视区域的底部。\n * - center:指定条目在可视区域的中间。\n * - auto:尽可能滚动距离最小保证条目在可视区域中,如果已经在可视区域,就不滚动。\n * - smart:条目如果已经在可视区域,就不滚动;如果有部分在可视区域,尽可能滚动距离最小保证条目在可视区域中;如果条目完全不在可视区域,那就滚动到条目在可视区域居中显示。\n */\n public scrollToItem(index: number, align: 'start' | 'end' | 'center' | 'auto' | 'smart', enhanced?: boolean): void\n}\n\ndeclare type VirtualList = VirtualListComponent\nconst VirtualList: typeof VirtualListComponent = (process.env.FRAMEWORK === 'vue' || process.env.FRAMEWORK === 'vue3')\n ? require('./vue').default\n : require('./react').default\n\nexport { VirtualList, VirtualListProps }\nexport default VirtualList\n"],"names":[],"mappings":"AA4OA,MAAM,WAAW,GAAgC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM;AACnH,MAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,MAAE,OAAO,CAAC,SAAS,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/virtual-list/index.ts"],"sourcesContent":["import type { BaseEventOrig, BaseEventOrigFunction, ScrollViewProps, StandardProps } from '@tarojs/components'\nimport type { Component, ComponentType, CSSProperties, ReactNode } from 'react'\n\ninterface VirtualListProps<T = any> extends Omit<StandardProps, 'children'> {\n /** 列表的高度。 */\n height: string | number\n /** 列表的宽度。 */\n width: string | number\n /** 子组件 */\n item: ComponentType<{\n /** 组件 ID */\n id: string\n /** 组件渲染的数据 */\n data: T[]\n /** 组件渲染数据的索引 */\n index: number\n /** 组件是否正在滚动,当 useIsScrolling 值为 true 时返回布尔值,否则返回 undefined */\n isScrolling?: boolean\n }>\n /** 列表的长度 */\n itemCount: number\n /** 渲染数据 */\n itemData: T[]\n /** 列表单项的大小,垂直滚动时为高度,水平滚动时为宽度。\n *\n * > Note:\n * > - unlimitedSize 模式下如果传入函数,只会调用一次用于设置初始值\n * > - 非 unlimitedSize 模式下如果传入函数,为避免性能问题,每个节点只会调用一次用于设置初始值\n */\n itemSize: number | ((index?: number, itemData?: T[]) => number)\n /** 解开高度列表单项大小限制,默认值使用:itemSize。\n *\n * > Note: 通过 itemSize 设置的初始高度与子节点实际高度差异过大会导致隐患,建议将单页大小设置接近于现实高度,在该模式下可以提升用户体验。\n * @default false\n */\n unlimitedSize?: boolean\n /** 布局方式\n * @default \"absolute\"\n */\n position?: 'absolute' | 'relative' | 'brick'\n /** 滚动方向。vertical 为垂直滚动,horizontal 为平行滚动。\n * @default \"vertical\"\n */\n layout?: 'vertical' | 'horizontal'\n /** 初始滚动偏移值,水平滚动影响 scrollLeft,垂直滚动影响 scrollTop。 */\n initialScrollOffset?: number\n /** 在可视区域之外渲染的列表单项数量,值设置得越高,快速滚动时出现白屏的概率就越小,相应地,每次滚动的性能会变得越差。 */\n overscanCount?: number\n /** 上下滚动预占位节点 */\n placeholderCount?: number\n /** 触顶事件触发时距页面顶部距离\n * @default 50\n */\n upperThreshold?: number\n /** 触底事件触发时距页面底部距离\n * @default 50\n */\n lowerThreshold?: number\n /** 是否注入 isScrolling 属性到 item 组件。这个参数一般用于实现滚动骨架屏(或其它 placeholder)时比较有用。 */\n useIsScrolling?: boolean\n /** 通过 ScrollViewContext 优化组件滚动性能\n * @default false\n * @note 部分平台不支持,使用时请注意甄别\n */\n enhanced?: boolean\n /** 列表外部容器组件类型。\n * @default ScrollView\n */\n outerElementType?: ComponentType | string\n /** 列表内部容器组件类型。\n * @default View\n */\n innerElementType?: ComponentType | string\n /** 列表子节点容器组件类型。\n * @default View\n */\n itemElementType?: ComponentType | string\n /** 顶部区域 */\n renderTop?: ReactNode\n /** 底部区域 */\n renderBottom?: ReactNode\n /** 列表滚动时调用函数 */\n onScroll?: (event: VirtualListProps.IVirtualListEvent<VirtualListProps.IVirtualListEventDetail>) => void\n /** 调用平台原生的滚动监听函数。 */\n onScrollNative?: BaseEventOrigFunction<ScrollViewProps.onScrollDetail>\n /** 触顶事件 */\n onScrollToUpper?: () => void\n /** 触底事件 */\n onScrollToLower?: () => void\n style?: CSSProperties\n /** 这是一个 fix 类型的参数,针对于各端小程序,在层级太深的情况下会生成 Taro 的自定义组件,导致一般的选择器字符会查询不到对应的元素,需要加上类似 #container >>> 的查询前缀\n * @default ''\n */\n queryPrefix?: string\n}\n\ndeclare namespace VirtualListProps {\n interface IVirtualListEventDetail extends ScrollViewProps.onScrollDetail {\n scrollLeft: number\n scrollTop: number\n scrollHeight: number\n scrollWidth: number\n clientHeight: number\n clientWidth: number\n diffOffset: number\n }\n\n interface IVirtualListEvent<T extends ScrollViewProps.onScrollDetail = ScrollViewProps.onScrollDetail> extends BaseEventOrig {\n /** 滚动方向,可能值为 forward 往前,backward 往后。 */\n scrollDirection: 'forward' | 'backward'\n /** 滚动距离 */\n scrollOffset: number\n /** 当滚动是由 scrollTo() 或 scrollToItem() 调用时返回 true,否则返回 false */\n scrollUpdateWasRequested: boolean\n /** 滚动信息 */\n detail: T\n }\n}\n\n/** 虚拟列表\n * @classification viewContainer\n * @supported weapp, swan, alipay, tt, qq, jd, h5\n * @example_react\n * ```tsx\n * import { VirtualList } from `@tarojs/components-advanced`\n *\n * function buildData (offset = 0) {\n * return Array(100).fill(0).map((_, i) => i + offset);\n * }\n *\n * const Row = React.memo(({ id, index, data }) => {\n * return (\n * <View id={id} className={index % 2 ? 'ListItemOdd' : 'ListItemEven'}>\n * Row {index}\n * </View>\n * );\n * })\n *\n * export default class Index extends Component {\n * state = {\n * data: buildData(0),\n * }\n *\n * render() {\n * const { data } = this.state\n * const dataLen = data.length\n * return (\n * <VirtualList\n * height={500} // 列表的高度\n * width='100%' // 列表的宽度\n * item={Row} // 列表单项组件,这里只能传入一个组件\n * itemData={data} // 渲染列表的数据\n * itemCount={dataLen} // 渲染列表的长度\n * itemSize={100} // 列表单项的高度\n * />\n * );\n * }\n * }\n * ```\n * @example_vue\n * ```js\n * // app.js 入口文件\n * import Vue from 'vue'\n * import { VirtualList } from '@tarojs/components-advanced'\n *\n * Vue.use(VirtualList)\n * ```\n * ```js\n * <! –– row.vue 单项组件 ––>\n * <template>\n * <view\n * :class=\"index % 2 ? 'ListItemOdd' : 'ListItemEven'\"\n * >\n * Row {{ index }} : {{ data[index] }}\n * </view>\n * </template>\n *\n * <script>\n * export default {\n * props: ['index', 'data']\n * }\n * </script>\n * ```\n * ```js\n * <! –– page.vue 页面组件 ––>\n * <template>\n * <virtual-list\n * :height=\"500\"\n * :item-data=\"list\"\n * :item-count=\"list.length\"\n * :item-size=\"100\"\n * :item=\"Row\"\n * width=\"100%\"\n * />\n * </template>\n *\n * <script>\n * import Row from './row.vue'\n * import { markRaw } from 'vue'\n *\n * function buildData (offset = 0) {\n * return Array(100).fill(0).map((_, i) => i + offset)\n * }\n *\n * export default {\n * data() {\n * return {\n * Row: markRaw(Row),\n * list: buildData(0)\n * }\n * },\n * }\n * </script>\n * ```\n * @see https://taro-docs.jd.com/docs/virtual-list\n */\n\ndeclare class VirtualListComponent extends Component<VirtualListProps> {\n /**\n * 滚动到指定的地点。\n */\n public scrollTo(scrollOffset: number, enhanced?: boolean): void\n\n /** 滚动到指定的条目。\n * @param index 指定条目的索引。\n * @param align 滚动到指定条目时,指定条目的位置。默认值为 auto。\n *\n * - start:指定条目在可视区域的顶部。\n * - end:指定条目在可视区域的底部。\n * - center:指定条目在可视区域的中间。\n * - auto:尽可能滚动距离最小保证条目在可视区域中,如果已经在可视区域,就不滚动。\n * - smart:条目如果已经在可视区域,就不滚动;如果有部分在可视区域,尽可能滚动距离最小保证条目在可视区域中;如果条目完全不在可视区域,那就滚动到条目在可视区域居中显示。\n */\n public scrollToItem(index: number, align: 'start' | 'end' | 'center' | 'auto' | 'smart', enhanced?: boolean): void\n}\n\ndeclare type VirtualList = VirtualListComponent\nconst VirtualList: typeof VirtualListComponent = (process.env.FRAMEWORK === 'vue' || process.env.FRAMEWORK === 'vue3')\n ? require('./vue').default\n : require('./react').default\n\nexport { VirtualList, VirtualListProps }\nexport default VirtualList\n"],"names":[],"mappings":"AA6OA,MAAM,WAAW,GAAgC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM;AACnH,MAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,MAAE,OAAO,CAAC,SAAS,CAAC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-set.js","sources":["../../../src/components/virtual-list/list-set.ts"],"sourcesContent":["import { isFunction } from '@tarojs/shared'\nimport memoizeOne from 'memoize-one'\n\nimport { getOffsetForIndexAndAlignment } from '../../utils'\nimport { isHorizontalFunc } from './utils'\n\nimport type { IProps } from './preset'\n\ntype TProps = Pick<IProps, 'width' | 'height' | 'unlimitedSize' | 'itemCount' | 'itemData' | 'itemSize' | 'overscanCount' | 'direction' | 'layout'>\n\nexport default class ListSet {\n list: number[] = []\n mode?: 'normal' | 'function' | 'unlimited'\n defaultSize = 1\n\n wrapperHeight = 0\n wrapperWidth = 0\n\n refreshCounter = 0\n\n constructor (protected props: TProps, protected refresh?: TFunc) {\n this.update(props)\n\n // Note: 不考虑列表模式切换情况,可能会导致列表抖动体验过差\n if (this.props.unlimitedSize) {\n this.mode = 'unlimited'\n } else if (isFunction(this.props.itemSize)) {\n this.mode = 'function'\n } else {\n this.mode = 'normal'\n }\n\n this.defaultSize = (isFunction(this.props.itemSize) ? this.props.itemSize() : this.props.itemSize) || 1\n\n if (!this.isNormalMode) {\n this.list = new Array(this.length).fill(-1)\n }\n }\n\n get isNormalMode () {\n return this.mode === 'normal'\n }\n\n get isFunctionMode () {\n return this.mode === 'function'\n }\n\n get isUnlimitedMode () {\n return this.mode === 'unlimited'\n }\n\n get length () {\n return this.props.itemCount || 100\n }\n\n get overscan () {\n return this.props.overscanCount || 0\n }\n\n get wrapperSize () {\n return isHorizontalFunc(this.props) ? this.wrapperWidth : this.wrapperHeight\n }\n\n update (props: TProps) {\n this.props = props\n\n if (this.length > this.list.length) {\n const arr = new Array(this.length - this.list.length).fill(-1)\n this.list.push(...arr)\n } else if (this.length < this.list.length) {\n this.list.length = this.length\n }\n }\n\n setSize (i = 0, size = this.defaultSize) {\n this.list[i] = size\n this.refresh?.()\n this.refreshCounter++\n }\n\n getSize (i = 0) {\n const size = this.props.itemSize\n const item = this.list[i]\n if (item >= 0) return item\n\n if (this.isFunctionMode && isFunction(size)) {\n const itemSize = size(i, this.props.itemData)\n this.setSize(i, itemSize)\n return itemSize\n }\n return this.defaultSize\n }\n\n getOffsetSize (i = this.list.length) {\n if (this.isNormalMode) return i * this.defaultSize\n return this.list.slice(0, i).reduce((sum, _, idx) => sum + this.getSize(idx), 0)\n }\n\n getOffsetSizeCache = memoizeOne((i = this.list.length, _flag = this.refreshCounter) => {\n return this.getOffsetSize(i)\n })\n\n getSizeCount (offset = 0) {\n if (offset === 0) return 0\n // if (this.isNormalMode) {\n // return Math.min(this.length - 1, Math.floor(offset / this.length))\n // }\n let offsetSize = 0\n const count = this.list.reduce((sum, _, idx) => {\n if (offsetSize < offset) {\n offsetSize += this.getSize(idx)\n return ++sum\n }\n return sum\n }, 0)\n return count - 1\n }\n\n getStartIndex (scrollOffset = 0) {\n return Math.max(0, this.getSizeCount(scrollOffset) - 1)\n }\n\n getStopIndex (wrapperSize = 0, scrollOffset = 0, startIndex = 0) {\n // const visibleOffset = this.getOffsetSizeCache(startIndex)\n // if (this.isNormalMode) {\n // const numVisibleItems = Math.ceil((wrapperSize + scrollOffset - visibleOffset) / this.length)\n // /** -1 is because stop index is inclusive */\n // return Math.max(startIndex, Math.min(this.length - 1, startIndex + numVisibleItems - 1))\n // }\n return Math.max(startIndex, Math.min(this.length - 1, this.getSizeCount(wrapperSize + scrollOffset)))\n }\n\n getRangeToRender (direction: 'forward' | 'backward', scrollOffset = 0, block = false) {\n if (this.length === 0) {\n return [0, 0, 0, 0]\n }\n\n const startIndex = this.getStartIndex(scrollOffset)\n const stopIndex = this.getStopIndex(this.wrapperSize, scrollOffset, startIndex)\n\n // Overscan by one item in each direction so that tab/focus works. If there isn't at least one extra item, tab loops back around.\n const overscanBackward = !block || direction === 'backward' ? Math.max(1, this.overscan) : 1\n const overscanForward = !block || direction === 'forward' ? Math.max(1, this.overscan) : 1\n return [\n Math.max(0, startIndex - overscanBackward),\n Math.max(0, Math.min(this.length - 1, stopIndex + overscanForward)),\n startIndex,\n stopIndex\n ]\n }\n\n getOffsetForIndexAndAlignment (index: number, align: string, scrollOffset: number) {\n return getOffsetForIndexAndAlignment({\n align,\n containerSize: this.wrapperSize,\n currentOffset: scrollOffset,\n scrollSize: this.getOffsetSizeCache(this.length),\n slideSize: this.getSize(index),\n targetOffset: this.getOffsetSizeCache(index),\n })\n }\n\n compareSize (i = 0, size = this.defaultSize) {\n if (this.isNormalMode) return true\n return this.getSize(i) === size\n }\n}\n"],"names":[],"mappings":";;;;;;AAUc,MAAO,OAAO,CAAA;IAU1B,WAAA,CAAuB,KAAa,EAAY,OAAe,EAAA;QAAxC,IAAA,CAAA,KAAK,GAAL,KAAK;QAAoB,IAAA,CAAA,OAAO,GAAP,OAAO;QATvD,IAAA,CAAA,IAAI,GAAa,EAAE;QAEnB,IAAA,CAAA,WAAW,GAAG,CAAC;QAEf,IAAA,CAAA,aAAa,GAAG,CAAC;QACjB,IAAA,CAAA,YAAY,GAAG,CAAC;QAEhB,IAAA,CAAA,cAAc,GAAG,CAAC;AAgFlB,QAAA,IAAA,CAAA,kBAAkB,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC,cAAc,KAAI;AACpF,YAAA,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;AAC9B,SAAC,CAAC;AA/EA,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;;AAGlB,QAAA,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE;AAC5B,YAAA,IAAI,CAAC,IAAI,GAAG,WAAW;;aAClB,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;AAC1C,YAAA,IAAI,CAAC,IAAI,GAAG,UAAU;;aACjB;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,QAAQ;;AAGtB,QAAA,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,CAAC;AAEvG,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;AACt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I,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC5F,MAAM,eAAe,GAAG,CAAC,KAAK,IAAI,SAAS,KAAK,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1F,OAAO;YACL,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;AAC1C,YAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;YACnE,UAAU;YACV;SACD;;AAGH,IAAA,6BAA6B,CAAE,KAAa,EAAE,KAAa,EAAE,YAAoB,EAAA;AAC/E,QAAA,OAAO,6BAA6B,CAAC;YACnC,KAAK;YACL,aAAa,EAAE,IAAI,CAAC,WAAW;AAC/B,YAAA,aAAa,EAAE,YAAY;YAC3B,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;AAChD,YAAA,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AAC9B,YAAA,YAAY,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;AAC7C,SAAA,CAAC;;IAGJ,WAAW,CAAE,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAA;QACzC,IAAI,IAAI,CAAC,YAAY;AAAE,YAAA,OAAO,IAAI;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI;;AAElC;;;;"}
1
+ {"version":3,"file":"list-set.js","sources":["../../../src/components/virtual-list/list-set.ts"],"sourcesContent":["import { isFunction } from '@tarojs/shared'\nimport memoizeOne from 'memoize-one'\n\nimport { getOffsetForIndexAndAlignment } from '../../utils'\nimport { isHorizontalFunc } from './utils'\n\nimport type { IProps } from './preset'\n\ntype TProps = Pick<IProps, 'width' | 'height' | 'unlimitedSize' | 'itemCount' | 'itemData' | 'itemSize' | 'overscanCount' | 'direction' | 'layout'>\n\nexport default class ListSet {\n list: number[] = []\n mode?: 'normal' | 'function' | 'unlimited'\n defaultSize = 1\n\n wrapperHeight = 0\n wrapperWidth = 0\n\n refreshCounter = 0\n\n constructor (protected props: TProps, protected refresh?: TFunc) {\n this.update(props)\n\n // Note: 不考虑列表模式切换情况,可能会导致列表抖动体验过差\n if (this.props.unlimitedSize) {\n this.mode = 'unlimited'\n } else if (isFunction(this.props.itemSize)) {\n this.mode = 'function'\n } else {\n this.mode = 'normal'\n }\n\n this.defaultSize = (isFunction(this.props.itemSize) ? this.props.itemSize() : this.props.itemSize) || 1\n\n if (!this.isNormalMode) {\n this.list = new Array(this.length).fill(-1)\n }\n }\n\n get isNormalMode () {\n return this.mode === 'normal'\n }\n\n get isFunctionMode () {\n return this.mode === 'function'\n }\n\n get isUnlimitedMode () {\n return this.mode === 'unlimited'\n }\n\n get length () {\n return this.props.itemCount || 100\n }\n\n get overscan () {\n return this.props.overscanCount || 0\n }\n\n get wrapperSize () {\n return isHorizontalFunc(this.props) ? this.wrapperWidth : this.wrapperHeight\n }\n\n update (props: TProps) {\n this.props = props\n\n if (this.length > this.list.length) {\n const arr = new Array(this.length - this.list.length).fill(-1)\n this.list.push(...arr)\n } else if (this.length < this.list.length) {\n this.list.length = this.length\n }\n }\n\n setSize (i = 0, size = this.defaultSize) {\n this.list[i] = size\n this.refresh?.()\n this.refreshCounter++\n }\n\n getSize (i = 0) {\n const size = this.props.itemSize\n const item = this.list[i]\n if (item >= 0) return item\n\n if (this.isFunctionMode && isFunction(size)) {\n const itemSize = size(i, this.props.itemData)\n this.setSize(i, itemSize)\n return itemSize\n }\n return this.defaultSize\n }\n\n getOffsetSize (i = this.list.length) {\n if (this.isNormalMode) return i * this.defaultSize\n return this.list.slice(0, i).reduce((sum, _, idx) => sum + this.getSize(idx), 0)\n }\n\n getOffsetSizeCache = memoizeOne((i = this.list.length, _flag = this.refreshCounter) => {\n return this.getOffsetSize(i)\n })\n\n getSizeCount (offset = 0) {\n if (offset === 0) return 0\n // if (this.isNormalMode) {\n // return Math.min(this.length - 1, Math.floor(offset / this.length))\n // }\n let offsetSize = 0\n const count = this.list.reduce((sum, _, idx) => {\n if (offsetSize < offset) {\n offsetSize += this.getSize(idx)\n return ++sum\n }\n return sum\n }, 0)\n return count - 1\n }\n\n getStartIndex (scrollOffset = 0) {\n return Math.max(0, this.getSizeCount(scrollOffset) - 1)\n }\n\n getStopIndex (wrapperSize = 0, scrollOffset = 0, startIndex = 0) {\n // const visibleOffset = this.getOffsetSizeCache(startIndex)\n // if (this.isNormalMode) {\n // const numVisibleItems = Math.ceil((wrapperSize + scrollOffset - visibleOffset) / this.length)\n // /** -1 is because stop index is inclusive */\n // return Math.max(startIndex, Math.min(this.length - 1, startIndex + numVisibleItems - 1))\n // }\n return Math.max(startIndex, Math.min(this.length - 1, this.getSizeCount(wrapperSize + scrollOffset)))\n }\n\n getRangeToRender (direction: 'forward' | 'backward', scrollOffset = 0, block = false) {\n if (this.length === 0) {\n return [0, 0, 0, 0]\n }\n\n const startIndex = this.getStartIndex(scrollOffset)\n const stopIndex = this.getStopIndex(this.wrapperSize, scrollOffset, startIndex)\n\n // Overscan by one item in each direction so that tab/focus works. If there isn't at least one extra item, tab loops back around.\n const overscanBackward = !block || direction === 'backward' ? Math.max(1, this.overscan) : 1\n const overscanForward = !block || direction === 'forward' ? Math.max(1, this.overscan) : 1\n return [\n Math.max(0, startIndex - overscanBackward),\n Math.max(0, Math.min(this.length - 1, stopIndex + overscanForward)),\n startIndex,\n stopIndex\n ]\n }\n\n getOffsetForIndexAndAlignment (index: number, align: string, scrollOffset: number) {\n return getOffsetForIndexAndAlignment({\n align,\n containerSize: this.wrapperSize,\n currentOffset: scrollOffset,\n scrollSize: this.getOffsetSizeCache(this.length),\n slideSize: this.getSize(index),\n targetOffset: this.getOffsetSizeCache(index),\n })\n }\n\n compareSize (i = 0, size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C,KAAK,IAAI,SAAS,KAAK,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1F,OAAO;YACL,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;AAC1C,YAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;YACnE,UAAU;YACV;SACD;;AAGH,IAAA,6BAA6B,CAAE,KAAa,EAAE,KAAa,EAAE,YAAoB,EAAA;AAC/E,QAAA,OAAO,6BAA6B,CAAC;YACnC,KAAK;YACL,aAAa,EAAE,IAAI,CAAC,WAAW;AAC/B,YAAA,aAAa,EAAE,YAAY;YAC3B,UAAU,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;AAChD,YAAA,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AAC9B,YAAA,YAAY,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;AAC7C,SAAA,CAAC;;IAGJ,WAAW,CAAE,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAA;QACzC,IAAI,IAAI,CAAC,YAAY;AAAE,YAAA,OAAO,IAAI;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI;;AAElC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"preset.js","sources":["../../../src/components/virtual-list/preset.ts"],"sourcesContent":["import { type IntersectionObserver, createIntersectionObserver, createSelectorQuery, getCurrentInstance } from '@tarojs/taro'\nimport * as CSS from 'csstype'\nimport memoizeOne from 'memoize-one'\n\nimport { convertNumber2PX, defaultItemKey, getRectSizeSync, isCosDistributing, throttle } from '../../utils'\nimport ListSet from './list-set'\nimport { isHorizontalFunc, isRtlFunc } from './utils'\n\nimport type { VirtualListProps } from './'\n\nlet INSTANCE_ID = 0\n\nexport interface IProps extends Partial<VirtualListProps> {\n children?: VirtualListProps['item']\n direction?: 'ltr' | 'rtl' | 'horizontal' | 'vertical'\n itemKey?: typeof defaultItemKey\n itemTagName?: string\n innerTagName?: string\n outerTagName?: string\n innerRef?: React.Ref<HTMLElement> | string\n outerRef?: React.Ref<HTMLElement> | string\n onItemsRendered?: TFunc\n shouldResetStyleCacheOnItemSizeChange?: boolean\n outerWrapper?: React.FC\n}\n\nexport default class Preset {\n itemList: ListSet\n _id: string\n _observer: Record<string, IntersectionObserver> = {}\n\n constructor (protected props: IProps, protected refresh?: TFunc) {\n this.init(this.props)\n this.itemList = new ListSet(props, refresh)\n }\n\n wrapperField = {\n scrollLeft: 0,\n scrollTop: 0,\n scrollHeight: 0,\n scrollWidth: 0,\n clientHeight: 0,\n clientWidth: 0,\n diffOffset: 0\n }\n\n diffList: number[] = [0, 0, 0]\n\n init (props: IProps) {\n this.props = props\n }\n\n update (props: IProps) {\n this.props = props\n this.itemList.update(props)\n }\n\n async updateWrapper (id: string) {\n this.id = id\n const { width = 0, height = 0 } = this.props\n const validWidth = typeof width === 'number' && width > 0\n const validHeight = typeof height === 'number' && height > 0\n if (validWidth) {\n this.itemList.wrapperWidth = width\n }\n if (validHeight) {\n this.itemList.wrapperHeight = height\n }\n\n if (!validHeight || !validWidth) {\n const res = await getRectSizeSync(`#${id}`, 100)\n this.itemList.wrapperWidth ||= res.width\n this.itemList.wrapperHeight ||= res.height\n this.refresh?.()\n }\n\n this.itemList.update(this.props)\n }\n\n set id (id: string) {\n this._id = id\n }\n\n get id () {\n this._id ||= `virtual-waterfall-${INSTANCE_ID++}`\n return this._id\n }\n\n get isHorizontal () {\n return isHorizontalFunc(this.props)\n }\n\n get isRtl () {\n return isRtlFunc(this.props)\n }\n\n get isRelative () {\n return this.props.position && this.props.position !== 'absolute'\n }\n\n get isBrick () {\n return this.props.position === 'brick'\n }\n\n get placeholderCount () {\n return this.props.placeholderCount >= 0 ? this.props.placeholderCount : this.props.overscanCount\n }\n\n get outerElement () {\n return this.props.outerElementType || this.props.outerTagName || 'div'\n }\n\n get innerElement () {\n return this.props.innerElementType || this.props.innerTagName || 'div'\n }\n\n get itemElement () {\n return this.props.itemElementType || this.props.itemTagName || 'div'\n }\n\n get field () {\n return this.wrapperField\n }\n\n set field (o: Record<string, number>) {\n Object.assign(this.wrapperField, o)\n // Object.keys(o).forEach(key => {\n // if (typeof o[key] === 'number' && typeof this.wrapperField[key] === 'number') {\n // this.wrapperField[key] = o[key]\n // }\n // })\n }\n\n get enhanced () {\n return this.props.enhanced || true\n }\n\n isShaking (diff?: number) {\n if (process.env.TARO_PLATFORM === 'web' || this.props.enhanced) return false\n const list = this.diffList.slice(-3)\n this.diffList.push(diff)\n return list.findIndex(e => Math.abs(e) === Math.abs(diff)) !== -1 || isCosDistributing(this.diffList.slice(-4))\n }\n\n resetCache () {\n this.itemList.refreshCounter++\n }\n\n getItemStyleCache = memoizeOne((\n itemIndex?: number,\n itemSize?: IProps['itemSize'] | false,\n _flag = this.itemList.refreshCounter\n ) => {\n itemSize = itemSize || this.itemList.getSize(itemIndex)\n const style: CSS.Properties<string | number> = this.isRelative ? {} : {\n position: 'absolute',\n }\n const offset = convertNumber2PX(this.itemList.getOffsetSizeCache(itemIndex))\n const size = convertNumber2PX(this.itemList.getSize(itemIndex))\n const isHorizontal = this.isHorizontal\n const isRtl = this.isRtl\n style.height = !isHorizontal ? size : '100%'\n style.width = isHorizontal ? size : '100%'\n if (!this.isRelative) {\n const offsetHorizontal = isHorizontal ? offset : 0\n style.top = !isHorizontal ? offset : 0\n if (isRtl) {\n style.right = offsetHorizontal\n } else {\n style.left = offsetHorizontal\n }\n }\n\n return style\n })\n\n getItemStyle (index: number) {\n const {\n shouldResetStyleCacheOnItemSizeChange\n } = this.props\n\n return this.getItemStyleCache(\n index,\n shouldResetStyleCacheOnItemSizeChange ? this.itemList.getSize(index) : false,\n )\n }\n\n boundaryDetection () {\n if ([typeof this.props.onScrollToUpper, typeof this.props.onScrollToLower].every(e => e !== 'function')) return\n\n createSelectorQuery().select(`#${this.id}`).node().exec(() => {\n const upperObserver = this.boundaryDetectionHelper({\n event: typeof this.props.onScrollToUpper === 'function' ? () => {\n if (this.field.diffOffset >= 0) this.props.onScrollToUpper()\n } : undefined,\n id: `${this.id}-${this.isHorizontal ? this.isRtl ? 'right' : 'left' : 'top'}`,\n })\n if (upperObserver) {\n this._observer.top = upperObserver\n }\n\n const lowerObserver = this.boundaryDetectionHelper({\n event: typeof this.props.onScrollToLower === 'function' ? () => {\n if (this.field.diffOffset <= 0) this.props.onScrollToLower()\n } : undefined,\n id: `${this.id}-${this.isHorizontal ? this.isRtl ? 'left' : 'right' : 'bottom'}`,\n })\n if (lowerObserver) {\n this._observer.bottom = lowerObserver\n }\n })\n }\n\n boundaryDetectionHelper ({\n component,\n event,\n id,\n }: {\n component?: TaroGeneral.IAnyObject\n event?: () => void\n id: string\n }) {\n if (typeof event !== 'function') return\n const eventFunc = throttle(event)\n\n component ||= getCurrentInstance().page\n const observer = createIntersectionObserver(component, {\n thresholds: [0.4],\n })\n\n observer\n .relativeTo(`#${this.id}`, {\n top: typeof this.props.lowerThreshold === 'number' ? this.props.lowerThreshold : 50,\n bottom: typeof this.props.upperThreshold === 'number' ? this.props.upperThreshold : 50,\n })\n .observe(`#${id}`, eventFunc)\n\n return observer\n }\n\n dispose () {\n Object.values(this._observer).forEach(e => e.disconnect?.())\n this._observer = {}\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAUA,IAAI,WAAW,GAAG,CAAC;AAgBL,MAAO,MAAM,CAAA;IAKzB,WAAA,CAAuB,KAAa,EAAY,OAAe,EAAA;QAAxC,IAAA,CAAA,KAAK,GAAL,KAAK;QAAoB,IAAA,CAAA,OAAO,GAAP,OAAO;QAFvD,IAAA,CAAA,SAAS,GAAyC,EAAE;AAOpD,QAAA,IAAA,CAAA,YAAY,GAA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AAC,IAAG,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,CAAA,CAAI,CAAA,EAAA,CAAC;AAC5D,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;;AAEtB;;;;"}
1
+ {"version":3,"file":"preset.js","sources":["../../../src/components/virtual-list/preset.ts"],"sourcesContent":["import { type IntersectionObserver, createIntersectionObserver, createSelectorQuery, getCurrentInstance } from '@tarojs/taro'\nimport * as CSS from 'csstype'\nimport memoizeOne from 'memoize-one'\n\nimport { convertNumber2PX, defaultItemKey, getRectSizeSync, isCosDistributing, throttle } from '../../utils'\nimport ListSet from './list-set'\nimport { isHorizontalFunc, isRtlFunc } from './utils'\n\nimport type { VirtualListProps } from './'\n\nlet INSTANCE_ID = 0\n\nexport interface IProps extends Partial<VirtualListProps> {\n children?: VirtualListProps['item']\n direction?: 'ltr' | 'rtl' | 'horizontal' | 'vertical'\n itemKey?: typeof defaultItemKey\n itemTagName?: string\n innerTagName?: string\n outerTagName?: string\n innerRef?: React.Ref<HTMLElement> | string\n outerRef?: React.Ref<HTMLElement> | string\n onItemsRendered?: TFunc\n shouldResetStyleCacheOnItemSizeChange?: boolean\n outerWrapper?: React.FC\n}\n\nexport default class Preset {\n itemList: ListSet\n _id: string\n _observer: Record<string, IntersectionObserver> = {}\n\n constructor (protected props: IProps, protected refresh?: TFunc) {\n this.init(this.props)\n this.itemList = new ListSet(props, refresh)\n }\n\n wrapperField = {\n scrollLeft: 0,\n scrollTop: 0,\n scrollHeight: 0,\n scrollWidth: 0,\n clientHeight: 0,\n clientWidth: 0,\n diffOffset: 0\n }\n\n diffList: number[] = [0, 0, 0]\n\n init (props: IProps) {\n this.props = props\n }\n\n update (props: IProps) {\n this.props = props\n this.itemList.update(props)\n }\n\n async updateWrapper (id: string) {\n this.id = id\n const { width = 0, height = 0 } = this.props\n const validWidth = typeof width === 'number' && width > 0\n const validHeight = typeof height === 'number' && height > 0\n if (validWidth) {\n this.itemList.wrapperWidth = width\n }\n if (validHeight) {\n this.itemList.wrapperHeight = height\n }\n\n if (!validHeight || !validWidth) {\n const res = await getRectSizeSync(`#${id}`, 100)\n this.itemList.wrapperWidth ||= res.width\n this.itemList.wrapperHeight ||= res.height\n this.refresh?.()\n }\n\n this.itemList.update(this.props)\n }\n\n set id (id: string) {\n this._id = id\n }\n\n get id () {\n this._id ||= `virtual-waterfall-${INSTANCE_ID++}`\n return this._id\n }\n\n get isHorizontal () {\n return isHorizontalFunc(this.props)\n }\n\n get isRtl () {\n return isRtlFunc(this.props)\n }\n\n get isRelative () {\n return this.props.position && this.props.position !== 'absolute'\n }\n\n get isBrick () {\n return this.props.position === 'brick'\n }\n\n get placeholderCount () {\n return this.props.placeholderCount >= 0 ? this.props.placeholderCount : this.props.overscanCount\n }\n\n get outerElement () {\n return this.props.outerElementType || this.props.outerTagName || 'div'\n }\n\n get innerElement () {\n return this.props.innerElementType || this.props.innerTagName || 'div'\n }\n\n get itemElement () {\n return this.props.itemElementType || this.props.itemTagName || 'div'\n }\n\n get field () {\n return this.wrapperField\n }\n\n set field (o: Record<string, number>) {\n Object.assign(this.wrapperField, o)\n // Object.keys(o).forEach(key => {\n // if (typeof o[key] === 'number' && typeof this.wrapperField[key] === 'number') {\n // this.wrapperField[key] = o[key]\n // }\n // })\n }\n\n get enhanced () {\n return this.props.enhanced || true\n }\n\n isShaking (diff?: number) {\n if (process.env.TARO_PLATFORM === 'web' || this.props.enhanced) return false\n const list = this.diffList.slice(-3)\n this.diffList.push(diff)\n return list.findIndex(e => Math.abs(e) === Math.abs(diff)) !== -1 || isCosDistributing(this.diffList.slice(-4))\n }\n\n resetCache () {\n this.itemList.refreshCounter++\n }\n\n getItemStyleCache = memoizeOne((\n itemIndex?: number,\n itemSize?: IProps['itemSize'] | false,\n _flag = this.itemList.refreshCounter\n ) => {\n itemSize = itemSize || this.itemList.getSize(itemIndex)\n const style: CSS.Properties<string | number> = this.isRelative ? {} : {\n position: 'absolute',\n }\n const offset = convertNumber2PX(this.itemList.getOffsetSizeCache(itemIndex))\n const size = convertNumber2PX(this.itemList.getSize(itemIndex))\n const isHorizontal = this.isHorizontal\n const isRtl = this.isRtl\n style.height = !isHorizontal ? size : '100%'\n style.width = isHorizontal ? size : '100%'\n if (!this.isRelative) {\n const offsetHorizontal = isHorizontal ? offset : 0\n style.top = !isHorizontal ? offset : 0\n if (isRtl) {\n style.right = offsetHorizontal\n } else {\n style.left = offsetHorizontal\n }\n }\n\n return style\n })\n\n getItemStyle (index: number) {\n const {\n shouldResetStyleCacheOnItemSizeChange\n } = this.props\n\n return this.getItemStyleCache(\n index,\n shouldResetStyleCacheOnItemSizeChange ? this.itemList.getSize(index) : false,\n )\n }\n\n boundaryDetection () {\n if ([typeof this.props.onScrollToUpper, typeof this.props.onScrollToLower].every(e => e !== 'function')) return\n\n createSelectorQuery().select(`#${this.id}`).node().exec(() => {\n const upperObserver = this.boundaryDetectionHelper({\n event: typeof this.props.onScrollToUpper === 'function' ? () => {\n if (this.field.diffOffset >= 0) this.props.onScrollToUpper()\n } : undefined,\n id: `${this.id}-${this.isHorizontal ? this.isRtl ? 'right' : 'left' : 'top'}`,\n })\n if (upperObserver) {\n this._observer.top = upperObserver\n }\n\n const lowerObserver = this.boundaryDetectionHelper({\n event: typeof this.props.onScrollToLower === 'function' ? () => {\n if (this.field.diffOffset <= 0) this.props.onScrollToLower()\n } : undefined,\n id: `${this.id}-${this.isHorizontal ? this.isRtl ? 'left' : 'right' : 'bottom'}`,\n })\n if (lowerObserver) {\n this._observer.bottom = lowerObserver\n }\n })\n }\n\n boundaryDetectionHelper ({\n component,\n event,\n id,\n }: {\n component?: TaroGeneral.IAnyObject\n event?: () => void\n id: string\n }) {\n if (typeof event !== 'function') return\n const eventFunc = throttle(event)\n\n component ||= getCurrentInstance().page\n const observer = createIntersectionObserver(component, {\n thresholds: [0.4],\n })\n\n observer\n .relativeTo(`#${this.id}`, {\n top: typeof this.props.lowerThreshold === 'number' ? this.props.lowerThreshold : 50,\n bottom: typeof this.props.upperThreshold === 'number' ? this.props.upperThreshold : 50,\n })\n .observe(`#${id}`, eventFunc)\n\n return observer\n }\n\n dispose () {\n Object.values(this._observer).forEach(e => e.disconnect?.())\n this._observer = {}\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAUA,IAAI,WAAW,GAAG,CAAC;AAgBL,MAAO,MAAM,CAAA;IAKzB,WAAuB,CAAA,KAAa,EAAY,OAAe,EAAA;QAAxC,IAAK,CAAA,KAAA,GAAL,KAAK;QAAoB,IAAO,CAAA,OAAA,GAAP,OAAO;QAFvD,IAAS,CAAA,SAAA,GAAyC,EAAE;AAOpD,QAAA,IAAA,CAAA,YAAY,GAAG;AACb,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,UAAU,EAAE;SACb;QAED,IAAQ,CAAA,QAAA,GAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAsG9B,QAAA,IAAA,CAAA,iBAAiB,GAAG,UAAU,CAAC,CAC7B,SAAkB,EAClB,QAAqC,EACrC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,KAClC;YACF,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;YACvD,MAAM,KAAK,GAAoC,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG;AACpE,gBAAA,QAAQ,EAAE,UAAU;aACrB;AACD,YAAA,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAC5E,YA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CAAC;AAClB,SAAA,CAAC;QAEF;AACG,aAAA,UAAU,CAAC,CAAI,CAAA,EAAA,IAAI,CAAC,EAAE,EAAE,EAAE;YACzB,GAAG,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,EAAE;YACnF,MAAM,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,EAAE;SACvF;AACA,aAAA,OAAO,CAAC,CAAI,CAAA,EAAA,EAAE,EAAE,EAAE,SAAS,CAAC;AAE/B,QAAA,OAAO,QAAQ;;IAGjB,OAAO,GAAA;QACL,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAG,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,CAAC,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAC;AAC5D,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;;AAEtB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/virtual-list/react/index.ts"],"sourcesContent":["import { ScrollView, View } from '@tarojs/components'\nimport React from 'react'\n\nimport List from './list'\nimport outerWrapper from './wrapper'\n\nimport type { VirtualListProps } from '../'\nimport type { IProps } from '../preset'\n\nconst VirtualList = React.forwardRef(function VirtualList (props: VirtualListProps, ref) {\n const {\n direction = 'ltr',\n outerElementType = ScrollView,\n innerElementType = View,\n itemElementType = View,\n initialScrollOffset = 0,\n overscanCount = 1,\n queryPrefix = '',\n ...rest\n } = props as IProps\n\n if ('children' in rest) {\n console.warn('Taro(VirtualList): children props have been deprecated. ' + 'Please use the item props instead.')\n rest.item = rest.children as IProps['item']\n }\n if (rest.item instanceof Array) {\n console.warn('Taro(VirtualList): item should not be an array')\n rest.item = rest.item[0]\n }\n return React.createElement(List, {\n ref,\n ...rest,\n outerElementType,\n itemElementType,\n innerElementType,\n direction,\n initialScrollOffset,\n overscanCount,\n queryPrefix,\n outerWrapper,\n })\n})\n\nexport default VirtualList\n"],"names":[],"mappings":";;;;;;AASA,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAAE,KAAuB,EAAE,GAAG,EAAA;AACrF,IAAA,MAAM,KASF,KAAe,EATb,EACJ,SAAS,GAAG,KAAK,EACjB,gBAAgB,GAAG,UAAU,EAC7B,gBAAgB,GAAG,IAAI,EACvB,eAAe,GAAG,IAAI,EACtB,mBAAmB,GAAG,CAAC,EACvB,aAAa,GAAG,CAAC,EACjB,WAAW,GAAG,EAAE,EAAA,GAAA,EAEC,EADd,IAAI,GAAA,MAAA,CAAA,EAAA,EARH,CAAA,WAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,qBAAA,EAAA,eAAA,EAAA,aAAA,CASL,CAAkB;AAEnB,IAAA,IAAI,UAAU,IAAI,IAAI,EAAE;AACtB,QAAA,OAAO,CAAC,IAAI,CAAC,0DAA0D,GAAG,oCAAoC,CAAC;AAC/G,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAA0B;;AAE7C,IAAA,IAAI,IAAI,CAAC,IAAI,YAAY,KAAK,EAAE;AAC9B,QAAA,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;IAE1B,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,gCAC7B,GAAG,EAAA,EACA,IAAI,CAAA,EAAA,EACP,gBAAgB;QAChB,eAAe;QACf,gBAAgB;QAChB,SAAS;QACT,mBAAmB;QACnB,aAAa;QACb,WAAW;AACX,QAAA,YAAY,IACZ;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/virtual-list/react/index.ts"],"sourcesContent":["import { ScrollView, View } from '@tarojs/components'\nimport React from 'react'\n\nimport List from './list'\nimport outerWrapper from './wrapper'\n\nimport type { VirtualListProps } from '../'\nimport type { IProps } from '../preset'\n\nconst VirtualList = React.forwardRef(function VirtualList (props: VirtualListProps, ref) {\n const {\n direction = 'ltr',\n outerElementType = ScrollView,\n innerElementType = View,\n itemElementType = View,\n initialScrollOffset = 0,\n overscanCount = 1,\n queryPrefix = '',\n ...rest\n } = props as IProps\n\n if ('children' in rest) {\n console.warn('Taro(VirtualList): children props have been deprecated. ' + 'Please use the item props instead.')\n rest.item = rest.children as IProps['item']\n }\n if (rest.item instanceof Array) {\n console.warn('Taro(VirtualList): item should not be an array')\n rest.item = rest.item[0]\n }\n return React.createElement(List, {\n ref,\n ...rest,\n outerElementType,\n itemElementType,\n innerElementType,\n direction,\n initialScrollOffset,\n overscanCount,\n queryPrefix,\n outerWrapper,\n })\n})\n\nexport default VirtualList\n"],"names":[],"mappings":";;;;;;AASM,MAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAAE,KAAuB,EAAE,GAAG,EAAA;AACrF,IAAA,MAAM,KASF,KAAe,EATb,EACJ,SAAS,GAAG,KAAK,EACjB,gBAAgB,GAAG,UAAU,EAC7B,gBAAgB,GAAG,IAAI,EACvB,eAAe,GAAG,IAAI,EACtB,mBAAmB,GAAG,CAAC,EACvB,aAAa,GAAG,CAAC,EACjB,WAAW,GAAG,EAAE,EAEC,GAAA,EAAA,EADd,IAAI,GARH,MAAA,CAAA,EAAA,EAAA,CAAA,WAAA,EAAA,kBAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,qBAAA,EAAA,eAAA,EAAA,aAAA,CASL,CAAkB;AAEnB,IAAA,IAAI,UAAU,IAAI,IAAI,EAAE;AACtB,QAAA,OAAO,CAAC,IAAI,CAAC,0DAA0D,GAAG,oCAAoC,CAAC;AAC/G,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAA0B;;AAE7C,IAAA,IAAI,IAAI,CAAC,IAAI,YAAY,KAAK,EAAE;AAC9B,QAAA,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;IAE1B,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,gCAC7B,GAAG,EAAA,EACA,IAAI,CAAA,EAAA,EACP,gBAAgB;QAChB,eAAe;QACf,gBAAgB;QAChB,SAAS;QACT,mBAAmB;QACnB,aAAa;QACb,WAAW;AACX,QAAA,YAAY,IACZ;AACJ,CAAC;;;;"}
@@ -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,IAAA,CAAA,OAAO,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,IAAA,CAAA,SAAS,GAAG,SAAS;QAErB,IAAA,CAAA,0BAA0B,GAAG,IAAI;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BAAiB,EAC1E,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,MAAM;YACN,QAAQ,EACR,KAAK,EAAA,MAAA,CAAA,MAAA,CAAA,EACH,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAChC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,uBAAuB,EAAE,OAAO,EAChC,UAAU,EAAE,WAAW,EACvB,SAAS,EAAA,EACN,KAAK,CAAA,EAEV,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAC1C,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAC1C,SAAS;AACT,YAAA,YAAY,GACb;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;;iBACzF;AACL,gBAAA,UAAU,CAAC,SAAS,GAAG,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;;;AAIhG,QAAA,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EACxC,UAAU,EACV,IAAI,CAAC,mBAAmB,EAAE,CAC3B;;;AAzfI,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;AA6frB;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;;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,SAAS;QAErB,IAA0B,CAAA,0BAAA,GAAG,IAAI;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;AACD,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;AAuCV,QAAA,IAAA,CAAA,kBAAkB,GAAG,CAAC,KAAa,EAAE,YAAqB,KAAI;AAC5D,YAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAI;AAC7B,gBAAA,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AwB,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU;;iBACzF;AACL,gBAAA,UAAU,CAAC,SAAS,GAAG,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS;;;AAIhG,QAAA,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EACxC,UAAU,EACV,IAAI,CAAC,mBAAmB,EAAE,CAC3B;;;AAzfI,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;AA6frB;AACA;AACA;AACA;AACA;;;;"}
@@ -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;AAC/B,IAAI,kBAAkB,GAAG,IAAI;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,OAAO,EAAE;AACpD,QAAA,kBAAkB,mBAAmB,IAAI,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A,CAAA,EAAI,SAAS,CAAA,gBAAA,CAAkB,CAAC;;QAGjJ,QAAQ,MAAM;AACZ,YAAA,KAAK,YAAY;AACjB,YAAA,KAAK,UAAU;;gBAEb;AAEF,YAAA;gBACE,MAAM,KAAK,CAAC,+CAA+C,GAAG,qDAAqD,GAAG,CAAA,CAAA,EAAI,MAAM,CAAA,gBAAA,CAAkB,CAAC;;AAGvJ,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,CAAA,gBAAA,CAAkB,CAAC;;;;;;;;AAUnK,IAAA,OAAO,IAAI;AACb;;;;"}
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;AAC/B,IAAI,kBAAkB,GAAG,IAAI;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,OAAO,EAAE;AACpD,QAAA,kBAAkB,mBAAmB,IAAI,OAAO,EAAE;;AAEtD;AAEa,MAAA,iBAAiB,GAAG,CAAC,EAChC,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,YAAY,E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,UAAU;;gBAEb;AAEF,YAAA;gBACE,MAAM,KAAK,CAAC,+CAA+C,GAAG,qDAAqD,GAAG,CAAI,CAAA,EAAA,MAAM,CAAkB,gBAAA,CAAA,CAAC;;AAGvJ,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;;;;;;;;AAUnK,IAAA,OAAO,IAAI;AACb;;;;"}
@@ -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 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,CAAA,CAAA,EAAI,SAAS,EAAE;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;KACF;AACD,IAAA,MAAM,OAAO,G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AC;;AAEzB,KAAC;AACD,IAAA,MAAM,YAAY,GAAG,MAAM,KAAK,YAAY;AAC5C,IAAA,MAAM,KAAK,GAAG,SAAS,KAAK,KAAK;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,CAAA,EACN;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;AACJ,CAAC;;;;"}
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,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-1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/components/virtual-list/utils.ts"],"sourcesContent":["interface IHorizontal {\n direction?: string\n layout?: string\n}\nexport function isHorizontalFunc ({ direction, layout }: IHorizontal) {\n return direction === 'horizontal' || layout === 'horizontal'\n}\ninterface IRrl {\n direction?: string\n}\nexport function isRtlFunc ({ direction }: IRrl) {\n return direction === 'rtl'\n}\n"],"names":[],"mappings":"SAIgB,gBAAgB,CAAE,EAAE,SAAS,EAAE,MAAM,EAAe,EAAA;AAClE,IAAA,OAAO,SAAS,KAAK,YAAY,IAAI,MAAM,KAAK,YAAY;AAC9D;AAIM,SAAU,SAAS,CAAE,EAAE,SAAS,EAAQ,EAAA;IAC5C,OAAO,SAAS,KAAK,KAAK;AAC5B;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/components/virtual-list/utils.ts"],"sourcesContent":["interface IHorizontal {\n direction?: string\n layout?: string\n}\nexport function isHorizontalFunc ({ direction, layout }: IHorizontal) {\n return direction === 'horizontal' || layout === 'horizontal'\n}\ninterface IRrl {\n direction?: string\n}\nexport function isRtlFunc ({ direction }: IRrl) {\n return direction === 'rtl'\n}\n"],"names":[],"mappings":"SAIgB,gBAAgB,CAAE,EAAE,SAAS,EAAE,MAAM,EAAe,EAAA;AAClE,IAAA,OAAO,SAAS,KAAK,YAAY,IAAI,MAAM,KAAK,YAAY;AAC9D;AAIgB,SAAA,SAAS,CAAE,EAAE,SAAS,EAAQ,EAAA;IAC5C,OAAO,SAAS,KAAK,KAAK;AAC5B;;;;"}