@arim-aisdc/public-components 2.0.25 → 2.1.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.
- package/dist/assets/iconfont/index.css +2 -0
- package/dist/assets/iconfont/public/iconfont.css +69 -0
- package/dist/assets/iconfont/public/iconfont.ttf +0 -0
- package/dist/assets/iconfont/table/iconfont.css +61 -45
- package/dist/assets/iconfont/table/iconfont.ttf +0 -0
- package/dist/components/CacheTabs/CacheTabs.d.ts +11 -0
- package/dist/components/CacheTabs/CacheTabs.js +273 -0
- package/dist/components/CacheTabs/index.d.ts +3 -0
- package/dist/components/CacheTabs/index.js +2 -0
- package/dist/components/CacheTabs/index.less +116 -0
- package/dist/components/TableMax/TableMax.js +1 -1
- package/dist/components/TableMax/components/CustomDragerLayer/index.less +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/themes/variables.less +4 -0
- package/dist/themes/variablesConfig.js +11 -2
- package/package.json +2 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont-public"; /* Project id 4386651 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1730099749830') format('truetype');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconfont-public {
|
|
7
|
+
font-family: "iconfont-public" !important;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon-public-guanbiqita:before {
|
|
15
|
+
content: "\e6db";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-public-shuaxinbiaoqian:before {
|
|
19
|
+
content: "\e6dc";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon-public-guanbibiaoqian:before {
|
|
23
|
+
content: "\e6dd";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-public-upload:before {
|
|
27
|
+
content: "\e877";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.icon-public-download:before {
|
|
31
|
+
content: "\e878";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.icon-public-refresh:before {
|
|
35
|
+
content: "\e7c1";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-public-edit:before {
|
|
39
|
+
content: "\e7c2";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-public-calendar:before {
|
|
43
|
+
content: "\e7c3";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-public-reduce:before {
|
|
47
|
+
content: "\e7c4";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-public-setting:before {
|
|
51
|
+
content: "\e7bc";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-public-delete:before {
|
|
55
|
+
content: "\e7bd";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.icon-public-drag:before {
|
|
59
|
+
content: "\e7be";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.icon-public-down:before {
|
|
63
|
+
content: "\e7bf";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.icon-public-pin:before {
|
|
67
|
+
content: "\e7c0";
|
|
68
|
+
}
|
|
69
|
+
|
|
Binary file
|
|
@@ -1,45 +1,61 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: iconfont-table; /* Project id 4453758 */
|
|
3
|
-
src: url('iconfont.ttf?t=
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.iconfont-table {
|
|
7
|
-
font-family: iconfont-table !important;
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
font-style: normal;
|
|
10
|
-
-webkit-font-smoothing: antialiased;
|
|
11
|
-
-moz-osx-font-smoothing: grayscale;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.icon-table-
|
|
15
|
-
content: "\
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.icon-table-
|
|
19
|
-
content: "\
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.icon-table-
|
|
23
|
-
content: "\
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.icon-table-
|
|
27
|
-
content: "\
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icon-table-
|
|
31
|
-
content: "\
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.icon-table-
|
|
35
|
-
content: "\
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.icon-table-
|
|
39
|
-
content: "\
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.icon-table-
|
|
43
|
-
content: "\
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont-table"; /* Project id 4453758 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1730099737796') format('truetype');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconfont-table {
|
|
7
|
+
font-family: "iconfont-table" !important;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon-table-a-xinzeng21:before {
|
|
15
|
+
content: "\e62e";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-table-a-download11:before {
|
|
19
|
+
content: "\e62f";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon-table-tight:before {
|
|
23
|
+
content: "\e87e";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-table-normal:before {
|
|
27
|
+
content: "\e87f";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.icon-table-shenglvehao:before {
|
|
31
|
+
content: "\e62d";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.icon-table-delete:before {
|
|
35
|
+
content: "\e87c";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-table-shuaxin:before {
|
|
39
|
+
content: "\e87b";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-table-upload:before {
|
|
43
|
+
content: "\e878";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-table-download:before {
|
|
47
|
+
content: "\e87a";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-table-shezhi:before {
|
|
51
|
+
content: "\e643";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-table-zhexian:before {
|
|
55
|
+
content: "\e644";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.icon-table-biaoge:before {
|
|
59
|
+
content: "\e645";
|
|
60
|
+
}
|
|
61
|
+
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export type CacheTabsProps = {
|
|
4
|
+
useAliveController: any;
|
|
5
|
+
pathname: string;
|
|
6
|
+
history: any;
|
|
7
|
+
nodeList?: any;
|
|
8
|
+
shouldCache: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: ({ useAliveController, pathname, history, nodeList, shouldCache }: CacheTabsProps) => React.ReactElement;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { Dropdown, Tabs, Tooltip } from 'antd';
|
|
14
|
+
import React, { useState, useMemo, useRef, useEffect } from 'react';
|
|
15
|
+
import "./index.less";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
export default (function (_ref) {
|
|
18
|
+
var useAliveController = _ref.useAliveController,
|
|
19
|
+
pathname = _ref.pathname,
|
|
20
|
+
history = _ref.history,
|
|
21
|
+
nodeList = _ref.nodeList,
|
|
22
|
+
shouldCache = _ref.shouldCache;
|
|
23
|
+
// 获取缓存列表
|
|
24
|
+
var _ref2 = (useAliveController === null || useAliveController === void 0 ? void 0 : useAliveController()) || {},
|
|
25
|
+
getCachingNodes = _ref2.getCachingNodes,
|
|
26
|
+
dropScope = _ref2.dropScope,
|
|
27
|
+
clear = _ref2.clear,
|
|
28
|
+
refreshScope = _ref2.refreshScope;
|
|
29
|
+
var cachingNodes = ((getCachingNodes === null || getCachingNodes === void 0 ? void 0 : getCachingNodes()) || nodeList).filter(function (item) {
|
|
30
|
+
return item === null || item === void 0 ? void 0 : item.tabName;
|
|
31
|
+
});
|
|
32
|
+
var _useState = useState({
|
|
33
|
+
path: '',
|
|
34
|
+
open: false
|
|
35
|
+
}),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
open = _useState2[0],
|
|
38
|
+
setOpen = _useState2[1];
|
|
39
|
+
|
|
40
|
+
// 阻止右键事件冒泡
|
|
41
|
+
var _onRightClick = function onRightClick(e, name) {
|
|
42
|
+
return open.open && open.path === name && e.stopPropagation();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// 点击tab,跳转页面
|
|
46
|
+
var clickTab = function clickTab(path) {
|
|
47
|
+
history === null || history === void 0 || history.push(path);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// 关闭tab,销毁缓存
|
|
51
|
+
var editTab = function editTab(path) {
|
|
52
|
+
dropScope === null || dropScope === void 0 || dropScope(path);
|
|
53
|
+
// 关闭当前页面,需跳转到其他页签
|
|
54
|
+
if (path === pathname) {
|
|
55
|
+
var index = cachingNodes.findIndex(function (item) {
|
|
56
|
+
return item.name === path;
|
|
57
|
+
});
|
|
58
|
+
if (index > 0) {
|
|
59
|
+
history === null || history === void 0 || history.push(cachingNodes[index - 1].name);
|
|
60
|
+
} else {
|
|
61
|
+
history === null || history === void 0 || history.push(cachingNodes[1].name);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// 关闭当前页
|
|
67
|
+
var onCurrent = function onCurrent(e) {
|
|
68
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
69
|
+
dropScope === null || dropScope === void 0 || dropScope(targetKey);
|
|
70
|
+
// 关闭当前页面,需跳转到其他页签
|
|
71
|
+
if (targetKey === pathname) {
|
|
72
|
+
var index = cachingNodes.findIndex(function (item) {
|
|
73
|
+
return item.name === targetKey;
|
|
74
|
+
});
|
|
75
|
+
if (index > 0) {
|
|
76
|
+
history === null || history === void 0 || history.push(cachingNodes[index - 1].name);
|
|
77
|
+
} else {
|
|
78
|
+
history === null || history === void 0 || history.push(cachingNodes[1].name);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// 关闭其他
|
|
84
|
+
var onOther = function onOther(e) {
|
|
85
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
86
|
+
history === null || history === void 0 || history.push(targetKey);
|
|
87
|
+
clear === null || clear === void 0 || clear();
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//关闭左侧
|
|
91
|
+
var onLeft = function onLeft(e) {
|
|
92
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
93
|
+
var lastIndex = cachingNodes.findIndex(function (item) {
|
|
94
|
+
return item.name === pathname;
|
|
95
|
+
});
|
|
96
|
+
var currIndex = cachingNodes.findIndex(function (item) {
|
|
97
|
+
return item.name === targetKey;
|
|
98
|
+
});
|
|
99
|
+
if (currIndex > lastIndex) history === null || history === void 0 || history.push(targetKey);
|
|
100
|
+
cachingNodes.forEach(function (item, index) {
|
|
101
|
+
if (index < currIndex) {
|
|
102
|
+
dropScope === null || dropScope === void 0 || dropScope((item === null || item === void 0 ? void 0 : item.name) || '');
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// 关闭右侧
|
|
108
|
+
var onRight = function onRight(e) {
|
|
109
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
110
|
+
var lastIndex = cachingNodes.findIndex(function (item) {
|
|
111
|
+
return item.name === pathname;
|
|
112
|
+
});
|
|
113
|
+
var currIndex = cachingNodes.findIndex(function (item) {
|
|
114
|
+
return item.name === targetKey;
|
|
115
|
+
});
|
|
116
|
+
if (currIndex < lastIndex) history === null || history === void 0 || history.push(targetKey);
|
|
117
|
+
cachingNodes.forEach(function (item, index) {
|
|
118
|
+
if (index > currIndex) {
|
|
119
|
+
dropScope === null || dropScope === void 0 || dropScope((item === null || item === void 0 ? void 0 : item.name) || '');
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// 关闭全部
|
|
125
|
+
var onAll = function onAll() {
|
|
126
|
+
history === null || history === void 0 || history.push('/home');
|
|
127
|
+
clear === null || clear === void 0 || clear();
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// 重新加载
|
|
131
|
+
var onRefresh = function onRefresh(e) {
|
|
132
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
133
|
+
refreshScope === null || refreshScope === void 0 || refreshScope(targetKey);
|
|
134
|
+
};
|
|
135
|
+
var menuItems = useMemo(function () {
|
|
136
|
+
return [{
|
|
137
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
138
|
+
className: "iconfont-public icon-public-shuaxinbiaoqian"
|
|
139
|
+
}),
|
|
140
|
+
label: '刷新标签',
|
|
141
|
+
key: 'refresh',
|
|
142
|
+
onClick: onRefresh
|
|
143
|
+
}, {
|
|
144
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
145
|
+
className: "iconfont-public icon-public-guanbibiaoqian"
|
|
146
|
+
}),
|
|
147
|
+
label: '关闭标签',
|
|
148
|
+
key: 'current',
|
|
149
|
+
disabled: cachingNodes.length <= 1,
|
|
150
|
+
onClick: onCurrent
|
|
151
|
+
}, {
|
|
152
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
153
|
+
className: "iconfont-public icon-public-guanbiqita"
|
|
154
|
+
}),
|
|
155
|
+
label: '关闭其他标签页',
|
|
156
|
+
key: 'other',
|
|
157
|
+
disabled: cachingNodes.length <= 1,
|
|
158
|
+
onClick: onOther
|
|
159
|
+
}
|
|
160
|
+
// ... other menu items ...
|
|
161
|
+
];
|
|
162
|
+
}, [cachingNodes.length, onRefresh, onCurrent, onOther]);
|
|
163
|
+
var tabItems = useMemo(function () {
|
|
164
|
+
return cachingNodes.map(function (item) {
|
|
165
|
+
return {
|
|
166
|
+
label: /*#__PURE__*/_jsx(LabelDropdown, {
|
|
167
|
+
name: item.name,
|
|
168
|
+
label: item.tabName,
|
|
169
|
+
onRightClick: function onRightClick(e) {
|
|
170
|
+
return _onRightClick(e, item.name);
|
|
171
|
+
},
|
|
172
|
+
cachingNodes: cachingNodes,
|
|
173
|
+
setOpen: setOpen,
|
|
174
|
+
menuItems: menuItems.map(function (menuItem) {
|
|
175
|
+
return _objectSpread(_objectSpread({}, menuItem), {}, {
|
|
176
|
+
key: JSON.stringify({
|
|
177
|
+
name: item.name,
|
|
178
|
+
key: menuItem.key
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
key: item.name,
|
|
184
|
+
closable: cachingNodes.length > 1
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
}, [cachingNodes, _onRightClick, menuItems]);
|
|
188
|
+
return /*#__PURE__*/_jsx("div", {
|
|
189
|
+
style: {
|
|
190
|
+
display: shouldCache ? 'block' : 'none'
|
|
191
|
+
},
|
|
192
|
+
children: /*#__PURE__*/_jsx(Tabs, {
|
|
193
|
+
hideAdd: true,
|
|
194
|
+
size: "middle",
|
|
195
|
+
type: "editable-card",
|
|
196
|
+
className: "cache-tabs",
|
|
197
|
+
activeKey: pathname,
|
|
198
|
+
onTabClick: clickTab,
|
|
199
|
+
onEdit: editTab,
|
|
200
|
+
items: tabItems,
|
|
201
|
+
tabBarGutter: 0
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
var LabelDropdown = /*#__PURE__*/React.memo(function (_ref3) {
|
|
206
|
+
var name = _ref3.name,
|
|
207
|
+
label = _ref3.label,
|
|
208
|
+
onRightClick = _ref3.onRightClick,
|
|
209
|
+
cachingNodes = _ref3.cachingNodes,
|
|
210
|
+
setOpen = _ref3.setOpen,
|
|
211
|
+
menuItems = _ref3.menuItems;
|
|
212
|
+
var _useState3 = useState(false),
|
|
213
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
214
|
+
isOverflowing = _useState4[0],
|
|
215
|
+
setIsOverflowing = _useState4[1];
|
|
216
|
+
var labelRef = useRef(null);
|
|
217
|
+
useEffect(function () {
|
|
218
|
+
var checkOverflow = function checkOverflow() {
|
|
219
|
+
if (labelRef.current) {
|
|
220
|
+
setIsOverflowing(labelRef.current.offsetWidth < labelRef.current.scrollWidth);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
checkOverflow();
|
|
224
|
+
window.addEventListener('resize', checkOverflow);
|
|
225
|
+
return function () {
|
|
226
|
+
return window.removeEventListener('resize', checkOverflow);
|
|
227
|
+
};
|
|
228
|
+
}, [label]);
|
|
229
|
+
return /*#__PURE__*/_jsx("div", {
|
|
230
|
+
onClick: function onClick(e) {
|
|
231
|
+
return onRightClick(e, name);
|
|
232
|
+
},
|
|
233
|
+
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
234
|
+
overlayClassName: "cache-tabs-dropdown",
|
|
235
|
+
trigger: ['contextMenu'],
|
|
236
|
+
onOpenChange: function onOpenChange(e) {
|
|
237
|
+
return setOpen({
|
|
238
|
+
path: name,
|
|
239
|
+
open: e
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
menu: {
|
|
243
|
+
items: menuItems
|
|
244
|
+
},
|
|
245
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
246
|
+
title: isOverflowing ? label : '',
|
|
247
|
+
color: "var(--globalColor7)",
|
|
248
|
+
overlayStyle: {
|
|
249
|
+
border: '1px solid var(--tableColor2)',
|
|
250
|
+
borderRadius: '6px'
|
|
251
|
+
},
|
|
252
|
+
overlayInnerStyle: {
|
|
253
|
+
padding: '6px 16px',
|
|
254
|
+
borderRadius: '6px',
|
|
255
|
+
color: 'var(--globalColor1)',
|
|
256
|
+
background: 'var(--globalColor1)',
|
|
257
|
+
fontSize: '14px',
|
|
258
|
+
lineHeight: '28px'
|
|
259
|
+
},
|
|
260
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
261
|
+
ref: labelRef,
|
|
262
|
+
className: cachingNodes.length > 1 ? 'dropdown-label' : '',
|
|
263
|
+
style: {
|
|
264
|
+
overflow: 'hidden',
|
|
265
|
+
textOverflow: 'ellipsis',
|
|
266
|
+
whiteSpace: 'nowrap'
|
|
267
|
+
},
|
|
268
|
+
children: label
|
|
269
|
+
})
|
|
270
|
+
}, name)
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// index.less
|
|
2
|
+
|
|
3
|
+
.cache-tabs {
|
|
4
|
+
height: 40px;
|
|
5
|
+
padding-top: 4px;
|
|
6
|
+
background: @globalColor8;
|
|
7
|
+
|
|
8
|
+
.ant-tabs-nav {
|
|
9
|
+
margin-bottom: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&>.ant-tabs-nav .ant-tabs-tab {
|
|
14
|
+
background: @globalColor8 !important;
|
|
15
|
+
border: 0 !important;
|
|
16
|
+
position: relative !important;
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-items: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
color: @globalColor2;
|
|
21
|
+
height: 100% !important;
|
|
22
|
+
padding: 0 12px !important;
|
|
23
|
+
pointer-events: auto;
|
|
24
|
+
}
|
|
25
|
+
&>.ant-tabs-nav .ant-tabs-tab-active {
|
|
26
|
+
background: @globalColor7 !important;
|
|
27
|
+
border-radius: 6px 6px 0 0 !important;
|
|
28
|
+
border: 0 !important;
|
|
29
|
+
.ant-tabs-tab-btn {
|
|
30
|
+
color: @globalColor1 !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&>.ant-tabs-nav .ant-tabs-tab:hover {
|
|
34
|
+
background: @globalColor7 !important;
|
|
35
|
+
border-radius: 6px 6px 0 0 !important;
|
|
36
|
+
border: 0 !important;
|
|
37
|
+
}
|
|
38
|
+
&>.ant-tabs-nav::before {
|
|
39
|
+
z-index: 1;
|
|
40
|
+
border-bottom: 1px solid @tableColor7;
|
|
41
|
+
}
|
|
42
|
+
&>.ant-tabs-nav .ant-tabs-tab:not(.ant-tabs-tab-active)::before{
|
|
43
|
+
position: absolute !important;
|
|
44
|
+
left: 0;
|
|
45
|
+
top: 10px;
|
|
46
|
+
bottom: 6px;
|
|
47
|
+
border-left: 1px solid @tableColor7;
|
|
48
|
+
content: '';
|
|
49
|
+
}
|
|
50
|
+
.ant-tabs-tab-active + .ant-tabs-tab::before, .ant-tabs-tab:nth-child(1):before{
|
|
51
|
+
position: absolute !important;
|
|
52
|
+
left: 0;
|
|
53
|
+
top: 10px;
|
|
54
|
+
bottom: 6px;
|
|
55
|
+
border-left: none !important;
|
|
56
|
+
content: '';
|
|
57
|
+
}
|
|
58
|
+
.ant-dropdown-trigger,.dropdown-label {
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
max-width: 96px;
|
|
63
|
+
}
|
|
64
|
+
&>.ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove {
|
|
65
|
+
padding: 0 !important;
|
|
66
|
+
margin: 0 0 0 4px;
|
|
67
|
+
}
|
|
68
|
+
&>.ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove .anticon {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
width: 16px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
color: @global-icon-color;
|
|
74
|
+
font-size: 10px;
|
|
75
|
+
&:hover {
|
|
76
|
+
background: @globalColor_14;
|
|
77
|
+
}
|
|
78
|
+
svg {
|
|
79
|
+
margin-top: 3px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cache-tabs-dropdown {
|
|
85
|
+
z-index: 9999;
|
|
86
|
+
.ant-dropdown-menu {
|
|
87
|
+
padding: 0 !important;
|
|
88
|
+
border-radius: 6px !important;
|
|
89
|
+
background: @global-hover-background-color;
|
|
90
|
+
box-shadow: 0px 5px 12px -4px @global-hover-box-shadow-color;
|
|
91
|
+
border-radius: 6px 6px 6px 6px;
|
|
92
|
+
border: 1px solid @tableColor7;
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
.ant-dropdown-menu-item {
|
|
96
|
+
padding: 7px 12px !important;
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
line-height: 22px !important;
|
|
100
|
+
border-radius: 0 !important;
|
|
101
|
+
color: @globalColor1 !important;
|
|
102
|
+
}
|
|
103
|
+
.ant-dropdown-menu-item-active, .ant-dropdown-menu-item:hover {
|
|
104
|
+
background: @globalColor_14 !important;
|
|
105
|
+
}
|
|
106
|
+
.ant-dropdown-menu-item-disabled, .ant-dropdown-menu-item-disabled:hover {
|
|
107
|
+
background: @global-disabled-background-color !important;
|
|
108
|
+
}
|
|
109
|
+
.iconfont-table {
|
|
110
|
+
font-size: 16px !important;
|
|
111
|
+
line-height: 22px !important;
|
|
112
|
+
color: @global-icon-color !important;
|
|
113
|
+
margin-right: 4px;
|
|
114
|
+
margin-top: 2px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -1244,7 +1244,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
1244
1244
|
},
|
|
1245
1245
|
placement: "bottomRight",
|
|
1246
1246
|
children: /*#__PURE__*/_jsx("i", {
|
|
1247
|
-
className: "iconfont-table icon-table-
|
|
1247
|
+
className: "iconfont-table icon-table-normal handleRightItem",
|
|
1248
1248
|
style: {
|
|
1249
1249
|
fontSize: '16px',
|
|
1250
1250
|
marginRight: 0
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export { default as SchemaForm } from './components/SchemaForm';
|
|
|
32
32
|
export * from './components/Icon';
|
|
33
33
|
export { default as Icon } from './components/Icon';
|
|
34
34
|
export { default as Empty } from './components/Empty';
|
|
35
|
+
export { default as CacheTabs } from './components/CacheTabs';
|
|
36
|
+
export * from './components/CacheTabs';
|
|
35
37
|
export { default as useCenterModalState } from './hooks/useCenterModalState';
|
|
36
38
|
export * from './hooks/useEventBus';
|
|
37
39
|
export { default as useEventBus } from './hooks/useEventBus';
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,8 @@ export { default as SchemaForm } from "./components/SchemaForm";
|
|
|
33
33
|
export * from "./components/Icon";
|
|
34
34
|
export { default as Icon } from "./components/Icon";
|
|
35
35
|
export { default as Empty } from "./components/Empty";
|
|
36
|
+
export { default as CacheTabs } from "./components/CacheTabs";
|
|
37
|
+
export * from "./components/CacheTabs";
|
|
36
38
|
|
|
37
39
|
// hooks
|
|
38
40
|
export { default as useCenterModalState } from "./hooks/useCenterModalState";
|
|
@@ -45,3 +45,7 @@
|
|
|
45
45
|
@tableTooltipBgc: var(--tableTooltipBgc, #f5f6f7); // 表格tooltip背景色
|
|
46
46
|
@tableSettingModalBgc: var(--tableSettingModalBgc, #ffffff); // 表格的body的背景底色
|
|
47
47
|
@global-tip-text-color: var(--global-tip-text-color, rgba(255,255,255,0.45)); //提醒色/暂无数据颜色/placeholder颜色
|
|
48
|
+
@global-icon-color: var(--global-icon-color, #ffffff); //图标色
|
|
49
|
+
@global-hover-background-color: var(--global-hover-background-color, #010C31f2); // 表格行hover背景色
|
|
50
|
+
@global-hover-box-shadow-color: var(--global-hover-box-shadow-color, #03062173); // hover/右键框投影颜色
|
|
51
|
+
@global-disabled-background-color: var(--global-disabled-background-color, #0F2347); // 禁用背景色
|
|
@@ -63,7 +63,11 @@ export var PublicThemeVariablesConfig = {
|
|
|
63
63
|
// 全局默认 禁用/选中 字体颜色
|
|
64
64
|
'--tableSettingModalBgc': '#FFFFFF',
|
|
65
65
|
// 表格的body的背景底色
|
|
66
|
-
'--global-tip-text-color': "rgba(36,42,48,0.45)"
|
|
66
|
+
'--global-tip-text-color': "rgba(36,42,48,0.45)",
|
|
67
|
+
'--global-icon-color': "#455169",
|
|
68
|
+
'--global-hover-background-color': "#ebebebf2",
|
|
69
|
+
'--global-hover-box-shadow-color': "#0306211a",
|
|
70
|
+
'--global-disabled-background-color': "#F2F2F2"
|
|
67
71
|
},
|
|
68
72
|
dark: {
|
|
69
73
|
'--global-curd-input-background-color': '#494c5dff',
|
|
@@ -130,6 +134,11 @@ export var PublicThemeVariablesConfig = {
|
|
|
130
134
|
// 全局默认 禁用/选中 字体颜色
|
|
131
135
|
'--tableSettingModalBgc': '#05081A',
|
|
132
136
|
// 表格的body的背景底色
|
|
133
|
-
'--global-tip-text-color': "rgba(255,255,255,0.45)"
|
|
137
|
+
'--global-tip-text-color': "rgba(255,255,255,0.45)",
|
|
138
|
+
// 提醒色/暂无数据颜色/placeholder颜
|
|
139
|
+
'--global-icon-color': "#fff",
|
|
140
|
+
'--global-hover-background-color': "#010C31f2",
|
|
141
|
+
'--global-hover-box-shadow-color': "#03062173",
|
|
142
|
+
'--global-disabled-background-color': "#0F2347"
|
|
134
143
|
}
|
|
135
144
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arim-aisdc/public-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "前端组件库",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"jsep": "^1.3.8",
|
|
62
62
|
"lodash": "^4.17.21",
|
|
63
63
|
"path": "^0.12.7",
|
|
64
|
+
"react-activation": "^0.12.4",
|
|
64
65
|
"react-color": "^2.19.3",
|
|
65
66
|
"react-dnd": "^16.0.1",
|
|
66
67
|
"react-dnd-html5-backend": "^16.0.1",
|