@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,35 @@
1
+ // @ts-nocheck
2
+ import * as React from 'react';
3
+ /**
4
+ * Locker return cached mark.
5
+ * If set to `true`, will return `true` in a short time even if set `false`.
6
+ * If set to `false` and then set to `true`, will change to `true`.
7
+ * And after time duration, it will back to `null` automatically.
8
+ */
9
+
10
+ export default function useLock() {
11
+ var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 250;
12
+ var lockRef = React.useRef(null);
13
+ var timeoutRef = React.useRef(null); // Clean up
14
+
15
+ React.useEffect(function () {
16
+ return function () {
17
+ window.clearTimeout(timeoutRef.current);
18
+ };
19
+ }, []);
20
+
21
+ function doLock(locked) {
22
+ if (locked || lockRef.current === null) {
23
+ lockRef.current = locked;
24
+ }
25
+
26
+ window.clearTimeout(timeoutRef.current);
27
+ timeoutRef.current = window.setTimeout(function () {
28
+ lockRef.current = null;
29
+ }, duration);
30
+ }
31
+
32
+ return [function () {
33
+ return lockRef.current;
34
+ }, doLock];
35
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import type { FieldNames } from '../Select';
3
+ /**
4
+ * Parse `children` to `options` if `options` is not provided.
5
+ * Then flatten the `options`.
6
+ */
7
+ export default function useOptions<OptionType>(options: OptionType[], children: React.ReactNode, fieldNames: FieldNames, optionFilterProp: string, optionLabelProp: string): {
8
+ options: OptionType[];
9
+ valueOptions: Map<React.ReactText, OptionType>;
10
+ labelOptions: Map<React.ReactNode, OptionType>;
11
+ };
@@ -0,0 +1,53 @@
1
+ // @ts-nocheck
2
+ import * as React from 'react';
3
+ import { convertChildrenToData } from '../utils/legacyUtil';
4
+ /**
5
+ * Parse `children` to `options` if `options` is not provided.
6
+ * Then flatten the `options`.
7
+ */
8
+
9
+ export default function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
10
+ return React.useMemo(function () {
11
+ var mergedOptions = options;
12
+ var childrenAsData = !options;
13
+
14
+ if (childrenAsData) {
15
+ mergedOptions = convertChildrenToData(children);
16
+ }
17
+
18
+ var valueOptions = new Map();
19
+ var labelOptions = new Map();
20
+
21
+ var setLabelOptions = function setLabelOptions(labelOptionsMap, option, key) {
22
+ if (key && typeof key === 'string') {
23
+ labelOptionsMap.set(option[key], option);
24
+ }
25
+ };
26
+
27
+ function dig(optionList) {
28
+ var isChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
29
+
30
+ // for loop to speed up collection speed
31
+ for (var i = 0; i < optionList.length; i += 1) {
32
+ var option = optionList[i];
33
+
34
+ if (!option[fieldNames.options] || isChildren) {
35
+ valueOptions.set(option[fieldNames.value], option);
36
+ setLabelOptions(labelOptions, option, fieldNames.label); // https://github.com/ant-design/ant-design/issues/35304
37
+
38
+ setLabelOptions(labelOptions, option, optionFilterProp);
39
+ setLabelOptions(labelOptions, option, optionLabelProp);
40
+ } else {
41
+ dig(option[fieldNames.options], true);
42
+ }
43
+ }
44
+ }
45
+
46
+ dig(mergedOptions);
47
+ return {
48
+ options: mergedOptions,
49
+ valueOptions: valueOptions,
50
+ labelOptions: labelOptions
51
+ };
52
+ }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
53
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Same as `React.useCallback` but always return a memoized function
3
+ * but redirect to real function.
4
+ */
5
+ export default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T;
@@ -0,0 +1,15 @@
1
+ // @ts-nocheck
2
+ import * as React from 'react';
3
+ /**
4
+ * Same as `React.useCallback` but always return a memoized function
5
+ * but redirect to real function.
6
+ */
7
+
8
+ export default function useRefFunc(callback) {
9
+ var funcRef = React.useRef();
10
+ funcRef.current = callback;
11
+ var cacheFn = React.useCallback(function () {
12
+ return funcRef.current.apply(funcRef, arguments);
13
+ }, []);
14
+ return cacheFn;
15
+ }
@@ -0,0 +1 @@
1
+ export default function useSelectTriggerControl(elements: () => (HTMLElement | undefined)[], open: boolean, triggerOpen: (open: boolean) => void, customizedTrigger: boolean): void;
@@ -0,0 +1,40 @@
1
+ // @ts-nocheck
2
+ import * as React from 'react';
3
+ export default function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
4
+ var propsRef = React.useRef(null);
5
+ propsRef.current = {
6
+ open: open,
7
+ triggerOpen: triggerOpen,
8
+ customizedTrigger: customizedTrigger
9
+ };
10
+ React.useEffect(function () {
11
+ function onGlobalMouseDown(event) {
12
+ var _propsRef$current;
13
+
14
+ // If trigger is customized, Trigger will take control of popupVisible
15
+ if ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current.customizedTrigger) {
16
+ return;
17
+ }
18
+
19
+ var target = event.target;
20
+
21
+ if (target.shadowRoot && event.composed) {
22
+ target = event.composedPath()[0] || target;
23
+ }
24
+
25
+ if (propsRef.current.open && elements().filter(function (element) {
26
+ return element;
27
+ }).every(function (element) {
28
+ return !element.contains(target) && element !== target;
29
+ })) {
30
+ // Should trigger close
31
+ propsRef.current.triggerOpen(false);
32
+ }
33
+ }
34
+
35
+ window.addEventListener('mousedown', onGlobalMouseDown);
36
+ return function () {
37
+ return window.removeEventListener('mousedown', onGlobalMouseDown);
38
+ };
39
+ }, []);
40
+ }
@@ -0,0 +1,10 @@
1
+ import Select from './Select';
2
+ import Option from './Option';
3
+ import OptGroup from './OptGroup';
4
+ import type { SelectProps } from './Select';
5
+ import BaseSelect from './BaseSelect';
6
+ import type { BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
7
+ import useBaseProps from './hooks/useBaseProps';
8
+ export { Option, OptGroup, BaseSelect, useBaseProps };
9
+ export type { SelectProps, BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate };
10
+ export default Select;
@@ -0,0 +1,7 @@
1
+ import Select from './Select';
2
+ import Option from './Option';
3
+ import OptGroup from './OptGroup';
4
+ import BaseSelect from './BaseSelect';
5
+ import useBaseProps from './hooks/useBaseProps';
6
+ export { Option, OptGroup, BaseSelect, useBaseProps };
7
+ export default Select;
@@ -0,0 +1,10 @@
1
+ import type * as React from 'react';
2
+ import type { RawValueType } from './BaseSelect';
3
+ export interface FlattenOptionData<OptionType> {
4
+ label?: React.ReactNode;
5
+ data: OptionType;
6
+ key: React.Key;
7
+ value?: RawValueType;
8
+ groupOption?: boolean;
9
+ group?: boolean;
10
+ }
@@ -0,0 +1,4 @@
1
+ export declare function toArray<T>(value: T | T[]): T[];
2
+ export declare const isClient: false | HTMLElement;
3
+ /** Is client side and not jsdom */
4
+ export declare const isBrowserClient: false | HTMLElement;
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ export function toArray(value) {
3
+ if (Array.isArray(value)) {
4
+ return value;
5
+ }
6
+
7
+ return value !== undefined ? [value] : [];
8
+ }
9
+ export var isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
10
+ /** Is client side and not jsdom */
11
+
12
+ export var isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;
@@ -0,0 +1,2 @@
1
+ /** keyCode Judgment function */
2
+ export declare function isValidateOpenKey(currentKeyCode: number): boolean;
@@ -0,0 +1,8 @@
1
+ import KeyCode from 'rc-util/lib/KeyCode';
2
+ /** keyCode Judgment function */
3
+
4
+ export function isValidateOpenKey(currentKeyCode) {
5
+ return ![// System function button
6
+ KeyCode.ESC, KeyCode.SHIFT, KeyCode.BACKSPACE, KeyCode.TAB, KeyCode.WIN_KEY, KeyCode.ALT, KeyCode.META, KeyCode.WIN_KEY_RIGHT, KeyCode.CTRL, KeyCode.SEMICOLON, KeyCode.EQUALS, KeyCode.CAPS_LOCK, KeyCode.CONTEXT_MENU, // F1-F12
7
+ KeyCode.F1, KeyCode.F2, KeyCode.F3, KeyCode.F4, KeyCode.F5, KeyCode.F6, KeyCode.F7, KeyCode.F8, KeyCode.F9, KeyCode.F10, KeyCode.F11, KeyCode.F12].includes(currentKeyCode);
8
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { BaseOptionType, DefaultOptionType } from '../Select';
3
+ export declare function convertChildrenToData<OptionType extends BaseOptionType = DefaultOptionType>(nodes: React.ReactNode, optionOnly?: boolean): OptionType[];
@@ -0,0 +1,58 @@
1
+ var _excluded = ["children", "value"],
2
+ _excluded2 = ["children"];
3
+
4
+ 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; }
5
+
6
+ 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; }
7
+
8
+ 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; }
9
+
10
+ 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; }
11
+
12
+ 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; }
13
+
14
+ // @ts-nocheck
15
+ import * as React from 'react';
16
+ import toArray from 'rc-util/lib/Children/toArray';
17
+
18
+ function convertNodeToOption(node) {
19
+ var key = node.key,
20
+ _node$props = node.props,
21
+ children = _node$props.children,
22
+ value = _node$props.value,
23
+ restProps = _objectWithoutProperties(_node$props, _excluded);
24
+
25
+ return _objectSpread({
26
+ key: key,
27
+ value: value !== undefined ? value : key,
28
+ children: children
29
+ }, restProps);
30
+ }
31
+
32
+ export function convertChildrenToData(nodes) {
33
+ var optionOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
34
+ return toArray(nodes).map(function (node, index) {
35
+ if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {
36
+ return null;
37
+ }
38
+
39
+ var isSelectOptGroup = node.type.isSelectOptGroup,
40
+ key = node.key,
41
+ _node$props2 = node.props,
42
+ children = _node$props2.children,
43
+ restProps = _objectWithoutProperties(_node$props2, _excluded2);
44
+
45
+ if (optionOnly || !isSelectOptGroup) {
46
+ return convertNodeToOption(node);
47
+ }
48
+
49
+ return _objectSpread(_objectSpread({
50
+ key: "__RC_SELECT_GRP__".concat(key === null ? index : key, "__"),
51
+ label: key
52
+ }, restProps), {}, {
53
+ options: convertChildrenToData(children)
54
+ });
55
+ }).filter(function (data) {
56
+ return data;
57
+ });
58
+ }
@@ -0,0 +1 @@
1
+ export declare function isPlatformMac(): boolean;
@@ -0,0 +1,4 @@
1
+ /* istanbul ignore file */
2
+ export function isPlatformMac() {
3
+ return /(mac\sos|macintosh)/i.test(navigator.appVersion);
4
+ }
@@ -0,0 +1,22 @@
1
+ import type { BaseOptionType, DefaultOptionType } from '../Select';
2
+ import type { FieldNames } from '../Select';
3
+ import type { FlattenOptionData } from '../interface';
4
+ export declare function fillFieldNames(fieldNames: FieldNames | undefined, childrenAsData: boolean): {
5
+ label: string;
6
+ value: string;
7
+ options: string;
8
+ };
9
+ /**
10
+ * Flat options into flatten list.
11
+ * We use `optionOnly` here is aim to avoid user use nested option group.
12
+ * Here is simply set `key` to the index if not provided.
13
+ */
14
+ export declare function flattenOptions<OptionType extends BaseOptionType = DefaultOptionType>(options: OptionType[], { fieldNames, childrenAsData }?: {
15
+ fieldNames?: FieldNames;
16
+ childrenAsData?: boolean;
17
+ }): FlattenOptionData<OptionType>[];
18
+ /**
19
+ * Inject `props` into `option` for legacy usage
20
+ */
21
+ export declare function injectPropsWithOption<T>(option: T): T;
22
+ export declare function getSeparatedContent(text: string, tokens: string[]): string[];
@@ -0,0 +1,157 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ 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."); }
4
+
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+
7
+ function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
8
+
9
+ 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."); }
10
+
11
+ 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); }
12
+
13
+ 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; }
14
+
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ 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; }
20
+
21
+ 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; }
22
+
23
+ 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; }
24
+
25
+ import warning from 'rc-util/lib/warning';
26
+
27
+ function getKey(data, index) {
28
+ var key = data.key;
29
+ var value;
30
+
31
+ if ('value' in data) {
32
+ value = data.value;
33
+ }
34
+
35
+ if (key !== null && key !== undefined) {
36
+ return key;
37
+ }
38
+
39
+ if (value !== undefined) {
40
+ return value;
41
+ }
42
+
43
+ return "rc-index-key-".concat(index);
44
+ }
45
+
46
+ export function fillFieldNames(fieldNames, childrenAsData) {
47
+ var _ref = fieldNames || {},
48
+ label = _ref.label,
49
+ value = _ref.value,
50
+ options = _ref.options;
51
+
52
+ return {
53
+ label: label || (childrenAsData ? 'children' : 'label'),
54
+ value: value || 'value',
55
+ options: options || 'options'
56
+ };
57
+ }
58
+ /**
59
+ * Flat options into flatten list.
60
+ * We use `optionOnly` here is aim to avoid user use nested option group.
61
+ * Here is simply set `key` to the index if not provided.
62
+ */
63
+
64
+ export function flattenOptions(options) {
65
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
66
+ fieldNames = _ref2.fieldNames,
67
+ childrenAsData = _ref2.childrenAsData;
68
+
69
+ var flattenList = [];
70
+
71
+ var _fillFieldNames = fillFieldNames(fieldNames, false),
72
+ fieldLabel = _fillFieldNames.label,
73
+ fieldValue = _fillFieldNames.value,
74
+ fieldOptions = _fillFieldNames.options;
75
+
76
+ function dig(list, isGroupOption) {
77
+ list.forEach(function (data) {
78
+ var label = data[fieldLabel];
79
+
80
+ if (isGroupOption || !(fieldOptions in data)) {
81
+ var value = data[fieldValue]; // Option
82
+
83
+ flattenList.push({
84
+ key: getKey(data, flattenList.length),
85
+ groupOption: isGroupOption,
86
+ data: data,
87
+ label: label,
88
+ value: value
89
+ });
90
+ } else {
91
+ var grpLabel = label;
92
+
93
+ if (grpLabel === undefined && childrenAsData) {
94
+ grpLabel = data.label;
95
+ } // Option Group
96
+
97
+
98
+ flattenList.push({
99
+ key: getKey(data, flattenList.length),
100
+ group: true,
101
+ data: data,
102
+ label: grpLabel
103
+ });
104
+ dig(data[fieldOptions], true);
105
+ }
106
+ });
107
+ }
108
+
109
+ dig(options, false);
110
+ return flattenList;
111
+ }
112
+ /**
113
+ * Inject `props` into `option` for legacy usage
114
+ */
115
+
116
+ export function injectPropsWithOption(option) {
117
+ var newOption = _objectSpread({}, option);
118
+
119
+ if (!('props' in newOption)) {
120
+ Object.defineProperty(newOption, 'props', {
121
+ get: function get() {
122
+ warning(false, 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.');
123
+ return newOption;
124
+ }
125
+ });
126
+ }
127
+
128
+ return newOption;
129
+ }
130
+ export function getSeparatedContent(text, tokens) {
131
+ if (!tokens || !tokens.length) {
132
+ return null;
133
+ }
134
+
135
+ var match = false;
136
+
137
+ function separate(str, _ref3) {
138
+ var _ref4 = _toArray(_ref3),
139
+ token = _ref4[0],
140
+ restTokens = _ref4.slice(1);
141
+
142
+ if (!token) {
143
+ return [str];
144
+ }
145
+
146
+ var list = str.split(token);
147
+ match = match || list.length > 1;
148
+ return list.reduce(function (prevList, unitStr) {
149
+ return [].concat(_toConsumableArray(prevList), _toConsumableArray(separate(unitStr, restTokens)));
150
+ }, []).filter(function (unit) {
151
+ return unit;
152
+ });
153
+ }
154
+
155
+ var list = separate(text, tokens);
156
+ return match ? list : null;
157
+ }
@@ -0,0 +1,3 @@
1
+ import type { SelectProps } from '../Select';
2
+ declare function warningProps(props: SelectProps): void;
3
+ export default warningProps;
@@ -0,0 +1,114 @@
1
+ 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); }
2
+
3
+ // @ts-nocheck
4
+ import * as React from 'react';
5
+ import warning, { noteOnce } from 'rc-util/lib/warning';
6
+ import toNodeArray from 'rc-util/lib/Children/toArray';
7
+ import { convertChildrenToData } from './legacyUtil';
8
+ import { toArray } from './commonUtil';
9
+ import { isMultiple } from '../BaseSelect';
10
+
11
+ function warningProps(props) {
12
+ var mode = props.mode,
13
+ options = props.options,
14
+ children = props.children,
15
+ backfill = props.backfill,
16
+ allowClear = props.allowClear,
17
+ placeholder = props.placeholder,
18
+ getInputElement = props.getInputElement,
19
+ showSearch = props.showSearch,
20
+ onSearch = props.onSearch,
21
+ defaultOpen = props.defaultOpen,
22
+ autoFocus = props.autoFocus,
23
+ labelInValue = props.labelInValue,
24
+ value = props.value,
25
+ inputValue = props.inputValue,
26
+ optionLabelProp = props.optionLabelProp;
27
+ var multiple = isMultiple(mode);
28
+ var mergedShowSearch = showSearch !== undefined ? showSearch : multiple || mode === 'combobox';
29
+ var mergedOptions = options || convertChildrenToData(children); // `tags` should not set option as disabled
30
+
31
+ warning(mode !== 'tags' || mergedOptions.every(function (opt) {
32
+ return !opt.disabled;
33
+ }), 'Please avoid setting option to disabled in tags mode since user can always type text as tag.'); // `combobox` & `tags` should option be `string` type
34
+
35
+ if (mode === 'tags' || mode === 'combobox') {
36
+ var hasNumberValue = mergedOptions.some(function (item) {
37
+ if (item.options) {
38
+ return item.options.some(function (opt) {
39
+ return typeof ('value' in opt ? opt.value : opt.key) === 'number';
40
+ });
41
+ }
42
+
43
+ return typeof ('value' in item ? item.value : item.key) === 'number';
44
+ });
45
+ warning(!hasNumberValue, '`value` of Option should not use number type when `mode` is `tags` or `combobox`.');
46
+ } // `combobox` should not use `optionLabelProp`
47
+
48
+
49
+ warning(mode !== 'combobox' || !optionLabelProp, '`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.'); // Only `combobox` support `backfill`
50
+
51
+ warning(mode === 'combobox' || !backfill, '`backfill` only works with `combobox` mode.'); // Only `combobox` support `getInputElement`
52
+
53
+ warning(mode === 'combobox' || !getInputElement, '`getInputElement` only work with `combobox` mode.'); // Customize `getInputElement` should not use `allowClear` & `placeholder`
54
+
55
+ noteOnce(mode !== 'combobox' || !getInputElement || !allowClear || !placeholder, 'Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.'); // `onSearch` should use in `combobox` or `showSearch`
56
+
57
+ if (onSearch && !mergedShowSearch && mode !== 'combobox' && mode !== 'tags') {
58
+ warning(false, '`onSearch` should work with `showSearch` instead of use alone.');
59
+ }
60
+
61
+ noteOnce(!defaultOpen || autoFocus, '`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.');
62
+
63
+ if (value !== undefined && value !== null) {
64
+ var values = toArray(value);
65
+ warning(!labelInValue || values.every(function (val) {
66
+ return _typeof(val) === 'object' && ('key' in val || 'value' in val);
67
+ }), '`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`');
68
+ warning(!multiple || Array.isArray(value), '`value` should be array when `mode` is `multiple` or `tags`');
69
+ } // Syntactic sugar should use correct children type
70
+
71
+
72
+ if (children) {
73
+ var invalidateChildType = null;
74
+ toNodeArray(children).some(function (node) {
75
+ if (! /*#__PURE__*/React.isValidElement(node) || !node.type) {
76
+ return false;
77
+ }
78
+
79
+ var type = node.type;
80
+
81
+ if (type.isSelectOption) {
82
+ return false;
83
+ }
84
+
85
+ if (type.isSelectOptGroup) {
86
+ var allChildrenValid = toNodeArray(node.props.children).every(function (subNode) {
87
+ if (! /*#__PURE__*/React.isValidElement(subNode) || !node.type || subNode.type.isSelectOption) {
88
+ return true;
89
+ }
90
+
91
+ invalidateChildType = subNode.type;
92
+ return false;
93
+ });
94
+
95
+ if (allChildrenValid) {
96
+ return false;
97
+ }
98
+
99
+ return true;
100
+ }
101
+
102
+ invalidateChildType = type;
103
+ return true;
104
+ });
105
+
106
+ if (invalidateChildType) {
107
+ warning(false, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(invalidateChildType.displayName || invalidateChildType.name || invalidateChildType, "`."));
108
+ }
109
+
110
+ warning(inputValue === undefined, '`inputValue` is deprecated, please use `searchValue` instead.');
111
+ }
112
+ }
113
+
114
+ export default warningProps;
@@ -1,2 +1,4 @@
1
+ import 'antd/lib/style/index.less';
2
+ import '../../Empty/style';
1
3
  import '../../style';
2
4
  import './index.less';
@@ -1,2 +1,5 @@
1
+ import 'antd/lib/style/index.less';
2
+ import '../../Empty/style';
1
3
  import '../../style';
2
- import './index.less';
4
+ import './index.less'; // style dependencies
5
+ // deps-lint-skip: form