@trionesdev/antd-mobile-base-react 0.0.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/dist/ActionSheet/ActionSheet.d.ts +25 -0
  4. package/dist/ActionSheet/ActionSheet.js +77 -0
  5. package/dist/ActionSheet/index.d.ts +3 -0
  6. package/dist/ActionSheet/index.js +2 -0
  7. package/dist/ActionSheet/style.scss +51 -0
  8. package/dist/Alert/alert.d.ts +32 -0
  9. package/dist/Alert/alert.js +49 -0
  10. package/dist/Alert/index.d.ts +3 -0
  11. package/dist/Alert/index.js +2 -0
  12. package/dist/Alert/style.scss +69 -0
  13. package/dist/Avatar/avatar.d.ts +14 -0
  14. package/dist/Avatar/avatar.js +40 -0
  15. package/dist/Avatar/index.d.ts +3 -0
  16. package/dist/Avatar/index.js +2 -0
  17. package/dist/Avatar/style.scss +16 -0
  18. package/dist/Badge/badge.d.ts +14 -0
  19. package/dist/Badge/badge.js +82 -0
  20. package/dist/Badge/index.d.ts +3 -0
  21. package/dist/Badge/index.js +2 -0
  22. package/dist/Badge/style.scss +100 -0
  23. package/dist/Card/card.d.ts +21 -0
  24. package/dist/Card/card.js +48 -0
  25. package/dist/Card/index.d.ts +4 -0
  26. package/dist/Card/index.js +3 -0
  27. package/dist/Card/native-props.d.ts +8 -0
  28. package/dist/Card/native-props.js +27 -0
  29. package/dist/Card/style.scss +35 -0
  30. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  31. package/dist/CascaderPicker/cascader-picker.js +88 -0
  32. package/dist/CascaderPicker/index.d.ts +3 -0
  33. package/dist/CascaderPicker/index.js +2 -0
  34. package/dist/CascaderPicker/style.scss +42 -0
  35. package/dist/CascaderView/cascader-column-item.d.ts +8 -0
  36. package/dist/CascaderView/cascader-column-item.js +19 -0
  37. package/dist/CascaderView/cascader-column.d.ts +9 -0
  38. package/dist/CascaderView/cascader-column.js +26 -0
  39. package/dist/CascaderView/cascader-view.d.ts +18 -0
  40. package/dist/CascaderView/cascader-view.js +243 -0
  41. package/dist/CascaderView/index.d.ts +3 -0
  42. package/dist/CascaderView/index.js +2 -0
  43. package/dist/CascaderView/style.scss +22 -0
  44. package/dist/CascaderView/types.d.ts +11 -0
  45. package/dist/CascaderView/types.js +1 -0
  46. package/dist/Cell/CellGroup.d.ts +3 -0
  47. package/dist/Cell/CellGroup.js +41 -0
  48. package/dist/Cell/cell.d.ts +4 -0
  49. package/dist/Cell/cell.js +31 -0
  50. package/dist/Cell/index.d.ts +9 -0
  51. package/dist/Cell/index.js +5 -0
  52. package/dist/Cell/styles.scss +52 -0
  53. package/dist/Cell/types.d.ts +41 -0
  54. package/dist/Cell/types.js +1 -0
  55. package/dist/Checkbox/checkbox-button.d.ts +3 -0
  56. package/dist/Checkbox/checkbox-button.js +42 -0
  57. package/dist/Checkbox/checkbox-group.d.ts +3 -0
  58. package/dist/Checkbox/checkbox-group.js +32 -0
  59. package/dist/Checkbox/checkbox.d.ts +4 -0
  60. package/dist/Checkbox/checkbox.js +47 -0
  61. package/dist/Checkbox/group-context.d.ts +3 -0
  62. package/dist/Checkbox/group-context.js +2 -0
  63. package/dist/Checkbox/index.d.ts +11 -0
  64. package/dist/Checkbox/index.js +7 -0
  65. package/dist/Checkbox/index.scss +151 -0
  66. package/dist/Checkbox/types.d.ts +20 -0
  67. package/dist/Checkbox/types.js +1 -0
  68. package/dist/ConfigProvider/config-provider.d.ts +57 -0
  69. package/dist/ConfigProvider/config-provider.js +41 -0
  70. package/dist/ConfigProvider/index.d.ts +9 -0
  71. package/dist/ConfigProvider/index.js +6 -0
  72. package/dist/DemoBlock/index.d.ts +10 -0
  73. package/dist/DemoBlock/index.js +15 -0
  74. package/dist/DemoBlock/index.scss +20 -0
  75. package/dist/DemoDescription/index.d.ts +6 -0
  76. package/dist/DemoDescription/index.js +7 -0
  77. package/dist/DemoDescription/index.scss +3 -0
  78. package/dist/Descriptions/DescriptionItem.d.ts +5 -0
  79. package/dist/Descriptions/DescriptionItem.js +67 -0
  80. package/dist/Descriptions/Descriptions.d.ts +4 -0
  81. package/dist/Descriptions/Descriptions.js +229 -0
  82. package/dist/Descriptions/index.d.ts +9 -0
  83. package/dist/Descriptions/index.js +5 -0
  84. package/dist/Descriptions/style.scss +65 -0
  85. package/dist/Descriptions/types.d.ts +90 -0
  86. package/dist/Descriptions/types.js +1 -0
  87. package/dist/Divider/divider.d.ts +17 -0
  88. package/dist/Divider/divider.js +36 -0
  89. package/dist/Divider/index.d.ts +3 -0
  90. package/dist/Divider/index.js +2 -0
  91. package/dist/Divider/style.scss +62 -0
  92. package/dist/Ellipsis/ellipsis.d.ts +16 -0
  93. package/dist/Ellipsis/ellipsis.js +77 -0
  94. package/dist/Ellipsis/index.d.ts +3 -0
  95. package/dist/Ellipsis/index.js +2 -0
  96. package/dist/Ellipsis/style.scss +13 -0
  97. package/dist/Ellipsis/useMeasure.d.ts +2 -0
  98. package/dist/Ellipsis/useMeasure.js +123 -0
  99. package/dist/Empty/empty-icon.d.ts +3 -0
  100. package/dist/Empty/empty-icon.js +12 -0
  101. package/dist/Empty/empty.d.ts +12 -0
  102. package/dist/Empty/empty.js +48 -0
  103. package/dist/Empty/images/empty.png +0 -0
  104. package/dist/Empty/index.d.ts +3 -0
  105. package/dist/Empty/index.js +2 -0
  106. package/dist/Empty/style.scss +29 -0
  107. package/dist/ErrorBlock/create-error-block.d.ts +13 -0
  108. package/dist/ErrorBlock/create-error-block.js +44 -0
  109. package/dist/ErrorBlock/demo/base.d.ts +3 -0
  110. package/dist/ErrorBlock/demo/base.js +23 -0
  111. package/dist/ErrorBlock/error-block.d.ts +2 -0
  112. package/dist/ErrorBlock/error-block.js +9 -0
  113. package/dist/ErrorBlock/images/busy.d.ts +2 -0
  114. package/dist/ErrorBlock/images/busy.js +90 -0
  115. package/dist/ErrorBlock/images/busy.png +0 -0
  116. package/dist/ErrorBlock/images/default.d.ts +2 -0
  117. package/dist/ErrorBlock/images/default.js +166 -0
  118. package/dist/ErrorBlock/images/default.png +0 -0
  119. package/dist/ErrorBlock/images/disconnected.d.ts +2 -0
  120. package/dist/ErrorBlock/images/disconnected.js +123 -0
  121. package/dist/ErrorBlock/images/disconnected.png +0 -0
  122. package/dist/ErrorBlock/images/empty.d.ts +2 -0
  123. package/dist/ErrorBlock/images/empty.js +119 -0
  124. package/dist/ErrorBlock/images/empty.png +0 -0
  125. package/dist/ErrorBlock/images/index.d.ts +4 -0
  126. package/dist/ErrorBlock/images/index.js +4 -0
  127. package/dist/ErrorBlock/index.d.ts +7 -0
  128. package/dist/ErrorBlock/index.js +3 -0
  129. package/dist/ErrorBlock/style.scss +62 -0
  130. package/dist/Footer/footer.d.ts +20 -0
  131. package/dist/Footer/footer.js +66 -0
  132. package/dist/Footer/index.d.ts +3 -0
  133. package/dist/Footer/index.js +2 -0
  134. package/dist/Footer/style.scss +55 -0
  135. package/dist/Form/FormItem/form-item-input.d.ts +15 -0
  136. package/dist/Form/FormItem/form-item-input.js +39 -0
  137. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  138. package/dist/Form/FormItem/form-item-label.js +25 -0
  139. package/dist/Form/FormItem/form-item.d.ts +21 -0
  140. package/dist/Form/FormItem/form-item.js +70 -0
  141. package/dist/Form/FormItem/index.d.ts +5 -0
  142. package/dist/Form/FormItem/index.js +3 -0
  143. package/dist/Form/context.d.ts +12 -0
  144. package/dist/Form/context.js +6 -0
  145. package/dist/Form/form.d.ts +44 -0
  146. package/dist/Form/form.js +31 -0
  147. package/dist/Form/hooks/useForm.d.ts +2 -0
  148. package/dist/Form/hooks/useForm.js +24 -0
  149. package/dist/Form/hooks/useFormContext.d.ts +2 -0
  150. package/dist/Form/hooks/useFormContext.js +6 -0
  151. package/dist/Form/index.d.ts +12 -0
  152. package/dist/Form/index.js +8 -0
  153. package/dist/Form/interface.d.ts +3 -0
  154. package/dist/Form/interface.js +1 -0
  155. package/dist/Form/style.scss +45 -0
  156. package/dist/Grid/grid.d.ts +16 -0
  157. package/dist/Grid/grid.js +35 -0
  158. package/dist/Grid/index.d.ts +7 -0
  159. package/dist/Grid/index.js +4 -0
  160. package/dist/Grid/style.scss +17 -0
  161. package/dist/Icon/check-icon.d.ts +3 -0
  162. package/dist/Icon/check-icon.js +10 -0
  163. package/dist/Icon/demo/base.d.ts +6 -0
  164. package/dist/Icon/demo/base.js +41 -0
  165. package/dist/Input/base-input.d.ts +14 -0
  166. package/dist/Input/base-input.js +63 -0
  167. package/dist/Input/index.d.ts +12 -0
  168. package/dist/Input/index.js +9 -0
  169. package/dist/Input/index.scss +173 -0
  170. package/dist/Input/input-affix-wrapper.d.ts +8 -0
  171. package/dist/Input/input-affix-wrapper.js +50 -0
  172. package/dist/Input/input-opt.d.ts +16 -0
  173. package/dist/Input/input-opt.js +93 -0
  174. package/dist/Input/input-password.d.ts +7 -0
  175. package/dist/Input/input-password.js +47 -0
  176. package/dist/Input/input.d.ts +15 -0
  177. package/dist/Input/input.js +47 -0
  178. package/dist/Input/textarea.d.ts +13 -0
  179. package/dist/Input/textarea.js +45 -0
  180. package/dist/Input/types.d.ts +1 -0
  181. package/dist/Input/types.js +1 -0
  182. package/dist/InputNumber/index.d.ts +3 -0
  183. package/dist/InputNumber/index.js +2 -0
  184. package/dist/InputNumber/input-number.d.ts +13 -0
  185. package/dist/InputNumber/input-number.js +69 -0
  186. package/dist/InputNumber/style.scss +43 -0
  187. package/dist/Mask/index.d.ts +3 -0
  188. package/dist/Mask/index.js +2 -0
  189. package/dist/Mask/mask-modal.d.ts +45 -0
  190. package/dist/Mask/mask-modal.js +32 -0
  191. package/dist/Mask/mask.d.ts +5 -0
  192. package/dist/Mask/mask.js +19 -0
  193. package/dist/Mask/style.scss +20 -0
  194. package/dist/NavBar/index.d.ts +3 -0
  195. package/dist/NavBar/index.js +2 -0
  196. package/dist/NavBar/nav-bar.d.ts +31 -0
  197. package/dist/NavBar/nav-bar.js +36 -0
  198. package/dist/NavBar/style.scss +61 -0
  199. package/dist/NoticeBar/index.d.ts +3 -0
  200. package/dist/NoticeBar/index.js +2 -0
  201. package/dist/NoticeBar/notice-bar.d.ts +64 -0
  202. package/dist/NoticeBar/notice-bar.js +119 -0
  203. package/dist/NoticeBar/style.scss +130 -0
  204. package/dist/PageIndicator/index.d.ts +3 -0
  205. package/dist/PageIndicator/index.js +2 -0
  206. package/dist/PageIndicator/page-indicator.d.ts +10 -0
  207. package/dist/PageIndicator/page-indicator.js +27 -0
  208. package/dist/PageIndicator/style.scss +59 -0
  209. package/dist/Picker/index.d.ts +3 -0
  210. package/dist/Picker/index.js +2 -0
  211. package/dist/Picker/picker.d.ts +19 -0
  212. package/dist/Picker/picker.js +97 -0
  213. package/dist/Picker/style.scss +41 -0
  214. package/dist/PickerView/index.d.ts +4 -0
  215. package/dist/PickerView/index.js +2 -0
  216. package/dist/PickerView/picker-view-column-item.d.ts +7 -0
  217. package/dist/PickerView/picker-view-column-item.js +11 -0
  218. package/dist/PickerView/picker-view-column.d.ts +10 -0
  219. package/dist/PickerView/picker-view-column.js +117 -0
  220. package/dist/PickerView/picker-view.d.ts +12 -0
  221. package/dist/PickerView/picker-view.js +60 -0
  222. package/dist/PickerView/style.scss +72 -0
  223. package/dist/PickerView/types.d.ts +4 -0
  224. package/dist/PickerView/types.js +1 -0
  225. package/dist/Popup/index.d.ts +3 -0
  226. package/dist/Popup/index.js +2 -0
  227. package/dist/Popup/popup-modal.d.ts +52 -0
  228. package/dist/Popup/popup-modal.js +74 -0
  229. package/dist/Popup/popup.d.ts +4 -0
  230. package/dist/Popup/popup.js +56 -0
  231. package/dist/Popup/style.scss +53 -0
  232. package/dist/Radio/GroupContext.d.ts +10 -0
  233. package/dist/Radio/GroupContext.js +2 -0
  234. package/dist/Radio/RadioButton.d.ts +3 -0
  235. package/dist/Radio/RadioButton.js +60 -0
  236. package/dist/Radio/RadioGroup.d.ts +3 -0
  237. package/dist/Radio/RadioGroup.js +60 -0
  238. package/dist/Radio/index.d.ts +11 -0
  239. package/dist/Radio/index.js +14 -0
  240. package/dist/Radio/radio.d.ts +4 -0
  241. package/dist/Radio/radio.js +78 -0
  242. package/dist/Radio/style.scss +138 -0
  243. package/dist/Radio/types.d.ts +58 -0
  244. package/dist/Radio/types.js +1 -0
  245. package/dist/Rate/index.d.ts +3 -0
  246. package/dist/Rate/index.js +2 -0
  247. package/dist/Rate/rate.d.ts +50 -0
  248. package/dist/Rate/rate.js +100 -0
  249. package/dist/Rate/style.scss +37 -0
  250. package/dist/Result/demo/base.d.ts +3 -0
  251. package/dist/Result/demo/base.js +57 -0
  252. package/dist/Result/index.d.ts +3 -0
  253. package/dist/Result/index.js +2 -0
  254. package/dist/Result/result.d.ts +10 -0
  255. package/dist/Result/result.js +28 -0
  256. package/dist/Result/style.scss +73 -0
  257. package/dist/Result/use-result-icon.d.ts +2 -0
  258. package/dist/Result/use-result-icon.js +53 -0
  259. package/dist/SafeArea/index.d.ts +4 -0
  260. package/dist/SafeArea/index.js +3 -0
  261. package/dist/SafeArea/safe-area.d.ts +14 -0
  262. package/dist/SafeArea/safe-area.js +23 -0
  263. package/dist/SafeArea/style.scss +18 -0
  264. package/dist/Scaffold/index.d.ts +3 -0
  265. package/dist/Scaffold/index.js +2 -0
  266. package/dist/Scaffold/scaffold.d.ts +11 -0
  267. package/dist/Scaffold/scaffold.js +19 -0
  268. package/dist/Scaffold/style.scss +16 -0
  269. package/dist/ScrollView/index.d.ts +4 -0
  270. package/dist/ScrollView/index.js +2 -0
  271. package/dist/ScrollView/scroll-view.d.ts +4 -0
  272. package/dist/ScrollView/scroll-view.js +55 -0
  273. package/dist/ScrollView/style.scss +19 -0
  274. package/dist/ScrollView/types.d.ts +26 -0
  275. package/dist/ScrollView/types.js +1 -0
  276. package/dist/SideBar/SideBarContext.d.ts +18 -0
  277. package/dist/SideBar/SideBarContext.js +2 -0
  278. package/dist/SideBar/index.d.ts +3 -0
  279. package/dist/SideBar/index.js +2 -0
  280. package/dist/SideBar/side-bar.d.ts +25 -0
  281. package/dist/SideBar/side-bar.js +351 -0
  282. package/dist/SideBar/style.scss +85 -0
  283. package/dist/SideBar/types.d.ts +7 -0
  284. package/dist/SideBar/types.js +1 -0
  285. package/dist/Space/index.d.ts +3 -0
  286. package/dist/Space/index.js +2 -0
  287. package/dist/Space/space.d.ts +38 -0
  288. package/dist/Space/space.js +61 -0
  289. package/dist/Space/style.scss +77 -0
  290. package/dist/SpinLoading/demo/base.d.ts +3 -0
  291. package/dist/SpinLoading/demo/base.js +21 -0
  292. package/dist/SpinLoading/index.d.ts +3 -0
  293. package/dist/SpinLoading/index.js +2 -0
  294. package/dist/SpinLoading/spin-loading.d.ts +10 -0
  295. package/dist/SpinLoading/spin-loading.js +59 -0
  296. package/dist/SpinLoading/spin-loading.scss +40 -0
  297. package/dist/Steps/HorizontalSteps.d.ts +3 -0
  298. package/dist/Steps/HorizontalSteps.js +85 -0
  299. package/dist/Steps/Point.d.ts +6 -0
  300. package/dist/Steps/Point.js +13 -0
  301. package/dist/Steps/Steps.d.ts +4 -0
  302. package/dist/Steps/Steps.js +26 -0
  303. package/dist/Steps/VerticalSteps.d.ts +3 -0
  304. package/dist/Steps/VerticalSteps.js +92 -0
  305. package/dist/Steps/context.d.ts +8 -0
  306. package/dist/Steps/context.js +5 -0
  307. package/dist/Steps/index.d.ts +4 -0
  308. package/dist/Steps/index.js +2 -0
  309. package/dist/Steps/style.scss +146 -0
  310. package/dist/Steps/types.d.ts +23 -0
  311. package/dist/Steps/types.js +4 -0
  312. package/dist/Switch/index.d.ts +3 -0
  313. package/dist/Switch/index.js +2 -0
  314. package/dist/Switch/style.scss +128 -0
  315. package/dist/Switch/switch.d.ts +21 -0
  316. package/dist/Switch/switch.js +96 -0
  317. package/dist/TabBar/TabBarContext.d.ts +10 -0
  318. package/dist/TabBar/TabBarContext.js +2 -0
  319. package/dist/TabBar/demo/base.d.ts +6 -0
  320. package/dist/TabBar/demo/base.js +26 -0
  321. package/dist/TabBar/index.d.ts +7 -0
  322. package/dist/TabBar/index.js +3 -0
  323. package/dist/TabBar/index.scss +36 -0
  324. package/dist/TabBar/tab-bar.d.ts +61 -0
  325. package/dist/TabBar/tab-bar.js +86 -0
  326. package/dist/Tabs/context.d.ts +11 -0
  327. package/dist/Tabs/context.js +4 -0
  328. package/dist/Tabs/demo/base.d.ts +3 -0
  329. package/dist/Tabs/demo/base.js +59 -0
  330. package/dist/Tabs/index.d.ts +9 -0
  331. package/dist/Tabs/index.js +5 -0
  332. package/dist/Tabs/style.scss +108 -0
  333. package/dist/Tabs/tab-nav.d.ts +9 -0
  334. package/dist/Tabs/tab-nav.js +25 -0
  335. package/dist/Tabs/tab-pane.d.ts +7 -0
  336. package/dist/Tabs/tab-pane.js +17 -0
  337. package/dist/Tabs/tab.d.ts +7 -0
  338. package/dist/Tabs/tab.js +6 -0
  339. package/dist/Tabs/tabs.d.ts +25 -0
  340. package/dist/Tabs/tabs.js +156 -0
  341. package/dist/Tag/demo/base.d.ts +7 -0
  342. package/dist/Tag/demo/base.js +67 -0
  343. package/dist/Tag/demo/style.scss +8 -0
  344. package/dist/Tag/index.d.ts +3 -0
  345. package/dist/Tag/index.js +2 -0
  346. package/dist/Tag/style.scss +86 -0
  347. package/dist/Tag/tag.d.ts +30 -0
  348. package/dist/Tag/tag.js +44 -0
  349. package/dist/Toast/index.d.ts +5 -0
  350. package/dist/Toast/index.js +3 -0
  351. package/dist/Toast/style.scss +63 -0
  352. package/dist/Toast/toast-modal.d.ts +18 -0
  353. package/dist/Toast/toast-modal.js +112 -0
  354. package/dist/Toast/toast.d.ts +7 -0
  355. package/dist/Toast/toast.js +78 -0
  356. package/dist/VerificationCodeInput/demo/base.d.ts +3 -0
  357. package/dist/VerificationCodeInput/demo/base.js +11 -0
  358. package/dist/VerificationCodeInput/index.d.ts +3 -0
  359. package/dist/VerificationCodeInput/index.js +2 -0
  360. package/dist/VerificationCodeInput/style.scss +20 -0
  361. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  362. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  363. package/dist/WaterMark/index.d.ts +3 -0
  364. package/dist/WaterMark/index.js +2 -0
  365. package/dist/WaterMark/style.scss +17 -0
  366. package/dist/WaterMark/water-mark.d.ts +22 -0
  367. package/dist/WaterMark/water-mark.js +108 -0
  368. package/dist/index.d.ts +90 -0
  369. package/dist/index.js +46 -0
  370. package/dist/locales/base.d.ts +139 -0
  371. package/dist/locales/base.js +139 -0
  372. package/dist/locales/en-US.d.ts +139 -0
  373. package/dist/locales/en-US.js +4 -0
  374. package/dist/locales/zh-CN.d.ts +3 -0
  375. package/dist/locales/zh-CN.js +140 -0
  376. package/dist/style/index.d.ts +1 -0
  377. package/dist/style/index.js +5 -0
  378. package/dist/style/style.scss +52 -0
  379. package/dist/style/theme-dark.scss +24 -0
  380. package/dist/style/theme-default.scss +54 -0
  381. package/dist/style/variable.scss +168 -0
  382. package/dist/types.d.ts +9 -0
  383. package/dist/types.js +1 -0
  384. package/dist/utils/datetime-utils.d.ts +3 -0
  385. package/dist/utils/datetime-utils.js +18 -0
  386. package/dist/utils/dev-log.d.ts +3 -0
  387. package/dist/utils/dev-log.js +36 -0
  388. package/dist/utils/is-dev.d.ts +1 -0
  389. package/dist/utils/is-dev.js +1 -0
  390. package/dist/utils/merge-locale.d.ts +1 -0
  391. package/dist/utils/merge-locale.js +16 -0
  392. package/dist/utils/native-props.d.ts +10 -0
  393. package/dist/utils/native-props.js +39 -0
  394. package/dist/utils/random-utils.d.ts +3 -0
  395. package/dist/utils/random-utils.js +13 -0
  396. package/dist/utils/to-css-length.d.ts +1 -0
  397. package/dist/utils/to-css-length.js +3 -0
  398. package/dist/utils/type.d.ts +65 -0
  399. package/dist/utils/type.js +48 -0
  400. package/dist/utils/with-default-props.d.ts +9 -0
  401. package/dist/utils/with-default-props.js +33 -0
  402. package/dist/utils/with-stop-propagation.d.ts +4 -0
  403. package/dist/utils/with-stop-propagation.js +38 -0
  404. package/package.json +55 -0
