tntd 1.4.20 → 1.4.21

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 (163) hide show
  1. package/components/Handle/README.md +0 -20
  2. package/components/Handle/index.js +27 -6
  3. package/components/locale.js +8 -2
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +23819 -24067
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +13 -8
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +108 -76
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +38 -31
  12. package/es/DevelopmentLogin/LoginModal.js +45 -32
  13. package/es/DevelopmentLogin/index.js +17 -13
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +69 -58
  17. package/es/Handle/README.md +0 -20
  18. package/es/Handle/index.js +67 -32
  19. package/es/Icon/fonts/iconfont.js +12 -7
  20. package/es/Icon/index.js +13 -10
  21. package/es/Img/Contain.js +29 -24
  22. package/es/Img/Cover.js +54 -40
  23. package/es/Img/index.js +45 -36
  24. package/es/Layout/ActionsContext.js +2 -3
  25. package/es/Layout/AppList.js +92 -37
  26. package/es/Layout/Application.js +72 -26
  27. package/es/Layout/Avatar.js +66 -29
  28. package/es/Layout/CompatibleLanguage.js +94 -39
  29. package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
  30. package/es/Layout/EnterpriseLayout/Language.js +32 -14
  31. package/es/Layout/EnterpriseLayout/Theme.js +34 -16
  32. package/es/Layout/EnterpriseLayout/index.js +16 -14
  33. package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
  34. package/es/Layout/GlobalNavigation/index.js +54 -20
  35. package/es/Layout/Header.js +46 -25
  36. package/es/Layout/HeaderActions.js +56 -42
  37. package/es/Layout/HeaderNavs.js +47 -20
  38. package/es/Layout/HeaderTabs.js +102 -49
  39. package/es/Layout/Iconfont.js +1 -1
  40. package/es/Layout/Language.js +32 -14
  41. package/es/Layout/Layout.js +108 -86
  42. package/es/Layout/Logo.js +32 -16
  43. package/es/Layout/OrgAppList.js +107 -62
  44. package/es/Layout/SideMenu.js +124 -63
  45. package/es/Layout/Theme.js +61 -23
  46. package/es/Layout/checkAuth.js +29 -0
  47. package/es/Layout/index.js +34 -26
  48. package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
  49. package/es/Layout/paaslayout/Header.js +45 -22
  50. package/es/Layout/paaslayout/Logo.js +13 -3
  51. package/es/Layout/paaslayout/SideMenu.js +78 -39
  52. package/es/Layout/paaslayout/index.js +102 -75
  53. package/es/Layout/storage.js +9 -10
  54. package/es/Layout/utils.js +136 -0
  55. package/es/LoadingButton/index.js +24 -15
  56. package/es/Modal/index.js +46 -38
  57. package/es/Page/Box.js +41 -34
  58. package/es/Page/index.js +67 -52
  59. package/es/Page/utils.js +5 -0
  60. package/es/QueryForm/Field/Checkbox.js +9 -5
  61. package/es/QueryForm/Field/Select.js +41 -31
  62. package/es/QueryForm/Field/SelectInput.js +41 -26
  63. package/es/QueryForm/Field/fieldsMap.js +1 -0
  64. package/es/QueryForm/Field/index.js +71 -41
  65. package/es/QueryForm/createActions.js +7 -6
  66. package/es/QueryForm/index.js +135 -76
  67. package/es/QueryListScene/List.js +128 -74
  68. package/es/QueryListScene/QueryForm.js +81 -46
  69. package/es/QueryListScene/QueryListScene.js +40 -25
  70. package/es/QueryListScene/Title.js +3 -3
  71. package/es/QueryListScene/Toolbar.js +12 -11
  72. package/es/Select/DropDownWrap.js +50 -29
  73. package/es/Select/index.js +231 -135
  74. package/es/Table/ResizableTable/index.js +40 -26
  75. package/es/Table/index.js +16 -18
  76. package/es/Title/index.js +23 -21
  77. package/es/locale.js +11 -3
  78. package/es/utils/checkAuth.js +5 -3
  79. package/es/utils/findMenuInfoByPath.js +4 -0
  80. package/es/utils/index.js +23 -12
  81. package/lib/ArrayInput/icon.js +6 -6
  82. package/lib/ArrayInput/index.js +127 -78
  83. package/lib/AuthContext.js +4 -1
  84. package/lib/Columns/index.js +47 -31
  85. package/lib/DevelopmentLogin/LoginModal.js +58 -32
  86. package/lib/DevelopmentLogin/index.js +27 -16
  87. package/lib/Ellipsis/Svg/CopySVG.js +15 -13
  88. package/lib/Ellipsis/Svg/TickSVG.js +10 -8
  89. package/lib/Ellipsis/index.js +80 -57
  90. package/lib/Handle/README.md +0 -20
  91. package/lib/Handle/index.js +80 -32
  92. package/lib/Icon/fonts/iconfont.js +12 -7
  93. package/lib/Icon/index.js +20 -11
  94. package/lib/Img/Contain.js +34 -24
  95. package/lib/Img/Cover.js +65 -42
  96. package/lib/Img/index.js +51 -36
  97. package/lib/Layout/ActionsContext.js +4 -1
  98. package/lib/Layout/AppList.js +118 -40
  99. package/lib/Layout/Application.js +86 -26
  100. package/lib/Layout/Avatar.js +86 -32
  101. package/lib/Layout/CompatibleLanguage.js +110 -39
  102. package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
  103. package/lib/Layout/EnterpriseLayout/Header.js +113 -0
  104. package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
  105. package/lib/Layout/EnterpriseLayout/Language.js +48 -17
  106. package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
  107. package/lib/Layout/EnterpriseLayout/index.js +23 -14
  108. package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
  109. package/lib/Layout/GlobalNavigation/index.js +74 -23
  110. package/lib/Layout/Header.js +63 -28
  111. package/lib/Layout/HeaderActions.js +74 -45
  112. package/lib/Layout/HeaderNavs.js +61 -23
  113. package/lib/Layout/HeaderTabs.js +118 -51
  114. package/lib/Layout/Iconfont.js +5 -1
  115. package/lib/Layout/Language.js +48 -17
  116. package/lib/Layout/Layout.js +128 -88
  117. package/lib/Layout/Logo.js +43 -19
  118. package/lib/Layout/OrgAppList.js +127 -64
  119. package/lib/Layout/SideMenu.js +143 -65
  120. package/lib/Layout/Theme.js +73 -23
  121. package/lib/Layout/checkAuth.js +39 -0
  122. package/lib/Layout/createActions.js +5 -0
  123. package/lib/Layout/images/index.js +28 -0
  124. package/lib/Layout/index.js +55 -30
  125. package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
  126. package/lib/Layout/paaslayout/Header.js +55 -22
  127. package/lib/Layout/paaslayout/Logo.js +19 -3
  128. package/lib/Layout/paaslayout/SideMenu.js +87 -39
  129. package/lib/Layout/paaslayout/index.js +122 -77
  130. package/lib/Layout/storage.js +40 -11
  131. package/lib/Layout/utils.js +166 -0
  132. package/lib/LoadingButton/index.js +29 -15
  133. package/lib/Modal/index.js +53 -38
  134. package/lib/Page/Box.js +45 -34
  135. package/lib/Page/index.js +77 -52
  136. package/lib/Page/utils.js +9 -1
  137. package/lib/QueryForm/Field/Checkbox.js +13 -5
  138. package/lib/QueryForm/Field/Select.js +53 -33
  139. package/lib/QueryForm/Field/SelectInput.js +56 -28
  140. package/lib/QueryForm/Field/fieldsMap.js +15 -1
  141. package/lib/QueryForm/Field/index.js +81 -43
  142. package/lib/QueryForm/createActions.js +12 -6
  143. package/lib/QueryForm/index.js +157 -78
  144. package/lib/QueryForm/useForm.js +5 -0
  145. package/lib/QueryListScene/List.js +140 -76
  146. package/lib/QueryListScene/QueryForm.js +86 -46
  147. package/lib/QueryListScene/QueryListScene.js +46 -25
  148. package/lib/QueryListScene/Title.js +7 -3
  149. package/lib/QueryListScene/Toolbar.js +16 -11
  150. package/lib/QueryListScene/createActions.js +5 -0
  151. package/lib/QueryListScene/index.js +10 -0
  152. package/lib/QueryListScene/useActions.js +5 -0
  153. package/lib/Select/DropDownWrap.js +56 -31
  154. package/lib/Select/index.js +241 -135
  155. package/lib/Table/ResizableTable/index.js +48 -26
  156. package/lib/Table/index.js +28 -17
  157. package/lib/Title/index.js +28 -21
  158. package/lib/index.js +56 -35
  159. package/lib/locale.js +19 -4
  160. package/lib/utils/checkAuth.js +9 -4
  161. package/lib/utils/findMenuInfoByPath.js +8 -1
  162. package/lib/utils/index.js +42 -15
  163. package/package.json +2 -2
