@tarojs/components-react 4.0.1 → 4.0.3-alpha.0

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 (67) hide show
  1. package/LICENSE +8 -8
  2. package/dist/components/button/index.js +78 -103
  3. package/dist/components/button/index.js.map +1 -1
  4. package/dist/components/icon/index.js +26 -17
  5. package/dist/components/icon/index.js.map +1 -1
  6. package/dist/components/image/index.js +76 -101
  7. package/dist/components/image/index.js.map +1 -1
  8. package/dist/components/input/index.js +183 -206
  9. package/dist/components/input/index.js.map +1 -1
  10. package/dist/components/pull-down-refresh/index.js +195 -211
  11. package/dist/components/pull-down-refresh/index.js.map +1 -1
  12. package/dist/components/scroll-view/index.js +137 -167
  13. package/dist/components/scroll-view/index.js.map +1 -1
  14. package/dist/components/swiper/index.js +248 -268
  15. package/dist/components/swiper/index.js.map +1 -1
  16. package/dist/components/text/index.js +22 -31
  17. package/dist/components/text/index.js.map +1 -1
  18. package/dist/components/view/index.js +72 -97
  19. package/dist/components/view/index.js.map +1 -1
  20. package/dist/index.css +1 -1
  21. package/dist/solid/components/button/index.js +95 -0
  22. package/dist/solid/components/button/index.js.map +1 -0
  23. package/dist/solid/components/button/style/index.scss.js +4 -0
  24. package/dist/solid/components/button/style/index.scss.js.map +1 -0
  25. package/dist/solid/components/icon/index.js +39 -0
  26. package/dist/solid/components/icon/index.js.map +1 -0
  27. package/dist/solid/components/icon/style/index.scss.js +4 -0
  28. package/dist/solid/components/icon/style/index.scss.js.map +1 -0
  29. package/dist/solid/components/image/index.js +94 -0
  30. package/dist/solid/components/image/index.js.map +1 -0
  31. package/dist/solid/components/input/index.js +256 -0
  32. package/dist/solid/components/input/index.js.map +1 -0
  33. package/dist/solid/components/input/style/index.scss.js +4 -0
  34. package/dist/solid/components/input/style/index.scss.js.map +1 -0
  35. package/dist/solid/components/pull-down-refresh/index.js +334 -0
  36. package/dist/solid/components/pull-down-refresh/index.js.map +1 -0
  37. package/dist/solid/components/pull-down-refresh/style/index.css.js +4 -0
  38. package/dist/solid/components/pull-down-refresh/style/index.css.js.map +1 -0
  39. package/dist/solid/components/scroll-view/index.js +188 -0
  40. package/dist/solid/components/scroll-view/index.js.map +1 -0
  41. package/dist/solid/components/scroll-view/style/index.css.js +4 -0
  42. package/dist/solid/components/scroll-view/style/index.css.js.map +1 -0
  43. package/dist/solid/components/swiper/index.js +307 -0
  44. package/dist/solid/components/swiper/index.js.map +1 -0
  45. package/dist/solid/components/swiper/style/index.css.js +4 -0
  46. package/dist/solid/components/swiper/style/index.css.js.map +1 -0
  47. package/dist/solid/components/text/index.js +32 -0
  48. package/dist/solid/components/text/index.js.map +1 -0
  49. package/dist/solid/components/text/style/index.css.js +4 -0
  50. package/dist/solid/components/text/style/index.css.js.map +1 -0
  51. package/dist/solid/components/view/index.js +88 -0
  52. package/dist/solid/components/view/index.js.map +1 -0
  53. package/dist/solid/index.css +1 -0
  54. package/dist/solid/index.js +13 -0
  55. package/dist/solid/index.js.map +1 -0
  56. package/dist/solid/utils/hooks.solid.js +54 -0
  57. package/dist/solid/utils/hooks.solid.js.map +1 -0
  58. package/dist/solid/utils/index.js +58 -0
  59. package/dist/solid/utils/index.js.map +1 -0
  60. package/dist/utils/hooks.react.js +15 -0
  61. package/dist/utils/hooks.react.js.map +1 -0
  62. package/dist/utils/index.js +26 -15
  63. package/dist/utils/index.js.map +1 -1
  64. package/package.json +19 -18
  65. package/types/index.d.ts +17 -0
  66. /package/dist/{components/view → solid/components/image}/style/index.css.js +0 -0
  67. /package/dist/{components/view → solid/components/image}/style/index.css.js.map +0 -0
