@tarojs/components-react 4.2.1-beta.2 → 4.2.1-beta.3

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 (77) hide show
  1. package/dist/components/image/index.js +3 -5
  2. package/dist/components/image/index.js.map +1 -1
  3. package/dist/components/picker/index.js +38 -110
  4. package/dist/components/picker/index.js.map +1 -1
  5. package/dist/components/picker/picker-group.js +127 -477
  6. package/dist/components/picker/picker-group.js.map +1 -1
  7. package/dist/components/refresher/index.js +5 -5
  8. package/dist/components/refresher/index.js.map +1 -1
  9. package/dist/components/scroll-view/index.js +36 -80
  10. package/dist/components/scroll-view/index.js.map +1 -1
  11. package/dist/index.css +1 -1
  12. package/dist/index.js +2 -6
  13. package/dist/index.js.map +1 -1
  14. package/dist/original/components/image/index.js +3 -5
  15. package/dist/original/components/image/index.js.map +1 -1
  16. package/dist/original/components/image/style/index.scss +1 -5
  17. package/dist/original/components/picker/index.js +38 -110
  18. package/dist/original/components/picker/index.js.map +1 -1
  19. package/dist/original/components/picker/picker-group.js +127 -477
  20. package/dist/original/components/picker/picker-group.js.map +1 -1
  21. package/dist/original/components/picker/style/index.scss +8 -9
  22. package/dist/original/components/refresher/index.js +5 -5
  23. package/dist/original/components/refresher/index.js.map +1 -1
  24. package/dist/original/components/scroll-view/index.js +36 -80
  25. package/dist/original/components/scroll-view/index.js.map +1 -1
  26. package/dist/original/index.js +2 -6
  27. package/dist/original/index.js.map +1 -1
  28. package/dist/solid/components/image/index.js +3 -5
  29. package/dist/solid/components/image/index.js.map +1 -1
  30. package/dist/solid/components/picker/index.js +45 -121
  31. package/dist/solid/components/picker/index.js.map +1 -1
  32. package/dist/solid/components/picker/picker-group.js +151 -500
  33. package/dist/solid/components/picker/picker-group.js.map +1 -1
  34. package/dist/solid/components/refresher/index.js +5 -5
  35. package/dist/solid/components/refresher/index.js.map +1 -1
  36. package/dist/solid/components/scroll-view/index.js +40 -84
  37. package/dist/solid/components/scroll-view/index.js.map +1 -1
  38. package/dist/solid/index.css +1 -1
  39. package/dist/solid/index.js +1 -1
  40. package/package.json +6 -8
  41. package/dist/components/map/MapContext.js +0 -628
  42. package/dist/components/map/MapContext.js.map +0 -1
  43. package/dist/components/map/MapCustomCallout.js +0 -91
  44. package/dist/components/map/MapCustomCallout.js.map +0 -1
  45. package/dist/components/map/common.js +0 -4
  46. package/dist/components/map/common.js.map +0 -1
  47. package/dist/components/map/createMapContext.js +0 -34
  48. package/dist/components/map/createMapContext.js.map +0 -1
  49. package/dist/components/map/handler.js +0 -50
  50. package/dist/components/map/handler.js.map +0 -1
  51. package/dist/components/map/index.js +0 -329
  52. package/dist/components/map/index.js.map +0 -1
  53. package/dist/components/switch/index.js +0 -125
  54. package/dist/components/switch/index.js.map +0 -1
  55. package/dist/components/switch/style/index.scss.js +0 -4
  56. package/dist/components/switch/style/index.scss.js.map +0 -1
  57. package/dist/contexts/ScrollElementContext.js +0 -6
  58. package/dist/contexts/ScrollElementContext.js.map +0 -1
  59. package/dist/original/components/map/MapContext.js +0 -628
  60. package/dist/original/components/map/MapContext.js.map +0 -1
  61. package/dist/original/components/map/MapCustomCallout.js +0 -91
  62. package/dist/original/components/map/MapCustomCallout.js.map +0 -1
  63. package/dist/original/components/map/common.js +0 -4
  64. package/dist/original/components/map/common.js.map +0 -1
  65. package/dist/original/components/map/createMapContext.js +0 -34
  66. package/dist/original/components/map/createMapContext.js.map +0 -1
  67. package/dist/original/components/map/handler.js +0 -50
  68. package/dist/original/components/map/handler.js.map +0 -1
  69. package/dist/original/components/map/index.js +0 -329
  70. package/dist/original/components/map/index.js.map +0 -1
  71. package/dist/original/components/switch/index.js +0 -125
  72. package/dist/original/components/switch/index.js.map +0 -1
  73. package/dist/original/components/switch/style/index.scss +0 -35
  74. package/dist/original/contexts/ScrollElementContext.js +0 -6
  75. package/dist/original/contexts/ScrollElementContext.js.map +0 -1
  76. package/dist/solid/contexts/ScrollElementContext.js +0 -6
  77. package/dist/solid/contexts/ScrollElementContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/scroll-view/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { isFunction } from '@tarojs/shared'\nimport classNames from 'classnames'\n\nimport { ScrollElementContext } from '../../contexts/ScrollElementContext'\nimport { createForwardRefComponent, throttle } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\nfunction easeOutScroll (from = 0, to = 0, callback) {\n if (from === to || typeof from !== 'number') {\n return\n }\n const change = to - from\n const dur = 500\n const sTime = +new Date()\n function linear (t, b, c, d) {\n return (c * t) / d + b\n }\n const isLarger = to >= from\n\n function step () {\n from = linear(+new Date() - sTime, from, change, dur)\n if ((isLarger && from >= to) || (!isLarger && to >= from)) {\n callback(to)\n return\n }\n callback(from)\n requestAnimationFrame(step)\n }\n step()\n}\n\n/** 未开启的滚动轴使用 nearest 避免原生 scrollIntoView 沿该轴滚动整页 */\nfunction scrollIntoView (\n id = '',\n animated = true,\n scrollX = false,\n scrollY = false,\n scrollIntoViewAlignment?: ScrollLogicalPosition\n) {\n document.querySelector(`#${id}`)?.scrollIntoView({\n behavior: animated ? 'smooth' : 'auto',\n block: scrollY ? (scrollIntoViewAlignment || 'center') : 'nearest',\n inline: scrollX ? (scrollIntoViewAlignment || 'start') : 'nearest'\n })\n}\n\nfunction scrollVertical (container, scrollTop, top, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollTop.current, top, pos => {\n if (container.current) container.current.scrollTop = pos\n })\n } else {\n if (container.current) container.current.scrollTop = top\n }\n scrollTop.current = top\n}\n\nfunction scrollHorizontal (container, scrollLeft, left, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollLeft.current, left, pos => {\n if (container.current) container.current.scrollLeft = pos\n })\n } else {\n if (container.current) container.current.scrollLeft = left\n }\n scrollLeft.current = left\n}\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n scrollX: boolean\n scrollY: boolean\n upperThreshold: number\n lowerThreshold: number\n scrollTop: number\n scrollLeft: number\n scrollIntoView?: string\n scrollIntoViewAlignment?: ScrollLogicalPosition\n scrollWithAnimation: boolean\n enableBackToTop?: boolean\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n onScrollToUpper: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollToLower: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScroll: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchMove: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n showScrollbar?: boolean // 新增参数,默认true\n enhanced?: boolean // 新增参数,默认false\n /** 嵌套滚动:内容在滚动容器中的起始偏移(固定头部等场景) */\n startOffset?: number\n}\n\n/** H5 等环境下 scrollTop 为整数,与带亚像素的受控值比较时允许该误差,避免反复 set scrollTop 与 scrollIntoView 打架 */\nconst CONTROLLED_SCROLL_EPSILON = 0.5\n\nfunction ScrollView (props: IProps) {\n const _scrollTop = useRef<any>(null)\n const _scrollLeft = useRef<any>(null)\n const container = useRef<any>(null)\n const scrollEndTimerRef = useRef<NodeJS.Timeout | null>(null)\n const isScrollingRef = useRef<boolean>(false)\n const isInitializedRef = useRef<boolean>(false)\n /** 与 props.scrollIntoView 比对,同 id 时只走受控 scrollTop,避免与上次锚点反复互顶 */\n const lastAppliedScrollIntoViewIdRef = useRef<string | null>(null)\n const [containerHeight, setContainerHeight] = useState(0)\n const onTouchMove = (e) => {\n e.stopPropagation()\n }\n\n const applyControlledScrollTopLeft = (p: IProps) => {\n const isAnimation = !!p.scrollWithAnimation\n const eps = CONTROLLED_SCROLL_EPSILON\n if (p.scrollY && typeof p.scrollTop === 'number' &&\n (_scrollTop.current === null || Math.abs(p.scrollTop - _scrollTop.current) >= eps)) {\n setTimeout(() => scrollVertical(container, _scrollTop, p.scrollTop, isAnimation), 10)\n }\n if (p.scrollX && typeof p.scrollLeft === 'number' &&\n (_scrollLeft.current === null || Math.abs(p.scrollLeft - _scrollLeft.current) >= eps)) {\n setTimeout(() => scrollHorizontal(container, _scrollLeft, p.scrollLeft, isAnimation), 10)\n }\n }\n\n const handleScroll = (props: IProps, isInit = false) => {\n if (\n props.scrollIntoView &&\n typeof props.scrollIntoView === 'string' &&\n document &&\n document.querySelector &&\n document.querySelector(`#${props.scrollIntoView}`)\n ) {\n if (isInit) {\n setTimeout(\n () =>\n scrollIntoView(\n props.scrollIntoView,\n props.scrollWithAnimation,\n !!props.scrollX,\n !!props.scrollY,\n props.scrollIntoViewAlignment\n ),\n 500\n )\n } else {\n scrollIntoView(\n props.scrollIntoView,\n props.scrollWithAnimation,\n !!props.scrollX,\n !!props.scrollY,\n props.scrollIntoViewAlignment\n )\n }\n } else {\n applyControlledScrollTopLeft(props)\n }\n }\n\n useEffect(() => {\n handleScroll(props, true)\n isInitializedRef.current = true\n }, [])\n\n // scrollTop / scrollLeft / scrollIntoView 受控同步(跳过 mount 时的 init effect)\n useEffect(() => {\n if (!isInitializedRef.current || !container.current) return\n\n const sitv = props.scrollIntoView\n const sitvOk = Boolean(\n sitv &&\n typeof sitv === 'string' &&\n document &&\n document.querySelector &&\n document.querySelector(`#${sitv}`)\n )\n\n if (sitvOk) {\n if (sitv !== lastAppliedScrollIntoViewIdRef.current) {\n scrollIntoView(\n sitv,\n props.scrollWithAnimation,\n !!props.scrollX,\n !!props.scrollY,\n props.scrollIntoViewAlignment\n )\n lastAppliedScrollIntoViewIdRef.current = typeof sitv === 'string' ? sitv : null\n } else {\n applyControlledScrollTopLeft(props)\n }\n } else {\n lastAppliedScrollIntoViewIdRef.current = null\n applyControlledScrollTopLeft(props)\n }\n }, [\n props.scrollTop,\n props.scrollLeft,\n props.scrollIntoView,\n props.scrollIntoViewAlignment,\n props.scrollWithAnimation,\n props.scrollX,\n props.scrollY\n ])\n\n const {\n className,\n style = {},\n onScroll,\n onScrollToUpper,\n onScrollToLower,\n scrollX,\n scrollY,\n showScrollbar = true, // 默认显示滚动条\n enhanced = false // 默认不增强\n } = props\n let { upperThreshold = 50, lowerThreshold = 50 } = props\n const cls = classNames(\n 'taro-scroll',\n {\n 'taro-scroll-view__scroll-x': scrollX,\n 'taro-scroll-view__scroll-y': scrollY,\n 'taro-scroll--hidebar': enhanced === true && showScrollbar === false,\n 'taro-scroll--enhanced': enhanced === true\n },\n className\n )\n upperThreshold = Number(upperThreshold)\n lowerThreshold = Number(lowerThreshold)\n const upperAndLower = e => {\n if (!container.current) return\n const { offsetWidth, offsetHeight, scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n if (\n onScrollToLower &&\n ((props.scrollY && offsetHeight + scrollTop + lowerThreshold >= scrollHeight) ||\n (props.scrollX && offsetWidth + scrollLeft + lowerThreshold >= scrollWidth))\n ) {\n onScrollToLower(e)\n }\n if (\n onScrollToUpper &&\n ((props.scrollY && scrollTop <= upperThreshold) || (props.scrollX && scrollLeft <= upperThreshold))\n ) {\n onScrollToUpper(e)\n }\n }\n const upperAndLowerThrottle = throttle(upperAndLower, 200)\n const _onScroll = e => {\n const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n _scrollLeft.current = scrollLeft\n _scrollTop.current = scrollTop\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n scrollLeft,\n scrollTop,\n scrollHeight,\n scrollWidth\n }\n })\n\n // 处理滚动开始\n if (!isScrollingRef.current) {\n isScrollingRef.current = true\n if (props.onScrollStart) {\n props.onScrollStart(e)\n }\n }\n\n // 清除滚动结束定时器\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n\n // 设置滚动结束定时器(150ms 无滚动事件后触发)\n if (props.onScrollEnd) {\n scrollEndTimerRef.current = setTimeout(() => {\n if (isScrollingRef.current) {\n isScrollingRef.current = false\n props.onScrollEnd?.(e)\n }\n scrollEndTimerRef.current = null\n }, 150)\n }\n\n upperAndLowerThrottle(e)\n onScroll && onScroll(e)\n }\n const _onTouchMove = e => {\n isFunction(props.onTouchMove) ? props.onTouchMove(e) : onTouchMove(e)\n }\n const _onTouchStart = e => {\n if (isFunction(props.onTouchStart)) {\n props.onTouchStart(e)\n }\n }\n const _onTouchEnd = e => {\n if (isFunction(props.onTouchEnd)) {\n props.onTouchEnd(e)\n }\n }\n // 清理定时器\n useEffect(() => {\n return () => {\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n }\n }, [])\n\n // ScrollElementContext:嵌套滚动时向子组件提供 scrollRef、containerHeight、startOffset\n useEffect(() => {\n const el = container.current\n if (!el) return\n const update = () => {\n if (container.current) {\n setContainerHeight(container.current.clientHeight)\n }\n }\n update()\n const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null\n if (ro) {\n ro.observe(el)\n return () => ro.disconnect()\n }\n }, [])\n\n const scrollElementContextValue = {\n scrollRef: container,\n containerHeight,\n startOffset: props.startOffset ?? 0,\n }\n\n return (\n <ScrollElementContext.Provider value={scrollElementContextValue}>\n <div\n ref={e => {\n if (e) {\n container.current = e\n if (props.forwardedRef) props.forwardedRef.current = e\n }\n }}\n style={style}\n className={cls}\n onScroll={_onScroll}\n onTouchMove={_onTouchMove}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n >\n {props.children}\n </div>\n </ScrollElementContext.Provider>\n )\n}\n\nexport default createForwardRefComponent(ScrollView)\n"],"names":["easeOutScroll","from","arguments","length","undefined","to","callback","change","dur","sTime","Date","linear","t","b","c","d","isLarger","step","requestAnimationFrame","scrollIntoView","id","animated","scrollX","scrollY","scrollIntoViewAlignment","_a","document","querySelector","behavior","block","inline","scrollVertical","container","scrollTop","top","isAnimation","current","pos","scrollHorizontal","scrollLeft","left","CONTROLLED_SCROLL_EPSILON","ScrollView","props","_scrollTop","useRef","_scrollLeft","scrollEndTimerRef","isScrollingRef","isInitializedRef","lastAppliedScrollIntoViewIdRef","containerHeight","setContainerHeight","useState","onTouchMove","e","stopPropagation","applyControlledScrollTopLeft","p","scrollWithAnimation","eps","Math","abs","setTimeout","handleScroll","isInit","useEffect","sitv","sitvOk","Boolean","className","style","onScroll","onScrollToUpper","onScrollToLower","showScrollbar","enhanced","upperThreshold","lowerThreshold","cls","classNames","Number","upperAndLower","offsetWidth","offsetHeight","scrollHeight","scrollWidth","upperAndLowerThrottle","throttle","_onScroll","Object","defineProperty","enumerable","writable","value","onScrollStart","clearTimeout","onScrollEnd","call","_onTouchMove","isFunction","_onTouchStart","onTouchStart","_onTouchEnd","onTouchEnd","el","update","clientHeight","ro","ResizeObserver","observe","disconnect","scrollElementContextValue","scrollRef","startOffset","_jsx","ScrollElementContext","Provider","children","ref","forwardedRef","createForwardRefComponent"],"mappings":";;;;;;;;AAWA,SAASA,aAAaA,GAA4B;AAAA,EAAA,IAA1BC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;AAAA,EAAA,IAAEG,EAAE,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;EAAA,IAAEI,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,GAAAD,CAAAA,GAAAA,SAAA,MAAAE,SAAA;EAChD,IAAIH,IAAI,KAAKI,EAAE,IAAI,OAAOJ,IAAI,KAAK,QAAQ,EAAE;AAC3C,IAAA;AACF;AACA,EAAA,MAAMM,MAAM,GAAGF,EAAE,GAAGJ,IAAI;EACxB,MAAMO,GAAG,GAAG,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Aa;AAC1BG,MAAAA,YAAY,EAAED,aAAc;AAC5BG,MAAAA,UAAU,EAAED,WAAY;MAAAe,QAAA,EAEvB3E,KAAK,CAAC2E;KACJ;AACP,GAA+B,CAAC;AAEpC;AAEA,YAAeG,yBAAyB,CAAC/E,UAAU,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/scroll-view/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { isFunction } from '@tarojs/shared'\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, throttle } from '../../utils'\nimport { useEffect, useRef } from '../../utils/hooks'\n\nimport type React from 'react'\n\nfunction easeOutScroll (from = 0, to = 0, callback) {\n if (from === to || typeof from !== 'number') {\n return\n }\n const change = to - from\n const dur = 500\n const sTime = +new Date()\n function linear (t, b, c, d) {\n return (c * t) / d + b\n }\n const isLarger = to >= from\n\n function step () {\n from = linear(+new Date() - sTime, from, change, dur)\n if ((isLarger && from >= to) || (!isLarger && to >= from)) {\n callback(to)\n return\n }\n callback(from)\n requestAnimationFrame(step)\n }\n step()\n}\n\nfunction scrollIntoView (id = '', isHorizontal = false, animated = true, scrollIntoViewAlignment?: ScrollLogicalPosition) {\n document.querySelector(`#${id}`)?.scrollIntoView({\n behavior: animated ? 'smooth' : 'auto',\n block: !isHorizontal ? (scrollIntoViewAlignment || 'center') : 'center',\n inline: isHorizontal ? (scrollIntoViewAlignment || 'start') : 'start'\n })\n}\n\nfunction scrollVertical (container, scrollTop, top, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollTop.current, top, pos => {\n if (container.current) container.current.scrollTop = pos\n })\n } else {\n if (container.current) container.current.scrollTop = top\n }\n scrollTop.current = top\n}\n\nfunction scrollHorizontal (container, scrollLeft, left, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollLeft.current, left, pos => {\n if (container.current) container.current.scrollLeft = pos\n })\n } else {\n if (container.current) container.current.scrollLeft = left\n }\n scrollLeft.current = left\n}\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n scrollX: boolean\n scrollY: boolean\n upperThreshold: number\n lowerThreshold: number\n scrollTop: number\n scrollLeft: number\n scrollIntoView?: string\n scrollIntoViewAlignment?: ScrollLogicalPosition\n scrollWithAnimation: boolean\n enableBackToTop?: boolean\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n onScrollToUpper: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollToLower: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScroll: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchMove: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n showScrollbar?: boolean // 新增参数,默认true\n enhanced?: boolean // 新增参数,默认false\n}\n\nfunction ScrollView (props: IProps) {\n const _scrollTop = useRef<any>(null)\n const _scrollLeft = useRef<any>(null)\n const container = useRef<any>(null)\n const scrollEndTimerRef = useRef<NodeJS.Timeout | null>(null)\n const isScrollingRef = useRef<boolean>(false)\n const isInitializedRef = useRef<boolean>(false)\n const onTouchMove = (e) => {\n e.stopPropagation()\n }\n\n const handleScroll = (props: IProps, isInit = false) => {\n // scrollIntoView\n if (\n props.scrollIntoView &&\n typeof props.scrollIntoView === 'string' &&\n document &&\n document.querySelector &&\n document.querySelector(`#${props.scrollIntoView}`)\n ) {\n const isHorizontal = props.scrollX && !props.scrollY\n if (isInit) {\n setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment), 500)\n } else {\n scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment)\n }\n } else {\n const isAnimation = !!props.scrollWithAnimation\n // Y 轴滚动\n if (props.scrollY && typeof props.scrollTop === 'number' && props.scrollTop !== _scrollTop.current) {\n setTimeout(() => scrollVertical(container, _scrollTop, props.scrollTop, isAnimation), 10)\n }\n // X 轴滚动\n if (props.scrollX && typeof props.scrollLeft === 'number' && props.scrollLeft !== _scrollLeft.current) {\n setTimeout(() => scrollHorizontal(container, _scrollLeft, props.scrollLeft, isAnimation), 10)\n }\n }\n }\n\n useEffect(() => {\n handleScroll(props, true)\n isInitializedRef.current = true\n }, [])\n\n // 监听 scrollTop、scrollLeft、scrollIntoView 的变化(排除初始化)\n useEffect(() => {\n if (isInitializedRef.current && container.current) {\n handleScroll(props, false)\n }\n }, [props.scrollTop, props.scrollLeft, props.scrollIntoView])\n\n const {\n className,\n style = {},\n onScroll,\n onScrollToUpper,\n onScrollToLower,\n scrollX,\n scrollY,\n showScrollbar = true, // 默认显示滚动条\n enhanced = false // 默认不增强\n } = props\n let { upperThreshold = 50, lowerThreshold = 50 } = props\n const cls = classNames(\n 'taro-scroll',\n {\n 'taro-scroll-view__scroll-x': scrollX,\n 'taro-scroll-view__scroll-y': scrollY,\n 'taro-scroll--hidebar': enhanced === true && showScrollbar === false,\n 'taro-scroll--enhanced': enhanced === true\n },\n className\n )\n upperThreshold = Number(upperThreshold)\n lowerThreshold = Number(lowerThreshold)\n const upperAndLower = e => {\n if (!container.current) return\n const { offsetWidth, offsetHeight, scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n if (\n onScrollToLower &&\n ((props.scrollY && offsetHeight + scrollTop + lowerThreshold >= scrollHeight) ||\n (props.scrollX && offsetWidth + scrollLeft + lowerThreshold >= scrollWidth))\n ) {\n onScrollToLower(e)\n }\n if (\n onScrollToUpper &&\n ((props.scrollY && scrollTop <= upperThreshold) || (props.scrollX && scrollLeft <= upperThreshold))\n ) {\n onScrollToUpper(e)\n }\n }\n const upperAndLowerThrottle = throttle(upperAndLower, 200)\n const _onScroll = e => {\n const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n _scrollLeft.current = scrollLeft\n _scrollTop.current = scrollTop\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n scrollLeft,\n scrollTop,\n scrollHeight,\n scrollWidth\n }\n })\n\n // 处理滚动开始\n if (!isScrollingRef.current) {\n isScrollingRef.current = true\n if (props.onScrollStart) {\n props.onScrollStart(e)\n }\n }\n\n // 清除滚动结束定时器\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n\n // 设置滚动结束定时器(150ms 无滚动事件后触发)\n if (props.onScrollEnd) {\n scrollEndTimerRef.current = setTimeout(() => {\n if (isScrollingRef.current) {\n isScrollingRef.current = false\n props.onScrollEnd?.(e)\n }\n scrollEndTimerRef.current = null\n }, 150)\n }\n\n upperAndLowerThrottle(e)\n onScroll && onScroll(e)\n }\n const _onTouchMove = e => {\n isFunction(props.onTouchMove) ? props.onTouchMove(e) : onTouchMove(e)\n }\n const _onTouchStart = e => {\n if (isFunction(props.onTouchStart)) {\n props.onTouchStart(e)\n }\n }\n const _onTouchEnd = e => {\n if (isFunction(props.onTouchEnd)) {\n props.onTouchEnd(e)\n }\n }\n // 清理定时器\n useEffect(() => {\n return () => {\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n }\n }, [])\n\n return (\n <div\n ref={e => {\n if (e) {\n container.current = e\n if (props.forwardedRef) props.forwardedRef.current = e\n }\n }}\n style={style}\n className={cls}\n onScroll={_onScroll}\n onTouchMove={_onTouchMove}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n >\n {props.children}\n </div>\n )\n}\n\nexport default createForwardRefComponent(ScrollView)\n"],"names":["easeOutScroll","from","arguments","length","undefined","to","callback","change","dur","sTime","Date","linear","t","b","c","d","isLarger","step","requestAnimationFrame","scrollIntoView","id","isHorizontal","animated","scrollIntoViewAlignment","_a","document","querySelector","behavior","block","inline","scrollVertical","container","scrollTop","top","isAnimation","current","pos","scrollHorizontal","scrollLeft","left","ScrollView","props","_scrollTop","useRef","_scrollLeft","scrollEndTimerRef","isScrollingRef","isInitializedRef","onTouchMove","e","stopPropagation","handleScroll","isInit","scrollX","scrollY","setTimeout","scrollWithAnimation","useEffect","className","style","onScroll","onScrollToUpper","onScrollToLower","showScrollbar","enhanced","upperThreshold","lowerThreshold","cls","classNames","Number","upperAndLower","offsetWidth","offsetHeight","scrollHeight","scrollWidth","upperAndLowerThrottle","throttle","_onScroll","Object","defineProperty","enumerable","writable","value","onScrollStart","clearTimeout","onScrollEnd","call","_onTouchMove","isFunction","_onTouchStart","onTouchStart","_onTouchEnd","onTouchEnd","_jsx","ref","forwardedRef","children","createForwardRefComponent"],"mappings":";;;;;;;AAUA,SAASA,aAAaA,GAA4B;AAAA,EAAA,IAA1BC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;AAAA,EAAA,IAAEG,EAAE,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;EAAA,IAAEI,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,GAAAD,CAAAA,GAAAA,SAAA,MAAAE,SAAA;EAChD,IAAIH,IAAI,KAAKI,EAAE,IAAI,OAAOJ,IAAI,KAAK,QAAQ,EAAE;AAC3C,IAAA;AACF;AACA,EAAA,MAAMM,MAAM,GAAGF,EAAE,GAAGJ,IAAI;EACxB,MAAMO,GAAG,GAAG,GAAG;AACf,EAAA,MAAMC,KAAK,GAAG,CAAC,IAAIC,IAAI,EAAE;EACzB,SAASC,MAAMA,CAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAA;AACzB,IAAA,OAAQD,CAAC,GAAGF,CA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U,EAAED,WAAY;IAAAK,QAAA,EAEvBvD,KAAK,CAACuD;AAAQ,GACZ,CAAC;AAEV;AAEA,YAAeC,yBAAyB,CAACzD,UAAU,CAAC;;;;"}
