@arim-aisdc/public-components 2.0.24 → 2.1.0
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/table/iconfont.css +40 -18
- package/dist/assets/iconfont/table/iconfont.ttf +0 -0
- package/dist/components/CacheTabs/CacheTabs.d.ts +10 -0
- package/dist/components/CacheTabs/CacheTabs.js +241 -0
- package/dist/components/CacheTabs/index.d.ts +3 -0
- package/dist/components/CacheTabs/index.js +2 -0
- package/dist/components/CacheTabs/index.less +107 -0
- package/dist/components/ConfigProvider/context.d.ts +2 -0
- package/dist/components/CustomForm/CustomForm.js +1 -0
- package/dist/components/CustomForm/index.less +6 -6
- package/dist/components/GlobalTip/MessageTip/MessageTip.d.ts +1 -0
- package/dist/components/GlobalTip/MessageTip/MessageTip.js +3 -2
- package/dist/components/GlobalTip/MessageTip/index.less +15 -0
- package/dist/components/GlobalTip/ModalTip/ModalTip.js +2 -1
- package/dist/components/QueryFilter/index.less +7 -7
- package/dist/components/TableMax/TableBody/Row.d.ts +9 -2
- package/dist/components/TableMax/TableBody/Row.js +27 -5
- package/dist/components/TableMax/TableBody/index.d.ts +2 -1
- package/dist/components/TableMax/TableBody/index.js +82 -4
- package/dist/components/TableMax/TableBody/index.less +36 -12
- package/dist/components/TableMax/TableHeader/Cell.d.ts +2 -1
- package/dist/components/TableMax/TableHeader/Cell.js +6 -2
- package/dist/components/TableMax/TableHeader/index.d.ts +2 -1
- package/dist/components/TableMax/TableHeader/index.js +6 -3
- package/dist/components/TableMax/TableHeader/index.less +13 -7
- package/dist/components/TableMax/TableMax.d.ts +1 -1
- package/dist/components/TableMax/TableMax.js +102 -40
- package/dist/components/TableMax/components/ColumnSetting/index.d.ts +2 -0
- package/dist/components/TableMax/components/ColumnSetting/index.js +50 -12
- package/dist/components/TableMax/components/ColumnSetting/index.less +21 -10
- package/dist/components/TableMax/components/CustomDragerLayer/index.d.ts +1 -1
- package/dist/components/TableMax/components/CustomDragerLayer/index.js +3 -2
- package/dist/components/TableMax/components/CustomDragerLayer/index.less +2 -3
- package/dist/components/TableMax/tableMax.less +51 -3
- package/dist/components/TableMax/type.d.ts +24 -2
- package/dist/components/TableMax/type.js +17 -1
- package/dist/components/TableMax/utils.d.ts +3 -2
- package/dist/components/TableMax/utils.js +5 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/themes/variables.less +3 -0
- package/dist/themes/variablesConfig.js +9 -2
- package/package.json +106 -105
- package/dist/assets/iconfont/table/demo.css +0 -539
- package/dist/assets/iconfont/table/demo_index.html +0 -372
- package/dist/assets/iconfont/table/iconfont.js +0 -42
- package/dist/assets/iconfont/table/iconfont.json +0 -65
- package/dist/assets/iconfont/table/iconfont.woff +0 -0
- package/dist/assets/iconfont/table/iconfont.woff2 +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family: "iconfont-table"; /* Project id
|
|
3
|
-
src: url('iconfont.
|
|
4
|
-
url('iconfont.woff?t=1727342206392') format('woff'),
|
|
5
|
-
url('iconfont.ttf?t=1727342206392') format('truetype');
|
|
2
|
+
font-family: "iconfont-table"; /* Project id 4386651 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1729650040389') format('truetype');
|
|
6
4
|
}
|
|
7
5
|
|
|
8
6
|
.iconfont-table {
|
|
@@ -13,35 +11,59 @@
|
|
|
13
11
|
-moz-osx-font-smoothing: grayscale;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
.icon-table-
|
|
17
|
-
content: "\
|
|
14
|
+
.icon-table-guanbiqita:before {
|
|
15
|
+
content: "\e6db";
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
.icon-table-
|
|
21
|
-
content: "\
|
|
18
|
+
.icon-table-shuaxinbiaoqian:before {
|
|
19
|
+
content: "\e6dc";
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
.icon-table-
|
|
25
|
-
content: "\
|
|
22
|
+
.icon-table-guanbibiaoqian:before {
|
|
23
|
+
content: "\e6dd";
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
.icon-table-upload:before {
|
|
29
|
-
content: "\
|
|
27
|
+
content: "\e877";
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
.icon-table-download:before {
|
|
33
|
-
content: "\
|
|
31
|
+
content: "\e878";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.icon-table-refresh:before {
|
|
35
|
+
content: "\e7c1";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-table-edit:before {
|
|
39
|
+
content: "\e7c2";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-table-calendar:before {
|
|
43
|
+
content: "\e7c3";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-table-reduce:before {
|
|
47
|
+
content: "\e7c4";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-table-setting:before {
|
|
51
|
+
content: "\e7bc";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-table-delete:before {
|
|
55
|
+
content: "\e7bd";
|
|
34
56
|
}
|
|
35
57
|
|
|
36
|
-
.icon-table-
|
|
37
|
-
content: "\
|
|
58
|
+
.icon-table-drag:before {
|
|
59
|
+
content: "\e7be";
|
|
38
60
|
}
|
|
39
61
|
|
|
40
|
-
.icon-table-
|
|
41
|
-
content: "\
|
|
62
|
+
.icon-table-down:before {
|
|
63
|
+
content: "\e7bf";
|
|
42
64
|
}
|
|
43
65
|
|
|
44
|
-
.icon-table-
|
|
45
|
-
content: "\
|
|
66
|
+
.icon-table-pin:before {
|
|
67
|
+
content: "\e7c0";
|
|
46
68
|
}
|
|
47
69
|
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|
|
9
|
+
declare const _default: ({ useAliveController, pathname, history, nodeList }: CacheTabsProps) => React.ReactElement;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Dropdown, Tabs, Tooltip } from 'antd';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export default (function (_ref) {
|
|
12
|
+
var useAliveController = _ref.useAliveController,
|
|
13
|
+
pathname = _ref.pathname,
|
|
14
|
+
history = _ref.history,
|
|
15
|
+
nodeList = _ref.nodeList;
|
|
16
|
+
// 获取缓存列表
|
|
17
|
+
var _useAliveController = useAliveController === null || useAliveController === void 0 ? void 0 : useAliveController(),
|
|
18
|
+
getCachingNodes = _useAliveController.getCachingNodes,
|
|
19
|
+
dropScope = _useAliveController.dropScope,
|
|
20
|
+
clear = _useAliveController.clear,
|
|
21
|
+
refreshScope = _useAliveController.refreshScope;
|
|
22
|
+
var cachingNodes = ((getCachingNodes === null || getCachingNodes === void 0 ? void 0 : getCachingNodes()) || nodeList).filter(function (item) {
|
|
23
|
+
return item === null || item === void 0 ? void 0 : item.tabName;
|
|
24
|
+
});
|
|
25
|
+
var _useState = useState({
|
|
26
|
+
path: '',
|
|
27
|
+
open: false
|
|
28
|
+
}),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
open = _useState2[0],
|
|
31
|
+
setOpen = _useState2[1];
|
|
32
|
+
|
|
33
|
+
// 阻止右键事件冒泡
|
|
34
|
+
var onRightClick = function onRightClick(e, name) {
|
|
35
|
+
return open.open && open.path === name && e.stopPropagation();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// 点击tab,跳转页面
|
|
39
|
+
var clickTab = function clickTab(path) {
|
|
40
|
+
history === null || history === void 0 || history.push(path);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 关闭tab,销毁缓存
|
|
44
|
+
var editTab = function editTab(path) {
|
|
45
|
+
dropScope === null || dropScope === void 0 || dropScope(path);
|
|
46
|
+
// 关闭当前页面,需跳转到其他页签
|
|
47
|
+
if (path === pathname) {
|
|
48
|
+
var index = cachingNodes.findIndex(function (item) {
|
|
49
|
+
return item.name === path;
|
|
50
|
+
});
|
|
51
|
+
if (index > 0) {
|
|
52
|
+
history === null || history === void 0 || history.push(cachingNodes[index - 1].name);
|
|
53
|
+
} else {
|
|
54
|
+
history === null || history === void 0 || history.push(cachingNodes[1].name);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// 关闭当前页
|
|
60
|
+
var onCurrent = function onCurrent(e) {
|
|
61
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
62
|
+
dropScope === null || dropScope === void 0 || dropScope(targetKey);
|
|
63
|
+
// 关闭当前页面,需跳转到其他页签
|
|
64
|
+
if (targetKey === pathname) {
|
|
65
|
+
var index = cachingNodes.findIndex(function (item) {
|
|
66
|
+
return item.name === targetKey;
|
|
67
|
+
});
|
|
68
|
+
if (index > 0) {
|
|
69
|
+
history === null || history === void 0 || history.push(cachingNodes[index - 1].name);
|
|
70
|
+
} else {
|
|
71
|
+
history === null || history === void 0 || history.push(cachingNodes[1].name);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// 关闭其他
|
|
77
|
+
var onOther = function onOther(e) {
|
|
78
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
79
|
+
history === null || history === void 0 || history.push(targetKey);
|
|
80
|
+
clear === null || clear === void 0 || clear();
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
//关闭左侧
|
|
84
|
+
var onLeft = function onLeft(e) {
|
|
85
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
86
|
+
var lastIndex = cachingNodes.findIndex(function (item) {
|
|
87
|
+
return item.name === pathname;
|
|
88
|
+
});
|
|
89
|
+
var currIndex = cachingNodes.findIndex(function (item) {
|
|
90
|
+
return item.name === targetKey;
|
|
91
|
+
});
|
|
92
|
+
if (currIndex > lastIndex) history === null || history === void 0 || history.push(targetKey);
|
|
93
|
+
cachingNodes.forEach(function (item, index) {
|
|
94
|
+
if (index < currIndex) {
|
|
95
|
+
dropScope === null || dropScope === void 0 || dropScope((item === null || item === void 0 ? void 0 : item.name) || '');
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// 关闭右侧
|
|
101
|
+
var onRight = function onRight(e) {
|
|
102
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
103
|
+
var lastIndex = cachingNodes.findIndex(function (item) {
|
|
104
|
+
return item.name === pathname;
|
|
105
|
+
});
|
|
106
|
+
var currIndex = cachingNodes.findIndex(function (item) {
|
|
107
|
+
return item.name === targetKey;
|
|
108
|
+
});
|
|
109
|
+
if (currIndex < lastIndex) history === null || history === void 0 || history.push(targetKey);
|
|
110
|
+
cachingNodes.forEach(function (item, index) {
|
|
111
|
+
if (index > currIndex) {
|
|
112
|
+
dropScope === null || dropScope === void 0 || dropScope((item === null || item === void 0 ? void 0 : item.name) || '');
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// 关闭全部
|
|
118
|
+
var onAll = function onAll() {
|
|
119
|
+
history === null || history === void 0 || history.push('/home');
|
|
120
|
+
clear === null || clear === void 0 || clear();
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// 重新加载
|
|
124
|
+
var onRefresh = function onRefresh(e) {
|
|
125
|
+
var targetKey = JSON.parse(e === null || e === void 0 ? void 0 : e.key).name;
|
|
126
|
+
refreshScope === null || refreshScope === void 0 || refreshScope(targetKey);
|
|
127
|
+
};
|
|
128
|
+
var labelDropdown = function labelDropdown(name, label) {
|
|
129
|
+
var lastIndex = cachingNodes.findIndex(function (item) {
|
|
130
|
+
return item.name === name;
|
|
131
|
+
});
|
|
132
|
+
console.log(cachingNodes, lastIndex, 'cachingNodes');
|
|
133
|
+
return /*#__PURE__*/_jsx("div", {
|
|
134
|
+
onClick: function onClick(e) {
|
|
135
|
+
return onRightClick(e, name);
|
|
136
|
+
},
|
|
137
|
+
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
138
|
+
overlayClassName: "cache-tabs-dropdown",
|
|
139
|
+
trigger: ['contextMenu'],
|
|
140
|
+
onOpenChange: function onOpenChange(e) {
|
|
141
|
+
return setOpen({
|
|
142
|
+
path: name,
|
|
143
|
+
open: e
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
menu: {
|
|
147
|
+
items: [{
|
|
148
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
149
|
+
className: "iconfont-table icon-table-shuaxinbiaoqian"
|
|
150
|
+
}),
|
|
151
|
+
label: '刷新标签',
|
|
152
|
+
key: JSON.stringify({
|
|
153
|
+
name: name,
|
|
154
|
+
key: 'refresh'
|
|
155
|
+
}),
|
|
156
|
+
onClick: onRefresh
|
|
157
|
+
}, {
|
|
158
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
159
|
+
className: "iconfont-table icon-table-guanbibiaoqian"
|
|
160
|
+
}),
|
|
161
|
+
label: '关闭标签',
|
|
162
|
+
key: JSON.stringify({
|
|
163
|
+
name: name,
|
|
164
|
+
key: 'current'
|
|
165
|
+
}),
|
|
166
|
+
disabled: cachingNodes.length <= 1,
|
|
167
|
+
onClick: onCurrent
|
|
168
|
+
}, {
|
|
169
|
+
icon: /*#__PURE__*/_jsx("i", {
|
|
170
|
+
className: "iconfont-table icon-table-guanbiqita"
|
|
171
|
+
}),
|
|
172
|
+
label: '关闭其他标签页',
|
|
173
|
+
key: JSON.stringify({
|
|
174
|
+
name: name,
|
|
175
|
+
key: 'other'
|
|
176
|
+
}),
|
|
177
|
+
disabled: cachingNodes.length <= 1,
|
|
178
|
+
onClick: onOther
|
|
179
|
+
}
|
|
180
|
+
// {
|
|
181
|
+
// icon: '',
|
|
182
|
+
// label: '关闭左侧',
|
|
183
|
+
// key: JSON.stringify({ name, key: 'left' }),
|
|
184
|
+
// disabled: lastIndex === 0,
|
|
185
|
+
// onClick: onLeft,
|
|
186
|
+
// },
|
|
187
|
+
// {
|
|
188
|
+
// label: '关闭右侧',
|
|
189
|
+
// key: JSON.stringify({ name, key: 'right' }),
|
|
190
|
+
// disabled: lastIndex === cachingNodes.length - 1,
|
|
191
|
+
// onClick: onRight,
|
|
192
|
+
// },
|
|
193
|
+
// {
|
|
194
|
+
// label: '重新加载',
|
|
195
|
+
// key: JSON.stringify({ name, key: 'refresh' }),
|
|
196
|
+
// onClick: onRefresh,
|
|
197
|
+
// },
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
201
|
+
title: name,
|
|
202
|
+
color: "var(--globalColor7)",
|
|
203
|
+
overlayStyle: {
|
|
204
|
+
border: '1px solid var(--tableColor2)',
|
|
205
|
+
borderRadius: '6px'
|
|
206
|
+
},
|
|
207
|
+
overlayInnerStyle: {
|
|
208
|
+
padding: '6px 16px',
|
|
209
|
+
borderRadius: '6px',
|
|
210
|
+
color: 'var(--globalColor1)',
|
|
211
|
+
background: 'var(--globalColor1)',
|
|
212
|
+
fontSize: '14px',
|
|
213
|
+
lineHeight: '28px'
|
|
214
|
+
},
|
|
215
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
216
|
+
className: cachingNodes.length > 1 ? 'dropdown-label' : '',
|
|
217
|
+
children: label
|
|
218
|
+
})
|
|
219
|
+
}, name)
|
|
220
|
+
})
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
var tabItems = cachingNodes.map(function (item) {
|
|
224
|
+
return {
|
|
225
|
+
label: labelDropdown(item.name, item.tabName),
|
|
226
|
+
key: item.name,
|
|
227
|
+
closable: cachingNodes.length > 1
|
|
228
|
+
};
|
|
229
|
+
});
|
|
230
|
+
return /*#__PURE__*/_jsx(Tabs, {
|
|
231
|
+
hideAdd: true,
|
|
232
|
+
size: "middle",
|
|
233
|
+
type: "editable-card",
|
|
234
|
+
className: "cache-tabs",
|
|
235
|
+
activeKey: pathname,
|
|
236
|
+
onTabClick: clickTab,
|
|
237
|
+
onEdit: editTab,
|
|
238
|
+
items: tabItems,
|
|
239
|
+
tabBarGutter: 0
|
|
240
|
+
});
|
|
241
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
}
|
|
24
|
+
&>.ant-tabs-nav .ant-tabs-tab-active {
|
|
25
|
+
background: @globalColor7 !important;
|
|
26
|
+
border-radius: 6px 6px 0 0 !important;
|
|
27
|
+
border: 0 !important;
|
|
28
|
+
.ant-tabs-tab-btn {
|
|
29
|
+
color: @globalColor1 !important;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&>.ant-tabs-nav::before {
|
|
33
|
+
z-index: 1;
|
|
34
|
+
border-bottom: 1px solid @tableColor7;
|
|
35
|
+
}
|
|
36
|
+
&>.ant-tabs-nav .ant-tabs-tab:not(.ant-tabs-tab-active)::before{
|
|
37
|
+
position: absolute !important;
|
|
38
|
+
left: 0;
|
|
39
|
+
top: 10px;
|
|
40
|
+
bottom: 6px;
|
|
41
|
+
border-left: 1px solid @tableColor7;
|
|
42
|
+
content: '';
|
|
43
|
+
}
|
|
44
|
+
.ant-tabs-tab-active + .ant-tabs-tab::before, .ant-tabs-tab:nth-child(1):before{
|
|
45
|
+
position: absolute !important;
|
|
46
|
+
left: 0;
|
|
47
|
+
top: 10px;
|
|
48
|
+
bottom: 6px;
|
|
49
|
+
border-left: none !important;
|
|
50
|
+
content: '';
|
|
51
|
+
}
|
|
52
|
+
.dropdown-label {
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
max-width: 84px;
|
|
57
|
+
}
|
|
58
|
+
&>.ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove {
|
|
59
|
+
padding: 0 !important;
|
|
60
|
+
margin: 0 0 0 4px;
|
|
61
|
+
}
|
|
62
|
+
&>.ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove .anticon {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: 16px;
|
|
65
|
+
height: 16px;
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
color: @global-icon-color;
|
|
68
|
+
font-size: 10px;
|
|
69
|
+
&:hover {
|
|
70
|
+
background: @globalColor_14;
|
|
71
|
+
}
|
|
72
|
+
svg {
|
|
73
|
+
margin-top: 3px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cache-tabs-dropdown {
|
|
79
|
+
z-index: 9999;
|
|
80
|
+
.ant-dropdown-menu {
|
|
81
|
+
padding: 0 !important;
|
|
82
|
+
border-radius: 6px !important;
|
|
83
|
+
background: @global-row-hover-background-color;
|
|
84
|
+
box-shadow: 0px 5px 12px -4px @global-hover-box-shadow-color;
|
|
85
|
+
border-radius: 6px 6px 6px 6px;
|
|
86
|
+
border: 1px solid @tableColor7;
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
.ant-dropdown-menu-item {
|
|
90
|
+
padding: 7px 12px !important;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
line-height: 22px !important;
|
|
94
|
+
border-radius: 0 !important;
|
|
95
|
+
color: @globalColor1 !important;
|
|
96
|
+
}
|
|
97
|
+
.ant-dropdown-menu-item-active, .ant-dropdown-menu-item:hover {
|
|
98
|
+
background: @globalColor_14 !important;
|
|
99
|
+
}
|
|
100
|
+
.iconfont-table {
|
|
101
|
+
font-size: 16px !important;
|
|
102
|
+
line-height: 22px !important;
|
|
103
|
+
color: @global-icon-color !important;
|
|
104
|
+
margin-right: 4px;
|
|
105
|
+
margin-top: 2px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface ConfigConsumerProps {
|
|
|
16
16
|
root?: string;
|
|
17
17
|
/** 空数据图标组件 */
|
|
18
18
|
renderEmpty?: (theme?: ThemeType) => React.ReactNode;
|
|
19
|
+
/**request函数 用于下载*/
|
|
20
|
+
request?: (...params: any[]) => Promise<Blob>;
|
|
19
21
|
}
|
|
20
22
|
export declare const DEFAULT_CONTEXT: {
|
|
21
23
|
theme: string;
|
|
@@ -340,6 +340,7 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
340
340
|
onChange: function onChange(e) {
|
|
341
341
|
return commonChange(e, item);
|
|
342
342
|
},
|
|
343
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
343
344
|
children: item.setting.map(function (el, num) {
|
|
344
345
|
return /*#__PURE__*/_jsx(Radio, {
|
|
345
346
|
value: el.value,
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.xmTtn {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
48
|
+
// .xmTtn {
|
|
49
|
+
// width: 76px;
|
|
50
|
+
// height: 32px;
|
|
51
|
+
// border-radius: 2px;
|
|
52
|
+
// padding: 0 !important;
|
|
53
|
+
// }
|
|
54
54
|
|
|
55
55
|
.xmTtn + .xmTtn {
|
|
56
56
|
margin-left: 16px;
|
|
@@ -5,13 +5,14 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
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
7
|
import { message } from 'antd';
|
|
8
|
+
import "./index.less";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
var defaultTipIconMap = {
|
|
10
11
|
success: 'iconfont-theme-dark-four icon-theme-dark-four-successful',
|
|
11
12
|
error: 'iconfont-theme-dark-four icon-theme-dark-four-error',
|
|
12
13
|
info: 'iconfont-theme-dark-four icon-theme-dark-four-information',
|
|
13
14
|
attention: 'iconfont-theme-dark-four icon-theme-dark-four-warning',
|
|
14
|
-
loading: 'iconfont-theme-dark-four icon-theme-dark-four-loading'
|
|
15
|
+
loading: 'anticon-loading-spin iconfont-theme-dark-four icon-theme-dark-four-loading'
|
|
15
16
|
};
|
|
16
17
|
var messageConfig = function messageConfig(_ref) {
|
|
17
18
|
var key = _ref.key,
|
|
@@ -22,7 +23,7 @@ var messageConfig = function messageConfig(_ref) {
|
|
|
22
23
|
_ref$tipIconMap = _ref.tipIconMap,
|
|
23
24
|
tipIconMap = _ref$tipIconMap === void 0 ? defaultTipIconMap : _ref$tipIconMap;
|
|
24
25
|
var defaultDuration = tipCode === 'loading' ? 0 : 2;
|
|
25
|
-
message.
|
|
26
|
+
message.open({
|
|
26
27
|
key: key,
|
|
27
28
|
icon: /*#__PURE__*/_jsx("span", {
|
|
28
29
|
className: "".concat(tipCode, "Icon"),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.anticon-loading-spin {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
animation: loong 1s infinite linear;
|
|
4
|
+
|
|
5
|
+
// &:before {
|
|
6
|
+
// display: inline-block;
|
|
7
|
+
// animation: loong 1s infinite linear;
|
|
8
|
+
// -webkit-animation: loong 1s infinite linear
|
|
9
|
+
// }
|
|
10
|
+
}
|
|
11
|
+
@keyframes loong {
|
|
12
|
+
100% {
|
|
13
|
+
transform: rotate(360deg);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -70,7 +70,8 @@ var updateModal = function updateModal(_ref3) {
|
|
|
70
70
|
_ref3$duration = _ref3.duration,
|
|
71
71
|
duration = _ref3$duration === void 0 ? 3000 : _ref3$duration,
|
|
72
72
|
afterClose = _ref3.afterClose;
|
|
73
|
-
console.log('==================', modal);
|
|
73
|
+
// console.log('==================', modal);
|
|
74
|
+
|
|
74
75
|
if (modal) {
|
|
75
76
|
modal.update(_objectSpread(_objectSpread({}, config({
|
|
76
77
|
tipCode: tipCode,
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.xmTtn {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
42
|
+
// .xmTtn {
|
|
43
|
+
// width: 76px;
|
|
44
|
+
// height: 32px;
|
|
45
|
+
// border-radius: 2px;
|
|
46
|
+
// // margin-bottom: 8px;
|
|
47
|
+
// padding: 0 !important;
|
|
48
|
+
// }
|
|
49
49
|
|
|
50
50
|
// .xmTtnDefault {
|
|
51
51
|
// background: rgba(245, 245, 245, 1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnSelectChangeType } from "../type";
|
|
1
|
+
import { DropSide, OnSelectChangeType } from "../type";
|
|
2
2
|
import { Table } from '@tanstack/react-table';
|
|
3
3
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
4
|
import './index.less';
|
|
@@ -51,6 +51,13 @@ type IRowProps = {
|
|
|
51
51
|
color: string;
|
|
52
52
|
};
|
|
53
53
|
tableTooltip: boolean;
|
|
54
|
+
changeHoverRow: (params: {
|
|
55
|
+
target?: any;
|
|
56
|
+
origin?: any;
|
|
57
|
+
}) => void;
|
|
58
|
+
clearHoverRowIndex: () => void;
|
|
59
|
+
hoverRowIndex: number;
|
|
60
|
+
dropSide: DropSide;
|
|
54
61
|
};
|
|
55
|
-
declare const Row: ({ tableBodyRef, table, tableId, row, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, reorderRow, canRowDrag, rowClassName, cellClassName, rowStyle, getCellProps, editting, rowEditing, renderSubComponent, selectedRowDragging, setSelectedRowDragging, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, rowHeight, disableDragRowIds, selectRowWhenClick, handleEditRowWhenDClick, canEditRowWhenDClick, theme, dragBeforeStart, shadowColumnInfo, onCellContextMenu, getRowHoverTipConfig, tableTooltip, }: IRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare const Row: ({ tableBodyRef, table, tableId, row, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, reorderRow, canRowDrag, rowClassName, cellClassName, rowStyle, getCellProps, editting, rowEditing, renderSubComponent, selectedRowDragging, setSelectedRowDragging, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, rowHeight, disableDragRowIds, selectRowWhenClick, handleEditRowWhenDClick, canEditRowWhenDClick, theme, dragBeforeStart, shadowColumnInfo, onCellContextMenu, getRowHoverTipConfig, tableTooltip, changeHoverRow, clearHoverRowIndex, hoverRowIndex, dropSide, }: IRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
63
|
export default Row;
|
|
@@ -10,13 +10,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
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
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { DropSide } from "../type";
|
|
13
14
|
import { flexRender } from '@tanstack/react-table';
|
|
14
15
|
import { Tooltip } from 'antd';
|
|
15
16
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
16
17
|
import { useDrag, useDrop } from 'react-dnd';
|
|
17
18
|
import { getEmptyImage } from 'react-dnd-html5-backend';
|
|
18
|
-
import { EditableCell } from "../components/ColumnEdit";
|
|
19
19
|
import { getPinningStyle } from "../TableHeader/utils";
|
|
20
|
+
import { EditableCell } from "../components/ColumnEdit";
|
|
20
21
|
import "./index.less";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -61,19 +62,37 @@ var Row = function Row(_ref) {
|
|
|
61
62
|
shadowColumnInfo = _ref.shadowColumnInfo,
|
|
62
63
|
onCellContextMenu = _ref.onCellContextMenu,
|
|
63
64
|
getRowHoverTipConfig = _ref.getRowHoverTipConfig,
|
|
64
|
-
tableTooltip = _ref.tableTooltip
|
|
65
|
+
tableTooltip = _ref.tableTooltip,
|
|
66
|
+
changeHoverRow = _ref.changeHoverRow,
|
|
67
|
+
clearHoverRowIndex = _ref.clearHoverRowIndex,
|
|
68
|
+
hoverRowIndex = _ref.hoverRowIndex,
|
|
69
|
+
dropSide = _ref.dropSide;
|
|
70
|
+
var dropPreviewLineClassName = useMemo(function () {
|
|
71
|
+
if (hoverRowIndex === row.index) {
|
|
72
|
+
return dropSide === DropSide.Top ? 'showTopBorder' : 'showBottomBorder';
|
|
73
|
+
} else {
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
}, [hoverRowIndex, dropSide]);
|
|
65
77
|
var timerRef = useRef();
|
|
66
78
|
var _useDrop = useDrop({
|
|
67
79
|
accept: 'TABLE_ROW',
|
|
68
80
|
drop: function drop(formDatas
|
|
69
81
|
// monitor
|
|
70
82
|
) {
|
|
71
|
-
|
|
83
|
+
clearHoverRowIndex();
|
|
72
84
|
return reorderRow === null || reorderRow === void 0 ? void 0 : reorderRow(formDatas, {
|
|
73
85
|
hoverRow: row,
|
|
74
86
|
targetTableId: tableId
|
|
75
87
|
});
|
|
76
|
-
|
|
88
|
+
},
|
|
89
|
+
hover: function hover(item, monitor) {
|
|
90
|
+
if (monitor.isOver() && monitor.canDrop()) {
|
|
91
|
+
changeHoverRow({
|
|
92
|
+
target: row,
|
|
93
|
+
origin: item
|
|
94
|
+
});
|
|
95
|
+
}
|
|
77
96
|
}
|
|
78
97
|
}),
|
|
79
98
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
@@ -262,6 +281,9 @@ var Row = function Row(_ref) {
|
|
|
262
281
|
canSelection && !selectRowWhenClick && String(row.id) === String(rowHighLightId) // 多选并且点击行时不选中,高亮状态单独管理
|
|
263
282
|
;
|
|
264
283
|
}, [row.id, row.getIsSelected(), rowSelectedId, selectRowWhenClick, rowHighLightId, canSelection]);
|
|
284
|
+
|
|
285
|
+
// console.log('row render', row.id);
|
|
286
|
+
|
|
265
287
|
var rowCom = function rowCom() {
|
|
266
288
|
var _row;
|
|
267
289
|
return /*#__PURE__*/_jsx("tr", {
|
|
@@ -277,7 +299,7 @@ var Row = function Row(_ref) {
|
|
|
277
299
|
onClick: rowClickOrDoubleClick,
|
|
278
300
|
onMouseEnter: rowMouseEnter,
|
|
279
301
|
onMouseLeave: rowMouseLeave,
|
|
280
|
-
className: "tbody-tr ".concat(isHighLight ? 'tbody-tr-selected' : '', " ").concat((rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row).map(function (item) {
|
|
302
|
+
className: "tbody-tr ".concat(isHighLight ? 'tbody-tr-selected' : '', " ").concat(dropPreviewLineClassName, " ").concat((rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row).map(function (item) {
|
|
281
303
|
return "".concat(item, "-").concat(theme);
|
|
282
304
|
}).join(' ')) || ''),
|
|
283
305
|
children: (_row = row["getVisibleCells"]) === null || _row === void 0 ? void 0 : _row.call(row).map(function (cell) {
|