@aloudata/aloudata-design 0.1.0-beta1 → 0.2.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 (402) hide show
  1. package/README.md +22 -13
  2. package/es/Button/demo/Icon/index.d.ts +3 -0
  3. package/es/Button/demo/Icon/index.js +67 -0
  4. package/{src → es}/Button/demo/Icon/index.less +0 -0
  5. package/es/Button/demo/basic/index.d.ts +4 -0
  6. package/es/Button/demo/basic/index.js +57 -0
  7. package/{src → es}/Button/demo/basic/index.less +0 -1
  8. package/es/Button/demo/disable/index.d.ts +3 -0
  9. package/es/Button/demo/disable/index.js +23 -0
  10. package/{src → es}/Button/demo/disable/index.less +0 -0
  11. package/es/Button/demo/href/index.d.ts +2 -0
  12. package/es/Button/demo/href/index.js +17 -0
  13. package/es/Button/demo/loading/index.d.ts +3 -0
  14. package/es/Button/demo/loading/index.js +37 -0
  15. package/{src → es}/Button/demo/loading/index.less +0 -0
  16. package/es/Button/index.d.ts +50 -0
  17. package/es/Button/index.js +108 -0
  18. package/es/Button/style/index.d.ts +2 -0
  19. package/es/Button/style/index.js +2 -0
  20. package/{src → es}/Button/style/index.less +5 -5
  21. package/es/Dropdown/Button.d.ts +69 -0
  22. package/es/Dropdown/Button.js +39 -0
  23. package/es/Dropdown/demo/basic/index.d.ts +4 -0
  24. package/es/Dropdown/demo/basic/index.js +18 -0
  25. package/es/Dropdown/demo/button/index.d.ts +3 -0
  26. package/es/Dropdown/demo/button/index.js +159 -0
  27. package/{src → es}/Dropdown/demo/button/index.less +0 -0
  28. package/es/Dropdown/demo/placement/index.d.ts +2 -0
  29. package/es/Dropdown/demo/placement/index.js +40 -0
  30. package/es/Dropdown/demo/subMenu/index.d.ts +2 -0
  31. package/es/Dropdown/demo/subMenu/index.js +42 -0
  32. package/es/Dropdown/demo/trigger/index.d.ts +2 -0
  33. package/es/Dropdown/demo/trigger/index.js +17 -0
  34. package/es/Dropdown/index.d.ts +59 -0
  35. package/es/Dropdown/index.js +33 -0
  36. package/es/Dropdown/style/index.d.ts +2 -0
  37. package/es/Dropdown/style/index.js +2 -0
  38. package/{src → es}/Dropdown/style/index.less +0 -0
  39. package/es/Empty/index.d.ts +8 -0
  40. package/es/Empty/index.js +57 -0
  41. package/es/Empty/style/index.d.ts +1 -0
  42. package/es/Empty/style/index.js +1 -0
  43. package/es/Empty/style/index.less +23 -0
  44. package/{src → es}/Icon/iconfont/demo.css +0 -0
  45. package/{src → es}/Icon/iconfont/demo_index.html +49 -3
  46. package/es/Icon/iconfont/iconfont.css +101 -0
  47. package/es/Icon/iconfont/iconfont.js +46 -0
  48. package/{src → es}/Icon/iconfont/iconfont.json +14 -0
  49. package/es/Icon/iconfont/iconfont.ttf +0 -0
  50. package/es/Icon/iconfont/iconfont.woff +0 -0
  51. package/es/Icon/iconfont/iconfont.woff2 +0 -0
  52. package/es/Icon/index.d.ts +11 -0
  53. package/es/Icon/index.js +42 -0
  54. package/{src → es}/Icon/index.less +3 -3
  55. package/es/Input/components/Group/index.d.ts +14 -0
  56. package/es/Input/components/Group/index.js +12 -0
  57. package/es/Input/components/Password/index.d.ts +9 -0
  58. package/es/Input/components/Password/index.js +20 -0
  59. package/es/Input/components/TextArea/index.d.ts +52 -0
  60. package/es/Input/components/TextArea/index.js +14 -0
  61. package/es/Input/demo/allowClear/index.d.ts +3 -0
  62. package/es/Input/demo/allowClear/index.js +11 -0
  63. package/{src → es}/Input/demo/allowClear/index.less +0 -0
  64. package/es/Input/demo/basic/index.d.ts +4 -0
  65. package/es/Input/demo/basic/index.js +65 -0
  66. package/{src → es}/Input/demo/basic/index.less +1 -1
  67. package/es/Input/demo/gourp/index.d.ts +2 -0
  68. package/es/Input/demo/gourp/index.js +67 -0
  69. package/es/Input/demo/password/index.d.ts +3 -0
  70. package/es/Input/demo/password/index.js +21 -0
  71. package/{src → es}/Input/demo/password/index.less +0 -0
  72. package/es/Input/demo/prefix/index.d.ts +3 -0
  73. package/es/Input/demo/prefix/index.js +17 -0
  74. package/{src → es}/Input/demo/prefix/index.less +0 -0
  75. package/es/Input/demo/showCount/index.d.ts +3 -0
  76. package/es/Input/demo/showCount/index.js +17 -0
  77. package/{src → es}/Input/demo/showCount/index.less +0 -0
  78. package/es/Input/demo/textArea/autoSize.d.ts +2 -0
  79. package/es/Input/demo/textArea/autoSize.js +50 -0
  80. package/es/Input/index.d.ts +65 -0
  81. package/es/Input/index.js +46 -0
  82. package/es/Input/style/index.d.ts +2 -0
  83. package/es/Input/style/index.js +2 -0
  84. package/{src → es}/Input/style/index.less +4 -1
  85. package/es/Menu/Divider.d.ts +4 -0
  86. package/es/Menu/Divider.js +15 -0
  87. package/es/Menu/MenuItem.d.ts +17 -0
  88. package/es/Menu/MenuItem.js +15 -0
  89. package/es/Menu/SubMenu.d.ts +26 -0
  90. package/es/Menu/SubMenu.js +29 -0
  91. package/es/Menu/index.d.ts +20 -0
  92. package/es/Menu/index.js +31 -0
  93. package/es/Menu/style/index.d.ts +2 -0
  94. package/es/Menu/style/index.js +2 -0
  95. package/{src → es}/Menu/style/index.less +4 -0
  96. package/es/Navigator/components/Menu/index.d.ts +19 -0
  97. package/es/Navigator/components/Menu/index.js +187 -0
  98. package/es/Navigator/demo/basic/index.d.ts +4 -0
  99. package/es/Navigator/demo/basic/index.js +45 -0
  100. package/es/Navigator/demo/basic/index.less +3 -0
  101. package/es/Navigator/demo/example/index.d.ts +4 -0
  102. package/es/Navigator/demo/example/index.js +153 -0
  103. package/es/Navigator/demo/example/index.less +10 -0
  104. package/es/Navigator/demo/logo.png +0 -0
  105. package/es/Navigator/demo/menuWithFooter/index.d.ts +4 -0
  106. package/es/Navigator/demo/menuWithFooter/index.js +73 -0
  107. package/es/Navigator/demo/menuWithFooter/index.less +3 -0
  108. package/es/Navigator/demo/subMenu/index.d.ts +4 -0
  109. package/es/Navigator/demo/subMenu/index.js +71 -0
  110. package/es/Navigator/demo/subMenu/index.less +3 -0
  111. package/es/Navigator/index.d.ts +41 -0
  112. package/es/Navigator/index.js +45 -0
  113. package/es/Navigator/style/index.d.ts +2 -0
  114. package/es/Navigator/style/index.js +2 -0
  115. package/es/Navigator/style/index.less +224 -0
  116. package/es/Select/BaseSelect.d.ts +5 -0
  117. package/es/Select/BaseSelect.js +400 -0
  118. package/{src/Select/OptionsList/OptGroup.tsx → es/Select/OptionsList/OptGroup.d.ts} +2 -4
  119. package/es/Select/OptionsList/OptGroup.js +6 -0
  120. package/es/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
  121. package/es/Select/OptionsList/OptionItem/RenderGroup.js +16 -0
  122. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
  123. package/es/Select/OptionsList/OptionItem/RenderLabelIcon.js +44 -0
  124. package/es/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
  125. package/es/Select/OptionsList/OptionItem/RenderOption.js +79 -0
  126. package/es/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
  127. package/es/Select/OptionsList/OptionItem/RenderTooltip.js +25 -0
  128. package/es/Select/OptionsList/OptionItem.d.ts +4 -0
  129. package/es/Select/OptionsList/OptionItem.js +4 -0
  130. package/es/Select/OptionsList/Options.d.ts +7 -0
  131. package/es/Select/OptionsList/Options.js +6 -0
  132. package/es/Select/OptionsList/index.d.ts +4 -0
  133. package/es/Select/OptionsList/index.js +187 -0
  134. package/es/Select/Selector/index.d.ts +4 -0
  135. package/es/Select/Selector/index.js +252 -0
  136. package/es/Select/VirtualList.d.ts +5 -0
  137. package/es/Select/VirtualList.js +29 -0
  138. package/es/Select/demo/disabled/index.d.ts +2 -0
  139. package/es/Select/demo/disabled/index.js +50 -0
  140. package/es/Select/demo/multiple/index.d.ts +2 -0
  141. package/es/Select/demo/multiple/index.js +140 -0
  142. package/es/Select/demo/options/index.d.ts +2 -0
  143. package/es/Select/demo/options/index.js +55 -0
  144. package/es/Select/demo/single/index.d.ts +3 -0
  145. package/es/Select/demo/single/index.js +89 -0
  146. package/es/Select/demo/single/index.less +5 -0
  147. package/es/Select/hooks/useCacheOption.d.ts +9 -0
  148. package/es/Select/hooks/useCacheOption.js +107 -0
  149. package/es/Select/index.d.ts +12 -0
  150. package/es/Select/index.js +9 -0
  151. package/es/Select/interface.d.ts +227 -0
  152. package/es/Select/interface.js +1 -0
  153. package/es/Select/style/index.d.ts +2 -0
  154. package/es/Select/style/index.js +2 -0
  155. package/{src → es}/Select/style/index.less +3 -10
  156. package/es/Select/utils.d.ts +21 -0
  157. package/es/Select/utils.js +193 -0
  158. package/es/Table/demo/basic/createData.d.ts +9 -0
  159. package/es/Table/demo/basic/createData.js +18 -0
  160. package/es/Table/demo/basic/index.d.ts +2 -0
  161. package/es/Table/demo/basic/index.js +64 -0
  162. package/es/Table/demo/editCell/index.d.ts +2 -0
  163. package/es/Table/demo/editCell/index.js +39 -0
  164. package/es/Table/demo/renderHeaderRight/index.d.ts +2 -0
  165. package/es/Table/demo/renderHeaderRight/index.js +37 -0
  166. package/es/Table/demo/rowSelect/index.d.ts +2 -0
  167. package/es/Table/demo/rowSelect/index.js +40 -0
  168. package/es/Table/demo/virtualList/index.d.ts +2 -0
  169. package/es/Table/demo/virtualList/index.js +88 -0
  170. package/es/Table/index.d.ts +5 -0
  171. package/es/Table/index.js +201 -0
  172. package/es/Table/interface.d.ts +14 -0
  173. package/es/Table/interface.js +1 -0
  174. package/es/Table/style/index.d.ts +2 -0
  175. package/es/Table/style/index.js +2 -0
  176. package/es/Table/style/index.less +111 -0
  177. package/es/Tabs/TabPane.d.ts +21 -0
  178. package/es/Tabs/TabPane.js +12 -0
  179. package/es/Tabs/demo/adaptHeight/index.d.ts +3 -0
  180. package/es/Tabs/demo/adaptHeight/index.js +19 -0
  181. package/{src → es}/Tabs/demo/adaptHeight/index.less +0 -0
  182. package/es/Tabs/demo/basic/index.d.ts +4 -0
  183. package/es/Tabs/demo/basic/index.js +44 -0
  184. package/{src → es}/Tabs/demo/basic/index.less +0 -0
  185. package/es/Tabs/demo/horizontalScroll/index.d.ts +3 -0
  186. package/es/Tabs/demo/horizontalScroll/index.js +30 -0
  187. package/{src → es}/Tabs/demo/horizontalScroll/index.less +0 -0
  188. package/es/Tabs/index.d.ts +41 -0
  189. package/es/Tabs/index.js +42 -0
  190. package/es/Tabs/style/index.d.ts +2 -0
  191. package/es/Tabs/style/index.js +2 -0
  192. package/{src → es}/Tabs/style/index.less +0 -0
  193. package/es/Tooltip/demo/basic/index.d.ts +2 -0
  194. package/es/Tooltip/demo/basic/index.js +7 -0
  195. package/es/Tooltip/demo/overflow/index.d.ts +2 -0
  196. package/es/Tooltip/demo/overflow/index.js +7 -0
  197. package/es/Tooltip/demo/placement/index.d.ts +6 -0
  198. package/es/Tooltip/demo/placement/index.js +70 -0
  199. package/{src → es}/Tooltip/demo/placement/index.less +0 -0
  200. package/es/Tooltip/demo/trigger/index.d.ts +3 -0
  201. package/es/Tooltip/demo/trigger/index.js +20 -0
  202. package/{src → es}/Tooltip/demo/trigger/index.less +0 -0
  203. package/es/Tooltip/index.d.ts +64 -0
  204. package/es/Tooltip/index.js +33 -0
  205. package/es/Tooltip/style/index.d.ts +2 -0
  206. package/es/Tooltip/style/index.js +2 -0
  207. package/{src → es}/Tooltip/style/index.less +0 -0
  208. package/es/_utils/hooks/useControlledState.d.ts +2 -0
  209. package/es/_utils/hooks/useControlledState.js +54 -0
  210. package/es/_utils/hooks/usePrefixCls.d.ts +2 -0
  211. package/es/_utils/hooks/usePrefixCls.js +14 -0
  212. package/es/index.d.ts +10 -0
  213. package/{src/index.ts → es/index.js} +3 -1
  214. package/es/style/index.d.ts +2 -0
  215. package/{src/style/index.ts → es/style/index.js} +0 -0
  216. package/{src → es}/style/index.less +0 -0
  217. package/{src → es}/style/mixins/index.less +0 -0
  218. package/{src → es}/style/themes/default/index.less +1 -1
  219. package/{lib/style/themes/default/themeColor.less → es/style/themes/default/themeColor.module.less} +0 -0
  220. package/es/style/themes/default/themeColor.module.less.d.ts +108 -0
  221. package/lib/Button/demo/basic/index.less +0 -1
  222. package/lib/Button/index.js +2 -2
  223. package/lib/Button/style/index.less +5 -5
  224. package/lib/Dropdown/demo/button/index.js +1 -1
  225. package/lib/Empty/index.d.ts +8 -0
  226. package/lib/Empty/index.js +71 -0
  227. package/lib/Empty/style/index.d.ts +1 -0
  228. package/lib/Empty/style/index.js +3 -0
  229. package/lib/Empty/style/index.less +23 -0
  230. package/lib/Icon/iconfont/demo_index.html +49 -3
  231. package/lib/Icon/iconfont/iconfont.css +11 -3
  232. package/lib/Icon/iconfont/iconfont.js +1 -1
  233. package/lib/Icon/iconfont/iconfont.json +14 -0
  234. package/lib/Icon/iconfont/iconfont.ttf +0 -0
  235. package/lib/Icon/iconfont/iconfont.woff +0 -0
  236. package/lib/Icon/iconfont/iconfont.woff2 +0 -0
  237. package/lib/Icon/index.less +3 -3
  238. package/lib/Input/components/Group/index.d.ts +0 -1
  239. package/lib/Input/components/Password/index.d.ts +0 -1
  240. package/lib/Input/demo/basic/index.less +1 -1
  241. package/lib/Input/style/index.less +4 -1
  242. package/lib/Menu/Divider.d.ts +0 -1
  243. package/lib/Menu/style/index.less +4 -0
  244. package/lib/Navigator/components/Menu/index.d.ts +19 -0
  245. package/lib/Navigator/components/Menu/index.js +205 -0
  246. package/lib/Navigator/demo/basic/index.d.ts +4 -0
  247. package/lib/Navigator/demo/basic/index.js +62 -0
  248. package/lib/Navigator/demo/basic/index.less +3 -0
  249. package/lib/Navigator/demo/example/index.d.ts +4 -0
  250. package/lib/Navigator/demo/example/index.js +179 -0
  251. package/lib/Navigator/demo/example/index.less +10 -0
  252. package/lib/Navigator/demo/logo.png +0 -0
  253. package/lib/Navigator/demo/menuWithFooter/index.d.ts +4 -0
  254. package/lib/Navigator/demo/menuWithFooter/index.js +92 -0
  255. package/lib/Navigator/demo/menuWithFooter/index.less +3 -0
  256. package/lib/Navigator/demo/subMenu/index.d.ts +4 -0
  257. package/lib/Navigator/demo/subMenu/index.js +88 -0
  258. package/lib/Navigator/demo/subMenu/index.less +3 -0
  259. package/lib/Navigator/index.d.ts +41 -0
  260. package/lib/Navigator/index.js +64 -0
  261. package/lib/Navigator/style/index.d.ts +2 -0
  262. package/lib/Navigator/style/index.js +5 -0
  263. package/lib/Navigator/style/index.less +224 -0
  264. package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
  265. package/lib/Select/OptionsList/OptionItem/RenderGroup.js +27 -0
  266. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
  267. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +58 -0
  268. package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
  269. package/lib/Select/OptionsList/OptionItem/RenderOption.js +94 -0
  270. package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
  271. package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +37 -0
  272. package/lib/Select/OptionsList/OptionItem.d.ts +4 -35
  273. package/lib/Select/OptionsList/OptionItem.js +26 -172
  274. package/lib/Select/OptionsList/Options.d.ts +2 -2
  275. package/lib/Select/OptionsList/index.js +1 -1
  276. package/lib/Select/Selector/index.d.ts +2 -2
  277. package/lib/Select/Selector/index.js +13 -10
  278. package/lib/Select/demo/single/index.d.ts +1 -0
  279. package/lib/Select/demo/single/index.js +5 -1
  280. package/lib/Select/demo/single/index.less +5 -0
  281. package/lib/Select/interface.d.ts +8 -2
  282. package/lib/Select/style/index.less +3 -10
  283. package/lib/Table/demo/basic/createData.d.ts +9 -0
  284. package/lib/Table/demo/basic/createData.js +23 -0
  285. package/lib/Table/demo/basic/index.d.ts +2 -0
  286. package/lib/Table/demo/basic/index.js +80 -0
  287. package/lib/Table/demo/editCell/index.d.ts +2 -0
  288. package/lib/Table/demo/editCell/index.js +54 -0
  289. package/lib/Table/demo/renderHeaderRight/index.d.ts +2 -0
  290. package/lib/Table/demo/renderHeaderRight/index.js +52 -0
  291. package/lib/Table/demo/rowSelect/index.d.ts +2 -0
  292. package/lib/Table/demo/rowSelect/index.js +55 -0
  293. package/lib/Table/demo/virtualList/index.d.ts +2 -0
  294. package/lib/Table/demo/virtualList/index.js +103 -0
  295. package/lib/Table/index.d.ts +5 -0
  296. package/lib/Table/index.js +225 -0
  297. package/lib/Table/interface.d.ts +14 -0
  298. package/lib/Table/interface.js +5 -0
  299. package/lib/Table/style/index.d.ts +2 -0
  300. package/lib/Table/style/index.js +5 -0
  301. package/lib/Table/style/index.less +111 -0
  302. package/lib/Tooltip/index.d.ts +1 -0
  303. package/lib/Tooltip/index.js +3 -1
  304. package/lib/index.d.ts +2 -0
  305. package/lib/index.js +16 -0
  306. package/lib/style/themes/default/index.less +1 -1
  307. package/{src/style/themes/default/themeColor.less → lib/style/themes/default/themeColor.module.less} +0 -0
  308. package/lib/style/themes/default/themeColor.module.less.d.ts +108 -0
  309. package/package.json +24 -8
  310. package/.editorconfig +0 -16
  311. package/.eslintrc.js +0 -43
  312. package/.fatherrc.ts +0 -16
  313. package/.prettierignore +0 -7
  314. package/.prettierrc.js +0 -1
  315. package/.stylelintrc.json +0 -36
  316. package/.umirc.ts +0 -15
  317. package/commitlint.config.js +0 -21
  318. package/docs/index.md +0 -21
  319. package/jest/setupTests.js +0 -1
  320. package/public/favicon.ico +0 -0
  321. package/src/Button/demo/Icon/index.tsx +0 -41
  322. package/src/Button/demo/basic/index.tsx +0 -26
  323. package/src/Button/demo/disable/index.tsx +0 -16
  324. package/src/Button/demo/href/index.tsx +0 -14
  325. package/src/Button/demo/loading/index.tsx +0 -21
  326. package/src/Button/index.md +0 -25
  327. package/src/Button/index.test.tsx +0 -58
  328. package/src/Button/index.tsx +0 -136
  329. package/src/Button/style/index.ts +0 -2
  330. package/src/Dropdown/Button.tsx +0 -93
  331. package/src/Dropdown/demo/basic/index.tsx +0 -20
  332. package/src/Dropdown/demo/button/index.tsx +0 -98
  333. package/src/Dropdown/demo/placement/index.tsx +0 -47
  334. package/src/Dropdown/demo/subMenu/index.tsx +0 -35
  335. package/src/Dropdown/demo/trigger/index.tsx +0 -19
  336. package/src/Dropdown/index.md +0 -35
  337. package/src/Dropdown/index.test.tsx +0 -185
  338. package/src/Dropdown/index.tsx +0 -71
  339. package/src/Dropdown/style/index.ts +0 -2
  340. package/src/Icon/iconfont/iconfont.css +0 -93
  341. package/src/Icon/iconfont/iconfont.js +0 -1
  342. package/src/Icon/iconfont/iconfont.ttf +0 -0
  343. package/src/Icon/iconfont/iconfont.woff +0 -0
  344. package/src/Icon/iconfont/iconfont.woff2 +0 -0
  345. package/src/Icon/index.tsx +0 -38
  346. package/src/Input/components/Group/index.tsx +0 -21
  347. package/src/Input/components/Password/index.tsx +0 -23
  348. package/src/Input/components/TextArea/index.tsx +0 -57
  349. package/src/Input/demo/allowClear/index.tsx +0 -10
  350. package/src/Input/demo/basic/index.tsx +0 -25
  351. package/src/Input/demo/gourp/index.tsx +0 -30
  352. package/src/Input/demo/password/index.tsx +0 -11
  353. package/src/Input/demo/prefix/index.tsx +0 -13
  354. package/src/Input/demo/showCount/index.tsx +0 -16
  355. package/src/Input/demo/textArea/autoSize.tsx +0 -21
  356. package/src/Input/index.md +0 -37
  357. package/src/Input/index.test.tsx +0 -78
  358. package/src/Input/index.tsx +0 -91
  359. package/src/Input/style/index.ts +0 -2
  360. package/src/Menu/Divider.tsx +0 -12
  361. package/src/Menu/MenuItem.tsx +0 -24
  362. package/src/Menu/SubMenu.tsx +0 -37
  363. package/src/Menu/index.md +0 -36
  364. package/src/Menu/index.test.tsx +0 -144
  365. package/src/Menu/index.tsx +0 -27
  366. package/src/Menu/style/index.ts +0 -2
  367. package/src/Select/BaseSelect.tsx +0 -321
  368. package/src/Select/OptionsList/OptionItem.tsx +0 -151
  369. package/src/Select/OptionsList/Options.tsx +0 -11
  370. package/src/Select/OptionsList/index.tsx +0 -169
  371. package/src/Select/Selector/index.tsx +0 -211
  372. package/src/Select/VirtualList.tsx +0 -36
  373. package/src/Select/demo/disabled/index.tsx +0 -44
  374. package/src/Select/demo/multiple/index.tsx +0 -77
  375. package/src/Select/demo/options/index.tsx +0 -63
  376. package/src/Select/demo/single/index.tsx +0 -50
  377. package/src/Select/hooks/useCacheOption.ts +0 -67
  378. package/src/Select/index.md +0 -72
  379. package/src/Select/index.tsx +0 -23
  380. package/src/Select/interface.ts +0 -231
  381. package/src/Select/style/index.ts +0 -2
  382. package/src/Select/utils.tsx +0 -133
  383. package/src/Tabs/TabPane.tsx +0 -28
  384. package/src/Tabs/demo/adaptHeight/index.tsx +0 -33
  385. package/src/Tabs/demo/basic/index.tsx +0 -30
  386. package/src/Tabs/demo/horizontalScroll/index.tsx +0 -36
  387. package/src/Tabs/index.md +0 -30
  388. package/src/Tabs/index.test.tsx +0 -100
  389. package/src/Tabs/index.tsx +0 -64
  390. package/src/Tabs/style/index.ts +0 -2
  391. package/src/Tooltip/demo/basic/index.tsx +0 -10
  392. package/src/Tooltip/demo/overflow/index.tsx +0 -10
  393. package/src/Tooltip/demo/placement/index.tsx +0 -60
  394. package/src/Tooltip/demo/trigger/index.tsx +0 -22
  395. package/src/Tooltip/index.md +0 -28
  396. package/src/Tooltip/index.test.tsx +0 -152
  397. package/src/Tooltip/index.tsx +0 -113
  398. package/src/Tooltip/style/index.ts +0 -2
  399. package/src/_utils/hooks/useControlledState.ts +0 -39
  400. package/src/_utils/hooks/usePrefixCls.ts +0 -11
  401. package/tsconfig.json +0 -13
  402. package/typings.d.ts +0 -3
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ListRef, ListProps } from 'rc-virtual-list';
3
+ import { IOption } from './interface';
4
+ declare const RefVirtualList: React.ForwardRefExoticComponent<ListProps<IOption> & React.RefAttributes<ListRef>>;
5
+ export default RefVirtualList;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import List from 'rc-virtual-list';
3
+ var defaultListRowHeight = 44;
4
+ var defaultListHeight = 520;
5
+
6
+ var VirtualList = function VirtualList(props, ref) {
7
+ var _props$itemHeight = props.itemHeight,
8
+ itemHeight = _props$itemHeight === void 0 ? defaultListRowHeight : _props$itemHeight,
9
+ _props$height = props.height,
10
+ height = _props$height === void 0 ? defaultListHeight : _props$height,
11
+ prefixCls = props.prefixCls,
12
+ children = props.children,
13
+ data = props.data,
14
+ virtual = props.virtual,
15
+ itemKey = props.itemKey;
16
+ return /*#__PURE__*/React.createElement(List, {
17
+ itemKey: itemKey,
18
+ ref: ref,
19
+ itemHeight: itemHeight,
20
+ height: height,
21
+ data: data,
22
+ virtual: virtual,
23
+ prefixCls: "".concat(prefixCls, "-virtual-list"),
24
+ fullHeight: false
25
+ }, children);
26
+ };
27
+
28
+ var RefVirtualList = /*#__PURE__*/React.forwardRef(VirtualList);
29
+ export default RefVirtualList;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import React from "react"; // import { Select } from '@aloudata/aloudata-design';
2
+
3
+ import Select from '../../index';
4
+ var Option = Select.Option;
5
+ export default (function () {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: 'ald-select-demo'
8
+ }, /*#__PURE__*/React.createElement(Select, {
9
+ className: 'ald-select',
10
+ style: {
11
+ width: 200
12
+ },
13
+ size: 'large',
14
+ multiple: true,
15
+ disabled: true,
16
+ placeholder: "large"
17
+ }, /*#__PURE__*/React.createElement(Option, {
18
+ key: 'a',
19
+ value: "Example Text"
20
+ }, "Example Text")), /*#__PURE__*/React.createElement(Select, {
21
+ className: 'ald-select',
22
+ style: {
23
+ width: 200
24
+ },
25
+ multiple: true,
26
+ label: 'Label:',
27
+ disabled: true,
28
+ placeholder: "placeholder"
29
+ }, /*#__PURE__*/React.createElement(Option, {
30
+ key: 'a',
31
+ value: "Example Text"
32
+ }, "Example Text")), /*#__PURE__*/React.createElement(Select, {
33
+ className: 'ald-select',
34
+ style: {
35
+ width: 200
36
+ },
37
+ multiple: true,
38
+ size: "small",
39
+ label: 'Label:',
40
+ defaultValue: ['a', 'b'],
41
+ disabled: true,
42
+ placeholder: "normal"
43
+ }, /*#__PURE__*/React.createElement(Option, {
44
+ key: 'a',
45
+ value: "a"
46
+ }, "Example Text"), /*#__PURE__*/React.createElement(Option, {
47
+ key: 'b',
48
+ value: "b"
49
+ }, "Example Text")));
50
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,140 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ 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; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React from "react"; // import { Select } from '@aloudata/aloudata-design';
14
+
15
+ import Select from '../../index';
16
+ import Icon from '../../../Icon';
17
+ var Option = Select.Option;
18
+ export default (function () {
19
+ var _React$useState = React.useState(''),
20
+ _React$useState2 = _slicedToArray(_React$useState, 2),
21
+ value = _React$useState2[0],
22
+ setValue = _React$useState2[1];
23
+
24
+ var _onChange = function onChange(value) {
25
+ console.log(value);
26
+ setValue(value);
27
+ };
28
+
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: 'ald-select-demo'
31
+ }, /*#__PURE__*/React.createElement(Select, {
32
+ className: 'ald-select',
33
+ style: {
34
+ width: 200
35
+ },
36
+ size: 'large',
37
+ multiple: true,
38
+ placeholder: "large size"
39
+ }, /*#__PURE__*/React.createElement(Option, {
40
+ key: 'a',
41
+ value: "Example Text"
42
+ }, "Example TexExample TextExample TextExample TextExample TextExample Textt"), /*#__PURE__*/React.createElement(Option, {
43
+ key: 'b',
44
+ value: "b"
45
+ }, "b"), /*#__PURE__*/React.createElement(Option, {
46
+ key: 'c',
47
+ value: "c"
48
+ }, "c"), /*#__PURE__*/React.createElement(Option, {
49
+ key: 'd',
50
+ value: "d"
51
+ }, "d"), /*#__PURE__*/React.createElement(Option, {
52
+ key: 'e',
53
+ value: "e"
54
+ }, "e"), /*#__PURE__*/React.createElement(Option, {
55
+ key: "f",
56
+ value: "f"
57
+ }, "f"), /*#__PURE__*/React.createElement(Option, {
58
+ key: "g",
59
+ value: "g"
60
+ }, "g")), /*#__PURE__*/React.createElement(Select, {
61
+ className: 'ald-select',
62
+ style: {
63
+ width: 200
64
+ },
65
+ size: 'default',
66
+ label: 'Label:',
67
+ multiple: true,
68
+ listHeight: 100,
69
+ placeholder: "default"
70
+ }, /*#__PURE__*/React.createElement(Option, {
71
+ key: 'a',
72
+ value: "Example Text"
73
+ }, "Example Text"), /*#__PURE__*/React.createElement(Option, {
74
+ key: 'b',
75
+ value: "b"
76
+ }, "b"), /*#__PURE__*/React.createElement(Option, {
77
+ key: 'c',
78
+ value: "c"
79
+ }, "c"), /*#__PURE__*/React.createElement(Option, {
80
+ key: 'd',
81
+ value: "d"
82
+ }, "d"), /*#__PURE__*/React.createElement(Option, {
83
+ key: 'e',
84
+ value: "e"
85
+ }, "e"), /*#__PURE__*/React.createElement(Option, {
86
+ key: "f",
87
+ value: "f"
88
+ }, "f"), /*#__PURE__*/React.createElement(Option, {
89
+ key: "g",
90
+ value: "g"
91
+ }, "g")), /*#__PURE__*/React.createElement(Select, {
92
+ className: 'ald-select',
93
+ style: {
94
+ width: 200
95
+ },
96
+ size: 'small',
97
+ multiple: true,
98
+ value: value,
99
+ // @ts-ignore
100
+ onChange: function onChange(v) {
101
+ _onChange(v);
102
+ },
103
+ placeholder: "small"
104
+ }, /*#__PURE__*/React.createElement(Option, {
105
+ key: 'a',
106
+ value: "Example Text"
107
+ }, "Example Text")), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Select, {
108
+ className: 'ald-select',
109
+ style: {
110
+ width: 200
111
+ },
112
+ size: 'large',
113
+ multiple: true,
114
+ label: /*#__PURE__*/React.createElement(Icon, {
115
+ type: 'view_Partial_line'
116
+ }),
117
+ placeholder: "large size"
118
+ }, /*#__PURE__*/React.createElement(Option, {
119
+ key: 'a',
120
+ value: "Example Text"
121
+ }, "Example TexExample TextExample TextExample TextExample TextExample Textt"), /*#__PURE__*/React.createElement(Option, {
122
+ key: 'b',
123
+ value: "b"
124
+ }, "b"), /*#__PURE__*/React.createElement(Option, {
125
+ key: 'c',
126
+ value: "c"
127
+ }, "c"), /*#__PURE__*/React.createElement(Option, {
128
+ key: 'd',
129
+ value: "d"
130
+ }, "d"), /*#__PURE__*/React.createElement(Option, {
131
+ key: 'e',
132
+ value: "e"
133
+ }, "e"), /*#__PURE__*/React.createElement(Option, {
134
+ key: "f",
135
+ value: "f"
136
+ }, "f"), /*#__PURE__*/React.createElement(Option, {
137
+ key: "g",
138
+ value: "g"
139
+ }, "g")));
140
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,55 @@
1
+ import React from "react"; // import { Select } from '@aloudata/aloudata-design';
2
+
3
+ import Select from '../../index';
4
+ var Option = Select.Option;
5
+ export default (function () {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: 'ald-select-demo'
8
+ }, /*#__PURE__*/React.createElement(Select, {
9
+ className: 'ald-select',
10
+ style: {
11
+ width: 200
12
+ },
13
+ size: 'large',
14
+ multiple: true,
15
+ placeholder: "large",
16
+ options: [{
17
+ label: 'Option 1',
18
+ value: 'Option 1'
19
+ }, {
20
+ label: 'Option 2',
21
+ value: 'Option 2'
22
+ }]
23
+ }), /*#__PURE__*/React.createElement(Select, {
24
+ className: 'ald-select',
25
+ style: {
26
+ width: 200
27
+ },
28
+ multiple: true,
29
+ label: 'Label:',
30
+ placeholder: "placeholder",
31
+ options: [{
32
+ label: 'Option 1',
33
+ value: 'Option 1'
34
+ }, {
35
+ label: 'Option 2',
36
+ value: 'Option 2'
37
+ }]
38
+ }), /*#__PURE__*/React.createElement(Select, {
39
+ className: 'ald-select',
40
+ style: {
41
+ width: 200
42
+ },
43
+ multiple: true,
44
+ size: "small",
45
+ label: 'Label:',
46
+ placeholder: "normal",
47
+ options: [{
48
+ label: 'Option 1',
49
+ value: 'Option 1'
50
+ }, {
51
+ label: 'Option 2',
52
+ value: 'Option 2'
53
+ }]
54
+ }));
55
+ });
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,89 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ 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; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React from "react"; // import { Select } from '@aloudata/aloudata-design';
14
+
15
+ import Select from '../../index';
16
+ import './index.less';
17
+ var Option = Select.Option;
18
+ export default (function () {
19
+ var _React$useState = React.useState(''),
20
+ _React$useState2 = _slicedToArray(_React$useState, 2),
21
+ value = _React$useState2[0],
22
+ setValue = _React$useState2[1];
23
+
24
+ var _onChange = function onChange(value) {
25
+ console.log(value);
26
+ setValue(value);
27
+ };
28
+
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: 'ald-select-demo'
31
+ }, /*#__PURE__*/React.createElement(Select, {
32
+ className: 'ald-select',
33
+ style: {
34
+ width: 200
35
+ },
36
+ size: 'large',
37
+ allowClear: true,
38
+ placeholder: "large size"
39
+ }, /*#__PURE__*/React.createElement(Option, {
40
+ key: 'a',
41
+ value: "Example Text"
42
+ }, "Example Text"), /*#__PURE__*/React.createElement(Option, {
43
+ key: 'b',
44
+ value: "b"
45
+ }, "Menu item"), /*#__PURE__*/React.createElement(Option, {
46
+ key: 'c',
47
+ value: "c"
48
+ }, "c"), /*#__PURE__*/React.createElement(Option, {
49
+ key: 'd',
50
+ value: "d"
51
+ }, "d"), /*#__PURE__*/React.createElement(Option, {
52
+ key: 'e',
53
+ value: "e"
54
+ }, "e"), /*#__PURE__*/React.createElement(Option, {
55
+ key: "f",
56
+ value: "f"
57
+ }, "f"), /*#__PURE__*/React.createElement(Option, {
58
+ key: "g",
59
+ title: "gg",
60
+ value: "g",
61
+ tooltip: "a"
62
+ }, "g")), /*#__PURE__*/React.createElement(Select, {
63
+ className: 'ald-select',
64
+ style: {
65
+ width: 200
66
+ },
67
+ size: 'default',
68
+ placeholder: "default"
69
+ }, /*#__PURE__*/React.createElement(Option, {
70
+ key: 'a',
71
+ value: "Example Text"
72
+ }, "Example Text")), /*#__PURE__*/React.createElement(Select, {
73
+ className: 'ald-select',
74
+ style: {
75
+ width: 200
76
+ },
77
+ size: 'small',
78
+ label: 'Label:',
79
+ placeholder: "small",
80
+ value: value,
81
+ // @ts-ignore
82
+ onChange: function onChange(v) {
83
+ _onChange(v);
84
+ }
85
+ }, /*#__PURE__*/React.createElement(Option, {
86
+ key: 'a',
87
+ value: "Example Text"
88
+ }, "Example Text")));
89
+ });
@@ -0,0 +1,5 @@
1
+ .ald-select-demo {
2
+ .ald-select {
3
+ margin: 0 24px 16px 0;
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ import { TMaybeArray, IOption } from '../interface';
2
+ export default function useCacheOptions(): {
3
+ setCacheOptions: (options: IOption[]) => void;
4
+ getOptionByValue: (optValue: string | number) => IOption;
5
+ getOptionsByValue: (optValue: TMaybeArray<string | number>) => TMaybeArray<IOption>;
6
+ updateGroup: (value: boolean) => void;
7
+ cacheOptionsMap: Map<any, any>;
8
+ hasGroup: boolean;
9
+ };
@@ -0,0 +1,107 @@
1
+ var _excluded = ["options"];
2
+
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
5
+ 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."); }
6
+
7
+ 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); }
8
+
9
+ 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; }
10
+
11
+ 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; }
12
+
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
15
+ 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; }
16
+
17
+ 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; }
18
+
19
+ 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; }
20
+
21
+ 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; }
22
+
23
+ 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; }
24
+
25
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
26
+ import { useCallback, useRef, useState } from 'react';
27
+
28
+ var optionSet = function optionSet(map, key, value) {
29
+ map.set(key, value);
30
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+
32
+
33
+ var groupOptionSet = function groupOptionSet(map, key, option) {
34
+ if (map.get(key)) {
35
+ var _map$get = map.get(key),
36
+ _map$get$options = _map$get.options,
37
+ groupOptions = _map$get$options === void 0 ? new Map() : _map$get$options,
38
+ rest = _objectWithoutProperties(_map$get, _excluded);
39
+
40
+ map.set(key, _objectSpread({
41
+ options: groupOptions.set(option.value, option)
42
+ }, rest));
43
+ } else {
44
+ map.set(key, {
45
+ label: option.groupLabel,
46
+ value: option.groupValue,
47
+ isSelectOptGroup: true,
48
+ options: new Map([[option.value, option]])
49
+ });
50
+ }
51
+
52
+ map.set(option.value, option);
53
+ };
54
+
55
+ export default function useCacheOptions() {
56
+ var cacheOptions = useRef(new Map());
57
+ var cacheOptionsMap = cacheOptions.current;
58
+
59
+ var _useState = useState(false),
60
+ _useState2 = _slicedToArray(_useState, 2),
61
+ isGroup = _useState2[0],
62
+ setIsGroup = _useState2[1];
63
+
64
+ var setCacheOptions = function setCacheOptions(options) {
65
+ if (!isGroup) {
66
+ options.forEach(function (option) {
67
+ return optionSet(cacheOptionsMap, option.value, option);
68
+ });
69
+ } else {
70
+ options.forEach(function (option) {
71
+ return groupOptionSet(cacheOptionsMap, option.groupValue, option);
72
+ });
73
+ }
74
+ };
75
+
76
+ var updateGroup = function updateGroup(value) {
77
+ if (value !== isGroup) {
78
+ setIsGroup(value);
79
+ }
80
+ }; // value to option || options
81
+
82
+
83
+ var getOptionByValue = useCallback(function (optValue) {
84
+ return cacheOptionsMap.get(optValue);
85
+ }, [cacheOptionsMap]);
86
+
87
+ var getOptionsByValue = function getOptionsByValue(optValue) {
88
+ return Array.isArray(optValue) ? optValue.reduce(function (prev, v) {
89
+ var op = getOptionByValue(v);
90
+
91
+ if (op) {
92
+ prev.push(op);
93
+ }
94
+
95
+ return prev;
96
+ }, []) : getOptionByValue(optValue);
97
+ };
98
+
99
+ return {
100
+ setCacheOptions: setCacheOptions,
101
+ getOptionByValue: getOptionByValue,
102
+ getOptionsByValue: getOptionsByValue,
103
+ updateGroup: updateGroup,
104
+ cacheOptionsMap: cacheOptionsMap,
105
+ hasGroup: isGroup
106
+ };
107
+ }
@@ -0,0 +1,12 @@
1
+ import BaseSelect from './BaseSelect';
2
+ import { IOption as Option, ISelectProps as SelectProps, IOptGroupProps as OptGroupProps, IOptionProps as OptionProps } from './interface';
3
+ import Options from './OptionsList/Options';
4
+ import OptGroup from './OptionsList/OptGroup';
5
+ import './style';
6
+ export declare type TSelect = typeof BaseSelect & {
7
+ Group: typeof OptGroup;
8
+ Option: typeof Options;
9
+ };
10
+ declare const Select: TSelect;
11
+ export { Options as Option, OptGroup as Group, SelectProps, OptionProps, Option as SelectOptions, OptGroupProps as GroupProps, };
12
+ export default Select;
@@ -0,0 +1,9 @@
1
+ import BaseSelect from './BaseSelect';
2
+ import Options from './OptionsList/Options';
3
+ import OptGroup from './OptionsList/OptGroup';
4
+ import './style';
5
+ var Select = BaseSelect;
6
+ Select.Option = Options;
7
+ Select.Group = OptGroup;
8
+ export { Options as Option, OptGroup as Group };
9
+ export default Select;