@aloudata/aloudata-design 0.4.0-beta.10 → 0.4.0-beta.12

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 (394) hide show
  1. package/es/Avatar/component/Avatar/index.d.ts +1 -1
  2. package/es/Avatar/component/Avatar/index.js +12 -16
  3. package/es/Breadcrumb/index.js +14 -18
  4. package/es/Button/index.d.ts +2 -2
  5. package/es/Button/index.js +16 -39
  6. package/es/Button/style/index.less +1 -1
  7. package/es/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
  8. package/es/Checkbox/component/CheckboxGroup/index.js +11 -11
  9. package/es/Checkbox/index.js +8 -8
  10. package/es/Checkbox/type.d.ts +1 -1
  11. package/es/Checkbox/type.js +0 -1
  12. package/es/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
  13. package/es/ConfigProvider/defaultRenderEmpty.js +0 -6
  14. package/es/ConfigProvider/sizeContext.d.ts +2 -2
  15. package/es/ConfigProvider/sizeContext.js +1 -1
  16. package/es/Divider/index.js +7 -3
  17. package/es/Dropdown/Button.d.ts +1 -1
  18. package/es/Dropdown/Button.js +16 -14
  19. package/es/Dropdown/index.d.ts +3 -3
  20. package/es/Dropdown/index.js +10 -10
  21. package/es/Empty/image/Authority.d.ts +0 -1
  22. package/es/Empty/image/Authority.js +0 -2
  23. package/es/Empty/image/Dataspace.d.ts +0 -1
  24. package/es/Empty/image/Dataspace.js +0 -2
  25. package/es/Empty/image/Search.d.ts +0 -1
  26. package/es/Empty/image/Search.js +0 -2
  27. package/es/Empty/image/Simple.d.ts +0 -1
  28. package/es/Empty/image/Simple.js +0 -2
  29. package/es/Empty/image/Worksheet.d.ts +0 -1
  30. package/es/Empty/image/Worksheet.js +0 -2
  31. package/es/Empty/image/empty.d.ts +0 -1
  32. package/es/Empty/image/empty.js +0 -2
  33. package/es/Empty/index.d.ts +1 -1
  34. package/es/Empty/index.js +16 -24
  35. package/es/Icon/components/Icon.js +14 -12
  36. package/es/Icon/components/createFromScripts.js +2 -8
  37. package/es/Icon/icons/AddLine.js +17 -23
  38. package/es/Icon/icons/AlertFill.js +17 -23
  39. package/es/Icon/icons/ArrowsDownLine.js +17 -23
  40. package/es/Icon/icons/CancelFill.js +17 -23
  41. package/es/Icon/icons/CheckFill.js +17 -23
  42. package/es/Icon/icons/CheckLine.js +17 -23
  43. package/es/Icon/icons/CloseLine.js +17 -23
  44. package/es/Icon/icons/DatabaseLine.js +17 -23
  45. package/es/Icon/icons/Deleteline.js +17 -23
  46. package/es/Icon/icons/DownloadLine.js +17 -23
  47. package/es/Icon/icons/ErrorFill.js +17 -23
  48. package/es/Icon/icons/EyeOffLine.js +17 -23
  49. package/es/Icon/icons/EyeOnLine.js +17 -23
  50. package/es/Icon/icons/FileLine.js +17 -23
  51. package/es/Icon/icons/HomeFill.js +17 -23
  52. package/es/Icon/icons/LightningLine.js +17 -23
  53. package/es/Icon/icons/Loading.js +17 -23
  54. package/es/Icon/icons/More.js +17 -23
  55. package/es/Icon/icons/NewWindowsLine.js +17 -23
  56. package/es/Icon/icons/SearchLine.js +17 -23
  57. package/es/Icon/icons/SortAscendingLine.js +17 -23
  58. package/es/Icon/icons/SortDescendingLine.js +17 -23
  59. package/es/Icon/icons/TextLine.js +17 -23
  60. package/es/Icon/icons/UserLine.js +17 -23
  61. package/es/Icon/icons.js +1658 -1588
  62. package/es/Input/components/Group/index.js +11 -9
  63. package/es/Input/components/Input/index.d.ts +2 -2
  64. package/es/Input/components/Input/index.js +10 -9
  65. package/es/Input/components/Password/index.js +14 -12
  66. package/es/Input/components/TextArea/index.js +13 -11
  67. package/es/InputNumber/index.js +10 -12
  68. package/es/Menu/Divider.js +7 -1
  69. package/es/Menu/MenuItem.js +7 -1
  70. package/es/Menu/SubMenu.js +8 -6
  71. package/es/Menu/index.d.ts +1 -1
  72. package/es/Menu/index.js +8 -6
  73. package/es/Modal/index.d.ts +1 -1
  74. package/es/Modal/index.js +18 -28
  75. package/es/Modal/locale.js +4 -6
  76. package/es/Modal/style/index.less +6 -1
  77. package/es/Navigator/components/Header/index.js +0 -2
  78. package/es/Navigator/components/Menu/index.js +14 -18
  79. package/es/Navigator/components/MenuItem/index.js +6 -9
  80. package/es/Navigator/index.js +5 -7
  81. package/es/Popconfirm/index.d.ts +89 -2
  82. package/es/Popconfirm/index.js +105 -1
  83. package/es/Popconfirm/style/index.less +58 -0
  84. package/es/Popover/index.js +9 -9
  85. package/es/Radio/components/Group/index.d.ts +1 -1
  86. package/es/Radio/components/Group/index.js +23 -32
  87. package/es/Radio/components/Radio/index.js +10 -19
  88. package/es/Radio/interface/radioGroup.d.ts +3 -3
  89. package/es/Select/index.d.ts +4 -4
  90. package/es/Select/index.js +53 -70
  91. package/es/Select/rc-select/BaseSelect.d.ts +7 -7
  92. package/es/Select/rc-select/BaseSelect.js +155 -245
  93. package/es/Select/rc-select/OptGroup.js +0 -1
  94. package/es/Select/rc-select/Option.js +0 -1
  95. package/es/Select/rc-select/OptionList.d.ts +2 -2
  96. package/es/Select/rc-select/OptionList.js +76 -128
  97. package/es/Select/rc-select/Select.d.ts +8 -8
  98. package/es/Select/rc-select/Select.js +137 -205
  99. package/es/Select/rc-select/SelectTrigger.js +30 -42
  100. package/es/Select/rc-select/Selector/Input.d.ts +1 -1
  101. package/es/Select/rc-select/Selector/Input.js +29 -37
  102. package/es/Select/rc-select/Selector/MultipleSelector.js +72 -97
  103. package/es/Select/rc-select/Selector/SingleSelector.js +28 -43
  104. package/es/Select/rc-select/Selector/index.js +33 -58
  105. package/es/Select/rc-select/TransBtn.js +5 -10
  106. package/es/Select/rc-select/hooks/useBaseProps.js +0 -1
  107. package/es/Select/rc-select/hooks/useCache.d.ts +1 -1
  108. package/es/Select/rc-select/hooks/useCache.js +9 -12
  109. package/es/Select/rc-select/hooks/useDelayReset.js +4 -18
  110. package/es/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
  111. package/es/Select/rc-select/hooks/useFilterOptions.js +8 -17
  112. package/es/Select/rc-select/hooks/useId.js +6 -17
  113. package/es/Select/rc-select/hooks/useLayoutEffect.js +0 -1
  114. package/es/Select/rc-select/hooks/useLock.js +2 -6
  115. package/es/Select/rc-select/hooks/useOptions.d.ts +2 -2
  116. package/es/Select/rc-select/hooks/useOptions.js +2 -10
  117. package/es/Select/rc-select/hooks/useRefFunc.js +0 -1
  118. package/es/Select/rc-select/hooks/useSelectTriggerControl.js +0 -5
  119. package/es/Select/rc-select/utils/commonUtil.js +0 -2
  120. package/es/Select/rc-select/utils/keyUtil.js +4 -3
  121. package/es/Select/rc-select/utils/legacyUtil.js +13 -22
  122. package/es/Select/rc-select/utils/valueUtil.js +18 -50
  123. package/es/Select/rc-select/utils/warningPropsUtil.js +30 -47
  124. package/es/Select/style/index.js +2 -1
  125. package/es/Select/style/status.less +3 -1
  126. package/es/Select/utils/iconUtil.d.ts +3 -3
  127. package/es/Select/utils/iconUtil.js +16 -26
  128. package/es/Space/index.js +1 -1
  129. package/es/Spin/index.d.ts +2 -2
  130. package/es/Steps/components/Step/index.d.ts +1 -1
  131. package/es/Steps/components/Step/index.js +9 -8
  132. package/es/Steps/index.d.ts +8 -2
  133. package/es/Steps/index.js +64 -10
  134. package/es/Steps/style/index.less +11 -12
  135. package/es/Switch/index.js +17 -30
  136. package/es/Table/Table.js +115 -191
  137. package/es/Table/components/Empty/index.js +0 -2
  138. package/es/Table/components/Loading/index.js +0 -2
  139. package/es/Table/components/TableBodyRowList/index.js +20 -39
  140. package/es/Table/components/TableHead/index.js +57 -94
  141. package/es/Table/interface.d.ts +1 -1
  142. package/es/Table/style/index.less +8 -4
  143. package/es/Table/utils.js +8 -29
  144. package/es/Tabs/index.d.ts +22 -7
  145. package/es/Tabs/index.js +12 -19
  146. package/es/Tooltip/index.d.ts +1 -1
  147. package/es/Tooltip/index.js +12 -12
  148. package/es/_utils/hooks/useControlledState.d.ts +1 -1
  149. package/es/_utils/hooks/useControlledState.js +8 -21
  150. package/es/_utils/hooks/useId.js +2 -6
  151. package/es/_utils/hooks/usePrefixCls.d.ts +1 -1
  152. package/es/_utils/hooks/usePrefixCls.js +2 -5
  153. package/es/index.d.ts +1 -1
  154. package/es/locale-provider/context.d.ts +1 -1
  155. package/es/locale-provider/index.js +10 -32
  156. package/lib/Alert/index.js +0 -4
  157. package/lib/Alert/style/index.js +0 -1
  158. package/lib/Avatar/component/Avatar/index.d.ts +1 -1
  159. package/lib/Avatar/component/Avatar/index.js +11 -24
  160. package/lib/Avatar/index.js +0 -4
  161. package/lib/Avatar/style/index.js +0 -1
  162. package/lib/Breadcrumb/index.js +14 -23
  163. package/lib/Breadcrumb/style/index.js +0 -1
  164. package/lib/Button/index.d.ts +2 -2
  165. package/lib/Button/index.js +16 -47
  166. package/lib/Button/style/index.js +0 -1
  167. package/lib/Button/style/index.less +1 -1
  168. package/lib/Card/index.js +0 -4
  169. package/lib/Card/style/index.js +0 -1
  170. package/lib/Checkbox/component/CheckboxGroup/index.d.ts +0 -1
  171. package/lib/Checkbox/component/CheckboxGroup/index.js +9 -16
  172. package/lib/Checkbox/index.js +8 -14
  173. package/lib/Checkbox/style/index.js +0 -1
  174. package/lib/Checkbox/type.d.ts +1 -1
  175. package/lib/Checkbox/type.js +0 -1
  176. package/lib/Col/index.js +0 -4
  177. package/lib/Col/style/index.js +0 -1
  178. package/lib/ConfigProvider/defaultRenderEmpty.d.ts +2 -2
  179. package/lib/ConfigProvider/defaultRenderEmpty.js +0 -13
  180. package/lib/ConfigProvider/index.js +0 -5
  181. package/lib/ConfigProvider/sizeContext.d.ts +2 -2
  182. package/lib/ConfigProvider/sizeContext.js +1 -8
  183. package/lib/ConfigProvider/style/index.js +0 -1
  184. package/lib/DatePicker/index.js +0 -4
  185. package/lib/DatePicker/style/index.js +0 -1
  186. package/lib/Divider/index.js +7 -8
  187. package/lib/Divider/style/index.js +0 -1
  188. package/lib/Drawer/index.js +0 -4
  189. package/lib/Drawer/style/index.js +0 -1
  190. package/lib/Dropdown/Button.d.ts +1 -1
  191. package/lib/Dropdown/Button.js +14 -20
  192. package/lib/Dropdown/index.d.ts +3 -3
  193. package/lib/Dropdown/index.js +10 -17
  194. package/lib/Dropdown/style/index.js +0 -2
  195. package/lib/Empty/image/Authority.d.ts +0 -1
  196. package/lib/Empty/image/Authority.js +0 -6
  197. package/lib/Empty/image/Dataspace.d.ts +0 -1
  198. package/lib/Empty/image/Dataspace.js +0 -6
  199. package/lib/Empty/image/Search.d.ts +0 -1
  200. package/lib/Empty/image/Search.js +0 -6
  201. package/lib/Empty/image/Simple.d.ts +0 -1
  202. package/lib/Empty/image/Simple.js +0 -6
  203. package/lib/Empty/image/Worksheet.d.ts +0 -1
  204. package/lib/Empty/image/Worksheet.js +0 -6
  205. package/lib/Empty/image/empty.d.ts +0 -1
  206. package/lib/Empty/image/empty.js +0 -6
  207. package/lib/Empty/index.d.ts +1 -1
  208. package/lib/Empty/index.js +15 -37
  209. package/lib/Form/index.js +0 -4
  210. package/lib/Form/style/index.js +0 -1
  211. package/lib/Icon/antdIconfont.js +0 -1
  212. package/lib/Icon/components/Icon.js +14 -16
  213. package/lib/Icon/components/createFromScripts.js +2 -8
  214. package/lib/Icon/icons/AddLine.js +16 -30
  215. package/lib/Icon/icons/AlertFill.js +16 -30
  216. package/lib/Icon/icons/ArrowsDownLine.js +16 -30
  217. package/lib/Icon/icons/CancelFill.js +16 -30
  218. package/lib/Icon/icons/CheckFill.js +16 -30
  219. package/lib/Icon/icons/CheckLine.js +16 -30
  220. package/lib/Icon/icons/CloseLine.js +16 -30
  221. package/lib/Icon/icons/DatabaseLine.js +16 -30
  222. package/lib/Icon/icons/Deleteline.js +16 -30
  223. package/lib/Icon/icons/DownloadLine.js +16 -30
  224. package/lib/Icon/icons/ErrorFill.js +16 -30
  225. package/lib/Icon/icons/EyeOffLine.js +16 -30
  226. package/lib/Icon/icons/EyeOnLine.js +16 -30
  227. package/lib/Icon/icons/FileLine.js +16 -30
  228. package/lib/Icon/icons/HomeFill.js +16 -30
  229. package/lib/Icon/icons/LightningLine.js +16 -30
  230. package/lib/Icon/icons/Loading.js +16 -30
  231. package/lib/Icon/icons/More.js +16 -30
  232. package/lib/Icon/icons/NewWindowsLine.js +16 -30
  233. package/lib/Icon/icons/SearchLine.js +16 -30
  234. package/lib/Icon/icons/SortAscendingLine.js +16 -30
  235. package/lib/Icon/icons/SortDescendingLine.js +16 -30
  236. package/lib/Icon/icons/TextLine.js +16 -30
  237. package/lib/Icon/icons/UserLine.js +16 -30
  238. package/lib/Icon/icons.js +1658 -1588
  239. package/lib/Icon/index.js +0 -3
  240. package/lib/Input/components/Group/index.js +11 -16
  241. package/lib/Input/components/Input/index.d.ts +2 -2
  242. package/lib/Input/components/Input/index.js +10 -16
  243. package/lib/Input/components/Password/index.js +12 -21
  244. package/lib/Input/components/TextArea/index.js +13 -18
  245. package/lib/Input/index.js +0 -6
  246. package/lib/Input/style/index.js +0 -2
  247. package/lib/InputNumber/index.js +10 -18
  248. package/lib/InputNumber/style/index.js +0 -1
  249. package/lib/Layout/index.js +0 -4
  250. package/lib/Layout/style/index.js +0 -1
  251. package/lib/Menu/Divider.js +7 -7
  252. package/lib/Menu/MenuItem.js +7 -7
  253. package/lib/Menu/SubMenu.js +8 -13
  254. package/lib/Menu/index.d.ts +1 -1
  255. package/lib/Menu/index.js +8 -16
  256. package/lib/Menu/style/index.js +0 -2
  257. package/lib/Modal/index.d.ts +1 -1
  258. package/lib/Modal/index.js +17 -45
  259. package/lib/Modal/locale.js +4 -9
  260. package/lib/Modal/style/index.js +0 -1
  261. package/lib/Modal/style/index.less +6 -1
  262. package/lib/Navigator/components/Header/index.js +0 -4
  263. package/lib/Navigator/components/Menu/index.js +13 -24
  264. package/lib/Navigator/components/MenuItem/index.js +6 -15
  265. package/lib/Navigator/index.js +5 -15
  266. package/lib/Navigator/style/index.js +0 -1
  267. package/lib/PageHeader/index.js +0 -4
  268. package/lib/PageHeader/style/index.js +0 -1
  269. package/lib/Popconfirm/index.d.ts +89 -2
  270. package/lib/Popconfirm/index.js +106 -5
  271. package/lib/Popconfirm/style/index.js +0 -1
  272. package/lib/Popconfirm/style/index.less +58 -0
  273. package/lib/Popover/index.js +9 -14
  274. package/lib/Popover/style/index.js +0 -1
  275. package/lib/Progress/index.js +0 -3
  276. package/lib/Progress/style/index.js +0 -1
  277. package/lib/Radio/components/Group/index.d.ts +1 -1
  278. package/lib/Radio/components/Group/index.js +22 -41
  279. package/lib/Radio/components/Radio/index.js +10 -30
  280. package/lib/Radio/index.js +0 -4
  281. package/lib/Radio/interface/radioGroup.d.ts +3 -3
  282. package/lib/Radio/style/index.js +0 -1
  283. package/lib/Row/index.js +0 -4
  284. package/lib/Row/style/index.js +0 -1
  285. package/lib/Select/index.d.ts +4 -4
  286. package/lib/Select/index.js +52 -87
  287. package/lib/Select/rc-select/BaseSelect.d.ts +7 -7
  288. package/lib/Select/rc-select/BaseSelect.js +155 -266
  289. package/lib/Select/rc-select/OptGroup.js +0 -2
  290. package/lib/Select/rc-select/Option.js +0 -2
  291. package/lib/Select/rc-select/OptionList.d.ts +2 -2
  292. package/lib/Select/rc-select/OptionList.js +75 -146
  293. package/lib/Select/rc-select/Select.d.ts +8 -8
  294. package/lib/Select/rc-select/Select.js +137 -224
  295. package/lib/Select/rc-select/SelectContext.js +1 -5
  296. package/lib/Select/rc-select/SelectTrigger.js +29 -49
  297. package/lib/Select/rc-select/Selector/Input.d.ts +1 -1
  298. package/lib/Select/rc-select/Selector/Input.js +29 -46
  299. package/lib/Select/rc-select/Selector/MultipleSelector.js +71 -109
  300. package/lib/Select/rc-select/Selector/SingleSelector.js +28 -50
  301. package/lib/Select/rc-select/Selector/index.js +32 -67
  302. package/lib/Select/rc-select/TransBtn.js +5 -16
  303. package/lib/Select/rc-select/hooks/useBaseProps.js +1 -7
  304. package/lib/Select/rc-select/hooks/useCache.d.ts +1 -1
  305. package/lib/Select/rc-select/hooks/useCache.js +9 -18
  306. package/lib/Select/rc-select/hooks/useDelayReset.js +4 -22
  307. package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +1 -1
  308. package/lib/Select/rc-select/hooks/useFilterOptions.js +8 -25
  309. package/lib/Select/rc-select/hooks/useId.js +6 -26
  310. package/lib/Select/rc-select/hooks/useLayoutEffect.js +0 -6
  311. package/lib/Select/rc-select/hooks/useLock.js +2 -10
  312. package/lib/Select/rc-select/hooks/useOptions.d.ts +2 -2
  313. package/lib/Select/rc-select/hooks/useOptions.js +2 -15
  314. package/lib/Select/rc-select/hooks/useRefFunc.js +0 -5
  315. package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +1 -10
  316. package/lib/Select/rc-select/index.js +0 -7
  317. package/lib/Select/rc-select/utils/commonUtil.js +0 -4
  318. package/lib/Select/rc-select/utils/keyUtil.js +4 -5
  319. package/lib/Select/rc-select/utils/legacyUtil.js +12 -28
  320. package/lib/Select/rc-select/utils/platformUtil.js +0 -1
  321. package/lib/Select/rc-select/utils/valueUtil.js +18 -55
  322. package/lib/Select/rc-select/utils/warningPropsUtil.js +30 -56
  323. package/lib/Select/style/index.js +0 -2
  324. package/lib/Select/style/status.less +3 -1
  325. package/lib/Select/utils/iconUtil.d.ts +3 -3
  326. package/lib/Select/utils/iconUtil.js +16 -39
  327. package/lib/Skeleton/index.js +0 -3
  328. package/lib/Skeleton/style/index.js +0 -1
  329. package/lib/Space/index.js +2 -9
  330. package/lib/Space/style/index.js +0 -1
  331. package/lib/Spin/index.d.ts +2 -2
  332. package/lib/Spin/index.js +0 -3
  333. package/lib/Spin/style/index.js +0 -1
  334. package/lib/Steps/components/ProcessIcon/index.js +0 -4
  335. package/lib/Steps/components/Step/index.d.ts +1 -1
  336. package/lib/Steps/components/Step/index.js +9 -18
  337. package/lib/Steps/index.d.ts +8 -2
  338. package/lib/Steps/index.js +63 -17
  339. package/lib/Steps/style/index.js +0 -1
  340. package/lib/Steps/style/index.less +11 -12
  341. package/lib/Switch/index.js +17 -37
  342. package/lib/Switch/style/index.js +0 -1
  343. package/lib/Table/Table.js +117 -216
  344. package/lib/Table/components/Empty/index.js +0 -6
  345. package/lib/Table/components/Loading/index.js +0 -7
  346. package/lib/Table/components/TableBodyRowList/index.js +19 -47
  347. package/lib/Table/components/TableHead/index.js +56 -108
  348. package/lib/Table/index.js +0 -3
  349. package/lib/Table/interface.d.ts +1 -1
  350. package/lib/Table/style/index.js +0 -1
  351. package/lib/Table/style/index.less +8 -4
  352. package/lib/Table/utils.js +8 -33
  353. package/lib/Tabs/index.d.ts +22 -7
  354. package/lib/Tabs/index.js +10 -28
  355. package/lib/Tabs/style/index.js +0 -2
  356. package/lib/Tooltip/index.d.ts +1 -1
  357. package/lib/Tooltip/index.js +12 -17
  358. package/lib/Tooltip/style/index.js +0 -1
  359. package/lib/Tree/index.js +0 -3
  360. package/lib/Tree/style/index.js +0 -1
  361. package/lib/Typography/index.js +0 -4
  362. package/lib/Typography/style/index.js +0 -1
  363. package/lib/Upload/index.js +0 -4
  364. package/lib/Upload/style/index.js +0 -1
  365. package/lib/_utils/hooks/useControlledState.d.ts +1 -1
  366. package/lib/_utils/hooks/useControlledState.js +8 -23
  367. package/lib/_utils/hooks/useId.js +3 -10
  368. package/lib/_utils/hooks/usePrefixCls.d.ts +1 -1
  369. package/lib/_utils/hooks/usePrefixCls.js +2 -10
  370. package/lib/index.d.ts +1 -1
  371. package/lib/index.js +0 -42
  372. package/lib/locale/default.js +0 -3
  373. package/lib/locale/en_US.js +1 -6
  374. package/lib/locale/zh_CN.js +1 -6
  375. package/lib/locale-provider/LocaleReceiver.js +0 -5
  376. package/lib/locale-provider/context.d.ts +1 -1
  377. package/lib/locale-provider/context.js +0 -2
  378. package/lib/locale-provider/default.js +0 -3
  379. package/lib/locale-provider/en_US.js +0 -3
  380. package/lib/locale-provider/index.js +8 -37
  381. package/lib/locale-provider/zh_CN.js +0 -3
  382. package/lib/message/index.js +0 -4
  383. package/lib/message/style/index.js +0 -1
  384. package/lib/notification/index.js +0 -4
  385. package/lib/notification/style/index.js +0 -1
  386. package/package.json +4 -3
  387. package/es/Table/hooks/useFrame.d.ts +0 -7
  388. package/es/Table/hooks/useFrame.js +0 -90
  389. package/es/Tabs/TabPane.d.ts +0 -21
  390. package/es/Tabs/TabPane.js +0 -6
  391. package/lib/Table/hooks/useFrame.d.ts +0 -7
  392. package/lib/Table/hooks/useFrame.js +0 -98
  393. package/lib/Tabs/TabPane.d.ts +0 -21
  394. package/lib/Tabs/TabPane.js +0 -18
