taro-react-uilib 1.3.4-0 → 1.3.4-2
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 +202 -4
- package/dist/components/ActionSheet/index.js +2 -0
- package/dist/components/ActionSheet/index.js.map +1 -0
- package/dist/components/ActivityIndicator/index.js +2 -0
- package/dist/components/ActivityIndicator/index.js.map +1 -0
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Captcha/index.js +1 -1
- package/dist/components/Captcha/index.js.map +1 -1
- package/dist/components/Cell/index.js +2 -0
- package/dist/components/Cell/index.js.map +1 -0
- package/dist/components/Dialog/Alert/index.js +1 -1
- package/dist/components/Dialog/Alert/index.js.map +1 -1
- package/dist/components/Dialog/Confirm/index.js +1 -1
- package/dist/components/Dialog/Confirm/index.js.map +1 -1
- package/dist/components/DialogComponent/index.js.map +1 -1
- package/dist/components/DialogRef/index.js +1 -1
- package/dist/components/DialogRef/index.js.map +1 -1
- package/dist/components/FormInput/index.js +1 -1
- package/dist/components/FormInput/index.js.map +1 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/LinkMan/index.js +2 -0
- package/dist/components/LinkMan/index.js.map +1 -0
- package/dist/components/NumberKeyboard/index.js +1 -1
- package/dist/components/NumberKeyboard/index.js.map +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/Rank/index.js +2 -0
- package/dist/components/Rank/index.js.map +1 -0
- package/dist/components/Result/images/result-empty.png.js +2 -0
- package/dist/components/Result/images/result-empty.png.js.map +1 -0
- package/dist/components/Result/images/result-fail.png.js +2 -0
- package/dist/components/Result/images/result-fail.png.js.map +1 -0
- package/dist/components/Result/images/result-networkErr.png.js +2 -0
- package/dist/components/Result/images/result-networkErr.png.js.map +1 -0
- package/dist/components/Result/images/result-submitted.png.js +2 -0
- package/dist/components/Result/images/result-submitted.png.js.map +1 -0
- package/dist/components/Result/images/result-success.png.js +2 -0
- package/dist/components/Result/images/result-success.png.js.map +1 -0
- package/dist/components/Result/images/result-wait.png.js +2 -0
- package/dist/components/Result/images/result-wait.png.js.map +1 -0
- package/dist/components/Result/index.js +2 -0
- package/dist/components/Result/index.js.map +1 -0
- package/dist/components/Result/statusMap.js +2 -0
- package/dist/components/Result/statusMap.js.map +1 -0
- package/dist/components/Step/Steps/index.js +1 -1
- package/dist/components/Step/Steps/index.js.map +1 -1
- package/dist/components/Step/index.js +1 -1
- package/dist/components/Step/index.js.map +1 -1
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tabbar/index.js.map +1 -1
- package/dist/components/Tabbar/tabbar/TabItem.js.map +1 -1
- package/dist/components/Tabbar/tabbar/Tabbar.js +1 -1
- package/dist/components/Tabbar/tabbar/Tabbar.js.map +1 -1
- package/dist/components/src/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/actionsheet.scss +122 -0
- package/dist/styles/components/activityindicator.scss +43 -0
- package/dist/styles/components/amountinput.scss +5 -6
- package/dist/styles/components/amountkeyboard.scss +30 -12
- package/dist/styles/components/badge.scss +0 -1
- package/dist/styles/components/bankicon.scss +1 -1
- package/dist/styles/components/button.scss +14 -7
- package/dist/styles/components/captcha.scss +9 -3
- package/dist/styles/components/cell.scss +119 -0
- package/dist/styles/components/checkbox.scss +4 -5
- package/dist/styles/components/dialog.scss +14 -14
- package/dist/styles/components/dialogref.scss +14 -30
- package/dist/styles/components/font/iconfont.ttf +0 -0
- package/dist/styles/components/font/iconfont.woff +0 -0
- package/dist/styles/components/font/iconfont.woff2 +0 -0
- package/dist/styles/components/forminput.scss +40 -28
- package/dist/styles/components/icon.scss +2 -2
- package/dist/styles/components/index.scss +7 -0
- package/dist/styles/components/linkman.scss +81 -0
- package/dist/styles/components/list.scss +17 -5
- package/dist/styles/components/loading.scss +1 -9
- package/dist/styles/components/mask.scss +1 -1
- package/dist/styles/components/navbar.scss +1 -0
- package/dist/styles/components/numberkeyboard.scss +47 -36
- package/dist/styles/components/page.scss +2 -2
- package/dist/styles/components/passwordinput.scss +1 -1
- package/dist/styles/components/picker.scss +0 -1
- package/dist/styles/components/popup.scss +2 -3
- package/dist/styles/components/progress.scss +45 -3
- package/dist/styles/components/radio.scss +5 -6
- package/dist/styles/components/rank.scss +50 -0
- package/dist/styles/components/result.scss +39 -0
- package/dist/styles/components/step.scss +9 -1
- package/dist/styles/components/switch.scss +40 -0
- package/dist/styles/components/tabbar.scss +3 -0
- package/dist/styles/components/toast.scss +0 -1
- package/dist/styles/themes/default.scss +17 -8
- package/dist/styles/themes/variable.scss +8 -0
- package/lib/components/ActionSheet/index.js +57 -0
- package/lib/components/ActionSheet/index.js.map +1 -0
- package/lib/components/ActivityIndicator/index.js +14 -0
- package/lib/components/ActivityIndicator/index.js.map +1 -0
- package/lib/components/Button/index.js +3 -2
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Captcha/index.js +2 -2
- package/lib/components/Captcha/index.js.map +1 -1
- package/lib/components/Cell/index.js +27 -0
- package/lib/components/Cell/index.js.map +1 -0
- package/lib/components/Dialog/Alert/index.js +3 -3
- package/lib/components/Dialog/Alert/index.js.map +1 -1
- package/lib/components/Dialog/Confirm/index.js +2 -2
- package/lib/components/Dialog/Confirm/index.js.map +1 -1
- package/lib/components/DialogComponent/index.js +0 -2
- package/lib/components/DialogComponent/index.js.map +1 -1
- package/lib/components/DialogRef/index.js +6 -14
- package/lib/components/DialogRef/index.js.map +1 -1
- package/lib/components/FormInput/index.js +3 -2
- package/lib/components/FormInput/index.js.map +1 -1
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/LinkMan/index.js +358 -0
- package/lib/components/LinkMan/index.js.map +1 -0
- package/lib/components/NumberKeyboard/index.js +4 -2
- package/lib/components/NumberKeyboard/index.js.map +1 -1
- package/lib/components/Progress/index.js +15 -10
- package/lib/components/Progress/index.js.map +1 -1
- package/lib/components/Radio/index.js +1 -1
- package/lib/components/Radio/index.js.map +1 -1
- package/lib/components/Rank/index.js +22 -0
- package/lib/components/Rank/index.js.map +1 -0
- package/lib/components/Result/index.js +30 -0
- package/lib/components/Result/index.js.map +1 -0
- package/lib/components/Result/statusMap.js +15 -0
- package/lib/components/Result/statusMap.js.map +1 -0
- package/lib/components/Step/Steps/index.js +1 -0
- package/lib/components/Step/Steps/index.js.map +1 -1
- package/lib/components/Step/index.js +2 -1
- package/lib/components/Step/index.js.map +1 -1
- package/lib/components/Switch/index.js +26 -0
- package/lib/components/Switch/index.js.map +1 -0
- package/lib/components/Tabbar/index.js +1 -0
- package/lib/components/Tabbar/index.js.map +1 -1
- package/lib/components/Tabbar/tabbar/TabItem.js +0 -1
- package/lib/components/Tabbar/tabbar/TabItem.js.map +1 -1
- package/lib/components/Tabbar/tabbar/Tabbar.js +9 -8
- package/lib/components/Tabbar/tabbar/Tabbar.js.map +1 -1
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/types/components/Button/index.d.ts +6 -1
- package/types/components/Captcha/index.d.ts +1 -1
- package/types/components/DialogRef/index.d.ts +2 -0
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/LinkMan/index.d.ts +33 -0
- package/types/components/NumberKeyboard/index.d.ts +2 -0
- package/types/components/Progress/index.d.ts +4 -0
- package/types/components/Result/index.d.ts +16 -0
- package/types/components/Result/statusMap.d.ts +9 -0
- package/types/components/Step/index.d.ts +1 -0
- package/types/components/Tabbar/index.d.ts +1 -0
- package/types/components/Tabbar/tabbar/TabItem.d.ts +0 -1
- package/types/components/Tabbar/tabbar/Tabbar.d.ts +3 -2
- package/types/index.d.ts +7 -0
- package/dist/styles/components/images/backspace.png +0 -0
- package/dist/styles/components/images/closeKeyboard.png +0 -0
- package/dist/styles/components/images/icon-arrow-right.png +0 -0
- package/dist/styles/components/images/loading.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,91 @@
|
|
|
1
|
+
## [1.3.4-2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-1...v1.3.4-2) (2023-07-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* icon增加、Cellborder ([15490f3](https://code.xhdev.xyz/h5group/taro-uilib/commits/15490f3f79d3cdcccdf9b1153943aff8a4dc1c7a))
|
|
7
|
+
* linkman 组件的开发 ([72de62d](https://code.xhdev.xyz/h5group/taro-uilib/commits/72de62d8507af2dc7281a3b1989ef1219f06f582))
|
|
8
|
+
* linkman开发 ([497b8f7](https://code.xhdev.xyz/h5group/taro-uilib/commits/497b8f7dcae63d7b826409a6573777ff903c9d09))
|
|
9
|
+
* linkman组件开发 ([cb8843c](https://code.xhdev.xyz/h5group/taro-uilib/commits/cb8843ca89091ebbf0b5e43319d472e81e4c8be8))
|
|
10
|
+
* Result 优化 ([ed92c0b](https://code.xhdev.xyz/h5group/taro-uilib/commits/ed92c0bf4a00c7901705fb847b2697ea8ebc64fe))
|
|
11
|
+
* 增加补充联系人组件 ([dee4637](https://code.xhdev.xyz/h5group/taro-uilib/commits/dee4637f7734443bb7a205f6358ab76172b2a022))
|
|
12
|
+
* 字体文件更新 ([a875262](https://code.xhdev.xyz/h5group/taro-uilib/commits/a8752626433033f398d8975537c5fc10ecb1d733))
|
|
13
|
+
* 缺省页组件开发 ([a55bc8f](https://code.xhdev.xyz/h5group/taro-uilib/commits/a55bc8fbf2c0c4bdf83a40b7472304c0f2c028f9))
|
|
14
|
+
* 联系人组件开发 ([9f7ac48](https://code.xhdev.xyz/h5group/taro-uilib/commits/9f7ac4893d314e18d434eb8f576117acc378d01c))
|
|
15
|
+
* 进度条组件 ([bdec066](https://code.xhdev.xyz/h5group/taro-uilib/commits/bdec0669a3e937bb16f865795cba77d5e2dd1725))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [1.3.2-2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-1...v1.3.2-2) (2023-07-06)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* Switch组件、组件优化 ([ec81a39](https://code.xhdev.xyz/h5group/taro-uilib/commits/ec81a39876c3755113c78289b030216e22e2375d))
|
|
25
|
+
* tabbar组件新增属性 ([77f16c7](https://code.xhdev.xyz/h5group/taro-uilib/commits/77f16c7d57cd8ecb3e03310ffae8bd9238c5afc0))
|
|
26
|
+
* 修改radio、checkbox disble样式 ([0249cb3](https://code.xhdev.xyz/h5group/taro-uilib/commits/0249cb31e5582e4f098e8fd5d3c3154f61068381))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.3.2-1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-0...v1.3.2-1) (2023-07-03)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* cell content固定宽度 ([6d998c4](https://code.xhdev.xyz/h5group/taro-uilib/commits/6d998c47e90ebda8d0afe7f502625b3a2d6d05a0))
|
|
36
|
+
* 去掉所有图片改用icon ([f87d12d](https://code.xhdev.xyz/h5group/taro-uilib/commits/f87d12d39264aeacae35220a7760dd573d18a559))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* actionsheet inline模式 ([d6b4ac5](https://code.xhdev.xyz/h5group/taro-uilib/commits/d6b4ac56bcdc57af9092d847d4c5bc58f1a3edf8))
|
|
42
|
+
* add Cell ([6f79e20](https://code.xhdev.xyz/h5group/taro-uilib/commits/6f79e20acba10d7db41de78a826b0c4f33655c27))
|
|
43
|
+
* alert样式修改 ([d1dab6d](https://code.xhdev.xyz/h5group/taro-uilib/commits/d1dab6d4c9b4b709bd0377d8b62da48aea65f7b3))
|
|
44
|
+
* button 变量修改 ([54d9198](https://code.xhdev.xyz/h5group/taro-uilib/commits/54d9198388022d66afe0a96850acd0706e6d9833))
|
|
45
|
+
* 增加cell、activityindicator、button优化 ([177fb35](https://code.xhdev.xyz/h5group/taro-uilib/commits/177fb3537bd25bb67f152e3570c88950c377019b))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [1.3.0-9](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0...v1.3.0-9) (2023-06-16)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* 抖音小程序上的兼容问题 ([1ccdae1](https://code.xhdev.xyz/h5group/taro-uilib/commits/1ccdae18e5bb7c8b36420d3c9d5c66af770e6c43))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# [1.3.0-8](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-7...v1.3.0-8) (2023-06-14)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
* numberkeyboard ([6633cc8](https://code.xhdev.xyz/h5group/taro-uilib/commits/6633cc8676d71a564d7416a08b7ceda037844c51))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* actionsheet组件、、rank组件 ([46b5dcd](https://code.xhdev.xyz/h5group/taro-uilib/commits/46b5dcd09300006ba12cc9adb1ea899aa61aa0a9))
|
|
69
|
+
* radio 默认圆形 ([c070363](https://code.xhdev.xyz/h5group/taro-uilib/commits/c070363288a1032cbcaa3c4b5d6d77dfab54290c))
|
|
70
|
+
* 主色调更新、优化captcha组件 ([680707e](https://code.xhdev.xyz/h5group/taro-uilib/commits/680707ef5e5e8c35be01125a1a567ea9070b8a2a))
|
|
71
|
+
* 增加action组件、增加icon ([db09cdd](https://code.xhdev.xyz/h5group/taro-uilib/commits/db09cddee336cdfb4965c4dc39c9907bdd95f8ea))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Performance Improvements
|
|
75
|
+
|
|
76
|
+
* button ghost diaddialog优化 ([628ed11](https://code.xhdev.xyz/h5group/taro-uilib/commits/628ed11cac10014cd47776f98abfac0b401fda79))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## [1.3.4-1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-0...v1.3.4-1) (2023-07-10)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
* icon类型 ([3f53ceb](https://code.xhdev.xyz/h5group/taro-uilib/commits/3f53ceb0bb1407f37442a7a8db59b7ac7a7b37ba))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
1
89
|
## [1.3.4-0](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.3...v1.3.4-0) (2023-07-10)
|
|
2
90
|
|
|
3
91
|
|
|
@@ -17,7 +105,7 @@
|
|
|
17
105
|
|
|
18
106
|
|
|
19
107
|
|
|
20
|
-
## [1.3.2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-
|
|
108
|
+
## [1.3.2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-2...v1.3.2) (2023-07-10)
|
|
21
109
|
|
|
22
110
|
|
|
23
111
|
### Features
|
|
@@ -26,6 +114,67 @@
|
|
|
26
114
|
|
|
27
115
|
|
|
28
116
|
|
|
117
|
+
## [1.3.2-2](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-1...v1.3.2-2) (2023-07-06)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Features
|
|
121
|
+
|
|
122
|
+
* Switch组件、组件优化 ([ec81a39](https://code.xhdev.xyz/h5group/taro-uilib/commits/ec81a39876c3755113c78289b030216e22e2375d))
|
|
123
|
+
* tabbar组件新增属性 ([77f16c7](https://code.xhdev.xyz/h5group/taro-uilib/commits/77f16c7d57cd8ecb3e03310ffae8bd9238c5afc0))
|
|
124
|
+
* 修改radio、checkbox disble样式 ([0249cb3](https://code.xhdev.xyz/h5group/taro-uilib/commits/0249cb31e5582e4f098e8fd5d3c3154f61068381))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## [1.3.2-1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.2-0...v1.3.2-1) (2023-07-03)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### Bug Fixes
|
|
132
|
+
|
|
133
|
+
* cell content固定宽度 ([6d998c4](https://code.xhdev.xyz/h5group/taro-uilib/commits/6d998c47e90ebda8d0afe7f502625b3a2d6d05a0))
|
|
134
|
+
* 去掉所有图片改用icon ([f87d12d](https://code.xhdev.xyz/h5group/taro-uilib/commits/f87d12d39264aeacae35220a7760dd573d18a559))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### Features
|
|
138
|
+
|
|
139
|
+
* actionsheet inline模式 ([d6b4ac5](https://code.xhdev.xyz/h5group/taro-uilib/commits/d6b4ac56bcdc57af9092d847d4c5bc58f1a3edf8))
|
|
140
|
+
* add Cell ([6f79e20](https://code.xhdev.xyz/h5group/taro-uilib/commits/6f79e20acba10d7db41de78a826b0c4f33655c27))
|
|
141
|
+
* alert样式修改 ([d1dab6d](https://code.xhdev.xyz/h5group/taro-uilib/commits/d1dab6d4c9b4b709bd0377d8b62da48aea65f7b3))
|
|
142
|
+
* button 变量修改 ([54d9198](https://code.xhdev.xyz/h5group/taro-uilib/commits/54d9198388022d66afe0a96850acd0706e6d9833))
|
|
143
|
+
* 增加cell、activityindicator、button优化 ([177fb35](https://code.xhdev.xyz/h5group/taro-uilib/commits/177fb3537bd25bb67f152e3570c88950c377019b))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# [1.3.0-9](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0...v1.3.0-9) (2023-06-16)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
* 抖音小程序上的兼容问题 ([1ccdae1](https://code.xhdev.xyz/h5group/taro-uilib/commits/1ccdae18e5bb7c8b36420d3c9d5c66af770e6c43))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# [1.3.0-8](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-7...v1.3.0-8) (2023-06-14)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Bug Fixes
|
|
160
|
+
|
|
161
|
+
* numberkeyboard ([6633cc8](https://code.xhdev.xyz/h5group/taro-uilib/commits/6633cc8676d71a564d7416a08b7ceda037844c51))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Features
|
|
165
|
+
|
|
166
|
+
* actionsheet组件、、rank组件 ([46b5dcd](https://code.xhdev.xyz/h5group/taro-uilib/commits/46b5dcd09300006ba12cc9adb1ea899aa61aa0a9))
|
|
167
|
+
* radio 默认圆形 ([c070363](https://code.xhdev.xyz/h5group/taro-uilib/commits/c070363288a1032cbcaa3c4b5d6d77dfab54290c))
|
|
168
|
+
* 主色调更新、优化captcha组件 ([680707e](https://code.xhdev.xyz/h5group/taro-uilib/commits/680707ef5e5e8c35be01125a1a567ea9070b8a2a))
|
|
169
|
+
* 增加action组件、增加icon ([db09cdd](https://code.xhdev.xyz/h5group/taro-uilib/commits/db09cddee336cdfb4965c4dc39c9907bdd95f8ea))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Performance Improvements
|
|
173
|
+
|
|
174
|
+
* button ghost diaddialog优化 ([628ed11](https://code.xhdev.xyz/h5group/taro-uilib/commits/628ed11cac10014cd47776f98abfac0b401fda79))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
29
178
|
## [1.3.2-0](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.1...v1.3.2-0) (2023-06-16)
|
|
30
179
|
|
|
31
180
|
|
|
@@ -35,7 +184,7 @@
|
|
|
35
184
|
|
|
36
185
|
|
|
37
186
|
|
|
38
|
-
## [1.3.1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0...v1.3.1) (2023-06-16)
|
|
187
|
+
## [1.3.1](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-9...v1.3.1) (2023-06-16)
|
|
39
188
|
|
|
40
189
|
|
|
41
190
|
### Bug Fixes
|
|
@@ -44,18 +193,67 @@
|
|
|
44
193
|
|
|
45
194
|
|
|
46
195
|
|
|
47
|
-
# [1.3.0](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0
|
|
196
|
+
# [1.3.0-9](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0...v1.3.0-9) (2023-06-16)
|
|
48
197
|
|
|
49
198
|
|
|
50
199
|
### Bug Fixes
|
|
51
200
|
|
|
52
|
-
*
|
|
201
|
+
* 抖音小程序上的兼容问题 ([1ccdae1](https://code.xhdev.xyz/h5group/taro-uilib/commits/1ccdae18e5bb7c8b36420d3c9d5c66af770e6c43))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# [1.3.0-8](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-7...v1.3.0-8) (2023-06-14)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Bug Fixes
|
|
209
|
+
|
|
210
|
+
* numberkeyboard ([6633cc8](https://code.xhdev.xyz/h5group/taro-uilib/commits/6633cc8676d71a564d7416a08b7ceda037844c51))
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Features
|
|
214
|
+
|
|
215
|
+
* actionsheet组件、、rank组件 ([46b5dcd](https://code.xhdev.xyz/h5group/taro-uilib/commits/46b5dcd09300006ba12cc9adb1ea899aa61aa0a9))
|
|
216
|
+
* radio 默认圆形 ([c070363](https://code.xhdev.xyz/h5group/taro-uilib/commits/c070363288a1032cbcaa3c4b5d6d77dfab54290c))
|
|
217
|
+
* 主色调更新、优化captcha组件 ([680707e](https://code.xhdev.xyz/h5group/taro-uilib/commits/680707ef5e5e8c35be01125a1a567ea9070b8a2a))
|
|
218
|
+
* 增加action组件、增加icon ([db09cdd](https://code.xhdev.xyz/h5group/taro-uilib/commits/db09cddee336cdfb4965c4dc39c9907bdd95f8ea))
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
### Performance Improvements
|
|
222
|
+
|
|
223
|
+
* button ghost diaddialog优化 ([628ed11](https://code.xhdev.xyz/h5group/taro-uilib/commits/628ed11cac10014cd47776f98abfac0b401fda79))
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
# [1.3.0](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-8...v1.3.0) (2023-06-15)
|
|
53
228
|
|
|
54
229
|
|
|
55
230
|
### Features
|
|
56
231
|
|
|
57
232
|
* badge、amountkeyboard在抖音上的边框问题 ([b7d1179](https://code.xhdev.xyz/h5group/taro-uilib/commits/b7d117931cb355f402bc28b1da174a8e51617286))
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
# [1.3.0-8](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.0-7...v1.3.0-8) (2023-06-14)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
### Bug Fixes
|
|
240
|
+
|
|
241
|
+
* navbar arrow ([085dd2b](https://code.xhdev.xyz/h5group/taro-uilib/commits/085dd2bc98df7a1249b86808378e7933e0fcdab2))
|
|
242
|
+
* numberkeyboard ([6633cc8](https://code.xhdev.xyz/h5group/taro-uilib/commits/6633cc8676d71a564d7416a08b7ceda037844c51))
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### Features
|
|
246
|
+
|
|
247
|
+
* actionsheet组件、、rank组件 ([46b5dcd](https://code.xhdev.xyz/h5group/taro-uilib/commits/46b5dcd09300006ba12cc9adb1ea899aa61aa0a9))
|
|
58
248
|
* navbar适配 ([ee6ab17](https://code.xhdev.xyz/h5group/taro-uilib/commits/ee6ab17e766d849c9223582e8e3431315163b289))
|
|
249
|
+
* radio 默认圆形 ([c070363](https://code.xhdev.xyz/h5group/taro-uilib/commits/c070363288a1032cbcaa3c4b5d6d77dfab54290c))
|
|
250
|
+
* 主色调更新、优化captcha组件 ([680707e](https://code.xhdev.xyz/h5group/taro-uilib/commits/680707ef5e5e8c35be01125a1a567ea9070b8a2a))
|
|
251
|
+
* 增加action组件、增加icon ([db09cdd](https://code.xhdev.xyz/h5group/taro-uilib/commits/db09cddee336cdfb4965c4dc39c9907bdd95f8ea))
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
### Performance Improvements
|
|
255
|
+
|
|
256
|
+
* button ghost diaddialog优化 ([628ed11](https://code.xhdev.xyz/h5group/taro-uilib/commits/628ed11cac10014cd47776f98abfac0b401fda79))
|
|
59
257
|
|
|
60
258
|
|
|
61
259
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import n,{useState as t,useEffect as a}from"react";import o from"classnames";import{View as c}from"@tarojs/components";import i from"../Popup/index.js";var l=function(l){var s=l.visible,r=void 0!==s&&s,m=l.title,u=l.description,h=l.data,d=void 0===h?[]:h,f=l.onConfirm,p=l.onCancel,E=l.className,x=l.children,v=l.style,N=l.mode,C=l.submitText,k=void 0===C?"提交":C,b=l.cancelText,g=void 0===b?"取消":b,y=l.showCancel,j=void 0!==y&&y,T=l.renderItem,P=l.ItemWrapper,_=l.onSubmit,w=l.onClick,A=l.showClose,I=void 0!==A&&A,O=l.justifyContent,R=void 0===O?"center":O,V=l.inline,F=void 0!==V&&V,S=e(t(r),2),W=S[0],q=S[1],z=function(e){null==p||p(e),null==w||w(!1),q(!1)};a((function(){q(r)}),[r]);var B=function(){null==_||_()},D=function(){return d.map((function(e,t){return T?T(e,t):n.createElement(c,{className:o("xh-action-sheet-main-panel-item",R),key:t,onClick:function(){!function(e,n){null==f||f(e,n),q(!1)}(e,t)}},"string"==typeof e?e:e.text)}))};return n.createElement(c,{className:o("xh-action-sheet",{inline:F}),onClick:function(){w?w(!r):d.length<=0||q(!0)}},n.createElement(i,{visible:W},n.createElement(c,{className:o("xh-action-sheet-main",E,N),style:v},n.createElement(c,{className:"xh-action-sheet-main-header"},n.createElement(c,{className:"xh-action-sheet-main-header-title"},m),n.createElement(c,{className:"xh-action-sheet-main-header-desc"},u),(I||"controlled"===N&&!j)&&n.createElement(c,{className:"xh-action-sheet-main-header-close",onClick:function(){return z()}})),n.createElement(c,{className:o("xh-action-sheet-main-panel",{panel:!T}),onClick:function(e){return"h5"!==process.env.TARO_ENV&&e.stopPropagation()}},P?n.createElement(P,null,D()):n.createElement(n.Fragment,null,D())),n.createElement(c,{className:"xh-action-sheet-main-action",onClick:function(e){return"h5"!==process.env.TARO_ENV&&e.stopPropagation()}},"controlled"===N?n.createElement(c,null,n.createElement(c,{className:"xh-action-sheet-main-action-submit",onClick:B},k),j&&n.createElement(c,{className:"xh-action-sheet-main-action-cancel mode",onClick:function(){return z(!0)}},g)):n.createElement(c,{className:"xh-action-sheet-main-action-cancel",onClick:function(){return z(!0)}},g)))),x)};export{l as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/ActionSheet/index.tsx"],"sourcesContent":["import React, { useState, ReactNode, ReactElement, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\n\nimport Popup from \"../Popup\";\nimport \"./index.scss\";\n\nexport interface ActionSheetOption {\n text: ReactNode;\n value: string | number;\n [key: string]: any;\n}\n\nexport type ActionValue = string | ActionSheetOption;\nexport interface ActionProps<T extends ActionValue = ActionValue> {\n visible?: boolean;\n title?: ReactNode;\n data: T[];\n defaultValueData?: (string | number)[];\n className?: string;\n style?: React.CSSProperties;\n onConfirm?: (selectedValue: T, index: number) => void;\n onCancel?: (bottom?: boolean) => void;\n onClose?: () => void;\n onClick?: (flag: boolean) => void;\n children?: ReactNode;\n description?: ReactNode;\n /**\n * @summary controlled模式下,组件为受控组件,需要外部来显示和隐藏\n * @description submit 模式下会显示提交按钮,可以自定义,也可以显示取消按钮但是得传进来一个Toggle事件用来显示隐藏\n */\n mode?: \"controlled\";\n cancelText?: ReactNode;\n /**\n * submit模式下,默认不展示取消按钮,可以设置\n */\n showCancel?: boolean;\n submitText?: string;\n renderItem?: (item: T, index: number) => ReactNode;\n ItemWrapper?: React.FC<{}>;\n onSubmit?: () => void;\n justifyContent?: \"start\" | \"end\";\n /**\n * 显示右上角的关闭、默认只有不显示下面的取消的时候才出现\n */\n showClose?: boolean;\n inline?: boolean;\n}\n\nconst ActionSheet = <T extends ActionValue>(\n props: ActionProps<T>\n): ReactElement => {\n const {\n visible = false,\n title,\n description,\n data = [],\n onConfirm,\n onCancel,\n className,\n children,\n style,\n mode,\n submitText = \"提交\",\n cancelText = \"取消\",\n showCancel = false,\n renderItem,\n ItemWrapper,\n onSubmit,\n onClick,\n showClose = false,\n justifyContent = \"center\",\n inline = false,\n } = props;\n\n const [innerVisible, setInnerVisible] = useState(visible);\n\n const handleCancel = (bottom?: boolean) => {\n onCancel?.(bottom);\n onClick?.(false);\n setInnerVisible(false);\n };\n\n useEffect(() => {\n setInnerVisible(visible);\n }, [visible]);\n\n const handleClick = () => {\n if (onClick) {\n onClick(!visible);\n return;\n }\n if (data.length <= 0) return;\n setInnerVisible(true);\n };\n\n const handleConfirm = (item: T, index: number) => {\n onConfirm?.(item, index);\n setInnerVisible(false);\n };\n\n const handleSubmit = () => {\n onSubmit?.();\n };\n\n const submitButton = () => {\n return (\n <View>\n <View\n className=\"xh-action-sheet-main-action-submit\"\n onClick={handleSubmit}\n >\n {submitText}\n </View>\n {showCancel && (\n <View\n className=\"xh-action-sheet-main-action-cancel mode\"\n onClick={() => handleCancel(true)}\n >\n {cancelText}\n </View>\n )}\n </View>\n );\n };\n\n const itemRender = () =>\n data.map((item, index) => {\n return renderItem ? (\n renderItem(item, index)\n ) : (\n <View\n className={classNames(\n \"xh-action-sheet-main-panel-item\",\n justifyContent\n )}\n key={index}\n onClick={() => {\n handleConfirm(item, index);\n }}\n >\n {typeof item === \"string\" ? item : item.text}\n </View>\n );\n });\n\n return (\n <View\n className={classNames(\"xh-action-sheet\", { inline })}\n onClick={handleClick}\n >\n <Popup visible={innerVisible}>\n <View\n className={classNames(\"xh-action-sheet-main\", className, mode)}\n style={style}\n >\n <View className=\"xh-action-sheet-main-header\">\n <View className=\"xh-action-sheet-main-header-title\">{title}</View>\n <View className=\"xh-action-sheet-main-header-desc\">\n {description}\n </View>\n {(showClose || (mode === \"controlled\" && !showCancel)) && (\n <View\n className=\"xh-action-sheet-main-header-close\"\n onClick={() => handleCancel()}\n ></View>\n )}\n </View>\n <View\n className={classNames(\"xh-action-sheet-main-panel\", {\n panel: !renderItem,\n })}\n onClick={e => process.env.TARO_ENV !== \"h5\" && e.stopPropagation()}\n >\n {ItemWrapper ? (\n <ItemWrapper>{itemRender()}</ItemWrapper>\n ) : (\n <React.Fragment>{itemRender()}</React.Fragment>\n )}\n </View>\n <View\n className=\"xh-action-sheet-main-action\"\n onClick={e => process.env.TARO_ENV !== \"h5\" && e.stopPropagation()}\n >\n {mode === \"controlled\" ? (\n submitButton()\n ) : (\n <View\n className=\"xh-action-sheet-main-action-cancel\"\n onClick={() => handleCancel(true)}\n >\n {cancelText}\n </View>\n )}\n </View>\n </View>\n </Popup>\n {children}\n </View>\n );\n};\n\nexport default ActionSheet;\n"],"names":["ActionSheet","props","_a","visible","title","description","_b","data","onConfirm","onCancel","className","children","style","mode","_c","submitText","_d","cancelText","_e","showCancel","renderItem","ItemWrapper","onSubmit","onClick","_f","showClose","_g","justifyContent","_h","inline","_j","__read","useState","innerVisible","setInnerVisible","handleCancel","bottom","useEffect","handleSubmit","itemRender","map","item","index","React","createElement","View","classNames","key","handleConfirm","text","length","Popup","panel","e","process","env","TARO_ENV","stopPropagation","Fragment"],"mappings":"oNAiDM,IAAAA,EAAc,SAClBC,GAGE,IAAAC,EAoBED,EApBaE,QAAfA,OAAO,IAAAD,GAAQA,EACfE,EAmBEH,EAnBGG,MACLC,EAkBEJ,EAAKI,YAjBPC,EAiBEL,EAAKM,KAjBPA,OAAO,IAAAD,EAAA,GAAEA,EACTE,EAgBEP,EAhBOO,UACTC,EAeER,EAAKQ,SAdPC,EAcET,EAdOS,UACTC,EAaEV,EAbMU,SACRC,EAYEX,EAAKW,MAXPC,EAWEZ,EAXEY,KACJC,EAUEb,EAVec,WAAjBA,OAAa,IAAAD,EAAA,KAAIA,EACjBE,EASEf,EATegB,WAAjBA,OAAU,IAAAD,EAAG,KAAIA,EACjBE,EAQEjB,EAAKkB,WARPA,OAAU,IAAAD,GAAQA,EAClBE,EAOEnB,EAPQmB,WACVC,EAMEpB,EAAKoB,YALPC,EAKErB,EAAKqB,SAJPC,EAIEtB,EAJKsB,QACPC,EAGEvB,EAHewB,UAAjBA,OAAS,IAAAD,GAAQA,EACjBE,EAEEzB,EAFuB0B,eAAzBA,OAAc,IAAAD,EAAG,SAAQA,EACzBE,EACE3B,EAAK4B,OADPA,OAAS,IAAAD,KAGLE,EAAAC,EAAkCC,EAAS7B,GAAQ,GAAlD8B,EAAYH,EAAA,GAAEI,OAEfC,EAAe,SAACC,GACpB3B,SAAAA,EAAW2B,GACXb,SAAAA,GAAU,GACVW,GAAgB,EAClB,EAEAG,GAAU,WACRH,EAAgB/B,EAClB,GAAG,CAACA,IAEJ,IAcMmC,EAAe,WACnBhB,SAAAA,GACF,EAuBMiB,EAAa,WACjB,OAAAhC,EAAKiC,KAAI,SAACC,EAAMC,GACd,OAAOtB,EACLA,EAAWqB,EAAMC,GAEjBC,EAACC,cAAAC,EACC,CAAAnC,UAAWoC,EACT,kCACAnB,GAEFoB,IAAKL,EACLnB,QAAS,YAzCK,SAACkB,EAASC,GAC9BlC,SAAAA,EAAYiC,EAAMC,GAClBR,GAAgB,EAClB,CAuCUc,CAAcP,EAAMC,EACtB,GAEiB,iBAATD,EAAoBA,EAAOA,EAAKQ,KAG9C,GAjBA,EAmBF,OACEN,EAACC,cAAAC,GACCnC,UAAWoC,EAAW,kBAAmB,CAAEjB,OAAMA,IACjDN,QA9DgB,WACdA,EACFA,GAASpB,GAGPI,EAAK2C,QAAU,GACnBhB,GAAgB,EAClB,GAyDIS,EAAAC,cAACO,EAAK,CAAChD,QAAS8B,GACdU,EAAAC,cAACC,EAAI,CACHnC,UAAWoC,EAAW,uBAAwBpC,EAAWG,GACzDD,MAAOA,GAEP+B,EAAAC,cAACC,EAAI,CAACnC,UAAU,+BACdiC,EAAAC,cAACC,EAAK,CAAAnC,UAAU,qCAAqCN,GACrDuC,EAAAC,cAACC,EAAK,CAAAnC,UAAU,oCACbL,IAEDoB,GAAuB,eAATZ,IAA0BM,IACxCwB,EAACC,cAAAC,EACC,CAAAnC,UAAU,oCACVa,QAAS,WAAM,OAAAY,GAAc,KAInCQ,EAAAC,cAACC,EACC,CAAAnC,UAAWoC,EAAW,6BAA8B,CAClDM,OAAQhC,IAEVG,QAAS,SAAA8B,GAAK,MAAyB,OAAzBC,QAAQC,IAAIC,UAAqBH,EAAEI,iBAAiB,GAEjEpC,EACCsB,EAACC,cAAAvB,OAAakB,KAEdI,EAAAC,cAACD,EAAMe,cAAUnB,MAGrBI,EAAAC,cAACC,EAAI,CACHnC,UAAU,8BACVa,QAAS,SAAA8B,GAAK,MAAyB,OAAzBC,QAAQC,IAAIC,UAAqBH,EAAEI,iBAAiB,GAExD,eAAT5C,EA7EP8B,gBAACE,EAAI,KACHF,EAACC,cAAAC,EACC,CAAAnC,UAAU,qCACVa,QAASe,GAERvB,GAEFI,GACCwB,EAAAC,cAACC,EAAI,CACHnC,UAAU,0CACVa,QAAS,WAAM,OAAAY,GAAa,EAAK,GAEhClB,IAoEC0B,EAAAC,cAACC,EAAI,CACHnC,UAAU,qCACVa,QAAS,WAAM,OAAAY,GAAa,EAAK,GAEhClB,MAMVN,EAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import a from"react";import t from"classnames";import{View as e}from"@tarojs/components";var i=function(i){var c=i.className,r=i.style,m=i.slot,s=t("xh-activity-indicator",c);return a.createElement(e,{className:s,style:r},a.createElement(e,{className:"xh-activity-indicator-main"}),a.createElement(e,{className:"xh-activity-indicator-main"}),a.createElement(e,{className:"xh-activity-indicator-main"}),m)};export{i as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/ActivityIndicator/index.tsx"],"sourcesContent":["import React, { CSSProperties, FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { XHComponentCommonProps } from \"../../types\";\nimport \"./index.scss\";\n\nexport type LoadingProps = {\n color?: string;\n tip?: string | ReactNode;\n style?: CSSProperties;\n slot?: ReactNode;\n} & XHComponentCommonProps;\n\nconst Activityindicator: FC<LoadingProps> = ({ className, style, slot }) => {\n const cls = classNames(\"xh-activity-indicator\", className);\n\n return (\n <View className={cls} style={style}>\n <View className=\"xh-activity-indicator-main\"></View>\n <View className=\"xh-activity-indicator-main\"></View>\n <View className=\"xh-activity-indicator-main\"></View>\n {slot}\n </View>\n );\n};\n\nexport default Activityindicator;\n"],"names":["Activityindicator","_a","className","style","slot","cls","classNames","React","createElement","View"],"mappings":"yFAaM,IAAAA,EAAsC,SAACC,GAAE,IAAAC,cAAWC,EAAKF,EAAAE,MAAEC,EAAIH,EAAAG,KAC7DC,EAAMC,EAAW,wBAAyBJ,GAEhD,OACEK,EAACC,cAAAC,EAAK,CAAAP,UAAWG,EAAKF,MAAOA,GAC3BI,EAAAC,cAACC,EAAI,CAACP,UAAU,+BAChBK,EAAAC,cAACC,EAAI,CAACP,UAAU,+BAChBK,EAAAC,cAACC,EAAI,CAACP,UAAU,+BACfE,EAGP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{useState as o,useRef as n,useEffect as r}from"react";import a from"classnames";import{Button as s}from"@tarojs/components";import{useTaroEnv as
|
|
1
|
+
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{useState as o,useRef as n,useEffect as r}from"react";import a from"classnames";import{Button as s}from"@tarojs/components";import{useTaroEnv as l}from"../src/hooks/index.js";import i from"./DotJump.js";var m=function(m){var u=m.disabled,d=void 0!==u&&u,p=m.type,c=void 0===p?"default":p,h=m.size,b=void 0===h?"normal":h,g=m.shape,f=void 0===g?"round":g,x=m.children,y=m.className,v=m.htmlType,P=m.formType,T=m.text,E=m.openType,M=m.lang,w=m.sessionFrom,C=m.sendMessageTitle,I=m.sendMessagePath,N=m.sendMessageImg,j=m.showMessageCard,k=m.appParameter,G=m.onGetUserInfo,S=m.onGetPhoneNumber,W=m.onOpenSetting,q=m.onError,A=m.onContact,D=m.onClick,F=m.preventTime,O=void 0===F?2500:F,U=m.style,z=m.loading,B=m.loadingStyle,J=m.loadingSpace,_=m.ghost,H=void 0!==_&&_,K=m.hollow,L=void 0!==K&&K,Q=l(),R=e(o(!1),2),V=R[0],X=R[1],Y=n(),Z=a("xh-button",{"xh-button-default":"default"===c,"xh-button-primary":"primary"===c,"xh-button-secondary":"secondary"===c,"xh-button-ghost":H,"xh-button-hollow":L,"xh-button-warn":"warn"===c,"xh-button-square":"square"===f,"xh-button-round":"round"===f,"xh-button-rectangle":"rectangle"===f,"xh-button-normal":"normal"===b,"xh-button-small":"mini"===b,"xh-button-full":"full"===b,"xh-button-disabled":d,"xh-button-webutton":"WEAPP"===Q},y),$=function(e){"WEB"===Q&&e.nativeEvent.stopImmediatePropagation(),e.preventDefault(),V&&0!==O||(0!==O&&(Y.current=setTimeout((function(){X(!1),clearTimeout(Y.current)}),O)),0!==O&&X(!0),D&&D(e))};r((function(){return function(){clearTimeout(Y.current)}}),[]);var ee=t.createElement(s,{className:Z,formType:P,openType:E,lang:M,type:c,sessionFrom:w,sendMessageTitle:C,sendMessagePath:I,sendMessageImg:N,showMessageCard:j,appParameter:k,onGetUserInfo:G,onGetPhoneNumber:S,onOpenSetting:W,onError:q,onContact:A,onClick:$,disabled:d,style:U,loading:z},x);return"WEAPP"===Q?ee:t.createElement("button",{className:Z,disabled:d,type:v,onClick:d?void 0:$,style:U},x||T,z&&t.createElement(i,{style:B,space:J}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import React, {\n FC,\n MouseEventHandler,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { Button } from \"@tarojs/components\";\nimport { ButtonProps } from \"@tarojs/components/types/Button\";\nimport {\n ITouchEvent,\n TouchEventFunction,\n} from \"@tarojs/components/types/common\";\n\nimport { useTaroEnv } from \"../../hooks\";\nimport \"./index.scss\";\nimport DotJump from \"./DotJump\";\n\nexport type ButtonType = \"default\" | \"secondary\" | \"primary\" | \"warn\"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import React, {\n FC,\n MouseEventHandler,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport classNames from \"classnames\";\nimport { Button } from \"@tarojs/components\";\nimport { ButtonProps } from \"@tarojs/components/types/Button\";\nimport {\n ITouchEvent,\n TouchEventFunction,\n} from \"@tarojs/components/types/common\";\n\nimport { useTaroEnv } from \"../../hooks\";\nimport \"./index.scss\";\nimport DotJump from \"./DotJump\";\n\nexport type ButtonType = \"default\" | \"secondary\" | \"primary\" | \"warn\";\n\nexport type ButtonShape = \"square\" | \"round\" | \"rectangle\";\n\nexport type ButtonSize = \"default\" | \"mini\" | \"full\";\n\nexport type WechatOpenType =\n | \"contact\"\n /** 触发用户转发,使用前建议先阅读使用指引\n * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95\n */\n | \"share\"\n /** 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息\n * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html\n */\n | \"getPhoneNumber\"\n /** 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 */\n | \"getUserInfo\"\n /** 用户实名信息授权,已经弃用 */\n | \"getRealnameAuthInfo\"\n /** 打开APP,可以通过app-parameter属性设定向APP传的参数\n * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html\n */\n | \"launchApp\"\n /** 打开授权设置页 */\n | \"openSetting\"\n /** 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容 */\n | \"feedback\";\nexport type XhButtonProps = {\n htmlType?: \"button\" | \"submit\" | \"reset\";\n type?: ButtonType;\n size?: ButtonSize;\n shape?: ButtonShape;\n disabled?: boolean;\n className?: string;\n styleName?: string;\n text?: string;\n preventTime?: number;\n onClick?: (e: ITouchEvent | MouseEvent) => void;\n style?: React.CSSProperties;\n loading?: boolean;\n loadingStyle?: React.CSSProperties;\n loadingSpace?: number;\n ghost?: boolean;\n /**\n * 镂空\n */\n hollow?: boolean;\n} & Omit<ButtonProps, \"type\" | \"size\">;\n\nconst XhButton: FC<XhButtonProps> = props => {\n const {\n disabled = false,\n type = \"default\",\n size = \"normal\",\n shape = \"round\",\n children,\n className,\n htmlType,\n formType,\n text,\n openType,\n lang,\n sessionFrom,\n sendMessageTitle,\n sendMessagePath,\n sendMessageImg,\n showMessageCard,\n appParameter,\n onGetUserInfo,\n onGetPhoneNumber,\n onOpenSetting,\n onError,\n onContact,\n onClick,\n preventTime = 2500,\n style,\n loading,\n loadingStyle,\n loadingSpace,\n ghost = false,\n hollow = false,\n } = props;\n const state = useTaroEnv();\n const [preventClick, setPreventClick] = useState(false);\n const timer = useRef<NodeJS.Timeout | undefined>();\n const classObj = classNames(\n \"xh-button\",\n {\n \"xh-button-default\": type === \"default\",\n \"xh-button-primary\": type === \"primary\",\n \"xh-button-secondary\": type === \"secondary\",\n \"xh-button-ghost\": ghost,\n \"xh-button-hollow\": hollow,\n \"xh-button-warn\": type === \"warn\",\n \"xh-button-square\": shape === \"square\",\n \"xh-button-round\": shape === \"round\",\n \"xh-button-rectangle\": shape === \"rectangle\",\n \"xh-button-normal\": size === \"normal\",\n \"xh-button-small\": size === \"mini\",\n \"xh-button-full\": size === \"full\",\n \"xh-button-disabled\": disabled,\n \"xh-button-webutton\": state === \"WEAPP\",\n },\n className\n );\n\n const handleClick: MouseEventHandler & TouchEventFunction = e => {\n state === \"WEB\" && e.nativeEvent.stopImmediatePropagation();\n e.preventDefault();\n\n if (preventClick && preventTime !== 0) {\n console.log(\"重复点击\");\n return;\n }\n if (preventTime !== 0) {\n timer.current = setTimeout(() => {\n setPreventClick(false);\n clearTimeout(timer.current);\n }, preventTime);\n }\n if (preventTime !== 0) setPreventClick(true);\n console.log(\"正常点击\");\n onClick && onClick(e);\n };\n\n useEffect(() => {\n return () => {\n clearTimeout(timer.current);\n };\n }, []);\n\n const weButton = (\n <Button\n className={classObj}\n formType={formType}\n openType={openType}\n lang={lang}\n type={type as ButtonProps[\"type\"]}\n sessionFrom={sessionFrom}\n sendMessageTitle={sendMessageTitle}\n sendMessagePath={sendMessagePath}\n sendMessageImg={sendMessageImg}\n showMessageCard={showMessageCard}\n appParameter={appParameter}\n onGetUserInfo={onGetUserInfo}\n onGetPhoneNumber={onGetPhoneNumber}\n onOpenSetting={onOpenSetting}\n onError={onError}\n onContact={onContact}\n onClick={handleClick}\n disabled={disabled}\n style={style}\n loading={loading}\n >\n {children}\n </Button>\n );\n\n if (state === \"WEAPP\") {\n return weButton;\n }\n\n return (\n // eslint-disable-next-line react/button-has-type\n <button\n className={classObj}\n disabled={disabled}\n type={htmlType}\n onClick={disabled ? undefined : handleClick}\n style={style}\n >\n {children || text}\n {loading && <DotJump style={loadingStyle} space={loadingSpace} />}\n </button>\n );\n};\n\nexport default XhButton;\n"],"names":["XhButton","props","_a","disabled","_b","type","_c","size","_d","shape","children","className","htmlType","formType","text","openType","lang","sessionFrom","sendMessageTitle","sendMessagePath","sendMessageImg","showMessageCard","appParameter","onGetUserInfo","onGetPhoneNumber","onOpenSetting","onError","onContact","onClick","_e","preventTime","style","loading","loadingStyle","loadingSpace","_f","ghost","_g","hollow","state","useTaroEnv","_h","__read","useState","preventClick","setPreventClick","timer","useRef","classObj","classNames","handleClick","e","nativeEvent","stopImmediatePropagation","preventDefault","current","setTimeout","clearTimeout","useEffect","weButton","React","Button","createElement","undefined","DotJump","space"],"mappings":"gRAqEM,IAAAA,EAA8B,SAAAC,GAEhC,IAAAC,EA8BED,EAAKE,SA9BPA,OAAQ,IAAAD,GAAQA,EAChBE,EA6BEH,OA7BFI,aAAO,UAASD,EAChBE,EA4BEL,EA5BaM,KAAfA,OAAO,IAAAD,EAAA,WACPE,EA2BEP,EA3BaQ,MAAfA,OAAQ,IAAAD,EAAA,UACRE,EA0BET,EAAKS,SAzBPC,EAyBEV,EAAKU,UAxBPC,EAwBEX,EAxBMW,SACRC,EAuBEZ,EAvBMY,SACRC,EAsBEb,OArBFc,EAqBEd,EAAKc,SApBPC,EAoBEf,EAAKe,KAnBPC,EAmBEhB,EAnBSgB,YACXC,EAkBEjB,mBAjBFkB,EAiBElB,EAAKkB,gBAhBPC,EAgBEnB,EAAKmB,eAfPC,EAeEpB,EAfaoB,gBACfC,EAcErB,EAdUqB,aACZC,EAaEtB,gBAZFuB,EAYEvB,EAAKuB,iBAXPC,EAWExB,EAAKwB,cAVPC,EAUEzB,EAVKyB,QACPC,EASE1B,YARF2B,EAQE3B,EAAK2B,QAPPC,EAOE5B,EAPgB6B,YAAlBA,OAAc,IAAAD,EAAA,OACdE,EAME9B,EAAK8B,MALPC,EAKE/B,EALK+B,QACPC,EAIEhC,eAHFiC,EAGEjC,eAFFkC,EAEElC,EAFWmC,MAAbA,OAAQ,IAAAD,KACRE,EACEpC,EADYqC,OAAdA,OAAS,IAAAD,KAELE,EAAQC,IACRC,EAAAC,EAAkCC,GAAS,GAAM,GAAhDC,EAAYH,EAAA,GAAEI,OACfC,EAAQC,IACRC,EAAWC,EACf,YACA,CACE,oBAA8B,YAAT5C,EACrB,oBAA8B,YAATA,EACrB,sBAAgC,cAATA,EACvB,kBAAmB+B,EACnB,mBAAoBE,EACpB,iBAA2B,SAATjC,EAClB,mBAA8B,WAAVI,EACpB,kBAA6B,UAAVA,EACnB,sBAAiC,cAAVA,EACvB,mBAA6B,WAATF,EACpB,kBAA4B,SAATA,EACnB,iBAA2B,SAATA,EAClB,qBAAsBJ,EACtB,qBAAgC,UAAVoC,GAExB5B,GAGIuC,EAAsD,SAAAC,GAChD,QAAVZ,GAAmBY,EAAEC,YAAYC,2BACjCF,EAAEG,iBAEEV,GAAgC,IAAhBd,IAIA,IAAhBA,IACFgB,EAAMS,QAAUC,YAAW,WACzBX,GAAgB,GAChBY,aAAaX,EAAMS,QACpB,GAAEzB,IAEe,IAAhBA,GAAmBe,GAAgB,GAEvCjB,GAAWA,EAAQuB,GACrB,EAEAO,GAAU,WACR,OAAO,WACLD,aAAaX,EAAMS,QACrB,CACD,GAAE,IAEH,IAAMI,GACJC,gBAACC,EAAM,CACLlD,UAAWqC,EACXnC,SAAUA,EACVE,SAAUA,EACVC,KAAMA,EACNX,KAAMA,EACNY,YAAaA,EACbC,iBAAkBA,EAClBC,gBAAiBA,EACjBC,eAAgBA,EAChBC,gBAAiBA,EACjBC,aAAcA,EACdC,cAAeA,EACfC,iBAAkBA,EAClBC,cAAeA,EACfC,QAASA,EACTC,UAAWA,EACXC,QAASsB,EACT/C,SAAUA,EACV4B,MAAOA,EACPC,QAASA,GAERtB,GAIL,MAAc,UAAV6B,EACKoB,GAKPC,EACEE,cAAA,SAAA,CAAAnD,UAAWqC,EACX7C,SAAUA,EACVE,KAAMO,EACNgB,QAASzB,OAAW4D,EAAYb,EAChCnB,MAAOA,GAENrB,GAAYI,EACZkB,GAAW4B,EAAAE,cAACE,EAAO,CAACjC,MAAOE,EAAcgC,MAAO/B,IAGvD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as t,__read as e,__assign as n}from"../node_modules/tslib/tslib.es6.js";import r,{forwardRef as a,useRef as c,useState as o,useImperativeHandle as i,useEffect as u,useMemo as l}from"react";import s from"classnames";import m from"../Button/index.js";var f=a((function(a,f){var v=a.timeout,d=void 0===v?59:v,h=a.text,p=void 0===h?"获取验证码":h,x=a.onClick,I=a.className,b=a.ingText,g=void 0===b?"s重新获取":b,k=a.onEnd,C=a.shape,E=void 0===C?"square":C,N=t(a,["timeout","text","onClick","className","ingText","onEnd","shape"]),j=c(),w=e(o(0),2),y=w[0],D=w[1],M=e(o(!1),2),T=M[0],q=M[1],B=function(){j.current&&clearInterval(j.current),D(0),q(!1)};i(f,(function(){return{reset:B,begin:z,beginning:T}}),[T]),u((function(){return j.current&&clearInterval(j.current),function(){j.current&&clearInterval(j.current)}}),[]);var _=l((function(){return y?"".concat(y).concat(g):p}),[y,p,g]),z=function(){var t=Date.now(),e=t;q(!0),j.current&&clearInterval(j.current),D(d),j.current=setInterval((function(){e=Date.now();var n=t+1e3*d+100,r=Math.max(Math.floor((n-e)/1e3),0);0===r&&(j.current&&clearInterval(j.current),q(!1),k&&k()),D(r)}),1e3)};return r.createElement(m,n({},a,{className:s("xh-captcha",I),disabled:T,onClick:function(){var t=x();t&&t.then&&t.then(z).catch((function(){q(!1)}))},type:"secondary",shape:E},N),_)}));export{f as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Captcha/index.tsx"],"sourcesContent":["import React, {\n useRef,\n useState,\n useEffect,\n useImperativeHandle,\n forwardRef,\n Ref,\n useMemo,\n} from \"react\";\nimport classnames from \"classnames\";\n\nimport Button, { XhButtonProps } from \"../Button\";\n\nimport \"./index.scss\";\n\nexport type refMe = {\n reset: () => void;\n begin: () => void;\n beginning: boolean;\n};\n\nexport interface CaptchaProps extends XhButtonProps {\n timeout?: number;\n className?: string;\n styleName?: string;\n text?: string;\n onClick: () => Promise<boolean>;\n ref: Ref<refMe>;\n timeingTemp?: string;\n ingText?: string;\n onEnd?: () => void;\n}\n\nconst CountdownButton = forwardRef<refMe, CaptchaProps>((props, fromRef) => {\n const {\n timeout = 59,\n text = \"获取验证码\",\n onClick,\n className,\n ingText = \"s重新获取\",\n onEnd,\n ...rest\n } = props;\n const intervalRef = useRef<NodeJS.Timeout | null>();\n const [time, setTime] = useState(0);\n const [disabled, setDisabled] = useState(false);\n\n const reset = (): void => {\n intervalRef.current && clearInterval(intervalRef.current);\n setTime(0);\n setDisabled(false);\n };\n\n useImperativeHandle(\n fromRef,\n () => ({\n reset,\n begin: counter,\n beginning: disabled,\n }),\n [disabled]\n );\n\n useEffect(() => {\n intervalRef.current && clearInterval(intervalRef.current);\n return () => {\n intervalRef.current && clearInterval(intervalRef.current);\n };\n }, []);\n\n // 倒计时\n const buttonText = useMemo((): string | number => {\n if (time) {\n return `${time}${ingText}`;\n }\n return text;\n }, [time, text, ingText]);\n\n const counter = () => {\n const now = Date.now();\n let nowStamp = now;\n\n setDisabled(true);\n\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n\n setTime(timeout);\n\n intervalRef.current = setInterval(() => {\n nowStamp = Date.now();\n const overTimeStamp = now + timeout * 1000 + 100;\n const leftTime = Math.max(\n Math.floor((overTimeStamp - nowStamp) / 1000),\n 0\n );\n\n if (leftTime === 0) {\n intervalRef.current && clearInterval(intervalRef.current);\n setDisabled(false);\n onEnd && onEnd();\n }\n\n setTime(leftTime);\n }, 1000);\n };\n\n const handleClick = (): any => {\n const promise = onClick();\n if (promise && promise.then) {\n promise.then(counter).catch(() => {\n console.log(\"callback reject....\");\n setDisabled(false);\n });\n }\n };\n\n return (\n <Button\n {...props}\n className={classnames(\"xh-captcha\", className)}\n disabled={disabled}\n onClick={handleClick}\n type=\"secondary\"\n shape
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Captcha/index.tsx"],"sourcesContent":["import React, {\n useRef,\n useState,\n useEffect,\n useImperativeHandle,\n forwardRef,\n Ref,\n useMemo,\n} from \"react\";\nimport classnames from \"classnames\";\n\nimport Button, { XhButtonProps } from \"../Button\";\n\nimport \"./index.scss\";\n\nexport type refMe = {\n reset: () => void;\n begin: () => void;\n beginning: boolean;\n};\n\nexport interface CaptchaProps extends XhButtonProps {\n timeout?: number;\n className?: string;\n styleName?: string;\n text?: string;\n onClick: () => Promise<boolean>;\n ref: Ref<refMe>;\n timeingTemp?: string;\n ingText?: string;\n onEnd?: () => void;\n}\n\nconst CountdownButton = forwardRef<refMe, CaptchaProps>((props, fromRef) => {\n const {\n timeout = 59,\n text = \"获取验证码\",\n onClick,\n className,\n ingText = \"s重新获取\",\n onEnd,\n shape = \"square\",\n ...rest\n } = props;\n const intervalRef = useRef<NodeJS.Timeout | null>();\n const [time, setTime] = useState(0);\n const [disabled, setDisabled] = useState(false);\n\n const reset = (): void => {\n intervalRef.current && clearInterval(intervalRef.current);\n setTime(0);\n setDisabled(false);\n };\n\n useImperativeHandle(\n fromRef,\n () => ({\n reset,\n begin: counter,\n beginning: disabled,\n }),\n [disabled]\n );\n\n useEffect(() => {\n intervalRef.current && clearInterval(intervalRef.current);\n return () => {\n intervalRef.current && clearInterval(intervalRef.current);\n };\n }, []);\n\n // 倒计时\n const buttonText = useMemo((): string | number => {\n if (time) {\n return `${time}${ingText}`;\n }\n return text;\n }, [time, text, ingText]);\n\n const counter = () => {\n const now = Date.now();\n let nowStamp = now;\n\n setDisabled(true);\n\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n\n setTime(timeout);\n\n intervalRef.current = setInterval(() => {\n nowStamp = Date.now();\n const overTimeStamp = now + timeout * 1000 + 100;\n const leftTime = Math.max(\n Math.floor((overTimeStamp - nowStamp) / 1000),\n 0\n );\n\n if (leftTime === 0) {\n intervalRef.current && clearInterval(intervalRef.current);\n setDisabled(false);\n onEnd && onEnd();\n }\n\n setTime(leftTime);\n }, 1000);\n };\n\n const handleClick = (): any => {\n const promise = onClick();\n if (promise && promise.then) {\n promise.then(counter).catch(() => {\n console.log(\"callback reject....\");\n setDisabled(false);\n });\n }\n };\n\n return (\n <Button\n {...props}\n className={classnames(\"xh-captcha\", className)}\n disabled={disabled}\n onClick={handleClick}\n type=\"secondary\"\n shape={shape}\n {...rest}\n >\n {buttonText}\n </Button>\n );\n});\nexport default CountdownButton;\n"],"names":["CountdownButton","forwardRef","props","fromRef","_a","timeout","_b","text","onClick","className","_c","ingText","onEnd","_d","shape","rest","__rest","intervalRef","useRef","_e","__read","useState","time","setTime","_f","disabled","setDisabled","reset","current","clearInterval","useImperativeHandle","begin","counter","beginning","useEffect","buttonText","useMemo","concat","now","Date","nowStamp","setInterval","overTimeStamp","leftTime","Math","max","floor","React","createElement","Button","__assign","classnames","promise","then","catch","type"],"mappings":"uQAiCA,IAAMA,EAAkBC,GAAgC,SAACC,EAAOC,GAE5D,IAAAC,EAQEF,EAAKG,QARPA,OAAU,IAAAD,EAAA,GAAEA,EACZE,EAOEJ,EAPYK,KAAdA,OAAO,IAAAD,EAAA,QAAOA,EACdE,EAMEN,EAAKM,QALPC,EAKEP,EALOO,UACTC,EAIER,EAAKS,QAJPA,OAAU,IAAAD,EAAA,QAAOA,EACjBE,EAGEV,EAAKU,MAFPC,EAEEX,EAAKY,MAFPA,OAAQ,IAAAD,EAAA,SAAQA,EACbE,EAAIC,EACLd,EATE,CASL,UAAA,OAAA,UAAA,YAAA,UAAA,QAAA,UACKe,EAAcC,IACdC,EAAAC,EAAkBC,EAAS,GAAE,GAA5BC,EAAIH,EAAA,GAAEI,OACPC,EAAAJ,EAA0BC,GAAS,GAAM,GAAxCI,EAAQD,EAAA,GAAEE,OAEXC,EAAQ,WACZV,EAAYW,SAAWC,cAAcZ,EAAYW,SACjDL,EAAQ,GACRG,GAAY,EACd,EAEAI,EACE3B,GACA,WAAM,MAAC,CACLwB,MAAKA,EACLI,MAAOC,EACPC,UAAWR,EACX,GACF,CAACA,IAGHS,GAAU,WAER,OADAjB,EAAYW,SAAWC,cAAcZ,EAAYW,SAC1C,WACLX,EAAYW,SAAWC,cAAcZ,EAAYW,QACnD,CACD,GAAE,IAGH,IAAMO,EAAaC,GAAQ,WACzB,OAAId,EACK,GAAGe,OAAAf,GAAOe,OAAA1B,GAEZJ,CACR,GAAE,CAACe,EAAMf,EAAMI,IAEVqB,EAAU,WACd,IAAMM,EAAMC,KAAKD,MACbE,EAAWF,EAEfZ,GAAY,GAERT,EAAYW,SACdC,cAAcZ,EAAYW,SAG5BL,EAAQlB,GAERY,EAAYW,QAAUa,aAAY,WAChCD,EAAWD,KAAKD,MAChB,IAAMI,EAAgBJ,EAAgB,IAAVjC,EAAiB,IACvCsC,EAAWC,KAAKC,IACpBD,KAAKE,OAAOJ,EAAgBF,GAAY,KACxC,GAGe,IAAbG,IACF1B,EAAYW,SAAWC,cAAcZ,EAAYW,SACjDF,GAAY,GACZd,GAASA,KAGXW,EAAQoB,EACT,GAAE,IACL,EAYA,OACEI,EAACC,cAAAC,EACKC,EAAA,CAAA,EAAAhD,GACJO,UAAW0C,EAAW,aAAc1C,GACpCgB,SAAUA,EACVjB,QAfgB,WAClB,IAAM4C,EAAU5C,IACZ4C,GAAWA,EAAQC,MACrBD,EAAQC,KAAKrB,GAASsB,OAAM,WAE1B5B,GAAY,EACd,GAEJ,EAQI6B,KAAK,YACLzC,MAAOA,GACHC,GAEHoB,EAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"react";import{View as l,Text as c}from"@tarojs/components";import a from"classnames";var t=function(t){var o=t.icon,r=t.value,n=t.extraIcon,s=t.arrow,i=t.border,m=void 0===i||i,d=t.onClick,p=t.className,u=t.outline,h=void 0===u||u,v=t.descriptionColor,x=void 0===v?"":v,E=t.valueColor,N=t.ellipsis,f=void 0===N||N,b=t.content,y=t.contentDescription,C=t.description,k=t.subDescription,w=t.secondary,D=t.alignItems,I=void 0===D?o?"start":"center":D,g=t.placeholder,j=void 0===g?"":g,q=a("xh-cell",{border:m},{secondary:w},{outline:h},I,p),z=a("xh-cell-main",{ellipsis:f});return e.createElement(l,{className:q,onClick:function(e){d&&d(e)}},o&&e.createElement(l,{className:"xh-cell-icon"},o),e.createElement(l,{className:z},b&&e.createElement(c,{className:"xh-cell-main-content"},b),y&&e.createElement(c,{className:"xh-cell-main-description"},y)),e.createElement(l,{className:"xh-cell-description",style:{color:x}},C?e.createElement(c,null,C):e.createElement(c,{className:"xh-cell-description-placeholder"},j),e.createElement(c,{className:"xh-cell-description-sub"},k)),e.createElement(l,{className:"xh-cell-value"},e.createElement(l,{className:"xh-cell-value-info",style:{color:E}},r),e.createElement(l,{className:"xh-cell-value-icon"},n||s&&e.createElement(l,{className:"arrow"}))))};export{t as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Cell/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport { View, Text, ITouchEvent } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHCellProps = {\n content?: ReactNode;\n contentDescription?: ReactNode;\n description?: ReactNode;\n subDescription?: ReactNode;\n icon?: ReactNode;\n value?: ReactNode;\n extraIcon?: ReactNode;\n border?: boolean;\n arrow?: boolean;\n outline?: boolean;\n onClick?: (e: ITouchEvent) => void;\n descriptionColor?: StandardLonghandProperties[\"color\"];\n valueColor?: StandardLonghandProperties[\"color\"];\n ellipsis?: boolean;\n placeholder?: string;\n alignItems?: \"start\" | \"center\" | \"end\";\n /**\n * @description 是否是次级列表\n */\n secondary?: boolean;\n} & XHComponentCommonProps;\n\nconst XHCell: FC<XHCellProps> = props => {\n const {\n icon,\n value,\n extraIcon,\n arrow,\n border = true,\n onClick,\n className,\n outline = true,\n descriptionColor = \"\",\n valueColor,\n ellipsis = true,\n content,\n contentDescription,\n description,\n subDescription,\n secondary,\n alignItems = icon ? \"start\" : \"center\",\n placeholder = \"\",\n } = props;\n\n const cellcls = classNames(\n \"xh-cell\",\n { border },\n { secondary },\n { outline },\n alignItems,\n className\n );\n\n const mainCls = classNames(\"xh-cell-main\", {\n ellipsis,\n });\n\n const handleClick = (e: ITouchEvent) => {\n onClick && onClick(e);\n };\n\n return (\n <View className={cellcls} onClick={handleClick}>\n {icon && <View className=\"xh-cell-icon\">{icon}</View>}\n <View className={mainCls}>\n {content && <Text className=\"xh-cell-main-content\">{content}</Text>}\n {contentDescription && (\n <Text className=\"xh-cell-main-description\">{contentDescription}</Text>\n )}\n </View>\n <View className=\"xh-cell-description\" style={{ color: descriptionColor }}>\n {description ? (\n <Text>{description}</Text>\n ) : (\n <Text className=\"xh-cell-description-placeholder\">{placeholder}</Text>\n )}\n <Text className=\"xh-cell-description-sub\">{subDescription}</Text>\n </View>\n <View className=\"xh-cell-value\">\n <View className=\"xh-cell-value-info\" style={{ color: valueColor }}>\n {value}\n </View>\n <View className=\"xh-cell-value-icon\">\n {extraIcon ? extraIcon : arrow && <View className=\"arrow\" />}\n </View>\n </View>\n </View>\n );\n};\nexport default XHCell;\n"],"names":["XHCell","props","icon","value","extraIcon","arrow","_a","border","onClick","className","_b","outline","_c","descriptionColor","valueColor","_d","ellipsis","content","contentDescription","description","subDescription","secondary","_e","alignItems","_f","placeholder","cellcls","classNames","mainCls","React","createElement","View","e","Text","style","color"],"mappings":"mGA+BM,IAAAA,EAA0B,SAAAC,GAE5B,IAAAC,EAkBED,EAlBEC,KACJC,EAiBEF,EAAKE,MAhBPC,EAgBEH,EAhBOG,UACTC,EAeEJ,EAAKI,MAdPC,EAcEL,EAAKM,OAdPA,OAAS,IAAAD,GAAIA,EACbE,EAaEP,EAbKO,QACPC,EAYER,EAAKQ,UAXPC,EAWET,EAAKU,QAXPA,OAAU,IAAAD,GAAIA,EACdE,EAUEX,EAVmBY,iBAArBA,OAAgB,IAAAD,EAAG,GAAEA,EACrBE,EASEb,aARFc,EAQEd,EAAKe,SARPA,OAAW,IAAAD,GAAIA,EACfE,EAOEhB,EAAKgB,QANPC,EAMEjB,EANgBiB,mBAClBC,EAKElB,EAAKkB,YAJPC,EAIEnB,EAJYmB,eACdC,EAGEpB,EAAKoB,UAFPC,EAEErB,EAAKsB,WAFPA,OAAa,IAAAD,EAAApB,EAAO,QAAU,SAAQoB,EACtCE,EACEvB,EADcwB,YAAhBA,OAAW,IAAAD,EAAG,GAAEA,EAGZE,EAAUC,EACd,UACA,CAAEpB,OAAMA,GACR,CAAEc,UAASA,GACX,CAAEV,QAAOA,GACTY,EACAd,GAGImB,EAAUD,EAAW,eAAgB,CACzCX,SAAQA,IAOV,OACEa,EAACC,cAAAC,EAAK,CAAAtB,UAAWiB,EAASlB,QALR,SAACwB,GACnBxB,GAAWA,EAAQwB,EACrB,GAIK9B,GAAQ2B,gBAACE,EAAI,CAACtB,UAAU,gBAAgBP,GACzC2B,EAAAC,cAACC,EAAI,CAACtB,UAAWmB,GACdX,GAAWY,gBAACI,EAAI,CAACxB,UAAU,wBAAwBQ,GACnDC,GACCW,EAACC,cAAAG,EAAK,CAAAxB,UAAU,4BAA4BS,IAGhDW,EAAAC,cAACC,EAAI,CAACtB,UAAU,sBAAsByB,MAAO,CAAEC,MAAOtB,IACnDM,EACCU,gBAACI,EAAI,KAAEd,GAEPU,EAACC,cAAAG,EAAK,CAAAxB,UAAU,mCAAmCgB,GAErDI,EAACC,cAAAG,GAAKxB,UAAU,2BAA2BW,IAE7CS,EAAAC,cAACC,EAAI,CAACtB,UAAU,iBACdoB,EAAAC,cAACC,EAAI,CAACtB,UAAU,qBAAqByB,MAAO,CAAEC,MAAOrB,IAClDX,GAEH0B,EAACC,cAAAC,EAAK,CAAAtB,UAAU,sBACbL,GAAwBC,GAASwB,EAAAC,cAACC,EAAI,CAACtB,UAAU,YAK5D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as e,__assign as t}from"../../node_modules/tslib/tslib.es6.js";import o,{createRef as n}from"react";import r from"react-dom";import{showModal as i}from"@tarojs/taro";import m from"../../DialogComponent/index.js";import c from"../../Button/index.js";var a=function(a){var f=a.title,l=void 0===f?"":f,s=a.content,d=a.confirmText,u=void 0===d?"知道了":d,p=e(a,["title","content","confirmText"]);return new Promise((function(e){if("h5"===process.env.TARO_ENV){var a=document.createElement("div"),f=n(),d=o.createElement(c,{ghost:!0,type:"default",shape:"rectangle",className:"xh-alert-button",onClick:function(){r.unmountComponentAtNode(a),e()}},u);r.render(o.createElement(m,{header:l,footer:d,content:s,visible:!0,ref:f}),a)}else i(t({title:l,content:s,showCancel:!1,confirmColor:"#fe5e00",confirmText:u},p)).then((function(){return e()}))}))};export{a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Dialog/Alert/index.tsx"],"sourcesContent":["import React, { createRef, ReactNode } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { showModal } from \"@tarojs/taro\";\nimport Dialog, { DialogRef } from \"../../DialogComponent\";\nimport Button from \"../../../../src/components/Button\";\n\nexport type AlertProps = {\n title?: string | ReactNode;\n content?: string | ReactNode;\n confirmText?: string | ReactNode;\n} & {\n /** 取消按钮的文字,最多 4 个字符 */\n cancelText?: string;\n /** 接口调用结束的回调函数(调用成功、失败都会执行) */\n complete?: (res: TaroGeneral.CallbackResult) => void;\n /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n confirmColor?: string;\n /** 确认按钮的文字,最多 4 个字符 */\n confirmText?: string;\n /** 提示的内容 */\n content?: string;\n /** 接口调用失败的回调函数 */\n fail?: (res: TaroGeneral.CallbackResult) => void;\n /** 接口调用成功的回调函数 */\n success?: () => void;\n /** 提示的标题 */\n title?: string;\n};\n\nconst Alert = (props: AlertProps): Promise<void> => {\n const { title = \"\", content, confirmText = \"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Dialog/Alert/index.tsx"],"sourcesContent":["import React, { createRef, ReactNode } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { showModal } from \"@tarojs/taro\";\nimport Dialog, { DialogRef } from \"../../DialogComponent\";\nimport Button from \"../../../../src/components/Button\";\n\nexport type AlertProps = {\n title?: string | ReactNode;\n content?: string | ReactNode;\n confirmText?: string | ReactNode;\n} & {\n /** 取消按钮的文字,最多 4 个字符 */\n cancelText?: string;\n /** 接口调用结束的回调函数(调用成功、失败都会执行) */\n complete?: (res: TaroGeneral.CallbackResult) => void;\n /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n confirmColor?: string;\n /** 确认按钮的文字,最多 4 个字符 */\n confirmText?: string;\n /** 提示的内容 */\n content?: string;\n /** 接口调用失败的回调函数 */\n fail?: (res: TaroGeneral.CallbackResult) => void;\n /** 接口调用成功的回调函数 */\n success?: () => void;\n /** 提示的标题 */\n title?: string;\n};\n\nconst Alert = (props: AlertProps): Promise<void> => {\n const { title = \"\", content, confirmText = \"知道了\", ...rest } = props;\n return new Promise(resolve => {\n if (process.env.TARO_ENV === \"h5\") {\n const div = document.createElement(\"div\");\n const dialogRef = createRef<DialogRef>();\n const alertFooter = (\n <Button\n ghost\n type=\"default\"\n shape=\"rectangle\"\n className=\"xh-alert-button\"\n onClick={() => {\n ReactDOM.unmountComponentAtNode(div);\n resolve();\n }}\n >\n {confirmText}\n </Button>\n );\n ReactDOM.render(\n <Dialog\n header={title}\n footer={alertFooter}\n content={content}\n visible\n ref={dialogRef}\n />,\n div\n );\n } else {\n showModal({\n title: title as string,\n content: content as string,\n showCancel: false,\n confirmColor: \"#fe5e00\",\n confirmText: confirmText as string,\n ...rest,\n }).then(() => resolve());\n }\n });\n};\n\nexport default Alert;\n"],"names":["Alert","props","_a","title","content","_b","confirmText","rest","__rest","Promise","resolve","process","env","TARO_ENV","div_1","document","createElement","dialogRef","createRef","alertFooter","React","Button","ghost","type","shape","className","onClick","ReactDOM","unmountComponentAtNode","render","Dialog","header","footer","visible","ref","showModal","__assign","showCancel","confirmColor","then"],"mappings":"uQA6BM,IAAAA,EAAQ,SAACC,GACL,IAAAC,EAAsDD,EAA5CE,MAAVA,OAAK,IAAAD,EAAG,GAAEA,EAAEE,EAA0CH,EAAnCG,QAAEC,EAAiCJ,EAAdK,YAAnBA,OAAW,IAAAD,EAAG,MAAKA,EAAKE,EAASC,EAAAP,EAAxD,CAAA,QAAA,UAAA,gBACN,OAAO,IAAIQ,SAAQ,SAAAC,GACjB,GAA6B,OAAzBC,QAAQC,IAAIC,SAAmB,CACjC,IAAMC,EAAMC,SAASC,cAAc,OAC7BC,EAAYC,IACZC,EACJC,EAAAJ,cAACK,EACC,CAAAC,SACAC,KAAK,UACLC,MAAM,YACNC,UAAU,kBACVC,QAAS,WACPC,EAASC,uBAAuBd,GAChCJ,GACF,GAECJ,GAGLqB,EAASE,OACPT,EAACJ,cAAAc,EACC,CAAAC,OAAQ5B,EACR6B,OAAQb,EACRf,QAASA,EACT6B,SACA,EAAAC,IAAKjB,IAEPH,EAEH,MACCqB,EACEC,EAAA,CAAAjC,MAAOA,EACPC,QAASA,EACTiC,YAAY,EACZC,aAAc,UACdhC,YAAaA,GACVC,IACFgC,MAAK,WAAM,OAAA7B,GAAA,GAElB,GACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import t,{createRef as n}from"react";import r from"react-dom";import{showModal as c}from"@tarojs/taro";import i from"../../DialogComponent/index.js";import m from"../../Button/index.js";var
|
|
1
|
+
import{__rest as e,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import t,{createRef as n}from"react";import r from"react-dom";import{showModal as c}from"@tarojs/taro";import i from"../../DialogComponent/index.js";import m from"../../Button/index.js";var a=function(a){var f=a.title,l=void 0===f?"":f,s=a.content,u=a.confirmText,d=void 0===u?"确定":u,p=a.cancelText,x=void 0===p?"取消":p,h=e(a,["title","content","confirmText","cancelText"]);return new Promise((function(e){if("h5"===process.env.TARO_ENV){var a=document.createElement("div"),f=n(),u=t.createElement("div",{className:"xh-confirm-footer"},t.createElement(m,{ghost:!0,type:"default",shape:"rectangle",className:"xh-confirm-footer-button xh-confirm-footer-cancel-button",onClick:function(){r.unmountComponentAtNode(a),e({errMsg:"ok",confirm:!1,cancel:!0})}},x),t.createElement(m,{ghost:!0,type:"primary",shape:"rectangle",className:"xh-confirm-footer-button xh-confirm-footer-confirm-button",onClick:function(){r.unmountComponentAtNode(a),e({errMsg:"ok",confirm:!0,cancel:!1})}},d));r.render(t.createElement(i,{header:l,footer:u,content:s,visible:!0,ref:f}),a)}else c(o({title:l,content:s,confirmColor:"#f6ab00",cancelText:x,cancelColor:"#666",confirmText:d},h)).then(e)}))};export{a as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Dialog/Confirm/index.tsx"],"sourcesContent":["import React, { createRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { showModal } from \"@tarojs/taro\";\nimport DialogComponent, { DialogRef } from \"../../DialogComponent\";\nimport Button from \"../../Button\";\n\nexport type ConfirmProps = {\n title?: string;\n header?: string;\n content: string;\n cancelText?: string;\n confirmText?: string;\n} & {\n /** 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n cancelColor?: string;\n /** 取消按钮的文字,最多 4 个字符 */\n cancelText?: string;\n /** 接口调用结束的回调函数(调用成功、失败都会执行) */\n complete?: (res: TaroGeneral.CallbackResult) => void;\n /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n confirmColor?: string;\n /** 确认按钮的文字,最多 4 个字符 */\n confirmText?: string;\n /** 提示的内容 */\n content?: string;\n /** 接口调用失败的回调函数 */\n fail?: (res: TaroGeneral.CallbackResult) => void;\n /** 接口调用成功的回调函数 */\n success?: (result: ConfirmPropsResult) => void;\n /** 提示的标题 */\n title?: string;\n};\n\nexport type ConfirmPropsResult = {\n /** 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */\n cancel: boolean;\n /** 为 true 时,表示用户点击了确定按钮 */\n confirm: boolean;\n /** 调用结果 */\n errMsg: string;\n};\nconst Comfirm = (props: ConfirmProps): Promise<ConfirmPropsResult> => {\n const {\n title = \"\",\n content,\n confirmText = \"确定\",\n cancelText = \"取消\",\n ...rest\n } = props;\n return new Promise(resolve => {\n if (process.env.TARO_ENV === \"h5\") {\n const div = document.createElement(\"div\");\n\n const dialogRef = createRef<DialogRef>();\n const alertFooter = (\n <div className=\"xh-confirm-footer\">\n <Button\n className=\"xh-confirm-footer-button xh-confirm-footer-cancel-button\"\n onClick={() => {\n ReactDOM.unmountComponentAtNode(div);\n resolve({ errMsg: \"ok\", confirm: false, cancel: true });\n }}\n >\n {cancelText}\n </Button>\n <Button\n type=\"primary\"\n className=\"xh-confirm-footer-button xh-confirm-footer-confirm-button\"\n onClick={() => {\n ReactDOM.unmountComponentAtNode(div);\n resolve({ errMsg: \"ok\", confirm: true, cancel: false });\n }}\n >\n {confirmText}\n </Button>\n </div>\n );\n ReactDOM.render(\n <DialogComponent\n header={title}\n footer={alertFooter}\n content={content}\n visible\n ref={dialogRef}\n />,\n div\n );\n } else {\n showModal({\n title,\n content,\n confirmColor: \"#f6ab00\",\n cancelText,\n cancelColor: \"#666\",\n confirmText,\n ...rest,\n }).then(resolve);\n }\n });\n};\n\nexport default Comfirm;\n"],"names":["Comfirm","props","_a","title","content","_b","confirmText","_c","cancelText","rest","__rest","Promise","resolve","process","env","TARO_ENV","div_1","document","createElement","dialogRef","createRef","alertFooter","React","className","Button","onClick","ReactDOM","unmountComponentAtNode","errMsg","confirm","cancel","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Dialog/Confirm/index.tsx"],"sourcesContent":["import React, { createRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { showModal } from \"@tarojs/taro\";\nimport DialogComponent, { DialogRef } from \"../../DialogComponent\";\nimport Button from \"../../Button\";\n\nexport type ConfirmProps = {\n title?: string;\n header?: string;\n content: string;\n cancelText?: string;\n confirmText?: string;\n} & {\n /** 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n cancelColor?: string;\n /** 取消按钮的文字,最多 4 个字符 */\n cancelText?: string;\n /** 接口调用结束的回调函数(调用成功、失败都会执行) */\n complete?: (res: TaroGeneral.CallbackResult) => void;\n /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */\n confirmColor?: string;\n /** 确认按钮的文字,最多 4 个字符 */\n confirmText?: string;\n /** 提示的内容 */\n content?: string;\n /** 接口调用失败的回调函数 */\n fail?: (res: TaroGeneral.CallbackResult) => void;\n /** 接口调用成功的回调函数 */\n success?: (result: ConfirmPropsResult) => void;\n /** 提示的标题 */\n title?: string;\n};\n\nexport type ConfirmPropsResult = {\n /** 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */\n cancel: boolean;\n /** 为 true 时,表示用户点击了确定按钮 */\n confirm: boolean;\n /** 调用结果 */\n errMsg: string;\n};\nconst Comfirm = (props: ConfirmProps): Promise<ConfirmPropsResult> => {\n const {\n title = \"\",\n content,\n confirmText = \"确定\",\n cancelText = \"取消\",\n ...rest\n } = props;\n return new Promise(resolve => {\n if (process.env.TARO_ENV === \"h5\") {\n const div = document.createElement(\"div\");\n\n const dialogRef = createRef<DialogRef>();\n const alertFooter = (\n <div className=\"xh-confirm-footer\">\n <Button\n ghost\n type=\"default\"\n shape=\"rectangle\"\n className=\"xh-confirm-footer-button xh-confirm-footer-cancel-button\"\n onClick={() => {\n ReactDOM.unmountComponentAtNode(div);\n resolve({ errMsg: \"ok\", confirm: false, cancel: true });\n }}\n >\n {cancelText}\n </Button>\n <Button\n ghost\n type=\"primary\"\n shape=\"rectangle\"\n className=\"xh-confirm-footer-button xh-confirm-footer-confirm-button\"\n onClick={() => {\n ReactDOM.unmountComponentAtNode(div);\n resolve({ errMsg: \"ok\", confirm: true, cancel: false });\n }}\n >\n {confirmText}\n </Button>\n </div>\n );\n ReactDOM.render(\n <DialogComponent\n header={title}\n footer={alertFooter}\n content={content}\n visible\n ref={dialogRef}\n />,\n div\n );\n } else {\n showModal({\n title,\n content,\n confirmColor: \"#f6ab00\",\n cancelText,\n cancelColor: \"#666\",\n confirmText,\n ...rest,\n }).then(resolve);\n }\n });\n};\n\nexport default Comfirm;\n"],"names":["Comfirm","props","_a","title","content","_b","confirmText","_c","cancelText","rest","__rest","Promise","resolve","process","env","TARO_ENV","div_1","document","createElement","dialogRef","createRef","alertFooter","React","className","Button","ghost","type","shape","onClick","ReactDOM","unmountComponentAtNode","errMsg","confirm","cancel","render","DialogComponent","header","footer","visible","ref","showModal","__assign","confirmColor","cancelColor","then"],"mappings":"uQAyCM,IAAAA,EAAU,SAACC,GAEb,IAAAC,EAKED,EAAKE,MALPA,aAAQ,GAAED,EACVE,EAIEH,EAAKG,QAHPC,EAGEJ,cAHFK,OAAc,IAAAD,EAAA,OACdE,EAEEN,EAAKO,WAFPA,OAAU,IAAAD,EAAG,KAAIA,EACdE,EAAIC,EACLT,EANE,CAAA,QAAA,UAAA,cAAA,eAON,OAAO,IAAIU,SAAQ,SAAAC,GACjB,GAA6B,OAAzBC,QAAQC,IAAIC,SAAmB,CACjC,IAAMC,EAAMC,SAASC,cAAc,OAE7BC,EAAYC,IACZC,EACJC,EAAKJ,cAAA,MAAA,CAAAK,UAAU,qBACbD,EAAAJ,cAACM,EACC,CAAAC,OACA,EAAAC,KAAK,UACLC,MAAM,YACNJ,UAAU,2DACVK,QAAS,WACPC,EAASC,uBAAuBd,GAChCJ,EAAQ,CAAEmB,OAAQ,KAAMC,SAAS,EAAOC,QAAQ,GACjD,GAEAzB,GAEHc,EAAAJ,cAACM,EACC,CAAAC,OACA,EAAAC,KAAK,UACLC,MAAM,YACNJ,UAAU,4DACVK,QAAS,WACPC,EAASC,uBAAuBd,GAChCJ,EAAQ,CAAEmB,OAAQ,KAAMC,SAAS,EAAMC,QAAQ,GACjD,GAEC3B,IAIPuB,EAASK,OACPZ,EAACJ,cAAAiB,EACC,CAAAC,OAAQjC,EACRkC,OAAQhB,EACRjB,QAASA,EACTkC,SACA,EAAAC,IAAKpB,IAEPH,EAEH,MACCwB,EACEC,EAAA,CAAAtC,MAAKA,EACLC,QAAOA,EACPsC,aAAc,UACdlC,WAAUA,EACVmC,YAAa,OACbrC,YAAWA,GACRG,IACFmC,KAAKhC,EAEZ,GACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/DialogComponent/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport ReactDOM from \"react-dom\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\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?: string | ReactNode;\n visible: boolean;\n} & XHComponentCommonProps;\n\nexport type DialogRef = {\n close: () => void;\n};\nconst DialogCom = forwardRef<DialogRef, DialogProps>((props, fromRef) => {\n const { header, content, footer, className = \"\", visible } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close: () => {\n console.log(\"closes\");\n setSelfVisible(false);\n },\n }));\n\n useEffect(() => {\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog\", className, {\n microApp: process.env.TARO_ENV !== \"h5\",\n });\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/DialogComponent/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useState,\n useImperativeHandle,\n forwardRef,\n useEffect,\n} from \"react\";\nimport ReactDOM from \"react-dom\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\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?: string | ReactNode;\n visible: boolean;\n} & XHComponentCommonProps;\n\nexport type DialogRef = {\n close: () => void;\n};\nconst DialogCom = forwardRef<DialogRef, DialogProps>((props, fromRef) => {\n const { header, content, footer, className = \"\", visible } = props;\n const [selfVisible, setSelfVisible] = useState(false);\n\n useImperativeHandle(fromRef, () => ({\n close: () => {\n console.log(\"closes\");\n setSelfVisible(false);\n },\n }));\n\n useEffect(() => {\n setSelfVisible(visible);\n }, [visible]);\n\n const dialogcls = classNames(\"xh-dialog\", className, {\n microApp: process.env.TARO_ENV !== \"h5\",\n });\n\n const dialogContent = classNames(\"xh-dialog-content-content\", {\n headless: !header,\n });\n const DialogMain = (\n <View className={dialogcls}>\n <Mask />\n <CSSTransition\n in={selfVisible}\n timeout={200}\n classNames=\"scale\"\n unmountOnExit\n >\n <View className=\"xh-dialog-content\">\n <View className=\"xh-dialog-content-header\">{header}</View>\n <View className={dialogContent}>{content}</View>\n <View className=\"xh-dialog-content-footer\">{footer}</View>\n </View>\n </CSSTransition>\n </View>\n );\n\n return ReactDOM.createPortal(DialogMain, document.body);\n});\n\nexport default DialogCom;\n"],"names":["DialogCom","forwardRef","props","fromRef","header","content","footer","_a","className","visible","_b","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","useEffect","dialogcls","classNames","microApp","process","env","TARO_ENV","dialogContent","headless","DialogMain","React","createElement","View","Mask","CSSTransition","in","timeout","unmountOnExit","ReactDOM","createPortal","document","body"],"mappings":"gWAyBA,IAAMA,EAAYC,GAAmC,SAACC,EAAOC,GACnD,IAAAC,EAAqDF,EAAKE,OAAlDC,EAA6CH,EAAtCG,QAAEC,EAAoCJ,EAAKI,OAAjCC,EAA4BL,EAAKM,UAAjCA,OAAY,IAAAD,EAAA,GAAEA,EAAEE,EAAYP,EAAKO,QAC5DC,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBZ,GAAS,WAAM,MAAC,CAClCa,MAAO,WAELF,GAAe,EAChB,EACD,IAEFG,GAAU,WACRH,EAAeL,EACjB,GAAG,CAACA,IAEJ,IAAMS,EAAYC,EAAW,YAAaX,EAAW,CACnDY,SAAmC,OAAzBC,QAAQC,IAAIC,WAGlBC,EAAgBL,EAAW,4BAA6B,CAC5DM,UAAWrB,IAEPsB,EACJC,EAAAC,cAACC,EAAK,CAAArB,UAAWU,GACfS,EAAAC,cAACE,EAAO,MACRH,EAAAC,cAACG,EAAa,CACZC,GAAInB,EACJoB,QAAS,IACTd,WAAW,QACXe,eAAa,GAEbP,EAAAC,cAACC,EAAI,CAACrB,UAAU,qBACdmB,EAAAC,cAACC,EAAK,CAAArB,UAAU,4BAA4BJ,GAC5CuB,EAAAC,cAACC,EAAK,CAAArB,UAAWgB,GAAgBnB,GACjCsB,EAAAC,cAACC,EAAI,CAACrB,UAAU,4BAA4BF,MAMpD,OAAO6B,EAASC,aAAaV,EAAYW,SAASC,KACpD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__read as e
|
|
1
|
+
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as o,useState as n,useImperativeHandle as a,useEffect as r}from"react";import s from"classnames";import{View as c}from"@tarojs/components";import l from"../Button/index.js";import i from"../Mask/index.js";import m from"../node_modules/react-transition-group/esm/CSSTransition.js";var f=o((function(o,f){var d=o.header,u=o.content,p=o.className,h=void 0===p?"":p,g=o.visible,v=o.showCancel,x=void 0===v||v,E=o.confirmText,N=void 0===E?"确定":E,C=o.cancelText,b=void 0===C?"取消":C,j=o.footer,T=void 0!==j&&j,k=o.onConfirm,w=o.onCancel,y=o.onClose,z=o.tranparent,S=void 0!==z&&z,_=e(n(!1),2),B=_[0],M=_[1];a(f,(function(){return{close:q,open:A}}));var q=function(){y&&y(),M(!1)},A=function(){M(!0)};r((function(){g||y&&y(),M(g)}),[g]);var D=s("xh-dialog-ref",h,{show:B}),F=t.createElement(c,{className:"xh-dialog-ref-content-footer-buttons"},x&&t.createElement(l,{ghost:!0,size:"full",shape:"rectangle",preventTime:0,onClick:function(){w&&w(),q()},className:"xh-dialog-ref-content-footer-buttons-cancel"},b),t.createElement(l,{type:"primary",shape:"rectangle",size:"full",ghost:!0,className:"xh-dialog-ref-content-footer-buttons--confirm",onClick:function(){k&&k()},preventTime:0},N));return t.createElement(c,{className:D},t.createElement(i,null),t.createElement(m,{in:B,timeout:200,classNames:"scale"},t.createElement(c,{className:s("xh-dialog-ref-content",{tranparent:S})},d&&t.createElement(c,{className:"xh-dialog-ref-content-header"},d),t.createElement(c,{className:"xh-dialog-ref-content-content"},u),T||t.createElement(c,{className:"xh-dialog-ref-content-footer"},F))))}));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} from \"react\";\nimport classNames from \"classnames\";\nimport { View } from \"@tarojs/components\";\nimport { CSSTransition } from \"react-transition-group\";\nimport Button
|
|
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 tranparent?: boolean;\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 tranparent = false,\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\n const dialogFooter = (\n <View className=\"xh-dialog-ref-content-footer-buttons\">\n {showCancel && (\n <Button\n ghost\n size=\"full\"\n shape=\"rectangle\"\n preventTime={0}\n onClick={handleCancel}\n className=\"xh-dialog-ref-content-footer-buttons-cancel\"\n >\n {cancelText}\n </Button>\n )}\n <Button\n type=\"primary\"\n shape=\"rectangle\"\n size=\"full\"\n ghost\n className=\"xh-dialog-ref-content-footer-buttons--confirm\"\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={classNames(\"xh-dialog-ref-content\", { tranparent })}>\n {header && (\n <View className=\"xh-dialog-ref-content-header\">{header}</View>\n )}\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","tranparent","_g","__read","useState","selfVisible","setSelfVisible","useImperativeHandle","close","open","useEffect","dialogcls","classNames","show","dialogFooter","React","createElement","View","Button","ghost","size","shape","preventTime","onClick","type","Mask","CSSTransition","in","timeout"],"mappings":"yWAiCA,IAAMA,EAAYC,GAAoC,SAACC,EAAOC,GAE1D,IAAAC,EAYEF,EAZIE,OACNC,EAWEH,EAXKG,QACPC,EAUEJ,EAAKK,UAVPA,OAAS,IAAAD,EAAG,GAAEA,EACdE,EASEN,EATKM,QACPC,EAQEP,EAAKQ,WARPA,OAAU,IAAAD,GAAOA,EACjBE,EAOET,cAPFU,aAAc,KAAID,EAClBE,EAMEX,EANeY,WAAjBA,OAAa,IAAAD,EAAA,OACbE,EAKEb,EAAKc,OALPA,OAAM,IAAAD,GAAQA,EACdE,EAIEf,EAJOe,UACTC,EAGEhB,WAFFiB,EAEEjB,EAAKiB,QADPC,EACElB,EADgBmB,WAAlBA,OAAa,IAAAD,KAETE,EAAAC,EAAgCC,GAAS,GAAM,GAA9CC,EAAWH,EAAA,GAAEI,OAEpBC,EAAoBxB,GAAS,WAAM,MAAC,CAClCyB,MAAKA,EACLC,KAAIA,EACJ,IAEF,IAAMD,EAAQ,WACZT,GAAWA,IACXO,GAAe,EACjB,EAEMG,EAAO,WACXH,GAAe,EACjB,EAWAI,GAAU,WACHtB,GACHW,GAAWA,IAEbO,EAAelB,EACjB,GAAG,CAACA,IAEJ,IAAMuB,EAAYC,EAAW,gBAAiBzB,EAAW,CACvD0B,KAAMR,IAGFS,EACJC,EAAAC,cAACC,EAAK,CAAA9B,UAAU,wCACbG,GACCyB,EAACC,cAAAE,EACC,CAAAC,OACA,EAAAC,KAAK,OACLC,MAAM,YACNC,YAAa,EACbC,QAxBa,WACnBzB,GAAYA,IACZU,GACF,EAsBQrB,UAAU,+CAETO,GAGLqB,EAAAC,cAACE,EAAM,CACLM,KAAK,UACLH,MAAM,YACND,KAAK,OACLD,OAAK,EACLhC,UAAU,gDACVoC,QAxCgB,WACpB1B,GAAaA,GAEf,EAsCMyB,YAAa,GAEZ9B,IAqBP,OAfEuB,EAAAC,cAACC,EAAK,CAAA9B,UAAWwB,GACfI,EAAAC,cAACS,EAAO,MACRV,EAAAC,cAACU,EAAa,CAACC,GAAItB,EAAauB,QAAS,IAAKhB,WAAW,SACvDG,EAAAC,cAACC,EAAI,CAAC9B,UAAWyB,EAAW,wBAAyB,CAAEX,WAAUA,KAC9DjB,GACC+B,EAAAC,cAACC,EAAI,CAAC9B,UAAU,gCAAgCH,GAElD+B,EAAAC,cAACC,EAAK,CAAA9B,UAAU,iCAAiCF,GAChDW,GACCmB,EAAAC,cAACC,EAAI,CAAC9B,UAAU,gCAAgC2B,KAO5D"}
|