@douyinfe/semi-ui 2.1.0-beta.0 → 2.1.0-next.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 (561) hide show
  1. package/dist/css/semi.css +43 -51
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +567 -660
  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/_base/base.css +510 -0
  8. package/lib/cjs/_base/base.d.ts +32 -0
  9. package/lib/cjs/_base/base.js +7 -0
  10. package/lib/cjs/_base/base.scss +3 -0
  11. package/lib/cjs/_base/baseComponent.d.ts +25 -0
  12. package/lib/cjs/_base/baseComponent.js +84 -0
  13. package/lib/cjs/_base/reactUtils.d.ts +8 -0
  14. package/lib/cjs/_base/reactUtils.js +55 -0
  15. package/lib/cjs/_portal/index.d.ts +36 -0
  16. package/lib/cjs/_portal/index.js +151 -0
  17. package/lib/cjs/_utils/index.d.ts +68 -0
  18. package/lib/cjs/_utils/index.js +189 -0
  19. package/lib/cjs/anchor/anchor-context.d.ts +7 -0
  20. package/lib/cjs/anchor/anchor-context.js +18 -0
  21. package/lib/cjs/anchor/index.d.ts +93 -0
  22. package/lib/cjs/anchor/index.js +334 -0
  23. package/lib/cjs/anchor/link.d.ts +37 -0
  24. package/lib/cjs/anchor/link.js +174 -0
  25. package/lib/cjs/autoComplete/index.d.ts +142 -0
  26. package/lib/cjs/autoComplete/index.js +427 -0
  27. package/lib/cjs/avatar/avatarGroup.d.ts +22 -0
  28. package/lib/cjs/avatar/avatarGroup.js +167 -0
  29. package/lib/cjs/avatar/index.d.ts +48 -0
  30. package/lib/cjs/avatar/index.js +259 -0
  31. package/lib/cjs/avatar/interface.d.ts +31 -0
  32. package/lib/cjs/avatar/interface.js +7 -0
  33. package/lib/cjs/backtop/index.d.ts +38 -0
  34. package/lib/cjs/backtop/index.js +144 -0
  35. package/lib/cjs/badge/index.d.ts +38 -0
  36. package/lib/cjs/badge/index.js +107 -0
  37. package/lib/cjs/banner/index.d.ts +50 -0
  38. package/lib/cjs/banner/index.js +209 -0
  39. package/lib/cjs/breadcrumb/bread-context.d.ts +11 -0
  40. package/lib/cjs/breadcrumb/bread-context.js +18 -0
  41. package/lib/cjs/breadcrumb/index.d.ts +81 -0
  42. package/lib/cjs/breadcrumb/index.js +286 -0
  43. package/lib/cjs/breadcrumb/item.d.ts +53 -0
  44. package/lib/cjs/breadcrumb/item.js +246 -0
  45. package/lib/cjs/button/Button.d.ts +61 -0
  46. package/lib/cjs/button/Button.js +145 -0
  47. package/lib/cjs/button/buttonGroup.d.ts +26 -0
  48. package/lib/cjs/button/buttonGroup.js +91 -0
  49. package/lib/cjs/button/index.d.ts +38 -0
  50. package/lib/cjs/button/index.js +45 -0
  51. package/lib/cjs/button/splitButtonGroup.d.ts +12 -0
  52. package/lib/cjs/button/splitButtonGroup.js +47 -0
  53. package/lib/cjs/calendar/dayCalendar.d.ts +50 -0
  54. package/lib/cjs/calendar/dayCalendar.js +234 -0
  55. package/lib/cjs/calendar/dayCol.d.ts +41 -0
  56. package/lib/cjs/calendar/dayCol.js +211 -0
  57. package/lib/cjs/calendar/index.d.ts +42 -0
  58. package/lib/cjs/calendar/index.js +119 -0
  59. package/lib/cjs/calendar/interface.d.ts +37 -0
  60. package/lib/cjs/calendar/interface.js +7 -0
  61. package/lib/cjs/calendar/monthCalendar.d.ts +59 -0
  62. package/lib/cjs/calendar/monthCalendar.js +474 -0
  63. package/lib/cjs/calendar/rangeCalendar.d.ts +51 -0
  64. package/lib/cjs/calendar/rangeCalendar.js +329 -0
  65. package/lib/cjs/calendar/timeCol.d.ts +15 -0
  66. package/lib/cjs/calendar/timeCol.js +101 -0
  67. package/lib/cjs/calendar/weekCalendar.d.ts +52 -0
  68. package/lib/cjs/calendar/weekCalendar.js +331 -0
  69. package/lib/cjs/card/cardGroup.d.ts +27 -0
  70. package/lib/cjs/card/cardGroup.js +87 -0
  71. package/lib/cjs/card/index.d.ts +75 -0
  72. package/lib/cjs/card/index.js +222 -0
  73. package/lib/cjs/card/meta.d.ts +26 -0
  74. package/lib/cjs/card/meta.js +93 -0
  75. package/lib/cjs/cascader/index.d.ts +178 -0
  76. package/lib/cjs/cascader/index.js +972 -0
  77. package/lib/cjs/cascader/item.d.ts +72 -0
  78. package/lib/cjs/cascader/item.js +353 -0
  79. package/lib/cjs/checkbox/checkbox.d.ts +61 -0
  80. package/lib/cjs/checkbox/checkbox.js +205 -0
  81. package/lib/cjs/checkbox/checkboxGroup.d.ts +49 -0
  82. package/lib/cjs/checkbox/checkboxGroup.js +183 -0
  83. package/lib/cjs/checkbox/checkboxInner.d.ts +40 -0
  84. package/lib/cjs/checkbox/checkboxInner.js +97 -0
  85. package/lib/cjs/checkbox/context.d.ts +14 -0
  86. package/lib/cjs/checkbox/context.js +17 -0
  87. package/lib/cjs/checkbox/index.d.ts +8 -0
  88. package/lib/cjs/checkbox/index.js +29 -0
  89. package/lib/cjs/collapse/collapse-context.d.ts +13 -0
  90. package/lib/cjs/collapse/collapse-context.js +18 -0
  91. package/lib/cjs/collapse/index.d.ts +43 -0
  92. package/lib/cjs/collapse/index.js +169 -0
  93. package/lib/cjs/collapse/item.d.ts +23 -0
  94. package/lib/cjs/collapse/item.js +151 -0
  95. package/lib/cjs/collapsible/index.d.ts +36 -0
  96. package/lib/cjs/collapsible/index.js +177 -0
  97. package/lib/cjs/configProvider/context.d.ts +11 -0
  98. package/lib/cjs/configProvider/context.js +18 -0
  99. package/lib/cjs/configProvider/index.d.ts +19 -0
  100. package/lib/cjs/configProvider/index.js +83 -0
  101. package/lib/cjs/datePicker/dateInput.d.ts +81 -0
  102. package/lib/cjs/datePicker/dateInput.js +408 -0
  103. package/lib/cjs/datePicker/datePicker.d.ts +180 -0
  104. package/lib/cjs/datePicker/datePicker.js +723 -0
  105. package/lib/cjs/datePicker/footer.d.ts +11 -0
  106. package/lib/cjs/datePicker/footer.js +39 -0
  107. package/lib/cjs/datePicker/index.d.ts +11 -0
  108. package/lib/cjs/datePicker/index.js +67 -0
  109. package/lib/cjs/datePicker/month.d.ts +203 -0
  110. package/lib/cjs/datePicker/month.js +503 -0
  111. package/lib/cjs/datePicker/monthsGrid.d.ts +88 -0
  112. package/lib/cjs/datePicker/monthsGrid.js +700 -0
  113. package/lib/cjs/datePicker/navigation.d.ts +44 -0
  114. package/lib/cjs/datePicker/navigation.js +117 -0
  115. package/lib/cjs/datePicker/quickControl.d.ts +22 -0
  116. package/lib/cjs/datePicker/quickControl.js +86 -0
  117. package/lib/cjs/datePicker/yearAndMonth.d.ts +48 -0
  118. package/lib/cjs/datePicker/yearAndMonth.js +279 -0
  119. package/lib/cjs/descriptions/descriptions-context.d.ts +7 -0
  120. package/lib/cjs/descriptions/descriptions-context.js +18 -0
  121. package/lib/cjs/descriptions/index.d.ts +47 -0
  122. package/lib/cjs/descriptions/index.js +102 -0
  123. package/lib/cjs/descriptions/item.d.ts +19 -0
  124. package/lib/cjs/descriptions/item.js +89 -0
  125. package/lib/cjs/dropdown/context.d.ts +5 -0
  126. package/lib/cjs/dropdown/context.js +20 -0
  127. package/lib/cjs/dropdown/dropdownDivider.d.ts +5 -0
  128. package/lib/cjs/dropdown/dropdownDivider.js +40 -0
  129. package/lib/cjs/dropdown/dropdownItem.d.ts +47 -0
  130. package/lib/cjs/dropdown/dropdownItem.js +134 -0
  131. package/lib/cjs/dropdown/dropdownMenu.d.ts +12 -0
  132. package/lib/cjs/dropdown/dropdownMenu.js +66 -0
  133. package/lib/cjs/dropdown/dropdownTitle.d.ts +16 -0
  134. package/lib/cjs/dropdown/dropdownTitle.js +62 -0
  135. package/lib/cjs/dropdown/index.d.ts +103 -0
  136. package/lib/cjs/dropdown/index.js +284 -0
  137. package/lib/cjs/empty/index.d.ts +38 -0
  138. package/lib/cjs/empty/index.js +141 -0
  139. package/lib/cjs/form/arrayField.d.ts +33 -0
  140. package/lib/cjs/form/arrayField.js +265 -0
  141. package/lib/cjs/form/baseForm.d.ts +148 -0
  142. package/lib/cjs/form/baseForm.js +326 -0
  143. package/lib/cjs/form/context.d.ts +9 -0
  144. package/lib/cjs/form/context.js +35 -0
  145. package/lib/cjs/form/errorMessage.d.ts +25 -0
  146. package/lib/cjs/form/errorMessage.js +108 -0
  147. package/lib/cjs/form/field.d.ts +96 -0
  148. package/lib/cjs/form/field.js +132 -0
  149. package/lib/cjs/form/group.d.ts +14 -0
  150. package/lib/cjs/form/group.js +147 -0
  151. package/lib/cjs/form/hoc/withField.d.ts +12 -0
  152. package/lib/cjs/form/hoc/withField.js +557 -0
  153. package/lib/cjs/form/hoc/withFormApi.d.ts +3 -0
  154. package/lib/cjs/form/hoc/withFormApi.js +25 -0
  155. package/lib/cjs/form/hoc/withFormState.d.ts +3 -0
  156. package/lib/cjs/form/hoc/withFormState.js +25 -0
  157. package/lib/cjs/form/hooks/index.d.ts +8 -0
  158. package/lib/cjs/form/hooks/index.js +72 -0
  159. package/lib/cjs/form/hooks/useArrayFieldState.d.ts +4 -0
  160. package/lib/cjs/form/hooks/useArrayFieldState.js +21 -0
  161. package/lib/cjs/form/hooks/useFieldApi.d.ts +10 -0
  162. package/lib/cjs/form/hooks/useFieldApi.js +31 -0
  163. package/lib/cjs/form/hooks/useFieldState.d.ts +6 -0
  164. package/lib/cjs/form/hooks/useFieldState.js +40 -0
  165. package/lib/cjs/form/hooks/useFormApi.d.ts +1 -0
  166. package/lib/cjs/form/hooks/useFormApi.js +17 -0
  167. package/lib/cjs/form/hooks/useFormState.d.ts +2 -0
  168. package/lib/cjs/form/hooks/useFormState.js +21 -0
  169. package/lib/cjs/form/hooks/useFormUpdater.d.ts +1 -0
  170. package/lib/cjs/form/hooks/useFormUpdater.js +17 -0
  171. package/lib/cjs/form/hooks/useStateWithGetter.d.ts +1 -0
  172. package/lib/cjs/form/hooks/useStateWithGetter.js +27 -0
  173. package/lib/cjs/form/index.d.ts +22 -0
  174. package/lib/cjs/form/index.js +117 -0
  175. package/lib/cjs/form/interface.d.ts +111 -0
  176. package/lib/cjs/form/interface.js +36 -0
  177. package/lib/cjs/form/label.d.ts +39 -0
  178. package/lib/cjs/form/label.js +91 -0
  179. package/lib/cjs/form/section.d.ts +17 -0
  180. package/lib/cjs/form/section.js +60 -0
  181. package/lib/cjs/form/slot.d.ts +14 -0
  182. package/lib/cjs/form/slot.js +200 -0
  183. package/lib/cjs/grid/col.d.ts +55 -0
  184. package/lib/cjs/grid/col.js +146 -0
  185. package/lib/cjs/grid/index.d.ts +5 -0
  186. package/lib/cjs/grid/index.js +27 -0
  187. package/lib/cjs/grid/row.d.ts +58 -0
  188. package/lib/cjs/grid/row.js +207 -0
  189. package/lib/cjs/iconButton/index.d.ts +47 -0
  190. package/lib/cjs/iconButton/index.js +154 -0
  191. package/lib/cjs/icons/index.d.ts +3 -0
  192. package/lib/cjs/icons/index.js +16 -0
  193. package/lib/cjs/index.d.ts +79 -0
  194. package/lib/cjs/index.js +782 -0
  195. package/lib/cjs/input/index.d.ts +170 -0
  196. package/lib/cjs/input/index.js +499 -0
  197. package/lib/cjs/input/inputGroup.d.ts +38 -0
  198. package/lib/cjs/input/inputGroup.js +163 -0
  199. package/lib/cjs/input/textarea.d.ts +44 -0
  200. package/lib/cjs/input/textarea.js +337 -0
  201. package/lib/cjs/inputNumber/index.d.ts +109 -0
  202. package/lib/cjs/inputNumber/index.js +528 -0
  203. package/lib/cjs/layout/Sider.d.ts +38 -0
  204. package/lib/cjs/layout/Sider.js +160 -0
  205. package/lib/cjs/layout/index.d.ts +43 -0
  206. package/lib/cjs/layout/index.js +174 -0
  207. package/lib/cjs/layout/layout-context.d.ts +9 -0
  208. package/lib/cjs/layout/layout-context.js +25 -0
  209. package/lib/cjs/list/index.d.ts +59 -0
  210. package/lib/cjs/list/index.js +189 -0
  211. package/lib/cjs/list/item.d.ts +36 -0
  212. package/lib/cjs/list/item.js +151 -0
  213. package/lib/cjs/list/list-context.d.ts +12 -0
  214. package/lib/cjs/list/list-context.js +18 -0
  215. package/lib/cjs/locale/context.d.ts +4 -0
  216. package/lib/cjs/locale/context.js +18 -0
  217. package/lib/cjs/locale/interface.d.ts +151 -0
  218. package/lib/cjs/locale/interface.js +7 -0
  219. package/lib/cjs/locale/localeConsumer.d.ts +21 -0
  220. package/lib/cjs/locale/localeConsumer.js +80 -0
  221. package/lib/cjs/locale/localeProvider.d.ts +18 -0
  222. package/lib/cjs/locale/localeProvider.js +54 -0
  223. package/lib/cjs/locale/source/ar.d.ts +3 -0
  224. package/lib/cjs/locale/source/ar.js +165 -0
  225. package/lib/cjs/locale/source/en_GB.d.ts +3 -0
  226. package/lib/cjs/locale/source/en_GB.js +165 -0
  227. package/lib/cjs/locale/source/en_US.d.ts +3 -0
  228. package/lib/cjs/locale/source/en_US.js +165 -0
  229. package/lib/cjs/locale/source/id_ID.d.ts +3 -0
  230. package/lib/cjs/locale/source/id_ID.js +165 -0
  231. package/lib/cjs/locale/source/ja_JP.d.ts +3 -0
  232. package/lib/cjs/locale/source/ja_JP.js +166 -0
  233. package/lib/cjs/locale/source/ko_KR.d.ts +3 -0
  234. package/lib/cjs/locale/source/ko_KR.js +166 -0
  235. package/lib/cjs/locale/source/ms_MY.d.ts +3 -0
  236. package/lib/cjs/locale/source/ms_MY.js +165 -0
  237. package/lib/cjs/locale/source/pt_BR.d.ts +3 -0
  238. package/lib/cjs/locale/source/pt_BR.js +173 -0
  239. package/lib/cjs/locale/source/ru_RU.d.ts +3 -0
  240. package/lib/cjs/locale/source/ru_RU.js +168 -0
  241. package/lib/cjs/locale/source/th_TH.d.ts +3 -0
  242. package/lib/cjs/locale/source/th_TH.js +169 -0
  243. package/lib/cjs/locale/source/tr_TR.d.ts +3 -0
  244. package/lib/cjs/locale/source/tr_TR.js +168 -0
  245. package/lib/cjs/locale/source/vi_VN.d.ts +3 -0
  246. package/lib/cjs/locale/source/vi_VN.js +168 -0
  247. package/lib/cjs/locale/source/zh_CN.d.ts +3 -0
  248. package/lib/cjs/locale/source/zh_CN.js +166 -0
  249. package/lib/cjs/locale/source/zh_TW.d.ts +3 -0
  250. package/lib/cjs/locale/source/zh_TW.js +166 -0
  251. package/lib/cjs/modal/ConfirmModal.d.ts +4 -0
  252. package/lib/cjs/modal/ConfirmModal.js +137 -0
  253. package/lib/cjs/modal/Modal.d.ts +133 -0
  254. package/lib/cjs/modal/Modal.js +437 -0
  255. package/lib/cjs/modal/ModalContent.d.ts +38 -0
  256. package/lib/cjs/modal/ModalContent.js +337 -0
  257. package/lib/cjs/modal/confirm.d.ts +215 -0
  258. package/lib/cjs/modal/confirm.js +132 -0
  259. package/lib/cjs/modal/index.d.ts +8 -0
  260. package/lib/cjs/modal/index.js +18 -0
  261. package/lib/cjs/modal/useModal/HookModal.d.ts +13 -0
  262. package/lib/cjs/modal/useModal/HookModal.js +79 -0
  263. package/lib/cjs/modal/useModal/index.d.ts +24 -0
  264. package/lib/cjs/modal/useModal/index.js +80 -0
  265. package/lib/cjs/motions/Rotate.d.ts +23 -0
  266. package/lib/cjs/motions/Rotate.js +87 -0
  267. package/lib/cjs/navigation/CollapseButton.d.ts +10 -0
  268. package/lib/cjs/navigation/CollapseButton.js +58 -0
  269. package/lib/cjs/navigation/Footer.d.ts +27 -0
  270. package/lib/cjs/navigation/Footer.js +107 -0
  271. package/lib/cjs/navigation/Header.d.ts +34 -0
  272. package/lib/cjs/navigation/Header.js +99 -0
  273. package/lib/cjs/navigation/Item.d.ts +70 -0
  274. package/lib/cjs/navigation/Item.js +294 -0
  275. package/lib/cjs/navigation/OpenIconTransition.d.ts +14 -0
  276. package/lib/cjs/navigation/OpenIconTransition.js +90 -0
  277. package/lib/cjs/navigation/SubNav.d.ts +103 -0
  278. package/lib/cjs/navigation/SubNav.js +438 -0
  279. package/lib/cjs/navigation/SubNavTransition.d.ts +17 -0
  280. package/lib/cjs/navigation/SubNavTransition.js +90 -0
  281. package/lib/cjs/navigation/index.d.ts +145 -0
  282. package/lib/cjs/navigation/index.js +442 -0
  283. package/lib/cjs/navigation/nav-context.d.ts +7 -0
  284. package/lib/cjs/navigation/nav-context.js +22 -0
  285. package/lib/cjs/notification/NoticeTransition.d.ts +10 -0
  286. package/lib/cjs/notification/NoticeTransition.js +90 -0
  287. package/lib/cjs/notification/index.d.ts +52 -0
  288. package/lib/cjs/notification/index.js +316 -0
  289. package/lib/cjs/notification/notice.d.ts +51 -0
  290. package/lib/cjs/notification/notice.js +240 -0
  291. package/lib/cjs/notification/useNotification/HookNotice.d.ts +7 -0
  292. package/lib/cjs/notification/useNotification/HookNotice.js +72 -0
  293. package/lib/cjs/notification/useNotification/index.d.ts +10 -0
  294. package/lib/cjs/notification/useNotification/index.js +161 -0
  295. package/lib/cjs/overflowList/index.d.ts +87 -0
  296. package/lib/cjs/overflowList/index.js +290 -0
  297. package/lib/cjs/overflowList/intersectionObserver.d.ts +34 -0
  298. package/lib/cjs/overflowList/intersectionObserver.js +119 -0
  299. package/lib/cjs/pagination/index.d.ts +99 -0
  300. package/lib/cjs/pagination/index.js +481 -0
  301. package/lib/cjs/popconfirm/index.d.ts +86 -0
  302. package/lib/cjs/popconfirm/index.js +254 -0
  303. package/lib/cjs/popover/Arrow.d.ts +9 -0
  304. package/lib/cjs/popover/Arrow.js +86 -0
  305. package/lib/cjs/popover/index.d.ts +87 -0
  306. package/lib/cjs/popover/index.js +158 -0
  307. package/lib/cjs/progress/index.d.ts +68 -0
  308. package/lib/cjs/progress/index.js +303 -0
  309. package/lib/cjs/radio/context.d.ts +22 -0
  310. package/lib/cjs/radio/context.js +18 -0
  311. package/lib/cjs/radio/index.d.ts +10 -0
  312. package/lib/cjs/radio/index.js +29 -0
  313. package/lib/cjs/radio/radio.d.ts +79 -0
  314. package/lib/cjs/radio/radio.js +225 -0
  315. package/lib/cjs/radio/radioGroup.d.ts +64 -0
  316. package/lib/cjs/radio/radioGroup.js +189 -0
  317. package/lib/cjs/radio/radioInner.d.ts +45 -0
  318. package/lib/cjs/radio/radioInner.js +140 -0
  319. package/lib/cjs/rating/index.d.ts +91 -0
  320. package/lib/cjs/rating/index.js +312 -0
  321. package/lib/cjs/rating/item.d.ts +38 -0
  322. package/lib/cjs/rating/item.js +143 -0
  323. package/lib/cjs/resizeObserver/index.d.ts +35 -0
  324. package/lib/cjs/resizeObserver/index.js +117 -0
  325. package/lib/cjs/scrollList/index.d.ts +26 -0
  326. package/lib/cjs/scrollList/index.js +82 -0
  327. package/lib/cjs/scrollList/scrollItem.d.ts +104 -0
  328. package/lib/cjs/scrollList/scrollItem.js +551 -0
  329. package/lib/cjs/select/index.d.ts +234 -0
  330. package/lib/cjs/select/index.js +1102 -0
  331. package/lib/cjs/select/option.d.ts +50 -0
  332. package/lib/cjs/select/option.js +211 -0
  333. package/lib/cjs/select/optionGroup.d.ts +20 -0
  334. package/lib/cjs/select/optionGroup.js +56 -0
  335. package/lib/cjs/select/utils.d.ts +9 -0
  336. package/lib/cjs/select/utils.js +116 -0
  337. package/lib/cjs/select/virtualRow.d.ts +8 -0
  338. package/lib/cjs/select/virtualRow.js +25 -0
  339. package/lib/cjs/sideSheet/SideSheetContent.d.ts +35 -0
  340. package/lib/cjs/sideSheet/SideSheetContent.js +195 -0
  341. package/lib/cjs/sideSheet/SideSheetTransition.d.ts +12 -0
  342. package/lib/cjs/sideSheet/SideSheetTransition.js +120 -0
  343. package/lib/cjs/sideSheet/index.d.ts +59 -0
  344. package/lib/cjs/sideSheet/index.js +303 -0
  345. package/lib/cjs/skeleton/index.d.ts +33 -0
  346. package/lib/cjs/skeleton/index.js +101 -0
  347. package/lib/cjs/skeleton/item.d.ts +34 -0
  348. package/lib/cjs/skeleton/item.js +134 -0
  349. package/lib/cjs/slider/index.d.ts +30 -0
  350. package/lib/cjs/slider/index.js +647 -0
  351. package/lib/cjs/space/index.d.ts +33 -0
  352. package/lib/cjs/space/index.js +116 -0
  353. package/lib/cjs/space/utils.d.ts +5 -0
  354. package/lib/cjs/space/utils.js +54 -0
  355. package/lib/cjs/spin/icon.d.ts +10 -0
  356. package/lib/cjs/spin/icon.js +103 -0
  357. package/lib/cjs/spin/index.d.ts +63 -0
  358. package/lib/cjs/spin/index.js +145 -0
  359. package/lib/cjs/steps/basicStep.d.ts +46 -0
  360. package/lib/cjs/steps/basicStep.js +180 -0
  361. package/lib/cjs/steps/basicSteps.d.ts +41 -0
  362. package/lib/cjs/steps/basicSteps.js +127 -0
  363. package/lib/cjs/steps/context.d.ts +6 -0
  364. package/lib/cjs/steps/context.js +17 -0
  365. package/lib/cjs/steps/fillStep.d.ts +34 -0
  366. package/lib/cjs/steps/fillStep.js +142 -0
  367. package/lib/cjs/steps/fillSteps.d.ts +35 -0
  368. package/lib/cjs/steps/fillSteps.js +127 -0
  369. package/lib/cjs/steps/index.d.ts +39 -0
  370. package/lib/cjs/steps/index.js +104 -0
  371. package/lib/cjs/steps/navStep.d.ts +30 -0
  372. package/lib/cjs/steps/navStep.js +99 -0
  373. package/lib/cjs/steps/navSteps.d.ts +33 -0
  374. package/lib/cjs/steps/navSteps.js +103 -0
  375. package/lib/cjs/steps/step.d.ts +13 -0
  376. package/lib/cjs/steps/step.js +58 -0
  377. package/lib/cjs/switch/index.d.ts +48 -0
  378. package/lib/cjs/switch/index.js +159 -0
  379. package/lib/cjs/table/Body/BaseRow.d.ts +125 -0
  380. package/lib/cjs/table/Body/BaseRow.js +347 -0
  381. package/lib/cjs/table/Body/ExpandedRow.d.ts +63 -0
  382. package/lib/cjs/table/Body/ExpandedRow.js +176 -0
  383. package/lib/cjs/table/Body/SectionRow.d.ts +67 -0
  384. package/lib/cjs/table/Body/SectionRow.js +248 -0
  385. package/lib/cjs/table/Body/index.d.ts +70 -0
  386. package/lib/cjs/table/Body/index.js +861 -0
  387. package/lib/cjs/table/ColGroup.d.ts +24 -0
  388. package/lib/cjs/table/ColGroup.js +78 -0
  389. package/lib/cjs/table/Column.d.ts +36 -0
  390. package/lib/cjs/table/Column.js +32 -0
  391. package/lib/cjs/table/ColumnFilter.d.ts +34 -0
  392. package/lib/cjs/table/ColumnFilter.js +192 -0
  393. package/lib/cjs/table/ColumnSelection.d.ts +40 -0
  394. package/lib/cjs/table/ColumnSelection.js +101 -0
  395. package/lib/cjs/table/ColumnShape.d.ts +32 -0
  396. package/lib/cjs/table/ColumnShape.js +47 -0
  397. package/lib/cjs/table/ColumnSorter.d.ts +25 -0
  398. package/lib/cjs/table/ColumnSorter.js +77 -0
  399. package/lib/cjs/table/CustomExpandIcon.d.ts +36 -0
  400. package/lib/cjs/table/CustomExpandIcon.js +102 -0
  401. package/lib/cjs/table/HeadTable.d.ts +20 -0
  402. package/lib/cjs/table/HeadTable.js +127 -0
  403. package/lib/cjs/table/ResizableHeaderCell.d.ts +13 -0
  404. package/lib/cjs/table/ResizableHeaderCell.js +75 -0
  405. package/lib/cjs/table/ResizableTable.d.ts +5 -0
  406. package/lib/cjs/table/ResizableTable.js +213 -0
  407. package/lib/cjs/table/Table.d.ts +305 -0
  408. package/lib/cjs/table/Table.js +1558 -0
  409. package/lib/cjs/table/TableCell.d.ts +124 -0
  410. package/lib/cjs/table/TableCell.js +394 -0
  411. package/lib/cjs/table/TableContextProvider.d.ts +3 -0
  412. package/lib/cjs/table/TableContextProvider.js +61 -0
  413. package/lib/cjs/table/TableHeader.d.ts +28 -0
  414. package/lib/cjs/table/TableHeader.js +190 -0
  415. package/lib/cjs/table/TableHeaderRow.d.ts +59 -0
  416. package/lib/cjs/table/TableHeaderRow.js +212 -0
  417. package/lib/cjs/table/TablePagination.d.ts +23 -0
  418. package/lib/cjs/table/TablePagination.js +67 -0
  419. package/lib/cjs/table/getColumns.d.ts +8 -0
  420. package/lib/cjs/table/getColumns.js +52 -0
  421. package/lib/cjs/table/index.d.ts +100 -0
  422. package/lib/cjs/table/index.js +85 -0
  423. package/lib/cjs/table/interface.d.ts +290 -0
  424. package/lib/cjs/table/interface.js +7 -0
  425. package/lib/cjs/table/table-context.d.ts +19 -0
  426. package/lib/cjs/table/table-context.js +25 -0
  427. package/lib/cjs/table/utils.d.ts +42 -0
  428. package/lib/cjs/table/utils.js +144 -0
  429. package/lib/cjs/tabs/TabBar.d.ts +41 -0
  430. package/lib/cjs/tabs/TabBar.js +309 -0
  431. package/lib/cjs/tabs/TabPane.d.ts +27 -0
  432. package/lib/cjs/tabs/TabPane.js +164 -0
  433. package/lib/cjs/tabs/TabPaneTransition.d.ts +4 -0
  434. package/lib/cjs/tabs/TabPaneTransition.js +119 -0
  435. package/lib/cjs/tabs/index.d.ts +50 -0
  436. package/lib/cjs/tabs/index.js +365 -0
  437. package/lib/cjs/tabs/interface.d.ts +72 -0
  438. package/lib/cjs/tabs/interface.js +7 -0
  439. package/lib/cjs/tabs/tabs-context.d.ts +4 -0
  440. package/lib/cjs/tabs/tabs-context.js +18 -0
  441. package/lib/cjs/tag/group.d.ts +40 -0
  442. package/lib/cjs/tag/group.js +165 -0
  443. package/lib/cjs/tag/index.d.ts +33 -0
  444. package/lib/cjs/tag/index.js +219 -0
  445. package/lib/cjs/tag/interface.d.ts +30 -0
  446. package/lib/cjs/tag/interface.js +7 -0
  447. package/lib/cjs/tagInput/index.d.ts +130 -0
  448. package/lib/cjs/tagInput/index.js +414 -0
  449. package/lib/cjs/timePicker/Combobox.d.ts +73 -0
  450. package/lib/cjs/timePicker/Combobox.js +344 -0
  451. package/lib/cjs/timePicker/PanelShape.d.ts +6 -0
  452. package/lib/cjs/timePicker/PanelShape.js +21 -0
  453. package/lib/cjs/timePicker/TimeInput.d.ts +66 -0
  454. package/lib/cjs/timePicker/TimeInput.js +226 -0
  455. package/lib/cjs/timePicker/TimePicker.d.ts +197 -0
  456. package/lib/cjs/timePicker/TimePicker.js +501 -0
  457. package/lib/cjs/timePicker/TimeShape.d.ts +10 -0
  458. package/lib/cjs/timePicker/TimeShape.js +26 -0
  459. package/lib/cjs/timePicker/index.d.ts +95 -0
  460. package/lib/cjs/timePicker/index.js +51 -0
  461. package/lib/cjs/timeline/index.d.ts +31 -0
  462. package/lib/cjs/timeline/index.js +145 -0
  463. package/lib/cjs/timeline/item.d.ts +30 -0
  464. package/lib/cjs/timeline/item.js +94 -0
  465. package/lib/cjs/toast/ToastTransition.d.ts +7 -0
  466. package/lib/cjs/toast/ToastTransition.js +71 -0
  467. package/lib/cjs/toast/index.d.ts +200 -0
  468. package/lib/cjs/toast/index.js +281 -0
  469. package/lib/cjs/toast/toast.d.ts +45 -0
  470. package/lib/cjs/toast/toast.js +185 -0
  471. package/lib/cjs/toast/useToast/HookToast.d.ts +7 -0
  472. package/lib/cjs/toast/useToast/HookToast.js +72 -0
  473. package/lib/cjs/toast/useToast/index.d.ts +9 -0
  474. package/lib/cjs/toast/useToast/index.js +107 -0
  475. package/lib/cjs/tooltip/ArrowBoundingShape.d.ts +8 -0
  476. package/lib/cjs/tooltip/ArrowBoundingShape.js +22 -0
  477. package/lib/cjs/tooltip/TooltipStyledTransition.d.ts +9 -0
  478. package/lib/cjs/tooltip/TooltipStyledTransition.js +54 -0
  479. package/lib/cjs/tooltip/TriangleArrow.d.ts +5 -0
  480. package/lib/cjs/tooltip/TriangleArrow.js +54 -0
  481. package/lib/cjs/tooltip/TriangleArrowVertical.d.ts +5 -0
  482. package/lib/cjs/tooltip/TriangleArrowVertical.js +53 -0
  483. package/lib/cjs/tooltip/index.d.ts +147 -0
  484. package/lib/cjs/tooltip/index.js +698 -0
  485. package/lib/cjs/transfer/index.d.ts +164 -0
  486. package/lib/cjs/transfer/index.js +660 -0
  487. package/lib/cjs/tree/autoSizer.d.ts +28 -0
  488. package/lib/cjs/tree/autoSizer.js +115 -0
  489. package/lib/cjs/tree/collapse.d.ts +29 -0
  490. package/lib/cjs/tree/collapse.js +164 -0
  491. package/lib/cjs/tree/index.d.ts +135 -0
  492. package/lib/cjs/tree/index.js +793 -0
  493. package/lib/cjs/tree/interface.d.ts +119 -0
  494. package/lib/cjs/tree/interface.js +7 -0
  495. package/lib/cjs/tree/nodeList.d.ts +9 -0
  496. package/lib/cjs/tree/nodeList.js +141 -0
  497. package/lib/cjs/tree/treeContext.d.ts +40 -0
  498. package/lib/cjs/tree/treeContext.js +18 -0
  499. package/lib/cjs/tree/treeNode.d.ts +54 -0
  500. package/lib/cjs/tree/treeNode.js +527 -0
  501. package/lib/cjs/tree/treeUtil.d.ts +1 -0
  502. package/lib/cjs/tree/treeUtil.js +28 -0
  503. package/lib/cjs/treeSelect/index.d.ts +232 -0
  504. package/lib/cjs/treeSelect/index.js +1274 -0
  505. package/lib/cjs/trigger/index.d.ts +36 -0
  506. package/lib/cjs/trigger/index.js +71 -0
  507. package/lib/cjs/typography/base.d.ts +176 -0
  508. package/lib/cjs/typography/base.js +714 -0
  509. package/lib/cjs/typography/copyable.d.ts +43 -0
  510. package/lib/cjs/typography/copyable.js +151 -0
  511. package/lib/cjs/typography/index.d.ts +17 -0
  512. package/lib/cjs/typography/index.js +48 -0
  513. package/lib/cjs/typography/interface.d.ts +25 -0
  514. package/lib/cjs/typography/interface.js +7 -0
  515. package/lib/cjs/typography/paragraph.d.ts +56 -0
  516. package/lib/cjs/typography/paragraph.js +83 -0
  517. package/lib/cjs/typography/text.d.ts +59 -0
  518. package/lib/cjs/typography/text.js +73 -0
  519. package/lib/cjs/typography/title.d.ts +61 -0
  520. package/lib/cjs/typography/title.js +97 -0
  521. package/lib/cjs/typography/typography.d.ts +22 -0
  522. package/lib/cjs/typography/typography.js +82 -0
  523. package/lib/cjs/typography/util.d.ts +2 -0
  524. package/lib/cjs/typography/util.js +155 -0
  525. package/lib/cjs/upload/fileCard.d.ts +62 -0
  526. package/lib/cjs/upload/fileCard.js +388 -0
  527. package/lib/cjs/upload/index.d.ts +214 -0
  528. package/lib/cjs/upload/index.js +552 -0
  529. package/lib/es/button/index.d.ts +1 -0
  530. package/lib/es/button/index.js +2 -1
  531. package/lib/es/cascader/index.d.ts +0 -1
  532. package/lib/es/datePicker/index.d.ts +1 -1
  533. package/lib/es/datePicker/yearAndMonth.js +1 -1
  534. package/lib/es/form/baseForm.d.ts +1 -1
  535. package/lib/es/form/field.d.ts +1 -1
  536. package/lib/es/iconButton/index.d.ts +1 -0
  537. package/lib/es/iconButton/index.js +1 -0
  538. package/lib/es/popconfirm/index.d.ts +1 -5
  539. package/lib/es/popconfirm/index.js +4 -10
  540. package/lib/es/popover/index.d.ts +1 -3
  541. package/lib/es/popover/index.js +8 -4
  542. package/lib/es/radio/context.d.ts +1 -1
  543. package/lib/es/radio/radio.d.ts +2 -2
  544. package/lib/es/radio/radioGroup.d.ts +4 -4
  545. package/lib/es/table/Table.d.ts +1 -1
  546. package/lib/es/table/index.d.ts +1 -1
  547. package/lib/es/table/interface.d.ts +2 -1
  548. package/lib/es/tabs/TabBar.d.ts +2 -4
  549. package/lib/es/tabs/TabBar.js +4 -12
  550. package/lib/es/tabs/TabPane.d.ts +1 -2
  551. package/lib/es/tabs/TabPane.js +2 -3
  552. package/lib/es/tabs/index.d.ts +2 -4
  553. package/lib/es/tabs/index.js +14 -83
  554. package/lib/es/tabs/interface.d.ts +1 -6
  555. package/lib/es/tagInput/index.d.ts +0 -3
  556. package/lib/es/tagInput/index.js +1 -6
  557. package/lib/es/tooltip/index.d.ts +0 -3
  558. package/lib/es/tooltip/index.js +0 -3
  559. package/lib/es/treeSelect/index.d.ts +11 -2
  560. package/lib/es/typography/title.d.ts +1 -1
  561. package/package.json +10 -10