@@ -1,37 +1,22 @@
1
1
  var _excluded = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "prefix", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "showArrow", "inputIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"];
2
-
3
2
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
-
7
4
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
-
9
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
-
11
6
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
-
13
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
-
15
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
-
17
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
-
19
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
-
21
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
22
-
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
23
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
-
25
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
-
27
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
-
29
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
-
15
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
32
-
33
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
34
-
35
20
  // @ts-nocheck
36
21
  import * as React from 'react';
37
22
  import classNames from 'classnames';
@@ -54,262 +39,231 @@ export function isMultiple(mode) {
54
39
  }
55
40
  var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
56
41
  var _customizeRawInputEle, _classNames2;
57
-
58
42
  var id = props.id,
59
- prefixCls = props.prefixCls,
60
- className = props.className,
61
- showSearch = props.showSearch,
62
- tagRender = props.tagRender,
63
- direction = props.direction,
64
- omitDomProps = props.omitDomProps,
65
- prefix = props.prefix,
66
- displayValues = props.displayValues,
67
- onDisplayValuesChange = props.onDisplayValuesChange,
68
- emptyOptions = props.emptyOptions,
69
- _props$notFoundConten = props.notFoundContent,
70
- notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,
71
- onClear = props.onClear,
72
- mode = props.mode,
73
- disabled = props.disabled,
74
- loading = props.loading,
75
- getInputElement = props.getInputElement,
76
- getRawInputElement = props.getRawInputElement,
77
- open = props.open,
78
- defaultOpen = props.defaultOpen,
79
- onDropdownVisibleChange = props.onDropdownVisibleChange,
80
- activeValue = props.activeValue,
81
- onActiveValueChange = props.onActiveValueChange,
82
- activeDescendantId = props.activeDescendantId,
83
- searchValue = props.searchValue,
84
- onSearch = props.onSearch,
85
- onSearchSplit = props.onSearchSplit,
86
- tokenSeparators = props.tokenSeparators,
87
- allowClear = props.allowClear,
88
- showArrow = props.showArrow,
89
- inputIcon = props.inputIcon,
90
- clearIcon = props.clearIcon,
91
- OptionList = props.OptionList,
92
- animation = props.animation,
93
- transitionName = props.transitionName,
94
- dropdownStyle = props.dropdownStyle,
95
- dropdownClassName = props.dropdownClassName,
96
- dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
97
- dropdownRender = props.dropdownRender,
98
- dropdownAlign = props.dropdownAlign,
99
- placement = props.placement,
100
- getPopupContainer = props.getPopupContainer,
101
- _props$showAction = props.showAction,
102
- showAction = _props$showAction === void 0 ? [] : _props$showAction,
103
- onFocus = props.onFocus,
104
- onBlur = props.onBlur,
105
- onKeyUp = props.onKeyUp,
106
- onKeyDown = props.onKeyDown,
107
- onMouseDown = props.onMouseDown,
108
- restProps = _objectWithoutProperties(props, _excluded); // ============================== MISC ==============================
109
-
110
-
43
+ prefixCls = props.prefixCls,
44
+ className = props.className,
45
+ showSearch = props.showSearch,
46
+ tagRender = props.tagRender,
47
+ direction = props.direction,
48
+ omitDomProps = props.omitDomProps,
49
+ prefix = props.prefix,
50
+ displayValues = props.displayValues,
51
+ onDisplayValuesChange = props.onDisplayValuesChange,
52
+ emptyOptions = props.emptyOptions,
53
+ _props$notFoundConten = props.notFoundContent,
54
+ notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,
55
+ onClear = props.onClear,
56
+ mode = props.mode,
57
+ disabled = props.disabled,
58
+ loading = props.loading,
59
+ getInputElement = props.getInputElement,
60
+ getRawInputElement = props.getRawInputElement,
61
+ open = props.open,
62
+ defaultOpen = props.defaultOpen,
63
+ onDropdownVisibleChange = props.onDropdownVisibleChange,
64
+ activeValue = props.activeValue,
65
+ onActiveValueChange = props.onActiveValueChange,
66
+ activeDescendantId = props.activeDescendantId,
67
+ searchValue = props.searchValue,
68
+ onSearch = props.onSearch,
69
+ onSearchSplit = props.onSearchSplit,
70
+ tokenSeparators = props.tokenSeparators,
71
+ allowClear = props.allowClear,
72
+ showArrow = props.showArrow,
73
+ inputIcon = props.inputIcon,
74
+ clearIcon = props.clearIcon,
75
+ OptionList = props.OptionList,
76
+ animation = props.animation,
77
+ transitionName = props.transitionName,
78
+ dropdownStyle = props.dropdownStyle,
79
+ dropdownClassName = props.dropdownClassName,
80
+ dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
81
+ dropdownRender = props.dropdownRender,
82
+ dropdownAlign = props.dropdownAlign,
83
+ placement = props.placement,
84
+ getPopupContainer = props.getPopupContainer,
85
+ _props$showAction = props.showAction,
86
+ showAction = _props$showAction === void 0 ? [] : _props$showAction,
87
+ onFocus = props.onFocus,
88
+ onBlur = props.onBlur,
89
+ onKeyUp = props.onKeyUp,
90
+ onKeyDown = props.onKeyDown,
91
+ onMouseDown = props.onMouseDown,
92
+ restProps = _objectWithoutProperties(props, _excluded);
93
+ // ============================== MISC ==============================
111
94
  var multiple = isMultiple(mode);
