@tarojs/components-react 4.2.1-beta.0 → 4.2.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/image/index.js +5 -3
- package/dist/components/image/index.js.map +1 -1
- package/dist/components/map/MapContext.js +628 -0
- package/dist/components/map/MapContext.js.map +1 -0
- package/dist/components/map/MapCustomCallout.js +91 -0
- package/dist/components/map/MapCustomCallout.js.map +1 -0
- package/dist/components/map/common.js +4 -0
- package/dist/components/map/common.js.map +1 -0
- package/dist/components/map/createMapContext.js +34 -0
- package/dist/components/map/createMapContext.js.map +1 -0
- package/dist/components/map/handler.js +50 -0
- package/dist/components/map/handler.js.map +1 -0
- package/dist/components/map/index.js +329 -0
- package/dist/components/map/index.js.map +1 -0
- package/dist/components/picker/index.js +76 -35
- package/dist/components/picker/index.js.map +1 -1
- package/dist/components/picker/picker-group.js +477 -127
- package/dist/components/picker/picker-group.js.map +1 -1
- package/dist/components/refresher/index.js +5 -5
- package/dist/components/refresher/index.js.map +1 -1
- package/dist/components/scroll-view/index.js +80 -36
- package/dist/components/scroll-view/index.js.map +1 -1
- package/dist/components/switch/index.js +125 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/style/index.scss.js +4 -0
- package/dist/components/switch/style/index.scss.js.map +1 -0
- package/dist/contexts/ScrollElementContext.js +6 -0
- package/dist/contexts/ScrollElementContext.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/original/components/image/index.js +5 -3
- package/dist/original/components/image/index.js.map +1 -1
- package/dist/original/components/image/style/index.scss +5 -1
- package/dist/original/components/map/MapContext.js +628 -0
- package/dist/original/components/map/MapContext.js.map +1 -0
- package/dist/original/components/map/MapCustomCallout.js +91 -0
- package/dist/original/components/map/MapCustomCallout.js.map +1 -0
- package/dist/original/components/map/common.js +4 -0
- package/dist/original/components/map/common.js.map +1 -0
- package/dist/original/components/map/createMapContext.js +34 -0
- package/dist/original/components/map/createMapContext.js.map +1 -0
- package/dist/original/components/map/handler.js +50 -0
- package/dist/original/components/map/handler.js.map +1 -0
- package/dist/original/components/map/index.js +329 -0
- package/dist/original/components/map/index.js.map +1 -0
- package/dist/original/components/picker/index.js +76 -35
- package/dist/original/components/picker/index.js.map +1 -1
- package/dist/original/components/picker/picker-group.js +477 -127
- package/dist/original/components/picker/picker-group.js.map +1 -1
- package/dist/original/components/picker/style/index.scss +9 -8
- package/dist/original/components/refresher/index.js +5 -5
- package/dist/original/components/refresher/index.js.map +1 -1
- package/dist/original/components/scroll-view/index.js +80 -36
- package/dist/original/components/scroll-view/index.js.map +1 -1
- package/dist/original/components/switch/index.js +125 -0
- package/dist/original/components/switch/index.js.map +1 -0
- package/dist/original/components/switch/style/index.scss +35 -0
- package/dist/original/contexts/ScrollElementContext.js +6 -0
- package/dist/original/contexts/ScrollElementContext.js.map +1 -0
- package/dist/original/index.js +6 -2
- package/dist/original/index.js.map +1 -1
- package/dist/solid/components/image/index.js +5 -3
- package/dist/solid/components/image/index.js.map +1 -1
- package/dist/solid/components/picker/index.js +82 -39
- package/dist/solid/components/picker/index.js.map +1 -1
- package/dist/solid/components/picker/picker-group.js +500 -151
- package/dist/solid/components/picker/picker-group.js.map +1 -1
- package/dist/solid/components/refresher/index.js +5 -5
- package/dist/solid/components/refresher/index.js.map +1 -1
- package/dist/solid/components/scroll-view/index.js +84 -40
- package/dist/solid/components/scroll-view/index.js.map +1 -1
- package/dist/solid/contexts/ScrollElementContext.js +6 -0
- package/dist/solid/contexts/ScrollElementContext.js.map +1 -0
- package/dist/solid/index.css +1 -1
- package/dist/solid/index.js +1 -1
- package/package.json +8 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker-group.js","sources":["../../../../src/components/picker/picker-group.tsx"],"sourcesContent":["import { ScrollView, View } from '@tarojs/components'\nimport Taro from '@tarojs/taro'\nimport * as React from 'react'\n\n// 添加类型定义\ntype TaroScrollView = React.ElementRef<typeof ScrollView>\ntype TaroView = React.ElementRef<typeof View>\n\nexport interface PickerGroupProps {\n mode?: 'basic' | 'time' | 'date' | 'region'\n range: any[]\n rangeKey?: string\n columnId: string\n updateIndex: (index: number, columnId: string, needRevise?: boolean, isUserBeginScroll?: boolean) => void // 替换updateHeight\n onColumnChange?: (e: { columnId: string, index: number }) => void // 修改回调参数名称\n updateDay?: (value: number, fields: number) => void\n selectedIndex?: number // 添加selectedIndex参数\n _updateTrigger?: any // 仅用于强制触发更新\n colors?: {\n itemDefaultColor?: string // 选项字体默认颜色\n itemSelectedColor?: string // 选项字体选中颜色\n lineColor?: string // 选中指示线颜色\n }\n}\n\n// 定义常量\nconst PICKER_LINE_HEIGHT = 34 // px\nconst PICKER_VISIBLE_ITEMS = 7 // 可见行数\nconst PICKER_BLANK_ITEMS = 3 // 空白行数\n\nconst getIndicatorStyle = (lineColor: string): React.CSSProperties => {\n return {\n borderTopColor: lineColor,\n borderBottomColor: lineColor\n }\n}\n\n// 辅助函数:获取系统信息的 lengthScaleRatio 并设置 targetScrollTop\nconst setTargetScrollTopWithScale = (\n setTargetScrollTop: (value: number) => void,\n baseValue: number,\n randomOffset?: number\n) => {\n // H5 和 weapp 不参与放大计算,直接使用 baseValue\n if (process.env.TARO_ENV === 'h5' || process.env.TARO_ENV === 'weapp') {\n const finalValue = randomOffset !== undefined ? baseValue + randomOffset : baseValue\n setTargetScrollTop(finalValue)\n return\n }\n\n Taro.getSystemInfo({\n success: (res) => {\n let lengthScaleRatio = (res as any)?.lengthScaleRatio\n if (lengthScaleRatio == null || lengthScaleRatio === 0) {\n console.warn('Taro.getSystemInfo: lengthScaleRatio 不存在,使用计算值')\n lengthScaleRatio = 1\n if (res.windowWidth < 320) {\n lengthScaleRatio = res.windowWidth / 320\n } else if (res.windowWidth >= 400 && res.windowWidth < 600) {\n lengthScaleRatio = res.windowWidth / 400\n }\n const shortSide = res.windowWidth < res.windowHeight ? res.windowWidth : res.windowHeight\n const isBigScreen = shortSide >= 600\n if (isBigScreen) {\n lengthScaleRatio = shortSide / 720\n }\n }\n const scaledValue = baseValue * lengthScaleRatio\n const finalValue = randomOffset !== undefined ? scaledValue + randomOffset : scaledValue\n setTargetScrollTop(finalValue)\n },\n fail: (err) => {\n console.error('获取系统信息失败:', err)\n // 失败时使用默认值 1\n const finalValue = randomOffset !== undefined ? baseValue + randomOffset : baseValue\n setTargetScrollTop(finalValue)\n }\n })\n}\n\nexport function PickerGroupBasic(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n onColumnChange,\n selectedIndex = 0, // 使用selectedIndex参数,默认为0\n colors = {},\n } = props\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n // 使用selectedIndex初始化当前索引\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n // 触摸状态用于优化用户体验\n const [isTouching, setIsTouching] = React.useState(false)\n\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n React.useEffect(() => {\n if (process.env.TARO_PLATFORM !== 'harmony') {\n if (scrollViewRef.current && scrollViewRef.current?.scrollHeight) {\n itemHeightRef.current = scrollViewRef.current.scrollHeight / scrollViewRef.current.childNodes.length\n } else {\n console.warn('Height measurement anomaly')\n }\n }\n }, [range.length]) // 只在range长度变化时重新计算\n // 获取选中的索引\n const getSelectedIndex = (scrollTop: number) => {\n return Math.round(scrollTop / itemHeightRef.current)\n }\n\n // 当selectedIndex变化时,调整滚动位置\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouching) {\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue)\n setCurrentIndex(selectedIndex)\n }\n }, [selectedIndex, range])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n // 简化为直接在滚动结束时通知父组件\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 做一个0.1s延时 0.1s之内没有新的滑动 则把选项归到中间 然后更新选中项\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n\n setIsTouching(false)\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset)\n updateIndex(newIndex, columnId)\n onColumnChange?.({ columnId, index: newIndex })\n isCenterTimerId.current = null\n }, 100)\n }\n // 滚动处理 - 在滚动时计算索引然后更新选中项样式\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{\n height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS,\n }}\n scrollTop={targetScrollTop}\n onScroll={handleScroll}\n onTouchStart={() => setIsTouching(true)}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 时间选择器实现\nexport function PickerGroupTime(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n selectedIndex = 0,\n colors = {},\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const [isTouching, setIsTouching] = React.useState(false)\n\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n React.useEffect(() => {\n if (process.env.TARO_PLATFORM !== 'harmony') {\n if (scrollViewRef.current && scrollViewRef.current?.scrollHeight) {\n itemHeightRef.current = scrollViewRef.current.scrollHeight / scrollViewRef.current.childNodes.length\n } else {\n console.warn('Height measurement anomaly')\n }\n }\n }, [range.length]) // 只在range长度变化时重新计算\n\n const getSelectedIndex = (scrollTop: number) => {\n return Math.round(scrollTop / itemHeightRef.current)\n }\n\n // 当selectedIndex变化时,调整滚动位置\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouching) {\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue)\n setCurrentIndex(selectedIndex)\n }\n }, [selectedIndex, range])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n\n // 简化为直接在滚动结束时通知父组件\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 做一个0.1s延时 0.1s之内没有新的滑动 则把选项归到中间 然后更新选中项\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n setIsTouching(false)\n // 调用updateIndex执行限位逻辑,获取是否触发了限位\n const isLimited = Boolean(updateIndex(newIndex, columnId, true))\n // 如果没有触发限位,才执行归中逻辑\n if (!isLimited) {\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset)\n }\n isCenterTimerId.current = null\n }, 100)\n }\n\n // 滚动处理\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{\n height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS,\n }}\n scrollTop={targetScrollTop}\n onScroll={handleScroll}\n onTouchStart={() => setIsTouching(true)}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 日期选择器实现\nexport function PickerGroupDate(props: PickerGroupProps) {\n const {\n range = [],\n columnId,\n updateDay,\n selectedIndex = 0,\n colors = {},\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const [isTouching, setIsTouching] = React.useState(false)\n\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n React.useEffect(() => {\n if (process.env.TARO_PLATFORM !== 'harmony') {\n if (scrollViewRef.current && scrollViewRef.current?.scrollHeight) {\n itemHeightRef.current = scrollViewRef.current.scrollHeight / scrollViewRef.current.childNodes.length\n } else {\n console.warn('Height measurement anomaly')\n }\n }\n }, [range.length]) // 只在range长度变化时重新计算\n\n const getSelectedIndex = (scrollTop: number) => {\n return Math.round(scrollTop / itemHeightRef.current)\n }\n\n // 当selectedIndex变化时,调整滚动位置\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouching) {\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue)\n setCurrentIndex(selectedIndex)\n }\n }, [selectedIndex, range])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n\n // 简化为直接在滚动结束时通知父组件\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n\n // 做一个0.1s延时 0.1s之内没有新的滑动 则把选项归到中间 然后更新选中项\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n\n setIsTouching(false)\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset)\n\n // 更新日期值\n if (updateDay) {\n // 解析文本中的数字(移除年、月、日等后缀)\n const valueText = range[newIndex] || ''\n const numericValue = parseInt(valueText.replace(/[^0-9]/g, ''))\n updateDay(isNaN(numericValue) ? 0 : numericValue, parseInt(columnId))\n }\n isCenterTimerId.current = null\n }, 100)\n }\n\n // 滚动处理\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {item}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{ height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS }}\n scrollTop={targetScrollTop}\n onScroll={handleScroll}\n onTouchStart={() => setIsTouching(true)}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 地区选择器实现\nexport function PickerGroupRegion(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n selectedIndex = 0, // 使用selectedIndex参数,默认为0\n colors = {},\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const scrollViewRef = React.useRef<any>(null)\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const [isTouching, setIsTouching] = React.useState(false)\n\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n const isUserBeginScrollRef = React.useRef(false)\n React.useEffect(() => {\n if (process.env.TARO_PLATFORM !== 'harmony') {\n if (scrollViewRef.current && scrollViewRef.current?.scrollHeight) {\n itemHeightRef.current = scrollViewRef.current.scrollHeight / scrollViewRef.current.childNodes.length\n } else {\n console.warn('Height measurement anomaly')\n }\n }\n }, [range.length]) // 只在range长度变化时重新计算\n\n const getSelectedIndex = (scrollTop: number) => {\n return Math.round(scrollTop / itemHeightRef.current)\n }\n\n // 当selectedIndex变化时,调整滚动位置\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouching) {\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue)\n setCurrentIndex(selectedIndex)\n }\n }, [selectedIndex, range])\n\n // 滚动结束处理\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 做一个0.1s延时 0.1s之内没有新的滑动 则把选项归到中间 然后更新选中项\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n\n setIsTouching(false)\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset)\n updateIndex(newIndex, columnId, false, isUserBeginScrollRef.current)\n }, 100)\n }\n\n // 滚动处理 - 在滚动时计算索引\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop)\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{ height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS }}\n scrollTop={targetScrollTop}\n onScroll={handleScroll}\n onTouchStart={() => {\n setIsTouching(true)\n isUserBeginScrollRef.current = true\n }}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 默认导出,根据 mode 自动分发\nexport function PickerGroup(props: PickerGroupProps) {\n switch (props.mode) {\n case 'time':\n return <PickerGroupTime {...props} />\n case 'date':\n return <PickerGroupDate {...props} />\n case 'region':\n return <PickerGroupRegion {...props} />\n default:\n return <PickerGroupBasic {...props} />\n }\n}\n"],"names":["PICKER_LINE_HEIGHT","PICKER_VISIBLE_ITEMS","PICKER_BLANK_ITEMS","getIndicatorStyle","lineColor","borderTopColor","borderBottomColor","setTargetScrollTopWithScale","setTargetScrollTop","baseValue","randomOffset","process","env","TARO_ENV","finalValue","undefined","Taro","getSystemInfo","success","res","lengthScaleRatio","console","warn","windowWidth","shortSide","windowHeight","isBigScreen","scaledValue","fail","err","error","PickerGroupBasic","props","range","rangeKey","columnId","updateIndex","onColumnChange","selectedIndex","colors","indicatorStyle","targetScrollTop","React","useState","scrollViewRef","useRef","itemRefs","currentIndex","setCurrentIndex","isTouching","setIsTouching","itemHeightRef","useEffect","TARO_PLATFORM","current","_a","scrollHeight","childNodes","length","getSelectedIndex","scrollTop","Math","round","isCenterTimerId","handleScrollEnd","clearTimeout","setTimeout","newIndex","random","index","handleScroll","pickerItem","map","item","content","_$createComponent","View","id","key","ref","el","className","style","height","color","itemSelectedColor","itemDefaultColor","children","realPickerItems","Array","fill","_","idx","_$mergeProps","ScrollView","scrollY","showScrollbar","onScroll","onTouchStart","onScrollEnd","scrollWithAnimation","PickerGroupTime","isLimited","Boolean","PickerGroupDate","updateDay","valueText","numericValue","parseInt","replace","isNaN","PickerGroupRegion","isUserBeginScrollRef","PickerGroup","mode"],"mappings":";;;;;AAyBA;AACA,MAAMA,kBAAkB,GAAG,EAAE,CAAA;AAC7B,MAAMC,oBAAoB,GAAG,CAAC,CAAA;AAC9B,MAAMC,kBAAkB,GAAG,CAAC,CAAA;AAE5B,MAAMC,iBAAiB,GAAIC,SAAiB,IAAyB;EACnE,OAAO;AACLC,IAAAA,cAAc,EAAED,SAAS;AACzBE,IAAAA,iBAAiB,EAAEF;GACpB;AACH,CAAC;AAED;AACA,MAAMG,2BAA2B,GAAGA,CAClCC,kBAA2C,EAC3CC,SAAiB,EACjBC,YAAqB,KACnB;AACF;AACA,EAAA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,IAAI,IAAIF,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,OAAO,EAAE;IACrE,MAAMC,UAAU,GAAGJ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;AAAA,OAAA,EACJzC,cAAc,GAAG;AAAE0C,QAAAA,KAAK,EAAE1C;AAAgB,OAAA,GAAG,EAAE,CAAAmC,CAAAA,EAAAA,eAAA,CAErDmB,UAAU,EAAA;AAAAf,QAAAA,GAAA,EACJnC,aAAa;QAClBmD,OAAO,EAAA,IAAA;AACPC,QAAAA,aAAa,EAAE,KAAK;QACpBf,SAAS,EAAA,sBAAA;AACTC,QAAAA,KAAK,EAAE;UAAEC,MAAM,EAAEnF,kBAAkB,GAAGC;SAAsB;AAC5D2D,QAAAA,SAAS,EAAEnB,eAAe;AAC1BwD,QAAAA,QAAQ,EAAE3B,YAAY;QACtB4B,YAAY,EAAEA,MAAK;UACjBhD,aAAa,CAAC,IAAI,CAAC;UACnB8D,oBAAoB,CAAC1D,OAAO,GAAG,IAAI;SACpC;AACD6C,QAAAA,WAAW,EAAEnC,eAAe;QAC5BoC,mBAAmB,EAAA,IAAA;AAAAb,QAAAA,QAAA,EAElBC;AAAe,OAAA,CAAA,CAAA;AAAA;AAAA,GAAA,CAAA;AAIxB;AAEA;AACM,SAAUyB,WAAWA,CAACjF,KAAuB,EAAA;EACjD,QAAQA,KAAK,CAACkF,IAAI;AAChB,IAAA,KAAK,MAAM;AACT,MAAA,OAAAvC,eAAA,CAAQ0B,eAAe,EAAKrE,KAAK,CAAA;AACnC,IAAA,KAAK,MAAM;AACT,MAAA,OAAA2C,eAAA,CAAQ6B,eAAe,EAAKxE,KAAK,CAAA;AACnC,IAAA,KAAK,QAAQ;AACX,MAAA,OAAA2C,eAAA,CAAQoC,iBAAiB,EAAK/E,KAAK,CAAA;AACrC,IAAA;AACE,MAAA,OAAA2C,eAAA,CAAQ5C,gBAAgB,EAAKC,KAAK,CAAA;AACtC;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"picker-group.js","sources":["../../../../src/components/picker/picker-group.tsx"],"sourcesContent":["import { ScrollView, View } from '@tarojs/components'\nimport Taro from '@tarojs/taro'\nimport * as React from 'react'\n\n// 添加类型定义\ntype TaroScrollView = React.ElementRef<typeof ScrollView>\ntype TaroView = React.ElementRef<typeof View>\n\nfunction requestAccessibilityFocusOnView(node: TaroView | null | undefined): void {\n if (node == null) return\n const fn = (Taro as any).setAccessibilityFocus\n if (typeof fn !== 'function') return\n fn({ viewRef: { current: node } as React.RefObject<any> })\n}\n\n/** 部分端同 id 连续 scrollIntoView 不生效:先清空再在下一宏任务设回目标 id */\nfunction usePickerItemScrollIntoView(): [string, (itemId: string) => void] {\n const [scrollIntoView, setScrollIntoView] = React.useState('')\n const pulseRef = React.useRef(0)\n\n const scrollToItemId = React.useCallback((itemId: string) => {\n pulseRef.current += 1\n const token = pulseRef.current\n setScrollIntoView('')\n setTimeout(() => {\n if (pulseRef.current !== token) return\n setScrollIntoView(itemId)\n }, 0)\n }, [])\n\n return [scrollIntoView, scrollToItemId]\n}\n\nexport interface PickerGroupProps {\n mode?: 'basic' | 'time' | 'date' | 'region'\n range: any[]\n rangeKey?: string\n columnId: string\n updateIndex: (index: number, columnId: string, needRevise?: boolean, isUserBeginScroll?: boolean) => void // 替换updateHeight\n onColumnChange?: (e: { columnId: string, index: number }) => void // 修改回调参数名称\n updateDay?: (value: number, fields: number) => void\n selectedIndex?: number // 添加selectedIndex参数\n _updateTrigger?: any // 仅用于强制触发更新\n colors?: {\n itemDefaultColor?: string // 选项字体默认颜色\n itemSelectedColor?: string // 选项字体选中颜色\n lineColor?: string // 选中指示线颜色\n }\n /** time 限位后由父级下发,命中 columnId 的列在稳定后对该项 setAccessibilityFocus */\n timeA11yLimitFocus?: { nonce: number, columnId: string } | null\n onTimeA11yLimitFocusConsumed?: () => void\n /** time 限位单调计数:抑制非触发列在停滚时误抢无障碍焦点 */\n timeA11yLimitEventNonce?: number\n /** 点击选项是否滚至选中区,默认 true */\n enableClickItemScroll?: boolean\n}\n\n// 定义常量\nconst PICKER_LINE_HEIGHT = 34 // px\nconst PICKER_VISIBLE_ITEMS = 7 // 可见行数\nconst PICKER_BLANK_ITEMS = 3 // 空白行数\n\nconst getIndicatorStyle = (lineColor: string): React.CSSProperties => {\n return {\n borderTopColor: lineColor,\n borderBottomColor: lineColor\n }\n}\n\n// 大屏方案版本要求\nconst MIN_DESIGN_APP_VERSION = 16\n\n// 判断是否启用测量值缩放适配(true=启用, false=使用系统侧缩放)\nconst resolveUseMeasuredScale = (res: Taro.getSystemInfo.Result): boolean => {\n // H5/weapp 不参与大屏系数\n if (process.env.TARO_ENV === 'h5' || process.env.TARO_ENV === 'weapp') {\n return false\n }\n\n const designAppVersionRaw = (res as any).designAppVersion\n const designAppVersionMajor = designAppVersionRaw != null ? parseInt(String(designAppVersionRaw).trim(), 10) : Number.NaN\n if (!Number.isFinite(designAppVersionMajor) || designAppVersionMajor < MIN_DESIGN_APP_VERSION) {\n return false\n }\n\n const platform = String((res as any).platform || '').toLowerCase()\n if (platform === 'harmony' || platform === 'android' || platform === 'ios') {\n return true\n }\n\n return false\n}\n\n// 辅助函数:计算 lengthScaleRatio\nconst calculateLengthScaleRatio = (res: Taro.getSystemInfo.Result): number => {\n let lengthScaleRatio = (res as any)?.lengthScaleRatio\n if (lengthScaleRatio == null || lengthScaleRatio === 0) {\n console.warn('Taro.getSystemInfo: lengthScaleRatio 不存在,使用计算值')\n lengthScaleRatio = 1\n if (res.windowWidth < 320) {\n lengthScaleRatio = res.windowWidth / 320\n } else if (res.windowWidth >= 400 && res.windowWidth < 600) {\n lengthScaleRatio = res.windowWidth / 400\n }\n const shortSide = res.windowWidth < res.windowHeight ? res.windowWidth : res.windowHeight\n const isBigScreen = shortSide >= 600\n if (isBigScreen) {\n lengthScaleRatio = shortSide / 720\n }\n }\n return lengthScaleRatio\n}\n\n// 辅助函数:获取系统信息的 lengthScaleRatio 并设置 targetScrollTop\nconst setTargetScrollTopWithScale = (\n setTargetScrollTop: (value: number) => void,\n baseValue: number,\n randomOffset?: number,\n lengthScaleRatio: number = 1,\n) => {\n // H5 和 weapp 不参与放大计算,直接使用 baseValue\n if (process.env.TARO_ENV === 'h5' || process.env.TARO_ENV === 'weapp') {\n const finalValue = randomOffset !== undefined ? baseValue + randomOffset : baseValue\n setTargetScrollTop(finalValue)\n return\n }\n\n if (process.env.TARO_PLATFORM === 'harmony') {\n const scaledValue = baseValue\n const finalValue = randomOffset !== undefined ? scaledValue + randomOffset : scaledValue\n setTargetScrollTop(finalValue)\n } else {\n const scaledValue = baseValue * lengthScaleRatio\n const finalValue = randomOffset !== undefined ? scaledValue + randomOffset : scaledValue\n setTargetScrollTop(finalValue)\n }\n}\n\n// 根据 scrollTop 计算选中索引\n// 系统侧缩放模式:scrollHeight 已被系统缩放,直接相除即可\n// 自行缩放模式:需要除以 ratio 换算(harmony 特殊处理,ratio 已内嵌在 itemHeight 中)\nconst getSelectedIndex = (scrollTop: number, itemHeight: number, lengthScaleRatio: number = 1, useMeasuredScale: boolean = false): number => {\n if (!useMeasuredScale || process.env.TARO_PLATFORM === 'harmony') {\n return Math.round(scrollTop / itemHeight)\n }\n return Math.round(scrollTop / lengthScaleRatio / itemHeight)\n}\n\n// 计算单项高度(返回设计稿值)\nconst calculateItemHeight = (\n scrollView: TaroScrollView | null,\n lengthScaleRatio: number,\n useMeasuredScale: boolean = false,\n): number => {\n if (process.env.TARO_PLATFORM === 'harmony') {\n return useMeasuredScale ? PICKER_LINE_HEIGHT * lengthScaleRatio : PICKER_LINE_HEIGHT\n }\n if (scrollView && scrollView?.scrollHeight) {\n return useMeasuredScale\n ? scrollView.scrollHeight / lengthScaleRatio / scrollView.childNodes.length\n : scrollView.scrollHeight / scrollView.childNodes.length\n }\n console.warn('Height measurement anomaly')\n return PICKER_LINE_HEIGHT\n}\n\nexport function PickerGroupBasic(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n onColumnChange,\n selectedIndex = 0, // 使用selectedIndex参数,默认为0\n colors = {},\n enableClickItemScroll = true,\n } = props\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const [scrollIntoView, scrollToItemId] = usePickerItemScrollIntoView()\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n const selectedIndexPropRef = React.useRef(selectedIndex)\n selectedIndexPropRef.current = selectedIndex\n const syncScrollFromPropsRef = React.useRef(false)\n const pendingScrollSettleFocusRef = React.useRef(false)\n // 使用selectedIndex初始化当前索引\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n // 触摸状态用于优化用户体验\n const isTouchingRef = React.useRef(false)\n\n const lengthScaleRatioRef = React.useRef(1)\n const useMeasuredScaleRef = React.useRef(false)\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n\n // 初始化时计算 lengthScaleRatio 并判定缩放模式\n React.useEffect(() => {\n Taro.getSystemInfo({\n success: (res) => {\n lengthScaleRatioRef.current = calculateLengthScaleRatio(res)\n useMeasuredScaleRef.current = resolveUseMeasuredScale(res)\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n },\n fail: () => {\n lengthScaleRatioRef.current = 1\n useMeasuredScaleRef.current = false\n }\n })\n }, [])\n\n React.useEffect(() => {\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n }, [range.length]) // 只在range长度变化时重新计算\n\n // props 的 selectedIndex 变化:滚至对应项并短时标记程序化滚动(syncScrollFromPropsRef)\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouchingRef.current) {\n syncScrollFromPropsRef.current = true\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, undefined, lengthScaleRatioRef.current)\n setCurrentIndex(selectedIndex)\n const tid = setTimeout(() => {\n syncScrollFromPropsRef.current = false\n }, 400)\n return () => clearTimeout(tid)\n }\n }, [selectedIndex, range])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n // 滚动静止后归中并同步选中\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 100ms 内无新滚动则归中并提交索引\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop, itemHeightRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n\n const allowA11yFocus = !syncScrollFromPropsRef.current\n const shouldFocusOnScrollSettle = pendingScrollSettleFocusRef.current\n\n isTouchingRef.current = false\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset, lengthScaleRatioRef.current)\n updateIndex(newIndex, columnId)\n onColumnChange?.({ columnId, index: newIndex })\n pendingScrollSettleFocusRef.current = false\n if (allowA11yFocus && shouldFocusOnScrollSettle) {\n requestAccessibilityFocusOnView(itemRefs.current[newIndex])\n }\n syncScrollFromPropsRef.current = false\n isCenterTimerId.current = null\n }, 100)\n }\n // 滚动中:按 scrollTop 更新高亮索引\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const ih = itemHeightRef.current\n const newIndex = getSelectedIndex(scrollTop, ih, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n const spi = selectedIndexPropRef.current\n if (newIndex !== spi) {\n if (!syncScrollFromPropsRef.current || isTouchingRef.current) {\n pendingScrollSettleFocusRef.current = true\n }\n if (isTouchingRef.current) {\n syncScrollFromPropsRef.current = false\n }\n }\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n {...(enableClickItemScroll\n ? { onClick: () => scrollToItemId(`picker-item-${columnId}-${index}`) }\n : {})}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n const clickScrollViewProps = enableClickItemScroll\n ? { scrollIntoView, scrollIntoViewAlignment: 'center' as const }\n : {}\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{\n height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS,\n }}\n scrollTop={targetScrollTop}\n {...clickScrollViewProps}\n onScroll={handleScroll}\n onTouchStart={() => { isTouchingRef.current = true }}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 时间选择器实现\nexport function PickerGroupTime(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n selectedIndex = 0,\n colors = {},\n timeA11yLimitFocus,\n onTimeA11yLimitFocusConsumed,\n timeA11yLimitEventNonce,\n enableClickItemScroll = true,\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const [scrollIntoView, scrollToItemId] = usePickerItemScrollIntoView()\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n const selectedIndexPropRef = React.useRef(selectedIndex)\n selectedIndexPropRef.current = selectedIndex\n const syncScrollFromPropsRef = React.useRef(false)\n const prevLimitEventNonceRef = React.useRef<number | undefined>(undefined)\n const suppressScrollSettleFocusNonceRef = React.useRef<number | null>(null)\n const pendingScrollSettleFocusRef = React.useRef(false)\n const pendingLimitFocusRef = React.useRef<{ index: number, nonce: number, attempts: number } | null>(null)\n const limitFocusTimerRef = React.useRef<NodeJS.Timeout | null>(null)\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const isTouchingRef = React.useRef(false)\n\n const lengthScaleRatioRef = React.useRef(1)\n const useMeasuredScaleRef = React.useRef(false)\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n\n const clearLimitFocusTimer = React.useCallback(() => {\n if (limitFocusTimerRef.current) {\n clearTimeout(limitFocusTimerRef.current)\n limitFocusTimerRef.current = null\n }\n }, [])\n\n const tryFocusPendingLimit = React.useCallback(() => {\n const pending = pendingLimitFocusRef.current\n const scrollView = scrollViewRef.current\n if (!pending || !scrollView) return\n\n const visualIndex = getSelectedIndex(\n scrollView.scrollTop,\n itemHeightRef.current,\n lengthScaleRatioRef.current,\n useMeasuredScaleRef.current,\n )\n const isStable = visualIndex === pending.index\n\n if (!isStable) {\n if (pending.attempts >= 20) {\n pendingLimitFocusRef.current = null\n if (suppressScrollSettleFocusNonceRef.current === pending.nonce) {\n suppressScrollSettleFocusNonceRef.current = null\n }\n onTimeA11yLimitFocusConsumed?.()\n return\n }\n pending.attempts += 1\n clearLimitFocusTimer()\n limitFocusTimerRef.current = setTimeout(() => {\n tryFocusPendingLimit()\n }, 50)\n return\n }\n\n const node = itemRefs.current[pending.index]\n pendingLimitFocusRef.current = null\n if (suppressScrollSettleFocusNonceRef.current === pending.nonce) {\n suppressScrollSettleFocusNonceRef.current = null\n }\n clearLimitFocusTimer()\n requestAccessibilityFocusOnView(node)\n onTimeA11yLimitFocusConsumed?.()\n }, [clearLimitFocusTimer, onTimeA11yLimitFocusConsumed])\n\n const schedulePendingLimitFocus = React.useCallback(() => {\n if (!pendingLimitFocusRef.current) return\n clearLimitFocusTimer()\n limitFocusTimerRef.current = setTimeout(() => {\n tryFocusPendingLimit()\n }, 100)\n }, [clearLimitFocusTimer, tryFocusPendingLimit])\n\n React.useEffect(() => clearLimitFocusTimer, [clearLimitFocusTimer])\n\n // 初始化时计算 lengthScaleRatio 并判定缩放模式\n React.useEffect(() => {\n Taro.getSystemInfo({\n success: (res) => {\n lengthScaleRatioRef.current = calculateLengthScaleRatio(res)\n useMeasuredScaleRef.current = resolveUseMeasuredScale(res)\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n },\n fail: () => {\n lengthScaleRatioRef.current = 1\n useMeasuredScaleRef.current = false\n }\n })\n }, [])\n\n React.useEffect(() => {\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n }, [range.length]) // 只在range长度变化时重新计算\n\n // props 的 selectedIndex 变化:滚至对应项并短时标记程序化滚动(syncScrollFromPropsRef)\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouchingRef.current) {\n syncScrollFromPropsRef.current = true\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, undefined, lengthScaleRatioRef.current)\n setCurrentIndex(selectedIndex)\n const tid = setTimeout(() => {\n syncScrollFromPropsRef.current = false\n }, 400)\n return () => clearTimeout(tid)\n }\n }, [selectedIndex, range])\n\n // time 限位 nonce 变更:强制对齐 scrollTop(避免 remount 打断读屏焦点)\n React.useEffect(() => {\n if (!timeA11yLimitEventNonce) return\n if (!scrollViewRef.current || range.length === 0 || isTouchingRef.current) return\n syncScrollFromPropsRef.current = true\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, Math.random() * 0.001, lengthScaleRatioRef.current)\n setCurrentIndex(selectedIndex)\n const tid = setTimeout(() => {\n syncScrollFromPropsRef.current = false\n }, 400)\n return () => clearTimeout(tid)\n }, [timeA11yLimitEventNonce]) // 仅依赖 nonce,其余用 ref\n\n React.useLayoutEffect(() => {\n if (timeA11yLimitEventNonce === undefined) return\n const prev = prevLimitEventNonceRef.current\n prevLimitEventNonceRef.current = timeA11yLimitEventNonce\n if (timeA11yLimitEventNonce > 0 && (prev === undefined || timeA11yLimitEventNonce > prev)) {\n suppressScrollSettleFocusNonceRef.current = timeA11yLimitEventNonce\n }\n }, [timeA11yLimitEventNonce])\n\n // 限位后登记本列待聚焦项,稳定后再 requestAccessibilityFocus\n React.useEffect(() => {\n const req = timeA11yLimitFocus\n if (!req || req.columnId !== columnId) return\n const idx = selectedIndex\n const nonce = req.nonce\n pendingScrollSettleFocusRef.current = false\n pendingLimitFocusRef.current = { index: idx, nonce, attempts: 0 }\n schedulePendingLimitFocus()\n }, [timeA11yLimitFocus, columnId, selectedIndex, schedulePendingLimitFocus])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n\n // 滚动静止后归中并同步选中\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 100ms 内无新滚动则归中并提交索引\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop, itemHeightRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n const allowA11yFocus = !syncScrollFromPropsRef.current\n const shouldFocusOnScrollSettle = pendingScrollSettleFocusRef.current\n isTouchingRef.current = false\n const isLimited = Boolean(updateIndex(newIndex, columnId, true))\n const hasPendingLimitFocus = pendingLimitFocusRef.current != null\n if (isLimited) {\n pendingScrollSettleFocusRef.current = false\n }\n if (!isLimited) {\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset, lengthScaleRatioRef.current)\n }\n if (!isLimited && hasPendingLimitFocus) {\n pendingScrollSettleFocusRef.current = false\n schedulePendingLimitFocus()\n syncScrollFromPropsRef.current = false\n isCenterTimerId.current = null\n return\n }\n if (!isLimited && pendingLimitFocusRef.current == null && suppressScrollSettleFocusNonceRef.current != null) {\n suppressScrollSettleFocusNonceRef.current = null\n }\n const suppressByLimitNonce = suppressScrollSettleFocusNonceRef.current != null\n if (!isLimited && allowA11yFocus && shouldFocusOnScrollSettle) {\n pendingScrollSettleFocusRef.current = false\n if (!suppressByLimitNonce) {\n requestAccessibilityFocusOnView(itemRefs.current[newIndex])\n }\n }\n syncScrollFromPropsRef.current = false\n isCenterTimerId.current = null\n }, 100)\n }\n\n // 滚动中:按 scrollTop 更新高亮索引\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const ih = itemHeightRef.current\n const newIndex = getSelectedIndex(scrollTop, ih, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n const spi = selectedIndexPropRef.current\n if (newIndex !== spi) {\n if (!syncScrollFromPropsRef.current || isTouchingRef.current) {\n pendingScrollSettleFocusRef.current = true\n }\n if (isTouchingRef.current) {\n syncScrollFromPropsRef.current = false\n }\n }\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n if (pendingLimitFocusRef.current) {\n schedulePendingLimitFocus()\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n {...(enableClickItemScroll\n ? { onClick: () => scrollToItemId(`picker-item-${columnId}-${index}`) }\n : {})}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n const clickScrollViewProps = enableClickItemScroll\n ? { scrollIntoView, scrollIntoViewAlignment: 'center' as const }\n : {}\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{\n height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS,\n }}\n scrollTop={targetScrollTop}\n {...clickScrollViewProps}\n onScroll={handleScroll}\n onTouchStart={() => { isTouchingRef.current = true }}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 日期选择器实现\nexport function PickerGroupDate(props: PickerGroupProps) {\n const {\n range = [],\n columnId,\n updateDay,\n selectedIndex = 0,\n colors = {},\n enableClickItemScroll = true,\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const [scrollIntoView, scrollToItemId] = usePickerItemScrollIntoView()\n const scrollViewRef = React.useRef<TaroScrollView>(null)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n const selectedIndexPropRef = React.useRef(selectedIndex)\n selectedIndexPropRef.current = selectedIndex\n const syncScrollFromPropsRef = React.useRef(false)\n const pendingScrollSettleFocusRef = React.useRef(false)\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const isTouchingRef = React.useRef(false)\n\n const lengthScaleRatioRef = React.useRef(1)\n const useMeasuredScaleRef = React.useRef(false)\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n\n // 初始化时计算 lengthScaleRatio 并判定缩放模式\n React.useEffect(() => {\n Taro.getSystemInfo({\n success: (res) => {\n lengthScaleRatioRef.current = calculateLengthScaleRatio(res)\n useMeasuredScaleRef.current = resolveUseMeasuredScale(res)\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n },\n fail: () => {\n lengthScaleRatioRef.current = 1\n useMeasuredScaleRef.current = false\n }\n })\n }, [])\n\n React.useEffect(() => {\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n }, [range.length]) // 只在range长度变化时重新计算\n\n // props 的 selectedIndex 变化:滚至对应项并短时标记程序化滚动(syncScrollFromPropsRef)\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouchingRef.current) {\n syncScrollFromPropsRef.current = true\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, undefined, lengthScaleRatioRef.current)\n setCurrentIndex(selectedIndex)\n const tid = setTimeout(() => {\n syncScrollFromPropsRef.current = false\n }, 400)\n return () => clearTimeout(tid)\n }\n }, [selectedIndex, range])\n\n // 是否处于归中状态\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n\n // 滚动静止后归中并同步选中\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n\n // 100ms 内无新滚动则归中并提交索引\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop, itemHeightRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n\n const allowA11yFocus = !syncScrollFromPropsRef.current\n const shouldFocusOnScrollSettle = pendingScrollSettleFocusRef.current\n\n isTouchingRef.current = false\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset, lengthScaleRatioRef.current)\n\n // 更新日期值\n if (updateDay) {\n // 解析文本中的数字(移除年、月、日等后缀)\n const valueText = range[newIndex] || ''\n const numericValue = parseInt(valueText.replace(/[^0-9]/g, ''))\n updateDay(isNaN(numericValue) ? 0 : numericValue, parseInt(columnId))\n }\n pendingScrollSettleFocusRef.current = false\n if (allowA11yFocus && shouldFocusOnScrollSettle) {\n requestAccessibilityFocusOnView(itemRefs.current[newIndex])\n }\n syncScrollFromPropsRef.current = false\n isCenterTimerId.current = null\n }, 100)\n }\n\n // 滚动中:按 scrollTop 更新高亮索引\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const ih = itemHeightRef.current\n const newIndex = getSelectedIndex(scrollTop, ih, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n const spi = selectedIndexPropRef.current\n if (newIndex !== spi) {\n if (!syncScrollFromPropsRef.current || isTouchingRef.current) {\n pendingScrollSettleFocusRef.current = true\n }\n if (isTouchingRef.current) {\n syncScrollFromPropsRef.current = false\n }\n }\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n {...(enableClickItemScroll\n ? { onClick: () => scrollToItemId(`picker-item-${columnId}-${index}`) }\n : {})}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {item}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n\n const clickScrollViewProps = enableClickItemScroll\n ? { scrollIntoView, scrollIntoViewAlignment: 'center' as const }\n : {}\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{ height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS }}\n scrollTop={targetScrollTop}\n {...clickScrollViewProps}\n onScroll={handleScroll}\n onTouchStart={() => { isTouchingRef.current = true }}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 地区选择器实现\nexport function PickerGroupRegion(props: PickerGroupProps) {\n const {\n range = [],\n rangeKey,\n columnId,\n updateIndex,\n selectedIndex = 0, // 使用selectedIndex参数,默认为0\n colors = {},\n enableClickItemScroll = true,\n } = props\n\n const indicatorStyle = colors.lineColor ? getIndicatorStyle(colors.lineColor) : null\n const scrollViewRef = React.useRef<any>(null)\n const [targetScrollTop, setTargetScrollTop] = React.useState(0)\n const [scrollIntoView, scrollToItemId] = usePickerItemScrollIntoView()\n const [currentIndex, setCurrentIndex] = React.useState(selectedIndex)\n const isTouchingRef = React.useRef(false)\n\n const lengthScaleRatioRef = React.useRef(1)\n const useMeasuredScaleRef = React.useRef(false)\n const itemHeightRef = React.useRef(PICKER_LINE_HEIGHT)\n const itemRefs = React.useRef<Array<TaroView | null>>([])\n const selectedIndexPropRef = React.useRef(selectedIndex)\n selectedIndexPropRef.current = selectedIndex\n const syncScrollFromPropsRef = React.useRef(false)\n const pendingScrollSettleFocusRef = React.useRef(false)\n\n // 初始化时计算 lengthScaleRatio 并判定缩放模式\n React.useEffect(() => {\n Taro.getSystemInfo({\n success: (res) => {\n lengthScaleRatioRef.current = calculateLengthScaleRatio(res)\n useMeasuredScaleRef.current = resolveUseMeasuredScale(res)\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n },\n fail: () => {\n lengthScaleRatioRef.current = 1\n useMeasuredScaleRef.current = false\n }\n })\n }, [])\n\n React.useEffect(() => {\n itemHeightRef.current = calculateItemHeight(scrollViewRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n }, [range.length]) // 只在range长度变化时重新计算\n\n // props 的 selectedIndex 变化:滚至对应项并短时标记程序化滚动(syncScrollFromPropsRef)\n React.useEffect(() => {\n if (scrollViewRef.current && range.length > 0 && !isTouchingRef.current) {\n syncScrollFromPropsRef.current = true\n const baseValue = selectedIndex * itemHeightRef.current\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, undefined, lengthScaleRatioRef.current)\n setCurrentIndex(selectedIndex)\n const tid = setTimeout(() => {\n syncScrollFromPropsRef.current = false\n }, 400)\n return () => clearTimeout(tid)\n }\n }, [selectedIndex, range])\n\n // 滚动静止后归中(debounce)\n const isCenterTimerId = React.useRef<NodeJS.Timeout | null>(null)\n const handleScrollEnd = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n // 100ms 内无新滚动则归中并提交索引\n isCenterTimerId.current = setTimeout(() => {\n if (!scrollViewRef.current) return\n\n const scrollTop = scrollViewRef.current.scrollTop\n const newIndex = getSelectedIndex(scrollTop, itemHeightRef.current, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n\n const allowA11yFocus = !syncScrollFromPropsRef.current\n const shouldFocusOnScrollSettle = pendingScrollSettleFocusRef.current\n\n isTouchingRef.current = false\n const baseValue = newIndex * itemHeightRef.current\n const randomOffset = Math.random() * 0.001 // 随机数为了在一个项内滚动时强制刷新\n setTargetScrollTopWithScale(setTargetScrollTop, baseValue, randomOffset, lengthScaleRatioRef.current)\n updateIndex(newIndex, columnId, false, allowA11yFocus)\n pendingScrollSettleFocusRef.current = false\n if (allowA11yFocus && shouldFocusOnScrollSettle) {\n requestAccessibilityFocusOnView(itemRefs.current[newIndex])\n }\n syncScrollFromPropsRef.current = false\n isCenterTimerId.current = null\n }, 100)\n }\n\n // 滚动中:按 scrollTop 更新高亮索引\n const handleScroll = () => {\n if (!scrollViewRef.current) return\n if (isCenterTimerId.current) {\n clearTimeout(isCenterTimerId.current)\n isCenterTimerId.current = null\n }\n const scrollTop = scrollViewRef.current.scrollTop\n const ih = itemHeightRef.current\n const newIndex = getSelectedIndex(scrollTop, ih, lengthScaleRatioRef.current, useMeasuredScaleRef.current)\n const spi = selectedIndexPropRef.current\n if (newIndex !== spi) {\n if (!syncScrollFromPropsRef.current || isTouchingRef.current) {\n pendingScrollSettleFocusRef.current = true\n }\n if (isTouchingRef.current) {\n syncScrollFromPropsRef.current = false\n }\n }\n if (newIndex !== currentIndex) {\n setCurrentIndex(newIndex)\n }\n }\n\n // 渲染选项\n const pickerItem = range.map((item, index) => {\n const content = rangeKey && item && typeof item === 'object' ? item[rangeKey] : item\n\n return (\n <View\n id={`picker-item-${columnId}-${index}`}\n key={index}\n ref={(el) => (itemRefs.current[index] = el)}\n className={`taro-picker__item${index === currentIndex ? ' taro-picker__item--selected' : ''}`}\n {...(enableClickItemScroll\n ? { onClick: () => scrollToItemId(`picker-item-${columnId}-${index}`) }\n : {})}\n style={{\n height: PICKER_LINE_HEIGHT,\n color: index === currentIndex\n ? (colors.itemSelectedColor || undefined)\n : (colors.itemDefaultColor || undefined)\n }}\n >\n {content}\n </View>\n )\n })\n\n const realPickerItems = [\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-top-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ...pickerItem,\n ...new Array(PICKER_BLANK_ITEMS)\n .fill(null)\n .map((_, idx) => (\n <View\n key={`blank-bottom-${idx}`}\n className=\"taro-picker__item taro-picker__item--blank\"\n style={{ height: PICKER_LINE_HEIGHT }}\n />\n )),\n ]\n const clickScrollViewProps = enableClickItemScroll\n ? { scrollIntoView, scrollIntoViewAlignment: 'center' as const }\n : {}\n\n return (\n <View className=\"taro-picker__group\">\n <View className=\"taro-picker__mask\" />\n <View\n className=\"taro-picker__indicator\"\n {...(indicatorStyle ? { style: indicatorStyle } : {})}\n />\n <ScrollView\n ref={scrollViewRef}\n scrollY\n showScrollbar={false}\n className=\"taro-picker__content\"\n style={{ height: PICKER_LINE_HEIGHT * PICKER_VISIBLE_ITEMS }}\n scrollTop={targetScrollTop}\n {...clickScrollViewProps}\n onScroll={handleScroll}\n onTouchStart={() => { isTouchingRef.current = true }}\n onScrollEnd={handleScrollEnd}\n scrollWithAnimation\n >\n {realPickerItems}\n </ScrollView>\n </View>\n )\n}\n\n// 默认导出,根据 mode 自动分发\nexport function PickerGroup(props: PickerGroupProps) {\n switch (props.mode) {\n case 'time':\n return <PickerGroupTime {...props} />\n case 'date':\n return <PickerGroupDate {...props} />\n case 'region':\n return <PickerGroupRegion {...props} />\n default:\n return <PickerGroupBasic {...props} />\n }\n}\n"],"names":["requestAccessibilityFocusOnView","node","fn","Taro","setAccessibilityFocus","viewRef","current","usePickerItemScrollIntoView","scrollIntoView","setScrollIntoView","React","useState","pulseRef","useRef","scrollToItemId","useCallback","itemId","token","setTimeout","PICKER_LINE_HEIGHT","PICKER_VISIBLE_ITEMS","PICKER_BLANK_ITEMS","getIndicatorStyle","lineColor","borderTopColor","borderBottomColor","MIN_DESIGN_APP_VERSION","resolveUseMeasuredScale","res","process","env","TARO_ENV","designAppVersionRaw","designAppVersion","designAppVersionMajor","parseInt","String","trim","Number","NaN","isFinite","platform","toLowerCase","calculateLengthScaleRatio","lengthScaleRatio","console","warn","windowWidth","shortSide","windowHeight","isBigScreen","setTargetScrollTopWithScale","setTargetScrollTop","baseValue","randomOffset","arguments","length","undefined","finalValue","TARO_PLATFORM","scaledValue","getSelectedIndex","scrollTop","itemHeight","useMeasuredScale","Math","round","calculateItemHeight","scrollView","scrollHeight","childNodes","PickerGroupBasic","props","range","rangeKey","columnId","updateIndex","onColumnChange","selectedIndex","colors","enableClickItemScroll","indicatorStyle","targetScrollTop","scrollViewRef","itemRefs","selectedIndexPropRef","syncScrollFromPropsRef","pendingScrollSettleFocusRef","currentIndex","setCurrentIndex","isTouchingRef","lengthScaleRatioRef","useMeasuredScaleRef","itemHeightRef","useEffect","getSystemInfo","success","fail","tid","clearTimeout","isCenterTimerId","handleScrollEnd","newIndex","allowA11yFocus","shouldFocusOnScrollSettle","random","index","handleScroll","ih","spi","pickerItem","map","item","content","_$createComponent","View","_$mergeProps","id","key","ref","el","className","onClick","style","height","color","itemSelectedColor","itemDefaultColor","children","realPickerItems","Array","fill","_","idx","clickScrollViewProps","scrollIntoViewAlignment","ScrollView","scrollY","showScrollbar","onScroll","onTouchStart","onScrollEnd","scrollWithAnimation","PickerGroupTime","timeA11yLimitFocus","onTimeA11yLimitFocusConsumed","timeA11yLimitEventNonce","prevLimitEventNonceRef","suppressScrollSettleFocusNonceRef","pendingLimitFocusRef","limitFocusTimerRef","clearLimitFocusTimer","tryFocusPendingLimit","pending","visualIndex","isStable","attempts","nonce","schedulePendingLimitFocus","useLayoutEffect","prev","req","isLimited","Boolean","hasPendingLimitFocus","suppressByLimitNonce","PickerGroupDate","updateDay","valueText","numericValue","replace","isNaN","PickerGroupRegion","PickerGroup","mode"],"mappings":";;;;;AAQA,SAASA,+BAA+BA,CAACC,IAAiC,EAAA;EACxE,IAAIA,IAAI,IAAI,IAAI,EAAE;AAClB,EAAA,MAAMC,EAAE,GAAIC,IAAY,CAACC,qBAAqB;AAC9C,EAAA,IAAI,OAAOF,EAAE,KAAK,UAAU,EAAE;AAC9BA,EAAAA,EAAE,CAAC;AAAEG,IAAAA,OAAO,EAAE;AAAEC,MAAAA,OAAO,EAAEL;AAAI;AAA4B,GAAA,CAAC;AAC5D;AAEA;AACA,SAASM,2BAA2BA,GAAA;EAClC,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGC,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC;AAC9D,EAAA,MAAMC,QAAQ,GAAGF,KAAK,CAACG,MAAM,CAAC,CAAC,CAAC;AAEhC,EAAA,MAAMC,cAAc,GAAGJ,KAAK,CAACK,WAAW,CAAEC,MAAc,IAAI;IAC1DJ,QAAQ,CAACN,OAAO,IAAI,CAAC;AACrB,IAAA,MAAMW,KAAK,GAAGL,QAAQ,CAACN,OAAO;IAC9BG,iBAAiB,CAAC,EAAE,CAAC;AACrBS,IAAAA,U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AU,EAAApB,UAAA,CAAA;AAAAG,QAAAA,GAAA,EACJpC,aAAa;QAClBsD,OAAO,EAAA,IAAA;AACPC,QAAAA,aAAa,EAAE,KAAK;QACpBjB,SAAS,EAAA,sBAAA;AACTE,QAAAA,KAAK,EAAE;UAAEC,MAAM,EAAEzG,kBAAkB,GAAGC;SAAsB;AAC5D0C,QAAAA,SAAS,EAAEoB;AAAe,OAAA,EACtBoD,oBAAoB,EAAA;AACxBK,QAAAA,QAAQ,EAAEhC,YAAY;QACtBiC,YAAY,EAAEA,MAAK;UAAGlD,aAAa,CAACpF,OAAO,GAAG,IAAI;SAAE;AACpDuI,QAAAA,WAAW,EAAExC,eAAe;QAC5ByC,mBAAmB,EAAA,IAAA;AAAAd,QAAAA,QAAA,EAElBC;AAAe,OAAA,CAAA,CAAA,CAAA;AAAA;AAAA,GAAA,CAAA;AAIxB;AAEA;AACM,SAAU4C,WAAWA,CAACrG,KAAuB,EAAA;EACjD,QAAQA,KAAK,CAACsG,IAAI;AAChB,IAAA,KAAK,MAAM;AACT,MAAA,OAAA5D,eAAA,CAAQ6B,eAAe,EAAKvE,KAAK,CAAA;AACnC,IAAA,KAAK,MAAM;AACT,MAAA,OAAA0C,eAAA,CAAQoD,eAAe,EAAK9F,KAAK,CAAA;AACnC,IAAA,KAAK,QAAQ;AACX,MAAA,OAAA0C,eAAA,CAAQ0D,iBAAiB,EAAKpG,KAAK,CAAA;AACrC,IAAA;AACE,MAAA,OAAA0C,eAAA,CAAQ3C,gBAAgB,EAAKC,KAAK,CAAA;AACtC;AACF;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const Refresher = () => {
|
|
2
|
+
return null;
|
|
3
|
+
};
|
|
4
|
+
Refresher.displayName = 'Refresher';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
const Refresher = View;
|
|
5
|
-
|
|
6
|
-
export { Refresher as default };
|
|
6
|
+
export { Refresher, Refresher as default };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/refresher/index.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/refresher/index.tsx"],"sourcesContent":["import React from 'react'\n\n/**\n * Refresher 组件 - 下拉刷新(标记组件)\n *\n * 以各平台 ScrollView 的 refresher 落地为准:\n * - weapp/jd/tt: ScrollView.refresher-enabled / bindRefresherPulling 等\n * - 本组件为标记组件,不渲染 DOM,仅向 List 等传配置;实际下拉逻辑由 List/ScrollView 内 useRefresher 或原生 refresher 处理。\n *\n * 高度规则:\n * - 无 children:使用默认 50px 高度\n * - 有 children:由 children 内容撑开高度\n *\n * children:用于替换「加载楼层」中间的显示内容;不传则使用默认文案(下拉刷新/释放刷新/加载中...)。\n * 小程序自定义需配合 refresherDefaultStyle=\"none\"。\n *\n * @example 使用默认文案(50px 高度)\n * <Refresher refresherEnabled refresherThreshold={50} onRefresherRefresh={fetchData} />\n *\n * @example 自定义内容(由内容撑开高度)\n * <Refresher refresherEnabled refresherDefaultStyle=\"none\" onRefresherRefresh={fetchData}>\n * <View style={{ height: 60, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n * <Text>下拉刷新</Text>\n * </View>\n * </Refresher>\n */\n\n/** 与 ScrollView.d.ts 的 refresher 相关属性、事件对齐 */\nexport interface RefresherProps {\n refresherEnabled?: boolean\n refresherThreshold?: number\n refresherDefaultStyle?: 'black' | 'white' | 'none'\n refresherBackground?: string\n refresherTriggered?: boolean\n /** 自定义刷新内容(替换默认「下拉刷新/释放刷新/加载中...」文案) */\n children?: React.ReactNode\n onRefresherPulling?: (e?: { detail?: { deltaY?: number } }) => void\n onRefresherRefresh?: () => void | Promise<void>\n onRefresherRestore?: () => void\n onRefresherAbort?: () => void\n onRefresherWillRefresh?: () => void\n onRefresherStatusChange?: (e?: { detail?: { status?: number, dy?: number } }) => void\n}\n\nconst Refresher: React.FC<RefresherProps> = () => {\n return null\n}\n\nRefresher.displayName = 'Refresher'\n\nexport { Refresher }\nexport default Refresher\n"],"names":["Refresher","displayName"],"mappings":"AA4CMA,MAAAA,SAAS,GAA6BA,MAAK;AAC/C,EAAA,OAAO,IAAI;AACb;AAEAA,SAAS,CAACC,WAAW,GAAG,WAAW;;;;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { template, use, insert, effect, style, delegateEvents } from 'solid-js/web';
|
|
1
|
+
import { template, createComponent, use, insert, effect, style, delegateEvents } from 'solid-js/web';
|
|
2
2
|
import './style/index.scss.js';
|
|
3
3
|
import { isFunction } from '@tarojs/shared';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
+
import { ScrollElementContext } from '../../contexts/ScrollElementContext.js';
|
|
5
6
|
import { throttle, createForwardRefComponent } from '../../utils/index.js';
|
|
6
|
-
import { useRef, useEffect } from '../../utils/hooks.solid.js';
|
|
7
|
+
import { useRef, useState, useEffect } from '../../utils/hooks.solid.js';
|
|
7
8
|
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/template(`<div>`);
|
|
9
10
|
function easeOutScroll() {
|
|
@@ -31,16 +32,18 @@ function easeOutScroll() {
|
|
|
31
32
|
}
|
|
32
33
|
step();
|
|
33
34
|
}
|
|
35
|
+
/** 未开启的滚动轴使用 nearest 避免原生 scrollIntoView 沿该轴滚动整页 */
|
|
34
36
|
function scrollIntoView() {
|
|
35
37
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
36
|
-
let
|
|
37
|
-
let
|
|
38
|
-
let
|
|
38
|
+
let animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
39
|
+
let scrollX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
40
|
+
let scrollY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
41
|
+
let scrollIntoViewAlignment = arguments.length > 4 ? arguments[4] : undefined;
|
|
39
42
|
var _a;
|
|
40
43
|
(_a = document.querySelector(`#${id}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
41
44
|
behavior: animated ? 'smooth' : 'auto',
|
|
42
|
-
block:
|
|
43
|
-
inline:
|
|
45
|
+
block: scrollY ? scrollIntoViewAlignment || 'center' : 'nearest',
|
|
46
|
+
inline: scrollX ? scrollIntoViewAlignment || 'start' : 'nearest'
|
|
44
47
|
});
|
|
45
48
|
}
|
|
46
49
|
function scrollVertical(container, scrollTop, top, isAnimation) {
|
|
@@ -63,48 +66,65 @@ function scrollHorizontal(container, scrollLeft, left, isAnimation) {
|
|
|
63
66
|
}
|
|
64
67
|
scrollLeft.current = left;
|
|
65
68
|
}
|
|
69
|
+
/** H5 等环境下 scrollTop 为整数,与带亚像素的受控值比较时允许该误差,避免反复 set scrollTop 与 scrollIntoView 打架 */
|
|
70
|
+
const CONTROLLED_SCROLL_EPSILON = 0.5;
|
|
66
71
|
function ScrollView(props) {
|
|
72
|
+
var _a;
|
|
67
73
|
const _scrollTop = useRef(null);
|
|
68
74
|
const _scrollLeft = useRef(null);
|
|
69
75
|
const container = useRef(null);
|
|
70
76
|
const scrollEndTimerRef = useRef(null);
|
|
71
77
|
const isScrollingRef = useRef(false);
|
|
72
78
|
const isInitializedRef = useRef(false);
|
|
79
|
+
/** 与 props.scrollIntoView 比对,同 id 时只走受控 scrollTop,避免与上次锚点反复互顶 */
|
|
80
|
+
const lastAppliedScrollIntoViewIdRef = useRef(null);
|
|
81
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
73
82
|
const onTouchMove = e => {
|
|
74
83
|
e.stopPropagation();
|
|
75
84
|
};
|
|
85
|
+
const applyControlledScrollTopLeft = p => {
|
|
86
|
+
const isAnimation = !!p.scrollWithAnimation;
|
|
87
|
+
const eps = CONTROLLED_SCROLL_EPSILON;
|
|
88
|
+
if (p.scrollY && typeof p.scrollTop === 'number' && (_scrollTop.current === null || Math.abs(p.scrollTop - _scrollTop.current) >= eps)) {
|
|
89
|
+
setTimeout(() => scrollVertical(container, _scrollTop, p.scrollTop, isAnimation), 10);
|
|
90
|
+
}
|
|
91
|
+
if (p.scrollX && typeof p.scrollLeft === 'number' && (_scrollLeft.current === null || Math.abs(p.scrollLeft - _scrollLeft.current) >= eps)) {
|
|
92
|
+
setTimeout(() => scrollHorizontal(container, _scrollLeft, p.scrollLeft, isAnimation), 10);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
76
95
|
const handleScroll = function (props) {
|
|
77
96
|
let isInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
78
|
-
// scrollIntoView
|
|
79
97
|
if (props.scrollIntoView && typeof props.scrollIntoView === 'string' && document && document.querySelector && document.querySelector(`#${props.scrollIntoView}`)) {
|
|
80
|
-
const isHorizontal = props.scrollX && !props.scrollY;
|
|
81
98
|
if (isInit) {
|
|
82
|
-
setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation,
|
|
99
|
+
setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, !!props.scrollX, !!props.scrollY, props.scrollIntoViewAlignment), 500);
|
|
83
100
|
} else {
|
|
84
|
-
scrollIntoView(props.scrollIntoView, props.scrollWithAnimation,
|
|
101
|
+
scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, !!props.scrollX, !!props.scrollY, props.scrollIntoViewAlignment);
|
|
85
102
|
}
|
|
86
103
|
} else {
|
|
87
|
-
|
|
88
|
-
// Y 轴滚动
|
|
89
|
-
if (props.scrollY && typeof props.scrollTop === 'number' && props.scrollTop !== _scrollTop.current) {
|
|
90
|
-
setTimeout(() => scrollVertical(container, _scrollTop, props.scrollTop, isAnimation), 10);
|
|
91
|
-
}
|
|
92
|
-
// X 轴滚动
|
|
93
|
-
if (props.scrollX && typeof props.scrollLeft === 'number' && props.scrollLeft !== _scrollLeft.current) {
|
|
94
|
-
setTimeout(() => scrollHorizontal(container, _scrollLeft, props.scrollLeft, isAnimation), 10);
|
|
95
|
-
}
|
|
104
|
+
applyControlledScrollTopLeft(props);
|
|
96
105
|
}
|
|
97
106
|
};
|
|
98
107
|
useEffect(() => {
|
|
99
108
|
handleScroll(props, true);
|
|
100
109
|
isInitializedRef.current = true;
|
|
101
110
|
}, []);
|
|
102
|
-
//
|
|
111
|
+
// scrollTop / scrollLeft / scrollIntoView 受控同步(跳过 mount 时的 init effect)
|
|
103
112
|
useEffect(() => {
|
|
104
|
-
if (isInitializedRef.current
|
|
105
|
-
|
|
113
|
+
if (!isInitializedRef.current || !container.current) return;
|
|
114
|
+
const sitv = props.scrollIntoView;
|
|
115
|
+
const sitvOk = Boolean(sitv && typeof sitv === 'string' && document && document.querySelector && document.querySelector(`#${sitv}`));
|
|
116
|
+
if (sitvOk) {
|
|
117
|
+
if (sitv !== lastAppliedScrollIntoViewIdRef.current) {
|
|
118
|
+
scrollIntoView(sitv, props.scrollWithAnimation, !!props.scrollX, !!props.scrollY, props.scrollIntoViewAlignment);
|
|
119
|
+
lastAppliedScrollIntoViewIdRef.current = typeof sitv === 'string' ? sitv : null;
|
|
120
|
+
} else {
|
|
121
|
+
applyControlledScrollTopLeft(props);
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
lastAppliedScrollIntoViewIdRef.current = null;
|
|
125
|
+
applyControlledScrollTopLeft(props);
|
|
106
126
|
}
|
|
107
|
-
}, [props.scrollTop, props.scrollLeft, props.scrollIntoView]);
|
|
127
|
+
}, [props.scrollTop, props.scrollLeft, props.scrollIntoView, props.scrollIntoViewAlignment, props.scrollWithAnimation, props.scrollX, props.scrollY]);
|
|
108
128
|
const {
|
|
109
129
|
className,
|
|
110
130
|
style: style$1 = {},
|
|
@@ -214,23 +234,47 @@ function ScrollView(props) {
|
|
|
214
234
|
}
|
|
215
235
|
};
|
|
216
236
|
}, []);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (e) {
|
|
225
|
-
container.current = e;
|
|
226
|
-
if (props.forwardedRef) props.forwardedRef.current = e;
|
|
237
|
+
// ScrollElementContext:嵌套滚动时向子组件提供 scrollRef、containerHeight、startOffset
|
|
238
|
+
useEffect(() => {
|
|
239
|
+
const el = container.current;
|
|
240
|
+
if (!el) return;
|
|
241
|
+
const update = () => {
|
|
242
|
+
if (container.current) {
|
|
243
|
+
setContainerHeight(container.current.clientHeight);
|
|
227
244
|
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
};
|
|
246
|
+
update();
|
|
247
|
+
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null;
|
|
248
|
+
if (ro) {
|
|
249
|
+
ro.observe(el);
|
|
250
|
+
return () => ro.disconnect();
|
|
251
|
+
}
|
|
252
|
+
}, []);
|
|
253
|
+
const scrollElementContextValue = {
|
|
254
|
+
scrollRef: container,
|
|
255
|
+
containerHeight,
|
|
256
|
+
startOffset: (_a = props.startOffset) !== null && _a !== void 0 ? _a : 0
|
|
257
|
+
};
|
|
258
|
+
return createComponent(ScrollElementContext.Provider, {
|
|
259
|
+
value: scrollElementContextValue,
|
|
260
|
+
get children() {
|
|
261
|
+
var _el$ = _tmpl$();
|
|
262
|
+
_el$.$$touchend = _onTouchEnd;
|
|
263
|
+
_el$.$$touchstart = _onTouchStart;
|
|
264
|
+
_el$.$$touchmove = _onTouchMove;
|
|
265
|
+
_el$.addEventListener("scroll", _onScroll);
|
|
266
|
+
use(e => {
|
|
267
|
+
if (e) {
|
|
268
|
+
container.current = e;
|
|
269
|
+
if (props.forwardedRef) props.forwardedRef.current = e;
|
|
270
|
+
}
|
|
271
|
+
}, _el$);
|
|
272
|
+
_el$.className = cls;
|
|
273
|
+
insert(_el$, () => props.children);
|
|
274
|
+
effect(_$p => style(_el$, style$1, _$p));
|
|
275
|
+
return _el$;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
234
278
|
}
|
|
235
279
|
var index = createForwardRefComponent(ScrollView);
|
|
236
280
|
delegateEvents(["touchmove", "touchstart", "touchend"]);
|