@@ -1,19 +1,15 @@
1
- export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
1
+ export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, Map, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Switch, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
2
2
  export { default as Button } from './components/button/index.js';
3
3
  export { default as Icon } from './components/icon/index.js';
4
4
  export { default as Image } from './components/image/index.js';
5
5
  export { default as Input } from './components/input/index.js';
6
- export { default as Map } from './components/map/index.js';
7
6
  export { default as Picker } from './components/picker/index.js';
8
7
  export { default as PullDownRefresh } from './components/pull-down-refresh/index.js';
9
- export { Refresher } from './components/refresher/index.js';
10
- export { ScrollElementContext } from './contexts/ScrollElementContext.js';
8
+ export { default as Refresher } from './components/refresher/index.js';
11
9
  export { default as ScrollView } from './components/scroll-view/index.js';
12
10
  export { Swiper, SwiperItem } from './components/swiper/index.js';
13
- export { default as Switch } from './components/switch/index.js';
14
11
  export { default as Text } from './components/text/index.js';
15
12
  export { default as View } from './components/view/index.js';
16
- export { createMapContext } from './components/map/createMapContext.js';
17
13
 
18
14
  /* eslint-disable simple-import-sort/exports */
19
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { default as Switch } from './components/switch'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { Map } from '@tarojs/components/lib/react'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '@tarojs/components/lib/react'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA"}
@@ -13,18 +13,16 @@ function Image(props) {
13
13
  const [, setIsLoaded] = useState(false);
14
14
  const {
15
15
  className,
16
- style: style$1,
16
+ style: style$1 = {},
17
17
  src,
18
18
  mode,
19
19
  onError,
20
20
  lazyLoad,
21
21
  imgProps,
22
- forwardedRef,
23
- disableDefaultSize = false
22
+ forwardedRef
24
23
  } = props,
25
- reset = __rest(props, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef", "disableDefaultSize"]);
24
+ reset = __rest(props, ["className", "style", "src", "mode", "onError", "lazyLoad", "imgProps", "forwardedRef"]);
26
25
  const cls = classNames('taro-img', {
27
- 'taro-img--with-default-host-size': !disableDefaultSize,
28
26
  'taro-img__widthfix': mode === 'widthFix'
29
27
  }, className);
30
28
  const imgCls = classNames('taro-img__mode-' + (mode || 'scaleToFill').toLowerCase().replace(/\s/g, ''));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n /** 为 true 时不挂载默认占位尺寸(320×240),由业务 style/class 决定容器大小 */\n disableDefaultSize?: boolean\n}\n\nfunction Image (props: IProps) {\n const imgRef = useRef<HTMLImageElement | null>(null)\n const observer = useRef<Partial<IntersectionObserver>>({})\n const [, setIsLoaded] = useState(false)\n const {\n className,\n style,\n src,\n mode,\n onError,\n lazyLoad,\n imgProps,\n forwardedRef,\n disableDefaultSize = false,\n ...reset\n } = props\n\n const cls = classNames(\n 'taro-img',\n {\n 'taro-img--with-default-host-size': !disableDefaultSize,\n 'taro-img__widthfix': mode === 'widthFix'\n },\n className\n )\n const imgCls = classNames(\n 'taro-img__mode-' +\n (mode || 'scaleToFill').toLowerCase().replace(/\\s/g, '')\n )\n\n const imageOnLoad = useCallback((e) => {\n const { onLoad } = props\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n width: e.target.width,\n height: e.target.height\n }\n })\n\n onLoad && onLoad(e)\n }, [props])\n\n useEffect(() => {\n if (lazyLoad) {\n observer.current = new IntersectionObserver(\n entries => {\n // 异步 api 关系\n if (entries[entries.length - 1].isIntersecting) {\n setIsLoaded(true)\n // findDOMNode(this).children[0].src = src\n imgRef.current!.src = src\n }\n },\n {\n rootMargin: '300px 0px'\n }\n )\n observer.current.observe?.(imgRef.current!)\n }\n\n return () => {\n observer.current?.disconnect?.()\n }\n }, [lazyLoad, src])\n\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n {lazyLoad ? (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n data-src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n ) : (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n )}\n </div>\n )\n}\n\nexport default createForwardRefComponent(Image)\n"],"names":["Image","props","imgRef","useRef","observer","setIsLoaded","useState","className","style","src","mode","onError","lazyLoad","imgProps","forwardedRef","disableDefaultSize","reset","__rest","cls","classNames","imgCls","toLowerCase","replace","imageOnLoad","useCallback","e","onLoad","Object","defineProperty","enumerable","writable","value","width","target","height","useEffect","current","IntersectionObserver","entries","length","isIntersecting","rootMargin","_b","_a","observe","call","disconnect","_el$","_tmpl$","_$use","_$spread","_$insert","_el$2","_tmpl$2","_$addEventListener","img","_$setAttribute","_el$3","_$effect","_$p","_$style","createForwardRefComponent"],"mappings":";;;;;;;;;AAqBA,SAASA,KAAKA,CAAEC,KAAa,EAAA;AAC3B,EAAA,MAAMC,MAAM,GAAGC,MAAM,CAA0B,IAAI,CAAC;AACpD,EAAA,MAAMC,QAAQ,GAAGD,MAAM,CAAgC,EAAE,CAAC;AAC1D,EAAA,MAAM,GAAGE,WAAW,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM;MACJC,SAAS;aACTC,OAAK;MACLC,GAAG;MACHC,IAAI;MACJC,OAAO;MACPC,QAAQ;MACRC,QAAQ;MACRC,YAAY;AACZC,MAAAA,kBAAkB,GAAG;AAEnB,KAAA,GAAAd,KAAK;IADJe,KAAK,GACNC,MAAA,CAAAhB,KAAK,EAXH,CAAA,WAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,cAAA,EAAA,oBAAA,CAWL,CAAQ;AAET,EAAA,MAAMiB,GAAG,GAAGC,UAAU,C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OAAA,EAQH9C,OAAO,CAAA;MAAA2C,gBAAA,CAAAG,KAAA,EAAA,MAAA,EADRlC,WAAW,CAAA;MAAA0B,GAAA,CAHdM,GAAG,IAAKrD,MAAM,CAACkC,OAAO,GAAGmB,GAAI,EAAAE,KAAA,CAAA;MAAAA,KAAA,CAAAlD,SAAA,GACvBa,MAAM;MAAAoC,YAAA,CAAAC,KAAA,EAAA,KAAA,EACZhD,GAAG,CAAA;MAAAyC,MAAA,CAAAO,KAAA,EAGJ5C,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAA4C,KAAA;KAEf,GAAA,CAAA;IAAAC,MAAA,CAAAC,GAAA,IAAAC,KAAA,CAAAb,IAAA,EAnByBvC,OAAK,EAAAmD,GAAA,CAAA,CAAA;AAAA,IAAA,OAAAZ,IAAA;AAAA,GAAA,GAAA;AAsBrC;AAEA,YAAec,yBAAyB,CAAC7D,KAAK,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { useCallback, useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n src: string\n mode: string\n onError: () => void\n onLoad: (e) => void\n lazyLoad?: boolean\n imgProps?: Record<string, any>\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction Image (props: IProps) {\n const imgRef = useRef<HTMLImageElement | null>(null)\n const observer = useRef<Partial<IntersectionObserver>>({})\n const [, setIsLoaded] = useState(false)\n const {\n className,\n style = {},\n src,\n mode,\n onError,\n lazyLoad,\n imgProps,\n forwardedRef,\n ...reset\n } = props\n\n const cls = classNames(\n 'taro-img',\n {\n 'taro-img__widthfix': mode === 'widthFix'\n },\n className\n )\n const imgCls = classNames(\n 'taro-img__mode-' +\n (mode || 'scaleToFill').toLowerCase().replace(/\\s/g, '')\n )\n\n const imageOnLoad = useCallback((e) => {\n const { onLoad } = props\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n width: e.target.width,\n height: e.target.height\n }\n })\n\n onLoad && onLoad(e)\n }, [props])\n\n useEffect(() => {\n if (lazyLoad) {\n observer.current = new IntersectionObserver(\n entries => {\n // 异步 api 关系\n if (entries[entries.length - 1].isIntersecting) {\n setIsLoaded(true)\n // findDOMNode(this).children[0].src = src\n imgRef.current!.src = src\n }\n },\n {\n rootMargin: '300px 0px'\n }\n )\n observer.current.observe?.(imgRef.current!)\n }\n\n return () => {\n observer.current?.disconnect?.()\n }\n }, [lazyLoad, src])\n\n return (\n <div className={cls} style={style} ref={forwardedRef} {...reset}>\n {lazyLoad ? (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n data-src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n ) : (\n <img\n ref={img => (imgRef.current = img)}\n className={imgCls}\n src={src}\n onLoad={imageOnLoad}\n onError={onError}\n {...imgProps}\n />\n )}\n </div>\n )\n}\n\nexport default createForwardRefComponent(Image)\n"],"names":["Image","props","imgRef","useRef","observer","setIsLoaded","useState","className","style","src","mode","onError","lazyLoad","imgProps","forwardedRef","reset","__rest","cls","classNames","imgCls","toLowerCase","replace","imageOnLoad","useCallback","e","onLoad","Object","defineProperty","enumerable","writable","value","width","target","height","useEffect","current","IntersectionObserver","entries","length","isIntersecting","rootMargin","_b","_a","observe","call","disconnect","_el$","_tmpl$","_$use","_$spread","_$insert","_el$2","_tmpl$2","_$addEventListener","img","_$setAttribute","_el$3","_$effect","_$p","_$style","createForwardRefComponent"],"mappings":";;;;;;;;;AAmBA,SAASA,KAAKA,CAAEC,KAAa,EAAA;AAC3B,EAAA,MAAMC,MAAM,GAAGC,MAAM,CAA0B,IAAI,CAAC;AACpD,EAAA,MAAMC,QAAQ,GAAGD,MAAM,CAAgC,EAAE,CAAC;AAC1D,EAAA,MAAM,GAAGE,WA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O,GAAGmB,GAAI,EAAAH,KAAA,CAAA;MAAAA,KAAA,CAAA5C,SAAA,GACvBY,MAAM;MAAAoC,YAAA,CAAAJ,KAAA,EAAA,UAAA,EACP1C,GAAG,CAAA;MAAAwC,MAAA,CAAAE,KAAA,EAGTtC,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAsC,KAAA;AAAA,KAAA,GAAA,GAAA,CAAA,MAAA;MAAA,IAAAK,KAAA,GAAAJ,OAAA,EAAA;MAAAC,gBAAA,CAAAG,KAAA,EAAA,OAAA,EAQH7C,OAAO,CAAA;MAAA0C,gBAAA,CAAAG,KAAA,EAAA,MAAA,EADRlC,WAAW,CAAA;MAAA0B,GAAA,CAHdM,GAAG,IAAKpD,MAAM,CAACiC,OAAO,GAAGmB,GAAI,EAAAE,KAAA,CAAA;MAAAA,KAAA,CAAAjD,SAAA,GACvBY,MAAM;MAAAoC,YAAA,CAAAC,KAAA,EAAA,KAAA,EACZ/C,GAAG,CAAA;MAAAwC,MAAA,CAAAO,KAAA,EAGJ3C,QAAQ,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAA2C,KAAA;KAEf,GAAA,CAAA;IAAAC,MAAA,CAAAC,GAAA,IAAAC,KAAA,CAAAb,IAAA,EAnByBtC,OAAK,EAAAkD,GAAA,CAAA,CAAA;AAAA,IAAA,OAAAZ,IAAA;AAAA,GAAA,GAAA;AAsBrC;AAEA,YAAec,yBAAyB,CAAC5D,KAAK,CAAC;;;;"}
@@ -2,7 +2,6 @@ import { createComponent, mergeProps, memo } from 'solid-js/web';
2
2
  import { __rest } from 'tslib';
3
3
  import './style/index.scss.js';
4
4
  import { View } from '@tarojs/components';
5
- import Taro from '@tarojs/taro';
6
5
  import classNames from 'classnames';
7
6
  import React__default from 'react';
8
7
  import { verifyValue, verifyTime, hoursRange, minutesRange, verifyDate, getYearRange, getMonthRange, getDayRange, compareTime, omit } from '../../utils/index.js';
@@ -129,13 +128,12 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
129
128
  children,
130
129
  formType,
131
130
  lang,
132
- theme = 'light',
133
- enableClickItemScroll = true
131
+ theme = 'light'
134
132
  } = props,
135
- restProps = __rest(props, ["mode", "disabled", "range", "rangeKey", "value", "start", "end", "fields", "headerText", "level", "regionData", "textProps", "colors", "onChange", "onColumnChange", "onCancel", "children", "formType", "lang", "theme", "enableClickItemScroll"]);
133
+ restProps = __rest(props, ["mode", "disabled", "range", "rangeKey", "value", "start", "end", "fields", "headerText", "level", "regionData", "textProps", "colors", "onChange", "onColumnChange", "onCancel", "children", "formType", "lang", "theme"]);
136
134
  const indexRef = React__default.useRef([]);
137
135
  const pickerDateRef = React__default.useRef();
138
- // region:首次用户滚动初始化完成前不入库
136
+ // 记录是否是用户滚动
139
137
  const isInitializationCompletedRef = React__default.useRef(false);
140
138
  const [state, setState] = React__default.useState({
141
139
  pickerValue: value || EMPTY_ARRAY,
@@ -144,45 +142,14 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
144
142
  hidden: true,
145
143
  fadeOut: false,
146
144
  isWillLoadCalled: false,
147
- a11yTimeLimitColumnId: null,
148
- a11yTimeLimitNonce: 0
145
+ timestamp: 0 // 用以部分模式下强制刷新组件的的时间戳,多用于反复限位
149
146
  });
150
- // 安全区域底部距离
151
- const [safeAreaBottom, setSafeAreaBottom] = React__default.useState(0);
152
147
  // 在组件内部
153
148
  const [columnsCount, setColumnsCount] = React__default.useState(() => getRegionColumnsCount(level));
154
149
  // 只在level变化时更新列数
155
150
  React__default.useEffect(() => {
156
151
  setColumnsCount(getRegionColumnsCount(level));
157
152
  }, [level]);
158
- // 更新安全区域
159
- const updateSafeArea = React__default.useCallback(() => {
160
- try {
161
- const systemInfo = Taro.getSystemInfoSync();
162
- const {
163
- safeArea,
164
- windowHeight
165
- } = systemInfo;
166
- if (safeArea && windowHeight) {
167
- const lengthScaleRatio = systemInfo.lengthScaleRatio || 1;
168
- const bottom = (windowHeight - safeArea.bottom) / lengthScaleRatio;
169
- setSafeAreaBottom(Math.max(0, bottom));
170
- }
171
- } catch (e) {
172
- // H5 环境或其他异常情况,不设置安全区域
173
- setSafeAreaBottom(0);
174
- }
175
- }, []);
176
- // 初始化安全区域
177
- React__default.useEffect(() => {
178
- updateSafeArea();
179
- }, [updateSafeArea]);
180
- // 监听窗口变化(导航方式切换等)
181
- React__default.useEffect(() => {
182
- const handleResize = () => updateSafeArea();
183
- window.addEventListener('resize', handleResize);
184
- return () => window.removeEventListener('resize', handleResize);
185
- }, [updateSafeArea]);
186
153
  // 获取当前索引数组
187
154
  const getIndices = React__default.useCallback(() => {
188
155
  return indexRef.current;
@@ -233,36 +200,25 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
233
200
  const monthRange = getMonthRange(_start, _end, currentYear);
234
201
  const dayRange = getDayRange(_start, _end, currentYear, currentMonth);
235
202
  indexRef.current = [yearRange.indexOf(currentYear), monthRange.indexOf(currentMonth), dayRange.indexOf(currentDay)];
236
- // props 同步时始终刷新 _updateValue,避免取消后再开时日列草稿与索引不一致
237
- pickerDateRef.current = {
238
- _value,
239
- _start,
240
- _end,
241
- _updateValue: [currentYear, currentMonth, currentDay]
242
- };
203
+ if (!pickerDateRef.current || pickerDateRef.current._value.getTime() !== _value.getTime() || pickerDateRef.current._start.getTime() !== _start.getTime() || pickerDateRef.current._end.getTime() !== _end.getTime()) {
204
+ pickerDateRef.current = {
205
+ _value,
206
+ _start,
207
+ _end,
208
+ _updateValue: [currentYear, currentMonth, currentDay]
209
+ };
210
+ }
243
211
  } else if (mode === 'region') {
244
212
  // region 模式处理 - 验证数据
245
213
  if (!regionData) {
246
214
  console.error('Picker: regionData is required for region mode');
247
- indexRef.current = Array.from({
248
- length: columnsCount
249
- }, () => 0);
250
- setState(prev => Object.assign(Object.assign({}, prev), {
251
- selectedIndices: [...indexRef.current],
252
- pickerValue: value || EMPTY_ARRAY
253
- }));
215
+ indexRef.current = [0];
254
216
  return;
255
217
  }
256
218
  const validation = validateRegionData(regionData, 'Picker');
257
219
  if (!validation.valid) {
258
220
  console.error(validation.error);
259
- indexRef.current = Array.from({
260
- length: columnsCount
261
- }, () => 0);
262
- setState(prev => Object.assign(Object.assign({}, prev), {
263
- selectedIndices: [...indexRef.current],
264
- pickerValue: value || EMPTY_ARRAY
265
- }));
221
+ indexRef.current = [0];
266
222
  return;
267
223
  }
268
224
  // 获取列数
@@ -309,16 +265,16 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
309
265
  handleProps();
310
266
  }
311
267
  }, [handleProps, state.isWillLoadCalled, JSON.stringify(value)]);
312
- // 打开时按 props 重算索引,避免未确认的滑动与 indexRef 残留导致再开抖动
268
+ // 显示 Picker
313
269
  const showPicker = React__default.useCallback(() => {
314
270
  if (disabled) return;
315
271
  isInitializationCompletedRef.current = false;
316
- handleProps();
272
+ const newIndices = getIndices();
317
273
  setState(prev => Object.assign(Object.assign({}, prev), {
318
- hidden: false,
319
- a11yTimeLimitColumnId: null
274
+ selectedIndices: newIndices,
275
+ hidden: false
320
276
  }));
321
- }, [disabled, handleProps]);
277
+ }, [disabled, getIndices]);
322
278
  // 隐藏 Picker
323
279
  const hidePicker = React__default.useCallback(() => {
324
280
  isInitializationCompletedRef.current = false;
@@ -393,11 +349,11 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
393
349
  finalIndices = [...newIndices];
394
350
  hasLimited = true;
395
351
  }
352
+ // 触发限位,更新状态,其它状态不用主动触发滚动
396
353
  if (hasLimited) {
397
354
  setState(prev => Object.assign(Object.assign({}, prev), {
398
355
  selectedIndices: finalIndices,
399
- a11yTimeLimitColumnId: columnId,
400
- a11yTimeLimitNonce: prev.a11yTimeLimitNonce + 1
356
+ timestamp: Date.now()
401
357
  }));
402
358
  } else {
403
359
  setState(prev => Object.assign(Object.assign({}, prev), {
@@ -630,17 +586,11 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
630
586
  }
631
587
  });
632
588
  }, [onColumnChange]);
633
- const consumeTimeA11yLimitFocus = React__default.useCallback(() => {
634
- setState(prev => Object.assign(Object.assign({}, prev), {
635
- a11yTimeLimitColumnId: null
636
- }));
637
- }, []);
638
- // 取消时按 props 回同步索引,避免与 value 脱节
589
+ // 处理取消
639
590
  const handleCancel = React__default.useCallback(() => {
640
- handleProps();
641
591
  hidePicker();
642
592
  onCancel === null || onCancel === void 0 ? void 0 : onCancel();
643
- }, [handleProps, hidePicker, onCancel]);
593
+ }, [hidePicker, onCancel]);
644
594
  // 渲染选择器组
