@tarojs/components-react 4.0.0-beta.9 → 4.0.0-beta.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/index.js +66 -66
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/icon/index.js +10 -5
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/image/index.js +59 -66
- package/dist/components/image/index.js.map +1 -1
- package/dist/components/input/index.js +7 -6
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/pull-down-refresh/index.js +21 -15
- package/dist/components/pull-down-refresh/index.js.map +1 -1
- package/dist/components/scroll-view/index.js +98 -102
- package/dist/components/scroll-view/index.js.map +1 -1
- package/dist/components/swiper/index.js +31 -25
- package/dist/components/swiper/index.js.map +1 -1
- package/dist/components/text/index.js +16 -16
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/view/index.js +69 -76
- package/dist/components/view/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/shared/dist/shared.esm.js +1210 -0
- package/dist/shared/dist/shared.esm.js.map +1 -0
- package/dist/solid/components/button/index.js +92 -0
- package/dist/solid/components/button/index.js.map +1 -0
- package/dist/solid/components/button/style/index.scss.js +4 -0
- package/dist/solid/components/button/style/index.scss.js.map +1 -0
- package/dist/solid/components/icon/index.js +35 -0
- package/dist/solid/components/icon/index.js.map +1 -0
- package/dist/solid/components/icon/style/index.scss.js +4 -0
- package/dist/solid/components/icon/style/index.scss.js.map +1 -0
- package/dist/solid/components/image/index.js +90 -0
- package/dist/solid/components/image/index.js.map +1 -0
- package/dist/solid/components/image/style/index.css.js +4 -0
- package/dist/solid/components/image/style/index.css.js.map +1 -0
- package/dist/solid/components/input/index.js +252 -0
- package/dist/solid/components/input/index.js.map +1 -0
- package/dist/solid/components/input/style/index.scss.js +4 -0
- package/dist/solid/components/input/style/index.scss.js.map +1 -0
- package/dist/solid/components/pull-down-refresh/index.js +328 -0
- package/dist/solid/components/pull-down-refresh/index.js.map +1 -0
- package/dist/solid/components/pull-down-refresh/style/index.css.js +4 -0
- package/dist/solid/components/pull-down-refresh/style/index.css.js.map +1 -0
- package/dist/solid/components/scroll-view/index.js +186 -0
- package/dist/solid/components/scroll-view/index.js.map +1 -0
- package/dist/solid/components/scroll-view/style/index.css.js +4 -0
- package/dist/solid/components/scroll-view/style/index.css.js.map +1 -0
- package/dist/solid/components/swiper/index.js +295 -0
- package/dist/solid/components/swiper/index.js.map +1 -0
- package/dist/solid/components/swiper/style/index.css.js +4 -0
- package/dist/solid/components/swiper/style/index.css.js.map +1 -0
- package/dist/solid/components/text/index.js +28 -0
- package/dist/solid/components/text/index.js.map +1 -0
- package/dist/solid/components/text/style/index.css.js +4 -0
- package/dist/solid/components/text/style/index.css.js.map +1 -0
- package/dist/solid/components/view/index.js +84 -0
- package/dist/solid/components/view/index.js.map +1 -0
- package/dist/solid/components/view/style/index.css.js +4 -0
- package/dist/solid/components/view/style/index.css.js.map +1 -0
- package/dist/solid/index.css +1 -0
- package/dist/solid/index.js +13 -0
- package/dist/solid/index.js.map +1 -0
- package/dist/solid/shared/dist/shared.esm.js +1210 -0
- package/dist/solid/shared/dist/shared.esm.js.map +1 -0
- package/dist/solid/utils/hooks.js +55 -0
- package/dist/solid/utils/hooks.js.map +1 -0
- package/dist/solid/utils/index.js +49 -0
- package/dist/solid/utils/index.js.map +1 -0
- package/dist/utils/hooks.js +55 -0
- package/dist/utils/hooks.js.map +1 -0
- package/package.json +13 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/swiper/index.tsx"],"sourcesContent":["import 'swiper/swiper-bundle.min.css'\nimport './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\nimport Swipers from 'swiper/swiper-bundle.esm.js'\n\nimport { debounce } from '../../utils'\n\nimport type ISwiper from 'swiper'\n\nlet INSTANCE_ID = 0\n\ninterface SwiperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n itemId: string\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 onAnimationFinish?: (e: TouchEvent) => void\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 SwiperItem extends React.Component<SwiperItemProps, Record<string, unknown>> {\n render () {\n const { className, style, itemId, children, ...restProps } = this.props\n const cls = classNames('swiper-slide', className)\n return (\n <div\n className={cls}\n style={style}\n item-id={itemId}\n {...restProps}\n >\n {children}\n </div>\n )\n }\n}\n\nclass Swiper extends React.Component<SwiperProps, Record<string, unknown>> {\n _id = 1 + INSTANCE_ID++\n _$current = 0\n _$width = 0\n _$height = 0\n $el: HTMLDivElement | null\n mySwiper: ISwiper\n observer: MutationObserver\n observerFirst: MutationObserver\n observerLast: MutationObserver\n\n componentDidMount () {\n const {\n autoplay = false,\n circular = true,\n current = 0,\n displayMultipleItems = 1,\n duration = 500,\n interval = 5000,\n spaceBetween,\n vertical\n } = this.props\n\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: parseFloat(String(displayMultipleItems)),\n initialSlide: parseInt(String(current), 10),\n speed: parseInt(String(duration), 10),\n observer: true,\n observeParents: true,\n on: {\n slideChange () {\n const e = createEvent('touchend')\n try {\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.realIndex\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that._$current = this.realIndex\n that.handleOnChange(e)\n },\n transitionEnd () {\n const e = createEvent('touchend')\n try {\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.mySwiper.realIndex\n }\n })\n if (this.mySwiper.isBeginning) {\n this.mySwiper.slideToLoop((this.props.children as any).length - 1, 0)\n } else if (this.mySwiper.isEnd) {\n this.mySwiper.slideToLoop(0, 0)\n }\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnAnimationFinish(e)\n },\n observerUpdate (_swiper: ISwiper, e) {\n const target = e.target\n const className = target && typeof target.className === 'string' ? target.className : ''\n if (className.includes('taro_page') && target.style.display !== 'none') {\n if (that.props.autoplay && target.contains(_swiper.$el[0])) {\n if (that.props.circular) {\n _swiper.slideToLoop(this.realIndex, 0) // 更新下标\n } else {\n _swiper.slideTo(this.realIndex)\n }\n }\n }\n }\n }\n }\n\n // 自动播放\n if (autoplay) {\n opt.autoplay = {\n delay: parseInt(String(interval), 10),\n disableOnInteraction: false\n }\n }\n\n // 两端距离\n if (spaceBetween) {\n opt.spaceBetween = spaceBetween\n }\n\n this.mySwiper = new Swipers(this.$el!, opt)\n setTimeout(() => {\n this.mySwiper.update()\n }, 500)\n\n if (!this.mySwiper || !this.props.circular) return\n\n const wrapper = this.mySwiper.$wrapperEl[0]\n this.observer = new MutationObserver(this.handleSwiperLoopListen)\n\n this.observer.observe(wrapper, {\n childList: true\n })\n }\n\n UNSAFE_componentWillReceiveProps (nextProps) {\n if (this.mySwiper) {\n const nextCurrent = typeof nextProps.current === 'number' ? nextProps.current : this._$current || 0\n\n this.handleSwiperLoop()\n // 是否衔接滚动模式\n if (nextProps.circular) {\n if (!this.mySwiper.isBeginning && !this.mySwiper.isEnd) {\n this.mySwiper.slideToLoop(parseInt(nextCurrent, 10)) // 更新下标\n }\n } else {\n this.mySwiper.slideTo(parseInt(nextCurrent, 10) + 1) // 更新下标\n }\n\n const autoplay = this.mySwiper.autoplay\n // 判断是否需要停止或开始自动轮播\n if (autoplay.running !== nextProps.autoplay) {\n if (nextProps.autoplay) {\n if (typeof this.mySwiper.params.autoplay === 'object') {\n this.mySwiper.params.autoplay.disableOnInteraction = false\n this.mySwiper.params.autoplay.delay = parseInt(String(this.props.interval) || '3000', 10)\n }\n autoplay.start()\n } else {\n autoplay.stop()\n }\n }\n\n this.mySwiper.update() // 更新子元素\n }\n }\n\n componentDidUpdate (preProps) {\n if (preProps.children.length === 0 && (this.props.children as any).length > 0) {\n (this.mySwiper as any).loopDestroy()\n ;(this.mySwiper as any).loopCreate()\n }\n if (!this.mySwiper) return\n if (this.props.autoplay) {\n if (this._$width !== this.mySwiper.width || this._$height !== this.mySwiper.height) {\n this.mySwiper.autoplay.start()\n }\n }\n this._$width = this.mySwiper.width\n this._$height = this.mySwiper.height\n }\n\n componentWillUnmount () {\n this.$el = null\n if (this.mySwiper) this.mySwiper.destroy()\n this.observer?.disconnect?.()\n this.observerFirst?.disconnect?.()\n this.observerLast?.disconnect?.()\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 parsePX (s = '0px') {\n return parseFloat(s.replace(/r*px/i, ''))\n }\n\n handleSwiperLoopListen = () => {\n this.observerFirst?.disconnect?.()\n this.observerLast?.disconnect?.()\n this.observerFirst = new MutationObserver(this.handleSwiperLoop)\n this.observerLast = new MutationObserver(this.handleSwiperLoop)\n const wrapper = this.mySwiper.$wrapperEl[0]\n const list = wrapper.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)')\n if (list.length >= 1) {\n this.observerFirst.observe(list[0], {\n characterData: true\n })\n } else if (list.length >= 2) {\n this.observerLast.observe(list[list.length - 1], {\n characterData: true\n })\n }\n }\n\n handleSwiperLoop = debounce(() => {\n if (this.mySwiper && this.mySwiper.$wrapperEl && this.props.circular) {\n // @ts-ignore\n this.mySwiper.loopDestroy()\n // @ts-ignore\n this.mySwiper.loopCreate()\n }\n }, 500)\n\n render () {\n const {\n className,\n style,\n vertical,\n previousMargin,\n nextMargin,\n indicatorColor,\n indicatorActiveColor\n } = this.props\n const defaultIndicatorColor = indicatorColor || 'rgba(0, 0, 0, .3)'\n const defaultIndicatorActiveColor = indicatorActiveColor || '#000'\n const cls = classNames(`taro-swiper-${this._id}`, className)\n const sty = Object.assign({\n paddingTop: vertical ? this.parsePX(previousMargin) : 0,\n paddingRight: vertical ? 0 : this.parsePX(nextMargin),\n paddingBottom: vertical ? this.parsePX(nextMargin) : 0,\n paddingLeft: vertical ? 0 : this.parsePX(previousMargin),\n overflow: 'hidden'\n }, style)\n const paginationCls = classNames(\n 'swiper-pagination',\n {\n 'swiper-pagination-hidden': !this.props.indicatorDots,\n 'swiper-pagination-bullets': this.props.indicatorDots\n }\n )\n return (\n <div className={`swiper-container-wrapper ${cls}`} style={sty}>\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 </style>`\n }}\n />\n <div className='swiper-wrapper'>{this.props.children}</div>\n <div className={paginationCls} />\n </div>\n </div>\n )\n }\n}\n\nexport { Swiper, SwiperItem }\n"],"names":["INSTANCE_ID","createEvent","type","e","TouchEvent","err","document","initEvent","SwiperItem","React","Component","render","_a","props","className","style","itemId","children","restProps","__rest","cls","classNames","createElement","Object","assign","Swiper","constructor","_id","_$current","_$width","_$height","handleSwiperLoopListen","_b","observerFirst","disconnect","_d","observerLast","_c","MutationObserver","handleSwiperLoop","wrapper","mySwiper","$wrapperEl","list","querySelectorAll","length","observe","characterData","debounce","circular","loopDestroy","loopCreate","componentDidMount","autoplay","current","displayMultipleItems","duration","interval","spaceBetween","vertical","that","opt","pagination","el","direction","loop","slidesPerView","parseFloat","String","initialSlide","parseInt","speed","observer","observeParents","on","slideChange","defineProperty","enumerable","value","realIndex","handleOnChange","transitionEnd","isBeginning","slideToLoop","isEnd","handleOnAnimationFinish","observerUpdate","_swiper","target","includes","display","contains","$el","slideTo","delay","disableOnInteraction","Swipers","setTimeout","update","childList","UNSAFE_componentWillReceiveProps","nextProps","nextCurrent","running","params","start","stop","componentDidUpdate","preProps","width","height","componentWillUnmount","destroy","_f","_e","func","onChange","onAnimationFinish","parsePX","s","arguments","undefined","replace","previousMargin","nextMargin","indicatorColor","indicatorActiveColor","defaultIndicatorColor","defaultIndicatorActiveColor","sty","paddingTop","paddingRight","paddingBottom","paddingLeft","overflow","paginationCls","indicatorDots","ref","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;;AAWA,IAAIA,WAAW,GAAG,CAAC,CAAA;AAuBnB,MAAMC,WAAW,GAAIC,IAAY,IAAI;AACnC,EAAA,IAAIC,CAAC,CAAA;EACL,IAAI;AACFA,IAAAA,CAAC,GAAG,IAAIC,UAAU,CAACF,IAAI,CAAC,CAAA;GACzB,CAAC,OAAOG,GAAG,EAAE;AACZF,IAAAA,CAAC,GAAGG,QAAQ,CAACL,WAAW,CAAC,OAAO,CAAC,CAAA;IACjCE,CAAC,CAACI,SAAS,CAACL,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAC9B,GAAA;AACD,EAAA,OAAOC,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAMK,UAAW,SAAQC,KAAK,CAACC,SAAmD,CAAA;AAChFC,EAAAA,MAAMA,GAAA;AACJ,IAAA,MAAMC,KAAuD,IAAI,CAACC,KAAK;AAAjE,MAAA;QAAEC,SAAS;QAAEC,KAAK;QAAEC,MAAM;AAAEC,QAAAA,QAAAA;AAAqC,OAAA,GAAAL,EAAA;AAAxBM,MAAAA,SAAS,GAAlDC,MAAA,CAAAP,EAAA,EAAA,CAAA,WAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,CA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AA;AAAC,OAAA;AAAC,KAAA,EAC9FtD,KAAA,CAAAa,aAAA,CAAA,KAAA,EAAA;AACEoH,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAE,CAAA;6BACO,IAAI,CAAChH,GAAG,CAAA,oFAAA,EAAuFoG,qBAAqB,CAAA;6BACpH,IAAI,CAACpG,GAAG,CAAA,2FAAA,EAA8FqG,2BAA2B,CAAA;AACvI,sBAAA,CAAA;;AAEX,KAAA,CAAA,EACFvH,KAAK,CAAAa,aAAA,CAAA,KAAA,EAAA;AAAAR,MAAAA,SAAS,EAAC,gBAAA;AAAgB,KAAA,EAAE,IAAI,CAACD,KAAK,CAACI,QAAQ,CAAO,EAC3DR,KAAA,CAAAa,aAAA,CAAA,KAAA,EAAA;AAAKR,MAAAA,SAAS,EAAEyH,aAAAA;MAAiB,CAC7B,CACF,CAAA;AAEV,GAAA;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/swiper/index.tsx"],"sourcesContent":["import 'swiper/swiper-bundle.min.css'\nimport './style/index.css'\n\nimport classNames from 'classnames'\nimport React from 'react'\nimport Swipers from 'swiper/swiper-bundle.esm.js'\n\nimport { debounce } from '../../utils'\n\nimport type ISwiper from 'swiper'\n\nlet INSTANCE_ID = 0\n\ninterface SwiperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n itemId: string\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 onAnimationFinish?: (e: TouchEvent) => void\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 SwiperItem extends React.Component<SwiperItemProps, Record<string, unknown>> {\n render () {\n const { className, style, itemId, children, ...restProps } = this.props\n const cls = classNames('swiper-slide', className)\n return (\n <div\n className={cls}\n style={style}\n item-id={itemId}\n {...restProps}\n >\n {children}\n </div>\n )\n }\n}\n\nclass Swiper extends React.Component<SwiperProps, Record<string, unknown>> {\n _id = 1 + INSTANCE_ID++\n _$current = 0\n _$width = 0\n _$height = 0\n $el: HTMLDivElement | null\n mySwiper: ISwiper\n observer: MutationObserver\n observerFirst: MutationObserver\n observerLast: MutationObserver\n\n componentDidMount () {\n const {\n autoplay = false,\n circular = true,\n current = 0,\n displayMultipleItems = 1,\n duration = 500,\n interval = 5000,\n spaceBetween,\n vertical\n } = this.props\n\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: parseFloat(String(displayMultipleItems)),\n initialSlide: parseInt(String(current), 10),\n speed: parseInt(String(duration), 10),\n observer: true,\n observeParents: true,\n on: {\n slideChange () {\n const e = createEvent('touchend')\n try {\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.realIndex\n }\n })\n } catch (err) {} // eslint-disable-line no-empty\n that._$current = this.realIndex\n that.handleOnChange(e)\n },\n transitionEnd () {\n const e = createEvent('touchend')\n try {\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n value: {\n current: this.mySwiper.realIndex\n }\n })\n if (this.mySwiper.isBeginning) {\n this.mySwiper.slideToLoop((this.props.children as any).length - 1, 0)\n } else if (this.mySwiper.isEnd) {\n this.mySwiper.slideToLoop(0, 0)\n }\n } catch (err) {} // eslint-disable-line no-empty\n that.handleOnAnimationFinish(e)\n },\n observerUpdate (_swiper: ISwiper, e) {\n const target = e.target\n const className = target && typeof target.className === 'string' ? target.className : ''\n if (className.includes('taro_page') && target.style.display !== 'none') {\n if (that.props.autoplay && target.contains(_swiper.$el[0])) {\n if (that.props.circular) {\n _swiper.slideToLoop(this.realIndex, 0) // 更新下标\n } else {\n _swiper.slideTo(this.realIndex)\n }\n }\n }\n }\n }\n }\n\n // 自动播放\n if (autoplay) {\n opt.autoplay = {\n delay: parseInt(String(interval), 10),\n disableOnInteraction: false\n }\n }\n\n // 两端距离\n if (spaceBetween) {\n opt.spaceBetween = spaceBetween\n }\n\n this.mySwiper = new Swipers(this.$el!, opt)\n setTimeout(() => {\n this.mySwiper.update()\n }, 500)\n\n if (!this.mySwiper || !this.props.circular) return\n\n const wrapper = this.mySwiper.$wrapperEl[0]\n this.observer = new MutationObserver(this.handleSwiperLoopListen)\n\n this.observer.observe(wrapper, {\n childList: true\n })\n }\n\n UNSAFE_componentWillReceiveProps (nextProps) {\n if (this.mySwiper) {\n const nextCurrent = typeof nextProps.current === 'number' ? nextProps.current : this._$current || 0\n\n this.handleSwiperLoop()\n // 是否衔接滚动模式\n if (nextProps.circular) {\n if (!this.mySwiper.isBeginning && !this.mySwiper.isEnd) {\n this.mySwiper.slideToLoop(parseInt(nextCurrent, 10)) // 更新下标\n }\n } else {\n this.mySwiper.slideTo(parseInt(nextCurrent, 10) + 1) // 更新下标\n }\n\n const autoplay = this.mySwiper.autoplay\n // 判断是否需要停止或开始自动轮播\n if (autoplay.running !== nextProps.autoplay) {\n if (nextProps.autoplay) {\n if (typeof this.mySwiper.params.autoplay === 'object') {\n this.mySwiper.params.autoplay.disableOnInteraction = false\n this.mySwiper.params.autoplay.delay = parseInt(String(this.props.interval) || '3000', 10)\n }\n autoplay.start()\n } else {\n autoplay.stop()\n }\n }\n\n this.mySwiper.update() // 更新子元素\n }\n }\n\n componentDidUpdate (preProps) {\n if (preProps.children.length === 0 && (this.props.children as any).length > 0) {\n (this.mySwiper as any).loopDestroy()\n ;(this.mySwiper as any).loopCreate()\n }\n if (!this.mySwiper) return\n if (this.props.autoplay) {\n if (this._$width !== this.mySwiper.width || this._$height !== this.mySwiper.height) {\n this.mySwiper.autoplay.start()\n }\n }\n this._$width = this.mySwiper.width\n this._$height = this.mySwiper.height\n }\n\n componentWillUnmount () {\n this.$el = null\n if (this.mySwiper) this.mySwiper.destroy()\n this.observer?.disconnect?.()\n this.observerFirst?.disconnect?.()\n this.observerLast?.disconnect?.()\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 parsePX (s = '0px') {\n return parseFloat(s.replace(/r*px/i, ''))\n }\n\n handleSwiperLoopListen = () => {\n this.observerFirst?.disconnect?.()\n this.observerLast?.disconnect?.()\n this.observerFirst = new MutationObserver(this.handleSwiperLoop)\n this.observerLast = new MutationObserver(this.handleSwiperLoop)\n const wrapper = this.mySwiper.$wrapperEl[0]\n const list = wrapper.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)')\n if (list.length >= 1) {\n this.observerFirst.observe(list[0], {\n characterData: true\n })\n } else if (list.length >= 2) {\n this.observerLast.observe(list[list.length - 1], {\n characterData: true\n })\n }\n }\n\n handleSwiperLoop = debounce(() => {\n if (this.mySwiper && this.mySwiper.$wrapperEl && this.props.circular) {\n // @ts-ignore\n this.mySwiper.loopDestroy()\n // @ts-ignore\n this.mySwiper.loopCreate()\n }\n }, 500)\n\n render () {\n const {\n className,\n style,\n vertical,\n previousMargin,\n nextMargin,\n indicatorColor,\n indicatorActiveColor\n } = this.props\n const defaultIndicatorColor = indicatorColor || 'rgba(0, 0, 0, .3)'\n const defaultIndicatorActiveColor = indicatorActiveColor || '#000'\n const cls = classNames(`taro-swiper-${this._id}`, className)\n const sty = Object.assign({\n paddingTop: vertical ? this.parsePX(previousMargin) : 0,\n paddingRight: vertical ? 0 : this.parsePX(nextMargin),\n paddingBottom: vertical ? this.parsePX(nextMargin) : 0,\n paddingLeft: vertical ? 0 : this.parsePX(previousMargin),\n overflow: 'hidden'\n }, style)\n const paginationCls = classNames(\n 'swiper-pagination',\n {\n 'swiper-pagination-hidden': !this.props.indicatorDots,\n 'swiper-pagination-bullets': this.props.indicatorDots\n }\n )\n return (\n <div className={`swiper-container-wrapper ${cls}`} style={sty}>\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 </style>`\n }}\n />\n <div className='swiper-wrapper'>{this.props.children}</div>\n <div className={paginationCls} />\n </div>\n </div>\n )\n }\n}\n\nexport { Swiper, SwiperItem }\n"],"names":["INSTANCE_ID","createEvent","type","e","TouchEvent","err","document","initEvent","SwiperItem","React","Component","render","_a","props","className","style","itemId","children","restProps","__rest","cls","classNames","_jsx","Swiper","constructor","_id","_$current","_$width","_$height","handleSwiperLoopListen","_b","observerFirst","disconnect","_d","observerLast","_c","MutationObserver","handleSwiperLoop","wrapper","mySwiper","$wrapperEl","list","querySelectorAll","length","observe","characterData","debounce","circular","loopDestroy","loopCreate","componentDidMount","autoplay","current","displayMultipleItems","duration","interval","spaceBetween","vertical","that","opt","pagination","el","direction","loop","slidesPerView","parseFloat","String","initialSlide","parseInt","speed","observer","observeParents","on","slideChange","Object","defineProperty","enumerable","value","realIndex","handleOnChange","transitionEnd","isBeginning","slideToLoop","isEnd","handleOnAnimationFinish","observerUpdate","_swiper","target","includes","display","contains","$el","slideTo","delay","disableOnInteraction","Swipers","setTimeout","update","childList","UNSAFE_componentWillReceiveProps","nextProps","nextCurrent","running","params","start","stop","componentDidUpdate","preProps","width","height","componentWillUnmount","destroy","_f","_e","func","onChange","onAnimationFinish","parsePX","s","arguments","undefined","replace","previousMargin","nextMargin","indicatorColor","indicatorActiveColor","defaultIndicatorColor","defaultIndicatorActiveColor","sty","assign","paddingTop","paddingRight","paddingBottom","paddingLeft","overflow","paginationCls","indicatorDots","_jsxs","ref","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;;;AAWA,IAAIA,WAAW,GAAG,CAAC,CAAA;AAuBnB,MAAMC,WAAW,GAAIC,IAAY,IAAI;AACnC,EAAA,IAAIC,CAAC,CAAA;EACL,IAAI;AACFA,IAAAA,CAAC,GAAG,IAAIC,UAAU,CAACF,IAAI,CAAC,CAAA;GACzB,CAAC,OAAOG,GAAG,EAAE;AACZF,IAAAA,CAAC,GAAGG,QAAQ,CAACL,WAAW,CAAC,OAAO,CAAC,CAAA;IACjCE,CAAC,CAACI,SAAS,CAACL,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAC9B,GAAA;AACD,EAAA,OAAOC,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAMK,UAAW,SAAQC,cAAK,CAACC,SAAmD,CAAA;AAChFC,EAAAA,MAAMA,GAAA;AACJ,IAAA,MAAMC,KAAuD,IAAI,CAACC,KAAK;AAAjE,MAAA;QAAEC,SAAS;QAAEC,KAAK;QAAEC,MAAM;AAAEC,QAAAA,QAAAA;AAAqC,OAAA,GAAAL,EAAA;AAAxBM,MAAAA,SAAS,GAAlDC,MAAA,CAAAP,EAAA,EAAA,CAAA,WAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,CAAoD,CAAa,CAAA;AACvE,IAAA,MAAMQ,GAAG,GAAGC,UAAU,CAAC,cAAc,EAAEP,SAAS,CAAC,CAAA;AACjD,IAAA,oBACEQ,GAAA,CAAA,KAAA,EAAA;AACER,MAAAA,SAAS,EAAEM,GAAI;AACfL,MAAAA,KAAK,EAAEA,KAAM;AACb,MAAA,SAAA,EAASC,MAAO;AAAA,MAAA,GACZE,SAAS;AAAAD,MAAAA,QAAA,EAEZA,QAAAA;AAAQ,KACN,CAAC,CAAA;AAEV,GAAA;AACD,CAAA;AAED,MAAMM,MAAO,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AA,QAAA,EAAE,IAAI,CAACJ,KAAK,CAACI,QAAAA;SAAc,CAC1D,eAAAK,GAAA,CAAA,KAAA,EAAA;AAAKR,UAAAA,SAAS,EAAEyH,aAAAA;AAAc,SAChC,CAAA,CAAA;OAAK,CAAA;AACP,KAAK,CAAC,CAAA;AAEV,GAAA;AACD;;;;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import './style/index.css.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import 'react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
7
|
+
function Text(props) {
|
|
8
|
+
const {
|
|
9
|
+
className,
|
|
10
|
+
selectable = false
|
|
11
|
+
} = props,
|
|
12
|
+
restProps = __rest(props, ["className", "selectable"]);
|
|
13
|
+
const cls = classNames('taro-text', {
|
|
14
|
+
'taro-text__selectable': selectable
|
|
15
|
+
}, className);
|
|
16
|
+
return /*#__PURE__*/jsx("span", {
|
|
17
|
+
...restProps,
|
|
18
|
+
className: cls,
|
|
19
|
+
children: props.children
|
|
20
|
+
});
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export { Text as default };
|
|
@@ -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\ninterface IProps extends React.HTMLAttributes<HTMLSpanElement> {\n selectable?: boolean\n}\n\
|
|
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\ninterface IProps extends React.HTMLAttributes<HTMLSpanElement> {\n selectable?: boolean\n}\n\nfunction Text (props: IProps) {\n const { className, selectable = false, ...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}>\n {props.children}\n </span>\n )\n}\n\nexport default Text\n"],"names":["Text","props","className","selectable","restProps","__rest","cls","classNames","_jsx","children"],"mappings":";;;;;;AASA,SAASA,IAAIA,CAAEC,KAAa,EAAA;EAC1B,MAAM;MAAEC,SAAS;AAAEC,MAAAA,UAAU,GAAG,KAAA;AAAK,KAAA,GAAmBF,KAAK;IAAnBG,SAAS,GAAKC,MAAA,CAAAJ,KAAK,EAAvD,CAAA,WAAA,EAAA,YAAA,CAA+C,CAAQ,CAAA;AAC7D,EAAA,MAAMK,GAAG,GAAGC,UAAU,CACpB,WAAW,EACX;AACE,IAAA,uBAAuB,EAAEJ,UAAAA;GAC1B,EACDD,SAAS,CACV,CAAA;AACD,EAAA,oBACEM,GAAA,CAAA,MAAA,EAAA;AAAA,IAAA,GAAUJ,SAAS;AAAEF,IAAAA,SAAS,EAAEI,GAAI;IAAAG,QAAA,EACjCR,KAAK,CAACQ,QAAAA;AAAQ,GACX,CAAC,CAAA;AAEX;;;;"}
|
|
@@ -1,83 +1,76 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import './style/index.css.js';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import { useState, useEffect } from '../../utils/hooks.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
return React.createElement("div", Object.assign({
|
|
75
|
-
className: cls,
|
|
76
|
-
onTouchStart: _onTouchStart,
|
|
77
|
-
onTouchEnd: _onTouchEnd,
|
|
78
|
-
onTouchMove: _onTouchMove
|
|
79
|
-
}, other), this.props.children);
|
|
80
|
-
}
|
|
7
|
+
function View(_a) {
|
|
8
|
+
var {
|
|
9
|
+
className,
|
|
10
|
+
hoverClass,
|
|
11
|
+
onTouchStart,
|
|
12
|
+
onTouchEnd,
|
|
13
|
+
onTouchMove,
|
|
14
|
+
hoverStartTime = 50,
|
|
15
|
+
hoverStayTime = 400
|
|
16
|
+
} = _a,
|
|
17
|
+
other = __rest(_a, ["className", "hoverClass", "onTouchStart", "onTouchEnd", "onTouchMove", "hoverStartTime", "hoverStayTime"]);
|
|
18
|
+
let timeoutEvent;
|
|
19
|
+
let startTime = 0;
|
|
20
|
+
const [hover, setHover] = useState(false);
|
|
21
|
+
const [touch, setTouch] = useState(false);
|
|
22
|
+
const [cls, setCls] = useState(classNames('', {
|
|
23
|
+
[`${hoverClass}`]: "react" === 'solid' ? hover() : hover
|
|
24
|
+
}, className));
|
|
25
|
+
const _onTouchStart = e => {
|
|
26
|
+
if (hoverClass) {
|
|
27
|
+
setTouch(true);
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
if ("react" === 'solid' ? touch() : touch) {
|
|
30
|
+
setHover(true);
|
|
31
|
+
}
|
|
32
|
+
}, hoverStartTime);
|
|
33
|
+
}
|
|
34
|
+
onTouchStart && onTouchStart(e);
|
|
35
|
+
if (other.onLongPress) {
|
|
36
|
+
timeoutEvent = setTimeout(() => {
|
|
37
|
+
other.onLongPress();
|
|
38
|
+
}, 350);
|
|
39
|
+
startTime = new Date().getTime();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const _onTouchMove = e => {
|
|
43
|
+
clearTimeout(timeoutEvent);
|
|
44
|
+
onTouchMove && onTouchMove(e);
|
|
45
|
+
};
|
|
46
|
+
const _onTouchEnd = e => {
|
|
47
|
+
const spanTime = new Date().getTime() - startTime;
|
|
48
|
+
if (spanTime < 350) {
|
|
49
|
+
clearTimeout(timeoutEvent);
|
|
50
|
+
}
|
|
51
|
+
if (hoverClass) {
|
|
52
|
+
setTouch(false);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
if ("react" === 'solid' ? touch() : touch) {
|
|
55
|
+
setHover(false);
|
|
56
|
+
}
|
|
57
|
+
}, hoverStayTime);
|
|
58
|
+
}
|
|
59
|
+
onTouchEnd && onTouchEnd(e);
|
|
60
|
+
};
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
setCls(classNames('', {
|
|
63
|
+
[`${hoverClass}`]: "react" === 'solid' ? hover() : hover
|
|
64
|
+
}, className));
|
|
65
|
+
}, [hover, className]);
|
|
66
|
+
return /*#__PURE__*/jsx("div", {
|
|
67
|
+
className: "react" === 'solid' ? cls() : cls,
|
|
68
|
+
onTouchStart: _onTouchStart,
|
|
69
|
+
onTouchEnd: _onTouchEnd,
|
|
70
|
+
onTouchMove: _onTouchMove,
|
|
71
|
+
...other,
|
|
72
|
+
children: other.children
|
|
73
|
+
});
|
|
81
74
|
}
|
|
82
75
|
|
|
83
76
|
export { View as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\nimport 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}\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\n\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}\n\nfunction View ({\n className,\n hoverClass,\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 Exclude<typeof hover, boolean>)() : 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 Exclude<typeof touch, boolean>)() : 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 Exclude<typeof touch, boolean>)() : 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 Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n className={process.env.FRAMEWORK === 'solid' ? (cls as Exclude<typeof cls, string>)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\nexport default View\n"],"names":["View","_a","className","hoverClass","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","children"],"mappings":";;;;;;AAkBA,SAASA,IAAIA,CAAEC,EASN,EAAA;MATM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG,GAAA;UAET;IADJC,KAAK,GARKC,MAAA,CAAAT,EAAA,EAAA,CAAA,WAAA,EA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Z,CAAC,CAAA;AAEV;;;;"}
|
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],.taro-button-core[plain][type=default],.taro-button-core[plain][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][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][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][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][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][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][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]:after,.taro-button-core[plain][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][disabled]
|
|
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],.taro-button-core[plain][type=default],.taro-button-core[plain][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][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][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][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][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][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][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]:after,.taro-button-core[plain][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][disabled],.taro-button-core[plain][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{height:100%}.taro-img__mode-aspectfit,.taro-img__mode-scaletofill{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-top,.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom{bottom:0;position:absolute;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{height:100%}.taro-img__mode-right,.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,input{display:block}input{height:1.4rem;overflow:hidden;text-align:inherit;text-overflow:clip;white-space:nowrap}.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%}.swiper-pagination{font-size:0}.swiper-pagination-bullet{opacity:1}.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}body,html{-webkit-tap-highlight-color:rgba(0,0,0,0);user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}
|