@@ -3,23 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findMenuInfoByPath = exports["default"] = void 0;
6
+ exports["default"] = exports.findMenuInfoByPath = void 0;
7
+
7
8
  var _ = require(".");
9
+
8
10
  var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
9
11
  var menu;
10
12
  var subMenu;
11
13
  var matchedSubMenu;
12
14
  var parentMenus;
15
+
13
16
  if (path) {
14
17
  (0, _.traverseTree)(menuTree, function (menu, pnode, pnodes) {
15
18
  if (!(0, _.isGroupMenu)(menu)) {
16
19
  var _menu;
20
+
17
21
  if (((_menu = menu) == null ? void 0 : _menu.path) === path) {
18
22
  subMenu = menu;
19
23
  menu = pnode;
20
24
  parentMenus = pnodes;
21
25
  return false;
22
26
  }
27
+
23
28
  if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
24
29
  matchedSubMenu = menu;
25
30
  menu = pnode;
@@ -34,12 +39,14 @@ var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc)
34
39
  parentMenus: parentMenus
35
40
  };
36
41
  }
42
+
37
43
  return {
38
44
  subMenu: subMenu,
39
45
  menu: menu,
40
46
  parentMenus: parentMenus
41
47
  };
42
48
  };
49
+
43
50
  exports.findMenuInfoByPath = findMenuInfoByPath;
