@douyinfe/semi-ui 2.22.0-beta.0 → 2.22.0-beta.2

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 (337) hide show
  1. package/dist/css/semi.css +438 -38
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +4084 -5300
  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/_cssAnimation/index.d.ts +39 -0
  8. package/lib/cjs/_cssAnimation/index.js +133 -0
  9. package/lib/cjs/anchor/index.d.ts +3 -3
  10. package/lib/cjs/anchor/link.d.ts +1 -1
  11. package/lib/cjs/autoComplete/index.d.ts +7 -8
  12. package/lib/cjs/autoComplete/option.d.ts +1 -1
  13. package/lib/cjs/banner/index.d.ts +2 -2
  14. package/lib/cjs/breadcrumb/index.d.ts +3 -3
  15. package/lib/cjs/breadcrumb/item.d.ts +3 -3
  16. package/lib/cjs/button/index.d.ts +2 -2
  17. package/lib/cjs/calendar/dayCalendar.d.ts +2 -2
  18. package/lib/cjs/calendar/index.d.ts +2 -2
  19. package/lib/cjs/calendar/monthCalendar.d.ts +2 -2
  20. package/lib/cjs/calendar/rangeCalendar.d.ts +2 -2
  21. package/lib/cjs/calendar/weekCalendar.d.ts +2 -2
  22. package/lib/cjs/card/cardGroup.d.ts +1 -1
  23. package/lib/cjs/carousel/index.d.ts +1 -1
  24. package/lib/cjs/cascader/index.d.ts +7 -8
  25. package/lib/cjs/cascader/index.js +8 -6
  26. package/lib/cjs/collapse/collapse-context.d.ts +1 -2
  27. package/lib/cjs/collapse/index.d.ts +3 -3
  28. package/lib/cjs/collapse/item.d.ts +2 -2
  29. package/lib/cjs/collapsible/index.d.ts +32 -19
  30. package/lib/cjs/collapsible/index.js +157 -121
  31. package/lib/cjs/configProvider/index.d.ts +1 -1
  32. package/lib/cjs/datePicker/dateInput.d.ts +3 -3
  33. package/lib/cjs/datePicker/datePicker.d.ts +12 -9
  34. package/lib/cjs/datePicker/datePicker.js +11 -13
  35. package/lib/cjs/datePicker/month.d.ts +1 -1
  36. package/lib/cjs/datePicker/month.js +5 -1
  37. package/lib/cjs/datePicker/monthsGrid.d.ts +7 -6
  38. package/lib/cjs/datePicker/monthsGrid.js +9 -26
  39. package/lib/cjs/datePicker/quickControl.d.ts +1 -1
  40. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  41. package/lib/cjs/datePicker/yearAndMonth.js +13 -8
  42. package/lib/cjs/descriptions/index.d.ts +1 -1
  43. package/lib/cjs/dropdown/dropdownItem.d.ts +2 -1
  44. package/lib/cjs/dropdown/dropdownItem.js +3 -1
  45. package/lib/cjs/dropdown/index.d.ts +5 -6
  46. package/lib/cjs/form/baseForm.d.ts +7 -5
  47. package/lib/cjs/form/errorMessage.d.ts +1 -1
  48. package/lib/cjs/form/field.d.ts +4 -2
  49. package/lib/cjs/form/label.d.ts +1 -1
  50. package/lib/cjs/grid/col.d.ts +6 -6
  51. package/lib/cjs/grid/row.d.ts +1 -1
  52. package/lib/cjs/iconButton/index.d.ts +2 -2
  53. package/lib/cjs/image/image.d.ts +4 -4
  54. package/lib/cjs/image/preview.d.ts +1 -1
  55. package/lib/cjs/image/previewInner.d.ts +1 -1
  56. package/lib/cjs/index.d.ts +1 -0
  57. package/lib/cjs/index.js +8 -0
  58. package/lib/cjs/inputNumber/index.d.ts +2 -2
  59. package/lib/cjs/locale/source/ro.d.ts +3 -3
  60. package/lib/cjs/modal/Modal.d.ts +6 -6
  61. package/lib/cjs/modal/Modal.js +80 -56
  62. package/lib/cjs/modal/ModalContent.js +6 -5
  63. package/lib/cjs/modal/confirm.d.ts +10 -10
  64. package/lib/cjs/modal/confirm.js +1 -15
  65. package/lib/cjs/modal/useModal/HookModal.d.ts +0 -2
  66. package/lib/cjs/modal/useModal/HookModal.js +6 -18
  67. package/lib/cjs/navigation/Footer.d.ts +1 -1
  68. package/lib/cjs/navigation/Header.d.ts +3 -3
  69. package/lib/cjs/navigation/Item.d.ts +4 -4
  70. package/lib/cjs/navigation/Item.js +11 -5
  71. package/lib/cjs/navigation/OpenIconTransition.d.ts +1 -15
  72. package/lib/cjs/navigation/OpenIconTransition.js +1 -82
  73. package/lib/cjs/navigation/SubNav.d.ts +4 -4
  74. package/lib/cjs/navigation/SubNav.js +43 -27
  75. package/lib/cjs/navigation/index.d.ts +8 -11
  76. package/lib/cjs/notification/index.d.ts +0 -1
  77. package/lib/cjs/notification/index.js +25 -15
  78. package/lib/cjs/notification/notice.d.ts +3 -1
  79. package/lib/cjs/notification/notice.js +3 -1
  80. package/lib/cjs/popconfirm/index.d.ts +4 -5
  81. package/lib/cjs/popover/index.d.ts +8 -8
  82. package/lib/cjs/popover/index.js +1 -1
  83. package/lib/cjs/progress/index.d.ts +4 -4
  84. package/lib/cjs/rating/index.d.ts +1 -1
  85. package/lib/cjs/rating/item.d.ts +1 -1
  86. package/lib/cjs/scrollList/index.d.ts +1 -1
  87. package/lib/cjs/scrollList/scrollItem.d.ts +3 -3
  88. package/lib/cjs/scrollList/scrollItem.js +2 -2
  89. package/lib/cjs/select/index.d.ts +11 -6
  90. package/lib/cjs/select/index.js +108 -60
  91. package/lib/cjs/select/option.d.ts +1 -1
  92. package/lib/cjs/select/optionGroup.d.ts +1 -1
  93. package/lib/cjs/sideSheet/SideSheetContent.d.ts +8 -0
  94. package/lib/cjs/sideSheet/SideSheetContent.js +10 -6
  95. package/lib/cjs/sideSheet/index.d.ts +4 -4
  96. package/lib/cjs/sideSheet/index.js +69 -39
  97. package/lib/cjs/space/index.d.ts +1 -1
  98. package/lib/cjs/spin/index.js +1 -4
  99. package/lib/cjs/table/Body/BaseRow.d.ts +5 -5
  100. package/lib/cjs/table/Body/ExpandedRow.d.ts +3 -3
  101. package/lib/cjs/table/Body/SectionRow.d.ts +3 -3
  102. package/lib/cjs/table/Column.d.ts +4 -4
  103. package/lib/cjs/table/ColumnShape.d.ts +4 -4
  104. package/lib/cjs/table/ColumnSorter.d.ts +1 -1
  105. package/lib/cjs/table/CustomExpandIcon.d.ts +1 -1
  106. package/lib/cjs/table/CustomExpandIcon.js +13 -5
  107. package/lib/cjs/table/Table.d.ts +16 -16
  108. package/lib/cjs/table/TableCell.d.ts +4 -4
  109. package/lib/cjs/table/TableHeaderRow.d.ts +2 -2
  110. package/lib/cjs/table/TablePagination.d.ts +1 -1
  111. package/lib/cjs/table/index.d.ts +15 -15
  112. package/lib/cjs/tabs/TabPane.d.ts +2 -8
  113. package/lib/cjs/tabs/TabPane.js +40 -38
  114. package/lib/cjs/tabs/index.d.ts +5 -3
  115. package/lib/cjs/tabs/index.js +26 -4
  116. package/lib/cjs/tabs/interface.d.ts +2 -0
  117. package/lib/cjs/tag/group.d.ts +1 -0
  118. package/lib/cjs/tag/group.js +6 -3
  119. package/lib/cjs/tag/index.d.ts +1 -1
  120. package/lib/cjs/tag/index.js +1 -0
  121. package/lib/cjs/tag/interface.d.ts +3 -1
  122. package/lib/cjs/tagInput/index.d.ts +3 -3
  123. package/lib/cjs/timePicker/Combobox.js +4 -8
  124. package/lib/cjs/timePicker/PanelShape.d.ts +2 -2
  125. package/lib/cjs/timePicker/TimePicker.d.ts +11 -11
  126. package/lib/cjs/timePicker/TimePicker.js +3 -1
  127. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  128. package/lib/cjs/timePicker/index.d.ts +10 -9
  129. package/lib/cjs/timeline/index.d.ts +1 -1
  130. package/lib/cjs/toast/index.d.ts +2 -4
  131. package/lib/cjs/toast/index.js +29 -14
  132. package/lib/cjs/toast/toast.d.ts +4 -2
  133. package/lib/cjs/toast/toast.js +3 -1
  134. package/lib/cjs/tooltip/index.d.ts +8 -9
  135. package/lib/cjs/tooltip/index.js +30 -37
  136. package/lib/cjs/transfer/index.d.ts +1 -1
  137. package/lib/cjs/tree/autoSizer.d.ts +2 -2
  138. package/lib/cjs/tree/index.d.ts +5 -5
  139. package/lib/cjs/tree/nodeCollapsible.d.ts +11 -0
  140. package/lib/cjs/tree/nodeCollapsible.js +50 -0
  141. package/lib/cjs/tree/nodeList.js +6 -5
  142. package/lib/cjs/tree/treeNode.d.ts +1 -1
  143. package/lib/cjs/treeSelect/index.d.ts +12 -9
  144. package/lib/cjs/treeSelect/index.js +23 -9
  145. package/lib/cjs/trigger/index.d.ts +1 -1
  146. package/lib/cjs/typography/base.d.ts +8 -8
  147. package/lib/cjs/typography/index.d.ts +2 -0
  148. package/lib/cjs/typography/index.js +3 -0
  149. package/lib/cjs/typography/interface.d.ts +2 -0
  150. package/lib/cjs/typography/numeral.d.ts +68 -0
  151. package/lib/cjs/typography/numeral.js +106 -0
  152. package/lib/cjs/typography/paragraph.d.ts +3 -3
  153. package/lib/cjs/typography/text.d.ts +4 -4
  154. package/lib/cjs/typography/title.d.ts +4 -4
  155. package/lib/cjs/upload/fileCard.d.ts +1 -1
  156. package/lib/es/_cssAnimation/index.d.ts +39 -0
  157. package/lib/es/_cssAnimation/index.js +122 -0
  158. package/lib/es/anchor/index.d.ts +3 -3
  159. package/lib/es/anchor/link.d.ts +1 -1
  160. package/lib/es/autoComplete/index.d.ts +7 -8
  161. package/lib/es/autoComplete/option.d.ts +1 -1
  162. package/lib/es/banner/index.d.ts +2 -2
  163. package/lib/es/breadcrumb/index.d.ts +3 -3
  164. package/lib/es/breadcrumb/item.d.ts +3 -3
  165. package/lib/es/button/index.d.ts +2 -2
  166. package/lib/es/calendar/dayCalendar.d.ts +2 -2
  167. package/lib/es/calendar/index.d.ts +2 -2
  168. package/lib/es/calendar/monthCalendar.d.ts +2 -2
  169. package/lib/es/calendar/rangeCalendar.d.ts +2 -2
  170. package/lib/es/calendar/weekCalendar.d.ts +2 -2
  171. package/lib/es/card/cardGroup.d.ts +1 -1
  172. package/lib/es/carousel/index.d.ts +1 -1
  173. package/lib/es/cascader/index.d.ts +7 -8
  174. package/lib/es/cascader/index.js +8 -6
  175. package/lib/es/collapse/collapse-context.d.ts +1 -2
  176. package/lib/es/collapse/index.d.ts +3 -3
  177. package/lib/es/collapse/item.d.ts +2 -2
  178. package/lib/es/collapsible/index.d.ts +32 -19
  179. package/lib/es/collapsible/index.js +158 -119
  180. package/lib/es/configProvider/index.d.ts +1 -1
  181. package/lib/es/datePicker/dateInput.d.ts +3 -3
  182. package/lib/es/datePicker/datePicker.d.ts +12 -9
  183. package/lib/es/datePicker/datePicker.js +11 -13
  184. package/lib/es/datePicker/month.d.ts +1 -1
  185. package/lib/es/datePicker/month.js +5 -1
  186. package/lib/es/datePicker/monthsGrid.d.ts +7 -6
  187. package/lib/es/datePicker/monthsGrid.js +9 -26
  188. package/lib/es/datePicker/quickControl.d.ts +1 -1
  189. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  190. package/lib/es/datePicker/yearAndMonth.js +13 -8
  191. package/lib/es/descriptions/index.d.ts +1 -1
  192. package/lib/es/dropdown/dropdownItem.d.ts +2 -1
  193. package/lib/es/dropdown/dropdownItem.js +3 -1
  194. package/lib/es/dropdown/index.d.ts +5 -6
  195. package/lib/es/form/baseForm.d.ts +7 -5
  196. package/lib/es/form/errorMessage.d.ts +1 -1
  197. package/lib/es/form/field.d.ts +4 -2
  198. package/lib/es/form/label.d.ts +1 -1
  199. package/lib/es/grid/col.d.ts +6 -6
  200. package/lib/es/grid/row.d.ts +1 -1
  201. package/lib/es/iconButton/index.d.ts +2 -2
  202. package/lib/es/image/image.d.ts +4 -4
  203. package/lib/es/image/preview.d.ts +1 -1
  204. package/lib/es/image/previewInner.d.ts +1 -1
  205. package/lib/es/index.d.ts +1 -0
  206. package/lib/es/index.js +1 -0
  207. package/lib/es/inputNumber/index.d.ts +2 -2
  208. package/lib/es/locale/source/ro.d.ts +3 -3
  209. package/lib/es/modal/Modal.d.ts +6 -6
  210. package/lib/es/modal/Modal.js +79 -56
  211. package/lib/es/modal/ModalContent.js +6 -5
  212. package/lib/es/modal/confirm.d.ts +10 -10
  213. package/lib/es/modal/confirm.js +1 -14
  214. package/lib/es/modal/useModal/HookModal.d.ts +0 -2
  215. package/lib/es/modal/useModal/HookModal.js +7 -19
  216. package/lib/es/navigation/Footer.d.ts +1 -1
  217. package/lib/es/navigation/Header.d.ts +3 -3
  218. package/lib/es/navigation/Item.d.ts +4 -4
  219. package/lib/es/navigation/Item.js +11 -5
  220. package/lib/es/navigation/OpenIconTransition.d.ts +1 -15
  221. package/lib/es/navigation/OpenIconTransition.js +1 -66
  222. package/lib/es/navigation/SubNav.d.ts +4 -4
  223. package/lib/es/navigation/SubNav.js +43 -28
  224. package/lib/es/navigation/index.d.ts +8 -11
  225. package/lib/es/notification/index.d.ts +0 -1
  226. package/lib/es/notification/index.js +24 -14
  227. package/lib/es/notification/notice.d.ts +3 -1
  228. package/lib/es/notification/notice.js +3 -1
  229. package/lib/es/popconfirm/index.d.ts +4 -5
  230. package/lib/es/popover/index.d.ts +8 -8
  231. package/lib/es/popover/index.js +1 -1
  232. package/lib/es/progress/index.d.ts +4 -4
  233. package/lib/es/rating/index.d.ts +1 -1
  234. package/lib/es/rating/item.d.ts +1 -1
  235. package/lib/es/scrollList/index.d.ts +1 -1
  236. package/lib/es/scrollList/scrollItem.d.ts +3 -3
  237. package/lib/es/scrollList/scrollItem.js +3 -3
  238. package/lib/es/select/index.d.ts +11 -6
  239. package/lib/es/select/index.js +108 -60
  240. package/lib/es/select/option.d.ts +1 -1
  241. package/lib/es/select/optionGroup.d.ts +1 -1
  242. package/lib/es/sideSheet/SideSheetContent.d.ts +8 -0
  243. package/lib/es/sideSheet/SideSheetContent.js +10 -6
  244. package/lib/es/sideSheet/index.d.ts +4 -4
  245. package/lib/es/sideSheet/index.js +67 -37
  246. package/lib/es/space/index.d.ts +1 -1
  247. package/lib/es/spin/index.js +1 -4
  248. package/lib/es/table/Body/BaseRow.d.ts +5 -5
  249. package/lib/es/table/Body/ExpandedRow.d.ts +3 -3
  250. package/lib/es/table/Body/SectionRow.d.ts +3 -3
  251. package/lib/es/table/Column.d.ts +4 -4
  252. package/lib/es/table/ColumnShape.d.ts +4 -4
  253. package/lib/es/table/ColumnSorter.d.ts +1 -1
  254. package/lib/es/table/CustomExpandIcon.d.ts +1 -1
  255. package/lib/es/table/CustomExpandIcon.js +13 -5
  256. package/lib/es/table/Table.d.ts +16 -16
  257. package/lib/es/table/TableCell.d.ts +4 -4
  258. package/lib/es/table/TableHeaderRow.d.ts +2 -2
  259. package/lib/es/table/TablePagination.d.ts +1 -1
  260. package/lib/es/table/index.d.ts +15 -15
  261. package/lib/es/tabs/TabPane.d.ts +2 -8
  262. package/lib/es/tabs/TabPane.js +40 -38
  263. package/lib/es/tabs/index.d.ts +5 -3
  264. package/lib/es/tabs/index.js +26 -4
  265. package/lib/es/tabs/interface.d.ts +2 -0
  266. package/lib/es/tag/group.d.ts +1 -0
  267. package/lib/es/tag/group.js +6 -3
  268. package/lib/es/tag/index.d.ts +1 -1
  269. package/lib/es/tag/index.js +1 -0
  270. package/lib/es/tag/interface.d.ts +3 -1
  271. package/lib/es/tagInput/index.d.ts +3 -3
  272. package/lib/es/timePicker/Combobox.js +4 -8
  273. package/lib/es/timePicker/PanelShape.d.ts +2 -2
  274. package/lib/es/timePicker/TimePicker.d.ts +11 -11
  275. package/lib/es/timePicker/TimePicker.js +3 -1
  276. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  277. package/lib/es/timePicker/index.d.ts +10 -9
  278. package/lib/es/timeline/index.d.ts +1 -1
  279. package/lib/es/toast/index.d.ts +2 -4
  280. package/lib/es/toast/index.js +27 -13
  281. package/lib/es/toast/toast.d.ts +4 -2
  282. package/lib/es/toast/toast.js +3 -1
  283. package/lib/es/tooltip/index.d.ts +8 -9
  284. package/lib/es/tooltip/index.js +27 -36
  285. package/lib/es/transfer/index.d.ts +1 -1
  286. package/lib/es/tree/autoSizer.d.ts +2 -2
  287. package/lib/es/tree/index.d.ts +5 -5
  288. package/lib/es/tree/nodeCollapsible.d.ts +11 -0
  289. package/lib/es/tree/nodeCollapsible.js +35 -0
  290. package/lib/es/tree/nodeList.js +6 -5
  291. package/lib/es/tree/treeNode.d.ts +1 -1
  292. package/lib/es/treeSelect/index.d.ts +12 -9
  293. package/lib/es/treeSelect/index.js +22 -8
  294. package/lib/es/trigger/index.d.ts +1 -1
  295. package/lib/es/typography/base.d.ts +8 -8
  296. package/lib/es/typography/index.d.ts +2 -0
  297. package/lib/es/typography/index.js +2 -0
  298. package/lib/es/typography/interface.d.ts +2 -0
  299. package/lib/es/typography/numeral.d.ts +68 -0
  300. package/lib/es/typography/numeral.js +86 -0
  301. package/lib/es/typography/paragraph.d.ts +3 -3
  302. package/lib/es/typography/text.d.ts +4 -4
  303. package/lib/es/typography/title.d.ts +4 -4
  304. package/lib/es/upload/fileCard.d.ts +1 -1
  305. package/package.json +7 -7
  306. package/lib/cjs/motions/Rotate.d.ts +0 -23
  307. package/lib/cjs/motions/Rotate.js +0 -76
  308. package/lib/cjs/navigation/SubNavTransition.d.ts +0 -17
  309. package/lib/cjs/navigation/SubNavTransition.js +0 -83
  310. package/lib/cjs/notification/NoticeTransition.d.ts +0 -10
  311. package/lib/cjs/notification/NoticeTransition.js +0 -85
  312. package/lib/cjs/sideSheet/SideSheetTransition.d.ts +0 -12
  313. package/lib/cjs/sideSheet/SideSheetTransition.js +0 -115
  314. package/lib/cjs/tabs/TabPaneTransition.d.ts +0 -4
  315. package/lib/cjs/tabs/TabPaneTransition.js +0 -114
  316. package/lib/cjs/toast/ToastTransition.d.ts +0 -7
  317. package/lib/cjs/toast/ToastTransition.js +0 -66
  318. package/lib/cjs/tooltip/TooltipStyledTransition.d.ts +0 -9
  319. package/lib/cjs/tooltip/TooltipStyledTransition.js +0 -52
  320. package/lib/cjs/tree/collapse.d.ts +0 -29
  321. package/lib/cjs/tree/collapse.js +0 -155
  322. package/lib/es/motions/Rotate.d.ts +0 -23
  323. package/lib/es/motions/Rotate.js +0 -60
  324. package/lib/es/navigation/SubNavTransition.d.ts +0 -17
  325. package/lib/es/navigation/SubNavTransition.js +0 -66
  326. package/lib/es/notification/NoticeTransition.d.ts +0 -10
  327. package/lib/es/notification/NoticeTransition.js +0 -74
  328. package/lib/es/sideSheet/SideSheetTransition.d.ts +0 -12
  329. package/lib/es/sideSheet/SideSheetTransition.js +0 -102
  330. package/lib/es/tabs/TabPaneTransition.d.ts +0 -4
  331. package/lib/es/tabs/TabPaneTransition.js +0 -103
  332. package/lib/es/toast/ToastTransition.d.ts +0 -7
  333. package/lib/es/toast/ToastTransition.js +0 -55
  334. package/lib/es/tooltip/TooltipStyledTransition.d.ts +0 -9
  335. package/lib/es/tooltip/TooltipStyledTransition.js +0 -38
  336. package/lib/es/tree/collapse.d.ts +0 -29
  337. package/lib/es/tree/collapse.js +0 -136
