@tarojs/components-react 4.1.7-beta.2 → 4.1.7-beta.4

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 (99) hide show
  1. package/dist/components/button/index.js +20 -7
  2. package/dist/components/button/index.js.map +1 -1
  3. package/dist/components/image/index.js +1 -1
  4. package/dist/components/image/index.js.map +1 -1
  5. package/dist/components/image/style/{index.css.js → index.scss.js} +1 -1
  6. package/dist/components/image/style/index.scss.js.map +1 -0
  7. package/dist/components/pull-down-refresh/index.js +1 -1
  8. package/dist/components/pull-down-refresh/index.js.map +1 -1
  9. package/dist/components/{scroll-view/style/index.css.js → pull-down-refresh/style/index.scss.js} +1 -1
  10. package/dist/components/pull-down-refresh/style/index.scss.js.map +1 -0
  11. package/dist/components/scroll-view/index.js +1 -1
  12. package/dist/components/scroll-view/index.js.map +1 -1
  13. package/dist/components/{pull-down-refresh/style/index.css.js → scroll-view/style/index.scss.js} +1 -1
  14. package/dist/components/scroll-view/style/index.scss.js.map +1 -0
  15. package/dist/components/swiper/index.js +1 -1
  16. package/dist/components/swiper/index.js.map +1 -1
  17. package/dist/components/swiper/style/{index.css.js → index.scss.js} +1 -1
  18. package/dist/components/swiper/style/index.scss.js.map +1 -0
  19. package/dist/components/text/index.js +1 -1
  20. package/dist/components/text/index.js.map +1 -1
  21. package/dist/components/text/style/index.scss.js +4 -0
  22. package/dist/components/text/style/index.scss.js.map +1 -0
  23. package/dist/index.css +1 -1
  24. package/dist/original/components/button/index.js +21 -8
  25. package/dist/original/components/button/index.js.map +1 -1
  26. package/dist/original/components/button/style/index.scss +353 -0
  27. package/dist/original/components/icon/index.js +1 -1
  28. package/dist/original/components/icon/style/index.scss +304 -0
  29. package/dist/original/components/image/index.js +1 -1
  30. package/dist/original/components/image/index.js.map +1 -1
  31. package/dist/original/components/image/style/index.scss +90 -0
  32. package/dist/original/components/input/index.js +1 -1
  33. package/dist/original/components/input/style/index.scss +71 -0
  34. package/dist/original/components/picker/index.js +1 -1
  35. package/dist/original/components/picker/style/index.scss +297 -0
  36. package/dist/original/components/pull-down-refresh/index.js +1 -1
  37. package/dist/original/components/pull-down-refresh/index.js.map +1 -1
  38. package/dist/original/components/pull-down-refresh/style/index.scss +53 -0
  39. package/dist/original/components/scroll-view/index.js +1 -1
  40. package/dist/original/components/scroll-view/index.js.map +1 -1
  41. package/dist/original/components/scroll-view/style/index.scss +22 -0
  42. package/dist/original/components/swiper/index.js +1 -1
  43. package/dist/original/components/swiper/index.js.map +1 -1
  44. package/dist/original/components/swiper/style/index.scss +9 -0
  45. package/dist/original/components/text/index.js +1 -1
  46. package/dist/original/components/text/index.js.map +1 -1
  47. package/dist/original/components/text/style/index.scss +13 -0
  48. package/dist/original/node_modules/.pnpm/rollup-plugin-styles@4.0.0_rollup@4.39.0/node_modules/rollup-plugin-styles/dist/runtime/inject-css.js +24 -0
  49. package/dist/original/node_modules/.pnpm/rollup-plugin-styles@4.0.0_rollup@4.39.0/node_modules/rollup-plugin-styles/dist/runtime/inject-css.js.map +1 -0
  50. package/dist/solid/components/button/index.js +20 -7
  51. package/dist/solid/components/button/index.js.map +1 -1
  52. package/dist/solid/components/image/index.js +1 -1
  53. package/dist/solid/components/image/index.js.map +1 -1
  54. package/dist/solid/components/image/style/index.scss.js +4 -0
  55. package/dist/solid/components/image/style/index.scss.js.map +1 -0
  56. package/dist/solid/components/scroll-view/index.js +1 -1
  57. package/dist/solid/components/scroll-view/index.js.map +1 -1
  58. package/dist/solid/components/scroll-view/style/index.scss.js +4 -0
  59. package/dist/solid/components/scroll-view/style/index.scss.js.map +1 -0
  60. package/dist/solid/components/text/index.js +1 -1
  61. package/dist/solid/components/text/index.js.map +1 -1
  62. package/dist/solid/components/text/style/index.scss.js +4 -0
  63. package/dist/solid/components/text/style/index.scss.js.map +1 -0
  64. package/dist/solid/index.css +1 -1
  65. package/package.json +8 -8
  66. package/types/global.d.ts +1 -1
  67. package/types/index.d.ts +3 -1
  68. package/dist/components/image/style/index.css.js.map +0 -1
  69. package/dist/components/pull-down-refresh/style/index.css.js.map +0 -1
  70. package/dist/components/scroll-view/style/index.css.js.map +0 -1
  71. package/dist/components/swiper/style/index.css.js.map +0 -1
  72. package/dist/components/text/style/index.css.js +0 -4
  73. package/dist/components/text/style/index.css.js.map +0 -1
  74. package/dist/original/components/button/style/index.css +0 -3
  75. package/dist/original/components/button/style/index.css.map +0 -1
  76. package/dist/original/components/icon/style/index.css +0 -3
  77. package/dist/original/components/icon/style/index.css.map +0 -1
  78. package/dist/original/components/image/style/index.css +0 -3
  79. package/dist/original/components/image/style/index.css.map +0 -1
  80. package/dist/original/components/input/style/index.css +0 -3
  81. package/dist/original/components/input/style/index.css.map +0 -1
  82. package/dist/original/components/picker/style/index.css +0 -3
  83. package/dist/original/components/picker/style/index.css.map +0 -1
  84. package/dist/original/components/pull-down-refresh/style/index.css +0 -3
  85. package/dist/original/components/pull-down-refresh/style/index.css.map +0 -1
  86. package/dist/original/components/scroll-view/style/index.css +0 -3
  87. package/dist/original/components/scroll-view/style/index.css.map +0 -1
  88. package/dist/original/components/swiper/style/index.css +0 -3
  89. package/dist/original/components/swiper/style/index.css.map +0 -1
  90. package/dist/original/components/text/style/index.css +0 -3
  91. package/dist/original/components/text/style/index.css.map +0 -1
  92. package/dist/original/index.css +0 -2
  93. package/dist/original/index.css.map +0 -1
  94. package/dist/solid/components/image/style/index.css.js +0 -4
  95. package/dist/solid/components/image/style/index.css.js.map +0 -1
  96. package/dist/solid/components/scroll-view/style/index.css.js +0 -4
  97. package/dist/solid/components/scroll-view/style/index.css.js.map +0 -1
  98. package/dist/solid/components/text/style/index.css.js +0 -4
  99. package/dist/solid/components/text/style/index.css.js.map +0 -1
