@aloudata/aloudata-design 0.1.0-beta1 → 0.2.0-beta.3

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 (414) 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 +95 -3
  46. package/es/Icon/iconfont/iconfont.css +109 -0
  47. package/es/Icon/iconfont/iconfont.js +46 -0
  48. package/{src → es}/Icon/iconfont/iconfont.json +28 -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 +10 -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/es/Input/demo/basic/index.less +14 -0
  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 +228 -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 +10 -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/resizeColumn/index.d.ts +2 -0
  167. package/es/Table/demo/resizeColumn/index.js +32 -0
  168. package/es/Table/demo/rowSelect/index.d.ts +2 -0
  169. package/es/Table/demo/rowSelect/index.js +35 -0
  170. package/es/Table/demo/sort/index.d.ts +2 -0
  171. package/es/Table/demo/sort/index.js +43 -0
  172. package/es/Table/demo/virtualList/index.d.ts +2 -0
  173. package/es/Table/demo/virtualList/index.js +88 -0
  174. package/es/Table/index.d.ts +5 -0
  175. package/es/Table/index.js +336 -0
  176. package/es/Table/interface.d.ts +34 -0
  177. package/es/Table/interface.js +1 -0
  178. package/es/Table/react-table-config.d.ts +122 -0
  179. package/es/Table/style/index.d.ts +2 -0
  180. package/es/Table/style/index.js +2 -0
  181. package/es/Table/style/index.less +141 -0
  182. package/es/Tabs/TabPane.d.ts +21 -0
  183. package/es/Tabs/TabPane.js +12 -0
  184. package/es/Tabs/demo/adaptHeight/index.d.ts +3 -0
  185. package/es/Tabs/demo/adaptHeight/index.js +19 -0
  186. package/{src → es}/Tabs/demo/adaptHeight/index.less +0 -0
  187. package/es/Tabs/demo/basic/index.d.ts +4 -0
  188. package/es/Tabs/demo/basic/index.js +44 -0
  189. package/{src → es}/Tabs/demo/basic/index.less +0 -0
  190. package/es/Tabs/demo/horizontalScroll/index.d.ts +3 -0
  191. package/es/Tabs/demo/horizontalScroll/index.js +30 -0
  192. package/{src → es}/Tabs/demo/horizontalScroll/index.less +0 -0
  193. package/es/Tabs/index.d.ts +41 -0
  194. package/es/Tabs/index.js +42 -0
  195. package/es/Tabs/style/index.d.ts +2 -0
  196. package/es/Tabs/style/index.js +2 -0
  197. package/{src → es}/Tabs/style/index.less +0 -0
  198. package/es/Tooltip/demo/basic/index.d.ts +2 -0
  199. package/es/Tooltip/demo/basic/index.js +7 -0
  200. package/es/Tooltip/demo/overflow/index.d.ts +2 -0
  201. package/es/Tooltip/demo/overflow/index.js +7 -0
  202. package/es/Tooltip/demo/placement/index.d.ts +6 -0
  203. package/es/Tooltip/demo/placement/index.js +70 -0
  204. package/{src → es}/Tooltip/demo/placement/index.less +0 -0
  205. package/es/Tooltip/demo/trigger/index.d.ts +3 -0
  206. package/es/Tooltip/demo/trigger/index.js +20 -0
  207. package/{src → es}/Tooltip/demo/trigger/index.less +0 -0
  208. package/es/Tooltip/index.d.ts +64 -0
  209. package/es/Tooltip/index.js +33 -0
  210. package/es/Tooltip/style/index.d.ts +2 -0
  211. package/es/Tooltip/style/index.js +2 -0
  212. package/{src → es}/Tooltip/style/index.less +0 -0
  213. package/es/_utils/hooks/useControlledState.d.ts +2 -0
  214. package/es/_utils/hooks/useControlledState.js +54 -0
  215. package/es/_utils/hooks/usePrefixCls.d.ts +2 -0
  216. package/es/_utils/hooks/usePrefixCls.js +14 -0
  217. package/es/index.d.ts +11 -0
  218. package/{src/index.ts → es/index.js} +3 -1
  219. package/es/style/index.d.ts +2 -0
  220. package/{src/style/index.ts → es/style/index.js} +0 -0
  221. package/{src → es}/style/index.less +0 -0
  222. package/{src → es}/style/mixins/index.less +0 -0
  223. package/{src → es}/style/themes/default/index.less +1 -1
  224. package/{lib/style/themes/default/themeColor.less → es/style/themes/default/themeColor.module.less} +0 -0
  225. package/es/style/themes/default/themeColor.module.less.d.ts +108 -0
  226. package/lib/Button/demo/basic/index.less +0 -1
  227. package/lib/Button/index.js +2 -2
  228. package/lib/Button/style/index.less +5 -5
  229. package/lib/Dropdown/demo/button/index.js +1 -1
  230. package/lib/Empty/index.d.ts +8 -0
  231. package/lib/Empty/index.js +71 -0
  232. package/lib/Empty/style/index.d.ts +1 -0
  233. package/lib/Empty/style/index.js +3 -0
  234. package/lib/Empty/style/index.less +23 -0
  235. package/lib/Icon/iconfont/demo_index.html +95 -3
  236. package/lib/Icon/iconfont/iconfont.css +19 -3
  237. package/lib/Icon/iconfont/iconfont.js +5 -5
  238. package/lib/Icon/iconfont/iconfont.json +28 -0
  239. package/lib/Icon/iconfont/iconfont.ttf +0 -0
  240. package/lib/Icon/iconfont/iconfont.woff +0 -0
  241. package/lib/Icon/iconfont/iconfont.woff2 +0 -0
  242. package/lib/Icon/index.less +3 -3
  243. package/lib/Input/components/Group/index.d.ts +0 -1
  244. package/lib/Input/components/Password/index.d.ts +3 -3
  245. package/lib/Input/components/Password/index.js +2 -2
  246. package/lib/Input/demo/basic/index.less +9 -1
  247. package/lib/Input/style/index.less +4 -1
  248. package/lib/Menu/Divider.d.ts +0 -1
  249. package/lib/Menu/style/index.less +4 -0
  250. package/lib/Navigator/components/Menu/index.d.ts +19 -0
  251. package/lib/Navigator/components/Menu/index.js +205 -0
  252. package/lib/Navigator/demo/basic/index.d.ts +4 -0
  253. package/lib/Navigator/demo/basic/index.js +62 -0
  254. package/lib/Navigator/demo/basic/index.less +3 -0
  255. package/lib/Navigator/demo/example/index.d.ts +4 -0
  256. package/lib/Navigator/demo/example/index.js +179 -0
  257. package/lib/Navigator/demo/example/index.less +10 -0
  258. package/lib/Navigator/demo/logo.png +0 -0
  259. package/lib/Navigator/demo/menuWithFooter/index.d.ts +4 -0
  260. package/lib/Navigator/demo/menuWithFooter/index.js +92 -0
  261. package/lib/Navigator/demo/menuWithFooter/index.less +3 -0
  262. package/lib/Navigator/demo/subMenu/index.d.ts +4 -0
  263. package/lib/Navigator/demo/subMenu/index.js +88 -0
  264. package/lib/Navigator/demo/subMenu/index.less +3 -0
  265. package/lib/Navigator/index.d.ts +41 -0
  266. package/lib/Navigator/index.js +64 -0
  267. package/lib/Navigator/style/index.d.ts +2 -0
  268. package/lib/Navigator/style/index.js +5 -0
  269. package/lib/Navigator/style/index.less +228 -0
  270. package/lib/Select/OptionsList/OptionItem/RenderGroup.d.ts +9 -0
  271. package/lib/Select/OptionsList/OptionItem/RenderGroup.js +27 -0
  272. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.d.ts +8 -0
  273. package/lib/Select/OptionsList/OptionItem/RenderLabelIcon.js +58 -0
  274. package/lib/Select/OptionsList/OptionItem/RenderOption.d.ts +16 -0
  275. package/lib/Select/OptionsList/OptionItem/RenderOption.js +94 -0
  276. package/lib/Select/OptionsList/OptionItem/RenderTooltip.d.ts +8 -0
  277. package/lib/Select/OptionsList/OptionItem/RenderTooltip.js +37 -0
  278. package/lib/Select/OptionsList/OptionItem.d.ts +4 -35
  279. package/lib/Select/OptionsList/OptionItem.js +26 -172
  280. package/lib/Select/OptionsList/Options.d.ts +2 -2
  281. package/lib/Select/OptionsList/index.js +1 -1
  282. package/lib/Select/Selector/index.d.ts +2 -2
  283. package/lib/Select/Selector/index.js +13 -10
  284. package/lib/Select/demo/single/index.d.ts +1 -0
  285. package/lib/Select/demo/single/index.js +5 -1
  286. package/lib/Select/demo/single/index.less +5 -0
  287. package/lib/Select/interface.d.ts +8 -2
  288. package/lib/Select/style/index.less +3 -10
  289. package/lib/Table/demo/basic/createData.d.ts +10 -0
  290. package/lib/Table/demo/basic/createData.js +23 -0
  291. package/lib/Table/demo/basic/index.d.ts +2 -0
  292. package/lib/Table/demo/basic/index.js +80 -0
  293. package/lib/Table/demo/editCell/index.d.ts +2 -0
  294. package/lib/Table/demo/editCell/index.js +54 -0
  295. package/lib/Table/demo/renderHeaderRight/index.d.ts +2 -0
  296. package/lib/Table/demo/renderHeaderRight/index.js +52 -0
  297. package/lib/Table/demo/resizeColumn/index.d.ts +2 -0
  298. package/lib/Table/demo/resizeColumn/index.js +47 -0
  299. package/lib/Table/demo/rowSelect/index.d.ts +2 -0
  300. package/lib/Table/demo/rowSelect/index.js +50 -0
  301. package/lib/Table/demo/sort/index.d.ts +2 -0
  302. package/lib/Table/demo/sort/index.js +58 -0
  303. package/lib/Table/demo/virtualList/index.d.ts +2 -0
  304. package/lib/Table/demo/virtualList/index.js +103 -0
  305. package/lib/Table/index.d.ts +5 -0
  306. package/lib/Table/index.js +362 -0
  307. package/lib/Table/interface.d.ts +34 -0
  308. package/lib/Table/interface.js +5 -0
  309. package/lib/Table/react-table-config.d.ts +122 -0
  310. package/lib/Table/style/index.d.ts +2 -0
  311. package/lib/Table/style/index.js +5 -0
  312. package/lib/Table/style/index.less +141 -0
  313. package/lib/Tooltip/index.d.ts +1 -0
  314. package/lib/Tooltip/index.js +3 -1
  315. package/lib/index.d.ts +3 -0
  316. package/lib/index.js +16 -0
  317. package/lib/style/themes/default/index.less +1 -1
  318. package/{src/style/themes/default/themeColor.less → lib/style/themes/default/themeColor.module.less} +0 -0
  319. package/lib/style/themes/default/themeColor.module.less.d.ts +108 -0
  320. package/package.json +24 -8
  321. package/.editorconfig +0 -16
  322. package/.eslintrc.js +0 -43
  323. package/.fatherrc.ts +0 -16
  324. package/.prettierignore +0 -7
  325. package/.prettierrc.js +0 -1
  326. package/.stylelintrc.json +0 -36
  327. package/.umirc.ts +0 -15
  328. package/commitlint.config.js +0 -21
  329. package/docs/index.md +0 -21
  330. package/jest/setupTests.js +0 -1
  331. package/public/favicon.ico +0 -0
  332. package/src/Button/demo/Icon/index.tsx +0 -41
  333. package/src/Button/demo/basic/index.tsx +0 -26
  334. package/src/Button/demo/disable/index.tsx +0 -16
  335. package/src/Button/demo/href/index.tsx +0 -14
  336. package/src/Button/demo/loading/index.tsx +0 -21
  337. package/src/Button/index.md +0 -25
  338. package/src/Button/index.test.tsx +0 -58
  339. package/src/Button/index.tsx +0 -136
  340. package/src/Button/style/index.ts +0 -2
  341. package/src/Dropdown/Button.tsx +0 -93
  342. package/src/Dropdown/demo/basic/index.tsx +0 -20
  343. package/src/Dropdown/demo/button/index.tsx +0 -98
  344. package/src/Dropdown/demo/placement/index.tsx +0 -47
  345. package/src/Dropdown/demo/subMenu/index.tsx +0 -35
  346. package/src/Dropdown/demo/trigger/index.tsx +0 -19
  347. package/src/Dropdown/index.md +0 -35
  348. package/src/Dropdown/index.test.tsx +0 -185
  349. package/src/Dropdown/index.tsx +0 -71
  350. package/src/Dropdown/style/index.ts +0 -2
  351. package/src/Icon/iconfont/iconfont.css +0 -93
  352. package/src/Icon/iconfont/iconfont.js +0 -1
  353. package/src/Icon/iconfont/iconfont.ttf +0 -0
  354. package/src/Icon/iconfont/iconfont.woff +0 -0
  355. package/src/Icon/iconfont/iconfont.woff2 +0 -0
  356. package/src/Icon/index.tsx +0 -38
  357. package/src/Input/components/Group/index.tsx +0 -21
  358. package/src/Input/components/Password/index.tsx +0 -23
  359. package/src/Input/components/TextArea/index.tsx +0 -57
  360. package/src/Input/demo/allowClear/index.tsx +0 -10
  361. package/src/Input/demo/basic/index.less +0 -6
  362. package/src/Input/demo/basic/index.tsx +0 -25
  363. package/src/Input/demo/gourp/index.tsx +0 -30
  364. package/src/Input/demo/password/index.tsx +0 -11
  365. package/src/Input/demo/prefix/index.tsx +0 -13
  366. package/src/Input/demo/showCount/index.tsx +0 -16
  367. package/src/Input/demo/textArea/autoSize.tsx +0 -21
  368. package/src/Input/index.md +0 -37
  369. package/src/Input/index.test.tsx +0 -78
  370. package/src/Input/index.tsx +0 -91
  371. package/src/Input/style/index.ts +0 -2
  372. package/src/Menu/Divider.tsx +0 -12
  373. package/src/Menu/MenuItem.tsx +0 -24
  374. package/src/Menu/SubMenu.tsx +0 -37
  375. package/src/Menu/index.md +0 -36
  376. package/src/Menu/index.test.tsx +0 -144
  377. package/src/Menu/index.tsx +0 -27
  378. package/src/Menu/style/index.ts +0 -2
  379. package/src/Select/BaseSelect.tsx +0 -321
  380. package/src/Select/OptionsList/OptionItem.tsx +0 -151
  381. package/src/Select/OptionsList/Options.tsx +0 -11
  382. package/src/Select/OptionsList/index.tsx +0 -169
  383. package/src/Select/Selector/index.tsx +0 -211
  384. package/src/Select/VirtualList.tsx +0 -36
  385. package/src/Select/demo/disabled/index.tsx +0 -44
  386. package/src/Select/demo/multiple/index.tsx +0 -77
  387. package/src/Select/demo/options/index.tsx +0 -63
  388. package/src/Select/demo/single/index.tsx +0 -50
  389. package/src/Select/hooks/useCacheOption.ts +0 -67
  390. package/src/Select/index.md +0 -72
  391. package/src/Select/index.tsx +0 -23
  392. package/src/Select/interface.ts +0 -231
  393. package/src/Select/style/index.ts +0 -2
  394. package/src/Select/utils.tsx +0 -133
  395. package/src/Tabs/TabPane.tsx +0 -28
  396. package/src/Tabs/demo/adaptHeight/index.tsx +0 -33
  397. package/src/Tabs/demo/basic/index.tsx +0 -30
  398. package/src/Tabs/demo/horizontalScroll/index.tsx +0 -36
  399. package/src/Tabs/index.md +0 -30
  400. package/src/Tabs/index.test.tsx +0 -100
  401. package/src/Tabs/index.tsx +0 -64
  402. package/src/Tabs/style/index.ts +0 -2
  403. package/src/Tooltip/demo/basic/index.tsx +0 -10
  404. package/src/Tooltip/demo/overflow/index.tsx +0 -10
  405. package/src/Tooltip/demo/placement/index.tsx +0 -60
  406. package/src/Tooltip/demo/trigger/index.tsx +0 -22
  407. package/src/Tooltip/index.md +0 -28
  408. package/src/Tooltip/index.test.tsx +0 -152
  409. package/src/Tooltip/index.tsx +0 -113
  410. package/src/Tooltip/style/index.ts +0 -2
  411. package/src/_utils/hooks/useControlledState.ts +0 -39
  412. package/src/_utils/hooks/usePrefixCls.ts +0 -11
  413. package/tsconfig.json +0 -13
  414. package/typings.d.ts +0 -3
