@qsxy/element-plus-react 1.0.0-next.1 → 1.0.0-next.10

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 (489) hide show
  1. package/README.md +95 -0
  2. package/dist/Avatar/Avatar.d.ts +4 -0
  3. package/dist/Avatar/Avatar.js +86 -0
  4. package/dist/Avatar/index.d.ts +2 -0
  5. package/dist/{VirtualList → Avatar}/index.js +7 -7
  6. package/dist/Avatar/typings.d.ts +21 -0
  7. package/dist/{VirtualList/interface.js → Avatar/typings.js} +3 -3
  8. package/dist/Badge/Badge.js +4 -5
  9. package/dist/Badge/typings.d.ts +10 -0
  10. package/dist/Breadcrumb/Breadcrumb.js +1 -4
  11. package/dist/Breadcrumb/typings.d.ts +4 -0
  12. package/dist/Button/Button.d.ts +0 -1
  13. package/dist/Button/Button.js +21 -9
  14. package/dist/Button/typings.d.ts +28 -0
  15. package/dist/Calendar/Calendar.js +1 -2
  16. package/dist/Calendar/CalendarContext.d.ts +10 -0
  17. package/dist/Calendar/Footer.js +1 -2
  18. package/dist/Calendar/Header.js +3 -8
  19. package/dist/Calendar/ShortCuts.d.ts +2 -0
  20. package/dist/Calendar/typings.d.ts +18 -0
  21. package/dist/Card/typings.d.ts +4 -0
  22. package/dist/Carousel/Carousel.d.ts +4 -0
  23. package/dist/Carousel/Carousel.js +168 -0
  24. package/dist/Carousel/CarouselContext.d.ts +4 -0
  25. package/dist/{VirtualList/Item.js → Carousel/CarouselContext.js} +29 -14
  26. package/dist/Carousel/CarouselItem.d.ts +4 -0
  27. package/dist/Carousel/CarouselItem.js +75 -0
  28. package/dist/Carousel/hooks/useCarousel.d.ts +37 -0
  29. package/dist/Carousel/hooks/useCarousel.js +348 -0
  30. package/dist/Carousel/hooks/useCarouselItem.d.ts +8 -0
  31. package/dist/Carousel/hooks/useCarouselItem.js +161 -0
  32. package/dist/Carousel/index.d.ts +3 -0
  33. package/dist/Carousel/index.js +42 -0
  34. package/dist/Carousel/typings.d.ts +83 -0
  35. package/dist/{VirtualList/utils/findDOMNode.js → Carousel/typings.js} +3 -16
  36. package/dist/Cascader/Cascader.js +148 -182
  37. package/dist/Cascader/CascaderContext.d.ts +4 -10
  38. package/dist/Cascader/CascaderContext.js +2 -6
  39. package/dist/Cascader/CascaderDropdown.d.ts +1 -0
  40. package/dist/Cascader/CascaderDropdown.js +1 -1
  41. package/dist/Cascader/CascaderMenu.js +4 -77
  42. package/dist/Cascader/Utils.d.ts +0 -2
  43. package/dist/Cascader/Utils.js +0 -44
  44. package/dist/Cascader/index.d.ts +1 -1
  45. package/dist/Cascader/typings.d.ts +76 -12
  46. package/dist/Cascader/useCascader.d.ts +61 -3
  47. package/dist/Cascader/useCascader.js +14 -41
  48. package/dist/Checkbox/Checkbox.js +2 -6
  49. package/dist/Checkbox/CheckboxButton.js +2 -6
  50. package/dist/Checkbox/typings.d.ts +11 -0
  51. package/dist/CheckboxGroup/CheckboxGroup.d.ts +4 -0
  52. package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -0
  53. package/dist/Col/Col.js +1 -8
  54. package/dist/Col/typings.d.ts +10 -0
  55. package/dist/Collapse/CollapseContext.d.ts +3 -0
  56. package/dist/Collapse/CollapseItem.js +10 -8
  57. package/dist/Collapse/CollapseTransition.d.ts +7 -6
  58. package/dist/Collapse/CollapseTransition.js +49 -31
  59. package/dist/Collapse/typings.d.ts +7 -0
  60. package/dist/ColorPicker/AlphaSlider.d.ts +7 -0
  61. package/dist/ColorPicker/AlphaSlider.js +0 -1
  62. package/dist/ColorPicker/ColorPicker.js +0 -1
  63. package/dist/ColorPicker/HueSlider.d.ts +7 -0
  64. package/dist/ColorPicker/HueSlider.js +0 -1
  65. package/dist/ColorPicker/Predefine.d.ts +7 -0
  66. package/dist/ColorPicker/Predefine.js +0 -1
  67. package/dist/ColorPicker/SvPanel.d.ts +7 -0
  68. package/dist/ColorPicker/SvPanel.js +0 -1
  69. package/dist/ColorPicker/typings.d.ts +9 -0
  70. package/dist/ConfigProvider/ConfigProvider.d.ts +5 -0
  71. package/dist/DatePicker/DatePicker.js +25 -14
  72. package/dist/DatePicker/DateRangePicker.js +11 -10
  73. package/dist/DatePicker/typings.d.ts +69 -0
  74. package/dist/DateTimePicker/DateTimePicker.d.ts +1 -1
  75. package/dist/DateTimePicker/DateTimePicker.js +13 -11
  76. package/dist/DateTimePicker/typings.d.ts +1 -0
  77. package/dist/Descriptions/Descriptions.js +1 -5
  78. package/dist/Descriptions/DescriptionsContext.d.ts +2 -0
  79. package/dist/Descriptions/typings.d.ts +13 -0
  80. package/dist/Dialog/Dialog.d.ts +0 -1
  81. package/dist/Dialog/Dialog.js +5 -8
  82. package/dist/Dialog/DialogBody.js +0 -3
  83. package/dist/Dialog/DialogContext.d.ts +8 -0
  84. package/dist/Dialog/DialogHeader.js +1 -4
  85. package/dist/Dialog/typings.d.ts +38 -2
  86. package/dist/Divider/Divider.d.ts +4 -0
  87. package/dist/Divider/Divider.js +1 -6
  88. package/dist/Drawer/Drawer.js +28 -14
  89. package/dist/Drawer/DrawerBody.js +1 -4
  90. package/dist/Drawer/DrawerContext.d.ts +10 -0
  91. package/dist/Drawer/DrawerHeader.js +1 -4
  92. package/dist/Drawer/typings.d.ts +16 -0
  93. package/dist/Dropdown/Dropdown.js +12 -8
  94. package/dist/Dropdown/DropdownContext.d.ts +2 -0
  95. package/dist/Dropdown/typings.d.ts +16 -1
  96. package/dist/Empty/Empty.js +1 -4
  97. package/dist/Empty/ImgEmpty.js +1 -1
  98. package/dist/Form/Form.js +10 -6
  99. package/dist/Form/FormItem.d.ts +12 -0
  100. package/dist/Form/FormItem.js +3 -1
  101. package/dist/Form/typings.d.ts +55 -0
  102. package/dist/Form/useForm.d.ts +22 -0
  103. package/dist/Form/utils/NameMap.d.ts +3 -0
  104. package/dist/Form/utils/classUtil.js +2 -2
  105. package/dist/Form/utils/validateUtil.d.ts +4 -0
  106. package/dist/Form/utils/valueUtil.d.ts +17 -0
  107. package/dist/Icon/Icon.js +1 -4
  108. package/dist/Icon/typings.d.ts +7 -0
  109. package/dist/Input/Input.js +18 -10
  110. package/dist/Input/InputRange.js +14 -11
  111. package/dist/Input/TextArea.js +8 -4
  112. package/dist/Input/typings.d.ts +61 -0
  113. package/dist/InputNumber/InputNumber.js +10 -7
  114. package/dist/InputNumber/typings.d.ts +21 -0
  115. package/dist/Link/Link.js +1 -4
  116. package/dist/Link/typings.d.ts +6 -1
  117. package/dist/Loading/Loading.js +17 -9
  118. package/dist/Loading/typings.d.ts +5 -0
  119. package/dist/Message/Main.d.ts +7 -0
  120. package/dist/Message/Message.js +11 -8
  121. package/dist/Message/index.d.ts +8 -0
  122. package/dist/Message/typings.d.ts +11 -0
  123. package/dist/MessageBox/Main.js +3 -1
  124. package/dist/MessageBox/MessageBox.js +1 -1
  125. package/dist/MessageBox/index.d.ts +17 -3
  126. package/dist/MessageBox/index.js +1 -1
  127. package/dist/MessageBox/typings.d.ts +50 -0
  128. package/dist/Notification/Main.d.ts +7 -0
  129. package/dist/Notification/Notification.js +17 -14
  130. package/dist/Notification/index.d.ts +15 -0
  131. package/dist/Notification/typings.d.ts +13 -0
  132. package/dist/Pagination/Pagination.js +15 -11
  133. package/dist/Pagination/typings.d.ts +28 -0
  134. package/dist/Popconfirm/Popconfirm.js +14 -10
  135. package/dist/Popconfirm/typings.d.ts +12 -1
  136. package/dist/Popover/Popover.js +13 -9
  137. package/dist/Popover/typings.d.ts +13 -1
  138. package/dist/Popper/Popper.js +22 -18
  139. package/dist/Popper/typings.d.ts +7 -1
  140. package/dist/Progress/Progress.js +13 -9
  141. package/dist/Progress/typings.d.ts +12 -0
  142. package/dist/Radio/typings.d.ts +7 -0
  143. package/dist/RadioGroup/typings.d.ts +1 -0
  144. package/dist/Row/Row.js +8 -5
  145. package/dist/Row/RowContext.d.ts +1 -0
  146. package/dist/Row/typings.d.ts +4 -0
  147. package/dist/Scrollbar/Scrollbar.js +13 -9
  148. package/dist/Scrollbar/Thumb.js +1 -1
  149. package/dist/Scrollbar/typings.d.ts +20 -0
  150. package/dist/Select/SelectCore.js +17 -14
  151. package/dist/Select/typings.d.ts +33 -0
  152. package/dist/Skeleton/PlaceholderGraph.d.ts +4 -0
  153. package/dist/Skeleton/PlaceholderGrid.d.ts +4 -0
  154. package/dist/Skeleton/PlaceholderGrid.js +0 -4
  155. package/dist/Skeleton/PlaceholderParagraph.d.ts +4 -0
  156. package/dist/Skeleton/PlaceholderParagraph.js +0 -4
  157. package/dist/Switch/Switch.js +13 -10
  158. package/dist/Switch/typings.d.ts +15 -0
  159. package/dist/Table/Colgroup.d.ts +1 -0
  160. package/dist/Table/Table.js +13 -9
  161. package/dist/Table/TableBody.js +10 -41
  162. package/dist/Table/TableCell.js +0 -5
  163. package/dist/Table/TableColumn.js +0 -4
  164. package/dist/Table/TableContext.d.ts +8 -0
  165. package/dist/Table/hooks/useSelection.d.ts +10 -0
  166. package/dist/Table/hooks/useTable.d.ts +7 -0
  167. package/dist/Table/treeUtil.d.ts +39 -0
  168. package/dist/Table/typings.d.ts +137 -1
  169. package/dist/Table/util.d.ts +10 -0
  170. package/dist/Table/util.js +2 -2
  171. package/dist/Tabs/Tabs.js +2 -5
  172. package/dist/Tabs/typings.d.ts +38 -0
  173. package/dist/Tag/Tag.d.ts +1 -1
  174. package/dist/Tag/Tag.js +7 -8
  175. package/dist/Tag/typings.d.ts +10 -0
  176. package/dist/TimeLine/TimeLineItem.js +7 -4
  177. package/dist/TimeLine/typings.d.ts +9 -0
  178. package/dist/TimePicker/TimePicker.js +16 -12
  179. package/dist/TimePicker/TimePickerRange.js +15 -12
  180. package/dist/TimePicker/TimeSpinnerPanel.js +3 -5
  181. package/dist/TimePicker/typings.d.ts +13 -0
  182. package/dist/TimePicker/useTimePicker.d.ts +7 -0
  183. package/dist/Tooltip/Tooltip.js +8 -15
  184. package/dist/Tooltip/TooltipContext.d.ts +1 -0
  185. package/dist/Tooltip/typings.d.ts +14 -1
  186. package/dist/Transfer/List.js +12 -8
  187. package/dist/Transfer/ListItem.d.ts +1 -0
  188. package/dist/Transfer/Transfer.js +11 -7
  189. package/dist/Transfer/typings/index.d.ts +27 -0
  190. package/dist/Transfer/typings/list.d.ts +25 -0
  191. package/dist/Transfer/typings/listBody.d.ts +1 -0
  192. package/dist/Transition/Transition.d.ts +16 -3
  193. package/dist/Transition/Transition.js +6 -4
  194. package/dist/Transition/TransitionGroup.d.ts +59 -0
  195. package/dist/Transition/childMapping.d.ts +23 -0
  196. package/dist/Tree/DirectoryTree.d.ts +6 -13
  197. package/dist/Tree/DirectoryTree.js +32 -81
  198. package/dist/Tree/DropIndicator.d.ts +4 -2
  199. package/dist/Tree/DropIndicator.js +7 -2
  200. package/dist/Tree/Indent.d.ts +2 -2
  201. package/dist/Tree/Indent.js +4 -4
  202. package/dist/Tree/MotionTreeNode.d.ts +4 -5
  203. package/dist/Tree/MotionTreeNode.js +69 -52
  204. package/dist/Tree/NodeList.d.ts +18 -11
  205. package/dist/Tree/NodeList.js +38 -29
  206. package/dist/Tree/RCTree.d.ts +92 -75
  207. package/dist/Tree/RCTree.js +199 -188
  208. package/dist/Tree/Tree.d.ts +18 -3
  209. package/dist/Tree/Tree.js +27 -27
  210. package/dist/Tree/TreeNode.d.ts +5 -83
  211. package/dist/Tree/TreeNode.js +320 -425
  212. package/dist/Tree/contextTypes.d.ts +40 -30
  213. package/dist/Tree/contextTypes.js +17 -4
  214. package/dist/Tree/index.d.ts +2 -2
  215. package/dist/Tree/typings.d.ts +63 -19
  216. package/dist/Tree/typings.js +1 -13
  217. package/dist/Tree/typings.tsx--bak +245 -0
  218. package/dist/Tree/useUnmount.d.ts +5 -0
  219. package/dist/{VirtualList/hooks/useChildren.js → Tree/useUnmount.js} +24 -16
  220. package/dist/Tree/util.d.ts +31 -18
  221. package/dist/Tree/util.js +21 -52
  222. package/dist/Tree/utils/conductUtil.d.ts +8 -2
  223. package/dist/Tree/utils/conductUtil.js +14 -3
  224. package/dist/Tree/utils/dictUtil.d.ts +8 -3
  225. package/dist/Tree/utils/dictUtil.js +49 -32
  226. package/dist/Tree/utils/diffUtil.d.ts +4 -3
  227. package/dist/Tree/utils/keyUtil.d.ts +2 -0
  228. package/dist/{VirtualList/utils/isFirefox.js → Tree/utils/keyUtil.js} +8 -7
  229. package/dist/Tree/utils/motion.js +6 -5
  230. package/dist/Tree/utils/pickAttrs.d.ts +5 -0
  231. package/dist/Tree/utils/treeUtil.d.ts +40 -18
  232. package/dist/Tree/utils/treeUtil.js +35 -14
  233. package/dist/TreeSelect/TreeSelect.js +14 -13
  234. package/dist/TreeSelect/Utils.d.ts +2 -1
  235. package/dist/TreeSelect/typings.d.ts +19 -0
  236. package/dist/Upload/Upload.js +9 -8
  237. package/dist/Upload/UploadList.js +2 -1
  238. package/dist/Upload/typings.d.ts +34 -0
  239. package/dist/Upload/use-handlers.d.ts +1 -0
  240. package/dist/Upload/use-handlers.js +1 -1
  241. package/dist/Util/Math.d.ts +34 -0
  242. package/dist/Util/base.d.ts +22 -0
  243. package/dist/Util/base.js +17 -0
  244. package/dist/Util/shallowEqual.d.ts +11 -0
  245. package/dist/Util/treeUtils.d.ts +8 -0
  246. package/dist/fonts/fa-brands-400.ttf +0 -0
  247. package/dist/fonts/fa-brands-400.woff2 +0 -0
  248. package/dist/fonts/fa-duotone-900.ttf +0 -0
  249. package/dist/fonts/fa-duotone-900.woff2 +0 -0
  250. package/dist/fonts/fa-light-300.ttf +0 -0
  251. package/dist/fonts/fa-light-300.woff2 +0 -0
  252. package/dist/fonts/fa-regular-400.ttf +0 -0
  253. package/dist/fonts/fa-regular-400.woff2 +0 -0
  254. package/dist/fonts/fa-solid-900.ttf +0 -0
  255. package/dist/fonts/fa-solid-900.woff2 +0 -0
  256. package/dist/fonts/fa-thin-100.ttf +0 -0
  257. package/dist/fonts/fa-thin-100.woff2 +0 -0
  258. package/dist/fonts/fa-v4compatibility.ttf +0 -0
  259. package/dist/fonts/fa-v4compatibility.woff2 +0 -0
  260. package/dist/hooks/animationPropsUtils.d.ts +12 -0
  261. package/dist/hooks/htmlPropsUtils.d.ts +8 -0
  262. package/dist/hooks/popperPropsUtils.d.ts +12 -0
  263. package/dist/hooks/prefix.d.ts +1 -1
  264. package/dist/hooks/prefix.js +4 -4
  265. package/dist/hooks/treePropsUtils.d.ts +12 -0
  266. package/dist/hooks/useChildrenInstance.d.ts +11 -0
  267. package/dist/hooks/useClassNames.d.ts +79 -0
  268. package/dist/hooks/useClassNames.js +12 -2
  269. package/dist/hooks/useControlled.d.ts +8 -0
  270. package/dist/hooks/useForceUpdate.d.ts +1 -0
  271. package/dist/index.css +1029 -1290
  272. package/dist/index.d.ts +8 -5
  273. package/dist/index.js +8 -5
  274. package/dist/theme-chalk/avatar/index.scss +50 -0
  275. package/dist/theme-chalk/build.scss +2 -0
  276. package/dist/theme-chalk/calendar/month-table.scss +1 -1
  277. package/dist/theme-chalk/carousel/index.scss +237 -0
  278. package/dist/theme-chalk/checkbox/index.scss +2 -2
  279. package/dist/theme-chalk/common/_var.scss +1 -0
  280. package/dist/theme-chalk/dev.scss +2 -0
  281. package/dist/theme-chalk/doc.scss +2 -0
  282. package/dist/theme-chalk/fonts/fa-brands-400.ttf +0 -0
  283. package/dist/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
  284. package/dist/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
  285. package/dist/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
  286. package/dist/theme-chalk/fonts/fa-light-300.ttf +0 -0
  287. package/dist/theme-chalk/fonts/fa-light-300.woff2 +0 -0
  288. package/dist/theme-chalk/fonts/fa-regular-400.ttf +0 -0
  289. package/dist/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
  290. package/dist/theme-chalk/fonts/fa-solid-900.ttf +0 -0
  291. package/dist/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
  292. package/dist/theme-chalk/fonts/fa-thin-100.ttf +0 -0
  293. package/dist/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
  294. package/dist/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
  295. package/dist/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
  296. package/dist/theme-chalk/icon/fonts.scss +9 -0
  297. package/dist/theme-chalk/icon/index.scss +0 -9
  298. package/dist/theme-chalk/icon/scss/_shims.scss +318 -318
  299. package/dist/theme-chalk/icon/scss/_variables.scss +1 -3
  300. package/dist/theme-chalk/icon/scss/brands.scss +0 -5
  301. package/dist/theme-chalk/icon/scss/duotone.scss +0 -5
  302. package/dist/theme-chalk/icon/scss/fontawesome.scss +0 -8
  303. package/dist/theme-chalk/icon/scss/light.scss +2 -7
  304. package/dist/theme-chalk/icon/scss/regular.scss +2 -7
  305. package/dist/theme-chalk/icon/scss/solid.scss +2 -7
  306. package/dist/theme-chalk/icon/scss/thin.scss +2 -7
  307. package/dist/theme-chalk/icon/scss/v4-shims.scss +0 -8
  308. package/dist/theme-chalk/index.scss +3 -0
  309. package/dist/theme-chalk/input/input.scss +5 -3
  310. package/dist/theme-chalk/link/index.scss +0 -85
  311. package/dist/theme-chalk/loading/index.scss +5 -7
  312. package/dist/theme-chalk/message/index.scss +5 -5
  313. package/dist/theme-chalk/notification/index.scss +5 -5
  314. package/dist/theme-chalk/pagination/index.scss +1 -1
  315. package/dist/theme-chalk/tabs/index.scss +1 -1
  316. package/dist/types/common.d.ts +24 -0
  317. package/dist/types/type.d.ts +5 -0
  318. package/package.json +4 -24
  319. package/theme-chalk/avatar/index.scss +50 -0
  320. package/theme-chalk/badge/index.scss +63 -0
  321. package/theme-chalk/breadcrumb/index.scss +65 -0
  322. package/theme-chalk/build.scss +2 -0
  323. package/{dist/theme-chalk/bak/mixins/_button.scss → theme-chalk/button/_mixins.scss} +151 -58
  324. package/theme-chalk/button/button-group.scss +83 -0
  325. package/theme-chalk/button/button.scss +382 -0
  326. package/theme-chalk/button/index.scss +2 -0
  327. package/theme-chalk/calendar/date-picker.scss +112 -0
  328. package/theme-chalk/calendar/date-range-picker.scss +139 -0
  329. package/theme-chalk/calendar/date-table.scss +156 -0
  330. package/theme-chalk/calendar/index.scss +6 -0
  331. package/theme-chalk/calendar/month-table.scss +92 -0
  332. package/theme-chalk/calendar/picker-panel.scss +136 -0
  333. package/theme-chalk/calendar/year-table.scss +107 -0
  334. package/theme-chalk/card/index.scss +44 -0
  335. package/theme-chalk/carousel/index.scss +237 -0
  336. package/theme-chalk/cascader/cascader-panel.scss +184 -0
  337. package/theme-chalk/cascader/cascader.scss +239 -0
  338. package/theme-chalk/cascader/index.scss +2 -0
  339. package/theme-chalk/checkbox/index.scss +255 -0
  340. package/theme-chalk/checkbox-button/index.scss +117 -0
  341. package/theme-chalk/checkbox-group/index.scss +33 -0
  342. package/{dist/theme-chalk/bak/mixins/_col.scss → theme-chalk/col/_mixins.scss} +27 -3
  343. package/theme-chalk/col/index.scss +50 -0
  344. package/theme-chalk/collapse/index.scss +84 -0
  345. package/theme-chalk/color-picker/index.scss +340 -0
  346. package/{dist/theme-chalk/bak/mixins/config.scss → theme-chalk/common/_var.scss} +1 -0
  347. package/theme-chalk/common/index.scss +222 -0
  348. package/theme-chalk/common/index.ts +1 -0
  349. package/theme-chalk/date-picker/index.scss +253 -0
  350. package/theme-chalk/date-time-picker/index.scss +3 -0
  351. package/theme-chalk/date-time-picker/time-picker.scss +83 -0
  352. package/theme-chalk/date-time-picker/time-range-picker.scss +32 -0
  353. package/theme-chalk/descriptions/descriptions-item.scss +66 -0
  354. package/theme-chalk/descriptions/descriptions.scss +160 -0
  355. package/theme-chalk/descriptions/index.scss +2 -0
  356. package/theme-chalk/dev.scss +2 -0
  357. package/theme-chalk/dialog/index.scss +190 -0
  358. package/theme-chalk/divider/index.scss +51 -0
  359. package/theme-chalk/doc.scss +2 -0
  360. package/theme-chalk/drawer/index.scss +250 -0
  361. package/theme-chalk/dropdown/index.scss +147 -0
  362. package/theme-chalk/empty/index.scss +69 -0
  363. package/theme-chalk/fonts/fa-brands-400.ttf +0 -0
  364. package/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
  365. package/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
  366. package/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
  367. package/theme-chalk/fonts/fa-light-300.ttf +0 -0
  368. package/theme-chalk/fonts/fa-light-300.woff2 +0 -0
  369. package/theme-chalk/fonts/fa-regular-400.ttf +0 -0
  370. package/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
  371. package/theme-chalk/fonts/fa-solid-900.ttf +0 -0
  372. package/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
  373. package/theme-chalk/fonts/fa-thin-100.ttf +0 -0
  374. package/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
  375. package/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
  376. package/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
  377. package/theme-chalk/form/index.scss +359 -0
  378. package/theme-chalk/icon/fonts.scss +9 -0
  379. package/theme-chalk/icon/index.scss +44 -0
  380. package/theme-chalk/icon/scss/_animated.scss +205 -0
  381. package/theme-chalk/icon/scss/_bordered-pulled.scss +20 -0
  382. package/theme-chalk/icon/scss/_core.scss +33 -0
  383. package/theme-chalk/icon/scss/_duotone-icons.scss +12 -0
  384. package/theme-chalk/icon/scss/_fixed-width.scss +7 -0
  385. package/theme-chalk/icon/scss/_functions.scss +57 -0
  386. package/theme-chalk/icon/scss/_icons.scss +11 -0
  387. package/theme-chalk/icon/scss/_list.scss +20 -0
  388. package/theme-chalk/icon/scss/_mixins.scss +102 -0
  389. package/theme-chalk/icon/scss/_rotated-flipped.scss +31 -0
  390. package/theme-chalk/icon/scss/_screen-reader.scss +14 -0
  391. package/theme-chalk/icon/scss/_shims.scss +2606 -0
  392. package/theme-chalk/icon/scss/_sizing.scss +16 -0
  393. package/theme-chalk/icon/scss/_stacked.scss +32 -0
  394. package/theme-chalk/icon/scss/_variables.scss +9189 -0
  395. package/theme-chalk/icon/scss/brands.scss +27 -0
  396. package/theme-chalk/icon/scss/duotone.scss +72 -0
  397. package/theme-chalk/icon/scss/fontawesome.scss +13 -0
  398. package/theme-chalk/icon/scss/index.scss +15 -0
  399. package/theme-chalk/icon/scss/light.scss +21 -0
  400. package/theme-chalk/icon/scss/regular.scss +21 -0
  401. package/theme-chalk/icon/scss/solid.scss +21 -0
  402. package/theme-chalk/icon/scss/thin.scss +21 -0
  403. package/theme-chalk/icon/scss/v4-shims.scss +3 -0
  404. package/theme-chalk/index.scss +67 -0
  405. package/theme-chalk/input/_mixins.scss +16 -0
  406. package/theme-chalk/input/index.scss +3 -0
  407. package/theme-chalk/input/input-range.scss +208 -0
  408. package/theme-chalk/input/input.scss +577 -0
  409. package/theme-chalk/input-number/index.scss +172 -0
  410. package/theme-chalk/link/index.scss +99 -0
  411. package/theme-chalk/loading/index.scss +94 -0
  412. package/theme-chalk/message/index.scss +169 -0
  413. package/theme-chalk/message-box/index.scss +184 -0
  414. package/theme-chalk/notification/index.scss +155 -0
  415. package/theme-chalk/pagination/index.scss +515 -0
  416. package/theme-chalk/placeholder/index.scss +135 -0
  417. package/theme-chalk/popconfirm/index.scss +35 -0
  418. package/theme-chalk/popover/index.scss +54 -0
  419. package/theme-chalk/popper/index.scss +86 -0
  420. package/theme-chalk/progress/index.scss +155 -0
  421. package/theme-chalk/radio/index.scss +2 -0
  422. package/theme-chalk/radio/radio-button.scss +128 -0
  423. package/theme-chalk/radio/radio.scss +171 -0
  424. package/theme-chalk/radio-group/index.scss +31 -0
  425. package/theme-chalk/row/index.scss +30 -0
  426. package/theme-chalk/scrollbar/index.scss +103 -0
  427. package/theme-chalk/select/index.scss +244 -0
  428. package/theme-chalk/select/option-group.scss +54 -0
  429. package/theme-chalk/select/option.scss +63 -0
  430. package/theme-chalk/select/select-dropdown.scss +57 -0
  431. package/theme-chalk/switch/index.scss +273 -0
  432. package/theme-chalk/table/index.scss +714 -0
  433. package/theme-chalk/tabs/index.scss +620 -0
  434. package/theme-chalk/tag/index.scss +360 -0
  435. package/theme-chalk/time-line/_timeline-item.scss +90 -0
  436. package/theme-chalk/time-line/_timeline.scss +50 -0
  437. package/theme-chalk/time-line/index.scss +2 -0
  438. package/theme-chalk/time-picker/index.scss +109 -0
  439. package/theme-chalk/tooltip/index.scss +13 -0
  440. package/theme-chalk/transfer/index.scss +247 -0
  441. package/theme-chalk/transition/index.scss +756 -0
  442. package/theme-chalk/tree/_directory.scss +73 -0
  443. package/theme-chalk/tree/_tree.scss +401 -0
  444. package/theme-chalk/tree/index.scss +2 -0
  445. package/theme-chalk/tree-select/index.scss +25 -0
  446. package/theme-chalk/upload/index.scss +631 -0
  447. package/dist/Tree/utils/KeyCode.d.ts +0 -110
  448. package/dist/Tree/utils/KeyCode.js +0 -550
  449. package/dist/VirtualList/Filler.d.ts +0 -11
  450. package/dist/VirtualList/Filler.js +0 -78
  451. package/dist/VirtualList/Item.d.ts +0 -7
  452. package/dist/VirtualList/ScrollBar.d.ts +0 -43
  453. package/dist/VirtualList/ScrollBar.js +0 -216
  454. package/dist/VirtualList/VirtualList.d.ts +0 -33
  455. package/dist/VirtualList/VirtualList.js +0 -280
  456. package/dist/VirtualList/hooks/useChildren.d.ts +0 -3
  457. package/dist/VirtualList/hooks/useDiffItem.d.ts +0 -2
  458. package/dist/VirtualList/hooks/useDiffItem.js +0 -39
  459. package/dist/VirtualList/hooks/useFrameWheel.d.ts +0 -6
  460. package/dist/VirtualList/hooks/useFrameWheel.js +0 -72
  461. package/dist/VirtualList/hooks/useHeights.d.ts +0 -3
  462. package/dist/VirtualList/hooks/useHeights.js +0 -83
  463. package/dist/VirtualList/hooks/useLayoutEffect.d.ts +0 -3
  464. package/dist/VirtualList/hooks/useLayoutEffect.js +0 -30
  465. package/dist/VirtualList/hooks/useMobileTouchMove.d.ts +0 -2
  466. package/dist/VirtualList/hooks/useMobileTouchMove.js +0 -92
  467. package/dist/VirtualList/hooks/useOriginScroll.d.ts +0 -2
  468. package/dist/VirtualList/hooks/useOriginScroll.js +0 -56
  469. package/dist/VirtualList/hooks/useScrollTo.d.ts +0 -5
  470. package/dist/VirtualList/hooks/useScrollTo.js +0 -111
  471. package/dist/VirtualList/index.d.ts +0 -2
  472. package/dist/VirtualList/interface.d.ts +0 -8
  473. package/dist/VirtualList/mock.d.ts +0 -6
  474. package/dist/VirtualList/mock.js +0 -29
  475. package/dist/VirtualList/utils/CacheMap.d.ts +0 -7
  476. package/dist/VirtualList/utils/CacheMap.js +0 -36
  477. package/dist/VirtualList/utils/algorithmUtil.d.ts +0 -6
  478. package/dist/VirtualList/utils/algorithmUtil.js +0 -81
  479. package/dist/VirtualList/utils/findDOMNode.d.ts +0 -2
  480. package/dist/VirtualList/utils/isFirefox.d.ts +0 -2
  481. package/dist/VirtualList/utils/raf.d.ts +0 -5
  482. package/dist/VirtualList/utils/raf.js +0 -57
  483. package/dist/theme-chalk/bak/common/popup.scss +0 -47
  484. package/dist/theme-chalk/bak/common/transition.scss +0 -118
  485. package/dist/theme-chalk/bak/common/var.scss +0 -1476
  486. package/dist/theme-chalk/bak/mixins/_var.scss +0 -55
  487. package/dist/theme-chalk/bak/mixins/function.scss +0 -85
  488. package/dist/theme-chalk/bak/mixins/mixins.scss +0 -215
  489. package/dist/theme-chalk/bak/mixins/utils.scss +0 -39
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/Tree/utils/treeUtil.ts
@@ -25,13 +35,23 @@ __export(treeUtil_exports, {
25
35
  fillFieldNames: () => fillFieldNames,
26
36
  flattenTreeData: () => flattenTreeData,
27
37
  getKey: () => getKey,
38
+ getPosition: () => getPosition,
28
39
  getTreeNodeProps: () => getTreeNodeProps,
40
+ isTreeNode: () => isTreeNode,
29
41
  traverseDataNodes: () => traverseDataNodes,
30
42
  warningWithoutKey: () => warningWithoutKey
31
43
  });