@@ -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","_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"],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esContent":["import 'swiper/swiper-bundle.css'\nimport './style/index.scss'\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,MAAMS,GAAG,GAAGC,UAAU,CAAC,cAAc,EAAER,SAAS,CAAC;AACjD,IAAA,oBACES,GAAA,CAAA,KAAA,EAAA;MACEC,GAAG,EAAGrB,CAAC,IAAI;QACT,IAAIA,CAAC,IAAIe,YAAY,EAAE;UACrBA,YAAY,CAACO,OAAO,GAAGtB,CAAC;AAC1B;OACA;AACFW,MAAAA,SAAS,EAAEO,GAAI;AACfN,MAAAA,KAAK,EAAEA,KAAM;AACb,MAA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AC9C0J,UAAU,GAAGD,yBAAyB,CAAC3K,eAAe;;;;"}
@@ -1,4 +1,4 @@
1
1
  var undefined$1 = undefined;
2
2
 
3
3
  export { undefined$1 as default };
4
- //# sourceMappingURL=index.css.js.map
4
+ //# sourceMappingURL=index.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,5 +1,5 @@
1
1
  import { __rest } from 'tslib';
2
- import './style/index.css.js';
2
+ import './style/index.scss.js';
3
3
  import classNames from 'classnames';
4
4
  import 'react';
