@zat-design/sisyphus-react 3.8.2 → 3.8.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/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/dist/index.esm.css +32 -8
- package/dist/less.esm.css +32 -8
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +22 -7
- package/es/ProEditTable/components/RenderField/index.js +9 -1
- package/es/ProEditTable/index.js +0 -1
- package/es/ProEditTable/propsType.d.ts +0 -1
- package/es/ProEditTable/utils/index.js +10 -3
- package/es/ProEnum/hooks/useEnumRequest.js +1 -1
- package/es/ProEnum/index.js +2 -2
- package/es/ProForm/components/base/InputNumber/index.js +1 -1
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/es/ProForm/components/combination/FormList/index.js +14 -3
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +4 -2
- package/es/ProForm/components/combination/Group/index.js +6 -3
- package/es/ProForm/components/combination/ProCascader/index.js +20 -13
- package/es/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/es/ProForm/components/render/ChangedWrapper.js +20 -2
- package/es/ProForm/components/render/Render.js +6 -3
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/components/render/propsType.d.ts +4 -0
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +22 -2
- package/es/ProForm/utils/diffOriginal.js +14 -2
- package/es/ProForm/utils/useShouldUpdate.js +20 -13
- package/es/ProTable/components/FormatColumn/index.d.ts +4 -1
- package/es/ProTable/components/FormatColumn/index.js +180 -30
- package/es/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/es/ProTable/components/RenderColumn/index.js +28 -10
- package/es/ProTable/index.js +26 -10
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTable/style/index.less +22 -6
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +25 -10
- package/lib/ProEditTable/components/RenderField/index.js +9 -1
- package/lib/ProEditTable/index.js +0 -1
- package/lib/ProEditTable/propsType.d.ts +0 -1
- package/lib/ProEditTable/utils/index.js +10 -3
- package/lib/ProEnum/hooks/useEnumRequest.js +1 -1
- package/lib/ProEnum/index.js +2 -2
- package/lib/ProForm/components/base/InputNumber/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/index.js +14 -3
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +4 -2
- package/lib/ProForm/components/combination/Group/index.js +6 -3
- package/lib/ProForm/components/combination/ProCascader/index.js +20 -13
- package/lib/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/lib/ProForm/components/render/ChangedWrapper.js +20 -2
- package/lib/ProForm/components/render/Render.js +6 -3
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/components/render/propsType.d.ts +4 -0
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +22 -2
- package/lib/ProForm/utils/diffOriginal.js +13 -1
- package/lib/ProForm/utils/useShouldUpdate.js +18 -11
- package/lib/ProTable/components/FormatColumn/index.d.ts +4 -1
- package/lib/ProTable/components/FormatColumn/index.js +179 -29
- package/lib/ProTable/components/RenderColumn/index.d.ts +2 -0
- package/lib/ProTable/components/RenderColumn/index.js +27 -9
- package/lib/ProTable/index.js +26 -10
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTable/style/index.less +22 -6
- package/package.json +4 -3
- package/.vscode/extensions.json +0 -5
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -16,7 +17,7 @@ var _lodash = require("lodash");
|
|
|
16
17
|
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
17
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
18
19
|
var _utils = require("../../../utils");
|
|
19
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender"];
|
|
20
21
|
var toNamePath = function toNamePath(name) {
|
|
21
22
|
if (Array.isArray(name)) {
|
|
22
23
|
return name;
|
|
@@ -84,8 +85,10 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
84
85
|
children = props.children,
|
|
85
86
|
type = props.type,
|
|
86
87
|
normalize = props.normalize,
|
|
88
|
+
getValueProps = props.getValueProps,
|
|
87
89
|
_props$valuePropName = props.valuePropName,
|
|
88
90
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
91
|
+
viewRender = props.viewRender,
|
|
89
92
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
90
93
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
|
|
91
94
|
isDiffAll = _ref2.isDiffAll;
|
|
@@ -115,8 +118,25 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
115
118
|
}, [props[valuePropName], originalValue]);
|
|
116
119
|
var isAdd = diffType === 'add';
|
|
117
120
|
var isChanged = diffType === 'changed';
|
|
121
|
+
var tipContent = (0, _react.useMemo)(function () {
|
|
122
|
+
var _getValueProps;
|
|
123
|
+
if (!isWatch || noChange) return undefined;
|
|
124
|
+
var orgValue = getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
125
|
+
// 兼容viewRender函数和Element场景
|
|
126
|
+
var _children = children;
|
|
127
|
+
if (viewRender) {
|
|
128
|
+
if (! /*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
129
|
+
return viewRender(orgValue);
|
|
130
|
+
}
|
|
131
|
+
_children = viewRender;
|
|
132
|
+
}
|
|
133
|
+
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
isView: true
|
|
136
|
+
}, valuePropName, orgValue), "checked", type === 'Switch' ? originalValue : undefined))) : undefined;
|
|
137
|
+
}, [originalValue, children]);
|
|
118
138
|
if (!isWatch || noChange) {
|
|
119
|
-
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0,
|
|
139
|
+
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest));
|
|
120
140
|
}
|
|
121
141
|
var diffClassName = (0, _classnames.default)({
|
|
122
142
|
'pro-form-item-changed': isChanged,
|
|
@@ -131,16 +151,11 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
131
151
|
return target.parentElement;
|
|
132
152
|
},
|
|
133
153
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
134
|
-
children: ["\u521D\u59CB\u503C\uFF1A",
|
|
135
|
-
// @ts-ignore
|
|
136
|
-
isView: true,
|
|
137
|
-
value: originalValue,
|
|
138
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
139
|
-
})) : undefined]
|
|
154
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
140
155
|
}),
|
|
141
156
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
142
157
|
className: diffClassName,
|
|
143
|
-
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0,
|
|
158
|
+
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest)) : undefined
|
|
144
159
|
})
|
|
145
160
|
});
|
|
146
161
|
};
|
|
@@ -255,13 +255,19 @@ var RenderField = function RenderField(_ref) {
|
|
|
255
255
|
TargetComponent = _editRender;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
var viewRenderFun = function viewRenderFun(value) {
|
|
259
|
+
if (/*#__PURE__*/_react.default.isValidElement(viewRender)) {
|
|
260
|
+
return viewRender;
|
|
261
|
+
}
|
|
262
|
+
return viewRender === null || viewRender === void 0 ? void 0 : viewRender(value, record, options);
|
|
263
|
+
};
|
|
258
264
|
// 查看模式
|
|
259
265
|
if (isView) {
|
|
260
266
|
// 存在viewRender覆盖默认值
|
|
261
267
|
if (typeof viewRender === 'function') {
|
|
262
268
|
var _column$dataIndex;
|
|
263
269
|
currentValue = (column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.includes('-')) ? value : currentValue;
|
|
264
|
-
var View =
|
|
270
|
+
var View = viewRenderFun(currentValue);
|
|
265
271
|
TargetComponent = (0, _jsxRuntime.jsx)(_Container.default, {
|
|
266
272
|
viewEmpty: viewEmpty,
|
|
267
273
|
children: View
|
|
@@ -566,6 +572,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
566
572
|
onChange: _onChange,
|
|
567
573
|
valuePropName: _formItemProps.valuePropName,
|
|
568
574
|
normalize: _formItemProps.normalize,
|
|
575
|
+
getValueProps: _formItemProps.getValueProps,
|
|
576
|
+
viewRender: viewRender && viewRenderFun,
|
|
569
577
|
children: FieldComponent
|
|
570
578
|
});
|
|
571
579
|
}
|
|
@@ -92,7 +92,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
92
92
|
return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
|
|
93
93
|
}, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
|
|
94
94
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
95
|
-
_columns: columns,
|
|
96
95
|
cellNamePath: [],
|
|
97
96
|
forceUpdate: {},
|
|
98
97
|
editingKeys: [],
|
|
@@ -109,7 +109,6 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
|
|
|
109
109
|
}
|
|
110
110
|
export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
|
|
111
111
|
export interface State {
|
|
112
|
-
_columns: ProEditTableColumnsProps[];
|
|
113
112
|
cellNamePath: NamePath[];
|
|
114
113
|
forceUpdate: {};
|
|
115
114
|
editingKeys: string[];
|
|
@@ -339,14 +339,21 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
// 单行多行交互有较大差异
|
|
342
|
-
return (0, _jsxRuntime.
|
|
342
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
343
343
|
className: cellClassName,
|
|
344
344
|
onClick: function onClick() {
|
|
345
345
|
isCanEdit && setState({
|
|
346
346
|
cellNamePath: cellName
|
|
347
347
|
});
|
|
348
348
|
},
|
|
349
|
-
children: (0, _jsxRuntime.jsx)(
|
|
349
|
+
children: [index === 0 && !item.width ? (0, _jsxRuntime.jsx)("div", {
|
|
350
|
+
style: {
|
|
351
|
+
visibility: 'hidden',
|
|
352
|
+
height: 0,
|
|
353
|
+
paddingLeft: (item === null || item === void 0 ? void 0 : item.required) ? 16 : 0
|
|
354
|
+
},
|
|
355
|
+
children: columnTitle
|
|
356
|
+
}) : null, (0, _jsxRuntime.jsx)(_components.RenderField, {
|
|
350
357
|
text: _text,
|
|
351
358
|
record: record,
|
|
352
359
|
index: index,
|
|
@@ -355,7 +362,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
355
362
|
cellName: cellName,
|
|
356
363
|
isEditing: isEditing // 是否正在编辑
|
|
357
364
|
})
|
|
358
|
-
})
|
|
365
|
+
})]
|
|
359
366
|
});
|
|
360
367
|
};
|
|
361
368
|
item.render = _render;
|
|
@@ -49,7 +49,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
49
49
|
}
|
|
50
50
|
var logDebug = function logDebug(msg) {
|
|
51
51
|
if (props.debugger) {
|
|
52
|
-
console.
|
|
52
|
+
console.warn('proEnum:', msg);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
var enumRes = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
package/lib/ProEnum/index.js
CHANGED
|
@@ -54,8 +54,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
54
54
|
showCodeName = _ref2.showCodeName,
|
|
55
55
|
resProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
56
56
|
enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
|
|
57
|
-
var label = '';
|
|
58
|
-
var fieldValue = '';
|
|
57
|
+
var label = 'label';
|
|
58
|
+
var fieldValue = 'value';
|
|
59
59
|
var _useState = (0, _react.useState)(dataSource || []),
|
|
60
60
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
61
|
dataList = _useState2[0],
|
|
@@ -86,7 +86,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
86
86
|
var _parser = function parser(value, precision) {
|
|
87
87
|
if (value === '') return value;
|
|
88
88
|
var num = Number(value.replace(/[\s,]+/g, ''));
|
|
89
|
-
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
|
|
89
|
+
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : Number(value) : Number(num.toFixed(precision));
|
|
90
90
|
};
|
|
91
91
|
if (valueType) {
|
|
92
92
|
switch (valueType) {
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { InternalNamePath } from 'antd/es/form/interface';
|
|
4
4
|
import type { levelType } from '../../../../../ProLayout/components/ProCollapse/PropTypes';
|
|
5
5
|
import type { FormListProps } from '../propsType';
|
|
6
|
+
import { DiffConfigProps } from '../../../../propsType';
|
|
6
7
|
interface Props extends Omit<FormListProps, 'toolbarProps'> {
|
|
7
8
|
index: number;
|
|
8
9
|
namePath: InternalNamePath;
|
|
@@ -14,6 +15,7 @@ interface Props extends Omit<FormListProps, 'toolbarProps'> {
|
|
|
14
15
|
};
|
|
15
16
|
level?: levelType;
|
|
16
17
|
towCollapse?: boolean;
|
|
18
|
+
diffConfig?: DiffConfigProps;
|
|
17
19
|
}
|
|
18
20
|
declare const BlockFields: React.FC<Props>;
|
|
19
21
|
export default BlockFields;
|
|
@@ -36,7 +36,8 @@ var BlockFields = function BlockFields(props) {
|
|
|
36
36
|
_props$level = props.level,
|
|
37
37
|
level = _props$level === void 0 ? '2' : _props$level,
|
|
38
38
|
towCollapse = props.towCollapse,
|
|
39
|
-
id = props.id
|
|
39
|
+
id = props.id,
|
|
40
|
+
diffConfig = props.diffConfig;
|
|
40
41
|
var _title = (0, _react.useMemo)(function () {
|
|
41
42
|
if ((0, _lodash.isFunction)(title)) {
|
|
42
43
|
var record = form.getFieldValue(namePath);
|
|
@@ -78,7 +79,8 @@ var BlockFields = function BlockFields(props) {
|
|
|
78
79
|
form: form,
|
|
79
80
|
colProps: colProps,
|
|
80
81
|
disabled: disabled,
|
|
81
|
-
isView: isView
|
|
82
|
+
isView: isView,
|
|
83
|
+
diffConfig: diffConfig
|
|
82
84
|
})
|
|
83
85
|
}, field.key)
|
|
84
86
|
})
|
|
@@ -2,6 +2,7 @@ import { ColProps, FormListFieldData } from 'antd';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { InternalNamePath } from 'antd/es/form/interface';
|
|
4
4
|
import { FormListProps } from '../propsType';
|
|
5
|
+
import { DiffConfigProps } from '../../../../propsType';
|
|
5
6
|
interface Props extends Omit<FormListProps, 'toolbarProps'> {
|
|
6
7
|
className?: string;
|
|
7
8
|
index: number;
|
|
@@ -12,6 +13,7 @@ interface Props extends Omit<FormListProps, 'toolbarProps'> {
|
|
|
12
13
|
field: Omit<FormListFieldData, 'key'> & {
|
|
13
14
|
key: string;
|
|
14
15
|
};
|
|
16
|
+
diffConfig?: DiffConfigProps;
|
|
15
17
|
}
|
|
16
18
|
declare const LineFields: React.FC<Props>;
|
|
17
19
|
export default LineFields;
|
|
@@ -35,7 +35,8 @@ var LineFields = function LineFields(props) {
|
|
|
35
35
|
isView = props.isView,
|
|
36
36
|
draggable = props.draggable,
|
|
37
37
|
className = props.className,
|
|
38
|
-
id = props.id
|
|
38
|
+
id = props.id,
|
|
39
|
+
diffConfig = props.diffConfig;
|
|
39
40
|
var isLess = mode === 'less';
|
|
40
41
|
var _useSortable = (0, _sortable.useSortable)({
|
|
41
42
|
id: field.key,
|
|
@@ -76,7 +77,8 @@ var LineFields = function LineFields(props) {
|
|
|
76
77
|
form: form,
|
|
77
78
|
colProps: colProps,
|
|
78
79
|
disabled: disabled,
|
|
79
|
-
isView: isView
|
|
80
|
+
isView: isView,
|
|
81
|
+
diffConfig: diffConfig
|
|
80
82
|
})
|
|
81
83
|
}), actionProps !== false && (0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
82
84
|
min: min,
|
|
@@ -11,6 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _antd = require("antd");
|
|
13
13
|
var _core = require("@dnd-kit/core");
|
|
14
|
+
var _lodash = require("lodash");
|
|
14
15
|
var _sortable = require("@dnd-kit/sortable");
|
|
15
16
|
var _utils = require("../../../utils");
|
|
16
17
|
var _utils2 = require("./utils");
|
|
@@ -18,6 +19,7 @@ var _ToolbarButton = _interopRequireDefault(require("./components/ToolbarButton"
|
|
|
18
19
|
var _BlockFields = _interopRequireDefault(require("./components/BlockFields"));
|
|
19
20
|
var _LineFields = _interopRequireDefault(require("./components/LineFields"));
|
|
20
21
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
22
|
+
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
21
23
|
var FormList = function FormList(props, ref) {
|
|
22
24
|
var columns = props.columns,
|
|
23
25
|
min = props.min,
|
|
@@ -39,9 +41,16 @@ var FormList = function FormList(props, ref) {
|
|
|
39
41
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
40
42
|
form = _ref.form,
|
|
41
43
|
name = _ref.name,
|
|
42
|
-
isView = _ref.isView
|
|
44
|
+
isView = _ref.isView,
|
|
45
|
+
diffConfig = _ref.diffConfig;
|
|
46
|
+
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
|
|
47
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
43
48
|
var errors = meta.errors;
|
|
44
49
|
var _namePath = (0, _utils.toArray)(name);
|
|
50
|
+
var orgValues = (0, _lodash.get)(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues, name);
|
|
51
|
+
var _diffConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, diffConfig), {}, {
|
|
52
|
+
originalValues: isDiffAll ? orgValues || [] : orgValues
|
|
53
|
+
});
|
|
45
54
|
var processColumns = (0, _react.useCallback)(function (fieldName, namePath) {
|
|
46
55
|
return columns.map(function (item) {
|
|
47
56
|
// names的name处理
|
|
@@ -104,7 +113,8 @@ var FormList = function FormList(props, ref) {
|
|
|
104
113
|
colProps: {
|
|
105
114
|
span: span
|
|
106
115
|
},
|
|
107
|
-
form: form
|
|
116
|
+
form: form,
|
|
117
|
+
diffConfig: _diffConfig
|
|
108
118
|
}), field.key) : (0, _jsxRuntime.jsx)(_LineFields.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
109
119
|
className: _fields.length === index + 1 ? 'pro-form-list-last' : ''
|
|
110
120
|
}, props), {}, {
|
|
@@ -118,7 +128,8 @@ var FormList = function FormList(props, ref) {
|
|
|
118
128
|
colProps: {
|
|
119
129
|
span: mode === 'less' ? 24 : span
|
|
120
130
|
},
|
|
121
|
-
form: form
|
|
131
|
+
form: form,
|
|
132
|
+
diffConfig: _diffConfig
|
|
122
133
|
}), field.key);
|
|
123
134
|
}), (0, _jsxRuntime.jsx)(_antd.Form.ErrorList, {
|
|
124
135
|
errors: errors
|
|
@@ -15,7 +15,7 @@ var _ConfirmWrapper = _interopRequireDefault(require("../../../../components/ren
|
|
|
15
15
|
var _useFieldProps = require("../../../../utils/useFieldProps");
|
|
16
16
|
var componentMap = _interopRequireWildcard(require("../../../../../index"));
|
|
17
17
|
var _AddonWrapper = _interopRequireDefault(require("./AddonWrapper"));
|
|
18
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType"];
|
|
18
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
|
19
19
|
// 这里的key与组件内参数一致, 决定使用哪个包裹组件
|
|
20
20
|
var wrapperMap = {
|
|
21
21
|
confirm: _ConfirmWrapper.default,
|
|
@@ -49,6 +49,7 @@ var ComRender = function ComRender(props) {
|
|
|
49
49
|
_props$valuePropName = props.valuePropName,
|
|
50
50
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
51
51
|
valueType = props.valueType,
|
|
52
|
+
isView = props.isView,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
53
54
|
var TypeComponent = componentMap[type];
|
|
54
55
|
var mergedGetValueProps = getValueProps || function (val) {
|
|
@@ -61,7 +62,8 @@ var ComRender = function ComRender(props) {
|
|
|
61
62
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
62
63
|
value: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, contextProps), {}, {
|
|
63
64
|
valueType: valueType,
|
|
64
|
-
type: type
|
|
65
|
+
type: type,
|
|
66
|
+
isView: isView
|
|
65
67
|
}),
|
|
66
68
|
children: Com
|
|
67
69
|
});
|
|
@@ -33,7 +33,8 @@ var Group = function Group(props) {
|
|
|
33
33
|
onChange = props.onChange,
|
|
34
34
|
otherProps = props.otherProps,
|
|
35
35
|
disabled = props.disabled,
|
|
36
|
-
id = props.id
|
|
36
|
+
id = props.id,
|
|
37
|
+
isView = props.isView;
|
|
37
38
|
var contextProps = _ProForm.default.useFieldProps() || {};
|
|
38
39
|
var names = contextProps.names,
|
|
39
40
|
name = contextProps.name,
|
|
@@ -76,7 +77,8 @@ var Group = function Group(props) {
|
|
|
76
77
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? (0, _jsxRuntime.jsx)(_antd.Space.Compact, {
|
|
77
78
|
children: columns.map(function (column, index) {
|
|
78
79
|
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
79
|
-
contextProps: contextProps
|
|
80
|
+
contextProps: contextProps,
|
|
81
|
+
isView: isView
|
|
80
82
|
}, column), {}, {
|
|
81
83
|
otherProps: otherProps
|
|
82
84
|
}), column.name);
|
|
@@ -86,7 +88,8 @@ var Group = function Group(props) {
|
|
|
86
88
|
}, (0, _lodash.omit)(space, ['separator', 'compact'])), {}, {
|
|
87
89
|
children: columns.map(function (column, index) {
|
|
88
90
|
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
89
|
-
contextProps: contextProps
|
|
91
|
+
contextProps: contextProps,
|
|
92
|
+
isView: isView
|
|
90
93
|
}, column), {}, {
|
|
91
94
|
otherProps: otherProps
|
|
92
95
|
}), column.name);
|
|
@@ -50,7 +50,7 @@ var getViewLabel = function getViewLabel(_ref) {
|
|
|
50
50
|
return viewLabel;
|
|
51
51
|
};
|
|
52
52
|
var ProCascader = function ProCascader(props) {
|
|
53
|
-
var _props$otherProps, _value$slice,
|
|
53
|
+
var _props$otherProps, _value$slice, _ref5, _ref5$filter, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
|
|
54
54
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProAddressBar') || {},
|
|
55
55
|
configDetailMaxLength = _ref2.detailMaxLength,
|
|
56
56
|
configEnumCode = _ref2.enumCode,
|
|
@@ -90,16 +90,18 @@ var ProCascader = function ProCascader(props) {
|
|
|
90
90
|
var realLevel = Math.max(2, level);
|
|
91
91
|
var detail = value === null || value === void 0 ? void 0 : value[realLevel];
|
|
92
92
|
var enumData = (0, _useEnum.default)(addressCode);
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProEnum'),
|
|
94
|
+
_useProConfig$dics = _useProConfig.dics,
|
|
95
|
+
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
|
96
|
+
var enumDataSource = (0, _react.useMemo)(function () {
|
|
97
|
+
if (!(props === null || props === void 0 ? void 0 : props.mode)) {
|
|
98
|
+
return (dics === null || dics === void 0 ? void 0 : dics[addressCode]) || [];
|
|
99
|
+
}
|
|
100
|
+
return Array.isArray(enumData) ? enumData[0] : [];
|
|
101
|
+
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
|
97
102
|
var realDataSource = (0, _react.useMemo)(function () {
|
|
98
103
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
104
|
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
|
100
|
-
if (transformResponse) {
|
|
101
|
-
return transformResponse(result);
|
|
102
|
-
}
|
|
103
105
|
return result;
|
|
104
106
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
105
107
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
|
@@ -115,7 +117,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
115
117
|
defaultLabel = _useState4[0],
|
|
116
118
|
setDefaultLabel = _useState4[1];
|
|
117
119
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
|
118
|
-
var
|
|
120
|
+
var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
119
121
|
var _yield$service, data, newData, transFormData, serviceData;
|
|
120
122
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
121
123
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -143,9 +145,13 @@ var ProCascader = function ProCascader(props) {
|
|
|
143
145
|
}, _callee);
|
|
144
146
|
}));
|
|
145
147
|
return function getFirstLevelOptions() {
|
|
146
|
-
return
|
|
148
|
+
return _ref4.apply(this, arguments);
|
|
147
149
|
};
|
|
148
150
|
}();
|
|
151
|
+
// 提取出来默认每次都执行
|
|
152
|
+
if (transformResponse) {
|
|
153
|
+
realDataSource = transformResponse(realDataSource);
|
|
154
|
+
}
|
|
149
155
|
(0, _react.useEffect)(function () {
|
|
150
156
|
if (service) {
|
|
151
157
|
// 传入useRequest时,初次加载级联第一级数据源
|
|
@@ -154,13 +160,14 @@ var ProCascader = function ProCascader(props) {
|
|
|
154
160
|
}, [service]);
|
|
155
161
|
(0, _react.useEffect)(function () {
|
|
156
162
|
if (realIsView && value) {
|
|
163
|
+
var _realDataSource;
|
|
157
164
|
// 传入dataSource + 查看时初始化展示
|
|
158
165
|
if (service) {
|
|
159
166
|
setDefaultLabel(getViewLabel({
|
|
160
167
|
dataSource: serviceData,
|
|
161
168
|
value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
|
|
162
169
|
}));
|
|
163
|
-
} else if ((realDataSource === null ||
|
|
170
|
+
} else if (((_realDataSource = realDataSource) === null || _realDataSource === void 0 ? void 0 : _realDataSource.length) > 0) {
|
|
164
171
|
setDefaultLabel(getViewLabel({
|
|
165
172
|
dataSource: realDataSource,
|
|
166
173
|
value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
|
|
@@ -194,9 +201,9 @@ var ProCascader = function ProCascader(props) {
|
|
|
194
201
|
var addressValue = isAddressMode ? value && ((_value$slice = value.slice(0, realLevel)) === null || _value$slice === void 0 ? void 0 : _value$slice.some(function (item) {
|
|
195
202
|
return !!item;
|
|
196
203
|
})) ? value.slice(0, realLevel) : undefined : value;
|
|
197
|
-
var viewValue = isAddressMode ? ((
|
|
204
|
+
var viewValue = isAddressMode ? ((_ref5 = [].concat((0, _toConsumableArray2.default)(defaultLabel), [value === null || value === void 0 ? void 0 : value[realLevel]])) === null || _ref5 === void 0 ? void 0 : (_ref5$filter = _ref5.filter(function (item) {
|
|
198
205
|
return !!item;
|
|
199
|
-
})) === null ||
|
|
206
|
+
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
|
200
207
|
return !!item;
|
|
201
208
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
|
202
209
|
var _findSelectedOptions = function findSelectedOptions(options, value) {
|
|
@@ -190,11 +190,25 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
190
190
|
value: item[valueKey],
|
|
191
191
|
label: item[labelKey]
|
|
192
192
|
}));
|
|
193
|
-
})) === null || _data$map === void 0 ? void 0 : _data$map.join(',') :
|
|
193
|
+
})) === null || _data$map === void 0 ? void 0 : _data$map.join(',') : '';
|
|
194
194
|
};
|
|
195
195
|
var viewText = (0, _react.useMemo)(function () {
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
var nextValue = labelInValue ? value : _value;
|
|
197
|
+
if (labelInValue) {
|
|
198
|
+
nextValue = value;
|
|
199
|
+
} else {
|
|
200
|
+
var _options$find;
|
|
201
|
+
var optionDTO = options === null || options === void 0 ? void 0 : (_options$find = options.find) === null || _options$find === void 0 ? void 0 : _options$find.call(options, function (item) {
|
|
202
|
+
return item[valueKey] === value;
|
|
203
|
+
});
|
|
204
|
+
if (optionDTO) {
|
|
205
|
+
nextValue = optionDTO;
|
|
206
|
+
} else {
|
|
207
|
+
nextValue = _value;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return formatValue(nextValue);
|
|
211
|
+
}, [value, _value, options]);
|
|
198
212
|
/**
|
|
199
213
|
* 获取表格的rowKey,支持函数、字符串
|
|
200
214
|
* @date 2023-02-16
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _diffOriginal = require("../../utils/diffOriginal");
|
|
18
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
19
|
var _utils = require("../../../utils");
|
|
20
|
-
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps", "viewRender"];
|
|
21
21
|
var ChangedWrapper = function ChangedWrapper(props) {
|
|
22
22
|
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
23
23
|
var name = props.name,
|
|
@@ -31,6 +31,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
31
31
|
_props$valuePropName = props.valuePropName,
|
|
32
32
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
33
33
|
normalize = props.normalize,
|
|
34
|
+
getValueProps = props.getValueProps,
|
|
35
|
+
viewRender = props.viewRender,
|
|
34
36
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
35
37
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
|
|
36
38
|
isDiffAll = _useProConfig.isDiffAll;
|
|
@@ -56,11 +58,23 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
56
58
|
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
57
59
|
var isAdd = diffType === 'add';
|
|
58
60
|
var isChanged = diffType === 'changed';
|
|
61
|
+
var viewRenderFun = (0, _react.useMemo)(function () {
|
|
62
|
+
var record = form.getFieldsValue();
|
|
63
|
+
return function (orgValue) {
|
|
64
|
+
return viewRender(orgValue, record, {
|
|
65
|
+
form: form
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}, [form]);
|
|
59
69
|
var tipContent = (0, _react.useMemo)(function () {
|
|
60
70
|
if (!isWatch || noChange) return undefined;
|
|
71
|
+
var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
|
|
72
|
+
value: originalValue
|
|
73
|
+
};
|
|
74
|
+
if (viewRender) return viewRenderFun(valueProps === null || valueProps === void 0 ? void 0 : valueProps.value);
|
|
61
75
|
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
|
62
76
|
isView: true
|
|
63
|
-
}, valuePropName,
|
|
77
|
+
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
|
64
78
|
}, [originalValue, children]);
|
|
65
79
|
if (!isWatch || noChange) {
|
|
66
80
|
// 嵌套子组件
|
|
@@ -92,9 +106,13 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
92
106
|
},
|
|
93
107
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
94
108
|
direction: "vertical",
|
|
109
|
+
className: "changed-tooltip",
|
|
95
110
|
children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
111
|
+
align: "start",
|
|
112
|
+
className: "original-value-container",
|
|
96
113
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
97
114
|
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
115
|
+
className: "current-value-container",
|
|
98
116
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
99
117
|
isView: true
|
|
100
118
|
})) : undefined]
|
|
@@ -50,7 +50,8 @@ var Render = function Render(props) {
|
|
|
50
50
|
requiredOnView = props.requiredOnView,
|
|
51
51
|
confirm = props.confirm,
|
|
52
52
|
globalControl = props.globalControl,
|
|
53
|
-
diffConfig = props.diffConfig
|
|
53
|
+
diffConfig = props.diffConfig,
|
|
54
|
+
viewRender = props.viewRender;
|
|
54
55
|
var colProps = props.colProps;
|
|
55
56
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
|
56
57
|
var labelWidth = formItemProps.labelWidth,
|
|
@@ -155,7 +156,7 @@ var Render = function Render(props) {
|
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
158
|
/** 移除多余参数,防止透传给formItem报错 */
|
|
158
|
-
var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow']);
|
|
159
|
+
var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames']);
|
|
159
160
|
/**
|
|
160
161
|
* globalControl 全局控制优先
|
|
161
162
|
* globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
|
|
@@ -426,7 +427,7 @@ var Render = function Render(props) {
|
|
|
426
427
|
span: 24 // 默认占一行
|
|
427
428
|
});
|
|
428
429
|
}
|
|
429
|
-
if (diffConfig) {
|
|
430
|
+
if (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues) {
|
|
430
431
|
child = (0, _jsxRuntime.jsx)(_ChangedWrapper.default, {
|
|
431
432
|
name: formItemProps.name,
|
|
432
433
|
names: otherProps.names,
|
|
@@ -438,6 +439,8 @@ var Render = function Render(props) {
|
|
|
438
439
|
onChange: handleChange,
|
|
439
440
|
valuePropName: _otherFormItemProps.valuePropName,
|
|
440
441
|
normalize: _otherFormItemProps.normalize,
|
|
442
|
+
getValueProps: _otherFormItemProps.getValueProps,
|
|
443
|
+
viewRender: viewRender,
|
|
441
444
|
children: child
|
|
442
445
|
});
|
|
443
446
|
}
|
|
@@ -194,7 +194,8 @@ var RenderFields = function RenderFields(props) {
|
|
|
194
194
|
namePath: column.namePath,
|
|
195
195
|
listName: column.listName,
|
|
196
196
|
globalControl: globalControl,
|
|
197
|
-
formDisabled: formDisabled
|
|
197
|
+
formDisabled: formDisabled,
|
|
198
|
+
diffConfig: diffConfig
|
|
198
199
|
};
|
|
199
200
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
200
201
|
value: otherProps,
|
|
@@ -217,7 +218,8 @@ var RenderFields = function RenderFields(props) {
|
|
|
217
218
|
diffConfig: diffConfig,
|
|
218
219
|
equalWith: equalWith,
|
|
219
220
|
requiredOnView: requiredOnView,
|
|
220
|
-
globalControl: globalControl
|
|
221
|
+
globalControl: globalControl,
|
|
222
|
+
viewRender: viewRender
|
|
221
223
|
})
|
|
222
224
|
}, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
|
|
223
225
|
});
|
|
@@ -182,6 +182,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
182
182
|
}) => React.ReactElement<any, any> | string | undefined | null;
|
|
183
183
|
viewType?: ViewType;
|
|
184
184
|
colProps?: ColProps;
|
|
185
|
+
/** 依赖刷新字段列表 */
|
|
186
|
+
dependNames?: NamePath[];
|
|
185
187
|
/**
|
|
186
188
|
* @description 表单item的props属性
|
|
187
189
|
* @deprecated 将于下个版本 4.0.0 被弃用
|
|
@@ -190,6 +192,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
190
192
|
formItemProps?: FormItemProps<Values> & {
|
|
191
193
|
index?: number;
|
|
192
194
|
namePath?: NamePath;
|
|
195
|
+
/** 依赖刷新字段列表 */
|
|
196
|
+
dependNames?: NamePath[];
|
|
193
197
|
};
|
|
194
198
|
/**
|
|
195
199
|
* @description 表单props属性
|