tntd 1.4.9 → 1.4.11

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 (47) hide show
  1. package/components/Layout/AppList.js +1 -1
  2. package/components/Layout/GlobalNavigation/NavigationPopup.js +8 -8
  3. package/components/Layout/GlobalNavigation/index.js +2 -2
  4. package/components/Layout/HeaderTabs.js +98 -73
  5. package/components/Layout/OrgAppList.js +14 -15
  6. package/components/Layout/SideMenu.js +2 -2
  7. package/components/Layout/index.js +4 -5
  8. package/components/Layout/paaslayout/CompactSideMenu.js +1 -1
  9. package/components/Layout/paaslayout/index.js +2 -2
  10. package/components/Layout/storage.js +1 -1
  11. package/components/index.js +1 -0
  12. package/components/{Layout → utils}/checkAuth.js +3 -1
  13. package/components/utils/findMenuInfoByPath.js +39 -0
  14. package/components/{Layout/utils.js → utils/index.js} +3 -35
  15. package/dist/stats.json +9824 -9578
  16. package/dist/tntd.js +1 -1
  17. package/es/Layout/AppList.js +1 -1
  18. package/es/Layout/GlobalNavigation/NavigationPopup.js +1 -1
  19. package/es/Layout/GlobalNavigation/index.js +1 -1
  20. package/es/Layout/HeaderTabs.js +19 -15
  21. package/es/Layout/OrgAppList.js +3 -4
  22. package/es/Layout/SideMenu.js +1 -1
  23. package/es/Layout/index.js +5 -4
  24. package/es/Layout/paaslayout/CompactSideMenu.js +1 -1
  25. package/es/Layout/paaslayout/index.js +1 -1
  26. package/es/Layout/storage.js +1 -1
  27. package/es/index.js +2 -1
  28. package/es/utils/checkAuth.js +30 -0
  29. package/es/utils/findMenuInfoByPath.js +41 -0
  30. package/es/utils/index.js +99 -0
  31. package/lib/Layout/AppList.js +1 -1
  32. package/lib/Layout/GlobalNavigation/NavigationPopup.js +1 -1
  33. package/lib/Layout/GlobalNavigation/index.js +1 -1
  34. package/lib/Layout/HeaderTabs.js +14 -10
  35. package/lib/Layout/OrgAppList.js +5 -6
  36. package/lib/Layout/SideMenu.js +1 -1
  37. package/lib/Layout/index.js +6 -6
  38. package/lib/Layout/paaslayout/CompactSideMenu.js +1 -1
  39. package/lib/Layout/paaslayout/index.js +1 -1
  40. package/lib/Layout/storage.js +1 -1
  41. package/lib/index.js +34 -0
  42. package/lib/utils/checkAuth.js +41 -0
  43. package/lib/utils/findMenuInfoByPath.js +52 -0
  44. package/lib/utils/index.js +159 -0
  45. package/package.json +1 -1
  46. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  47. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
@@ -1,3 +1,6 @@
1
+ export * from './checkAuth';
2
+ export * from './findMenuInfoByPath';
3
+
1
4
  export const isGroupMenu = menu => menu?.children && !menu?.path;
2
5
 
3
6
  export const getSelectedMenuInfo = (selectedKey, menus = []) => {
@@ -32,41 +35,6 @@ export const getSelectedMenuInfo = (selectedKey, menus = []) => {
32
35
  };
33
36
  };
34
37
 
35
- export const findMenuInfoByPath = (menuTree, path, matchFunc) => {
36
- let menu;
37
- let subMenu;
38
- let matchedSubMenu;
39
- let parentMenus;
40
-
41
- if (path) {
42
- traverseTree(menuTree, (menu, pnode, pnodes) => {
43
- if (!isGroupMenu(menu)) {
44
- if (menu?.path === path) {
45
- subMenu = menu;
46
- menu = pnode;
47
- parentMenus = pnodes;
48
- return false;
49
- }
50
-
51
- if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
52
- matchedSubMenu = menu;
53
- menu = pnode;
54
- parentMenus = pnodes;
55
- }
56
- }
57
- });
58
-
59
- return {
60
- subMenu,
61
- matchedSubMenu,
62
- menu,
63
- parentMenus
64
- };
65
- }
66
-
67
- return { subMenu, menu, parentMenus };
68
- };
69
-
70
38
  export const hasLevel3 = menus => {
71
39
  return menus?.some(
72
40
  menu => menu?.children?.some(item => item?.children?.length)