taro-ui 3.3.0 → 3.3.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.
Files changed (415) hide show
  1. package/LICENSE +21 -0
  2. package/lib/common/component.d.ts +10 -0
  3. package/lib/common/component.js +27 -28
  4. package/lib/common/component.js.map +1 -1
  5. package/lib/common/utils.d.ts +41 -0
  6. package/lib/common/utils.js +169 -192
  7. package/lib/common/utils.js.map +1 -1
  8. package/lib/components/accordion/index.d.ts +14 -0
  9. package/lib/components/accordion/index.js +111 -106
  10. package/lib/components/accordion/index.js.map +1 -1
  11. package/lib/components/action-sheet/body/index.d.ts +5 -0
  12. package/lib/components/action-sheet/body/index.js +11 -8
  13. package/lib/components/action-sheet/body/index.js.map +1 -1
  14. package/lib/components/action-sheet/body/item/index.d.ts +9 -0
  15. package/lib/components/action-sheet/body/item/index.js +21 -18
  16. package/lib/components/action-sheet/body/item/index.js.map +1 -1
  17. package/lib/components/action-sheet/footer/index.d.ts +9 -0
  18. package/lib/components/action-sheet/footer/index.js +24 -18
  19. package/lib/components/action-sheet/footer/index.js.map +1 -1
  20. package/lib/components/action-sheet/header/index.d.ts +5 -0
  21. package/lib/components/action-sheet/header/index.js +14 -8
  22. package/lib/components/action-sheet/header/index.js.map +1 -1
  23. package/lib/components/action-sheet/index.d.ts +14 -0
  24. package/lib/components/action-sheet/index.js +69 -64
  25. package/lib/components/action-sheet/index.js.map +1 -1
  26. package/lib/components/activity-indicator/index.d.ts +8 -0
  27. package/lib/components/activity-indicator/index.js +33 -29
  28. package/lib/components/activity-indicator/index.js.map +1 -1
  29. package/lib/components/avatar/index.d.ts +9 -0
  30. package/lib/components/avatar/index.js +58 -50
  31. package/lib/components/avatar/index.js.map +1 -1
  32. package/lib/components/badge/index.d.ts +10 -0
  33. package/lib/components/badge/index.js +44 -35
  34. package/lib/components/badge/index.js.map +1 -1
  35. package/lib/components/button/index.d.ts +15 -0
  36. package/lib/components/button/index.js +165 -113
  37. package/lib/components/button/index.js.map +1 -1
  38. package/lib/components/calendar/body/index.d.ts +26 -0
  39. package/lib/components/calendar/body/index.js +279 -183
  40. package/lib/components/calendar/body/index.js.map +1 -1
  41. package/lib/components/calendar/common/constant.d.ts +3 -0
  42. package/lib/components/calendar/common/constant.js +8 -3
  43. package/lib/components/calendar/common/constant.js.map +1 -1
  44. package/lib/components/calendar/common/helper.d.ts +4 -0
  45. package/lib/components/calendar/common/helper.js +77 -76
  46. package/lib/components/calendar/common/helper.js.map +1 -1
  47. package/lib/components/calendar/common/plugins.d.ts +11 -0
  48. package/lib/components/calendar/common/plugins.js +50 -66
  49. package/lib/components/calendar/common/plugins.js.map +1 -1
  50. package/lib/components/calendar/controller/index.d.ts +5 -0
  51. package/lib/components/calendar/controller/index.js +49 -28
  52. package/lib/components/calendar/controller/index.js.map +1 -1
  53. package/lib/components/calendar/index.d.ts +20 -0
  54. package/lib/components/calendar/index.js +233 -196
  55. package/lib/components/calendar/index.js.map +1 -1
  56. package/lib/components/calendar/ui/date-list/index.d.ts +12 -0
  57. package/lib/components/calendar/ui/date-list/index.js +50 -39
  58. package/lib/components/calendar/ui/date-list/index.js.map +1 -1
  59. package/lib/components/calendar/ui/day-list/index.d.ts +4 -0
  60. package/lib/components/calendar/ui/day-list/index.js +9 -14
  61. package/lib/components/calendar/ui/day-list/index.js.map +1 -1
  62. package/lib/components/card/index.d.ts +9 -0
  63. package/lib/components/card/index.js +73 -52
  64. package/lib/components/card/index.js.map +1 -1
  65. package/lib/components/checkbox/index.d.ts +9 -0
  66. package/lib/components/checkbox/index.js +52 -48
  67. package/lib/components/checkbox/index.js.map +1 -1
  68. package/lib/components/countdown/index.d.ts +20 -0
  69. package/lib/components/countdown/index.js +140 -125
  70. package/lib/components/countdown/index.js.map +1 -1
  71. package/lib/components/countdown/item/index.d.ts +9 -0
  72. package/lib/components/countdown/item/index.js +18 -18
  73. package/lib/components/countdown/item/index.js.map +1 -1
  74. package/lib/components/curtain/index.d.ts +10 -0
  75. package/lib/components/curtain/index.js +56 -39
  76. package/lib/components/curtain/index.js.map +1 -1
  77. package/lib/components/divider/index.d.ts +8 -0
  78. package/lib/components/divider/index.js +51 -34
  79. package/lib/components/divider/index.js.map +1 -1
  80. package/lib/components/drawer/index.d.ts +16 -0
  81. package/lib/components/drawer/index.js +106 -85
  82. package/lib/components/drawer/index.js.map +1 -1
  83. package/lib/components/fab/index.d.ts +9 -0
  84. package/lib/components/fab/index.js +22 -19
  85. package/lib/components/fab/index.js.map +1 -1
  86. package/lib/components/flex/index.d.ts +7 -0
  87. package/lib/components/flex/index.js +37 -34
  88. package/lib/components/flex/index.js.map +1 -1
  89. package/lib/components/flex/item/index.d.ts +7 -0
  90. package/lib/components/flex/item/index.js +30 -27
  91. package/lib/components/flex/item/index.js.map +1 -1
  92. package/lib/components/float-layout/index.d.ts +13 -0
  93. package/lib/components/float-layout/index.js +96 -68
  94. package/lib/components/float-layout/index.js.map +1 -1
  95. package/lib/components/form/index.d.ts +10 -0
  96. package/lib/components/form/index.js +37 -24
  97. package/lib/components/form/index.js.map +1 -1
  98. package/lib/components/grid/index.d.ts +9 -0
  99. package/lib/components/grid/index.js +92 -62
  100. package/lib/components/grid/index.js.map +1 -1
  101. package/lib/components/icon/index.d.ts +9 -0
  102. package/lib/components/icon/index.js +48 -31
  103. package/lib/components/icon/index.js.map +1 -1
  104. package/lib/components/image-picker/index.d.ts +11 -0
  105. package/lib/components/image-picker/index.js +152 -126
  106. package/lib/components/image-picker/index.js.map +1 -1
  107. package/lib/components/indexes/index.d.ts +29 -0
  108. package/lib/components/indexes/index.js +255 -198
  109. package/lib/components/indexes/index.js.map +1 -1
  110. package/lib/components/input/index.d.ts +17 -0
  111. package/lib/components/input/index.js +224 -160
  112. package/lib/components/input/index.js.map +1 -1
  113. package/lib/components/input-number/index.d.ts +13 -0
  114. package/lib/components/input-number/index.js +180 -152
  115. package/lib/components/input-number/index.js.map +1 -1
  116. package/lib/components/list/index.d.ts +8 -0
  117. package/lib/components/list/index.js +20 -13
  118. package/lib/components/list/index.js.map +1 -1
  119. package/lib/components/list/item/index.d.ts +11 -0
  120. package/lib/components/list/item/index.js +146 -99
  121. package/lib/components/list/item/index.js.map +1 -1
  122. package/lib/components/load-more/index.d.ts +9 -0
  123. package/lib/components/load-more/index.js +65 -41
  124. package/lib/components/load-more/index.js.map +1 -1
  125. package/lib/components/loading/index.d.ts +12 -0
  126. package/lib/components/loading/index.js +26 -26
  127. package/lib/components/loading/index.js.map +1 -1
  128. package/lib/components/message/index.d.ts +15 -0
  129. package/lib/components/message/index.js +72 -63
  130. package/lib/components/message/index.js.map +1 -1
  131. package/lib/components/modal/action/index.d.ts +8 -0
  132. package/lib/components/modal/action/index.js +20 -14
  133. package/lib/components/modal/action/index.js.map +1 -1
  134. package/lib/components/modal/content/index.d.ts +5 -0
  135. package/lib/components/modal/content/index.js +11 -8
  136. package/lib/components/modal/content/index.js.map +1 -1
  137. package/lib/components/modal/header/index.d.ts +5 -0
  138. package/lib/components/modal/header/index.js +11 -8
  139. package/lib/components/modal/header/index.js.map +1 -1
  140. package/lib/components/modal/index.d.ts +15 -0
  141. package/lib/components/modal/index.js +96 -87
  142. package/lib/components/modal/index.js.map +1 -1
  143. package/lib/components/nav-bar/index.d.ts +12 -0
  144. package/lib/components/nav-bar/index.js +210 -98
  145. package/lib/components/nav-bar/index.js.map +1 -1
  146. package/lib/components/noticebar/index.d.ts +16 -0
  147. package/lib/components/noticebar/index.js +177 -154
  148. package/lib/components/noticebar/index.js.map +1 -1
  149. package/lib/components/pagination/index.d.ts +12 -0
  150. package/lib/components/pagination/index.js +133 -102
  151. package/lib/components/pagination/index.js.map +1 -1
  152. package/lib/components/progress/index.d.ts +7 -0
  153. package/lib/components/progress/index.js +48 -40
  154. package/lib/components/progress/index.js.map +1 -1
  155. package/lib/components/radio/index.d.ts +9 -0
  156. package/lib/components/radio/index.js +48 -37
  157. package/lib/components/radio/index.js.map +1 -1
  158. package/lib/components/range/index.d.ts +22 -0
  159. package/lib/components/range/index.js +197 -142
  160. package/lib/components/range/index.js.map +1 -1
  161. package/lib/components/rate/index.d.ts +9 -0
  162. package/lib/components/rate/index.js +74 -48
  163. package/lib/components/rate/index.js.map +1 -1
  164. package/lib/components/search-bar/index.d.ts +16 -0
  165. package/lib/components/search-bar/index.js +167 -112
  166. package/lib/components/search-bar/index.js.map +1 -1
  167. package/lib/components/segmented-control/index.d.ts +9 -0
  168. package/lib/components/segmented-control/index.js +78 -53
  169. package/lib/components/segmented-control/index.js.map +1 -1
  170. package/lib/components/slider/index.d.ts +13 -0
  171. package/lib/components/slider/index.js +107 -69
  172. package/lib/components/slider/index.js.map +1 -1
  173. package/lib/components/steps/index.d.ts +9 -0
  174. package/lib/components/steps/index.js +61 -44
  175. package/lib/components/steps/index.js.map +1 -1
  176. package/lib/components/swipe-action/index.d.ts +27 -0
  177. package/lib/components/swipe-action/index.js +206 -157
  178. package/lib/components/swipe-action/index.js.map +1 -1
  179. package/lib/components/swipe-action/options/index.d.ts +5 -0
  180. package/lib/components/swipe-action/options/index.js +22 -8
  181. package/lib/components/swipe-action/options/index.js.map +1 -1
  182. package/lib/components/switch/index.d.ts +9 -0
  183. package/lib/components/switch/index.js +53 -42
  184. package/lib/components/switch/index.js.map +1 -1
  185. package/lib/components/tab-bar/index.d.ts +9 -0
  186. package/lib/components/tab-bar/index.js +164 -90
  187. package/lib/components/tab-bar/index.js.map +1 -1
  188. package/lib/components/tabs/index.d.ts +24 -0
  189. package/lib/components/tabs/index.js +203 -174
  190. package/lib/components/tabs/index.js.map +1 -1
  191. package/lib/components/tabs-pane/index.d.ts +8 -0
  192. package/lib/components/tabs-pane/index.js +37 -24
  193. package/lib/components/tabs-pane/index.js.map +1 -1
  194. package/lib/components/tag/index.d.ts +9 -0
  195. package/lib/components/tag/index.js +64 -44
  196. package/lib/components/tag/index.js.map +1 -1
  197. package/lib/components/textarea/index.d.ts +13 -0
  198. package/lib/components/textarea/index.js +132 -86
  199. package/lib/components/textarea/index.js.map +1 -1
  200. package/lib/components/timeline/index.d.ts +8 -0
  201. package/lib/components/timeline/index.js +70 -47
  202. package/lib/components/timeline/index.js.map +1 -1
  203. package/lib/components/toast/img.json +6 -3
  204. package/lib/components/toast/index.d.ts +16 -0
  205. package/lib/components/toast/index.js +111 -104
  206. package/lib/components/toast/index.js.map +1 -1
  207. package/lib/index.d.ts +53 -0
  208. package/lib/index.js +108 -54
  209. package/lib/index.js.map +1 -1
  210. package/{dist → lib}/style/components/curtain.scss +3 -3
  211. package/{dist → lib}/style/components/grid.scss +2 -2
  212. package/lib/style/components/index.scss +52 -0
  213. package/{dist → lib}/style/components/list.scss +2 -2
  214. package/{dist → lib}/style/components/range.scss +2 -2
  215. package/{dist → lib}/style/components/toast.scss +1 -1
  216. package/lib/style/index.css +11754 -0
  217. package/lib/style/index.css.map +1 -0
  218. package/lib/style/mixins/index.scss +18 -0
  219. package/{dist → lib}/style/mixins/libs/shade.scss +4 -2
  220. package/{dist → lib}/style/mixins/libs/tint.scss +4 -2
  221. package/{dist → lib}/style/variables/default.scss +1 -1
  222. package/package.json +45 -48
  223. package/rn/components/action-sheet/index.tsx +8 -14
  224. package/rn/components/calendar/ui/date-list/index.tsx +1 -1
  225. package/rn/components/drawer/index.tsx +15 -15
  226. package/rn/components/float-layout/index.tsx +3 -2
  227. package/rn/components/input/index.tsx +14 -7
  228. package/rn/components/input-number/index.tsx +19 -19
  229. package/rn/components/message/index.tsx +1 -1
  230. package/rn/components/swipe-action/index.rn.tsx +4 -2
  231. package/rn/components/swipe-action/index.tsx +6 -5
  232. package/rn/components/tab-bar/index.tsx +1 -1
  233. package/rn/components/tabs/index.tsx +14 -14
  234. package/rn/components/textarea/index.tsx +2 -2
  235. package/README.md +0 -85
  236. package/dist/index.esm.js +0 -8407
  237. package/dist/index.esm.js.map +0 -1
  238. package/dist/index.js +0 -8468
  239. package/dist/index.js.map +0 -1
  240. package/dist/style/components/accordion.rn.scss +0 -79
  241. package/dist/style/components/action-sheet.rn.scss +0 -80
  242. package/dist/style/components/activity-indicator.rn.scss +0 -30
  243. package/dist/style/components/article.rn.scss +0 -59
  244. package/dist/style/components/avatar.rn.scss +0 -46
  245. package/dist/style/components/badge.rn.scss +0 -52
  246. package/dist/style/components/button.rn.scss +0 -80
  247. package/dist/style/components/calendar.rn.scss +0 -182
  248. package/dist/style/components/card.rn.scss +0 -88
  249. package/dist/style/components/checkbox.rn.scss +0 -108
  250. package/dist/style/components/countdown.rn.scss +0 -82
  251. package/dist/style/components/curtain.rn.scss +0 -129
  252. package/dist/style/components/divider.rn.scss +0 -33
  253. package/dist/style/components/drawer.rn.scss +0 -72
  254. package/dist/style/components/fab.rn.scss +0 -38
  255. package/dist/style/components/flex.rn.scss +0 -159
  256. package/dist/style/components/float-layout.rn.scss +0 -119
  257. package/dist/style/components/form.rn.scss +0 -12
  258. package/dist/style/components/grid.rn.scss +0 -104
  259. package/dist/style/components/icon.rn.scss +0 -221
  260. package/dist/style/components/image-picker.rn.scss +0 -108
  261. package/dist/style/components/index.rn.scss +0 -51
  262. package/dist/style/components/index.scss +0 -52
  263. package/dist/style/components/indexes.rn.scss +0 -53
  264. package/dist/style/components/input-number.rn.scss +0 -82
  265. package/dist/style/components/input.rn.scss +0 -149
  266. package/dist/style/components/list.rn.scss +0 -107
  267. package/dist/style/components/load-more.rn.scss +0 -28
  268. package/dist/style/components/loading.rn.scss +0 -45
  269. package/dist/style/components/message.rn.scss +0 -57
  270. package/dist/style/components/modal.rn.scss +0 -136
  271. package/dist/style/components/nav-bar.rn.scss +0 -123
  272. package/dist/style/components/noticebar.rn.scss +0 -111
  273. package/dist/style/components/pagination.rn.scss +0 -43
  274. package/dist/style/components/progress.rn.scss +0 -105
  275. package/dist/style/components/radio.rn.scss +0 -94
  276. package/dist/style/components/range.rn.scss +0 -52
  277. package/dist/style/components/rate.rn.scss +0 -48
  278. package/dist/style/components/search-bar.rn.scss +0 -134
  279. package/dist/style/components/segmented-control.rn.scss +0 -44
  280. package/dist/style/components/slider.rn.scss +0 -33
  281. package/dist/style/components/steps.rn.scss +0 -131
  282. package/dist/style/components/swipe-action.rn.scss +0 -53
  283. package/dist/style/components/switch.rn.scss +0 -61
  284. package/dist/style/components/tab-bar.rn.scss +0 -74
  285. package/dist/style/components/tabs.rn.scss +0 -205
  286. package/dist/style/components/tag.rn.scss +0 -74
  287. package/dist/style/components/textarea.rn.scss +0 -57
  288. package/dist/style/components/timeline.rn.scss +0 -89
  289. package/dist/style/components/toast.rn.scss +0 -112
  290. package/dist/style/index.rn.scss +0 -14
  291. package/dist/style/mixins/index.rn.scss +0 -18
  292. package/dist/style/mixins/index.scss +0 -18
  293. package/dist/style/mixins/libs/absolute-center.rn.scss +0 -9
  294. package/dist/style/mixins/libs/active.rn.scss +0 -10
  295. package/dist/style/mixins/libs/alignhack.rn.scss +0 -11
  296. package/dist/style/mixins/libs/border.rn.scss +0 -48
  297. package/dist/style/mixins/libs/clearfix.rn.scss +0 -21
  298. package/dist/style/mixins/libs/disabled.rn.scss +0 -6
  299. package/dist/style/mixins/libs/flex.rn.scss +0 -49
  300. package/dist/style/mixins/libs/hairline.rn.scss +0 -209
  301. package/dist/style/mixins/libs/line.rn.scss +0 -14
  302. package/dist/style/mixins/libs/overlay.rn.scss +0 -11
  303. package/dist/style/mixins/libs/placeholder.rn.scss +0 -12
  304. package/dist/style/mixins/libs/shade.rn.scss +0 -23
  305. package/dist/style/mixins/libs/tint.rn.scss +0 -23
  306. package/dist/style/themes/purple.rn.scss +0 -44
  307. package/dist/style/themes/red.rn.scss +0 -45
  308. package/dist/style/variables/default.rn.scss +0 -461
  309. package/types/accordion.d.ts +0 -49
  310. package/types/action-sheet.d.ts +0 -55
  311. package/types/activity-indicator.d.ts +0 -33
  312. package/types/avatar.d.ts +0 -39
  313. package/types/badge.d.ts +0 -24
  314. package/types/base.d.ts +0 -26
  315. package/types/button.d.ts +0 -70
  316. package/types/calendar.d.ts +0 -225
  317. package/types/card.d.ts +0 -48
  318. package/types/checkbox.d.ts +0 -24
  319. package/types/countdown.d.ts +0 -95
  320. package/types/curtain.d.ts +0 -26
  321. package/types/divider.d.ts +0 -33
  322. package/types/drawer.d.ts +0 -48
  323. package/types/fab.d.ts +0 -21
  324. package/types/flex.d.ts +0 -27
  325. package/types/float-button.d.ts +0 -26
  326. package/types/float-layout.d.ts +0 -73
  327. package/types/form.d.ts +0 -26
  328. package/types/grid.d.ts +0 -51
  329. package/types/icon.d.ts +0 -12
  330. package/types/image-picker.d.ts +0 -73
  331. package/types/index.d.ts +0 -55
  332. package/types/indexes.d.ts +0 -76
  333. package/types/input-number.d.ts +0 -89
  334. package/types/input.d.ts +0 -162
  335. package/types/list.d.ts +0 -84
  336. package/types/load-more.d.ts +0 -43
  337. package/types/message.d.ts +0 -43
  338. package/types/modal.d.ts +0 -62
  339. package/types/nav-bar.d.ts +0 -65
  340. package/types/noticebar.d.ts +0 -65
  341. package/types/pagination.d.ts +0 -51
  342. package/types/progress.d.ts +0 -30
  343. package/types/radio.d.ts +0 -47
  344. package/types/range.d.ts +0 -63
  345. package/types/rate.d.ts +0 -34
  346. package/types/search-bar.d.ts +0 -105
  347. package/types/segmented-control.d.ts +0 -44
  348. package/types/slider.d.ts +0 -73
  349. package/types/steps.d.ts +0 -69
  350. package/types/swipe-action.d.ts +0 -86
  351. package/types/switch.d.ts +0 -38
  352. package/types/tab-bar.d.ts +0 -98
  353. package/types/tabs-pane.d.ts +0 -25
  354. package/types/tabs.d.ts +0 -62
  355. package/types/tag.d.ts +0 -48
  356. package/types/textarea.d.ts +0 -113
  357. package/types/timeline.d.ts +0 -46
  358. package/types/toast.d.ts +0 -53
  359. /package/{dist → lib}/style/components/accordion.scss +0 -0
  360. /package/{dist → lib}/style/components/action-sheet.scss +0 -0
  361. /package/{dist → lib}/style/components/activity-indicator.scss +0 -0
  362. /package/{dist → lib}/style/components/article.scss +0 -0
  363. /package/{dist → lib}/style/components/avatar.scss +0 -0
  364. /package/{dist → lib}/style/components/badge.scss +0 -0
  365. /package/{dist → lib}/style/components/button.scss +0 -0
  366. /package/{dist → lib}/style/components/calendar.scss +0 -0
  367. /package/{dist → lib}/style/components/card.scss +0 -0
  368. /package/{dist → lib}/style/components/checkbox.scss +0 -0
  369. /package/{dist → lib}/style/components/countdown.scss +0 -0
  370. /package/{dist → lib}/style/components/divider.scss +0 -0
  371. /package/{dist → lib}/style/components/drawer.scss +0 -0
  372. /package/{dist → lib}/style/components/fab.scss +0 -0
  373. /package/{dist → lib}/style/components/flex.scss +0 -0
  374. /package/{dist → lib}/style/components/float-layout.scss +0 -0
  375. /package/{dist → lib}/style/components/form.scss +0 -0
  376. /package/{dist → lib}/style/components/icon.scss +0 -0
  377. /package/{dist → lib}/style/components/image-picker.scss +0 -0
  378. /package/{dist → lib}/style/components/indexes.scss +0 -0
  379. /package/{dist → lib}/style/components/input-number.scss +0 -0
  380. /package/{dist → lib}/style/components/input.scss +0 -0
  381. /package/{dist → lib}/style/components/load-more.scss +0 -0
  382. /package/{dist → lib}/style/components/loading.scss +0 -0
  383. /package/{dist → lib}/style/components/message.scss +0 -0
  384. /package/{dist → lib}/style/components/modal.scss +0 -0
  385. /package/{dist → lib}/style/components/nav-bar.scss +0 -0
  386. /package/{dist → lib}/style/components/noticebar.scss +0 -0
  387. /package/{dist → lib}/style/components/pagination.scss +0 -0
  388. /package/{dist → lib}/style/components/progress.scss +0 -0
  389. /package/{dist → lib}/style/components/radio.scss +0 -0
  390. /package/{dist → lib}/style/components/rate.scss +0 -0
  391. /package/{dist → lib}/style/components/search-bar.scss +0 -0
  392. /package/{dist → lib}/style/components/segmented-control.scss +0 -0
  393. /package/{dist → lib}/style/components/slider.scss +0 -0
  394. /package/{dist → lib}/style/components/steps.scss +0 -0
  395. /package/{dist → lib}/style/components/swipe-action.scss +0 -0
  396. /package/{dist → lib}/style/components/switch.scss +0 -0
  397. /package/{dist → lib}/style/components/tab-bar.scss +0 -0
  398. /package/{dist → lib}/style/components/tabs.scss +0 -0
  399. /package/{dist → lib}/style/components/tag.scss +0 -0
  400. /package/{dist → lib}/style/components/textarea.scss +0 -0
  401. /package/{dist → lib}/style/components/timeline.scss +0 -0
  402. /package/{dist → lib}/style/index.scss +0 -0
  403. /package/{dist → lib}/style/mixins/libs/absolute-center.scss +0 -0
  404. /package/{dist → lib}/style/mixins/libs/active.scss +0 -0
  405. /package/{dist → lib}/style/mixins/libs/alignhack.scss +0 -0
  406. /package/{dist → lib}/style/mixins/libs/border.scss +0 -0
  407. /package/{dist → lib}/style/mixins/libs/clearfix.scss +0 -0
  408. /package/{dist → lib}/style/mixins/libs/disabled.scss +0 -0
  409. /package/{dist → lib}/style/mixins/libs/flex.scss +0 -0
  410. /package/{dist → lib}/style/mixins/libs/hairline.scss +0 -0
  411. /package/{dist → lib}/style/mixins/libs/line.scss +0 -0
  412. /package/{dist → lib}/style/mixins/libs/overlay.scss +0 -0
  413. /package/{dist → lib}/style/mixins/libs/placeholder.scss +0 -0
  414. /package/{dist → lib}/style/themes/purple.scss +0 -0
  415. /package/{dist → lib}/style/themes/red.scss +0 -0
