taro-ui 3.3.1 → 3.3.3

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 (487) hide show
  1. package/dist/common/component.d.ts +10 -0
  2. package/dist/common/component.js +32 -0
  3. package/dist/common/component.js.map +1 -0
  4. package/dist/common/utils.d.ts +41 -0
  5. package/dist/common/utils.js +203 -0
  6. package/dist/common/utils.js.map +1 -0
  7. package/dist/components/accordion/index.d.ts +14 -0
  8. package/dist/components/accordion/index.js +121 -0
  9. package/dist/components/accordion/index.js.map +1 -0
  10. package/dist/components/action-sheet/body/index.d.ts +5 -0
  11. package/dist/components/action-sheet/body/index.js +13 -0
  12. package/dist/components/action-sheet/body/index.js.map +1 -0
  13. package/dist/components/action-sheet/body/item/index.d.ts +9 -0
  14. package/dist/components/action-sheet/body/item/index.js +25 -0
  15. package/dist/components/action-sheet/body/item/index.js.map +1 -0
  16. package/dist/components/action-sheet/footer/index.d.ts +9 -0
  17. package/dist/components/action-sheet/footer/index.js +28 -0
  18. package/dist/components/action-sheet/footer/index.js.map +1 -0
  19. package/dist/components/action-sheet/header/index.d.ts +5 -0
  20. package/dist/components/action-sheet/header/index.js +16 -0
  21. package/dist/components/action-sheet/header/index.js.map +1 -0
  22. package/dist/components/action-sheet/index.d.ts +14 -0
  23. package/dist/components/action-sheet/index.js +76 -0
  24. package/dist/components/action-sheet/index.js.map +1 -0
  25. package/dist/components/activity-indicator/index.d.ts +8 -0
  26. package/dist/components/activity-indicator/index.js +39 -0
  27. package/dist/components/activity-indicator/index.js.map +1 -0
  28. package/dist/components/avatar/index.d.ts +9 -0
  29. package/dist/components/avatar/index.js +68 -0
  30. package/dist/components/avatar/index.js.map +1 -0
  31. package/dist/components/badge/index.d.ts +10 -0
  32. package/dist/components/badge/index.js +51 -0
  33. package/dist/components/badge/index.js.map +1 -0
  34. package/dist/components/button/index.d.ts +15 -0
  35. package/dist/components/button/index.js +177 -0
  36. package/dist/components/button/index.js.map +1 -0
  37. package/dist/components/calendar/body/index.d.ts +26 -0
  38. package/dist/components/calendar/body/index.js +289 -0
  39. package/dist/components/calendar/body/index.js.map +1 -0
  40. package/dist/components/calendar/common/constant.d.ts +3 -0
  41. package/dist/components/calendar/common/constant.js +9 -0
  42. package/dist/components/calendar/common/constant.js.map +1 -0
  43. package/dist/components/calendar/common/helper.d.ts +4 -0
  44. package/dist/components/calendar/common/helper.js +84 -0
  45. package/dist/components/calendar/common/helper.js.map +1 -0
  46. package/dist/components/calendar/common/plugins.d.ts +11 -0
  47. package/dist/components/calendar/common/plugins.js +55 -0
  48. package/dist/components/calendar/common/plugins.js.map +1 -0
  49. package/dist/components/calendar/controller/index.d.ts +5 -0
  50. package/dist/components/calendar/controller/index.js +51 -0
  51. package/dist/components/calendar/controller/index.js.map +1 -0
  52. package/dist/components/calendar/index.d.ts +20 -0
  53. package/dist/components/calendar/index.js +244 -0
  54. package/dist/components/calendar/index.js.map +1 -0
  55. package/dist/components/calendar/ui/date-list/index.d.ts +12 -0
  56. package/dist/components/calendar/ui/date-list/index.js +54 -0
  57. package/dist/components/calendar/ui/date-list/index.js.map +1 -0
  58. package/dist/components/calendar/ui/day-list/index.d.ts +4 -0
  59. package/dist/components/calendar/ui/day-list/index.js +11 -0
  60. package/dist/components/calendar/ui/day-list/index.js.map +1 -0
  61. package/dist/components/card/index.d.ts +9 -0
  62. package/dist/components/card/index.js +80 -0
  63. package/dist/components/card/index.js.map +1 -0
  64. package/dist/components/checkbox/index.d.ts +9 -0
  65. package/dist/components/checkbox/index.js +59 -0
  66. package/dist/components/checkbox/index.js.map +1 -0
  67. package/dist/components/countdown/index.d.ts +20 -0
  68. package/dist/components/countdown/index.js +152 -0
  69. package/dist/components/countdown/index.js.map +1 -0
  70. package/dist/components/countdown/item/index.d.ts +9 -0
  71. package/dist/components/countdown/item/index.js +24 -0
  72. package/dist/components/countdown/item/index.js.map +1 -0
  73. package/dist/components/curtain/index.d.ts +10 -0
  74. package/dist/components/curtain/index.js +62 -0
  75. package/dist/components/curtain/index.js.map +1 -0
  76. package/dist/components/divider/index.d.ts +8 -0
  77. package/dist/components/divider/index.js +57 -0
  78. package/dist/components/divider/index.js.map +1 -0
  79. package/dist/components/drawer/index.d.ts +16 -0
  80. package/dist/components/drawer/index.js +114 -0
  81. package/dist/components/drawer/index.js.map +1 -0
  82. package/dist/components/fab/index.d.ts +9 -0
  83. package/dist/components/fab/index.js +29 -0
  84. package/dist/components/fab/index.js.map +1 -0
  85. package/dist/components/flex/index.d.ts +7 -0
  86. package/dist/components/flex/index.js +41 -0
  87. package/dist/components/flex/index.js.map +1 -0
  88. package/dist/components/flex/item/index.d.ts +7 -0
  89. package/dist/components/flex/item/index.js +34 -0
  90. package/dist/components/flex/item/index.js.map +1 -0
  91. package/dist/components/float-layout/index.d.ts +13 -0
  92. package/dist/components/float-layout/index.js +104 -0
  93. package/dist/components/float-layout/index.js.map +1 -0
  94. package/dist/components/form/index.d.ts +10 -0
  95. package/dist/components/form/index.js +43 -0
  96. package/dist/components/form/index.js.map +1 -0
  97. package/dist/components/grid/index.d.ts +9 -0
  98. package/dist/components/grid/index.js +101 -0
  99. package/dist/components/grid/index.js.map +1 -0
  100. package/dist/components/icon/index.d.ts +9 -0
  101. package/dist/components/icon/index.js +54 -0
  102. package/dist/components/icon/index.js.map +1 -0
  103. package/dist/components/image-picker/index.d.ts +11 -0
  104. package/dist/components/image-picker/index.js +164 -0
  105. package/dist/components/image-picker/index.js.map +1 -0
  106. package/dist/components/indexes/index.d.ts +29 -0
  107. package/dist/components/indexes/index.js +272 -0
  108. package/dist/components/indexes/index.js.map +1 -0
  109. package/dist/components/input/index.d.ts +17 -0
  110. package/dist/components/input/index.js +232 -0
  111. package/dist/components/input/index.js.map +1 -0
  112. package/dist/components/input-number/index.d.ts +13 -0
  113. package/dist/components/input-number/index.js +193 -0
  114. package/dist/components/input-number/index.js.map +1 -0
  115. package/dist/components/list/index.d.ts +8 -0
  116. package/dist/components/list/index.js +26 -0
  117. package/dist/components/list/index.js.map +1 -0
  118. package/dist/components/list/item/index.d.ts +11 -0
  119. package/dist/components/list/item/index.js +152 -0
  120. package/dist/components/list/item/index.js.map +1 -0
  121. package/dist/components/load-more/index.d.ts +9 -0
  122. package/dist/components/load-more/index.js +72 -0
  123. package/dist/components/load-more/index.js.map +1 -0
  124. package/dist/components/loading/index.d.ts +12 -0
  125. package/dist/components/loading/index.js +32 -0
  126. package/dist/components/loading/index.js.map +1 -0
  127. package/dist/components/message/index.d.ts +15 -0
  128. package/dist/components/message/index.js +78 -0
  129. package/dist/components/message/index.js.map +1 -0
  130. package/dist/components/modal/action/index.d.ts +8 -0
  131. package/dist/components/modal/action/index.js +26 -0
  132. package/dist/components/modal/action/index.js.map +1 -0
  133. package/dist/components/modal/content/index.d.ts +5 -0
  134. package/dist/components/modal/content/index.js +13 -0
  135. package/dist/components/modal/content/index.js.map +1 -0
  136. package/dist/components/modal/header/index.d.ts +5 -0
  137. package/dist/components/modal/header/index.js +13 -0
  138. package/dist/components/modal/header/index.js.map +1 -0
  139. package/dist/components/modal/index.d.ts +15 -0
  140. package/dist/components/modal/index.js +106 -0
  141. package/dist/components/modal/index.js.map +1 -0
  142. package/dist/components/nav-bar/index.d.ts +12 -0
  143. package/dist/components/nav-bar/index.js +217 -0
  144. package/dist/components/nav-bar/index.js.map +1 -0
  145. package/dist/components/noticebar/index.d.ts +16 -0
  146. package/dist/components/noticebar/index.js +186 -0
  147. package/dist/components/noticebar/index.js.map +1 -0
  148. package/dist/components/pagination/index.d.ts +12 -0
  149. package/dist/components/pagination/index.js +146 -0
  150. package/dist/components/pagination/index.js.map +1 -0
  151. package/dist/components/progress/index.d.ts +7 -0
  152. package/dist/components/progress/index.js +53 -0
  153. package/dist/components/progress/index.js.map +1 -0
  154. package/dist/components/radio/index.d.ts +9 -0
  155. package/dist/components/radio/index.js +54 -0
  156. package/dist/components/radio/index.js.map +1 -0
  157. package/dist/components/range/index.d.ts +22 -0
  158. package/dist/components/range/index.js +207 -0
  159. package/dist/components/range/index.js.map +1 -0
  160. package/dist/components/rate/index.d.ts +9 -0
  161. package/dist/components/rate/index.js +82 -0
  162. package/dist/components/rate/index.js.map +1 -0
  163. package/dist/components/search-bar/index.d.ts +16 -0
  164. package/dist/components/search-bar/index.js +176 -0
  165. package/dist/components/search-bar/index.js.map +1 -0
  166. package/dist/components/segmented-control/index.d.ts +9 -0
  167. package/dist/components/segmented-control/index.js +84 -0
  168. package/dist/components/segmented-control/index.js.map +1 -0
  169. package/dist/components/slider/index.d.ts +13 -0
  170. package/dist/components/slider/index.js +115 -0
  171. package/dist/components/slider/index.js.map +1 -0
  172. package/dist/components/steps/index.d.ts +9 -0
  173. package/dist/components/steps/index.js +67 -0
  174. package/dist/components/steps/index.js.map +1 -0
  175. package/dist/components/swipe-action/index.d.ts +27 -0
  176. package/dist/components/swipe-action/index.js +220 -0
  177. package/dist/components/swipe-action/index.js.map +1 -0
  178. package/dist/components/swipe-action/options/index.d.ts +5 -0
  179. package/dist/components/swipe-action/options/index.js +24 -0
  180. package/dist/components/swipe-action/options/index.js.map +1 -0
  181. package/dist/components/switch/index.d.ts +9 -0
  182. package/dist/components/switch/index.js +59 -0
  183. package/dist/components/switch/index.js.map +1 -0
  184. package/dist/components/tab-bar/index.d.ts +9 -0
  185. package/dist/components/tab-bar/index.js +170 -0
  186. package/dist/components/tab-bar/index.js.map +1 -0
  187. package/dist/components/tabs/index.d.ts +24 -0
  188. package/dist/components/tabs/index.js +219 -0
  189. package/dist/components/tabs/index.js.map +1 -0
  190. package/dist/components/tabs-pane/index.d.ts +8 -0
  191. package/dist/components/tabs-pane/index.js +43 -0
  192. package/dist/components/tabs-pane/index.js.map +1 -0
  193. package/dist/components/tag/index.d.ts +9 -0
  194. package/dist/components/tag/index.js +75 -0
  195. package/dist/components/tag/index.js.map +1 -0
  196. package/dist/components/textarea/index.d.ts +13 -0
  197. package/dist/components/textarea/index.js +141 -0
  198. package/dist/components/textarea/index.js.map +1 -0
  199. package/dist/components/timeline/index.d.ts +8 -0
  200. package/dist/components/timeline/index.js +76 -0
  201. package/dist/components/timeline/index.js.map +1 -0
  202. package/dist/components/toast/img.json +8 -0
  203. package/dist/components/toast/index.d.ts +16 -0
  204. package/dist/components/toast/index.js +124 -0
  205. package/dist/components/toast/index.js.map +1 -0
  206. package/{lib/index.js → dist/index.d.ts} +0 -2
  207. package/dist/index.esm.js +6020 -8272
  208. package/dist/index.esm.js.map +1 -1
  209. package/dist/index.js +6104 -8332
  210. package/dist/index.js.map +1 -1
  211. package/dist/style/components/grid.scss +2 -2
  212. package/dist/style/components/index.scss +48 -48
  213. package/dist/style/components/list.scss +2 -2
  214. package/dist/style/index.css +11754 -0
  215. package/dist/style/index.css.map +1 -0
  216. package/dist/style/mixins/index.scss +13 -13
  217. package/dist/style/mixins/libs/shade.scss +4 -2
  218. package/dist/style/mixins/libs/tint.scss +4 -2
  219. package/dist/style/variables/default.scss +1 -1
  220. package/package.json +56 -33
  221. package/rn/components/action-sheet/index.tsx +8 -14
  222. package/rn/components/calendar/ui/date-list/index.tsx +1 -1
  223. package/rn/components/drawer/index.tsx +15 -15
  224. package/rn/components/float-layout/index.tsx +3 -2
  225. package/rn/components/input/index.tsx +14 -7
  226. package/rn/components/input-number/index.tsx +19 -19
  227. package/rn/components/message/index.tsx +1 -1
  228. package/rn/components/swipe-action/index.rn.tsx +4 -2
  229. package/rn/components/swipe-action/index.tsx +6 -5
  230. package/rn/components/tab-bar/index.tsx +1 -1
  231. package/rn/components/tabs/index.tsx +14 -14
  232. package/rn/components/textarea/index.tsx +2 -2
  233. package/dist/style/components/accordion.rn.scss +0 -79
  234. package/dist/style/components/action-sheet.rn.scss +0 -80
  235. package/dist/style/components/activity-indicator.rn.scss +0 -30
  236. package/dist/style/components/article.rn.scss +0 -59
  237. package/dist/style/components/avatar.rn.scss +0 -46
  238. package/dist/style/components/badge.rn.scss +0 -52
  239. package/dist/style/components/button.rn.scss +0 -80
  240. package/dist/style/components/calendar.rn.scss +0 -182
  241. package/dist/style/components/card.rn.scss +0 -88
  242. package/dist/style/components/checkbox.rn.scss +0 -108
  243. package/dist/style/components/countdown.rn.scss +0 -82
  244. package/dist/style/components/curtain.rn.scss +0 -129
  245. package/dist/style/components/divider.rn.scss +0 -33
  246. package/dist/style/components/drawer.rn.scss +0 -72
  247. package/dist/style/components/fab.rn.scss +0 -38
  248. package/dist/style/components/flex.rn.scss +0 -159
  249. package/dist/style/components/float-layout.rn.scss +0 -119
  250. package/dist/style/components/form.rn.scss +0 -12
  251. package/dist/style/components/grid.rn.scss +0 -104
  252. package/dist/style/components/icon.rn.scss +0 -221
  253. package/dist/style/components/image-picker.rn.scss +0 -108
  254. package/dist/style/components/index.rn.scss +0 -51
  255. package/dist/style/components/indexes.rn.scss +0 -53
  256. package/dist/style/components/input-number.rn.scss +0 -82
  257. package/dist/style/components/input.rn.scss +0 -149
  258. package/dist/style/components/list.rn.scss +0 -107
  259. package/dist/style/components/load-more.rn.scss +0 -28
  260. package/dist/style/components/loading.rn.scss +0 -45
  261. package/dist/style/components/message.rn.scss +0 -57
  262. package/dist/style/components/modal.rn.scss +0 -136
  263. package/dist/style/components/nav-bar.rn.scss +0 -123
  264. package/dist/style/components/noticebar.rn.scss +0 -111
  265. package/dist/style/components/pagination.rn.scss +0 -43
  266. package/dist/style/components/progress.rn.scss +0 -105
  267. package/dist/style/components/radio.rn.scss +0 -94
  268. package/dist/style/components/range.rn.scss +0 -52
  269. package/dist/style/components/rate.rn.scss +0 -48
  270. package/dist/style/components/search-bar.rn.scss +0 -134
  271. package/dist/style/components/segmented-control.rn.scss +0 -44
  272. package/dist/style/components/slider.rn.scss +0 -33
  273. package/dist/style/components/steps.rn.scss +0 -131
  274. package/dist/style/components/swipe-action.rn.scss +0 -53
  275. package/dist/style/components/switch.rn.scss +0 -61
  276. package/dist/style/components/tab-bar.rn.scss +0 -74
  277. package/dist/style/components/tabs.rn.scss +0 -205
  278. package/dist/style/components/tag.rn.scss +0 -74
  279. package/dist/style/components/textarea.rn.scss +0 -57
  280. package/dist/style/components/timeline.rn.scss +0 -89
  281. package/dist/style/components/toast.rn.scss +0 -112
  282. package/dist/style/index.rn.scss +0 -14
  283. package/dist/style/mixins/index.rn.scss +0 -18
  284. package/dist/style/mixins/libs/absolute-center.rn.scss +0 -9
  285. package/dist/style/mixins/libs/active.rn.scss +0 -10
  286. package/dist/style/mixins/libs/alignhack.rn.scss +0 -11
  287. package/dist/style/mixins/libs/border.rn.scss +0 -48
  288. package/dist/style/mixins/libs/clearfix.rn.scss +0 -21
  289. package/dist/style/mixins/libs/disabled.rn.scss +0 -6
  290. package/dist/style/mixins/libs/flex.rn.scss +0 -49
  291. package/dist/style/mixins/libs/hairline.rn.scss +0 -209
  292. package/dist/style/mixins/libs/line.rn.scss +0 -14
  293. package/dist/style/mixins/libs/overlay.rn.scss +0 -11
  294. package/dist/style/mixins/libs/placeholder.rn.scss +0 -12
  295. package/dist/style/mixins/libs/shade.rn.scss +0 -23
  296. package/dist/style/mixins/libs/tint.rn.scss +0 -23
  297. package/dist/style/themes/purple.rn.scss +0 -44
  298. package/dist/style/themes/red.rn.scss +0 -45
  299. package/dist/style/variables/default.rn.scss +0 -461
  300. package/lib/common/component.js +0 -33
  301. package/lib/common/component.js.map +0 -1
  302. package/lib/common/utils.js +0 -226
  303. package/lib/common/utils.js.map +0 -1
  304. package/lib/components/accordion/index.js +0 -116
  305. package/lib/components/accordion/index.js.map +0 -1
  306. package/lib/components/action-sheet/body/index.js +0 -10
  307. package/lib/components/action-sheet/body/index.js.map +0 -1
  308. package/lib/components/action-sheet/body/item/index.js +0 -22
  309. package/lib/components/action-sheet/body/item/index.js.map +0 -1
  310. package/lib/components/action-sheet/footer/index.js +0 -22
  311. package/lib/components/action-sheet/footer/index.js.map +0 -1
  312. package/lib/components/action-sheet/header/index.js +0 -10
  313. package/lib/components/action-sheet/header/index.js.map +0 -1
  314. package/lib/components/action-sheet/index.js +0 -71
  315. package/lib/components/action-sheet/index.js.map +0 -1
  316. package/lib/components/activity-indicator/index.js +0 -35
  317. package/lib/components/activity-indicator/index.js.map +0 -1
  318. package/lib/components/avatar/index.js +0 -64
  319. package/lib/components/avatar/index.js.map +0 -1
  320. package/lib/components/badge/index.js +0 -42
  321. package/lib/components/badge/index.js.map +0 -1
  322. package/lib/components/button/index.js +0 -125
  323. package/lib/components/button/index.js.map +0 -1
  324. package/lib/components/calendar/body/index.js +0 -193
  325. package/lib/components/calendar/body/index.js.map +0 -1
  326. package/lib/components/calendar/common/constant.js +0 -4
  327. package/lib/components/calendar/common/constant.js.map +0 -1
  328. package/lib/components/calendar/common/helper.js +0 -83
  329. package/lib/components/calendar/common/helper.js.map +0 -1
  330. package/lib/components/calendar/common/plugins.js +0 -71
  331. package/lib/components/calendar/common/plugins.js.map +0 -1
  332. package/lib/components/calendar/controller/index.js +0 -30
  333. package/lib/components/calendar/controller/index.js.map +0 -1
  334. package/lib/components/calendar/index.js +0 -207
  335. package/lib/components/calendar/index.js.map +0 -1
  336. package/lib/components/calendar/ui/date-list/index.js +0 -43
  337. package/lib/components/calendar/ui/date-list/index.js.map +0 -1
  338. package/lib/components/calendar/ui/day-list/index.js +0 -16
  339. package/lib/components/calendar/ui/day-list/index.js.map +0 -1
  340. package/lib/components/card/index.js +0 -59
  341. package/lib/components/card/index.js.map +0 -1
  342. package/lib/components/checkbox/index.js +0 -55
  343. package/lib/components/checkbox/index.js.map +0 -1
  344. package/lib/components/countdown/index.js +0 -137
  345. package/lib/components/countdown/index.js.map +0 -1
  346. package/lib/components/countdown/item/index.js +0 -24
  347. package/lib/components/countdown/item/index.js.map +0 -1
  348. package/lib/components/curtain/index.js +0 -45
  349. package/lib/components/curtain/index.js.map +0 -1
  350. package/lib/components/divider/index.js +0 -40
  351. package/lib/components/divider/index.js.map +0 -1
  352. package/lib/components/drawer/index.js +0 -93
  353. package/lib/components/drawer/index.js.map +0 -1
  354. package/lib/components/fab/index.js +0 -26
  355. package/lib/components/fab/index.js.map +0 -1
  356. package/lib/components/flex/index.js +0 -38
  357. package/lib/components/flex/index.js.map +0 -1
  358. package/lib/components/flex/item/index.js +0 -31
  359. package/lib/components/flex/item/index.js.map +0 -1
  360. package/lib/components/float-layout/index.js +0 -76
  361. package/lib/components/float-layout/index.js.map +0 -1
  362. package/lib/components/form/index.js +0 -30
  363. package/lib/components/form/index.js.map +0 -1
  364. package/lib/components/grid/index.js +0 -71
  365. package/lib/components/grid/index.js.map +0 -1
  366. package/lib/components/icon/index.js +0 -37
  367. package/lib/components/icon/index.js.map +0 -1
  368. package/lib/components/image-picker/index.js +0 -138
  369. package/lib/components/image-picker/index.js.map +0 -1
  370. package/lib/components/indexes/index.js +0 -215
  371. package/lib/components/indexes/index.js.map +0 -1
  372. package/lib/components/input/index.js +0 -168
  373. package/lib/components/input/index.js.map +0 -1
  374. package/lib/components/input-number/index.js +0 -165
  375. package/lib/components/input-number/index.js.map +0 -1
  376. package/lib/components/list/index.js +0 -19
  377. package/lib/components/list/index.js.map +0 -1
  378. package/lib/components/list/item/index.js +0 -105
  379. package/lib/components/list/item/index.js.map +0 -1
  380. package/lib/components/load-more/index.js +0 -48
  381. package/lib/components/load-more/index.js.map +0 -1
  382. package/lib/components/loading/index.js +0 -32
  383. package/lib/components/loading/index.js.map +0 -1
  384. package/lib/components/message/index.js +0 -69
  385. package/lib/components/message/index.js.map +0 -1
  386. package/lib/components/modal/action/index.js +0 -20
  387. package/lib/components/modal/action/index.js.map +0 -1
  388. package/lib/components/modal/content/index.js +0 -10
  389. package/lib/components/modal/content/index.js.map +0 -1
  390. package/lib/components/modal/header/index.js +0 -10
  391. package/lib/components/modal/header/index.js.map +0 -1
  392. package/lib/components/modal/index.js +0 -97
  393. package/lib/components/modal/index.js.map +0 -1
  394. package/lib/components/nav-bar/index.js +0 -105
  395. package/lib/components/nav-bar/index.js.map +0 -1
  396. package/lib/components/noticebar/index.js +0 -163
  397. package/lib/components/noticebar/index.js.map +0 -1
  398. package/lib/components/pagination/index.js +0 -115
  399. package/lib/components/pagination/index.js.map +0 -1
  400. package/lib/components/progress/index.js +0 -45
  401. package/lib/components/progress/index.js.map +0 -1
  402. package/lib/components/radio/index.js +0 -43
  403. package/lib/components/radio/index.js.map +0 -1
  404. package/lib/components/range/index.js +0 -152
  405. package/lib/components/range/index.js.map +0 -1
  406. package/lib/components/rate/index.js +0 -56
  407. package/lib/components/rate/index.js.map +0 -1
  408. package/lib/components/search-bar/index.js +0 -121
  409. package/lib/components/search-bar/index.js.map +0 -1
  410. package/lib/components/segmented-control/index.js +0 -59
  411. package/lib/components/segmented-control/index.js.map +0 -1
  412. package/lib/components/slider/index.js +0 -77
  413. package/lib/components/slider/index.js.map +0 -1
  414. package/lib/components/steps/index.js +0 -50
  415. package/lib/components/steps/index.js.map +0 -1
  416. package/lib/components/swipe-action/index.js +0 -171
  417. package/lib/components/swipe-action/index.js.map +0 -1
  418. package/lib/components/swipe-action/options/index.js +0 -10
  419. package/lib/components/swipe-action/options/index.js.map +0 -1
  420. package/lib/components/switch/index.js +0 -48
  421. package/lib/components/switch/index.js.map +0 -1
  422. package/lib/components/tab-bar/index.js +0 -96
  423. package/lib/components/tab-bar/index.js.map +0 -1
  424. package/lib/components/tabs/index.js +0 -190
  425. package/lib/components/tabs/index.js.map +0 -1
  426. package/lib/components/tabs-pane/index.js +0 -30
  427. package/lib/components/tabs-pane/index.js.map +0 -1
  428. package/lib/components/tag/index.js +0 -55
  429. package/lib/components/tag/index.js.map +0 -1
  430. package/lib/components/textarea/index.js +0 -95
  431. package/lib/components/textarea/index.js.map +0 -1
  432. package/lib/components/timeline/index.js +0 -53
  433. package/lib/components/timeline/index.js.map +0 -1
  434. package/lib/components/toast/img.json +0 -5
  435. package/lib/components/toast/index.js +0 -117
  436. package/lib/components/toast/index.js.map +0 -1
  437. package/lib/index.js.map +0 -1
  438. package/types/accordion.d.ts +0 -49
  439. package/types/action-sheet.d.ts +0 -55
  440. package/types/activity-indicator.d.ts +0 -33
  441. package/types/avatar.d.ts +0 -39
  442. package/types/badge.d.ts +0 -24
  443. package/types/base.d.ts +0 -26
  444. package/types/button.d.ts +0 -70
  445. package/types/calendar.d.ts +0 -225
  446. package/types/card.d.ts +0 -48
  447. package/types/checkbox.d.ts +0 -24
  448. package/types/countdown.d.ts +0 -95
  449. package/types/curtain.d.ts +0 -26
  450. package/types/divider.d.ts +0 -33
  451. package/types/drawer.d.ts +0 -48
  452. package/types/fab.d.ts +0 -21
  453. package/types/flex.d.ts +0 -27
  454. package/types/float-button.d.ts +0 -26
  455. package/types/float-layout.d.ts +0 -73
  456. package/types/form.d.ts +0 -26
  457. package/types/grid.d.ts +0 -51
  458. package/types/icon.d.ts +0 -12
  459. package/types/image-picker.d.ts +0 -73
  460. package/types/index.d.ts +0 -55
  461. package/types/indexes.d.ts +0 -76
  462. package/types/input-number.d.ts +0 -89
  463. package/types/input.d.ts +0 -162
  464. package/types/list.d.ts +0 -84
  465. package/types/load-more.d.ts +0 -43
  466. package/types/message.d.ts +0 -43
  467. package/types/modal.d.ts +0 -62
  468. package/types/nav-bar.d.ts +0 -65
  469. package/types/noticebar.d.ts +0 -65
  470. package/types/pagination.d.ts +0 -51
  471. package/types/progress.d.ts +0 -30
  472. package/types/radio.d.ts +0 -47
  473. package/types/range.d.ts +0 -63
  474. package/types/rate.d.ts +0 -34
  475. package/types/search-bar.d.ts +0 -105
  476. package/types/segmented-control.d.ts +0 -44
  477. package/types/slider.d.ts +0 -73
  478. package/types/steps.d.ts +0 -69
  479. package/types/swipe-action.d.ts +0 -86
  480. package/types/switch.d.ts +0 -38
  481. package/types/tab-bar.d.ts +0 -98
  482. package/types/tabs-pane.d.ts +0 -25
  483. package/types/tabs.d.ts +0 -62
  484. package/types/tag.d.ts +0 -48
  485. package/types/textarea.d.ts +0 -113
  486. package/types/timeline.d.ts +0 -46
  487. package/types/toast.d.ts +0 -53
