@vtx/components 4.0.0-beta.8 → 4.0.0-beta.81
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/README.md +19 -19
- package/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +53 -52
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +106 -137
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +124 -32
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -33
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +211 -70
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +30 -19
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +37 -33
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +57 -3
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +13 -9
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +102 -36
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +42 -34
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +98 -35
- package/es/vtx-tree-select/index.js +71 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +93 -39
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +54 -52
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +113 -143
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +124 -32
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -34
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +209 -71
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -18
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +37 -33
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +57 -3
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +13 -9
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +104 -38
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +40 -31
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +96 -33
- package/lib/vtx-tree-select/index.js +71 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +91 -37
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/package.json +240 -225
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/es/vtx-datagrid/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import useSet from "../utils/useSet";
|
|
|
23
23
|
import Alert from "./Alert";
|
|
24
24
|
import ToolBar from "./ToolBar";
|
|
25
25
|
import { Container, TableContext } from "./Store/Provide";
|
|
26
|
+
import { mergeComponentsForResize } from "./mergeComponents";
|
|
26
27
|
import { useStyle } from "./style/index";
|
|
27
28
|
import { useAntdColumnResize } from 'react-antd-column-resize';
|
|
28
29
|
import { useIntl } from "../vtx-provider";
|
|
@@ -32,8 +33,8 @@ var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
|
32
33
|
export var indexColumnKey = '_serialNum';
|
|
33
34
|
export var DEFAULT_HEIGHTS = {
|
|
34
35
|
HEAD_FOOT: 115,
|
|
35
|
-
ALERT:
|
|
36
|
-
TOOLBAR:
|
|
36
|
+
ALERT: 48,
|
|
37
|
+
TOOLBAR: 64
|
|
37
38
|
};
|
|
38
39
|
function VtxTable(props) {
|
|
39
40
|
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
|
|
@@ -52,17 +53,19 @@ function VtxTable(props) {
|
|
|
52
53
|
isDragRef = _useContext2.isDragRef,
|
|
53
54
|
rootDomRef = _useContext2.rootDomRef,
|
|
54
55
|
sortKeyColumns = _useContext2.sortKeyColumns,
|
|
55
|
-
TextEnum = _useContext2.TextEnum
|
|
56
|
+
TextEnum = _useContext2.TextEnum,
|
|
57
|
+
tableSize = _useContext2.tableSize;
|
|
56
58
|
var _useSet = useSet({
|
|
57
59
|
// 表格id
|
|
58
60
|
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
59
|
-
scrollY:
|
|
61
|
+
scrollY: undefined
|
|
60
62
|
}),
|
|
61
63
|
_useSet2 = _slicedToArray(_useSet, 2),
|
|
62
64
|
_useSet2$ = _useSet2[0],
|
|
63
65
|
datagridId = _useSet2$.datagridId,
|
|
64
66
|
scrollY = _useSet2$.scrollY,
|
|
65
67
|
setState = _useSet2[1];
|
|
68
|
+
var scrollYRef = useRef(undefined);
|
|
66
69
|
// 列设置提示高度
|
|
67
70
|
var alertHeight = useRef(0);
|
|
68
71
|
// 工具栏高度
|
|
@@ -107,25 +110,65 @@ function VtxTable(props) {
|
|
|
107
110
|
|
|
108
111
|
// 高度计算
|
|
109
112
|
var _useThrottleFn = useThrottleFn(function () {
|
|
110
|
-
var _rootDomRef$current;
|
|
113
|
+
var _rootDomRef$current, _bodyDiv$getElementsB;
|
|
111
114
|
if (!rootDomRef.current) {
|
|
112
115
|
return null;
|
|
113
116
|
}
|
|
114
|
-
var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
115
117
|
var divs = rootDomRef.current.getElementsByTagName('div');
|
|
118
|
+
var pagination = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('ul'), function (dom) {
|
|
119
|
+
return dom.className.includes('ant-pagination');
|
|
120
|
+
})[0];
|
|
121
|
+
var tableHeader = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('thead'), function (dom) {
|
|
122
|
+
return dom.className.includes('ant-table-thead');
|
|
123
|
+
})[0];
|
|
124
|
+
var _headFootHeight = headFootHeight;
|
|
125
|
+
if (tableHeader) {
|
|
126
|
+
_headFootHeight = ((pagination === null || pagination === void 0 ? void 0 : pagination.clientHeight) || 0) + 32 + (tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.clientHeight);
|
|
127
|
+
}
|
|
128
|
+
var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - _headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
129
|
+
if (!bodyHeight || bodyHeight <= 0) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
116
132
|
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
117
|
-
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
|
|
133
|
+
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content') || dom.className.includes('ant-table-tbody');
|
|
118
134
|
})[0];
|
|
135
|
+
var tablePlaceholder = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('tr'), function (dom) {
|
|
136
|
+
return dom.className.includes('ant-table-placeholder');
|
|
137
|
+
})[0];
|
|
138
|
+
if (!bodyDiv) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
var tableHeight = ((_bodyDiv$getElementsB = bodyDiv.getElementsByTagName('table')) === null || _bodyDiv$getElementsB === void 0 || (_bodyDiv$getElementsB = _bodyDiv$getElementsB[0]) === null || _bodyDiv$getElementsB === void 0 ? void 0 : _bodyDiv$getElementsB.clientHeight) || 0;
|
|
142
|
+
var minBodyHeight = Math.max(bodyHeight - (rest.scrollY || 0), 0);
|
|
119
143
|
if (bodyDiv) {
|
|
120
|
-
bodyDiv.style.minHeight = "".concat(
|
|
144
|
+
bodyDiv.style.minHeight = "".concat(minBodyHeight, "px");
|
|
145
|
+
}
|
|
146
|
+
if (tablePlaceholder) {
|
|
147
|
+
var placeholderHeight = Math.max(bodyHeight - (rest.scrollY || 0) - 48 - 12, 0);
|
|
148
|
+
tablePlaceholder.style.height = "".concat(placeholderHeight, "px");
|
|
149
|
+
var tableCell = Array.prototype.filter.call(tablePlaceholder.getElementsByTagName('td'), function (dom) {
|
|
150
|
+
return dom.className.includes('ant-table-cell');
|
|
151
|
+
})[0];
|
|
152
|
+
if (tableCell) {
|
|
153
|
+
tableCell.style.height = "".concat(placeholderHeight, "px");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// antd6.x 的bug 如果table的高度 没有body 高 则没有滚动条
|
|
157
|
+
|
|
158
|
+
var nextScrollY = tableHeight > bodyHeight ? bodyHeight : undefined;
|
|
159
|
+
if (scrollYRef.current !== nextScrollY) {
|
|
160
|
+
scrollYRef.current = nextScrollY;
|
|
161
|
+
setState({
|
|
162
|
+
scrollY: nextScrollY
|
|
163
|
+
});
|
|
121
164
|
}
|
|
122
|
-
setState({
|
|
123
|
-
scrollY: bodyHeight
|
|
124
|
-
});
|
|
125
165
|
}, {
|
|
126
166
|
wait: 350
|
|
127
167
|
}),
|
|
128
168
|
calculateHeight = _useThrottleFn.run;
|
|
169
|
+
useEffect(function () {
|
|
170
|
+
scrollYRef.current = scrollY;
|
|
171
|
+
}, [scrollY]);
|
|
129
172
|
useEffect(function () {
|
|
130
173
|
var resizeObserver = new ResizeObserver(function () {
|
|
131
174
|
calculateHeight();
|
|
@@ -140,7 +183,14 @@ function VtxTable(props) {
|
|
|
140
183
|
resizeObserver.disconnect();
|
|
141
184
|
}
|
|
142
185
|
};
|
|
143
|
-
}, [autoFit]);
|
|
186
|
+
}, [autoFit, tableSize]);
|
|
187
|
+
|
|
188
|
+
// fix: 最后一页,横向滚动条上移问题
|
|
189
|
+
useEffect(function () {
|
|
190
|
+
if (scrollY > 0) {
|
|
191
|
+
calculateHeight();
|
|
192
|
+
}
|
|
193
|
+
}, [scrollY]);
|
|
144
194
|
useLayoutEffect(function () {
|
|
145
195
|
if (autoFit) {
|
|
146
196
|
calculateHeight();
|
|
@@ -181,9 +231,6 @@ function VtxTable(props) {
|
|
|
181
231
|
});
|
|
182
232
|
};
|
|
183
233
|
var _tableColumn = loopFilter(counter.tableColumn);
|
|
184
|
-
if (!columnsMap['_serialNum']) {
|
|
185
|
-
return [];
|
|
186
|
-
}
|
|
187
234
|
return sortByKeyArrayExtract(_tableColumn, sortKeyColumns, columnsMap, 'key');
|
|
188
235
|
}, [columnsMap, counter.tableColumn, sortKeyColumns]);
|
|
189
236
|
|
|
@@ -221,9 +268,12 @@ function VtxTable(props) {
|
|
|
221
268
|
result = _objectSpread(_objectSpread({}, result), {}, {
|
|
222
269
|
y: scrollY - (rest.scrollY || 0)
|
|
223
270
|
});
|
|
271
|
+
if (scrollY == undefined) {
|
|
272
|
+
result.y = undefined;
|
|
273
|
+
}
|
|
224
274
|
}
|
|
225
275
|
return result;
|
|
226
|
-
}, [rest.scroll, rest.scrollY, autoFit]);
|
|
276
|
+
}, [rest.scroll, rest.scrollY, scrollY, autoFit]);
|
|
227
277
|
var hasAlert = useMemo(function () {
|
|
228
278
|
var _rest$rowSelection2;
|
|
229
279
|
return (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
@@ -237,15 +287,44 @@ function VtxTable(props) {
|
|
|
237
287
|
var _useAntdColumnResize = useAntdColumnResize(function () {
|
|
238
288
|
return {
|
|
239
289
|
columns: columns,
|
|
240
|
-
minWidth:
|
|
290
|
+
minWidth: 10
|
|
241
291
|
};
|
|
242
292
|
}, [columns]),
|
|
243
293
|
resizableColumns = _useAntdColumnResize.resizableColumns,
|
|
244
294
|
resizeComponents = _useAntdColumnResize.components,
|
|
245
295
|
tableWidth = _useAntdColumnResize.tableWidth,
|
|
246
296
|
resetColumns = _useAntdColumnResize.resetColumns;
|
|
297
|
+
|
|
298
|
+
// const _columns = useMemo(() => {
|
|
299
|
+
// let result = [];
|
|
300
|
+
// if (!showTable) {
|
|
301
|
+
// result = []
|
|
302
|
+
// } else if (isDragRef) {
|
|
303
|
+
// result = resizableColumns
|
|
304
|
+
// } else {
|
|
305
|
+
// result = columns
|
|
306
|
+
// }
|
|
307
|
+
// let flag = false;
|
|
308
|
+
// result?.map((v) => {
|
|
309
|
+
// if (columnsMap[v.key].width !== v.width) {
|
|
310
|
+
// flag = true;
|
|
311
|
+
// columnsMap[v.key] = {
|
|
312
|
+
// ...columnsMap[v.key],
|
|
313
|
+
// width: v.width
|
|
314
|
+
// };
|
|
315
|
+
// }
|
|
316
|
+
// })
|
|
317
|
+
// if (flag) {
|
|
318
|
+
// counter.setColumnsMap(
|
|
319
|
+
// columnsMap
|
|
320
|
+
// )
|
|
321
|
+
// }
|
|
322
|
+
// return result;
|
|
323
|
+
|
|
324
|
+
// }, [isDragRef, resizableColumns, showTable, columns, columnsMap])
|
|
325
|
+
|
|
326
|
+
// 1. 先计算列配置
|
|
247
327
|
var _columns = useMemo(function () {
|
|
248
|
-
var _result;
|
|
249
328
|
var result = [];
|
|
250
329
|
if (!showTable) {
|
|
251
330
|
result = [];
|
|
@@ -254,24 +333,30 @@ function VtxTable(props) {
|
|
|
254
333
|
} else {
|
|
255
334
|
result = columns;
|
|
256
335
|
}
|
|
336
|
+
return result;
|
|
337
|
+
}, [isDragRef, resizableColumns, showTable, columns]);
|
|
338
|
+
|
|
339
|
+
// 2. 在 effect 中同步列宽到 columnsMap
|
|
340
|
+
useEffect(function () {
|
|
341
|
+
if (!showTable || !_columns.length) return;
|
|
257
342
|
var flag = false;
|
|
258
|
-
|
|
259
|
-
|
|
343
|
+
var newColumnsMap = _objectSpread({}, columnsMap); // 创建副本避免直接修改
|
|
344
|
+
|
|
345
|
+
_columns.forEach(function (v) {
|
|
346
|
+
var _columnsMap$v$key;
|
|
347
|
+
if (((_columnsMap$v$key = columnsMap[v.key]) === null || _columnsMap$v$key === void 0 ? void 0 : _columnsMap$v$key.width) !== v.width) {
|
|
260
348
|
flag = true;
|
|
261
|
-
|
|
349
|
+
newColumnsMap[v.key] = _objectSpread(_objectSpread({}, newColumnsMap[v.key]), {}, {
|
|
350
|
+
width: v.width
|
|
351
|
+
});
|
|
262
352
|
}
|
|
263
353
|
});
|
|
264
354
|
if (flag) {
|
|
265
|
-
counter.setColumnsMap(
|
|
355
|
+
counter.setColumnsMap(newColumnsMap);
|
|
266
356
|
}
|
|
267
|
-
|
|
268
|
-
}, [isDragRef, resizableColumns, showTable, columns, columnsMap]);
|
|
357
|
+
}, [_columns, columnsMap, counter, showTable]);
|
|
269
358
|
var _components = useMemo(function () {
|
|
270
|
-
|
|
271
|
-
return resizeComponents;
|
|
272
|
-
} else {
|
|
273
|
-
return components;
|
|
274
|
-
}
|
|
359
|
+
return mergeComponentsForResize(components, resizeComponents, isDragRef);
|
|
275
360
|
}, [isDragRef, resizeComponents, components]);
|
|
276
361
|
|
|
277
362
|
// 工具栏
|
|
@@ -293,20 +378,24 @@ function VtxTable(props) {
|
|
|
293
378
|
}) : null;
|
|
294
379
|
return wrapSSR( /*#__PURE__*/_jsxs("div", {
|
|
295
380
|
id: datagridId,
|
|
296
|
-
className: classnames(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !(dataSource !== null && dataSource !== void 0 && dataSource.length)), "".concat(prefixCls, "-userAgent-mac"), isMac), "".concat(prefixCls, "-striped"), tableStyles.includes('striped')), "".concat(prefixCls, "-no-border"), !tableStyles.includes('border')), "".concat(prefixCls, "-header-background"), tableStyles.includes('header-background')), hashId),
|
|
381
|
+
className: classnames(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !(dataSource !== null && dataSource !== void 0 && dataSource.length)), "".concat(prefixCls, "-userAgent-mac"), isMac), "".concat(prefixCls, "-striped"), tableStyles.includes('striped')), "".concat(prefixCls, "-no-border"), !tableStyles.includes('border')), "".concat(prefixCls, "-no-data"), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) === 0), "".concat(prefixCls, "-header-background"), tableStyles.includes('header-background')), "".concat(prefixCls, "-no-header-background"), !tableStyles.includes('header-background')), hashId),
|
|
297
382
|
ref: rootDomRef,
|
|
298
383
|
style: style,
|
|
299
384
|
children: [toolbarRender, alertRender, /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
|
300
385
|
size: counter.tableSize,
|
|
301
386
|
bordered: true
|
|
387
|
+
// virtual
|
|
302
388
|
}, rest), {}, {
|
|
303
389
|
dataSource: dataSource,
|
|
304
390
|
scroll: _objectSpread({
|
|
305
391
|
x: 'max-content'
|
|
306
392
|
}, scroll),
|
|
307
393
|
pagination: getPagination(rest.pagination),
|
|
308
|
-
|
|
309
|
-
|
|
394
|
+
xs: true,
|
|
395
|
+
styles: {
|
|
396
|
+
root: {
|
|
397
|
+
height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
|
|
398
|
+
}
|
|
310
399
|
},
|
|
311
400
|
locale: _objectSpread({
|
|
312
401
|
emptyText: /*#__PURE__*/_jsx(Empty, {
|
|
@@ -315,6 +404,9 @@ function VtxTable(props) {
|
|
|
315
404
|
}, rest.locale),
|
|
316
405
|
components: _components,
|
|
317
406
|
columns: _columns
|
|
407
|
+
// tableLayout={'auto'}
|
|
408
|
+
,
|
|
409
|
+
tableLayout: "fixed"
|
|
318
410
|
}))]
|
|
319
411
|
}));
|
|
320
412
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export function mergeComponentsForResize(components, resizeComponents, isDragRef) {
|
|
8
|
+
if (!isDragRef) {
|
|
9
|
+
return components;
|
|
10
|
+
}
|
|
11
|
+
return _objectSpread(_objectSpread(_objectSpread({}, resizeComponents || {}), components || {}), {}, {
|
|
12
|
+
header: _objectSpread(_objectSpread({}, (components === null || components === void 0 ? void 0 : components.header) || {}), (resizeComponents === null || resizeComponents === void 0 ? void 0 : resizeComponents.header) || {}),
|
|
13
|
+
body: _objectSpread(_objectSpread({}, (resizeComponents === null || resizeComponents === void 0 ? void 0 : resizeComponents.body) || {}), (components === null || components === void 0 ? void 0 : components.body) || {})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
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
|
-
var _excluded = ["confirm"]
|
|
2
|
+
var _excluded = ["confirm"],
|
|
3
|
+
_excluded2 = ["confirm"];
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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; }
|
|
3
10
|
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; }
|
|
4
11
|
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; }
|
|
5
12
|
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; }
|
|
@@ -7,12 +14,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
14
|
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); }
|
|
8
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
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."); }
|
|
12
|
-
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); }
|
|
13
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
|
-
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; }
|
|
16
17
|
import { DownOutlined } from '@ant-design/icons';
|
|
17
18
|
import { Divider, Dropdown, Popconfirm } from 'antd';
|
|
18
19
|
import Icon from "../vtx-icon";
|
|
@@ -45,14 +46,32 @@ var renderColumnButtons = function renderColumnButtons(_ref) {
|
|
|
45
46
|
/* eslint-disable */
|
|
46
47
|
moreRender = /*#__PURE__*/_jsx(Dropdown, {
|
|
47
48
|
menu: {
|
|
48
|
-
items: (moreActions === null || moreActions === void 0 ? void 0 : moreActions.map(function (item,
|
|
49
|
+
items: (moreActions === null || moreActions === void 0 ? void 0 : moreActions.map(function (item, index) {
|
|
50
|
+
var name = item.name,
|
|
51
|
+
popconfirm = item.popconfirm;
|
|
52
|
+
if (popconfirm) {
|
|
53
|
+
var confirm = popconfirm.confirm,
|
|
54
|
+
rest = _objectWithoutProperties(popconfirm, _excluded);
|
|
55
|
+
return {
|
|
56
|
+
key: index,
|
|
57
|
+
label: /*#__PURE__*/_jsx(Popconfirm, _objectSpread(_objectSpread({
|
|
58
|
+
trigger: ['hover'],
|
|
59
|
+
onConfirm: confirm ? function () {
|
|
60
|
+
return confirm(record, index);
|
|
61
|
+
} : undefined
|
|
62
|
+
}, rest), {}, {
|
|
63
|
+
children: name
|
|
64
|
+
}))
|
|
65
|
+
};
|
|
66
|
+
}
|
|
49
67
|
return {
|
|
50
|
-
key:
|
|
68
|
+
key: index,
|
|
51
69
|
label: item.name
|
|
52
70
|
};
|
|
53
71
|
})) || [],
|
|
54
72
|
onClick: function onClick(e) {
|
|
55
|
-
|
|
73
|
+
var _moreActions$e$key, _moreActions$e$key$on;
|
|
74
|
+
(_moreActions$e$key = moreActions[e.key]) === null || _moreActions$e$key === void 0 || (_moreActions$e$key$on = _moreActions$e$key.onClick) === null || _moreActions$e$key$on === void 0 || _moreActions$e$key$on.call(_moreActions$e$key, record, index);
|
|
56
75
|
}
|
|
57
76
|
},
|
|
58
77
|
children: /*#__PURE__*/_jsxs("a", {
|
|
@@ -82,7 +101,7 @@ var renderColumnButtons = function renderColumnButtons(_ref) {
|
|
|
82
101
|
}, name);
|
|
83
102
|
if (popconfirm) {
|
|
84
103
|
var confirm = popconfirm.confirm,
|
|
85
|
-
rest = _objectWithoutProperties(popconfirm,
|
|
104
|
+
rest = _objectWithoutProperties(popconfirm, _excluded2);
|
|
86
105
|
btnNode = /*#__PURE__*/_createElement(Popconfirm, _objectSpread(_objectSpread({}, rest), {}, {
|
|
87
106
|
onConfirm: confirm ? function () {
|
|
88
107
|
return confirm(record, index);
|
|
@@ -8,37 +8,85 @@ import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
|
8
8
|
var genVtxStyle = function genVtxStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls,
|
|
10
10
|
antCls = token.antCls;
|
|
11
|
-
return _defineProperty(
|
|
11
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
|
|
12
12
|
position: 'relative',
|
|
13
|
-
overflow: 'hidden'
|
|
14
|
-
|
|
13
|
+
// overflow: 'hidden',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column'
|
|
16
|
+
}, "".concat(antCls, "-table-cell-ellipsis"), {
|
|
17
|
+
whiteSpace: 'normal'
|
|
18
|
+
}), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
|
|
19
|
+
// minWidth: "calc(100% - 2px) !important"
|
|
20
|
+
}), '.ant-spin, .ant-spin-nested-loading', _defineProperty({
|
|
21
|
+
height: '100%'
|
|
22
|
+
}, '.ant-spin-container', _defineProperty({
|
|
23
|
+
height: '100%',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column'
|
|
26
|
+
}, '.ant-table', _defineProperty({
|
|
27
|
+
// height: '100%',
|
|
28
|
+
flex: 1
|
|
29
|
+
}, '.ant-table-container', _defineProperty(_defineProperty({
|
|
30
|
+
height: '100%',
|
|
31
|
+
borderInlineStart: 'none'
|
|
32
|
+
}, '.ant-table-body', {
|
|
33
|
+
scrollbarWidth: 'thin'
|
|
34
|
+
}), '.ant-table-content', _defineProperty({
|
|
35
|
+
height: '100%',
|
|
36
|
+
scrollbarWidth: 'thin'
|
|
37
|
+
}, 'table', {
|
|
38
|
+
// height: '100%',
|
|
39
|
+
minWidth: 'calc(100% - 1px) !important'
|
|
40
|
+
})))))), '.ant-table', _defineProperty(_defineProperty(_defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
|
|
15
41
|
'>tr>th': {
|
|
16
|
-
background: token.colorBgContainer
|
|
42
|
+
background: token.colorBgContainer,
|
|
43
|
+
'&:first-child': {
|
|
44
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
45
|
+
}
|
|
17
46
|
}
|
|
18
47
|
})), '.ant-table-cell', {
|
|
19
|
-
minWidth:
|
|
20
|
-
}), '.ant-table-
|
|
48
|
+
// minWidth: 10,
|
|
49
|
+
}), '.ant-table-tbody', {
|
|
50
|
+
'>tr>td': {
|
|
51
|
+
'&:first-child': {
|
|
52
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
21
55
|
'>tr.ant-table-placeholder': {
|
|
22
56
|
position: 'absolute',
|
|
23
|
-
top: '
|
|
57
|
+
top: 'auto',
|
|
58
|
+
bottom: 'auto',
|
|
24
59
|
right: 0,
|
|
25
60
|
left: 0,
|
|
26
61
|
backgroundColor: 'transparent',
|
|
27
62
|
borderTop: 'none',
|
|
63
|
+
// borderInlineEnd: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
|
|
64
|
+
// borderBottom: "var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)",
|
|
28
65
|
'>td.ant-table-cell': {
|
|
29
|
-
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
justifyContent: 'center',
|
|
66
|
+
padding: 0,
|
|
32
67
|
width: '100%',
|
|
33
68
|
height: '100%',
|
|
34
|
-
border: 'none'
|
|
69
|
+
border: 'none',
|
|
70
|
+
'>.ant-table-expanded-row-fixed': {
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
height: '100%',
|
|
75
|
+
width: '100%',
|
|
76
|
+
'&::after': {
|
|
77
|
+
border: 'none'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
35
80
|
}
|
|
36
81
|
}
|
|
37
|
-
}))
|
|
82
|
+
})), '.ant-pagination', _defineProperty({
|
|
83
|
+
margin: 'var(--ant-margin) 0 0 0'
|
|
84
|
+
}, '.ant-pagination-item', {
|
|
38
85
|
borderRadius: token.borderRadiusSM
|
|
39
|
-
}))), "
|
|
40
|
-
height: '100%'
|
|
41
|
-
|
|
86
|
+
})))), "".concat(componentCls, "-fit"), {
|
|
87
|
+
height: '100%',
|
|
88
|
+
minHeight: 200
|
|
89
|
+
}), "".concat(componentCls, "-noFit"), {}), "".concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({
|
|
42
90
|
borderColor: 'transparent'
|
|
43
91
|
}, '.ant-table-thead', {
|
|
44
92
|
'>tr>th': {
|
|
@@ -47,10 +95,14 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
47
95
|
}), '.ant-table-body', {
|
|
48
96
|
'>table >tbody>tr>td': {
|
|
49
97
|
borderInlineColor: 'transparent !important'
|
|
98
|
+
},
|
|
99
|
+
'>table >tbody>tr.ant-table-placeholder': {
|
|
100
|
+
borderInlineColor: 'transparent !important',
|
|
101
|
+
borderBottomColor: 'transparent !important'
|
|
50
102
|
}
|
|
51
|
-
}))))), "
|
|
103
|
+
}))))), "".concat(componentCls, "-striped"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, "".concat(antCls, "-table"), _defineProperty({}, '>.ant-table-container', _defineProperty(_defineProperty({}, '.ant-table-body', {
|
|
52
104
|
'>table >tbody>tr:nth-child(odd)>td': {
|
|
53
|
-
backgroundColor: token.
|
|
105
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
54
106
|
'&.ant-table-cell-row-hover': {
|
|
55
107
|
backgroundColor: token.colorFillAlterSolid
|
|
56
108
|
}
|
|
@@ -64,11 +116,41 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
64
116
|
backgroundColor: token.controlItemBgActiveHover
|
|
65
117
|
}
|
|
66
118
|
}
|
|
67
|
-
})
|
|
119
|
+
}), '.ant-table-tbody', {
|
|
120
|
+
'>tr:nth-child(odd)>td': {
|
|
121
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
122
|
+
'&.ant-table-cell-row-hover': {
|
|
123
|
+
backgroundColor: token.colorFillAlterSolid
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
'>tr:nth-child(odd)>td.ant-table-column-sort': {
|
|
127
|
+
backgroundColor: token.colorFillAlterSolid
|
|
128
|
+
},
|
|
129
|
+
'>tr.ant-table-row-selected:nth-child(odd)>td': {
|
|
130
|
+
backgroundColor: token.controlItemBgActive,
|
|
131
|
+
'&.ant-table-cell-row-hover': {
|
|
132
|
+
backgroundColor: token.controlItemBgActiveHover
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}))))), "".concat(componentCls, "-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-header', _defineProperty({}, '.ant-table-thead', {
|
|
68
136
|
'>tr>th': {
|
|
69
|
-
background: token.
|
|
137
|
+
background: token.colorBgLayoutTable
|
|
138
|
+
}
|
|
139
|
+
}))))), "".concat(componentCls, "-no-header-background"), _defineProperty({}, "".concat(antCls, "-table-wrapper "), _defineProperty({}, '.ant-table-thead', {
|
|
140
|
+
'>tr>th': {
|
|
141
|
+
background: token.colorBgContainer
|
|
70
142
|
}
|
|
71
|
-
})))))
|
|
143
|
+
}))), "".concat(componentCls, "-no-data"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
|
|
144
|
+
borderInlineStart: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
145
|
+
}, '.ant-table-content', _defineProperty({
|
|
146
|
+
borderRight: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)',
|
|
147
|
+
borderBottom: 'var(--ant-line-width) var(--ant-line-type) var(--ant-table-border-color)'
|
|
148
|
+
}, 'table', {})))))))), "".concat(componentCls, "-no-data").concat(componentCls, "-no-border"), _defineProperty({}, "".concat(antCls, "-table-wrapper"), _defineProperty({}, '.ant-spin', _defineProperty({}, '.ant-spin-container', _defineProperty({}, '.ant-table', _defineProperty({}, '.ant-table-container', _defineProperty({
|
|
149
|
+
borderInlineStart: 'none'
|
|
150
|
+
}, '.ant-table-content', {
|
|
151
|
+
borderRight: 'none',
|
|
152
|
+
borderBottom: 'none'
|
|
153
|
+
})))))));
|
|
72
154
|
};
|
|
73
155
|
export function useStyle(prefix) {
|
|
74
156
|
return useAntdStyle(prefix, function (token) {
|