112
95
  var mergedShowSearch = (showSearch !== undefined ? showSearch : multiple) || mode === 'combobox';
113
-
114
96
  var domProps = _objectSpread({}, restProps);
115
-
116
97
  DEFAULT_OMIT_PROPS.forEach(function (propName) {
117
98
  delete domProps[propName];
118
99
  });
119
100
  omitDomProps === null || omitDomProps === void 0 ? void 0 : omitDomProps.forEach(function (propName) {
120
101
  delete domProps[propName];
121
- }); // ============================= Mobile =============================
122
-
102
+ });
103
+ // ============================= Mobile =============================
123
104
  var _React$useState = React.useState(false),
124
- _React$useState2 = _slicedToArray(_React$useState, 2),
125
- mobile = _React$useState2[0],
126
- setMobile = _React$useState2[1];
127
-
105
+ _React$useState2 = _slicedToArray(_React$useState, 2),
106
+ mobile = _React$useState2[0],
107
+ setMobile = _React$useState2[1];
128
108
  React.useEffect(function () {
129
109
  // Only update on the client side
130
110
  setMobile(isMobile());
131
- }, []); // ============================== Refs ==============================
132
-
111
+ }, []);
112
+ // ============================== Refs ==============================
133
113
  var containerRef = React.useRef(null);
