@para-ui/core 2.1.32 → 2.1.35

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 (556) hide show
  1. package/.eslintignore +12 -0
  2. package/README.md +31 -0
  3. package/babel.config.js +7 -0
  4. package/docs/App.tsx +277 -0
  5. package/docs/Router.tsx +79 -0
  6. package/docs/assets/1.jpeg +0 -0
  7. package/docs/assets/P.svg +1 -0
  8. package/docs/assets/icon.ico +0 -0
  9. package/docs/assets/icon.png +0 -0
  10. package/docs/assets/logo.png +0 -0
  11. package/docs/config/interceptors.ts +73 -0
  12. package/docs/config/router.tsx +212 -0
  13. package/docs/context/global.tsx +65 -0
  14. package/docs/index.tsx +42 -0
  15. package/docs/locale/index.ts +64 -0
  16. package/docs/locale/lang/en_US.ts +16 -0
  17. package/docs/locale/lang/zh_CN.ts +16 -0
  18. package/docs/react-app-env.d.ts +18 -0
  19. package/docs/services/api.ts +6 -0
  20. package/docs/styles/index.scss +31 -0
  21. package/docs/view/autoBox/api.tsx +67 -0
  22. package/docs/view/autoBox/codeString.tsx +137 -0
  23. package/docs/view/autoBox/index.scss +15 -0
  24. package/docs/view/autoBox/index.tsx +97 -0
  25. package/docs/view/autoTips/api.tsx +49 -0
  26. package/docs/view/autoTips/codeString.tsx +34 -0
  27. package/{Tree/utils/closestPolyfill.d.ts → docs/view/autoTips/index.scss} +0 -0
  28. package/docs/view/autoTips/index.tsx +53 -0
  29. package/docs/view/breadcrumbs/api.tsx +72 -0
  30. package/docs/view/breadcrumbs/codeString.tsx +160 -0
  31. package/docs/view/breadcrumbs/index.scss +14 -0
  32. package/docs/view/breadcrumbs/index.tsx +173 -0
  33. package/docs/view/button/api.tsx +131 -0
  34. package/docs/view/button/codeString.tsx +153 -0
  35. package/docs/view/button/index.scss +23 -0
  36. package/docs/view/button/index.tsx +165 -0
  37. package/docs/view/buttonGroup/api.tsx +55 -0
  38. package/docs/view/buttonGroup/codeString.tsx +108 -0
  39. package/docs/view/buttonGroup/index.scss +9 -0
  40. package/docs/view/buttonGroup/index.tsx +93 -0
  41. package/docs/view/carousel/api.tsx +165 -0
  42. package/docs/view/carousel/codeString.tsx +207 -0
  43. package/docs/view/carousel/index.scss +12 -0
  44. package/docs/view/carousel/index.tsx +174 -0
  45. package/docs/view/cascader/api.tsx +116 -0
  46. package/docs/view/cascader/codeString.tsx +584 -0
  47. package/docs/view/cascader/index.scss +0 -0
  48. package/docs/view/cascader/index.tsx +261 -0
  49. package/docs/view/checkbox/api.tsx +148 -0
  50. package/docs/view/checkbox/codeString.tsx +215 -0
  51. package/docs/view/checkbox/index.scss +0 -0
  52. package/docs/view/checkbox/index.tsx +233 -0
  53. package/docs/view/collapse/api.tsx +109 -0
  54. package/docs/view/collapse/codeString.tsx +186 -0
  55. package/docs/view/collapse/index.scss +0 -0
  56. package/docs/view/collapse/index.tsx +171 -0
  57. package/docs/view/colorPicker/api.tsx +30 -0
  58. package/docs/view/colorPicker/codeString.tsx +58 -0
  59. package/docs/view/colorPicker/index.scss +5 -0
  60. package/docs/view/colorPicker/index.tsx +39 -0
  61. package/docs/view/comboSelect/api.tsx +255 -0
  62. package/docs/view/comboSelect/codeString.tsx +629 -0
  63. package/docs/view/comboSelect/index.scss +5 -0
  64. package/docs/view/comboSelect/index.tsx +402 -0
  65. package/docs/view/container/api.tsx +61 -0
  66. package/docs/view/container/codeString.tsx +64 -0
  67. package/docs/view/container/index.scss +0 -0
  68. package/docs/view/container/index.tsx +84 -0
  69. package/docs/view/datePicker/api.tsx +264 -0
  70. package/docs/view/datePicker/codeString.tsx +185 -0
  71. package/docs/view/datePicker/index.scss +8 -0
  72. package/docs/view/datePicker/index.tsx +205 -0
  73. package/docs/view/drawer/api.tsx +123 -0
  74. package/docs/view/drawer/codeString.tsx +122 -0
  75. package/docs/view/drawer/index.scss +5 -0
  76. package/docs/view/drawer/index.tsx +200 -0
  77. package/docs/view/empty/api.tsx +57 -0
  78. package/docs/view/empty/codeString.tsx +38 -0
  79. package/docs/view/empty/index.scss +11 -0
  80. package/docs/view/empty/index.tsx +43 -0
  81. package/docs/view/form/api.tsx +266 -0
  82. package/docs/view/form/codeString.tsx +203 -0
  83. package/docs/view/form/index.scss +0 -0
  84. package/docs/view/form/index.tsx +225 -0
  85. package/docs/view/help/api.tsx +58 -0
  86. package/docs/view/help/codeString.tsx +39 -0
  87. package/docs/view/help/index.scss +5 -0
  88. package/docs/view/help/index.tsx +40 -0
  89. package/docs/view/helperText/api.tsx +31 -0
  90. package/docs/view/helperText/codeString.tsx +16 -0
  91. package/docs/view/helperText/index.scss +0 -0
  92. package/docs/view/helperText/index.tsx +33 -0
  93. package/docs/view/home/index.scss +55 -0
  94. package/docs/view/home/index.tsx +119 -0
  95. package/docs/view/icons/index.scss +48 -0
  96. package/docs/view/icons/index.tsx +87 -0
  97. package/docs/view/inputLang/api.tsx +99 -0
  98. package/docs/view/inputLang/codeString.tsx +66 -0
  99. package/docs/view/inputLang/index.scss +0 -0
  100. package/docs/view/inputLang/index.tsx +85 -0
  101. package/docs/view/inputNumber/api.tsx +169 -0
  102. package/docs/view/inputNumber/codeString.tsx +129 -0
  103. package/docs/view/inputNumber/index.scss +0 -0
  104. package/docs/view/inputNumber/index.tsx +141 -0
  105. package/docs/view/label/api.tsx +63 -0
  106. package/docs/view/label/codeString.tsx +63 -0
  107. package/docs/view/label/index.scss +0 -0
  108. package/docs/view/label/index.tsx +82 -0
  109. package/docs/view/loading/api.tsx +26 -0
  110. package/docs/view/loading/codeString.tsx +13 -0
  111. package/docs/view/loading/index.scss +0 -0
  112. package/docs/view/loading/index.tsx +38 -0
  113. package/docs/view/menu/api.tsx +227 -0
  114. package/docs/view/menu/codeString.tsx +302 -0
  115. package/docs/view/menu/index.scss +42 -0
  116. package/docs/view/menu/index.tsx +289 -0
  117. package/docs/view/message/api.tsx +35 -0
  118. package/docs/view/message/codeString.tsx +73 -0
  119. package/docs/view/message/index.scss +7 -0
  120. package/docs/view/message/index.tsx +64 -0
  121. package/docs/view/modal/api.tsx +141 -0
  122. package/docs/view/modal/codeString.tsx +222 -0
  123. package/docs/view/modal/index.scss +9 -0
  124. package/docs/view/modal/index.tsx +222 -0
  125. package/docs/view/multiBox/api.tsx +99 -0
  126. package/docs/view/multiBox/codeString.tsx +104 -0
  127. package/docs/view/multiBox/index.scss +0 -0
  128. package/docs/view/multiBox/index.tsx +123 -0
  129. package/docs/view/notification/api.tsx +148 -0
  130. package/docs/view/notification/codeString.tsx +110 -0
  131. package/docs/view/notification/index.scss +9 -0
  132. package/docs/view/notification/index.tsx +118 -0
  133. package/docs/view/operateBtn/api.tsx +127 -0
  134. package/docs/view/operateBtn/codeString.tsx +165 -0
  135. package/docs/view/operateBtn/index.scss +0 -0
  136. package/docs/view/operateBtn/index.tsx +160 -0
  137. package/docs/view/pageHeader/api.tsx +321 -0
  138. package/docs/view/pageHeader/codeString.tsx +252 -0
  139. package/docs/view/pageHeader/index.scss +6 -0
  140. package/docs/view/pageHeader/index.tsx +291 -0
  141. package/docs/view/pagination/api.tsx +71 -0
  142. package/docs/view/pagination/codeString.tsx +45 -0
  143. package/docs/view/pagination/index.scss +0 -0
  144. package/docs/view/pagination/index.tsx +54 -0
  145. package/docs/view/popConfirm/api.tsx +96 -0
  146. package/docs/view/popConfirm/codeString.tsx +130 -0
  147. package/docs/view/popConfirm/index.scss +33 -0
  148. package/docs/view/popConfirm/index.tsx +167 -0
  149. package/docs/view/popover/api.tsx +80 -0
  150. package/docs/view/popover/codeString.tsx +40 -0
  151. package/docs/view/popover/index.scss +4 -0
  152. package/docs/view/popover/index.tsx +53 -0
  153. package/docs/view/querying/api.tsx +46 -0
  154. package/docs/view/querying/codeString.tsx +28 -0
  155. package/docs/view/querying/index.scss +11 -0
  156. package/docs/view/querying/index.tsx +35 -0
  157. package/docs/view/radio/api.tsx +142 -0
  158. package/docs/view/radio/codeString.tsx +136 -0
  159. package/docs/view/radio/index.scss +0 -0
  160. package/docs/view/radio/index.tsx +154 -0
  161. package/docs/view/search/api.tsx +132 -0
  162. package/docs/view/search/codeString.tsx +164 -0
  163. package/docs/view/search/index.scss +0 -0
  164. package/docs/view/search/index.tsx +142 -0
  165. package/docs/view/select/api.tsx +195 -0
  166. package/docs/view/select/codeString.tsx +379 -0
  167. package/docs/view/select/index.scss +12 -0
  168. package/docs/view/select/index.tsx +370 -0
  169. package/docs/view/selectInput/api.tsx +161 -0
  170. package/docs/view/selectInput/codeString.tsx +171 -0
  171. package/docs/view/selectInput/index.scss +12 -0
  172. package/docs/view/selectInput/index.tsx +167 -0
  173. package/docs/view/singleBox/api.tsx +89 -0
  174. package/docs/view/singleBox/codeString.tsx +94 -0
  175. package/docs/view/singleBox/index.scss +0 -0
  176. package/docs/view/singleBox/index.tsx +111 -0
  177. package/docs/view/slider/api.tsx +135 -0
  178. package/docs/view/slider/codeString.tsx +99 -0
  179. package/docs/view/slider/index.scss +11 -0
  180. package/docs/view/slider/index.tsx +95 -0
  181. package/docs/view/stepper/api.tsx +49 -0
  182. package/docs/view/stepper/codeString.tsx +64 -0
  183. package/docs/view/stepper/index.scss +3 -0
  184. package/docs/view/stepper/index.tsx +57 -0
  185. package/docs/view/switch/api.tsx +70 -0
  186. package/docs/view/switch/codeString.tsx +48 -0
  187. package/docs/view/switch/index.scss +16 -0
  188. package/docs/view/switch/index.tsx +50 -0
  189. package/docs/view/table/api.tsx +330 -0
  190. package/docs/view/table/codeString.tsx +737 -0
  191. package/docs/view/table/index.scss +0 -0
  192. package/docs/view/table/index.tsx +549 -0
  193. package/docs/view/tabs/api.tsx +106 -0
  194. package/docs/view/tabs/codeString.tsx +243 -0
  195. package/docs/view/tabs/index.scss +5 -0
  196. package/docs/view/tabs/index.tsx +132 -0
  197. package/docs/view/tag/api.tsx +119 -0
  198. package/docs/view/tag/codeString.tsx +95 -0
  199. package/docs/view/tag/index.scss +5 -0
  200. package/docs/view/tag/index.tsx +91 -0
  201. package/docs/view/textField/api.tsx +229 -0
  202. package/docs/view/textField/codeString.tsx +251 -0
  203. package/docs/view/textField/index.scss +3 -0
  204. package/docs/view/textField/index.tsx +327 -0
  205. package/docs/view/timeLine/api.tsx +43 -0
  206. package/docs/view/timeLine/codeString.tsx +85 -0
  207. package/docs/view/timeLine/index.scss +5 -0
  208. package/docs/view/timeLine/index.tsx +73 -0
  209. package/docs/view/timePicker/api.tsx +178 -0
  210. package/docs/view/timePicker/codeString.tsx +66 -0
  211. package/docs/view/timePicker/index.scss +8 -0
  212. package/docs/view/timePicker/index.tsx +75 -0
  213. package/docs/view/toggleButton/api.tsx +100 -0
  214. package/docs/view/toggleButton/codeString.tsx +152 -0
  215. package/docs/view/toggleButton/index.scss +5 -0
  216. package/docs/view/toggleButton/index.tsx +108 -0
  217. package/docs/view/toolTip/api.tsx +96 -0
  218. package/docs/view/toolTip/codeString.tsx +42 -0
  219. package/docs/view/toolTip/index.scss +5 -0
  220. package/docs/view/toolTip/index.tsx +44 -0
  221. package/docs/view/transfer/api.tsx +33 -0
  222. package/docs/view/transfer/codeString.tsx +44 -0
  223. package/docs/view/transfer/index.scss +0 -0
  224. package/docs/view/transfer/index.tsx +59 -0
  225. package/docs/view/tree/api.tsx +413 -0
  226. package/docs/view/tree/codeString.tsx +437 -0
  227. package/docs/view/tree/index.scss +5 -0
  228. package/docs/view/tree/index.tsx +362 -0
  229. package/docs/view/upload/api.tsx +302 -0
  230. package/docs/view/upload/codeString.tsx +248 -0
  231. package/docs/view/upload/index.scss +7 -0
  232. package/docs/view/upload/index.tsx +207 -0
  233. package/package.json +1 -1
  234. package/publish.sh +5 -0
  235. package/run.js +43 -0
  236. package/scripts/extract-css.js +9 -0
  237. package/temp/main.js +1103 -0
  238. package/{style.css → temp/style.css} +5 -5
  239. package/tsconfig.json +40 -0
  240. package/webpack.cdn.config.js +81 -0
  241. package/webpack.config.js +249 -0
  242. package/webpack.extract.css.js +86 -0
  243. package/AutoBox/index.d.ts +0 -34
  244. package/AutoBox/index.js +0 -28
  245. package/AutoTips/index.d.ts +0 -25
  246. package/AutoTips/index.js +0 -15
  247. package/Breadcrumbs/index.d.ts +0 -39
  248. package/Breadcrumbs/index.js +0 -28
  249. package/Button/SplitButton.d.ts +0 -56
  250. package/Button/index.d.ts +0 -56
  251. package/Button/index.js +0 -53
  252. package/Button/lang/en_US.d.ts +0 -4
  253. package/Button/lang/index.d.ts +0 -9
  254. package/Button/lang/zh_CN.d.ts +0 -4
  255. package/ButtonGroup/index.d.ts +0 -33
  256. package/ButtonGroup/index.js +0 -53
  257. package/Carousel/index.d.ts +0 -30
  258. package/Carousel/index.js +0 -15
  259. package/Cascader/index.d.ts +0 -52
  260. package/Cascader/index.js +0 -41
  261. package/Cascader/lang/en_US.d.ts +0 -4
  262. package/Cascader/lang/index.d.ts +0 -9
  263. package/Cascader/lang/zh_CN.d.ts +0 -4
  264. package/Checkbox/index.d.ts +0 -40
  265. package/Checkbox/index.js +0 -27
  266. package/CheckboxGroup/index.d.ts +0 -46
  267. package/CheckboxGroup/index.js +0 -27
  268. package/Collapse/collapsePanel.d.ts +0 -30
  269. package/Collapse/index.d.ts +0 -57
  270. package/Collapse/index.js +0 -28
  271. package/Collapse/motion.d.ts +0 -5
  272. package/Collapse/util.d.ts +0 -11
  273. package/ColorPicker/index.d.ts +0 -4
  274. package/ColorPicker/index.js +0 -1
  275. package/ComBox/index.d.ts +0 -16
  276. package/ComBox/index.js +0 -16
  277. package/ComBox/interface.d.ts +0 -5
  278. package/ComboSelect/WithTabsCombo/index.d.ts +0 -11
  279. package/ComboSelect/WithTabsCombo/interface.d.ts +0 -141
  280. package/ComboSelect/index.d.ts +0 -11
  281. package/ComboSelect/index.js +0 -391
  282. package/ComboSelect/interface.d.ts +0 -139
  283. package/ComboSelect/lang/en_US.d.ts +0 -8
  284. package/ComboSelect/lang/index.d.ts +0 -17
  285. package/ComboSelect/lang/zh_CN.d.ts +0 -8
  286. package/ComboSelect/utils.d.ts +0 -13
  287. package/Container/index.d.ts +0 -77
  288. package/Container/index.js +0 -15
  289. package/DatePicker/PickerButton.d.ts +0 -3
  290. package/DatePicker/PickerTag.d.ts +0 -3
  291. package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
  292. package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
  293. package/DatePicker/generatePicker/index.d.ts +0 -77
  294. package/DatePicker/index.d.ts +0 -18
  295. package/DatePicker/index.js +0 -144
  296. package/DatePicker/lang/en_US.d.ts +0 -3
  297. package/DatePicker/lang/index.d.ts +0 -7
  298. package/DatePicker/lang/zh_CN.d.ts +0 -3
  299. package/DatePicker/util.d.ts +0 -20
  300. package/Desktop/index.d.ts +0 -55
  301. package/Desktop/index.js +0 -14
  302. package/Drawer/index.d.ts +0 -11
  303. package/Drawer/index.js +0 -53
  304. package/Drawer/interface.d.ts +0 -78
  305. package/Drawer/lang/en_US.d.ts +0 -5
  306. package/Drawer/lang/index.d.ts +0 -11
  307. package/Drawer/lang/zh_CN.d.ts +0 -5
  308. package/Empty/images/index.d.ts +0 -2
  309. package/Empty/index.d.ts +0 -29
  310. package/Empty/index.js +0 -14
  311. package/Empty/lang/en_US.d.ts +0 -6
  312. package/Empty/lang/index.d.ts +0 -13
  313. package/Empty/lang/zh_CN.d.ts +0 -6
  314. package/Form/index.d.ts +0 -154
  315. package/Form/index.js +0 -209
  316. package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
  317. package/FormItem/compoments/formFile/index.d.ts +0 -38
  318. package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
  319. package/FormItem/compoments/formSelect/index.d.ts +0 -18
  320. package/FormItem/errorTips.d.ts +0 -10
  321. package/FormItem/index.d.ts +0 -130
  322. package/FormItem/index.js +0 -209
  323. package/FormItem/itemType.d.ts +0 -42
  324. package/FormItem/validateFunction.d.ts +0 -15
  325. package/FunctionModal/dialog.d.ts +0 -58
  326. package/FunctionModal/index.d.ts +0 -8
  327. package/FunctionModal/index.js +0 -118
  328. package/FunctionModal/modalContext.d.ts +0 -14
  329. package/GlobalContext/componentsProps.d.ts +0 -15
  330. package/GlobalContext/confirmLocale.d.ts +0 -7
  331. package/GlobalContext/index.d.ts +0 -28
  332. package/GlobalContext/index.js +0 -16
  333. package/GlobalContext/intl.d.ts +0 -34
  334. package/GlobalContext/useFormatMessage.d.ts +0 -3
  335. package/Help/index.d.ts +0 -20
  336. package/Help/index.js +0 -28
  337. package/HelperText/index.d.ts +0 -19
  338. package/HelperText/index.js +0 -15
  339. package/InputLang/index.d.ts +0 -49
  340. package/InputLang/index.js +0 -118
  341. package/InputNumber/index.d.ts +0 -74
  342. package/InputNumber/index.js +0 -79
  343. package/Label/index.d.ts +0 -35
  344. package/Label/index.js +0 -27
  345. package/Loading/index.d.ts +0 -17
  346. package/Loading/index.js +0 -28
  347. package/Menu/footerExpansion.d.ts +0 -9
  348. package/Menu/index.d.ts +0 -10
  349. package/Menu/index.js +0 -53
  350. package/Menu/interface.d.ts +0 -137
  351. package/Menu/logo.d.ts +0 -9
  352. package/Menu/verticalMenuList.d.ts +0 -14
  353. package/Message/index.d.ts +0 -59
  354. package/Message/index.js +0 -67
  355. package/Modal/Confirm/index.d.ts +0 -62
  356. package/Modal/index.d.ts +0 -61
  357. package/Modal/index.js +0 -118
  358. package/Modal/lang/en_US.d.ts +0 -5
  359. package/Modal/lang/index.d.ts +0 -11
  360. package/Modal/lang/zh_CN.d.ts +0 -5
  361. package/MultiBox/index.d.ts +0 -54
  362. package/MultiBox/index.js +0 -105
  363. package/Notification/index.d.ts +0 -52
  364. package/Notification/index.js +0 -67
  365. package/OperateBtn/index.d.ts +0 -59
  366. package/OperateBtn/index.js +0 -66
  367. package/OperateBtn/lang/en_US.d.ts +0 -4
  368. package/OperateBtn/lang/index.d.ts +0 -9
  369. package/OperateBtn/lang/zh_CN.d.ts +0 -4
  370. package/PageHeader/horizontalMeun.d.ts +0 -9
  371. package/PageHeader/horizontalMeunRight.d.ts +0 -9
  372. package/PageHeader/index.d.ts +0 -10
  373. package/PageHeader/index.js +0 -66
  374. package/PageHeader/interface.d.ts +0 -167
  375. package/Pagination/index.d.ts +0 -33
  376. package/Pagination/index.js +0 -183
  377. package/Pagination/lang/en_US.d.ts +0 -8
  378. package/Pagination/lang/index.d.ts +0 -17
  379. package/Pagination/lang/zh_CN.d.ts +0 -8
  380. package/ParauiProvider/index.d.ts +0 -12
  381. package/ParauiProvider/index.js +0 -15
  382. package/PopConfirm/index.d.ts +0 -50
  383. package/PopConfirm/index.js +0 -105
  384. package/PopConfirm/lang/en_US.d.ts +0 -5
  385. package/PopConfirm/lang/index.d.ts +0 -11
  386. package/PopConfirm/lang/zh_CN.d.ts +0 -5
  387. package/Popover/index.d.ts +0 -14
  388. package/Popover/index.js +0 -15
  389. package/Popper/index.d.ts +0 -13
  390. package/Popper/index.js +0 -16
  391. package/Querying/images/index.d.ts +0 -2
  392. package/Querying/index.d.ts +0 -25
  393. package/Querying/index.js +0 -14
  394. package/Querying/lang/en_US.d.ts +0 -4
  395. package/Querying/lang/index.d.ts +0 -9
  396. package/Querying/lang/zh_CN.d.ts +0 -4
  397. package/Radio/index.d.ts +0 -38
  398. package/Radio/index.js +0 -27
  399. package/RadioGroup/index.d.ts +0 -47
  400. package/RadioGroup/index.js +0 -27
  401. package/Search/index.d.ts +0 -56
  402. package/Search/index.js +0 -118
  403. package/Select/index.d.ts +0 -85
  404. package/Select/index.js +0 -105
  405. package/Select/lang/en_US.d.ts +0 -5
  406. package/Select/lang/index.d.ts +0 -11
  407. package/Select/lang/zh_CN.d.ts +0 -5
  408. package/Select/selectCom.d.ts +0 -11
  409. package/SelectInput/index.d.ts +0 -11
  410. package/SelectInput/index.js +0 -105
  411. package/SingleBox/index.d.ts +0 -42
  412. package/SingleBox/index.js +0 -105
  413. package/Slider/index.d.ts +0 -14
  414. package/Slider/index.js +0 -15
  415. package/Slider/interface.d.ts +0 -102
  416. package/Split/index.d.ts +0 -7
  417. package/Split/index.js +0 -15
  418. package/Stepper/icons.d.ts +0 -5
  419. package/Stepper/index.d.ts +0 -39
  420. package/Stepper/index.js +0 -145
  421. package/Switch/index.d.ts +0 -78
  422. package/Switch/index.js +0 -40
  423. package/Table/index.d.ts +0 -9
  424. package/Table/index.js +0 -261
  425. package/Table/interface.d.ts +0 -200
  426. package/Table/lang/en_US.d.ts +0 -6
  427. package/Table/lang/index.d.ts +0 -13
  428. package/Table/lang/zh_CN.d.ts +0 -6
  429. package/Table/tableBody.d.ts +0 -9
  430. package/Table/tableBodyElement/index.d.ts +0 -15
  431. package/Table/tableBodyInterface.d.ts +0 -67
  432. package/Table/tableCom.d.ts +0 -11
  433. package/Table/tableContainer/index.d.ts +0 -16
  434. package/Table/tableElement/index.d.ts +0 -17
  435. package/Table/tableHead.d.ts +0 -9
  436. package/Table/tableHeadElement/index.d.ts +0 -15
  437. package/Table/tableHeadInterface.d.ts +0 -30
  438. package/Table/tablePagination.d.ts +0 -9
  439. package/Table/tablePaginationInterFace.d.ts +0 -24
  440. package/Table/tdElement/index.d.ts +0 -15
  441. package/Table/thElement/index.d.ts +0 -15
  442. package/Table/trElement/index.d.ts +0 -15
  443. package/Table/util.d.ts +0 -16
  444. package/Tabs/index.d.ts +0 -48
  445. package/Tabs/index.js +0 -131
  446. package/Tag/TagGroup.d.ts +0 -66
  447. package/Tag/index.d.ts +0 -34
  448. package/Tag/index.js +0 -40
  449. package/TextField/index.d.ts +0 -93
  450. package/TextField/index.js +0 -79
  451. package/TextField/textFieldCom.d.ts +0 -11
  452. package/TimePicker/index.d.ts +0 -22
  453. package/TimePicker/index.js +0 -144
  454. package/TimePicker/locale/en_US.d.ts +0 -3
  455. package/TimePicker/locale/zh_CN.d.ts +0 -3
  456. package/TimePicker/style/index.d.ts +0 -1
  457. package/Timeline/index.d.ts +0 -22
  458. package/Timeline/index.js +0 -15
  459. package/ToggleButton/ToggleButtonGroup.d.ts +0 -45
  460. package/ToggleButton/index.d.ts +0 -49
  461. package/ToggleButton/index.js +0 -53
  462. package/Tooltip/index.d.ts +0 -11
  463. package/Tooltip/index.js +0 -15
  464. package/Transfer/index.d.ts +0 -17
  465. package/Transfer/index.js +0 -144
  466. package/Transfer/lang/en_US.d.ts +0 -6
  467. package/Transfer/lang/index.d.ts +0 -13
  468. package/Transfer/lang/zh_CN.d.ts +0 -6
  469. package/Tree/OperateBar/index.d.ts +0 -13
  470. package/Tree/Tree.d.ts +0 -4
  471. package/Tree/index.d.ts +0 -5
  472. package/Tree/index.js +0 -131
  473. package/Tree/interface.d.ts +0 -201
  474. package/Tree/lang/en_US.d.ts +0 -8
  475. package/Tree/lang/index.d.ts +0 -17
  476. package/Tree/lang/zh_CN.d.ts +0 -8
  477. package/Tree/utils/tools.d.ts +0 -26
  478. package/Tree/utils/treeUtil.d.ts +0 -15
  479. package/Upload/Dragger/index.d.ts +0 -10
  480. package/Upload/ErroTip/index.d.ts +0 -13
  481. package/Upload/ImageUpload/index.d.ts +0 -14
  482. package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
  483. package/Upload/ImgCrop/constants.d.ts +0 -7
  484. package/Upload/ImgCrop/index.d.ts +0 -6
  485. package/Upload/ImgCrop/interface.d.ts +0 -24
  486. package/Upload/UploadList/index.d.ts +0 -5
  487. package/Upload/index.d.ts +0 -15
  488. package/Upload/index.js +0 -196
  489. package/Upload/interface.d.ts +0 -134
  490. package/Upload/lang/en_US.d.ts +0 -12
  491. package/Upload/lang/index.d.ts +0 -25
  492. package/Upload/lang/zh_CN.d.ts +0 -12
  493. package/cdn/AutoBox/index.js +0 -29
  494. package/cdn/AutoTips/index.js +0 -40
  495. package/cdn/Breadcrumbs/index.js +0 -53
  496. package/cdn/Button/index.js +0 -79
  497. package/cdn/ButtonGroup/index.js +0 -79
  498. package/cdn/Carousel/index.js +0 -6
  499. package/cdn/Cascader/index.js +0 -40
  500. package/cdn/Checkbox/index.js +0 -53
  501. package/cdn/CheckboxGroup/index.js +0 -53
  502. package/cdn/Collapse/index.js +0 -27
  503. package/cdn/ColorPicker/index.js +0 -1
  504. package/cdn/ComBox/index.js +0 -1
  505. package/cdn/ComboSelect/index.js +0 -438
  506. package/cdn/Container/index.js +0 -1
  507. package/cdn/DatePicker/index.js +0 -183
  508. package/cdn/Desktop/index.js +0 -24
  509. package/cdn/Drawer/index.js +0 -84
  510. package/cdn/Empty/index.js +0 -1
  511. package/cdn/Form/index.js +0 -248
  512. package/cdn/FormItem/index.js +0 -248
  513. package/cdn/FunctionModal/index.js +0 -144
  514. package/cdn/GlobalContext/index.js +0 -1
  515. package/cdn/Help/index.js +0 -53
  516. package/cdn/HelperText/index.js +0 -1
  517. package/cdn/InputLang/index.js +0 -144
  518. package/cdn/InputNumber/index.js +0 -118
  519. package/cdn/Label/index.js +0 -53
  520. package/cdn/Loading/index.js +0 -14
  521. package/cdn/Menu/index.js +0 -55
  522. package/cdn/Message/index.js +0 -53
  523. package/cdn/Modal/index.js +0 -144
  524. package/cdn/MultiBox/index.js +0 -131
  525. package/cdn/Notification/index.js +0 -66
  526. package/cdn/OperateBtn/index.js +0 -92
  527. package/cdn/PageHeader/index.js +0 -92
  528. package/cdn/Pagination/index.js +0 -214
  529. package/cdn/ParauiProvider/index.js +0 -9
  530. package/cdn/PopConfirm/index.js +0 -131
  531. package/cdn/Popover/index.js +0 -16
  532. package/cdn/Popper/index.js +0 -26
  533. package/cdn/Querying/index.js +0 -1
  534. package/cdn/Radio/index.js +0 -53
  535. package/cdn/RadioGroup/index.js +0 -53
  536. package/cdn/Search/index.js +0 -144
  537. package/cdn/Select/index.js +0 -131
  538. package/cdn/SelectInput/index.js +0 -131
  539. package/cdn/SingleBox/index.js +0 -131
  540. package/cdn/Slider/index.js +0 -14
  541. package/cdn/Split/index.js +0 -1
  542. package/cdn/Stepper/index.js +0 -154
  543. package/cdn/Switch/index.js +0 -71
  544. package/cdn/Table/index.js +0 -292
  545. package/cdn/Tabs/index.js +0 -165
  546. package/cdn/Tag/index.js +0 -27
  547. package/cdn/TextField/index.js +0 -105
  548. package/cdn/TimePicker/index.js +0 -183
  549. package/cdn/Timeline/index.js +0 -16
  550. package/cdn/ToggleButton/index.js +0 -79
  551. package/cdn/Tooltip/index.js +0 -40
  552. package/cdn/Transfer/index.js +0 -170
  553. package/cdn/Tree/index.js +0 -170
  554. package/cdn/Upload/index.js +0 -249
  555. package/index.d.ts +0 -124
  556. package/index.js +0 -690