32
44
  module.exports = __toCommonJS(treeUtil_exports);
33
- var import_Util = require("../../Util");
34
- var import_util = require("../util");
45
+ var import_toArray = __toESM(require("rc-util/lib/Children/toArray"));
46
+ var import_omit = __toESM(require("rc-util/lib/omit"));
47
+ var import_warning = __toESM(require("rc-util/lib/warning"));
48
+ var import_keyUtil = __toESM(require("./keyUtil"));
49
+ function getPosition(level, index) {
50
+ return `${level}-${index}`;
51
+ }
52
+ function isTreeNode(node) {
53
+ return node && node.type && node.type.isTreeNode;
54
+ }
35
55
  function getKey(key, pos) {
36
56
  if (key !== null && key !== void 0) {
37
57
  return key;
@@ -54,9 +74,9 @@ function warningWithoutKey(treeData, fieldNames) {
54
74
  (list || []).forEach((treeNode) => {
55
75
  const key = treeNode[fieldNames.key];
56
76
  const children = treeNode[fieldNames.children];
57
- (0, import_Util.warning)(key !== null && key !== void 0, `Tree node must have a certain key: [${path}${key}]`);
77
+ (0, import_warning.default)(key !== null && key !== void 0, `Tree node must have a certain key: [${path}${key}]`);
58
78
  const recordKey = String(key);
59
- (0, import_Util.warning)(!keys.has(recordKey) || key === null || key === void 0, `Same 'key' exist in the Tree: ${recordKey}`);
79
+ (0, import_warning.default)(!keys.has(recordKey) || key === null || key === void 0, `Same 'key' exist in the Tree: ${recordKey}`);
60
80
  keys.set(recordKey, true);
61
81
  dig(children, `${path}${recordKey} > `);
62
82
  });
@@ -65,10 +85,10 @@ function warningWithoutKey(treeData, fieldNames) {
65
85
  }
66
86
  function convertTreeToData(rootNodes) {
67
87
  function dig(node) {
68
- const treeNodes = (0, import_util.toArray)(node);
88
+ const treeNodes = (0, import_toArray.default)(node);
69
89
  return treeNodes.map((treeNode) => {
70
- if (!(0, import_util.isTreeNode)(treeNode)) {
71
- (0, import_Util.warning)(!treeNode, "Tree/TreeNode can only accept TreeNode as children.");
90
+ if (!isTreeNode(treeNode)) {
91
+ (0, import_warning.default)(!treeNode, "Tree/TreeNode can only accept TreeNode as children.");
72
92
  return null;
73
93
  }
74
94
  const { key } = treeNode;
@@ -92,7 +112,7 @@ function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
92
112
  const flattenList = [];
93
113
  function dig(list, parent = null) {
94
114
  return list.map((treeNode, index) => {
95
- const pos = (0, import_util.getPosition)(parent ? parent.pos : "0", index);
115
+ const pos = getPosition(parent ? parent.pos : "0", index);
96
116
  const mergedKey = getKey(treeNode[fieldKey], pos);
97
117
  let mergedTitle;
98
118
  for (let i = 0; i < fieldTitles.length; i += 1) {
@@ -102,8 +122,7 @@ function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
102
122
  break;
103
123
  }
104
124
  }
105
- const flattenNode = {
106
- ...(0, import_util.omit)(treeNode, [...fieldTitles, fieldKey, fieldChildren]),
125
+ const flattenNode = Object.assign((0, import_omit.default)(treeNode, [...fieldTitles, fieldKey, fieldChildren]), {
107
126
  title: mergedTitle,
108
127
  key: mergedKey,
109
128
  parent,
@@ -112,7 +131,7 @@ function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
112
131
  data: treeNode,
113
132
  isStart: [...parent ? parent.isStart : [], index === 0],
114
133
  isEnd: [...parent ? parent.isEnd : [], index === list.length - 1]
115
- };
134
+ });
116
135
  flattenList.push(flattenNode);
117
136
  if (expandedKeys === true || expandedKeySet.has(mergedKey)) {
118
137
  flattenNode.children = dig(treeNode[fieldChildren] || [], flattenNode);
@@ -148,7 +167,7 @@ function traverseDataNodes(dataNodes, callback, config) {
148
167
  }
149
168
  function processNode(node, index, parent, pathNodes) {
150
169
  const children = node ? node[mergeChildrenPropName] : dataNodes;
151
- const pos = node ? (0, import_util.getPosition)(parent.pos, index) : "0";
170
+ const pos = node ? getPosition(parent.pos, index) : "0";
152
171
  const connectNodes = node ? [...pathNodes, node] : [];
153
172
  if (node) {
154
173
  const key = syntheticGetKey(node, pos);
@@ -223,7 +242,7 @@ function convertDataToEntities(dataNodes, {
223
242
  return wrapper;
224
243
  }
225
244
  function getTreeNodeProps(key, { expandedKeys, selectedKeys, loadedKeys, loadingKeys, checkedKeys, halfCheckedKeys, dragOverNodeKey, dropPosition, keyEntities }) {
226
- const entity = keyEntities[key];
245
+ const entity = (0, import_keyUtil.default)(keyEntities, key);
227
246
  const treeNodeProps = {
228
247
  eventKey: key,
229
248
  expanded: expandedKeys.indexOf(key) !== -1,
@@ -262,7 +281,7 @@ function convertNodePropsToEventData(props) {
262
281
  if (!("props" in eventData)) {
263
282
  Object.defineProperty(eventData, "props", {
264
283
  get() {
265
- (0, import_Util.warning)(false, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.");
284
+ (0, import_warning.default)(false, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.");
266
285
  return props;
267
286
  }
268
287
  });
@@ -277,7 +296,9 @@ function convertNodePropsToEventData(props) {
277
296
  fillFieldNames,
278
297
  flattenTreeData,
279
298
  getKey,
299
+ getPosition,
280
300
  getTreeNodeProps,
301
+ isTreeNode,
281
302
  traverseDataNodes,
282
303
  warningWithoutKey
283
304
  });
@@ -51,6 +51,20 @@ var import_Util = require("../Util");
51
51
  var import_hooks = require("../hooks");
52
52
  var import_Utils = require("./Utils");
53
53
  function InternalTreeSelect(props, ref) {
54
+ props = {
55
+ clearable: true,
56
+ collapseTags: true,
57
+ checkStrictly: true,
58
+ disabled: false,
59
+ selectable: true,
60
+ filterable: true,
61
+ placeholder: "请选择",
62
+ noDataText: "无数据",
63
+ loadingText: /* @__PURE__ */ import_react.default.createElement("span", null, /* @__PURE__ */ import_react.default.createElement(import_Icon.Icon, { prefix: "fas", name: "spinner", spin: true }), " 加载中..."),
64
+ fieldNames: { title: "title", key: "key", children: "children" },
65
+ onBeforeClick: () => true,
66
+ ...props
67
+ };
54
68
  const {
55
69
  placeholder,
56
70
  clearable,
@@ -504,18 +518,5 @@ function InternalTreeSelect(props, ref) {
504
518
  }
505
519
  var ForwardTreeSelect = (0, import_react.forwardRef)(InternalTreeSelect);
506
520
  var TreeSelect = ForwardTreeSelect;
507
- TreeSelect.defaultProps = {
508
- clearable: true,
509
- collapseTags: true,
510
- checkStrictly: true,
511
- disabled: false,
512
- selectable: true,
513
- filterable: true,
514
- placeholder: "请选择",
515
- noDataText: "无数据",
516
- loadingText: /* @__PURE__ */ import_react.default.createElement("span", null, /* @__PURE__ */ import_react.default.createElement(import_Icon.Icon, { prefix: "fas", name: "spinner", spin: true }), " 加载中..."),
517
- fieldNames: { title: "title", key: "key", children: "children" },
518
- onBeforeClick: () => true
519
- };
520
521
  TreeSelect.displayName = "TreeSelect";
521
522
  var TreeSelect_default = TreeSelect;
@@ -1,2 +1,3 @@
1
1
  import { DataNode } from '../Tree';
2
- export declare const parentNotSelectable: (treeData?: DataNode[]) => DataNode<any>[];
2
+ /** 单选不可选父级 */
3
+ export declare const parentNotSelectable: (treeData?: DataNode[]) => DataNode[];
@@ -16,25 +16,44 @@ export type TreeSelectRef = {
16
16
  setVisible: (value: boolean) => void;
17
17
  };
18
18
  export interface TreeSelectProps<T = DataNode, V = ValueType> extends Omit<FormControlBaseProps<V>, 'onChange'>, Omit<TreeProps<T>, 'children' | 'style'>, Omit<BaseProps, 'children'>, NativeProps, AnimationEventProps {
19
+ /** 表单提交给后台表示节点名称的name */
19
20
  labelName?: string;
21
+ /** 是否可以清空选项 */
20
22
  clearable?: boolean;
23
+ /** 占位符 */
21
24
  placeholder?: string;
22
25
  filterable?: boolean;
26
+ /** 选择任意级别 */
23
27
  checkStrictly?: boolean;
28
+ /** 多选时是否将选中值按文字的形式展示 */
24
29
  collapseTags?: boolean;
30
+ /** 是否纯文本模式,即无边框 */
25
31
  plain?: boolean;
32
+ /** */
26
33
  required?: boolean;
34
+ /** 下拉项最大宽度 */
27
35
  maxWidth?: number;
36
+ /** 表单校验错误提示 */
28
37
  error?: boolean;
38
+ /** 表单校验警告提示 */
29
39
  warning?: boolean;
40
+ /** 表是否加载中 */
30
41
  loading?: boolean;
42
+ /** 输入框前置内容,只对 type="text" 有效 */
31
43
  prepend?: React.ReactElement<any> | string | number;
44
+ /** 输入框后置内容,只对 type="text" 有效 */
32
45
  append?: React.ReactElement | string | number;
46
+ /** 选项为空时显示的文字 */
33
47
  noDataText?: React.ReactElement | string;
48
+ /** 远程加载时显示的文字 */
34
49
  loadingText?: React.ReactElement | string;
50
+ /** 点击节点前的回调,返回true触发onClick事件和onSelect事件 */
35
51
  onBeforeClick?: (node: T, event: React.MouseEvent<any>) => boolean;
52
+ /** 点击节点事件 */
36
53
  onClickNode?: (node: T, event: React.MouseEvent<any>) => boolean;
54
+ /** 选中值发生变化时触发 */
37
55
  onChange?: (value: ValueType | Key[], label?: string | string[]) => void;
56
+ /** 数据加载成功时调用 */
38
57
  onLoadSuccess?: (value: ValueType | Key[], label?: string[]) => void;
39
58
  }
40
59
  export type SelectInfo<T> = {
@@ -41,6 +41,15 @@ var import_UploadList = __toESM(require("./UploadList"));
41
41
  var import_use_handlers = require("./use-handlers");
42
42
  var Upload = (0, import_react.memo)(
43
43
  (0, import_react.forwardRef)((props, ref) => {
44
+ props = {
45
+ action: "#",
46
+ method: "post",
47
+ name: "file",
48
+ showFileList: true,
49
+ listType: "text",
50
+ autoUpload: true,
51
+ ...props
52
+ };
44
53
  const { listType, accept, onPreview, showFileList, formatter, trigger, tip } = props;
45
54
  const uploadRef = (0, import_react.useRef)(null);
46
55
  const disabled = (0, import_hooks.useDisabled)(props.disabled);
@@ -97,13 +106,5 @@ var Upload = (0, import_react.memo)(
97
106
  )));
98
107
  })
99
108
  );
100
- Upload.defaultProps = {
101
- action: "#",
102
- method: "post",
103
- name: "file",
104
- showFileList: true,
105
- listType: "text",
106
- autoUpload: true
107
- };
108
109
  Upload.displayName = "ElUpload";
109
110
  var Upload_default = Upload;
@@ -42,13 +42,14 @@ var UploadList = (props) => {
42
42
  const { listType, files = [], handlePreview, onRemove, formatter, append } = props;
43
43
  const { b, bm, be, is } = (0, import_hooks.useClassNames)("upload");
44
44
  const disabled = (0, import_hooks.useDisabled)(props.disabled);
45
+ const nodeRef = (0, import_react.useRef)(null);
45
46
  const handleRemove = (0, import_react.useCallback)(
46
47
  (file) => {
47
48
  onRemove == null ? void 0 : onRemove(file);
48
49
  },
49
50
  [onRemove]
50
51
  );
51
- return /* @__PURE__ */ import_react.default.createElement("ul", { className: (0, import_classnames.default)(b`list`, bm("list", listType), is({ disabled })) }, files.map((file, i) => /* @__PURE__ */ import_react.default.createElement(import_Transition.Transition, { key: `tr_${file.uid || file.name}${i}`, name: b("list", false), visible: true, transitionAppear: true, unmountOnExit: true, display: "" }, /* @__PURE__ */ import_react.default.createElement("li", { key: `${file.uid || file.name}${i}`, className: (0, import_classnames.default)(
52
+ return /* @__PURE__ */ import_react.default.createElement("ul", { className: (0, import_classnames.default)(b`list`, bm("list", listType), is({ disabled })) }, files.map((file, i) => /* @__PURE__ */ import_react.default.createElement(import_Transition.Transition, { nodeRef, key: `tr_${file.uid || file.name}${i}`, name: b("list", false), visible: true, transitionAppear: true, unmountOnExit: true, display: "" }, /* @__PURE__ */ import_react.default.createElement("li", { ref: nodeRef, key: `${file.uid || file.name}${i}`, className: (0, import_classnames.default)(
52
53
  be("list", "item"),
53
54
  is(file.status)
54
55
  /* , { focusing } */
@@ -1,38 +1,64 @@
1
1
  import React from 'react';
2
2
  import { BaseProps, NativeProps } from '../types/common';
3
3
  export interface UploadBaseProps {
4
+ /** 请求 URL */
4
5
  action: string;
6
+ /** 设置上传的请求头部 */
5
7
  headers?: Headers | Record<string, any>;
8
+ /** 设置上传请求方法 */
6
9
  method?: 'post' | 'get';
10
+ /** 是否支持多选文件 */
7
11
  multiple?: boolean;
12
+ /** 上传时附带的额外参数 */
8
13
  data?: Record<string, any> | ((rawFile: UploadRawFile) => Promise<Record<string, any>>) | ((rawFile: UploadRawFile) => Record<string, any>);
14
+ /** 上传的文件字段名 */
9
15
  name?: string;
16
+ /** 是否启用拖拽上传 */
10
17
  drag?: boolean;
18
+ /** 支持发送 cookie 凭证信息 */
11
19
  withCredentials?: boolean;
20
+ /** 是否显示已上传文件列表 */
12
21
  showFileList?: boolean;
22
+ /** 接受上传的文件类型 */
13
23
  accept?: string;
14
24
  type?: string;
25
+ /** 默认上传文件 */
15
26
  fileList?: UploadUserFile[];
27
+ /** 文件列表的类型 */
16
28
  listType?: 'text' | 'picture' | 'picture-card';
29
+ /** 是否自动上传文件 */
17
30
  autoUpload?: boolean;
31
+ /** 覆盖默认的 Xhr 行为,允许自行实现上传文件的请求 */
18
32
  httpRequest?: (options: UploadRequestOptions) => XMLHttpRequest | Promise<unknown>;
33
+ /** 是否禁用上传 */
19
34
  disabled?: boolean;
35
+ /** 允许上传文件的最大数量 */
20
36
  limit?: number;
21
37
  }
22
38
  export interface UploadHooks {
39
+ /** 上传文件之前的钩子,参数为上传的文件, 若返回false或者返回 Promise 且被 reject,则停止上传。 */
23
40
  beforeUpload?: (rawFile: UploadRawFile) => Awaitable<void | undefined | null | boolean | File | Blob>;
41
+ /** 删除文件之前的钩子,参数为上传的文件和文件列表, 若返回 false 或者返回 Promise 且被 reject,则停止删除。 */
24
42
  beforeRemove?: (uploadFile: UploadFile, uploadFiles: UploadFiles) => Awaitable<boolean>;
43
+ /** 文件列表移除文件时的钩子 */
25
44
  onRemove?: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
45
+ /** 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用 */
26
46
  onChange?: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
47
+ /** 点击文件列表中已上传的文件时的钩子 */
27
48
  onPreview?: (uploadFile: UploadFile) => void;
49
+ /** 文件上传成功时的钩子 */
28
50
  onSuccess?: (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
51
+ /** 文件上传时的钩子 */
29
52
  onProgress?: (evt: UploadProgressEvent, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
53
+ /** 文件上传失败时的钩子 */
30
54
  onError?: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
55
+ /** 当超出限制时,执行的钩子函数 */
31
56
  onExceed?: (files: File[], uploadFiles: UploadUserFile[]) => void;
32
57
  }
33
58
  export interface UploadContentProps extends UploadBaseProps, BaseProps {
34
59
  beforeUpload?: UploadHooks['beforeUpload'];
35
60
  onRemove?: (file: UploadFile | UploadRawFile) => void;
61
+ /** 手动选择文件 */
36
62
  onStart?: (rawFile: UploadRawFile) => void;
37
63
  onSuccess?: (response: any, rawFile: UploadRawFile) => unknown;
38
64
  onProgress?: (evt: UploadProgressEvent, rawFile: UploadRawFile) => void;
@@ -44,15 +70,23 @@ export interface UploadContentRef {
44
70
  upload: (rawFile: UploadRawFile) => Promise<void>;
45
71
  }
46
72
  export interface UploadRef {
73
+ /** 取消上传请求 */
47
74
  abort: (file?: UploadFile) => void;
75
+ /** 手动上传文件列表 */
48
76
  submit: () => void;
77
+ /** 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */
49
78
  clearFiles: (status?: Array<'ready' | 'uploading' | 'success' | 'fail'>) => void;
79
+ /** 手动选择文件 */
50
80
  handleStart: (rawFile: UploadRawFile) => void;
81
+ /** 手动移除文件。 file 和rawFile 已被合并。 rawFile 将在 v2.2.0 中移除 */
51
82
  handleRemove: (file: UploadFile | UploadRawFile) => void;
52
83
  }
53
84
  export interface UploadProps extends UploadBaseProps, UploadHooks, BaseProps, NativeProps {
85
+ /** 缩略图模板的内容 */
54
86
  formatter?: (file: UploadFile) => React.ReactElement;
87
+ /** 触发文件选择框的内容 */
55
88
  trigger?: React.ReactElement;
89
+ /** 提示说明文字 */
56
90
  tip?: React.ReactElement;
57
91
  }
58
92
  export interface UploadListProps {
@@ -3,6 +3,7 @@ import { UploadContentRef, UploadFile, UploadFiles, UploadProps, UploadRawFile,
3
3
  export declare const useHandlers: (props: Omit<UploadProps, 'fileList'> & {
4
4
  fileList: UploadFiles;
5
5
  }, uploadRef: RefObject<UploadContentRef | undefined>) => {
6
+ /** @description two-way binding ref from props `fileList` */
6
7
  uploadFiles: UploadFiles;
7
8
  setUploadFiles: (value: UploadFiles) => void;
8
9
  abort: (file: UploadFile) => void;
@@ -43,7 +43,7 @@ var revokeObjectURL = (file) => {
43
43
  }
44
44
  };
45
45
  var useHandlers = (props, uploadRef) => {
46
- const { fileList, listType, onError, onChange, onProgress, onSuccess, beforeRemove, onRemove } = props;
46
+ const { fileList, listType = "text", onError, onChange, onProgress, onSuccess, beforeRemove, onRemove } = props;
47
47
  const uploadFilesRef = (0, import_react.useRef)();
48
48
  const [uploadFiles, setUploadFiles, isControlled] = (0, import_hooks.useControlled)(fileList, []);
49
49
  const { forceUpdate } = (0, import_hooks.useForceUpdate)();
@@ -1,5 +1,39 @@
1
+ /**
2
+ * 乘法 - js运算精度丢失问题
3
+ * @param arg1 数1
4
+ * @param arg2 数2
5
+ * 0.0023 * 100 ==> 0.22999999999999998
6
+ * {{ 0.0023 | multiply(100) }} ==> 0.23
7
+ */
1
8
  export declare function floatMultiply(arg1: number | string, arg2: number | string): number;
9
+ /**
10
+ * 除法 - js运算精度丢失问题
11
+ * @param arg1 数1
12
+ * @param arg2 数2
13
+ * 0.0023 / 0.00001 ==> 229.99999999999997
14
+ * {{ 0.0023 | divide(0.00001) }} ==> 230
15
+ */
2
16
  export declare function floatDivide(arg1: number | string, arg2: number | string): number;
17
+ /**
18
+ * 加法 - js运算精度丢失问题
19
+ * @param arg1 数1
20
+ * @param arg2 数2
21
+ * 0.0023 + 0.00000000000001 ==> 0.0023000000000099998
22
+ * {{ 0.0023 | plus(0.00000000000001) }} ==> 0.00230000000001
23
+ */
3
24
  export declare function floatAdd(arg1: string | number, arg2: string | number): number;
25
+ /**
26
+ * 减法 - js运算精度丢失问题
27
+ * @param arg1 数1
28
+ * @param arg2 数2
29
+ * 0.0023 - 0.00000011 ==> 0.0022998899999999997
30
+ * {{ 0.0023 | minus( 0.00000011 ) }} ==> 0.00229989
31
+ */
4
32
  export declare function floatSub(arg1: string | number, arg2: string | number): number;
33
+ /**
34
+ * 格式化数字,带精度
35
+ * @param value 数字
36
+ * @param precision 精度
37
+ * @returns
38
+ */
5
39
  export declare const formatNumber: (value: number, precision: number) => string;
@@ -1,8 +1,29 @@
1
+ /**
2
+ * 判断对象是否为空
3
+ * @param {Object} val 被判断的对象
4
+ * @returns {Boolean} 返回true或false
5
+ */
1
6
  export declare function isEmpty(val: any): boolean;
7
+ /**
8
+ * 判断对象是否不为空
9
+ * @param {Object} val 被判断的对象
10
+ * @returns {Boolean} 返回true或false
11
+ */
2
12
  export declare function isNotEmpty(val: any): boolean;
13
+ /**
14
+ * 随机序列,包含数字和字母
15
+ * @param {Number} n 序列的个数
16
+ * @returns {String} 返回序列
17
+ */
3
18
  export declare function randomCode(n: number): string;
4
19
  export declare function getScrollWidth(elem: HTMLElement): number;
5
20
  export declare function warning(valid: boolean, message: string): void;
21
+ /**
22
+ * 创建隐形表单下载方法
23
+ * @param url 下载地址
24
+ * @param params 参数列表
25
+ * @param pther method:请求方式,target:是否新窗口
26
+ */
6
27
  export declare const download: (url: string, params: {
7
28
  name: string;
8
29
  value: string;
@@ -17,3 +38,4 @@ export declare const isNumber: (val: any) => val is number;
17
38
  export declare const isString: (val: any) => boolean;
18
39
  export declare const isStringNumber: (val: string) => boolean;
19
40
  export declare function addUnit(value?: string | number, defaultUnit?: string): string;
41
+ export declare function mergeDefaultProps<T>(defaultProps: Partial<T>, target: T): T;
package/dist/Util/base.js CHANGED
@@ -40,6 +40,7 @@ __export(base_exports, {
40
40
  isString: () => isString,
41
41
  isStringNumber: () => isStringNumber,
42
42
  isUndefined: () => isUndefined,
43
+ mergeDefaultProps: () => mergeDefaultProps,
43
44
  randomCode: () => randomCode,
44
45
  warning: () => warning
45
46
  });
@@ -203,6 +204,21 @@ function addUnit(value, defaultUnit = "px") {
203
204
  return value;
204
205
  }
205
206
  }
207
+ function mergeDefaultProps(defaultProps = {}, target) {
208
+ const props = { ...target };
209
+ if (Object.prototype.toString.call(props) === "[object Object]" && Object.prototype.toString.call(defaultProps) === "[object Object]") {
210
+ for (const item in defaultProps) {
211
+ if (isUndefined(props[item])) {
212
+ Object.assign(props, { [item]: defaultProps[item] });
213
+ } else {
214
+ if (Object.prototype.toString.call(props[item]) === "[object Object]" && Object.prototype.toString.call(defaultProps[item]) === "[object Object]") {
215
+ props[item] = mergeDefaultProps(props[item], defaultProps[item]);
216
+ }
217
+ }
218
+ }
219
+ }
220
+ return props;
221
+ }
206
222
  // Annotate the CommonJS export names for ESM import in node:
207
223
  0 && (module.exports = {
208
224
  addUnit,
@@ -216,6 +232,7 @@ function addUnit(value, defaultUnit = "px") {
216
232
  isString,
217
233
  isStringNumber,
218
234
  isUndefined,
235
+ mergeDefaultProps,
219
236
  randomCode,
220
237
  warning
221
238
  });
@@ -1,2 +1,13 @@
1
+ /**
2
+ * From: https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js
3
+ * @providesModule shallowEqual
4
+ * @typechecks
5
+ * @flow
6
+ */
7
+ /**
8
+ * Performs equality by iterating through keys on an object and returning false
9
+ * when any key has values which are not strictly equal between the arguments.
10
+ * Returns true when the values of all keys are strictly equal.
11
+ */
1
12
  declare function shallowEqual(objA: any, objB: any): boolean;
2
13
  export default shallowEqual;
@@ -3,5 +3,13 @@ interface FieldNames {
3
3
  parentIdKey?: string;
4
4
  childrenKey?: string;
5
5
  }
6
+ /**
7
+ * 非递归实现
8
+ * 每一项都有parentId,根元素
9
+ * @param list
10
+ * @param rootId 根元素id
11
+ * @param param2 可配晋参数
12
+ * @returns
13
+ */
6
14
  export declare const generateTree: <T>(list: T[], rootId: string | number, { idKey, parentIdKey, childrenKey }?: FieldNames) => T[];
7
15
  export {};
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,3 +1,15 @@
1
1
  import { TransitionProps } from '../Transition';
2
2
  export declare const animationAllProps: string[];
3
+ /**
4
+ * Returns an array of objects consisting of: props of html input element and rest.
5
+ * @author Parker
6
+ * @CreateTime 2022/4/8 17:46:40
7
+ * @LastEditor Parker
8
+ * @ModifyTime 2022/4/22 15:38:45
9
+ * @param {object} props A ReactElement props object
10
+ * @param {Object} [options={}]
11
+ * @param {Array} [options.htmlProps] An array of html input props
12
+ * @param {boolean} [options.includeAria] Includes all input props that starts with "aria-"
13
+ * @returns {[{}, {}]} An array of objects
14
+ */
3
15
  export declare const partitionAnimationProps: (props: any, options?: any) => [TransitionProps, any];
@@ -2,4 +2,12 @@ import React from 'react';
2
2
  export declare const htmlInputAttrs: string[];
3
3
  export declare const htmlInputEvents: string[];
4
4
  export declare const htmlInputProps: string[];
5
+ /**
6
+ * Returns an array of objects consisting of: props of html input element and rest.
7
+ * @param {object} props A ReactElement props object
8
+ * @param {Object} [options={}]
9
+ * @param {Array} [options.htmlProps] An array of html input props
10
+ * @param {boolean} [options.includeAria] Includes all input props that starts with "aria-"
11
+ * @returns {[{}, {}]} An array of objects
12
+ */
5
13
  export declare const partitionHTMLProps: (props: any, options?: any) => [React.AllHTMLAttributes<any>, any];
@@ -1,3 +1,15 @@
1
1
  import { PopperProps } from '../Popper';
2
2
  export declare const popperAllProps: string[];
3
+ /**
4
+ * Returns an array of objects consisting of: props of html input element and rest.
5
+ * @author Parker
6
+ * @CreateTime 2022/4/8 17:46:40
7
+ * @LastEditor Parker
8
+ * @ModifyTime 2025/2/22 11:48:08
9
+ * @param {object} props A ReactElement props object
10
+ * @param {Object} [options={}]
11
+ * @param {Array} [options.htmlProps] An array of html input props
12
+ * @param {boolean} [options.includeAria] Includes all input props that starts with "aria-"
13
+ * @returns {[{}, {}]} An array of objects
14
+ */
3
15
  export declare const partitionPopperPropsUtils: (props: any, options?: any) => [Partial<PopperProps>, any];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="lodash" />
2
- export declare const globalKey = "el";
2
+ export declare const namespace = "el";
3
3
  export declare const getClassNamePrefix: () => string;
4
4
  export declare const defaultClassPrefix: (name: string) => string;
5
5
  export type ISplitCode = '-' | '__' | '--';
@@ -32,15 +32,15 @@ __export(prefix_exports, {
32
32
  default: () => prefix_default,
33
33
  defaultClassPrefix: () => defaultClassPrefix,
34
34
  getClassNamePrefix: () => getClassNamePrefix,
35
- globalKey: () => globalKey,
35
+ namespace: () => namespace,
36
36
  prefix: () => prefix
37
37
  });
38
38
  module.exports = __toCommonJS(prefix_exports);
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var import_curry = __toESM(require("lodash/curry"));
41
- var globalKey = "el";
41
+ var namespace = "el";
42
42
  var getClassNamePrefix = () => {
43
- return globalKey + "-";
43
+ return namespace + "-";
44
44
  };
45
45
  var defaultClassPrefix = (name) => `${getClassNamePrefix()}${name}`;
46
46
  function prefix(pre, className, split = "-") {
@@ -57,6 +57,6 @@ var prefix_default = (0, import_curry.default)(prefix);
57
57
  0 && (module.exports = {
58
58
  defaultClassPrefix,
59
59
  getClassNamePrefix,
60
- globalKey,
60
+ namespace,
61
61
  prefix
62
62
  });