134
114
  var selectorDomRef = React.useRef(null);
135
115
  var triggerRef = React.useRef(null);
136
116
  var selectorRef = React.useRef(null);
137
117
  var listRef = React.useRef(null);
138
118
  /** Used for component focused management */
139
-
140
119
  var _useDelayReset = useDelayReset(),
141
- _useDelayReset2 = _slicedToArray(_useDelayReset, 3),
142
- mockFocused = _useDelayReset2[0],
143
- setMockFocused = _useDelayReset2[1],
144
- cancelSetMockFocused = _useDelayReset2[2]; // =========================== Imperative ===========================
145
-
146
-
120
+ _useDelayReset2 = _slicedToArray(_useDelayReset, 3),
121
+ mockFocused = _useDelayReset2[0],
122
+ setMockFocused = _useDelayReset2[1],
123
+ cancelSetMockFocused = _useDelayReset2[2];
124
+ // =========================== Imperative ===========================
147
125
  React.useImperativeHandle(ref, function () {
148
126
  var _selectorRef$current, _selectorRef$current2;
149
-
150
127
  return {
151
128
  focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,
152
129
  blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,
153
130
  scrollTo: function scrollTo(arg) {
154
131
  var _listRef$current;
155
-
156
132
  return (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(arg);
157
133
  }
158
134
  };
159
- }); // ========================== Search Value ==========================
160
-
135
+ });
136
+ // ========================== Search Value ==========================
161
137
  var mergedSearchValue = React.useMemo(function () {
162
138
  var _displayValues$;
163
-
164
139
  if (mode !== 'combobox') {
165
140
  return searchValue;
166
141
  }
167
-
168
142
  var val = (_displayValues$ = displayValues[0]) === null || _displayValues$ === void 0 ? void 0 : _displayValues$.value;
169
143
  return typeof val === 'string' || typeof val === 'number' ? String(val) : '';
170
- }, [searchValue, mode, displayValues]); // ========================== Custom Input ==========================
144
+ }, [searchValue, mode, displayValues]);
145
+ // ========================== Custom Input ==========================
171
146
  // Only works in `combobox`
