tntd 2.0.14 → 2.0.15

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 (447) hide show
  1. package/es/array-input/index.js +6 -31
  2. package/es/array-input/style/index.js +1 -0
  3. package/es/array-input/style/index.js.map +1 -0
  4. package/es/auth-context/style/index.js +1 -0
  5. package/es/auth-context/style/index.js.map +1 -0
  6. package/es/columns/index.js +6 -12
  7. package/es/development-login/LoginModal.js +4 -10
  8. package/es/development-login/style/index.js +1 -0
  9. package/es/development-login/style/index.js.map +1 -0
  10. package/es/drawer/drawer.js +5 -9
  11. package/es/drawer/drawer.js.map +1 -1
  12. package/es/drawer/drawer.less +13 -11
  13. package/es/ellipsis/index.js +14 -25
  14. package/es/ellipsis/style/index.js +1 -0
  15. package/es/ellipsis/style/index.js.map +1 -0
  16. package/es/empty/empty.js +9 -13
  17. package/es/empty/render-empty.js +22 -0
  18. package/es/empty/render-empty.js.map +1 -0
  19. package/es/empty/style/index.js +2 -0
  20. package/es/empty/style/index.js.map +1 -0
  21. package/es/handle/index.js +14 -27
  22. package/es/handle/style/index.js +1 -0
  23. package/es/handle/style/index.js.map +1 -0
  24. package/es/icon-list/style/index.js +1 -0
  25. package/es/icon-list/style/index.js.map +1 -0
  26. package/es/img/Contain.js +13 -19
  27. package/es/img/Cover.js +13 -24
  28. package/es/img/index.js +14 -21
  29. package/es/img/style/index.js +1 -0
  30. package/es/img/style/index.js.map +1 -0
  31. package/es/index.js +0 -1
  32. package/es/loading-button/index.js +6 -13
  33. package/es/loading-button/style/index.js +1 -0
  34. package/es/loading-button/style/index.js.map +1 -0
  35. package/es/locale/default.js +0 -2
  36. package/es/locale/en_US.js +0 -2
  37. package/es/locale/zh_CN.js +0 -2
  38. package/es/modal/index.js +11 -2
  39. package/es/modal/index.js.map +1 -1
  40. package/es/modal/modal.js +44 -0
  41. package/es/modal/modal.js.map +1 -0
  42. package/es/modal/modal.less +27 -25
  43. package/es/page/Box.js +19 -28
  44. package/es/page/index.js +22 -38
  45. package/es/page/style/index.js +1 -0
  46. package/es/page/style/index.js.map +1 -0
  47. package/es/page/utils.js +0 -5
  48. package/es/prev-locale.js +0 -3
  49. package/es/query-form/Field/Checkbox.js +4 -8
  50. package/es/query-form/Field/Select.js +10 -17
  51. package/es/query-form/Field/SelectInput.js +4 -18
  52. package/es/query-form/Field/fieldsMap.js +0 -1
  53. package/es/query-form/Field/index.js +2 -11
  54. package/es/query-form/createActions.js +0 -8
  55. package/es/query-form/index.js +2 -34
  56. package/es/query-form/style/index.js +1 -0
  57. package/es/query-form/style/index.js.map +1 -0
  58. package/es/query-list-scene/List.js +18 -39
  59. package/es/query-list-scene/QueryForm.js +10 -19
  60. package/es/query-list-scene/QueryListScene.js +0 -2
  61. package/es/query-list-scene/Toolbar.js +6 -10
  62. package/es/query-list-scene/createActions.js +0 -3
  63. package/es/query-list-scene/style/index.js +1 -0
  64. package/es/query-list-scene/style/index.js.map +1 -0
  65. package/es/render-empty/render-empty.js +0 -2
  66. package/es/render-empty/style/index.js +1 -0
  67. package/es/render-empty/style/index.js.map +1 -0
  68. package/es/steps/steps.js +9 -17
  69. package/es/svg-components/illustration-403.js +0 -2
  70. package/es/svg-components/illustration-404.js +0 -2
  71. package/es/svg-components/illustration-500.js +0 -2
  72. package/es/svg-components/illustration-empty.js +0 -2
  73. package/es/svg-components/illustration-failure.js +0 -2
  74. package/es/svg-components/illustration-no-access.js +0 -2
  75. package/es/svg-components/illustration-no-chart.js +0 -2
  76. package/es/svg-components/illustration-no-result.js +0 -2
  77. package/es/svg-components/illustration-offline.js +0 -2
  78. package/es/svg-components/illustration-success.js +0 -2
  79. package/es/table/assets/image-loading-background.js +0 -2
  80. package/es/table/assets/image-loading.js +0 -2
  81. package/es/table/hooks/use-column-setting.js +0 -1
  82. package/es/table/style/index.js +2 -0
  83. package/es/table/style/index.js.map +1 -0
  84. package/es/table/table.js +14 -19
  85. package/es/table/table.stories.js +0 -2
  86. package/es/table/utils.js +2 -6
  87. package/es/title/index.js +10 -14
  88. package/es/title/style/index.js +1 -0
  89. package/es/title/style/index.js.map +1 -0
  90. package/es/tntd-cascader/AntdCascader/component/context.js +2 -4
  91. package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +0 -2
  92. package/es/tntd-cascader/AntdCascader/component/getIcons.js +6 -15
  93. package/es/tntd-cascader/AntdCascader/config/utils.js +0 -2
  94. package/es/tntd-cascader/AntdCascader/config/warning.js +4 -8
  95. package/es/tntd-cascader/AntdCascader/index.js +51 -73
  96. package/es/tntd-cascader/rc-cascader/Cascader.js +86 -113
  97. package/es/tntd-cascader/rc-cascader/OptionList/Column.js +16 -26
  98. package/es/tntd-cascader/rc-cascader/OptionList/index.js +26 -43
  99. package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -7
  100. package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +12 -41
  101. package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +4 -10
  102. package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +2 -4
  103. package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +0 -1
  104. package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +0 -1
  105. package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +2 -7
  106. package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +8 -15
  107. package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +2 -6
  108. package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +2 -4
  109. package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +2 -7
  110. package/es/tntd-icon/fonts/iconfont.js +7 -12
  111. package/es/tntd-icon/index.js +5 -9
  112. package/es/tntd-icon/style/index.js +1 -0
  113. package/es/tntd-icon/style/index.js.map +1 -0
  114. package/es/tntd-layout/ActionsContext.js +2 -2
  115. package/es/tntd-layout/AppList.js +2 -14
  116. package/es/tntd-layout/Application.js +0 -4
  117. package/es/tntd-layout/Avatar.js +0 -4
  118. package/es/tntd-layout/CompatibleLanguage.js +0 -13
  119. package/es/tntd-layout/EnterpriseLayout/Avatar.js +0 -4
  120. package/es/tntd-layout/EnterpriseLayout/Language.js +0 -6
  121. package/es/tntd-layout/EnterpriseLayout/Theme.js +0 -4
  122. package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
  123. package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +2 -33
  124. package/es/tntd-layout/GlobalNavigation/index.js +0 -6
  125. package/es/tntd-layout/HeaderActions.js +28 -32
  126. package/es/tntd-layout/HeaderNavs.js +6 -14
  127. package/es/tntd-layout/HeaderTabs.js +14 -35
  128. package/es/tntd-layout/Language.js +0 -6
  129. package/es/tntd-layout/Layout.js +2 -7
  130. package/es/tntd-layout/Logo.js +4 -11
  131. package/es/tntd-layout/OrgAppList.js +22 -39
  132. package/es/tntd-layout/SideMenu.js +8 -45
  133. package/es/tntd-layout/Theme.js +0 -6
  134. package/es/tntd-layout/index.js +9 -17
  135. package/es/tntd-layout/paaslayout/CompactSideMenu.js +0 -15
  136. package/es/tntd-layout/paaslayout/SideMenu.js +0 -15
  137. package/es/tntd-layout/paaslayout/index.js +4 -13
  138. package/es/tntd-layout/storage.js +2 -2
  139. package/es/tntd-layout/style/index.js +1 -0
  140. package/es/tntd-layout/style/index.js.map +1 -0
  141. package/es/tntd-modal/index.js +12 -18
  142. package/es/tntd-modal/style/index.js +1 -0
  143. package/es/tntd-modal/style/index.js.map +1 -0
  144. package/es/tntd-second-page/index.js +0 -3
  145. package/es/tntd-select/DropDownWrap.js +4 -8
  146. package/es/tntd-select/index.js +74 -118
  147. package/es/tntd-select/style/index.js +1 -0
  148. package/es/tntd-select/style/index.js.map +1 -0
  149. package/es/utils/checkAuth.js +0 -1
  150. package/es/utils/findMenuInfoByPath.js +0 -3
  151. package/es/utils/index.js +2 -11
  152. package/lib/affix/index.js +4 -10
  153. package/lib/alert/index.js +4 -10
  154. package/lib/anchor/index.js +4 -10
  155. package/lib/array-input/icon.js +1 -7
  156. package/lib/array-input/index.js +41 -91
  157. package/lib/array-input/style/index.d.ts +1 -0
  158. package/lib/array-input/style/index.d.ts.map +1 -0
  159. package/lib/array-input/style/index.js +1 -0
  160. package/lib/array-input/style/index.js.map +1 -0
  161. package/lib/auth-context/index.js +0 -3
  162. package/lib/auth-context/style/index.d.ts +1 -0
  163. package/lib/auth-context/style/index.d.ts.map +1 -0
  164. package/lib/auth-context/style/index.js +1 -0
  165. package/lib/auth-context/style/index.js.map +1 -0
  166. package/lib/auto-complete/index.js +4 -10
  167. package/lib/avatar/index.js +4 -10
  168. package/lib/back-top/index.js +4 -10
  169. package/lib/badge/index.js +4 -10
  170. package/lib/breadcrumb/index.js +4 -10
  171. package/lib/button/index.js +4 -10
  172. package/lib/calendar/index.js +4 -10
  173. package/lib/card/index.js +4 -10
  174. package/lib/carousel/index.js +4 -10
  175. package/lib/cascader/index.js +4 -10
  176. package/lib/checkbox/index.js +4 -10
  177. package/lib/col/index.js +4 -10
  178. package/lib/collapse/index.js +4 -11
  179. package/lib/columns/index.js +14 -28
  180. package/lib/comment/index.js +4 -10
  181. package/lib/config-provider/config-provider.js +0 -2
  182. package/lib/config-provider/index.js +4 -10
  183. package/lib/date-picker/index.js +4 -10
  184. package/lib/descriptions/index.js +4 -10
  185. package/lib/development-login/LoginModal.js +25 -50
  186. package/lib/development-login/index.js +11 -22
  187. package/lib/development-login/style/index.d.ts +1 -0
  188. package/lib/development-login/style/index.d.ts.map +1 -0
  189. package/lib/development-login/style/index.js +1 -0
  190. package/lib/development-login/style/index.js.map +1 -0
  191. package/lib/divider/index.js +4 -10
  192. package/lib/drawer/drawer.d.ts.map +1 -1
  193. package/lib/drawer/drawer.js +7 -17
  194. package/lib/drawer/drawer.js.map +1 -1
  195. package/lib/drawer/drawer.less +13 -11
  196. package/lib/drawer/index.js +1 -5
  197. package/lib/dropdown/index.js +4 -10
  198. package/lib/ellipsis/Svg/CopySVG.js +0 -4
  199. package/lib/ellipsis/Svg/TickSVG.js +0 -4
  200. package/lib/ellipsis/index.js +42 -73
  201. package/lib/ellipsis/style/index.d.ts +1 -0
  202. package/lib/ellipsis/style/index.d.ts.map +1 -0
  203. package/lib/ellipsis/style/index.js +1 -0
  204. package/lib/ellipsis/style/index.js.map +1 -0
  205. package/lib/empty/empty.js +14 -30
  206. package/lib/empty/empty.stories.js +3 -21
  207. package/lib/empty/index.js +1 -5
  208. package/lib/empty/render-empty.d.ts +3 -0
  209. package/lib/empty/render-empty.d.ts.map +1 -0
  210. package/lib/empty/render-empty.js +32 -0
  211. package/lib/empty/render-empty.js.map +1 -0
  212. package/lib/empty/style/index.d.ts +3 -0
  213. package/lib/empty/style/index.d.ts.map +1 -0
  214. package/lib/empty/style/index.js +4 -0
  215. package/lib/empty/style/index.js.map +1 -0
  216. package/lib/exception/exception.js +7 -14
  217. package/lib/exception/index.js +1 -4
  218. package/lib/form/index.js +4 -10
  219. package/lib/handle/index.js +19 -46
  220. package/lib/handle/style/index.d.ts +1 -0
  221. package/lib/handle/style/index.d.ts.map +1 -0
  222. package/lib/handle/style/index.js +1 -0
  223. package/lib/handle/style/index.js.map +1 -0
  224. package/lib/icon/index.js +4 -10
  225. package/lib/icon-list/style/index.d.ts +3 -0
  226. package/lib/icon-list/style/index.d.ts.map +1 -0
  227. package/lib/icon-list/style/index.js +8 -0
  228. package/lib/icon-list/style/index.js.map +1 -0
  229. package/lib/img/Contain.js +12 -23
  230. package/lib/img/Cover.js +31 -53
  231. package/lib/img/index.js +29 -47
  232. package/lib/img/style/index.d.ts +1 -0
  233. package/lib/img/style/index.d.ts.map +1 -0
  234. package/lib/img/style/index.js +1 -0
  235. package/lib/img/style/index.js.map +1 -0
  236. package/lib/index.js +100 -187
  237. package/lib/input/index.js +4 -10
  238. package/lib/input-number/index.js +4 -10
  239. package/lib/layout/index.js +4 -10
  240. package/lib/list/index.js +4 -10
  241. package/lib/loading-button/index.js +15 -32
  242. package/lib/loading-button/style/index.d.ts +1 -0
  243. package/lib/loading-button/style/index.d.ts.map +1 -0
  244. package/lib/loading-button/style/index.js +1 -0
  245. package/lib/loading-button/style/index.js.map +1 -0
  246. package/lib/locale/default.js +0 -5
  247. package/lib/locale/en_US.js +0 -4
  248. package/lib/locale/index.js +3 -6
  249. package/lib/locale/zh_CN.js +0 -4
  250. package/lib/locale-provider/index.js +4 -10
  251. package/lib/mention/index.js +4 -10
  252. package/lib/mentions/index.js +4 -10
  253. package/lib/menu/index.js +4 -10
  254. package/lib/message/index.js +4 -11
  255. package/lib/modal/index.d.ts +2 -2
  256. package/lib/modal/index.d.ts.map +1 -1
  257. package/lib/modal/index.js +13 -14
  258. package/lib/modal/index.js.map +1 -1
  259. package/lib/modal/modal.d.ts +15 -0
  260. package/lib/modal/modal.d.ts.map +1 -0
  261. package/lib/modal/modal.js +66 -0
  262. package/lib/modal/modal.js.map +1 -0
  263. package/lib/modal/modal.less +27 -25
  264. package/lib/notification/index.js +4 -10
  265. package/lib/page/Box.js +24 -37
  266. package/lib/page/index.js +37 -66
  267. package/lib/page/style/index.d.ts +1 -0
  268. package/lib/page/style/index.d.ts.map +1 -0
  269. package/lib/page/style/index.js +1 -0
  270. package/lib/page/style/index.js.map +1 -0
  271. package/lib/page/utils.js +1 -9
  272. package/lib/page-header/index.js +4 -10
  273. package/lib/pagination/index.js +4 -10
  274. package/lib/popconfirm/index.js +4 -10
  275. package/lib/popover/index.js +4 -10
  276. package/lib/prev-locale.js +1 -10
  277. package/lib/progress/index.js +4 -10
  278. package/lib/query-form/Field/Checkbox.js +2 -11
  279. package/lib/query-form/Field/Select.js +27 -45
  280. package/lib/query-form/Field/SelectInput.js +21 -46
  281. package/lib/query-form/Field/fieldsMap.js +1 -12
  282. package/lib/query-form/Field/index.js +38 -70
  283. package/lib/query-form/createActions.js +0 -7
  284. package/lib/query-form/index.js +52 -121
  285. package/lib/query-form/style/index.d.ts +1 -0
  286. package/lib/query-form/style/index.d.ts.map +1 -0
  287. package/lib/query-form/style/index.js +1 -0
  288. package/lib/query-form/style/index.js.map +1 -0
  289. package/lib/query-form/useForm.js +0 -4
  290. package/lib/query-list-scene/List.js +58 -111
  291. package/lib/query-list-scene/QueryForm.js +37 -67
  292. package/lib/query-list-scene/QueryListScene.js +21 -42
  293. package/lib/query-list-scene/Title.js +1 -5
  294. package/lib/query-list-scene/Toolbar.js +8 -15
  295. package/lib/query-list-scene/createActions.js +0 -6
  296. package/lib/query-list-scene/index.js +0 -10
  297. package/lib/query-list-scene/style/index.d.ts +1 -0
  298. package/lib/query-list-scene/style/index.d.ts.map +1 -0
  299. package/lib/query-list-scene/style/index.js +1 -0
  300. package/lib/query-list-scene/style/index.js.map +1 -0
  301. package/lib/query-list-scene/useActions.js +0 -4
  302. package/lib/radio/index.js +4 -10
  303. package/lib/rate/index.js +4 -10
  304. package/lib/render-empty/index.js +0 -2
  305. package/lib/render-empty/render-empty.js +0 -8
  306. package/lib/render-empty/style/index.d.ts +2 -0
  307. package/lib/render-empty/style/index.d.ts.map +1 -0
  308. package/lib/render-empty/style/index.js +3 -0
  309. package/lib/render-empty/style/index.js.map +1 -0
  310. package/lib/result/index.js +4 -10
  311. package/lib/row/index.js +4 -10
  312. package/lib/select/index.js +4 -10
  313. package/lib/skeleton/index.js +4 -10
  314. package/lib/slider/index.js +4 -10
  315. package/lib/spin/index.js +4 -10
  316. package/lib/statistic/index.js +4 -10
  317. package/lib/steps/index.js +1 -5
  318. package/lib/steps/steps.js +12 -29
  319. package/lib/svg-components/illustration-403.js +3 -9
  320. package/lib/svg-components/illustration-404.js +3 -9
  321. package/lib/svg-components/illustration-500.js +3 -9
  322. package/lib/svg-components/illustration-empty.js +3 -9
  323. package/lib/svg-components/illustration-failure.js +3 -9
  324. package/lib/svg-components/illustration-no-access.js +3 -9
  325. package/lib/svg-components/illustration-no-chart.js +3 -9
  326. package/lib/svg-components/illustration-no-result.js +3 -9
  327. package/lib/svg-components/illustration-offline.js +3 -9
  328. package/lib/svg-components/illustration-success.js +3 -9
  329. package/lib/svg-components/index.js +0 -11
  330. package/lib/switch/index.js +4 -10
  331. package/lib/table/assets/image-loading-background.js +3 -9
  332. package/lib/table/assets/image-loading.js +3 -9
  333. package/lib/table/context.js +0 -2
  334. package/lib/table/hooks/index.js +1 -2
  335. package/lib/table/hooks/use-column-setting.js +8 -16
  336. package/lib/table/index.js +1 -5
  337. package/lib/table/style/index.d.ts +3 -0
  338. package/lib/table/style/index.d.ts.map +1 -0
  339. package/lib/table/style/index.js +4 -0
  340. package/lib/table/style/index.js.map +1 -0
  341. package/lib/table/table.js +34 -63
  342. package/lib/table/table.stories.js +2 -11
  343. package/lib/table/utils.js +2 -11
  344. package/lib/tabs/index.js +4 -10
  345. package/lib/tag/index.js +4 -10
  346. package/lib/time-picker/index.js +4 -10
  347. package/lib/timeline/index.js +4 -10
  348. package/lib/title/index.js +10 -20
  349. package/lib/title/style/index.d.ts +1 -0
  350. package/lib/title/style/index.d.ts.map +1 -0
  351. package/lib/title/style/index.js +1 -0
  352. package/lib/title/style/index.js.map +1 -0
  353. package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +4 -11
  354. package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -8
  355. package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +3 -8
  356. package/lib/tntd-cascader/AntdCascader/component/context.js +3 -9
  357. package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +4 -12
  358. package/lib/tntd-cascader/AntdCascader/component/getIcons.js +19 -37
  359. package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +8 -17
  360. package/lib/tntd-cascader/AntdCascader/config/utils.js +6 -15
  361. package/lib/tntd-cascader/AntdCascader/config/warning.js +7 -15
  362. package/lib/tntd-cascader/AntdCascader/index.js +80 -133
  363. package/lib/tntd-cascader/AntdCascader/interface.js +0 -3
  364. package/lib/tntd-cascader/index.js +0 -2
  365. package/lib/tntd-cascader/rc-cascader/Cascader.js +123 -188
  366. package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +11 -21
  367. package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +60 -88
  368. package/lib/tntd-cascader/rc-cascader/OptionList/index.js +65 -109
  369. package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -33
  370. package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +56 -106
  371. package/lib/tntd-cascader/rc-cascader/context.js +3 -8
  372. package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +14 -31
  373. package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -15
  374. package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +3 -11
  375. package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +3 -8
  376. package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -15
  377. package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +26 -41
  378. package/lib/tntd-cascader/rc-cascader/index.js +0 -3
  379. package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +9 -20
  380. package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +0 -8
  381. package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -14
  382. package/lib/tntd-icon/fonts/iconfont.js +7 -12
  383. package/lib/tntd-icon/index.js +6 -17
  384. package/lib/tntd-icon/style/index.d.ts +1 -0
  385. package/lib/tntd-icon/style/index.d.ts.map +1 -0
  386. package/lib/tntd-icon/style/index.js +1 -0
  387. package/lib/tntd-icon/style/index.js.map +1 -0
  388. package/lib/tntd-layout/ActionsContext.js +0 -3
  389. package/lib/tntd-layout/AppList.js +30 -105
  390. package/lib/tntd-layout/Application.js +22 -84
  391. package/lib/tntd-layout/Avatar.js +18 -72
  392. package/lib/tntd-layout/CompatibleLanguage.js +32 -105
  393. package/lib/tntd-layout/EnterpriseLayout/Avatar.js +24 -80
  394. package/lib/tntd-layout/EnterpriseLayout/Language.js +14 -45
  395. package/lib/tntd-layout/EnterpriseLayout/Theme.js +16 -46
  396. package/lib/tntd-layout/EnterpriseLayout/index.js +4 -12
  397. package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +45 -174
  398. package/lib/tntd-layout/GlobalNavigation/index.js +19 -70
  399. package/lib/tntd-layout/Header.js +20 -54
  400. package/lib/tntd-layout/HeaderActions.js +33 -64
  401. package/lib/tntd-layout/HeaderNavs.js +19 -59
  402. package/lib/tntd-layout/HeaderTabs.js +43 -111
  403. package/lib/tntd-layout/Iconfont.js +0 -5
  404. package/lib/tntd-layout/Language.js +14 -45
  405. package/lib/tntd-layout/Layout.js +74 -113
  406. package/lib/tntd-layout/Logo.js +14 -41
  407. package/lib/tntd-layout/OrgAppList.js +51 -119
  408. package/lib/tntd-layout/SideMenu.js +42 -120
  409. package/lib/tntd-layout/Theme.js +19 -71
  410. package/lib/tntd-layout/createActions.js +0 -5
  411. package/lib/tntd-layout/images/index.js +0 -28
  412. package/lib/tntd-layout/index.js +21 -49
  413. package/lib/tntd-layout/paaslayout/CompactSideMenu.js +29 -81
  414. package/lib/tntd-layout/paaslayout/Header.js +14 -47
  415. package/lib/tntd-layout/paaslayout/Logo.js +2 -19
  416. package/lib/tntd-layout/paaslayout/SideMenu.js +31 -82
  417. package/lib/tntd-layout/paaslayout/index.js +62 -108
  418. package/lib/tntd-layout/storage.d.ts +1 -1
  419. package/lib/tntd-layout/storage.d.ts.map +1 -1
  420. package/lib/tntd-layout/storage.js +3 -33
  421. package/lib/tntd-layout/style/index.d.ts +1 -0
  422. package/lib/tntd-layout/style/index.d.ts.map +1 -0
  423. package/lib/tntd-layout/style/index.js +1 -0
  424. package/lib/tntd-layout/style/index.js.map +1 -0
  425. package/lib/tntd-modal/index.js +32 -51
  426. package/lib/tntd-modal/style/index.d.ts +1 -0
  427. package/lib/tntd-modal/style/index.d.ts.map +1 -0
  428. package/lib/tntd-modal/style/index.js +1 -0
  429. package/lib/tntd-modal/style/index.js.map +1 -0
  430. package/lib/tntd-second-page/index.js +14 -24
  431. package/lib/tntd-select/DropDownWrap.js +24 -45
  432. package/lib/tntd-select/index.js +117 -206
  433. package/lib/tntd-select/style/index.d.ts +1 -0
  434. package/lib/tntd-select/style/index.d.ts.map +1 -0
  435. package/lib/tntd-select/style/index.js +1 -0
  436. package/lib/tntd-select/style/index.js.map +1 -0
  437. package/lib/tooltip/index.js +4 -10
  438. package/lib/transfer/index.js +4 -10
  439. package/lib/tree/index.js +4 -10
  440. package/lib/tree-select/index.js +4 -10
  441. package/lib/typography/index.js +4 -10
  442. package/lib/upload/index.js +4 -10
  443. package/lib/utils/checkAuth.js +4 -10
  444. package/lib/utils/findMenuInfoByPath.js +1 -7
  445. package/lib/utils/index.js +13 -41
  446. package/lib/version/index.js +4 -10
  447. package/package.json +1 -1