@@ -0,0 +1,187 @@
1
+ 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; }
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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 _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; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useCallback, useState, useEffect, useMemo } from 'react';
20
+ import AntdMenu from 'antd/lib/menu';
21
+ import Icon from '../../../Icon';
22
+
23
+ function Menu(props) {
24
+ var menuList = props.menuList,
25
+ selectedKey = props.selectedKey,
26
+ onMenuSelect = props.onMenuSelect;
27
+
28
+ var _useMemo = useMemo(function () {
29
+ return getFlattenMenuByKey(menuList);
30
+ }, [menuList]),
31
+ flattenMenuByMenuKey = _useMemo.flattenMenuByMenuKey;
32
+
33
+ var _useState = useState(''),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ openKey = _useState2[0],
36
+ setOpenKey = _useState2[1]; // 当前展开的菜单项
37
+
38
+
39
+ var _useState3 = useState(''),
40
+ _useState4 = _slicedToArray(_useState3, 2),
41
+ currentSelectedKey = _useState4[0],
42
+ setCurrentSelectedKey = _useState4[1]; // 当前选中的菜单项
43
+
44
+
45
+ var renderExpandIcon = useCallback(function (renderIconInfo) {
46
+ var isOpen = renderIconInfo.isOpen;
47
+
48
+ if (isOpen) {
49
+ return /*#__PURE__*/React.createElement(Icon, {
50
+ type: "arrow_drop_down",
51
+ size: 20,
52
+ className: "ald-nav-menu-icon-right"
53
+ });
54
+ }
55
+
56
+ return /*#__PURE__*/React.createElement(Icon, {
57
+ type: "arrow_drop_up",
58
+ size: 20,
59
+ className: "ald-nav-menu-icon-right"
60
+ });
61
+ }, []);
62
+ useEffect(function () {
63
+ setCurrentSelectedKey(selectedKey);
64
+ }, [selectedKey]);
65
+ /**
66
+ * 处理选中菜单项变化
67
+ */
68
+
69
+ var onMenuChange = useCallback(function (key) {
70
+ if (onMenuSelect && flattenMenuByMenuKey[key]) {
71
+ var path = flattenMenuByMenuKey[key].path;
72
+ var menuInfo = {
73
+ key: key,
74
+ path: path
75
+ };
76
+ onMenuSelect(menuInfo);
77
+ }
78
+ }, [flattenMenuByMenuKey, onMenuSelect]);
79
+ /**
80
+ * 根据当前选中的菜单项,设置展开的菜单项
81
+ */
82
+
83
+ useEffect(function () {
84
+ var _flattenMenuByMenuKey;
85
+
86
+ setOpenKey(((_flattenMenuByMenuKey = flattenMenuByMenuKey[currentSelectedKey]) === null || _flattenMenuByMenuKey === void 0 ? void 0 : _flattenMenuByMenuKey.openKey) || '');
87
+ }, [currentSelectedKey, flattenMenuByMenuKey, onMenuSelect]);
88
+ /**
89
+ * 父级菜单点击
90
+ */
91
+
92
+ var onSupMenuClick = useCallback(function (key) {
93
+ if (key === openKey) {
94
+ return;
95
+ }
96
+
97
+ var FIRST_INDEX = 0;
98
+ var firstChildrenKey = flattenMenuByMenuKey[key].children[FIRST_INDEX].key;
99
+ setCurrentSelectedKey(firstChildrenKey);
100
+ onMenuChange(firstChildrenKey);
101
+ }, [flattenMenuByMenuKey, openKey, onMenuChange]);
102
+ /**
103
+ * 子级菜单项或者一级菜单点击
104
+ */
105
+
106
+ var onMenuItemClick = useCallback(function (key) {
107
+ if (key === currentSelectedKey) {
108
+ return;
109
+ }
110
+
111
+ setCurrentSelectedKey(key);
112
+ onMenuChange(key);
113
+ }, [currentSelectedKey, onMenuChange]);
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ className: "ald-nav-menu-wrap"
116
+ }, /*#__PURE__*/React.createElement(AntdMenu, {
117
+ selectedKeys: [currentSelectedKey],
118
+ expandIcon: renderExpandIcon,
119
+ openKeys: [openKey],
120
+ mode: "inline",
121
+ style: {
122
+ padding: '0 12px'
123
+ }
124
+ }, Array.isArray(menuList) && menuList.map(function (item) {
125
+ if (item.children) {
126
+ return /*#__PURE__*/React.createElement(AntdMenu.SubMenu, {
127
+ key: item.key,
128
+ icon: item.icon,
129
+ title: item.title,
130
+ onTitleClick: function onTitleClick() {
131
+ return onSupMenuClick(item.key);
132
+ }
133
+ }, item.children.map(function (subItem) {
134
+ return /*#__PURE__*/React.createElement(AntdMenu.Item, {
135
+ onClick: function onClick() {
136
+ return onMenuItemClick(subItem.key);
137
+ },
138
+ key: subItem.key
139
+ }, subItem.title);
140
+ }));
141
+ }
142
+
143
+ return /*#__PURE__*/React.createElement(AntdMenu.Item, {
144
+ key: item.key,
145
+ icon: item.icon,
146
+ onClick: function onClick() {
147
+ return onMenuItemClick(item.key);
148
+ }
149
+ }, item.title);
150
+ })));
151
+ }
152
+
153
+ function getFlattenMenuByKey(menuList) {
154
+ var flattenMenuByMenuKey = {};
155
+ var menuKeys = []; // 存储所有的key 用来判断是否有重复的key
156
+
157
+ var menuInvalidFlag = true; // 传入的menuList是否有效
158
+
159
+ menuList.forEach(function (item) {
160
+ if (!item.key) {
161
+ menuInvalidFlag = false;
162
+ }
163
+
164
+ if (item.children) {
165
+ flattenMenuByMenuKey[item.key] = _objectSpread(_objectSpread({}, item), {}, {
166
+ openKey: ''
167
+ });
168
+ item.children.forEach(function (childItem) {
169
+ flattenMenuByMenuKey[childItem.key] = _objectSpread(_objectSpread({}, childItem), {}, {
170
+ openKey: item.key
171
+ });
172
+ menuKeys.push(childItem.key);
173
+ });
174
+ } else {
175
+ flattenMenuByMenuKey[item.key] = _objectSpread(_objectSpread({}, item), {}, {
176
+ openKey: ''
177
+ });
178
+ menuKeys.push(item.key);
179
+ }
180
+ });
181
+ return {
182
+ menuInvalidFlag: menuInvalidFlag,
183
+ flattenMenuByMenuKey: flattenMenuByMenuKey
184
+ };
185
+ }
186
+
187
+ export default Menu;
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { Navigator } from '@aloudata/aloudata-design';
3
+ import logoSrc from '../logo.png';
4
+ import Icon from '../../../Icon'; // import { IMenuItem } from '@aloudata/aloudata-design/lib/Navigator';
5
+
6
+ import '../../style/index.less';
7
+ import './index.less';
8
+ export default (function () {
9
+ var mockData = [{
10
+ title: '查询',
11
+ icon: /*#__PURE__*/React.createElement(Icon, {
12
+ type: 'add'
13
+ }),
14
+ key: 'query',
15
+ path: '/query'
16
+ }, {
17
+ title: '数据',
18
+ icon: /*#__PURE__*/React.createElement(Icon, {
19
+ type: 'add'
20
+ }),
21
+ key: 'data',
22
+ path: '/data'
23
+ }, {
24
+ title: '计算',
25
+ icon: /*#__PURE__*/React.createElement(Icon, {
26
+ type: 'add'
27
+ }),
28
+ key: 'calculate',
29
+ path: '/calculate'
30
+ }, {
31
+ title: '测试',
32
+ icon: /*#__PURE__*/React.createElement(Icon, {
33
+ type: 'add'
34
+ }),
35
+ key: 'test',
36
+ path: '/calculate'
37
+ }];
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ className: 'ald-nav-demo'
40
+ }, /*#__PURE__*/React.createElement(Navigator, {
41
+ menuList: mockData,
42
+ defaultSelectedKey: "dataSpace",
43
+ logoSrc: logoSrc
44
+ }));
45
+ });
@@ -0,0 +1,3 @@
1
+ .ald-nav-demo {
2
+ height: 300px;
3
+ }
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,153 @@
1
+ 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; }
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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 _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; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useState, useMemo } from 'react';
20
+ import { Navigator, Button } from '@aloudata/aloudata-design';
21
+ import Icon from '../../../Icon';
22
+ import logoSrc from '../logo.png';
23
+ import { useLocation } from 'umi';
24
+ import _ from 'lodash';
25
+ import '../../style/index.less';
26
+ import './index.less';
27
+ var mockData = [{
28
+ title: '查询',
29
+ icon: /*#__PURE__*/React.createElement(Icon, {
30
+ type: 'add'
31
+ }),
32
+ key: 'query',
33
+ path: '/navigator#search'
34
+ }, {
35
+ title: '数据',
36
+ icon: /*#__PURE__*/React.createElement(Icon, {
37
+ type: 'add'
38
+ }),
39
+ key: 'data',
40
+ path: '/navigator#data',
41
+ children: [{
42
+ title: '数据空间',
43
+ key: 'dataSpace',
44
+ path: '/navigator#dataSpace'
45
+ }, {
46
+ title: '数据源',
47
+ key: 'datasource',
48
+ path: '/navigator#datasource'
49
+ }]
50
+ }, {
51
+ title: '计算',
52
+ icon: /*#__PURE__*/React.createElement(Icon, {
53
+ type: 'add'
54
+ }),
55
+ key: 'calculate',
56
+ path: '/navigator#calculate',
57
+ children: [{
58
+ title: '任务记录',
59
+ key: 'job',
60
+ path: '/navigator#job'
61
+ }, {
62
+ title: '查询引擎',
63
+ key: 'queryEngine',
64
+ path: '/navigator#queryEngine'
65
+ }]
66
+ }, {
67
+ title: '测试',
68
+ key: 'test',
69
+ icon: /*#__PURE__*/React.createElement(Icon, {
70
+ type: 'add'
71
+ }),
72
+ path: '/navigator#calculate',
73
+ children: [{
74
+ title: '测试菜单1',
75
+ key: 'hello',
76
+ path: '/navigator#hello'
77
+ }, {
78
+ title: '测试菜单2',
79
+ key: 'hello2',
80
+ path: '/navigator#hello2'
81
+ }]
82
+ }];
83
+ export default (function () {
84
+ // 根据路由信息去匹配菜单信息
85
+ var _useLocation = useLocation(),
86
+ pathname = _useLocation.pathname;
87
+
88
+ var flattenMenuByMenuPath = useMemo(function () {
89
+ return getFlattenMenuByPath(mockData);
90
+ }, []);
91
+
92
+ var menuInfo = _.get(flattenMenuByMenuPath, pathname, {
93
+ path: '',
94
+ key: ''
95
+ });
96
+
97
+ var _useState = useState(menuInfo.key || ''),
98
+ _useState2 = _slicedToArray(_useState, 2),
99
+ selectedKey = _useState2[0],
100
+ setSelectedKey = _useState2[1];
101
+
102
+ var onMenuSelect = function onMenuSelect(menuInfo) {
103
+ console.log('menuInfo', menuInfo);
104
+ var path = menuInfo.path; // 进行路由跳转
105
+ };
106
+
107
+ var mockBtnClick = function mockBtnClick(key) {
108
+ setSelectedKey(key);
109
+ };
110
+
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ className: 'ald-nav-demo-example'
113
+ }, /*#__PURE__*/React.createElement(Navigator, {
114
+ menuList: mockData,
115
+ selectedKey: selectedKey,
116
+ footer: /*#__PURE__*/React.createElement("div", null, "Footer Wrap"),
117
+ logoSrc: logoSrc,
118
+ onMenuSelect: onMenuSelect
119
+ }), /*#__PURE__*/React.createElement("div", {
120
+ className: 'ald-nav-content'
121
+ }, /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u83DC\u5355\uFF1A", selectedKey), /*#__PURE__*/React.createElement(Button, {
122
+ onClick: function onClick() {
123
+ return mockBtnClick('query');
124
+ }
125
+ }, "\u6A21\u62DF\u67E5\u8BE2\u9875\u9762\u5237\u65B0"), /*#__PURE__*/React.createElement(Button, {
126
+ onClick: function onClick() {
127
+ return mockBtnClick('dataSpace');
128
+ }
129
+ }, "\u6A21\u62DF\u6570\u636E\u7A7A\u95F4\u5237\u65B0"), /*#__PURE__*/React.createElement(Button, {
130
+ onClick: function onClick() {
131
+ return mockBtnClick('job');
132
+ }
133
+ }, "\u6A21\u62DF\u4EFB\u52A1\u8BB0\u5F55\u5237\u65B0")));
134
+ });
135
+
136
+ function getFlattenMenuByPath(menuList) {
137
+ var flattenMenuByMenuPath = {};
138
+ menuList.forEach(function (item) {
139
+ if (!item.path) {
140
+ console.error('path is required');
141
+ }
142
+
143
+ if (item.children) {
144
+ flattenMenuByMenuPath[item.path] = _objectSpread({}, item);
145
+ item.children.forEach(function (childItem) {
146
+ flattenMenuByMenuPath[childItem.path] = _objectSpread({}, childItem);
147
+ });
148
+ } else {
149
+ flattenMenuByMenuPath[item.path] = _objectSpread({}, item);
150
+ }
151
+ });
152
+ return flattenMenuByMenuPath;
153
+ }
@@ -0,0 +1,10 @@
1
+ .ald-nav-demo-example {
2
+ border: 1px solid #ccc;
3
+ width: 800px;
4
+ height: 600px;
5
+ display: flex;
6
+
7
+ .ald-nav-content {
8
+ padding: 24px;
9
+ }
10
+ }
Binary file
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { Navigator } from '@aloudata/aloudata-design';
3
+ import logoSrc from '../logo.png';
4
+ import Icon from '../../../Icon';
5
+ import '../../style/index.less';
6
+ import './index.less';
7
+ export default (function () {
8
+ var mockData = [{
9
+ title: '查询',
10
+ icon: /*#__PURE__*/React.createElement(Icon, {
11
+ type: 'add'
12
+ }),
13
+ key: 'query',
14
+ path: '/query'
15
+ }, {
16
+ title: '数据',
17
+ icon: /*#__PURE__*/React.createElement(Icon, {
18
+ type: 'add'
19
+ }),
20
+ key: 'data',
21
+ path: '/data',
22
+ children: [{
23
+ title: '数据空间',
24
+ key: 'dataSpace',
25
+ path: '/data/dataSpace'
26
+ }, {
27
+ title: '数据源',
28
+ key: 'datasource',
29
+ path: '/data/datasource'
30
+ }]
31
+ }, {
32
+ title: '计算',
33
+ icon: /*#__PURE__*/React.createElement(Icon, {
34
+ type: 'add'
35
+ }),
36
+ key: 'calculate',
37
+ path: '/calculate',
38
+ children: [{
39
+ title: '任务记录',
40
+ key: 'job',
41
+ path: '/calculate/job'
42
+ }, {
43
+ title: '查询引擎',
44
+ key: 'queryEngine',
45
+ path: '/calculate/'
46
+ }]
47
+ }, {
48
+ title: '测试',
49
+ icon: /*#__PURE__*/React.createElement(Icon, {
50
+ type: 'add'
51
+ }),
52
+ key: 'test',
53
+ path: '/calculate',
54
+ children: [{
55
+ title: '测试菜单1',
56
+ key: 'hello',
57
+ path: '/calculate/job'
58
+ }, {
59
+ title: '测试菜单2',
60
+ key: 'hello2',
61
+ path: '/calculate/'
62
+ }]
63
+ }];
64
+ var footer = /*#__PURE__*/React.createElement("div", null, "Footer Wrap");
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: 'ald-nav-demo'
67
+ }, /*#__PURE__*/React.createElement(Navigator, {
68
+ menuList: mockData,
69
+ defaultSelectedKey: "dataSpace",
70
+ footer: footer,
71
+ logoSrc: logoSrc
72
+ }));
73
+ });
@@ -0,0 +1,3 @@
1
+ .ald-nav-demo {
2
+ height: 600px;
3
+ }
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import { Navigator } from '@aloudata/aloudata-design';
3
+ import logoSrc from '../logo.png';
4
+ import Icon from '../../../Icon';
5
+ import '../../style/index.less';
6
+ import './index.less';
7
+ export default (function () {
8
+ var mockData = [{
9
+ title: '查询',
10
+ icon: /*#__PURE__*/React.createElement(Icon, {
11
+ type: 'add'
12
+ }),
13
+ key: 'query',
14
+ path: '/query'
15
+ }, {
16
+ title: '数据',
17
+ icon: /*#__PURE__*/React.createElement(Icon, {
18
+ type: 'add'
19
+ }),
20
+ key: 'data',
21
+ path: '/data',
22
+ children: [{
23
+ title: '数据空间',
24
+ key: 'dataSpace',
25
+ path: '/data/dataSpace'
26
+ }, {
27
+ title: '数据源',
28
+ key: 'datasource',
29
+ path: '/data/datasource'
30
+ }]
31
+ }, {
32
+ title: '计算',
33
+ icon: /*#__PURE__*/React.createElement(Icon, {
34
+ type: 'add'
35
+ }),
36
+ key: 'calculate',
37
+ path: '/calculate',
38
+ children: [{
39
+ title: '任务记录',
40
+ key: 'job',
41
+ path: '/calculate/job'
42
+ }, {
43
+ title: '查询引擎',
44
+ key: 'queryEngine',
45
+ path: '/calculate/'
46
+ }]
47
+ }, {
48
+ title: '测试',
49
+ icon: /*#__PURE__*/React.createElement(Icon, {
50
+ type: 'add'
51
+ }),
52
+ key: 'test',
53
+ path: '/calculate',
54
+ children: [{
55
+ title: '测试菜单1',
56
+ key: 'hello',
57
+ path: '/calculate/job'
58
+ }, {
59
+ title: '测试菜单2',
60
+ key: 'hello2',
61
+ path: '/calculate/'
62
+ }]
63
+ }];
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: 'ald-nav-demo'
66
+ }, /*#__PURE__*/React.createElement(Navigator, {
67
+ menuList: mockData,
68
+ defaultSelectedKey: "dataSpace",
69
+ logoSrc: logoSrc
70
+ }));
71
+ });
@@ -0,0 +1,3 @@
1
+ .ald-nav-demo {
2
+ height: 600px;
3
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { IMenuItem } from './components/Menu';
3
+ import './style';
4
+ export type { IMenuItem } from './components/Menu';
5
+ export interface INavigatorProps {
6
+ /**
7
+ * @description 菜单数据
8
+ * @default []
9
+ */
10
+ menuList: IMenuItem[];
11
+ /**
12
+ * @description 当前选中的菜单项
13
+ * @default --
14
+ */
15
+ selectedKey: string;
16
+ /**
17
+ * @description logo的地址 默认高度为24px
18
+ * @default --
19
+ */
20
+ logoSrc: string;
21
+ /**
22
+ * @description logo的点击(可选)
23
+ * @default --
24
+ */
25
+ onLogoClick?: () => void;
26
+ /**
27
+ * @description 导航底部信息 可自定义
28
+ * @default null
29
+ */
30
+ footer?: React.ReactNode;
31
+ /**
32
+ * @description 菜单被选中时调用(可选)
33
+ * @default --
34
+ */
35
+ onMenuSelect?: (menuInfo: {
36
+ key: string;
37
+ path: string;
38
+ }) => void;
39
+ }
40
+ declare function Navigator(props: INavigatorProps): JSX.Element;
41
+ export default Navigator;
@@ -0,0 +1,45 @@
1
+ import React, { useCallback } from 'react';
2
+ import classNames from 'classnames';
3
+ import Menu from './components/Menu';
4
+ import './style';
5
+
6
+ function Navigator(props) {
7
+ var menuList = props.menuList,
8
+ selectedKey = props.selectedKey,
9
+ logoSrc = props.logoSrc,
10
+ _props$footer = props.footer,
11
+ footer = _props$footer === void 0 ? null : _props$footer,
12
+ onLogoClick = props.onLogoClick,
13
+ onMenuSelect = props.onMenuSelect;
14
+ var renderMenu = useCallback(function () {
15
+ return /*#__PURE__*/React.createElement(Menu, {
16
+ menuList: menuList,
17
+ selectedKey: selectedKey,
18
+ onMenuSelect: onMenuSelect
19
+ });
20
+ }, [selectedKey, menuList, onMenuSelect]);
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ className: classNames('ald-nav')
23
+ }, /*#__PURE__*/React.createElement("div", {
24
+ className: classNames('ald-nav-logo', {
25
+ 'ald-nav-logo-able-click': onLogoClick
26
+ })
27
+ }, logoSrc && /*#__PURE__*/React.createElement("div", {
28
+ onClick: onLogoClick,
29
+ className: "ald-nav-logo-wrap"
30
+ }, /*#__PURE__*/React.createElement("img", {
31
+ src: logoSrc,
32
+ alt: "",
33
+ draggable: false
34
+ }))), /*#__PURE__*/React.createElement("div", {
35
+ className: classNames('ald-nav-menu', {
36
+ 'ald-nav-menu-has-footer': !!footer
37
+ })
38
+ }, renderMenu()), footer && /*#__PURE__*/React.createElement("div", {
39
+ className: "ald-nav-footer"
40
+ }, /*#__PURE__*/React.createElement("div", {
41
+ className: "ald-nav-footer-wrap"
42
+ }, footer)));
43
+ }
44
+
45
+ export default Navigator;
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';