5
5
  import { createForwardRefComponent } from '../../utils/index.js';
@@ -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;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
+ {"version":3,"file":"index.js","sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import './style/index.scss'\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;;;;"}
@@ -0,0 +1,4 @@
1
+ var undefined$1 = undefined;
2
+
3
+ export { undefined$1 as default };
4
+ //# sourceMappingURL=index.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
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}.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:#ff0f23;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:#ff0f23;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--hidebar::-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:1px solid rgba(0,0,0,.2);border-radius:10px;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(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core.taro-btn-default{background-color:#f8f8f8;color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):visited{color:#000}.taro-button-core.taro-btn-default:not(.taro-btn-disabled):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core.taro-btn-mini{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-warn{background-color:transparent;border-width:1px}.taro-button-core.taro-btn-disabled{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-disabled.taro-btn-default{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core.taro-btn-disabled.taro-btn-primary{background-color:#9ed99d}.taro-button-core.taro-btn-disabled.taro-btn-warn{background-color:#ec8b89}.taro-button-core.taro-btn-loading .weui-loading{margin:-.2em .34em 0 0}.taro-button-core.taro-btn-loading.taro-btn-primary,.taro-button-core.taro-btn-loading.taro-btn-warn{color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-loading.taro-btn-primary{background-color:#179b16}.taro-button-core.taro-btn-loading.taro-btn-warn{background-color:#ce3c39}.taro-button-core.taro-btn-plain.taro-btn-primary{border:1px solid #1aad19;color:#1aad19}.taro-button-core.taro-btn-plain.taro-btn-primary:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core.taro-btn-plain.taro-btn-primary:after{border-width:0}.taro-button-core.taro-btn-plain.taro-btn-warn{border:1px solid #e64340;color:#e64340}.taro-button-core.taro-btn-plain.taro-btn-warn:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core.taro-btn-plain.taro-btn-warn:after{border-width:0}.taro-button-core.taro-btn-plain,.taro-button-core.taro-btn-plain.taro-btn-default{border:1px solid #353535;color:#353535}.taro-button-core.taro-btn-plain.taro-btn-default:not(.taro-btn-disabled):active,.taro-button-core.taro-btn-plain:not(.taro-btn-disabled):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core.taro-btn-plain.taro-btn-default:after,.taro-button-core.taro-btn-plain:after{border-width:0}.taro-button-core.taro-btn-primary{background-color:#1aad19;color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-primary:not(.taro-btn-disabled):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-warn{background-color:#e64340;color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):visited{color:#fff}.taro-button-core.taro-btn-warn:not(.taro-btn-disabled):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-default,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-primary,.taro-button-core.taro-btn-plain.taro-btn-disabled.taro-btn-warn{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:#ff0f23;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:#ff0f23;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--hidebar::-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,8 +1,8 @@
1
1
  import { __rest } from 'tslib';
2
- import './style/index.css';
2
+ import './style/index.scss';
3
3
  import classNames from 'classnames';
4
4
  import { omit, createForwardRefComponent } from '../../utils/index.js';
