@zat-design/sisyphus-react 3.7.2 → 3.7.3-beta.10
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 +79 -0
- package/dist/less.esm.css +76 -0
- package/es/ProAction/index.js +4 -4
- package/es/ProDownload/index.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +29 -24
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/getDefaultProps.js +2 -1
- package/es/ProEditTable/utils/tools.js +3 -3
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +5 -4
- package/es/ProEnum/style/index.less +8 -4
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- package/es/ProForm/components/base/Input/index.d.ts +1 -1
- package/es/ProForm/components/combination/Container/index.js +5 -3
- package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/es/ProForm/components/combination/FormList/utils.js +5 -4
- package/es/ProForm/components/combination/Group/component/ComRender.js +3 -1
- package/es/ProForm/components/combination/Group/utils.js +22 -5
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +7 -7
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -1
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +16 -0
- package/es/ProForm/components/render/{Changed.js → ChangedWrapper.js} +43 -15
- package/es/ProForm/components/render/Render.js +7 -8
- package/es/ProForm/components/render/RenderFields.d.ts +2 -3
- package/es/ProForm/components/render/RenderFields.js +3 -4
- package/es/ProForm/components/render/propsType.d.ts +4 -3
- package/es/ProForm/index.js +3 -6
- package/es/ProForm/propsType.d.ts +12 -2
- package/es/ProForm/style/index.less +102 -4
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/rulesCreator.d.ts +1 -1
- package/es/ProForm/utils/rulesCreator.js +25 -22
- package/es/ProForm/utils/valueType.js +2 -2
- package/es/ProIcon/utils/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProSelect/index.js +11 -8
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.d.ts +1 -7
- package/es/ProSelect/utils/index.js +13 -5
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +5 -2
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +3 -3
- package/es/ProStep/index.js +24 -17
- package/es/ProTable/components/FormatColumn/index.js +3 -3
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +2 -1
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +18 -18
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +3 -3
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/utils.js +11 -12
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/es/ProUpload/index.js +1 -1
- package/es/ProUpload/propsType.d.ts +5 -0
- package/es/style/theme/antd.less +5 -0
- package/es/style/theme/index.less +1 -0
- package/es/style/theme/tokens.less +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +13 -0
- package/lib/ProAction/index.js +4 -4
- package/lib/ProDownload/index.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +30 -25
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/getDefaultProps.js +3 -1
- package/lib/ProEditTable/utils/tools.js +3 -3
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +5 -4
- package/lib/ProEnum/style/index.less +8 -4
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- package/lib/ProForm/components/base/Input/index.d.ts +1 -1
- package/lib/ProForm/components/combination/Container/index.js +5 -3
- package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/lib/ProForm/components/combination/FormList/utils.js +4 -3
- package/lib/ProForm/components/combination/Group/component/ComRender.js +3 -1
- package/lib/ProForm/components/combination/Group/utils.js +22 -5
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +7 -7
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -1
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +16 -0
- package/lib/ProForm/components/render/{Changed.js → ChangedWrapper.js} +43 -15
- package/lib/ProForm/components/render/Render.js +7 -8
- package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -4
- package/lib/ProForm/components/render/propsType.d.ts +4 -3
- package/lib/ProForm/index.js +3 -6
- package/lib/ProForm/propsType.d.ts +12 -2
- package/lib/ProForm/style/index.less +102 -4
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/rulesCreator.d.ts +1 -1
- package/lib/ProForm/utils/rulesCreator.js +25 -22
- package/lib/ProForm/utils/valueType.js +2 -2
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProSelect/index.js +11 -8
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.d.ts +1 -7
- package/lib/ProSelect/utils/index.js +13 -5
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +5 -2
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +3 -3
- package/lib/ProStep/index.js +24 -17
- package/lib/ProTable/components/FormatColumn/index.js +3 -3
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +2 -1
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +18 -18
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +3 -3
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/utils.js +11 -11
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/index.js +1 -1
- package/lib/ProUpload/propsType.d.ts +5 -0
- package/lib/style/theme/antd.less +5 -0
- package/lib/style/theme/index.less +1 -0
- package/lib/style/theme/tokens.less +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/package.json +2 -1
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
- /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
package/es/ProEnum/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
11
11
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
13
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
|
-
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps"],
|
|
14
|
+
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
|
15
15
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
|
16
16
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
17
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
@@ -39,10 +39,11 @@ var ProEnum = function ProEnum(props) {
|
|
|
39
39
|
onChange = props.onChange,
|
|
40
40
|
transformResponse = props.transformResponse,
|
|
41
41
|
otherProps = props.otherProps,
|
|
42
|
+
isView = props.isView,
|
|
42
43
|
enumProps = _objectWithoutProperties(props, _excluded);
|
|
43
44
|
var _ref = otherProps || {},
|
|
44
|
-
isView = _ref.isView,
|
|
45
45
|
viewEmpty = _ref.viewEmpty;
|
|
46
|
+
var _isView = isView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
|
|
46
47
|
var _ref2 = useProConfig('ProEnum') || {},
|
|
47
48
|
fieldNames = _ref2.fieldNames,
|
|
48
49
|
_ref2$clear = _ref2.clear,
|
|
@@ -226,7 +227,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
226
227
|
if (!code && !dataSource && !useRequest) {
|
|
227
228
|
var _locale$ProEnum4;
|
|
228
229
|
_message.error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
|
229
|
-
return;
|
|
230
|
+
// return;
|
|
230
231
|
}
|
|
231
232
|
var transToLabel = function transToLabel(value) {
|
|
232
233
|
var list = dataList && dataList.length ? dataList : enumLists;
|
|
@@ -271,7 +272,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
271
272
|
};
|
|
272
273
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
|
273
274
|
};
|
|
274
|
-
if (
|
|
275
|
+
if (_isView) {
|
|
275
276
|
if (Array.isArray(value)) {
|
|
276
277
|
return _jsx(Container, {
|
|
277
278
|
tooltip: true,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
justify-content: center;
|
|
20
20
|
margin-right: var(--zaui-space-size-sm);
|
|
21
21
|
padding: var(--zaui-space-size-xs) 10px;
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: var(--zaui-disabled-bg);
|
|
23
23
|
border-radius: var(--zaui-space-size-xs);
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
background-color: var(--zaui-brand);
|
|
30
30
|
}
|
|
31
31
|
&-tag-item-disabled {
|
|
32
|
-
background-color:
|
|
32
|
+
background-color: var(--zaui-disabled-bg);
|
|
33
33
|
pointer-events: none;
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -90,12 +90,16 @@
|
|
|
90
90
|
|
|
91
91
|
.pro-enum-group-item-disabled {
|
|
92
92
|
color: rgba(0, 0, 0, 0.25);
|
|
93
|
-
background:
|
|
93
|
+
background: var(--zaui-disabled-bg);
|
|
94
94
|
cursor: not-allowed;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
&-group-root-disabled {
|
|
99
|
-
|
|
99
|
+
color: #bfbfbf;
|
|
100
|
+
|
|
101
|
+
.pro-enum-group-item {
|
|
102
|
+
background: var(--zaui-disabled-bg);
|
|
103
|
+
}
|
|
100
104
|
}
|
|
101
105
|
}
|
|
@@ -7,7 +7,7 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
|
7
7
|
this.events = void 0;
|
|
8
8
|
this.events = new Map();
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
_createClass(SimpleEventCenter, [{
|
|
11
11
|
key: "subscribe",
|
|
12
12
|
value: function subscribe(eventName, callback) {
|
|
13
13
|
if (!this.events.has(eventName)) {
|
|
@@ -34,5 +34,6 @@ var SimpleEventCenter = /*#__PURE__*/function () {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}]);
|
|
37
|
+
return SimpleEventCenter;
|
|
37
38
|
}(); // 将 eventCenter 实例添加到 window 对象上
|
|
38
39
|
window.eventCenter = new SimpleEventCenter();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) =>
|
|
1
|
+
declare const getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => JSX.Element;
|
|
2
2
|
export default getEnumLabel;
|
|
@@ -5,7 +5,7 @@ interface EnumRes {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
7
|
export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any): EnumRes;
|
|
8
|
-
export declare function setEnumData(storage: StorageType, cacheKey: string, data:
|
|
8
|
+
export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
|
|
9
9
|
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): DataOption[];
|
|
10
10
|
export declare function isObject(obj: any): boolean;
|
|
11
11
|
export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): void;
|
|
@@ -13,6 +13,10 @@ export function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
export function setEnumData(storage, cacheKey, data) {
|
|
16
|
+
var _Object$keys;
|
|
17
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
16
20
|
if (storage === 'localStorage') {
|
|
17
21
|
window.localStorage.setItem(cacheKey, JSON.stringify(data));
|
|
18
22
|
} else if (storage === 'sessionStorage') {
|
|
@@ -9,11 +9,12 @@ import ProCollapse from '../../../../ProLayout/components/ProCollapse';
|
|
|
9
9
|
import ProForm from '../../../../ProForm';
|
|
10
10
|
var Container = function Container(props) {
|
|
11
11
|
var children = props.children,
|
|
12
|
-
otherProps = props.otherProps,
|
|
13
12
|
className = props.className,
|
|
14
13
|
container = props.container,
|
|
15
14
|
show = props.show,
|
|
16
|
-
clearNotShow = props.clearNotShow
|
|
15
|
+
clearNotShow = props.clearNotShow,
|
|
16
|
+
diffConfig = props.diffConfig,
|
|
17
|
+
otherProps = props.otherProps;
|
|
17
18
|
var _ref = ProForm.useFieldProps() || {},
|
|
18
19
|
type = _ref.type,
|
|
19
20
|
form = _ref.form,
|
|
@@ -38,7 +39,8 @@ var Container = function Container(props) {
|
|
|
38
39
|
var childRender = function childRender() {
|
|
39
40
|
var child = _jsx(RenderFields, _objectSpread({
|
|
40
41
|
columns: _children,
|
|
41
|
-
form: form
|
|
42
|
+
form: form,
|
|
43
|
+
diffConfig: diffConfig
|
|
42
44
|
}, otherProps));
|
|
43
45
|
if (type === 'ProCollapse') {
|
|
44
46
|
return _jsx(ProCollapse, _objectSpread(_objectSpread({}, omit(props, ['otherProps', 'children', 'onBlur', 'onChange', 'placeholder', 'className'])), {}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowProps } from 'antd';
|
|
3
|
-
import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
3
|
+
import { ProColumnProps, ProFormOtherProps, DiffConfigProps } from '../../../propsType';
|
|
4
4
|
export interface ContainerProps {
|
|
5
5
|
children?: ProColumnProps[];
|
|
6
6
|
otherProps?: ProFormOtherProps;
|
|
@@ -8,5 +8,6 @@ export interface ContainerProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
container?: string | React.ReactNode;
|
|
10
10
|
show?: boolean | (() => boolean);
|
|
11
|
+
diffConfig?: DiffConfigProps;
|
|
11
12
|
clearNotShow?: boolean;
|
|
12
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEqualWith
|
|
1
|
+
import { isEqualWith } from 'lodash';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
|
@@ -26,8 +26,9 @@ export var memoWith = function memoWith(pre, next) {
|
|
|
26
26
|
if ( /*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// 移除解决formlist函数里不更新问题
|
|
30
|
+
// if (isFunction(objValue) && isFunction(othValue)) {
|
|
31
|
+
// return true;
|
|
32
|
+
// }
|
|
32
33
|
});
|
|
33
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName"];
|
|
4
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType"];
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
|
|
@@ -40,6 +40,7 @@ var ComRender = function ComRender(props) {
|
|
|
40
40
|
getValueProps = props.getValueProps,
|
|
41
41
|
_props$valuePropName = props.valuePropName,
|
|
42
42
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
43
|
+
valueType = props.valueType,
|
|
43
44
|
rest = _objectWithoutProperties(props, _excluded);
|
|
44
45
|
var TypeComponent = componentMap[type];
|
|
45
46
|
var mergedGetValueProps = getValueProps || function (val) {
|
|
@@ -51,6 +52,7 @@ var ComRender = function ComRender(props) {
|
|
|
51
52
|
var Com = getComRender(Component, props, componentProps);
|
|
52
53
|
return _jsx(FieldProvider, {
|
|
53
54
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
55
|
+
valueType: valueType,
|
|
54
56
|
type: type
|
|
55
57
|
}),
|
|
56
58
|
children: Com
|
|
@@ -87,7 +87,7 @@ export var getReactiveProps = function getReactiveProps(params) {
|
|
|
87
87
|
component = params.component,
|
|
88
88
|
fieldProps = params.fieldProps,
|
|
89
89
|
name = params.name;
|
|
90
|
-
var values = form.
|
|
90
|
+
var values = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
|
|
91
91
|
var _disabled = isFunction(disabled) ? disabled(values, {
|
|
92
92
|
form: form,
|
|
93
93
|
index: index,
|
|
@@ -182,13 +182,14 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
182
182
|
mode = _ref.mode,
|
|
183
183
|
onChange = _ref.onChange,
|
|
184
184
|
onFieldChange = _ref.onFieldChange,
|
|
185
|
-
comDisabled = _ref.disabled
|
|
185
|
+
comDisabled = _ref.disabled,
|
|
186
|
+
onBlur = _ref.onBlur;
|
|
186
187
|
var _disabled = disabled || comDisabled;
|
|
187
188
|
var columnName = names ? names[index] : [].concat(name, index);
|
|
188
189
|
// 响应式字段改变后的回调
|
|
189
190
|
var changedCallback = function changedCallback(lastDependency, current) {
|
|
190
191
|
// 清值防抖 多次刷新时以最后一次为准
|
|
191
|
-
if (clearNotShow !== false) {
|
|
192
|
+
if (clearNotShow !== false && names) {
|
|
192
193
|
if ((current === null || current === void 0 ? void 0 : current.show) === false) {
|
|
193
194
|
clearInterval(timerRef.current[index]);
|
|
194
195
|
timerRef.current[index] = setTimeout(function () {
|
|
@@ -237,10 +238,12 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
237
238
|
args[_key] = arguments[_key];
|
|
238
239
|
}
|
|
239
240
|
newValue = valueFromEventWrapper(column, args);
|
|
240
|
-
if (
|
|
241
|
+
if (transform === null || transform === void 0 ? void 0 : transform.normalize) {
|
|
241
242
|
var _transform$normalize;
|
|
243
|
+
newValue = transform === null || transform === void 0 ? void 0 : (_transform$normalize = transform.normalize) === null || _transform$normalize === void 0 ? void 0 : _transform$normalize.call(transform, newValue);
|
|
244
|
+
} else if (normalize) {
|
|
242
245
|
// @ts-ignore
|
|
243
|
-
newValue =
|
|
246
|
+
newValue = normalize === null || normalize === void 0 ? void 0 : normalize(newValue);
|
|
244
247
|
}
|
|
245
248
|
internalChange === null || internalChange === void 0 ? void 0 : internalChange(newValue, args[1], index);
|
|
246
249
|
var values = form.getFieldValue(namePath);
|
|
@@ -267,6 +270,19 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
267
270
|
}
|
|
268
271
|
}
|
|
269
272
|
};
|
|
273
|
+
var handleBlur = function handleBlur() {
|
|
274
|
+
if (!onBlur) return;
|
|
275
|
+
var values = form.getFieldValue(namePath);
|
|
276
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
277
|
+
args[_key2] = arguments[_key2];
|
|
278
|
+
}
|
|
279
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(args[0], values, {
|
|
280
|
+
index: outerIndex,
|
|
281
|
+
namePath: namePath,
|
|
282
|
+
form: form,
|
|
283
|
+
option: args === null || args === void 0 ? void 0 : args[1]
|
|
284
|
+
});
|
|
285
|
+
};
|
|
270
286
|
return _objectSpread(_objectSpread(_objectSpread({}, column), {}, {
|
|
271
287
|
name: columnName
|
|
272
288
|
}, reactiveProps), {}, {
|
|
@@ -274,6 +290,7 @@ export var useTransformColumns = function useTransformColumns(params) {
|
|
|
274
290
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
275
291
|
fieldProps: _objectSpread(_objectSpread({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
276
292
|
onChange: handleChange,
|
|
293
|
+
onBlur: handleBlur,
|
|
277
294
|
value: value === null || value === void 0 ? void 0 : value[index]
|
|
278
295
|
})
|
|
279
296
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProCascaderProps } from './propsType';
|
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) =>
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -29,9 +29,9 @@ var defaultFieldNames = {
|
|
|
29
29
|
value: 'code',
|
|
30
30
|
children: 'children'
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var filterDataSource = function filterDataSource(dataSource, level, fieldNames) {
|
|
33
33
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
34
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] :
|
|
34
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] : filterDataSource(item === null || item === void 0 ? void 0 : item[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], level - 1, fieldNames)));
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
|
@@ -96,7 +96,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = useMemo(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ?
|
|
99
|
+
var result = isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
100
|
return transformDataName(result, fieldNames);
|
|
101
101
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
102
102
|
var _useRequest = _objectSpread({}, useRequest),
|
|
@@ -131,7 +131,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
131
131
|
value: fieldNames.value,
|
|
132
132
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
|
133
133
|
});
|
|
134
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
|
134
|
+
serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level, fieldNames) : transFormData;
|
|
135
135
|
setServiceData(serviceData);
|
|
136
136
|
case 9:
|
|
137
137
|
case "end":
|
|
@@ -196,7 +196,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
196
196
|
})) === null || _ref7$filter === void 0 ? void 0 : _ref7$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
|
197
197
|
return !!item;
|
|
198
198
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
|
199
|
-
var
|
|
199
|
+
var findSelectedOptions = function findSelectedOptions(options, value) {
|
|
200
200
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
201
201
|
var _value = value !== null && value !== void 0 ? value : [];
|
|
202
202
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
|
@@ -215,7 +215,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
215
215
|
if (foundOption) {
|
|
216
216
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
|
217
217
|
if (_value.length > 1 && foundOption.children) {
|
|
218
|
-
return
|
|
218
|
+
return findSelectedOptions(foundOption.children, _value.slice(1), [].concat(_toConsumableArray(path), [foundOption]));
|
|
219
219
|
}
|
|
220
220
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
|
221
221
|
return [].concat(_toConsumableArray(path), [foundOption]);
|
|
@@ -224,7 +224,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
var _selectedOptions = useMemo(function () {
|
|
227
|
-
return
|
|
227
|
+
return findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
|
228
228
|
}, [service, serviceData, realDataSource, addressValue]);
|
|
229
229
|
var handleAddressChange = function handleAddressChange(e) {
|
|
230
230
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
|
@@ -91,7 +91,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
91
91
|
});
|
|
92
92
|
// 查看模式
|
|
93
93
|
if (isView || props.isView) {
|
|
94
|
-
if (isEmpty(value)) {
|
|
94
|
+
if (isEmpty(value) || (value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
95
|
+
return typeof item !== 'number';
|
|
96
|
+
}))) {
|
|
95
97
|
return viewEmpty;
|
|
96
98
|
}
|
|
97
99
|
switch (valueType) {
|
|
@@ -12,5 +12,5 @@ export interface InputRangeProps {
|
|
|
12
12
|
isPositiveInteger?: boolean;
|
|
13
13
|
precision?: number;
|
|
14
14
|
}
|
|
15
|
-
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) =>
|
|
15
|
+
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => JSX.Element;
|
|
16
16
|
export default InputRange;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ProAddressPropsType } from './propsTypes';
|
|
2
3
|
export declare const transferAddressInfoToRegion: () => {
|
|
3
4
|
normalize: (value: any) => {
|
|
@@ -23,5 +24,5 @@ export declare const transferAddressInfoToRegion: () => {
|
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
|
-
export declare function ProAddress({ ...props }: ProAddressPropsType):
|
|
27
|
+
export declare function ProAddress({ ...props }: ProAddressPropsType): JSX.Element;
|
|
27
28
|
export default ProAddress;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ProRangeBoxPropsType } from './propsType';
|
|
2
|
-
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType):
|
|
3
|
+
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
import { NamePath } from 'antd/lib/form/interface';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
|
+
interface Props {
|
|
7
|
+
name?: NamePath;
|
|
8
|
+
names?: NamePath[];
|
|
9
|
+
namesStr?: string;
|
|
10
|
+
diffConfig?: DiffConfigProps;
|
|
11
|
+
form: FormInstance;
|
|
12
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
}
|
|
15
|
+
declare const ChangedWrapper: React.FC<Props>;
|
|
16
|
+
export default ChangedWrapper;
|
|
@@ -4,61 +4,89 @@ import "antd/es/tooltip/style";
|
|
|
4
4
|
import _Tooltip from "antd/es/tooltip";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["name", "names", "namesStr", "
|
|
7
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import classNames from 'classnames';
|
|
9
10
|
import { get } from 'lodash';
|
|
10
11
|
import React, { useMemo } from 'react';
|
|
11
12
|
import { diffOriginal } from '../../utils/diffOriginal';
|
|
12
|
-
|
|
13
|
+
import { useProConfig } from '../../../ProConfigProvider';
|
|
14
|
+
import { isEmpty } from '../../../utils';
|
|
15
|
+
var ChangedWrapper = function ChangedWrapper(props) {
|
|
16
|
+
var _diffConfig$toolTip;
|
|
13
17
|
var name = props.name,
|
|
14
18
|
names = props.names,
|
|
15
19
|
namesStr = props.namesStr,
|
|
16
|
-
originalValues = props.originalValues,
|
|
17
20
|
form = props.form,
|
|
18
21
|
equalWith = props.equalWith,
|
|
19
22
|
children = props.children,
|
|
20
23
|
type = props.type,
|
|
21
|
-
|
|
24
|
+
diffConfig = props.diffConfig,
|
|
25
|
+
_props$valuePropName = props.valuePropName,
|
|
26
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
22
27
|
rest = _objectWithoutProperties(props, _excluded);
|
|
28
|
+
var _useProConfig = useProConfig('ProForm'),
|
|
29
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
30
|
+
var originalValues = diffConfig.originalValues,
|
|
31
|
+
changeTipColor = diffConfig.changeTipColor,
|
|
32
|
+
addTipColor = diffConfig.addTipColor;
|
|
33
|
+
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
23
34
|
// 不渲染tooltip
|
|
24
|
-
var
|
|
35
|
+
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
25
36
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
26
37
|
return get(originalValues, name);
|
|
27
38
|
}) : get(originalValues, name);
|
|
28
|
-
var noChange = !equalWith && (!originalValues ||
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
39
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
|
40
|
+
var diffType = useMemo(function () {
|
|
41
|
+
if (!isWatch || noChange) return 'same';
|
|
31
42
|
return diffOriginal({
|
|
32
43
|
originalValue: originalValue,
|
|
33
|
-
value: props
|
|
44
|
+
value: props[valuePropName],
|
|
34
45
|
form: form,
|
|
35
46
|
equalWith: equalWith
|
|
36
47
|
// name: namesStr || name,
|
|
37
48
|
});
|
|
38
|
-
}, [
|
|
49
|
+
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
50
|
+
var isAdd = diffType === 'add';
|
|
51
|
+
var isChanged = diffType === 'changed';
|
|
39
52
|
var tipContent = useMemo(function () {
|
|
40
|
-
if (
|
|
53
|
+
if (!isWatch || noChange) return undefined;
|
|
41
54
|
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, {
|
|
42
55
|
isView: true,
|
|
43
56
|
value: originalValue,
|
|
44
57
|
checked: type === 'Switch' ? originalValue : undefined
|
|
45
58
|
})) : undefined;
|
|
46
59
|
}, [originalValue, children]);
|
|
47
|
-
if (
|
|
60
|
+
if (!isWatch || noChange) {
|
|
48
61
|
return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
|
|
49
62
|
}
|
|
63
|
+
var tipOpenCalc = function tipOpenCalc() {
|
|
64
|
+
if (!toolTip) return false;
|
|
65
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
66
|
+
return isChanged ? undefined : false;
|
|
67
|
+
};
|
|
68
|
+
var style = {
|
|
69
|
+
'--zaui-contract-bg': changeTipColor,
|
|
70
|
+
'--zaui-contract-bg-add': addTipColor
|
|
71
|
+
};
|
|
72
|
+
var diffClassName = classNames({
|
|
73
|
+
'pro-form-item-changed': isChanged,
|
|
74
|
+
'pro-form-item-add': isAdd
|
|
75
|
+
});
|
|
50
76
|
return _jsx(_Tooltip, {
|
|
51
|
-
open:
|
|
77
|
+
open: tipOpenCalc(),
|
|
52
78
|
getPopupContainer: function getPopupContainer(target) {
|
|
53
79
|
return target.parentElement;
|
|
54
80
|
},
|
|
55
81
|
title: _jsxs(_Space, {
|
|
56
82
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
57
83
|
}),
|
|
84
|
+
placement: "topLeft",
|
|
58
85
|
children: _jsx("div", {
|
|
59
|
-
className:
|
|
86
|
+
className: diffClassName,
|
|
87
|
+
style: style,
|
|
60
88
|
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest)) : undefined
|
|
61
89
|
})
|
|
62
90
|
});
|
|
63
91
|
};
|
|
64
|
-
export default
|
|
92
|
+
export default ChangedWrapper;
|
|
@@ -28,7 +28,7 @@ import valueTypeMap from '../../utils/valueType';
|
|
|
28
28
|
import tipSvg from '../../../assets/tip.svg';
|
|
29
29
|
import useRules from '../../utils/useRules';
|
|
30
30
|
import ConfirmWrapper from './ConfirmWrapper';
|
|
31
|
-
import
|
|
31
|
+
import ChangedWrapper from './ChangedWrapper';
|
|
32
32
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
33
33
|
var Render = function Render(props) {
|
|
34
34
|
var _ref2, _ref3, _ref4, _ref5, _otherProps$names2;
|
|
@@ -46,12 +46,11 @@ var Render = function Render(props) {
|
|
|
46
46
|
formDisabled = props.formDisabled,
|
|
47
47
|
type = props.type,
|
|
48
48
|
isSelect = props.isSelect,
|
|
49
|
-
originalValues = props.originalValues,
|
|
50
49
|
equalWith = props.equalWith,
|
|
51
50
|
requiredOnView = props.requiredOnView,
|
|
52
|
-
originalDiffTip = props.originalDiffTip,
|
|
53
51
|
confirm = props.confirm,
|
|
54
|
-
globalControl = props.globalControl
|
|
52
|
+
globalControl = props.globalControl,
|
|
53
|
+
diffConfig = props.diffConfig;
|
|
55
54
|
var colProps = props.colProps;
|
|
56
55
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
|
57
56
|
var labelWidth = formItemProps.labelWidth,
|
|
@@ -427,17 +426,17 @@ var Render = function Render(props) {
|
|
|
427
426
|
span: 24 // 默认占一行
|
|
428
427
|
});
|
|
429
428
|
}
|
|
430
|
-
if (
|
|
431
|
-
child = _jsx(
|
|
429
|
+
if (diffConfig) {
|
|
430
|
+
child = _jsx(ChangedWrapper, {
|
|
432
431
|
name: formItemProps.name,
|
|
433
432
|
names: otherProps.names,
|
|
434
433
|
namesStr: namesStr,
|
|
435
|
-
|
|
434
|
+
diffConfig: diffConfig,
|
|
436
435
|
form: form,
|
|
437
436
|
equalWith: equalWith,
|
|
438
|
-
originalDiffTip: originalDiffTip,
|
|
439
437
|
type: type,
|
|
440
438
|
onChange: handleChange,
|
|
439
|
+
valuePropName: _otherFormItemProps.valuePropName,
|
|
441
440
|
children: child
|
|
442
441
|
});
|
|
443
442
|
}
|
|
@@ -2,7 +2,7 @@ import { ColProps } from 'antd';
|
|
|
2
2
|
import { FormInstance } from 'antd/es/form/Form';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ProColumnProps } from './propsType';
|
|
5
|
-
import {
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
6
|
interface Props<T = any> {
|
|
7
7
|
isView?: boolean;
|
|
8
8
|
columns: ProColumnProps[];
|
|
@@ -13,11 +13,10 @@ interface Props<T = any> {
|
|
|
13
13
|
viewEmpty?: React.ReactNode;
|
|
14
14
|
openState?: boolean;
|
|
15
15
|
labelWidth?: string | number;
|
|
16
|
-
|
|
16
|
+
diffConfig?: DiffConfigProps;
|
|
17
17
|
clearNotShow?: boolean;
|
|
18
18
|
requiredOnView?: boolean;
|
|
19
19
|
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
20
|
-
originalDiffTip?: boolean;
|
|
21
20
|
globalControl?: boolean;
|
|
22
21
|
}
|
|
23
22
|
declare const RenderFields: React.FC<Props>;
|
|
@@ -22,11 +22,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
22
22
|
viewEmpty = _props$viewEmpty === void 0 ? '-' : _props$viewEmpty,
|
|
23
23
|
openState = props.openState,
|
|
24
24
|
labelWidth = props.labelWidth,
|
|
25
|
-
originalValues = props.originalValues,
|
|
26
25
|
outerClearNotShow = props.clearNotShow,
|
|
27
26
|
requiredOnView = props.requiredOnView,
|
|
28
27
|
required = props.required,
|
|
29
|
-
|
|
28
|
+
diffConfig = props.diffConfig,
|
|
30
29
|
globalControl = props.globalControl;
|
|
31
30
|
// 是否包含隐藏字段
|
|
32
31
|
var hiddenData = columns.filter(function (item) {
|
|
@@ -154,6 +153,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
154
153
|
if (['ProCollapse', 'Container'].includes(_type)) {
|
|
155
154
|
componentProps.show = show;
|
|
156
155
|
componentProps.clearNotShow = clearNotShow;
|
|
156
|
+
componentProps.diffConfig = diffConfig;
|
|
157
157
|
}
|
|
158
158
|
// switch与SwitchCheckbox单独添加valuePropName
|
|
159
159
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
@@ -206,10 +206,9 @@ var RenderFields = function RenderFields(props) {
|
|
|
206
206
|
otherProps: otherProps,
|
|
207
207
|
fieldProps: isFunction(fieldProps) ? fieldProps : null,
|
|
208
208
|
isSelect: _isSelect,
|
|
209
|
-
|
|
209
|
+
diffConfig: diffConfig,
|
|
210
210
|
equalWith: equalWith,
|
|
211
211
|
requiredOnView: requiredOnView,
|
|
212
|
-
originalDiffTip: originalDiffTip,
|
|
213
212
|
globalControl: globalControl
|
|
214
213
|
})
|
|
215
214
|
}, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
|
|
@@ -30,7 +30,8 @@ import { ProUploadProps } from '../../../ProUpload/propsType';
|
|
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
|
31
31
|
import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
|
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
33
|
-
import { DistributiveOmit } from '../../propsType';
|
|
33
|
+
import { DistributiveOmit, DiffConfigProps } from '../../propsType';
|
|
34
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
34
35
|
export type ComponentMap = keyof typeof componentMap;
|
|
35
36
|
type ValidateKey = keyof typeof validate;
|
|
36
37
|
type RegExpKey = keyof typeof regExp;
|
|
@@ -201,7 +202,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
201
202
|
upperCase?: boolean;
|
|
202
203
|
hiddenNames?: string[] | any[];
|
|
203
204
|
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
|
204
|
-
equalWith?:
|
|
205
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
205
206
|
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
206
207
|
labelRequired?: boolean;
|
|
207
208
|
toISOString?: boolean;
|
|
@@ -267,7 +268,7 @@ export interface RenderProps<Values = any> {
|
|
|
267
268
|
form: FormInstance<Values>;
|
|
268
269
|
fieldProps?: ReactiveFunction<Values, React.ReactNode>;
|
|
269
270
|
isSelect: boolean;
|
|
270
|
-
|
|
271
|
+
diffConfig: DiffConfigProps;
|
|
271
272
|
requiredOnView?: boolean;
|
|
272
273
|
confirm?: ProFormColumnProps['confirm'];
|
|
273
274
|
globalControl?: boolean;
|