@@ -0,0 +1,307 @@
1
+ import { template, use, setAttribute, spread, insert, effect, style } from 'solid-js/web';
2
+ import { __rest } from 'tslib';
3
+ import 'swiper/swiper-bundle.min.css';
4
+ import './style/index.css.js';
5
+ import classNames from 'classnames';
6
+ import React from 'react';
7
+ import Swipers from 'swiper/swiper-bundle.esm.js';
8
+ import { debounce, createForwardRefComponent } from '../../utils/index.js';
9
+
10
+ var _tmpl$ = /*#__PURE__*/template(`<div>`),
11
+ _tmpl$2 = /*#__PURE__*/template(`<div><div class=swiper-container><div></div><div class=swiper-wrapper></div><div>`);
12
+ let INSTANCE_ID = 0;
13
+ const createEvent = type => {
14
+ let e;
15
+ try {
16
+ e = new TouchEvent(type);
17
+ } catch (err) {
18
+ e = document.createEvent('Event');
19
+ e.initEvent(type, true, true);
20
+ }
21
+ return e;
22
+ };
23
+ class SwiperItemInner extends React.Component {
24
+ render() {
25
+ const _a = this.props,
26
+ {
27
+ className,
28
+ style: style$1,
29
+ itemId,
30
+ children,
31
+ forwardedRef
32
+ } = _a,
33
+ restProps = __rest(_a, ["className", "style", "itemId", "children", "forwardedRef"]);
34
+ const cls = classNames('swiper-slide', className);
35
+ return (() => {
36
+ var _el$ = _tmpl$();
37
+ use(e => {
38
+ if (e && forwardedRef) {
39
+ forwardedRef.current = e;
40
+ }
41
+ }, _el$);
42
+ _el$.className = cls;
43
+ setAttribute(_el$, "item-id", itemId);
44
+ spread(_el$, restProps, false, true);
45
+ insert(_el$, children);
46
+ effect(_$p => style(_el$, style$1, _$p));
47
+ return _el$;
48
+ })();
49
+ }
50
+ }
51
+ class SwiperInner extends React.Component {
52
+ constructor() {
53
+ super(...arguments);
54
+ this._id = 1 + INSTANCE_ID++;
55
+ this._$current = 0;
56
+ this._$width = 0;
57
+ this._$height = 0;
58
+ this.handleSwiperLoopListen = () => {
59
+ var _a, _b, _c, _d;
60
+ (_b = (_a = this.observerFirst) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
61
+ (_d = (_c = this.observerLast) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
62
+ this.observerFirst = new MutationObserver(this.handleSwiperLoop);
63
+ this.observerLast = new MutationObserver(this.handleSwiperLoop);
64
+ const wrapper = this.mySwiper.$wrapperEl[0];
65
+ const list = wrapper.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)');
66
+ if (list.length >= 1) {
67
+ this.observerFirst.observe(list[0], {
68
+ characterData: true
69
+ });
70
+ } else if (list.length >= 2) {
71
+ this.observerLast.observe(list[list.length - 1], {
72
+ characterData: true
73
+ });
74
+ }
75
+ };
76
+ this.handleSwiperLoop = debounce(() => {
77
+ if (this.mySwiper && this.mySwiper.$wrapperEl && this.props.circular) {
78
+ // @ts-ignore
79
+ this.mySwiper.loopDestroy();
80
+ // @ts-ignore
81
+ this.mySwiper.loopCreate();
82
+ }
83
+ }, 500);
84
+ }
85
+ componentDidMount() {
86
+ const {
87
+ autoplay = false,
88
+ circular = true,
89
+ current = 0,
90
+ displayMultipleItems = 1,
91
+ duration = 500,
92
+ interval = 5000,
93
+ spaceBetween,
94
+ vertical
95
+ } = this.props;
96
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
97
+ const that = this;
98
+ const opt = {
99
+ // 指示器
100
+ pagination: {
101
+ el: `.taro-swiper-${this._id} > .swiper-container > .swiper-pagination`
102
+ },
103
+ direction: vertical ? 'vertical' : 'horizontal',
104
+ loop: circular,
105
+ slidesPerView: parseFloat(String(displayMultipleItems)),
106
+ initialSlide: parseInt(String(current), 10),
107
+ speed: parseInt(String(duration), 10),
108
+ observer: true,
109
+ observeParents: true,
110
+ on: {
111
+ slideChange() {
112
+ const e = createEvent('touchend');
113
+ try {
114
+ Object.defineProperty(e, 'detail', {
115
+ enumerable: true,
116
+ value: {
117
+ current: this.realIndex
118
+ }
119
+ });
120
+ } catch (err) {} // eslint-disable-line no-empty
121
+ that._$current = this.realIndex;
122
+ that.handleOnChange(e);
123
+ },
124
+ transitionEnd() {
125
+ const e = createEvent('touchend');
126
+ try {
127
+ Object.defineProperty(e, 'detail', {
128
+ enumerable: true,
129
+ value: {
130
+ current: this.mySwiper.realIndex
131
+ }
132
+ });
133
+ if (this.mySwiper.isBeginning) {
134
+ this.mySwiper.slideToLoop(this.props.children.length - 1, 0);
135
+ } else if (this.mySwiper.isEnd) {
136
+ this.mySwiper.slideToLoop(0, 0);
137
+ }
138
+ } catch (err) {} // eslint-disable-line no-empty
139
+ that.handleOnAnimationFinish(e);
140
+ },
141
+ observerUpdate(_swiper, e) {
142
+ const target = e.target;
143
+ const className = target && typeof target.className === 'string' ? target.className : '';
144
+ if (className.includes('taro_page') && target.style.display !== 'none') {
145
+ if (that.props.autoplay && target.contains(_swiper.$el[0])) {
146
+ if (that.props.circular) {
147
+ _swiper.slideToLoop(this.realIndex, 0); // 更新下标
148
+ } else {
149
+ _swiper.slideTo(this.realIndex);
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ };
156
+ // 自动播放
157
+ if (autoplay) {
158
+ opt.autoplay = {
159
+ delay: parseInt(String(interval), 10),
160
+ disableOnInteraction: false
161
+ };
162
+ }
163
+ // 两端距离
164
+ if (spaceBetween) {
165
+ opt.spaceBetween = spaceBetween;
166
+ }
167
+ this.mySwiper = new Swipers(this.$el, opt);
168
+ setTimeout(() => {
169
+ this.mySwiper.update();
170
+ }, 500);
171
+ if (!this.mySwiper || !this.props.circular) return;
172
+ const wrapper = this.mySwiper.$wrapperEl[0];
173
+ this.observer = new MutationObserver(this.handleSwiperLoopListen);
174
+ this.observer.observe(wrapper, {
175
+ childList: true
176
+ });
177
+ }
178
+ UNSAFE_componentWillReceiveProps(nextProps) {
179
+ if (this.mySwiper) {
180
+ const nextCurrent = typeof nextProps.current === 'number' ? nextProps.current : this._$current || 0;
181
+ this.handleSwiperLoop();
182
+ // 是否衔接滚动模式
183
+ if (nextProps.circular) {
184
+ if (!this.mySwiper.isBeginning && !this.mySwiper.isEnd) {
185
+ this.mySwiper.slideToLoop(parseInt(nextCurrent, 10)); // 更新下标
186
+ }
187
+ } else {
188
+ this.mySwiper.slideTo(parseInt(nextCurrent, 10) + 1); // 更新下标
189
+ }
190
+ const autoplay = this.mySwiper.autoplay;
191
+ // 判断是否需要停止或开始自动轮播
192
+ if (autoplay.running !== nextProps.autoplay) {
193
+ if (nextProps.autoplay) {
194
+ if (typeof this.mySwiper.params.autoplay === 'object') {
195
+ this.mySwiper.params.autoplay.disableOnInteraction = false;
196
+ this.mySwiper.params.autoplay.delay = parseInt(String(this.props.interval) || '3000', 10);
197
+ }
198
+ autoplay.start();
199
+ } else {
200
+ autoplay.stop();
201
+ }
202
+ }
203
+ this.mySwiper.update(); // 更新子元素
204
+ }
205
+ }
206
+ componentDidUpdate(preProps) {
207
+ if (preProps.children.length === 0 && this.props.children.length > 0) {
208
+ this.mySwiper.loopDestroy();
209
+ this.mySwiper.loopCreate();
210
+ }
211
+ if (!this.mySwiper) return;
212
+ if (this.props.autoplay) {
213
+ if (this._$width !== this.mySwiper.width || this._$height !== this.mySwiper.height) {
214
+ this.mySwiper.autoplay.start();
215
+ }
216
+ }
217
+ this._$width = this.mySwiper.width;
218
+ this._$height = this.mySwiper.height;
219
+ }
220
+ componentWillUnmount() {
221
+ var _a, _b, _c, _d, _e, _f;
222
+ this.$el = null;
223
+ if (this.mySwiper) this.mySwiper.destroy();
224
+ (_b = (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect) === null || _b === void 0 ? void 0 : _b.call(_a);
225
+ (_d = (_c = this.observerFirst) === null || _c === void 0 ? void 0 : _c.disconnect) === null || _d === void 0 ? void 0 : _d.call(_c);
226
+ (_f = (_e = this.observerLast) === null || _e === void 0 ? void 0 : _e.disconnect) === null || _f === void 0 ? void 0 : _f.call(_e);
227
+ }
228
+ handleOnChange(e) {
229
+ const func = this.props.onChange;
230
+ typeof func === 'function' && func(e);
231
+ }
232
+ handleOnAnimationFinish(e) {
233
+ const func = this.props.onAnimationFinish;
234
+ typeof func === 'function' && func(e);
235
+ }
236
+ parsePX() {
237
+ let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '0px';
238
+ return parseFloat(s.replace(/r*px/i, ''));
239
+ }
240
+ render() {
241
+ const {
242
+ className,
243
+ style: style$1,
244
+ vertical,
245
+ previousMargin,
246
+ nextMargin,
247
+ indicatorColor,
248
+ indicatorActiveColor,
249
+ forwardedRef
250
+ } = this.props;
251
+ const defaultIndicatorColor = indicatorColor || 'rgba(0, 0, 0, .3)';
252
+ const defaultIndicatorActiveColor = indicatorActiveColor || '#000';
253
+ const cls = classNames(`taro-swiper-${this._id}`, className);
254
+ const sty = Object.assign({
255
+ paddingTop: vertical ? this.parsePX(previousMargin) : 0,
256
+ paddingRight: vertical ? 0 : this.parsePX(nextMargin),
257
+ paddingBottom: vertical ? this.parsePX(nextMargin) : 0,
258
+ paddingLeft: vertical ? 0 : this.parsePX(previousMargin),
259
+ overflow: 'hidden'
260
+ }, style$1);
261
+ const paginationCls = classNames('swiper-pagination', {
262
+ 'swiper-pagination-hidden': !this.props.indicatorDots,
263
+ 'swiper-pagination-bullets': this.props.indicatorDots
264
+ });
265
+ const _self$ = this;
266
+ return (() => {
267
+ var _el$2 = _tmpl$2(),
268
+ _el$3 = _el$2.firstChild,
269
+ _el$4 = _el$3.firstChild,
270
+ _el$5 = _el$4.nextSibling,
271
+ _el$6 = _el$5.nextSibling;
272
+ use(e => {
273
+ if (forwardedRef && e) {
274
+ forwardedRef.current = e;
275
+ }
276
+ }, _el$2);
277
+ _el$2.className = `swiper-container-wrapper ${cls}`;
278
+ use(el => {
279
+ _self$.$el = el;
280
+ }, _el$3);
281
+ _el$3.style.setProperty("overflow", "visible");
282
+ insert(_el$5, () => _self$.props.children);
283
+ _el$6.className = paginationCls;
284
+ effect(_p$ => {
285
+ var _v$ = sty,
286
+ _v$2 = {
287
+ __html: `<style type='text/css'>
288
+ .taro-swiper-${_self$._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet { background: ${defaultIndicatorColor} }
289
+ .taro-swiper-${_self$._id} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet-active { background: ${defaultIndicatorActiveColor} }
290
+ </style>`
291
+ };
292
+ _p$.e = style(_el$2, _v$, _p$.e);
293
+ _v$2 !== _p$.t && setAttribute(_el$4, "dangerouslysetinnerhtml", _p$.t = _v$2);
294
+ return _p$;
295
+ }, {
296
+ e: undefined,
297
+ t: undefined
298
+ });
299
+ return _el$2;
300
+ })();
301
+ }
302
+ }
303
+ const Swiper = createForwardRefComponent(SwiperInner);
304
+ const SwiperItem = createForwardRefComponent(SwiperItemInner);
305
+
306
+ export { Swiper, SwiperItem };
307
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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 { createForwardRefComponent, 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 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 forwardedRef?: React.MutableRefObject<HTMLDivElement>\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 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\nclass SwiperInner 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 forwardedRef\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} 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 </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 const Swiper = createForwardRefComponent(SwiperInner)\nexport const SwiperItem = createForwardRefComponent(SwiperItemInner)\n"],"names":["INSTANCE_ID","createEvent","type","e","TouchEvent","err","document","initEvent","SwiperItemInner","React","Component","render","_a","props","className","style","itemId","children","forwardedRef","restProps","__rest","cls","classNames","_el$","_tmpl$","_$use","current","_$setAttribute","_$spread","_$insert","_$effect","_$p","_$style","SwiperInner","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","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","_self$","_el$2","_tmpl$2","_el$3","firstChild","_el$4","_el$5","nextSibling","_el$6","setProperty","_p$","_v$","_v$2","__html","t","Swiper","createForwardRefComponent","SwiperItem"],"mappings":";;;;;;;;;;;AAWA,IAAIA,WAAW,GAAG,CAAC,CAAA;AAyBnB,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;AAC/B,GAAA;AACA,EAAA,OAAOC,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAMK,eAAgB,SAAQC,KAAK,CAACC,SAAmD,CAAA;AACrFC,EAAAA,MAAMA,GAAA;AACJ,IAAA,MAAMC,EAAA,GAAqE,IAAI,CAACC,KAAK;AAA/E,MAAA;QAAEC,SAAS;eAAEC,OAAK;QAAEC,MAAM;QAAEC,QAAQ;AAAEC,QAAAA,YAAAA;AAAY,OAAA,GAAAN,EAA6B;AAAxBO,MAAAA,SAAS,GAAAC,MAAA,CAAAR,EAAA,EAAhE,CAAkE,WAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,cAAA,CAAA,CAAa,CAAA;AACrF,IAAA,MAAMS,GAAG,GAAGC,UAAU,CAAC,cAAc,EAAER,SAAS,CAAC,CAAA;AACjD,IAAA,OAAA,CAAA,MAAA;MAAA,IAAAS,IAAA,GAAAC,MAAA,EAAA,CAAA;MAAAC,GAAA,CAEUtB,CAAC,IAAI;QACT,IAAIA,CAAC,IAAIe,YAAY,EAAE;UACrBA,YAAY,CAACQ,OAA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,GAAA,CAAA;AAAA,OAAA,EAAA;AAAAzJ,QAAAA,CAAA,EAAA8H,SAAA;AAAA+B,QAAAA,CAAA,EAAA/B,SAAAA;AAAA,OAAA,CAAA,CAAA;AAAA,MAAA,OAAAkB,KAAA,CAAA;AAAA,KAAA,GAAA,CAAA;AAOX,GAAA;AACD,CAAA;MAEYc,MAAM,GAAGC,yBAAyB,CAACjI,WAAW,EAAC;MAC/CkI,UAAU,GAAGD,yBAAyB,CAAC1J,eAAe;;;;"}
@@ -0,0 +1,4 @@
1
+ var undefined$1 = undefined;
2
+
3
+ export { undefined$1 as default };
4
+ //# sourceMappingURL=index.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,32 @@
1
+ import { template, use, spread, mergeProps, insert } from 'solid-js/web';
2
+ import { __rest } from 'tslib';
3
+ import './style/index.css.js';
4
+ import classNames from 'classnames';
5
+ import 'react';
6
+ import { createForwardRefComponent } from '../../utils/index.js';
7
+
8
+ var _tmpl$ = /*#__PURE__*/template(`<span>`);
9
+ function Text(props) {
10
+ const {
11
+ className,
12
+ selectable = false,
13
+ forwardedRef
14
+ } = props,
15
+ restProps = __rest(props, ["className", "selectable", "forwardedRef"]);
16
+ const cls = classNames('taro-text', {
17
+ 'taro-text__selectable': selectable
18
+ }, className);
19
+ return (() => {
20
+ var _el$ = _tmpl$();
21
+ use(forwardedRef, _el$);
22
+ spread(_el$, mergeProps(restProps, {
23
+ "className": cls
24
+ }), false, true);
25
+ insert(_el$, () => props.children);
26
+ return _el$;
27
+ })();
28
+ }
29
+ var index = createForwardRefComponent(Text);
30
+
31
+ export { index as default };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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","_el$","_tmpl$","_$use","_$spread","_$mergeProps","_$insert","children","createForwardRefComponent"],"mappings":";;;;;;;;AAYA,SAASA,IAAIA,CAAEC,KAAa,EAAA;EAC1B,MAAM;MAAEC,SAAS;AAAEC,MAAAA,UAAU,GAAG,KAAK;AAAEC,MAAAA,YAAAA;AAA+B,KAAA,GAAAH,KAAK;AAAnBI,IAAAA,SAAS,GAAAC,MAAA,CAAKL,KAAK,EAArE,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,CAA6D,CAAQ,CAAA;AAC3E,EAAA,MAAMM,GAAG,GAAGC,UAAU,CACpB,WAAW,EACX;AACE,IAAA,uBAAuB,EAAEL,UAAAA;GAC1B,EACDD,SAAS,CACV,CAAA;AACD,EAAA,OAAA,CAAA,MAAA;IAAA,IAAAO,IAAA,GAAAC,MAAA,EAAA,CAAA;IAAAC,GAAA,CAC4CP,YAAY,EAAAK,IAAA,CAAA,CAAA;AAAAG,IAAAA,MAAA,CAAAH,IAAA,EAAAI,UAAA,CAA5CR,SAAS,EAAA;MAAA,WAAaE,EAAAA,GAAAA;AAAG,KAAA,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AAAAO,IAAAA,MAAA,CAAAL,IAAA,EAChCR,MAAAA,KAAK,CAACc,QAAQ,CAAA,CAAA;AAAA,IAAA,OAAAN,IAAA,CAAA;AAAA,GAAA,GAAA,CAAA;AAGrB,CAAA;AAEA,YAAeO,yBAAyB,CAAChB,IAAI,CAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ var undefined$1 = undefined;
2
+
3
+ export { undefined$1 as default };
4
+ //# sourceMappingURL=index.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,88 @@
1
+ import { template, use, spread, mergeProps, memo, insert, delegateEvents } from 'solid-js/web';
2
+ import { __rest } from 'tslib';
3
+ import classNames from 'classnames';
4
+ import { useState, useEffect } from '../../utils/hooks.solid.js';
5
+ import { createForwardRefComponent } from '../../utils/index.js';
6
+
7
+ var _tmpl$ = /*#__PURE__*/template(`<div>`);
8
+ function View(_a) {
9
+ var {
10
+ className,
11
+ hoverClass,
12
+ forwardedRef,
13
+ onTouchStart,
14
+ onTouchEnd,
15
+ onTouchMove,
16
+ hoverStartTime = 50,
17
+ hoverStayTime = 400
18
+ } = _a,
19
+ other = __rest(_a, ["className", "hoverClass", "forwardedRef", "onTouchStart", "onTouchEnd", "onTouchMove", "hoverStartTime", "hoverStayTime"]);
20
+ let timeoutEvent;
21
+ let startTime = 0;
22
+ const [hover, setHover] = useState(false);
23
+ const [touch, setTouch] = useState(false);
24
+ const [cls, setCls] = useState(classNames('', {
25
+ [`${hoverClass}`]: "solid" === 'solid' ? hover() : hover
26
+ }, className));
27
+ const _onTouchStart = e => {
28
+ if (hoverClass) {
29
+ setTouch(true);
30
+ setTimeout(() => {
31
+ if ("solid" === 'solid' ? touch() : touch) {
32
+ setHover(true);
33
+ }
34
+ }, hoverStartTime);
35
+ }
36
+ onTouchStart && onTouchStart(e);
37
+ if (other.onLongPress) {
38
+ timeoutEvent = setTimeout(() => {
39
+ other.onLongPress();
40
+ }, 350);
41
+ startTime = new Date().getTime();
42
+ }
43
+ };
44
+ const _onTouchMove = e => {
45
+ clearTimeout(timeoutEvent);
46
+ onTouchMove && onTouchMove(e);
47
+ };
48
+ const _onTouchEnd = e => {
49
+ const spanTime = new Date().getTime() - startTime;
50
+ if (spanTime < 350) {
51
+ clearTimeout(timeoutEvent);
52
+ }
53
+ if (hoverClass) {
54
+ setTouch(false);
55
+ setTimeout(() => {
56
+ if ("solid" === 'solid' ? touch() : touch) {
57
+ setHover(false);
58
+ }
59
+ }, hoverStayTime);
60
+ }
61
+ onTouchEnd && onTouchEnd(e);
62
+ };
63
+ useEffect(() => {
64
+ setCls(classNames('', {
65
+ [`${hoverClass}`]: "solid" === 'solid' ? hover() : hover
66
+ }, className));
67
+ }, [hover, className]);
68
+ return (() => {
69
+ var _el$ = _tmpl$();
70
+ _el$.$$touchmove = _onTouchMove;
71
+ _el$.$$touchend = _onTouchEnd;
72
+ _el$.$$touchstart = _onTouchStart;
73
+ var _ref$ = forwardedRef;
74
+ typeof _ref$ === "function" ? use(_ref$, _el$) : forwardedRef = _el$;
75
+ spread(_el$, mergeProps({
76
+ get className() {
77
+ return memo(() => "solid" === 'solid')() ? cls() : cls;
78
+ }
79
+ }, other), false, true);
80
+ insert(_el$, () => other.children);
81
+ return _el$;
82
+ })();
83
+ }
84
+ var index = createForwardRefComponent(View);
85
+ delegateEvents(["touchstart", "touchend", "touchmove"]);
86
+
87
+ export { index as default };
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/view/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\nimport { createForwardRefComponent } from '../../utils/index'\n\nimport type { TFunc } from '@tarojs/runtime/dist/runtime.esm'\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n}\n\nfunction View ({\n className,\n hoverClass,\n forwardedRef,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as unknown as TFunc)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as unknown as TFunc)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n ref={forwardedRef}\n className={process.env.FRAMEWORK === 'solid' ? (cls as unknown as TFunc)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\n\nexport default createForwardRefComponent(View)\n"],"names":["View","_a","className","hoverClass","forwardedRef","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_el$","_tmpl$","$$touchmove","$$touchend","$$touchstart","_ref$","_$use","_$spread","_$mergeProps","_$memo","_$insert","children","createForwardRefComponent","_$delegateEvents"],"mappings":";;;;;;;AAmBA,SAASA,IAAIA,CAAEC,EAUN,EAAA;MAVM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG,GAAA;UAET;IADJC,KAAK,GATKC,MAAA,CAAAV,EAAA,EAAA,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CAUd,CADS,CAAA;AAER,EAAA,IAAIW,YAA2C,CAAA;EAC/C,IAAIC,SAAS,GAAG,CAAC,CAAA;EACjB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC,CAAA;EAClD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAU,KAAK,CAAC,CAAA;EAElD,MAAM,CAACG,GAAG,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAASK,UAAU,CAC/C,EAAE,EACF;AACE,IAAA,CAAC,CAAGlB,EAAAA,UAAU,CAAE,CAAA,GAAGmB,OAAqB,KAAK,OAAO,GAAIR,KAA0B,EAAE,GAAGA,KAAAA;GACxF,EACDZ,SAAS,CACV,CAAC,CAAA;EAEF,MAAMqB,aAAa,GAAGC,CAAC,IAAG;AACxB,IAAA,IAAIrB,UAAU,EAAE;MACde,QAAQ,CAAC,IAAI,CAAC,CAAA;AACdO,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IA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g)}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{display:block}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%}.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}
@@ -0,0 +1,13 @@
1
+ export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, Editor, FollowSwan, Form, FunctionalPageNavigator, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, LivePlayer, LivePusher, Login, Lottie, Map, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, OfficialAccount, OpenData, PageContainer, PageMeta, Picker, PickerGroup, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, ShareElement, Slider, Slot, Switch, TabItem, Tabbar, Tabs, Textarea, Video, VideoControl, VideoDanmu, VoipRoom, WebView } from '@tarojs/components/lib/react';
2
+ export { default as Button } from './components/button/index.js';
3
+ export { default as Icon } from './components/icon/index.js';
4
+ export { default as Image } from './components/image/index.js';
5
+ export { default as Input } from './components/input/index.js';
6
+ export { default as PullDownRefresh } from './components/pull-down-refresh/index.js';
7
+ export { default as ScrollView } from './components/scroll-view/index.js';
8
+ export { Swiper, SwiperItem } from './components/swiper/index.js';
9
+ export { default as Text } from './components/text/index.js';
10
+ export { default as View } from './components/view/index.js';
11
+
12
+ /* eslint-disable simple-import-sort/exports */
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { Map } from '@tarojs/components/lib/react'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { Picker, PickerGroup } from '@tarojs/components/lib/react'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '@tarojs/components/lib/react'\nexport { Tabbar, TabItem } from '@tarojs/components/lib/react'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video, VideoControl, VideoDanmu } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;AAAA"}
@@ -0,0 +1,54 @@
1
+ import { __awaiter } from 'tslib';
2
+ import Solid from 'solid-js';
3
+
4
+ const useState = (value, options) => {
5
+ const [state, setState] = Solid.createSignal(value, options);
6
+ return [state, setState];
7
+ };
8
+ const useCallback = (callback, deps) => {
9
+ const [_, setSignal] = Solid.createSignal(0); // eslint-disable-line @typescript-eslint/no-unused-vars
10
+ Solid.createEffect(() => {
11
+ deps.forEach(dep => typeof dep === 'function' ? dep() : dep);
12
+ setSignal(s => s + 1);
13
+ });
14
+ return function () {
15
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16
+ args[_key] = arguments[_key];
17
+ }
18
+ return __awaiter(void 0, void 0, void 0, function* () {
19
+ Solid.createEffect(() => {
20
+ const clean = callback(...args);
21
+ return typeof clean === 'function' && Solid.onCleanup(clean);
22
+ });
23
+ });
24
+ };
25
+ };
26
+ const useEffect = (effect, deps) => {
27
+ Solid.createEffect(() => {
28
+ const cleanup = effect();
29
+ deps.forEach(dep => dep);
30
+ return () => {
31
+ if (typeof cleanup === 'function') cleanup();
32
+ };
33
+ });
34
+ };
35
+ const useMemo = Solid.createMemo;
36
+ const useRef = init => {
37
+ const [state] = Solid.createSignal(init);
38
+ return {
39
+ current: state()
40
+ };
41
+ };
42
+ const createContext = Solid.createContext;
43
+ const useContext = Solid.useContext;
44
+ const memo = (component, _propsAreEqual) => component; // eslint-disable-line @typescript-eslint/no-unused-vars
45
+ const forwardRef = component => component;
46
+ const useImperativeHandle = (ref, createHandle, deps) => {
47
+ Solid.createEffect(() => {
48
+ deps.forEach(dep => dep);
49
+ ref.current = createHandle();
50
+ });
51
+ };
52
+
53
+ export { createContext, forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState };
54
+ //# sourceMappingURL=hooks.solid.js.map