5
- import { useRef, useState, useEffect } from '../../utils/hooks.react.js';
5
+ import { useRef, useState, useEffect, useCallback } from '../../utils/hooks.react.js';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
7
 
8
8
  function Button(props) {
@@ -58,20 +58,33 @@ function Button(props) {
58
58
  onClick,
59
59
  hoverClass = 'button-hover',
60
60
  loading = false,
61
- type
61
+ type = 'default',
62
+ size
62
63
  } = props,
63
- restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type"]);
64
+ restProps = __rest(props, ["forwardedRef", "plain", "children", "disabled", "className", "style", "onClick", "hoverClass", "loading", "type", "size"]);
65
+ const handleClick = useCallback(e => {
66
+ if (disabled) return; // 如果按钮不可用,直接返回
67
+ onClick === null || onClick === void 0 ? void 0 : onClick(e); // 否则执行点击回调
68
+ }, [disabled, onClick]);
64
69
  const cls = classNames(className, 'taro-button-core', {
65
- [`${hoverClass}`]: state.hover && !disabled
70
+ [`${hoverClass}`]: state.hover && !disabled,
71
+ 'taro-btn-disabled': disabled,
72
+ 'taro-btn-loading': loading,
73
+ 'taro-btn-plain': plain,
74
+ 'taro-btn-mini': size === 'mini',
75
+ 'taro-btn-default': type === 'default',
76
+ 'taro-btn-primary': type === 'primary',
77
+ 'taro-btn-warn': type === 'warn'
66
78
  });
67
79
  return /*#__PURE__*/jsxs("button", {
68
- ...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef']),
80
+ ...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick']),
69
81
  type: type,
82
+ size: size,
83
+ disabled: disabled,
70
84
  ref: forwardedRef,
71
85
  className: cls,
72
86
  style: style,
73
- onClick: onClick,
74
- disabled: disabled,
87
+ onClick: handleClick,
75
88
  onTouchStart: _onTouchStart,
76
89
  onTouchEnd: _onTouchEnd,
77
90
  loading: loading.toString(),
@@ -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","_jsxs","omit","ref","toString","_jsx","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,EACX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AAG;AAC5Bd,IAAAA,KAAK,EAAEA,KAAK,CAACc,QAAQ,EAAG;AAAAb,IAAAA,QAAA,EAEvB,CAAA,CAAC,CAACI,OAAO,iBAAIU,GAAA,CAAA,GAAA,EAAA;AAAGb,MAAAA,SAAS,EAAC;KAAc,CAAG,EAC3CD,QAAQ;AAAA,GACH,CAAC;AAEb;AAEA,YAAee,yBAAyB,CAAC1C,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 { useCallback, 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 onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void\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 = 'default', size, ...restProps } = props\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) return // 如果按钮不可用,直接返回\n onClick?.(e) // 否则执行点击回调\n },\n [disabled, onClick]\n )\n\n const cls = classNames(\n className,\n 'taro-button-core',\n {\n [`${hoverClass}`]: (state as IState).hover && !disabled,\n 'taro-btn-disabled': disabled,\n 'taro-btn-loading': loading,\n 'taro-btn-plain': plain,\n 'taro-btn-mini': size === 'mini',\n 'taro-btn-default': type === 'default',\n 'taro-btn-primary': type === 'primary',\n 'taro-btn-warn': type === 'warn'\n }\n )\n\n return (\n <button\n {...omit(restProps, ['hoverClass', 'onTouchStart', 'onTouchEnd', 'type', 'loading', 'forwardedRef', 'size', 'plain', 'disabled', 'onClick'])}\n type={type}\n size={size}\n disabled={disabled}\n ref={forwardedRef}\n className={cls}\n style={style}\n onClick={handleClick}\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","size","restProps","__rest","handleClick","useCallback","cls","classNames","_jsxs","omit","ref","toString","_jsx","createForwardRefComponent"],"mappings":";;;;;;;AA4BA,SAASA,M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