@zat-design/sisyphus-react 3.9.1-beta.9 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +14 -0
- package/dist/less.esm.css +14 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +2 -1
- package/es/ProEditTable/propsType.d.ts +2 -0
- package/es/ProEnum/index.js +0 -1
- package/es/ProForm/components/combination/Group/index.js +15 -8
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +15 -0
- package/es/ProForm/components/combination/Group/utils.js +43 -9
- package/es/ProForm/components/combination/ProCascader/index.js +7 -1
- package/es/ProForm/components/render/ChangedWrapper.js +2 -1
- package/es/ProLayout/style/index.less +5 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +2 -1
- package/lib/ProEditTable/propsType.d.ts +2 -0
- package/lib/ProEnum/index.js +0 -1
- package/lib/ProForm/components/combination/Group/index.js +15 -8
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/style/index.less +15 -0
- package/lib/ProForm/components/combination/Group/utils.js +44 -9
- package/lib/ProForm/components/combination/ProCascader/index.js +7 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +2 -1
- package/lib/ProLayout/style/index.less +5 -0
- package/package.json +2 -2
- package/.vscode/extensions.json +0 -5
package/dist/index.esm.css
CHANGED
@@ -1246,6 +1246,9 @@
|
|
1246
1246
|
border-radius: var(--zaui-border-radius, 8px) !important;
|
1247
1247
|
background: #E4F2FE;
|
1248
1248
|
}
|
1249
|
+
.pro-layout.pro-layout-light .pro-collapse .pro-collapse-panel .pro-collapse-level2-collapse .ant-collapse-header {
|
1250
|
+
border-radius: 0 !important;
|
1251
|
+
}
|
1249
1252
|
.pro-layout.pro-layout-light .pro-header {
|
1250
1253
|
border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
|
1251
1254
|
}
|
@@ -2654,6 +2657,17 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
2654
2657
|
border-start-end-radius: 4px;
|
2655
2658
|
border-end-end-radius: 4px;
|
2656
2659
|
}
|
2660
|
+
.pro-group .ant-space-compact .pro-select .ant-select .ant-select-selector {
|
2661
|
+
border-radius: 0 !important;
|
2662
|
+
}
|
2663
|
+
.pro-group .ant-space-compact .pro-select:first-child .ant-select .ant-select-selector {
|
2664
|
+
border-start-start-radius: 4px !important;
|
2665
|
+
border-end-start-radius: 4px !important;
|
2666
|
+
}
|
2667
|
+
.pro-group .ant-space-compact .pro-select:last-child .ant-select .ant-select-selector {
|
2668
|
+
border-start-end-radius: 4px !important;
|
2669
|
+
border-end-end-radius: 4px!important;
|
2670
|
+
}
|
2657
2671
|
.pro-group .ant-space-compact .ant-select .ant-select-selector {
|
2658
2672
|
border-start-end-radius: 0;
|
2659
2673
|
border-end-end-radius: 0;
|
package/dist/less.esm.css
CHANGED
@@ -1246,6 +1246,9 @@
|
|
1246
1246
|
border-radius: var(--zaui-border-radius, 8px) !important;
|
1247
1247
|
background: #E4F2FE;
|
1248
1248
|
}
|
1249
|
+
.pro-layout.pro-layout-light .pro-collapse .pro-collapse-panel .pro-collapse-level2-collapse .ant-collapse-header {
|
1250
|
+
border-radius: 0 !important;
|
1251
|
+
}
|
1249
1252
|
.pro-layout.pro-layout-light .pro-header {
|
1250
1253
|
border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
|
1251
1254
|
}
|
@@ -2654,6 +2657,17 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
2654
2657
|
border-start-end-radius: 4px;
|
2655
2658
|
border-end-end-radius: 4px;
|
2656
2659
|
}
|
2660
|
+
.pro-group .ant-space-compact .pro-select .ant-select .ant-select-selector {
|
2661
|
+
border-radius: 0 !important;
|
2662
|
+
}
|
2663
|
+
.pro-group .ant-space-compact .pro-select:first-child .ant-select .ant-select-selector {
|
2664
|
+
border-start-start-radius: 4px !important;
|
2665
|
+
border-end-start-radius: 4px !important;
|
2666
|
+
}
|
2667
|
+
.pro-group .ant-space-compact .pro-select:last-child .ant-select .ant-select-selector {
|
2668
|
+
border-start-end-radius: 4px !important;
|
2669
|
+
border-end-end-radius: 4px!important;
|
2670
|
+
}
|
2657
2671
|
.pro-group .ant-space-compact .ant-select .ant-select-selector {
|
2658
2672
|
border-start-end-radius: 0;
|
2659
2673
|
border-end-end-radius: 0;
|
@@ -118,7 +118,8 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
118
118
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
119
119
|
var diffType = useMemo(function () {
|
120
120
|
if (!isWatch || noChange) return 'same';
|
121
|
-
var _value = normalize ? normalize(props[valuePropName])
|
121
|
+
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
122
|
+
: props[valuePropName];
|
122
123
|
return diffOriginal({
|
123
124
|
value: _value,
|
124
125
|
originalValue: originalValue,
|
@@ -8,6 +8,7 @@ import type { ColumnType, TableProps } from 'antd/es/table';
|
|
8
8
|
import type { FormInstance, FormItemProps } from 'antd/es/form';
|
9
9
|
import type { FunctionArgs, ProRule } from '../ProForm/propsType';
|
10
10
|
import { ProFormValueType, ColumnPropsMap } from '../ProForm/components/render/propsType';
|
11
|
+
import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
|
11
12
|
export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDelete' | 'custom';
|
12
13
|
export type ShowFunction<T> = (record?: T, options?: {
|
13
14
|
index?: number;
|
@@ -105,6 +106,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
105
106
|
hiddenNames?: NamePath[] | NamePath[][];
|
106
107
|
rules?: ProRule[] | RulesFn<T>;
|
107
108
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
109
|
+
onDiff?: DiffOriginalParams['equalWith'];
|
108
110
|
[key: string]: any;
|
109
111
|
}
|
110
112
|
export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
|
package/es/ProEnum/index.js
CHANGED
@@ -231,7 +231,6 @@ var ProEnum = function ProEnum(props) {
|
|
231
231
|
if (!code && !dataSource && !useRequest) {
|
232
232
|
var _locale$ProEnum4;
|
233
233
|
_message.error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
234
|
-
// return;
|
235
234
|
}
|
236
235
|
var transToLabel = function transToLabel(value) {
|
237
236
|
var list = dataList && dataList.length ? dataList : enumLists;
|
@@ -70,23 +70,30 @@ var Group = function Group(props) {
|
|
70
70
|
id: id,
|
71
71
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
|
72
72
|
children: columns.map(function (column, index) {
|
73
|
-
|
73
|
+
column.otherProps = otherProps;
|
74
|
+
// 自定义间隔移除对于参数
|
75
|
+
if (column === null || column === void 0 ? void 0 : column.separator) {
|
76
|
+
delete column.separator;
|
77
|
+
delete column.otherProps;
|
78
|
+
}
|
79
|
+
return _jsx(ComRender, _objectSpread({
|
74
80
|
contextProps: contextProps,
|
75
81
|
isView: isParentView || isView
|
76
|
-
}, column),
|
77
|
-
otherProps: otherProps
|
78
|
-
}), column.name);
|
82
|
+
}, column), column.name || index);
|
79
83
|
})
|
80
84
|
}) : _jsx(_Space, _objectSpread(_objectSpread({
|
81
85
|
align: "start"
|
82
86
|
}, omit(space, ['separator', 'compact'])), {}, {
|
83
87
|
children: columns.map(function (column, index) {
|
84
|
-
|
88
|
+
column.otherProps = otherProps;
|
89
|
+
if (column === null || column === void 0 ? void 0 : column.separator) {
|
90
|
+
delete column.separator;
|
91
|
+
delete column.otherProps;
|
92
|
+
}
|
93
|
+
return _jsx(ComRender, _objectSpread({
|
85
94
|
contextProps: contextProps,
|
86
95
|
isView: isParentView || isView
|
87
|
-
}, column),
|
88
|
-
otherProps: otherProps
|
89
|
-
}), column.name);
|
96
|
+
}, column), column.name || index);
|
90
97
|
})
|
91
98
|
}))
|
92
99
|
});
|
@@ -104,6 +104,21 @@
|
|
104
104
|
}
|
105
105
|
}
|
106
106
|
|
107
|
+
.pro-select {
|
108
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-selector{
|
109
|
+
border-radius: 0 !important;
|
110
|
+
}
|
111
|
+
&:first-child .@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
112
|
+
border-start-start-radius: 4px !important;
|
113
|
+
border-end-start-radius: 4px !important;
|
114
|
+
}
|
115
|
+
|
116
|
+
&:last-child .@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
117
|
+
border-start-end-radius: 4px !important;
|
118
|
+
border-end-end-radius: 4px!important;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
107
122
|
.@{ant-prefix}-select {
|
108
123
|
.@{ant-prefix}-select-selector {
|
109
124
|
.border-radius(0, 0, 0, 0);
|
@@ -4,8 +4,10 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
4
|
import "antd/es/button/style";
|
5
5
|
import _Button from "antd/es/button";
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
/* eslint-disable no-lonely-if */
|
7
8
|
import { useRef } from 'react';
|
8
9
|
import { cloneDeep, isEqual, isFunction } from 'lodash';
|
10
|
+
import { validate } from '@zat-design/utils';
|
9
11
|
import valueTypeMap from '../../../utils/valueType';
|
10
12
|
import { useDeepCompareMemo } from '../../../utils/useDeepCompareMemo';
|
11
13
|
import { difference } from '../../../../ProEditTable/utils/tools';
|
@@ -18,20 +20,52 @@ export var insertSeparator = function insertSeparator(columns, space) {
|
|
18
20
|
if (!(space === null || space === void 0 ? void 0 : space.separator)) {
|
19
21
|
return columns;
|
20
22
|
}
|
23
|
+
var separatorIndexs = function () {
|
24
|
+
var reuslt = [];
|
25
|
+
if (validate.isEmpty(space === null || space === void 0 ? void 0 : space.separatorIndex)) {
|
26
|
+
return reuslt;
|
27
|
+
}
|
28
|
+
// 如果 index 是数字,将其转换为数组
|
29
|
+
if (typeof (space === null || space === void 0 ? void 0 : space.separatorIndex) === 'number') {
|
30
|
+
reuslt.push(space.separatorIndex);
|
31
|
+
}
|
32
|
+
if (Array.isArray(space.separatorIndex)) {
|
33
|
+
reuslt = reuslt.concat(space.separatorIndex);
|
34
|
+
}
|
35
|
+
return reuslt;
|
36
|
+
}();
|
21
37
|
return columns.reduce(function (result, current, index, array) {
|
22
38
|
// 将当前元素添加到结果数组中
|
23
39
|
result.push(current);
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
40
|
+
if (separatorIndexs === null || separatorIndexs === void 0 ? void 0 : separatorIndexs.length) {
|
41
|
+
separatorIndexs.forEach(function (separatorIndex) {
|
42
|
+
if (index === separatorIndex) {
|
43
|
+
result.push({
|
44
|
+
separator: true,
|
45
|
+
component: _jsx(_Button, {
|
46
|
+
className: "group-separator",
|
47
|
+
children: space.separator
|
48
|
+
}),
|
49
|
+
fieldProps: {
|
50
|
+
disabled: true
|
51
|
+
}
|
52
|
+
});
|
33
53
|
}
|
34
54
|
});
|
55
|
+
} else {
|
56
|
+
// 如果当前元素不是最后一个元素,则添加间隔符
|
57
|
+
if (index < array.length - 1) {
|
58
|
+
result.push({
|
59
|
+
separator: true,
|
60
|
+
component: _jsx(_Button, {
|
61
|
+
className: "group-separator",
|
62
|
+
children: space.separator
|
63
|
+
}),
|
64
|
+
fieldProps: {
|
65
|
+
disabled: true
|
66
|
+
}
|
67
|
+
});
|
68
|
+
}
|
35
69
|
}
|
36
70
|
return result;
|
37
71
|
}, []);
|
@@ -35,11 +35,17 @@ var _filterDataSource = function filterDataSource(dataSource, level, fieldNames)
|
|
35
35
|
});
|
36
36
|
};
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
38
|
+
var _value2;
|
38
39
|
var dataSource = _ref.dataSource,
|
39
40
|
value = _ref.value;
|
41
|
+
var _value = value;
|
40
42
|
var viewLabel = [];
|
43
|
+
// fix: value是string类型,需要转为数组
|
44
|
+
if (_value && !Array.isArray(_value)) {
|
45
|
+
_value = [value];
|
46
|
+
}
|
41
47
|
// 根据dataSource得到label数组,查看模式展示需要
|
42
|
-
|
48
|
+
(_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2.forEach(function (value, index) {
|
43
49
|
var _dataSource;
|
44
50
|
var temp = (_dataSource = dataSource) === null || _dataSource === void 0 ? void 0 : _dataSource.find(function (item) {
|
45
51
|
return (item === null || item === void 0 ? void 0 : item.value) === value;
|
@@ -44,7 +44,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
44
44
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
45
45
|
var diffType = useMemo(function () {
|
46
46
|
if (!isWatch || noChange) return 'same';
|
47
|
-
var _value = normalize ? normalize(props[valuePropName])
|
47
|
+
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
48
|
+
: props[valuePropName];
|
48
49
|
return diffOriginal({
|
49
50
|
originalValue: originalValue,
|
50
51
|
value: _value,
|
@@ -123,7 +123,8 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
123
123
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
124
124
|
var diffType = (0, _react.useMemo)(function () {
|
125
125
|
if (!isWatch || noChange) return 'same';
|
126
|
-
var _value = normalize ? normalize(props[valuePropName])
|
126
|
+
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
127
|
+
: props[valuePropName];
|
127
128
|
return (0, _diffOriginal.diffOriginal)({
|
128
129
|
value: _value,
|
129
130
|
originalValue: originalValue,
|
@@ -8,6 +8,7 @@ import type { ColumnType, TableProps } from 'antd/es/table';
|
|
8
8
|
import type { FormInstance, FormItemProps } from 'antd/es/form';
|
9
9
|
import type { FunctionArgs, ProRule } from '../ProForm/propsType';
|
10
10
|
import { ProFormValueType, ColumnPropsMap } from '../ProForm/components/render/propsType';
|
11
|
+
import { DiffOriginalParams } from '../ProForm/utils/diffOriginal';
|
11
12
|
export type ActionType = 'edit' | 'delete' | 'save' | 'cancel' | 'add' | 'mulDelete' | 'custom';
|
12
13
|
export type ShowFunction<T> = (record?: T, options?: {
|
13
14
|
index?: number;
|
@@ -105,6 +106,7 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
105
106
|
hiddenNames?: NamePath[] | NamePath[][];
|
106
107
|
rules?: ProRule[] | RulesFn<T>;
|
107
108
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
109
|
+
onDiff?: DiffOriginalParams['equalWith'];
|
108
110
|
[key: string]: any;
|
109
111
|
}
|
110
112
|
export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
|
package/lib/ProEnum/index.js
CHANGED
@@ -232,7 +232,6 @@ var ProEnum = function ProEnum(props) {
|
|
232
232
|
if (!code && !dataSource && !useRequest) {
|
233
233
|
var _locale$ProEnum4;
|
234
234
|
_antd.message.error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
235
|
-
// return;
|
236
235
|
}
|
237
236
|
var transToLabel = function transToLabel(value) {
|
238
237
|
var list = dataList && dataList.length ? dataList : enumLists;
|
@@ -76,23 +76,30 @@ var Group = function Group(props) {
|
|
76
76
|
id: id,
|
77
77
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? (0, _jsxRuntime.jsx)(_antd.Space.Compact, {
|
78
78
|
children: columns.map(function (column, index) {
|
79
|
-
|
79
|
+
column.otherProps = otherProps;
|
80
|
+
// 自定义间隔移除对于参数
|
81
|
+
if (column === null || column === void 0 ? void 0 : column.separator) {
|
82
|
+
delete column.separator;
|
83
|
+
delete column.otherProps;
|
84
|
+
}
|
85
|
+
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)({
|
80
86
|
contextProps: contextProps,
|
81
87
|
isView: isParentView || isView
|
82
|
-
}, column),
|
83
|
-
otherProps: otherProps
|
84
|
-
}), column.name);
|
88
|
+
}, column), column.name || index);
|
85
89
|
})
|
86
90
|
}) : (0, _jsxRuntime.jsx)(_antd.Space, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
87
91
|
align: "start"
|
88
92
|
}, (0, _lodash.omit)(space, ['separator', 'compact'])), {}, {
|
89
93
|
children: columns.map(function (column, index) {
|
90
|
-
|
94
|
+
column.otherProps = otherProps;
|
95
|
+
if (column === null || column === void 0 ? void 0 : column.separator) {
|
96
|
+
delete column.separator;
|
97
|
+
delete column.otherProps;
|
98
|
+
}
|
99
|
+
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)({
|
91
100
|
contextProps: contextProps,
|
92
101
|
isView: isParentView || isView
|
93
|
-
}, column),
|
94
|
-
otherProps: otherProps
|
95
|
-
}), column.name);
|
102
|
+
}, column), column.name || index);
|
96
103
|
})
|
97
104
|
}))
|
98
105
|
});
|
@@ -104,6 +104,21 @@
|
|
104
104
|
}
|
105
105
|
}
|
106
106
|
|
107
|
+
.pro-select {
|
108
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-selector{
|
109
|
+
border-radius: 0 !important;
|
110
|
+
}
|
111
|
+
&:first-child .@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
112
|
+
border-start-start-radius: 4px !important;
|
113
|
+
border-end-start-radius: 4px !important;
|
114
|
+
}
|
115
|
+
|
116
|
+
&:last-child .@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
117
|
+
border-start-end-radius: 4px !important;
|
118
|
+
border-end-end-radius: 4px!important;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
107
122
|
.@{ant-prefix}-select {
|
108
123
|
.@{ant-prefix}-select-selector {
|
109
124
|
.border-radius(0, 0, 0, 0);
|
@@ -12,10 +12,13 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
13
13
|
var _react = require("react");
|
14
14
|
var _lodash = require("lodash");
|
15
|
+
var _utils = require("@zat-design/utils");
|
15
16
|
var _antd = require("antd");
|
16
17
|
var _valueType = _interopRequireDefault(require("../../../utils/valueType"));
|
17
18
|
var _useDeepCompareMemo = require("../../../utils/useDeepCompareMemo");
|
18
19
|
var _tools = require("../../../../ProEditTable/utils/tools");
|
20
|
+
/* eslint-disable no-lonely-if */
|
21
|
+
|
19
22
|
/**
|
20
23
|
* 插入间隔符
|
21
24
|
* @param columns 表单配置数组
|
@@ -25,20 +28,52 @@ var insertSeparator = exports.insertSeparator = function insertSeparator(columns
|
|
25
28
|
if (!(space === null || space === void 0 ? void 0 : space.separator)) {
|
26
29
|
return columns;
|
27
30
|
}
|
31
|
+
var separatorIndexs = function () {
|
32
|
+
var reuslt = [];
|
33
|
+
if (_utils.validate.isEmpty(space === null || space === void 0 ? void 0 : space.separatorIndex)) {
|
34
|
+
return reuslt;
|
35
|
+
}
|
36
|
+
// 如果 index 是数字,将其转换为数组
|
37
|
+
if (typeof (space === null || space === void 0 ? void 0 : space.separatorIndex) === 'number') {
|
38
|
+
reuslt.push(space.separatorIndex);
|
39
|
+
}
|
40
|
+
if (Array.isArray(space.separatorIndex)) {
|
41
|
+
reuslt = reuslt.concat(space.separatorIndex);
|
42
|
+
}
|
43
|
+
return reuslt;
|
44
|
+
}();
|
28
45
|
return columns.reduce(function (result, current, index, array) {
|
29
46
|
// 将当前元素添加到结果数组中
|
30
47
|
result.push(current);
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
48
|
+
if (separatorIndexs === null || separatorIndexs === void 0 ? void 0 : separatorIndexs.length) {
|
49
|
+
separatorIndexs.forEach(function (separatorIndex) {
|
50
|
+
if (index === separatorIndex) {
|
51
|
+
result.push({
|
52
|
+
separator: true,
|
53
|
+
component: (0, _jsxRuntime.jsx)(_antd.Button, {
|
54
|
+
className: "group-separator",
|
55
|
+
children: space.separator
|
56
|
+
}),
|
57
|
+
fieldProps: {
|
58
|
+
disabled: true
|
59
|
+
}
|
60
|
+
});
|
40
61
|
}
|
41
62
|
});
|
63
|
+
} else {
|
64
|
+
// 如果当前元素不是最后一个元素,则添加间隔符
|
65
|
+
if (index < array.length - 1) {
|
66
|
+
result.push({
|
67
|
+
separator: true,
|
68
|
+
component: (0, _jsxRuntime.jsx)(_antd.Button, {
|
69
|
+
className: "group-separator",
|
70
|
+
children: space.separator
|
71
|
+
}),
|
72
|
+
fieldProps: {
|
73
|
+
disabled: true
|
74
|
+
}
|
75
|
+
});
|
76
|
+
}
|
42
77
|
}
|
43
78
|
return result;
|
44
79
|
}, []);
|
@@ -35,11 +35,17 @@ var _filterDataSource = function filterDataSource(dataSource, level, fieldNames)
|
|
35
35
|
});
|
36
36
|
};
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
38
|
+
var _value2;
|
38
39
|
var dataSource = _ref.dataSource,
|
39
40
|
value = _ref.value;
|
41
|
+
var _value = value;
|
40
42
|
var viewLabel = [];
|
43
|
+
// fix: value是string类型,需要转为数组
|
44
|
+
if (_value && !Array.isArray(_value)) {
|
45
|
+
_value = [value];
|
46
|
+
}
|
41
47
|
// 根据dataSource得到label数组,查看模式展示需要
|
42
|
-
|
48
|
+
(_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2.forEach(function (value, index) {
|
43
49
|
var _dataSource;
|
44
50
|
var temp = (_dataSource = dataSource) === null || _dataSource === void 0 ? void 0 : _dataSource.find(function (item) {
|
45
51
|
return (item === null || item === void 0 ? void 0 : item.value) === value;
|
@@ -49,7 +49,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
49
49
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
50
50
|
var diffType = (0, _react.useMemo)(function () {
|
51
51
|
if (!isWatch || noChange) return 'same';
|
52
|
-
var _value = normalize ? normalize(props[valuePropName])
|
52
|
+
var _value = normalize ? normalize(props[valuePropName], undefined, undefined, true) // true 代表是值比对时的调用
|
53
|
+
: props[valuePropName];
|
53
54
|
return (0, _diffOriginal.diffOriginal)({
|
54
55
|
originalValue: originalValue,
|
55
56
|
value: _value,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
3
|
-
"version": "3.9.
|
3
|
+
"version": "3.9.2",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -59,7 +59,7 @@
|
|
59
59
|
"@dnd-kit/sortable": "^7.0.2",
|
60
60
|
"@dnd-kit/utilities": "^3.2.1",
|
61
61
|
"@pansy/react-watermark": "^3.1.13",
|
62
|
-
"@zat-design/utils": "1.1.
|
62
|
+
"@zat-design/utils": "1.1.37",
|
63
63
|
"ahooks": "3.7.4",
|
64
64
|
"antd": "4.24.8",
|
65
65
|
"big.js": "^6.2.1",
|