@vtx/components 4.0.0-beta.93 → 4.0.0-beta.94
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/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +6 -6
- 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/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-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
- package/es/vtx-datagrid/index.js +13 -7
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-export/index.js +8 -8
- package/es/vtx-icon/index.js1 +90 -90
- package/es/vtx-modal/index.js +5 -4
- 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-provider/index.js +30 -30
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +6 -6
- 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/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-datagrid/ToolBar/components/ColumnSetting/index.js +4 -4
- package/lib/vtx-datagrid/index.js +13 -10
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-export/index.js +8 -8
- package/lib/vtx-icon/index.js1 +90 -90
- package/lib/vtx-modal/index.js +5 -4
- 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-provider/index.js +30 -30
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/package.json +239 -239
|
@@ -40,9 +40,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
40
40
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
41
|
var noteOnce = rcWarning.noteOnce;
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* 显示警告信息
|
|
45
|
-
* @param messageStr
|
|
43
|
+
/**
|
|
44
|
+
* 显示警告信息
|
|
45
|
+
* @param messageStr
|
|
46
46
|
*/
|
|
47
47
|
var warning = function warning(messageStr) {
|
|
48
48
|
return message.warning(messageStr);
|
|
@@ -52,11 +52,11 @@ export var recordKeyToString = function recordKeyToString(rowKey) {
|
|
|
52
52
|
return rowKey;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
/**
|
|
56
|
-
* 使用map 来删除数据,性能一般 但是准确率比较高
|
|
57
|
-
*
|
|
58
|
-
* @param keyProps
|
|
59
|
-
* @param action
|
|
55
|
+
/**
|
|
56
|
+
* 使用map 来删除数据,性能一般 但是准确率比较高
|
|
57
|
+
*
|
|
58
|
+
* @param keyProps
|
|
59
|
+
* @param action
|
|
60
60
|
*/
|
|
61
61
|
export function editableRowByKey(keyProps, action) {
|
|
62
62
|
var _recordKeyToString;
|
|
@@ -68,11 +68,11 @@ export function editableRowByKey(keyProps, action) {
|
|
|
68
68
|
var key = (_recordKeyToString = recordKeyToString(keyProps.key)) === null || _recordKeyToString === void 0 ? void 0 : _recordKeyToString.toString();
|
|
69
69
|
var kvMap = new Map();
|
|
70
70
|
|
|
71
|
-
/**
|
|
72
|
-
* 打平这个数组
|
|
73
|
-
*
|
|
74
|
-
* @param records
|
|
75
|
-
* @param parentKey
|
|
71
|
+
/**
|
|
72
|
+
* 打平这个数组
|
|
73
|
+
*
|
|
74
|
+
* @param records
|
|
75
|
+
* @param parentKey
|
|
76
76
|
*/
|
|
77
77
|
function dig(records, map_row_parentKey, map_row_index) {
|
|
78
78
|
records.forEach(function (record, index) {
|
|
@@ -157,10 +157,10 @@ export function editableRowByKey(keyProps, action) {
|
|
|
157
157
|
return fill(kvMap);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
/**
|
|
161
|
-
* 保存按钮的dom
|
|
162
|
-
*
|
|
163
|
-
* @param ActionRenderConfig
|
|
160
|
+
/**
|
|
161
|
+
* 保存按钮的dom
|
|
162
|
+
*
|
|
163
|
+
* @param ActionRenderConfig
|
|
164
164
|
*/
|
|
165
165
|
export function SaveEditableAction(_ref, ref) {
|
|
166
166
|
var recordKey = _ref.recordKey,
|
|
@@ -263,10 +263,10 @@ export function SaveEditableAction(_ref, ref) {
|
|
|
263
263
|
}, "save");
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
/**
|
|
267
|
-
* 删除按钮 dom
|
|
268
|
-
*
|
|
269
|
-
* @param ActionRenderConfig
|
|
266
|
+
/**
|
|
267
|
+
* 删除按钮 dom
|
|
268
|
+
*
|
|
269
|
+
* @param ActionRenderConfig
|
|
270
270
|
*/
|
|
271
271
|
export var DeleteEditableAction = function DeleteEditableAction(_ref4) {
|
|
272
272
|
var recordKey = _ref4.recordKey,
|
|
@@ -406,17 +406,17 @@ export function defaultActionRender(row, config) {
|
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
/**
|
|
410
|
-
* 一个方便的hooks 用于维护编辑的状态
|
|
411
|
-
*
|
|
412
|
-
* @param props
|
|
409
|
+
/**
|
|
410
|
+
* 一个方便的hooks 用于维护编辑的状态
|
|
411
|
+
*
|
|
412
|
+
* @param props
|
|
413
413
|
*/
|
|
414
414
|
export function useEditableArray(props) {
|
|
415
415
|
// Internationalization
|
|
416
416
|
var intl = useIntl();
|
|
417
417
|
|
|
418
|
-
/**
|
|
419
|
-
* 点击开始编辑之前的保存数据用的
|
|
418
|
+
/**
|
|
419
|
+
* 点击开始编辑之前的保存数据用的
|
|
420
420
|
*/
|
|
421
421
|
var preEditRowRef = useRef(null);
|
|
422
422
|
var _useState = useState(undefined),
|
|
@@ -504,10 +504,10 @@ export function useEditableArray(props) {
|
|
|
504
504
|
};
|
|
505
505
|
});
|
|
506
506
|
|
|
507
|
-
/**
|
|
508
|
-
* 进入编辑状态
|
|
509
|
-
*
|
|
510
|
-
* @param recordKey
|
|
507
|
+
/**
|
|
508
|
+
* 进入编辑状态
|
|
509
|
+
*
|
|
510
|
+
* @param recordKey
|
|
511
511
|
*/
|
|
512
512
|
var startEditable = useRefFunction(function (recordKey, record) {
|
|
513
513
|
var _ref7, _props$dataSource;
|
|
@@ -526,10 +526,10 @@ export function useEditableArray(props) {
|
|
|
526
526
|
return true;
|
|
527
527
|
});
|
|
528
528
|
|
|
529
|
-
/**
|
|
530
|
-
* 退出编辑状态
|
|
531
|
-
*
|
|
532
|
-
* @param recordKey
|
|
529
|
+
/**
|
|
530
|
+
* 退出编辑状态
|
|
531
|
+
*
|
|
532
|
+
* @param recordKey
|
|
533
533
|
*/
|
|
534
534
|
var cancelEditable = useRefFunction( /*#__PURE__*/function () {
|
|
535
535
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(recordKey, needReTry) {
|
|
@@ -635,11 +635,11 @@ export function useEditableArray(props) {
|
|
|
635
635
|
}
|
|
636
636
|
});
|
|
637
637
|
}, [saveRefsMap, editableKeysSet]);
|
|
638
|
-
/**
|
|
639
|
-
* 保存编辑行
|
|
640
|
-
*
|
|
641
|
-
* @param recordKey
|
|
642
|
-
* @param needReTry
|
|
638
|
+
/**
|
|
639
|
+
* 保存编辑行
|
|
640
|
+
*
|
|
641
|
+
* @param recordKey
|
|
642
|
+
* @param needReTry
|
|
643
643
|
*/
|
|
644
644
|
var saveEditable = useRefFunction( /*#__PURE__*/function () {
|
|
645
645
|
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(recordKey, needReTry) {
|
|
@@ -686,12 +686,12 @@ export function useEditableArray(props) {
|
|
|
686
686
|
};
|
|
687
687
|
}());
|
|
688
688
|
|
|
689
|
-
/**
|
|
690
|
-
* 同时只能支持一行,取消之后数据消息,不会触发 dataSource
|
|
691
|
-
*
|
|
692
|
-
* @param row
|
|
693
|
-
* @param options
|
|
694
|
-
* @name 增加新的行
|
|
689
|
+
/**
|
|
690
|
+
* 同时只能支持一行,取消之后数据消息,不会触发 dataSource
|
|
691
|
+
*
|
|
692
|
+
* @param row
|
|
693
|
+
* @param options
|
|
694
|
+
* @name 增加新的行
|
|
695
695
|
*/
|
|
696
696
|
var addEditRecord = useRefFunction(function (row, options) {
|
|
697
697
|
if (options !== null && options !== void 0 && options.parentKey && !dataSourceKeyIndexMapRef.current.has(recordKeyToString(options === null || options === void 0 ? void 0 : options.parentKey).toString())) {
|
|
@@ -20,19 +20,19 @@ import { useCallback, useMemo, useRef } from 'react';
|
|
|
20
20
|
import { useIntl } from "../../vtx-provider";
|
|
21
21
|
import { defaultActionRender, recordKeyToString } from "../useEditableArray";
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* 显示警告信息
|
|
25
|
-
* @param messageStr
|
|
23
|
+
/**
|
|
24
|
+
* 显示警告信息
|
|
25
|
+
* @param messageStr
|
|
26
26
|
*/
|
|
27
27
|
var warning = function warning(messageStr) {
|
|
28
28
|
return message.warning(messageStr);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* 使用map 来删除数据,性能一般 但是准确率比较高
|
|
33
|
-
*
|
|
34
|
-
* @param params
|
|
35
|
-
* @param action
|
|
31
|
+
/**
|
|
32
|
+
* 使用map 来删除数据,性能一般 但是准确率比较高
|
|
33
|
+
*
|
|
34
|
+
* @param params
|
|
35
|
+
* @param action
|
|
36
36
|
*/
|
|
37
37
|
function editableRowByKey(_ref) {
|
|
38
38
|
var data = _ref.data,
|
|
@@ -40,14 +40,14 @@ function editableRowByKey(_ref) {
|
|
|
40
40
|
return _objectSpread(_objectSpread({}, data), row);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* 一个方便的hooks 用于维护编辑的状态
|
|
45
|
-
*
|
|
46
|
-
* @param props
|
|
43
|
+
/**
|
|
44
|
+
* 一个方便的hooks 用于维护编辑的状态
|
|
45
|
+
*
|
|
46
|
+
* @param props
|
|
47
47
|
*/
|
|
48
48
|
export function useEditableMap(props) {
|
|
49
|
-
/**
|
|
50
|
-
* 点击开始编辑之前的保存数据用的
|
|
49
|
+
/**
|
|
50
|
+
* 点击开始编辑之前的保存数据用的
|
|
51
51
|
*/
|
|
52
52
|
var preEditRowRef = useRef(null);
|
|
53
53
|
var editableType = props.type || 'single';
|
|
@@ -79,10 +79,10 @@ export function useEditableMap(props) {
|
|
|
79
79
|
return false;
|
|
80
80
|
}, [(editableKeys || []).join(',')]);
|
|
81
81
|
|
|
82
|
-
/**
|
|
83
|
-
* 进入编辑状态
|
|
84
|
-
*
|
|
85
|
-
* @param recordKey
|
|
82
|
+
/**
|
|
83
|
+
* 进入编辑状态
|
|
84
|
+
*
|
|
85
|
+
* @param recordKey
|
|
86
86
|
*/
|
|
87
87
|
var startEditable = function startEditable(recordKey, recordValue) {
|
|
88
88
|
var _ref2;
|
|
@@ -97,10 +97,10 @@ export function useEditableMap(props) {
|
|
|
97
97
|
return true;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
/**
|
|
101
|
-
* 退出编辑状态
|
|
102
|
-
*
|
|
103
|
-
* @param recordKey
|
|
100
|
+
/**
|
|
101
|
+
* 退出编辑状态
|
|
102
|
+
*
|
|
103
|
+
* @param recordKey
|
|
104
104
|
*/
|
|
105
105
|
var cancelEditable = function cancelEditable(recordKey) {
|
|
106
106
|
// 防止多次渲染
|
|
@@ -37,11 +37,11 @@ export var MediaQueryEnum = {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* loop query screen className
|
|
42
|
-
* Array.find will throw a error
|
|
43
|
-
* `Rendered more hooks than during the previous render.`
|
|
44
|
-
* So should use Array.forEach
|
|
40
|
+
/**
|
|
41
|
+
* loop query screen className
|
|
42
|
+
* Array.find will throw a error
|
|
43
|
+
* `Rendered more hooks than during the previous render.`
|
|
44
|
+
* So should use Array.forEach
|
|
45
45
|
*/
|
|
46
46
|
export var getScreenClassName = function getScreenClassName() {
|
|
47
47
|
var queryKey = undefined;
|
|
@@ -375,10 +375,10 @@ export default function ColumnSetting(props) {
|
|
|
375
375
|
var checkedColumnKeys = props.checkedColumnKeys,
|
|
376
376
|
onColumnsSave = props.onColumnsSave;
|
|
377
377
|
|
|
378
|
-
/**
|
|
379
|
-
* 设置全部选中,或全部未选中
|
|
380
|
-
*
|
|
381
|
-
* @param show
|
|
378
|
+
/**
|
|
379
|
+
* 设置全部选中,或全部未选中
|
|
380
|
+
*
|
|
381
|
+
* @param show
|
|
382
382
|
*/
|
|
383
383
|
var setAllSelectAction = useRefFunction(function () {
|
|
384
384
|
var show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
package/es/vtx-datagrid/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import { Container, TableContext } from "./Store/Provide";
|
|
|
27
27
|
import ToolBar from "./ToolBar";
|
|
28
28
|
import { mergeComponentsForResize } from "./mergeComponents";
|
|
29
29
|
import { useStyle } from "./style/index";
|
|
30
|
+
import { forwardRef } from 'react';
|
|
31
|
+
import { merge } from 'lodash-es';
|
|
30
32
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
33
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
34
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
@@ -36,7 +38,7 @@ export var DEFAULT_HEIGHTS = {
|
|
|
36
38
|
ALERT: 48,
|
|
37
39
|
TOOLBAR: 64
|
|
38
40
|
};
|
|
39
|
-
|
|
41
|
+
var VtxTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
40
42
|
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
|
|
41
43
|
var intl = useIntl();
|
|
42
44
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
@@ -386,6 +388,7 @@ function VtxTable(props) {
|
|
|
386
388
|
ref: rootDomRef,
|
|
387
389
|
style: style,
|
|
388
390
|
children: [toolbarRender, alertRender, /*#__PURE__*/_jsx(Table, _objectSpread(_objectSpread({
|
|
391
|
+
ref: ref,
|
|
389
392
|
size: counter.tableSize,
|
|
390
393
|
bordered: true
|
|
391
394
|
// virtual
|
|
@@ -396,11 +399,11 @@ function VtxTable(props) {
|
|
|
396
399
|
}, scroll),
|
|
397
400
|
pagination: getPagination(rest.pagination),
|
|
398
401
|
xs: true,
|
|
399
|
-
styles: {
|
|
402
|
+
styles: merge({
|
|
400
403
|
root: {
|
|
401
404
|
height: "calc(100% - ".concat(toolbarHeight.current + alertHeight.current, "px)")
|
|
402
405
|
}
|
|
403
|
-
},
|
|
406
|
+
}, props.styles),
|
|
404
407
|
locale: _objectSpread({
|
|
405
408
|
emptyText: /*#__PURE__*/_jsx(Empty, {
|
|
406
409
|
description: emptyText
|
|
@@ -413,16 +416,19 @@ function VtxTable(props) {
|
|
|
413
416
|
tableLayout: "fixed"
|
|
414
417
|
}))]
|
|
415
418
|
}));
|
|
416
|
-
}
|
|
417
|
-
|
|
419
|
+
});
|
|
420
|
+
VtxTable.displayName = 'VtxTable';
|
|
421
|
+
var VtxDatagrid = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
418
422
|
var ErrorComponent = props.ErrorBoundary === false ? React.Fragment : props.ErrorBoundary || ErrorBoundary;
|
|
419
423
|
return /*#__PURE__*/_jsx(Container, {
|
|
420
424
|
initValue: props,
|
|
421
425
|
children: /*#__PURE__*/_jsx(ErrorComponent, {
|
|
422
|
-
children: /*#__PURE__*/_jsx(VtxTable, _objectSpread({}, props)
|
|
426
|
+
children: /*#__PURE__*/_jsx(VtxTable, _objectSpread(_objectSpread({}, props), {}, {
|
|
427
|
+
ref: ref
|
|
428
|
+
}))
|
|
423
429
|
})
|
|
424
430
|
});
|
|
425
|
-
}
|
|
431
|
+
});
|
|
426
432
|
VtxDatagrid.displayName = 'VtxDatagrid';
|
|
427
433
|
export { VtxDatagrid };
|
|
428
434
|
export default VtxDatagrid;
|