@douyinfe/semi-ui 2.1.0-next.0 → 2.1.0-next.1

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 (333) hide show
  1. package/dist/css/semi.css +14 -1
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +44750 -42235
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/_utils/index.js +10 -6
  8. package/lib/cjs/anchor/index.js +11 -7
  9. package/lib/cjs/autoComplete/index.d.ts +36 -11
  10. package/lib/cjs/autoComplete/index.js +12 -10
  11. package/lib/cjs/avatar/avatarGroup.js +9 -5
  12. package/lib/cjs/badge/index.js +6 -4
  13. package/lib/cjs/breadcrumb/index.js +5 -5
  14. package/lib/cjs/breadcrumb/item.js +8 -4
  15. package/lib/cjs/button/index.d.ts +0 -1
  16. package/lib/cjs/button/index.js +1 -2
  17. package/lib/cjs/calendar/dayCalendar.js +4 -4
  18. package/lib/cjs/calendar/monthCalendar.js +4 -4
  19. package/lib/cjs/calendar/rangeCalendar.js +4 -4
  20. package/lib/cjs/calendar/weekCalendar.js +4 -4
  21. package/lib/cjs/card/index.js +6 -4
  22. package/lib/cjs/cascader/index.d.ts +1 -0
  23. package/lib/cjs/cascader/index.js +45 -23
  24. package/lib/cjs/cascader/item.js +3 -5
  25. package/lib/cjs/checkbox/checkbox.js +11 -7
  26. package/lib/cjs/checkbox/checkboxGroup.js +3 -3
  27. package/lib/cjs/checkbox/checkboxInner.js +4 -4
  28. package/lib/cjs/collapse/index.js +4 -8
  29. package/lib/cjs/collapsible/index.js +4 -1
  30. package/lib/cjs/datePicker/datePicker.js +29 -21
  31. package/lib/cjs/datePicker/footer.js +4 -4
  32. package/lib/cjs/datePicker/month.js +12 -8
  33. package/lib/cjs/datePicker/monthsGrid.js +6 -4
  34. package/lib/cjs/datePicker/navigation.js +7 -7
  35. package/lib/cjs/datePicker/yearAndMonth.d.ts +2 -2
  36. package/lib/cjs/datePicker/yearAndMonth.js +7 -5
  37. package/lib/cjs/descriptions/index.js +3 -3
  38. package/lib/cjs/dropdown/dropdownItem.js +5 -5
  39. package/lib/cjs/dropdown/index.js +6 -4
  40. package/lib/cjs/form/arrayField.js +7 -5
  41. package/lib/cjs/form/baseForm.d.ts +5 -11
  42. package/lib/cjs/form/baseForm.js +8 -9
  43. package/lib/cjs/form/field.d.ts +5 -23
  44. package/lib/cjs/form/field.js +2 -18
  45. package/lib/cjs/form/group.js +3 -3
  46. package/lib/cjs/form/hoc/withField.d.ts +1 -1
  47. package/lib/cjs/form/hoc/withField.js +0 -3
  48. package/lib/cjs/form/slot.js +10 -6
  49. package/lib/cjs/iconButton/index.d.ts +0 -1
  50. package/lib/cjs/iconButton/index.js +4 -5
  51. package/lib/cjs/input/index.js +20 -16
  52. package/lib/cjs/input/inputGroup.js +4 -4
  53. package/lib/cjs/input/textarea.js +16 -12
  54. package/lib/cjs/inputNumber/index.js +15 -13
  55. package/lib/cjs/list/index.js +4 -4
  56. package/lib/cjs/list/item.js +4 -4
  57. package/lib/cjs/locale/localeConsumer.d.ts +5 -5
  58. package/lib/cjs/locale/localeConsumer.js +4 -4
  59. package/lib/cjs/modal/Modal.js +6 -6
  60. package/lib/cjs/modal/ModalContent.js +4 -4
  61. package/lib/cjs/modal/confirm.js +3 -3
  62. package/lib/cjs/modal/useModal/HookModal.d.ts +3 -2
  63. package/lib/cjs/modal/useModal/HookModal.js +3 -3
  64. package/lib/cjs/navigation/CollapseButton.js +3 -3
  65. package/lib/cjs/navigation/Item.js +9 -7
  66. package/lib/cjs/navigation/SubNav.js +6 -4
  67. package/lib/cjs/navigation/index.d.ts +1 -1
  68. package/lib/cjs/navigation/index.js +15 -11
  69. package/lib/cjs/notification/index.d.ts +1 -1
  70. package/lib/cjs/notification/index.js +1 -1
  71. package/lib/cjs/notification/notice.js +6 -6
  72. package/lib/cjs/overflowList/index.js +15 -9
  73. package/lib/cjs/overflowList/intersectionObserver.js +6 -4
  74. package/lib/cjs/pagination/index.js +5 -5
  75. package/lib/cjs/popconfirm/index.d.ts +5 -1
  76. package/lib/cjs/popconfirm/index.js +18 -10
  77. package/lib/cjs/popover/Arrow.js +5 -5
  78. package/lib/cjs/popover/index.d.ts +3 -1
  79. package/lib/cjs/popover/index.js +5 -8
  80. package/lib/cjs/radio/context.d.ts +1 -1
  81. package/lib/cjs/radio/radio.d.ts +2 -2
  82. package/lib/cjs/radio/radio.js +4 -4
  83. package/lib/cjs/radio/radioGroup.d.ts +4 -4
  84. package/lib/cjs/radio/radioGroup.js +3 -3
  85. package/lib/cjs/radio/radioInner.js +3 -3
  86. package/lib/cjs/rating/index.d.ts +1 -1
  87. package/lib/cjs/resizeObserver/index.js +1 -0
  88. package/lib/cjs/scrollList/scrollItem.d.ts +12 -11
  89. package/lib/cjs/scrollList/scrollItem.js +34 -28
  90. package/lib/cjs/select/index.js +41 -26
  91. package/lib/cjs/select/option.js +5 -5
  92. package/lib/cjs/select/utils.d.ts +1 -1
  93. package/lib/cjs/select/utils.js +13 -7
  94. package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -1
  95. package/lib/cjs/sideSheet/SideSheetContent.js +3 -3
  96. package/lib/cjs/sideSheet/index.d.ts +3 -3
  97. package/lib/cjs/sideSheet/index.js +3 -3
  98. package/lib/cjs/slider/index.js +9 -7
  99. package/lib/cjs/space/index.js +13 -9
  100. package/lib/cjs/steps/basicStep.js +3 -3
  101. package/lib/cjs/steps/basicSteps.js +1 -1
  102. package/lib/cjs/steps/fillStep.js +3 -3
  103. package/lib/cjs/steps/fillSteps.js +2 -2
  104. package/lib/cjs/steps/index.js +3 -3
  105. package/lib/cjs/steps/navStep.js +3 -3
  106. package/lib/cjs/steps/navSteps.js +1 -1
  107. package/lib/cjs/switch/index.js +5 -5
  108. package/lib/cjs/table/Body/BaseRow.js +28 -16
  109. package/lib/cjs/table/Body/ExpandedRow.js +11 -7
  110. package/lib/cjs/table/Body/SectionRow.js +6 -4
  111. package/lib/cjs/table/Body/index.js +44 -32
  112. package/lib/cjs/table/ColGroup.js +4 -4
  113. package/lib/cjs/table/ColumnFilter.js +4 -4
  114. package/lib/cjs/table/ColumnSelection.js +3 -3
  115. package/lib/cjs/table/ColumnSorter.js +3 -3
  116. package/lib/cjs/table/CustomExpandIcon.js +8 -8
  117. package/lib/cjs/table/HeadTable.js +7 -5
  118. package/lib/cjs/table/ResizableTable.js +16 -12
  119. package/lib/cjs/table/Table.d.ts +1 -1
  120. package/lib/cjs/table/Table.js +76 -58
  121. package/lib/cjs/table/TableCell.js +28 -18
  122. package/lib/cjs/table/TableHeader.js +7 -5
  123. package/lib/cjs/table/TableHeaderRow.js +24 -18
  124. package/lib/cjs/table/TablePagination.js +7 -5
  125. package/lib/cjs/table/getColumns.js +6 -4
  126. package/lib/cjs/table/index.d.ts +1 -1
  127. package/lib/cjs/table/table-context.js +4 -4
  128. package/lib/cjs/table/utils.js +2 -2
  129. package/lib/cjs/tabs/TabBar.d.ts +4 -2
  130. package/lib/cjs/tabs/TabBar.js +14 -6
  131. package/lib/cjs/tabs/TabPane.d.ts +2 -1
  132. package/lib/cjs/tabs/TabPane.js +2 -1
  133. package/lib/cjs/tabs/TabPaneTransition.js +6 -6
  134. package/lib/cjs/tabs/index.d.ts +3 -1
  135. package/lib/cjs/tabs/index.js +95 -21
  136. package/lib/cjs/tabs/interface.d.ts +6 -1
  137. package/lib/cjs/tagInput/index.d.ts +3 -0
  138. package/lib/cjs/tagInput/index.js +34 -19
  139. package/lib/cjs/timePicker/Combobox.d.ts +10 -4
  140. package/lib/cjs/timePicker/Combobox.js +7 -6
  141. package/lib/cjs/timePicker/TimeInput.js +9 -9
  142. package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
  143. package/lib/cjs/timePicker/TimePicker.js +11 -9
  144. package/lib/cjs/timePicker/index.js +3 -3
  145. package/lib/cjs/toast/index.d.ts +1 -1
  146. package/lib/cjs/toast/toast.js +4 -4
  147. package/lib/cjs/tooltip/index.d.ts +3 -0
  148. package/lib/cjs/tooltip/index.js +30 -17
  149. package/lib/cjs/transfer/index.js +23 -15
  150. package/lib/cjs/tree/autoSizer.js +5 -5
  151. package/lib/cjs/tree/collapse.js +3 -3
  152. package/lib/cjs/tree/index.js +16 -10
  153. package/lib/cjs/tree/interface.d.ts +2 -2
  154. package/lib/cjs/tree/nodeList.js +3 -3
  155. package/lib/cjs/tree/treeNode.js +10 -6
  156. package/lib/cjs/tree/treeUtil.js +6 -4
  157. package/lib/cjs/treeSelect/index.d.ts +2 -11
  158. package/lib/cjs/treeSelect/index.js +31 -21
  159. package/lib/cjs/typography/base.d.ts +1 -1
  160. package/lib/cjs/typography/base.js +15 -9
  161. package/lib/cjs/typography/paragraph.d.ts +1 -1
  162. package/lib/cjs/typography/text.d.ts +1 -1
  163. package/lib/cjs/typography/title.d.ts +1 -1
  164. package/lib/cjs/upload/fileCard.d.ts +3 -18
  165. package/lib/cjs/upload/index.d.ts +4 -57
  166. package/lib/cjs/upload/index.js +15 -15
  167. package/lib/cjs/upload/interface.d.ts +56 -0
  168. package/lib/cjs/upload/interface.js +7 -0
  169. package/lib/es/_utils/index.js +7 -5
  170. package/lib/es/anchor/index.js +8 -6
  171. package/lib/es/autoComplete/index.d.ts +36 -11
  172. package/lib/es/autoComplete/index.js +10 -9
  173. package/lib/es/avatar/avatarGroup.js +6 -4
  174. package/lib/es/badge/index.js +4 -3
  175. package/lib/es/breadcrumb/index.js +7 -4
  176. package/lib/es/breadcrumb/item.js +5 -3
  177. package/lib/es/button/index.d.ts +0 -1
  178. package/lib/es/button/index.js +1 -2
  179. package/lib/es/calendar/dayCalendar.js +3 -3
  180. package/lib/es/calendar/monthCalendar.js +3 -3
  181. package/lib/es/calendar/rangeCalendar.js +3 -3
  182. package/lib/es/calendar/weekCalendar.js +3 -3
  183. package/lib/es/card/index.js +5 -3
  184. package/lib/es/cascader/index.d.ts +1 -0
  185. package/lib/es/cascader/index.js +39 -22
  186. package/lib/es/cascader/item.js +2 -2
  187. package/lib/es/checkbox/checkbox.js +8 -6
  188. package/lib/es/checkbox/checkboxGroup.js +2 -2
  189. package/lib/es/checkbox/checkboxInner.js +4 -3
  190. package/lib/es/collapse/index.js +3 -7
  191. package/lib/es/collapsible/index.js +4 -1
  192. package/lib/es/datePicker/datePicker.js +26 -20
  193. package/lib/es/datePicker/footer.js +3 -3
  194. package/lib/es/datePicker/index.d.ts +1 -1
  195. package/lib/es/datePicker/month.js +11 -7
  196. package/lib/es/datePicker/monthsGrid.js +4 -3
  197. package/lib/es/datePicker/navigation.js +6 -6
  198. package/lib/es/datePicker/yearAndMonth.d.ts +2 -2
  199. package/lib/es/datePicker/yearAndMonth.js +5 -4
  200. package/lib/es/descriptions/index.js +2 -2
  201. package/lib/es/dropdown/dropdownItem.js +4 -4
  202. package/lib/es/dropdown/index.js +4 -3
  203. package/lib/es/form/arrayField.js +7 -4
  204. package/lib/es/form/baseForm.d.ts +5 -11
  205. package/lib/es/form/baseForm.js +7 -8
  206. package/lib/es/form/field.d.ts +5 -23
  207. package/lib/es/form/field.js +2 -18
  208. package/lib/es/form/group.js +2 -2
  209. package/lib/es/form/hoc/withField.d.ts +1 -1
  210. package/lib/es/form/hoc/withField.js +0 -3
  211. package/lib/es/form/slot.js +7 -5
  212. package/lib/es/iconButton/index.d.ts +0 -1
  213. package/lib/es/iconButton/index.js +3 -4
  214. package/lib/es/input/index.js +17 -15
  215. package/lib/es/input/inputGroup.js +3 -3
  216. package/lib/es/input/textarea.js +13 -11
  217. package/lib/es/inputNumber/index.js +13 -12
  218. package/lib/es/list/index.js +3 -3
  219. package/lib/es/list/item.js +3 -3
  220. package/lib/es/locale/localeConsumer.d.ts +5 -5
  221. package/lib/es/locale/localeConsumer.js +5 -3
  222. package/lib/es/modal/Modal.js +5 -5
  223. package/lib/es/modal/ModalContent.js +3 -3
  224. package/lib/es/modal/confirm.js +2 -2
  225. package/lib/es/modal/useModal/HookModal.d.ts +3 -2
  226. package/lib/es/modal/useModal/HookModal.js +3 -2
  227. package/lib/es/modal/useModal/index.js +1 -1
  228. package/lib/es/navigation/CollapseButton.js +2 -2
  229. package/lib/es/navigation/Item.js +7 -6
  230. package/lib/es/navigation/SubNav.js +4 -3
  231. package/lib/es/navigation/index.d.ts +1 -1
  232. package/lib/es/navigation/index.js +12 -10
  233. package/lib/es/notification/index.d.ts +1 -1
  234. package/lib/es/notification/index.js +1 -1
  235. package/lib/es/notification/notice.js +5 -5
  236. package/lib/es/overflowList/index.js +13 -8
  237. package/lib/es/overflowList/intersectionObserver.js +4 -3
  238. package/lib/es/pagination/index.js +4 -4
  239. package/lib/es/popconfirm/index.d.ts +5 -1
  240. package/lib/es/popconfirm/index.js +16 -9
  241. package/lib/es/popover/Arrow.js +7 -4
  242. package/lib/es/popover/index.d.ts +3 -1
  243. package/lib/es/popover/index.js +4 -8
  244. package/lib/es/radio/context.d.ts +1 -1
  245. package/lib/es/radio/radio.d.ts +2 -2
  246. package/lib/es/radio/radio.js +3 -3
  247. package/lib/es/radio/radioGroup.d.ts +4 -4
  248. package/lib/es/radio/radioGroup.js +2 -2
  249. package/lib/es/radio/radioInner.js +2 -2
  250. package/lib/es/rating/index.d.ts +1 -1
  251. package/lib/es/resizeObserver/index.js +1 -0
  252. package/lib/es/scrollList/scrollItem.d.ts +12 -11
  253. package/lib/es/scrollList/scrollItem.js +32 -19
  254. package/lib/es/select/index.js +39 -27
  255. package/lib/es/select/option.js +6 -6
  256. package/lib/es/select/utils.d.ts +1 -1
  257. package/lib/es/select/utils.js +12 -8
  258. package/lib/es/sideSheet/SideSheetContent.d.ts +1 -1
  259. package/lib/es/sideSheet/SideSheetContent.js +2 -2
  260. package/lib/es/sideSheet/index.d.ts +3 -3
  261. package/lib/es/sideSheet/index.js +2 -2
  262. package/lib/es/slider/index.js +7 -6
  263. package/lib/es/space/index.js +10 -8
  264. package/lib/es/steps/basicStep.js +2 -2
  265. package/lib/es/steps/basicSteps.js +2 -2
  266. package/lib/es/steps/fillStep.js +2 -2
  267. package/lib/es/steps/fillSteps.js +3 -3
  268. package/lib/es/steps/index.js +2 -2
  269. package/lib/es/steps/navStep.js +2 -2
  270. package/lib/es/steps/navSteps.js +2 -2
  271. package/lib/es/switch/index.js +4 -4
  272. package/lib/es/table/Body/BaseRow.js +25 -15
  273. package/lib/es/table/Body/ExpandedRow.js +9 -6
  274. package/lib/es/table/Body/SectionRow.js +4 -3
  275. package/lib/es/table/Body/index.js +58 -31
  276. package/lib/es/table/ColGroup.js +4 -3
  277. package/lib/es/table/ColumnFilter.js +3 -3
  278. package/lib/es/table/ColumnSelection.js +2 -2
  279. package/lib/es/table/ColumnSorter.js +2 -2
  280. package/lib/es/table/CustomExpandIcon.js +8 -7
  281. package/lib/es/table/HeadTable.js +7 -4
  282. package/lib/es/table/ResizableTable.js +17 -9
  283. package/lib/es/table/Table.d.ts +1 -1
  284. package/lib/es/table/Table.js +69 -44
  285. package/lib/es/table/TableCell.js +24 -17
  286. package/lib/es/table/TableHeader.js +5 -4
  287. package/lib/es/table/TableHeaderRow.js +24 -11
  288. package/lib/es/table/TablePagination.js +7 -4
  289. package/lib/es/table/getColumns.js +5 -4
  290. package/lib/es/table/index.d.ts +1 -1
  291. package/lib/es/table/table-context.js +4 -3
  292. package/lib/es/table/utils.js +2 -2
  293. package/lib/es/tabs/TabBar.d.ts +4 -2
  294. package/lib/es/tabs/TabBar.js +14 -6
  295. package/lib/es/tabs/TabPane.d.ts +2 -1
  296. package/lib/es/tabs/TabPane.js +3 -2
  297. package/lib/es/tabs/TabPaneTransition.js +5 -5
  298. package/lib/es/tabs/index.d.ts +3 -1
  299. package/lib/es/tabs/index.js +90 -19
  300. package/lib/es/tabs/interface.d.ts +6 -1
  301. package/lib/es/tagInput/index.d.ts +3 -0
  302. package/lib/es/tagInput/index.js +28 -18
  303. package/lib/es/timePicker/Combobox.d.ts +10 -4
  304. package/lib/es/timePicker/Combobox.js +6 -5
  305. package/lib/es/timePicker/TimeInput.js +8 -8
  306. package/lib/es/timePicker/TimePicker.d.ts +1 -1
  307. package/lib/es/timePicker/TimePicker.js +9 -8
  308. package/lib/es/timePicker/index.js +2 -2
  309. package/lib/es/toast/index.d.ts +1 -1
  310. package/lib/es/toast/toast.js +3 -3
  311. package/lib/es/tooltip/index.d.ts +3 -0
  312. package/lib/es/tooltip/index.js +35 -16
  313. package/lib/es/transfer/index.js +16 -11
  314. package/lib/es/tree/autoSizer.js +4 -4
  315. package/lib/es/tree/collapse.js +2 -2
  316. package/lib/es/tree/index.js +12 -9
  317. package/lib/es/tree/interface.d.ts +2 -2
  318. package/lib/es/tree/nodeList.js +2 -2
  319. package/lib/es/tree/treeNode.js +7 -5
  320. package/lib/es/tree/treeUtil.js +4 -3
  321. package/lib/es/treeSelect/index.d.ts +2 -11
  322. package/lib/es/treeSelect/index.js +28 -20
  323. package/lib/es/typography/base.d.ts +1 -1
  324. package/lib/es/typography/base.js +17 -8
  325. package/lib/es/typography/paragraph.d.ts +1 -1
  326. package/lib/es/typography/text.d.ts +1 -1
  327. package/lib/es/typography/title.d.ts +1 -1
  328. package/lib/es/upload/fileCard.d.ts +3 -18
  329. package/lib/es/upload/index.d.ts +4 -57
  330. package/lib/es/upload/index.js +14 -14
  331. package/lib/es/upload/interface.d.ts +56 -0
  332. package/lib/es/upload/interface.js +1 -0
  333. package/package.json +12 -9