172
-
173
- var customizeInputElement = mode === 'combobox' && typeof getInputElement === 'function' && getInputElement() || null; // Used for customize replacement for `rc-cascader`
174
-
147
+ var customizeInputElement = mode === 'combobox' && typeof getInputElement === 'function' && getInputElement() || null;
148
+ // Used for customize replacement for `rc-cascader`
175
149
  var customizeRawInputElement = typeof getRawInputElement === 'function' && getRawInputElement();
176
- var customizeRawInputRef = useComposeRef(selectorDomRef, customizeRawInputElement === null || customizeRawInputElement === void 0 ? void 0 : (_customizeRawInputEle = customizeRawInputElement.props) === null || _customizeRawInputEle === void 0 ? void 0 : _customizeRawInputEle.ref); // ============================== Open ==============================
177
-
150
+ var customizeRawInputRef = useComposeRef(selectorDomRef, customizeRawInputElement === null || customizeRawInputElement === void 0 ? void 0 : (_customizeRawInputEle = customizeRawInputElement.props) === null || _customizeRawInputEle === void 0 ? void 0 : _customizeRawInputEle.ref);
151
+ // ============================== Open ==============================
178
152
  var _useMergedState = useMergedState(undefined, {
179
- defaultValue: defaultOpen,
180
- value: open
181
- }),
182
- _useMergedState2 = _slicedToArray(_useMergedState, 2),
183
- innerOpen = _useMergedState2[0],
184
- setInnerOpen = _useMergedState2[1];
185
-
186
- var mergedOpen = innerOpen; // Not trigger `open` in `combobox` when `notFoundContent` is empty
187
-
153
+ defaultValue: defaultOpen,
154
+ value: open
155
+ }),
156
+ _useMergedState2 = _slicedToArray(_useMergedState, 2),
157
+ innerOpen = _useMergedState2[0],
158
+ setInnerOpen = _useMergedState2[1];
159
+ var mergedOpen = innerOpen;
160
+ // Not trigger `open` in `combobox` when `notFoundContent` is empty
188
161
  var emptyListContent = !notFoundContent && emptyOptions;
