@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-import2/index.js
CHANGED
|
@@ -26,15 +26,17 @@ import getToken from "../utils/getToken";
|
|
|
26
26
|
import getSignature from '@vtx/utils/lib/getSignature';
|
|
27
27
|
import useSet from "../utils/useSet";
|
|
28
28
|
import md5 from 'md5';
|
|
29
|
-
import { getVtxToken } from '@vtx/utils';
|
|
29
|
+
import { getVtxToken, getUrlParam } from '@vtx/utils';
|
|
30
30
|
import classnames from 'classnames';
|
|
31
31
|
import { useStyle } from "./style/index";
|
|
32
32
|
import { VtxProvider, useIntl } from "../vtx-provider";
|
|
33
|
+
import VtxModal from "../vtx-modal";
|
|
33
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
35
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
36
|
function getFileName() {
|
|
36
37
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
37
|
-
var
|
|
38
|
+
var _ref = arguments.length > 1 ? arguments[1] : undefined,
|
|
39
|
+
intl = _ref.intl;
|
|
38
40
|
var index = name.lastIndexOf('.');
|
|
39
41
|
var suffix = name.substring(index);
|
|
40
42
|
return name.substring(0, index) + "(".concat(intl.getMessage('import.errorFile', '错误文件'), ")") + suffix;
|
|
@@ -43,17 +45,20 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
43
45
|
var intl = useIntl();
|
|
44
46
|
var _useContext = useContext(VtxProvider),
|
|
45
47
|
getPrefixCls = _useContext.getPrefixCls;
|
|
46
|
-
var prefixCls = getPrefixCls('
|
|
48
|
+
var prefixCls = getPrefixCls('', 'vtx-import2');
|
|
47
49
|
var _useStyle = useStyle(prefixCls),
|
|
48
50
|
wrapSSR = _useStyle.wrapSSR,
|
|
49
51
|
hashId = _useStyle.hashId;
|
|
50
52
|
var visible = props.visible,
|
|
51
53
|
close = props.close,
|
|
52
54
|
title = props.title,
|
|
53
|
-
accept = props.accept,
|
|
54
|
-
|
|
55
|
+
_props$accept = props.accept,
|
|
56
|
+
accept = _props$accept === void 0 ? 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv' : _props$accept,
|
|
57
|
+
_props$fileKey = props.fileKey,
|
|
58
|
+
fileKey = _props$fileKey === void 0 ? 'file' : _props$fileKey,
|
|
55
59
|
uploadURL = props.uploadURL,
|
|
56
|
-
postData = props.postData,
|
|
60
|
+
_props$postData = props.postData,
|
|
61
|
+
postData = _props$postData === void 0 ? {} : _props$postData,
|
|
57
62
|
errorURL = props.errorURL,
|
|
58
63
|
templateURL = props.templateURL,
|
|
59
64
|
afterUpload = props.afterUpload,
|
|
@@ -132,7 +137,7 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
132
137
|
state = _useSet2[0],
|
|
133
138
|
setState = _useSet2[1];
|
|
134
139
|
var token = getToken();
|
|
135
|
-
if (
|
|
140
|
+
if (props.token) {
|
|
136
141
|
token = props.token;
|
|
137
142
|
}
|
|
138
143
|
var newErrorDownloadName = errorDownloadName;
|
|
@@ -147,7 +152,9 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
147
152
|
}, interval);
|
|
148
153
|
useEffect(function () {
|
|
149
154
|
if (fileList.length !== 0) {
|
|
150
|
-
fileName.current = getFileName(fileList[0].name
|
|
155
|
+
fileName.current = getFileName(fileList[0].name, {
|
|
156
|
+
intl: intl
|
|
157
|
+
});
|
|
151
158
|
}
|
|
152
159
|
}, [fileList]);
|
|
153
160
|
|
|
@@ -202,6 +209,8 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
202
209
|
};
|
|
203
210
|
// 发送请求
|
|
204
211
|
xhr.open('POST', '/cloudFile/common/uploadChunk', true);
|
|
212
|
+
xhr.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
|
|
213
|
+
xhr.setRequestHeader('access_token', token ? "".concat(token) : '');
|
|
205
214
|
xhr.send(list[indexRef.current]);
|
|
206
215
|
} else {
|
|
207
216
|
mergeFile();
|
|
@@ -215,7 +224,7 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
215
224
|
if (xhr.status === 200) {
|
|
216
225
|
var res = JSON.parse(xhr.responseText);
|
|
217
226
|
if ((res === null || res === void 0 ? void 0 : res.result) == 0) {
|
|
218
|
-
message.success('上传成功');
|
|
227
|
+
message.success(intl.getMessage('import.success', '上传成功'));
|
|
219
228
|
chunkUpload(res.data);
|
|
220
229
|
} else {
|
|
221
230
|
message.error((res === null || res === void 0 ? void 0 : res.msg) || intl.getMessage('import.error', '上传失败'));
|
|
@@ -227,6 +236,8 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
227
236
|
};
|
|
228
237
|
// 发送请求
|
|
229
238
|
xhr.open('POST', '/cloudFile/common/mergeChunk', true);
|
|
239
|
+
xhr.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
|
|
240
|
+
xhr.setRequestHeader('access_token', token ? "".concat(token) : '');
|
|
230
241
|
var data = new FormData();
|
|
231
242
|
data.append('chunkId', state.chunkId);
|
|
232
243
|
data.append('tenantId', getVtxToken('tenantId'));
|
|
@@ -247,6 +258,7 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
247
258
|
}
|
|
248
259
|
request.setRequestHeader('Authorization', token ? "Bearer ".concat(token) : '');
|
|
249
260
|
request.setRequestHeader('access_token', token ? "".concat(token) : '');
|
|
261
|
+
request.setRequestHeader('systemCode', getUrlParam('systemCode') ? getUrlParam('systemCode') : '');
|
|
250
262
|
// 添加操作日志
|
|
251
263
|
request.setRequestHeader('operation', encodeURIComponent(JSON.stringify({
|
|
252
264
|
menuId: sessionStorage.getItem('vtxmenuselectedKeys'),
|
|
@@ -329,9 +341,9 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
329
341
|
}
|
|
330
342
|
}
|
|
331
343
|
};
|
|
332
|
-
var onUpload = function onUpload(
|
|
333
|
-
var
|
|
334
|
-
files =
|
|
344
|
+
var onUpload = function onUpload(_ref2) {
|
|
345
|
+
var _ref2$files = _ref2.files,
|
|
346
|
+
files = _ref2$files === void 0 ? fileList : _ref2$files;
|
|
335
347
|
if (typeof props.beforeUpload === 'function') {
|
|
336
348
|
var flag = beforeUpload(files[0]);
|
|
337
349
|
if (!flag) {
|
|
@@ -366,7 +378,10 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
366
378
|
var modelProps = {
|
|
367
379
|
open: visible,
|
|
368
380
|
width: width || 392,
|
|
369
|
-
maskClosable: false,
|
|
381
|
+
// maskClosable: false,
|
|
382
|
+
mask: {
|
|
383
|
+
closable: false
|
|
384
|
+
},
|
|
370
385
|
footer: [/*#__PURE__*/_jsx(Button, {
|
|
371
386
|
onClick: close,
|
|
372
387
|
children: "".concat(TextEnum.btnCloseText).concat(status === 1 && result ? '(' + countdown + ')' : '')
|
|
@@ -388,7 +403,7 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
388
403
|
})]
|
|
389
404
|
})
|
|
390
405
|
};
|
|
391
|
-
return wrapSSR( /*#__PURE__*/_jsxs(
|
|
406
|
+
return wrapSSR( /*#__PURE__*/_jsxs(VtxModal, _objectSpread(_objectSpread({}, modelProps), {}, {
|
|
392
407
|
children: [status === 0 ? /*#__PURE__*/_jsx(Content, {
|
|
393
408
|
prefixCls: prefixCls,
|
|
394
409
|
fileList: fileList,
|
|
@@ -422,11 +437,6 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
422
437
|
})]
|
|
423
438
|
})));
|
|
424
439
|
};
|
|
425
|
-
VtxImport2.defaultProps = {
|
|
426
|
-
fileKey: 'file',
|
|
427
|
-
accept: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv',
|
|
428
|
-
postData: {}
|
|
429
|
-
};
|
|
430
440
|
VtxImport2.propTypes = {
|
|
431
441
|
visible: PropTypes.bool,
|
|
432
442
|
templateURL: PropTypes.string,
|
|
@@ -447,7 +457,8 @@ VtxImport2.propTypes = {
|
|
|
447
457
|
beforeUpload: PropTypes.func,
|
|
448
458
|
chunkSize: PropTypes.number,
|
|
449
459
|
width: PropTypes.number,
|
|
450
|
-
extraDom: [PropTypes.string, PropTypes.node]
|
|
460
|
+
// extraDom: [PropTypes.string, PropTypes.node],
|
|
461
|
+
extraDom: PropTypes.object
|
|
451
462
|
};
|
|
452
463
|
export { VtxImport2 };
|
|
453
464
|
export default VtxImport2;
|
|
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
8
|
var genVtxImport2Style = function genVtxImport2Style(token) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
|
-
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-modal-header-title', {
|
|
11
11
|
color: token.colorText
|
|
12
12
|
}), '&-modal-header-text', {
|
|
13
13
|
fontWeight: '400'
|
|
@@ -25,8 +25,8 @@ var genVtxImport2Style = function genVtxImport2Style(token) {
|
|
|
25
25
|
height: '80px',
|
|
26
26
|
padding: '16px 16px 16px 48px',
|
|
27
27
|
color: token.colorPrimary,
|
|
28
|
-
fontSize:
|
|
29
|
-
backgroundColor: token.
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
30
30
|
borderRadius: '4px'
|
|
31
31
|
}, "".concat(componentCls, "-download"), {
|
|
32
32
|
marginLeft: '16px'
|
|
@@ -48,7 +48,58 @@ var genVtxImport2Style = function genVtxImport2Style(token) {
|
|
|
48
48
|
display: 'flex',
|
|
49
49
|
alignItems: 'center',
|
|
50
50
|
justifyContent: 'space-between',
|
|
51
|
-
color:
|
|
51
|
+
color: token.colorTextSecondary
|
|
52
|
+
}, "".concat(componentCls, "-file-name"), {
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
whiteSpace: 'nowrap',
|
|
55
|
+
textOverflow: 'ellipsis'
|
|
56
|
+
}))), '&:last-child ', {
|
|
57
|
+
marginTop: '20px'
|
|
58
|
+
}), "".concat(componentCls, "-content-mark"), {
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
top: 0,
|
|
61
|
+
left: 0,
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
width: '28px',
|
|
66
|
+
height: '22px',
|
|
67
|
+
color: '#fff',
|
|
68
|
+
backgroundColor: token.colorPrimary,
|
|
69
|
+
border: "1px solid ".concat(token.colorPrimary),
|
|
70
|
+
borderRadius: '4px 0',
|
|
71
|
+
opacity: 0.6
|
|
72
|
+
}))), "".concat(componentCls, "-content-box"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
73
|
+
position: 'relative',
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
height: '80px',
|
|
77
|
+
padding: '16px 16px 16px 48px',
|
|
78
|
+
color: token.colorPrimary,
|
|
79
|
+
fontSize: 14,
|
|
80
|
+
backgroundColor: token.colorBgLayoutTable,
|
|
81
|
+
borderRadius: '4px'
|
|
82
|
+
}, "".concat(componentCls, "-download"), {
|
|
83
|
+
marginLeft: '16px'
|
|
84
|
+
}), "".concat(componentCls, "-file-list"), _defineProperty(_defineProperty({
|
|
85
|
+
display: 'flex',
|
|
86
|
+
flexDirection: 'column',
|
|
87
|
+
justifyContent: 'space-between',
|
|
88
|
+
width: '100%',
|
|
89
|
+
marginLeft: '16px',
|
|
90
|
+
overflow: 'hidden',
|
|
91
|
+
whiteSpace: 'nowrap',
|
|
92
|
+
textOverflow: 'ellipsis'
|
|
93
|
+
}, "".concat(componentCls, "-text"), {
|
|
94
|
+
cursor: 'pointer',
|
|
95
|
+
overflowRrap: 'break-word',
|
|
96
|
+
wordBreak: 'break-all',
|
|
97
|
+
whiteSpace: 'pre-wrap'
|
|
98
|
+
}), "".concat(componentCls, "-file-item"), _defineProperty({
|
|
99
|
+
display: 'flex',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
justifyContent: 'space-between',
|
|
102
|
+
color: token.colorBase
|
|
52
103
|
}, "".concat(componentCls, "-file-name"), {
|
|
53
104
|
overflow: 'hidden',
|
|
54
105
|
whiteSpace: 'nowrap',
|
|
@@ -77,17 +128,17 @@ var genVtxImport2Style = function genVtxImport2Style(token) {
|
|
|
77
128
|
}, "".concat(componentCls, "-result"), {
|
|
78
129
|
marginTop: '20px',
|
|
79
130
|
marginBottom: '12px',
|
|
80
|
-
color:
|
|
131
|
+
color: token.colorText,
|
|
81
132
|
fontWeight: '700',
|
|
82
133
|
fontSize: '24px'
|
|
83
134
|
}), "&-success-tips", {
|
|
84
|
-
color:
|
|
85
|
-
fontSize:
|
|
135
|
+
color: token.colorTextSecondary,
|
|
136
|
+
fontSize: 14
|
|
86
137
|
}), "&-error-tips", {
|
|
87
138
|
color: token.colorPrimary,
|
|
88
|
-
fontSize:
|
|
139
|
+
fontSize: 14,
|
|
89
140
|
cursor: 'pointer'
|
|
90
|
-
}))
|
|
141
|
+
}));
|
|
91
142
|
};
|
|
92
143
|
export function useStyle(prefixCls) {
|
|
93
144
|
return useAntdStyle('VtxImport2', function (token) {
|
|
@@ -45,12 +45,17 @@ var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
var wrapper = null;
|
|
49
|
+
if (showCount && 'value' in props) {
|
|
50
|
+
wrapper = function wrapper(element) {
|
|
51
|
+
return /*#__PURE__*/_jsx("div", {
|
|
52
|
+
className: classnames(prefixCls, hashId),
|
|
53
|
+
"data-count": "".concat(len, "/").concat(maxLength),
|
|
54
|
+
children: element
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return wrapSSR(wrapper ? wrapper(render) : render);
|
|
54
59
|
});
|
|
55
60
|
export default TextArea;
|
|
56
61
|
TextArea.propTypes = {
|
package/es/vtx-modal/index.js
CHANGED
|
@@ -195,15 +195,20 @@ function VtxModal(props) {
|
|
|
195
195
|
destroyOnHidden: (_props$destroyOnClose = props.destroyOnClose) !== null && _props$destroyOnClose !== void 0 ? _props$destroyOnClose : true
|
|
196
196
|
};
|
|
197
197
|
var newProps = _objectSpread(_objectSpread(_objectSpread({
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
mask: {
|
|
199
|
+
closable: false
|
|
200
|
+
},
|
|
201
|
+
width: 700,
|
|
202
|
+
focusable: {
|
|
203
|
+
autoFocusButton: null,
|
|
204
|
+
focusTriggerAfterClose: true,
|
|
205
|
+
trap: false
|
|
206
|
+
}
|
|
201
207
|
}, props), legacyProps), {}, {
|
|
202
208
|
closable: false,
|
|
203
209
|
open: open,
|
|
204
210
|
title: title,
|
|
205
211
|
wrapClassName: classnames(prefixCls, hashId, wrapClassName, _defineProperty({}, "".concat(prefixCls, "-maxClass"), isFull ? true : false), classId.current),
|
|
206
|
-
// bodyStyle,
|
|
207
212
|
onCancel: onCancel,
|
|
208
213
|
style: _objectSpread(_objectSpread({}, props.style), isFull ? {} : transformStyle)
|
|
209
214
|
});
|
|
@@ -19,11 +19,13 @@ var genVtxModalStyle = function genVtxModalStyle(token) {
|
|
|
19
19
|
padding: 0
|
|
20
20
|
},
|
|
21
21
|
'.ant-modal-body': {
|
|
22
|
-
|
|
22
|
+
height: 'calc(100% - 108px)',
|
|
23
23
|
padding: '12px 20px 8px 20px',
|
|
24
|
-
overflowY: 'auto'
|
|
25
|
-
height: '100%'
|
|
24
|
+
overflowY: 'auto'
|
|
26
25
|
}
|
|
26
|
+
},
|
|
27
|
+
'.ant-modal-container': {
|
|
28
|
+
padding: 0
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
}, '&-title', _defineProperty(_defineProperty(_defineProperty({
|
|
@@ -19,7 +19,7 @@ function Content(props) {
|
|
|
19
19
|
height = props.height;
|
|
20
20
|
var contentClass = classnames(_defineProperty(_defineProperty(_defineProperty({}, 'vtx-page-content-absolute', !relative), 'vtx-page-content-relative', relative), 'vtx-page-content-scroll-y', scrollY), className);
|
|
21
21
|
var newStyle = style;
|
|
22
|
-
if (
|
|
22
|
+
if (height !== undefined) {
|
|
23
23
|
newStyle = _objectSpread(_objectSpread({}, newStyle), {}, {
|
|
24
24
|
height: height
|
|
25
25
|
});
|
|
@@ -1,9 +1,3 @@
|
|
|
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
1
|
import { ConfigProvider } from 'antd';
|
|
8
2
|
import classsnames from 'classnames';
|
|
9
3
|
import PropTypes from 'prop-types';
|
|
@@ -50,7 +44,7 @@ var Content = function Content(props) {
|
|
|
50
44
|
hashId = _useStyle2.hashId;
|
|
51
45
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
52
46
|
className: classsnames("".concat(prefix, "-tab-content"), className, hashId),
|
|
53
|
-
style:
|
|
47
|
+
style: style,
|
|
54
48
|
children: props.children
|
|
55
49
|
}));
|
|
56
50
|
};
|
|
@@ -124,15 +124,25 @@ Content.propTypes = {
|
|
|
124
124
|
*/
|
|
125
125
|
var Table = function Table(props) {
|
|
126
126
|
var className = props.className,
|
|
127
|
-
style = props.style
|
|
127
|
+
style = props.style,
|
|
128
|
+
children = props.children;
|
|
128
129
|
var _useContext3 = useContext(StoreCtx),
|
|
129
130
|
searchCollapseEvent$ = _useContext3.searchCollapseEvent$;
|
|
131
|
+
|
|
132
|
+
// 安全检查:如果不是有效的 React 元素,直接渲染不注入 props
|
|
133
|
+
if (! /*#__PURE__*/React.isValidElement(children)) {
|
|
134
|
+
return /*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: classsnames('vtx-page-table-wrap', className),
|
|
136
|
+
style: style,
|
|
137
|
+
children: children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
130
140
|
return /*#__PURE__*/_jsx("div", {
|
|
131
|
-
className: classsnames('vtx-page-table-wrap', className
|
|
141
|
+
className: classsnames('vtx-page-table-wrap', className),
|
|
132
142
|
style: style,
|
|
133
|
-
children: /*#__PURE__*/React.cloneElement(
|
|
143
|
+
children: /*#__PURE__*/React.cloneElement(children, {
|
|
134
144
|
searchCollapseEvent$: searchCollapseEvent$
|
|
135
|
-
})
|
|
145
|
+
})
|
|
136
146
|
});
|
|
137
147
|
};
|
|
138
148
|
Table.propTypes = {
|
|
@@ -12,7 +12,8 @@ function TableWrap(props) {
|
|
|
12
12
|
var relative = props.relative,
|
|
13
13
|
height = props.height,
|
|
14
14
|
style = props.style,
|
|
15
|
-
className = props.className
|
|
15
|
+
className = props.className,
|
|
16
|
+
children = props.children;
|
|
16
17
|
var tableClass = classnames(_defineProperty(_defineProperty({}, 'vtx-table-wrapper-absolute', !relative), 'vtx-table-wrapper-relative', relative), className);
|
|
17
18
|
var newStyle = style;
|
|
18
19
|
if (relative && 'height' in props) {
|
|
@@ -23,7 +24,7 @@ function TableWrap(props) {
|
|
|
23
24
|
return /*#__PURE__*/_jsx("div", {
|
|
24
25
|
className: tableClass,
|
|
25
26
|
style: newStyle,
|
|
26
|
-
children:
|
|
27
|
+
children: children
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
export default TableWrap;
|
|
@@ -1,9 +1,3 @@
|
|
|
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
1
|
import classsnames from 'classnames';
|
|
8
2
|
import PropTypes from 'prop-types';
|
|
9
3
|
import { useContext } from 'react';
|
|
@@ -49,7 +43,7 @@ var Content = function Content(props) {
|
|
|
49
43
|
hashId = _useStyle2.hashId;
|
|
50
44
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
51
45
|
className: classsnames("".concat(prefix, "-tree-content"), className, hashId),
|
|
52
|
-
style:
|
|
46
|
+
style: style,
|
|
53
47
|
children: props.children
|
|
54
48
|
}));
|
|
55
49
|
};
|
|
@@ -62,7 +56,7 @@ var Tree = function Tree(props) {
|
|
|
62
56
|
var className = props.className,
|
|
63
57
|
style = props.style;
|
|
64
58
|
return /*#__PURE__*/_jsx("div", {
|
|
65
|
-
className: classsnames('vtx-page-tree-wrap', className
|
|
59
|
+
className: classsnames('vtx-page-tree-wrap', className),
|
|
66
60
|
style: style,
|
|
67
61
|
children: props.children
|
|
68
62
|
});
|
|
@@ -44,11 +44,12 @@ function Container() {
|
|
|
44
44
|
className = _this$props.className,
|
|
45
45
|
top = _this$props.top,
|
|
46
46
|
space = _this$props.space;
|
|
47
|
-
var wrapClass = classnames(_defineProperty({}, componentClass,
|
|
48
|
-
var newStyle = _objectSpread({
|
|
49
|
-
top: top
|
|
47
|
+
var wrapClass = classnames(_defineProperty({}, componentClass, !!componentClass), className);
|
|
48
|
+
var newStyle = _objectSpread(_objectSpread(_objectSpread({}, top !== undefined && {
|
|
49
|
+
top: top
|
|
50
|
+
}), space !== undefined && {
|
|
50
51
|
padding: space
|
|
51
|
-
}, style);
|
|
52
|
+
}), style);
|
|
52
53
|
var newProps = {
|
|
53
54
|
className: wrapClass,
|
|
54
55
|
style: newStyle
|
|
@@ -59,7 +60,7 @@ function Container() {
|
|
|
59
60
|
return HOC;
|
|
60
61
|
}(React.Component), _defineProperty(_class, "displayName", "HOC(".concat(getDisplayName(WrappedComponend), ")")), _defineProperty(_class, "propTypes", {
|
|
61
62
|
top: PropTypes.number,
|
|
62
|
-
space: PropTypes.number
|
|
63
|
+
space: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
63
64
|
style: PropTypes.object,
|
|
64
65
|
className: PropTypes.string
|
|
65
66
|
}), _class;
|
|
@@ -96,7 +96,7 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
96
96
|
'&-wrap': _objectSpread(_objectSpread({}, absolute()), {}, {
|
|
97
97
|
backgroundColor: token.colorBgContainer,
|
|
98
98
|
borderRadius: token.borderRadiusLG,
|
|
99
|
-
padding: '0 20px'
|
|
99
|
+
padding: '0 20px 20px 20px'
|
|
100
100
|
}),
|
|
101
101
|
'&-card': {
|
|
102
102
|
background: token.colorBgContainer,
|
|
@@ -109,7 +109,9 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
109
109
|
'&-left': _defineProperty(_defineProperty({}, "".concat(componentCls, "-ztree-search"), {
|
|
110
110
|
right: 0
|
|
111
111
|
}), '.ant-vtx-tree-wraaper', {})
|
|
112
|
-
})), "".concat(componentCls, "-button-wrap"), _defineProperty({}, "button + button", {
|
|
112
|
+
})), "".concat(componentCls, "-button-wrap"), _defineProperty(_defineProperty({}, "button + button", {
|
|
113
|
+
marginLeft: 8
|
|
114
|
+
}), "button + .vtx-export-async", {
|
|
113
115
|
marginLeft: 8
|
|
114
116
|
}));
|
|
115
117
|
};
|
package/es/vtx-provider/index.js
CHANGED
|
@@ -31,6 +31,8 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
31
31
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
32
|
export * from "./intl";
|
|
33
33
|
export * from "./useStyle";
|
|
34
|
+
|
|
35
|
+
// 调接口前剔除无效字段,节省流量
|
|
34
36
|
var omitUndefined = function omitUndefined(obj) {
|
|
35
37
|
var newObj = {};
|
|
36
38
|
Object.keys(obj || {}).forEach(function (key) {
|
|
@@ -67,7 +69,7 @@ export var VtxConfigContext = /*#__PURE__*/React.createContext({
|
|
|
67
69
|
hashed: true,
|
|
68
70
|
dark: false,
|
|
69
71
|
token: _objectSpread(_objectSpread({}, antdTheme.getDesignToken()), {}, {
|
|
70
|
-
|
|
72
|
+
vtxComponentsCls: '.vtx',
|
|
71
73
|
antCls: '.ant',
|
|
72
74
|
themeId: 0
|
|
73
75
|
}),
|
|
@@ -128,9 +130,9 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
128
130
|
* @example .ant-pro
|
|
129
131
|
*/
|
|
130
132
|
|
|
131
|
-
var
|
|
133
|
+
var vtxComponentsCls = prefixCls ? ".".concat(prefixCls) : ".vtx";
|
|
132
134
|
var antCls = '.' + getPrefixCls();
|
|
133
|
-
var salt = "".concat(
|
|
135
|
+
var salt = "".concat(vtxComponentsCls);
|
|
134
136
|
/**
|
|
135
137
|
* 合并一下token,不然导致嵌套 token 失效
|
|
136
138
|
*/
|
|
@@ -141,21 +143,22 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
141
143
|
var _proProvide$intl;
|
|
142
144
|
var localeName = locale === null || locale === void 0 ? void 0 : locale.locale;
|
|
143
145
|
var key = findIntlKeyByAntdLocaleKey(localeName);
|
|
146
|
+
|
|
144
147
|
// antd 的 key 存在的时候以 antd 的为主
|
|
145
148
|
var resolvedIntl = intl !== null && intl !== void 0 ? intl : localeName && ((_proProvide$intl = proProvide.intl) === null || _proProvide$intl === void 0 ? void 0 : _proProvide$intl.locale) === 'default' ? intlMap[key] : proProvide.intl || intlMap[key];
|
|
146
149
|
return _objectSpread(_objectSpread({}, proProvide), {}, {
|
|
147
150
|
dark: dark !== null && dark !== void 0 ? dark : proProvide.dark,
|
|
148
151
|
token: merge(proProvide.token, tokenContext.token, {
|
|
149
|
-
|
|
152
|
+
vtxComponentsCls: vtxComponentsCls,
|
|
150
153
|
antCls: antCls,
|
|
151
154
|
themeId: tokenContext.theme.id,
|
|
152
155
|
layout: proLayoutTokenMerge
|
|
153
156
|
}),
|
|
154
157
|
intl: resolvedIntl || zhCNIntl
|
|
155
158
|
});
|
|
156
|
-
}, [locale === null || locale === void 0 ? void 0 : locale.locale, proProvide, dark, tokenContext.token, tokenContext.theme.id,
|
|
159
|
+
}, [locale === null || locale === void 0 ? void 0 : locale.locale, proProvide, dark, tokenContext.token, tokenContext.theme.id, antCls, proLayoutTokenMerge, intl]);
|
|
157
160
|
var finalToken = _objectSpread(_objectSpread({}, proProvideValue.token || {}), {}, {
|
|
158
|
-
|
|
161
|
+
vtxComponentsCls: vtxComponentsCls
|
|
159
162
|
});
|
|
160
163
|
var _useCacheToken = useCacheToken(tokenContext.theme, [tokenContext.token, finalToken !== null && finalToken !== void 0 ? finalToken : {}], {
|
|
161
164
|
salt: salt,
|
|
@@ -234,7 +237,7 @@ var ConfigProviderContainer = function ConfigProviderContainer(props) {
|
|
|
234
237
|
* @returns
|
|
235
238
|
*/
|
|
236
239
|
export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
237
|
-
var _theme$components;
|
|
240
|
+
var _theme$components, _theme$components2;
|
|
238
241
|
var propsTheme = props.theme,
|
|
239
242
|
propsLocale = props.locale,
|
|
240
243
|
needDeps = props.needDeps,
|
|
@@ -261,18 +264,25 @@ export var VtxConfigProvider = function VtxConfigProvider(props) {
|
|
|
261
264
|
borderRadius: 8,
|
|
262
265
|
borderRadiusLG: 12,
|
|
263
266
|
borderRadiusSM: 4
|
|
264
|
-
}, dark ? {
|
|
267
|
+
}, dark ? {
|
|
268
|
+
colorBgLayoutTable: '#111'
|
|
269
|
+
} : _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
265
270
|
colorPrimary: '#3A6DFF',
|
|
271
|
+
colorLink: '#3A6DFF',
|
|
266
272
|
colorText: '#29343D',
|
|
267
273
|
colorTextSecondary: '#78829D',
|
|
268
274
|
colorBorder: '#DCDFE6',
|
|
269
275
|
colorTextPlaceholder: '#BFC3CB',
|
|
270
276
|
colorFillAlter: '#F5F7FA'
|
|
271
|
-
}, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#FAFAFA')), theme.token);
|
|
277
|
+
}, "colorFillAlter", '#F5F7FA'), "colorTextPlaceholder", '#BFC3CB'), "colorFillAlterSolid", '#F5F7FA'), "colorBgLayout", '#F0F2F5'), "colorBgLayoutTable", '#FAFAFA')), theme.token);
|
|
272
278
|
theme.components = _objectSpread(_objectSpread({}, theme.components), {}, {
|
|
273
279
|
Table: _objectSpread({
|
|
274
280
|
headerBorderRadius: 0
|
|
275
|
-
}, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table)
|
|
281
|
+
}, (_theme$components = theme.components) === null || _theme$components === void 0 ? void 0 : _theme$components.Table),
|
|
282
|
+
Modal: _objectSpread({
|
|
283
|
+
contentPadding: 0,
|
|
284
|
+
bodyPadding: 0
|
|
285
|
+
}, (_theme$components2 = theme.components) === null || _theme$components2 === void 0 ? void 0 : _theme$components2.Modal)
|
|
276
286
|
});
|
|
277
287
|
|
|
278
288
|
// 自动注入 antd 的配置
|