645
595
  const renderPickerGroup = React__default.useMemo(() => {
646
596
  switch (mode) {
@@ -658,18 +608,15 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
658
608
  get selectedIndex() {
659
609
  return state.selectedIndices[index];
660
610
  },
661
- colors: colors,
662
- enableClickItemScroll: enableClickItemScroll
611
+ colors: colors
663
612
  }));
664
613
  }
665
614
  case 'time':
666
615
  {
667
- const timeA11yLimitFocus = state.a11yTimeLimitColumnId != null ? {
668
- nonce: state.a11yTimeLimitNonce,
669
- columnId: state.a11yTimeLimitColumnId
670
- } : null;
671
616
  return [createComponent(PickerGroup, {
672
- key: "hour",
617
+ get key() {
618
+ return `hour-${state.timestamp}`;
619
+ },
673
620
  mode: "time",
674
621
  range: hoursRange,
675
622
  updateIndex: updateIndex,
@@ -677,15 +624,11 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
677
624
  get selectedIndex() {
678
625
  return state.selectedIndices[0];
679
626
  },
680
- colors: colors,
681
- timeA11yLimitFocus: timeA11yLimitFocus,
682
- onTimeA11yLimitFocusConsumed: consumeTimeA11yLimitFocus,
683
- get timeA11yLimitEventNonce() {
684
- return state.a11yTimeLimitNonce;
685
- },
686
- enableClickItemScroll: enableClickItemScroll
627
+ colors: colors
687
628
  }), createComponent(PickerGroup, {
688
- key: "minute",
629
+ get key() {
630
+ return `minute-${state.timestamp}`;
631
+ },
689
632
  mode: "time",
690
633
  range: minutesRange,
691
634
  updateIndex: updateIndex,
@@ -693,13 +636,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
693
636
  get selectedIndex() {
694
637
  return state.selectedIndices[1];
695
638
  },
696
- colors: colors,
697
- timeA11yLimitFocus: timeA11yLimitFocus,
698
- onTimeA11yLimitFocusConsumed: consumeTimeA11yLimitFocus,
699
- get timeA11yLimitEventNonce() {
700
- return state.a11yTimeLimitNonce;
701
- },
702
- enableClickItemScroll: enableClickItemScroll
639
+ colors: colors
703
640
  })];
704
641
  }