189
-
190
162
  if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {
191
163
  mergedOpen = false;
192
164
  }
193
-
194
165
  var triggerOpen = emptyListContent ? false : mergedOpen;
195
166
  var onToggleOpen = React.useCallback(function (newOpen) {
196
167
  var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;
197
-
198
168
  if (mergedOpen !== nextOpen && !disabled) {
199
169
  setInnerOpen(nextOpen);
200
170
  onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 ? void 0 : onDropdownVisibleChange(nextOpen);
201
171
  }
202
- }, [disabled, mergedOpen, setInnerOpen, onDropdownVisibleChange]); // ============================= Search =============================
203
-
172
+ }, [disabled, mergedOpen, setInnerOpen, onDropdownVisibleChange]);
173
+ // ============================= Search =============================
204
174
  var tokenWithEnter = React.useMemo(function () {
205
175
  return (tokenSeparators || []).some(function (tokenSeparator) {
206
176
  return ['\n', '\r\n'].includes(tokenSeparator);
207
177
  });
208
178
  }, [tokenSeparators]);
209
-
210
179
  var onInternalSearch = function onInternalSearch(searchText, fromTyping, isCompositing) {
211
180
  var ret = true;
212
181
  var newSearchText = searchText;
213
- onActiveValueChange === null || onActiveValueChange === void 0 ? void 0 : onActiveValueChange(null); // Check if match the `tokenSeparators`
214
-
215
- var patchLabels = isCompositing ? null : getSeparatedContent(searchText, tokenSeparators); // Ignore combobox since it's not split-able
216
-
182
+ onActiveValueChange === null || onActiveValueChange === void 0 ? void 0 : onActiveValueChange(null);
183
+ // Check if match the `tokenSeparators`
184
+ var patchLabels = isCompositing ? null : getSeparatedContent(searchText, tokenSeparators);
185
+ // Ignore combobox since it's not split-able
217
186
  if (mode !== 'combobox' && patchLabels) {
218
187
  newSearchText = '';
219
- onSearchSplit === null || onSearchSplit === void 0 ? void 0 : onSearchSplit(patchLabels); // Should close when paste finish
220
-
221
- onToggleOpen(false); // Tell Selector that break next actions
222
-
188
+ onSearchSplit === null || onSearchSplit === void 0 ? void 0 : onSearchSplit(patchLabels);
189
+ // Should close when paste finish
190
+ onToggleOpen(false);
191
+ // Tell Selector that break next actions
223
192
  ret = false;
224
193
  }
225
-
226
194
  if (onSearch && mergedSearchValue !== newSearchText) {
227
195
  onSearch(newSearchText, {
228
196
  source: fromTyping ? 'typing' : 'effect'
229
197
  });
230
198
  }
231
-
232
199
  return ret;
233
- }; // Only triggered when menu is closed & mode is tags
200
+ };
201
+ // Only triggered when menu is closed & mode is tags
234
202
  // If menu is open, OptionList will take charge
235
203
  // If mode isn't tags, press enter is not meaningful when you can't see any option
236
-
237
-
238
204
  var onInternalSearchSubmit = function onInternalSearchSubmit(searchText) {
239
205
  // prevent empty tags from appearing when you click the Enter button
240
206
  if (!searchText || !searchText.trim()) {
241
207
  return;
242
208
  }
243
-
244
209
  onSearch(searchText, {
245
210
  source: 'submit'
246
211
  });
247
- }; // Close will clean up single mode search text
248
-
249
-
212
+ };
213
+ // Close will clean up single mode search text
250
214
  React.useEffect(function () {
251
215
  if (!mergedOpen && !multiple && mode !== 'combobox') {
252
216
  onInternalSearch('', false, false);
253
217
  }
254
- }, [mergedOpen]); // ============================ Disabled ============================
218
+ }, [mergedOpen]);
219
+ // ============================ Disabled ============================
255
220
  // Close dropdown & remove focus state when disabled change
256
-
257
221
  React.useEffect(function () {
258
222
  if (innerOpen && disabled) {
259
223
  setInnerOpen(false);
260
224
  }
261
-
262
225
  if (disabled) {
263
226
  setMockFocused(false);
264
227
  }
265
- }, [disabled]); // ============================ Keyboard ============================
266
-
228
+ }, [disabled]);
229
+ // ============================ Keyboard ============================
267
230
  /**
268
231
  * We record input value here to check if can press to clean up by backspace
269
232
  * - null: Key is not down, this is reset by key up
270
233
  * - true: Search text is empty when first time backspace down
271
234
  * - false: Search text is not empty when first time backspace down
272
235
  */
273
-
274
236
  var _useLock = useLock(),
275
- _useLock2 = _slicedToArray(_useLock, 2),
276
- getClearLock = _useLock2[0],
277
- setClearLock = _useLock2[1]; // KeyDown
278
-
279
-
237
+ _useLock2 = _slicedToArray(_useLock, 2),
238
+ getClearLock = _useLock2[0],
239
+ setClearLock = _useLock2[1];
240
+ // KeyDown
280
241
  var onInternalKeyDown = function onInternalKeyDown(event) {
281
242
  var clearLock = getClearLock();
282
243
  var which = event.which;
283
-
284
244
  if (which === KeyCode.ENTER) {
285
245
  // Do not submit form when type in the input
286
246
  if (mode !== 'combobox') {
287
247
  event.preventDefault();
288
- } // We only manage open state here, close logic should handle by list component
289
-
290
-
248
+ }
249
+ // We only manage open state here, close logic should handle by list component
291
250
  if (!mergedOpen) {
292
251
  onToggleOpen(true);
293
252
  }
294
253
  }
