@tarojs/components-react 4.1.4-beta.2 → 4.1.4-beta.20

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 (50) hide show
  1. package/README.md +31 -0
  2. package/dist/components/button/index.js.map +1 -1
  3. package/dist/components/icon/index.js.map +1 -1
  4. package/dist/components/image/index.js.map +1 -1
  5. package/dist/components/input/index.js.map +1 -1
  6. package/dist/components/picker/index.js +749 -0
  7. package/dist/components/picker/index.js.map +1 -0
  8. package/dist/components/picker/picker-group.js +477 -0
  9. package/dist/components/picker/picker-group.js.map +1 -0
  10. package/dist/components/picker/react-style/style.css +2 -0
  11. package/dist/components/picker/react-style/style.css.map +1 -0
  12. package/dist/components/picker/react-style/style.js +4 -0
  13. package/dist/components/picker/react-style/style.js.map +1 -0
  14. package/dist/components/picker/style/index.scss.js +4 -0
  15. package/dist/components/picker/style/index.scss.js.map +1 -0
  16. package/dist/components/pull-down-refresh/index.js +14 -10
  17. package/dist/components/pull-down-refresh/index.js.map +1 -1
  18. package/dist/components/scroll-view/index.js +11 -3
  19. package/dist/components/scroll-view/index.js.map +1 -1
  20. package/dist/components/swiper/index.js +30 -27
  21. package/dist/components/swiper/index.js.map +1 -1
  22. package/dist/components/text/index.js.map +1 -1
  23. package/dist/components/view/index.js.map +1 -1
  24. package/dist/index.css +1 -1
  25. package/dist/index.js +2 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/solid/components/button/index.js.map +1 -1
  28. package/dist/solid/components/icon/index.js.map +1 -1
  29. package/dist/solid/components/image/index.js.map +1 -1
  30. package/dist/solid/components/picker/index.js +794 -0
  31. package/dist/solid/components/picker/index.js.map +1 -0
  32. package/dist/solid/components/picker/picker-group.js +490 -0
  33. package/dist/solid/components/picker/picker-group.js.map +1 -0
  34. package/dist/solid/components/picker/style/index.scss.js +4 -0
  35. package/dist/solid/components/picker/style/index.scss.js.map +1 -0
  36. package/dist/solid/components/scroll-view/index.js +11 -3
  37. package/dist/solid/components/scroll-view/index.js.map +1 -1
  38. package/dist/solid/components/text/index.js.map +1 -1
  39. package/dist/solid/components/view/index.js.map +1 -1
  40. package/dist/solid/index.css +1 -1
  41. package/dist/solid/index.js +2 -1
  42. package/dist/solid/index.js.map +1 -1
  43. package/dist/solid/utils/hooks.solid.js +10 -5
  44. package/dist/solid/utils/hooks.solid.js.map +1 -1
  45. package/dist/solid/utils/index.js +117 -5
  46. package/dist/solid/utils/index.js.map +1 -1
  47. package/dist/utils/hooks.react.js.map +1 -1
  48. package/dist/utils/index.js +117 -5
  49. package/dist/utils/index.js.map +1 -1
  50. package/package.json +22 -7
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/swiper/index.tsx"],"sourcesContent":["import 'swiper/swiper-bundle.css'\nimport './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\nimport Swipers from 'swiper/bundle'\n\nimport { createForwardRefComponent, debounce } from '../../utils'\n\nimport type ISwiper from 'swiper'\n\nlet INSTANCE_ID = 0\nconst ONE_ADDITIONAL_SLIDES_THRESHOLD = 5\nconst TWO_ADDITIONAL_SLIDES_THRESHOLD = 7\n\ninterface SwiperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n itemId: string\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\ninterface SwiperProps extends React.HTMLAttributes<HTMLDivElement> {\n autoplay?: boolean\n interval?: number\n duration?: number\n current?: number\n displayMultipleItems?: number\n circular?: boolean\n vertical?: boolean\n spaceBetween?: any\n previousMargin?: string\n nextMargin?: string\n indicatorColor?: string\n indicatorActiveColor?: string\n indicatorDots?: boolean\n currentItemId?: string\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n full?: boolean\n onAnimationFinish?: (e: TouchEvent) => void\n effectsProps?: Record<string, any>\n}\n\nconst createEvent = (type: string) => {\n let e\n try {\n e = new TouchEvent(type)\n } catch (err) {\n e = document.createEvent('Event')\n e.initEvent(type, true, true)\n }\n return e\n}\n\nclass SwiperItemInner extends React.Component<SwiperItemProps, Record<string, unknown>> {\n render () {\n const { className, style, itemId, children, forwardedRef, ...restProps } = this.props\n const cls = classNames('swiper-slide', className)\n return (\n <div\n ref={(e) => {\n if (e && forwardedRef) {\n forwardedRef.current = e\n }\n }}\n className={cls}\n style={style}\n item-id={itemId}\n {...restProps}\n >\n {children}\n </div>\n )\n }\n}\n\ninterface SwiperState {\n swiperWrapper: HTMLElement | null\n}\n\nclass SwiperInner extends React.Component<SwiperProps, SwiperState> {\n _id = 1 + INSTANCE_ID++\n #source = 'autoplay'\n #swiperResetting: boolean = false\n #lastSwiperActiveIndex: number = 0\n // dom 变化是否由外部引起,因为 swiper 的循环模式也会引起 dom 的变化。如果不是由外部引起的 dom 变化,就不需要重新初始化 swiper\n #domChangeByOutSide: boolean = false\n $el: HTMLDivElement | null\n swiper: ISwiper| null\n observer: MutationObserver\n\n constructor(props) {\n super(props)\n this.state = {\n swiperWrapper: null\n }\n }\n\n componentDidMount () {\n this.handleInit()\n }\n\n hackSwiperWrapDomAction () {\n if (!this.state.swiperWrapper || !this.swiper) return\n const appendChild = this.state.swiperWrapper.appendChild.bind(this.state.swiperWrapper)\n const removeChild = this.state.swiperWrapper.removeChild.bind(this.state.swiperWrapper)\n const replaceChild = this.state.swiperWrapper.replaceChild.bind(this.state.swiperWrapper)\n const insertBefore = this.state.swiperWrapper.insertBefore.bind(this.state.swiperWrapper)\n\n const beforeAction = () => {\n if (!this.state.swiperWrapper || !this.swiper) return\n this.#swiperResetting = true\n if (!this.#domChangeByOutSide && this.props.circular) {\n // 如果是由于外部子节点的变化引起的 dom 变化,需要重新初始化 swiper。\n // 在初dom操作之前,需要调用 loopDestroy,把子节点的顺序恢复\n this.#domChangeByOutSide = true\n this.swiper.loopDestroy()\n this.swiper.params.loop = false\n }\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.appendChild = (...args) => {\n beforeAction()\n return appendChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.removeChild = (...args) => {\n beforeAction()\n return removeChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.replaceChild = (...args) => {\n beforeAction()\n return replaceChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.insertBefore = (...args) => {\n beforeAction()\n return insertBefore(...args)\n }\n }\n\n handleInit = (reset = false) => {\n const {\n autoplay = false,\n circular = true,\n current = 0,\n displayMultipleItems = 1,\n duration = 500,\n interval = 5000,\n currentItemId,\n effectsProps = {},\n vertical\n } = this.props\n\n let initialSlide = parseInt(String(current), 10)\n if (reset) {\n initialSlide = this.#lastSwiperActiveIndex\n } else {\n if (currentItemId) {\n let itemIdIndex = 0\n this.getSlidersList().forEach((swiperItem, index) => {\n // @ts-ignore\n if (swiperItem.itemId && swiperItem.itemId === currentItemId) {\n itemIdIndex = index\n }\n })\n initialSlide = itemIdIndex\n }\n }\n\n const loopAdditionalSlides = this.getLoopAdditionalSlides()\n const centeredSlides = displayMultipleItems === 1 && this.getNeedFixLoop()\n const slidesPerView = displayMultipleItems\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this\n const opt: Record<string, any> = {\n // 指示器\n pagination: { el: `.taro-swiper-${this._id} > .swiper-container > .swiper-pagination` },\n direction: vertical ? 'vertical' : 'horizontal',\n loop: circular,\n slidesPerView: slidesPerView,\n initialSlide,\n speed: parseInt(String(duration), 10),\n observer: true,\n observeParents: true,\n nested: true,\n loopAdditionalSlides,\n centeredSlides,\n touchReleaseOnEdges: true,\n threshold: 0,\n ...effectsProps,\n on: {\n init (_swiper) {\n that.getNeedFixLoop() && _swiper.loopFix()\n that.props.autoplay && _swiper.autoplay.start()\n },\n transitionEnd (_swiper) {\n if (that.#swiperResetting || that.#lastSwiperActiveIndex === _swiper.realIndex) return\n that.#lastSwiperActiveIndex = _swiper.realIndex\n that.getNeedFixLoop() && _swiper.loopFix()\n that.props.autoplay && _swiper.autoplay.start()\n const e = createEvent('touchend')\n try {\n const currentId = that.getCurrentId(_swiper)\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n source: that.#source,\n current: this.realIndex,\n currentId: currentId\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnAnimationFinish(e)\n that.#source = 'autoplay'\n },\n touchMove () {\n that.#source = 'touch'\n },\n touchEnd: (_swiper) => {\n that.#source = 'touch'\n that.props.autoplay && _swiper.autoplay.start()\n },\n touchStart: (_swiper) => {\n that.#source = 'touch'\n that.props.autoplay && _swiper.autoplay.pause()\n },\n slideChange (_swiper) {\n if (that.#swiperResetting || that.#lastSwiperActiveIndex === _swiper.realIndex) return\n const e = createEvent('touchend')\n try {\n const currentId = that.getCurrentId(_swiper)\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.realIndex,\n source: that.#source,\n currentId,\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnChange(e)\n },\n autoplay (_swiper) {\n // Note: 修复 autoplay 时,切换到其他页面再切回来,autoplay 会停止的问题\n _swiper.animating = false\n that.#source = 'autoplay'\n }\n }\n }\n\n // 自动播放\n if (autoplay) {\n opt.autoplay = {\n delay: parseInt(String(interval), 10),\n disableOnInteraction: false\n }\n }\n\n this.swiper = new Swipers(this.$el!, opt)\n\n // Note: 这里是拦截了 swiper 的 minTranslate 和 maxTranslate 方法,手动修复了 loop 模式下的 margin 问题\n // 因为这两个属性会影响滑动到哪个位置进行 fixloop\n // 可参考源码:https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/events/onTouchMove.mjs\n // https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/loop/loopFix.mjs\n if (this.getNeedFixLoop()) {\n // @ts-ignore\n const minTranslate = this.swiper.minTranslate.bind(this.swiper)\n // @ts-ignore\n const maxTranslate = this.swiper.maxTranslate.bind(this.swiper)\n if (centeredSlides && this.getSlidersList().length < 4) {\n // @ts-ignore\n this.swiper.minTranslate = () => minTranslate() + this.parseMargin()[1]\n // @ts-ignore\n this.swiper.maxTranslate = () => maxTranslate() - this.parseMargin()[0]\n } else {\n // @ts-ignore\n this.swiper.minTranslate = () => minTranslate() - this.parseMargin()[0]\n // @ts-ignore\n this.swiper.maxTranslate = () => maxTranslate() + this.parseMargin()[1]\n }\n }\n\n this.setState({\n swiperWrapper: this.swiper.wrapperEl\n })\n }\n\n componentDidUpdate (prevProps, pervState) {\n if (!this.swiper || !this.state.swiperWrapper) return\n if (pervState.swiperWrapper !== this.state.swiperWrapper && this.state.swiperWrapper) {\n this.observer && this.observer.disconnect()\n this.observer = new MutationObserver(this.handleSwiperSizeDebounce)\n this.observer.observe(this.state.swiperWrapper as Node, {\n childList: true\n })\n this.hackSwiperWrapDomAction()\n }\n\n if (prevProps.circular !== this.props.circular || prevProps.displayMultipleItems !== this.props.displayMultipleItems) {\n this.reset()\n }\n\n if (prevProps.interval !== this.props.interval) {\n if (typeof this.swiper.params.autoplay === 'object') {\n this.swiper.params.autoplay.delay = this.props.interval\n }\n }\n\n if (prevProps.duration !== this.props.duration) {\n this.swiper.params.speed = this.props.duration\n }\n\n if (prevProps.current !== this.props.current && !this.props.currentItemId) {\n const n = parseInt(String(this.props.current), 10)\n if (isNaN(n) || n === this.swiper.realIndex) return\n this.#source = ''\n if (this.props.circular) {\n this.swiper.slideToLoop(n) // 更新下标\n this.props.autoplay && this.swiper.autoplay.pause()\n // @ts-ignore\n this.swiper.loopFix()\n this.props.autoplay && this.swiper.autoplay.start()\n } else {\n this.swiper.slideTo(n) // 更新下标\n }\n }\n\n if (prevProps.autoplay !== this.props.autoplay) {\n const swiperAutoplay = this.swiper.autoplay\n if (swiperAutoplay) {\n if (swiperAutoplay.running === this.props.autoplay) return\n\n if (this.props.autoplay) {\n if (this.swiper.params && typeof this.swiper.params.autoplay === 'object') {\n if (this.swiper.params.autoplay.disableOnInteraction === true) {\n this.swiper.params.autoplay.disableOnInteraction = false\n }\n this.swiper.params.autoplay.delay = this.props.interval\n }\n swiperAutoplay.start()\n } else {\n swiperAutoplay.stop()\n }\n }\n }\n\n if (prevProps.currentItemId !== this.props.currentItemId) {\n let itemIdIndex = 0\n this.getSlidersList().forEach((swiperItem, index) => {\n const itemId = swiperItem.getAttribute('item-id')\n // @ts-ignore\n if (itemId === this.props.currentItemId) {\n if (this.props.circular) {\n itemIdIndex = Number(swiperItem.getAttribute('data-swiper-slide-index'))\n } else {\n itemIdIndex = index\n }\n }\n })\n if (isNaN(itemIdIndex) || itemIdIndex === this.swiper.realIndex) return\n this.#source = ''\n if (this.props.circular) {\n this.swiper.slideToLoop(itemIdIndex) // 更新下标\n this.props.autoplay && this.swiper.autoplay.pause()\n // @ts-ignore\n this.swiper.loopFix()\n this.props.autoplay && this.swiper.autoplay.start()\n } else {\n this.swiper.slideTo(itemIdIndex) // 更新下标\n }\n }\n }\n\n componentWillUnmount () {\n this.$el = null\n this.swiper?.destroy?.()\n this.observer?.disconnect?.()\n this.setState({\n swiperWrapper: null\n })\n }\n\n handleOnChange (e: React.FormEvent<HTMLDivElement>) {\n const func = this.props.onChange\n typeof func === 'function' && func(e)\n }\n\n handleOnAnimationFinish (e: TouchEvent) {\n const func = this.props.onAnimationFinish\n typeof func === 'function' && func(e)\n }\n\n handleSwiperSizeDebounce = debounce(() => {\n if (!this.swiper) return\n if (this.props.circular) {\n if (this.#domChangeByOutSide) {\n this.reset()\n this.#domChangeByOutSide = false\n }\n } else {\n this.swiper.update()\n this.#swiperResetting = false\n }\n }, 50)\n\n\n reset = () => {\n if (!this.swiper) return\n this.#swiperResetting = true\n this.#lastSwiperActiveIndex = this.swiper.realIndex\n this.swiper.destroy()\n this.handleInit(true)\n this.#swiperResetting = false\n }\n\n // 以下为方法函数\n getSlidersList = () => this.$el?.querySelectorAll?.('.swiper-slide') || []\n\n // 获取是否需要手动修复 loop 的条件\n getNeedFixLoop = () => {\n const margins = this.parseMargin()\n const hasMargin = margins.filter(Boolean).length > 0\n return this.props.circular && hasMargin\n }\n\n // Note: loop 的时候添加 additionalSlides 可以避免循环的时候由于 loopFix 不及时,出现空白的问题。但是并不是 additionalSlides 越多越好,因为 additionalSlides 越多,如果 swiper-item 的数量不够,会导致出现 bug。\n // 目前的策略是 swiper-item 的数量小于等于 5 时,不添加 additionalSlides,大于 5 小于等于 7 时,添加 1 个 additionalSlides,大于 7 时,添加 2 个 additionalSlides。\n getLoopAdditionalSlides():number {\n const slidersLength = (this.getSlidersList()).length\n if (!this.$el || !this.getNeedFixLoop() || slidersLength < ONE_ADDITIONAL_SLIDES_THRESHOLD) return 0\n if (slidersLength <= TWO_ADDITIONAL_SLIDES_THRESHOLD) return 1\n return 2\n }\n\n parseMargin = () => {\n const { previousMargin = '0px', nextMargin = '0px' } = this.props\n const [, pM] = /^(\\d+)px/.exec(previousMargin) || []\n const [, nN] = /^(\\d+)px/.exec(nextMargin as string) || []\n return [parseInt(pM) || 0, parseInt(nN) || 0]\n }\n\n getCurrentId (swiper: ISwiper) {\n const slides = swiper.slides\n const activeIndex = swiper.activeIndex\n const currentSlide = slides[activeIndex]\n return currentSlide.getAttribute('item-id')\n }\n\n render () {\n const {\n className,\n style,\n vertical,\n indicatorColor,\n indicatorActiveColor,\n forwardedRef\n } = this.props\n const defaultIndicatorColor = indicatorColor || 'rgba(0, 0, 0, .3)'\n const defaultIndicatorActiveColor = indicatorActiveColor || '#000'\n const [pM, nM] = this.parseMargin()\n const cls = classNames(`taro-swiper-${this._id}`, className)\n const sty = Object.assign({ overflow: 'hidden' }, style)\n if (this.props.full) {\n sty.height = '100%'\n }\n const swiperContainerStyleList:string [] = [\n 'overflow: visible;',\n vertical ? `margin-top: ${pM}px; margin-bottom: ${nM}px;` : `margin-right: ${nM}px; margin-left: ${pM}px;`,\n this.props.full ? 'height: 100%;' : ''\n ]\n\n\n const swiperPaginationStyleList:string [] = [\n this.props.indicatorDots ? 'opacity: 1;' : 'display: none;',\n 'font-size: 0;'\n ]\n return (\n <div className={`swiper-container-wrapper ${cls}`} style={sty} ref={(e) => {\n if (forwardedRef && e) {\n forwardedRef.current = e\n }\n }}>\n <div className='swiper-container' style={{ overflow: 'visible' }} ref={(el) => { this.$el = el }}>\n <div\n dangerouslySetInnerHTML={{\n __html: `<style type='text/css'>\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet { background: ${defaultIndicatorColor} }\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet-active { background: ${defaultIndicatorActiveColor} }\n .taro-swiper-${this._id} > .swiper-container { ${swiperContainerStyleList.join('')} }\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination { ${swiperPaginationStyleList.join('')} }\n </style>`\n }}\n />\n <div className='swiper-wrapper' >{this.props.children}</div>\n <div className='swiper-pagination' />\n </div>\n </div>\n )\n }\n}\n\nexport const Swiper = createForwardRefComponent(SwiperInner)\nexport const SwiperItem = createForwardRefComponent(SwiperItemInner)\n"],"names":["INSTANCE_ID","ONE_ADDITIONAL_SLIDES_THRESHOLD","TWO_ADDITIONAL_SLIDES_THRESHOLD","createEvent","type","e","TouchEvent","err","document","initEvent","SwiperItemInner","React","Component","render","_a","props","className","style","itemId","children","forwardedRef","restProps","__rest","cls","classNames","_jsx","ref","current","SwiperInner","constructor","_id","_SwiperInner_source","set","_SwiperInner_swiperResetting","_SwiperInner_lastSwiperActiveIndex","_SwiperInner_domChangeByOutSide","handleInit","reset","autoplay","circular","displayMultipleItems","duration","interval","currentItemId","effectsProps","vertical","initialSlide","parseInt","String","__classPrivateFieldGet","itemIdIndex","getSlidersList","forEach","swiperItem","index","loopAdditionalSlides","getLoopAdditionalSlides","centeredSlides","getNeedFixLoop","slidesPerView","that","opt","Object","assign","pagination","el","direction","loop","speed","observer","observeParents","nested","touchReleaseOnEdges","threshold","on","init","_swiper","loopFix","start","transitionEnd","realIndex","__classPrivateFieldSet","currentId","getCurrentId","defineProperty","enumerable","value","source","handleOnAnimationFinish","touchMove","touchEnd","touchStart","pause","slideChange","handleOnChange","animating","delay","disableOnInteraction","swiper","Swipers","$el","minTranslate","bind","maxTranslate","length","parseMargin","setState","swiperWrapper","wrapperEl","handleSwiperSizeDebounce","debounce","update","destroy","_b","querySelectorAll","margins","hasMargin","filter","Boolean","previousMargin","nextMargin","pM","exec","nN","state","componentDidMount","hackSwiperWrapDomAction","appendChild","removeChild","replaceChild","insertBefore","beforeAction","loopDestroy","params","args","componentDidUpdate","prevProps","pervState","disconnect","MutationObserver","observe","childList","n","isNaN","slideToLoop","slideTo","swiperAutoplay","running","stop","getAttribute","Number","componentWillUnmount","_d","_c","func","onChange","onAnimationFinish","slidersLength","slides","activeIndex","currentSlide","indicatorColor","indicatorActiveColor","defaultIndicatorColor","defaultIndicatorActiveColor","nM","sty","overflow","full","height","swiperContainerStyleList","swiperPaginationStyleList","indicatorDots","_jsxs","dangerouslySetInnerHTML","__html","join","Swiper","createForwardRefComponent","SwiperItem"],"mappings":";;;;;;;;;;AAWA,IAAIA,WAAW,GAAG,CAAC;AACnB,MAAMC,+BAA+B,GAAG,CAAC;AACzC,MAAMC,+BAA+B,GAAG,CAAC;AA4BzC,MAAMC,WAAW,GAAIC,IAAY,IAAI;AACnC,EAAA,IAAIC,CAAC;EACL,IAAI;AACFA,IAAAA,CAAC,GAAG,IAAIC,UAAU,CAACF,IAAI,CAAC;GACzB,CAAC,OAAOG,GAAG,EAAE;AACZF,IAAAA,CAAC,GAAGG,QAAQ,CAACL,WAAW,CAAC,OAAO,CAAC;IACjCE,CAAC,CAACI,SAAS,CAACL,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC/B;AACA,EAAA,OAAOC,CAAC;AACV,CAAC;AAED,MAAMK,eAAgB,SAAQC,cAAK,CAACC,SAAmD,CAAA;AACrFC,EAAAA,MAAMA,GAAA;AACJ,IAAA,MAAMC,EAAA,GAAqE,IAAI,CAACC,KAAK;AAA/E,MAAA;QAAEC,SAAS;QAAEC,KAAK;QAAEC,MAAM;QAAEC,QAAQ;AAAEC,QAAAA;AAAY,OAAA,GAA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ACJ,KAAK,CAACI;SAAc,CAC3D,eAAAM,GAAA,CAAA,KAAA,EAAA;AAAKT,UAAAA,SAAS,EAAC;AAAmB,SAAA,CACpC;OAAK;AACP,KAAK,CAAC;AAEV;AACD;;MAEYiK,MAAM,GAAGC,yBAAyB,CAACtJ,WAAW;MAC9CuJ,UAAU,GAAGD,yBAAyB,CAACxK,eAAe;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/swiper/index.tsx"],"sourcesContent":["import 'swiper/swiper-bundle.css'\nimport './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\nimport Swipers from 'swiper/bundle'\n\nimport { createForwardRefComponent, debounce } from '../../utils'\n\nimport type ISwiper from 'swiper'\n\nlet INSTANCE_ID = 0\nconst ONE_ADDITIONAL_SLIDES_THRESHOLD = 5\nconst TWO_ADDITIONAL_SLIDES_THRESHOLD = 7\n\ninterface SwiperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n itemId: string\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\ninterface SwiperProps extends React.HTMLAttributes<HTMLDivElement> {\n autoplay?: boolean\n interval?: number\n duration?: number\n current?: number\n displayMultipleItems?: number\n circular?: boolean\n vertical?: boolean\n spaceBetween?: any\n previousMargin?: string\n nextMargin?: string\n indicatorColor?: string\n indicatorActiveColor?: string\n indicatorDots?: boolean\n currentItemId?: string\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n full?: boolean\n onAnimationFinish?: (e: TouchEvent) => void\n effectsProps?: Record<string, any>\n}\n\nconst createEvent = (type: string) => {\n let e\n try {\n e = new TouchEvent(type)\n } catch (err) {\n e = document.createEvent('Event')\n e.initEvent(type, true, true)\n }\n return e\n}\n\nclass SwiperItemInner extends React.Component<SwiperItemProps, Record<string, unknown>> {\n render () {\n const { className, style, itemId, children, forwardedRef, ...restProps } = this.props\n const cls = classNames('swiper-slide', className)\n return (\n <div\n ref={(e) => {\n if (e && forwardedRef) {\n forwardedRef.current = e\n }\n }}\n className={cls}\n style={style}\n item-id={itemId}\n {...restProps}\n >\n {children}\n </div>\n )\n }\n}\n\ninterface SwiperState {\n swiperWrapper: HTMLElement | null\n}\n\nclass SwiperInner extends React.Component<SwiperProps, SwiperState> {\n _id = 1 + INSTANCE_ID++\n #source = 'autoplay'\n #swiperResetting: boolean = false\n #lastSwiperActiveIndex: number = 0\n // dom 变化是否由外部引起,因为 swiper 的循环模式也会引起 dom 的变化。如果不是由外部引起的 dom 变化,就不需要重新初始化 swiper\n #domChangeByOutSide: boolean = false\n $el: HTMLDivElement | null\n swiper: ISwiper| null\n observer: MutationObserver\n\n constructor(props) {\n super(props)\n this.state = {\n swiperWrapper: null\n }\n }\n\n componentDidMount () {\n this.handleInit()\n }\n\n hackSwiperWrapDomAction () {\n if (!this.state.swiperWrapper || !this.swiper) return\n const appendChild = this.state.swiperWrapper.appendChild.bind(this.state.swiperWrapper)\n const removeChild = this.state.swiperWrapper.removeChild.bind(this.state.swiperWrapper)\n const replaceChild = this.state.swiperWrapper.replaceChild.bind(this.state.swiperWrapper)\n const insertBefore = this.state.swiperWrapper.insertBefore.bind(this.state.swiperWrapper)\n\n const beforeAction = () => {\n if (!this.state.swiperWrapper || !this.swiper) return\n this.#swiperResetting = true\n if (!this.#domChangeByOutSide && this.props.circular) {\n // 如果是由于外部子节点的变化引起的 dom 变化,需要重新初始化 swiper。\n // 在初dom操作之前,需要调用 loopDestroy,把子节点的顺序恢复\n this.#domChangeByOutSide = true\n this.swiper.loopDestroy()\n this.swiper.params.loop = false\n }\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.appendChild = (...args) => {\n beforeAction()\n return appendChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.removeChild = (...args) => {\n beforeAction()\n return removeChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.replaceChild = (...args) => {\n beforeAction()\n return replaceChild(...args)\n }\n\n // eslint-disable-next-line react/no-direct-mutation-state\n this.state.swiperWrapper.insertBefore = (...args) => {\n beforeAction()\n return insertBefore(...args)\n }\n }\n\n handleInit = (reset = false) => {\n const {\n autoplay = false,\n circular = true,\n current = 0,\n displayMultipleItems = 1,\n duration = 500,\n interval = 5000,\n currentItemId,\n effectsProps = {},\n vertical\n } = this.props\n\n let initialSlide = parseInt(String(current), 10)\n if (reset) {\n initialSlide = this.#lastSwiperActiveIndex\n } else {\n if (currentItemId) {\n let itemIdIndex = 0\n this.getSlidersList().forEach((swiperItem, index) => {\n // @ts-ignore\n if (swiperItem.itemId && swiperItem.itemId === currentItemId) {\n itemIdIndex = index\n }\n })\n initialSlide = itemIdIndex\n }\n }\n\n const loopAdditionalSlides = this.getLoopAdditionalSlides()\n const centeredSlides = displayMultipleItems === 1 && this.getNeedFixLoop()\n const slidesPerView = displayMultipleItems\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this\n const opt: Record<string, any> = {\n // 指示器\n pagination: { el: `.taro-swiper-${this._id} > .swiper-container > .swiper-pagination` },\n direction: vertical ? 'vertical' : 'horizontal',\n loop: circular,\n slidesPerView: slidesPerView,\n initialSlide,\n speed: parseInt(String(duration), 10),\n observer: true,\n observeParents: true,\n nested: true,\n loopAdditionalSlides,\n centeredSlides,\n touchReleaseOnEdges: true,\n threshold: 0,\n ...effectsProps,\n on: {\n init (_swiper) {\n that.getNeedFixLoop() && _swiper.loopFix()\n that.props.autoplay && _swiper.autoplay.start()\n },\n transitionEnd (_swiper) {\n if (that.#swiperResetting || that.#lastSwiperActiveIndex === _swiper.realIndex) return\n that.#lastSwiperActiveIndex = _swiper.realIndex\n that.getNeedFixLoop() && _swiper.loopFix()\n that.props.autoplay && _swiper.autoplay.start()\n const e = createEvent('touchend')\n try {\n const currentId = that.getCurrentId(_swiper)\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n source: that.#source,\n current: this.realIndex,\n currentId: currentId\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnAnimationFinish(e)\n that.#source = 'autoplay'\n },\n touchMove () {\n that.#source = 'touch'\n },\n touchEnd: (_swiper) => {\n that.#source = 'touch'\n that.props.autoplay && _swiper.autoplay.start()\n },\n touchStart: (_swiper) => {\n that.#source = 'touch'\n that.props.autoplay && _swiper.autoplay.pause()\n },\n slideChange (_swiper) {\n if (that.#swiperResetting || that.#lastSwiperActiveIndex === _swiper.realIndex) return\n const e = createEvent('touchend')\n try {\n const currentId = that.getCurrentId(_swiper)\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.realIndex,\n source: that.#source,\n currentId,\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnChange(e)\n },\n autoplay (_swiper) {\n // Note: 修复 autoplay 时,切换到其他页面再切回来,autoplay 会停止的问题\n _swiper.animating = false\n that.#source = 'autoplay'\n }\n }\n }\n\n // 自动播放\n if (autoplay) {\n opt.autoplay = {\n delay: parseInt(String(interval), 10),\n disableOnInteraction: false\n }\n }\n\n this.swiper = new Swipers(this.$el!, opt)\n\n // Note: 这里是拦截了 swiper 的 minTranslate 和 maxTranslate 方法,手动修复了 loop 模式下的 margin 问题\n // 因为这两个属性会影响滑动到哪个位置进行 fixloop\n // 可参考源码:https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/events/onTouchMove.mjs\n // https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/loop/loopFix.mjs\n if (this.getNeedFixLoop()) {\n // @ts-ignore\n const minTranslate = this.swiper.minTranslate.bind(this.swiper)\n // @ts-ignore\n const maxTranslate = this.swiper.maxTranslate.bind(this.swiper)\n if (centeredSlides && this.getSlidersList().length < 4) {\n // @ts-ignore\n this.swiper.minTranslate = () => minTranslate() + this.parseMargin()[1]\n // @ts-ignore\n this.swiper.maxTranslate = () => maxTranslate() - this.parseMargin()[0]\n } else {\n // @ts-ignore\n this.swiper.minTranslate = () => minTranslate() - this.parseMargin()[0]\n // @ts-ignore\n this.swiper.maxTranslate = () => maxTranslate() + this.parseMargin()[1]\n }\n }\n\n this.setState({\n swiperWrapper: this.swiper.wrapperEl\n })\n }\n\n componentDidUpdate (prevProps, pervState) {\n if (!this.swiper || !this.state.swiperWrapper) return\n if (pervState.swiperWrapper !== this.state.swiperWrapper && this.state.swiperWrapper) {\n this.observer && this.observer.disconnect()\n this.observer = new MutationObserver(this.handleSwiperSizeDebounce)\n this.observer.observe(this.state.swiperWrapper as Node, {\n childList: true\n })\n this.hackSwiperWrapDomAction()\n }\n\n if (prevProps.circular !== this.props.circular || prevProps.displayMultipleItems !== this.props.displayMultipleItems) {\n this.reset()\n }\n\n if (prevProps.interval !== this.props.interval) {\n if (typeof this.swiper.params.autoplay === 'object') {\n this.swiper.params.autoplay.delay = this.props.interval\n }\n }\n\n if (prevProps.duration !== this.props.duration) {\n this.swiper.params.speed = this.props.duration\n }\n\n if (prevProps.current !== this.props.current && !this.props.currentItemId) {\n const n = parseInt(String(this.props.current), 10)\n if (isNaN(n) || n === this.swiper.realIndex) return\n this.#source = ''\n if (this.props.circular) {\n this.swiper.slideToLoop(n) // 更新下标\n this.props.autoplay && this.swiper.autoplay.pause()\n // @ts-ignore\n this.swiper.loopFix()\n this.props.autoplay && this.swiper.autoplay.start()\n } else {\n this.swiper.slideTo(n) // 更新下标\n }\n }\n\n if (prevProps.autoplay !== this.props.autoplay) {\n const swiperAutoplay = this.swiper.autoplay\n if (swiperAutoplay) {\n if (swiperAutoplay.running === this.props.autoplay) return\n\n if (this.props.autoplay) {\n if (this.swiper.params && typeof this.swiper.params.autoplay === 'object') {\n if (this.swiper.params.autoplay.disableOnInteraction === true) {\n this.swiper.params.autoplay.disableOnInteraction = false\n }\n this.swiper.params.autoplay.delay = this.props.interval\n }\n swiperAutoplay.start()\n } else {\n swiperAutoplay.stop()\n }\n }\n }\n\n if (prevProps.currentItemId !== this.props.currentItemId) {\n let itemIdIndex = 0\n this.getSlidersList().forEach((swiperItem, index) => {\n const itemId = swiperItem.getAttribute('item-id')\n // @ts-ignore\n if (itemId === this.props.currentItemId) {\n if (this.props.circular) {\n itemIdIndex = Number(swiperItem.getAttribute('data-swiper-slide-index'))\n } else {\n itemIdIndex = index\n }\n }\n })\n if (isNaN(itemIdIndex) || itemIdIndex === this.swiper.realIndex) return\n this.#source = ''\n if (this.props.circular) {\n this.swiper.slideToLoop(itemIdIndex) // 更新下标\n this.props.autoplay && this.swiper.autoplay.pause()\n // @ts-ignore\n this.swiper.loopFix()\n this.props.autoplay && this.swiper.autoplay.start()\n } else {\n this.swiper.slideTo(itemIdIndex) // 更新下标\n }\n }\n }\n\n componentWillUnmount () {\n this.$el = null\n this.swiper?.destroy?.()\n this.observer?.disconnect?.()\n this.setState({\n swiperWrapper: null\n })\n }\n\n handleOnChange (e: React.FormEvent<HTMLDivElement>) {\n const func = this.props.onChange\n typeof func === 'function' && func(e)\n }\n\n handleOnAnimationFinish (e: TouchEvent) {\n const func = this.props.onAnimationFinish\n typeof func === 'function' && func(e)\n }\n\n handleSwiperSizeDebounce = debounce(() => {\n if (!this.swiper) return\n if (this.props.circular) {\n if (this.#domChangeByOutSide) {\n this.reset()\n this.#domChangeByOutSide = false\n }\n } else {\n this.swiper.update()\n this.#swiperResetting = false\n }\n }, 50)\n\n\n reset = () => {\n if (!this.swiper) return\n this.#swiperResetting = true\n this.#lastSwiperActiveIndex = this.swiper.realIndex\n this.swiper.destroy()\n this.handleInit(true)\n this.#swiperResetting = false\n }\n\n // 以下为方法函数\n getSlidersList = () => this.$el?.querySelectorAll?.('.swiper-slide') || []\n\n // 获取是否需要手动修复 loop 的条件\n getNeedFixLoop = () => {\n const margins = this.parseMargin()\n const hasMargin = margins.filter(Boolean).length > 0\n return this.props.circular && hasMargin\n }\n\n // Note: loop 的时候添加 additionalSlides 可以避免循环的时候由于 loopFix 不及时,出现空白的问题。但是并不是 additionalSlides 越多越好,因为 additionalSlides 越多,如果 swiper-item 的数量不够,会导致出现 bug。\n // 目前的策略是 swiper-item 的数量小于等于 5 时,不添加 additionalSlides,大于 5 小于等于 7 时,添加 1 个 additionalSlides,大于 7 时,添加 2 个 additionalSlides。\n getLoopAdditionalSlides():number {\n const slidersLength = (this.getSlidersList()).length\n if (!this.$el || !this.getNeedFixLoop() || slidersLength < ONE_ADDITIONAL_SLIDES_THRESHOLD) return 0\n if (slidersLength <= TWO_ADDITIONAL_SLIDES_THRESHOLD) return 1\n return 2\n }\n\n parseMargin = () => {\n const { previousMargin = '0px', nextMargin = '0px' } = this.props\n const [, pM] = /^(\\d+)px/.exec(previousMargin) || []\n const [, nN] = /^(\\d+)px/.exec(nextMargin as string) || []\n return [parseInt(pM) || 0, parseInt(nN) || 0]\n }\n\n getCurrentId (swiper: ISwiper) {\n const slides = swiper.slides\n const activeIndex = swiper.activeIndex\n const currentSlide = slides[activeIndex]\n return currentSlide.getAttribute('item-id')\n }\n\n render () {\n const {\n className,\n style,\n vertical,\n indicatorColor,\n indicatorActiveColor,\n forwardedRef\n } = this.props\n const defaultIndicatorColor = indicatorColor || 'rgba(0, 0, 0, .3)'\n const defaultIndicatorActiveColor = indicatorActiveColor || '#000'\n const [pM, nM] = this.parseMargin()\n const cls = classNames(`taro-swiper-${this._id}`, className)\n const sty = Object.assign({ overflow: 'hidden' }, style)\n if (this.props.full) {\n sty.height = '100%'\n }\n const swiperContainerStyleList:string [] = [\n 'overflow: visible;',\n vertical ? `margin-top: ${pM}px; margin-bottom: ${nM}px;` : `margin-right: ${nM}px; margin-left: ${pM}px;`,\n this.props.full ? 'height: 100%;' : ''\n ]\n\n\n const swiperPaginationStyleList:string [] = [\n this.props.indicatorDots ? 'opacity: 1;' : 'display: none;',\n 'font-size: 0;'\n ]\n return (\n <div className={`swiper-container-wrapper ${cls}`} style={sty} ref={(e) => {\n if (forwardedRef && e) {\n forwardedRef.current = e\n }\n }}>\n <div className='swiper-container' style={{ overflow: 'visible' }} ref={(el) => { this.$el = el }}>\n <div\n dangerouslySetInnerHTML={{\n __html: `<style type='text/css'>\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet { background: ${defaultIndicatorColor} }\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet-active { background: ${defaultIndicatorActiveColor} }\n .taro-swiper-${this._id} > .swiper-container { ${swiperContainerStyleList.join('')} }\n .taro-swiper-${this._id} > .swiper-container > .swiper-pagination { ${swiperPaginationStyleList.join('')} }\n </style>`\n }}\n />\n <div className='swiper-wrapper' >{this.props.children}</div>\n <div className='swiper-pagination' />\n </div>\n </div>\n )\n }\n}\n\nexport const Swiper = createForwardRefComponent(SwiperInner)\nexport const SwiperItem = createForwardRefComponent(SwiperItemInner)\n"],"names":["INSTANCE_ID","ONE_ADDITIONAL_SLIDES_THRESHOLD","TWO_ADDITIONAL_SLIDES_THRESHOLD","createEvent","type","e","TouchEvent","err","document","initEvent","SwiperItemInner","React","Component","render","_a","props","className","style","itemId","children","forwardedRef","restProps","__rest","cls","classNames","_jsx","ref","current","SwiperInner","constructor","_this","this","_id","_SwiperInner_source","set","_SwiperInner_swiperResetting","_SwiperInner_lastSwiperActiveIndex","_SwiperInner_domChangeByOutSide","handleInit","reset","arguments","length","undefined","autoplay","circular","displayMultipleItems","duration","interval","currentItemId","effectsProps","vertical","initialSlide","parseInt","String","__classPrivateFieldGet","itemIdIndex","getSlidersList","forEach","swiperItem","index","loopAdditionalSlides","getLoopAdditionalSlides","centeredSlides","getNeedFixLoop","slidesPerView","that","opt","Object","assign","pagination","el","direction","loop","speed","observer","observeParents","nested","touchReleaseOnEdges","threshold","on","init","_swiper","loopFix","start","transitionEnd","realIndex","__classPrivateFieldSet","currentId","getCurrentId","defineProperty","enumerable","value","source","handleOnAnimationFinish","touchMove","touchEnd","touchStart","pause","slideChange","handleOnChange","animating","delay","disableOnInteraction","swiper","Swipers","$el","minTranslate","bind","maxTranslate","parseMargin","setState","swiperWrapper","wrapperEl","handleSwiperSizeDebounce","debounce","update","destroy","_b","querySelectorAll","margins","hasMargin","filter","Boolean","previousMargin","nextMargin","pM","exec","nN","state","componentDidMount","hackSwiperWrapDomAction","appendChild","removeChild","replaceChild","insertBefore","beforeAction","loopDestroy","params","componentDidUpdate","prevProps","pervState","disconnect","MutationObserver","observe","childList","n","isNaN","slideToLoop","slideTo","swiperAutoplay","running","stop","getAttribute","Number","componentWillUnmount","_d","_c","func","onChange","onAnimationFinish","slidersLength","slides","activeIndex","currentSlide","indicatorColor","indicatorActiveColor","defaultIndicatorColor","defaultIndicatorActiveColor","nM","sty","overflow","full","height","swiperContainerStyleList","swiperPaginationStyleList","indicatorDots","_jsxs","dangerouslySetInnerHTML","__html","join","Swiper","createForwardRefComponent","SwiperItem"],"mappings":";;;;;;;;;;AAWA,IAAIA,WAAW,GAAG,CAAC;AACnB,MAAMC,+BAA+B,GAAG,CAAC;AACzC,MAAMC,+BAA+B,GAAG,CAAC;AA4BzC,MAAMC,WAAW,GAAIC,IAAY,IAAI;AACnC,EAAA,IAAIC,CAAC;EACL,IAAI;AACFA,IAAAA,CAAC,GAAG,IAAIC,UAAU,CAACF,IAAI,CAAC;GACzB,CAAC,OAAOG,GAAG,EAAE;AACZF,IAAAA,CAAC,GAAGG,QAAQ,CAACL,WAAW,CAAC,OAAO,CAAC;IACjCE,CAAC,CAACI,SAAS,CAACL,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC/B;AACA,EAAA,OAAOC,CAAC;AACV,CAAC;AAED,MAAMK,eAAgB,SAAQC,cAAK,CAACC,SAAmD,CAAA;AACrFC,EAAAA,MAAMA,GAAA;AACJ,IAAA,MAAMC,EAAA,GAAqE,IAAI,CAACC,KAAK;AAA/E,MAAA;QAAEC,SAAS;QAAEC,KAAK;QAAEC,MAAM;QAAEC,QAAQ;AAAEC,QAAAA;AAAY,OAAA,GAAAN,EAA6B;AAAxBO,MAAAA,SAAS,GAAAC,MAAA,CAAAR,EAAA,EAAhE,CAAkE,WAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,cAAA,CAAA,CAAa;AACrF,IAAA,MA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,eAAA1J,GAAA,CAAA,KAAA,EAAA;AAAKT,UAAAA,SAAS,EAAC,gBAAgB;AAAAG,UAAAA,QAAA,EAAG,IAAI,CAACJ,KAAK,CAACI;SAAc,CAC3D,eAAAM,GAAA,CAAA,KAAA,EAAA;AAAKT,UAAAA,SAAS,EAAC;AAAmB,SACpC,CAAA;OAAK;AACP,KAAK,CAAC;AAEV;AACD;;MAEYoK,MAAM,GAAGC,yBAAyB,CAACzJ,WAAW;MAC9C0J,UAAU,GAAGD,yBAAyB,CAAC3K,eAAe;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport { createForwardRefComponent } from '../../utils'\n\ninterface IProps extends React.HTMLAttributes<HTMLSpanElement> {\n selectable?: boolean\n forwardedRef?: React.MutableRefObject<HTMLSpanElement>\n}\n\nfunction Text (props: IProps) {\n const { className, selectable = false, forwardedRef, ...restProps } = props\n const cls = classNames(\n 'taro-text',\n {\n 'taro-text__selectable': selectable\n },\n className\n )\n return (\n <span {...restProps} className={cls} ref={forwardedRef}>\n {props.children}\n </span>\n )\n}\n\nexport default createForwardRefComponent(Text)\n"],"names":["Text","props","className","selectable","forwardedRef","restProps","__rest","cls","classNames","_jsx","ref","children","createForwardRefComponent"],"mappings":";;;;;;;AAYA,SAASA,IAAIA,CAAEC,KAAa,EAAA;EAC1B,MAAM;MAAEC,SAAS;AAAEC,MAAAA,UAAU,GAAG,KAAK;AAAEC,MAAAA;AAAY,KAAA,GAAmBH,KAAK;AAAnBI,IAAAA,SAAS,GAAAC,MAAA,CAAKL,KAAK,EAArE,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,CAA6D,CAAQ;AAC3E,EAAA,MAAMM,GAAG,GAAGC,UAAU,CACpB,WAAW,EACX;AACE,IAAA,uBAAuB,EAAEL;GAC1B,EACDD,SAAS,CACV;AACD,EAAA,oBACEO,GAAA,CAAA,MAAA,EAAA;AAAA,IAAA,GAAUJ,SAAS;AAAEH,IAAAA,SAAS,EAAEK,GAAI;AAACG,IAAAA,GAAG,EAAEN,YAAa;IAAAO,QAAA,EACpDV,KAAK,CAACU;AAAQ,GACX,CAAC;AAEX;AAEA,YAAeC,yBAAyB,CAACZ,IAAI,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\n\nimport { createForwardRefComponent } from '../../utils'\n\ninterface IProps extends React.HTMLAttributes<HTMLSpanElement> {\n selectable?: boolean\n forwardedRef?: React.MutableRefObject<HTMLSpanElement>\n}\n\nfunction Text (props: IProps) {\n const { className, selectable = false, forwardedRef, ...restProps } = props\n const cls = classNames(\n 'taro-text',\n {\n 'taro-text__selectable': selectable\n },\n className\n )\n return (\n <span {...restProps} className={cls} ref={forwardedRef}>\n {props.children}\n </span>\n )\n}\n\nexport default createForwardRefComponent(Text)\n"],"names":["Text","props","className","selectable","forwardedRef","restProps","__rest","cls","classNames","_jsx","ref","children","createForwardRefComponent"],"mappings":";;;;;;;AAYA,SAASA,IAAIA,CAAEC,KAAa,EAAA;EAC1B,MAAM;MAAEC,SAAS;AAAEC,MAAAA,UAAU,GAAG,KAAK;AAAEC,MAAAA;AAA+B,KAAA,GAAAH,KAAK;AAAnBI,IAAAA,SAAS,GAAAC,MAAA,CAAKL,KAAK,EAArE,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,CAA6D,CAAQ;AAC3E,EAAA,MAAMM,GAAG,GAAGC,UAAU,CACpB,WAAW,EACX;AACE,IAAA,uBAAuB,EAAEL;GAC1B,EACDD,SAAS,CACV;AACD,EAAA,oBACEO,GAAA,CAAA,MAAA,EAAA;AAAA,IAAA,GAAUJ,SAAS;AAAEH,IAAAA,SAAS,EAAEK,GAAI;AAACG,IAAAA,GAAG,EAAEN,YAAa;IAAAO,QAAA,EACpDV,KAAK,CAACU;AAAQ,GACX,CAAC;AAEX;AAEA,YAAeC,yBAAyB,CAACZ,IAAI,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\nimport { createForwardRefComponent } from '../../utils/index'\n\nimport type { TFunc } from '@tarojs/runtime/dist/runtime.esm'\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction View ({\n className,\n hoverClass,\n forwardedRef,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n ref={forwardedRef}\n className={process.env.FRAMEWORK === 'solid' ? (cls as unknown as TFunc)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\n\nexport default createForwardRefComponent(View)\n"],"names":["View","_a","className","hoverClass","forwardedRef","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_jsx","ref","children","createForwardRefComponent"],"mappings":";;;;;;AAmBA,SAASA,IAAIA,CAAEC,EAUN,EAAA;MAVM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG;UAET;IADJC,KAAK,GAAAC,MAAA,CAAAV,EAAA,EATK,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CAUd,CADS;AAER,EAAA,IAAIW,YAA2C;EAC/C,IAAIC,SAAS,GAAG,CAAC;EACjB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC;EAClD,MAAM,CAACC,KAAK,EAAEC,QAAQ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OAAqB,KAAK,OAAO,GAAIL,KAA0B,EAAE,GAAGA,KAAK,EAAE;UAC7EF,QAAQ,CAAC,KAAK,CAAC;AACjB;OACD,EAAEN,aAAa,CAAC;AACnB;AACAH,IAAAA,UAAU,IAAIA,UAAU,CAACkB,CAAC,CAAC;GAC5B;AAEDS,EAAAA,SAAS,CAAC,MAAK;AACbb,IAAAA,MAAM,CAACC,UAAU,CACf,EAAE,EACF;AACE,MAAA,CAAC,CAAA,EAAGlB,UAAU,CAAA,CAAE,GAAGmB,OAAqB,KAAK,OAAO,GAAIR,KAA0B,EAAE,GAAGA;KACxF,EACDZ,SAAS,CACV,CAAC;AACJ,GAAC,EAAE,CAACY,KAAK,EAAEZ,SAAS,CAAC,CAAC;AAEtB,EAAA,oBACEgC,GAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAE/B,YAAa;AAClBF,IAAAA,SAAS,EAAEoB,OAAqB,KAAK,OAAO,GAAIH,GAAwB,EAAE,GAAGA,GAAc;AAC3Fd,IAAAA,YAAY,EAAEkB,aAAc;AAC5BjB,IAAAA,UAAU,EAAEyB,WAAY;AACxBxB,IAAAA,WAAW,EAAEsB,YAAa;AAAA,IAAA,GACtBnB,KAAK;IAAA0B,QAAA,EAER1B,KAAK,CAAC0B;AAAQ,GACZ,CAAC;AAEV;AAGA,YAAeC,yBAAyB,CAACrC,IAAI,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\nimport { createForwardRefComponent } from '../../utils/index'\n\nimport type { TFunc } from '@tarojs/runtime/dist/runtime.esm'\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction View ({\n className,\n hoverClass,\n forwardedRef,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n ref={forwardedRef}\n className={process.env.FRAMEWORK === 'solid' ? (cls as unknown as TFunc)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\n\nexport default createForwardRefComponent(View)\n"],"names":["View","_a","className","hoverClass","forwardedRef","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_jsx","ref","children","createForwardRefComponent"],"mappings":";;;;;;AAmBA,SAASA,IAAIA,CAAEC,EAUN,EAAA;MAVM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG;UAET;IADJC,KAAK,GATKC,MAAA,CAAAV,EAAA,EAAA,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CAUd,CADS;AAER,EAAA,IAAIW,YAA2C;EAC/C,IAAIC,SAAS,GAAG,CAAC;EACjB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC;EAClD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAU,KAAK,CAAC;EAElD,MAAM,CAACG,GAAG,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAASK,UAAU,CAC/C,EAAE,EACF;AACE,IAAA,CAAC,CAAGlB,EAAAA,UAAU,CAAE,CAAA,GAAGmB,OAAqB,KAAK,OAAO,GAAIR,KAA0B,EAAE,GAAGA;GACxF,EACDZ,SAAS,CACV,CAAC;EAEF,MAAMqB,aAAa,GAAGC,CAAC,IAAG;AACxB,IAAA,IAAIrB,UAAU,EAAE;MACde,QAAQ,CAAC,IAAI,CAAC;AACdO,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAIH,OAAqB,KAAK,OAAO,GAAIL,KAA0B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CAAC,CAAC;AAEtB,EAAA,oBACEgC,GAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAE/B,YAAa;AAClBF,IAAAA,SAAS,EAAEoB,OAAqB,KAAK,OAAO,GAAIH,GAAwB,EAAE,GAAGA,GAAc;AAC3Fd,IAAAA,YAAY,EAAEkB,aAAc;AAC5BjB,IAAAA,UAAU,EAAEyB,WAAY;AACxBxB,IAAAA,WAAW,EAAEsB,YAAa;AAAA,IAAA,GACtBnB,KAAK;IAAA0B,QAAA,EAER1B,KAAK,CAAC0B;AAAQ,GACZ,CAAC;AAEV;AAGA,YAAeC,yBAAyB,CAACrC,IAAI,CAAC;;;;"}
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- @-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default],.taro-button-core[plain=true][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain=true][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain=true][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain=true][type=primary]:after{border-width:0}.taro-button-core[plain=true][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain=true][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain=true][type=warn]:after{border-width:0}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain=true]:not([disabled]):active,.taro-button-core[plain=true][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain=true]:after,.taro-button-core[plain=true][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain=true][disabled],.taro-button-core[plain=true][disabled][type=primary]{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;height:240px;overflow:hidden;position:relative;width:320px}.taro-img.taro-img__widthfix,.taro-img__mode-heightfix{height:100%}.taro-img__mode-scaletofill{height:100%;width:100%}.taro-img__mode-aspectfit{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom,.taro-img__mode-top{left:50%;position:absolute;transform:translate(-50%)}.taro-img__mode-bottom{bottom:0}.taro-img__mode-center{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.taro-img__mode-left,.taro-img__mode-right{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{right:0}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core{display:block}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%;overflow:visible;position:relative}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}
1
+ @-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default],.taro-button-core[plain=true][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain=true][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain=true][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain=true][type=primary]:after{border-width:0}.taro-button-core[plain=true][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain=true][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain=true][type=warn]:after{border-width:0}.taro-button-core[plain=true],.taro-button-core[plain=true][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain=true]:not([disabled]):active,.taro-button-core[plain=true][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain=true]:after,.taro-button-core[plain=true][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain=true][disabled],.taro-button-core[plain=true][disabled][type=primary]{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;height:240px;overflow:hidden;position:relative;width:320px}.taro-img.taro-img__widthfix,.taro-img__mode-heightfix{height:100%}.taro-img__mode-scaletofill{height:100%;width:100%}.taro-img__mode-aspectfit{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom,.taro-img__mode-top{left:50%;position:absolute;transform:translate(-50%)}.taro-img__mode-bottom{bottom:0}.taro-img__mode-center{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.taro-img__mode-left,.taro-img__mode-right{position:absolute;top:50%;transform:translateY(-50%)}.taro-img__mode-right{right:0}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core{display:block}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.taro-picker__overlay{position:fixed;z-index:1000}.taro-picker__mask-overlay,.taro-picker__overlay{bottom:0;height:100%;left:0;right:0;top:0;width:100%}.taro-picker__mask-overlay{background-color:rgba(0,0,0,.6);position:absolute;z-index:1001}.taro-picker{background-color:#e5e5e5;bottom:0;font-size:14px;left:0;position:absolute;width:100%;z-index:1002}.taro-picker__hd{align-items:center;background-color:#fff;display:flex;font-size:17px;height:44px;justify-content:space-between;padding:0;position:relative}.taro-picker__hd:after{background-color:#e5e5e5;bottom:0;content:"";height:1px;left:0;position:absolute;transform:scaleY(.5);width:100%}.taro-picker__action{color:#1aad19;flex:0 0 auto;font-size:14px;height:44px;line-height:44px;padding:0 10px}.taro-picker__action:first-child{color:#888}.taro-picker__title{color:#000;font-size:16px;font-weight:500;left:50%;max-width:40%;overflow:hidden;position:absolute;text-overflow:ellipsis;top:50%;transform:translate(-50%,-50%);white-space:nowrap}.taro-picker__bd{background-color:#fff;height:238px;overflow:hidden;width:100%}.taro-picker__bd,.taro-picker__group{box-sizing:border-box;display:flex;flex:1}.taro-picker__group{align-items:center;height:100%;justify-content:center;min-width:0;position:relative}.taro-picker__group--date .taro-picker__columns{display:flex;height:100%;width:100%}.taro-picker__mask{background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6) 40%,hsla(0,0%,100%,0) 45%,hsla(0,0%,100%,0) 55%,hsla(0,0%,100%,.6) 60%,hsla(0,0%,100%,.95));height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:1}.taro-picker__indicator{box-sizing:border-box;height:34px;left:0;position:absolute;top:50%;transform:translateY(-50%);width:100%;z-index:1002}.taro-picker__indicator:after,.taro-picker__indicator:before{background-color:#e5e5e5;content:"";height:1px;left:0;position:absolute;right:0;transform:scaleY(.5)}.taro-picker__indicator:before{top:0}.taro-picker__indicator:after{bottom:0}.taro-picker__content{box-sizing:border-box;height:100%;width:100%}.taro-picker__item{align-items:center;box-sizing:border-box;color:#000;display:flex;font-size:16px;height:34px;justify-content:center;line-height:34px;overflow:hidden;padding:0 8px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.taro-picker__item--selected{color:#1aad19;font-weight:500}.taro-picker__item--disabled{color:#999}.taro-picker__column{flex:1;margin:0 8px}.taro-picker__column:first-child{margin-left:0}.taro-picker__column:last-child{margin-right:0}.taro-picker__item--custom{align-items:center;color:#888;display:flex;font-weight:400;justify-content:center;text-align:center}@keyframes taro-picker__slide-up{0%{transform:translate3d(0,100%,0)}to{transform:translateZ(0)}}@keyframes taro-picker__slide-down{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}@keyframes taro-picker__fade-in{0%{opacity:0}to{opacity:1}}@keyframes taro-picker__fade-out{0%{opacity:1}to{opacity:0}}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%;overflow:visible;position:relative}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
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, Picker, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, StickyHeader, StickySection, Switch, 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, StickyHeader, StickySection, 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 Picker } from './components/picker/index.js';
6
7
  export { default as PullDownRefresh } from './components/pull-down-refresh/index.js';
7
8
  export { default as ScrollView } from './components/scroll-view/index.js';
8
9
  export { Swiper, SwiperItem } from './components/swiper/index.js';
package/dist/index.js.map CHANGED
@@ -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 { 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 { Picker } from '@tarojs/components/lib/react'\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 { 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 { StickyHeader } from '@tarojs/components/lib/react'\nexport { StickySection } 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"}
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 { 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 { StickyHeader } from '@tarojs/components/lib/react'\nexport { StickySection } 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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n}\n\ninterface IState {\n hover:boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type, ...restProps } = props\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef'])}\n type={type}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={onClick}\n disabled={disabled}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n loading={loading.toString()}\n plain={plain.toString()}\n >\n {!!loading && <i className='weui-loading' />}\n {children}\n </button>\n )\n}\n\nexport default createForwardRefComponent(Button)\n"],"names":["Button","props","startTimer","useRef","endTimer","state","setState","useState","hover","touch","useEffect","current","clearTimeout","_onTouchStart","e","Object","assign","hoverClass","disabled","setTimeout","hoverStartTime","onTouchStart","_onTouchEnd","hoverStayTime","onTouchEnd","forwardedRef","plain","children","className","style","onClick","loading","type","restProps","__rest","cls","classNames","_el$","_tmpl$","_$use","_$spread","_$mergeProps","omit","toString","_$insert","_tmpl$2","createForwardRefComponent"],"mappings":";;;;;;;;;AA2BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;AAC5B,EAAA,MAAMC,UAAU,GAAGC,MAAM,EAAiC;AAC1D,EAAA,MAAMC,QAAQ,GAAGD,MAAM,EAAiC;AACxD,EAAA,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAS;AACzCC,IAAAA,KAAK,EAAE,KAAK;AACZC,IAAAA,KAAK,EAAE;AACR,GAAA,CAAC;AAEFC,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,OAAO,MAAK;MACVR,UAAU,CAACS,OAAO,IAAIC,YAAY,CAACV,UAAU,CAACS,OAAO,CAAC;MACtDP,QAAQ,CAACO,OAAO,IAAIC,YAAY,CAACR,QAAQ,CAACO,OAAO,CAAC;KACnD;GACF,EAAE,EAAE,CAAC;EAEN,MAAME,aAAa,GAAIC,CAAsC,IAAI;AAC/DR,IAAAA,QAAQ,CAAEQ,CAAC,IAAKC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAC,MAAA,CAAA,EAAA,EACXF,CAAC,CAAA,EAAA;AACJL,MAAAA,KAAK,EAAE;AAAI,KAAA,CACX,CAAC;AACH,IAAA,IAAIR,KAAK,CAACgB,UAAU,IAAIhB,KAAK,CAACgB,UAAU,KAAK,MAAM,IAAI,CAAChB,KAAK,CAACiB,QAAQ,EAAE;AACtEhB,MAAAA,UAAU,CAACS,OAAO,GAAGQ,UAAU,CAAC,MAAK;QACnC,IAAKd,KAAgB,CAACI,KAAK,EAAE;AAC3BH,UAAAA,QAAQ,CAAEQ,CAAC,IAAKC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAC,MAAA,CAAA,EAAA,EACXF,CAAC,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AA;AAAA,GAAA,GAAA;AAGf;AAEA,YAAeS,yBAAyB,CAAC9C,MAAM,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/button/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n size?: string\n plain?: boolean\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n disabled?: boolean\n loading?: boolean\n type?: string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLButtonElement>\n}\n\ninterface IState {\n hover:boolean\n touch: boolean\n}\n\nfunction Button (props: IProps) {\n const startTimer = useRef<ReturnType<typeof setTimeout>>()\n const endTimer = useRef<ReturnType<typeof setTimeout>>()\n const [state, setState] = useState<IState>({\n hover: false,\n touch: false\n })\n\n useEffect(() => {\n return () => {\n startTimer.current && clearTimeout(startTimer.current)\n endTimer.current && clearTimeout(endTimer.current)\n }\n }, [])\n\n const _onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: true\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n startTimer.current = setTimeout(() => {\n if ((state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: true\n }))\n }\n }, props.hoverStartTime || 20)\n }\n props.onTouchStart && props.onTouchStart(e)\n }\n\n const _onTouchEnd = (e: React.TouchEvent<HTMLButtonElement>) => {\n setState((e) => ({\n ...e,\n touch: false\n }))\n if (props.hoverClass && props.hoverClass !== 'none' && !props.disabled) {\n endTimer.current = setTimeout(() => {\n if (!(state as IState).touch) {\n setState((e) => ({\n ...e,\n hover: false\n }))\n }\n }, props.hoverStayTime || 70)\n }\n props.onTouchEnd && props.onTouchEnd(e)\n }\n\n const { forwardedRef, plain = false, children, disabled = false, className, style, onClick, hoverClass = 'button-hover', loading = false, type, ...restProps } = props\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef'])}\n type={type}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={onClick}\n disabled={disabled}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n loading={loading.toString()}\n plain={plain.toString()}\n >\n {!!loading && <i className='weui-loading' />}\n {children}\n </button>\n )\n}\n\nexport default createForwardRefComponent(Button)\n"],"names":["Button","props","startTimer","useRef","endTimer","state","setState","useState","hover","touch","useEffect","current","clearTimeout","_onTouchStart","e","Object","assign","hoverClass","disabled","setTimeout","hoverStartTime","onTouchStart","_onTouchEnd","hoverStayTime","onTouchEnd","forwardedRef","plain","children","className","style","onClick","loading","type","restProps","__rest","cls","classNames","_el$","_tmpl$","_$use","_$spread","_$mergeProps","omit","toString","_$insert","_tmpl$2","createForwardRefComponent"],"mappings":";;;;;;;;;AA2BA,SAASA,MAAMA,CAAEC,KAAa,EAAA;AAC5B,EAAA,MAAMC,UAAU,GAAGC,MAAM,EAAiC;AAC1D,EAAA,MAAMC,QAAQ,GAAGD,MAAM,EAAiC;AACxD,EAAA,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAS;AACzCC,IAAAA,KAAK,EAAE,KAAK;AACZC,IAAAA,KAAK,EAAE;AACR,GAAA,CAAC;AAEFC,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,OAAO,MAAK;MACVR,UAAU,CAACS,OAAO,IAAIC,YAAY,CAACV,UAAU,CAACS,OAAO,CAAC;MACtDP,QAAQ,CAACO,OAAO,IAAIC,YAAY,CAACR,QAAQ,CAACO,OAAO,CAAC;KACnD;GACF,EAAE,EAAE,CAAC;EAEN,MAAME,aAAa,GAAIC,CAAsC,IAAI;AAC/DR,I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OAAO;AAAA,MAAA,UAAA,EACNZ,QAAQ;AAAA,MAAA,cAAA,EACJL,aAAa;AAAA,MAAA,YAAA,EACfS,WAAW;AAAA,MAAA,IACvBS,OAAOA,GAAA;AAAA,QAAA,OAAEA,OAAO,CAACY,QAAQ,EAAE;AAAA,OAAA;AAAA,MAAA,IAC3BjB,KAAKA,GAAA;AAAA,QAAA,OAAEA,KAAK,CAACiB,QAAQ,EAAE;AAAA;AAAA,KAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA;IAAAC,MAAA,CAAAP,IAAA,EAEtB,CAAC,CAACN,OAAO,IAAAc,OAAA,EAAkC,EAAA,IAAA,CAAA;IAAAD,MAAA,CAAAP,IAAA,EAC3CV,QAAQ,EAAA,IAAA,CAAA;AAAA,IAAA,OAAAU,IAAA;AAAA,GAAA,GAAA;AAGf;AAEA,YAAeS,yBAAyB,CAAC9C,MAAM,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/icon/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\n\ninterface IProps {\n type: string\n color: string\n size?: number | string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLLIElement>\n}\n\nconst Icon = (props: IProps) => {\n let { type, className = '', size = '23', color, forwardedRef } = props\n if (type) type = type.replace(/_/g, '-')\n const cls = classNames(\n {\n [`weui-icon-${type}`]: true\n },\n className\n )\n const style = { 'font-size': size + 'px', color: color }\n\n return (\n // eslint-disable-next-line react/react-in-jsx-scope\n <i ref={forwardedRef} {...omit(props, ['type', 'className', 'forwardedRef'])} className={cls} style={style} />\n )\n}\nexport default createForwardRefComponent(Icon)\n"],"names":["Icon","props","type","className","size","color","forwardedRef","replace","cls","classNames","style","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","omit","createForwardRefComponent"],"mappings":";;;;;;AAcA,MAAMA,IAAI,GAAIC,KAAa,IAAI;EAC7B,IAAI;IAAEC,IAAI;AAAEC,IAAAA,SAAS,GAAG,EAAE;AAAEC,IAAAA,IAAI,GAAG,IAAI;IAAEC,KAAK;AAAEC,IAAAA;AAAY,GAAE,GAAGL,KAAK;EACtE,IAAIC,IAAI,EAAEA,IAAI,GAAGA,IAAI,CAACK,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACxC,MAAMC,GAAG,GAAGC,UAAU,CACpB;IACE,CAAC,CAAA,UAAA,EAAaP,IAAI,CAAA,CAAE,GAAG;GACxB,EACDC,SAAS,CACV;AACD,EAAA,MAAMO,KAAK,GAAG;IAAE,WAAW,EAAEN,IAAI,GAAG,IAAI;AAAEC,IAAAA,KAAK,EAAEA;GAAO;EAExD;AACE,IAAA,CAAA,MAAA;MAAA,IAAAM,IAAA,GAAAC,MAAA,EAAA;MAAA,IAAAC,KAAA,GACQP,YAAY;MAAA,OAAAO,KAAA,KAAA,UAAA,GAAAC,GAAA,CAAAD,KAAA,EAAAF,IAAA,CAAA,GAAZL,YAAY,GAAAK,IAAA;AAAAI,MAAAA,MAAA,CAAAJ,IAAA,EAAAK,UAAA,CAAA,MAAMC,IAAI,CAAChB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,EAAA;AAAA,QAAA,WAAA,EAAaO,GAAG;QAAA,OAAA,EAASE;AAAK,OAAA,CAAA,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAC,IAAA;AAAA,KAAA;AAAA;AAE9G,CAAC;AACD,YAAeO,yBAAyB,CAAClB,IAAI,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/icon/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport classNames from 'classnames'\n\nimport { createForwardRefComponent, omit } from '../../utils'\n\ninterface IProps {\n type: string\n color: string\n size?: number | string\n className?: string\n forwardedRef?: React.MutableRefObject<HTMLLIElement>\n}\n\nconst Icon = (props: IProps) => {\n let { type, className = '', size = '23', color, forwardedRef } = props\n if (type) type = type.replace(/_/g, '-')\n const cls = classNames(\n {\n [`weui-icon-${type}`]: true\n },\n className\n )\n const style = { 'font-size': size + 'px', color: color }\n\n return (\n // eslint-disable-next-line react/react-in-jsx-scope\n <i ref={forwardedRef} {...omit(props, ['type', 'className', 'forwardedRef'])} className={cls} style={style} />\n )\n}\nexport default createForwardRefComponent(Icon)\n"],"names":["Icon","props","type","className","size","color","forwardedRef","replace","cls","classNames","style","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","omit","createForwardRefComponent"],"mappings":";;;;;;AAcA,MAAMA,IAAI,GAAIC,KAAa,IAAI;EAC7B,IAAI;IAAEC,IAAI;AAAEC,IAAAA,SAAS,GAAG,EAAE;AAAEC,IAAAA,IAAI,GAAG,IAAI;IAAEC,KAAK;AAAEC,IAAAA;AAAc,GAAA,GAAGL,KAAK;EACtE,IAAIC,IAAI,EAAEA,IAAI,GAAGA,IAAI,CAACK,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACxC,MAAMC,GAAG,GAAGC,UAAU,CACpB;IACE,CAAC,CAAA,UAAA,EAAaP,IAAI,CAAA,CAAE,GAAG;GACxB,EACDC,SAAS,CACV;AACD,EAAA,MAAMO,KAAK,GAAG;IAAE,WAAW,EAAEN,IAAI,GAAG,IAAI;AAAEC,IAAAA,KAAK,EAAEA;GAAO;EAExD;AACE,IAAA,CAAA,MAAA;MAAA,IAAAM,IAAA,GAAAC,MAAA,EAAA;MAAA,IAAAC,KAAA,GACQP,YAAY;MAAA,OAAAO,KAAA,KAAAC,UAAAA,GAAAA,GAAA,CAAAD,KAAA,EAAAF,IAAA,CAAA,GAAZL,YAAY,GAAAK,IAAA;AAAAI,MAAAA,MAAA,CAAAJ,IAAA,EAAAK,UAAA,CAAA,MAAMC,IAAI,CAAChB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,EAAA;AAAA,QAAA,WAAA,EAAaO,GAAG;QAAA,OAASE,EAAAA;AAAK,OAAA,CAAA,EAAA,KAAA,EAAA,KAAA,CAAA;AAAA,MAAA,OAAAC,IAAA;AAAA,KAAA;AAAA;AAE9G,CAAC;AACD,YAAeO,yBAAyB,CAAClB,IAAI,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\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 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,WAAW,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM;MACJC,SAAS;aACTC,OAAK,GAAG,EAAE;MACVC,GAAG;MACHC,IAAI;MACJC,OAAO;MACPC,QAAQ;MACRC,QAAQ;AACRC,MAAAA;AAAY,KAAA,GAEVb,KAAK;IADJc,KAAK,GAAAC,MAAA,CACNf,KAAK,EAVH,CAAA,WAAA,EAAA,OAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,cAAA,CAUL,CAAQ;AACT,EAAA,MAAMgB,GAAG,GAAGC,UAAU,CACpB,UAAU,EACV;IACE,oBAAoB,EAAER,IAAI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W,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;KAAA,GAEf,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;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/image/index.tsx"],"sourcesContent":["import './style/index.css'\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 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,WAAW,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACvC,MAAM;MACJC,SAAS;aACTC,OAAK,GA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