705
642
  case 'date':
@@ -727,8 +664,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
727
664
  get selectedIndex() {
728
665
  return state.selectedIndices[0];
729
666
  },
730
- colors: colors,
731
- enableClickItemScroll: enableClickItemScroll
667
+ colors: colors
732
668
  })];
733
669
  if (fields === 'month' || fields === 'day') {
734
670
  renderView.push(createComponent(PickerGroup, {
@@ -741,8 +677,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
741
677
  get selectedIndex() {
742
678
  return state.selectedIndices[1];
743
679
  },
744
- colors: colors,
745
- enableClickItemScroll: enableClickItemScroll
680
+ colors: colors
746
681
  }));
747
682
  }
748
683
  if (fields === 'day') {
@@ -756,8 +691,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
756
691
  get selectedIndex() {
757
692
  return state.selectedIndices[2];
758
693
  },
759
- colors: colors,
760
- enableClickItemScroll: enableClickItemScroll
694
+ colors: colors
761
695
  }));
762
696
  }
763
697
  return renderView;
@@ -797,8 +731,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
797
731
  get selectedIndex() {
798
732
  return state.selectedIndices[i];
799
733
  },
800
- colors: colors,
801
- enableClickItemScroll: enableClickItemScroll
734
+ colors: colors
802
735
  }));