295
-
296
- setClearLock(!!mergedSearchValue); // Remove value by `backspace`
297
-
254
+ setClearLock(!!mergedSearchValue);
255
+ // Remove value by `backspace`
298
256
  if (which === KeyCode.BACKSPACE && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
299
257
  var cloneDisplayValues = _toConsumableArray(displayValues);
300
-
301
258
  var removedDisplayValue = null;
302
-
303
259
  for (var i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
304
260
  var current = cloneDisplayValues[i];
305
-
306
261
  if (!current.disabled) {
307
262
  cloneDisplayValues.splice(i, 1);
308
263
  removedDisplayValue = current;
309
264
  break;
310
265
  }
311
266
  }
312
-
313
267
  if (removedDisplayValue) {
314
268
  onDisplayValuesChange(cloneDisplayValues, {
315
269
  type: 'remove',
@@ -317,36 +271,27 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
317
271
  });
318
272
  }
319
273
  }
320
-
321
274
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
322
275
  rest[_key - 1] = arguments[_key];
323
276
  }
324
-
325
277
  if (mergedOpen && listRef.current) {
326
278
  var _listRef$current2;
327
-
328
279
  (_listRef$current2 = listRef.current).onKeyDown.apply(_listRef$current2, [event].concat(rest));
329
280
  }
330
-
331
281
  onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown.apply(void 0, [event].concat(rest));
332
- }; // KeyUp
333
-
334
-
282
+ };
283
+ // KeyUp
335
284
  var onInternalKeyUp = function onInternalKeyUp(event) {
336
285
  for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
337
286
  rest[_key2 - 1] = arguments[_key2];
338
287
  }
339
-
340
288
  if (mergedOpen && listRef.current) {
341
289
  var _listRef$current3;
342
-
343
290
  (_listRef$current3 = listRef.current).onKeyUp.apply(_listRef$current3, [event].concat(rest));
344
291
  }
345
-
346
292
  onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp.apply(void 0, [event].concat(rest));
347
- }; // ============================ Selector ============================
348
-
349
-
293
+ };
294
+ // ============================ Selector ============================
350
295
  var onSelectorRemove = function onSelectorRemove(val) {
351
296
  var newValues = displayValues.filter(function (i) {
352
297
  return i !== val;
@@ -355,40 +300,31 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
355
300
  type: 'remove',
356
301
  values: [val]
357
302
  });
358
- }; // ========================== Focus / Blur ==========================
359
-
303
+ };
304
+ // ========================== Focus / Blur ==========================
360
305
  /** Record real focus status */
361
-
362
-
363
306
  var focusRef = React.useRef(false);
364
-
365
307
  var onContainerFocus = function onContainerFocus() {
366
308
  setMockFocused(true);
367
-
368
309
  if (!disabled) {
369
310
  if (onFocus && !focusRef.current) {
370
311
  onFocus.apply(void 0, arguments);
371
- } // `showAction` should handle `focus` if set
372
-
373
-
312
+ }
313
+ // `showAction` should handle `focus` if set
374
314
  if (showAction.includes('focus')) {
375
315
  onToggleOpen(true);
376
316
  }
377
317
  }
378
-
379
318
  focusRef.current = true;
380
319
  };
381
-
382
320
  var onContainerBlur = function onContainerBlur() {
383
321
  setMockFocused(false, function () {
384
322
  focusRef.current = false;
385
323
  onToggleOpen(false);
386
324
  });
387
-
388
325
  if (disabled) {
389
326
  return;
390
327
  }
391
-
392
328
  if (mergedSearchValue) {
393
329
  // `tags` mode should move `searchValue` into values
394
330
  if (mode === 'tags') {
@@ -402,13 +338,11 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
402
338
  });
403
339
  }
404
340
  }
405
-
406
341
  if (onBlur) {
407
342
  onBlur.apply(void 0, arguments);
408
343
  }
409
- }; // Give focus back of Select
410
-
411
-
344
+ };
345
+ // Give focus back of Select
412
346
  var activeTimeoutIds = [];
413
347
  React.useEffect(function () {
414
348
  return function () {
@@ -418,81 +352,64 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
418
352
  activeTimeoutIds.splice(0, activeTimeoutIds.length);
419
353
  };
420
354
  }, []);
421
-
422
355
  var onInternalMouseDown = function onInternalMouseDown(event) {
423
356
  var _triggerRef$current;
424
-
425
357
  var target = event.target;
426
- var popupElement = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement(); // We should give focus back to selector if clicked item is not focusable
427
-
358
+ var popupElement = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement();
359
+ // We should give focus back to selector if clicked item is not focusable
428
360
  if (popupElement && popupElement.contains(target)) {
429
361
  var timeoutId = setTimeout(function () {
430
362
  var index = activeTimeoutIds.indexOf(timeoutId);
431
-
432
363
  if (index !== -1) {
433
364
  activeTimeoutIds.splice(index, 1);
434
365
  }
435
-
436
366
  cancelSetMockFocused();
437
-
438
367
  if (!mobile && !popupElement.contains(document.activeElement)) {
439
368
  var _selectorRef$current3;
440
-
441
369
  (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 ? void 0 : _selectorRef$current3.focus();
442
370
  }
443
371
  });
444
372
  activeTimeoutIds.push(timeoutId);
445
373
  }
446
-
447
374
  for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
448
375
  restArgs[_key3 - 1] = arguments[_key3];
449
376
  }
450
-
451
377
  onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown.apply(void 0, [event].concat(restArgs));
452
- }; // ============================ Dropdown ============================
453
-
454
-
378
+ };
379
+ // ============================ Dropdown ============================
455
380
  var _React$useState3 = React.useState(null),
456
- _React$useState4 = _slicedToArray(_React$useState3, 2),
457
- containerWidth = _React$useState4[0],
458
- setContainerWidth = _React$useState4[1];
459
-
381
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
382
+ containerWidth = _React$useState4[0],
383
+ setContainerWidth = _React$useState4[1];
460
384
  var _React$useState5 = React.useState({}),
461
- _React$useState6 = _slicedToArray(_React$useState5, 2),
462
- forceUpdate = _React$useState6[1]; // We need force update here since popup dom is render async
463
-
464
-
385
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
386
+ forceUpdate = _React$useState6[1];
387
+ // We need force update here since popup dom is render async
465
388
  function onPopupMouseEnter() {
466
389
  forceUpdate({});
467
390
  }
468
-
469
391
  useLayoutEffect(function () {
470
392
  if (triggerOpen) {
471
393
  var _containerRef$current;
472
-
473
394
  var newWidth = Math.ceil((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth);
474
-
475
395
  if (containerWidth !== newWidth && !Number.isNaN(newWidth)) {
476
396
  setContainerWidth(newWidth);
477
397
  }
478
398
  }
479
- }, [triggerOpen]); // Used for raw custom input trigger
480
-
399
+ }, [triggerOpen]);
400
+ // Used for raw custom input trigger
481
401
  var onTriggerVisibleChange;
