@vtx/components 4.0.0-beta.7 → 4.0.0-beta.70
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/es/index.js +3 -0
- package/es/utils/filterSpecialCharacters.js +47 -46
- package/es/utils/index.js +1 -2
- package/es/vtx-color-picker/index.js +138 -33
- package/es/vtx-color-picker/style/index.js +36 -12
- package/es/vtx-combogrid/Combogrid.js +16 -10
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-combogrid/style/index.js +4 -4
- package/es/vtx-datagrid/Store/Provide.js +109 -132
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -5
- 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/ToolBar/index.js +2 -2
- package/es/vtx-datagrid/columnState.js +64 -0
- package/es/vtx-datagrid/index.js +114 -35
- 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-date-picker/QdatePicker.js +1 -1
- 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 +25 -25
- package/es/vtx-export-async/History.js +7 -3
- package/es/vtx-export-async/index.js +42 -14
- 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 +18 -17
- 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 +155 -43
- package/es/vtx-import/result.js +6 -2
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +31 -20
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-input/TextArea/index.js +11 -6
- package/es/vtx-modal/index.js +9 -4
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +1 -7
- package/es/vtx-page-layout/TableLayout.js +14 -4
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +2 -8
- package/es/vtx-page-layout/container.js +6 -5
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +20 -10
- package/es/vtx-provider/locale/en_US.js +65 -5
- package/es/vtx-provider/locale/zh_CN.js +75 -5
- package/es/vtx-provider/useStyle/index.js +8 -4
- package/es/vtx-scrollable-row/index.js +38 -28
- package/es/vtx-search/index.js +18 -13
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +132 -46
- 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 +34 -25
- 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 +104 -40
- package/es/vtx-tree-select/index.js +75 -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 +291 -113
- package/es/vtx-wang-editor/wangEditorUtil.js +59 -9
- package/lib/index.js +36 -0
- package/lib/utils/filterSpecialCharacters.js +48 -46
- package/lib/utils/index.js +0 -7
- package/lib/vtx-color-picker/index.js +139 -34
- package/lib/vtx-color-picker/style/index.js +36 -12
- package/lib/vtx-combogrid/Combogrid.js +16 -10
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-combogrid/style/index.js +4 -4
- package/lib/vtx-datagrid/Store/Provide.js +116 -138
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -6
- 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/ToolBar/index.js +2 -2
- package/lib/vtx-datagrid/columnState.js +73 -0
- package/lib/vtx-datagrid/index.js +115 -35
- 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-date-picker/QdatePicker.js +1 -1
- 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 +26 -26
- package/lib/vtx-export-async/History.js +7 -3
- package/lib/vtx-export-async/index.js +40 -12
- 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 +18 -17
- 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 +154 -42
- package/lib/vtx-import/result.js +6 -2
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +30 -19
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-input/TextArea/index.js +11 -6
- package/lib/vtx-modal/index.js +9 -4
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +3 -9
- package/lib/vtx-page-layout/TableLayout.js +14 -4
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +4 -10
- package/lib/vtx-page-layout/container.js +6 -5
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +19 -10
- package/lib/vtx-provider/locale/en_US.js +65 -5
- package/lib/vtx-provider/locale/zh_CN.js +75 -5
- package/lib/vtx-provider/useStyle/index.js +8 -4
- package/lib/vtx-scrollable-row/index.js +38 -28
- package/lib/vtx-search/index.js +18 -13
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +134 -48
- 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 +32 -23
- 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 +102 -38
- package/lib/vtx-tree-select/index.js +75 -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 +289 -113
- package/lib/vtx-wang-editor/wangEditorUtil.js +59 -10
- package/package.json +44 -28
- 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,14 +23,22 @@ 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';
|
|
29
|
+
import { useIntl } from "../vtx-provider";
|
|
28
30
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
31
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
32
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
31
33
|
export var indexColumnKey = '_serialNum';
|
|
34
|
+
export var DEFAULT_HEIGHTS = {
|
|
35
|
+
HEAD_FOOT: 115,
|
|
36
|
+
ALERT: 48,
|
|
37
|
+
TOOLBAR: 64
|
|
38
|
+
};
|
|
32
39
|
function VtxTable(props) {
|
|
33
40
|
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
|
|
41
|
+
var intl = useIntl();
|
|
34
42
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
35
43
|
getPrefixCls = _useContext.getPrefixCls;
|
|
36
44
|
var prefixCls = getPrefixCls('', 'vtx-datagrid');
|
|
@@ -45,7 +53,8 @@ function VtxTable(props) {
|
|
|
45
53
|
isDragRef = _useContext2.isDragRef,
|
|
46
54
|
rootDomRef = _useContext2.rootDomRef,
|
|
47
55
|
sortKeyColumns = _useContext2.sortKeyColumns,
|
|
48
|
-
TextEnum = _useContext2.TextEnum
|
|
56
|
+
TextEnum = _useContext2.TextEnum,
|
|
57
|
+
tableSize = _useContext2.tableSize;
|
|
49
58
|
var _useSet = useSet({
|
|
50
59
|
// 表格id
|
|
51
60
|
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
@@ -66,7 +75,7 @@ function VtxTable(props) {
|
|
|
66
75
|
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
67
76
|
toolbarClassName = props.toolbarClassName,
|
|
68
77
|
_props$toolbarTilte = props.toolbarTilte,
|
|
69
|
-
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
78
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? intl.getMessage('datagrid.queryResults', '查询结果') : _props$toolbarTilte,
|
|
70
79
|
buttonGroup = props.buttonGroup,
|
|
71
80
|
_props$refreshIconVis = props.refreshIconVisible,
|
|
72
81
|
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
@@ -80,14 +89,14 @@ function VtxTable(props) {
|
|
|
80
89
|
_props$autoFit = props.autoFit,
|
|
81
90
|
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
82
91
|
_props$headFootHeight = props.headFootHeight,
|
|
83
|
-
headFootHeight = _props$headFootHeight === void 0 ?
|
|
92
|
+
headFootHeight = _props$headFootHeight === void 0 ? DEFAULT_HEIGHTS.HEAD_FOOT : _props$headFootHeight,
|
|
84
93
|
_props$columnResizabl = props.columnResizable,
|
|
85
94
|
columnResizable = _props$columnResizabl === void 0 ? true : _props$columnResizabl,
|
|
86
95
|
components = props.components,
|
|
87
96
|
className = props.className,
|
|
88
97
|
style = props.style,
|
|
89
98
|
_props$emptyText = props.emptyText,
|
|
90
|
-
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
99
|
+
emptyText = _props$emptyText === void 0 ? intl.getMessage('select.empty', '暂无数据') : _props$emptyText,
|
|
91
100
|
onRowSelectionClear = props.onRowSelectionClear,
|
|
92
101
|
onColumnsSave = props.onColumnsSave,
|
|
93
102
|
uniqueKey = props.uniqueKey,
|
|
@@ -100,20 +109,43 @@ function VtxTable(props) {
|
|
|
100
109
|
|
|
101
110
|
// 高度计算
|
|
102
111
|
var _useThrottleFn = useThrottleFn(function () {
|
|
103
|
-
var _rootDomRef$current;
|
|
112
|
+
var _rootDomRef$current, _bodyDiv$getElementsB;
|
|
104
113
|
if (!rootDomRef.current) {
|
|
105
114
|
return null;
|
|
106
115
|
}
|
|
107
|
-
var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
108
116
|
var divs = rootDomRef.current.getElementsByTagName('div');
|
|
117
|
+
var pagination = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('ul'), function (dom) {
|
|
118
|
+
return dom.className.includes('ant-pagination');
|
|
119
|
+
})[0];
|
|
120
|
+
var tableHeader = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('thead'), function (dom) {
|
|
121
|
+
return dom.className.includes('ant-table-thead');
|
|
122
|
+
})[0];
|
|
123
|
+
var _headFootHeight = headFootHeight;
|
|
124
|
+
if (tableHeader) {
|
|
125
|
+
_headFootHeight = ((pagination === null || pagination === void 0 ? void 0 : pagination.clientHeight) || 0) + 32 + (tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.clientHeight);
|
|
126
|
+
}
|
|
127
|
+
var bodyHeight = ((_rootDomRef$current = rootDomRef.current) === null || _rootDomRef$current === void 0 ? void 0 : _rootDomRef$current.clientHeight) - _headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
109
128
|
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
110
|
-
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
|
|
129
|
+
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content') || dom.className.includes('ant-table-tbody');
|
|
130
|
+
})[0];
|
|
131
|
+
var tablePlaceholder = Array.prototype.filter.call(rootDomRef.current.getElementsByTagName('tr'), function (dom) {
|
|
132
|
+
return dom.className.includes('ant-table-placeholder');
|
|
111
133
|
})[0];
|
|
112
134
|
if (bodyDiv) {
|
|
113
135
|
bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
|
|
114
136
|
}
|
|
137
|
+
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;
|
|
138
|
+
if (tablePlaceholder) {
|
|
139
|
+
tablePlaceholder.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
|
|
140
|
+
var tableCell = Array.prototype.filter.call(tablePlaceholder.getElementsByTagName('td'), function (dom) {
|
|
141
|
+
return dom.className.includes('ant-table-cell');
|
|
142
|
+
})[0];
|
|
143
|
+
tableCell.style.height = "".concat(bodyHeight - (rest.scrollY || 0) - 48 - 12, "px");
|
|
144
|
+
}
|
|
145
|
+
// antd6.x 的bug 如果table的高度 没有body 高 则没有滚动条
|
|
146
|
+
|
|
115
147
|
setState({
|
|
116
|
-
scrollY: bodyHeight
|
|
148
|
+
scrollY: tableHeight > bodyHeight ? bodyHeight : undefined
|
|
117
149
|
});
|
|
118
150
|
}, {
|
|
119
151
|
wait: 350
|
|
@@ -123,19 +155,24 @@ function VtxTable(props) {
|
|
|
123
155
|
var resizeObserver = new ResizeObserver(function () {
|
|
124
156
|
calculateHeight();
|
|
125
157
|
});
|
|
126
|
-
// componentDidMount
|
|
127
158
|
if (autoFit && rootDomRef.current) {
|
|
128
159
|
resizeObserver.observe(rootDomRef.current, {
|
|
129
160
|
box: 'border-box'
|
|
130
161
|
});
|
|
131
162
|
}
|
|
132
163
|
return function () {
|
|
133
|
-
// componentWillUnmount
|
|
134
164
|
if (autoFit) {
|
|
135
165
|
resizeObserver.disconnect();
|
|
136
166
|
}
|
|
137
167
|
};
|
|
138
|
-
}, [autoFit]);
|
|
168
|
+
}, [autoFit, tableSize]);
|
|
169
|
+
|
|
170
|
+
// fix: 最后一页,横向滚动条上移问题
|
|
171
|
+
useEffect(function () {
|
|
172
|
+
if (scrollY > 0) {
|
|
173
|
+
calculateHeight();
|
|
174
|
+
}
|
|
175
|
+
}, [scrollY]);
|
|
139
176
|
useLayoutEffect(function () {
|
|
140
177
|
if (autoFit) {
|
|
141
178
|
calculateHeight();
|
|
@@ -152,7 +189,7 @@ function VtxTable(props) {
|
|
|
152
189
|
showSizeChanger: true,
|
|
153
190
|
showQuickJumper: true,
|
|
154
191
|
showTotal: function showTotal(total) {
|
|
155
|
-
return "".concat(TextEnum.
|
|
192
|
+
return "".concat(TextEnum.paginationTotalText, " ").concat(total, " ").concat(TextEnum.paginationItemText);
|
|
156
193
|
}
|
|
157
194
|
}, pagination);
|
|
158
195
|
};
|
|
@@ -176,9 +213,6 @@ function VtxTable(props) {
|
|
|
176
213
|
});
|
|
177
214
|
};
|
|
178
215
|
var _tableColumn = loopFilter(counter.tableColumn);
|
|
179
|
-
if (!columnsMap['_serialNum']) {
|
|
180
|
-
return [];
|
|
181
|
-
}
|
|
182
216
|
return sortByKeyArrayExtract(_tableColumn, sortKeyColumns, columnsMap, 'key');
|
|
183
217
|
}, [columnsMap, counter.tableColumn, sortKeyColumns]);
|
|
184
218
|
|
|
@@ -216,9 +250,12 @@ function VtxTable(props) {
|
|
|
216
250
|
result = _objectSpread(_objectSpread({}, result), {}, {
|
|
217
251
|
y: scrollY - (rest.scrollY || 0)
|
|
218
252
|
});
|
|
253
|
+
if (scrollY == undefined) {
|
|
254
|
+
result.y = undefined;
|
|
255
|
+
}
|
|
219
256
|
}
|
|
220
257
|
return result;
|
|
221
|
-
}, [rest.scroll, rest.scrollY, autoFit]);
|
|
258
|
+
}, [rest.scroll, rest.scrollY, scrollY, autoFit]);
|
|
222
259
|
var hasAlert = useMemo(function () {
|
|
223
260
|
var _rest$rowSelection2;
|
|
224
261
|
return (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
@@ -227,20 +264,49 @@ function VtxTable(props) {
|
|
|
227
264
|
selectedRowKeys: (_rest$rowSelection4 = rest.rowSelection) === null || _rest$rowSelection4 === void 0 ? void 0 : _rest$rowSelection4.selectedRowKeys,
|
|
228
265
|
onRowSelectionClear: onRowSelectionClear
|
|
229
266
|
}) : null;
|
|
230
|
-
alertHeight.current = !hideSelectionClear && hasAlert ?
|
|
231
|
-
toolbarHeight.current = toolbar ?
|
|
267
|
+
alertHeight.current = !hideSelectionClear && hasAlert ? DEFAULT_HEIGHTS.ALERT : 0;
|
|
268
|
+
toolbarHeight.current = toolbar ? DEFAULT_HEIGHTS.TOOLBAR : 0;
|
|
232
269
|
var _useAntdColumnResize = useAntdColumnResize(function () {
|
|
233
270
|
return {
|
|
234
271
|
columns: columns,
|
|
235
|
-
minWidth:
|
|
272
|
+
minWidth: 10
|
|
236
273
|
};
|
|
237
274
|
}, [columns]),
|
|
238
275
|
resizableColumns = _useAntdColumnResize.resizableColumns,
|
|
239
276
|
resizeComponents = _useAntdColumnResize.components,
|
|
240
277
|
tableWidth = _useAntdColumnResize.tableWidth,
|
|
241
278
|
resetColumns = _useAntdColumnResize.resetColumns;
|
|
279
|
+
|
|
280
|
+
// const _columns = useMemo(() => {
|
|
281
|
+
// let result = [];
|
|
282
|
+
// if (!showTable) {
|
|
283
|
+
// result = []
|
|
284
|
+
// } else if (isDragRef) {
|
|
285
|
+
// result = resizableColumns
|
|
286
|
+
// } else {
|
|
287
|
+
// result = columns
|
|
288
|
+
// }
|
|
289
|
+
// let flag = false;
|
|
290
|
+
// result?.map((v) => {
|
|
291
|
+
// if (columnsMap[v.key].width !== v.width) {
|
|
292
|
+
// flag = true;
|
|
293
|
+
// columnsMap[v.key] = {
|
|
294
|
+
// ...columnsMap[v.key],
|
|
295
|
+
// width: v.width
|
|
296
|
+
// };
|
|
297
|
+
// }
|
|
298
|
+
// })
|
|
299
|
+
// if (flag) {
|
|
300
|
+
// counter.setColumnsMap(
|
|
301
|
+
// columnsMap
|
|
302
|
+
// )
|
|
303
|
+
// }
|
|
304
|
+
// return result;
|
|
305
|
+
|
|
306
|
+
// }, [isDragRef, resizableColumns, showTable, columns, columnsMap])
|
|
307
|
+
|
|
308
|
+
// 1. 先计算列配置
|
|
242
309
|
var _columns = useMemo(function () {
|
|
243
|
-
var _result;
|
|
244
310
|
var result = [];
|
|
245
311
|
if (!showTable) {
|
|
246
312
|
result = [];
|
|
@@ -249,24 +315,30 @@ function VtxTable(props) {
|
|
|
249
315
|
} else {
|
|
250
316
|
result = columns;
|
|
251
317
|
}
|
|
318
|
+
return result;
|
|
319
|
+
}, [isDragRef, resizableColumns, showTable, columns]);
|
|
320
|
+
|
|
321
|
+
// 2. 在 effect 中同步列宽到 columnsMap
|
|
322
|
+
useEffect(function () {
|
|
323
|
+
if (!showTable || !_columns.length) return;
|
|
252
324
|
var flag = false;
|
|
253
|
-
|
|
254
|
-
|
|
325
|
+
var newColumnsMap = _objectSpread({}, columnsMap); // 创建副本避免直接修改
|
|
326
|
+
|
|
327
|
+
_columns.forEach(function (v) {
|
|
328
|
+
var _columnsMap$v$key;
|
|
329
|
+
if (((_columnsMap$v$key = columnsMap[v.key]) === null || _columnsMap$v$key === void 0 ? void 0 : _columnsMap$v$key.width) !== v.width) {
|
|
255
330
|
flag = true;
|
|
256
|
-
|
|
331
|
+
newColumnsMap[v.key] = _objectSpread(_objectSpread({}, newColumnsMap[v.key]), {}, {
|
|
332
|
+
width: v.width
|
|
333
|
+
});
|
|
257
334
|
}
|
|
258
335
|
});
|
|
259
336
|
if (flag) {
|
|
260
|
-
counter.setColumnsMap(
|
|
337
|
+
counter.setColumnsMap(newColumnsMap);
|
|
261
338
|
}
|
|
262
|
-
|
|
263
|
-
}, [isDragRef, resizableColumns, showTable, columns, columnsMap]);
|
|
339
|
+
}, [_columns, columnsMap, counter, showTable]);
|
|
264
340
|
var _components = useMemo(function () {
|
|
265
|
-
|
|
266
|
-
return resizeComponents;
|
|
267
|
-
} else {
|
|
268
|
-
return components;
|
|
269
|
-
}
|
|
341
|
+
return mergeComponentsForResize(components, resizeComponents, isDragRef);
|
|
270
342
|
}, [isDragRef, resizeComponents, components]);
|
|
271
343
|
|
|
272
344
|
// 工具栏
|
|
@@ -279,7 +351,7 @@ function VtxTable(props) {
|
|
|
279
351
|
hideColumnHeight: hideColumnHeight,
|
|
280
352
|
hideColumnSetting: hideColumnSetting,
|
|
281
353
|
onRefresh: onRefresh,
|
|
282
|
-
columns:
|
|
354
|
+
columns: tableColumn,
|
|
283
355
|
onColumnsSave: onColumnsSave,
|
|
284
356
|
uniqueKey: uniqueKey,
|
|
285
357
|
prefixUrl: prefixUrl,
|
|
@@ -288,20 +360,24 @@ function VtxTable(props) {
|
|
|
288
360
|
}) : null;
|
|
289
361
|
return wrapSSR( /*#__PURE__*/_jsxs("div", {
|
|
290
362
|
id: datagridId,
|
|
291
|
-
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),
|
|
363
|
+
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),
|
|
292
364
|
ref: rootDomRef,
|
|
293
365
|
style: style,
|
|
294
366
|
children: [toolbarRender, alertRender, /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
|
295
367
|
size: counter.tableSize,
|
|
296
368
|
bordered: true
|
|
369
|
+
// virtual
|
|
297
370
|
}, rest), {}, {
|
|
298
371
|
dataSource: dataSource,
|
|
299
372
|
scroll: _objectSpread({
|
|
300
373
|
x: 'max-content'
|
|
301
374
|
}, scroll),
|
|
302
375
|
pagination: getPagination(rest.pagination),
|
|
303
|
-
|
|
304
|
-
|
|
376
|
+
xs: true,
|
|
377
|
+
styles: {
|
|
378
|
+
root: {
|
|
379
|
+
height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
|
|
380
|
+
}
|
|
305
381
|
},
|
|
306
382
|
locale: _objectSpread({
|
|
307
383
|
emptyText: /*#__PURE__*/_jsx(Empty, {
|
|
@@ -310,6 +386,9 @@ function VtxTable(props) {
|
|
|
310
386
|
}, rest.locale),
|
|
311
387
|
components: _components,
|
|
312
388
|
columns: _columns
|
|
389
|
+
// tableLayout={'auto'}
|
|
390
|
+
,
|
|
391
|
+
tableLayout: "fixed"
|
|
313
392
|
}))]
|
|
314
393
|
}));
|
|
315
394
|
}
|
|
@@ -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', _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) {
|
|
@@ -26,7 +26,7 @@ export default function VtxQtimePicker(props) {
|
|
|
26
26
|
var _format$split;
|
|
27
27
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
28
28
|
getPrefixCls = _useContext.getPrefixCls;
|
|
29
|
-
var prefixCls = getPrefixCls('', 'vtx-
|
|
29
|
+
var prefixCls = getPrefixCls('', 'vtx-date-picker');
|
|
30
30
|
var _useStyle = useStyle(prefixCls),
|
|
31
31
|
wrapSSR = _useStyle.wrapSSR,
|
|
32
32
|
hashId = _useStyle.hashId;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import React, { useContext } from 'react';
|
|
10
|
+
import { Descriptions } from 'antd';
|
|
11
|
+
import { useStyle } from "./style";
|
|
12
|
+
import { VtxProvider } from "../vtx-provider";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
function VtxDescriptions(props) {
|
|
15
|
+
var _useContext = useContext(VtxProvider),
|
|
16
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
17
|
+
var prefixCls = getPrefixCls('descriptions', props.prefixCls);
|
|
18
|
+
var _useStyle = useStyle(prefixCls),
|
|
19
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
20
|
+
hashId = _useStyle.hashId;
|
|
21
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(props), props));
|
|
22
|
+
return wrapSSR( /*#__PURE__*/_jsx(Descriptions, _objectSpread({
|
|
23
|
+
classNames: {
|
|
24
|
+
root: classnames(hashId, prefixCls)
|
|
25
|
+
}
|
|
26
|
+
}, rest)));
|
|
27
|
+
}
|
|
28
|
+
VtxDescriptions.propTypes = {};
|
|
29
|
+
export default VtxDescriptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
|
+
var genStyle = function genStyle(token) {
|
|
9
|
+
var componentCls = token.componentCls;
|
|
10
|
+
return _defineProperty({}, componentCls, {});
|
|
11
|
+
};
|
|
12
|
+
export function useStyle(prefixCls) {
|
|
13
|
+
return useAntdStyle('VtxDescriptions', function (token) {
|
|
14
|
+
var _token = _objectSpread(_objectSpread({}, token), {}, {
|
|
15
|
+
componentCls: ".".concat(prefixCls)
|
|
16
|
+
});
|
|
17
|
+
return [genStyle(_token)];
|
|
18
|
+
});
|
|
19
|
+
}
|