tntd 1.4.32 → 1.4.33-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/components/Ellipsis/index.js +47 -15
  2. package/components/QueryListScene/QueryForm.js +4 -4
  3. package/components/QueryListScene/createActions.js +4 -4
  4. package/dist/1.tntd.js +1 -1
  5. package/dist/stats.json +24089 -23289
  6. package/dist/tntd.css +1 -1
  7. package/dist/tntd.js +7 -10
  8. package/es/ArrayInput/icon.js +5 -5
  9. package/es/ArrayInput/index.js +79 -111
  10. package/es/AuthContext.js +1 -1
  11. package/es/Columns/index.js +33 -40
  12. package/es/DevelopmentLogin/LoginModal.js +33 -46
  13. package/es/DevelopmentLogin/index.js +14 -18
  14. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  15. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  16. package/es/Ellipsis/index.js +100 -79
  17. package/es/Handle/index.js +46 -64
  18. package/es/Icon/fonts/iconfont.js +7 -12
  19. package/es/Icon/index.js +12 -15
  20. package/es/Img/Contain.js +26 -31
  21. package/es/Img/Cover.js +43 -57
  22. package/es/Img/index.js +39 -48
  23. package/es/Layout/ActionsContext.js +3 -2
  24. package/es/Layout/AppList.js +39 -94
  25. package/es/Layout/Application.js +28 -74
  26. package/es/Layout/Avatar.js +30 -67
  27. package/es/Layout/CompatibleLanguage.js +41 -96
  28. package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
  29. package/es/Layout/EnterpriseLayout/Language.js +16 -34
  30. package/es/Layout/EnterpriseLayout/Theme.js +18 -36
  31. package/es/Layout/EnterpriseLayout/index.js +14 -16
  32. package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
  33. package/es/Layout/GlobalNavigation/index.js +22 -56
  34. package/es/Layout/Header.js +26 -47
  35. package/es/Layout/HeaderActions.js +45 -59
  36. package/es/Layout/HeaderNavs.js +24 -51
  37. package/es/Layout/HeaderTabs.js +53 -106
  38. package/es/Layout/Iconfont.js +1 -1
  39. package/es/Layout/Language.js +16 -34
  40. package/es/Layout/Layout.js +88 -110
  41. package/es/Layout/Logo.js +17 -33
  42. package/es/Layout/OrgAppList.js +64 -109
  43. package/es/Layout/SideMenu.js +67 -128
  44. package/es/Layout/Theme.js +25 -63
  45. package/es/Layout/index.js +28 -37
  46. package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
  47. package/es/Layout/paaslayout/Header.js +23 -46
  48. package/es/Layout/paaslayout/Logo.js +4 -14
  49. package/es/Layout/paaslayout/SideMenu.js +41 -80
  50. package/es/Layout/paaslayout/index.js +77 -104
  51. package/es/Layout/storage.js +10 -9
  52. package/es/LoadingButton/index.js +18 -27
  53. package/es/Modal/index.js +42 -51
  54. package/es/Page/Box.js +36 -43
  55. package/es/Page/index.js +56 -71
  56. package/es/Page/utils.js +0 -5
  57. package/es/QueryForm/Field/Checkbox.js +7 -11
  58. package/es/QueryForm/Field/Select.js +34 -44
  59. package/es/QueryForm/Field/SelectInput.js +31 -46
  60. package/es/QueryForm/Field/fieldsMap.js +0 -1
  61. package/es/QueryForm/Field/index.js +46 -78
  62. package/es/QueryForm/createActions.js +6 -7
  63. package/es/QueryForm/index.js +79 -140
  64. package/es/QueryListScene/List.js +83 -139
  65. package/es/QueryListScene/QueryForm.js +54 -91
  66. package/es/QueryListScene/QueryListScene.js +29 -47
  67. package/es/QueryListScene/Title.js +3 -3
  68. package/es/QueryListScene/Toolbar.js +13 -14
  69. package/es/QueryListScene/createActions.js +4 -4
  70. package/es/Select/DropDownWrap.js +32 -55
  71. package/es/Select/index.js +140 -232
  72. package/es/Table/ResizableTable/index.js +29 -43
  73. package/es/Table/index.js +20 -19
  74. package/es/Title/index.js +23 -25
  75. package/es/locale.js +1 -5
  76. package/es/utils/checkAuth.js +6 -8
  77. package/es/utils/findMenuInfoByPath.js +0 -4
  78. package/es/utils/index.js +17 -27
  79. package/lib/ArrayInput/icon.js +7 -9
  80. package/lib/ArrayInput/index.js +82 -131
  81. package/lib/AuthContext.js +2 -6
  82. package/lib/Columns/index.js +36 -54
  83. package/lib/DevelopmentLogin/LoginModal.js +36 -63
  84. package/lib/DevelopmentLogin/index.js +21 -31
  85. package/lib/Ellipsis/Svg/CopySVG.js +15 -18
  86. package/lib/Ellipsis/Svg/TickSVG.js +10 -13
  87. package/lib/Ellipsis/index.js +105 -93
  88. package/lib/Handle/index.js +51 -87
  89. package/lib/Icon/fonts/iconfont.js +7 -12
  90. package/lib/Icon/iconList.js +1 -2
  91. package/lib/Icon/index.js +16 -26
  92. package/lib/Img/Contain.js +29 -40
  93. package/lib/Img/Cover.js +48 -72
  94. package/lib/Img/index.js +42 -58
  95. package/lib/Layout/ActionsContext.js +1 -5
  96. package/lib/Layout/AppList.js +45 -124
  97. package/lib/Layout/Application.js +31 -92
  98. package/lib/Layout/Avatar.js +36 -91
  99. package/lib/Layout/CompatibleLanguage.js +44 -116
  100. package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
  101. package/lib/Layout/EnterpriseLayout/Language.js +22 -54
  102. package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
  103. package/lib/Layout/EnterpriseLayout/index.js +17 -27
  104. package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
  105. package/lib/Layout/GlobalNavigation/index.js +28 -80
  106. package/lib/Layout/Header.js +36 -68
  107. package/lib/Layout/HeaderActions.js +51 -81
  108. package/lib/Layout/HeaderNavs.js +30 -70
  109. package/lib/Layout/HeaderTabs.js +58 -127
  110. package/lib/Layout/Iconfont.js +4 -9
  111. package/lib/Layout/Language.js +22 -54
  112. package/lib/Layout/Layout.js +93 -134
  113. package/lib/Layout/Logo.js +26 -47
  114. package/lib/Layout/OrgAppList.js +69 -133
  115. package/lib/Layout/SideMenu.js +72 -151
  116. package/lib/Layout/Theme.js +28 -79
  117. package/lib/Layout/createActions.js +3 -9
  118. package/lib/Layout/images/index.js +5 -36
  119. package/lib/Layout/index.js +35 -63
  120. package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
  121. package/lib/Layout/paaslayout/Header.js +30 -60
  122. package/lib/Layout/paaslayout/Logo.js +11 -24
  123. package/lib/Layout/paaslayout/SideMenu.js +44 -93
  124. package/lib/Layout/paaslayout/index.js +82 -128
  125. package/lib/Layout/storage.js +26 -68
  126. package/lib/LoadingButton/index.js +21 -36
  127. package/lib/Modal/index.js +45 -62
  128. package/lib/Page/Box.js +38 -50
  129. package/lib/Page/index.js +58 -84
  130. package/lib/Page/utils.js +5 -16
  131. package/lib/QueryForm/Field/Checkbox.js +10 -19
  132. package/lib/QueryForm/Field/Select.js +39 -60
  133. package/lib/QueryForm/Field/SelectInput.js +36 -65
  134. package/lib/QueryForm/Field/fieldsMap.js +6 -23
  135. package/lib/QueryForm/Field/index.js +50 -91
  136. package/lib/QueryForm/createActions.js +9 -16
  137. package/lib/QueryForm/index.js +83 -165
  138. package/lib/QueryForm/useForm.js +1 -6
  139. package/lib/QueryListScene/List.js +89 -153
  140. package/lib/QueryListScene/QueryForm.js +58 -101
  141. package/lib/QueryListScene/QueryListScene.js +31 -56
  142. package/lib/QueryListScene/Title.js +6 -11
  143. package/lib/QueryListScene/Toolbar.js +16 -22
  144. package/lib/QueryListScene/createActions.js +7 -13
  145. package/lib/QueryListScene/index.js +5 -19
  146. package/lib/QueryListScene/useActions.js +1 -6
  147. package/lib/Select/DropDownWrap.js +35 -63
  148. package/lib/Select/index.js +142 -245
  149. package/lib/Table/ResizableTable/index.js +31 -54
  150. package/lib/Table/index.js +21 -34
  151. package/lib/Title/index.js +26 -34
  152. package/lib/index.js +36 -57
  153. package/lib/locale.js +9 -25
  154. package/lib/utils/checkAuth.js +9 -16
  155. package/lib/utils/findMenuInfoByPath.js +3 -12
  156. package/lib/utils/index.js +26 -60
  157. package/package.json +3 -2