@@ -1,155 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _noop2 = _interopRequireDefault(require("lodash/noop"));
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _semiAnimationReact = require("@douyinfe/semi-animation-react");
13
-
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
- var _constants = require("@douyinfe/semi-foundation/lib/cjs/collapsible/constants");
17
-
18
- var _getMotionObjFromProps = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/getMotionObjFromProps"));
19
-
20
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
-
22
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- /* eslint-disable arrow-body-style */
27
- const ease = 'cubicBezier(.25,.1,.25,1)';
28
-
29
- const Collapse = props => {
30
- const {
31
- motion,
32
- children,
33
- duration,
34
- onMotionEnd,
35
- motionType
36
- } = props;
37
- const ref = (0, _react.useRef)(null);
38
- const [maxHeight, setMaxHeight] = (0, _react.useState)(0); // cache last state
39
-
40
- const [open, setOpen] = (0, _react.useState)(true);
41
- const [left, setLeft] = (0, _react.useState)(false);
42
- const [immediateAttr, setImmediateAttr] = (0, _react.useState)(false);
43
- (0, _react.useEffect)(() => {
44
- if (motionType === 'enter') {
45
- !open && setOpen(true);
46
- left && setLeft(false);
47
- } else if (motionType === 'leave') {
48
- !open && setOpen(true);
49
- !immediateAttr && setImmediateAttr(true);
50
- left && setLeft(false);
51
- }
52
- }, [motionType]);
53
- const setHeight = (0, _react.useCallback)(node => {
54
- const currHeight = node && node.scrollHeight;
55
-
56
- if (currHeight && maxHeight !== currHeight) {
57
- setMaxHeight(currHeight);
58
- }
59
- }, [left]);
60
-
61
- const resetHeight = () => {
62
- ref.current.style.maxHeight = 'none';
63
- };
64
-
65
- const formatStyle = style => {
66
- // eslint-disable-next-line @typescript-eslint/no-shadow
67
- const {
68
- maxHeight
69
- } = style;
70
- return {
71
- maxHeight
72
- };
73
- };
74
-
75
- const renderChildren = transitionStyle => {
76
- const transition = transitionStyle && typeof transitionStyle === 'object' ? formatStyle(transitionStyle) : {};
77
- const style = Object.assign({
78
- overflow: 'hidden',
79
- maxHeight: open ? 'none' : 0
80
- }, transition);
81
- return /*#__PURE__*/_react.default.createElement("div", {
82
- style: style,
83
- className: "".concat(_constants.cssClasses.PREFIX, "-wrapper"),
84
- ref: ref
85
- }, /*#__PURE__*/_react.default.createElement("div", {
86
- ref: setHeight
87
- }, children));
88
- };
89
-
90
- const didLeave = () => {
91
- setLeft(true);
92
- setMaxHeight(0);
93
- motionType === 'leave' && onMotionEnd();
94
- };
95
-
96
- const onImmediateEnter = () => {
97
- open && setOpen(false);
98
- setImmediateAttr(false);
99
- };
100
-
101
- const didEnter = () => {
102
- resetHeight();
103
- immediateAttr && onImmediateEnter();
104
- motionType === 'enter' && onMotionEnd();
105
- };
106
-
107
- const renderContent = () => {
108
- if (left) {
109
- return null;
110
- }
111
-
112
- const mergeMotion = (0, _getMotionObjFromProps.default)({
113
- didEnter,
114
- didLeave,
115
- motion
116
- });
117
- return motion ? /*#__PURE__*/_react.default.createElement(_semiAnimationReact.Transition, Object.assign({
118
- state: open ? 'enter' : 'leave',
119
- immediate: immediateAttr,
120
- from: {
121
- maxHeight: 0
122
- },
123
- enter: {
124
- maxHeight: {
125
- val: maxHeight,
126
- easing: ease,
127
- duration
128
- }
129
- },
130
- leave: {
131
- maxHeight: {
132
- val: 0,
133
- easing: ease,
134
- duration
135
- }
136
- }
137
- }, mergeMotion), transitionStyle => renderChildren(transitionStyle)) : renderChildren(null);
138
- };
139
-
140
- return renderContent();
141
- };
142
-
143
- Collapse.propType = {
144
- motion: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func, _propTypes.default.object]),
145
- children: _propTypes.default.node,
146
- duration: _propTypes.default.number,
147
- onMotionEnd: _propTypes.default.func
148
- };
149
- Collapse.defaultProps = {
150
- duration: 250,
151
- motion: true,
152
- onMotionEnd: _noop2.default
153
- };
154
- var _default = Collapse;
155
- exports.default = _default;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- export interface TransitionStyle {
4
- rotate?: number;
5
- }
6
- export interface OpenIconTransitionProps {
7
- isOpen?: boolean;
8
- children?: React.ReactNode;
9
- enterDeg?: number;
10
- fromDeg?: number;
11
- duration?: number;
12
- }
13
- declare function OpenIconTransition(props?: OpenIconTransitionProps): React.ReactElement;
14
- declare namespace OpenIconTransition {
15
- var propTypes: {
16
- isOpen: PropTypes.Validator<boolean>;
17
- children: PropTypes.Validator<any>;
18
- enterDeg: PropTypes.Requireable<number>;
19
- fromDeg: PropTypes.Requireable<number>;
20
- duration: PropTypes.Requireable<number>;
21
- };
22
- }
23
- export default OpenIconTransition;
@@ -1,60 +0,0 @@
1
- import React, { useEffect, useState, Children, cloneElement, isValidElement } from 'react';
2
- import { Transition } from '@douyinfe/semi-animation-react';
3
- import PropTypes from 'prop-types';
4
-
5
- const formatStyle = function formatStyle(_ref) {
6
- let {
7
- rotate = 0
8
- } = _ref;
9
- return {
10
- transform: "rotate(".concat(rotate, "deg)")
11
- };
12
- };
13
-
14
- function OpenIconTransition() {
15
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
16
- const {
17
- children,
18
- isOpen,
19
- enterDeg = 180,
20
- fromDeg = 0,
21
- duration = 150
22
- } = props;
23
- const [immediate, setImmediate] = useState(true);
24
- useEffect(() => {
25
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
26
- setImmediate(false);
27
- }, [isOpen]);
28
- return /*#__PURE__*/React.createElement(Transition, {
29
- immediate: immediate,
30
- state: isOpen ? 'enter' : 'leave',
31
- from: {
32
- rotate: fromDeg
33
- },
34
- enter: {
35
- rotate: {
36
- val: enterDeg,
37
- duration,
38
- easing: 'cubic-bezier(.62, .05, .36, .95)'
39
- }
40
- },
41
- leave: {
42
- rotate: {
43
- val: fromDeg,
44
- duration,
45
- easing: 'cubic-bezier(.62, .05, .36, .95)'
46
- }
47
- }
48
- }, transitionStyle => Children.map(children, child => /*#__PURE__*/isValidElement(child) ? /*#__PURE__*/cloneElement(child, Object.assign(Object.assign({}, child.props), {
49
- style: Object.assign(Object.assign({}, child.props.style), formatStyle(transitionStyle))
50
- })) : child));
51
- }
52
-
53
- OpenIconTransition.propTypes = {
54
- isOpen: PropTypes.bool.isRequired,
55
- children: PropTypes.any.isRequired,
56
- enterDeg: PropTypes.number,
57
- fromDeg: PropTypes.number,
58
- duration: PropTypes.number
59
- };
60
- export default OpenIconTransition;
@@ -1,17 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { Motion } from '@douyinfe/semi-foundation/lib/es/utils/type';
4
- export interface SubNavTransitionProps {
5
- children?: React.ReactNode | ((transitionProps?: any) => React.ReactNode);
6
- isCollapsed?: boolean;
7
- maxHeight?: number;
8
- motion?: Motion;
9
- }
10
- declare function SubNavTransition(props?: SubNavTransitionProps): JSX.Element;
11
- declare namespace SubNavTransition {
12
- var propTypes: {
13
- children: PropTypes.Requireable<any>;
14
- isCollapsed: PropTypes.Requireable<boolean>;
15
- };
16
- }
17
- export default SubNavTransition;
@@ -1,66 +0,0 @@
1
- import { Transition } from '@douyinfe/semi-animation-react';
2
- import PropTypes from 'prop-types';
3
- import React, { useState } from 'react';
4
- const ease = 'cubicBezier(.25,.1,.25,1)';
5
-
6
- const formatStyle = function formatStyle(_ref) {
7
- let {
8
- maxHeight,
9
- opacity
10
- } = _ref;
11
- return {
12
- maxHeight,
13
- opacity
14
- };
15
- };
16
-
17
- function SubNavTransition() {
18
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
19
- const {
20
- children,
21
- isCollapsed,
22
- maxHeight = 999
23
- } = props; // eslint-disable-next-line no-unused-vars
24
-
25
- const [immediate, setImmediate] = useState(false); // useEffect(() => {
26
- // setImmediate(isCollapsed);
27
- // }, [isCollapsed]);
28
-
29
- return /*#__PURE__*/React.createElement(Transition, {
30
- from: {
31
- maxHeight: 0,
32
- opacity: 0
33
- },
34
- enter: {
35
- maxHeight: {
36
- val: maxHeight,
37
- easing: 'easeInQuad',
38
- duration: 250
39
- },
40
- opacity: {
41
- val: 1,
42
- duration: 200,
43
- easing: 'cubic-bezier(0.5, -0.1, 1, 0.4)'
44
- }
45
- },
46
- leave: {
47
- maxHeight: {
48
- val: 0,
49
- easing: ease,
50
- duration: 250
51
- },
52
- opacity: {
53
- val: 0,
54
- duration: isCollapsed ? 1 : 200,
55
- easing: 'cubic-bezier(0.5, -0.1, 1, 0.4)'
56
- }
57
- },
58
- immediate: immediate
59
- }, typeof children === 'function' ? transitionStyle => children(formatStyle(transitionStyle)) : children);
60
- }
61
-
62
- SubNavTransition.propTypes = {
63
- children: PropTypes.any,
64
- isCollapsed: PropTypes.bool
65
- };
66
- export default SubNavTransition;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { NoticePosition } from '@douyinfe/semi-foundation/lib/es/notification/notificationFoundation';
3
- import { Motion } from '../_base/base';
4
- export declare type ArgsType<T> = T extends (...args: infer A) => any ? A : never;
5
- export interface NoticeTransitionProps {
6
- position?: NoticePosition;
7
- motion?: Motion<NoticeTransitionProps>;
8
- children?: React.ReactNode | ((TransitionProps?: any) => React.ReactNode);
9
- }
10
- export default function NoticeTransition(props?: NoticeTransitionProps): JSX.Element;
@@ -1,74 +0,0 @@
1
- // @ts-ignore Currently there is no types for semi-animation-react
2
- import { Transition } from '@douyinfe/semi-animation-react';
3
- import React from 'react';
4
- export default function NoticeTransition() {
5
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6
- let {
7
- motion = {}
8
- } = props;
9
- const {
10
- position = 'topRight'
11
- } = props;
12
-
13
- const formatStyle = function formatStyle(_ref) {
14
- let {
15
- translate,
16
- opacity
17
- } = _ref;
18
- let transform = "translateX(".concat(translate, "%)");
19
-
20
- if (position && typeof position === 'string') {
21
- if (/left/i.test(position)) {
22
- transform = "translateX(".concat(-translate, "%)");
23
- } else if (/right/i.test(position)) {
24
- transform = "translateX(".concat(translate, "%)");
25
- } else if (/top/i.test(position)) {
26
- transform = "translateY(".concat(-translate, "%)");
27
- } else {
28
- transform = "translateY(".concat(translate, "%)");
29
- }
30
- }
31
-
32
- return {
33
- transform,
34
- opacity
35
- };
36
- };
37
-
38
- if (typeof motion === 'function') {
39
- motion = motion(props);
40
- } else if (!motion || typeof motion !== 'object') {
41
- motion = {};
42
- }
43
-
44
- return /*#__PURE__*/React.createElement(Transition // onFrame={style => console.log(formatStyle(style))}
45
- , Object.assign({
46
- // onFrame={style => console.log(formatStyle(style))}
47
- from: {
48
- translate: 100,
49
- opacity: 0
50
- },
51
- enter: {
52
- translate: {
53
- val: 0,
54
- tension: 560,
55
- friction: 32
56
- },
57
- opacity: {
58
- val: 1,
59
- duration: 200
60
- }
61
- },
62
- leave: {
63
- translate: {
64
- val: 100,
65
- easing: 'easeOutCubic',
66
- duration: 300
67
- },
68
- opacity: {
69
- val: 0,
70
- duration: 200
71
- }
72
- }
73
- }, motion), typeof props.children === 'function' ? transitionStyle => props.children(formatStyle(transitionStyle)) : props.children);
74
- }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { Motion } from '../_base/base';
3
- export interface SideSheetTransitionProps {
4
- children?: React.ReactNode | ((TransitionProps: any) => React.ReactNode);
5
- motion?: Motion<SideSheetTransitionProps>;
6
- controlled?: boolean;
7
- visible?: boolean;
8
- placement?: 'left' | 'top' | 'right' | 'bottom';
9
- }
10
- export default class SideSheetTransition extends React.PureComponent<SideSheetTransitionProps> {
11
- render(): JSX.Element;
12
- }
@@ -1,102 +0,0 @@
1
- // @ts-ignore Currently there is no types definition for semi-animation-react;
2
- import { Transition } from '@douyinfe/semi-animation-react';
3
- import React from 'react'; // eslint-disable-next-line max-len
4
-
5
- const formatStyles = function formatStyles() {
6
- let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
- let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8
- const {
9
- placement
10
- } = props;
11
- const {
12
- translate
13
- } = styles;
14
- const {
15
- opacity
16
- } = styles;
17
- let transform = '';
18
-
19
- switch (placement) {
20
- case 'left':
21
- transform = "translateX(-".concat(translate, "%)");
22
- break;
23
-
24
- case 'top':
25
- transform = "translateY(-".concat(translate, "%)");
26
- break;
27
-
28
- case 'right':
29
- transform = "translateX(".concat(translate, "%)");
30
- break;
31
-
32
- case 'bottom':
33
- transform = "translateY(".concat(translate, "%)");
34
- break;
35
-
36
- default:
37
- break;
38
- }
39
-
40
- return {
41
- transform,
42
- opacity
43
- };
44
- };
45
-
46
- export default class SideSheetTransition extends React.PureComponent {
47
- render() {
48
- let {
49
- motion = {}
50
- } = this.props;
51
- const {
52
- children,
53
- controlled = false,
54
- visible
55
- } = this.props;
56
-
57
- if (typeof motion === 'function') {
58
- motion = motion(this.props);
59
- } else if (!motion || typeof motion !== 'object') {
60
- motion = {};
61
- }
62
-
63
- let extra = {};
64
-
65
- if (controlled) {
66
- extra = {
67
- state: visible ? 'enter' : 'leave'
68
- };
69
- }
70
-
71
- return /*#__PURE__*/React.createElement(Transition, Object.assign({
72
- config: {
73
- tension: 170,
74
- friction: 14,
75
- easing: 'linear',
76
- duration: 200
77
- },
78
- from: {
79
- translate: 100,
80
- opacity: {
81
- val: 0,
82
- duration: 180
83
- }
84
- },
85
- enter: {
86
- translate: 0,
87
- opacity: {
88
- val: 1,
89
- duration: 180
90
- }
91
- },
92
- leave: {
93
- translate: 100,
94
- opacity: {
95
- val: 0,
96
- duration: 180
97
- }
98
- }
99
- }, extra, motion), typeof children === 'function' ? styles => children(formatStyles(styles, this.props)) : children);
100
- }
101
-
102
- }
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { TabPaneTransitionProps } from './interface';
3
- declare const TabPaneTransition: FC<TabPaneTransitionProps>;
4
- export default TabPaneTransition;
@@ -1,103 +0,0 @@
1
- import _toInteger from "lodash/toInteger";
2
-
3
- /* eslint-disable react/destructuring-assignment */
4
- import React from 'react';
5
- import { Transition } from '@douyinfe/semi-animation-react';
6
-
7
- const TabPaneTransition = function () {
8
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9
- const direction = props.direction ? 1 : -1;
10
- const {
11
- mode
12
- } = props;
13
- let {
14
- motion
15
- } = props;
16
- const ratio = 60;
17
-
18
- if (typeof motion === 'function') {
19
- motion = motion(props);
20
- } else if (!motion || typeof motion !== 'object') {
21
- motion = {};
22
- }
23
-
24
- if (mode === 'vertical') {
25
- return /*#__PURE__*/React.createElement(Transition, Object.assign({}, props, {
26
- config: {
27
- tension: 612,
28
- friction: 32
29
- },
30
- from: {
31
- translateY: direction * ratio,
32
- opacity: 0
33
- },
34
- enter: {
35
- translateY: 0,
36
- opacity: {
37
- val: 1,
38
- duration: 200
39
- }
40
- },
41
- leave: {
42
- translateY: -1 * direction * ratio,
43
- opacity: {
44
- val: 0,
45
- duration: 200
46
- }
47
- }
48
- }, motion), typeof props.children === 'function' ? _ref => {
49
- let {
50
- translateY,
51
- opacity
52
- } = _ref;
53
- // delete translateX in 0 in case of zIndex problems.
54
- const finalState = _toInteger(translateY) === 0 ? {
55
- opacity
56
- } : {
57
- transform: "translateY(".concat(_toInteger(translateY), "px)"),
58
- opacity
59
- };
60
- return props.children(finalState);
61
- } : props.children);
62
- }
63
-
64
- return /*#__PURE__*/React.createElement(Transition, Object.assign({}, props, {
65
- config: {
66
- tension: 612,
67
- friction: 32
68
- },
69
- from: {
70
- translateX: direction * ratio,
71
- opacity: 0
72
- },
73
- enter: {
74
- translateX: 0,
75
- opacity: {
76
- val: 1,
77
- duration: 200
78
- }
79
- },
80
- leave: {
81
- translateX: -1 * direction * ratio,
82
- opacity: {
83
- val: 0,
84
- duration: 200
85
- }
86
- }
87
- }, motion), typeof props.children === 'function' ? _ref2 => {
88
- let {
89
- translateX,
90
- opacity
91
- } = _ref2;
92
- // delete translateX in 0 in case of zIndex problems.
93
- const finalState = _toInteger(translateX) === 0 ? {
94
- opacity
95
- } : {
96
- transform: "translateX(".concat(_toInteger(translateX), "px)"),
97
- opacity
98
- };
99
- return props.children(finalState);
100
- } : props.children);
101
- };
102
-
103
- export default TabPaneTransition;
@@ -1,7 +0,0 @@
1
- import { Motion } from '../_base/base';
2
- import React from 'react';
3
- export interface ToastTransitionProps {
4
- motion?: Motion<ToastTransitionProps>;
5
- children?: React.ReactNode | ((TransitionProps: any) => any);
6
- }
7
- export default function ToastTransition(props?: ToastTransitionProps): JSX.Element;
@@ -1,55 +0,0 @@
1
- // @ts-ignore Currently there is no types for semi-animation-react
2
- import { Transition } from '@douyinfe/semi-animation-react';
3
- import React from 'react';
4
- export default function ToastTransition() {
5
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6
- let {
7
- motion = {}
8
- } = props;
9
-
10
- if (typeof motion === 'function') {
11
- motion = motion(props);
12
- } else if (!motion || typeof motion !== 'object') {
13
- motion = {};
14
- }
15
-
16
- return /*#__PURE__*/React.createElement(Transition // onFrame={style => console.log(style)}
17
- , Object.assign({
18
- // onFrame={style => console.log(style)}
19
- from: {
20
- translateY: -100,
21
- opacity: 0
22
- },
23
- enter: {
24
- translateY: {
25
- val: 0,
26
- tension: 560,
27
- friction: 32
28
- },
29
- opacity: {
30
- val: 1,
31
- duration: 300
32
- }
33
- },
34
- leave: {
35
- translateY: {
36
- val: -100,
37
- easing: 'easeOutCubic',
38
- duration: 300
39
- },
40
- opacity: {
41
- val: 0,
42
- duration: 200
43
- }
44
- }
45
- }, motion), typeof props.children === 'function' ? _ref => {
46
- let {
47
- translateY,
48
- opacity
49
- } = _ref;
50
- return props.children({
51
- transform: "translateY(".concat(translateY, "%)"),
52
- opacity
53
- });
54
- } : props.children);
55
- }