@aloudata/aloudata-design 0.2.7 → 0.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/es/Avatar/index.d.ts +15 -0
  2. package/es/Avatar/index.js +33 -0
  3. package/es/Avatar/style/index.d.ts +2 -0
  4. package/es/Avatar/style/index.js +2 -0
  5. package/es/Avatar/style/index.less +34 -0
  6. package/es/Breadcrumb/index.d.ts +8 -0
  7. package/es/Breadcrumb/index.js +36 -0
  8. package/es/Breadcrumb/style/index.d.ts +2 -0
  9. package/es/Breadcrumb/style/index.js +2 -0
  10. package/es/Breadcrumb/style/index.less +28 -0
  11. package/es/Button/index.d.ts +4 -4
  12. package/es/Button/index.js +28 -23
  13. package/es/Button/style/index.less +163 -130
  14. package/es/Button/style/variables.less +60 -0
  15. package/es/Checkbox/style/index.less +16 -1
  16. package/es/ConfigProvider/index.d.ts +1 -0
  17. package/es/ConfigProvider/index.js +1 -0
  18. package/es/Dropdown/Button.js +1 -1
  19. package/es/Dropdown/style/index.less +41 -8
  20. package/es/Empty/image/Authority.d.ts +3 -0
  21. package/es/Empty/image/Authority.js +360 -0
  22. package/es/Empty/image/Dataspace.d.ts +3 -0
  23. package/es/Empty/image/Dataspace.js +271 -0
  24. package/es/Empty/image/Search.d.ts +3 -0
  25. package/es/Empty/image/Search.js +156 -0
  26. package/es/Empty/image/Simple.d.ts +3 -0
  27. package/es/Empty/image/Simple.js +20 -0
  28. package/es/Empty/image/Worksheet.d.ts +3 -0
  29. package/es/Empty/image/Worksheet.js +270 -0
  30. package/es/Empty/image/empty.d.ts +3 -0
  31. package/es/Empty/image/empty.js +139 -0
  32. package/es/Empty/index.d.ts +21 -5
  33. package/es/Empty/index.js +84 -54
  34. package/es/Empty/style/index.less +56 -11
  35. package/es/Icon/index.d.ts +2 -2
  36. package/es/Icon/index.js +10 -2
  37. package/es/Input/components/Group/index.d.ts +4 -2
  38. package/es/Input/components/Group/index.js +23 -1
  39. package/es/Input/components/Input/index.d.ts +1 -1
  40. package/es/Input/components/Input/index.js +12 -0
  41. package/es/Input/components/Password/index.d.ts +7 -1
  42. package/es/Input/components/Password/index.js +25 -3
  43. package/es/Input/style/index.less +278 -43
  44. package/es/InputNumber/index.d.ts +4 -0
  45. package/es/InputNumber/index.js +32 -0
  46. package/es/InputNumber/style/index.d.ts +2 -0
  47. package/es/InputNumber/style/index.js +2 -0
  48. package/es/InputNumber/style/index.less +152 -0
  49. package/es/Menu/Divider.d.ts +2 -1
  50. package/es/Menu/MenuItem.d.ts +2 -1
  51. package/es/Menu/SubMenu.d.ts +2 -1
  52. package/es/Menu/SubMenu.js +1 -1
  53. package/es/Menu/index.d.ts +2 -1
  54. package/es/Menu/style/index.less +1 -2
  55. package/es/Modal/index.d.ts +21 -0
  56. package/es/Modal/index.js +93 -0
  57. package/es/Modal/style/index.d.ts +2 -0
  58. package/es/Modal/style/index.js +2 -0
  59. package/es/Modal/style/index.less +206 -0
  60. package/es/Navigator/components/Header/index.d.ts +9 -0
  61. package/es/Navigator/components/Header/index.js +18 -0
  62. package/es/Navigator/components/Menu/index.d.ts +7 -13
  63. package/es/Navigator/components/Menu/index.js +26 -119
  64. package/es/Navigator/components/MenuItem/index.d.ts +21 -0
  65. package/es/Navigator/components/MenuItem/index.js +39 -0
  66. package/es/Navigator/index.d.ts +19 -8
  67. package/es/Navigator/index.js +6 -15
  68. package/es/Navigator/style/bg.png +0 -0
  69. package/es/Navigator/style/index.less +58 -166
  70. package/es/Popover/index.d.ts +5 -0
  71. package/es/Popover/index.js +22 -0
  72. package/es/Popover/style/index.d.ts +2 -0
  73. package/es/Popover/style/index.js +2 -0
  74. package/es/Popover/style/index.less +37 -0
  75. package/es/Radio/index.d.ts +2 -3
  76. package/es/Select/index.d.ts +36 -9
  77. package/es/Select/index.js +154 -7
  78. package/es/Select/rc-select/BaseSelect.d.ts +116 -0
  79. package/es/Select/rc-select/BaseSelect.js +641 -0
  80. package/es/Select/rc-select/OptGroup.d.ts +12 -0
  81. package/es/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
  82. package/es/Select/rc-select/Option.d.ts +14 -0
  83. package/es/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
  84. package/es/Select/rc-select/OptionList.d.ts +10 -0
  85. package/es/Select/rc-select/OptionList.js +401 -0
  86. package/es/Select/rc-select/Select.d.ts +109 -0
  87. package/es/Select/rc-select/Select.js +547 -0
  88. package/es/Select/rc-select/SelectContext.d.ts +20 -0
  89. package/es/Select/rc-select/SelectContext.js +4 -0
  90. package/es/Select/rc-select/SelectTrigger.d.ts +30 -0
  91. package/es/Select/rc-select/SelectTrigger.js +136 -0
  92. package/es/Select/rc-select/Selector/Input.d.ts +26 -0
  93. package/es/Select/rc-select/Selector/Input.js +114 -0
  94. package/es/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
  95. package/es/Select/rc-select/Selector/MultipleSelector.js +236 -0
  96. package/es/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
  97. package/es/Select/rc-select/Selector/SingleSelector.js +112 -0
  98. package/es/Select/rc-select/Selector/index.d.ts +80 -0
  99. package/es/Select/rc-select/Selector/index.js +194 -0
  100. package/es/Select/rc-select/TransBtn.d.ts +12 -0
  101. package/es/Select/rc-select/TransBtn.js +42 -0
  102. package/es/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
  103. package/es/Select/rc-select/hooks/useBaseProps.js +11 -0
  104. package/es/Select/rc-select/hooks/useCache.d.ts +7 -0
  105. package/es/Select/rc-select/hooks/useCache.js +49 -0
  106. package/es/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
  107. package/es/Select/rc-select/hooks/useDelayReset.js +50 -0
  108. package/es/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
  109. package/es/Select/rc-select/hooks/useFilterOptions.js +75 -0
  110. package/es/Select/rc-select/hooks/useId.d.ts +5 -0
  111. package/es/Select/rc-select/hooks/useId.js +47 -0
  112. package/es/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
  113. package/es/Select/rc-select/hooks/useLayoutEffect.js +17 -0
  114. package/es/Select/rc-select/hooks/useLock.d.ts +7 -0
  115. package/es/Select/rc-select/hooks/useLock.js +35 -0
  116. package/es/Select/rc-select/hooks/useOptions.d.ts +11 -0
  117. package/es/Select/rc-select/hooks/useOptions.js +53 -0
  118. package/es/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
  119. package/es/Select/rc-select/hooks/useRefFunc.js +15 -0
  120. package/es/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
  121. package/es/Select/rc-select/hooks/useSelectTriggerControl.js +40 -0
  122. package/es/Select/rc-select/index.d.ts +10 -0
  123. package/es/Select/rc-select/index.js +7 -0
  124. package/es/Select/rc-select/interface.d.ts +10 -0
  125. package/es/Select/{interface.js → rc-select/interface.js} +0 -0
  126. package/es/Select/rc-select/utils/commonUtil.d.ts +4 -0
  127. package/es/Select/rc-select/utils/commonUtil.js +12 -0
  128. package/es/Select/rc-select/utils/keyUtil.d.ts +2 -0
  129. package/es/Select/rc-select/utils/keyUtil.js +8 -0
  130. package/es/Select/rc-select/utils/legacyUtil.d.ts +3 -0
  131. package/es/Select/rc-select/utils/legacyUtil.js +58 -0
  132. package/es/Select/rc-select/utils/platformUtil.d.ts +1 -0
  133. package/es/Select/rc-select/utils/platformUtil.js +4 -0
  134. package/es/Select/rc-select/utils/valueUtil.d.ts +22 -0
  135. package/es/Select/rc-select/utils/valueUtil.js +157 -0
  136. package/es/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
  137. package/es/Select/rc-select/utils/warningPropsUtil.js +114 -0
  138. package/es/Select/style/index.d.ts +2 -0
  139. package/es/Select/style/index.js +4 -1
  140. package/es/Select/style/index.less +173 -494
  141. package/es/Select/style/multiple.less +222 -0
  142. package/es/Select/style/rtl.less +168 -0
  143. package/es/Select/style/select.less +337 -0
  144. package/es/Select/style/single.less +179 -0
  145. package/es/Select/style/status.less +48 -0
  146. package/es/Select/style/variables.less +56 -0
  147. package/es/Select/style/variables.less.d.ts +97 -0
  148. package/es/Select/utils/iconUtil.d.ts +24 -0
  149. package/es/Select/utils/iconUtil.js +87 -0
  150. package/es/Space/index.d.ts +1 -1
  151. package/es/Space/index.js +0 -1
  152. package/es/Table/Table.d.ts +6 -0
  153. package/es/Table/Table.js +464 -0
  154. package/es/Table/components/Empty/empty-img.png +0 -0
  155. package/es/Table/components/Empty/index.d.ts +4 -0
  156. package/es/Table/components/Empty/index.js +16 -0
  157. package/es/Table/components/Empty/index.less +24 -0
  158. package/es/Table/index.d.ts +2 -4
  159. package/es/Table/index.js +2 -463
  160. package/es/Table/interface.d.ts +11 -15
  161. package/es/Table/style/index.less +44 -21
  162. package/es/Tabs/style/index.less +39 -7
  163. package/es/Tooltip/style/index.less +2 -1
  164. package/es/index.d.ts +14 -2
  165. package/es/index.js +7 -1
  166. package/es/style/index.less +2 -1
  167. package/es/style/mixins/index.less +8 -0
  168. package/es/style/themes/default/index.less +10 -10
  169. package/es/style/themes/default/themeColor.module.less +58 -94
  170. package/es/style/themes/default/themeColor.module.less.d.ts +1 -17
  171. package/lib/Avatar/index.d.ts +15 -0
  172. package/lib/Avatar/index.js +57 -0
  173. package/lib/Avatar/style/index.d.ts +2 -0
  174. package/lib/Avatar/style/index.js +5 -0
  175. package/lib/Avatar/style/index.less +34 -0
  176. package/lib/Breadcrumb/index.d.ts +8 -0
  177. package/lib/Breadcrumb/index.js +50 -0
  178. package/lib/Breadcrumb/style/index.d.ts +2 -0
  179. package/lib/Breadcrumb/style/index.js +5 -0
  180. package/lib/Breadcrumb/style/index.less +28 -0
  181. package/lib/Button/index.d.ts +4 -4
  182. package/lib/Button/index.js +28 -24
  183. package/lib/Button/style/index.less +163 -130
  184. package/lib/Button/style/variables.less +60 -0
  185. package/lib/Checkbox/style/index.less +16 -1
  186. package/lib/ConfigProvider/index.d.ts +1 -0
  187. package/lib/ConfigProvider/index.js +26 -0
  188. package/lib/Dropdown/Button.js +1 -1
  189. package/lib/Dropdown/style/index.less +41 -8
  190. package/lib/Empty/image/Authority.d.ts +3 -0
  191. package/lib/Empty/image/Authority.js +374 -0
  192. package/lib/Empty/image/Dataspace.d.ts +3 -0
  193. package/lib/Empty/image/Dataspace.js +285 -0
  194. package/lib/Empty/image/Search.d.ts +3 -0
  195. package/lib/Empty/image/Search.js +170 -0
  196. package/lib/Empty/image/Simple.d.ts +3 -0
  197. package/lib/Empty/image/Simple.js +34 -0
  198. package/lib/Empty/image/Worksheet.d.ts +3 -0
  199. package/lib/Empty/image/Worksheet.js +284 -0
  200. package/lib/Empty/image/empty.d.ts +3 -0
  201. package/lib/Empty/image/empty.js +153 -0
  202. package/lib/Empty/index.d.ts +21 -5
  203. package/lib/Empty/index.js +94 -53
  204. package/lib/Empty/style/index.less +56 -11
  205. package/lib/Icon/index.d.ts +2 -2
  206. package/lib/Icon/index.js +10 -2
  207. package/lib/Input/components/Group/index.d.ts +4 -2
  208. package/lib/Input/components/Group/index.js +24 -1
  209. package/lib/Input/components/Input/index.d.ts +1 -1
  210. package/lib/Input/components/Input/index.js +13 -0
  211. package/lib/Input/components/Password/index.d.ts +7 -1
  212. package/lib/Input/components/Password/index.js +25 -2
  213. package/lib/Input/style/index.less +278 -43
  214. package/lib/InputNumber/index.d.ts +4 -0
  215. package/lib/InputNumber/index.js +45 -0
  216. package/lib/InputNumber/style/index.d.ts +2 -0
  217. package/lib/InputNumber/style/index.js +5 -0
  218. package/lib/InputNumber/style/index.less +152 -0
  219. package/lib/Menu/Divider.d.ts +2 -1
  220. package/lib/Menu/MenuItem.d.ts +2 -1
  221. package/lib/Menu/SubMenu.d.ts +2 -1
  222. package/lib/Menu/SubMenu.js +1 -1
  223. package/lib/Menu/index.d.ts +2 -1
  224. package/lib/Menu/style/index.less +1 -2
  225. package/lib/Modal/index.d.ts +21 -0
  226. package/lib/Modal/index.js +119 -0
  227. package/lib/Modal/style/index.d.ts +2 -0
  228. package/lib/Modal/style/index.js +5 -0
  229. package/lib/Modal/style/index.less +206 -0
  230. package/lib/Navigator/components/Header/index.d.ts +9 -0
  231. package/lib/Navigator/components/Header/index.js +28 -0
  232. package/lib/Navigator/components/Menu/index.d.ts +7 -13
  233. package/lib/Navigator/components/Menu/index.js +25 -118
  234. package/lib/Navigator/components/MenuItem/index.d.ts +21 -0
  235. package/lib/Navigator/components/MenuItem/index.js +56 -0
  236. package/lib/Navigator/index.d.ts +19 -8
  237. package/lib/Navigator/index.js +7 -15
  238. package/lib/Navigator/style/bg.png +0 -0
  239. package/lib/Navigator/style/index.less +58 -166
  240. package/lib/Popover/index.d.ts +5 -0
  241. package/lib/Popover/index.js +35 -0
  242. package/lib/Popover/style/index.d.ts +2 -0
  243. package/lib/Popover/style/index.js +5 -0
  244. package/lib/Popover/style/index.less +37 -0
  245. package/lib/Radio/index.d.ts +2 -3
  246. package/lib/Select/index.d.ts +36 -9
  247. package/lib/Select/index.js +166 -18
  248. package/lib/Select/rc-select/BaseSelect.d.ts +116 -0
  249. package/lib/Select/rc-select/BaseSelect.js +672 -0
  250. package/lib/Select/rc-select/OptGroup.d.ts +12 -0
  251. package/lib/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
  252. package/lib/Select/rc-select/Option.d.ts +14 -0
  253. package/lib/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
  254. package/lib/Select/rc-select/OptionList.d.ts +10 -0
  255. package/lib/Select/rc-select/OptionList.js +427 -0
  256. package/lib/Select/rc-select/Select.d.ts +109 -0
  257. package/lib/Select/rc-select/Select.js +545 -0
  258. package/lib/Select/rc-select/SelectContext.d.ts +20 -0
  259. package/lib/Select/rc-select/SelectContext.js +19 -0
  260. package/lib/Select/rc-select/SelectTrigger.d.ts +30 -0
  261. package/lib/Select/rc-select/SelectTrigger.js +153 -0
  262. package/lib/Select/rc-select/Selector/Input.d.ts +26 -0
  263. package/lib/Select/rc-select/Selector/Input.js +132 -0
  264. package/lib/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
  265. package/lib/Select/rc-select/Selector/MultipleSelector.js +257 -0
  266. package/lib/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
  267. package/lib/Select/rc-select/Selector/SingleSelector.js +129 -0
  268. package/lib/Select/rc-select/Selector/index.d.ts +80 -0
  269. package/lib/Select/rc-select/Selector/index.js +203 -0
  270. package/lib/Select/rc-select/TransBtn.d.ts +12 -0
  271. package/lib/Select/rc-select/TransBtn.js +59 -0
  272. package/lib/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
  273. package/lib/Select/rc-select/hooks/useBaseProps.js +28 -0
  274. package/lib/Select/rc-select/hooks/useCache.d.ts +7 -0
  275. package/lib/Select/rc-select/hooks/useCache.js +63 -0
  276. package/lib/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
  277. package/lib/Select/rc-select/hooks/useDelayReset.js +62 -0
  278. package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
  279. package/lib/Select/rc-select/hooks/useFilterOptions.js +91 -0
  280. package/lib/Select/rc-select/hooks/useId.d.ts +5 -0
  281. package/lib/Select/rc-select/hooks/useId.js +68 -0
  282. package/lib/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
  283. package/lib/Select/rc-select/hooks/useLayoutEffect.js +32 -0
  284. package/lib/Select/rc-select/hooks/useLock.d.ts +7 -0
  285. package/lib/Select/rc-select/hooks/useLock.js +49 -0
  286. package/lib/Select/rc-select/hooks/useOptions.d.ts +11 -0
  287. package/lib/Select/rc-select/hooks/useOptions.js +68 -0
  288. package/lib/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
  289. package/lib/Select/rc-select/hooks/useRefFunc.js +29 -0
  290. package/lib/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
  291. package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +54 -0
  292. package/lib/Select/rc-select/index.d.ts +10 -0
  293. package/lib/Select/rc-select/index.js +45 -0
  294. package/lib/Select/rc-select/interface.d.ts +10 -0
  295. package/lib/Select/{interface.js → rc-select/interface.js} +0 -0
  296. package/lib/Select/rc-select/utils/commonUtil.d.ts +4 -0
  297. package/lib/Select/rc-select/utils/commonUtil.js +23 -0
  298. package/lib/Select/rc-select/utils/keyUtil.d.ts +2 -0
  299. package/lib/Select/rc-select/utils/keyUtil.js +17 -0
  300. package/lib/Select/rc-select/utils/legacyUtil.d.ts +3 -0
  301. package/lib/Select/rc-select/utils/legacyUtil.js +73 -0
  302. package/lib/Select/rc-select/utils/platformUtil.d.ts +1 -0
  303. package/lib/Select/rc-select/utils/platformUtil.js +11 -0
  304. package/lib/Select/rc-select/utils/valueUtil.d.ts +22 -0
  305. package/lib/Select/rc-select/utils/valueUtil.js +172 -0
  306. package/lib/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
  307. package/lib/Select/rc-select/utils/warningPropsUtil.js +132 -0
  308. package/lib/Select/style/index.d.ts +2 -0
  309. package/lib/Select/style/index.js +4 -0
  310. package/lib/Select/style/index.less +173 -494
  311. package/lib/Select/style/multiple.less +222 -0
  312. package/lib/Select/style/rtl.less +168 -0
  313. package/lib/Select/style/select.less +337 -0
  314. package/lib/Select/style/single.less +179 -0
  315. package/lib/Select/style/status.less +48 -0
  316. package/lib/Select/style/variables.less +56 -0
  317. package/lib/Select/style/variables.less.d.ts +97 -0
  318. package/lib/Select/utils/iconUtil.d.ts +24 -0
  319. package/lib/Select/utils/iconUtil.js +109 -0
  320. package/lib/Space/index.d.ts +1 -1
  321. package/lib/Space/index.js +0 -6
  322. package/lib/Table/Table.d.ts +6 -0
  323. package/lib/Table/Table.js +491 -0
  324. package/lib/Table/components/Empty/empty-img.png +0 -0
  325. package/lib/Table/components/Empty/index.d.ts +4 -0
  326. package/lib/Table/components/Empty/index.js +30 -0
  327. package/lib/Table/components/Empty/index.less +24 -0
  328. package/lib/Table/index.d.ts +2 -4
  329. package/lib/Table/index.js +2 -478
  330. package/lib/Table/interface.d.ts +11 -15
  331. package/lib/Table/style/index.less +44 -21
  332. package/lib/Tabs/style/index.less +39 -7
  333. package/lib/Tooltip/style/index.less +2 -1
  334. package/lib/index.d.ts +14 -2
  335. package/lib/index.js +48 -0
  336. package/lib/style/index.less +2 -1
  337. package/lib/style/mixins/index.less +8 -0
  338. package/lib/style/themes/default/index.less +10 -10
  339. package/lib/style/themes/default/themeColor.module.less +58 -94
  340. package/lib/style/themes/default/themeColor.module.less.d.ts +1 -17
  341. package/package.json +3 -2
  342. package/es/Select/BaseSelect.d.ts +0 -5
  343. package/es/Select/BaseSelect.js +0 -413
  344. package/es/Select/OptionsList/OptGroup.d.ts +0 -7
  345. package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
  346. package/es/Select/OptionsList/OptionItem/RenderGroup.js +0 -16
  347. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
  348. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -45
  349. package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
  350. package/es/Select/OptionsList/OptionItem/RenderOption.js +0 -79
  351. package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
  352. package/es/Select/OptionsList/OptionItem/RenderTooltip.js +0 -25
  353. package/es/Select/OptionsList/OptionItem.d.ts +0 -4
  354. package/es/Select/OptionsList/OptionItem.js +0 -4
  355. package/es/Select/OptionsList/Options.d.ts +0 -7
  356. package/es/Select/OptionsList/index.d.ts +0 -4
  357. package/es/Select/OptionsList/index.js +0 -176
  358. package/es/Select/Selector/index.d.ts +0 -4
  359. package/es/Select/Selector/index.js +0 -252
  360. package/es/Select/VirtualList.d.ts +0 -5
  361. package/es/Select/VirtualList.js +0 -29
  362. package/es/Select/hooks/useCacheOption.d.ts +0 -9
  363. package/es/Select/hooks/useCacheOption.js +0 -107
  364. package/es/Select/interface.d.ts +0 -235
  365. package/es/Select/utils.d.ts +0 -21
  366. package/es/Select/utils.js +0 -193
  367. package/lib/Select/BaseSelect.d.ts +0 -5
  368. package/lib/Select/BaseSelect.js +0 -446
  369. package/lib/Select/OptionsList/OptGroup.d.ts +0 -7
  370. package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
  371. package/lib/Select/OptionsList/OptionItem/RenderGroup.js +0 -27
  372. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
  373. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -60
  374. package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
  375. package/lib/Select/OptionsList/OptionItem/RenderOption.js +0 -94
  376. package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
  377. package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +0 -37
  378. package/lib/Select/OptionsList/OptionItem.d.ts +0 -4
  379. package/lib/Select/OptionsList/OptionItem.js +0 -39
  380. package/lib/Select/OptionsList/Options.d.ts +0 -7
  381. package/lib/Select/OptionsList/index.d.ts +0 -4
  382. package/lib/Select/OptionsList/index.js +0 -195
  383. package/lib/Select/Selector/index.d.ts +0 -4
  384. package/lib/Select/Selector/index.js +0 -276
  385. package/lib/Select/VirtualList.d.ts +0 -5
  386. package/lib/Select/VirtualList.js +0 -42
  387. package/lib/Select/hooks/useCacheOption.d.ts +0 -9
  388. package/lib/Select/hooks/useCacheOption.js +0 -113
  389. package/lib/Select/interface.d.ts +0 -235
  390. package/lib/Select/utils.d.ts +0 -21
  391. package/lib/Select/utils.js +0 -233