@@ -1,105 +1,152 @@
1
- import classNames from 'classnames';
2
- import PropTypes from 'prop-types';
3
- import React from 'react';
4
- import { Image, Switch, Text, View } from '@tarojs/components';
5
- import { mergeStyle } from '../../../common/utils';
6
- export default class AtListItem extends React.Component {
7
- constructor() {
8
- super(...arguments);
9
- this.handleClick = (event) => {
10
- if (typeof this.props.onClick === 'function' && !this.props.disabled) {
11
- this.props.onClick(event);
12
- }
13
- };
14
- this.handleSwitchChange = (event) => {
15
- if (typeof this.props.onSwitchChange === 'function' &&
16
- !this.props.disabled) {
17
- this.props.onSwitchChange(event);
18
- }
19
- };
20
- }
21
- handleSwitchClick(e) {
22
- e.stopPropagation();
23
- }
24
- render() {
25
- const { note, arrow, thumb, iconInfo, disabled, isSwitch, hasBorder, extraThumb, switchColor, switchIsCheck, icon } = this.props;
26
- const { extraText, title } = this.props;
27
- const rootClass = classNames('at-list__item', {
28
- 'at-list__item--thumb': thumb,
29
- 'at-list__item--multiple': note,
30
- 'at-list__item--disabled': disabled,
31
- 'at-list__item--no-border': !hasBorder
32
- }, this.props.className);
33
- const renderIcon = () => {
34
- if (icon) {
35
- return React.createElement(View, { className: 'item-icon' }, icon);
36
- }
37
- else if (iconInfo === null || iconInfo === void 0 ? void 0 : iconInfo.value) {
38
- const iconClass = classNames((iconInfo && iconInfo.prefixClass) || 'at-icon', {
39
- [`${(iconInfo && iconInfo.prefixClass) || 'at-icon'}-${iconInfo && iconInfo.value}`]: iconInfo && iconInfo.value
40
- }, iconInfo && iconInfo.className);
41
- return (React.createElement(View, { className: 'at-list__item-icon item-icon' },
42
- React.createElement(Text, { className: iconClass, style: mergeStyle({
43
- color: iconInfo.color || '',
44
- fontSize: `${iconInfo.size || 24}px`
45
- }, iconInfo.customStyle || '') })));
46
- }
47
- else if (thumb) {
48
- return (React.createElement(View, { className: 'at-list__item-thumb item-thumb' },
49
- React.createElement(Image, { className: 'item-thumb__info', mode: 'scaleToFill', src: thumb })));
50
- }
51
- };
52
- return (React.createElement(View, { className: rootClass, onClick: this.handleClick },
53
- React.createElement(View, { className: 'at-list__item-container' },
54
- renderIcon(),
55
- React.createElement(View, { className: 'at-list__item-content item-content' },
56
- React.createElement(View, { className: 'item-content__info' },
57
- React.createElement(View, { className: 'item-content__info-title' }, title),
58
- note && React.createElement(View, { className: 'item-content__info-note' }, note))),
59
- React.createElement(View, { className: 'at-list__item-extra item-extra' },
60
- extraText && React.createElement(View, { className: 'item-extra__info' }, extraText),
61
- extraThumb && !extraText && (React.createElement(View, { className: 'item-extra__image' },
62
- React.createElement(Image, { className: 'item-extra__image-info', mode: 'aspectFit', src: extraThumb }))),
63
- isSwitch && !extraThumb && !extraText && (React.createElement(View, { className: 'item-extra__switch', onClick: this.handleSwitchClick },
64
- React.createElement(Switch, { color: switchColor, disabled: disabled, checked: switchIsCheck, onChange: this.handleSwitchChange }))),
65
- arrow ? (React.createElement(View, { className: 'item-extra__icon' },
66
- React.createElement(Text, { className: `at-icon item-extra__icon-arrow at-icon-chevron-${arrow}` }))) : null))));
67
- }
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { Image, Switch, Text, View } from "@tarojs/components";
5
+ import { mergeStyle } from "../../../common/utils";
6
+ class AtListItem extends React.Component {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.handleClick = (event) => {
10
+ if (typeof this.props.onClick === "function" && !this.props.disabled) {
11
+ this.props.onClick(event);
12
+ }
13
+ };
14
+ this.handleSwitchChange = (event) => {
15
+ if (typeof this.props.onSwitchChange === "function" && !this.props.disabled) {
16
+ this.props.onSwitchChange(event);
17
+ }
18
+ };
19
+ }
20
+ handleSwitchClick(e) {
21
+ e.stopPropagation();
22
+ }
23
+ render() {
24
+ const {
25
+ note,
26
+ arrow,
27
+ thumb,
28
+ iconInfo,
29
+ disabled,
30
+ isSwitch,
31
+ hasBorder,
32
+ extraThumb,
33
+ switchColor,
34
+ switchIsCheck,
35
+ icon
36
+ } = this.props;
37
+ const { extraText, title } = this.props;
38
+ const rootClass = classNames(
39
+ "at-list__item",
40
+ {
41
+ "at-list__item--thumb": thumb,
42
+ "at-list__item--multiple": note,
43
+ "at-list__item--disabled": disabled,
44
+ "at-list__item--no-border": !hasBorder
45
+ },
46
+ this.props.className
47
+ );
48
+ const renderIcon = () => {
49
+ if (icon) {
50
+ return /* @__PURE__ */ React.createElement(View, { className: "item-icon" }, icon);
51
+ } else if (iconInfo == null ? void 0 : iconInfo.value) {
52
+ const iconClass = classNames(
53
+ iconInfo && iconInfo.prefixClass || "at-icon",
54
+ {
55
+ [`${iconInfo && iconInfo.prefixClass || "at-icon"}-${iconInfo && iconInfo.value}`]: iconInfo && iconInfo.value
56
+ },
57
+ iconInfo && iconInfo.className
58
+ );
59
+ return /* @__PURE__ */ React.createElement(View, { className: "at-list__item-icon item-icon" }, /* @__PURE__ */ React.createElement(
60
+ Text,
61
+ {
62
+ className: iconClass,
63
+ style: mergeStyle(
64
+ {
65
+ color: iconInfo.color || "",
66
+ fontSize: `${iconInfo.size || 24}px`
67
+ },
68
+ iconInfo.customStyle || ""
69
+ )
70
+ }
71
+ ));
72
+ } else if (thumb) {
73
+ return /* @__PURE__ */ React.createElement(View, { className: "at-list__item-thumb item-thumb" }, /* @__PURE__ */ React.createElement(
74
+ Image,
75
+ {
76
+ className: "item-thumb__info",
77
+ mode: "scaleToFill",
78
+ src: thumb
79
+ }
80
+ ));
81
+ }
82
+ };
83
+ return /* @__PURE__ */ React.createElement(View, { className: rootClass, onClick: this.handleClick }, /* @__PURE__ */ React.createElement(View, { className: "at-list__item-container" }, renderIcon(), /* @__PURE__ */ React.createElement(View, { className: "at-list__item-content item-content" }, /* @__PURE__ */ React.createElement(View, { className: "item-content__info" }, /* @__PURE__ */ React.createElement(View, { className: "item-content__info-title" }, title), note && /* @__PURE__ */ React.createElement(View, { className: "item-content__info-note" }, note))), /* @__PURE__ */ React.createElement(View, { className: "at-list__item-extra item-extra" }, extraText && /* @__PURE__ */ React.createElement(View, { className: "item-extra__info" }, extraText), extraThumb && !extraText && /* @__PURE__ */ React.createElement(View, { className: "item-extra__image" }, /* @__PURE__ */ React.createElement(
84
+ Image,
85
+ {
86
+ className: "item-extra__image-info",
87
+ mode: "aspectFit",
88
+ src: extraThumb
89
+ }
90
+ )), isSwitch && !extraThumb && !extraText && /* @__PURE__ */ React.createElement(
91
+ View,
92
+ {
93
+ className: "item-extra__switch",
94
+ onClick: this.handleSwitchClick
95
+ },
96
+ /* @__PURE__ */ React.createElement(
97
+ Switch,
98
+ {
99
+ color: switchColor,
100
+ disabled,
101
+ checked: switchIsCheck,
102
+ onChange: this.handleSwitchChange
103
+ }
104
+ )
105
+ ), arrow ? /* @__PURE__ */ React.createElement(View, { className: "item-extra__icon" }, /* @__PURE__ */ React.createElement(
106
+ Text,
107
+ {
108
+ className: `at-icon item-extra__icon-arrow at-icon-chevron-${arrow}`
109
+ }
110
+ )) : null)));
111
+ }
68
112
  }