@@ -0,0 +1,152 @@
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { View } from "@tarojs/components";
5
+ import AtCountdownItem from "./item";
6
+ const toSeconds = (day, hours, minutes, seconds) => day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds;
7
+ const defaultFormat = {
8
+ day: "\u5929",
9
+ hours: "\u65F6",
10
+ minutes: "\u5206",
11
+ seconds: "\u79D2"
12
+ };
13
+ class AtCountdown extends React.Component {
14
+ constructor(props) {
15
+ super(props);
16
+ const { day = 0, hours = 0, minutes = 0, seconds = 0 } = this.props;
17
+ this.seconds = toSeconds(day, hours, minutes, seconds);
18
+ const {
19
+ day: _day,
20
+ hours: _hours,
21
+ minutes: _minutes,
22
+ seconds: _seconds
23
+ } = this.calculateTime();
24
+ this.state = {
25
+ _day,
26
+ _hours,
27
+ _minutes,
28
+ _seconds
29
+ };
30
+ }
31
+ setTimer() {
32
+ if (!this.timer) this.countdonwn();
33
+ }
34
+ clearTimer() {
35
+ if (this.timer) {
36
+ clearTimeout(this.timer);
37
+ this.timer = 0;
38
+ }
39
+ }
40
+ calculateTime() {
41
+ let [day, hours, minutes, seconds] = [0, 0, 0, 0];
42
+ if (this.seconds > 0) {
43
+ day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0;
44
+ hours = this.props.isShowHour ? Math.floor(this.seconds / (60 * 60)) - day * 24 : 0;
45
+ minutes = this.props.isShowMinute ? Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60 : 0;
46
+ seconds = Math.floor(this.seconds) - day * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
47
+ }
48
+ return {
49
+ day,
50
+ hours,
51
+ minutes,
52
+ seconds
53
+ };
54
+ }
55
+ countdonwn() {
56
+ const { day, hours, minutes, seconds } = this.calculateTime();
57
+ this.setState({
58
+ _day: day,
59
+ _hours: hours,
60
+ _minutes: minutes,
61
+ _seconds: seconds
62
+ });
63
+ this.seconds--;
64
+ if (this.seconds < 0) {
65
+ this.clearTimer();
66
+ this.props.onTimeUp && this.props.onTimeUp();
67
+ return;
68
+ }
69
+ this.timer = setTimeout(() => {
70
+ this.countdonwn();
71
+ }, 1e3);
72
+ }
73
+ UNSAFE_componentWillReceiveProps(nextProps) {
74
+ if (JSON.stringify(this.props) === JSON.stringify(nextProps)) return;
75
+ const { day = 0, hours = 0, minutes = 0, seconds = 0 } = nextProps;
76
+ this.seconds = toSeconds(day, hours, minutes, seconds);
77
+ this.clearTimer();
78
+ this.setTimer();
79
+ }
80
+ componentDidMount() {
81
+ this.setTimer();
82
+ }
83
+ componentWillUnmount() {
84
+ this.clearTimer();
85
+ }
86
+ componentDidHide() {
87
+ this.clearTimer();
88
+ }
89
+ componentDidShow() {
90
+ this.setTimer();
91
+ }
92
+ render() {
93
+ const {
94
+ className,
95
+ customStyle,
96
+ format = defaultFormat,
97
+ isCard,
98
+ isShowDay,
99
+ isShowHour,
100
+ isShowMinute
101
+ } = this.props;
102
+ const { _day, _hours, _minutes, _seconds } = this.state;
103
+ return /* @__PURE__ */ React.createElement(
104
+ View,
105
+ {
106
+ className: classNames(
107
+ {
108
+ "at-countdown": true,
109
+ "at-countdown--card": isCard
110
+ },
111
+ className
112
+ ),
113
+ style: customStyle
114
+ },
115
+ isShowDay && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _day, separator: (format == null ? void 0 : format.day) || "\u5929" }),
116
+ isShowHour && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _hours, separator: (format == null ? void 0 : format.hours) || "" }),
117
+ isShowMinute && /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _minutes, separator: (format == null ? void 0 : format.minutes) || "" }),
118
+ /* @__PURE__ */ React.createElement(AtCountdownItem, { num: _seconds, separator: (format == null ? void 0 : format.seconds) || "" })
119
+ );
120
+ }
121
+ }
122
+ AtCountdown.defaultProps = {
123
+ customStyle: "",
124
+ className: "",
125
+ isCard: false,
126
+ isShowDay: false,
127
+ isShowHour: true,
128
+ isShowMinute: true,
129
+ format: defaultFormat,
130
+ day: 0,
131
+ hours: 0,
132
+ minutes: 0,
133
+ seconds: 0
134
+ };
135
+ AtCountdown.propTypes = {
136
+ customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
137
+ className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
138
+ isCard: PropTypes.bool,
139
+ isShowDay: PropTypes.bool,
140
+ isShowHour: PropTypes.bool,
141
+ isShowMinute: PropTypes.bool,
142
+ format: PropTypes.object,
143
+ day: PropTypes.number,
144
+ hours: PropTypes.number,
145
+ minutes: PropTypes.number,
146
+ seconds: PropTypes.number,
147
+ onTimeUp: PropTypes.func
148
+ };
149
+ export {
150
+ AtCountdown as default
151
+ };
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/countdown/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtCountDownProps, AtCountdownState } from '../../../types/countdown'\nimport AtCountdownItem from './item'\n\ntype TimeObject = {\n day: number\n hours: number\n minutes: number\n seconds: number\n}\n\nconst toSeconds = (\n day: number,\n hours: number,\n minutes: number,\n seconds: number\n): number => day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds\n\nconst defaultFormat = {\n day: '天',\n hours: '时',\n minutes: '分',\n seconds: '秒'\n}\n\nexport default class AtCountdown extends React.Component<\n AtCountDownProps,\n AtCountdownState\n> {\n public static defaultProps: AtCountDownProps\n public static propTypes: InferProps<AtCountDownProps>\n\n private seconds: number\n private timer: NodeJS.Timeout | number | undefined\n\n public constructor(props: AtCountDownProps) {\n super(props)\n const { day = 0, hours = 0, minutes = 0, seconds = 0 } = this.props\n this.seconds = toSeconds(day, hours, minutes, seconds)\n const {\n day: _day,\n hours: _hours,\n minutes: _minutes,\n seconds: _seconds\n } = this.calculateTime()\n\n this.state = {\n _day,\n _hours,\n _minutes,\n _seconds\n }\n }\n\n private setTimer(): void {\n if (!this.timer) this.countdonwn()\n }\n\n private clearTimer(): void {\n if (this.timer) {\n clearTimeout(this.timer as number)\n this.timer = 0\n }\n }\n\n private calculateTime(): TimeObject {\n let [day, hours, minutes, seconds] = [0, 0, 0, 0]\n\n if (this.seconds > 0) {\n day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0\n hours = this.props.isShowHour\n ? Math.floor(this.seconds / (60 * 60)) - day * 24\n : 0\n minutes = this.props.isShowMinute\n ? Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60\n : 0\n seconds =\n Math.floor(this.seconds) -\n day * 24 * 60 * 60 -\n hours * 60 * 60 -\n minutes * 60\n }\n return {\n day,\n hours,\n minutes,\n seconds\n }\n }\n\n private countdonwn(): void {\n const { day, hours, minutes, seconds } = this.calculateTime()\n\n this.setState({\n _day: day,\n _hours: hours,\n _minutes: minutes,\n _seconds: seconds\n })\n this.seconds--\n\n if (this.seconds < 0) {\n this.clearTimer()\n this.props.onTimeUp && this.props.onTimeUp()\n return\n }\n\n this.timer = setTimeout(() => {\n this.countdonwn()\n }, 1000)\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: AtCountDownProps): void {\n if (JSON.stringify(this.props) === JSON.stringify(nextProps)) return\n\n const { day = 0, hours = 0, minutes = 0, seconds = 0 } = nextProps\n this.seconds = toSeconds(day, hours, minutes, seconds)\n this.clearTimer()\n this.setTimer()\n }\n\n public componentDidMount(): void {\n this.setTimer()\n }\n\n public componentWillUnmount(): void {\n this.clearTimer()\n }\n\n public componentDidHide(): void {\n this.clearTimer()\n }\n\n public componentDidShow(): void {\n this.setTimer()\n }\n\n public render(): JSX.Element {\n const {\n className,\n customStyle,\n format = defaultFormat,\n isCard,\n isShowDay,\n isShowHour,\n isShowMinute\n } = this.props\n\n const { _day, _hours, _minutes, _seconds } = this.state\n\n return (\n <View\n className={classNames(\n {\n 'at-countdown': true,\n 'at-countdown--card': isCard\n },\n className\n )}\n style={customStyle}\n >\n {isShowDay && (\n <AtCountdownItem num={_day} separator={format?.day || '天'} />\n )}\n {isShowHour && (\n <AtCountdownItem num={_hours} separator={format?.hours || ''} />\n )}\n {isShowMinute && (\n <AtCountdownItem num={_minutes} separator={format?.minutes || ''} />\n )}\n <AtCountdownItem num={_seconds} separator={format?.seconds || ''} />\n </View>\n )\n }\n}\n\nAtCountdown.defaultProps = {\n customStyle: '',\n className: '',\n isCard: false,\n isShowDay: false,\n isShowHour: true,\n isShowMinute: true,\n format: defaultFormat,\n day: 0,\n hours: 0,\n minutes: 0,\n seconds: 0\n}\n\nAtCountdown.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n isCard: PropTypes.bool,\n isShowDay: PropTypes.bool,\n isShowHour: PropTypes.bool,\n isShowMinute: PropTypes.bool,\n format: PropTypes.object,\n day: PropTypes.number,\n hours: PropTypes.number,\n minutes: PropTypes.number,\n seconds: PropTypes.number,\n onTimeUp: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,OAAO,qBAAqB;AAS5B,MAAM,YAAY,CAChB,KACA,OACA,SACA,YACW,MAAM,KAAK,KAAK,KAAK,QAAQ,KAAK,KAAK,UAAU,KAAK;AAEnE,MAAM,gBAAgB;AAAA,EACpB,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX;AAEA,MAAO,oBAAkC,MAAM,UAG7C;AAAA,EAOO,YAAY,OAAyB;AAC1C,UAAM,KAAK;AACX,UAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,EAAE,IAAI,KAAK;AAC9D,SAAK,UAAU,UAAU,KAAK,OAAO,SAAS,OAAO;AACrD,UAAM;AAAA,MACJ,KAAK;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,IACX,IAAI,KAAK,cAAc;AAEvB,SAAK,QAAQ;AAAA,MACX;AAAA,M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;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX;AAEA,YAAY,YAAY;AAAA,EACtB,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACrE,WAAW,UAAU,UAAU,CAAC,UAAU,OAAO,UAAU,MAAM,CAAC;AAAA,EAClE,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,cAAc,UAAU;AAAA,EACxB,QAAQ,UAAU;AAAA,EAClB,KAAK,UAAU;AAAA,EACf,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,UAAU,UAAU;AACtB;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtCountdownItemProps } from '../../../../types/countdown';
4
+ export default class AtCountdownItem extends React.Component<AtCountdownItemProps> {
5
+ static defaultProps: AtCountdownItemProps;
6
+ static propTypes: InferProps<AtCountdownItemProps>;
7
+ private formatNum;
8
+ render(): JSX.Element;
9
+ }
@@ -0,0 +1,24 @@
1
+ import PropTypes from "prop-types";
2
+ import React from "react";
3
+ import { Text, View } from "@tarojs/components";
4
+ class AtCountdownItem extends React.Component {
5
+ formatNum(num) {
6
+ return num <= 9 ? `0${num}` : `${num}`;
7
+ }
8
+ render() {
9
+ const { num, separator } = this.props;
10
+ return /* @__PURE__ */ React.createElement(View, { className: "at-countdown__item" }, /* @__PURE__ */ React.createElement(View, { className: "at-countdown__time-box" }, /* @__PURE__ */ React.createElement(Text, { className: "at-countdown__time" }, this.formatNum(num))), /* @__PURE__ */ React.createElement(Text, { className: "at-countdown__separator" }, separator));
11
+ }
12
+ }
13
+ AtCountdownItem.defaultProps = {
14
+ num: 0,
15
+ separator: ":"
16
+ };
17
+ AtCountdownItem.propTypes = {
18
+ num: PropTypes.number.isRequired,
19
+ separator: PropTypes.string
20
+ };
21
+ export {
22
+ AtCountdownItem as default
23
+ };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/countdown/item/index.tsx"],"sourcesContent":["import PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { Text, View } from '@tarojs/components'\nimport { AtCountdownItemProps } from '../../../../types/countdown'\n\nexport default class AtCountdownItem extends React.Component<AtCountdownItemProps> {\n public static defaultProps: AtCountdownItemProps\n public static propTypes: InferProps<AtCountdownItemProps>\n\n private formatNum(num: number): string {\n return num <= 9 ? `0${num}` : `${num}`\n }\n\n public render(): JSX.Element {\n const { num, separator } = this.props\n\n return (\n <View className='at-countdown__item'>\n <View className='at-countdown__time-box'>\n <Text className='at-countdown__time'>{this.formatNum(num)}</Text>\n </View>\n <Text className='at-countdown__separator'>{separator}</Text>\n </View>\n )\n }\n}\n\nAtCountdownItem.defaultProps = {\n num: 0,\n separator: ':'\n}\n\nAtCountdownItem.propTypes = {\n num: PropTypes.number.isRequired,\n separator: PropTypes.string\n}\n"],"mappings":"AAAA,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,MAAM,YAAY;AAG3B,MAAO,wBAAsC,MAAM,UAAgC;AAAA,EAIzE,UAAU,KAAqB;AACrC,WAAO,OAAO,IAAI,IAAI,GAAG,KAAK,GAAG,GAAG;AAAA,EACtC;AAAA,EAEO,SAAsB;AAC3B,UAAM,EAAE,KAAK,UAAU,IAAI,KAAK;AAEhC,WACE,oCAAC,QAAK,WAAU,wBACd,oCAAC,QAAK,WAAU,4BACd,oCAAC,QAAK,WAAU,wBAAsB,KAAK,UAAU,GAAG,CAAE,CAC5D,GACA,oCAAC,QAAK,WAAU,6BAA2B,SAAU,CACvD;AAAA,EAEJ;AACF;AAEA,gBAAgB,eAAe;AAAA,EAC7B,KAAK;AAAA,EACL,WAAW;AACb;AAEA,gBAAgB,YAAY;AAAA,EAC1B,KAAK,UAAU,OAAO;AAAA,EACtB,WAAW,UAAU;AACvB;","names":[]}
@@ -0,0 +1,10 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtCurtainProps } from '../../../types/curtain';
4
+ export default class AtCurtain extends React.Component<AtCurtainProps> {
5
+ static defaultProps: AtCurtainProps;
6
+ static propTypes: InferProps<AtCurtainProps>;
7
+ private onClose;
8
+ private _stopPropagation;
9
+ render(): JSX.Element;
10
+ }
@@ -0,0 +1,62 @@
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { View } from "@tarojs/components";
5
+ class AtCurtain extends React.Component {
6
+ onClose(e) {
7
+ e.stopPropagation();
8
+ this.props.onClose(e);
9
+ }
10
+ _stopPropagation(e) {
11
+ e.stopPropagation();
12
+ }
13
+ render() {
14
+ const { className, customStyle, isOpened, closeBtnPosition } = this.props;
15
+ const curtainClass = classNames(
16
+ {
17
+ "at-curtain": true,
18
+ "at-curtain--closed": !isOpened
19
+ },
20
+ className
21
+ );
22
+ const btnCloseClass = classNames({
23
+ "at-curtain__btn-close": true,
24
+ [`at-curtain__btn-close--${closeBtnPosition}`]: closeBtnPosition
25
+ });
26
+ return /* @__PURE__ */ React.createElement(
27
+ View,
28
+ {
29
+ className: curtainClass,
30
+ style: customStyle,
31
+ onClick: this._stopPropagation
32
+ },
33
+ /* @__PURE__ */ React.createElement(View, { className: "at-curtain__container" }, /* @__PURE__ */ React.createElement(View, { className: "at-curtain__body" }, this.props.children, /* @__PURE__ */ React.createElement(
34
+ View,
35
+ {
36
+ className: btnCloseClass,
37
+ onClick: this.onClose.bind(this)
38
+ }
39
+ )))
40
+ );
41
+ }
42
+ }
43
+ AtCurtain.defaultProps = {
44
+ customStyle: "",
45
+ className: "",
46
+ isOpened: false,
47
+ closeBtnPosition: "bottom",
48
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
49
+ onClose: () => {
50
+ }
51
+ };
52
+ AtCurtain.propTypes = {
53
+ customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
54
+ className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
55
+ isOpened: PropTypes.bool,
56
+ closeBtnPosition: PropTypes.string,
57
+ onClose: PropTypes.func
58
+ };
59
+ export {
60
+ AtCurtain as default
61
+ };
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/curtain/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtCurtainProps } from '../../../types/curtain'\n\nexport default class AtCurtain extends React.Component<AtCurtainProps> {\n public static defaultProps: AtCurtainProps\n public static propTypes: InferProps<AtCurtainProps>\n\n private onClose(e: CommonEvent): void {\n e.stopPropagation()\n this.props.onClose(e)\n }\n\n private _stopPropagation(e: CommonEvent): void {\n e.stopPropagation()\n }\n\n public render(): JSX.Element {\n const { className, customStyle, isOpened, closeBtnPosition } = this.props\n\n const curtainClass = classNames(\n {\n 'at-curtain': true,\n 'at-curtain--closed': !isOpened\n },\n className\n )\n const btnCloseClass = classNames({\n 'at-curtain__btn-close': true,\n [`at-curtain__btn-close--${closeBtnPosition}`]: closeBtnPosition\n })\n\n return (\n <View\n className={curtainClass}\n style={customStyle}\n onClick={this._stopPropagation}\n >\n <View className='at-curtain__container'>\n <View className='at-curtain__body'>\n {this.props.children}\n <View\n className={btnCloseClass}\n onClick={this.onClose.bind(this)}\n ></View>\n </View>\n </View>\n </View>\n )\n }\n}\n\nAtCurtain.defaultProps = {\n customStyle: '',\n className: '',\n isOpened: false,\n closeBtnPosition: 'bottom',\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onClose: (): void => {}\n}\n\nAtCurtain.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n isOpened: PropTypes.bool,\n closeBtnPosition: Prop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AkB,UAAU;AAAA,EAC5B,SAAS,UAAU;AACrB;","names":[]}
@@ -0,0 +1,8 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtDividerProps } from '../../../types/divider';
4
+ export default class AtDivider extends React.Component<AtDividerProps> {
5
+ static defaultProps: AtDividerProps;
6
+ static propTypes: InferProps<AtDividerProps>;
7
+ render(): JSX.Element;
8
+ }
@@ -0,0 +1,57 @@
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { View } from "@tarojs/components";
5
+ import { mergeStyle, pxTransform } from "../../common/utils";
6
+ class AtDivider extends React.Component {
7
+ render() {
8
+ const {
9
+ className,
10
+ customStyle,
11
+ content,
12
+ height,
13
+ fontColor,
14
+ fontSize,
15
+ lineColor
16
+ } = this.props;
17
+ const rootStyle = {
18
+ height: height ? `${pxTransform(Number(height))}` : ""
19
+ };
20
+ const fontStyle = {
21
+ color: fontColor,
22
+ fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ""
23
+ };
24
+ const lineStyle = {
25
+ backgroundColor: lineColor
26
+ };
27
+ return /* @__PURE__ */ React.createElement(
28
+ View,
29
+ {
30
+ className: classNames("at-divider", className),
31
+ style: mergeStyle(rootStyle, customStyle)
32
+ },
33
+ /* @__PURE__ */ React.createElement(View, { className: "at-divider__content", style: fontStyle }, content === "" ? this.props.children : content),
34
+ /* @__PURE__ */ React.createElement(View, { className: "at-divider__line", style: lineStyle })
35
+ );
36
+ }
37
+ }
38
+ AtDivider.defaultProps = {
39
+ content: "",
40
+ height: 0,
41
+ fontColor: "",
42
+ fontSize: 0,
43
+ lineColor: ""
44
+ };
45
+ AtDivider.propTypes = {
46
+ customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
47
+ className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
48
+ content: PropTypes.string,
49
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
50
+ fontColor: PropTypes.string,
51
+ fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
52
+ lineColor: PropTypes.string
53
+ };
54
+ export {
55
+ AtDivider as default
56
+ };
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDividerProps } from '../../../types/divider'\nimport { mergeStyle, pxTransform } from '../../common/utils'\n\nexport default class AtDivider extends React.Component<AtDividerProps> {\n public static defaultProps: AtDividerProps\n public static propTypes: InferProps<AtDividerProps>\n\n public render(): JSX.Element {\n const {\n className,\n customStyle,\n content,\n height,\n fontColor,\n fontSize,\n lineColor\n } = this.props\n\n const rootStyle = {\n height: height ? `${pxTransform(Number(height))}` : ''\n }\n\n const fontStyle = {\n color: fontColor,\n fontSize: fontSize ? `${pxTransform(Number(fontSize))}` : ''\n }\n\n const lineStyle: React.CSSProperties = {\n backgroundColor: lineColor\n }\n\n return (\n <View\n className={classNames('at-divider', className)}\n style={mergeStyle(rootStyle, customStyle as object)}\n >\n <View className='at-divider__content' style={fontStyle}>\n {content === '' ? this.props.children : content}\n </View>\n <View className='at-divider__line' style={lineStyle}></View>\n </View>\n )\n }\n}\n\nAtDivider.defaultProps = {\n content: '',\n height: 0,\n fontColor: '',\n fontSize: 0,\n lineColor: ''\n}\n\nAtDivider.propTypes = {\n customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),\n content: PropTypes.string,\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n fontColor: PropTypes.string,\n fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n lineColor: PropTypes.string\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,SAAS,YAAY,mBAAm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prop-types';
2
+ import React from 'react';
3
+ import { AtDrawerProps, AtDrawerState } from '../../../types/drawer';
4
+ export default class AtDrawer extends React.Component<AtDrawerProps, AtDrawerState> {
5
+ static defaultProps: AtDrawerProps;
6
+ static propTypes: InferProps<AtDrawerProps>;
7
+ constructor(props: AtDrawerProps);
8
+ componentDidMount(): void;
9
+ private onItemClick;
10
+ private onHide;
11
+ private animHide;
12
+ private animShow;
13
+ private onMaskClick;
14
+ UNSAFE_componentWillReceiveProps(nextProps: AtDrawerProps): void;
15
+ render(): JSX.Element;
16
+ }
@@ -0,0 +1,114 @@
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { View } from "@tarojs/components";
5
+ import AtList from "../list/index";
6
+ import AtListItem from "../list/item/index";
7
+ class AtDrawer extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ this.state = {
11
+ animShow: false,
12
+ _show: props.show
13
+ };
14
+ }
15
+ componentDidMount() {
16
+ const { _show } = this.state;
17
+ if (_show) this.animShow();
18
+ }
19
+ onItemClick(index) {
20
+ this.props.onItemClick && this.props.onItemClick(index);
21
+ this.animHide();
22
+ }
23
+ onHide() {
24
+ this.setState({ _show: false }, () => {
25
+ this.props.onClose && this.props.onClose();
26
+ });
27
+ }
28
+ animHide() {
29
+ this.setState({
30
+ animShow: false
31
+ });
32
+ setTimeout(() => {
33
+ this.onHide();
34
+ }, 300);
35
+ }
36
+ animShow() {
37
+ this.setState({ _show: true });
38
+ setTimeout(() => {
39
+ this.setState({
40
+ animShow: true
41
+ });
42
+ }, 200);
43
+ }
44
+ onMaskClick() {
45
+ this.animHide();
46
+ }
47
+ UNSAFE_componentWillReceiveProps(nextProps) {
48
+ const { show } = nextProps;
49
+ if (show !== this.state._show) {
50
+ show ? this.animShow() : this.animHide();
51
+ }
52
+ }
53
+ render() {
54
+ const { mask, width, right, items } = this.props;
55
+ const { animShow, _show } = this.state;
56
+ const rootClassName = ["at-drawer"];
57
+ const maskStyle = {
58
+ display: mask ? "block" : "none",
59
+ opacity: animShow ? 1 : 0
60
+ };
61
+ const listStyle = {
62
+ width,
63
+ transition: animShow ? "all 225ms cubic-bezier(0, 0, 0.2, 1)" : "all 195ms cubic-bezier(0.4, 0, 0.6, 1)"
64
+ };
65
+ const classObject = {
66
+ "at-drawer--show": animShow,
67
+ "at-drawer--right": right,
68
+ "at-drawer--left": !right
69
+ };
70
+ return _show ? /* @__PURE__ */ React.createElement(
71
+ View,
72
+ {
73
+ className: classNames(rootClassName, classObject, this.props.className)
74
+ },
75
+ /* @__PURE__ */ React.createElement(
76
+ View,
77
+ {
78
+ className: "at-drawer__mask",
79
+ style: maskStyle,
80
+ onClick: this.onMaskClick.bind(this)
81
+ }
82
+ ),
83
+ /* @__PURE__ */ React.createElement(View, { className: "at-drawer__content", style: listStyle }, !!items && items.length ? /* @__PURE__ */ React.createElement(AtList, null, items.map((name, index) => /* @__PURE__ */ React.createElement(
84
+ AtListItem,
85
+ {
86
+ key: `${name}-${index}`,
87
+ "data-index": index,
88
+ onClick: this.onItemClick.bind(this, index),
89
+ title: name,
90
+ arrow: "right"
91
+ }
92
+ ))) : this.props.children)
93
+ ) : /* @__PURE__ */ React.createElement(View, null);
94
+ }
95
+ }
96
+ AtDrawer.defaultProps = {
97
+ show: false,
98
+ mask: true,
99
+ width: "",
100
+ right: false,
101
+ items: []
102
+ };
103
+ AtDrawer.propTypes = {
104
+ show: PropTypes.bool,
105
+ mask: PropTypes.bool,
106
+ width: PropTypes.string,
107
+ items: PropTypes.arrayOf(PropTypes.string),
108
+ onItemClick: PropTypes.func,
109
+ onClose: PropTypes.func
110
+ };
111
+ export {
112
+ AtDrawer as default
113
+ };
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/drawer/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtDrawerProps, AtDrawerState } from '../../../types/drawer'\nimport AtList from '../list/index'\nimport AtListItem from '../list/item/index'\n\nexport default class AtDrawer extends React.Component<\n AtDrawerProps,\n AtDrawerState\n> {\n public static defaultProps: AtDrawerProps\n public static propTypes: InferProps<AtDrawerProps>\n\n public constructor(props: AtDrawerProps) {\n super(props)\n this.state = {\n animShow: false,\n _show: props.show\n }\n }\n\n public componentDidMount(): void {\n const { _show } = this.state\n if (_show) this.animShow()\n }\n\n private onItemClick(index: number): void {\n this.props.onItemClick && this.props.onItemClick(index)\n this.animHide()\n }\n\n private onHide(): void {\n this.setState({ _show: false }, () => {\n this.props.onClose && this.props.onClose()\n })\n }\n\n private animHide(): void {\n this.setState({\n animShow: false\n })\n setTimeout(() => {\n this.onHide()\n }, 300)\n }\n\n private animShow(): void {\n this.setState({ _show: true })\n setTimeout(() => {\n this.setState({\n animShow: true\n })\n }, 200)\n }\n\n private onMaskClick(): void {\n this.animHide()\n }\n\n public UNSAFE_componentWillReceiveProps(nextProps: AtDrawerProps): void {\n const { show } = nextProps\n if (show !== this.state._show) {\n show ? this.animShow() : this.animHide()\n }\n }\n\n public render(): JSX.Element {\n const { mask, width, right, items } = this.props\n const { animShow, _show } = this.state\n const rootClassName = ['at-drawer']\n\n const maskStyle = {\n display: mask ? 'block' : 'none',\n opacity: animShow ? 1 : 0\n }\n const listStyle = {\n width,\n transition: animShow\n ? 'all 225ms cubic-bezier(0, 0, 0.2, 1)'\n : 'all 195ms cubic-bezier(0.4, 0, 0.6, 1)'\n }\n\n const classObject = {\n 'at-drawer--show': animShow,\n 'at-drawer--right': right,\n 'at-drawer--left': !right\n }\n\n return _show ? (\n <View\n className={classNames(rootClassName, classObject, this.props.className)}\n >\n <View\n className='at-drawer__mask'\n style={maskStyle}\n onClick={this.onMaskClick.bind(this)}\n ></View>\n\n <View className='at-drawer__content' style={listStyle}>\n {!!items && items.length ? (\n <AtList>\n {items.map((name, index) => (\n <AtListItem\n key={`${name}-${index}`}\n data-index={index}\n onClick={this.onItemClick.bind(this, index)}\n title={name}\n arrow='right'\n ></AtListItem>\n ))}\n </AtList>\n ) : (\n this.props.children\n )}\n </View>\n </View>\n ) : (\n <View></View>\n )\n }\n}\n\nAtDrawer.defaultProps = {\n show: false,\n mask: true,\n width: '',\n right: false,\n items: []\n}\n\nAtDrawer.propTypes = {\n show: PropTypes.bool,\n mask: PropTypes.bool,\n width: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.string),\n onItemClick: PropTypes.func,\n onClose: PropTypes.func\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAErB,OAAO,YAAY;AACnB,OAAO,gBAAgB;AAEvB,MAAO,iBAA+B,MAAM,UAG1C;AAAA,EAIO,YAAY,OAAsB;AACvC,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,MACV,OAAO,MAAM;AAAA,IACf;AAAA,EACF;AAAA,EAEO,oBAA0B;AAC/B,UAAM,EAAE,MAAM,IAAI,KAAK;AACvB,QAAI,MAAO,MAAK,SAAS;AAAA,EAC3B;AAAA,EAEQ,YAAY,OAAqB;AACvC,SAAK,MAAM,eAAe,KAAK,MAAM,YAAY,KAAK;AACtD,SAAK,SAAS;AAAA,EAChB;AAAA,EAEQ,SAAe;AACrB,SAAK,SAAS,EAAE,OAAO,MAAM,GAAG,MAAM;AACpC,WAAK,MAAM,WAAW,KAAK,MAAM,QAAQ;AAAA,IAC3C,CAAC;AAAA,EACH;AAAA,EAEQ,WAAiB;AACvB,SAAK,SAAS;AAAA,MACZ,UAAU;AAAA,IACZ,CAAC;AACD,eAAW,MAAM;AACf,WAAK,OAAO;AAAA,IACd,GAAG,GAAG;AAAA,EACR;AAAA,EAEQ,WAAiB;AACvB,SAAK,SAAS,EAAE,OAAO,KAAK,CAAC;AAC7B,eAAW,MAAM;AACf,WAAK,SAAS;AAAA,QACZ,UAAU;AAAA,MACZ,CAAC;AAAA,IACH,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AEV;AACF;AAEA,SAAS,eAAe;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO,CAAC;AACV;AAEA,SAAS,YAAY;AAAA,EACnB,MAAM,UAAU;AAAA,EAChB,MAAM,UAAU;AAAA,EAChB,OAAO,UAAU;AAAA,EACjB,OAAO,UAAU,QAAQ,UAAU,MAAM;AAAA,EACzC,aAAa,UAAU;AAAA,EACvB,SAAS,UAAU;AACrB;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtFabProps } from '../../../types/fab';
4
+ export default class AtFab extends React.Component<AtFabProps> {
5
+ static defaultProps: AtFabProps;
6
+ static propTypes: InferProps<AtFabProps>;
7
+ private onClick;
8
+ render(): JSX.Element;
9
+ }
@@ -0,0 +1,29 @@
1
+ import classNames from "classnames";
2
+ import PropTypes from "prop-types";
3
+ import React from "react";
4
+ import { View } from "@tarojs/components";
5
+ class AtFab extends React.Component {
6
+ onClick(e) {
7
+ if (typeof this.props.onClick === "function") {
8
+ this.props.onClick(e);
9
+ }
10
+ }
11
+ render() {
12
+ const { size, className, children } = this.props;
13
+ const rootClass = classNames("at-fab", className, {
14
+ [`at-fab--${size}`]: size
15
+ });
16
+ return /* @__PURE__ */ React.createElement(View, { className: rootClass, onClick: this.onClick.bind(this) }, children);
17
+ }
18
+ }
19
+ AtFab.propTypes = {
20
+ size: PropTypes.oneOf(["normal", "small"]),
21
+ onClick: PropTypes.func
22
+ };
23
+ AtFab.defaultProps = {
24
+ size: "normal"
25
+ };
26
+ export {
27
+ AtFab as default
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { CommonEvent } from '@tarojs/components/types/common'\nimport { AtFabProps } from '../../../types/fab'\n\nexport default class AtFab extends React.Component<AtFabProps> {\n public static defaultProps: AtFabProps\n public static propTypes: InferProps<AtFabProps>\n\n private onClick(e: CommonEvent): void {\n if (typeof this.props.onClick === 'function') {\n this.props.onClick(e)\n }\n }\n\n public render(): JSX.Element {\n const { size, className, children } = this.props\n\n const rootClass = classNames('at-fab', className, {\n [`at-fab--${size}`]: size\n })\n\n return (\n <View className={rootClass} onClick={this.onClick.bind(this)}>\n {children}\n </View>\n )\n }\n}\n\nAtFab.propTypes = {\n size: PropTypes.oneOf(['normal', 'small']),\n onClick: PropTypes.func\n}\n\nAtFab.defaultProps = {\n size: 'normal'\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAIrB,MAAO,cAA4B,MAAM,UAAsB;AAAA,EAIrD,QAAQ,GAAsB;AACpC,QAAI,OAAO,KAAK,MAAM,YAAY,YAAY;AAC5C,WAAK,MAAM,QAAQ,CAAC;AAAA,IACtB;AAAA,EACF;AAAA,EAEO,SAAsB;AAC3B,UAAM,EAAE,MAAM,WAAW,SAAS,IAAI,KAAK;AAE3C,UAAM,YAAY,WAAW,UAAU,WAAW;AAAA,MAChD,CAAC,WAAW,IAAI,EAAE,GAAG;AAAA,IACvB,CAAC;AAED,WACE,oCAAC,QAAK,WAAW,WAAW,SAAS,KAAK,QAAQ,KAAK,IAAI,KACxD,QACH;AAAA,EAEJ;AACF;AAEA,MAAM,YAAY;AAAA,EAChB,MAAM,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC;AAAA,EACzC,SAAS,UAAU;AACrB;AAEA,MAAM,eAAe;AAAA,EACnB,MAAM;AACR;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtFlexProps } from '../../../types/flex';
4
+ export default class AtFlex extends React.Component<AtFlexProps> {
5
+ static propTypes: InferProps<AtFlexProps>;
6
+ render(): JSX.Element;
7
+ }
@@ -0,0 +1,41 @@
1
+ import classNames from "classnames";
2
+ import _forEach from "lodash/forEach";
3
+ import PropTypes from "prop-types";
4
+ import React from "react";
5
+ import { View } from "@tarojs/components";
6
+ class AtFlex extends React.Component {
7
+ render() {
8
+ const rootClass = ["at-row"];
9
+ _forEach(this.props, (value, key) => {
10
+ if (key === "children") {
11
+ return;
12
+ }
13
+ if (key === "alignContent") {
14
+ return rootClass.push(`at-row--${value}`);
15
+ }
16
+ if (key === "alignContent") {
17
+ return rootClass.push(`at-row__align-content--${value}`);
18
+ }
19
+ rootClass.push(`at-row__${key}--${value}`);
20
+ });
21
+ return /* @__PURE__ */ React.createElement(View, { className: classNames(rootClass) }, this.props.children);
22
+ }
23
+ }
24
+ AtFlex.propTypes = {
25
+ wrap: PropTypes.oneOf(["no-wrap", "wrap", "wrap-reverse"]),
26
+ align: PropTypes.oneOf(["start", "end", "center", "stretch", "baseline"]),
27
+ justify: PropTypes.oneOf(["start", "end", "center", "between", "around"]),
28
+ dirction: PropTypes.oneOf(["row", "column", "row-reverse", "column-reverse"]),
29
+ alignContent: PropTypes.oneOf([
30
+ "start",
31
+ "end",
32
+ "center",
33
+ "stretch",
34
+ "between",
35
+ "around"
36
+ ])
37
+ };
38
+ export {
39
+ AtFlex as default
40
+ };
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/flex/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport _forEach from 'lodash/forEach'\nimport PropTypes, { InferProps } from 'prop-types'\nimport React from 'react'\nimport { View } from '@tarojs/components'\nimport { AtFlexProps } from '../../../types/flex'\n\nexport default class AtFlex extends React.Component<AtFlexProps> {\n public static propTypes: InferProps<AtFlexProps>\n\n public render(): JSX.Element {\n const rootClass = ['at-row']\n\n _forEach(this.props, (value, key) => {\n if (key === 'children') {\n return\n }\n if (key === 'alignContent') {\n return rootClass.push(`at-row--${value}`)\n }\n if (key === 'alignContent') {\n return rootClass.push(`at-row__align-content--${value}`)\n }\n rootClass.push(`at-row__${key}--${value}`)\n })\n\n return <View className={classNames(rootClass)}>{this.props.children}</View>\n }\n}\n\nAtFlex.propTypes = {\n wrap: PropTypes.oneOf(['no-wrap', 'wrap', 'wrap-reverse']),\n align: PropTypes.oneOf(['start', 'end', 'center', 'stretch', 'baseline']),\n justify: PropTypes.oneOf(['start', 'end', 'center', 'between', 'around']),\n dirction: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),\n alignContent: PropTypes.oneOf([\n 'start',\n 'end',\n 'center',\n 'stretch',\n 'between',\n 'around'\n ])\n}\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,eAA+B;AACtC,OAAO,WAAW;AAClB,SAAS,YAAY;AAGrB,MAAO,eAA6B,MAAM,UAAuB;AAAA,EAGxD,SAAsB;AAC3B,UAAM,YAAY,CAAC,QAAQ;AAE3B,aAAS,KAAK,OAAO,CAAC,OAAO,QAAQ;AACnC,UAAI,QAAQ,YAAY;AACtB;AAAA,MACF;AACA,UAAI,QAAQ,gBAAgB;AAC1B,eAAO,UAAU,KAAK,WAAW,KAAK,EAAE;AAAA,MAC1C;AACA,UAAI,QAAQ,gBAAgB;AAC1B,eAAO,UAAU,KAAK,0BAA0B,KAAK,EAAE;AAAA,MACzD;AACA,gBAAU,KAAK,WAAW,GAAG,KAAK,KAAK,EAAE;AAAA,IAC3C,CAAC;AAED,WAAO,oCAAC,QAAK,WAAW,WAAW,SAAS,KAAI,KAAK,MAAM,QAAS;AAAA,EACtE;AACF;AAEA,OAAO,YAAY;AAAA,EACjB,MAAM,UAAU,MAAM,CAAC,WAAW,QAAQ,cAAc,CAAC;AAAA,EACzD,OAAO,UAAU,MAAM,CAAC,SAAS,OAAO,UAAU,WAAW,UAAU,CAAC;AAAA,EACxE,SAAS,UAAU,MAAM,CAAC,SAAS,OAAO,UAAU,WAAW,QAAQ,CAAC;AAAA,EACxE,UAAU,UAAU,MAAM,CAAC,OAAO,UAAU,eAAe,gBAAgB,CAAC;AAAA,EAC5E,cAAc,UAAU,MAAM;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { InferProps } from 'prop-types';
2
+ import React from 'react';
3
+ import { AtFlexItemProps } from '../../../../types/flex';
4
+ export default class AtFlexItem extends React.Component<AtFlexItemProps> {
5
+ static propTypes: InferProps<AtFlexItemProps>;
6
+ render(): JSX.Element;
7
+ }