@douyinfe/semi-ui 2.28.0-alpha.0 → 2.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/dist/css/semi.css +227 -0
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +2393 -2068
  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/_portal/index.js +2 -2
  8. package/lib/cjs/_utils/index.js +3 -1
  9. package/lib/cjs/anchor/index.js +9 -9
  10. package/lib/cjs/anchor/link.js +8 -8
  11. package/lib/cjs/autoComplete/index.js +8 -4
  12. package/lib/cjs/autoComplete/option.js +7 -7
  13. package/lib/cjs/avatar/avatarGroup.js +7 -7
  14. package/lib/cjs/avatar/index.js +12 -12
  15. package/lib/cjs/badge/index.js +8 -8
  16. package/lib/cjs/banner/index.js +12 -12
  17. package/lib/cjs/breadcrumb/index.js +12 -12
  18. package/lib/cjs/breadcrumb/item.js +8 -8
  19. package/lib/cjs/button/Button.js +9 -9
  20. package/lib/cjs/button/buttonGroup.js +5 -5
  21. package/lib/cjs/button/splitButtonGroup.js +1 -1
  22. package/lib/cjs/calendar/dayCalendar.js +13 -13
  23. package/lib/cjs/calendar/dayCol.js +17 -17
  24. package/lib/cjs/calendar/monthCalendar.js +38 -38
  25. package/lib/cjs/calendar/rangeCalendar.js +27 -27
  26. package/lib/cjs/calendar/timeCol.js +6 -6
  27. package/lib/cjs/calendar/weekCalendar.js +27 -27
  28. package/lib/cjs/card/cardGroup.js +2 -2
  29. package/lib/cjs/card/index.js +16 -16
  30. package/lib/cjs/card/meta.js +5 -5
  31. package/lib/cjs/carousel/CarouselArrow.js +6 -6
  32. package/lib/cjs/carousel/CarouselIndicator.js +6 -6
  33. package/lib/cjs/carousel/index.js +12 -12
  34. package/lib/cjs/cascader/index.d.ts +5 -2
  35. package/lib/cjs/cascader/index.js +40 -38
  36. package/lib/cjs/cascader/item.d.ts +15 -1
  37. package/lib/cjs/cascader/item.js +64 -32
  38. package/lib/cjs/checkbox/checkbox.js +14 -14
  39. package/lib/cjs/checkbox/checkboxGroup.js +4 -4
  40. package/lib/cjs/checkbox/checkboxInner.js +6 -6
  41. package/lib/cjs/collapse/item.js +9 -9
  42. package/lib/cjs/collapsible/index.js +3 -3
  43. package/lib/cjs/configProvider/index.js +1 -1
  44. package/lib/cjs/datePicker/dateInput.js +16 -16
  45. package/lib/cjs/datePicker/datePicker.js +9 -9
  46. package/lib/cjs/datePicker/footer.js +1 -1
  47. package/lib/cjs/datePicker/index.js +1 -1
  48. package/lib/cjs/datePicker/month.js +2 -2
  49. package/lib/cjs/datePicker/monthsGrid.js +27 -27
  50. package/lib/cjs/datePicker/navigation.js +1 -1
  51. package/lib/cjs/datePicker/quickControl.js +14 -14
  52. package/lib/cjs/datePicker/yearAndMonth.js +4 -4
  53. package/lib/cjs/descriptions/index.js +3 -3
  54. package/lib/cjs/descriptions/item.js +5 -5
  55. package/lib/cjs/divider/index.js +7 -7
  56. package/lib/cjs/dropdown/dropdownDivider.js +1 -1
  57. package/lib/cjs/dropdown/dropdownItem.js +7 -7
  58. package/lib/cjs/dropdown/dropdownMenu.js +1 -1
  59. package/lib/cjs/dropdown/dropdownTitle.js +2 -2
  60. package/lib/cjs/dropdown/index.js +3 -3
  61. package/lib/cjs/empty/index.js +7 -7
  62. package/lib/cjs/form/arrayField.js +1 -1
  63. package/lib/cjs/form/baseForm.d.ts +2 -0
  64. package/lib/cjs/form/baseForm.js +2 -2
  65. package/lib/cjs/form/errorMessage.js +1 -1
  66. package/lib/cjs/form/field.d.ts +2 -0
  67. package/lib/cjs/form/group.js +2 -2
  68. package/lib/cjs/form/hoc/withField.js +16 -16
  69. package/lib/cjs/form/label.js +9 -9
  70. package/lib/cjs/form/slot.js +5 -5
  71. package/lib/cjs/grid/col.js +11 -11
  72. package/lib/cjs/grid/row.js +4 -4
  73. package/lib/cjs/highlight/index.js +1 -1
  74. package/lib/cjs/iconButton/index.js +5 -5
  75. package/lib/cjs/image/image.js +10 -10
  76. package/lib/cjs/image/preview.js +3 -3
  77. package/lib/cjs/image/previewFooter.js +12 -12
  78. package/lib/cjs/image/previewHeader.js +3 -3
  79. package/lib/cjs/image/previewImage.js +7 -7
  80. package/lib/cjs/image/previewInner.js +7 -7
  81. package/lib/cjs/input/index.js +38 -38
  82. package/lib/cjs/input/inputGroup.js +7 -7
  83. package/lib/cjs/input/textarea.js +14 -14
  84. package/lib/cjs/inputNumber/index.js +11 -11
  85. package/lib/cjs/layout/Sider.d.ts +1 -1
  86. package/lib/cjs/layout/Sider.js +4 -4
  87. package/lib/cjs/layout/index.js +3 -3
  88. package/lib/cjs/list/index.js +11 -11
  89. package/lib/cjs/list/item.js +6 -6
  90. package/lib/cjs/modal/ConfirmModal.js +7 -7
  91. package/lib/cjs/modal/Modal.js +4 -4
  92. package/lib/cjs/modal/ModalContent.js +24 -24
  93. package/lib/cjs/modal/useModal/index.js +1 -1
  94. package/lib/cjs/navigation/CollapseButton.js +1 -1
  95. package/lib/cjs/navigation/Footer.js +2 -2
  96. package/lib/cjs/navigation/Header.js +5 -5
  97. package/lib/cjs/navigation/Item.js +16 -16
  98. package/lib/cjs/navigation/SubNav.js +14 -14
  99. package/lib/cjs/navigation/index.js +8 -8
  100. package/lib/cjs/notification/index.js +3 -3
  101. package/lib/cjs/notification/notice.js +12 -12
  102. package/lib/cjs/overflowList/index.d.ts +1 -1
  103. package/lib/cjs/overflowList/index.js +32 -35
  104. package/lib/cjs/overflowList/intersectionObserver.js +3 -1
  105. package/lib/cjs/pagination/index.js +26 -26
  106. package/lib/cjs/popconfirm/index.js +9 -9
  107. package/lib/cjs/popover/index.js +2 -2
  108. package/lib/cjs/progress/index.js +14 -14
  109. package/lib/cjs/radio/radio.js +22 -22
  110. package/lib/cjs/radio/radioGroup.js +5 -5
  111. package/lib/cjs/radio/radioInner.js +7 -7
  112. package/lib/cjs/rating/index.js +5 -5
  113. package/lib/cjs/rating/item.js +11 -11
  114. package/lib/cjs/scrollList/index.js +5 -5
  115. package/lib/cjs/scrollList/scrollItem.js +13 -13
  116. package/lib/cjs/select/index.d.ts +11 -0
  117. package/lib/cjs/select/index.js +297 -116
  118. package/lib/cjs/select/option.js +7 -7
  119. package/lib/cjs/sideSheet/SideSheetContent.js +10 -10
  120. package/lib/cjs/sideSheet/index.js +7 -7
  121. package/lib/cjs/skeleton/index.js +1 -1
  122. package/lib/cjs/skeleton/item.js +4 -4
  123. package/lib/cjs/slider/index.js +28 -28
  124. package/lib/cjs/space/index.js +12 -12
  125. package/lib/cjs/spin/icon.js +2 -2
  126. package/lib/cjs/spin/index.js +6 -6
  127. package/lib/cjs/steps/basicStep.js +14 -14
  128. package/lib/cjs/steps/basicSteps.js +6 -6
  129. package/lib/cjs/steps/fillStep.js +10 -10
  130. package/lib/cjs/steps/fillSteps.js +4 -4
  131. package/lib/cjs/steps/navStep.js +5 -5
  132. package/lib/cjs/steps/navSteps.js +2 -2
  133. package/lib/cjs/table/Body/BaseRow.js +5 -5
  134. package/lib/cjs/table/Body/ExpandedRow.js +3 -3
  135. package/lib/cjs/table/Body/SectionRow.js +1 -1
  136. package/lib/cjs/table/Body/index.js +8 -8
  137. package/lib/cjs/table/ColGroup.js +2 -2
  138. package/lib/cjs/table/ColumnFilter.js +3 -3
  139. package/lib/cjs/table/ColumnSelection.js +2 -2
  140. package/lib/cjs/table/ColumnSorter.js +7 -7
  141. package/lib/cjs/table/CustomExpandIcon.js +2 -2
  142. package/lib/cjs/table/HeadTable.js +3 -3
  143. package/lib/cjs/table/Table.js +20 -20
  144. package/lib/cjs/table/TableCell.js +8 -8
  145. package/lib/cjs/table/TableHeader.js +1 -1
  146. package/lib/cjs/table/TableHeaderRow.js +8 -8
  147. package/lib/cjs/table/TablePagination.js +3 -3
  148. package/lib/cjs/tabs/TabBar.js +31 -49
  149. package/lib/cjs/tabs/TabItem.d.ts +18 -0
  150. package/lib/cjs/tabs/TabItem.js +95 -0
  151. package/lib/cjs/tabs/TabPane.js +3 -3
  152. package/lib/cjs/tabs/index.d.ts +2 -1
  153. package/lib/cjs/tabs/index.js +5 -2
  154. package/lib/cjs/tag/group.js +5 -5
  155. package/lib/cjs/tag/index.js +13 -13
  156. package/lib/cjs/tagInput/index.d.ts +6 -2
  157. package/lib/cjs/tagInput/index.js +37 -34
  158. package/lib/cjs/timePicker/Combobox.js +4 -4
  159. package/lib/cjs/timePicker/TimeInput.js +4 -4
  160. package/lib/cjs/timePicker/TimePicker.js +8 -8
  161. package/lib/cjs/timeline/index.js +8 -8
  162. package/lib/cjs/timeline/item.js +7 -7
  163. package/lib/cjs/toast/index.js +5 -5
  164. package/lib/cjs/toast/toast.js +9 -9
  165. package/lib/cjs/tooltip/index.js +7 -7
  166. package/lib/cjs/transfer/index.js +31 -31
  167. package/lib/cjs/tree/autoSizer.js +1 -1
  168. package/lib/cjs/tree/index.js +6 -6
  169. package/lib/cjs/tree/interface.d.ts +1 -0
  170. package/lib/cjs/tree/nodeList.js +1 -1
  171. package/lib/cjs/tree/treeNode.js +26 -26
  172. package/lib/cjs/treeSelect/index.js +41 -41
  173. package/lib/cjs/typography/base.js +14 -14
  174. package/lib/cjs/typography/copyable.js +3 -3
  175. package/lib/cjs/typography/paragraph.js +1 -1
  176. package/lib/cjs/typography/title.js +1 -1
  177. package/lib/cjs/typography/util.js +1 -1
  178. package/lib/cjs/upload/fileCard.js +32 -32
  179. package/lib/cjs/upload/index.js +37 -37
  180. package/lib/es/_portal/index.js +2 -2
  181. package/lib/es/_utils/index.js +3 -1
  182. package/lib/es/anchor/index.js +9 -9
  183. package/lib/es/anchor/link.js +8 -8
  184. package/lib/es/autoComplete/index.js +8 -4
  185. package/lib/es/autoComplete/option.js +7 -7
  186. package/lib/es/avatar/avatarGroup.js +7 -7
  187. package/lib/es/avatar/index.js +12 -12
  188. package/lib/es/badge/index.js +8 -8
  189. package/lib/es/banner/index.js +12 -12
  190. package/lib/es/breadcrumb/index.js +12 -12
  191. package/lib/es/breadcrumb/item.js +8 -8
  192. package/lib/es/button/Button.js +9 -9
  193. package/lib/es/button/buttonGroup.js +5 -5
  194. package/lib/es/button/splitButtonGroup.js +1 -1
  195. package/lib/es/calendar/dayCalendar.js +13 -13
  196. package/lib/es/calendar/dayCol.js +17 -17
  197. package/lib/es/calendar/monthCalendar.js +38 -38
  198. package/lib/es/calendar/rangeCalendar.js +27 -27
  199. package/lib/es/calendar/timeCol.js +6 -6
  200. package/lib/es/calendar/weekCalendar.js +27 -27
  201. package/lib/es/card/cardGroup.js +2 -2
  202. package/lib/es/card/index.js +16 -16
  203. package/lib/es/card/meta.js +5 -5
  204. package/lib/es/carousel/CarouselArrow.js +6 -6
  205. package/lib/es/carousel/CarouselIndicator.js +6 -6
  206. package/lib/es/carousel/index.js +12 -12
  207. package/lib/es/cascader/index.d.ts +5 -2
  208. package/lib/es/cascader/index.js +40 -38
  209. package/lib/es/cascader/item.d.ts +15 -1
  210. package/lib/es/cascader/item.js +64 -32
  211. package/lib/es/checkbox/checkbox.js +14 -14
  212. package/lib/es/checkbox/checkboxGroup.js +4 -4
  213. package/lib/es/checkbox/checkboxInner.js +6 -6
  214. package/lib/es/collapse/item.js +9 -9
  215. package/lib/es/collapsible/index.js +3 -3
  216. package/lib/es/configProvider/index.js +1 -1
  217. package/lib/es/datePicker/dateInput.js +16 -16
  218. package/lib/es/datePicker/datePicker.js +9 -9
  219. package/lib/es/datePicker/footer.js +1 -1
  220. package/lib/es/datePicker/index.js +1 -1
  221. package/lib/es/datePicker/month.js +2 -2
  222. package/lib/es/datePicker/monthsGrid.js +27 -27
  223. package/lib/es/datePicker/navigation.js +1 -1
  224. package/lib/es/datePicker/quickControl.js +14 -14
  225. package/lib/es/datePicker/yearAndMonth.js +4 -4
  226. package/lib/es/descriptions/index.js +3 -3
  227. package/lib/es/descriptions/item.js +5 -5
  228. package/lib/es/divider/index.js +7 -7
  229. package/lib/es/dropdown/dropdownDivider.js +1 -1
  230. package/lib/es/dropdown/dropdownItem.js +7 -7
  231. package/lib/es/dropdown/dropdownMenu.js +1 -1
  232. package/lib/es/dropdown/dropdownTitle.js +2 -2
  233. package/lib/es/dropdown/index.js +3 -3
  234. package/lib/es/empty/index.js +7 -7
  235. package/lib/es/form/arrayField.js +1 -1
  236. package/lib/es/form/baseForm.d.ts +2 -0
  237. package/lib/es/form/baseForm.js +2 -2
  238. package/lib/es/form/errorMessage.js +1 -1
  239. package/lib/es/form/field.d.ts +2 -0
  240. package/lib/es/form/group.js +2 -2
  241. package/lib/es/form/hoc/withField.js +16 -16
  242. package/lib/es/form/label.js +9 -9
  243. package/lib/es/form/slot.js +5 -5
  244. package/lib/es/grid/col.js +11 -11
  245. package/lib/es/grid/row.js +4 -4
  246. package/lib/es/highlight/index.js +1 -1
  247. package/lib/es/iconButton/index.js +5 -5
  248. package/lib/es/image/image.js +10 -10
  249. package/lib/es/image/preview.js +3 -3
  250. package/lib/es/image/previewFooter.js +12 -12
  251. package/lib/es/image/previewHeader.js +3 -3
  252. package/lib/es/image/previewImage.js +7 -7
  253. package/lib/es/image/previewInner.js +7 -7
  254. package/lib/es/input/index.js +38 -38
  255. package/lib/es/input/inputGroup.js +7 -7
  256. package/lib/es/input/textarea.js +14 -14
  257. package/lib/es/inputNumber/index.js +11 -11
  258. package/lib/es/layout/Sider.d.ts +1 -1
  259. package/lib/es/layout/Sider.js +4 -4
  260. package/lib/es/layout/index.js +3 -3
  261. package/lib/es/list/index.js +11 -11
  262. package/lib/es/list/item.js +6 -6
  263. package/lib/es/modal/ConfirmModal.js +7 -7
  264. package/lib/es/modal/Modal.js +4 -4
  265. package/lib/es/modal/ModalContent.js +24 -24
  266. package/lib/es/modal/useModal/index.js +1 -1
  267. package/lib/es/navigation/CollapseButton.js +1 -1
  268. package/lib/es/navigation/Footer.js +2 -2
  269. package/lib/es/navigation/Header.js +5 -5
  270. package/lib/es/navigation/Item.js +16 -16
  271. package/lib/es/navigation/SubNav.js +14 -14
  272. package/lib/es/navigation/index.js +8 -8
  273. package/lib/es/notification/index.js +3 -3
  274. package/lib/es/notification/notice.js +12 -12
  275. package/lib/es/overflowList/index.d.ts +1 -1
  276. package/lib/es/overflowList/index.js +31 -35
  277. package/lib/es/overflowList/intersectionObserver.js +2 -1
  278. package/lib/es/pagination/index.js +26 -26
  279. package/lib/es/popconfirm/index.js +9 -9
  280. package/lib/es/popover/index.js +2 -2
  281. package/lib/es/progress/index.js +14 -14
  282. package/lib/es/radio/radio.js +22 -22
  283. package/lib/es/radio/radioGroup.js +5 -5
  284. package/lib/es/radio/radioInner.js +7 -7
  285. package/lib/es/rating/index.js +5 -5
  286. package/lib/es/rating/item.js +11 -11
  287. package/lib/es/scrollList/index.js +5 -5
  288. package/lib/es/scrollList/scrollItem.js +13 -13
  289. package/lib/es/select/index.d.ts +11 -0
  290. package/lib/es/select/index.js +288 -112
  291. package/lib/es/select/option.js +7 -7
  292. package/lib/es/sideSheet/SideSheetContent.js +10 -10
  293. package/lib/es/sideSheet/index.js +7 -7
  294. package/lib/es/skeleton/index.js +1 -1
  295. package/lib/es/skeleton/item.js +4 -4
  296. package/lib/es/slider/index.js +28 -28
  297. package/lib/es/space/index.js +12 -12
  298. package/lib/es/spin/icon.js +2 -2
  299. package/lib/es/spin/index.js +6 -6
  300. package/lib/es/steps/basicStep.js +14 -14
  301. package/lib/es/steps/basicSteps.js +6 -6
  302. package/lib/es/steps/fillStep.js +10 -10
  303. package/lib/es/steps/fillSteps.js +4 -4
  304. package/lib/es/steps/navStep.js +5 -5
  305. package/lib/es/steps/navSteps.js +2 -2
  306. package/lib/es/table/Body/BaseRow.js +5 -5
  307. package/lib/es/table/Body/ExpandedRow.js +3 -3
  308. package/lib/es/table/Body/SectionRow.js +1 -1
  309. package/lib/es/table/Body/index.js +8 -8
  310. package/lib/es/table/ColGroup.js +2 -2
  311. package/lib/es/table/ColumnFilter.js +3 -3
  312. package/lib/es/table/ColumnSelection.js +2 -2
  313. package/lib/es/table/ColumnSorter.js +7 -7
  314. package/lib/es/table/CustomExpandIcon.js +2 -2
  315. package/lib/es/table/HeadTable.js +3 -3
  316. package/lib/es/table/Table.js +20 -20
  317. package/lib/es/table/TableCell.js +8 -8
  318. package/lib/es/table/TableHeader.js +1 -1
  319. package/lib/es/table/TableHeaderRow.js +8 -8
  320. package/lib/es/table/TablePagination.js +3 -3
  321. package/lib/es/tabs/TabBar.js +30 -50
  322. package/lib/es/tabs/TabItem.d.ts +18 -0
  323. package/lib/es/tabs/TabItem.js +78 -0
  324. package/lib/es/tabs/TabPane.js +3 -3
  325. package/lib/es/tabs/index.d.ts +2 -1
  326. package/lib/es/tabs/index.js +4 -2
  327. package/lib/es/tag/group.js +5 -5
  328. package/lib/es/tag/index.js +13 -13
  329. package/lib/es/tagInput/index.d.ts +6 -2
  330. package/lib/es/tagInput/index.js +37 -34
  331. package/lib/es/timePicker/Combobox.js +4 -4
  332. package/lib/es/timePicker/TimeInput.js +4 -4
  333. package/lib/es/timePicker/TimePicker.js +8 -8
  334. package/lib/es/timeline/index.js +8 -8
  335. package/lib/es/timeline/item.js +7 -7
  336. package/lib/es/toast/index.js +5 -5
  337. package/lib/es/toast/toast.js +9 -9
  338. package/lib/es/tooltip/index.js +7 -7
  339. package/lib/es/transfer/index.js +31 -31
  340. package/lib/es/tree/autoSizer.js +1 -1
  341. package/lib/es/tree/index.js +6 -6
  342. package/lib/es/tree/interface.d.ts +1 -0
  343. package/lib/es/tree/nodeList.js +1 -1
  344. package/lib/es/tree/treeNode.js +26 -26
  345. package/lib/es/treeSelect/index.js +41 -41
  346. package/lib/es/typography/base.js +14 -14
  347. package/lib/es/typography/copyable.js +3 -3
  348. package/lib/es/typography/paragraph.js +1 -1
  349. package/lib/es/typography/title.js +1 -1
  350. package/lib/es/typography/util.js +1 -1
  351. package/lib/es/upload/fileCard.js +32 -32
  352. package/lib/es/upload/index.js +37 -37
  353. package/package.json +8 -8
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
+ var _pick2 = _interopRequireDefault(require("lodash/pick"));
9
+
8
10
  var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