69
113
  AtListItem.defaultProps = {
70
- note: '',
71
- disabled: false,
72
- title: '',
73
- thumb: '',
74
- isSwitch: false,
75
- hasBorder: true,
76
- switchColor: '#6190E8',
77
- switchIsCheck: false,
78
- extraText: '',
79
- extraThumb: '',
80
- iconInfo: { value: '' }
114
+ note: "",
115
+ disabled: false,
116
+ title: "",
117
+ thumb: "",
118
+ isSwitch: false,
119
+ hasBorder: true,
120
+ switchColor: "#6190E8",
121
+ switchIsCheck: false,
122
+ extraText: "",
123
+ extraThumb: "",
124
+ iconInfo: { value: "" }
81
125
  };
82
126
  AtListItem.propTypes = {
83
- note: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
84
- disabled: PropTypes.bool,
85
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
86
- thumb: PropTypes.string,
87
- onClick: PropTypes.func,
88
- isSwitch: PropTypes.bool,
89
- hasBorder: PropTypes.bool,
90
- switchColor: PropTypes.string,
91
- switchIsCheck: PropTypes.bool,
92
- extraText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
93
- extraThumb: PropTypes.string,
94
- onSwitchChange: PropTypes.func,
95
- arrow: PropTypes.oneOf(['up', 'down', 'right']),
96
- iconInfo: PropTypes.shape({
97
- size: PropTypes.number,
98
- value: PropTypes.string,
99
- color: PropTypes.string,
100
- prefixClass: PropTypes.string,
101
- customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
102
- className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
103
- })
127
+ note: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
128
+ disabled: PropTypes.bool,
129
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
130
+ thumb: PropTypes.string,
131
+ onClick: PropTypes.func,
132
+ isSwitch: PropTypes.bool,
133
+ hasBorder: PropTypes.bool,
134
+ switchColor: PropTypes.string,
135
+ switchIsCheck: PropTypes.bool,
136
+ extraText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
137
+ extraThumb: PropTypes.string,
138
+ onSwitchChange: PropTypes.func,
139
+ arrow: PropTypes.oneOf(["up", "down", "right"]),
140
+ iconInfo: PropTypes.shape({
141
+ size: PropTypes.number,
142
+ value: PropTypes.string,
143
+ color: PropTypes.string,
144
+ prefixClass: PropTypes.string,
145
+ customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
146
+ className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
147
+ })
148
+ };
149
+ export {
150
+ AtListItem as default
104
151
  };
