@aloudata/aloudata-design 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (527) 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 +36 -0
  11. package/es/Button/index.d.ts +4 -4
  12. package/es/Button/index.js +45 -25
  13. package/es/Button/style/index.less +185 -150
  14. package/es/Button/style/variables.less +67 -0
  15. package/es/Checkbox/style/index.less +35 -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/Form/style/index.less +8 -0
  36. package/es/Icon/antdIconfont.d.ts +4 -0
  37. package/es/Icon/antdIconfont.js +2 -0
  38. package/es/Icon/components/Icon.d.ts +32 -0
  39. package/es/Icon/components/Icon.js +27 -0
  40. package/es/Icon/components/createFromScripts.d.ts +1 -0
  41. package/es/Icon/components/createFromScripts.js +35 -0
  42. package/es/Icon/iconSvgs/arrows_right_sm.svg +3 -0
  43. package/es/Icon/icons/AddLine.d.ts +13 -0
  44. package/es/Icon/icons/AddLine.js +66 -0
  45. package/es/Icon/icons/AlertFill.d.ts +13 -0
  46. package/es/Icon/icons/AlertFill.js +73 -0
  47. package/es/Icon/icons/ArrowsDownLine.d.ts +13 -0
  48. package/es/Icon/icons/ArrowsDownLine.js +66 -0
  49. package/es/Icon/icons/CancelFill.d.ts +13 -0
  50. package/es/Icon/icons/CancelFill.js +73 -0
  51. package/es/Icon/icons/CheckFill.d.ts +13 -0
  52. package/es/Icon/icons/CheckFill.js +73 -0
  53. package/es/Icon/icons/CloseLine.d.ts +13 -0
  54. package/es/Icon/icons/CloseLine.js +66 -0
  55. package/es/Icon/icons/DatabaseLine.d.ts +13 -0
  56. package/es/Icon/icons/DatabaseLine.js +66 -0
  57. package/es/Icon/icons/Deleteline.d.ts +13 -0
  58. package/es/Icon/icons/Deleteline.js +66 -0
  59. package/es/Icon/icons/DownloadLine.d.ts +13 -0
  60. package/es/Icon/icons/DownloadLine.js +73 -0
  61. package/es/Icon/icons/ErrorFill.d.ts +13 -0
  62. package/es/Icon/icons/ErrorFill.js +73 -0
  63. package/es/Icon/icons/EyeOffLine.d.ts +13 -0
  64. package/es/Icon/icons/EyeOffLine.js +73 -0
  65. package/es/Icon/icons/EyeOnLine.d.ts +13 -0
  66. package/es/Icon/icons/EyeOnLine.js +66 -0
  67. package/es/Icon/icons/FileLine.d.ts +13 -0
  68. package/es/Icon/icons/FileLine.js +73 -0
  69. package/es/Icon/icons/HomeFill.d.ts +13 -0
  70. package/es/Icon/icons/HomeFill.js +73 -0
  71. package/es/Icon/icons/IconBase.withSpan.tpl +58 -0
  72. package/es/Icon/icons/LightningLine.d.ts +13 -0
  73. package/es/Icon/icons/LightningLine.js +66 -0
  74. package/es/Icon/icons/Loading.d.ts +13 -0
  75. package/es/Icon/icons/Loading.js +66 -0
  76. package/es/Icon/icons/More.d.ts +13 -0
  77. package/es/Icon/icons/More.js +66 -0
  78. package/es/Icon/icons/NewWindowsLine.d.ts +13 -0
  79. package/es/Icon/icons/NewWindowsLine.js +74 -0
  80. package/es/Icon/icons/SearchLine.d.ts +13 -0
  81. package/es/Icon/icons/SearchLine.js +73 -0
  82. package/es/Icon/icons/SortAscendingLine.d.ts +13 -0
  83. package/es/Icon/icons/SortAscendingLine.js +66 -0
  84. package/es/Icon/icons/SortDescendingLine.d.ts +13 -0
  85. package/es/Icon/icons/SortDescendingLine.js +66 -0
  86. package/es/Icon/icons/TextLine.d.ts +13 -0
  87. package/es/Icon/icons/TextLine.js +73 -0
  88. package/es/Icon/icons/UserLine.d.ts +13 -0
  89. package/es/Icon/icons/UserLine.js +73 -0
  90. package/es/Icon/icons/style.css +9 -0
  91. package/es/Icon/icons/style.css.d.ts +10 -0
  92. package/es/Icon/index.d.ts +2 -13
  93. package/es/Icon/index.js +2 -45
  94. package/es/Icon/index.less +9 -17
  95. package/es/Icon/style/index.d.ts +1 -0
  96. package/es/Icon/style/index.js +1 -0
  97. package/es/Icon/style/index.less +0 -0
  98. package/es/Input/components/Group/index.d.ts +4 -2
  99. package/es/Input/components/Group/index.js +23 -1
  100. package/es/Input/components/Input/index.d.ts +1 -1
  101. package/es/Input/components/Input/index.js +12 -0
  102. package/es/Input/components/Password/index.d.ts +7 -1
  103. package/es/Input/components/Password/index.js +29 -6
  104. package/es/Input/style/index.less +278 -43
  105. package/es/InputNumber/index.d.ts +4 -0
  106. package/es/InputNumber/index.js +32 -0
  107. package/es/InputNumber/style/index.d.ts +2 -0
  108. package/es/InputNumber/style/index.js +2 -0
  109. package/es/InputNumber/style/index.less +224 -0
  110. package/es/Menu/Divider.d.ts +2 -1
  111. package/es/Menu/MenuItem.d.ts +2 -1
  112. package/es/Menu/SubMenu.d.ts +2 -1
  113. package/es/Menu/SubMenu.js +1 -1
  114. package/es/Menu/index.d.ts +2 -1
  115. package/es/Menu/style/index.less +5 -5
  116. package/es/Modal/index.d.ts +21 -0
  117. package/es/Modal/index.js +95 -0
  118. package/es/Modal/style/index.d.ts +2 -0
  119. package/es/Modal/style/index.js +2 -0
  120. package/es/Modal/style/index.less +206 -0
  121. package/es/Navigator/components/Header/index.d.ts +9 -0
  122. package/es/Navigator/components/Header/index.js +18 -0
  123. package/es/Navigator/components/Menu/index.d.ts +7 -13
  124. package/es/Navigator/components/Menu/index.js +26 -162
  125. package/es/Navigator/components/MenuItem/index.d.ts +21 -0
  126. package/es/Navigator/components/MenuItem/index.js +39 -0
  127. package/es/Navigator/index.d.ts +19 -8
  128. package/es/Navigator/index.js +6 -15
  129. package/es/Navigator/style/bg.png +0 -0
  130. package/es/Navigator/style/index.less +105 -174
  131. package/es/Popover/index.d.ts +5 -0
  132. package/es/Popover/index.js +22 -0
  133. package/es/Popover/style/index.d.ts +2 -0
  134. package/es/Popover/style/index.js +2 -0
  135. package/es/Popover/style/index.less +37 -0
  136. package/es/Radio/index.d.ts +2 -3
  137. package/es/Select/index.d.ts +37 -9
  138. package/es/Select/index.js +155 -7
  139. package/es/Select/rc-select/BaseSelect.d.ts +116 -0
  140. package/es/Select/rc-select/BaseSelect.js +641 -0
  141. package/es/Select/rc-select/OptGroup.d.ts +12 -0
  142. package/es/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
  143. package/es/Select/rc-select/Option.d.ts +14 -0
  144. package/es/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
  145. package/es/Select/rc-select/OptionList.d.ts +10 -0
  146. package/es/Select/rc-select/OptionList.js +401 -0
  147. package/es/Select/rc-select/Select.d.ts +109 -0
  148. package/es/Select/rc-select/Select.js +547 -0
  149. package/es/Select/rc-select/SelectContext.d.ts +20 -0
  150. package/es/Select/rc-select/SelectContext.js +4 -0
  151. package/es/Select/rc-select/SelectTrigger.d.ts +30 -0
  152. package/es/Select/rc-select/SelectTrigger.js +136 -0
  153. package/es/Select/rc-select/Selector/Input.d.ts +26 -0
  154. package/es/Select/rc-select/Selector/Input.js +114 -0
  155. package/es/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
  156. package/es/Select/rc-select/Selector/MultipleSelector.js +236 -0
  157. package/es/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
  158. package/es/Select/rc-select/Selector/SingleSelector.js +112 -0
  159. package/es/Select/rc-select/Selector/index.d.ts +80 -0
  160. package/es/Select/rc-select/Selector/index.js +194 -0
  161. package/es/Select/rc-select/TransBtn.d.ts +12 -0
  162. package/es/Select/rc-select/TransBtn.js +42 -0
  163. package/es/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
  164. package/es/Select/rc-select/hooks/useBaseProps.js +11 -0
  165. package/es/Select/rc-select/hooks/useCache.d.ts +7 -0
  166. package/es/Select/rc-select/hooks/useCache.js +49 -0
  167. package/es/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
  168. package/es/Select/rc-select/hooks/useDelayReset.js +50 -0
  169. package/es/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
  170. package/es/Select/rc-select/hooks/useFilterOptions.js +75 -0
  171. package/es/Select/rc-select/hooks/useId.d.ts +5 -0
  172. package/es/Select/rc-select/hooks/useId.js +47 -0
  173. package/es/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
  174. package/es/Select/rc-select/hooks/useLayoutEffect.js +17 -0
  175. package/es/Select/rc-select/hooks/useLock.d.ts +7 -0
  176. package/es/Select/rc-select/hooks/useLock.js +35 -0
  177. package/es/Select/rc-select/hooks/useOptions.d.ts +11 -0
  178. package/es/Select/rc-select/hooks/useOptions.js +53 -0
  179. package/es/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
  180. package/es/Select/rc-select/hooks/useRefFunc.js +15 -0
  181. package/es/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
  182. package/es/Select/rc-select/hooks/useSelectTriggerControl.js +40 -0
  183. package/es/Select/rc-select/index.d.ts +10 -0
  184. package/es/Select/rc-select/index.js +7 -0
  185. package/es/Select/rc-select/interface.d.ts +10 -0
  186. package/es/Select/{interface.js → rc-select/interface.js} +0 -0
  187. package/es/Select/rc-select/utils/commonUtil.d.ts +4 -0
  188. package/es/Select/rc-select/utils/commonUtil.js +12 -0
  189. package/es/Select/rc-select/utils/keyUtil.d.ts +2 -0
  190. package/es/Select/rc-select/utils/keyUtil.js +8 -0
  191. package/es/Select/rc-select/utils/legacyUtil.d.ts +3 -0
  192. package/es/Select/rc-select/utils/legacyUtil.js +58 -0
  193. package/es/Select/rc-select/utils/platformUtil.d.ts +1 -0
  194. package/es/Select/rc-select/utils/platformUtil.js +4 -0
  195. package/es/Select/rc-select/utils/valueUtil.d.ts +22 -0
  196. package/es/Select/rc-select/utils/valueUtil.js +157 -0
  197. package/es/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
  198. package/es/Select/rc-select/utils/warningPropsUtil.js +114 -0
  199. package/es/Select/style/index.d.ts +1 -0
  200. package/es/Select/style/index.js +3 -1
  201. package/es/Select/style/index.less +230 -480
  202. package/es/Select/style/multiple.less +222 -0
  203. package/es/Select/style/rtl.less +168 -0
  204. package/es/Select/style/select.less +337 -0
  205. package/es/Select/style/single.less +179 -0
  206. package/es/Select/style/status.less +48 -0
  207. package/es/Select/style/variables.less +67 -0
  208. package/es/Select/style/variables.less.d.ts +100 -0
  209. package/es/Select/utils/iconUtil.d.ts +24 -0
  210. package/es/Select/utils/iconUtil.js +82 -0
  211. package/es/Space/index.d.ts +1 -1
  212. package/es/Space/index.js +0 -1
  213. package/es/Table/Table.d.ts +5 -0
  214. package/es/Table/Table.js +473 -0
  215. package/es/Table/index.d.ts +2 -4
  216. package/es/Table/index.js +2 -463
  217. package/es/Table/interface.d.ts +11 -15
  218. package/es/Table/style/index.less +51 -21
  219. package/es/Tabs/index.d.ts +2 -1
  220. package/es/Tabs/index.js +10 -4
  221. package/es/Tabs/style/index.less +73 -7
  222. package/es/Tooltip/style/index.less +2 -1
  223. package/es/index.d.ts +15 -2
  224. package/es/index.js +8 -1
  225. package/es/style/index.less +3 -1
  226. package/es/style/mixins/index.less +8 -0
  227. package/es/style/themes/default/index.less +10 -10
  228. package/es/style/themes/default/scrollBar.less +13 -0
  229. package/es/style/themes/default/themeColor.module.less +58 -94
  230. package/es/style/themes/default/themeColor.module.less.d.ts +1 -17
  231. package/lib/Avatar/index.d.ts +15 -0
  232. package/lib/Avatar/index.js +57 -0
  233. package/lib/Avatar/style/index.d.ts +2 -0
  234. package/lib/Avatar/style/index.js +5 -0
  235. package/lib/Avatar/style/index.less +34 -0
  236. package/lib/Breadcrumb/index.d.ts +8 -0
  237. package/lib/Breadcrumb/index.js +50 -0
  238. package/lib/Breadcrumb/style/index.d.ts +2 -0
  239. package/lib/Breadcrumb/style/index.js +5 -0
  240. package/lib/Breadcrumb/style/index.less +36 -0
  241. package/lib/Button/index.d.ts +4 -4
  242. package/lib/Button/index.js +45 -25
  243. package/lib/Button/style/index.less +185 -150
  244. package/lib/Button/style/variables.less +67 -0
  245. package/lib/Checkbox/style/index.less +35 -1
  246. package/lib/ConfigProvider/index.d.ts +1 -0
  247. package/lib/ConfigProvider/index.js +26 -0
  248. package/lib/Dropdown/Button.js +1 -1
  249. package/lib/Dropdown/style/index.less +41 -8
  250. package/lib/Empty/image/Authority.d.ts +3 -0
  251. package/lib/Empty/image/Authority.js +374 -0
  252. package/lib/Empty/image/Dataspace.d.ts +3 -0
  253. package/lib/Empty/image/Dataspace.js +285 -0
  254. package/lib/Empty/image/Search.d.ts +3 -0
  255. package/lib/Empty/image/Search.js +170 -0
  256. package/lib/Empty/image/Simple.d.ts +3 -0
  257. package/lib/Empty/image/Simple.js +34 -0
  258. package/lib/Empty/image/Worksheet.d.ts +3 -0
  259. package/lib/Empty/image/Worksheet.js +284 -0
  260. package/lib/Empty/image/empty.d.ts +3 -0
  261. package/lib/Empty/image/empty.js +153 -0
  262. package/lib/Empty/index.d.ts +21 -5
  263. package/lib/Empty/index.js +94 -53
  264. package/lib/Empty/style/index.less +56 -11
  265. package/lib/Form/style/index.less +8 -0
  266. package/lib/Icon/antdIconfont.d.ts +4 -0
  267. package/lib/Icon/antdIconfont.js +13 -0
  268. package/lib/Icon/components/Icon.d.ts +32 -0
  269. package/lib/Icon/components/Icon.js +38 -0
  270. package/lib/Icon/components/createFromScripts.d.ts +1 -0
  271. package/lib/Icon/components/createFromScripts.js +41 -0
  272. package/lib/Icon/iconSvgs/arrows_right_sm.svg +3 -0
  273. package/lib/Icon/icons/AddLine.d.ts +13 -0
  274. package/lib/Icon/icons/AddLine.js +83 -0
  275. package/lib/Icon/icons/AlertFill.d.ts +13 -0
  276. package/lib/Icon/icons/AlertFill.js +90 -0
  277. package/lib/Icon/icons/ArrowsDownLine.d.ts +13 -0
  278. package/lib/Icon/icons/ArrowsDownLine.js +83 -0
  279. package/lib/Icon/icons/CancelFill.d.ts +13 -0
  280. package/lib/Icon/icons/CancelFill.js +90 -0
  281. package/lib/Icon/icons/CheckFill.d.ts +13 -0
  282. package/lib/Icon/icons/CheckFill.js +90 -0
  283. package/lib/Icon/icons/CloseLine.d.ts +13 -0
  284. package/lib/Icon/icons/CloseLine.js +83 -0
  285. package/lib/Icon/icons/DatabaseLine.d.ts +13 -0
  286. package/lib/Icon/icons/DatabaseLine.js +83 -0
  287. package/lib/Icon/icons/Deleteline.d.ts +13 -0
  288. package/lib/Icon/icons/Deleteline.js +83 -0
  289. package/lib/Icon/icons/DownloadLine.d.ts +13 -0
  290. package/lib/Icon/icons/DownloadLine.js +90 -0
  291. package/lib/Icon/icons/ErrorFill.d.ts +13 -0
  292. package/lib/Icon/icons/ErrorFill.js +90 -0
  293. package/lib/Icon/icons/EyeOffLine.d.ts +13 -0
  294. package/lib/Icon/icons/EyeOffLine.js +90 -0
  295. package/lib/Icon/icons/EyeOnLine.d.ts +13 -0
  296. package/lib/Icon/icons/EyeOnLine.js +83 -0
  297. package/lib/Icon/icons/FileLine.d.ts +13 -0
  298. package/lib/Icon/icons/FileLine.js +90 -0
  299. package/lib/Icon/icons/HomeFill.d.ts +13 -0
  300. package/lib/Icon/icons/HomeFill.js +90 -0
  301. package/lib/Icon/icons/IconBase.withSpan.tpl +58 -0
  302. package/lib/Icon/icons/LightningLine.d.ts +13 -0
  303. package/lib/Icon/icons/LightningLine.js +83 -0
  304. package/lib/Icon/icons/Loading.d.ts +13 -0
  305. package/lib/Icon/icons/Loading.js +83 -0
  306. package/lib/Icon/icons/More.d.ts +13 -0
  307. package/lib/Icon/icons/More.js +83 -0
  308. package/lib/Icon/icons/NewWindowsLine.d.ts +13 -0
  309. package/lib/Icon/icons/NewWindowsLine.js +91 -0
  310. package/lib/Icon/icons/SearchLine.d.ts +13 -0
  311. package/lib/Icon/icons/SearchLine.js +90 -0
  312. package/lib/Icon/icons/SortAscendingLine.d.ts +13 -0
  313. package/lib/Icon/icons/SortAscendingLine.js +83 -0
  314. package/lib/Icon/icons/SortDescendingLine.d.ts +13 -0
  315. package/lib/Icon/icons/SortDescendingLine.js +83 -0
  316. package/lib/Icon/icons/TextLine.d.ts +13 -0
  317. package/lib/Icon/icons/TextLine.js +90 -0
  318. package/lib/Icon/icons/UserLine.d.ts +13 -0
  319. package/lib/Icon/icons/UserLine.js +90 -0
  320. package/lib/Icon/icons/style.css +9 -0
  321. package/lib/Icon/icons/style.css.d.ts +10 -0
  322. package/lib/Icon/index.d.ts +2 -13
  323. package/lib/Icon/index.js +2 -51
  324. package/lib/Icon/index.less +9 -17
  325. package/lib/Icon/style/index.d.ts +1 -0
  326. package/lib/Icon/style/index.js +1 -0
  327. package/lib/Icon/style/index.less +0 -0
  328. package/lib/Input/components/Group/index.d.ts +4 -2
  329. package/lib/Input/components/Group/index.js +24 -1
  330. package/lib/Input/components/Input/index.d.ts +1 -1
  331. package/lib/Input/components/Input/index.js +13 -0
  332. package/lib/Input/components/Password/index.d.ts +7 -1
  333. package/lib/Input/components/Password/index.js +30 -5
  334. package/lib/Input/style/index.less +278 -43
  335. package/lib/InputNumber/index.d.ts +4 -0
  336. package/lib/InputNumber/index.js +45 -0
  337. package/lib/InputNumber/style/index.d.ts +2 -0
  338. package/lib/InputNumber/style/index.js +5 -0
  339. package/lib/InputNumber/style/index.less +224 -0
  340. package/lib/Menu/Divider.d.ts +2 -1
  341. package/lib/Menu/MenuItem.d.ts +2 -1
  342. package/lib/Menu/SubMenu.d.ts +2 -1
  343. package/lib/Menu/SubMenu.js +1 -1
  344. package/lib/Menu/index.d.ts +2 -1
  345. package/lib/Menu/style/index.less +5 -5
  346. package/lib/Modal/index.d.ts +21 -0
  347. package/lib/Modal/index.js +121 -0
  348. package/lib/Modal/style/index.d.ts +2 -0
  349. package/lib/Modal/style/index.js +5 -0
  350. package/lib/Modal/style/index.less +206 -0
  351. package/lib/Navigator/components/Header/index.d.ts +9 -0
  352. package/lib/Navigator/components/Header/index.js +28 -0
  353. package/lib/Navigator/components/Menu/index.d.ts +7 -13
  354. package/lib/Navigator/components/Menu/index.js +25 -162
  355. package/lib/Navigator/components/MenuItem/index.d.ts +21 -0
  356. package/lib/Navigator/components/MenuItem/index.js +56 -0
  357. package/lib/Navigator/index.d.ts +19 -8
  358. package/lib/Navigator/index.js +7 -15
  359. package/lib/Navigator/style/bg.png +0 -0
  360. package/lib/Navigator/style/index.less +105 -174
  361. package/lib/Popover/index.d.ts +5 -0
  362. package/lib/Popover/index.js +35 -0
  363. package/lib/Popover/style/index.d.ts +2 -0
  364. package/lib/Popover/style/index.js +5 -0
  365. package/lib/Popover/style/index.less +37 -0
  366. package/lib/Radio/index.d.ts +2 -3
  367. package/lib/Select/index.d.ts +37 -9
  368. package/lib/Select/index.js +167 -18
  369. package/lib/Select/rc-select/BaseSelect.d.ts +116 -0
  370. package/lib/Select/rc-select/BaseSelect.js +672 -0
  371. package/lib/Select/rc-select/OptGroup.d.ts +12 -0
  372. package/lib/Select/{OptionsList → rc-select}/OptGroup.js +1 -0
  373. package/lib/Select/rc-select/Option.d.ts +14 -0
  374. package/lib/Select/{OptionsList/Options.js → rc-select/Option.js} +1 -0
  375. package/lib/Select/rc-select/OptionList.d.ts +10 -0
  376. package/lib/Select/rc-select/OptionList.js +427 -0
  377. package/lib/Select/rc-select/Select.d.ts +109 -0
  378. package/lib/Select/rc-select/Select.js +545 -0
  379. package/lib/Select/rc-select/SelectContext.d.ts +20 -0
  380. package/lib/Select/rc-select/SelectContext.js +19 -0
  381. package/lib/Select/rc-select/SelectTrigger.d.ts +30 -0
  382. package/lib/Select/rc-select/SelectTrigger.js +153 -0
  383. package/lib/Select/rc-select/Selector/Input.d.ts +26 -0
  384. package/lib/Select/rc-select/Selector/Input.js +132 -0
  385. package/lib/Select/rc-select/Selector/MultipleSelector.d.ts +16 -0
  386. package/lib/Select/rc-select/Selector/MultipleSelector.js +257 -0
  387. package/lib/Select/rc-select/Selector/SingleSelector.d.ts +8 -0
  388. package/lib/Select/rc-select/Selector/SingleSelector.js +129 -0
  389. package/lib/Select/rc-select/Selector/index.d.ts +80 -0
  390. package/lib/Select/rc-select/Selector/index.js +203 -0
  391. package/lib/Select/rc-select/TransBtn.d.ts +12 -0
  392. package/lib/Select/rc-select/TransBtn.js +59 -0
  393. package/lib/Select/rc-select/hooks/useBaseProps.d.ts +13 -0
  394. package/lib/Select/rc-select/hooks/useBaseProps.js +28 -0
  395. package/lib/Select/rc-select/hooks/useCache.d.ts +7 -0
  396. package/lib/Select/rc-select/hooks/useCache.js +63 -0
  397. package/lib/Select/rc-select/hooks/useDelayReset.d.ts +5 -0
  398. package/lib/Select/rc-select/hooks/useDelayReset.js +62 -0
  399. package/lib/Select/rc-select/hooks/useFilterOptions.d.ts +3 -0
  400. package/lib/Select/rc-select/hooks/useFilterOptions.js +91 -0
  401. package/lib/Select/rc-select/hooks/useId.d.ts +5 -0
  402. package/lib/Select/rc-select/hooks/useId.js +68 -0
  403. package/lib/Select/rc-select/hooks/useLayoutEffect.d.ts +5 -0
  404. package/lib/Select/rc-select/hooks/useLayoutEffect.js +32 -0
  405. package/lib/Select/rc-select/hooks/useLock.d.ts +7 -0
  406. package/lib/Select/rc-select/hooks/useLock.js +49 -0
  407. package/lib/Select/rc-select/hooks/useOptions.d.ts +11 -0
  408. package/lib/Select/rc-select/hooks/useOptions.js +68 -0
  409. package/lib/Select/rc-select/hooks/useRefFunc.d.ts +5 -0
  410. package/lib/Select/rc-select/hooks/useRefFunc.js +29 -0
  411. package/lib/Select/rc-select/hooks/useSelectTriggerControl.d.ts +1 -0
  412. package/lib/Select/rc-select/hooks/useSelectTriggerControl.js +54 -0
  413. package/lib/Select/rc-select/index.d.ts +10 -0
  414. package/lib/Select/rc-select/index.js +45 -0
  415. package/lib/Select/rc-select/interface.d.ts +10 -0
  416. package/lib/Select/{interface.js → rc-select/interface.js} +0 -0
  417. package/lib/Select/rc-select/utils/commonUtil.d.ts +4 -0
  418. package/lib/Select/rc-select/utils/commonUtil.js +23 -0
  419. package/lib/Select/rc-select/utils/keyUtil.d.ts +2 -0
  420. package/lib/Select/rc-select/utils/keyUtil.js +17 -0
  421. package/lib/Select/rc-select/utils/legacyUtil.d.ts +3 -0
  422. package/lib/Select/rc-select/utils/legacyUtil.js +73 -0
  423. package/lib/Select/rc-select/utils/platformUtil.d.ts +1 -0
  424. package/lib/Select/rc-select/utils/platformUtil.js +11 -0
  425. package/lib/Select/rc-select/utils/valueUtil.d.ts +22 -0
  426. package/lib/Select/rc-select/utils/valueUtil.js +172 -0
  427. package/lib/Select/rc-select/utils/warningPropsUtil.d.ts +3 -0
  428. package/lib/Select/rc-select/utils/warningPropsUtil.js +132 -0
  429. package/lib/Select/style/index.d.ts +1 -0
  430. package/lib/Select/style/index.js +2 -0
  431. package/lib/Select/style/index.less +230 -480
  432. package/lib/Select/style/multiple.less +222 -0
  433. package/lib/Select/style/rtl.less +168 -0
  434. package/lib/Select/style/select.less +337 -0
  435. package/lib/Select/style/single.less +179 -0
  436. package/lib/Select/style/status.less +48 -0
  437. package/lib/Select/style/variables.less +67 -0
  438. package/lib/Select/style/variables.less.d.ts +100 -0
  439. package/lib/Select/utils/iconUtil.d.ts +24 -0
  440. package/lib/Select/utils/iconUtil.js +102 -0
  441. package/lib/Space/index.d.ts +1 -1
  442. package/lib/Space/index.js +0 -6
  443. package/lib/Table/Table.d.ts +5 -0
  444. package/lib/Table/Table.js +501 -0
  445. package/lib/Table/index.d.ts +2 -4
  446. package/lib/Table/index.js +2 -478
  447. package/lib/Table/interface.d.ts +11 -15
  448. package/lib/Table/style/index.less +51 -21
  449. package/lib/Tabs/index.d.ts +2 -1
  450. package/lib/Tabs/index.js +11 -4
  451. package/lib/Tabs/style/index.less +73 -7
  452. package/lib/Tooltip/style/index.less +2 -1
  453. package/lib/index.d.ts +15 -2
  454. package/lib/index.js +56 -0
  455. package/lib/style/index.less +3 -1
  456. package/lib/style/mixins/index.less +8 -0
  457. package/lib/style/themes/default/index.less +10 -10
  458. package/lib/style/themes/default/scrollBar.less +13 -0
  459. package/lib/style/themes/default/themeColor.module.less +58 -94
  460. package/lib/style/themes/default/themeColor.module.less.d.ts +1 -17
  461. package/package.json +3 -2
  462. package/es/Icon/iconfont/demo.css +0 -539
  463. package/es/Icon/iconfont/demo_index.html +0 -720
  464. package/es/Icon/iconfont/iconfont.css +0 -109
  465. package/es/Icon/iconfont/iconfont.js +0 -46
  466. package/es/Icon/iconfont/iconfont.json +0 -170
  467. package/es/Icon/iconfont/iconfont.ttf +0 -0
  468. package/es/Icon/iconfont/iconfont.woff +0 -0
  469. package/es/Icon/iconfont/iconfont.woff2 +0 -0
  470. package/es/Select/BaseSelect.d.ts +0 -5
  471. package/es/Select/BaseSelect.js +0 -413
  472. package/es/Select/OptionsList/OptGroup.d.ts +0 -7
  473. package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
  474. package/es/Select/OptionsList/OptionItem/RenderGroup.js +0 -16
  475. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
  476. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -45
  477. package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
  478. package/es/Select/OptionsList/OptionItem/RenderOption.js +0 -79
  479. package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
  480. package/es/Select/OptionsList/OptionItem/RenderTooltip.js +0 -25
  481. package/es/Select/OptionsList/OptionItem.d.ts +0 -4
  482. package/es/Select/OptionsList/OptionItem.js +0 -4
  483. package/es/Select/OptionsList/Options.d.ts +0 -7
  484. package/es/Select/OptionsList/index.d.ts +0 -4
  485. package/es/Select/OptionsList/index.js +0 -176
  486. package/es/Select/Selector/index.d.ts +0 -4
  487. package/es/Select/Selector/index.js +0 -252
  488. package/es/Select/VirtualList.d.ts +0 -5
  489. package/es/Select/VirtualList.js +0 -29
  490. package/es/Select/hooks/useCacheOption.d.ts +0 -9
  491. package/es/Select/hooks/useCacheOption.js +0 -107
  492. package/es/Select/interface.d.ts +0 -235
  493. package/es/Select/utils.d.ts +0 -21
  494. package/es/Select/utils.js +0 -193
  495. package/lib/Icon/iconfont/demo.css +0 -539
  496. package/lib/Icon/iconfont/demo_index.html +0 -720
  497. package/lib/Icon/iconfont/iconfont.css +0 -109
  498. package/lib/Icon/iconfont/iconfont.js +0 -48
  499. package/lib/Icon/iconfont/iconfont.json +0 -170
  500. package/lib/Icon/iconfont/iconfont.ttf +0 -0
  501. package/lib/Icon/iconfont/iconfont.woff +0 -0
  502. package/lib/Icon/iconfont/iconfont.woff2 +0 -0
  503. package/lib/Select/BaseSelect.d.ts +0 -5
  504. package/lib/Select/BaseSelect.js +0 -446
  505. package/lib/Select/OptionsList/OptGroup.d.ts +0 -7
  506. package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +0 -9
  507. package/lib/Select/OptionsList/OptionItem/RenderGroup.js +0 -27
  508. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +0 -10
  509. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +0 -60
  510. package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +0 -16
  511. package/lib/Select/OptionsList/OptionItem/RenderOption.js +0 -94
  512. package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +0 -8
  513. package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +0 -37
  514. package/lib/Select/OptionsList/OptionItem.d.ts +0 -4
  515. package/lib/Select/OptionsList/OptionItem.js +0 -39
  516. package/lib/Select/OptionsList/Options.d.ts +0 -7
  517. package/lib/Select/OptionsList/index.d.ts +0 -4
  518. package/lib/Select/OptionsList/index.js +0 -195
  519. package/lib/Select/Selector/index.d.ts +0 -4
  520. package/lib/Select/Selector/index.js +0 -276
  521. package/lib/Select/VirtualList.d.ts +0 -5
  522. package/lib/Select/VirtualList.js +0 -42
  523. package/lib/Select/hooks/useCacheOption.d.ts +0 -9
  524. package/lib/Select/hooks/useCacheOption.js +0 -113
  525. package/lib/Select/interface.d.ts +0 -235
  526. package/lib/Select/utils.d.ts +0 -21
  527. package/lib/Select/utils.js +0 -233
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import type { ScrollConfig } from 'rc-virtual-list/lib/List';
3
+ export declare type OptionListProps = Record<string, never>;
4
+ export interface RefOptionListProps {
5
+ onKeyDown: React.KeyboardEventHandler;
6
+ onKeyUp: React.KeyboardEventHandler;
7
+ scrollTo?: (args: number | ScrollConfig) => void;
8
+ }
9
+ declare const RefOptionList: React.ForwardRefExoticComponent<Pick<Record<string, never>, string> & React.RefAttributes<RefOptionListProps>>;
10
+ export default RefOptionList;
@@ -0,0 +1,401 @@
1
+ var _excluded = ["disabled", "title", "children", "style", "className"];
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
+
11
+ 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."); }
12
+
13
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
+
15
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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
+ // @ts-nocheck
30
+ import * as React from 'react';
31
+ import { useEffect } from 'react';
32
+ import KeyCode from 'rc-util/lib/KeyCode';
33
+ import omit from 'rc-util/lib/omit';
34
+ import pickAttrs from 'rc-util/lib/pickAttrs';
35
+ import useMemo from 'rc-util/lib/hooks/useMemo';
36
+ import classNames from 'classnames';
37
+ import List from 'rc-virtual-list';
38
+ import { isPlatformMac } from './utils/platformUtil';
39
+ import useBaseProps from './hooks/useBaseProps';
40
+ import SelectContext from './SelectContext';
41
+ import Checkbox from '../../Checkbox';
42
+ import Icon from '../../Icon';
43
+ import colors from '../../style/themes/default/themeColor.module.less';
44
+
45
+ function isTitleType(content) {
46
+ return typeof content === 'string' || typeof content === 'number';
47
+ }
48
+ /**
49
+ * Using virtual list of option display.
50
+ * Will fallback to dom if use customize render.
51
+ */
52
+
53
+
54
+ var OptionList = function OptionList(_, ref) {
55
+ var _useBaseProps = useBaseProps(),
56
+ prefixCls = _useBaseProps.prefixCls,
57
+ id = _useBaseProps.id,
58
+ open = _useBaseProps.open,
59
+ multiple = _useBaseProps.multiple,
60
+ mode = _useBaseProps.mode,
61
+ searchValue = _useBaseProps.searchValue,
62
+ toggleOpen = _useBaseProps.toggleOpen,
63
+ notFoundContent = _useBaseProps.notFoundContent,
64
+ onPopupScroll = _useBaseProps.onPopupScroll;
65
+
66
+ var _React$useContext = React.useContext(SelectContext),
67
+ flattenOptions = _React$useContext.flattenOptions,
68
+ onActiveValue = _React$useContext.onActiveValue,
69
+ defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption,
70
+ onSelect = _React$useContext.onSelect,
71
+ menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon,
72
+ rawValues = _React$useContext.rawValues,
73
+ fieldNames = _React$useContext.fieldNames,
74
+ virtual = _React$useContext.virtual,
75
+ listHeight = _React$useContext.listHeight,
76
+ listItemHeight = _React$useContext.listItemHeight;
77
+
78
+ var itemPrefixCls = "".concat(prefixCls, "-item");
79
+ var memoFlattenOptions = useMemo(function () {
80
+ return flattenOptions;
81
+ }, [open, flattenOptions], function (prev, next) {
82
+ return next[0] && prev[1] !== next[1];
83
+ }); // =========================== List ===========================
84
+
85
+ var listRef = React.useRef(null);
86
+
87
+ var onListMouseDown = function onListMouseDown(event) {
88
+ event.preventDefault();
89
+ };
90
+
91
+ var scrollIntoView = function scrollIntoView(args) {
92
+ if (listRef.current) {
93
+ listRef.current.scrollTo(typeof args === 'number' ? {
94
+ index: args
95
+ } : args);
96
+ }
97
+ }; // ========================== Active ==========================
98
+
99
+
100
+ var getEnabledActiveIndex = function getEnabledActiveIndex(index) {
101
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
102
+ var len = memoFlattenOptions.length;
103
+
104
+ for (var i = 0; i < len; i += 1) {
105
+ var current = (index + i * offset + len) % len;
106
+ var _memoFlattenOptions$c = memoFlattenOptions[current],
107
+ group = _memoFlattenOptions$c.group,
108
+ data = _memoFlattenOptions$c.data;
109
+
110
+ if (!group && !data.disabled) {
111
+ return current;
112
+ }
113
+ }
114
+
115
+ return -1;
116
+ };
117
+
118
+ var _React$useState = React.useState(function () {
119
+ return getEnabledActiveIndex(0);
120
+ }),
121
+ _React$useState2 = _slicedToArray(_React$useState, 2),
122
+ activeIndex = _React$useState2[0],
123
+ setActiveIndex = _React$useState2[1];
124
+
125
+ var setActive = function setActive(index) {
126
+ var fromKeyboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
127
+ setActiveIndex(index);
128
+ var info = {
129
+ source: fromKeyboard ? 'keyboard' : 'mouse'
130
+ }; // Trigger active event
131
+
132
+ var flattenItem = memoFlattenOptions[index];
133
+
134
+ if (!flattenItem) {
135
+ onActiveValue(null, -1, info);
136
+ return;
137
+ }
138
+
139
+ onActiveValue(flattenItem.value, index, info);
140
+ }; // Auto active first item when list length or searchValue changed
141
+
142
+
143
+ useEffect(function () {
144
+ setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
145
+ }, [memoFlattenOptions.length, searchValue]); // https://github.com/ant-design/ant-design/issues/34975
146
+
147
+ var isSelected = React.useCallback(function (value) {
148
+ return rawValues.has(value) && mode !== 'combobox';
149
+ }, [mode, _toConsumableArray(rawValues).toString()]); // Auto scroll to item position in single mode
150
+
151
+ useEffect(function () {
152
+ /**
153
+ * React will skip `onChange` when component update.
154
+ * `setActive` function will call root accessibility state update which makes re-render.
155
+ * So we need to delay to let Input component trigger onChange first.
156
+ */
157
+ var timeoutId = setTimeout(function () {
158
+ if (!multiple && open && rawValues.size === 1) {
159
+ var value = Array.from(rawValues)[0];
160
+ var index = memoFlattenOptions.findIndex(function (_ref) {
161
+ var data = _ref.data;
162
+ return data.value === value;
163
+ });
164
+
165
+ if (index !== -1) {
166
+ setActive(index);
167
+ scrollIntoView(index);
168
+ }
169
+ }
170
+ }); // Force trigger scrollbar visible when open
171
+
172
+ if (open) {
173
+ var _listRef$current;
174
+
175
+ (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(undefined);
176
+ }
177
+
178
+ return function () {
179
+ return clearTimeout(timeoutId);
180
+ };
181
+ }, [open, searchValue]); // ========================== Values ==========================
182
+
183
+ var onSelectValue = function onSelectValue(value) {
184
+ if (value !== undefined) {
185
+ onSelect(value, {
186
+ selected: !rawValues.has(value)
187
+ });
188
+ } // Single mode should always close by select
189
+
190
+
191
+ if (!multiple) {
192
+ toggleOpen(false);
193
+ }
194
+ }; // ========================= Keyboard =========================
195
+
196
+
197
+ React.useImperativeHandle(ref, function () {
198
+ return {
199
+ onKeyDown: function onKeyDown(event) {
200
+ var which = event.which,
201
+ ctrlKey = event.ctrlKey;
202
+
203
+ switch (which) {
204
+ // >>> Arrow keys & ctrl + n/p on Mac
205
+ case KeyCode.N:
206
+ case KeyCode.P:
207
+ case KeyCode.UP:
208
+ case KeyCode.DOWN:
209
+ {
210
+ var offset = 0;
211
+
212
+ if (which === KeyCode.UP) {
213
+ offset = -1;
214
+ } else if (which === KeyCode.DOWN) {
215
+ offset = 1;
216
+ } else if (isPlatformMac() && ctrlKey) {
217
+ if (which === KeyCode.N) {
218
+ offset = 1;
219
+ } else if (which === KeyCode.P) {
220
+ offset = -1;
221
+ }
222
+ }
223
+
224
+ if (offset !== 0) {
225
+ var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
226
+ scrollIntoView(nextActiveIndex);
227
+ setActive(nextActiveIndex, true);
228
+ }
229
+
230
+ break;
231
+ }
232
+ // >>> Select
233
+
234
+ case KeyCode.ENTER:
235
+ {
236
+ // value
237
+ var item = memoFlattenOptions[activeIndex];
238
+
239
+ if (item && !item.data.disabled) {
240
+ onSelectValue(item.value);
241
+ } else {
242
+ onSelectValue(undefined);
243
+ }
244
+
245
+ if (open) {
246
+ event.preventDefault();
247
+ }
248
+
249
+ break;
250
+ }
251
+ // >>> Close
252
+
253
+ case KeyCode.ESC:
254
+ {
255
+ toggleOpen(false);
256
+
257
+ if (open) {
258
+ event.stopPropagation();
259
+ }
260
+ }
261
+ }
262
+ },
263
+ onKeyUp: function onKeyUp() {},
264
+ scrollTo: function scrollTo(index) {
265
+ scrollIntoView(index);
266
+ }
267
+ };
268
+ }); // ========================== Render ==========================
269
+
270
+ if (memoFlattenOptions.length === 0) {
271
+ return /*#__PURE__*/React.createElement("div", {
272
+ role: "listbox",
273
+ id: "".concat(id, "_list"),
274
+ className: "".concat(itemPrefixCls, "-empty"),
275
+ onMouseDown: onListMouseDown
276
+ }, notFoundContent);
277
+ }
278
+
279
+ var omitFieldNameList = Object.keys(fieldNames).map(function (key) {
280
+ return fieldNames[key];
281
+ });
282
+
283
+ var getLabel = function getLabel(item) {
284
+ return item.label;
285
+ };
286
+
287
+ var renderItem = function renderItem(index) {
288
+ var item = memoFlattenOptions[index];
289
+ if (!item) return null;
290
+ var itemData = item.data || {};
291
+ var value = itemData.value;
292
+ var group = item.group;
293
+ var attrs = pickAttrs(itemData, true);
294
+ var mergedLabel = getLabel(item);
295
+ return item ? /*#__PURE__*/React.createElement("div", Object.assign({
296
+ "aria-label": typeof mergedLabel === 'string' && !group ? mergedLabel : null
297
+ }, attrs, {
298
+ key: index,
299
+ role: group ? 'presentation' : 'option',
300
+ id: "".concat(id, "_list_").concat(index),
301
+ "aria-selected": isSelected(value)
302
+ }), value) : null;
303
+ };
304
+
305
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
306
+ role: "listbox",
307
+ id: "".concat(id, "_list"),
308
+ style: {
309
+ height: 0,
310
+ width: 0,
311
+ overflow: 'hidden'
312
+ }
313
+ }, renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /*#__PURE__*/React.createElement(List, {
314
+ itemKey: "key",
315
+ ref: listRef,
316
+ data: memoFlattenOptions,
317
+ height: listHeight,
318
+ itemHeight: listItemHeight,
319
+ fullHeight: false,
320
+ onMouseDown: onListMouseDown,
321
+ onScroll: onPopupScroll,
322
+ virtual: virtual
323
+ }, function (item, itemIndex) {
324
+ var _classNames;
325
+
326
+ var group = item.group,
327
+ groupOption = item.groupOption,
328
+ data = item.data,
329
+ label = item.label,
330
+ value = item.value;
331
+ var key = data.key; // Group
332
+
333
+ if (group) {
334
+ var _data$title;
335
+
336
+ var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : isTitleType(label) ? label.toString() : undefined;
337
+ return /*#__PURE__*/React.createElement("div", {
338
+ className: classNames(itemPrefixCls, "".concat(itemPrefixCls, "-group")),
339
+ title: groupTitle
340
+ }, label !== undefined ? label : key);
341
+ }
342
+
343
+ var disabled = data.disabled,
344
+ title = data.title,
345
+ children = data.children,
346
+ style = data.style,
347
+ className = data.className,
348
+ otherProps = _objectWithoutProperties(data, _excluded);
349
+
350
+ var passedProps = omit(otherProps, omitFieldNameList); // Option
351
+
352
+ var selected = isSelected(value);
353
+ var optionPrefixCls = "".concat(itemPrefixCls, "-option");
354
+ var optionClassName = classNames(itemPrefixCls, optionPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(optionPrefixCls, "-grouped"), groupOption), _defineProperty(_classNames, "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !disabled), _defineProperty(_classNames, "".concat(optionPrefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(optionPrefixCls, "-selected"), selected), _classNames));
355
+ var mergedLabel = getLabel(item);
356
+ var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected; // https://github.com/ant-design/ant-design/issues/34145
357
+
358
+ var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value; // https://github.com/ant-design/ant-design/issues/26717
359
+
360
+ var optionTitle = isTitleType(content) ? content.toString() : undefined;
361
+
362
+ if (title !== undefined) {
363
+ optionTitle = title;
364
+ }
365
+
366
+ return /*#__PURE__*/React.createElement("div", Object.assign({}, pickAttrs(passedProps), {
367
+ "aria-selected": selected,
368
+ className: classNames(optionClassName, 'ald-select-item'),
369
+ title: optionTitle,
370
+ onMouseMove: function onMouseMove() {
371
+ if (activeIndex === itemIndex || disabled) {
372
+ return;
373
+ }
374
+
375
+ setActive(itemIndex);
376
+ },
377
+ onClick: function onClick() {
378
+ if (!disabled) {
379
+ onSelectValue(value);
380
+ }
381
+ },
382
+ style: style
383
+ }), !multiple && /*#__PURE__*/React.createElement("div", {
384
+ className: 'ald-select-single-check'
385
+ }, selected && /*#__PURE__*/React.createElement(Icon, {
386
+ color: colors.B60,
387
+ size: '1em',
388
+ type: "check"
389
+ })), multiple && /*#__PURE__*/React.createElement(Checkbox, {
390
+ className: 'ald-select-multiple-checkbox',
391
+ checked: selected,
392
+ disabled: disabled
393
+ }), /*#__PURE__*/React.createElement("div", {
394
+ className: "".concat(optionPrefixCls, "-content")
395
+ }, content), /*#__PURE__*/React.isValidElement(menuItemSelectedIcon) || selected);
396
+ }));
397
+ };
398
+
399
+ var RefOptionList = /*#__PURE__*/React.forwardRef(OptionList);
400
+ RefOptionList.displayName = 'OptionList';
401
+ export default RefOptionList;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * To match accessibility requirement, we always provide an input in the component.
3
+ * Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
4
+ * For focused select, we set `aria-live="polite"` to update the accessibility content.
5
+ *
6
+ * ref:
7
+ * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
8
+ *
9
+ * New api:
10
+ * - listHeight
11
+ * - listItemHeight
12
+ * - component
13
+ *
14
+ * Remove deprecated api:
15
+ * - multiple
16
+ * - tags
17
+ * - combobox
18
+ * - firstActiveValue
19
+ * - dropdownMenuStyle
20
+ * - openClassName (Not list in api)
21
+ *
22
+ * Update:
23
+ * - `backfill` only support `combobox` mode
24
+ * - `combobox` mode not support `labelInValue` since it's meaningless
25
+ * - `getInputElement` only support `combobox` mode
26
+ * - `onChange` return OptionData instead of ReactNode
27
+ * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
28
+ * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
29
+ * - `combobox` mode not support `optionLabelProp`
30
+ */
31
+ import * as React from 'react';
32
+ import type { DisplayValueType, RenderNode } from './BaseSelect';
33
+ import Option from './Option';
34
+ import OptGroup from './OptGroup';
35
+ import type { BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
36
+ export declare type OnActiveValue = (active: RawValueType, index: number, info?: {
37
+ source?: 'keyboard' | 'mouse';
38
+ }) => void;
39
+ export declare type OnInternalSelect = (value: RawValueType, info: {
40
+ selected: boolean;
41
+ }) => void;
42
+ export declare type RawValueType = string | number;
43
+ export interface LabelInValueType {
44
+ label: React.ReactNode;
45
+ value: RawValueType;
46
+ /** @deprecated `key` is useless since it should always same as `value` */
47
+ key?: React.Key;
48
+ }
49
+ export declare type DraftValueType = RawValueType | LabelInValueType | DisplayValueType | (RawValueType | LabelInValueType | DisplayValueType)[];
50
+ export declare type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
51
+ export interface FieldNames {
52
+ value?: string;
53
+ label?: string;
54
+ options?: string;
55
+ }
56
+ export interface BaseOptionType {
57
+ disabled?: boolean;
58
+ [name: string]: any;
59
+ }
60
+ export interface DefaultOptionType extends BaseOptionType {
61
+ label: React.ReactNode;
62
+ value?: string | number | null;
63
+ children?: Omit<DefaultOptionType, 'children'>[];
64
+ }
65
+ export declare type SelectHandler<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> = ((value: RawValueType | LabelInValueType, option: OptionType) => void) | ((value: ValueType, option: OptionType) => void);
66
+ declare type ArrayElementType<T> = T extends (infer E)[] ? E : T;
67
+ export interface SelectProps<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> extends BaseSelectPropsWithoutPrivate {
68
+ prefixCls?: string;
69
+ id?: string;
70
+ backfill?: boolean;
71
+ fieldNames?: FieldNames;
72
+ /** @deprecated Use `searchValue` instead */
73
+ inputValue?: string;
74
+ searchValue?: string;
75
+ onSearch?: (value: string) => void;
76
+ autoClearSearchValue?: boolean;
77
+ onSelect?: SelectHandler<ArrayElementType<ValueType>, OptionType>;
78
+ onDeselect?: SelectHandler<ArrayElementType<ValueType>, OptionType>;
79
+ /**
80
+ * In Select, `false` means do nothing.
81
+ * In TreeSelect, `false` will highlight match item.
82
+ * It's by design.
83
+ */
84
+ filterOption?: boolean | FilterFunc<OptionType>;
85
+ filterSort?: (optionA: OptionType, optionB: OptionType) => number;
86
+ optionFilterProp?: string;
87
+ optionLabelProp?: string;
88
+ children?: React.ReactNode;
89
+ options?: OptionType[];
90
+ defaultActiveFirstOption?: boolean;
91
+ virtual?: boolean;
92
+ listHeight?: number;
93
+ listItemHeight?: number;
94
+ menuItemSelectedIcon?: RenderNode;
95
+ mode?: 'combobox' | 'multiple' | 'tags';
96
+ labelInValue?: boolean;
97
+ value?: ValueType | null;
98
+ defaultValue?: ValueType | null;
99
+ onChange?: (value: ValueType, option: OptionType | OptionType[]) => void;
100
+ }
101
+ declare const TypedSelect: (<ValueType = any, OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
102
+ children?: React.ReactNode;
103
+ } & {
104
+ ref?: ((instance: BaseSelectRef | null) => void) | React.RefObject<BaseSelectRef> | null | undefined;
105
+ }) => React.ReactElement) & {
106
+ Option: typeof Option;
107
+ OptGroup: typeof OptGroup;
108
+ };
109
+ export default TypedSelect;