9
11
 
10
12
  var _react = _interopRequireDefault(require("react"));
@@ -27,6 +29,8 @@ var _semiIcons = require("@douyinfe/semi-icons");
27
29
 
28
30
  var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
29
31
 
32
+ var _TabItem = _interopRequireDefault(require("./TabItem"));
33
+
30
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
35
 
32
36
  var __rest = void 0 && (void 0).__rest || function (s, e) {
@@ -51,7 +55,7 @@ class TabBar extends _react.default.Component {
51
55
  const key = this._getItemKey(itemKey); // eslint-disable-next-line max-len
52
56
 
53
57
 
54
- const tabItem = document.querySelector("[data-uuid=\"".concat(this.state.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
58
+ const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${_constants.cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
55
59
  tabItem.scrollIntoView({
56
60
  behavior: 'smooth',
57
61
  block: 'nearest',
@@ -68,45 +72,23 @@ class TabBar extends _react.default.Component {
68
72
  const {
69
73
  size,
70
74
  type,
71
- deleteTabItem
75
+ deleteTabItem,
76
+ handleKeyDown,
77
+ tabPosition
72
78
  } = this.props;
73
- const panelIcon = panel.icon ? this.renderIcon(panel.icon) : null;
74
- const closableIcon = type === 'card' && panel.closable ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
75
- "aria-label": "Close",
76
- role: "button",
77
- className: "".concat(_constants.cssClasses.TABS_TAB, "-icon-close"),
78
- onClick: e => deleteTabItem(panel.itemKey, e)
79
- }) : null;
80
- let events = {};
81
- const key = panel.itemKey;
82
-
83
- if (!panel.disabled) {
84
- events = {
85
- onClick: e => this.handleItemClick(key, e)
86
- };
87
- }
88
79
 
89
- const isSelected = this._isActive(key);
90
-
91
- const className = (0, _classnames.default)(_constants.cssClasses.TABS_TAB, {
92
- [_constants.cssClasses.TABS_TAB_ACTIVE]: isSelected,
93
- [_constants.cssClasses.TABS_TAB_DISABLED]: panel.disabled,
94
- ["".concat(_constants.cssClasses.TABS_TAB, "-small")]: size === 'small',
95
- ["".concat(_constants.cssClasses.TABS_TAB, "-medium")]: size === 'medium'
96
- });
97
- return /*#__PURE__*/_react.default.createElement("div", Object.assign({
98
- role: "tab",
99
- id: "semiTab".concat(key),
100
- "data-tabkey": "semiTab".concat(key),
101
- "aria-controls": "semiTabPanel".concat(key),
102
- "aria-disabled": panel.disabled ? 'true' : 'false',
103
- "aria-selected": isSelected ? 'true' : 'false',
104
- tabIndex: isSelected ? 0 : -1,
105
- onKeyDown: e => this.handleKeyDown(e, key, panel.closable)
106
- }, events, {
107
- className: className,
108
- key: this._getItemKey(key)
109
- }), panelIcon, panel.tab, closableIcon);
80
+ const isSelected = this._isActive(panel.itemKey);
81
+
82
+ return /*#__PURE__*/_react.default.createElement(_TabItem.default, Object.assign({}, (0, _pick2.default)(panel, ['disabled', 'icon', 'itemKey', 'tab', 'closable']), {
83
+ key: this._getItemKey(panel.itemKey),
84
+ selected: isSelected,
85
+ size: size,
86
+ type: type,
87
+ tabPosition: tabPosition,
88
+ handleKeyDown: handleKeyDown,
89
+ deleteTabItem: deleteTabItem,
90
+ onClick: this.handleItemClick
91
+ }));
110
92
  };
111
93
 
112
94
  this.renderTabComponents = list => list.map(panel => this.renderTabItem(panel));
@@ -121,7 +103,7 @@ class TabBar extends _react.default.Component {
121
103
  const key = this._getItemKey(lastItem.itemKey); // eslint-disable-next-line max-len
122
104
 
123
105
 
124
- const tabItem = document.querySelector("[data-uuid=\"".concat(this.state.uuid, "\"] .").concat(_constants.cssClasses.TABS_TAB, "[data-scrollkey=\"").concat(key, "\"]"));
106
+ const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${_constants.cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
125
107
  tabItem.scrollIntoView({
126
108
  behavior: 'smooth',
127
109
  block: 'nearest',
@@ -162,17 +144,17 @@ class TabBar extends _react.default.Component {
162
144
  }));
163
145
 
164
146
  const arrowCls = (0, _classnames.default)({
165
- ["".concat(_constants.cssClasses.TABS_BAR, "-arrow-").concat(pos)]: pos,
166
- ["".concat(_constants.cssClasses.TABS_BAR, "-arrow")]: true
147
+ [`${_constants.cssClasses.TABS_BAR}-arrow-${pos}`]: pos,
148
+ [`${_constants.cssClasses.TABS_BAR}-arrow`]: true
167
149
  });
168
150
  const dropdownCls = (0, _classnames.default)(dropdownClassName, {
169
- ["".concat(_constants.cssClasses.TABS_BAR, "-dropdown")]: true
151
+ [`${_constants.cssClasses.TABS_BAR}-dropdown`]: true
170
152
  });
171
153
  return /*#__PURE__*/_react.default.createElement(_dropdown.default, {
172
154
  className: dropdownCls,
173
155
  clickToHide: true,
174
156
  clickTriggerToHide: true,
175
- key: "".concat(rePosKey, "-").concat(pos),
157
+ key: `${rePosKey}-${pos}`,
176
158
  position: pos === 'start' ? 'bottomLeft' : 'bottomRight',
177
159
  render: disabled ? null : menu,
178
160
  showTick: true,
@@ -215,14 +197,14 @@ class TabBar extends _react.default.Component {
215
197
  items: renderedList,
216
198
  overflowRenderer: this.renderOverflow,
217
199
  renderMode: "scroll",
218
- className: "".concat(_constants.cssClasses.TABS_BAR, "-overflow-list"),
200
+ className: `${_constants.cssClasses.TABS_BAR}-overflow-list`,
219
201
  visibleItemRenderer: this.renderTabItem
220
202
  });
221
203
  };
222
204
 
223
205
  this._isActive = key => key === this.props.activeKey;
224
206
 
225
- this._getItemKey = key => "".concat(key, "-bar");
207
+ this._getItemKey = key => `${key}-bar`;
226
208
 
227
209
  this.state = {
228
210
  endInd: props.list.length,
@@ -253,8 +235,8 @@ class TabBar extends _react.default.Component {
253
235
  };
254
236
  const tabBarExtraContentStyle = tabBarExtraContent && tabBarExtraContent.props ? tabBarExtraContent.props.style : {};
255
237
  const extraCls = (0, _classnames.default)(_constants.cssClasses.TABS_BAR_EXTRA, {
256
- ["".concat(_constants.cssClasses.TABS_BAR, "-").concat(type, "-extra")]: type,
257
- ["".concat(_constants.cssClasses.TABS_BAR, "-").concat(type, "-extra-").concat(size)]: size
238
+ [`${_constants.cssClasses.TABS_BAR}-${type}-extra`]: type,
239
+ [`${_constants.cssClasses.TABS_BAR}-${type}-extra-${size}`]: size
258
240
  });
259
241
 
260
242
  if (tabBarExtraContent) {
@@ -286,8 +268,8 @@ class TabBar extends _react.default.Component {
286
268
  [_constants.cssClasses.TABS_BAR_LINE]: type === 'line',
287
269
  [_constants.cssClasses.TABS_BAR_CARD]: type === 'card',
288
270
  [_constants.cssClasses.TABS_BAR_BUTTON]: type === 'button',
289
- ["".concat(_constants.cssClasses.TABS_BAR, "-").concat(tabPosition)]: tabPosition,
290
- ["".concat(_constants.cssClasses.TABS_BAR, "-collapse")]: collapsible
271
+ [`${_constants.cssClasses.TABS_BAR}-${tabPosition}`]: tabPosition,
272
+ [`${_constants.cssClasses.TABS_BAR}-collapse`]: collapsible
291
273
  });
292
274
  const extra = this.renderExtra();
293
275
  const contents = collapsible ? this.renderCollapsedTab() : this.renderTabComponents(list);
@@ -0,0 +1,18 @@
1
+ import React, { ReactNode, MouseEvent } from 'react';
2
+ import { TabType, TabSize, TabPosition } from './interface';
3
+ export interface TabItemProps {
4
+ tab?: ReactNode;
5
+ icon?: ReactNode;
6
+ size?: TabSize;
7
+ type?: TabType;
8
+ tabPosition?: TabPosition;
9
+ selected?: boolean;
10
+ closable?: boolean;
11
+ disabled?: boolean;
12
+ itemKey?: string;
13
+ handleKeyDown?: (event: React.KeyboardEvent, itemKey: string, closable: boolean) => void;
14
+ deleteTabItem?: (tabKey: string, event: MouseEvent<Element>) => void;
15
+ onClick?: (itemKey: string, e: MouseEvent<Element>) => void;
16
+ }
17
+ declare const ForwardTabItem: React.ForwardRefExoticComponent<TabItemProps & React.RefAttributes<HTMLDivElement>>;
18
+ export default ForwardTabItem;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _constants = require("@douyinfe/semi-foundation/lib/cjs/tabs/constants");
13
+
14
+ var _semiIcons = require("@douyinfe/semi-icons");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
23
+ var t = {};
24
+
25
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
26
+
27
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
28
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
29
+ }
30
+ return t;
31
+ };
32
+
33
+ const TabItem = (props, ref) => {
34
+ const {
35
+ tab,
36
+ size,
37
+ type,
38
+ icon,
39
+ selected,
40
+ closable,
41
+ disabled,
42
+ itemKey,
43
+ deleteTabItem,
44
+ tabPosition,
45
+ handleKeyDown,
46
+ onClick
47
+ } = props,
48
+ restProps = __rest(props, ["tab", "size", "type", "icon", "selected", "closable", "disabled", "itemKey", "deleteTabItem", "tabPosition", "handleKeyDown", "onClick"]);
49
+
50
+ const closableIcon = (0, _react.useMemo)(() => {
51
+ return type === 'card' && closable ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
52
+ "aria-label": "Close",
53
+ role: "button",
54
+ className: `${_constants.cssClasses.TABS_TAB}-icon-close`,
55
+ onClick: e => deleteTabItem(itemKey, e)
56
+ }) : null;
57
+ }, [type, closable, deleteTabItem, itemKey]);
58
+ const renderIcon = (0, _react.useCallback)(icon => /*#__PURE__*/_react.default.createElement("span", null, icon), []);
59
+ const handleKeyDownInItem = (0, _react.useCallback)(event => {
60
+ handleKeyDown && handleKeyDown(event, itemKey, closable);
61
+ }, [handleKeyDown, itemKey, closable]);
62
+ const handleItemClick = (0, _react.useCallback)(e => {
63
+ !disabled && onClick && onClick(itemKey, e);
64
+ }, [itemKey, disabled, onClick]);
65
+ const panelIcon = icon ? renderIcon(icon) : null;
66
+ const className = (0, _classnames.default)(_constants.cssClasses.TABS_TAB, `${_constants.cssClasses.TABS_TAB}-${type}`, `${_constants.cssClasses.TABS_TAB}-${tabPosition}`, `${_constants.cssClasses.TABS_TAB}-single`, {
67
+ [_constants.cssClasses.TABS_TAB_ACTIVE]: selected,
68
+ [_constants.cssClasses.TABS_TAB_DISABLED]: disabled,
69
+ [`${_constants.cssClasses.TABS_TAB}-small`]: size === 'small',
70
+ [`${_constants.cssClasses.TABS_TAB}-medium`]: size === 'medium'
71
+ });
72
+ return /*#__PURE__*/_react.default.createElement("div", Object.assign({
73
+ role: "tab",
74
+ id: `semiTab${itemKey}`,
75
+ "data-tabkey": `semiTab${itemKey}`,
76
+ "aria-controls": `semiTabPanel${itemKey}`,
77
+ "aria-disabled": disabled ? 'true' : 'false',
78
+ "aria-selected": selected ? 'true' : 'false',
79
+ tabIndex: selected ? 0 : -1,
80
+ onKeyDown: handleKeyDownInItem,
81
+ onClick: handleItemClick,
82
+ className: className
83
+ }, restProps, {
84
+ ref: ref
85
+ }), panelIcon, tab, closableIcon);
86
+ }; // Why is forwardRef needed here?
87
+ // Because TabItem needs to be used in OverflowList (when tabs' type is collapsible),
88
+ // OverflowList will pass ref to the outermost div DOM node of TabItem
89
+
90
+
91
+ const ForwardTabItem = /*#__PURE__*/(0, _react.forwardRef)(TabItem); // @ts-ignore
92
+
93
+ ForwardTabItem.elementType = 'Tabs.TabItem';
94
+ var _default = ForwardTabItem;
95
+ exports.default = _default;
@@ -119,8 +119,8 @@ class TabPane extends _react.PureComponent {
119
119
  return /*#__PURE__*/_react.default.createElement("div", Object.assign({
120
120
  ref: this.ref,
121
121
  role: "tabpanel",
122
- id: "semiTabPanel".concat(itemKey),
123
- "aria-labelledby": "semiTab".concat(itemKey),
122
+ id: `semiTabPanel${itemKey}`,
123
+ "aria-labelledby": `semiTab${itemKey}`,
124
124
  className: classNames,
125
125
  style: style,
126
126
  "aria-hidden": active ? 'false' : 'true',
@@ -137,7 +137,7 @@ class TabPane extends _react.PureComponent {
137
137
  animationEventsNeedBind
138
138
  } = _ref;
139
139
  return /*#__PURE__*/_react.default.createElement("div", Object.assign({
140
- className: "".concat(_constants.cssClasses.TABS_PANE_MOTION_OVERLAY, " ").concat(animationClassName),
140
+ className: `${_constants.cssClasses.TABS_PANE_MOTION_OVERLAY} ${animationClassName}`,
141
141
  "x-semi-prop": "children"
142
142
  }, animationEventsNeedBind), shouldRender ? children : null);
143
143
  }));
@@ -1,4 +1,4 @@
1
- import { MouseEvent, ReactElement, ReactNode, RefCallback, RefObject } from 'react';
1
+ import React, { MouseEvent, ReactElement, ReactNode, RefCallback, RefObject } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import TabsFoundation, { TabsAdapter } from '@douyinfe/semi-foundation/lib/cjs/tabs/foundation';
4
4
  import BaseComponent from '../_base/baseComponent';
@@ -14,6 +14,7 @@ export interface TabsState {
14
14
  }
15
15
  declare class Tabs extends BaseComponent<TabsProps, TabsState> {
16
16
  static TabPane: typeof TabPane;
17
+ static TabItem: React.ForwardRefExoticComponent<import("./TabItem").TabItemProps & React.RefAttributes<HTMLDivElement>>;
17
18
  static propTypes: {
18
19
  activeKey: PropTypes.Requireable<string>;
19
20
  className: PropTypes.Requireable<string>;
@@ -32,6 +32,8 @@ var _TabBar = _interopRequireDefault(require("./TabBar"));
32
32
 
33
33
  var _TabPane = _interopRequireDefault(require("./TabPane"));
34
34
 
35
+ var _TabItem = _interopRequireDefault(require("./TabItem"));
36
+
35
37
  var _tabsContext = _interopRequireDefault(require("./tabs-context"));
36
38
 
37
39
  var _interface = require("./interface");
@@ -334,11 +336,11 @@ class Tabs extends _baseComponent.default {
334
336
  } = this.state;
335
337
  const tabWrapperCls = (0, _classnames.default)(className, {
336
338
  [_constants.cssClasses.TABS]: true,
337
- ["".concat(_constants.cssClasses.TABS, "-").concat(tabPosition)]: tabPosition
339
+ [`${_constants.cssClasses.TABS}-${tabPosition}`]: tabPosition
338
340
  });
339
341
  const tabContentCls = (0, _classnames.default)({
340
342
  [_constants.cssClasses.TABS_CONTENT]: true,
341
- ["".concat(_constants.cssClasses.TABS_CONTENT, "-").concat(tabPosition)]: tabPosition
343
+ [`${_constants.cssClasses.TABS_CONTENT}-${tabPosition}`]: tabPosition
342
344
  });
343
345
  const tabBarProps = {
344
346
  activeKey,
@@ -379,6 +381,7 @@ class Tabs extends _baseComponent.default {
379
381
  }
380
382
 
381
383
  Tabs.TabPane = _TabPane.default;
384
+ Tabs.TabItem = _TabItem.default;
382
385
  Tabs.propTypes = {
383
386
  activeKey: _propTypes.default.string,
384
387
  className: _propTypes.default.string,
@@ -54,7 +54,7 @@ class TagGroup extends _react.PureComponent {
54
54
  trigger: "hover",
55
55
  position: "top",
56
56
  autoAdjustOverflow: true,
57
- className: "".concat(prefixCls, "-rest-group-popover")
57
+ className: `${prefixCls}-rest-group-popover`
58
58
  }, popoverProps, {
59
59
  key: "_+n_Popover"
60
60
  }), nTag);
@@ -137,10 +137,10 @@ class TagGroup extends _react.PureComponent {
137
137
  size
138
138
  } = this.props;
139
139
  const groupCls = (0, _classnames.default)({
140
- ["".concat(prefixCls, "-group")]: true,
141
- ["".concat(prefixCls, "-group-max")]: maxTagCount,
142
- ["".concat(prefixCls, "-group-small")]: size === 'small',
143
- ["".concat(prefixCls, "-group-large")]: size === 'large'
140
+ [`${prefixCls}-group`]: true,
141
+ [`${prefixCls}-group-max`]: maxTagCount,
142
+ [`${prefixCls}-group-small`]: size === 'small',
143
+ [`${prefixCls}-group-large`]: size === 'large'
144
144
  }, className);
145
145
  const tags = this.renderAllTags();
146
146
  const tagContents = typeof maxTagCount === 'undefined' ? tags : this.renderMergeTags(tags);
@@ -184,16 +184,16 @@ class Tag extends _react.Component {
184
184
  const baseProps = Object.assign(Object.assign({}, attr), {
185
185
  onClick,
186
186
  className: (0, _classnames.default)(prefixCls, {
187
- ["".concat(prefixCls, "-default")]: size === 'default',
188
- ["".concat(prefixCls, "-small")]: size === 'small',
189
- ["".concat(prefixCls, "-large")]: size === 'large',
190
- ["".concat(prefixCls, "-square")]: shape === 'square',
191
- ["".concat(prefixCls, "-circle")]: shape === 'circle',
192
- ["".concat(prefixCls, "-").concat(type)]: type,
193
- ["".concat(prefixCls, "-").concat(color, "-").concat(type)]: color && type,
194
- ["".concat(prefixCls, "-closable")]: closable,
195
- ["".concat(prefixCls, "-invisible")]: !isVisible,
196
- ["".concat(prefixCls, "-avatar-").concat(avatarShape)]: avatarSrc
187
+ [`${prefixCls}-default`]: size === 'default',
188
+ [`${prefixCls}-small`]: size === 'small',
189
+ [`${prefixCls}-large`]: size === 'large',
190
+ [`${prefixCls}-square`]: shape === 'square',
191
+ [`${prefixCls}-circle`]: shape === 'circle',
192
+ [`${prefixCls}-${type}`]: type,
193
+ [`${prefixCls}-${color}-${type}`]: color && type,
194
+ [`${prefixCls}-closable`]: closable,
195
+ [`${prefixCls}-invisible`]: !isVisible,
196
+ [`${prefixCls}-avatar-${avatarShape}`]: avatarSrc
197
197
  }, className)
198
198
  });
199
199
  const wrapProps = clickable ? Object.assign(Object.assign({}, baseProps), a11yProps) : baseProps;
@@ -201,15 +201,15 @@ class Tag extends _react.Component {
201
201
  /*#__PURE__*/
202
202
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
203
203
  _react.default.createElement("div", {
204
- className: "".concat(prefixCls, "-close"),
204
+ className: `${prefixCls}-close`,
205
205
  onClick: e => this.close(e, children, tagKey)
206
206
  }, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
207
207
  size: "small"
208
208
  })) : null;
209
209
  return /*#__PURE__*/_react.default.createElement("div", Object.assign({
210
- "aria-label": this.props['aria-label'] || (0, _isString2.default)(children) ? "".concat(closable ? 'Closable ' : '', "Tag: ").concat(children) : ''
210
+ "aria-label": this.props['aria-label'] || (0, _isString2.default)(children) ? `${closable ? 'Closable ' : ''}Tag: ${children}` : ''
211
211
  }, wrapProps), avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/_react.default.createElement("div", {
212
- className: "".concat(prefixCls, "-content")
212
+ className: `${prefixCls}-content`
213
213
  }, children), closeIcon);
214
214
  }
215
215
 
@@ -6,6 +6,7 @@ import TagInputFoundation, { TagInputAdapter, OnSortEndProps } from '@douyinfe/s
6
6
  import { ArrayElement } from '../_base/base';
7
7
  import BaseComponent from '../_base/baseComponent';
8
8
  import { PopoverProps } from '../popover';
9
+ import { ShowTooltip } from '../typography';
9
10
  export declare type Size = ArrayElement<typeof strings.SIZE_SET>;
10
11
  export declare type RestTagsPopoverProps = PopoverProps;
11
12
  declare type ValidateStatus = "default" | "error" | "warning";
@@ -20,7 +21,7 @@ export interface TagInputProps {
20
21
  maxTagCount?: number;
21
22
  showRestTagsPopover?: boolean;
22
23
  restTagsPopoverProps?: RestTagsPopoverProps;
23
- showContentTooltip?: boolean;
24
+ showContentTooltip?: boolean | ShowTooltip;
24
25
  allowDuplicates?: boolean;
25
26
  addOnBlur?: boolean;
26
27
  draggable?: boolean;
@@ -71,7 +72,10 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
71
72
  maxLength: PropTypes.Requireable<number>;
72
73
  showRestTagsPopover: PropTypes.Requireable<boolean>;
73
74
  restTagsPopoverProps: PropTypes.Requireable<object>;
74
- showContentTooltip: PropTypes.Requireable<boolean>;
75
+ showContentTooltip: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
76
+ type: PropTypes.Requireable<string>;
77
+ opts: PropTypes.Requireable<object>;
78
+ }>>>;
75
79
  defaultValue: PropTypes.Requireable<any[]>;
76
80
  value: PropTypes.Requireable<any[]>;
77
81
  inputValue: PropTypes.Requireable<string>;
@@ -54,7 +54,7 @@ const SortableList = (0, _reactSortableHoc.SortableContainer)(_ref => {
54
54
  items
55
55
  } = _ref;
56
56
  return /*#__PURE__*/_react.default.createElement("div", {
57
- className: "".concat(prefixCls, "-sortable-list")
57
+ className: `${prefixCls}-sortable-list`
58
58
  }, items.map((item, index) =>
59
59
  /*#__PURE__*/
60
60
  // @ts-ignore skip SortableItem type check
@@ -132,22 +132,22 @@ class TagInput extends _baseComponent.default {
132
132
  active
133
133
  } = this.state;
134
134
  const showIconHandler = active && draggable;
135
- const tagCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper-tag"), {
136
- ["".concat(prefixCls, "-wrapper-tag-size-").concat(size)]: size,
137
- ["".concat(prefixCls, "-wrapper-tag-icon")]: showIconHandler
135
+ const tagCls = (0, _classnames.default)(`${prefixCls}-wrapper-tag`, {
136
+ [`${prefixCls}-wrapper-tag-size-${size}`]: size,
137
+ [`${prefixCls}-wrapper-tag-icon`]: showIconHandler
138
138
  });
139
- const typoCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper-typo"), {
140
- ["".concat(prefixCls, "-wrapper-typo-disabled")]: disabled
139
+ const typoCls = (0, _classnames.default)(`${prefixCls}-wrapper-typo`, {
140
+ [`${prefixCls}-wrapper-typo-disabled`]: disabled
141
141
  });
142
142
  const itemWrapperCls = (0, _classnames.default)({
143
- ["".concat(prefixCls, "-drag-item")]: showIconHandler,
144
- ["".concat(prefixCls, "-wrapper-tag-icon")]: showIconHandler
143
+ [`${prefixCls}-drag-item`]: showIconHandler,
144
+ [`${prefixCls}-wrapper-tag-icon`]: showIconHandler
145
145
  });
146
146
  const DragHandle = (0, _reactSortableHoc.SortableHandle)(() => /*#__PURE__*/_react.default.createElement(_semiIcons.IconHandle, {
147
- className: "".concat(prefixCls, "-drag-handler")
147
+ className: `${prefixCls}-drag-handler`
148
148
  }));
149
149
  return tagsArray.map((value, index) => {
150
- const elementKey = showIconHandler ? value : "".concat(index).concat(value);
150
+ const elementKey = showIconHandler ? value : `${index}${value}`;
151
151
 
152
152
  const onClose = () => {
153
153
  !disabled && this.handleTagClose(index);
@@ -168,9 +168,9 @@ class TagInput extends _baseComponent.default {
168
168
  closable: !disabled,
169
169
  key: elementKey,
170
170
  visible: true,
171
- "aria-label": "".concat(!disabled ? 'Closable ' : '', "Tag: ").concat(value)
171
+ "aria-label": `${!disabled ? 'Closable ' : ''}Tag: ${value}`
172
172
  }, /*#__PURE__*/_react.default.createElement("div", {
173
- className: "".concat(prefixCls, "-tag-content-wrapper")
173
+ className: `${prefixCls}-tag-content-wrapper`
174
174
  }, showIconHandler && /*#__PURE__*/_react.default.createElement(DragHandle, null), /*#__PURE__*/_react.default.createElement(_paragraph.default, {
175
175
  className: typoCls,
176
176
  ellipsis: {
@@ -354,8 +354,8 @@ class TagInput extends _baseComponent.default {
354
354
  disabled,
355
355
  clearIcon
356
356
  } = this.props;
357
- const clearCls = (0, _classnames.default)("".concat(prefixCls, "-clearBtn"), {
358
- ["".concat(prefixCls, "-clearBtn-invisible")]: !hovering || inputValue === '' && tagsArray.length === 0 || disabled
357
+ const clearCls = (0, _classnames.default)(`${prefixCls}-clearBtn`, {
358
+ [`${prefixCls}-clearBtn-invisible`]: !hovering || inputValue === '' && tagsArray.length === 0 || disabled
359
359
  });
360
360
 
361
361
  if (showClear) {
@@ -384,11 +384,11 @@ class TagInput extends _baseComponent.default {
384
384
  return null;
385
385
  }
386
386
 
387
- const prefixWrapperCls = (0, _classnames.default)("".concat(prefixCls, "-prefix"), {
388
- ["".concat(prefixCls, "-inset-label")]: insetLabel,
389
- ["".concat(prefixCls, "-prefix-text")]: labelNode && (0, _isString2.default)(labelNode),
387
+ const prefixWrapperCls = (0, _classnames.default)(`${prefixCls}-prefix`, {
388
+ [`${prefixCls}-inset-label`]: insetLabel,
389
+ [`${prefixCls}-prefix-text`]: labelNode && (0, _isString2.default)(labelNode),
390
390
  // eslint-disable-next-line max-len
391
- ["".concat(prefixCls, "-prefix-icon")]: (0, _utils.isSemiIcon)(labelNode)
391
+ [`${prefixCls}-prefix-icon`]: (0, _utils.isSemiIcon)(labelNode)
392
392
  });
393
393
  return (
394
394
  /*#__PURE__*/
@@ -412,10 +412,10 @@ class TagInput extends _baseComponent.default {
412
412
  return null;
413
413
  }
414
414
 
415
- const suffixWrapperCls = (0, _classnames.default)("".concat(prefixCls, "-suffix"), {
416
- ["".concat(prefixCls, "-suffix-text")]: suffix && (0, _isString2.default)(suffix),
415
+ const suffixWrapperCls = (0, _classnames.default)(`${prefixCls}-suffix`, {
416
+ [`${prefixCls}-suffix-text`]: suffix && (0, _isString2.default)(suffix),
417
417
  // eslint-disable-next-line max-len
418
- ["".concat(prefixCls, "-suffix-icon")]: (0, _utils.isSemiIcon)(suffix)
418
+ [`${prefixCls}-suffix-icon`]: (0, _utils.isSemiIcon)(suffix)
419
419
  });
420
420
  return (
421
421
  /*#__PURE__*/
@@ -442,8 +442,8 @@ class TagInput extends _baseComponent.default {
442
442
  tagsArray,
443
443
  active
444
444
  } = this.state;
445
- const restTagsCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper-n"), {
446
- ["".concat(prefixCls, "-wrapper-n-disabled")]: disabled
445
+ const restTagsCls = (0, _classnames.default)(`${prefixCls}-wrapper-n`, {
446
+ [`${prefixCls}-wrapper-n-disabled`]: disabled
447
447
  });
448
448
  const allTags = this.getAllTags();
449
449
  let restTags = [];
@@ -468,7 +468,7 @@ class TagInput extends _baseComponent.default {
468
468
  // @ts-ignore skip SortableItem type check
469
469
  return /*#__PURE__*/_react.default.createElement(SortableList, {
470
470
  useDragHandle: true,
471
- helperClass: "".concat(prefixCls, "-drag-item-move"),
471
+ helperClass: `${prefixCls}-drag-item-move`,
472
472
  items: sortableListItems,
473
473
  onSortEnd: this.onSortEnd,
474
474
  axis: "xy"
@@ -522,16 +522,16 @@ class TagInput extends _baseComponent.default {
522
522
  active
523
523
  } = this.state;
524
524
  const tagInputCls = (0, _classnames.default)(prefixCls, className, {
525
- ["".concat(prefixCls, "-focus")]: focusing || active,
526
- ["".concat(prefixCls, "-disabled")]: disabled,
527
- ["".concat(prefixCls, "-hover")]: hovering && !disabled,
528
- ["".concat(prefixCls, "-error")]: validateStatus === 'error',
529
- ["".concat(prefixCls, "-warning")]: validateStatus === 'warning',
530
- ["".concat(prefixCls, "-small")]: size === 'small',
531
- ["".concat(prefixCls, "-large")]: size === 'large'
525
+ [`${prefixCls}-focus`]: focusing || active,
526
+ [`${prefixCls}-disabled`]: disabled,
527
+ [`${prefixCls}-hover`]: hovering && !disabled,
528
+ [`${prefixCls}-error`]: validateStatus === 'error',
529
+ [`${prefixCls}-warning`]: validateStatus === 'warning',
530
+ [`${prefixCls}-small`]: size === 'small',
531
+ [`${prefixCls}-large`]: size === 'large'
532
532
  });
533
- const inputCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper-input"), "".concat(prefixCls, "-wrapper-input-").concat(size));
534
- const wrapperCls = (0, _classnames.default)("".concat(prefixCls, "-wrapper"));
533
+ const inputCls = (0, _classnames.default)(`${prefixCls}-wrapper-input`, `${prefixCls}-wrapper-input-${size}`);
534
+ const wrapperCls = (0, _classnames.default)(`${prefixCls}-wrapper`);
535
535
  return (
536
536
  /*#__PURE__*/
537
537
  // eslint-disable-next-line
@@ -593,7 +593,10 @@ TagInput.propTypes = {
593
593
  maxLength: _propTypes.default.number,
594
594
  showRestTagsPopover: _propTypes.default.bool,
595
595
  restTagsPopoverProps: _propTypes.default.object,
596
- showContentTooltip: _propTypes.default.bool,
596
+ showContentTooltip: _propTypes.default.oneOfType([_propTypes.default.shape({
597
+ type: _propTypes.default.string,
598
+ opts: _propTypes.default.object
599
+ }), _propTypes.default.bool]),
597
600
  defaultValue: _propTypes.default.array,
598
601
  value: _propTypes.default.array,
599
602
  inputValue: _propTypes.default.string,
@@ -162,7 +162,7 @@ class Combobox extends _baseComponent.default {
162
162
 
163
163
  const transformHour = value => value + locale.hour;
164
164
 
165
- const className = "".concat(prefixCls, "-list-hour");
165
+ const className = `${prefixCls}-list-hour`;
166
166
  return /*#__PURE__*/_react.default.createElement(_scrollItem.default, Object.assign({
167
167
  ref: current => this.cacheRefCurrent('hour', current),
168
168
  mode: 'normal',
@@ -193,7 +193,7 @@ class Combobox extends _baseComponent.default {
193
193
 
194
194
  const value = new Date(timeStampValue);
195
195
  const disabledOptions = disabledMinutes && disabledMinutes(value.getHours());
196
- const className = "".concat(prefixCls, "-list-minute");
196
+ const className = `${prefixCls}-list-minute`;
197
197
 
198
198
  const transformMinute = min => min + locale.minute;
199
199
 
@@ -227,7 +227,7 @@ class Combobox extends _baseComponent.default {
227
227
 
228
228
  const value = new Date(timeStampValue);
229
229
  const disabledOptions = disabledSeconds && disabledSeconds(value.getHours(), value.getMinutes());
230
- const className = "".concat(prefixCls, "-list-second");
230
+ const className = `${prefixCls}-list-second`;
231
231
 
232
232
  const transformSecond = sec => String(sec) + locale.second;
233
233
 
@@ -263,7 +263,7 @@ class Combobox extends _baseComponent.default {
263
263
  text: locale.PM || '下午'
264
264
  }];
265
265
  const selected = isAM ? 0 : 1;
266
- const className = "".concat(prefixCls, "-list-ampm");
266
+ const className = `${prefixCls}-list-ampm`;
267
267
  return /*#__PURE__*/_react.default.createElement(_scrollItem.default, Object.assign({
268
268
  ref: current => this.cacheRefCurrent('ampm', current),
269
269
  mode: 'normal',