@@ -0,0 +1,233 @@
1
+ import React, {FunctionComponent, useState} from 'react';
2
+ import CodeBox from '../../components/codeBox';
3
+ import Checkbox from 'src/Checkbox';
4
+ import CheckboxGroup, {CheckboxListProps} from 'src/CheckboxGroup';
5
+ import ButtonGroup from 'src/ButtonGroup';
6
+ import APITable from '../../components/apiTable';
7
+ import Title from '../../components/title';
8
+ import {basicCheckbox, basicCheckboxGroup} from './codeString';
9
+ import apiData, {apiDataGroup} from './api';
10
+ import './index.scss';
11
+
12
+ const list: CheckboxListProps[] = [
13
+ {
14
+ label: '选项1',
15
+ name: '1'
16
+ },
17
+ {
18
+ label: '选项2',
19
+ name: '2'
20
+ },
21
+ {
22
+ label: '选项3',
23
+ name: '3'
24
+ }
25
+ ];
26
+
27
+ const ParaCheckbox: FunctionComponent = () => {
28
+ const [value, setValue] = useState<any[]>(['1']);
29
+ const [size, setSize] = useState<any>('large');
30
+
31
+ const clickBtnSize = (item: any) => {
32
+ setSize(item.value)
33
+ }
34
+ const onChange = (val: any) => {
35
+ setValue(val);
36
+ }
37
+
38
+ return (
39
+ <div className={'paraui-checkbox-demo paraui-form'}>
40
+ <Title name={'复选框'}>代码演示</Title>
41
+ <CodeBox
42
+ code={basicCheckbox}
43
+ title={'基本'}
44
+ description={'最简单的用法。'}
45
+ >
46
+ <Checkbox
47
+ label="默认"
48
+ />
49
+ <Checkbox
50
+ label="选中"
51
+ checked={true}
52
+ />
53
+ <Checkbox
54
+ label="半选"
55
+ indeterminate={true}
56
+ />
57
+ <br />
58
+ <br />
59
+ <Checkbox
60
+ label="默认"
61
+ disabled={true}
62
+ />
63
+ <Checkbox
64
+ label="选中"
65
+ checked={true}
66
+ disabled={true}
67
+ />
68
+ <Checkbox
69
+ label="半选"
70
+ indeterminate={true}
71
+ disabled={true}
72
+ />
73
+ <br />
74
+ <br />
75
+ <Checkbox
76
+ label="默认"
77
+ labelTooltip={{tooltip: '帮组提示'}}
78
+ />
79
+ <Checkbox
80
+ label="选中"
81
+ checked={true}
82
+ labelTooltip={{tooltip: '帮组提示'}}
83
+ />
84
+ <Checkbox
85
+ label="半选"
86
+ indeterminate={true}
87
+ labelTooltip={{tooltip: '帮组提示'}}
88
+ />
89
+ <br />
90
+ <br />
91
+ <Checkbox
92
+ label="默认"
93
+ disabled={true}
94
+ labelTooltip={{tooltip: '帮组提示'}}
95
+ />
96
+ <Checkbox
97
+ label="选中"
98
+ checked={true}
99
+ disabled={true}
100
+ labelTooltip={{tooltip: '帮组提示'}}
101
+ />
102
+ <Checkbox
103
+ label="半选"
104
+ indeterminate={true}
105
+ disabled={true}
106
+ labelTooltip={{tooltip: '帮组提示'}}
107
+ />
108
+ <br />
109
+ <br />
110
+ <Checkbox
111
+ label="默认"
112
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
113
+ />
114
+ <Checkbox
115
+ label="选中"
116
+ checked={true}
117
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
118
+ />
119
+ <Checkbox
120
+ label="半选"
121
+ indeterminate={true}
122
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
123
+ />
124
+ <br />
125
+ <br />
126
+ <Checkbox
127
+ label="默认"
128
+ disabled={true}
129
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
130
+ />
131
+ <Checkbox
132
+ label="选中"
133
+ checked={true}
134
+ disabled={true}
135
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
136
+ />
137
+ <Checkbox
138
+ label="半选"
139
+ indeterminate={true}
140
+ disabled={true}
141
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
142
+ />
143
+ <br/>
144
+ <br/>
145
+ <Checkbox
146
+ label="默认默认默认默认默认"
147
+ style={{width: '100px'}}
148
+ />
149
+ <Checkbox
150
+ label="默认"
151
+ />
152
+ </CodeBox>
153
+ <CodeBox
154
+ code={basicCheckboxGroup}
155
+ title={'复选框组'}
156
+ description={'复选框组。'}
157
+ >
158
+ <div style={{marginBottom: '20px'}}>
159
+ <ButtonGroup
160
+ mode={'text'}
161
+ onClick={clickBtnSize}
162
+ data={[
163
+ {
164
+ text: '小(small)',
165
+ value: 'small'
166
+ },
167
+ {
168
+ text: '中(medium)',
169
+ value: 'medium'
170
+ },
171
+ {
172
+ text: '大(large)',
173
+ value: 'large'
174
+ },
175
+ ]}
176
+ />
177
+ </div>
178
+ <CheckboxGroup
179
+ label={'复选框组'}
180
+ list={list}
181
+ onChange={onChange}
182
+ value={value}
183
+ size={size}
184
+ />
185
+ <CheckboxGroup
186
+ required={true}
187
+ label={'复选框组'}
188
+ list={list}
189
+ onChange={onChange}
190
+ value={value}
191
+ size={size}
192
+ />
193
+ <CheckboxGroup
194
+ label={'复选框组'}
195
+ error={true}
196
+ helperText={'请选择'}
197
+ list={list}
198
+ onChange={onChange}
199
+ value={value}
200
+ size={size}
201
+ />
202
+ <CheckboxGroup
203
+ label={'复选框组'}
204
+ row={false}
205
+ list={list}
206
+ onChange={onChange}
207
+ value={value}
208
+ size={size}
209
+ />
210
+ <CheckboxGroup
211
+ label={'复选框组'}
212
+ list={list}
213
+ onChange={onChange}
214
+ value={value}
215
+ size={size}
216
+ labelTooltip={{tooltip: '帮组提示'}}
217
+ />
218
+ <CheckboxGroup
219
+ label={'复选框组'}
220
+ list={list}
221
+ onChange={onChange}
222
+ value={value}
223
+ size={size}
224
+ labelTooltip={{tooltip: '帮组提示', tooltipType: 'line'}}
225
+ />
226
+ </CodeBox>
227
+ <APITable data={apiData} subTitle={'CheckboxProps'} />
228
+ <APITable data={apiDataGroup} subTitle={'CheckboxGroup'} showApi={false} />
229
+ </div>
230
+ );
231
+ };
232
+
233
+ export default ParaCheckbox;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * @author linhd
3
+ * @date 2022/2/14 2:04 PM
4
+ * @description api
5
+ */
6
+ import {RowsData} from '../../components/apiTable';
7
+
8
+ const apiData: RowsData = [
9
+ {
10
+ name: 'className',
11
+ desc: 'class样式名',
12
+ type: 'string'
13
+ },
14
+ {
15
+ name: 'style',
16
+ desc: 'style',
17
+ type: 'CSSProperties'
18
+ },
19
+ {
20
+ name: 'defaultActiveKey',
21
+ desc: '初始化选中面板的 key',
22
+ type: 'Array<string | number> | string | number'
23
+ },
24
+ {
25
+ name: 'activeKey',
26
+ desc: '当前激活 tab 面板的 key',
27
+ type: 'Array<string | number> | string | number'
28
+ },
29
+ {
30
+ name: 'accordion',
31
+ desc: '手风琴模式',
32
+ type: 'boolean',
33
+ default: 'false'
34
+ },
35
+ {
36
+ name: 'collapsible',
37
+ desc: '所有子面板是否可折叠或指定可折叠触发区域',
38
+ type: 'header | disabled'
39
+ },
40
+ {
41
+ name: 'destroyInactivePanel',
42
+ desc: '销毁折叠隐藏的面板',
43
+ type: 'boolean',
44
+ default: 'false'
45
+ },
46
+ {
47
+ name: 'expandIcon',
48
+ desc: '自定义切换图标',
49
+ type: '(panelProps: PanelProps) => React.ReactNode'
50
+ },
51
+ {
52
+ name: 'expandIconPosition',
53
+ desc: '设置图标位置',
54
+ type: 'left | right | undefined',
55
+ default: 'left'
56
+ },
57
+ {
58
+ name: 'onChange',
59
+ desc: '切换面板的回调',
60
+ type: '(key: string | string[]) => void'
61
+ }
62
+ ];
63
+
64
+ export const apiDataPanel: RowsData = [
65
+ {
66
+ name: 'className',
67
+ desc: 'class样式名',
68
+ type: 'string'
69
+ },
70
+ {
71
+ name: 'style',
72
+ desc: 'style',
73
+ type: 'CSSProperties'
74
+ },
75
+ {
76
+ name: 'key',
77
+ desc: '对应 activeKey',
78
+ type: 'string | number'
79
+ },
80
+ {
81
+ name: 'header',
82
+ desc: '面板头内容',
83
+ type: 'ReactNode'
84
+ },
85
+ {
86
+ name: 'collapsible',
87
+ desc: '是否可折叠或指定可折叠触发区域',
88
+ type: 'header | disabled'
89
+ },
90
+ {
91
+ name: 'showArrow',
92
+ desc: '是否展示当前面板上的箭头',
93
+ type: 'boolean',
94
+ default: 'true'
95
+ },
96
+ {
97
+ name: 'forceRender',
98
+ desc: '被隐藏时是否渲染 DOM 结构',
99
+ type: 'boolean',
100
+ default: 'false'
101
+ },
102
+ {
103
+ name: 'extra',
104
+ desc: '被自定义渲染每个面板右上角的内容',
105
+ type: 'ReactNode'
106
+ }
107
+ ];
108
+
109
+ export default apiData;
@@ -0,0 +1,186 @@
1
+ /**
2
+ * @author linhd
3
+ * @date 2022/2/14 2:04 PM
4
+ * @description 源码字符串
5
+ */
6
+ export const basicCollapse = `
7
+ import Collapse from '@para-ui/core/Collapse';
8
+ const {Panel} = Collapse;
9
+
10
+ const callback = (key: any) => {
11
+ console.log(key);
12
+ }
13
+
14
+ const text = \`
15
+ A dog is a type of domesticated animal.
16
+ Known for its loyalty and faithfulness,
17
+ it can be found as a welcome guest in many households across the world.
18
+ \`;
19
+
20
+ <Collapse defaultActiveKey={['1']} onChange={callback}>
21
+ <Panel header="This is panel header 1" key="1">
22
+ <p>{text}</p>
23
+ </Panel>
24
+ <Panel header="This is panel header 2" key="2">
25
+ <p>{text}</p>
26
+ </Panel>
27
+ <Panel header="This is panel header 3" key="3">
28
+ <p>{text}</p>
29
+ </Panel>
30
+ </Collapse>
31
+ `;
32
+
33
+ export const accordionCollapse = `
34
+ import Collapse from '@para-ui/core/Collapse';
35
+ const {Panel} = Collapse;
36
+
37
+ const text = \`
38
+ A dog is a type of domesticated animal.
39
+ Known for its loyalty and faithfulness,
40
+ it can be found as a welcome guest in many households across the world.
41
+ \`;
42
+
43
+ <Collapse accordion>
44
+ <Panel header="This is panel header 1" key="1">
45
+ <p>{text}</p>
46
+ </Panel>
47
+ <Panel header="This is panel header 2" key="2">
48
+ <p>{text}</p>
49
+ </Panel>
50
+ <Panel header="This is panel header 3" key="3">
51
+ <p>{text}</p>
52
+ </Panel>
53
+ </Collapse>
54
+ `;
55
+
56
+ export const nestCollapse = `
57
+ import Collapse from '@para-ui/core/Collapse';
58
+ const {Panel} = Collapse;
59
+
60
+ const callback = (key: any) => {
61
+ console.log(key);
62
+ }
63
+
64
+ const text = \`
65
+ A dog is a type of domesticated animal.
66
+ Known for its loyalty and faithfulness,
67
+ it can be found as a welcome guest in many households across the world.
68
+ \`;
69
+
70
+ <Collapse onChange={callback}>
71
+ <Panel header="This is panel header 1" key="1">
72
+ <Collapse defaultActiveKey="1">
73
+ <Panel header="This is panel nest panel" key="1">
74
+ <p>{text}</p>
75
+ </Panel>
76
+ </Collapse>
77
+ </Panel>
78
+ <Panel header="This is panel header 2" key="2">
79
+ <p>{text}</p>
80
+ </Panel>
81
+ <Panel header="This is panel header 3" key="3">
82
+ <p>{text}</p>
83
+ </Panel>
84
+ </Collapse>
85
+ `;
86
+
87
+ export const arrowCollapse = `
88
+ import Collapse from '@para-ui/core/Collapse';
89
+ const {Panel} = Collapse;
90
+
91
+ const callback = (key: any) => {
92
+ console.log(key);
93
+ }
94
+
95
+ const text = \`
96
+ A dog is a type of domesticated animal.
97
+ Known for its loyalty and faithfulness,
98
+ it can be found as a welcome guest in many households across the world.
99
+ \`;
100
+
101
+ <Collapse defaultActiveKey={['1']} onChange={callback}>
102
+ <Panel header="This is panel header with arrow icon" key="1">
103
+ <p>{text}</p>
104
+ </Panel>
105
+ <Panel showArrow={false} header="This is panel header with no arrow icon" key="2">
106
+ <p>{text}</p>
107
+ </Panel>
108
+ </Collapse>
109
+ `;
110
+
111
+ export const posCollapse = `
112
+ import Collapse from '@para-ui/core/Collapse';
113
+ const {Panel} = Collapse;
114
+
115
+ const [expandIconPosition, setExpandIconPosition] = useState<any>('left')
116
+
117
+ const callback = (key: any) => {
118
+ console.log(key);
119
+ }
120
+
121
+ const text = \`
122
+ A dog is a type of domesticated animal.
123
+ Known for its loyalty and faithfulness,
124
+ it can be found as a welcome guest in many households across the world.
125
+ \`;
126
+
127
+ const genExtra = () => (
128
+ <AdvancedSet
129
+ onClick={(event: any) => {
130
+ // If you don't want click extra trigger collapse, you can prevent this:
131
+ event.stopPropagation();
132
+ }}
133
+ />
134
+ );
135
+
136
+ const clickBtn = (type: any) => () => {
137
+ setExpandIconPosition(type)
138
+ }
139
+
140
+ <Collapse
141
+ defaultActiveKey={['1']}
142
+ onChange={callback}
143
+ expandIconPosition={expandIconPosition}
144
+ >
145
+ <Panel header="This is panel header 1" key="1" extra={genExtra()}>
146
+ <div>{text}</div>
147
+ </Panel>
148
+ <Panel header="This is panel header 2" key="2" extra={genExtra()}>
149
+ <div>{text}</div>
150
+ </Panel>
151
+ <Panel header="This is panel header 3" key="3" extra={genExtra()}>
152
+ <div>{text}</div>
153
+ </Panel>
154
+ </Collapse>
155
+ <br />
156
+ <div>
157
+ <Button onClick={clickBtn('left')} variant={"outlined"} style={{marginRight: '10px'}}>left</Button>
158
+ <Button onClick={clickBtn('right')} variant={"outlined"}>right</Button>
159
+ </div>
160
+ `;
161
+
162
+ export const disabledCollapse = `
163
+ import Collapse from '@para-ui/core/Collapse';
164
+ const {Panel} = Collapse;
165
+
166
+ const text = \`
167
+ A dog is a type of domesticated animal.
168
+ Known for its loyalty and faithfulness,
169
+ it can be found as a welcome guest in many households across the world.
170
+ \`;
171
+
172
+ <Collapse collapsible="header" defaultActiveKey={['1']}>
173
+ <Panel header="This panel can only be collapsed by clicking text" key="1">
174
+ <p>{text}</p>
175
+ </Panel>
176
+ <Panel header="This panel can only be collapsed by clicking text" key="2" collapsible="disabled">
177
+ <p>{text}</p>
178
+ </Panel>
179
+ </Collapse>
180
+ <br />
181
+ <Collapse collapsible="disabled">
182
+ <Panel header="This panel can't be collapsed" key="1">
183
+ <p>{text}</p>
184
+ </Panel>
185
+ </Collapse>
186
+ `;
File without changes
@@ -0,0 +1,171 @@
1
+ import React, {FunctionComponent, useState} from 'react';
2
+ import CodeBox from '../../components/codeBox';
3
+ import Collapse from 'src/Collapse';
4
+ import Button from 'src/Button';
5
+ import APITable from '../../components/apiTable';
6
+ import Title from '../../components/title';
7
+ import AdvancedSet from "@para-ui/icons/AdvancedSet";
8
+ import {
9
+ basicCollapse,
10
+ accordionCollapse,
11
+ nestCollapse,
12
+ arrowCollapse,
13
+ posCollapse,
14
+ disabledCollapse
15
+ } from './codeString';
16
+ import apiData, {apiDataPanel} from './api';
17
+ import './index.scss';
18
+
19
+ const {Panel} = Collapse;
20
+
21
+ const ParaCollapse: FunctionComponent = () => {
22
+ const [expandIconPosition, setExpandIconPosition] = useState<any>('left')
23
+
24
+ const callback = (key: any) => {
25
+ console.log(key);
26
+ }
27
+
28
+ const text = `
29
+ A dog is a type of domesticated animal.
30
+ Known for its loyalty and faithfulness,
31
+ it can be found as a welcome guest in many households across the world.
32
+ `;
33
+
34
+ const genExtra = () => (
35
+ <AdvancedSet
36
+ onClick={(event: any) => {
37
+ // If you don't want click extra trigger collapse, you can prevent this:
38
+ event.stopPropagation();
39
+ }}
40
+ />
41
+ );
42
+
43
+ const clickBtn = (type: any) => () => {
44
+ setExpandIconPosition(type)
45
+ }
46
+
47
+ return (
48
+ <div className={'paraui-collapse-demo'}>
49
+ <Title name={'折叠面板'}>代码演示</Title>
50
+ <CodeBox
51
+ code={basicCollapse}
52
+ title={'折叠面板'}
53
+ description={'可以同时展开多个面板,这个例子默认展开了第一个。'}
54
+ >
55
+ <Collapse defaultActiveKey={['1']} onChange={callback}>
56
+ <Panel header="This is panel header 1" key="1">
57
+ <p>{text}</p>
58
+ </Panel>
59
+ <Panel header="This is panel header 2" key="2">
60
+ <p>{text}</p>
61
+ </Panel>
62
+ <Panel header="This is panel header 3" key="3">
63
+ <p>{text}</p>
64
+ </Panel>
65
+ </Collapse>
66
+ </CodeBox>
67
+ <CodeBox
68
+ code={accordionCollapse}
69
+ title={'手风琴'}
70
+ description={'手风琴,每次只打开一个 tab。'}
71
+ >
72
+ <Collapse accordion>
73
+ <Panel header="This is panel header 1" key="1">
74
+ <p>{text}</p>
75
+ </Panel>
76
+ <Panel header="This is panel header 2" key="2">
77
+ <p>{text}</p>
78
+ </Panel>
79
+ <Panel header="This is panel header 3" key="3">
80
+ <p>{text}</p>
81
+ </Panel>
82
+ </Collapse>
83
+ </CodeBox>
84
+ <CodeBox
85
+ code={nestCollapse}
86
+ title={'面板嵌套'}
87
+ description={'嵌套折叠面板。'}
88
+ >
89
+ <Collapse onChange={callback}>
90
+ <Panel header="This is panel header 1" key="1">
91
+ <Collapse defaultActiveKey="1">
92
+ <Panel header="This is panel nest panel" key="1">
93
+ <p>{text}</p>
94
+ </Panel>
95
+ </Collapse>
96
+ </Panel>
97
+ <Panel header="This is panel header 2" key="2">
98
+ <p>{text}</p>
99
+ </Panel>
100
+ <Panel header="This is panel header 3" key="3">
101
+ <p>{text}</p>
102
+ </Panel>
103
+ </Collapse>
104
+ </CodeBox>
105
+ <CodeBox
106
+ code={arrowCollapse}
107
+ title={'隐藏箭头'}
108
+ description={'你可以通过 showArrow={false} 隐藏 CollapsePanel 组件的箭头图标。'}
109
+ >
110
+ <Collapse defaultActiveKey={['1']} onChange={callback}>
111
+ <Panel header="This is panel header with arrow icon" key="1">
112
+ <p>{text}</p>
113
+ </Panel>
114
+ <Panel showArrow={false} header="This is panel header with no arrow icon" key="2">
115
+ <p>{text}</p>
116
+ </Panel>
117
+ </Collapse>
118
+ </CodeBox>
119
+ <CodeBox
120
+ code={posCollapse}
121
+ title={'图标位置'}
122
+ description={'图标位置。'}
123
+ >
124
+ <Collapse
125
+ defaultActiveKey={['1']}
126
+ onChange={callback}
127
+ expandIconPosition={expandIconPosition}
128
+ >
129
+ <Panel header="This is panel header 1" key="1" extra={genExtra()}>
130
+ <div>{text}</div>
131
+ </Panel>
132
+ <Panel header="This is panel header 2" key="2" extra={genExtra()}>
133
+ <div>{text}</div>
134
+ </Panel>
135
+ <Panel header="This is panel header 3" key="3" extra={genExtra()}>
136
+ <div>{text}</div>
137
+ </Panel>
138
+ </Collapse>
139
+ <br />
140
+ <div>
141
+ <Button onClick={clickBtn('left')} variant={"outlined"} style={{marginRight: '10px'}}>left</Button>
142
+ <Button onClick={clickBtn('right')} variant={"outlined"}>right</Button>
143
+ </div>
144
+ </CodeBox>
145
+ <CodeBox
146
+ code={disabledCollapse}
147
+ title={'禁用'}
148
+ description={'禁用。'}
149
+ >
150
+ <Collapse collapsible="header" defaultActiveKey={['1']}>
151
+ <Panel header="This panel can only be collapsed by clicking text" key="1">
152
+ <p>{text}</p>
153
+ </Panel>
154
+ <Panel header="This panel can only be collapsed by clicking text" key="2" collapsible="disabled">
155
+ <p>{text}</p>
156
+ </Panel>
157
+ </Collapse>
158
+ <br />
159
+ <Collapse collapsible="disabled">
160
+ <Panel header="This panel can't be collapsed" key="1">
161
+ <p>{text}</p>
162
+ </Panel>
163
+ </Collapse>
164
+ </CodeBox>
165
+ <APITable data={apiData} subTitle={'Collapse'}/>
166
+ <APITable data={apiDataPanel} showApi={false} subTitle={'Collapse.Panel'}/>
167
+ </div>
168
+ );
169
+ };
170
+
171
+ export default ParaCollapse;