@@ -3,22 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports.getCheckAuth = void 0;
7
-
6
+ exports.getCheckAuth = exports["default"] = void 0;
8
7
  var _lodash = require("lodash");
9
-
10
- var getCheckAuth = function getCheckAuth(menus) {
11
- var getAuthMap = function getAuthMap() {
8
+ var getCheckAuth = exports.getCheckAuth = function getCheckAuth(menus) {
9
+ var _getAuthMap = function getAuthMap() {
12
10
  var menus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
13
11
  var authMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
14
12
  return menus.reduce(function (acc, _ref) {
15
13
  var code = _ref.code,
16
- groupName = _ref.groupName,
17
- functionList = _ref.functionList,
18
- children = _ref.children;
19
-
14
+ groupName = _ref.groupName,
15
+ functionList = _ref.functionList,
16
+ children = _ref.children;
20
17
  if (groupName) {
21
- return getAuthMap(children, acc);
18
+ return _getAuthMap(children, acc);
22
19
  } else {
23
20
  acc[code] = acc[code] || {};
24
21
  acc[code] = (functionList || []).reduce(function (acc, curFunc) {
@@ -29,13 +26,9 @@ var getCheckAuth = function getCheckAuth(menus) {
29
26
  }
30
27
  }, authMap);
31
28
  };
32
-
33
- var authMap = getAuthMap(menus);
29
+ var authMap = _getAuthMap(menus);
34
30
  return function (menuCode, funCode) {
35
31
  return !!(0, _lodash.get)(authMap, "".concat(menuCode).concat(funCode ? ".".concat(funCode) : ''));
36
32
  };
37
33
  };
38
-
39
- exports.getCheckAuth = getCheckAuth;
40
- var _default = getCheckAuth;
41
- exports["default"] = _default;
34
+ var _default = exports["default"] = getCheckAuth;
@@ -3,28 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports.findMenuInfoByPath = void 0;
7
-
6
+ exports.findMenuInfoByPath = exports["default"] = void 0;
8
7
  var _ = require(".");
9
-
10
- var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
8
+ var findMenuInfoByPath = exports.findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc) {
11
9
  var menu;
12
10
  var subMenu;
13
11
  var matchedSubMenu;
14
12
  var parentMenus;
15
-
16
13
  if (path) {
17
14
  (0, _.traverseTree)(menuTree, function (menu, pnode, pnodes) {
18
15
  if (!(0, _.isGroupMenu)(menu)) {
19
16
  var _menu;
20
-
21
17
  if (((_menu = menu) == null ? void 0 : _menu.path) === path) {
22
18
  subMenu = menu;
23
19
  menu = pnode;
24
20
  parentMenus = pnodes;
25
21
  return false;
26
22
  }
27
-
28
23
  if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
29
24
  matchedSubMenu = menu;
30
25
  menu = pnode;
@@ -39,14 +34,10 @@ var findMenuInfoByPath = function findMenuInfoByPath(menuTree, path, matchFunc)
39
34
  parentMenus: parentMenus
40
35
  };
41
36
  }
42
-
43
37
  return {
44
38
  subMenu: subMenu,
45
39
  menu: menu,
46
40
  parentMenus: parentMenus
47
41
  };
48
42
  };
49
-
50
- exports.findMenuInfoByPath = findMenuInfoByPath;
51
- var _default = findMenuInfoByPath;
52
- exports["default"] = _default;
43
+ var _default = exports["default"] = findMenuInfoByPath;
@@ -12,13 +12,12 @@ var _exportNames = {
12
12
  traverseTree: true,
13
13
  safeParseJSON: true
14
14
  };
15
- exports.safeParseJSON = exports.traverseTree = exports.openInNewTab = exports.isNewTabMenu = exports.hasLevel3 = exports.getSelectedMenuInfo = exports.isGroupMenu = void 0;
16
-
15
+ exports.traverseTree = exports.safeParseJSON = exports.openInNewTab = exports.isNewTabMenu = exports.isGroupMenu = exports.hasLevel3 = exports.getSelectedMenuInfo = void 0;
17
16
  var _checkAuth = require("./checkAuth");
18
-
19
17
  Object.keys(_checkAuth).forEach(function (key) {
20
18
  if (key === "default" || key === "__esModule") return;
21
19
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
+ if (key in exports && exports[key] === _checkAuth[key]) return;
22
21
  Object.defineProperty(exports, key, {
23
22
  enumerable: true,
24
23
  get: function get() {
@@ -26,12 +25,11 @@ Object.keys(_checkAuth).forEach(function (key) {
26
25
  }
27
26
  });
28
27
  });
29
-
30
28
  var _findMenuInfoByPath = require("./findMenuInfoByPath");
31
-
32
29
  Object.keys(_findMenuInfoByPath).forEach(function (key) {
33
30
  if (key === "default" || key === "__esModule") return;
34
31
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
+ if (key in exports && exports[key] === _findMenuInfoByPath[key]) return;
35
33
  Object.defineProperty(exports, key, {
36
34
  enumerable: true,
37
35
  get: function get() {
@@ -39,29 +37,22 @@ Object.keys(_findMenuInfoByPath).forEach(function (key) {
39
37
  }
40
38
  });
41
39
  });
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
-
51
- var isGroupMenu = function isGroupMenu(menu) {
52
- return (menu == null ? void 0 : menu.children) && !(menu == null ? void 0 : menu.path);
40
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
43
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
44
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
45
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
46
+ var isGroupMenu = exports.isGroupMenu = function isGroupMenu(menu) {
47
+ return (menu == null ? void 0 : menu.children) && !(menu != null && menu.path);
53
48
  };
54
-
55
- exports.isGroupMenu = isGroupMenu;
56
-
57
- var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
49
+ var getSelectedMenuInfo = exports.getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
58
50
  var menus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
59
51
  var subMenu;
60
52
  var menu;
61
53
  var parentMenus = [];
62
-
63
54
  if (selectedKey) {
64
- traverseTree(menus, function (node, pnode, pnodes) {
55
+ _traverseTree(menus, function (node, pnode, pnodes) {
65
56
  if (!isGroupMenu(node) && node.code === selectedKey) {
66
57
  subMenu = node;
67
58
  menu = pnode;
@@ -71,7 +62,7 @@ var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
71
62
  });
72
63
  } else {
73
64
  // 默认找到第一个菜单项
74
- traverseTree(menus, function (node, pnode, pnodes) {
65
+ _traverseTree(menus, function (node, pnode, pnodes) {
75
66
  if (!isGroupMenu(node)) {
76
67
  subMenu = node;
77
68
  menu = pnode;
@@ -80,80 +71,55 @@ var getSelectedMenuInfo = function getSelectedMenuInfo(selectedKey) {
80
71
  }
81
72
  });
82
73
  }
83
-
84
74
  return {
85
75
  subMenu: subMenu,
86
76
  menu: menu,
87
77
  parentMenus: parentMenus
88
78
  };
89
79
  };
90
-
91
- exports.getSelectedMenuInfo = getSelectedMenuInfo;
92
-
93
- var hasLevel3 = function hasLevel3(menus) {
80
+ var hasLevel3 = exports.hasLevel3 = function hasLevel3(menus) {
94
81
  return menus == null ? void 0 : menus.some(function (menu) {
95
82
  var _menu$children;
96
-
97
83
  return menu == null ? void 0 : (_menu$children = menu.children) == null ? void 0 : _menu$children.some(function (item) {
98
84
  var _item$children;
99
-
100
85
  return item == null ? void 0 : (_item$children = item.children) == null ? void 0 : _item$children.length;
101
86
  });
102
87
  });
103
88
  };
104
-
105
- exports.hasLevel3 = hasLevel3;
106
-
107
- var isNewTabMenu = function isNewTabMenu(menu) {
89
+ var isNewTabMenu = exports.isNewTabMenu = function isNewTabMenu(menu) {
108
90
  var _ref = menu || {},
109
- target = _ref.target,
110
- path = _ref.path;
111
-
91
+ target = _ref.target,
92
+ path = _ref.path;
112
93
  return target === '_blank' || /^http/i.test(path) && /blankType=newTarget/.test(path);
113
94
  };
114
-
115
- exports.isNewTabMenu = isNewTabMenu;
116
-
117
- var openInNewTab = function openInNewTab(path) {
95
+ var openInNewTab = exports.openInNewTab = function openInNewTab(path) {
118
96
  window.open(path, '_blank');
119
97
  };
120
-
121
- exports.openInNewTab = openInNewTab;
122
-
123
- var traverseTree = function traverseTree(treeData, callback, pnode) {
98
+ var _traverseTree = exports.traverseTree = function traverseTree(treeData, callback, pnode) {
124
99
  var pnodes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
125
100
  (treeData || []).every(function (node, index) {
126
101
  var result;
127
-
128
102
  if (callback) {
129
- result = callback(node, pnode, (pnodes == null ? void 0 : pnodes.length) ? pnodes : [pnode].filter(function (item) {
103
+ result = callback(node, pnode, pnodes != null && pnodes.length ? pnodes : [pnode].filter(function (item) {
130
104
  return !!item;
131
105
  }), index);
132
- } // 回调函数返回false则终止遍历
133
-
106
+ }
134
107
 
108
+ // 回调函数返回false则终止遍历
135
109
  if (result !== false) {
136
- node && traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
110
+ node && _traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
137
111
  }
138
-
139
112
  return result !== false;
140
113
  });
141
114
  return treeData;
142
115
  };
143
-
144
- exports.traverseTree = traverseTree;
145
-
146
- var safeParseJSON = function safeParseJSON(str, defaultObj) {
116
+ var safeParseJSON = exports.safeParseJSON = function safeParseJSON(str, defaultObj) {
147
117
  var result;
148
-
149
118
  try {
150
119
  result = JSON.parse(str);
151
120
  } catch (err) {
152
121
  console.warn('json parse error:', err);
153
122
  result = typeof defaultObj === 'undefined' ? str : defaultObj;
154
123
  }
155
-
156
124
  return result || defaultObj;
157
- };
158
-
159
- exports.safeParseJSON = safeParseJSON;
125
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tntd",
3
- "version": "1.4.32",
3
+ "version": "1.4.33-beta.1",
4
4
  "description": "ued tnt design",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -48,9 +48,10 @@
48
48
  "babel-loader": "^8.0.6",
49
49
  "babel-plugin-import": "^1.12.1",
50
50
  "babel-plugin-styless": "^1.4.25",
51
+ "cross-env": "^7.0.3",
51
52
  "css-loader": "^3.6.0",
52
53
  "cssnano": "^4.1.10",
53
- "doc-scripts": "^1.8.2",
54
+ "doc-scripts": "1.8.2",
54
55
  "eslint": "^7.15.0",
55
56
  "less": "^3.11.1",
56
57
  "less-loader": "^4.1.0",