@@ -0,0 +1,1102 @@
1
+ "use strict";
2
+
3
+ var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
4
+
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+
7
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
8
+
9
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
10
+
11
+ _Object$defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+
15
+ exports.default = void 0;
16
+
17
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
18
+
19
+ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
20
+
21
+ var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind"));
22
+
23
+ var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
24
+
25
+ var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
26
+
27
+ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
28
+
29
+ var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
30
+
31
+ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
32
+
33
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
34
+
35
+ var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
36
+
37
+ var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
38
+
39
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
40
+
41
+ var _react = _interopRequireWildcard(require("react"));
42
+
43
+ var _reactDom = _interopRequireDefault(require("react-dom"));
44
+
45
+ var _classnames = _interopRequireDefault(require("classnames"));
46
+
47
+ var _propTypes = _interopRequireDefault(require("prop-types"));
48
+
49
+ var _context12 = _interopRequireDefault(require("../configProvider/context"));
50
+
51
+ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/select/foundation"));
52
+
53
+ var _constants = require("@douyinfe/semi-foundation/lib/cjs/select/constants");
54
+
55
+ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
56
+
57
+ var _lodashEs = require("lodash-es");
58
+
59
+ var _index = _interopRequireDefault(require("../tag/index"));
60
+
61
+ var _group = _interopRequireDefault(require("../tag/group"));
62
+
63
+ var _localeConsumer = _interopRequireDefault(require("../locale/localeConsumer"));
64
+
65
+ var _index2 = _interopRequireDefault(require("../popover/index"));
66
+
67
+ var _constants2 = require("@douyinfe/semi-foundation/lib/cjs/popover/constants");
68
+
69
+ var _reactWindow = require("react-window");
70
+
71
+ var _utils = require("./utils");
72
+
73
+ var _virtualRow = _interopRequireDefault(require("./virtualRow"));
74
+
75
+ var _index3 = _interopRequireDefault(require("../input/index"));
76
+
77
+ var _option = _interopRequireDefault(require("./option"));
78
+
79
+ var _optionGroup = _interopRequireDefault(require("./optionGroup"));
80
+
81
+ var _spin = _interopRequireDefault(require("../spin"));
82
+
83
+ var _trigger = _interopRequireDefault(require("../trigger"));
84
+
85
+ var _semiIcons = require("@douyinfe/semi-icons");
86
+
87
+ var _utils2 = require("../_utils");
88
+
89
+ var _warning = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/warning"));
90
+
91
+ require("@douyinfe/semi-foundation/lib/cjs/select/select.css");
92
+
93
+ 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); }
94
+
95
+ 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; }
96
+
97
+ /* eslint-disable max-len */
98
+
99
+ /* eslint-disable max-lines-per-function */
100
+ const prefixcls = _constants.cssClasses.PREFIX;
101
+ const key = 0; // Notes: Use the label of the option as the identifier, that is, the option in Select, the value is allowed to be the same, but the label must be unique
102
+
103
+ class Select extends _baseComponent.default {
104
+ constructor(props) {
105
+ var _context, _context2, _context3, _context4, _context5, _context6;
106
+
107
+ super(props);
108
+
109
+ this.handleInputChange = value => this.foundation.handleInputChange(value);
110
+
111
+ this.state = {
112
+ isOpen: false,
113
+ isFocus: false,
114
+ options: [],
115
+ selections: new _map.default(),
116
+ dropdownMinWidth: null,
117
+ optionKey: key,
118
+ inputValue: '',
119
+ showInput: false,
120
+ focusIndex: props.defaultActiveFirstOption ? 0 : -1,
121
+ keyboardEventSet: {},
122
+ optionGroups: [],
123
+ isHovering: false
124
+ };
125
+ /* Generate random string */
126
+
127
+ this.selectOptionListID = (0, _slice.default)(_context = Math.random().toString(36)).call(_context, 2);
128
+ this.virtualizeListRef = /*#__PURE__*/_react.default.createRef();
129
+ this.inputRef = /*#__PURE__*/_react.default.createRef();
130
+ this.triggerRef = /*#__PURE__*/_react.default.createRef();
131
+ this.optionsRef = /*#__PURE__*/_react.default.createRef();
132
+ this.clickOutsideHandler = null;
133
+ this.onSelect = (0, _bind.default)(_context2 = this.onSelect).call(_context2, this);
134
+ this.onClear = (0, _bind.default)(_context3 = this.onClear).call(_context3, this);
135
+ this.onMouseEnter = (0, _bind.default)(_context4 = this.onMouseEnter).call(_context4, this);
136
+ this.onMouseLeave = (0, _bind.default)(_context5 = this.onMouseLeave).call(_context5, this);
137
+ this.renderOption = (0, _bind.default)(_context6 = this.renderOption).call(_context6, this);
138
+ this.foundation = new _foundation.default(this.adapter);
139
+ (0, _warning.default)('optionLabelProp' in this.props, '[Semi Select] \'optionLabelProp\' has already been deprecated, please use \'renderSelectedItem\' instead.');
140
+ (0, _warning.default)('labelInValue' in this.props, '[Semi Select] \'labelInValue\' has already been deprecated, please use \'onChangeWithObject\' instead.');
141
+ }
142
+
143
+ get adapter() {
144
+ var _this = this;
145
+
146
+ const keyboardAdapter = {
147
+ registerKeyDown: cb => {
148
+ const keyboardEventSet = {
149
+ onKeyDown: cb
150
+ };
151
+ this.setState({
152
+ keyboardEventSet
153
+ });
154
+ },
155
+ unregisterKeyDown: () => {
156
+ this.setState({
157
+ keyboardEventSet: {}
158
+ });
159
+ },
160
+ updateFocusIndex: focusIndex => {
161
+ this.setState({
162
+ focusIndex
163
+ });
164
+ },
165
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
166
+ scrollToFocusOption: () => {}
167
+ };
168
+ const filterAdapter = {
169
+ updateInputValue: value => {
170
+ this.setState({
171
+ inputValue: value
172
+ });
173
+ },
174
+ toggleInputShow: (showInput, cb) => {
175
+ this.setState({
176
+ showInput
177
+ }, () => {
178
+ cb();
179
+ });
180
+ },
181
+ focusInput: () => {
182
+ if (this.inputRef && this.inputRef.current) {
183
+ this.inputRef.current.focus();
184
+ }
185
+ }
186
+ };
187
+ const multipleAdapter = {
188
+ notifyMaxLimit: option => this.props.onExceed(option),
189
+ getMaxLimit: () => this.props.max,
190
+ registerClickOutsideHandler: cb => {
191
+ const clickOutsideHandler = e => {
192
+ const optionInstance = this.optionsRef && this.optionsRef.current;
193
+ const triggerDom = this.triggerRef && this.triggerRef.current; // eslint-disable-next-line react/no-find-dom-node
194
+
195
+ const optionsDom = _reactDom.default.findDOMNode(optionInstance); // let isInPanel = optionsDom && optionsDom.contains(e.target);
196
+ // let isInTrigger = triggerDom && triggerDom.contains(e.target);
197
+
198
+
199
+ if (optionsDom && !optionsDom.contains(e.target) && triggerDom && !triggerDom.contains(e.target)) {
200
+ cb(e);
201
+ }
202
+ };
203
+
204
+ this.clickOutsideHandler = clickOutsideHandler;
205
+ document.addEventListener('mousedown', clickOutsideHandler, false);
206
+ },
207
+ unregisterClickOutsideHandler: () => {
208
+ if (this.clickOutsideHandler) {
209
+ document.removeEventListener('mousedown', this.clickOutsideHandler, false);
210
+ this.clickOutsideHandler = null;
211
+ }
212
+ },
213
+ rePositionDropdown: () => {
214
+ let {
215
+ optionKey
216
+ } = this.state;
217
+ optionKey = optionKey + 1;
218
+ this.setState({
219
+ optionKey
220
+ });
221
+ },
222
+ notifyDeselect: (value, option) => {
223
+ delete option._parentGroup;
224
+ this.props.onDeselect(value, option);
225
+ }
226
+ };
227
+ return (0, _assign.default)((0, _assign.default)((0, _assign.default)((0, _assign.default)((0, _assign.default)({}, super.adapter), keyboardAdapter), filterAdapter), multipleAdapter), {
228
+ // Collect all subitems, each item is visible by default when collected, and is not selected
229
+ getOptionsFromChildren: function () {
230
+ let children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props.children;
231
+ let optionGroups = [];
232
+ let options = [];
233
+ const {
234
+ optionList
235
+ } = _this.props;
236
+
237
+ if (optionList && optionList.length) {
238
+ options = (0, _map2.default)(optionList).call(optionList, itemOpt => (0, _assign.default)({
239
+ _show: true,
240
+ _selected: false
241
+ }, itemOpt));
242
+ optionGroups[0] = {
243
+ children: options,
244
+ label: ''
245
+ };
246
+ } else {
247
+ const result = (0, _utils.getOptionsFromGroup)(children);
248
+ optionGroups = result.optionGroups;
249
+ options = result.options;
250
+ }
251
+
252
+ _this.setState({
253
+ optionGroups
254
+ });
255
+
256
+ return options;
257
+ },
258
+ updateOptions: options => {
259
+ this.setState({
260
+ options
261
+ });
262
+ },
263
+ openMenu: () => {
264
+ this.setState({
265
+ isOpen: true
266
+ });
267
+ },
268
+ closeMenu: () => {
269
+ this.setState({
270
+ isOpen: false
271
+ });
272
+ },
273
+ getTriggerWidth: () => {
274
+ const el = this.triggerRef.current;
275
+ return el && el.getBoundingClientRect().width;
276
+ },
277
+ setOptionWrapperWidth: width => {
278
+ this.setState({
279
+ dropdownMinWidth: width
280
+ });
281
+ },
282
+ updateSelection: selections => {
283
+ this.setState({
284
+ selections
285
+ });
286
+ },
287
+ // clone Map, important!!!, prevent unexpected modify on state
288
+ getSelections: () => new _map.default(this.state.selections),
289
+ notifyChange: value => {
290
+ this.props.onChange(value);
291
+ },
292
+ notifySelect: (value, option) => {
293
+ delete option._parentGroup;
294
+ this.props.onSelect(value, option);
295
+ },
296
+ notifyDropdownVisibleChange: visible => {
297
+ this.props.onDropdownVisibleChange(visible);
298
+ },
299
+ notifySearch: input => {
300
+ this.props.onSearch(input);
301
+ },
302
+ notifyCreate: input => {
303
+ this.props.onCreate(input);
304
+ },
305
+ notifyMouseEnter: e => {
306
+ this.props.onMouseEnter(e);
307
+ },
308
+ notifyMouseLeave: e => {
309
+ this.props.onMouseLeave(e);
310
+ },
311
+ notifyFocus: event => {
312
+ this.props.onFocus(event);
313
+ },
314
+ notifyBlur: event => {
315
+ this.props.onBlur(event);
316
+ },
317
+ notifyClear: () => {
318
+ this.props.onClear();
319
+ },
320
+ notifyListScroll: e => {
321
+ this.props.onListScroll(e);
322
+ },
323
+ updateHovering: isHovering => {
324
+ this.setState({
325
+ isHovering
326
+ });
327
+ },
328
+ updateFocusState: isFocus => {
329
+ this.setState({
330
+ isFocus
331
+ });
332
+ },
333
+ focusTrigger: () => {
334
+ try {
335
+ const el = this.triggerRef.current;
336
+ el.focus();
337
+ } catch (error) {}
338
+ },
339
+ updateScrollTop: () => {
340
+ var _context7, _context8;
341
+
342
+ // eslint-disable-next-line max-len
343
+ let destNode = document.querySelector((0, _concat.default)(_context7 = (0, _concat.default)(_context8 = "#".concat(prefixcls, "-")).call(_context8, this.selectOptionListID, " .")).call(_context7, prefixcls, "-option-selected"));
344
+
345
+ if ((0, _isArray.default)(destNode)) {
346
+ // eslint-disable-next-line prefer-destructuring
347
+ destNode = destNode[0];
348
+ }
349
+
350
+ if (destNode) {
351
+ /**
352
+ * Scroll the first selected item into view.
353
+ * The reason why ScrollIntoView is not used here is that it may cause page to move.
354
+ */
355
+ const destParent = destNode.parentNode;
356
+ destParent.scrollTop = destNode.offsetTop - destParent.offsetTop - destParent.clientHeight / 2 + destNode.clientHeight / 2;
357
+ }
358
+ }
359
+ });
360
+ }
361
+
362
+ componentDidMount() {
363
+ this.foundation.init();
364
+ }
365
+
366
+ componentWillUnmount() {
367
+ this.foundation.destroy();
368
+ }
369
+
370
+ componentDidUpdate(prevProps, prevState) {
371
+ var _context9, _context10;
372
+
373
+ const prevChildrenKeys = (0, _map2.default)(_context9 = _react.default.Children.toArray(prevProps.children)).call(_context9, child => child.key);
374
+ const nowChildrenKeys = (0, _map2.default)(_context10 = _react.default.Children.toArray(this.props.children)).call(_context10, child => child.key);
375
+ let isOptionsChanged = false;
376
+
377
+ if (!(0, _lodashEs.isEqual)(prevChildrenKeys, nowChildrenKeys) || !(0, _lodashEs.isEqual)(prevProps.optionList, this.props.optionList)) {
378
+ isOptionsChanged = true;
379
+ this.foundation.handleOptionListChange();
380
+ } // Add isOptionChanged: There may be cases where the value is unchanged, but the optionList is updated. At this time, the label corresponding to the value may change, and the selected item needs to be updated
381
+
382
+
383
+ if (prevProps.value !== this.props.value || isOptionsChanged) {
384
+ if ('value' in this.props) {
385
+ this.foundation.handleValueChange(this.props.value);
386
+ } else {
387
+ this.foundation.handleOptionListChangeHadDefaultValue();
388
+ }
389
+ }
390
+ }
391
+
392
+ renderInput() {
393
+ const {
394
+ size,
395
+ multiple,
396
+ disabled
397
+ } = this.props;
398
+ const inputcls = (0, _classnames.default)("".concat(prefixcls, "-input"), {
399
+ ["".concat(prefixcls, "-input-single")]: !multiple,
400
+ ["".concat(prefixcls, "-input-multiple")]: multiple
401
+ });
402
+ const {
403
+ inputValue
404
+ } = this.state;
405
+ const inputProps = {
406
+ value: inputValue,
407
+ disabled,
408
+ className: inputcls,
409
+ onChange: this.handleInputChange
410
+ };
411
+ let style = {}; // Multiple choice mode
412
+
413
+ if (multiple) {
414
+ style = {
415
+ width: inputValue ? "".concat(inputValue.length * 16, "px") : '2px'
416
+ };
417
+ inputProps.style = style;
418
+ }
419
+
420
+ return /*#__PURE__*/_react.default.createElement(_index3.default, (0, _assign.default)({
421
+ ref: this.inputRef,
422
+ size: size
423
+ }, inputProps, {
424
+ onFocus: e => {
425
+ // prevent event bubbling which will fire trigger onFocus event
426
+ e.stopPropagation(); // e.nativeEvent.stopImmediatePropagation();
427
+ }
428
+ }));
429
+ }
430
+
431
+ close() {
432
+ this.foundation.close();
433
+ }
434
+
435
+ open() {
436
+ this.foundation.open();
437
+ }
438
+
439
+ clearInput() {
440
+ this.foundation.clearInput();
441
+ }
442
+
443
+ selectAll() {
444
+ this.foundation.selectAll();
445
+ }
446
+
447
+ deselectAll() {
448
+ this.foundation.clearSelected();
449
+ }
450
+
451
+ focus() {
452
+ this.foundation.focus();
453
+ }
454
+
455
+ onSelect(option, optionIndex, e) {
456
+ this.foundation.onSelect(option, optionIndex, e);
457
+ }
458
+
459
+ onClear(e) {
460
+ e.nativeEvent.stopImmediatePropagation();
461
+ this.foundation.handleClearClick(e);
462
+ }
463
+
464
+ renderEmpty() {
465
+ return /*#__PURE__*/_react.default.createElement(_option.default, {
466
+ empty: true,
467
+ emptyContent: this.props.emptyContent
468
+ });
469
+ }
470
+
471
+ renderLoading() {
472
+ const loadingWrapperCls = "".concat(prefixcls, "-loading-wrapper");
473
+ return /*#__PURE__*/_react.default.createElement("div", {
474
+ className: loadingWrapperCls
475
+ }, /*#__PURE__*/_react.default.createElement(_spin.default, null));
476
+ }
477
+
478
+ renderOption(option, optionIndex, style) {
479
+ const {
480
+ focusIndex,
481
+ inputValue
482
+ } = this.state;
483
+ const {
484
+ renderOptionItem
485
+ } = this.props;
486
+ let optionContent;
487
+ const isFocused = optionIndex === focusIndex;
488
+ let optionStyle = style || {};
489
+
490
+ if (option.style) {
491
+ optionStyle = (0, _assign.default)((0, _assign.default)({}, optionStyle), option.style);
492
+ }
493
+
494
+ if (option._inputCreateOnly) {
495
+ optionContent = this.renderCreateOption(option, isFocused, optionIndex, style);
496
+ } else {
497
+ // use another name to make sure that 'key' in optionList still exist when we call onChange
498
+ if ('key' in option) {
499
+ option._keyInOptionList = option.key;
500
+ }
501
+
502
+ optionContent = /*#__PURE__*/_react.default.createElement(_option.default, (0, _assign.default)({
503
+ showTick: true
504
+ }, option, {
505
+ selected: option._selected,
506
+ onSelect: (v, e) => this.onSelect(v, optionIndex, e),
507
+ focused: isFocused,
508
+ onMouseEnter: () => this.onOptionHover(optionIndex),
509
+ style: optionStyle,
510
+ key: option.key || option.label + option.value + optionIndex,
511
+ renderOptionItem: renderOptionItem,
512
+ inputValue: inputValue
513
+ }), option.label);
514
+ }
515
+
516
+ return optionContent;
517
+ }
518
+
519
+ renderCreateOption(option, isFocused, optionIndex, style) {
520
+ const {
521
+ renderCreateItem
522
+ } = this.props; // default render method
523
+
524
+ if (typeof renderCreateItem === 'undefined') {
525
+ const defaultCreateItem = /*#__PURE__*/_react.default.createElement(_option.default, (0, _assign.default)({
526
+ key: option.key || option.label + option.value,
527
+ onSelect: (v, e) => this.onSelect(v, optionIndex, e),
528
+ onMouseEnter: () => this.onOptionHover(optionIndex),
529
+ showTick: true
530
+ }, option, {
531
+ focused: isFocused,
532
+ style: style
533
+ }), /*#__PURE__*/_react.default.createElement(_localeConsumer.default, {
534
+ componentName: "Select"
535
+ }, locale => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
536
+ className: "".concat(prefixcls, "-create-tips")
537
+ }, locale.createText), option.value)));
538
+
539
+ return defaultCreateItem;
540
+ }
541
+
542
+ const customCreateItem = renderCreateItem(option.value, isFocused);
543
+ return /*#__PURE__*/_react.default.createElement("div", {
544
+ onClick: e => this.onSelect(option, optionIndex, e),
545
+ key: new Date().valueOf()
546
+ }, customCreateItem);
547
+ }
548
+
549
+ onOptionHover(optionIndex) {
550
+ this.foundation.handleOptionMouseEnter(optionIndex);
551
+ }
552
+
553
+ renderWithGroup(visibileOptions) {
554
+ const content = [];
555
+ const groupStatus = new _map.default();
556
+ (0, _forEach.default)(visibileOptions).call(visibileOptions, (option, optionIndex) => {
557
+ const parentGroup = option._parentGroup;
558
+ const optionContent = this.renderOption(option, optionIndex);
559
+
560
+ if (parentGroup && groupStatus.has(parentGroup.label)) {
561
+ // group content already insert
562
+ content.push(optionContent);
563
+ } else if (parentGroup) {
564
+ const groupContent = /*#__PURE__*/_react.default.createElement(_optionGroup.default, (0, _assign.default)({}, parentGroup, {
565
+ key: parentGroup.label
566
+ }));
567
+
568
+ groupStatus.set(parentGroup.label, true);
569
+ content.push(groupContent);
570
+ content.push(optionContent);
571
+ } else {
572
+ // when not use with OptionGroup
573
+ content.push(optionContent);
574
+ }
575
+ });
576
+ return content;
577
+ }
578
+
579
+ renderVirtualizeList(visibileOptions) {
580
+ const {
581
+ virtualize
582
+ } = this.props;
583
+ const {
584
+ direction
585
+ } = this.context;
586
+ const {
587
+ height,
588
+ width,
589
+ itemSize
590
+ } = virtualize;
591
+ return /*#__PURE__*/_react.default.createElement(_reactWindow.FixedSizeList, {
592
+ ref: this.virtualizeListRef,
593
+ height: height || _constants.numbers.LIST_HEIGHT,
594
+ itemCount: visibileOptions.length,
595
+ itemSize: itemSize,
596
+ itemData: {
597
+ visibileOptions,
598
+ renderOption: this.renderOption
599
+ },
600
+ width: width || '100%',
601
+ style: {
602
+ direction
603
+ }
604
+ }, _virtualRow.default);
605
+ }
606
+
607
+ renderOptions(children) {
608
+ var _context11;
609
+
610
+ const {
611
+ dropdownMinWidth,
612
+ options,
613
+ selections
614
+ } = this.state;
615
+ const {
616
+ maxHeight,
617
+ dropdownClassName,
618
+ dropdownStyle,
619
+ outerTopSlot,
620
+ innerTopSlot,
621
+ outerBottomSlot,
622
+ innerBottomSlot,
623
+ loading,
624
+ virtualize
625
+ } = this.props; // Do a filter first, instead of directly judging in forEach, so that the focusIndex can correspond to
626
+
627
+ const visibileOptions = (0, _filter.default)(options).call(options, item => item._show);
628
+ let listContent = this.renderWithGroup(visibileOptions);
629
+
630
+ if (virtualize) {
631
+ listContent = this.renderVirtualizeList(visibileOptions);
632
+ }
633
+
634
+ const style = (0, _assign.default)({
635
+ minWidth: dropdownMinWidth
636
+ }, dropdownStyle);
637
+ const optionListCls = (0, _classnames.default)({
638
+ ["".concat(prefixcls, "-option-list")]: true,
639
+ ["".concat(prefixcls, "-option-list-chosen")]: selections.size
640
+ });
641
+ const isEmpty = !options.length || !(0, _some.default)(options).call(options, item => item._show);
642
+ return /*#__PURE__*/_react.default.createElement("div", {
643
+ id: (0, _concat.default)(_context11 = "".concat(prefixcls, "-")).call(_context11, this.selectOptionListID),
644
+ className: dropdownClassName,
645
+ style: style
646
+ }, outerTopSlot, /*#__PURE__*/_react.default.createElement("div", {
647
+ style: {
648
+ maxHeight: "".concat(maxHeight, "px")
649
+ },
650
+ className: optionListCls,
651
+ role: "listbox",
652
+ onScroll: e => this.foundation.handleListScroll(e)
653
+ }, innerTopSlot, !loading ? listContent : this.renderLoading(), isEmpty && !loading ? this.renderEmpty() : null, innerBottomSlot), outerBottomSlot);
654
+ }
655
+
656
+ renderSingleSelection(selections, filterable) {
657
+ let {
658
+ renderSelectedItem
659
+ } = this.props;
660
+ const {
661
+ placeholder
662
+ } = this.props;
663
+ const {
664
+ showInput,
665
+ inputValue
666
+ } = this.state;
667
+ let renderText = '';
668
+ const selectedItems = [...selections];
669
+
670
+ if (typeof renderSelectedItem === 'undefined') {
671
+ renderSelectedItem = optionNode => optionNode.label;
672
+ }
673
+
674
+ if (selectedItems.length) {
675
+ const selectedItem = selectedItems[0][1];
676
+ renderText = renderSelectedItem(selectedItem);
677
+ }
678
+
679
+ const spanCls = (0, _classnames.default)({
680
+ ["".concat(prefixcls, "-selection-text")]: true,
681
+ ["".concat(prefixcls, "-selection-placeholder")]: !renderText && renderText !== 0,
682
+ ["".concat(prefixcls, "-selection-text-hide")]: inputValue && showInput,
683
+ ["".concat(prefixcls, "-selection-text-inactive")]: !inputValue && showInput // Stack Input & RenderText(opacity 0.4)
684
+
685
+ });
686
+ const contentWrapperCls = "".concat(prefixcls, "-content-wrapper");
687
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
688
+ className: contentWrapperCls
689
+ }, /*#__PURE__*/_react.default.createElement("span", {
690
+ className: spanCls
691
+ }, renderText || renderText === 0 ? renderText : placeholder), filterable && showInput ? this.renderInput() : null));
692
+ }
693
+
694
+ renderMultipleSelection(selections, filterable) {
695
+ let {
696
+ renderSelectedItem
697
+ } = this.props;
698
+ const {
699
+ placeholder,
700
+ maxTagCount,
701
+ size
702
+ } = this.props;
703
+ const {
704
+ inputValue
705
+ } = this.state;
706
+ const selectDisabled = this.props.disabled;
707
+ const renderTags = [];
708
+ const selectedItems = [...selections];
709
+
710
+ if (typeof renderSelectedItem === 'undefined') {
711
+ renderSelectedItem = optionNode => ({
712
+ isRenderInTag: true,
713
+ content: optionNode.label
714
+ });
715
+ }
716
+
717
+ const tags = (0, _map2.default)(selectedItems).call(selectedItems, (item, i) => {
718
+ const label = item[0];
719
+ const {
720
+ value
721
+ } = item[1];
722
+ const disabled = item[1].disabled || selectDisabled;
723
+
724
+ const onClose = (tagContent, e) => {
725
+ if (e && typeof e.preventDefault === 'function') {
726
+ e.preventDefault(); // make sure that tag will not hidden immediately in controlled mode
727
+ }
728
+
729
+ this.foundation.removeTag({
730
+ label,
731
+ value
732
+ });
733
+ };
734
+
735
+ const {
736
+ content,
737
+ isRenderInTag
738
+ } = renderSelectedItem(item[1], {
739
+ index: i,
740
+ disabled,
741
+ onClose
742
+ });
743
+ const basic = {
744
+ disabled,
745
+ closable: !disabled,
746
+ onClose
747
+ };
748
+
749
+ if (isRenderInTag) {
750
+ return /*#__PURE__*/_react.default.createElement(_index.default, (0, _assign.default)({}, basic, {
751
+ color: "white",
752
+ size: size || 'large',
753
+ key: value
754
+ }), content);
755
+ } else {
756
+ return content;
757
+ }
758
+ });
759
+ const contentWrapperCls = (0, _classnames.default)({
760
+ ["".concat(prefixcls, "-content-wrapper")]: true,
761
+ ["".concat(prefixcls, "-content-wrapper-one-line")]: maxTagCount,
762
+ ["".concat(prefixcls, "-content-wrapper-empty")]: !tags.length
763
+ });
764
+ const spanCls = (0, _classnames.default)({
765
+ ["".concat(prefixcls, "-selection-text")]: true,
766
+ ["".concat(prefixcls, "-selection-placeholder")]: !tags.length,
767
+ ["".concat(prefixcls, "-selection-text-hide")]: tags && tags.length // [prefixcls + '-selection-text-inactive']: !inputValue && !tags.length,
768
+
769
+ });
770
+ const placeholderText = placeholder && !inputValue ? /*#__PURE__*/_react.default.createElement("span", {
771
+ className: spanCls
772
+ }, placeholder) : null;
773
+ const n = tags.length > maxTagCount ? maxTagCount : undefined;
774
+ const NotOneLine = !maxTagCount; // Multiple lines (that is, do not set maxTagCount), do not use TagGroup, directly traverse with Tag, otherwise Input cannot follow the correct position
775
+
776
+ const tagContent = NotOneLine ? tags : /*#__PURE__*/_react.default.createElement(_group.default, {
777
+ tagList: tags,
778
+ maxTagCount: n,
779
+ size: "large",
780
+ mode: "custom"
781
+ });
782
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
783
+ className: contentWrapperCls
784
+ }, tags && tags.length ? tagContent : placeholderText, !filterable ? null : this.renderInput()));
785
+ }
786
+
787
+ onMouseEnter(e) {
788
+ this.foundation.handleMouseEnter(e);
789
+ }
790
+
791
+ onMouseLeave(e) {
792
+ this.foundation.handleMouseLeave(e);
793
+ }
794
+ /* Processing logic when popover visible changes */
795
+
796
+
797
+ handlePopoverVisibleChange(status) {
798
+ const {
799
+ virtualize
800
+ } = this.props;
801
+ const {
802
+ selections
803
+ } = this.state;
804
+
805
+ if (!status) {
806
+ return;
807
+ }
808
+
809
+ if (virtualize) {
810
+ let minKey;
811
+ (0, _forEach.default)(selections).call(selections, (v, k) => {
812
+ const tempKey = Number(String(k).match(/option-(.*)/)[1]);
813
+ minKey = typeof minKey === 'number' && minKey < tempKey ? minKey : tempKey;
814
+ });
815
+
816
+ if (minKey) {
817
+ this.virtualizeListRef.current.scrollToItem(minKey, 'center');
818
+ }
819
+ } else {
820
+ this.foundation.updateScrollTop();
821
+ }
822
+ }
823
+
824
+ renderSuffix() {
825
+ const {
826
+ suffix
827
+ } = this.props;
828
+ const suffixWrapperCls = (0, _classnames.default)({
829
+ ["".concat(prefixcls, "-suffix")]: true,
830
+ ["".concat(prefixcls, "-suffix-text")]: suffix && (0, _lodashEs.isString)(suffix),
831
+ ["".concat(prefixcls, "-suffix-icon")]: (0, _utils2.isSemiIcon)(suffix)
832
+ });
833
+ return /*#__PURE__*/_react.default.createElement("div", {
834
+ className: suffixWrapperCls
835
+ }, suffix);
836
+ }
837
+
838
+ renderPrefix() {
839
+ const {
840
+ prefix,
841
+ insetLabel
842
+ } = this.props;
843
+ const labelNode = prefix || insetLabel;
844
+ const prefixWrapperCls = (0, _classnames.default)({
845
+ ["".concat(prefixcls, "-prefix")]: true,
846
+ ["".concat(prefixcls, "-inset-label")]: insetLabel,
847
+ ["".concat(prefixcls, "-prefix-text")]: labelNode && (0, _lodashEs.isString)(labelNode),
848
+ ["".concat(prefixcls, "-prefix-icon")]: (0, _utils2.isSemiIcon)(labelNode)
849
+ });
850
+ return /*#__PURE__*/_react.default.createElement("div", {
851
+ className: prefixWrapperCls
852
+ }, labelNode);
853
+ }
854
+
855
+ renderSelection() {
856
+ const {
857
+ disabled,
858
+ multiple,
859
+ filter,
860
+ style,
861
+ size,
862
+ className,
863
+ validateStatus,
864
+ showArrow,
865
+ suffix,
866
+ prefix,
867
+ insetLabel,
868
+ placeholder,
869
+ triggerRender,
870
+ arrowIcon
871
+ } = this.props;
872
+ const {
873
+ selections,
874
+ isOpen,
875
+ keyboardEventSet,
876
+ inputValue,
877
+ isHovering,
878
+ isFocus
879
+ } = this.state;
880
+ const useCustomTrigger = typeof triggerRender === 'function';
881
+ const filterable = Boolean(filter); // filter(boolean || function)
882
+
883
+ const selectionCls = useCustomTrigger ? (0, _classnames.default)(className) : (0, _classnames.default)(prefixcls, className, {
884
+ ["".concat(prefixcls, "-open")]: isOpen,
885
+ ["".concat(prefixcls, "-focus")]: isFocus,
886
+ ["".concat(prefixcls, "-disabled")]: disabled,
887
+ ["".concat(prefixcls, "-single")]: !multiple,
888
+ ["".concat(prefixcls, "-multiple")]: multiple,
889
+ ["".concat(prefixcls, "-filterable")]: filterable,
890
+ ["".concat(prefixcls, "-small")]: size === 'small',
891
+ ["".concat(prefixcls, "-large")]: size === 'large',
892
+ ["".concat(prefixcls, "-error")]: validateStatus === 'error',
893
+ ["".concat(prefixcls, "-warning")]: validateStatus === 'warning',
894
+ ["".concat(prefixcls, "-no-arrow")]: !showArrow,
895
+ ["".concat(prefixcls, "-with-prefix")]: prefix || insetLabel,
896
+ ["".concat(prefixcls, "-with-suffix")]: suffix
897
+ });
898
+ const showClear = this.props.showClear && (selections.size || inputValue) && !disabled && (isHovering || isOpen);
899
+ const arrowContent = showArrow ? /*#__PURE__*/_react.default.createElement("div", {
900
+ className: "".concat(prefixcls, "-arrow")
901
+ }, arrowIcon) : /*#__PURE__*/_react.default.createElement("div", {
902
+ className: "".concat(prefixcls, "-arrow-empty")
903
+ });
904
+ const inner = useCustomTrigger ? /*#__PURE__*/_react.default.createElement(_trigger.default, {
905
+ value: (0, _from.default)((0, _values.default)(selections).call(selections)),
906
+ inputValue: inputValue,
907
+ onChange: this.handleInputChange,
908
+ onClear: this.onClear,
909
+ disabled: disabled,
910
+ triggerRender: triggerRender,
911
+ placeholder: placeholder,
912
+ componentName: "Select",
913
+ componentProps: (0, _assign.default)({}, this.props)
914
+ }) : [/*#__PURE__*/_react.default.createElement(_react.Fragment, {
915
+ key: "prefix"
916
+ }, prefix || insetLabel ? this.renderPrefix() : null), /*#__PURE__*/_react.default.createElement(_react.Fragment, {
917
+ key: "selection"
918
+ }, /*#__PURE__*/_react.default.createElement("div", {
919
+ className: (0, _classnames.default)("".concat(prefixcls, "-selection"))
920
+ }, multiple ? this.renderMultipleSelection(selections, filterable) : this.renderSingleSelection(selections, filterable))), /*#__PURE__*/_react.default.createElement(_react.Fragment, {
921
+ key: "clearicon"
922
+ }, showClear ? /*#__PURE__*/_react.default.createElement("div", {
923
+ className: (0, _classnames.default)("".concat(prefixcls, "-clear")),
924
+ onClick: this.onClear
925
+ }, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClear, null)) : arrowContent), /*#__PURE__*/_react.default.createElement(_react.Fragment, {
926
+ key: "suffix"
927
+ }, suffix ? this.renderSuffix() : null)];
928
+ const tabIndex = disabled ? null : 0;
929
+ return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
930
+ className: selectionCls,
931
+ ref: ref => this.triggerRef.current = ref,
932
+ onClick: e => this.foundation.handleClick(e),
933
+ style: style,
934
+ tabIndex: tabIndex,
935
+ onMouseEnter: this.onMouseEnter,
936
+ onMouseLeave: this.onMouseLeave,
937
+ // onFocus={e => this.foundation.handleTriggerFocus(e)}
938
+ onBlur: e => this.foundation.handleTriggerBlur(e)
939
+ }, keyboardEventSet), inner);
940
+ }
941
+
942
+ render() {
943
+ const {
944
+ direction
945
+ } = this.context;
946
+ const defaultPosition = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
947
+ const {
948
+ children,
949
+ position = defaultPosition,
950
+ zIndex,
951
+ getPopupContainer,
952
+ motion,
953
+ autoAdjustOverflow,
954
+ mouseLeaveDelay,
955
+ mouseEnterDelay,
956
+ spacing,
957
+ stopPropagation
958
+ } = this.props;
959
+ const {
960
+ isOpen,
961
+ optionKey
962
+ } = this.state;
963
+ const optionList = this.renderOptions(children);
964
+ const selection = this.renderSelection();
965
+ return /*#__PURE__*/_react.default.createElement(_index2.default, {
966
+ getPopupContainer: getPopupContainer,
967
+ motion: motion,
968
+ autoAdjustOverflow: autoAdjustOverflow,
969
+ mouseLeaveDelay: mouseLeaveDelay,
970
+ mouseEnterDelay: mouseEnterDelay,
971
+ // transformFromCenter TODO: check no such property
972
+ zIndex: zIndex,
973
+ ref: this.optionsRef,
974
+ content: optionList,
975
+ visible: isOpen,
976
+ trigger: "custom",
977
+ rePosKey: optionKey,
978
+ position: position,
979
+ spacing: spacing,
980
+ stopPropagation: stopPropagation,
981
+ onVisibleChange: status => this.handlePopoverVisibleChange(status)
982
+ }, selection);
983
+ }
984
+
985
+ }
986
+
987
+ Select.contextType = _context12.default;
988
+ Select.Option = _option.default;
989
+ Select.OptGroup = _optionGroup.default;
990
+ Select.propTypes = {
991
+ autoFocus: _propTypes.default.bool,
992
+ children: _propTypes.default.node,
993
+ defaultValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array, _propTypes.default.object]),
994
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.array, _propTypes.default.object]),
995
+ placeholder: _propTypes.default.node,
996
+ onChange: _propTypes.default.func,
997
+ multiple: _propTypes.default.bool,
998
+ // Whether to turn on the input box filtering function, when it is a function, it represents a custom filtering function
999
+ filter: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
1000
+ // How many tags can you choose?
1001
+ max: _propTypes.default.number,
1002
+ // How many tabs are displayed at most, and the rest are displayed in + N
1003
+ maxTagCount: _propTypes.default.number,
1004
+ maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
1005
+ style: _propTypes.default.object,
1006
+ className: _propTypes.default.string,
1007
+ size: _propTypes.default.oneOf(_constants.strings.SIZE_SET),
1008
+ disabled: _propTypes.default.bool,
1009
+ emptyContent: _propTypes.default.node,
1010
+ onDropdownVisibleChange: _propTypes.default.func,
1011
+ zIndex: _propTypes.default.number,
1012
+ position: _propTypes.default.oneOf(_constants.strings.POSITION_SET),
1013
+ onSearch: _propTypes.default.func,
1014
+ getPopupContainer: _propTypes.default.func,
1015
+ dropdownClassName: _propTypes.default.string,
1016
+ dropdownStyle: _propTypes.default.object,
1017
+ outerTopSlot: _propTypes.default.node,
1018
+ innerTopSlot: _propTypes.default.node,
1019
+ outerBottomSlot: _propTypes.default.node,
1020
+ innerBottomSlot: _propTypes.default.node,
1021
+ optionList: _propTypes.default.array,
1022
+ dropdownMatchSelectWidth: _propTypes.default.bool,
1023
+ loading: _propTypes.default.bool,
1024
+ defaultOpen: _propTypes.default.bool,
1025
+ validateStatus: _propTypes.default.oneOf(_constants.strings.STATUS),
1026
+ defaultActiveFirstOption: _propTypes.default.bool,
1027
+ triggerRender: _propTypes.default.func,
1028
+ stopPropagation: _propTypes.default.bool,
1029
+ // motion doesn't need to be exposed
1030
+ motion: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool, _propTypes.default.object]),
1031
+ onChangeWithObject: _propTypes.default.bool,
1032
+ suffix: _propTypes.default.node,
1033
+ prefix: _propTypes.default.node,
1034
+ insetLabel: _propTypes.default.node,
1035
+ showClear: _propTypes.default.bool,
1036
+ showArrow: _propTypes.default.bool,
1037
+ renderSelectedItem: _propTypes.default.func,
1038
+ allowCreate: _propTypes.default.bool,
1039
+ renderCreateItem: _propTypes.default.func,
1040
+ onMouseEnter: _propTypes.default.func,
1041
+ onMouseLeave: _propTypes.default.func,
1042
+ clickToHide: _propTypes.default.bool,
1043
+ onExceed: _propTypes.default.func,
1044
+ onCreate: _propTypes.default.func,
1045
+ remote: _propTypes.default.bool,
1046
+ onDeselect: _propTypes.default.func,
1047
+ // The main difference between onSelect and onChange is that when multiple selections are selected, onChange contains all options, while onSelect only contains items for the current operation
1048
+ onSelect: _propTypes.default.func,
1049
+ autoAdjustOverflow: _propTypes.default.bool,
1050
+ mouseEnterDelay: _propTypes.default.number,
1051
+ mouseLeaveDelay: _propTypes.default.number,
1052
+ spacing: _propTypes.default.number,
1053
+ onBlur: _propTypes.default.func,
1054
+ onFocus: _propTypes.default.func,
1055
+ onClear: _propTypes.default.func,
1056
+ virtualize: _propTypes.default.object,
1057
+ renderOptionItem: _propTypes.default.func,
1058
+ onListScroll: _propTypes.default.func,
1059
+ arrowIcon: _propTypes.default.node // open: PropTypes.bool,
1060
+ // tagClosable: PropTypes.bool,
1061
+
1062
+ };
1063
+ Select.defaultProps = {
1064
+ stopPropagation: true,
1065
+ motion: true,
1066
+ zIndex: _constants2.numbers.DEFAULT_Z_INDEX,
1067
+ // position: 'bottomLeft',
1068
+ filter: false,
1069
+ multiple: false,
1070
+ disabled: false,
1071
+ defaultOpen: false,
1072
+ allowCreate: false,
1073
+ placeholder: '',
1074
+ onDropdownVisibleChange: _lodashEs.noop,
1075
+ onChangeWithObject: false,
1076
+ onChange: _lodashEs.noop,
1077
+ onSearch: _lodashEs.noop,
1078
+ onMouseEnter: _lodashEs.noop,
1079
+ onMouseLeave: _lodashEs.noop,
1080
+ onDeselect: _lodashEs.noop,
1081
+ onSelect: _lodashEs.noop,
1082
+ onCreate: _lodashEs.noop,
1083
+ onExceed: _lodashEs.noop,
1084
+ onFocus: _lodashEs.noop,
1085
+ onBlur: _lodashEs.noop,
1086
+ onClear: _lodashEs.noop,
1087
+ onListScroll: _lodashEs.noop,
1088
+ maxHeight: 300,
1089
+ dropdownMatchSelectWidth: true,
1090
+ defaultActiveFirstOption: false,
1091
+ showArrow: true,
1092
+ showClear: false,
1093
+ remote: false,
1094
+ autoAdjustOverflow: true,
1095
+ arrowIcon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronDown, null) // Radio selection is different from the default renderSelectedItem for multiple selection, so it is not declared here
1096
+ // renderSelectedItem: (optionNode) => optionNode.label,
1097
+ // The default creator rendering is related to i18, so it is not declared here
1098
+ // renderCreateItem: (input) => input
1099
+
1100
+ };
1101
+ var _default = Select;
1102
+ exports.default = _default;