@@ -0,0 +1,108 @@
1
+ @import "../style/variable";
2
+ $tabsCls: 'triones-antm-tabs';
3
+
4
+ .#{$tabsCls} {
5
+ display: flex;
6
+ flex-direction: column;
7
+ &-nav {
8
+ position: relative;
9
+ display: flex;
10
+ flex: none;
11
+ align-items: center;
12
+
13
+ &::before {
14
+ bottom: 0;
15
+ position: absolute;
16
+ right: 0;
17
+ left: 0;
18
+ border-bottom: 1Px solid #f0f0f0;
19
+ content: ' ';
20
+ }
21
+
22
+ &-wrap {
23
+ //position: relative;
24
+ //display: flex;
25
+ //flex: auto;
26
+ //align-self: stretch;
27
+ //overflow: hidden;
28
+ //white-space: nowrap;
29
+ //transform: translate(0);
30
+ width: 100%;
31
+ }
32
+
33
+ &-list {
34
+ position: relative;
35
+ display: flex;
36
+ flex: auto;
37
+ overflow-y: auto;
38
+ scrollbar-width: none;
39
+ }
40
+ }
41
+
42
+ &-ink-bar {
43
+ position: absolute;
44
+ bottom: 0;
45
+ background-color: $trionesColorPrimary;
46
+ height: 2px;
47
+ //width: 100px;
48
+ &-animated {
49
+
50
+ }
51
+ }
52
+
53
+ &-tab {
54
+ position: relative;
55
+ display: inline-flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ padding: 10Px 10Px;
59
+ font-size: 14Px;
60
+ background: transparent;
61
+ border: 0;
62
+ outline: none;
63
+ cursor: pointer;
64
+ color: rgba(0, 0, 0, 0.88);
65
+ white-space: nowrap;
66
+
67
+ &-stretch {
68
+ flex: auto;
69
+ }
70
+
71
+ &-active {
72
+ color: $trionesColorPrimary;
73
+ &::after{
74
+ content: ' ';
75
+ position: absolute;
76
+ bottom: 0;
77
+ width: calc(100% - 0.24rem * 2);
78
+ height: 0.04rem;
79
+ overflow: hidden;
80
+ font-size: 0;
81
+ border-radius: 50vh;
82
+ box-sizing: border-box;
83
+ background-color: $trionesColorPrimary;
84
+ }
85
+ }
86
+
87
+ }
88
+
89
+ &-content-holder {
90
+ flex: auto;
91
+ overflow: hidden;
92
+ .#{$tabsCls} {
93
+ &-content {
94
+ height: 100%;
95
+ }
96
+ }
97
+ }
98
+
99
+ &-tab-pane {
100
+ height: 100%;
101
+ display: none;
102
+
103
+ &-active {
104
+ display: block;
105
+ }
106
+ }
107
+ }
108
+
@@ -0,0 +1,9 @@
1
+ import React, { FC, MouseEvent } from "react";
2
+ type TabNavProps = {
3
+ label?: React.ReactNode;
4
+ active?: boolean;
5
+ stretch?: boolean;
6
+ onClick?: (e: MouseEvent<HTMLDivElement>) => void;
7
+ };
8
+ export declare const TabNav: FC<TabNavProps>;
9
+ export {};
@@ -0,0 +1,25 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import React, { useRef } from "react";
6
+ import classNames from "classnames";
7
+ var tabsCls = "triones-antm-tabs";
8
+ export var TabNav = function TabNav(_ref) {
9
+ var label = _ref.label,
10
+ active = _ref.active,
11
+ stretch = _ref.stretch,
12
+ _onClick = _ref.onClick;
13
+ var tabNavRef = useRef(null);
14
+ var tabNavInnerRef = useRef(null);
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ ref: tabNavRef,
17
+ className: classNames("".concat(tabsCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(tabsCls, "-tab-active"), active), "".concat(tabsCls, "-tab-stretch"), stretch)),
18
+ onClick: function onClick(e) {
19
+ _onClick === null || _onClick === void 0 || _onClick(e);
20
+ }
21
+ }, /*#__PURE__*/React.createElement("div", {
22
+ ref: tabNavInnerRef,
23
+ className: classNames("".concat(tabsCls, "-tab-inner"))
24
+ }, label));
25
+ };
@@ -0,0 +1,7 @@
1
+ import React, { FC } from "react";
2
+ type TabPaneProps = {
3
+ children: React.ReactNode;
4
+ tabKey: string;
5
+ };
6
+ export declare const TabPane: FC<TabPaneProps>;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import classNames from "classnames";
6
+ import React, { useContext } from "react";
7
+ import { TabsContext } from "./context";
8
+ var tabsCls = "triones-antm-tabs";
9
+ export var TabPane = function TabPane(_ref) {
10
+ var children = _ref.children,
11
+ tabKey = _ref.tabKey;
12
+ var _useContext = useContext(TabsContext),
13
+ activeKey = _useContext.activeKey;
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: classNames("".concat(tabsCls, "-tab-pane"), _defineProperty({}, "".concat(tabsCls, "-tab-pane-active"), activeKey == tabKey))
16
+ }, children);
17
+ };
@@ -0,0 +1,7 @@
1
+ import React, { FC } from "react";
2
+ export type TabItemProps = {
3
+ children?: React.ReactNode;
4
+ key: string;
5
+ label?: React.ReactNode;
6
+ };
7
+ export declare const Tab: FC<TabItemProps>;
@@ -0,0 +1,6 @@
1
+ export var Tab = function Tab(_ref) {
2
+ var children = _ref.children,
3
+ key = _ref.key,
4
+ label = _ref.label;
5
+ return null;
6
+ };
@@ -0,0 +1,25 @@
1
+ import React, { FC, MouseEvent } from 'react';
2
+ import './style.scss';
3
+ import { TabItemProps } from './tab';
4
+ export type TabsProps = {
5
+ children?: React.ReactNode;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ activeKey?: string;
9
+ defaultActiveKey?: string;
10
+ /**
11
+ * @description 是否拉伸
12
+ * @default true
13
+ */
14
+ stretch?: boolean;
15
+ items?: TabItemProps[];
16
+ /**
17
+ * @description Tab 点击回调
18
+ */
19
+ onTabClick?: (key: string, e: MouseEvent) => void;
20
+ /**
21
+ * @description 激活key变化回调
22
+ */
23
+ onChange?: (activeKey?: string) => void;
24
+ };
25
+ export declare const Tabs: FC<TabsProps>;
@@ -0,0 +1,156 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import classNames from 'classnames';
12
+ import { isEmpty, isEqual, isArray } from 'lodash';
13
+ import React, { useEffect, useReducer, useRef, useState } from 'react';
14
+ import { TabsContext } from "./context";
15
+ import "./style.scss";
16
+ import { Tab } from "./tab";
17
+ import { TabNav } from "./tab-nav";
18
+ import { TabPane } from "./tab-pane";
19
+ var tabsCls = "triones-antm-tabs";
20
+ var ITEMS_ACTION = /*#__PURE__*/function (ITEMS_ACTION) {
21
+ ITEMS_ACTION[ITEMS_ACTION["SET_ITEMS"] = 0] = "SET_ITEMS";
22
+ ITEMS_ACTION[ITEMS_ACTION["ADD_ITEM"] = 1] = "ADD_ITEM";
23
+ return ITEMS_ACTION;
24
+ }(ITEMS_ACTION || {});
25
+ export var Tabs = function Tabs(_ref) {
26
+ var _items$;
27
+ var children = _ref.children,
28
+ className = _ref.className,
29
+ style = _ref.style,
30
+ activeKey = _ref.activeKey,
31
+ defaultActiveKey = _ref.defaultActiveKey,
32
+ _ref$stretch = _ref.stretch,
33
+ stretch = _ref$stretch === void 0 ? true : _ref$stretch,
34
+ items = _ref.items,
35
+ onTabClick = _ref.onTabClick,
36
+ onChange = _ref.onChange;
37
+ var tabNavRef = useRef(null);
38
+ var _useState = useState(activeKey || defaultActiveKey || (items === null || items === void 0 || (_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.key)),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ internalActiveKey = _useState2[0],
41
+ setInternalActiveKey = _useState2[1];
42
+ var _useReducer = useReducer(function (prevState, action) {
43
+ switch (action.type) {
44
+ case ITEMS_ACTION.SET_ITEMS:
45
+ return action.payload;
46
+ case ITEMS_ACTION.ADD_ITEM:
47
+ return [].concat(_toConsumableArray(prevState), [action.payload]);
48
+ }
49
+ return prevState;
50
+ }, items || []),
51
+ _useReducer2 = _slicedToArray(_useReducer, 2),
52
+ internalItems = _useReducer2[0],
53
+ dispatch = _useReducer2[1];
54
+ var handleChange = function handleChange(activeKey) {
55
+ onChange === null || onChange === void 0 || onChange(activeKey);
56
+ };
57
+ var handleTabClick = function handleTabClick(key, e) {
58
+ onTabClick === null || onTabClick === void 0 || onTabClick(key, e);
59
+ setInternalActiveKey(key);
60
+ handleChange(key);
61
+ };
62
+ var handleSetItems = function handleSetItems(items) {
63
+ dispatch({
64
+ type: ITEMS_ACTION.SET_ITEMS,
65
+ payload: items
66
+ });
67
+ };
68
+ var handleAddItem = function handleAddItem(item) {
69
+ dispatch({
70
+ type: ITEMS_ACTION.ADD_ITEM,
71
+ payload: item
72
+ });
73
+ };
74
+ useEffect(function () {
75
+ console.log('activeKey tabs', activeKey);
76
+ if (activeKey === undefined) {
77
+ return;
78
+ }
79
+ if (activeKey === internalActiveKey) {
80
+ return;
81
+ }
82
+ setInternalActiveKey(activeKey);
83
+ }, [activeKey]);
84
+ useEffect(function () {
85
+ if (items === undefined) {
86
+ return;
87
+ }
88
+ if (isEqual(items, internalItems)) {
89
+ return;
90
+ }
91
+ handleSetItems(items);
92
+ }, [items]);
93
+ useEffect(function () {
94
+ if (internalActiveKey) {} else {
95
+ var _items$2, _items$3;
96
+ setInternalActiveKey(items === null || items === void 0 || (_items$2 = items[0]) === null || _items$2 === void 0 ? void 0 : _items$2.key);
97
+ handleChange(items === null || items === void 0 || (_items$3 = items[0]) === null || _items$3 === void 0 ? void 0 : _items$3.key);
98
+ }
99
+ }, [internalActiveKey, internalItems]);
100
+ useEffect(function () {
101
+ if (children) {
102
+ if (isArray(children)) {
103
+ var _tabItems$;
104
+ var tabItems = children.filter(function (tab) {
105
+ return tab.type === Tab;
106
+ }).map(function (tab) {
107
+ return {
108
+ key: tab.key,
109
+ label: tab.props.label,
110
+ children: tab.props.children
111
+ };
112
+ });
113
+ handleSetItems(tabItems);
114
+ setInternalActiveKey(activeKey || defaultActiveKey || (tabItems === null || tabItems === void 0 || (_tabItems$ = tabItems[0]) === null || _tabItems$ === void 0 ? void 0 : _tabItems$.key));
115
+ }
116
+ }
117
+ }, [children]);
118
+ return /*#__PURE__*/React.createElement(TabsContext.Provider, {
119
+ value: {
120
+ activeKey: internalActiveKey,
121
+ setActiveKey: setInternalActiveKey,
122
+ items: internalItems || [],
123
+ setItems: handleSetItems,
124
+ addItem: handleAddItem
125
+ }
126
+ }, /*#__PURE__*/React.createElement("div", {
127
+ className: classNames(tabsCls, className),
128
+ style: style
129
+ }, /*#__PURE__*/React.createElement("div", {
130
+ className: classNames("".concat(tabsCls, "-nav"))
131
+ }, /*#__PURE__*/React.createElement("div", {
132
+ className: classNames("".concat(tabsCls, "-nav-wrap"))
133
+ }, /*#__PURE__*/React.createElement("div", {
134
+ ref: tabNavRef,
135
+ className: classNames("".concat(tabsCls, "-nav-list"))
136
+ }, !isEmpty(internalItems) && (internalItems === null || internalItems === void 0 ? void 0 : internalItems.map(function (item, index) {
137
+ return /*#__PURE__*/React.createElement(TabNav, {
138
+ active: internalActiveKey === item.key,
139
+ stretch: stretch,
140
+ label: item.label,
141
+ key: "tab-nav-".concat(index),
142
+ onClick: function onClick(e) {
143
+ handleTabClick(item.key, e);
144
+ }
145
+ });
146
+ }))))), /*#__PURE__*/React.createElement("div", {
147
+ className: classNames("".concat(tabsCls, "-content-holder"))
148
+ }, /*#__PURE__*/React.createElement("div", {
149
+ className: classNames("".concat(tabsCls, "-content"))
150
+ }, !isEmpty(internalItems) && (internalItems === null || internalItems === void 0 ? void 0 : internalItems.map(function (item, index) {
151
+ return /*#__PURE__*/React.createElement(TabPane, {
152
+ key: "tab-panel-".concat(item.key),
153
+ tabKey: item.key
154
+ }, item.children);
155
+ }))))));
156
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * compact: true
3
+ */
4
+ import React from 'react';
5
+ import './style.scss';
6
+ declare const _default: () => React.JSX.Element;
7
+ export default _default;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * compact: true
3
+ */
4
+ import React from 'react';
5
+ import "./style.scss";
6
+ import { DemoBlock } from "../../DemoBlock";
7
+ import Tag from "../index";
8
+ export default (function () {
9
+ var clsPrefix = 'tag-demo-style';
10
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
11
+ title: "\u57FA\u7840\u7528\u6CD5"
12
+ }, /*#__PURE__*/React.createElement("div", {
13
+ className: "".concat(clsPrefix, "-content")
14
+ }, /*#__PURE__*/React.createElement(Tag, null, "Default"))), /*#__PURE__*/React.createElement(DemoBlock, {
15
+ title: "\u7EBF\u6846\u6807\u7B7E"
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: "".concat(clsPrefix, "-content")
18
+ }, /*#__PURE__*/React.createElement(Tag, {
19
+ fill: "outline",
20
+ color: "default"
21
+ }, "Default"), /*#__PURE__*/React.createElement(Tag, {
22
+ fill: "outline",
23
+ color: "primary"
24
+ }, "Primary"), /*#__PURE__*/React.createElement(Tag, {
25
+ fill: "outline",
26
+ color: "success"
27
+ }, "Success"), /*#__PURE__*/React.createElement(Tag, {
28
+ fill: "outline",
29
+ color: "warning"
30
+ }, "Warning"), /*#__PURE__*/React.createElement(Tag, {
31
+ fill: "outline",
32
+ color: "danger"
33
+ }, "Danger"))), /*#__PURE__*/React.createElement(DemoBlock, {
34
+ title: "\u8BED\u4E49\u6807\u7B7E"
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: "".concat(clsPrefix, "-content")
37
+ }, /*#__PURE__*/React.createElement(Tag, {
38
+ color: "default"
39
+ }, "Default"), /*#__PURE__*/React.createElement(Tag, {
40
+ color: "primary"
41
+ }, "Primary"), /*#__PURE__*/React.createElement(Tag, {
42
+ color: "success"
43
+ }, "Success"), /*#__PURE__*/React.createElement(Tag, {
44
+ color: "warning"
45
+ }, "Warning"), /*#__PURE__*/React.createElement(Tag, {
46
+ color: "danger"
47
+ }, "Danger"))), /*#__PURE__*/React.createElement(DemoBlock, {
48
+ title: "\u5706\u89D2\u6807\u7B7E"
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ className: "".concat(clsPrefix, "-content")
51
+ }, /*#__PURE__*/React.createElement(Tag, {
52
+ color: "default",
53
+ round: true
54
+ }, "Default"))), /*#__PURE__*/React.createElement(DemoBlock, {
55
+ title: "\u81EA\u5B9A\u4E49\u989C\u8272"
56
+ }, /*#__PURE__*/React.createElement("div", {
57
+ className: "".concat(clsPrefix, "-content")
58
+ }, /*#__PURE__*/React.createElement(Tag, {
59
+ color: "#f50"
60
+ }, "#f50"), /*#__PURE__*/React.createElement(Tag, {
61
+ color: "#2db7f5"
62
+ }, "#2db7f5"), /*#__PURE__*/React.createElement(Tag, {
63
+ color: "#87d068"
64
+ }, "#87d068"), /*#__PURE__*/React.createElement(Tag, {
65
+ color: "#108ee9"
66
+ }, "#108ee9"))));
67
+ });
@@ -0,0 +1,8 @@
1
+ .tag-demo-style {
2
+ &-content {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ gap: 8px;
6
+ row-gap: 8px;
7
+ }
8
+ }
@@ -0,0 +1,3 @@
1
+ import { Tag, TagProps } from "./tag";
2
+ export type { TagProps };
3
+ export default Tag;
@@ -0,0 +1,2 @@
1
+ import { Tag } from "./tag";
2
+ export default Tag;
@@ -0,0 +1,86 @@
1
+ @import "../style/variable";
2
+ $tagCls: 'triones-antm-tag';
3
+
4
+ .#{$tagCls} {
5
+ display: inline-block;
6
+ align-items: center;
7
+ padding: 2Px 8Px;
8
+ font-size: 11Px;
9
+ line-height: 1.2;
10
+ border-radius: $trionesBorderRadius;
11
+ box-sizing: border-box;
12
+ white-space: nowrap;
13
+
14
+ &-square {
15
+ border-radius: 0;
16
+ }
17
+
18
+ &-round {
19
+ border-radius: 12px;
20
+ }
21
+
22
+ // Default variant styles
23
+ &-default {
24
+ &.#{$tagCls}-solid {
25
+ background: #666;
26
+ color: #fff;
27
+ }
28
+ &.#{$tagCls}-outline {
29
+ color: #666;
30
+ border: 1px solid #666;
31
+ background: transparent;
32
+ }
33
+ }
34
+
35
+ // Primary variant styles
36
+ &-primary {
37
+ &.#{$tagCls}-solid {
38
+ background: $trionesColorPrimary;
39
+ color: #fff;
40
+ }
41
+ &.#{$tagCls}-outline {
42
+ color: $trionesColorPrimary;
43
+ border: 1px solid $trionesColorPrimary;
44
+ background: transparent;
45
+ }
46
+ }
47
+
48
+ // Success variant styles
49
+ &-success {
50
+ &.#{$tagCls}-solid {
51
+ background: $trionesColorSuccess;
52
+ color: #fff;
53
+ }
54
+ &.#{$tagCls}-outline {
55
+ color: $trionesColorSuccess;
56
+ border: 1px solid $trionesColorSuccess;
57
+ background: transparent;
58
+ }
59
+ }
60
+
61
+ // Warning variant styles
62
+ &-warning {
63
+ &.#{$tagCls}-solid {
64
+ background: $trionesColorWarning;
65
+ color: #fff;
66
+ }
67
+ &.#{$tagCls}-outline {
68
+ color: $trionesColorWarning;
69
+ border: 1px solid $trionesColorWarning;
70
+ background: transparent;
71
+ }
72
+ }
73
+
74
+ // Danger variant styles
75
+ &-danger {
76
+ &.#{$tagCls}-solid {
77
+ background: $trionesColorError;
78
+ color: #fff;
79
+ }
80
+ &.#{$tagCls}-outline {
81
+ color: $trionesColorError;
82
+ border: 1px solid $trionesColorError;
83
+ background: transparent;
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,30 @@
1
+ import React, { FC } from 'react';
2
+ import './style.scss';
3
+ export type TagProps = {
4
+ children?: React.ReactNode;
5
+ /**
6
+ * 标签色
7
+ */
8
+ color?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | string;
9
+ /**
10
+ * 填充模式
11
+ */
12
+ fill?: 'solid' | 'outline';
13
+ /**
14
+ * 点击时的回调
15
+ */
16
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
17
+ /**
18
+ * 是否圆角
19
+ */
20
+ round?: boolean;
21
+ /**
22
+ * 自定义类名
23
+ */
24
+ className?: string;
25
+ /**
26
+ * 自定义样式
27
+ */
28
+ style?: React.CSSProperties;
29
+ };
30
+ export declare const Tag: FC<TagProps>;
@@ -0,0 +1,44 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["children", "color", "fill", "onClick", "className", "style", "round"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ import classNames from 'classnames';
12
+ import React from 'react';
13
+ import "./style.scss";
14
+ export var Tag = function Tag(_ref) {
15
+ var children = _ref.children,
16
+ _ref$color = _ref.color,
17
+ color = _ref$color === void 0 ? 'default' : _ref$color,
18
+ _ref$fill = _ref.fill,
19
+ fill = _ref$fill === void 0 ? 'solid' : _ref$fill,
20
+ onClick = _ref.onClick,
21
+ className = _ref.className,
22
+ style = _ref.style,
23
+ _ref$round = _ref.round,
24
+ round = _ref$round === void 0 ? false : _ref$round,
25
+ props = _objectWithoutProperties(_ref, _excluded);
26
+ var clsPrefix = 'triones-antm-tag';
27
+
28
+ // 是否是预设颜色
29
+ var isPresetColor = ['default', 'primary', 'success', 'warning', 'danger'].includes(color);
30
+ var customStyle = !isPresetColor ? _objectSpread(_objectSpread({}, fill === 'solid' ? {
31
+ backgroundColor: color,
32
+ color: '#fff'
33
+ } : {
34
+ color: color,
35
+ borderColor: color,
36
+ backgroundColor: 'transparent'
37
+ }), style) : style;
38
+ return /*#__PURE__*/React.createElement("div", _extends({
39
+ className: classNames(clsPrefix, _defineProperty(_defineProperty(_defineProperty({}, "".concat(clsPrefix, "-").concat(color), isPresetColor), "".concat(clsPrefix, "-").concat(fill), fill), "".concat(clsPrefix, "-").concat(round ? 'round' : 'square'), round), className),
40
+ style: customStyle
41
+ }, props, {
42
+ onClick: onClick
43
+ }), children);
44
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ToastProps } from "./toast";
3
+ declare const Toast: import("react").FC<ToastProps>;
4
+ export type { ToastProps };
5
+ export default Toast;
@@ -0,0 +1,3 @@
1
+ import { InternalToast } from "./toast";
2
+ var Toast = InternalToast;
3
+ export default Toast;