803
736
  }
804
737
  return columns;
@@ -812,11 +745,10 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
812
745
  get selectedIndex() {
813
746
  return state.selectedIndices[0];
814
747
  },
815
- colors: colors,
816
- enableClickItemScroll: enableClickItemScroll
748
+ colors: colors
817
749
  });
818
750
  }
819
- }, [mode, range, rangeKey, fields, updateIndex, updateDay, handleColumnChange, pickerDateRef.current, level, regionData, state.selectedIndices, state.a11yTimeLimitColumnId, state.a11yTimeLimitNonce, consumeTimeA11yLimitFocus, columnsCount, lang, colors, enableClickItemScroll]);
751
+ }, [mode, range, rangeKey, fields, updateIndex, updateDay, handleColumnChange, pickerDateRef.current, level, regionData, state.selectedIndices, columnsCount, lang, colors]);
820
752
  // 动画类名控制逻辑
821
753
  const clsMask = classNames('taro-picker__mask-overlay', 'taro-picker__animate-fade-in', {
822
754
  'taro-picker__animate-fade-out': state.fadeOut
@@ -830,9 +762,6 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
830
762
  const titleStyle = colors.titleColor ? {
831
763
  color: colors.titleColor
832
764
  } : null;
833
- const maskOverlayStyle = colors.maskColor ? {
834
- backgroundColor: colors.maskColor
835
- } : undefined;
836
765
  // 暴露方法给外部
837
766
  React__default.useImperativeHandle(ref, () => ({
838
767
  showPicker,
@@ -853,21 +782,16 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
853
782
  onClick: showPicker,
854
783
  children: children
855
784
  }), memo(() => memo(() => !!!state.hidden)() && createComponent(View, {
856
- get className() {
857
- return classNames('taro-picker__overlay', `taro-picker__overlay--theme-${theme}`);
858
- },
785
+ className: "taro-picker__overlay",
859
786
  get children() {
860
787
  return [createComponent(View, {
861
788
  className: clsMask,
862
- style: maskOverlayStyle,
863
789
  onClick: handleCancel
864
- }), createComponent(View, {
865
- className: clsSlider,
866
- get style() {
867
- return Object.assign(Object.assign({}, backgroundStyle), {
868
- paddingBottom: safeAreaBottom ? `${safeAreaBottom}px` : undefined
869
- });
870
- },
790
+ }), createComponent(View, mergeProps({
791
+ className: clsSlider
792
+ }, backgroundStyle ? {
793
+ style: backgroundStyle
794
+ } : {}, {
871
795
  get children() {
872
796
  return [createComponent(View, mergeProps({
873
797
  className: "taro-picker__hd"
@@ -913,7 +837,7 @@ const Picker = /*#__PURE__*/React__default.forwardRef((props, ref) => {
913
837
  children: renderPickerGroup
914
838
  }))];
915
839
  }
916
- })];
840
+ }))];
917
841
  }
918
842
  }))];
919
843
  }