@@ -1,26 +1,22 @@
1
1
  var __rest = this && this.__rest || function (s, e) {
2
2
  var t = {};
3
-
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
5
-
6
4
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
5
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
8
6
  }
9
7
  return t;
10
8
  };
11
-
12
9
  import React from 'react';
13
10
  import './fonts/iconfont';
14
11
  import './index.less';
15
12
  export { default as iconList } from '../icon-list';
16
13
  export default (_a => {
17
14
  var {
18
- type,
19
- prefix = 'tnt-',
20
- className = ''
21
- } = _a,
22
- props = __rest(_a, ["type", "prefix", "className"]);
23
-
15
+ type,
16
+ prefix = 'tnt-',
17
+ className = ''
18
+ } = _a,
19
+ props = __rest(_a, ["type", "prefix", "className"]);
24
20
  return React.createElement("i", Object.assign({
25
21
  className: `tnt-icon ${className}`,
26
22
  type: type
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-icon/style/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1,3 +1,3 @@
1
- import { createContext } from 'react'; // import createActions from './createActions';
2
-
1
+ import { createContext } from 'react';
2
+ // import createActions from './createActions';
3
3
  export default createContext({});
@@ -49,8 +49,8 @@ const MenuList = styled(Menu)`
49
49
  .isInIframe & {
50
50
  margin-left: 20px;
51
51
  }
52
- `; // 新版UI
53
-
52
+ `;
53
+ // 新版UI
54
54
  const AppsSelect = styled(Select)`
55
55
  min-width: 160px;
56
56
  height: 28px;
@@ -140,10 +140,8 @@ export default withTheme(props => {
140
140
  items = [],
141
141
  onChange
142
142
  } = props;
143
-
144
143
  const getInitialSelectedApp = () => {
145
144
  const currentAppStore = getCurrentAppStore();
146
-
147
145
  const findAppByKey = selectedKey => {
148
146
  let findApp;
149
147
  traverseTree(items, item => {
@@ -154,17 +152,14 @@ export default withTheme(props => {
154
152
  });
155
153
  return findApp;
156
154
  };
157
-
158
155
  const currentApp = findAppByKey(selectedKey || _get(currentAppStore, 'key'));
159
156
  return currentApp || items[0];
160
157
  };
161
-
162
158
  const changeApp = app => {
163
159
  setSelectedApp(app);
164
160
  setCurrentAppStore(app);
165
161
  onChange && onChange(app);
166
162
  };
167
-
168
163
  const [searchValue, setSearchValue] = useState();
169
164
  const [selectedApp, setSelectedApp] = useState(getInitialSelectedApp());
170
165
  const Menus = React.createElement(MenuList, {
@@ -185,11 +180,9 @@ export default withTheme(props => {
185
180
  name
186
181
  } = {}) => {
187
182
  const regExp = new RegExp(searchValue, 'i');
188
-
189
183
  if (searchValue) {
190
184
  return regExp.test(key) || regExp.test(name);
191
185
  }
192
-
193
186
  return true;
194
187
  }).map(item => React.createElement(Menu.Item, {
195
188
  key: item.key,
@@ -197,16 +190,13 @@ export default withTheme(props => {
197
190
  }, item.name)));
198
191
  useEffect(() => {
199
192
  const newApp = getInitialSelectedApp();
200
-
201
193
  if ((newApp === null || newApp === void 0 ? void 0 : newApp.key) !== (selectedApp === null || selectedApp === void 0 ? void 0 : selectedApp.key)) {
202
194
  changeApp(newApp);
203
195
  }
204
196
  }, [items, selectedKey]);
205
-
206
197
  if (!props.theme.compatible) {
207
198
  if (items === null || items === void 0 ? void 0 : items.some(item => {
208
199
  var _a;
209
-
210
200
  return (_a = item.children) === null || _a === void 0 ? void 0 : _a.length;
211
201
  })) {
212
202
  return React.createElement(AppTreeSelect, {
@@ -242,7 +232,6 @@ export default withTheme(props => {
242
232
  }
243
233
  });
244
234
  }
245
-
246
235
  return React.createElement(AppsSelect, {
247
236
  placeholder: "\u8BF7\u9009\u62E9",
248
237
  showSearch: true,
@@ -266,7 +255,6 @@ export default withTheme(props => {
266
255
  value: key
267
256
  }, name)));
268
257
  }
269
-
270
258
  return React.createElement(Dropdown, {
271
259
  overlay: Menus,
272
260
  trigger: ['click']
@@ -60,7 +60,6 @@ const AppContentWrapper = styled.div`
60
60
  border-radius: 4px;
61
61
  z-index: 1;
62
62
  `;
63
-
64
63
  const AppContent = props => {
65
64
  const {
66
65
  language,
@@ -68,12 +67,10 @@ const AppContent = props => {
68
67
  onChange
69
68
  } = props;
70
69
  const [appKey, setAppKey] = useState(props.appKey);
71
-
72
70
  const changeApp = appKey => {
73
71
  setAppKey(appKey);
74
72
  onChange && onChange(appKey);
75
73
  };
76
-
77
74
  return React.createElement(AppContentWrapper, null, React.createElement(AppList, null, apps.sort((a, b) => _get(applicationsMap, `${a.appKey}.sort`, 1) - _get(applicationsMap, `${b.appKey}.sort`, 1)).map(({
78
75
  appKey: key
79
76
  }) => React.createElement(AppItem, {
@@ -93,7 +90,6 @@ const AppContent = props => {
93
90
  en: 'enName'
94
91
  }[language || 'cn']}`, key))))));
95
92
  };
96
-
97
93
  export default (props => React.createElement(App, null, React.createElement(Popover, {
98
94
  placement: "bottomRight",
99
95
  title: null,
@@ -75,7 +75,6 @@ const UserInfoWrapper = styled.div`
75
75
  }
76
76
  }
77
77
  `;
78
-
79
78
  const UserInfoContent = props => {
80
79
  const {
81
80
  userInfo,
@@ -125,10 +124,8 @@ const UserInfoContent = props => {
125
124
  }
126
125
  }, getText('signOut'))));
127
126
  };
128
-
129
127
  export default (props => {
130
128
  var _a;
131
-
132
129
  const {
133
130
  userInfo = {}
134
131
  } = props;
@@ -145,7 +142,6 @@ export default (props => {
145
142
  src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
146
143
  onError: e => {
147
144
  var _a;
148
-
149
145
  e.target.onerror = null;
150
146
  e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
151
147
  }
@@ -119,7 +119,6 @@ const themes = [{
119
119
  value: 'themeS2',
120
120
  img: images.themeSymbol2
121
121
  }];
122
-
123
122
  const ThemeContent = props => {
124
123
  const {
125
124
  config,
@@ -130,40 +129,31 @@ const ThemeContent = props => {
130
129
  language: languageVisible = true,
131
130
  theme: themeVisible = true
132
131
  } = config || {};
133
-
134
132
  const getTheme = () => {
135
133
  let theme = getThemeStore() || props.theme || 'themeS2';
136
134
  return themes.some(({
137
135
  value
138
136
  }) => value === theme) ? theme : 'themeS2';
139
137
  };
140
-
141
138
  const [theme, setTheme] = useState(getTheme());
142
-
143
139
  const changeTheme = theme => {
144
140
  setTheme(theme);
145
141
  setThemeStore(theme);
146
142
  onThemeChange(theme);
147
143
  };
148
-
149
144
  const getLanguage = () => {
150
145
  let lang = getLanguageStore() || props.language;
151
-
152
146
  if (!languagesMap[lang]) {
153
147
  lang = _get(languages, '0.value');
154
148
  }
155
-
156
149
  return lang;
157
150
  };
158
-
159
151
  const [language = 'cn', setLanguage] = useState(getLanguage());
160
-
161
152
  const changeLanguage = language => {
162
153
  setLanguage(language);
163
154
  setLanguageStore(language);
164
155
  onLanguageChange(language);
165
156
  };
166
-
167
157
  return React.createElement(ThemeContentWrapper, null, themeVisible && React.createElement(ThemeSwitch, null, themes.map(({
168
158
  value,
169
159
  img
@@ -187,16 +177,13 @@ const ThemeContent = props => {
187
177
  onClick: changeLanguage.bind(this, value)
188
178
  }, name))));
189
179
  };
190
-
191
180
  export default (props => {
192
181
  const {
193
182
  config
194
183
  } = props;
195
-
196
184
  if ((config === null || config === void 0 ? void 0 : config.language) === false && (config === null || config === void 0 ? void 0 : config.theme) === false) {
197
185
  return null;
198
186
  }
199
-
200
187
  return React.createElement(Theme, null, React.createElement(Popover, {
201
188
  placement: "bottomRight",
202
189
  title: null,
@@ -81,7 +81,6 @@ const UserInfoWrapper = styled.div`
81
81
  }
82
82
  }
83
83
  `;
84
-
85
84
  const UserInfoContent = props => {
86
85
  const {
87
86
  userInfo,
@@ -143,10 +142,8 @@ const UserInfoContent = props => {
143
142
  }
144
143
  }, getText('signOut'))));
145
144
  };
146
-
147
145
  export default (props => {
148
146
  var _a;
149
-
150
147
  const {
151
148
  userInfo = {}
152
149
  } = props;
@@ -163,7 +160,6 @@ export default (props => {
163
160
  src: avatar.indexOf('base64') > 0 ? avatar : _get(images[avatar], 'default', images[avatar]),
164
161
  onError: e => {
165
162
  var _a;
166
-
167
163
  e.target.onerror = null;
168
164
  e.target.src = ((_a = images.empty) === null || _a === void 0 ? void 0 : _a.default) || images.empty;
169
165
  }
@@ -65,26 +65,20 @@ export default withTheme(props => {
65
65
  const {
66
66
  onChange
67
67
  } = props;
68
-
69
68
  const getLanguage = () => {
70
69
  let lang = getLanguageStore() || props.language;
71
-
72
70
  if (!languagesMap[lang]) {
73
71
  lang = _get(languages, '0.value');
74
72
  }
75
-
76
73
  return lang;
77
74
  };
78
-
79
75
  const [language = 'cn', setLanguage] = useState(getLanguage());
80
-
81
76
  const switchLanguage = () => {
82
77
  const lang = language !== 'en' ? 'en' : 'cn';
83
78
  setLanguage(lang);
84
79
  setLanguageStore(lang);
85
80
  onChange && onChange(lang);
86
81
  };
87
-
88
82
  const otherLanguage = useMemo(() => language === 'cn' ? 'en' : 'cn', [language]);
89
83
  return React.createElement(Language, {
90
84
  onClick: switchLanguage
@@ -70,22 +70,18 @@ export default (props => {
70
70
  const {
71
71
  onChange
72
72
  } = props;
73
-
74
73
  const getTheme = () => {
75
74
  let theme = getThemeStore() || props.theme || 'themeS3';
76
75
  return themes.some(({
77
76
  value
78
77
  }) => value === theme) ? theme : 'themeS3';
79
78
  };
80
-
81
79
  const [theme, setTheme] = useState(getTheme());
82
-
83
80
  const changeTheme = theme => {
84
81
  setTheme(theme);
85
82
  setThemeStore(theme);
86
83
  onChange(theme);
87
84
  };
88
-
89
85
  return React.createElement(Theme, null, React.createElement(Row, {
90
86
  type: "flex",
91
87
  justify: "space-between",
@@ -7,8 +7,8 @@ export default withTheme(props => {
7
7
  const {
8
8
  userInfo = {},
9
9
  extendMap = {}
10
- } = props; // 企业级的默认蓝色主题
11
-
10
+ } = props;
11
+ // 企业级的默认蓝色主题
12
12
  let theme = getThemeStore() || (extendMap === null || extendMap === void 0 ? void 0 : extendMap.defaultTheme) || userInfo.theme || 'themeS3';
13
13
  theme = theme === 'default' ? 'themeS3' : theme;
14
14
  const newProps = Object.assign(Object.assign({}, props), {
@@ -122,7 +122,6 @@ const ListBox = styled.ul`
122
122
  }
123
123
  }
124
124
  `;
125
-
126
125
  const SearchList = ({
127
126
  items,
128
127
  onSelectMenu,
@@ -132,7 +131,6 @@ const SearchList = ({
132
131
  }, items === null || items === void 0 ? void 0 : items.map(item => React.createElement("li", {
133
132
  onClick: () => onSelectMenu(item)
134
133
  }, item === null || item === void 0 ? void 0 : item.menuName)));
135
-
136
134
  export default (({
137
135
  theme,
138
136
  menus = [],
@@ -147,19 +145,16 @@ export default (({
147
145
  const isLevel3 = hasLevel3(menus);
148
146
  const [activeTopMenu, setActiveTopMenu] = useState(isLevel3 ? menus === null || menus === void 0 ? void 0 : menus[0] : null);
149
147
  const selectedMenuKey = actions.getSelectedMenuKey();
150
-
151
148
  const calcGroupMenus = menus => {
152
149
  menus = menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
153
- var _a; // 分组
154
-
155
-
150
+ var _a;
151
+ // 分组
156
152
  if ((_a = cur === null || cur === void 0 ? void 0 : cur.children) === null || _a === void 0 ? void 0 : _a.length) {
157
153
  acc.push(cur);
158
154
  } else {
159
155
  const defaultGroup = acc.find(({
160
156
  isDefaultGroup
161
157
  }) => isDefaultGroup);
162
-
163
158
  if (!defaultGroup) {
164
159
  acc.unshift({
165
160
  isDefaultGroup: true,
@@ -169,47 +164,36 @@ export default (({
169
164
  defaultGroup.children.push(cur);
170
165
  }
171
166
  }
172
-
173
167
  return acc;
174
168
  }, []);
175
169
  return menus === null || menus === void 0 ? void 0 : menus.reduce((acc, cur) => {
176
170
  var _a;
177
-
178
171
  const column = Math.max(1, ~~((containerRef.current.clientWidth - 32) / 210));
179
-
180
172
  if (!acc.length) {
181
173
  acc.push([cur]);
182
174
  } else {
183
175
  const calcGroupHeight = group => {
184
176
  var _a;
185
-
186
177
  return 46 + (((_a = group === null || group === void 0 ? void 0 : group.children) === null || _a === void 0 ? void 0 : _a.length) || 0) * 30;
187
178
  };
188
-
189
179
  const calcColumnHeight = columnGroups => columnGroups === null || columnGroups === void 0 ? void 0 : columnGroups.reduce((acc, cur) => {
190
180
  acc += calcGroupHeight(cur);
191
181
  return acc;
192
182
  }, 0);
193
-
194
183
  const currentColumnHeight = calcColumnHeight(acc[acc.length - 1]);
195
184
  const nextGroupHeight = calcGroupHeight(cur);
196
-
197
185
  const findMinHeightGroup = groups => {
198
186
  let minHeight = Infinity;
199
187
  let index = 0;
200
-
201
188
  for (let i = 0; i < groups.length; i++) {
202
189
  const height = calcColumnHeight(groups[i]);
203
-
204
190
  if (height < minHeight) {
205
191
  index = i;
206
192
  minHeight = height;
207
193
  }
208
194
  }
209
-
210
195
  return groups[index];
211
196
  };
212
-
213
197
  if (acc.length >= column) {
214
198
  const minHeightGroup = findMinHeightGroup(acc);
215
199
  minHeightGroup === null || minHeightGroup === void 0 ? void 0 : minHeightGroup.push(cur);
@@ -221,14 +205,11 @@ export default (({
221
205
  }
222
206
  }
223
207
  }
224
-
225
208
  return acc;
226
209
  }, []);
227
210
  };
228
-
229
211
  const groupMenus = calcGroupMenus((activeTopMenu === null || activeTopMenu === void 0 ? void 0 : activeTopMenu.children) || menus);
230
212
  const [searchedMenus, setSearchedMenus] = useState([]);
231
-
232
213
  const onMenuClick = menu => {
233
214
  actions.emit('menuSelect', {
234
215
  key: menu.code,
@@ -238,36 +219,28 @@ export default (({
238
219
  setSearchedMenus([]);
239
220
  close();
240
221
  };
241
-
242
222
  const debounceSearch = _debounce(evt => {
243
223
  var _a;
244
-
245
224
  const value = (_a = evt.target.value) === null || _a === void 0 ? void 0 : _a.trim();
246
225
  const matchedMenus = [];
247
-
248
226
  if (value) {
249
227
  traverseTree(menus, node => {
250
228
  var _a;
251
-
252
229
  if (node.path && ((_a = node === null || node === void 0 ? void 0 : node.menuName) === null || _a === void 0 ? void 0 : _a.includes(value))) {
253
230
  matchedMenus.push(node);
254
231
  }
255
232
  });
256
233
  }
257
-
258
234
  setSearchedMenus(matchedMenus);
259
235
  }, 100);
260
-
261
236
  const onSearchChange = evt => {
262
237
  evt.persist();
263
238
  setSearchValue(evt.target.value);
264
239
  debounceSearch(evt);
265
240
  };
266
-
267
241
  const onSelectAppTab = menu => {
268
242
  setActiveTopMenu(menu);
269
243
  };
270
-
271
244
  useEffect(() => {
272
245
  const clickOutside = evt => {
273
246
  const {
@@ -276,12 +249,10 @@ export default (({
276
249
  pageX,
277
250
  pageY
278
251
  } = evt;
279
-
280
252
  const isOutside = (evt, popup) => {
281
253
  if (popup === null || popup === void 0 ? void 0 : popup.contains) {
282
254
  return !(popup === null || popup === void 0 ? void 0 : popup.contains(evt.target));
283
255
  }
284
-
285
256
  let {
286
257
  x,
287
258
  y,
@@ -293,14 +264,12 @@ export default (({
293
264
  y += window.scrollY;
294
265
  return pageX < x || pageX > x + width || pageY < y || pageY > y + height;
295
266
  };
296
-
297
267
  if (isOutside(evt, popupRef.current)) {
298
268
  setSearchValue('');
299
269
  setSearchedMenus([]);
300
270
  close();
301
271
  }
302
272
  };
303
-
304
273
  document.addEventListener('click', clickOutside);
305
274
  return () => document.removeEventListener('click', clickOutside);
306
275
  }, []);
@@ -47,13 +47,11 @@ const Navigation = styled.li`
47
47
  display: none;
48
48
  }
49
49
  `;
50
-
51
50
  const createPopupContainer = () => {
52
51
  const div = document.createElement('div');
53
52
  div.setAttribute('class', 'tnt-navigation-popup');
54
53
  return div;
55
54
  };
56
-
57
55
  const GlobalStyle = createGlobalStyle`
58
56
  .tnt-navigation-popup {
59
57
  position: absolute;
@@ -87,18 +85,15 @@ export default withTheme(props => {
87
85
  const popupRef = useRef();
88
86
  useEffect(() => {
89
87
  var _a;
90
-
91
88
  popupRef.current = createPopupContainer();
92
89
  (_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(popupRef.current);
93
90
  return () => {
94
91
  var _a;
95
-
96
92
  (_a = headerRef === null || headerRef === void 0 ? void 0 : headerRef.current) === null || _a === void 0 ? void 0 : _a.removeChild(popupRef.current);
97
93
  };
98
94
  }, []);
99
95
  useEffect(() => {
100
96
  const classNames = popupRef.current.getAttribute('class').split(' ');
101
-
102
97
  if (visible) {
103
98
  ReactDOM.render(React.createElement(NavigationPopup, {
104
99
  actions: actions,
@@ -116,7 +111,6 @@ export default withTheme(props => {
116
111
  return React.createElement(Navigation, {
117
112
  onClick: evt => {
118
113
  var _a, _b;
119
-
120
114
  evt.stopPropagation();
121
115
  (_a = evt.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation();
122
116
  (_b = evt.nativeEvent) === null || _b === void 0 ? void 0 : _b.stopPropagation();
@@ -1,14 +1,11 @@
1
1
  var __rest = this && this.__rest || function (s, e) {
2
2
  var t = {};
3
-
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
5
-
6
4
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
5
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
8
6
  }
9
7
  return t;
10
8
  };
11
-
12
9
  import React from 'react';
13
10
  import styled, { withTheme } from 'styled-components';
14
11
  import Divider from '../divider';
@@ -64,35 +61,34 @@ const Actions = styled.ul`
64
61
  `;
65
62
  export default withTheme(props => {
66
63
  const {
67
- type,
68
- config: {
69
- theme = true,
70
- avatar = true,
71
- language = true,
72
- application = false,
73
- globalNavigation = false
74
- } = {},
75
- theme: {
76
- compatible
77
- },
78
- userInfo = {},
79
- menus,
80
- apps,
81
- extraActions,
82
- headerRef,
83
- onLanguageChange,
84
- onThemeChange,
85
- onApplicationChange,
86
- onAppChange,
87
- onCollapseChange,
88
- onPersonalSetting,
89
- onChangePassword,
90
- onLogout,
91
- onLogoClick,
92
- AvatarCustom
93
- } = props,
94
- rest = __rest(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
95
-
64
+ type,
65
+ config: {
66
+ theme = true,
67
+ avatar = true,
68
+ language = true,
69
+ application = false,
70
+ globalNavigation = false
71
+ } = {},
72
+ theme: {
73
+ compatible
74
+ },
75
+ userInfo = {},
76
+ menus,
77
+ apps,
78
+ extraActions,
79
+ headerRef,
80
+ onLanguageChange,
81
+ onThemeChange,
82
+ onApplicationChange,
83
+ onAppChange,
84
+ onCollapseChange,
85
+ onPersonalSetting,
86
+ onChangePassword,
87
+ onLogout,
88
+ onLogoClick,
89
+ AvatarCustom
90
+ } = props,
91
+ rest = __rest(props, ["type", "config", "theme", "userInfo", "menus", "apps", "extraActions", "headerRef", "onLanguageChange", "onThemeChange", "onApplicationChange", "onAppChange", "onCollapseChange", "onPersonalSetting", "onChangePassword", "onLogout", "onLogoClick", "AvatarCustom"]);
96
92
  return React.createElement(Actions, Object.assign({}, rest), extraActions, globalNavigation && React.createElement(GlobalNavigation, {
97
93
  headerRef: headerRef,
98
94
  menus: menus
@@ -1,16 +1,12 @@
1
1
  import _get from "lodash/get";
2
-
3
2
  var __rest = this && this.__rest || function (s, e) {
4
3
  var t = {};
5
-
6
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
7
-
8
5
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
6
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
7
  }
11
8
  return t;
12
9
  };
13
-
14
10
  import React, { useState, useEffect } from 'react';
15
11
  import styled, { withTheme } from 'styled-components';
16
12
  import cn from 'classnames';
@@ -67,25 +63,21 @@ const NavItem = styled.li`
67
63
  `;
68
64
  export const HeaderNavs = withTheme(_a => {
69
65
  var {
70
- theme,
71
- navs = [],
72
- onChange,
73
- onSelect
74
- } = _a,
75
- props = __rest(_a, ["theme", "navs", "onChange", "onSelect"]);
76
-
66
+ theme,
67
+ navs = [],
68
+ onChange,
69
+ onSelect
70
+ } = _a,
71
+ props = __rest(_a, ["theme", "navs", "onChange", "onSelect"]);
77
72
  const [selectedKey, setSelectedKey] = useState(props.selectedKey || _get(navs, '0.key'));
78
-
79
73
  const onClickNav = nav => {
80
74
  setSelectedKey(nav.key);
81
75
  onSelect && onSelect(nav);
82
-
83
76
  if (selectedKey !== nav.key) {
84
77
  onChange && onChange(nav);
85
78
  setSelectedKey(nav.key);
86
79
  }
87
80
  };
88
-
89
81
  useEffect(() => {
90
82
  setSelectedKey(props.selectedKey || _get(navs, '0.key'));
91
83
  }, [navs, props.selectedKey]);