482
-
483
402
  if (customizeRawInputElement) {
484
403
  onTriggerVisibleChange = function onTriggerVisibleChange(newOpen) {
485
404
  onToggleOpen(newOpen);
486
405
  };
487
- } // Close when click on non-select element
488
-
489
-
406
+ }
407
+ // Close when click on non-select element
490
408
  useSelectTriggerControl(function () {
491
409
  var _triggerRef$current2;
492
-
493
410
  return [containerRef.current, (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.getPopupElement()];
494
- }, triggerOpen, onToggleOpen, !!customizeRawInputElement); // ============================ Context =============================
495
-
411
+ }, triggerOpen, onToggleOpen, !!customizeRawInputElement);
412
+ // ============================ Context =============================
496
413
  var baseSelectContext = React.useMemo(function () {
497
414
  return _objectSpread(_objectSpread({}, props), {}, {
498
415
  notFoundContent: notFoundContent,
@@ -503,14 +420,13 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
503
420
  multiple: multiple,
504
421
  toggleOpen: onToggleOpen
505
422
  });
506
- }, [props, notFoundContent, triggerOpen, mergedOpen, id, mergedShowSearch, multiple, onToggleOpen]); // ==================================================================
423
+ }, [props, notFoundContent, triggerOpen, mergedOpen, id, mergedShowSearch, multiple, onToggleOpen]);
424
+ // ==================================================================
507
425
  // == Render ==
508
426
  // ==================================================================
509
427
  // ============================= Arrow ==============================
510
-
511
428
  var mergedShowArrow = showArrow !== undefined ? showArrow : loading || !multiple && mode !== 'combobox';
512
429
  var arrowNode;
513
-
514
430
  if (mergedShowArrow) {
515
431
  arrowNode = /*#__PURE__*/React.createElement(TransBtn, {
516
432
  className: classNames("".concat(prefixCls, "-arrow"), _defineProperty({}, "".concat(prefixCls, "-arrow-loading"), loading)),
@@ -523,11 +439,9 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
523
439
  showSearch: mergedShowSearch
524
440
  }
525
441
  });
526
- } // ============================= Clear ==============================
527
-
528
-
442
+ }
443
+ // ============================= Clear ==============================
529
444
  var clearNode;
530
-
531
445
  var onClearMouseDown = function onClearMouseDown() {
532
446
  onClear === null || onClear === void 0 ? void 0 : onClear();
533
447
  onDisplayValuesChange([], {
@@ -536,22 +450,20 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
536
450
  });
537
451
  onInternalSearch('', false, false);
538
452
  };
539
-
540
453
  if (!disabled && allowClear && (displayValues.length || mergedSearchValue)) {
541
454
  clearNode = /*#__PURE__*/React.createElement(TransBtn, {
542
455
  className: "".concat(prefixCls, "-clear"),
543
456
  onMouseDown: onClearMouseDown,
544
457
  customizeIcon: clearIcon
545
458
  }, "\xD7");
546
- } // =========================== OptionList ===========================
547
-
548
-
459
+ }
460
+ // =========================== OptionList ===========================
549
461
  var optionList = /*#__PURE__*/React.createElement(OptionList, {
550
462
  ref: listRef
551
- }); // ============================= Select =============================
552
-
553
- var mergedClassName = classNames(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-focused"), mockFocused), _defineProperty(_classNames2, "".concat(prefixCls, "-multiple"), multiple), _defineProperty(_classNames2, "".concat(prefixCls, "-single"), !multiple), _defineProperty(_classNames2, "".concat(prefixCls, "-allow-clear"), allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-show-arrow"), mergedShowArrow), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames2, "".concat(prefixCls, "-loading"), loading), _defineProperty(_classNames2, "".concat(prefixCls, "-open"), mergedOpen), _defineProperty(_classNames2, "".concat(prefixCls, "-customize-input"), customizeInputElement), _defineProperty(_classNames2, "".concat(prefixCls, "-show-search"), mergedShowSearch), _classNames2)); // >>> Selector
554
-
463
+ });
464
+ // ============================= Select =============================
465
+ var mergedClassName = classNames(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-focused"), mockFocused), _defineProperty(_classNames2, "".concat(prefixCls, "-multiple"), multiple), _defineProperty(_classNames2, "".concat(prefixCls, "-single"), !multiple), _defineProperty(_classNames2, "".concat(prefixCls, "-allow-clear"), allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-show-arrow"), mergedShowArrow), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames2, "".concat(prefixCls, "-loading"), loading), _defineProperty(_classNames2, "".concat(prefixCls, "-open"), mergedOpen), _defineProperty(_classNames2, "".concat(prefixCls, "-customize-input"), customizeInputElement), _defineProperty(_classNames2, "".concat(prefixCls, "-show-search"), mergedShowSearch), _classNames2));
466
+ // >>> Selector
555
467
  var selectorNode = /*#__PURE__*/React.createElement(SelectTrigger, {
556
468
  ref: triggerRef,
557
469
  disabled: disabled,
@@ -577,7 +489,7 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
577
489
  onPopupMouseEnter: onPopupMouseEnter
578
490
  }, customizeRawInputElement ? /*#__PURE__*/React.cloneElement(customizeRawInputElement, {
579
491
  ref: customizeRawInputRef
580
- }) : /*#__PURE__*/React.createElement(Selector, Object.assign({}, props, {
492
+ }) : /*#__PURE__*/React.createElement(Selector, _objectSpread(_objectSpread({}, props), {}, {
581
493
  domRef: selectorDomRef,
582
494
  prefixCls: prefixCls,
583
495
  prefix: prefix,
@@ -597,16 +509,16 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
597
509
  onSearchSubmit: onInternalSearchSubmit,
598
510
  onRemove: onSelectorRemove,
599
511
  tokenWithEnter: tokenWithEnter
600
- }))); // >>> Render
601
-
602
- var renderNode; // Render raw
603
-
512
+ })));
513
+ // >>> Render
514
+ var renderNode;
515
+ // Render raw
604
516
  if (customizeRawInputElement) {
605
517
  renderNode = selectorNode;
606
518
  } else {
607
- renderNode = /*#__PURE__*/React.createElement("div", Object.assign({
519
+ renderNode = /*#__PURE__*/React.createElement("div", _objectSpread(_objectSpread({
608
520
  className: mergedClassName
609
- }, domProps, {
521
+ }, domProps), {}, {
610
522
  ref: containerRef,
611
523
  onMouseDown: onInternalMouseDown,
612
524
  onKeyDown: onInternalKeyDown,
@@ -624,18 +536,16 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
624
536
  "aria-live": "polite"
625
537
  }, "".concat(displayValues.map(function (_ref) {
626
538
  var label = _ref.label,
627
- value = _ref.value;
539
+ value = _ref.value;
628
540
  return ['number', 'string'].includes(_typeof(label)) ? label : value;
629
541
  }).join(', '))), selectorNode, arrowNode, clearNode);
630
542
  }
631
-
632
543
  return /*#__PURE__*/React.createElement(BaseSelectContext.Provider, {
633
544
  value: baseSelectContext
634
545
  }, renderNode);
635
- }); // Set display name for dev
636
-
546
+ });
547
+ // Set display name for dev
637
548
  if (process.env.NODE_ENV !== 'production') {
638
549
  BaseSelect.displayName = 'BaseSelect';
639
550
  }
640
-
641
551
  export default BaseSelect;