@@ -1,9 +1,10 @@
1
+ import _isPlainObject from "lodash/isPlainObject";
2
+ import _cloneDeepWith from "lodash/cloneDeepWith";
1
3
  import React from 'react';
2
- import { cloneDeepWith, isPlainObject } from 'lodash-es';
3
4
  export function cloneDeep(treeNodeList) {
4
- return cloneDeepWith(treeNodeList, val => {
5
+ return _cloneDeepWith(treeNodeList, val => {
5
6
  // only clone treeNode inner data and skip user data
6
- if (isPlainObject(val) && !val._innerDataTag) {
7
+ if (_isPlainObject(val) && !val._innerDataTag) {
7
8
  return val;
8
9
  }
9
10
 
@@ -27,16 +27,7 @@ export declare type RenderSelectedItemInMultiple = (treeNode: TreeNodeData, othe
27
27
  isRenderInTag: boolean;
28
28
  content: React.ReactNode;
29
29
  };
30
- export interface RenderSelectedItem {
31
- (treeNode: TreeNodeData): React.ReactNode;
32
- (treeNode: TreeNodeData, otherProps: {
33
- index: number | string;
34
- onClose: (tagContent: any, e: React.MouseEvent) => void;
35
- }): {
36
- isRenderInTag: boolean;
37
- content: React.ReactNode;
38
- };
39
- }
30
+ export declare type RenderSelectedItem = RenderSelectedItemInSingle | RenderSelectedItemInMultiple;
40
31
  export declare type OverrideCommonProps = 'renderFullLabel' | 'renderLabel' | 'defaultValue' | 'emptyContent' | 'filterTreeNode' | 'style' | 'treeData' | 'value' | 'onExpand';
41
32
  /**
42
33
  * Type definition description:
@@ -205,7 +196,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
205
196
  renderArrow: () => JSX.Element;
206
197
  renderClearBtn: () => JSX.Element;
207
198
  renderSelection: () => JSX.Element;
208
- renderTagItem: (key: string, idx: number) => any;
199
+ renderTagItem: (key: string, idx: number) => React.ReactNode;
209
200
  renderTagInput: () => JSX.Element;
210
201
  renderInput: () => JSX.Element;
211
202
  renderEmpty: () => JSX.Element;
@@ -1,3 +1,9 @@
1
+ import _isFunction from "lodash/isFunction";
2
+ import _get from "lodash/get";
3
+ import _noop from "lodash/noop";
4
+ import _isEmpty from "lodash/isEmpty";
5
+ import _isString from "lodash/isString";
6
+ import _isEqual from "lodash/isEqual";
1
7
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
2
8
  import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
3
9
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
@@ -9,7 +15,6 @@ import React, { Fragment } from 'react';
9
15
  import ReactDOM from 'react-dom';
10
16
  import cls from 'classnames';
11
17
  import PropTypes from 'prop-types';
12
- import { isEqual, isString, isEmpty, noop, get, isFunction } from 'lodash-es';
13
18
  import TreeSelectFoundation from '@douyinfe/semi-foundation/lib/es/treeSelect/foundation';
14
19
  import { convertDataToEntities, flattenTreeData, calcExpandedKeysForValues, calcMotionKeys, findKeysForValues, calcCheckedKeys, calcExpandedKeys, getValueOrKey, normalizeKeyList, calcDisabledKeys, normalizeValue } from '@douyinfe/semi-foundation/lib/es/tree/treeUtil';
15
20
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/treeSelect/constants';
@@ -47,7 +52,7 @@ class TreeSelect extends BaseComponent {
47
52
  } = this.props;
48
53
  const suffixWrapperCls = cls({
49
54
  ["".concat(prefixcls, "-suffix")]: true,
50
- ["".concat(prefixcls, "-suffix-text")]: suffix && isString(suffix),
55
+ ["".concat(prefixcls, "-suffix-text")]: suffix && _isString(suffix),
51
56
  ["".concat(prefixcls, "-suffix-icon")]: isSemiIcon(suffix)
52
57
  });
53
58
  return /*#__PURE__*/React.createElement("div", {
@@ -65,7 +70,7 @@ class TreeSelect extends BaseComponent {
65
70
  ["".concat(prefixcls, "-prefix")]: true,
66
71
  // to be doublechecked
67
72
  ["".concat(prefixcls, "-inset-label")]: insetLabel,
68
- ["".concat(prefixcls, "-prefix-text")]: labelNode && isString(labelNode),
73
+ ["".concat(prefixcls, "-prefix-text")]: labelNode && _isString(labelNode),
69
74
  ["".concat(prefixcls, "-prefix-icon")]: isSemiIcon(labelNode)
70
75
  });
71
76
  return /*#__PURE__*/React.createElement("div", {
@@ -139,9 +144,9 @@ class TreeSelect extends BaseComponent {
139
144
  size,
140
145
  renderSelectedItem: propRenderSelectedItem
141
146
  } = this.props;
142
- const renderSelectedItem = isFunction(propRenderSelectedItem) ? propRenderSelectedItem : item => ({
147
+ const renderSelectedItem = _isFunction(propRenderSelectedItem) ? propRenderSelectedItem : item => ({
143
148
  isRenderInTag: true,
144
- content: get(item, treeNodeLabelProp, null)
149
+ content: _get(item, treeNodeLabelProp, null)
145
150
  });
146
151
  const renderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly);
147
152
  const tagList = []; // eslint-disable-next-line @typescript-eslint/no-shadow
@@ -348,8 +353,10 @@ class TreeSelect extends BaseComponent {
348
353
  onMouseLeave: e => this.handleMouseLeave(e)
349
354
  } : {};
350
355
  const isTriggerPositionSearch = searchPosition === strings.SEARCH_POSITION_TRIGGER && filterable;
351
- const isEmptyTriggerSearch = isTriggerPositionSearch && isEmpty(checkedKeys);
352
- const isValueTriggerSearch = isTriggerPositionSearch && !isEmpty(checkedKeys);
356
+
357
+ const isEmptyTriggerSearch = isTriggerPositionSearch && _isEmpty(checkedKeys);
358
+
359
+ const isValueTriggerSearch = isTriggerPositionSearch && !_isEmpty(checkedKeys);
353
360
  const classNames = useCustomTrigger ? cls(className) : cls(prefixcls, {
354
361
  ["".concat(prefixcls, "-focus")]: isOpen && !isInput,
355
362
  ["".concat(prefixcls, "-disabled")]: disabled,
@@ -370,7 +377,7 @@ class TreeSelect extends BaseComponent {
370
377
  const inner = useCustomTrigger ? /*#__PURE__*/React.createElement(Trigger, {
371
378
  inputValue: inputValue,
372
379
  // eslint-disable-next-line @typescript-eslint/no-shadow
373
- value: _mapInstanceProperty(triggerRenderKeys).call(triggerRenderKeys, key => get(keyEntities, [key, 'data'])),
380
+ value: _mapInstanceProperty(triggerRenderKeys).call(triggerRenderKeys, key => _get(keyEntities, [key, 'data'])),
374
381
  disabled: disabled,
375
382
  placeholder: placeholder,
376
383
  onClear: this.handleClear,
@@ -422,7 +429,7 @@ class TreeSelect extends BaseComponent {
422
429
  const tagCls = cls("".concat(prefixcls, "-selection-tag"), {
423
430
  ["".concat(prefixcls, "-selection-tag-disabled")]: disabled
424
431
  });
425
- const nodeHaveData = !isEmpty(nodes) && !isEmpty(nodes[0]);
432
+ const nodeHaveData = !_isEmpty(nodes) && !_isEmpty(nodes[0]);
426
433
  const isDisableStrictlyNode = disableStrictly && nodeHaveData && disabledKeys.has(nodes[0].key);
427
434
  const closable = nodeHaveData && !nodes[0].disabled && !disabled && !isDisableStrictlyNode;
428
435
 
@@ -441,12 +448,12 @@ class TreeSelect extends BaseComponent {
441
448
  onClose
442
449
  };
443
450
  const item = nodes[0];
444
- const renderSelectedItem = isFunction(propRenderSelectedItem) ? propRenderSelectedItem : selectedItem => ({
451
+ const renderSelectedItem = _isFunction(propRenderSelectedItem) ? propRenderSelectedItem : selectedItem => ({
445
452
  isRenderInTag: true,
446
- content: get(selectedItem, treeNodeLabelProp, null)
453
+ content: _get(selectedItem, treeNodeLabelProp, null)
447
454
  });
448
455
 
449
- if (isFunction(renderSelectedItem)) {
456
+ if (_isFunction(renderSelectedItem)) {
450
457
  const {
451
458
  content,
452
459
  isRenderInTag
@@ -676,7 +683,7 @@ class TreeSelect extends BaseComponent {
676
683
  motionExpand
677
684
  } = this.props;
678
685
 
679
- if (!virtualize || isEmpty(virtualize)) {
686
+ if (!virtualize || _isEmpty(virtualize)) {
680
687
  return /*#__PURE__*/React.createElement(NodeList, {
681
688
  flattenNodes: flattenNodes,
682
689
  flattenList: this._flattenNodes,
@@ -750,7 +757,7 @@ class TreeSelect extends BaseComponent {
750
757
  ["".concat(prefixTree, "-option-list-block")]: true
751
758
  });
752
759
  const searchNoRes = Boolean(inputValue) && !filteredKeys.size;
753
- const noData = isEmpty(flattenNodes) || showFilteredOnly && searchNoRes;
760
+ const noData = _isEmpty(flattenNodes) || showFilteredOnly && searchNoRes;
754
761
  const isDropdownPositionSearch = searchPosition === strings.SEARCH_POSITION_DROPDOWN;
755
762
  return /*#__PURE__*/React.createElement(TreeContext.Provider, {
756
763
  value: {
@@ -765,7 +772,7 @@ class TreeSelect extends BaseComponent {
765
772
  onNodeClick: this.onNodeClick,
766
773
  onNodeDoubleClick: this.onNodeDoubleClick,
767
774
  // tree node will call this function when treeNode is right clicked
768
- onNodeRightClick: noop,
775
+ onNodeRightClick: _noop,
769
776
  onNodeExpand: this.onNodeExpand,
770
777
  onNodeSelect: this.onNodeSelect,
771
778
  onNodeCheck: this.onNodeCheck,
@@ -828,7 +835,7 @@ class TreeSelect extends BaseComponent {
828
835
  rePosKey
829
836
  } = prevState;
830
837
 
831
- const needUpdate = name => !prevProps && name in props || prevProps && !isEqual(prevProps[name], props[name]);
838
+ const needUpdate = name => !prevProps && name in props || prevProps && !_isEqual(prevProps[name], props[name]);
832
839
 
833
840
  let treeData;
834
841
  const withObject = props.onChangeWithObject;
@@ -849,7 +856,7 @@ class TreeSelect extends BaseComponent {
849
856
  } // if treeData keys changes, we won't show animation
850
857
 
851
858
 
852
- if (treeData && props.motion && !isEqual(new _Set(_Object$keys(newState.keyEntities)), new _Set(_Object$keys(prevState.keyEntities)))) {
859
+ if (treeData && props.motion && !_isEqual(new _Set(_Object$keys(newState.keyEntities)), new _Set(_Object$keys(prevState.keyEntities)))) {
853
860
  if (prevProps && props.motion) {
854
861
  newState.motionKeys = new _Set([]);
855
862
  newState.motionType = null;
@@ -952,7 +959,8 @@ class TreeSelect extends BaseComponent {
952
959
  registerClickOutsideHandler: cb => {
953
960
  const clickOutsideHandler = e => {
954
961
  const optionInstance = this.optionsRef && this.optionsRef.current;
955
- const triggerDom = this.triggerRef && this.triggerRef.current;
962
+ const triggerDom = this.triggerRef && this.triggerRef.current; // eslint-disable-next-line
963
+
956
964
  const optionsDom = ReactDOM.findDOMNode(optionInstance);
957
965
  const target = e.target;
958
966
 
@@ -995,7 +1003,7 @@ class TreeSelect extends BaseComponent {
995
1003
  const {
996
1004
  onLoad
997
1005
  } = this.props;
998
- isFunction(onLoad) && onLoad(newLoadedKeys, data);
1006
+ _isFunction(onLoad) && onLoad(newLoadedKeys, data);
999
1007
  }
1000
1008
  };
1001
1009
  return _Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign({}, super.adapter), filterAdapter), treeSelectAdapter), treeAdapter), {
@@ -1213,7 +1221,7 @@ TreeSelect.defaultProps = {
1213
1221
  defaultOpen: false,
1214
1222
  showSearchClear: true,
1215
1223
  showClear: false,
1216
- onVisibleChange: noop,
1224
+ onVisibleChange: _noop,
1217
1225
  expandAction: false,
1218
1226
  clickToHide: true,
1219
1227
  searchAutoFocus: false
@@ -63,7 +63,7 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
63
63
  link: PropTypes.Requireable<boolean | object>;
64
64
  spacing: PropTypes.Requireable<"normal" | "extended">;
65
65
  strong: PropTypes.Requireable<boolean>;
66
- size: PropTypes.Requireable<"normal" | "small">;
66
+ size: PropTypes.Requireable<"small" | "normal">;
67
67
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
68
68
  style: PropTypes.Requireable<object>;
69
69
  className: PropTypes.Requireable<string>;
@@ -1,3 +1,7 @@
1
+ import _isString from "lodash/isString";
2
+ import _merge from "lodash/merge";
3
+ import _omit from "lodash/omit";
4
+ import _isUndefined from "lodash/isUndefined";
1
5
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
2
6
  import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
7
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
@@ -24,7 +28,6 @@ import PropTypes from 'prop-types';
24
28
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/typography/constants';
25
29
  import Typography from './typography';
26
30
  import Copyable from './copyable';
27
- import { isUndefined, omit, merge, isString } from 'lodash-es';
28
31
  import Tooltip from '../tooltip/index';
29
32
  import Popover from '../popover/index';
30
33
  import getRenderText from './util';
@@ -94,7 +97,7 @@ export default class Base extends Component {
94
97
  pos,
95
98
  suffix
96
99
  } = this.getEllipsisOpt();
97
- return !expandable && isUndefined(expandText) && !copyable && pos === 'end' && !suffix.length;
100
+ return !expandable && _isUndefined(expandText) && !copyable && pos === 'end' && !suffix.length;
98
101
  };
99
102
  /**
100
103
  * whether truncated
@@ -126,7 +129,9 @@ export default class Base extends Component {
126
129
  expandText
127
130
  } = this.getEllipsisOpt();
128
131
  const overflowed = !expanded && (isOverflowed || isTruncated);
129
- const noExpandText = !expandable && isUndefined(expandText);
132
+
133
+ const noExpandText = !expandable && _isUndefined(expandText);
134
+
130
135
  const show = noExpandText && overflowed && showTooltip;
131
136
 
132
137
  if (!show) {
@@ -140,7 +145,7 @@ export default class Base extends Component {
140
145
 
141
146
  if (typeof showTooltip === 'object') {
142
147
  if (showTooltip.type && showTooltip.type.toLowerCase() === 'popover') {
143
- return merge({
148
+ return _merge({
144
149
  opts: {
145
150
  style: {
146
151
  width: '240px'
@@ -214,8 +219,11 @@ export default class Base extends Component {
214
219
  expanded,
215
220
  first
216
221
  } = this.state;
217
- const noExpandText = !expandable && isUndefined(expandText);
218
- const noCollapseText = !collapsible && isUndefined(collapseText);
222
+
223
+ const noExpandText = !expandable && _isUndefined(expandText);
224
+
225
+ const noCollapseText = !collapsible && _isUndefined(collapseText);
226
+
219
227
  let text;
220
228
 
221
229
  if (!expanded && !noExpandText) {
@@ -544,8 +552,9 @@ export default class Base extends Component {
544
552
  } = _a,
545
553
  rest = __rest(_a, ["component", "children", "className", "type", "spacing", "disabled", "style", "ellipsis", "icon", "size", "link", "heading"]);
546
554
 
547
- const textProps = omit(rest, ['strong', 'editable', 'mark', 'copyable', 'underline', 'code', // 'link',
555
+ const textProps = _omit(rest, ['strong', 'editable', 'mark', 'copyable', 'underline', 'code', // 'link',
548
556
  'delete']);
557
+
549
558
  const iconNode = this.renderIcon();
550
559
  const ellipsisOpt = this.getEllipsisOpt();
551
560
  const {
@@ -568,7 +577,7 @@ export default class Base extends Component {
568
577
  ["".concat(prefixCls, "-link")]: link,
569
578
  ["".concat(prefixCls, "-disabled")]: disabled,
570
579
  [_concatInstanceProperty(_context4 = "".concat(prefixCls, "-")).call(_context4, spacing)]: spacing,
571
- [_concatInstanceProperty(_context5 = "".concat(prefixCls, "-")).call(_context5, heading)]: isString(heading) && hTagReg.test(heading)
580
+ [_concatInstanceProperty(_context5 = "".concat(prefixCls, "-")).call(_context5, heading)]: _isString(heading) && hTagReg.test(heading)
572
581
  });
573
582
  return /*#__PURE__*/React.createElement(Typography, _Object$assign({
574
583
  className: wrapperCls,
@@ -30,7 +30,7 @@ export default class Paragraph extends PureComponent<ParagraphProps> {
30
30
  underline: PropTypes.Requireable<boolean>;
31
31
  strong: PropTypes.Requireable<boolean>;
32
32
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
33
- size: PropTypes.Requireable<"normal" | "small">;
33
+ size: PropTypes.Requireable<"small" | "normal">;
34
34
  spacing: PropTypes.Requireable<"normal" | "extended">;
35
35
  style: PropTypes.Requireable<object>;
36
36
  className: PropTypes.Requireable<string>;
@@ -33,7 +33,7 @@ export default class Text extends PureComponent<TextProps> {
33
33
  link: PropTypes.Requireable<boolean | object>;
34
34
  strong: PropTypes.Requireable<boolean>;
35
35
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
36
- size: PropTypes.Requireable<"normal" | "small">;
36
+ size: PropTypes.Requireable<"small" | "normal">;
37
37
  style: PropTypes.Requireable<object>;
38
38
  className: PropTypes.Requireable<string>;
39
39
  code: PropTypes.Requireable<boolean>;
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<4 | 2 | 3 | 1 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -1,25 +1,10 @@
1
- import { PureComponent, ReactNode, MouseEventHandler, MouseEvent, CSSProperties } from 'react';
1
+ import { PureComponent, ReactNode, MouseEvent, CSSProperties } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Locale } from '../locale/interface';
4
- export interface FileCardProps {
4
+ import { RenderFileItemProps } from './interface';
5
+ export interface FileCardProps extends RenderFileItemProps {
5
6
  className?: string;
6
- disabled?: boolean;
7
- listType?: 'picture' | 'list';
8
- name?: string;
9
- onPreviewClick?: MouseEventHandler<HTMLDivElement>;
10
- onRemove?: (props: FileCardProps, e: MouseEvent) => void;
11
- onReplace?: (props: FileCardProps, e: MouseEvent) => void;
12
- onRetry?: (props: FileCardProps, e: MouseEvent) => void;
13
- percent?: number;
14
- preview?: boolean;
15
- previewFile?: (props: FileCardProps) => ReactNode;
16
- showReplace?: boolean;
17
- showRetry?: boolean;
18
- size?: string;
19
- status?: string;
20
7
  style?: CSSProperties;
21
- url?: string;
22
- validateMessage?: ReactNode;
23
8
  }
24
9
  declare class FileCard extends PureComponent<FileCardProps> {
25
10
  static propTypes: {
@@ -1,65 +1,12 @@
1
1
  import { ReactNode, CSSProperties, RefObject, ChangeEvent, DragEvent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import UploadFoundation, { BaseFileItem, UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
4
- import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
3
+ import UploadFoundation, { UploadAdapter, BeforeUploadObjectResult, AfterUploadResult } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
5
4
  import FileCard from './fileCard';
6
5
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
7
- import { ArrayElement } from '../_base/base';
6
+ import { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError } from './interface';
8
7
  import { Locale } from '../locale/interface';
9
8
  import '@douyinfe/semi-foundation/lib/es/upload/upload.css';
10
- export { BeforeUploadObjectResult, AfterUploadResult };
11
- export interface FileItem extends BaseFileItem {
12
- validateMessage?: ReactNode;
13
- }
14
- export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
15
- export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
16
- export interface RenderFileItemProps extends FileItem {
17
- previewFile: (fileItem: FileItem) => ReactNode;
18
- listType: UploadListType;
19
- onRemove: () => void;
20
- onRetry: () => void;
21
- onReplace: () => void;
22
- key: string;
23
- showRetry: boolean;
24
- showReplace: boolean;
25
- style: CSSProperties;
26
- disabled: boolean;
27
- onPreviewClick: () => void;
28
- }
29
- export interface BeforeUploadProps {
30
- file: FileItem;
31
- fileList: Array<FileItem>;
32
- }
33
- export interface AfterUploadProps {
34
- file: FileItem;
35
- fileList: Array<FileItem>;
36
- response: any;
37
- }
38
- export interface OnChangeProps {
39
- fileList: Array<FileItem>;
40
- currentFile: FileItem;
41
- }
42
- export interface customRequestArgs {
43
- fileName: string;
44
- data: Record<string, any>;
45
- file: FileItem;
46
- fileInstance: File;
47
- onProgress: (event: {
48
- total: number;
49
- loaded: number;
50
- }) => any;
51
- onError: (userXhr: {
52
- status?: number;
53
- }, e: Event) => any;
54
- onSuccess: (response: any, e: Event) => any;
55
- withCredentials: boolean;
56
- action: string;
57
- }
58
- export interface CustomError extends Error {
59
- status: number;
60
- method: string;
61
- url: string;
62
- }
9
+ export { FileItem, RenderFileItemProps, UploadListType, PromptPositionType, BeforeUploadProps, AfterUploadProps, OnChangeProps, customRequestArgs, CustomError, BeforeUploadObjectResult, AfterUploadResult };
63
10
  export interface UploadProps {
64
11
  accept?: string;
65
12
  action: string;
@@ -103,7 +50,7 @@ export interface UploadProps {
103
50
  onRetry?: (fileItem: FileItem) => void;
104
51
  onSizeError?: (file: File, fileList: Array<FileItem>) => void;
105
52
  onSuccess?: (responseBody: any, file: File, fileList: Array<FileItem>) => void;
106
- previewFile?: (fileItem: FileItem) => ReactNode;
53
+ previewFile?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
107
54
  prompt?: ReactNode;
108
55
  promptPosition?: PromptPositionType;
109
56
  renderFileItem?: (renderFileItemProps: RenderFileItemProps) => ReactNode;
@@ -1,3 +1,4 @@
1
+ import _noop from "lodash/noop";
1
2
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
2
3
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
3
4
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
@@ -6,7 +7,6 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
6
7
  import React from 'react';
7
8
  import cls from 'classnames';
8
9
  import PropTypes from 'prop-types';
9
- import { noop } from 'lodash-es';
10
10
  import UploadFoundation from '@douyinfe/semi-foundation/lib/es/upload/foundation';
11
11
  import { strings, cssClasses } from '@douyinfe/semi-foundation/lib/es/upload/constants';
12
12
  import FileCard from './fileCard';
@@ -498,21 +498,21 @@ Upload.defaultProps = {
498
498
  disabled: false,
499
499
  listType: 'list',
500
500
  multiple: false,
501
- onAcceptInvalid: noop,
502
- onChange: noop,
501
+ onAcceptInvalid: _noop,
502
+ onChange: _noop,
503
503
  beforeRemove: () => true,
504
504
  beforeClear: () => true,
505
- onClear: noop,
506
- onDrop: noop,
507
- onError: noop,
508
- onExceed: noop,
509
- onFileChange: noop,
510
- onOpenFileDialog: noop,
511
- onProgress: noop,
512
- onRemove: noop,
513
- onRetry: noop,
514
- onSizeError: noop,
515
- onSuccess: noop,
505
+ onClear: _noop,
506
+ onDrop: _noop,
507
+ onError: _noop,
508
+ onExceed: _noop,
509
+ onFileChange: _noop,
510
+ onOpenFileDialog: _noop,
511
+ onProgress: _noop,
512
+ onRemove: _noop,
513
+ onRetry: _noop,
514
+ onSizeError: _noop,
515
+ onSuccess: _noop,
516
516
  promptPosition: 'right',
517
517
  showClear: true,
518
518
  showReplace: false,
@@ -0,0 +1,56 @@
1
+ import { ReactNode, CSSProperties, MouseEvent } from 'react';
2
+ import { BaseFileItem } from '@douyinfe/semi-foundation/lib/es/upload/foundation';
3
+ import { strings } from '@douyinfe/semi-foundation/lib/es/upload/constants';
4
+ import { ArrayElement } from '../_base/base';
5
+ export declare type PromptPositionType = ArrayElement<typeof strings.PROMPT_POSITION>;
6
+ export declare type UploadListType = ArrayElement<typeof strings.LIST_TYPE>;
7
+ export interface BeforeUploadProps {
8
+ file: FileItem;
9
+ fileList: Array<FileItem>;
10
+ }
11
+ export interface AfterUploadProps {
12
+ file: FileItem;
13
+ fileList: Array<FileItem>;
14
+ response: any;
15
+ }
16
+ export interface OnChangeProps {
17
+ fileList: Array<FileItem>;
18
+ currentFile: FileItem;
19
+ }
20
+ export interface customRequestArgs {
21
+ fileName: string;
22
+ data: Record<string, any>;
23
+ file: FileItem;
24
+ fileInstance: File;
25
+ onProgress: (event: {
26
+ total: number;
27
+ loaded: number;
28
+ }) => any;
29
+ onError: (userXhr: {
30
+ status?: number;
31
+ }, e: Event) => any;
32
+ onSuccess: (response: any, e: Event) => any;
33
+ withCredentials: boolean;
34
+ action: string;
35
+ }
36
+ export interface CustomError extends Error {
37
+ status: number;
38
+ method: string;
39
+ url: string;
40
+ }
41
+ export interface FileItem extends BaseFileItem {
42
+ validateMessage?: ReactNode;
43
+ }
44
+ export interface RenderFileItemProps extends FileItem {
45
+ previewFile?: (fileItem: RenderFileItemProps) => ReactNode;
46
+ listType: UploadListType;
47
+ onRemove: (props: RenderFileItemProps, e: MouseEvent) => void;
48
+ onRetry: (props: RenderFileItemProps, e: MouseEvent) => void;
49
+ onReplace: (props: RenderFileItemProps, e: MouseEvent) => void;
50
+ key: string;
51
+ showRetry: boolean;
52
+ showReplace: boolean;
53
+ style?: CSSProperties;
54
+ disabled: boolean;
55
+ onPreviewClick: () => void;
56
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.1.0-next.0",
3
+ "version": "2.1.0-next.1",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -19,17 +19,18 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@babel/runtime-corejs3": "^7.15.4",
22
- "@douyinfe/semi-animation-react": "2.1.0-next.0",
23
- "@douyinfe/semi-foundation": "2.1.0-next.0",
24
- "@douyinfe/semi-icons": "2.1.0-next.0",
25
- "@douyinfe/semi-illustrations": "2.1.0-next.0",
26
- "@douyinfe/semi-theme-default": "2.0.6",
22
+ "@douyinfe/semi-animation-react": "2.1.0-next.1",
23
+ "@douyinfe/semi-foundation": "2.1.0-next.1",
24
+ "@douyinfe/semi-icons": "2.1.0-next.1",
25
+ "@douyinfe/semi-illustrations": "2.1.0-next.1",
26
+ "@douyinfe/semi-theme-default": "2.1.1",
27
+ "@types/react-window": "^1.8.2",
27
28
  "async-validator": "^3.5.0",
28
29
  "classnames": "^2.2.6",
29
30
  "copy-text-to-clipboard": "^2.1.1",
30
31
  "date-fns": "^2.9.0",
31
32
  "date-fns-tz": "^1.0.10",
32
- "lodash-es": "^4.17.21",
33
+ "lodash": "^4.17.21",
33
34
  "react-resizable": "^1.8.0",
34
35
  "react-sortable-hoc": "^1.11.0",
35
36
  "react-window": "^1.8.2",
@@ -64,15 +65,17 @@
64
65
  ],
65
66
  "author": "",
66
67
  "license": "MIT",
67
- "gitHead": "165521f2a49e95bf358c03b7f376dbc84ec02adc",
68
+ "gitHead": "a3621f11541ff3fc91310ba0f3d89d50dd558678",
68
69
  "devDependencies": {
69
70
  "@babel/plugin-proposal-decorators": "^7.15.8",
70
71
  "@babel/plugin-transform-runtime": "^7.15.8",
71
72
  "@babel/preset-env": "^7.15.8",
72
73
  "@babel/preset-react": "^7.14.5",
73
- "@douyinfe/semi-scss-compile": "2.1.0-next.0",
74
+ "@douyinfe/semi-scss-compile": "2.1.0-next.1",
74
75
  "@storybook/addon-knobs": "^6.3.1",
76
+ "@types/lodash": "^4.14.176",
75
77
  "babel-loader": "^8.2.2",
78
+ "babel-plugin-lodash": "^3.3.4",
76
79
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
77
80
  "del": "^6.0.0",
78
81
  "enzyme": "^3.11.0",