105
152
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/list/item/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,SAAyB,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAG9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAA0B;IAAxE;;QAIU,gBAAW,GAAG,CAAC,KAAkB,EAAQ,EAAE;YACjD,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;aAC1B;QACH,CAAC,CAAA;QAMO,uBAAkB,GAAG,CAAC,KAAkB,EAAQ,EAAE;YACxD,IACE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,UAAU;gBAC/C,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EACpB;gBACA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;aACjC;QACH,CAAC,CAAA;IAuHH,CAAC;IAlIS,iBAAiB,C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AS,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACrE,UAAU,EAAE,SAAS,CAAC,MAAM;IAC5B,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;QACxB,IAAI,EAAE,SAAS,CAAC,MAAM;QACtB,KAAK,EAAE,SAAS,CAAC,MAAM;QACvB,KAAK,EAAE,SAAS,CAAC,MAAM;QACvB,WAAW,EAAE,SAAS,CAAC,MAAM;QAC7B,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACtE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;KACpE,CAAC;CACH,CAAA"}
1
+ {"version":3,"sources":["../../../../src/components/list/item/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Image, Switch, Text, View } from '@tarojs/components'\nimport { CommonEvent, ITouchEvent } from '@tarojs/components/types/common'\nimport { AtListItemProps } from '../../../../types/list'\nimport { mergeStyle } from '../../../common/utils'\n\nexport default class AtListItem extends React.Component<AtListItemProps> {\n public static defaultProps: AtListItemProps\n public static propTypes: InferProps<AtListItemProps>\n\n private handleClick = (event: ITouchEvent): void => {\n if (typeof this.props.onClick === 'function' && !this.props.disabled) {\n this.props.onClick(event)\n }\n }\n\n private handleSwitchClick(e: CommonEvent): void {\n e.stopPropagation()\n }\n\n private handleSwitchChange = (event: CommonEvent): void => {\n if (\n typeof this.props.onSwitchChange === 'function' &&\n !this.props.disabled\n ) {\n this.props.onSwitchChange(event)\n }\n }\n\n public render(): JSX.Element {\n const {\n note,\n arrow,\n thumb,\n iconInfo,\n disabled,\n isSwitch,\n hasBorder,\n extraThumb,\n switchColor,\n switchIsCheck,\n icon\n } = this.props\n\n const { extraText, title } = this.props\n\n const rootClass = classNames(\n 'at-list__item',\n {\n 'at-list__item--thumb': thumb,\n 'at-list__item--multiple': note,\n 'at-list__item--disabled': disabled,\n 'at-list__item--no-border': !hasBorder\n },\n this.props.className\n )\n\n const renderIcon = () => {\n if (icon) {\n return <View className='item-icon'>{icon}</View>\n } else if (iconInfo?.value) {\n const iconClass = classNames(\n (iconInfo && iconInfo.prefixClass) || 'at-icon',\n {\n [`${(iconInfo && iconInfo.prefixClass) || 'at-icon'}-${\n iconInfo && iconInfo.value\n }`]: iconInfo && iconInfo.value\n },\n iconInfo && iconInfo.className\n )\n return (\n <View className='at-list__item-icon item-icon'>\n <Text\n className={iconClass}\n style={mergeStyle(\n {\n color: iconInfo.color || '',\n fontSize: `${iconInfo.size || 24}px`\n },\n iconInfo.customStyle || ''\n )}\n ></Text>\n </View>\n )\n } else if (thumb) {\n return (\n <View className='at-list__item-thumb item-thumb'>\n <Image\n className='item-thumb__info'\n mode='scaleToFill'\n src={thumb}\n />\n </View>\n )\n }\n }\n\n return (\n <View className={rootClass} onClick={this.handleClick}>\n <View className='at-list__item-container'>\n {renderIcon()}\n <View className='at-list__item-content item-content'>\n <View className='item-content__info'>\n <View className='item-content__info-title'>{title}</View>\n {note && <View className='item-content__info-note'>{note}</View>}\n </View>\n </View>\n <View className='at-list__item-extra item-extra'>\n {extraText && <View className='item-extra__info'>{extraText}</View>}\n\n {extraThumb && !extraText && (\n <View className='item-extra__image'>\n <Image\n className='item-extra__image-info'\n mode='aspectFit'\n src={extraThumb}\n />\n </View>\n )}\n\n {isSwitch && !extraThumb && !extraText && (\n <View\n className='item-extra__switch'\n onClick={this.handleSwitchClick}\n >\n <Switch\n color={switchColor}\n disabled={disabled}\n checked={switchIsCheck}\n onChange={this.handleSwitchChange}\n />\n </View>\n )}\n\n {arrow ? (\n <View className='item-extra__icon'>\n <Text\n className={`at-icon item-extra__icon-arrow at-icon-chevron-${arrow}`}\n />\n </View>\n ) : null}\n </View>\n </View>\n </View>\n )\n }\n}\n\nAtListItem.defaultProps = {\n note: '',\n disabled: false,\n title: '',\n thumb: '',\n isSwitch: false,\n hasBorder: true,\n switchColor: '#6190E8',\n switchIsCheck: false,\n extraText: '',\n extraThumb: '',\n iconInfo: { value: '' }\n}\n\nAtListItem.propTypes = {\n note: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n disabled: PropTypes.bool,\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n thumb: PropTypes.string,\n onClick: PropTypes.func,\n isSwitch: PropTypes.bool,\n hasBorder: PropTypes.bool,\n switchColor: PropTypes.string,\n switchIsCheck: PropTypes.bool,\n extraText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n extraThumb: PropTypes.string,\n onSwitchChange: PropTypes.func,\n arrow: PropTypes.oneOf(['up', 'down', 'right']),\n iconInfo: PropTypes.shape({\n size: PropTypes.number,\n value: PropTypes.string,\n color: PropTypes.string,\n prefixClass: PropTypes.string,\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])\n })\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,OAAO,QAAQ,MAAM,YAAY;AAG1C,SAAS,kBAAkB;AAE3B,MAAO,mBAAiC,MAAM,UAA2B;AAAA,EAAzE;AAAA;AAIE,SAAQ,cAAc,CAAC,UAA6B;AAClD,UAAI,OAAO,KAAK,MAAM,YAAY,cAAc,CAAC,KAAK,MAAM,UAAU;AACpE,aAAK,MAAM,QAAQ,KAAK;AAAA,MAC1B;AAAA,IACF;AAMA,SAAQ,qBAAqB,CAAC,UAA6B;AACzD,UACE,OAAO,KAAK,MAAM,mBAAmB,cACrC,CAAC,KAAK,MAAM,UACZ;AACA,aAAK,MAAM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AAA,EAChE,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,eAAe,UAAU;AAAA,EACzB,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,EACpE,YAAY,UAAU;AAAA,EACtB,gBAAgB,UAAU;AAAA,EAC1B,OAAO,UAAU,MAAM,CAAC,MAAM,QAAQ,OAAO,CAAC;AAAA,EAC9C,UAAU,UAAU,MAAM;AAAA,IACxB,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU;AAAA,IACjB,OAAO,UAAU;AAAA,IACjB,aAAa,UAAU;AAAA,IACvB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,IACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EACpE,CAAC;AACH;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtLoadMoreProps } from '../../../types/load-more';
4
+ export default class AtLoadMore extends React.Component<AtLoadMoreProps> {
5
+ static defaultProps: AtLoadMoreProps;
6
+ static propTypes: InferProps<AtLoadMoreProps>;
7
+ private onClick;
8
+ render(): JSX.Element;
9
+ }
@@ -1,48 +1,72 @@
1
- import classNames from 'classnames';
2
- import PropTypes from 'prop-types';
3
- import React from 'react';
4
- import { Text, View } from '@tarojs/components';
5
- import AtActivityIndicator from '../activity-indicator/index';
6
- import AtButton from '../button/index';
7
- export default class AtLoadMore extends React.Component {
8
- onClick() {
9
- this.props.onClick && this.props.onClick(arguments);
10
- }
11
- render() {
12
- const { className, customStyle, loadingText, moreText, status, moreBtnStyle, noMoreTextStyle, noMoreText } = this.props;
13
- let component = null;
14
- if (status === 'loading') {
15
- component = React.createElement(AtActivityIndicator, { mode: 'center', content: loadingText });
16
- }
17
- else if (status === 'more') {
18
- component = (React.createElement(View, { className: 'at-load-more__cnt' },
19
- React.createElement(AtButton, { full: true, onClick: this.onClick.bind(this), customStyle: moreBtnStyle }, moreText)));
20
- }
21
- else {
22
- component = (React.createElement(Text, { className: 'at-load-more__tip', style: noMoreTextStyle }, noMoreText));
23
- }
24
- return (React.createElement(View, { className: classNames('at-load-more', className), style: customStyle }, component));
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { Text, View } from "@tarojs/components";
5
+ import AtActivityIndicator from "../activity-indicator/index";
6
+ import AtButton from "../button/index";
7
+ class AtLoadMore extends React.Component {
8
+ onClick() {
9
+ this.props.onClick && this.props.onClick(arguments);
10
+ }
11
+ render() {
12
+ const {
13
+ className,
14
+ customStyle,
15
+ loadingText,
16
+ moreText,
17
+ status,
18
+ moreBtnStyle,
19
+ noMoreTextStyle,
20
+ noMoreText
21
+ } = this.props;
22
+ let component = null;
23
+ if (status === "loading") {
24
+ component = /* @__PURE__ */ React.createElement(AtActivityIndicator, { mode: "center", content: loadingText });
25
+ } else if (status === "more") {
26
+ component = /* @__PURE__ */ React.createElement(View, { className: "at-load-more__cnt" }, /* @__PURE__ */ React.createElement(
27
+ AtButton,
28
+ {
29
+ full: true,
30
+ onClick: this.onClick.bind(this),
31
+ customStyle: moreBtnStyle
32
+ },
33
+ moreText
34
+ ));
35
+ } else {
36
+ component = /* @__PURE__ */ React.createElement(Text, { className: "at-load-more__tip", style: noMoreTextStyle }, noMoreText);
25
37
  }
38
+ return /* @__PURE__ */ React.createElement(
39
+ View,
40
+ {
41
+ className: classNames("at-load-more", className),
42
+ style: customStyle
43
+ },
44
+ component
45
+ );
46
+ }
26
47
  }
27
48
  AtLoadMore.defaultProps = {
28
- customStyle: '',
29
- className: '',
30
- noMoreTextStyle: '',
31
- moreBtnStyle: '',
32
- status: 'more',
33
- loadingText: '加载中',
34
- moreText: '查看更多',
35
- noMoreText: '没有更多'
49
+ customStyle: "",
50
+ className: "",
51
+ noMoreTextStyle: "",
52
+ moreBtnStyle: "",
53
+ status: "more",
54
+ loadingText: "\u52A0\u8F7D\u4E2D",
55
+ moreText: "\u67E5\u770B\u66F4\u591A",
56
+ noMoreText: "\u6CA1\u6709\u66F4\u591A"
36
57
  };
37
58
  AtLoadMore.propTypes = {
38
- customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
39
- className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
40
- noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
41
- moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
42
- status: PropTypes.oneOf(['more', 'loading', 'noMore']),
43
- loadingText: PropTypes.string,
44
- moreText: PropTypes.string,
45
- noMoreText: PropTypes.string,
46
- onClick: PropTypes.func
59
+ customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
60
+ className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
61
+ noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
62
+ moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
63
+ status: PropTypes.oneOf(["more", "loading", "noMore"]),
64
+ loadingText: PropTypes.string,
65
+ moreText: PropTypes.string,
66
+ noMoreText: PropTypes.string,
67
+ onClick: PropTypes.func
68
+ };
69
+ export {
70
+ AtLoadMore as default
47
71
  };
48
72
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/load-more/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,SAAyB,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,mBAAmB,MAAM,6BAA6B,CAAA;AAC7D,OAAO,QAAQ,MAAM,iBAAiB,CAAA;AAEtC,MAAM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,UAAU,EAAE,MAAM;CACnB,CAAA;AAED,UAAU,CAAC,SAAS,GAAG;IACrB,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACtE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnE,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1E,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACtD,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,QAAQ,EAAE,SAAS,CAAC,MAAM;IAC1B,UAAU,EAAE,SAAS,CAAC,MAAM;IAC5B,OAAO,EAAE,SAAS,CAAC,IAAI;CACxB,CAAA"}
1
+ {"version":3,"sources":["../../../src/components/load-more/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { AtLoadMoreProps } from '../../../types/load-more'\nimport AtActivityIndicator from '../activity-indicator/index'\nimport AtButton from '../button/index'\n\nexport default class AtLoadMore extends React.Component<AtLoadMoreProps> {\n public static defaultProps: AtLoadMoreProps\n public static propTypes: InferProps<AtLoadMoreProps>\n\n private onClick(): void {\n this.props.onClick && this.props.onClick(arguments as any)\n }\n\n public render(): JSX.Element {\n const {\n className,\n customStyle,\n loadingText,\n moreText,\n status,\n moreBtnStyle,\n noMoreTextStyle,\n noMoreText\n } = this.props\n\n let component: JSX.Element | null = null\n if (status === 'loading') {\n component = <AtActivityIndicator mode='center' content={loadingText} />\n } else if (status === 'more') {\n component = (\n <View className='at-load-more__cnt'>\n <AtButton\n full\n onClick={this.onClick.bind(this)}\n customStyle={moreBtnStyle}\n >\n {moreText}\n </AtButton>\n </View>\n )\n } else {\n component = (\n <Text className='at-load-more__tip' style={noMoreTextStyle}>\n {noMoreText}\n </Text>\n )\n }\n\n return (\n <View\n className={classNames('at-load-more', className)}\n style={customStyle}\n >\n {component}\n </View>\n )\n }\n}\n\nAtLoadMore.defaultProps = {\n customStyle: '',\n className: '',\n noMoreTextStyle: '',\n moreBtnStyle: '',\n status: 'more',\n loadingText: '加载中',\n moreText: '查看更多',\n noMoreText: '没有更多'\n}\n\nAtLoadMore.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n status: PropTypes.oneOf(['more', 'loading', 'noMore']),\n loadingText: PropTypes.string,\n moreText: PropTypes.string,\n noMoreText: PropTypes.string,\n onClick: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAE3B,OAAO,yBAAyB;AAChC,OAAO,cAAc;AAErB,MAAO,mBAAiC,MAAM,UAA2B;AAAA,EAI/D,UAAgB;AACtB,SAAK,MAAM,WAAW,KAAK,MAAM,QAAQ,SAAgB;AAAA,EAC3D;AAAA,EAEO,SAAsB;AAC3B,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,KAAK;AAET,QAAI,YAAgC;AACpC,QAAI,WAAW,WAAW;AACxB,kBAAY,oCAAC,uBAAoB,MAAK,UAAS,SAAS,aAAa;AAAA,IACvE,WAAW,WAAW,QAAQ;AAC5B,kBACE,oCAAC,QAAK,WAAU,uBACd;AAAA,QAAC;AAAA;AAAA,UACC,MAAI;AAAA,UACJ,SAAS,KAAK,QAAQ,KAAK,IAAI;AAAA,UAC/B,aAAa;AAAA;AAAA,QAEZ;AAAA,MACH,CACF;AAAA,IAEJ,OAAO;AACL,kBACE,oCAAC,QAAK,WAAU,qBAAoB,OAAO,mBACxC,UACH;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,WAAW,gBAAgB,SAAS;AAAA,QAC/C,OAAO;AAAA;AAAA,MAEN;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,WAAW,eAAe;AAAA,EACxB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACd;AAEA,WAAW,YAAY;AAAA,EACrB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,iBAAiB,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACzE,cAAc,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACtE,QAAQ,UAAU,MAAM,CAAC,QAAQ,WAAW,QAAQ,CAAC;AAAA,EACrD,aAAa,UAAU;AAAA,EACvB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AACrB;","names":[]}
@@ -0,0 +1,12 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ interface AtLoadingProps {
4
+ size?: string | number;
5
+ color?: string | number;
6
+ }
7
+ export default class AtLoading extends React.Component<AtLoadingProps> {
8
+ static defaultProps: AtLoadingProps;
9
+ static propTypes: InferProps<AtLoadingProps>;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -1,32 +1,32 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { View } from '@tarojs/components';
4
- import { pxTransform } from '../../common/utils';
5
- export default class AtLoading extends React.Component {
6
- render() {
7
- const { color, size } = this.props;
8
- const loadingSize = typeof size === 'string' ? size : String(size);
9
- const sizeStyle = {
10
- width: size ? `${pxTransform(parseInt(loadingSize))}` : '',
11
- height: size ? `${pxTransform(parseInt(loadingSize))}` : ''
12
- };
13
- const colorStyle = {
14
- border: color ? `1px solid ${color}` : '',
15
- borderColor: color ? `${color} transparent transparent transparent` : ''
16
- };
17
- const ringStyle = Object.assign({}, colorStyle, sizeStyle);
18
- return (React.createElement(View, { className: 'at-loading', style: sizeStyle },
19
- React.createElement(View, { className: 'at-loading__ring', style: ringStyle }),
20
- React.createElement(View, { className: 'at-loading__ring', style: ringStyle }),
21
- React.createElement(View, { className: 'at-loading__ring', style: ringStyle })));
22
- }
1
+ import PropTypes from "prop-types";
2
+ import React from "react";
3
+ import { View } from "@tarojs/components";
4
+ import { pxTransform } from "../../common/utils";
5
+ class AtLoading extends React.Component {
6
+ render() {
7
+ const { color, size } = this.props;
8
+ const loadingSize = typeof size === "string" ? size : String(size);
9
+ const sizeStyle = {
10
+ width: size ? `${pxTransform(parseInt(loadingSize))}` : "",
11
+ height: size ? `${pxTransform(parseInt(loadingSize))}` : ""
12
+ };
13
+ const colorStyle = {
14
+ border: color ? `1px solid ${color}` : "",
15
+ borderColor: color ? `${color} transparent transparent transparent` : ""
16
+ };
17
+ const ringStyle = Object.assign({}, colorStyle, sizeStyle);
18
+ return /* @__PURE__ */ React.createElement(View, { className: "at-loading", style: sizeStyle }, /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }), /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }), /* @__PURE__ */ React.createElement(View, { className: "at-loading__ring", style: ringStyle }));
19
+ }
23
20
  }
24
21
  AtLoading.defaultProps = {
25
- size: 0,
26
- color: ''
22
+ size: 0,
23
+ color: ""
27
24
  };
28
25
  AtLoading.propTypes = {
29
- size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
30
- color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
26
+ size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
27
+ color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
28
+ };
29
+ export {
30
+ AtLoading as default
31
31
  };
32
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/loading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAyB,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAOhD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,KAAK,CAAC,SAAyB;IAI7D,MAAM;QACX,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAClC,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAClE,MAAM,SAAS,GAAG;YAChB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YAC1D,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;SAC5D,CAAA;QACD,MAAM,UAAU,GAAG;YACjB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;YACzC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,sCAAsC,CAAC,CAAC,CAAC,EAAE;SACzE,CAAA;QACD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;QAE1D,OAAO,CACL,oBAAC,IAAI,IAAC,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,SAAS;YAC3C,oBAAC,IAAI,IAAC,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,SAAS,GAAS;YAC5D,oBAAC,IAAI,IAAC,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,SAAS,GAAS;YAC5D,oBAAC,IAAI,IAAC,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,SAAS,GAAS,CACvD,CACR,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,YAAY,GAAG;IACvB,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,EAAE;CACV,CAAA;AAED,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/D,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACjE,CAAA"}
1
+ {"version":3,"sources":["../../../src/components/loading/index.tsx"],"sourcesContent":["import PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { pxTransform } from '../../common/utils'\n\ninterface AtLoadingProps {\n size?: string | number\n color?: string | number\n}\n\nexport default class AtLoading extends React.Component<AtLoadingProps> {\n public static defaultProps: AtLoadingProps\n public static propTypes: InferProps<AtLoadingProps>\n\n public render(): JSX.Element {\n const { color, size } = this.props\n const loadingSize = typeof size === 'string' ? size : String(size)\n const sizeStyle = {\n width: size ? `${pxTransform(parseInt(loadingSize))}` : '',\n height: size ? `${pxTransform(parseInt(loadingSize))}` : ''\n }\n const colorStyle = {\n border: color ? `1px solid ${color}` : '',\n borderColor: color ? `${color} transparent transparent transparent` : ''\n }\n const ringStyle = Object.assign({}, colorStyle, sizeStyle)\n\n return (\n <View className='at-loading' style={sizeStyle}>\n <View className='at-loading__ring' style={ringStyle}></View>\n <View className='at-loading__ring' style={ringStyle}></View>\n <View className='at-loading__ring' style={ringStyle}></View>\n </View>\n )\n }\n}\n\nAtLoading.defaultProps = {\n size: 0,\n color: ''\n}\n\nAtLoading.propTypes = {\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n}\n"],"mappings":"AAAA,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAO5B,MAAO,kBAAgC,MAAM,UAA0B;AAAA,EAI9D,SAAsB;AAC3B,UAAM,EAAE,OAAO,KAAK,IAAI,KAAK;AAC7B,UAAM,cAAc,OAAO,SAAS,WAAW,OAAO,OAAO,IAAI;AACjE,UAAM,YAAY;AAAA,MAChB,OAAO,OAAO,GAAG,YAAY,SAAS,WAAW,CAAC,CAAC,KAAK;AAAA,MACxD,QAAQ,OAAO,GAAG,YAAY,SAAS,WAAW,CAAC,CAAC,KAAK;AAAA,IAC3D;AACA,UAAM,aAAa;AAAA,MACjB,QAAQ,QAAQ,aAAa,KAAK,KAAK;AAAA,MACvC,aAAa,QAAQ,GAAG,KAAK,yCAAyC;AAAA,IACxE;AACA,UAAM,YAAY,OAAO,OAAO,CAAC,GAAG,YAAY,SAAS;AAEzD,WACE,oCAAC,QAAK,WAAU,cAAa,OAAO,aAClC,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,GACrD,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,GACrD,oCAAC,QAAK,WAAU,oBAAmB,OAAO,WAAW,CACvD;AAAA,EAEJ;AACF;AAEA,UAAU,eAAe;AAAA,EACvB,MAAM;AAAA,EACN,OAAO;AACT;AAEA,UAAU,YAAY;AAAA,EACpB,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC9D,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AACjE;","names":[]}
@@ -0,0 +1,15 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtMessageProps, AtMessageState } from '../../../types/message';
4
+ export default class AtMessage extends React.Component<AtMessageProps, AtMessageState> {
5
+ static defaultProps: AtMessageProps;
6
+ static propTypes: InferProps<AtMessageProps>;
7
+ private _timer;
8
+ constructor(props: AtMessageProps);
9
+ private bindMessageListener;
10
+ componentDidShow(): void;
11
+ componentDidMount(): void;
12
+ componentDidHide(): void;
13
+ componentWillUnmount(): void;
14
+ render(): JSX.Element;
15
+ }