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.
- package/components/Handle/README.md +0 -20
- package/components/Handle/index.js +27 -6
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +23819 -24067
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +67 -32
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +80 -32
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
|
@@ -3,23 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
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;
|
package/lib/utils/index.js
CHANGED
|
@@ -12,12 +12,13 @@ var _exportNames = {
|
|
|
12
12
|
traverseTree: true,
|
|
13
13
|
safeParseJSON: true
|
|
14
14
|
};
|
|
15
|
-
exports.
|
|
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
|
-
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
function
|
|
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
|
|
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
|
-
|
|
95
|
-
|
|
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
|
|
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