44
51
  var _default = findMenuInfoByPath;
45
52
  exports["default"] = _default;
@@ -12,12 +12,13 @@ var _exportNames = {
12
12
  traverseTree: true,
13
13
  safeParseJSON: true
14
14
  };
15
- exports.traverseTree = exports.safeParseJSON = exports.openInNewTab = exports.isNewTabMenu = exports.isGroupMenu = exports.hasLevel3 = exports.getSelectedMenuInfo = void 0;
15
+ exports.safeParseJSON = exports.traverseTree = exports.openInNewTab = exports.isNewTabMenu = exports.hasLevel3 = exports.getSelectedMenuInfo = exports.isGroupMenu = void 0;
16
+
16
17
  var _checkAuth = require("./checkAuth");
18
+
17
19
  Object.keys(_checkAuth).forEach(function (key) {
18
20
  if (key === "default" || key === "__esModule") return;
19
21
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
- if (key in exports && exports[key] === _checkAuth[key]) return;
21
22
  Object.defineProperty(exports, key, {
22
23
  enumerable: true,
23
24
  get: function get() {
@@ -25,11 +26,12 @@ Object.keys(_checkAuth).forEach(function (key) {
25
26
  }
26
27
  });
27
28
  });
29
+
28
30
  var _findMenuInfoByPath = require("./findMenuInfoByPath");
31
+
29
32
  Object.keys(_findMenuInfoByPath).forEach(function (key) {
30
33
  if (key === "default" || key === "__esModule") return;
31
34
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _findMenuInfoByPath[key]) return;
33
35
  Object.defineProperty(exports, key, {
34
36
  enumerable: true,
35
37
  get: function get() {
@@ -37,21 +39,27 @@ Object.keys(_findMenuInfoByPath).forEach(function (key) {
37
39
  }
38
40
  });
39
41
  });
40
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
41
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
42
- 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); }
43
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
44
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
45
- 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; }
42
+
43
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
44
+
45
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
46
+
47
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
48
+
49
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
50
+
46
51
  var isGroupMenu = function isGroupMenu(menu) {
47
- return (menu == null ? void 0 : menu.children) && !(menu != null && menu.path);
52
+ return (menu == null ? void 0 : menu.children) && !(menu == null ? void 0 : menu.path);
48
53
  };
