taro-react-uilib 1.0.28 → 1.0.30

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/CHANGELOG.md ADDED
@@ -0,0 +1,348 @@
1
+ ## [1.0.30](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.29...v1.0.30) (2023-03-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * dialogref confirm bug ([7f93e55](https://code.xhdev.xyz/h5group/taro-uilib/commits/7f93e5501e45861f3e4d118f16363d2d8917aa5e))
7
+
8
+
9
+
10
+ ## [1.0.29](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.28...v1.0.29) (2023-03-13)
11
+
12
+
13
+ ### Features
14
+
15
+ * px transform ba报错 ([3137153](https://code.xhdev.xyz/h5group/taro-uilib/commits/31371538243e7601edf102bb0a7e2072c6ce082b))
16
+
17
+
18
+
19
+ ## [1.0.28](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.27...v1.0.28) (2023-03-01)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * image还原初始化 ([26d405d](https://code.xhdev.xyz/h5group/taro-uilib/commits/26d405dc20b7ce04c6aad8b7cc1626a2727a24c0))
25
+
26
+
27
+ ### Features
28
+
29
+ * dialog组件区分小程序和h5 ([b73e026](https://code.xhdev.xyz/h5group/taro-uilib/commits/b73e0269699ecb26d9a98d5d34988cdd17903fa6))
30
+ * toast mo去掉默认icon ([9473c5d](https://code.xhdev.xyz/h5group/taro-uilib/commits/9473c5dedf9ff9587164548dbd6500d5999637e1))
31
+
32
+
33
+
34
+ ## [1.0.27](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.23...v1.0.27) (2022-12-05)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * Image taro not define ([45483bf](https://code.xhdev.xyz/h5group/taro-uilib/commits/45483bf68c512b7f8a285bf42e30cc7ace574607))
40
+ * update ([3106212](https://code.xhdev.xyz/h5group/taro-uilib/commits/3106212ec8c5ce63613f802e2304e10aed5e2f12))
41
+
42
+
43
+ ### Features
44
+
45
+ * forminput width 100% ([56586d6](https://code.xhdev.xyz/h5group/taro-uilib/commits/56586d6d8d6576f0e9b25b2cbe1294c35c5fee02))
46
+ * forminput width 100% ([cb368ee](https://code.xhdev.xyz/h5group/taro-uilib/commits/cb368ee6f0445cf777ef5b4c974a64d351e82b66))
47
+ * input ref处理 ([eeb9be4](https://code.xhdev.xyz/h5group/taro-uilib/commits/eeb9be4e213ac50c6783a3d502311793027f51fd))
48
+ * input ref处理 ([e899e62](https://code.xhdev.xyz/h5group/taro-uilib/commits/e899e62658789bc1ff0d62af350801f83ae6a84d))
49
+ * input的typescript问题 ([cb06bf5](https://code.xhdev.xyz/h5group/taro-uilib/commits/cb06bf581006ac671e7c9d13884194f82bbf4b0e))
50
+
51
+
52
+
53
+ ## [1.0.23](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.22...v1.0.23) (2022-11-08)
54
+
55
+
56
+ ### Features
57
+
58
+ * toast 增加hide回调 ([bad7c55](https://code.xhdev.xyz/h5group/taro-uilib/commits/bad7c55e9ca3ab41d9af8d3a946794d9e2200aed))
59
+ * 借款组件适配 ([3970d31](https://code.xhdev.xyz/h5group/taro-uilib/commits/3970d3135c682fe75b40b6756542ac7ce46c0920))
60
+
61
+
62
+
63
+ ## [1.0.22](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.21...v1.0.22) (2022-10-28)
64
+
65
+
66
+ ### Features
67
+
68
+ * add picker popup optimize INput ([fe042b7](https://code.xhdev.xyz/h5group/taro-uilib/commits/fe042b75eeee3d2e29bde2fa3afccca26d3925ba))
69
+ * external dep ([8004e36](https://code.xhdev.xyz/h5group/taro-uilib/commits/8004e3683d90c529f5d7dbabd3c1b8282139a5f4))
70
+ * picker ([208d2ff](https://code.xhdev.xyz/h5group/taro-uilib/commits/208d2ff5059f86c9f6fba3fe51536f5738a7423a))
71
+ * picker base demo ([aa8ddba](https://code.xhdev.xyz/h5group/taro-uilib/commits/aa8ddbaf454371cbe4aa67eddaecb38fd85db8eb))
72
+ * picker开发 ([ff67009](https://code.xhdev.xyz/h5group/taro-uilib/commits/ff67009dc98e504cddb2cd8a677f63ea45118ade))
73
+ * react-transition-group不能外置 ([4854208](https://code.xhdev.xyz/h5group/taro-uilib/commits/48542088e18826043f683d472fdf8432328a63b9))
74
+ * v21 ([168a9d6](https://code.xhdev.xyz/h5group/taro-uilib/commits/168a9d630de84f0d50ed478ddcebf6e6f0775983))
75
+ * 修复button存在的内存泄露问题 ([72494d8](https://code.xhdev.xyz/h5group/taro-uilib/commits/72494d877289a443e593a868c53a9e3fb86c0938))
76
+ * 修复button存在的内存泄露问题 ([41853b4](https://code.xhdev.xyz/h5group/taro-uilib/commits/41853b49910fc4f5c99107ddc23649bab61334fc))
77
+ * 修复button存在的内存泄露问题 ([59fe743](https://code.xhdev.xyz/h5group/taro-uilib/commits/59fe743744553ae213f8c43237d67a1a68230f77))
78
+ * 修复button存在的内存泄露问题 ([3beb7a8](https://code.xhdev.xyz/h5group/taro-uilib/commits/3beb7a82cbbb248c5ca9bd9e973af68548111510))
79
+
80
+
81
+
82
+ ## [1.0.21](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.20...v1.0.21) (2022-09-01)
83
+
84
+
85
+ ### Bug Fixes
86
+
87
+ * dialog单词错误 ([1fcbca6](https://code.xhdev.xyz/h5group/taro-uilib/commits/1fcbca67f8480acdf53dc8f47508d05f5dc45e53))
88
+ * dialog单词错误 ([b97e04f](https://code.xhdev.xyz/h5group/taro-uilib/commits/b97e04f4b0f484981e3bad08d95e283707bac8d2))
89
+
90
+
91
+ ### Features
92
+
93
+ * list去掉左右边距 ([a621609](https://code.xhdev.xyz/h5group/taro-uilib/commits/a621609702da9961b670b3ba2eb4cca9df0f9c5c))
94
+
95
+
96
+
97
+ ## [1.0.20](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.19...v1.0.20) (2022-08-25)
98
+
99
+
100
+ ### Bug Fixes
101
+
102
+ * tabbar 样式问题 ([1adf38f](https://code.xhdev.xyz/h5group/taro-uilib/commits/1adf38f78fb9e6a6d60430a6e995eaae3d6a08b3))
103
+
104
+
105
+
106
+ ## [1.0.19](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.18...v1.0.19) (2022-08-25)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * list ([fc244a0](https://code.xhdev.xyz/h5group/taro-uilib/commits/fc244a073a300df999266c09a3fe62f5cc6536cd))
112
+ * 导出tabbar list修改 ([9c4262e](https://code.xhdev.xyz/h5group/taro-uilib/commits/9c4262e73a10ad8765a1b610f32938f73e382cb7))
113
+
114
+
115
+
116
+ ## [1.0.18](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.17...v1.0.18) (2022-08-24)
117
+
118
+
119
+ ### Bug Fixes
120
+
121
+ * list fix ([838bb89](https://code.xhdev.xyz/h5group/taro-uilib/commits/838bb89e1af26d3677cec88113e03ce6872f925a))
122
+
123
+
124
+
125
+ ## [1.0.17](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.16...v1.0.17) (2022-08-24)
126
+
127
+
128
+ ### Features
129
+
130
+ * css 压缩失败 ([31f7ee8](https://code.xhdev.xyz/h5group/taro-uilib/commits/31f7ee865c40193cd724ea1a836012c0970dd1df))
131
+
132
+
133
+
134
+ ## [1.0.16](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.15...v1.0.16) (2022-08-24)
135
+
136
+
137
+ ### Features
138
+
139
+ * css压缩 add tabbar components ([f9a5f91](https://code.xhdev.xyz/h5group/taro-uilib/commits/f9a5f9118a811de3f6c1a68127607d2d916f4439))
140
+ * tabbar 完善 ([abcde25](https://code.xhdev.xyz/h5group/taro-uilib/commits/abcde25d49cdf5a2089d1dd775b14ddcb1fc1376))
141
+ * tabbar 完善 ([35c1ea9](https://code.xhdev.xyz/h5group/taro-uilib/commits/35c1ea9b5a4982dea094bb441f7267a8a6564998))
142
+ * 打包优化 ([f806089](https://code.xhdev.xyz/h5group/taro-uilib/commits/f80608928dc301cbde21dac00b96a7dfe3957447))
143
+ * 添加tabbar组件 ([e797c13](https://code.xhdev.xyz/h5group/taro-uilib/commits/e797c133e248c161e429c247eef1a9c62fb7f2e1))
144
+
145
+
146
+
147
+ ## [1.0.15](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.14...v1.0.15) (2022-08-16)
148
+
149
+
150
+ ### Bug Fixes
151
+
152
+ * drop inline-block ([6fe4b5c](https://code.xhdev.xyz/h5group/taro-uilib/commits/6fe4b5c689fb9d595c6e002be35f2cd382d88475))
153
+
154
+
155
+
156
+ ## [1.0.14](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.13...v1.0.14) (2022-08-05)
157
+
158
+
159
+ ### Features
160
+
161
+ * loading change ([31ec93c](https://code.xhdev.xyz/h5group/taro-uilib/commits/31ec93c9af50294826e672a79adfb51f653ad2df))
162
+ * loading tip props partial ([a09646e](https://code.xhdev.xyz/h5group/taro-uilib/commits/a09646e1b0810393435cb1341cf264dd3169bab5))
163
+
164
+
165
+
166
+ ## [1.0.13](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.12...v1.0.13) (2022-08-05)
167
+
168
+
169
+ ### Features
170
+
171
+ * add new loading ([ff3da00](https://code.xhdev.xyz/h5group/taro-uilib/commits/ff3da00fab655e217d5a2fa1fe45dd2602bf72cb))
172
+ * loading change ([caf4c68](https://code.xhdev.xyz/h5group/taro-uilib/commits/caf4c6850465572083608445448ba09f2dbb09da))
173
+
174
+
175
+
176
+ ## [1.0.12](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.11...v1.0.12) (2022-08-03)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * 1.0.11 ([834dbc5](https://code.xhdev.xyz/h5group/taro-uilib/commits/834dbc5a74ff24c9b83f57c786fadb97fb335ebb))
182
+ * build err ([399706c](https://code.xhdev.xyz/h5group/taro-uilib/commits/399706cb705941643c28176744990edd6cdb594d))
183
+
184
+
185
+ ### Features
186
+
187
+ * 去掉noborder属性 ([26cb781](https://code.xhdev.xyz/h5group/taro-uilib/commits/26cb781807046cee1cea3ad5c92be51e92a916ba))
188
+ * 增加无边框的shape ([c076801](https://code.xhdev.xyz/h5group/taro-uilib/commits/c076801a6718ce96af356001c97139f0c286a6d8))
189
+
190
+
191
+
192
+ ## [1.0.11](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.10...v1.0.11) (2022-08-01)
193
+
194
+
195
+ ### Features
196
+
197
+ * key去掉放重复 ([724e815](https://code.xhdev.xyz/h5group/taro-uilib/commits/724e8157977544424b344cbcef753035489d9f48))
198
+
199
+
200
+
201
+ ## [1.0.10](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.9...v1.0.10) (2022-08-01)
202
+
203
+
204
+
205
+ ## [1.0.9](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.8...v1.0.9) (2022-07-29)
206
+
207
+
208
+ ### Bug Fixes
209
+
210
+ * 1.0.8 ([4c34836](https://code.xhdev.xyz/h5group/taro-uilib/commits/4c3483608127428f3a3b8f502f6c712765ecb01a))
211
+
212
+
213
+ ### Features
214
+
215
+ * css按需引入 ([5b46a1e](https://code.xhdev.xyz/h5group/taro-uilib/commits/5b46a1eecf0041ca5a41b0ba0d5ccfce4af2863a))
216
+ * css按需引入 ([c678cd5](https://code.xhdev.xyz/h5group/taro-uilib/commits/c678cd546677e459634700da8314e83bf127440c))
217
+ * css按需引入 ([9b6d21f](https://code.xhdev.xyz/h5group/taro-uilib/commits/9b6d21f15a39d8cb121d88ca687acc3cf447dc9c))
218
+ * css按需引入 ([db23dd8](https://code.xhdev.xyz/h5group/taro-uilib/commits/db23dd8fae6f21128c5077b6efe16ab5cf273c15))
219
+ * dialog组件优化、button组件加入防重复点击 ([66f65f0](https://code.xhdev.xyz/h5group/taro-uilib/commits/66f65f08330c8ed7103bb234d2964eb71b97ca0a))
220
+
221
+
222
+
223
+ ## [1.0.8](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.7...v1.0.8) (2022-07-27)
224
+
225
+
226
+ ### Bug Fixes
227
+
228
+ * dialog ref ([03a3e62](https://code.xhdev.xyz/h5group/taro-uilib/commits/03a3e62bca447fc314b66ba9e77ff57a01005e55))
229
+
230
+
231
+
232
+ ## [1.0.7](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.6...v1.0.7) (2022-07-22)
233
+
234
+
235
+ ### Bug Fixes
236
+
237
+ * 打包配置 ([6059b7c](https://code.xhdev.xyz/h5group/taro-uilib/commits/6059b7c6c56194e7675adf27725377b92609c75b))
238
+
239
+
240
+ ### Features
241
+
242
+ * 打包优化 ([c20687b](https://code.xhdev.xyz/h5group/taro-uilib/commits/c20687ba33c3a68831a952d8f79f78d7be52ed7a))
243
+
244
+
245
+
246
+ ## [1.0.6](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.5...v1.0.6) (2022-07-12)
247
+
248
+
249
+ ### Bug Fixes
250
+
251
+ * forminput ([aba4750](https://code.xhdev.xyz/h5group/taro-uilib/commits/aba475011ecf0646696b73c79ee2efd5b75a7349))
252
+
253
+
254
+
255
+ ## [1.0.5](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.4...v1.0.5) (2022-07-12)
256
+
257
+
258
+ ### Bug Fixes
259
+
260
+ * forminput ([d262760](https://code.xhdev.xyz/h5group/taro-uilib/commits/d262760fc6f03f508d78a0c4d5308e3140bb8bbe))
261
+
262
+
263
+
264
+ ## [1.0.4](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.3...v1.0.4) (2022-07-12)
265
+
266
+
267
+ ### Features
268
+
269
+ * update formInput ([c10afec](https://code.xhdev.xyz/h5group/taro-uilib/commits/c10afecce3617c10569066b6cd30ed6794d2d9fc))
270
+
271
+
272
+
273
+ ## [1.0.3](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.2...v1.0.3) (2022-07-04)
274
+
275
+
276
+ ### Bug Fixes
277
+
278
+ * add dialog ([d409059](https://code.xhdev.xyz/h5group/taro-uilib/commits/d4090595b0fe7196c6a55ca823fd69693eca2834))
279
+ * add Toast PasswordInput Progress ([5e8f3b3](https://code.xhdev.xyz/h5group/taro-uilib/commits/5e8f3b3b1216dd5a55ac4e19b603c83dd9bb001e))
280
+ * component ([7521f48](https://code.xhdev.xyz/h5group/taro-uilib/commits/7521f482ac823887bb5f7c56c6bcd2cfc4e6ae69))
281
+ * toast ([bbc092a](https://code.xhdev.xyz/h5group/taro-uilib/commits/bbc092aa17d4862bd0c56d3557b4d5e03c2d6c5e))
282
+ * Toast开发 ([4b1caa3](https://code.xhdev.xyz/h5group/taro-uilib/commits/4b1caa35371555e9fad9d4d784ae14390e8313c6))
283
+
284
+
285
+ ### Features
286
+
287
+ * alert dialog组件 ([d0316ae](https://code.xhdev.xyz/h5group/taro-uilib/commits/d0316ae640b88602d5a8812464ad67a823de6f6f))
288
+ * image组件封装 ([25385a2](https://code.xhdev.xyz/h5group/taro-uilib/commits/25385a22eee6ddfe003e57bdadb628085f406222))
289
+
290
+
291
+
292
+ ## [1.0.2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.1...v1.0.2) (2022-06-09)
293
+
294
+
295
+ ### Features
296
+
297
+ * drop changelog ([37ea76f](https://code.xhdev.xyz/h5group/taro-uilib/commits/37ea76fd657dcde42e51a53866e8ac1e7391956f))
298
+
299
+
300
+
301
+ ## [1.0.1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.0.0...v1.0.1) (2022-06-08)
302
+
303
+
304
+ ### Features
305
+
306
+ * add dialog ([60df611](https://code.xhdev.xyz/h5group/taro-uilib/commits/60df6110b4ee02f8d548f3940886695596268bac))
307
+ * add eslint & prettier ([c1c243b](https://code.xhdev.xyz/h5group/taro-uilib/commits/c1c243b32618a8173c5d00718373c8f7c4b3cbb5))
308
+ * add eslint & prettier ([10101d3](https://code.xhdev.xyz/h5group/taro-uilib/commits/10101d347396744ae32a9344a0271e554de1833b))
309
+ * add eslint & prettier ([cd92053](https://code.xhdev.xyz/h5group/taro-uilib/commits/cd92053003f63fb446e72ebde8f3c9552db168bb))
310
+ * build ([d1dcb04](https://code.xhdev.xyz/h5group/taro-uilib/commits/d1dcb042c2ff9d7da42517c86c32d95705948009))
311
+ * build ([c04a785](https://code.xhdev.xyz/h5group/taro-uilib/commits/c04a78554d1c36d8b2abb7177c21e87b8deacc41))
312
+ * build ([8064554](https://code.xhdev.xyz/h5group/taro-uilib/commits/806455404b3b03dda419e9aa5ce4acb2e67d2b90))
313
+ * build ([fd167a2](https://code.xhdev.xyz/h5group/taro-uilib/commits/fd167a21370a9b5b57d83e3f5892fe5f335dd3f1))
314
+ * build ([2ac5df8](https://code.xhdev.xyz/h5group/taro-uilib/commits/2ac5df8bfcbd032cac9e6de09e8c003d5ed190d7))
315
+ * button组件完善 ([d661228](https://code.xhdev.xyz/h5group/taro-uilib/commits/d661228fb8e840a182ae94f71636b8359f785cfd))
316
+ * change log ([8e254fd](https://code.xhdev.xyz/h5group/taro-uilib/commits/8e254fdc3acd62d8021fa96339564698228f022d))
317
+ * eslint ([b84a1d6](https://code.xhdev.xyz/h5group/taro-uilib/commits/b84a1d683f0860ef9422f3a704287730cfab863a))
318
+ * eslint ([70f7a48](https://code.xhdev.xyz/h5group/taro-uilib/commits/70f7a48feacb2fb1ccf75218e53ff56815d78e08))
319
+ * husky ([113e8b6](https://code.xhdev.xyz/h5group/taro-uilib/commits/113e8b65570aaeb4678a71e26ef3238dcdcca858))
320
+ * postinstall ([a163622](https://code.xhdev.xyz/h5group/taro-uilib/commits/a1636226a67b4fb573b402b5949f1069eb8788dd))
321
+ * postinstall ([207ce77](https://code.xhdev.xyz/h5group/taro-uilib/commits/207ce77a5d1960fc0046e1f59ceb6a39a6e8af86))
322
+ * 字节小程序 ([fa4bfc4](https://code.xhdev.xyz/h5group/taro-uilib/commits/fa4bfc433a36ed3792a8ef81e5471c6d3b8ce50f))
323
+ * 按钮修复 ([db92448](https://code.xhdev.xyz/h5group/taro-uilib/commits/db92448ad25dba087d93388a1c0746adf4d27bfb))
324
+
325
+
326
+
327
+ # [1.0.0](https://code.xhdev.xyz/h5group/taro-uilib/compare/fbd70f2875752c10785d311448c4940745b3c690...v1.0.0) (2022-05-13)
328
+
329
+
330
+ ### Bug Fixes
331
+
332
+ * 增加FormInput、Image组件 ([3ab6739](https://code.xhdev.xyz/h5group/taro-uilib/commits/3ab67394e77296f9c4341b696df76b1cae3fbc36))
333
+
334
+
335
+ ### Features
336
+
337
+ * arrow ([d8650da](https://code.xhdev.xyz/h5group/taro-uilib/commits/d8650da836008125dad49d7207125a38c496bd16))
338
+ * base ([4cbef15](https://code.xhdev.xyz/h5group/taro-uilib/commits/4cbef154e95df14e8992092db48aafc4e0461be5))
339
+ * d.ts ([3b663f3](https://code.xhdev.xyz/h5group/taro-uilib/commits/3b663f3a689633ba013635e57baffc9b02631029))
340
+ * init ([fbd70f2](https://code.xhdev.xyz/h5group/taro-uilib/commits/fbd70f2875752c10785d311448c4940745b3c690))
341
+ * version ([9aa311f](https://code.xhdev.xyz/h5group/taro-uilib/commits/9aa311ff857d46feadf28200bd90fb15933e22fd))
342
+ * version update ([829a1f4](https://code.xhdev.xyz/h5group/taro-uilib/commits/829a1f4485116d8a7c03a1b435b80be6f68042ff))
343
+ * 增加list组件 ([41379ab](https://code.xhdev.xyz/h5group/taro-uilib/commits/41379abdcbdaec4ab050aa70ac0cab7cc883b2b5))
344
+ * 新增bankicon组件 ([6ea6263](https://code.xhdev.xyz/h5group/taro-uilib/commits/6ea62637a7c7162ac71747d939425c1ca7223be7))
345
+ * 组件开发 ([64423a8](https://code.xhdev.xyz/h5group/taro-uilib/commits/64423a82fc2991dd84029cfab1f62a69a9acbb8a))
346
+
347
+
348
+
@@ -1,2 +1,2 @@
1
- import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o,useState as n,useImperativeHandle as r,useEffect as a,useMemo as c}from"react";import s from"classnames";import{View as l}from"@tarojs/components";import i from"../Button/index.js";import m from"../Mask/index.js";import f from"../node_modules/react-transition-group/esm/CSSTransition.js";var p=o((function(o,p){var d=o.header,u=o.content,h=o.className,v=void 0===h?"":h,g=o.visible,x=o.showCancel,E=void 0===x||x,N=o.confirmText,C=void 0===N?"确定":N,T=o.cancelText,b=void 0===T?"取消":T,j=o.footer,k=void 0!==j&&j,y=o.onConfirm,_=o.onCancel,A=o.onClose,w=e(n(!1),2),O=w[0],R=w[1];r(p,(function(){return{close:S,open:V}}));var S=function(){A&&A(),R(!1)},V=function(){R(!0)},B=function(){y&&y()},M=function(){_&&_(),S()};a((function(){g||A&&A(),R(g)}),[g]);var q=s("xh-dialog-ref",v,{show:O}),z=s("xh-dialog-ref-content-footer-buttons",{microApp:"h5"!==process.env.TARO_ENV}),D=t.createElement(l,{className:z},E&&t.createElement(i,{type:"ghost",shape:"rectangle",preventTime:0,onClick:M,className:"xh-dialog-ref-content-footer-buttons-microapp-cancel"},b),t.createElement(i,{type:"ghost",shape:"rectangle",className:"xh-dialog-ref-content-footer-buttons-microapp-confirm",onClick:B,preventTime:0},C)),F=t.createElement(l,{className:z},E&&t.createElement(i,{preventTime:0,onClick:M,className:"xh-dialog-ref-content-footer-buttons-h5-cancel"},b),t.createElement(i,{type:"primary",className:"xh-dialog-ref-content-footer-buttons-h5-confirm",onClick:B,preventTime:0},C)),G=c((function(){return"h5"===process.env.TARO_ENV?F:D}),[]);return t.createElement(l,{className:q},t.createElement(m,null),t.createElement(f,{in:O,timeout:200,classNames:"scale"},t.createElement(l,{className:"xh-dialog-ref-content"},t.createElement(l,{className:"xh-dialog-ref-content-header"},d),t.createElement(l,{className:"xh-dialog-ref-content-content"},u),k||t.createElement(l,{className:"xh-dialog-ref-content-footer"},G))))}));export{p as default};
1
+ import{__read as e}from"../node_modules/tslib/tslib.es6.js";import o,{forwardRef as t,useState as n,useImperativeHandle as r,useEffect as a}from"react";import c from"classnames";import{View as s}from"@tarojs/components";import i from"../Button/index.js";import m from"../Mask/index.js";import l from"../node_modules/react-transition-group/esm/CSSTransition.js";var f=t((function(t,f){var d=t.header,p=t.content,u=t.className,h=void 0===u?"":u,v=t.visible,x=t.showCancel,E=void 0===x||x,N=t.confirmText,g=void 0===N?"确定":N,b=t.cancelText,T=void 0===b?"取消":b,C=t.footer,j=void 0!==C&&C,_=t.onConfirm,A=t.onCancel,k=t.onClose,O=e(n(!1),2),R=O[0],V=O[1];r(f,(function(){return{close:w,open:y}}));var w=function(){k&&k(),V(!1)},y=function(){V(!0)};a((function(){v||k&&k(),V(v)}),[v]);var S=c("xh-dialog-ref",h,{show:R}),B=c("xh-dialog-ref-content-footer-buttons",{microApp:"h5"!==process.env.TARO_ENV}),M=o.createElement(s,{className:B},E&&o.createElement(i,{preventTime:0,onClick:function(){A&&A(),w()},className:"h5"!==process.env.TARO_ENV?"xh-dialog-ref-content-footer-buttons-microapp-cancel":"xh-dialog-ref-content-footer-buttons-h5-cancel"},T),o.createElement(i,{type:"primary",className:"h5"!==process.env.TARO_ENV?"xh-dialog-ref-content-footer-buttons-microapp-confirm":"xh-dialog-ref-content-footer-buttons-h5-confirm",onClick:function(){_&&_()},preventTime:0},g));return o.createElement(s,{className:S},o.createElement(m,null),o.createElement(l,{in:R,timeout:200,classNames:"scale"},o.createElement(s,{className:"xh-dialog-ref-content"},o.createElement(s,{className:"xh-dialog-ref-content-header"},d),o.createElement(s,{className:"xh-dialog-ref-content-content"},p),j||o.createElement(s,{className:"xh-dialog-ref-content-footer"},M))))}));export{f as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/DialogRef/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n useMemo,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Mask from \"../Mask\";\nimport \"./index.scss\";\n\nexport type DialogProps = {\n header?: string | ReactNode;\n content: string | ReactNode;\n footer?: ReactNode;\n cancelText?: string;\n confirmText?: string;\n showCancel?: boolean;\n visible: boolean;\n onConfirm?: () => void;\n onCancel?: () => void;\n onClose?: () => void;\n} & XHComponentCommonProps;\n\nexport type IDialogRef = {\n close: () => void;\n open: () => void;\n};\nconst DialogCom = forwardRef<IDialogRef, DialogProps>((props, fromRef) => {\n const {\n header,\n content,\n className = \"\",\n visible,\n showCancel = true,\n confirmText = \"确定\",\n cancelText = \"取消\",\n footer = false,\n onConfirm,\n onCancel,\n onClose,\n } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close,\n open,\n }));\n\n const close = () => {\n onClose && onClose();\n setSelfVisible(false);\n };\n\n const open = () => {\n setSelfVisible(true);\n };\n\n const handleConfirm = () => {\n onConfirm && onConfirm();\n // close();\n };\n const handleCancel = () => {\n onCancel && onCancel();\n close();\n };\n\n useEffect(() => {\n if (!visible) {\n onClose && onClose();\n }\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog-ref\", className, {\n show: selfVisible,\n });\n const footercls = classNames(\"xh-dialog-ref-content-footer-buttons\", {\n microApp: process.env.TARO_ENV !== \"h5\",\n });\n const dialogFooterMicroApp = (\n <View className={footercls}>\n {showCancel && (\n <Button\n type=\"ghost\"\n shape=\"rectangle\"\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-buttons-microapp-cancel\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"ghost\"\n shape=\"rectangle\"\n className=\"xh-dialog-ref-content-footer-buttons-microapp-confirm\"\n onClick={handleConfirm}\n preventTime={0}\n >\n {confirmText}\n </Button>\n </View>\n );\n\n const dialogFooterH5 = (\n <View className={footercls}>\n {showCancel && (\n <Button\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-buttons-h5-cancel\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"primary\"\n className=\"xh-dialog-ref-content-footer-buttons-h5-confirm\"\n onClick={handleConfirm}\n preventTime={0}\n >\n {confirmText}\n </Button>\n </View>\n );\n\n const footerRender = useMemo(() => {\n if (process.env.TARO_ENV === \"h5\") {\n return dialogFooterH5;\n }\n return dialogFooterMicroApp;\n }, []);\n\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition in={selfVisible} timeout={200} classNames=\"scale\">\n <View className=\"xh-dialog-ref-content\">\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\n <View className=\"xh-dialog-ref-content-content\">{content}</View>\n {footer || (\n <View className=\"xh-dialog-ref-content-footer\">{footerRender}</View>\n )}\n </View>\n </CSSTransition>\n </View>\n );\n return DialogMain;\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","_a","className","visible","_b","showCancel","_c","confirmText","_d","cancelText","_e","footer","onConfirm","onCancel","onClose","_f","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","handleConfirm","handleCancel","useEffect","dialogcls","classNames","show","footercls","microApp","process","env","TARO_ENV","dialogFooterMicroApp","React","createElement","View","Button","type","shape","preventTime","onClick","dialogFooterH5","footerRender","useMemo","Mask","CSSTransition","in","timeout"],"mappings":"sXAiCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAWEF,EAAKE,OAVPC,EAUEH,EAAKG,QATPC,EASEJ,EATYK,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAQEN,EARKM,QACPC,EAOEP,EAAKQ,WAPPA,cAAiBD,EACjBE,EAMET,EANgBU,YAAlBA,OAAW,IAAAD,EAAG,KAAIA,EAClBE,EAKEX,EALeY,WAAjBA,OAAU,IAAAD,EAAG,KAAIA,EACjBE,EAIEb,SAJFc,OAAS,IAAAD,KACTE,EAGEf,YAFFgB,EAEEhB,WADFiB,EACEjB,UACEkB,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBtB,GAAS,WAAM,MAAC,CAClCuB,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZP,GAAWA,IACXK,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAEMI,EAAgB,WACpBX,GAAaA,GAEf,EACMY,EAAe,WACnBX,GAAYA,IACZQ,GACF,EAEAI,GAAU,WACHtB,GACHW,GAAWA,IAEbK,EAAehB,EACjB,GAAG,CAACA,IAEJ,IAAMuB,EAAYC,EAAW,gBAAiBzB,EAAW,CACvD0B,KAAMV,IAEFW,EAAYF,EAAW,uCAAwC,CACnEG,SAAmC,OAAzBC,QAAQC,IAAIC,WAElBC,EACJC,EAAAC,cAACC,EAAK,CAAAnC,UAAW2B,GACdxB,GACC8B,EAAAC,cAACE,EAAM,CACLC,KAAK,QACLC,MAAM,YACNC,YAAa,EACbC,QAASlB,EACTtB,UAAU,wDAETO,GAGL0B,EAACC,cAAAE,EACC,CAAAC,KAAK,QACLC,MAAM,YACNtC,UAAU,wDACVwC,QAASnB,EACTkB,YAAa,GAEZlC,IAKDoC,EACJR,EAAAC,cAACC,EAAK,CAAAnC,UAAW2B,GACdxB,GACC8B,EAAAC,cAACE,EACC,CAAAG,YAAa,EACbC,QAASlB,EACTtB,UAAU,kDAETO,GAGL0B,EAACC,cAAAE,GACCC,KAAK,UACLrC,UAAU,kDACVwC,QAASnB,EACTkB,YAAa,GAEZlC,IAKDqC,EAAeC,GAAQ,WAC3B,MAA6B,OAAzBd,QAAQC,IAAIC,SACPU,EAEFT,CACR,GAAE,IAgBH,OAbEC,EAAAC,cAACC,EAAK,CAAAnC,UAAWwB,GACfS,EAAAC,cAACU,EAAO,MACRX,EAAAC,cAACW,EAAa,CAACC,GAAI9B,EAAa+B,QAAS,IAAKtB,WAAW,SACvDQ,EAAAC,cAACC,EAAI,CAACnC,UAAU,yBACdiC,EAAAC,cAACC,EAAK,CAAAnC,UAAU,gCAAgCH,GAChDoC,EAAAC,cAACC,EAAK,CAAAnC,UAAU,iCAAiCF,GAChDW,GACCwB,EAAAC,cAACC,EAAI,CAACnC,UAAU,gCAAgC0C,KAO5D"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/DialogRef/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport Button from \"../Button\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport Mask from \"../Mask\";\nimport \"./index.scss\";\n\nexport type DialogProps = {\n header?: string | ReactNode;\n content: string | ReactNode;\n footer?: ReactNode;\n cancelText?: string;\n confirmText?: string;\n showCancel?: boolean;\n visible: boolean;\n onConfirm?: () => void;\n onCancel?: () => void;\n onClose?: () => void;\n} & XHComponentCommonProps;\n\nexport type IDialogRef = {\n close: () => void;\n open: () => void;\n};\nconst DialogCom = forwardRef<IDialogRef, DialogProps>((props, fromRef) => {\n const {\n header,\n content,\n className = \"\",\n visible,\n showCancel = true,\n confirmText = \"确定\",\n cancelText = \"取消\",\n footer = false,\n onConfirm,\n onCancel,\n onClose,\n } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close,\n open,\n }));\n\n const close = () => {\n onClose && onClose();\n setSelfVisible(false);\n };\n\n const open = () => {\n setSelfVisible(true);\n };\n\n const handleConfirm = () => {\n onConfirm && onConfirm();\n // close();\n };\n const handleCancel = () => {\n onCancel && onCancel();\n close();\n };\n\n useEffect(() => {\n if (!visible) {\n onClose && onClose();\n }\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog-ref\", className, {\n show: selfVisible,\n });\n const footercls = classNames(\"xh-dialog-ref-content-footer-buttons\", {\n microApp: process.env.TARO_ENV !== \"h5\",\n });\n\n const dialogFooter = (\n <View className={footercls}>\n {showCancel && (\n <Button\n preventTime={0}\n onClick={handleCancel}\n className={\n process.env.TARO_ENV !== \"h5\"\n ? \"xh-dialog-ref-content-footer-buttons-microapp-cancel\"\n : \"xh-dialog-ref-content-footer-buttons-h5-cancel\"\n }\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"primary\"\n className={\n process.env.TARO_ENV !== \"h5\"\n ? \"xh-dialog-ref-content-footer-buttons-microapp-confirm\"\n : \"xh-dialog-ref-content-footer-buttons-h5-confirm\"\n }\n onClick={handleConfirm}\n preventTime={0}\n >\n {confirmText}\n </Button>\n </View>\n );\n\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition in={selfVisible} timeout={200} classNames=\"scale\">\n <View className=\"xh-dialog-ref-content\">\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\n <View className=\"xh-dialog-ref-content-content\">{content}</View>\n {footer || (\n <View className=\"xh-dialog-ref-content-footer\">{dialogFooter}</View>\n )}\n </View>\n </CSSTransition>\n </View>\n );\n return DialogMain;\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","_a","className","visible","_b","showCancel","_c","confirmText","_d","cancelText","_e","footer","onConfirm","onCancel","onClose","_f","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","useEffect","dialogcls","classNames","show","footercls","microApp","process","env","TARO_ENV","dialogFooter","React","createElement","View","Button","preventTime","onClick","type","Mask","CSSTransition","in","timeout"],"mappings":"yWAgCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAWEF,EAAKE,OAVPC,EAUEH,EAAKG,QATPC,EASEJ,EATYK,UAAdA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAQEN,EARKM,QACPC,EAOEP,EAAKQ,WAPPA,cAAiBD,EACjBE,EAMET,EANgBU,YAAlBA,OAAW,IAAAD,EAAG,KAAIA,EAClBE,EAKEX,EALeY,WAAjBA,OAAU,IAAAD,EAAG,KAAIA,EACjBE,EAIEb,SAJFc,OAAS,IAAAD,KACTE,EAGEf,YAFFgB,EAEEhB,WADFiB,EACEjB,UACEkB,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBtB,GAAS,WAAM,MAAC,CAClCuB,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZP,GAAWA,IACXK,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAWAI,GAAU,WACHpB,GACHW,GAAWA,IAEbK,EAAehB,EACjB,GAAG,CAACA,IAEJ,IAAMqB,EAAYC,EAAW,gBAAiBvB,EAAW,CACvDwB,KAAMR,IAEFS,EAAYF,EAAW,uCAAwC,CACnEG,SAAmC,OAAzBC,QAAQC,IAAIC,WAGlBC,EACJC,EAAAC,cAACC,EAAK,CAAAjC,UAAWyB,GACdtB,GACC4B,EAACC,cAAAE,GACCC,YAAa,EACbC,QAxBa,WACnBzB,GAAYA,IACZQ,GACF,EAsBQnB,UAC2B,OAAzB2B,QAAQC,IAAIC,SACR,uDACA,kDAGLtB,GAGLwB,EAAAC,cAACE,EAAM,CACLG,KAAK,UACLrC,UAC2B,OAAzB2B,QAAQC,IAAIC,SACR,wDACA,kDAENO,QA7CgB,WACpB1B,GAAaA,GAEf,EA2CMyB,YAAa,GAEZ9B,IAmBP,OAbE0B,EAAAC,cAACC,EAAK,CAAAjC,UAAWsB,GACfS,EAAAC,cAACM,EAAO,MACRP,EAAAC,cAACO,EAAa,CAACC,GAAIxB,EAAayB,QAAS,IAAKlB,WAAW,SACvDQ,EAAAC,cAACC,EAAI,CAACjC,UAAU,yBACd+B,EAAAC,cAACC,EAAK,CAAAjC,UAAU,gCAAgCH,GAChDkC,EAAAC,cAACC,EAAK,CAAAjC,UAAU,iCAAiCF,GAChDW,GACCsB,EAAAC,cAACC,EAAI,CAACjC,UAAU,gCAAgC8B,KAO5D"}
@@ -1,2 +1,2 @@
1
- import{__read as t}from"../node_modules/tslib/tslib.es6.js";import e,{useState as r,useEffect as s,useMemo as o}from"react";import{Image as c}from"@tarojs/components";import{getImageInfo as a,pxTransform as i}from"@tarojs/taro";var n=function(n){var m=n.width,h=void 0===m?"":m,l=n.height,f=void 0===l?"":l,d=n.src,u=n.className,g=t(r({}),2),p=g[0],v=g[1];s((function(){"h5"===process.env.TARO_ENV||u||a({src:d,success:function(t){"getImageInfo:ok"===t.errMsg&&v({width:t.width,height:t.height})}})}),[]);var N=o((function(){var t=p||{};return h&&(t.width="".concat(i(h))),f&&(t.height="".concat(i(f))),t}),[h,f,p]);return"h5"!==process.env.TARO_ENV?e.createElement(c,{src:d,style:N,className:u}):e.createElement("img",{src:d,alt:"",style:N,className:u})};export{n as default};
1
+ import{__rest as t,__read as e,__assign as r}from"../node_modules/tslib/tslib.es6.js";import s,{useState as o,useEffect as c,useMemo as i}from"react";import{Image as a}from"@tarojs/components";import{getImageInfo as n}from"@tarojs/taro";import{pxTransform as m}from"../src/utils/index.js";var h=function(h){var l=h.width,d=void 0===l?0:l,f=h.height,u=void 0===f?0:f,g=h.src,p=h.className,v=t(h,["width","height","src","className"]),N=e(o({}),2),w=N[0],j=N[1];c((function(){"h5"===process.env.TARO_ENV||p||n({src:g,success:function(t){"getImageInfo:ok"===t.errMsg&&j({width:t.width,height:t.height})}})}),[]);var E=i((function(){var t=w||{};return d&&(t.width="".concat(m(d))),u&&(t.height="".concat(m(u))),t}),[d,u,w]);return"h5"!==process.env.TARO_ENV?s.createElement(a,{src:g,style:E,className:p}):s.createElement("img",r({src:g,style:E,className:p},v))};export{h as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Image/index.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useState } from \"react\";\nimport { Image } from \"@tarojs/components\";\nimport { getImageInfo, pxTransform } from \"@tarojs/taro\";\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nexport type ImageProps = {\n width?: number;\n height?: number;\n src: string;\n} & XHComponentCommonProps;\n\nconst XHImage: FC<ImageProps> = props => {\n const { width = \"\", height = \"\", src, className } = props;\n const [defaultSize, setDefaultSize] = useState<{\n width?: number | string;\n height?: number | string;\n } | null>({});\n\n useEffect(() => {\n if (process.env.TARO_ENV !== \"h5\" && !className) {\n getImageInfo({\n src,\n success: res => {\n if (res.errMsg === \"getImageInfo:ok\") {\n console.log(res);\n setDefaultSize({ width: res.width, height: res.height });\n }\n },\n });\n } else {\n }\n }, []);\n\n const size = useMemo(() => {\n let computedSize = defaultSize || {};\n if (width) {\n (computedSize as any).width = `${pxTransform(width)}`;\n }\n if (height) {\n (computedSize as any).height = `${pxTransform(height)}`;\n }\n console.log(\"size\");\n\n return computedSize;\n }, [width, height, defaultSize]);\n\n return process.env.TARO_ENV !== \"h5\" ? (\n <Image src={src} style={size} className={className} />\n ) : (\n <img src={src} alt=\"\" style={size} className={className} />\n );\n};\n\nexport default XHImage;\n"],"names":["XHImage","props","_a","width","_b","height","src","className","_c","__read","useState","defaultSize","setDefaultSize","useEffect","process","env","TARO_ENV","getImageInfo","success","res","errMsg","size","useMemo","computedSize","concat","pxTransform","React","Image","style","createElement","alt"],"mappings":"oOAYM,IAAAA,EAA0B,SAAAC,GACtB,IAAAC,EAA4CD,EAAKE,MAAjDA,OAAQ,IAAAD,EAAA,GAAEA,EAAEE,EAAgCH,EAArBI,OAAXA,OAAM,IAAAD,EAAG,GAAEA,EAAEE,EAAmBL,EAAhBK,IAAEC,EAAcN,EAAKM,UACnDC,EAAAC,EAAgCC,EAG5B,CAAE,GAAC,GAHNC,EAAWH,EAAA,GAAEI,OAKpBC,GAAU,WACqB,OAAzBC,QAAQC,IAAIC,UAAsBT,GACpCU,EAAa,CACXX,IAAGA,EACHY,QAAS,SAAAC,GACY,oBAAfA,EAAIC,QAENR,EAAe,CAAET,MAAOgB,EAAIhB,MAAOE,OAAQc,EAAId,QAElD,GAIN,GAAE,IAEH,IAAMgB,EAAOC,GAAQ,WACnB,IAAIC,EAAeZ,GAAe,GASlC,OARIR,IACDoB,EAAqBpB,MAAQ,GAAAqB,OAAGC,EAAYtB,KAE3CE,IACDkB,EAAqBlB,OAAS,GAAAmB,OAAGC,EAAYpB,KAIzCkB,CACR,GAAE,CAACpB,EAAOE,EAAQM,IAEnB,MAAgC,OAAzBG,QAAQC,IAAIC,SACjBU,gBAACC,EAAK,CAACrB,IAAKA,EAAKsB,MAAOP,EAAMd,UAAWA,IAEzCmB,EAAKG,cAAA,MAAA,CAAAvB,IAAKA,EAAKwB,IAAI,GAAGF,MAAOP,EAAMd,UAAWA,GAElD"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Image/index.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useState } from \"react\";\nimport { Image } from \"@tarojs/components\";\nimport { getImageInfo } from \"@tarojs/taro\";\nimport { pxTransform } from \"../../utils/index\";\n\nimport \"./index.scss\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nexport type ImageProps = {\n width?: number;\n height?: number;\n src: string;\n alt?: string;\n} & XHComponentCommonProps;\n\nconst XHImage: FC<ImageProps> = props => {\n const { width = 0, height = 0, src, className, ...rest } = props;\n const [defaultSize, setDefaultSize] = useState<{\n width?: number;\n height?: number;\n }>({});\n\n useEffect(() => {\n if (process.env.TARO_ENV !== \"h5\" && !className) {\n getImageInfo({\n src,\n success: res => {\n if (res.errMsg === \"getImageInfo:ok\") {\n console.log(res);\n setDefaultSize({ width: res.width, height: res.height });\n }\n },\n });\n }\n }, []);\n\n const size = useMemo(() => {\n let computedSize: { width?: string | number; height?: string | number } =\n defaultSize || {};\n if (width) {\n computedSize.width = `${pxTransform(width)}`;\n }\n if (height) {\n computedSize.height = `${pxTransform(height)}`;\n }\n\n return computedSize;\n }, [width, height, defaultSize]);\n\n return process.env.TARO_ENV !== \"h5\" ? (\n <Image src={src} style={size} className={className} />\n ) : (\n <img src={src} style={size} className={className} {...rest} />\n );\n};\n\nexport default XHImage;\n"],"names":["XHImage","props","_a","width","_b","height","src","className","rest","__rest","_c","__read","useState","defaultSize","setDefaultSize","useEffect","process","env","TARO_ENV","getImageInfo","success","res","errMsg","size","useMemo","computedSize","concat","pxTransform","React","createElement","Image","style","__assign"],"mappings":"iSAeM,IAAAA,EAA0B,SAAAC,GACtB,IAAAC,EAAmDD,EAA1CE,MAATA,OAAQ,IAAAD,EAAA,EAACA,EAAEE,EAAwCH,EAAKI,OAA7CA,aAAS,EAACD,EAAEE,EAA4BL,EAAzBK,IAAEC,EAAuBN,EAAdM,UAAKC,EAASC,EAAAR,EAArD,CAAA,QAAA,SAAA,MAAA,cACAS,EAAAC,EAAgCC,EAGnC,CAAE,GAAC,GAHCC,EAAWH,EAAA,GAAEI,OAKpBC,GAAU,WACqB,OAAzBC,QAAQC,IAAIC,UAAsBX,GACpCY,EAAa,CACXb,IAAGA,EACHc,QAAS,SAAAC,GACY,oBAAfA,EAAIC,QAENR,EAAe,CAAEX,MAAOkB,EAAIlB,MAAOE,OAAQgB,EAAIhB,QAElD,GAGN,GAAE,IAEH,IAAMkB,EAAOC,GAAQ,WACnB,IAAIC,EACFZ,GAAe,GAQjB,OAPIV,IACFsB,EAAatB,MAAQ,GAAAuB,OAAGC,EAAYxB,KAElCE,IACFoB,EAAapB,OAAS,GAAAqB,OAAGC,EAAYtB,KAGhCoB,CACR,GAAE,CAACtB,EAAOE,EAAQQ,IAEnB,MAAgC,OAAzBG,QAAQC,IAAIC,SACjBU,EAACC,cAAAC,GAAMxB,IAAKA,EAAKyB,MAAOR,EAAMhB,UAAWA,IAEzCqB,EAAAC,cAAA,MAAAG,EAAA,CAAK1B,IAAKA,EAAKyB,MAAOR,EAAMhB,UAAWA,GAAeC,GAE1D"}
@@ -1,2 +1,2 @@
1
- var u=function(u){return u.replace(/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,"")};export{u as inputRange};
1
+ var u=function(u){return u.replace(/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,"")};function D(u,D){if(void 0===D&&(D=750),!u)return"";return"h5"===process.env.TARO_ENV?Math.ceil(parseInt("".concat(u),10)/40*640/D*1e4)/1e4+"rem":"".concat(u/{640:1.17,750:1,828:.905}[D],"rpx")}export{u as inputRange,D as pxTransform};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/index.ts"],"sourcesContent":["/**\n * 禁止输入emoji表情\n * @param {string} val - 输入内容\n * @returns {boolean} - 校验结果 返回 true || false\n */\nexport const inputRange = (val: string): string => {\n let iconRule1 =\n /[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF][\\u200D|\\uFE0F]|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF]|[0-9|*|#]\\uFE0F\\u20E3|[0-9|#]\\u20E3|[\\u203C-\\u3299]\\uFE0F\\u200D|[\\u203C-\\u3299]\\uFE0F|[\\u2122-\\u2B55]|\\u303D|[\\A9|\\AE]\\u3030|\\uA9|\\uAE|\\u3030/gi;\n return val.replace(iconRule1, \"\");\n};\n\n// function Handler(fn) {\n// this.handler = fn;\n// this.next = null;\n// }\n\n// Handler.prototype.setNext = function setNext(h) {\n// this.next = h;\n// return h;\n// };\n\n// Handler.prototype.passRequest = function () {\n// const ret = this.handler.apply(this, arguments);\n// // 提前结束\n// if (!ret) {\n// return ret;\n// }\n\n// // 向后传递\n// if (this.next) {\n// return this.next.passRequest.apply(this.next, arguments);\n// }\n// return ret;\n// };\n\n// export class ChainHander {\n// public hander: (s: string) => boolean\n// public next\n// constructor(fn: (str: string) => boolean) {\n// this.hander = fn\n// }\n// public setNext(callback): () => boolean {\n// this.next = callback\n// return callback\n// }\n// public checkPass(...arg) {\n// const result = this.hander.apply(this, arg)\n// if (!result) {\n// return result\n// }\n\n// if (this.next != null) {\n// return this.next.checkPass.apply(this.next, arg)\n// }\n\n// return result\n// }\n// }\n\nexport const throtte = (fn: Function, delay: number = 1500) => {\n let timer: NodeJS.Timer;\n let canCall = true;\n return function (arg) {\n if (canCall) {\n canCall = false;\n console.log(arg);\n console.log(\"arg\");\n fn(arg);\n }\n timer = setTimeout(() => {\n canCall = true;\n clearTimeout(timer);\n }, delay);\n };\n};\n"],"names":["inputRange","val","replace"],"mappings":"AAKO,IAAMA,EAAa,SAACC,GAGzB,OAAOA,EAAIC,QADT,6OAC4B,GAChC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/utils/index.ts"],"sourcesContent":["/**\n * 禁止输入emoji表情\n * @param {string} val - 输入内容\n * @returns {boolean} - 校验结果 返回 true || false\n */\nexport const inputRange = (val: string): string => {\n let iconRule1 =\n /[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF][\\u200D|\\uFE0F]|[\\uD83C|\\uD83D|\\uD83E][\\uDC00-\\uDFFF]|[0-9|*|#]\\uFE0F\\u20E3|[0-9|#]\\u20E3|[\\u203C-\\u3299]\\uFE0F\\u200D|[\\u203C-\\u3299]\\uFE0F|[\\u2122-\\u2B55]|\\u303D|[\\A9|\\AE]\\u3030|\\uA9|\\uAE|\\u3030/gi;\n return val.replace(iconRule1, \"\");\n};\n\n// function Handler(fn) {\n// this.handler = fn;\n// this.next = null;\n// }\n\n// Handler.prototype.setNext = function setNext(h) {\n// this.next = h;\n// return h;\n// };\n\n// Handler.prototype.passRequest = function () {\n// const ret = this.handler.apply(this, arguments);\n// // 提前结束\n// if (!ret) {\n// return ret;\n// }\n\n// // 向后传递\n// if (this.next) {\n// return this.next.passRequest.apply(this.next, arguments);\n// }\n// return ret;\n// };\n\n// export class ChainHander {\n// public hander: (s: string) => boolean\n// public next\n// constructor(fn: (str: string) => boolean) {\n// this.hander = fn\n// }\n// public setNext(callback): () => boolean {\n// this.next = callback\n// return callback\n// }\n// public checkPass(...arg) {\n// const result = this.hander.apply(this, arg)\n// if (!result) {\n// return result\n// }\n\n// if (this.next != null) {\n// return this.next.checkPass.apply(this.next, arg)\n// }\n\n// return result\n// }\n// }\n\nexport const throtte = (fn: Function, delay: number = 1500) => {\n let timer: NodeJS.Timer;\n let canCall = true;\n return function (arg) {\n if (canCall) {\n canCall = false;\n console.log(arg);\n console.log(\"arg\");\n fn(arg);\n }\n timer = setTimeout(() => {\n canCall = true;\n clearTimeout(timer);\n }, delay);\n };\n};\n\nexport function pxTransform(size: number, designWidth = 750): string {\n if (!size) return \"\";\n const deviceRatio = {\n 640: 2.34 / 2,\n 750: 1,\n 828: 1.81 / 2,\n };\n if (process.env.TARO_ENV === \"h5\")\n return (\n Math.ceil(\n (((parseInt(`${size}`, 10) / 40) * 640) / designWidth) * 10000\n ) /\n 10000 +\n \"rem\"\n );\n return `${size / deviceRatio[designWidth]}rpx`;\n}\n"],"names":["inputRange","val","replace","pxTransform","size","designWidth","process","env","TARO_ENV","Math","ceil","parseInt","concat"],"mappings":"AAKO,IAAMA,EAAa,SAACC,GAGzB,OAAOA,EAAIC,QADT,6OAC4B,GAChC,EAmEgB,SAAAC,EAAYC,EAAcC,GACxC,QADwC,IAAAA,IAAAA,EAAiB,MACpDD,EAAM,MAAO,GAMlB,MAA6B,OAAzBE,QAAQC,IAAIC,SAEZC,KAAKC,KACAC,SAAS,GAAAC,OAAGR,GAAQ,IAAM,GAAM,IAAOC,EAAe,KAEzD,IACF,MAEG,GAAAO,OAAGR,EAbU,CAClB,IAAK,KACL,IAAK,EACL,IAAK,MAUsBC,SAC/B"}