@@ -0,0 +1,547 @@
1
+ var _excluded = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "listHeight", "listItemHeight", "value", "defaultValue", "labelInValue", "onChange"];
2
+
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+
5
+ 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."); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ 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; }
12
+
13
+ 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; }
14
+
15
+ 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; }
16
+
17
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
+
19
+ 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."); }
20
+
21
+ 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); }
22
+
23
+ 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; }
24
+
25
+ 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; }
26
+
27
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
+
29
+ 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; }
30
+
31
+ 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; }
32
+
33
+ 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); }
34
+
35
+ // @ts-nocheck
36
+
37
+ /**
38
+ * To match accessibility requirement, we always provide an input in the component.
39
+ * Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
40
+ * For focused select, we set `aria-live="polite"` to update the accessibility content.
41
+ *
42
+ * ref:
43
+ * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
44
+ *
45
+ * New api:
46
+ * - listHeight
47
+ * - listItemHeight
48
+ * - component
49
+ *
50
+ * Remove deprecated api:
51
+ * - multiple
52
+ * - tags
53
+ * - combobox
54
+ * - firstActiveValue
55
+ * - dropdownMenuStyle
56
+ * - openClassName (Not list in api)
57
+ *
58
+ * Update:
59
+ * - `backfill` only support `combobox` mode
60
+ * - `combobox` mode not support `labelInValue` since it's meaningless
61
+ * - `getInputElement` only support `combobox` mode
62
+ * - `onChange` return OptionData instead of ReactNode
63
+ * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
64
+ * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
65
+ * - `combobox` mode not support `optionLabelProp`
66
+ */
67
+ import * as React from 'react';
68
+ import warning from 'rc-util/lib/warning';
69
+ import useMergedState from 'rc-util/lib/hooks/useMergedState';
70
+ import BaseSelect, { isMultiple } from './BaseSelect';
71
+ import OptionList from './OptionList';
72
+ import Option from './Option';
73
+ import OptGroup from './OptGroup';
74
+ import useOptions from './hooks/useOptions';
75
+ import SelectContext from './SelectContext';
76
+ import useId from './hooks/useId';
77
+ import useRefFunc from './hooks/useRefFunc';
78
+ import { fillFieldNames, flattenOptions, injectPropsWithOption } from './utils/valueUtil';
79
+ import warningProps from './utils/warningPropsUtil';
80
+ import { toArray } from './utils/commonUtil';
81
+ import useFilterOptions from './hooks/useFilterOptions';
82
+ import useCache from './hooks/useCache';
83
+ var OMIT_DOM_PROPS = ['inputValue'];
84
+
85
+ function isRawValue(value) {
86
+ return !value || _typeof(value) !== 'object';
87
+ }
88
+
89
+ var Select = /*#__PURE__*/React.forwardRef(function (props, ref) {
90
+ var id = props.id,
91
+ mode = props.mode,
92
+ _props$prefixCls = props.prefixCls,
93
+ prefixCls = _props$prefixCls === void 0 ? 'rc-select' : _props$prefixCls,
94
+ backfill = props.backfill,
95
+ fieldNames = props.fieldNames,
96
+ inputValue = props.inputValue,
97
+ searchValue = props.searchValue,
98
+ onSearch = props.onSearch,
99
+ _props$autoClearSearc = props.autoClearSearchValue,
100
+ autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
101
+ onSelect = props.onSelect,
102
+ onDeselect = props.onDeselect,
103
+ _props$dropdownMatchS = props.dropdownMatchSelectWidth,
104
+ dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,
105
+ filterOption = props.filterOption,
106
+ filterSort = props.filterSort,
107
+ optionFilterProp = props.optionFilterProp,
108
+ optionLabelProp = props.optionLabelProp,
109
+ options = props.options,
110
+ children = props.children,
111
+ defaultActiveFirstOption = props.defaultActiveFirstOption,
112
+ menuItemSelectedIcon = props.menuItemSelectedIcon,
113
+ virtual = props.virtual,
114
+ _props$listHeight = props.listHeight,
115
+ listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,
116
+ _props$listItemHeight = props.listItemHeight,
117
+ listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,
118
+ value = props.value,
119
+ defaultValue = props.defaultValue,
120
+ labelInValue = props.labelInValue,
121
+ onChange = props.onChange,
122
+ restProps = _objectWithoutProperties(props, _excluded);
123
+
124
+ var mergedId = useId(id);
125
+ var multiple = isMultiple(mode);
126
+ var childrenAsData = !!(!options && children);
127
+ var mergedFilterOption = React.useMemo(function () {
128
+ if (filterOption === undefined && mode === 'combobox') {
129
+ return false;
130
+ }
131
+
132
+ return filterOption;
133
+ }, [filterOption, mode]); // ========================= FieldNames =========================
134
+
135
+ var mergedFieldNames = React.useMemo(function () {
136
+ return fillFieldNames(fieldNames, childrenAsData);
137
+ },
138
+ /* eslint-disable react-hooks/exhaustive-deps */
139
+ [// We stringify fieldNames to avoid unnecessary re-renders.
140
+ JSON.stringify(fieldNames), childrenAsData]); // =========================== Search ===========================
141
+
142
+ var _useMergedState = useMergedState('', {
143
+ value: searchValue !== undefined ? searchValue : inputValue,
144
+ postState: function postState(search) {
145
+ return search || '';
146
+ }
147
+ }),
148
+ _useMergedState2 = _slicedToArray(_useMergedState, 2),
149
+ mergedSearchValue = _useMergedState2[0],
150
+ setSearchValue = _useMergedState2[1]; // =========================== Option ===========================
151
+
152
+
153
+ var parsedOptions = useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);
154
+ var valueOptions = parsedOptions.valueOptions,
155
+ labelOptions = parsedOptions.labelOptions,
156
+ mergedOptions = parsedOptions.options; // ========================= Wrap Value =========================
157
+
158
+ var convert2LabelValues = React.useCallback(function (draftValues) {
159
+ // Convert to array
160
+ var valueList = toArray(draftValues); // Convert to labelInValue type
161
+
162
+ return valueList.map(function (val) {
163
+ var rawValue;
164
+ var rawLabel;
165
+ var rawKey;
166
+ var rawDisabled; // Fill label & value
167
+
168
+ if (isRawValue(val)) {
169
+ rawValue = val;
170
+ } else {
171
+ var _val$value;
172
+
173
+ rawKey = val.key;
174
+ rawLabel = val.label;
175
+ rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;
176
+ }
177
+
178
+ var option = valueOptions.get(rawValue);
179
+
180
+ if (option) {
181
+ var _option$key;
182
+
183
+ // Fill missing props
184
+ if (rawLabel === undefined) rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];
185
+ if (rawKey === undefined) rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;
186
+ rawDisabled = option === null || option === void 0 ? void 0 : option.disabled; // Warning if label not same as provided
187
+
188
+ if (process.env.NODE_ENV !== 'production' && !optionLabelProp) {
189
+ var optionLabel = option === null || option === void 0 ? void 0 : option[mergedFieldNames.label];
190
+
191
+ if (optionLabel !== undefined && optionLabel !== rawLabel) {
192
+ warning(false, '`label` of `value` is not same as `label` in Select options.');
193
+ }
194
+ }
195
+ }
196
+
197
+ return {
198
+ label: rawLabel,
199
+ value: rawValue,
200
+ key: rawKey,
201
+ disabled: rawDisabled
202
+ };
203
+ });
204
+ }, [mergedFieldNames, optionLabelProp, valueOptions]); // =========================== Values ===========================
205
+
206
+ var _useMergedState3 = useMergedState(defaultValue, {
207
+ value: value
208
+ }),
209
+ _useMergedState4 = _slicedToArray(_useMergedState3, 2),
210
+ internalValue = _useMergedState4[0],
211
+ setInternalValue = _useMergedState4[1]; // Merged value with LabelValueType
212
+
213
+
214
+ var rawLabeledValues = React.useMemo(function () {
215
+ var _values$;
216
+
217
+ var values = convert2LabelValues(internalValue); // combobox no need save value when it's empty
218
+
219
+ if (mode === 'combobox' && !((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) {
220
+ return [];
221
+ }
222
+
223
+ return values;
224
+ }, [internalValue, convert2LabelValues, mode]); // Fill label with cache to avoid option remove
225
+
226
+ var _useCache = useCache(rawLabeledValues, valueOptions),
227
+ _useCache2 = _slicedToArray(_useCache, 2),
228
+ mergedValues = _useCache2[0],
229
+ getMixedOption = _useCache2[1];
230
+
231
+ var displayValues = React.useMemo(function () {
232
+ // `null` need show as placeholder instead
233
+ // https://github.com/ant-design/ant-design/issues/25057
234
+ if (!mode && mergedValues.length === 1) {
235
+ var firstValue = mergedValues[0];
236
+
237
+ if (firstValue.value === null && (firstValue.label === null || firstValue.label === undefined)) {
238
+ return [];
239
+ }
240
+ }
241
+
242
+ return mergedValues.map(function (item) {
243
+ var _item$label;
244
+
245
+ return _objectSpread(_objectSpread({}, item), {}, {
246
+ label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value
247
+ });
248
+ });
249
+ }, [mode, mergedValues]);
250
+ /** Convert `displayValues` to raw value type set */
251
+
252
+ var rawValues = React.useMemo(function () {
253
+ return new Set(mergedValues.map(function (val) {
254
+ return val.value;
255
+ }));
256
+ }, [mergedValues]);
257
+ React.useEffect(function () {
258
+ if (mode === 'combobox') {
259
+ var _mergedValues$;
260
+
261
+ var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;
262
+
263
+ if (strValue !== undefined && strValue !== null) {
264
+ setSearchValue(String(strValue));
265
+ }
266
+ }
267
+ }, [mergedValues]); // ======================= Display Option =======================
268
+ // Create a placeholder item if not exist in `options`
269
+
270
+ var createTagOption = useRefFunc(function (val, label) {
271
+ var _ref;
272
+
273
+ var mergedLabel = label !== null && label !== void 0 ? label : val;
274
+ return _ref = {}, _defineProperty(_ref, mergedFieldNames.value, val), _defineProperty(_ref, mergedFieldNames.label, mergedLabel), _ref;
275
+ }); // Fill tag as option if mode is `tags`
276
+
277
+ var filledTagOptions = React.useMemo(function () {
278
+ if (mode !== 'tags') {
279
+ return mergedOptions;
280
+ } // >>> Tag mode
281
+
282
+
283
+ var cloneOptions = _toConsumableArray(mergedOptions); // Check if value exist in options (include new patch item)
284
+
285
+
286
+ var existOptions = function existOptions(val) {
287
+ return valueOptions.has(val);
288
+ }; // Fill current value as option
289
+
290
+
291
+ _toConsumableArray(mergedValues).sort(function (a, b) {
292
+ return a.value < b.value ? -1 : 1;
293
+ }).forEach(function (item) {
294
+ var val = item.value;
295
+
296
+ if (!existOptions(val)) {
297
+ cloneOptions.push(createTagOption(val, item.label));
298
+ }
299
+ });
300
+
301
+ return cloneOptions;
302
+ }, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);
303
+ var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp); // Fill options with search value if needed
304
+
305
+ var filledSearchOptions = React.useMemo(function () {
306
+ if (mode !== 'tags' || !mergedSearchValue || filteredOptions.some(function (item) {
307
+ return item[optionFilterProp || 'value'] === mergedSearchValue;
308
+ })) {
309
+ return filteredOptions;
310
+ } // Fill search value as option
311
+
312
+
313
+ return [createTagOption(mergedSearchValue)].concat(_toConsumableArray(filteredOptions));
314
+ }, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue]);
315
+ var orderedFilteredOptions = React.useMemo(function () {
316
+ if (!filterSort) {
317
+ return filledSearchOptions;
318
+ }
319
+
320
+ return _toConsumableArray(filledSearchOptions).sort(function (a, b) {
321
+ return filterSort(a, b);
322
+ });
323
+ }, [filledSearchOptions, filterSort]);
324
+ var displayOptions = React.useMemo(function () {
325
+ return flattenOptions(orderedFilteredOptions, {
326
+ fieldNames: mergedFieldNames,
327
+ childrenAsData: childrenAsData
328
+ });
329
+ }, [orderedFilteredOptions, mergedFieldNames, childrenAsData]); // =========================== Change ===========================
330
+
331
+ var triggerChange = function triggerChange(values) {
332
+ var labeledValues = convert2LabelValues(values);
333
+ setInternalValue(labeledValues);
334
+
335
+ if (onChange && ( // Trigger event only when value changed
336
+ labeledValues.length !== mergedValues.length || labeledValues.some(function (newVal, index) {
337
+ var _mergedValues$index;
338
+
339
+ return ((_mergedValues$index = mergedValues[index]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);
340
+ }))) {
341
+ var returnValues = labelInValue ? labeledValues : labeledValues.map(function (v) {
342
+ return v.value;
343
+ });
344
+ var returnOptions = labeledValues.map(function (v) {
345
+ return injectPropsWithOption(getMixedOption(v.value));
346
+ });
347
+ onChange( // Value
348
+ multiple ? returnValues : returnValues[0], // Option
349
+ multiple ? returnOptions : returnOptions[0]);
350
+ }
351
+ }; // ======================= Accessibility ========================
352
+
353
+
354
+ var _React$useState = React.useState(null),
355
+ _React$useState2 = _slicedToArray(_React$useState, 2),
356
+ activeValue = _React$useState2[0],
357
+ setActiveValue = _React$useState2[1];
358
+
359
+ var _React$useState3 = React.useState(0),
360
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
361
+ accessibilityIndex = _React$useState4[0],
362
+ setAccessibilityIndex = _React$useState4[1];
363
+
364
+ var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';
365
+ var onActiveValue = React.useCallback(function (active, index) {
366
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
367
+ _ref2$source = _ref2.source,
368
+ source = _ref2$source === void 0 ? 'keyboard' : _ref2$source;
369
+
370
+ setAccessibilityIndex(index);
371
+
372
+ if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {
373
+ setActiveValue(String(active));
374
+ }
375
+ }, [backfill, mode]); // ========================= OptionList =========================
376
+
377
+ var triggerSelect = function triggerSelect(val, selected) {
378
+ var getSelectEnt = function getSelectEnt() {
379
+ var _option$key2;
380
+
381
+ var option = getMixedOption(val);
382
+ return [labelInValue ? {
383
+ label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],
384
+ value: val,
385
+ key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val
386
+ } : val, injectPropsWithOption(option)];
387
+ };
388
+
389
+ if (selected && onSelect) {
390
+ var _getSelectEnt = getSelectEnt(),
391
+ _getSelectEnt2 = _slicedToArray(_getSelectEnt, 2),
392
+ wrappedValue = _getSelectEnt2[0],
393
+ option = _getSelectEnt2[1];
394
+
395
+ onSelect(wrappedValue, option);
396
+ } else if (!selected && onDeselect) {
397
+ var _getSelectEnt3 = getSelectEnt(),
398
+ _getSelectEnt4 = _slicedToArray(_getSelectEnt3, 2),
399
+ _wrappedValue = _getSelectEnt4[0],
400
+ _option = _getSelectEnt4[1];
401
+
402
+ onDeselect(_wrappedValue, _option);
403
+ }
404
+ }; // Used for OptionList selection
405
+
406
+
407
+ var onInternalSelect = useRefFunc(function (val, info) {
408
+ var cloneValues; // Single mode always trigger select only with option list
409
+
410
+ var mergedSelect = multiple ? info.selected : true;
411
+
412
+ if (mergedSelect) {
413
+ cloneValues = multiple ? [].concat(_toConsumableArray(mergedValues), [val]) : [val];
414
+ } else {
415
+ cloneValues = mergedValues.filter(function (v) {
416
+ return v.value !== val;
417
+ });
418
+ }
419
+
420
+ triggerChange(cloneValues);
421
+ triggerSelect(val, mergedSelect); // Clean search value if single or configured
422
+
423
+ if (mode === 'combobox') {
424
+ // setSearchValue(String(val));
425
+ setActiveValue('');
426
+ } else if (!isMultiple || autoClearSearchValue) {
427
+ setSearchValue('');
428
+ setActiveValue('');
429
+ }
430
+ }); // ======================= Display Change =======================
431
+ // BaseSelect display values change
432
+
433
+ var onDisplayValuesChange = function onDisplayValuesChange(nextValues, info) {
434
+ triggerChange(nextValues);
435
+
436
+ if (info.type === 'remove' || info.type === 'clear') {
437
+ info.values.forEach(function (item) {
438
+ triggerSelect(item.value, false);
439
+ });
440
+ }
441
+ }; // =========================== Search ===========================
442
+
443
+
444
+ var onInternalSearch = function onInternalSearch(searchText, info) {
445
+ setSearchValue(searchText);
446
+ setActiveValue(null); // [Submit] Tag mode should flush input
447
+
448
+ if (info.source === 'submit') {
449
+ var formatted = (searchText || '').trim(); // prevent empty tags from appearing when you click the Enter button
450
+
451
+ if (formatted) {
452
+ var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), [formatted])));
453
+ triggerChange(newRawValues);
454
+ triggerSelect(formatted, true);
455
+ setSearchValue('');
456
+ }
457
+
458
+ return;
459
+ }
460
+
461
+ if (info.source !== 'blur') {
462
+ if (mode === 'combobox') {
463
+ triggerChange(searchText);
464
+ }
465
+
466
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);
467
+ }
468
+ };
469
+
470
+ var onInternalSearchSplit = function onInternalSearchSplit(words) {
471
+ var patchValues = words;
472
+
473
+ if (mode !== 'tags') {
474
+ patchValues = words.map(function (word) {
475
+ var opt = labelOptions.get(word);
476
+ return opt === null || opt === void 0 ? void 0 : opt.value;
477
+ }).filter(function (val) {
478
+ return val !== undefined;
479
+ });
480
+ }
481
+
482
+ var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), _toConsumableArray(patchValues))));
483
+ triggerChange(newRawValues);
484
+ newRawValues.forEach(function (newRawValue) {
485
+ triggerSelect(newRawValue, true);
486
+ });
487
+ }; // ========================== Context ===========================
488
+
489
+
490
+ var selectContext = React.useMemo(function () {
491
+ var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;
492
+ return _objectSpread(_objectSpread({}, parsedOptions), {}, {
493
+ flattenOptions: displayOptions,
494
+ onActiveValue: onActiveValue,
495
+ defaultActiveFirstOption: mergedDefaultActiveFirstOption,
496
+ onSelect: onInternalSelect,
497
+ menuItemSelectedIcon: menuItemSelectedIcon,
498
+ rawValues: rawValues,
499
+ fieldNames: mergedFieldNames,
500
+ virtual: realVirtual,
501
+ listHeight: listHeight,
502
+ listItemHeight: listItemHeight,
503
+ childrenAsData: childrenAsData
504
+ });
505
+ }, [parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, childrenAsData]); // ========================== Warning ===========================
506
+
507
+ if (process.env.NODE_ENV !== 'production') {
508
+ warningProps(props);
509
+ } // ==============================================================
510
+ // == Render ==
511
+ // ==============================================================
512
+
513
+
514
+ return /*#__PURE__*/React.createElement(SelectContext.Provider, {
515
+ value: selectContext
516
+ }, /*#__PURE__*/React.createElement(BaseSelect, Object.assign({}, restProps, {
517
+ // >>> MISC
518
+ id: mergedId,
519
+ prefixCls: prefixCls,
520
+ ref: ref,
521
+ omitDomProps: OMIT_DOM_PROPS,
522
+ mode: mode,
523
+ // >>> Values
524
+ displayValues: displayValues,
525
+ onDisplayValuesChange: onDisplayValuesChange,
526
+ // >>> Search
527
+ searchValue: mergedSearchValue,
528
+ onSearch: onInternalSearch,
529
+ onSearchSplit: onInternalSearchSplit,
530
+ dropdownMatchSelectWidth: dropdownMatchSelectWidth,
531
+ // >>> OptionList
532
+ OptionList: OptionList,
533
+ emptyOptions: !displayOptions.length,
534
+ // >>> Accessibility
535
+ activeValue: activeValue,
536
+ activeDescendantId: "".concat(mergedId, "_list_").concat(accessibilityIndex)
537
+ })));
538
+ });
539
+
540
+ if (process.env.NODE_ENV !== 'production') {
541
+ Select.displayName = 'Select';
542
+ }
543
+
544
+ var TypedSelect = Select;
545
+ TypedSelect.Option = Option;
546
+ TypedSelect.OptGroup = OptGroup;
547
+ export default TypedSelect;
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import type { RawValueType, RenderNode } from './BaseSelect';
3
+ import type { FlattenOptionData } from './interface';
4
+ import type { BaseOptionType, FieldNames, OnActiveValue, OnInternalSelect } from './Select';
5
+ export interface SelectContextProps {
6
+ options: BaseOptionType[];
7
+ flattenOptions: FlattenOptionData<BaseOptionType>[];
8
+ onActiveValue: OnActiveValue;
9
+ defaultActiveFirstOption?: boolean;
10
+ onSelect: OnInternalSelect;
11
+ menuItemSelectedIcon?: RenderNode;
12
+ rawValues: Set<RawValueType>;
13
+ fieldNames?: FieldNames;
14
+ virtual?: boolean;
15
+ listHeight?: number;
16
+ listItemHeight?: number;
17
+ childrenAsData?: boolean;
18
+ }
19
+ declare const SelectContext: React.Context<SelectContextProps>;
20
+ export default SelectContext;
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ import * as React from 'react';
3
+ var SelectContext = /*#__PURE__*/React.createContext(null);
4
+ export default SelectContext;
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import type { AlignType } from 'rc-trigger/lib/interface';
3
+ import type { Placement, RenderDOMFunc } from './BaseSelect';
4
+ export interface RefTriggerProps {
5
+ getPopupElement: () => HTMLDivElement;
6
+ }
7
+ export interface SelectTriggerProps {
8
+ prefixCls: string;
9
+ children: React.ReactElement;
10
+ disabled: boolean;
11
+ visible: boolean;
12
+ popupElement: React.ReactElement;
13
+ animation?: string;
14
+ transitionName?: string;
15
+ containerWidth: number;
16
+ placement?: Placement;
17
+ dropdownStyle: React.CSSProperties;
18
+ dropdownClassName: string;
19
+ direction: string;
20
+ dropdownMatchSelectWidth?: boolean | number;
21
+ dropdownRender?: (menu: React.ReactElement) => React.ReactElement;
22
+ getPopupContainer?: RenderDOMFunc;
23
+ dropdownAlign: AlignType;
24
+ empty: boolean;
25
+ getTriggerDOMNode: () => HTMLElement;
26
+ onPopupVisibleChange?: (visible: boolean) => void;
27
+ onPopupMouseEnter: () => void;
28
+ }
29
+ declare const RefSelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<RefTriggerProps>>;
30
+ export default RefSelectTrigger;