54
+
49
55
  exports.isGroupMenu = isGroupMenu;
56
+
50
57
  var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
51
58
  var menus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
52
59
  var subMenu;
53
60
  var menu;
54
61
  var parentMenus = [];
62
+
55
63
  if (selectedKey) {
56
64
  traverseTree(menus, function (node, pnode, pnodes) {
57
65
  if (!isGroupMenu(node) && node.code === selectedKey) {
@@ -72,61 +80,80 @@ var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
72
80
  }
73
81
  });
74
82
  }
83
+
75
84
  return {
76
85
  subMenu: subMenu,
77
86
  menu: menu,
78
87
  parentMenus: parentMenus
79
88
  };
80
89
  };
90
+
81
91
  exports.getSelectedMenuInfo = getSelectedMenuInfo;
92
+
82
93
  var hasLevel3 = function hasLevel3(menus) {
83
94
  return menus == null ? void 0 : menus.some(function (menu) {
84
95
  var _menu$children;
96
+
85
97
  return menu == null ? void 0 : (_menu$children = menu.children) == null ? void 0 : _menu$children.some(function (item) {
86
98
  var _item$children;
99
+
87
100
  return item == null ? void 0 : (_item$children = item.children) == null ? void 0 : _item$children.length;
88
101
  });
89
102
  });
90
103
  };
104
+
91
105
  exports.hasLevel3 = hasLevel3;
106
+
92
107
  var isNewTabMenu = function isNewTabMenu(menu) {
93
108
  var _ref = menu || {},
94
- target = _ref.target,
95
- path = _ref.path;
109
+ target = _ref.target,
110
+ path = _ref.path;
111
+
96
112
  return target === '_blank' || /^http/i.test(path) && /blankType=newTarget/.test(path);
97
113
  };
114
+
98
115
  exports.isNewTabMenu = isNewTabMenu;
116
+
99
117
  var openInNewTab = function openInNewTab(path) {
100
118
  window.open(path, '_blank');
101
119
  };
120
+
102
121
  exports.openInNewTab = openInNewTab;
122
+
103
123
  var traverseTree = function traverseTree(treeData, callback, pnode) {
104
124
  var pnodes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
105
125
  (treeData || []).every(function (node, index) {
106
126
  var result;
127
+
107
128
  if (callback) {
108
- result = callback(node, pnode, pnodes != null && pnodes.length ? pnodes : [pnode].filter(function (item) {
129
+ result = callback(node, pnode, (pnodes == null ? void 0 : pnodes.length) ? pnodes : [pnode].filter(function (item) {
109
130
  return !!item;
110
131
  }), index);
111
- }
132
+ } // 回调函数返回false则终止遍历
133
+
112
134
 
113
- // 回调函数返回false则终止遍历
114
135
  if (result !== false) {
115
136
  node && traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
116
137
  }
138
+
117
139
  return result !== false;
118
140
  });
119
141
  return treeData;
120
142
  };
143
+
121
144
  exports.traverseTree = traverseTree;
145
+
122
146
  var safeParseJSON = function safeParseJSON(str, defaultObj) {
123
147
  var result;
148
+
124
149
  try {
125
150
  result = JSON.parse(str);
126
151
  } catch (err) {
127
152
  console.warn('json parse error:', err);
128
153
  result = typeof defaultObj === 'undefined' ? str : defaultObj;
129
154
  }
155
+
130
156
  return result || defaultObj;
131
157
  };
158
+
132
159
  exports.safeParseJSON = safeParseJSON;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "1.4.20",
3
+ "version": "1.4.21",
4
4
  "description": "ued tnt design",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -73,4 +73,4 @@
73
73
  "react-resizable": "^1.11.1",
74
74
  "styled-components": "^5.3.0"
75
75
  }
76
- }
76
+ }