@zat-design/sisyphus-react 3.8.3-beta.15 → 3.8.3-beta.17
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/.vscode/extensions.json +5 -0
- package/dist/index.esm.css +7 -1
- package/dist/less.esm.css +6 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -7
- package/es/ProEditTable/components/RenderField/index.js +3 -2
- package/es/ProEditTable/index.js +5 -3
- package/es/ProEditTable/propsType.d.ts +3 -0
- package/es/ProEditTable/style/index.less +0 -1
- package/es/ProForm/components/combination/Group/index.js +3 -4
- package/es/ProForm/components/combination/ProCascader/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.js +7 -3
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +5 -0
- package/es/style/theme/antd.less +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -7
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/index.js +5 -3
- package/lib/ProEditTable/propsType.d.ts +3 -0
- package/lib/ProEditTable/style/index.less +0 -1
- package/lib/ProForm/components/combination/Group/index.js +3 -4
- package/lib/ProForm/components/combination/ProCascader/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +7 -3
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +5 -0
- package/lib/style/theme/antd.less +1 -1
- package/package.json +1 -1
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
- package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
- package/coverage/lcov-report/src/.umi/core/index.html +0 -206
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
- package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
- package/coverage/lcov-report/src/.umi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
- package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
package/dist/index.esm.css
CHANGED
|
@@ -2833,6 +2833,12 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2833
2833
|
display: unset;
|
|
2834
2834
|
visibility: hidden;
|
|
2835
2835
|
}
|
|
2836
|
+
.pro-form.pro-form-view .pro-group .ant-space-item,
|
|
2837
|
+
.pro-form.pro-form-view .pro-group .pro-form-view-container {
|
|
2838
|
+
width: -webkit-max-content;
|
|
2839
|
+
width: -moz-max-content;
|
|
2840
|
+
width: max-content;
|
|
2841
|
+
}
|
|
2836
2842
|
.pro-form.pro-form-view .ant-form-item-label label {
|
|
2837
2843
|
color: var(--zaui-aide-text, #939599);
|
|
2838
2844
|
}
|
|
@@ -5644,7 +5650,7 @@ input[type='button'] {
|
|
|
5644
5650
|
user-select: text;
|
|
5645
5651
|
}
|
|
5646
5652
|
.ant-table.ant-table-fixed-header .ant-table-tbody .ant-table-row:nth-child(even) td {
|
|
5647
|
-
background: #ffffff
|
|
5653
|
+
background: #ffffff;
|
|
5648
5654
|
}
|
|
5649
5655
|
.ant-table.ant-table-fixed-header .ant-table-tbody .ant-table-row:nth-child(odd) {
|
|
5650
5656
|
background-color: var(--zaui-table-strip-bg, #fafafa);
|
package/dist/less.esm.css
CHANGED
|
@@ -2833,6 +2833,12 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2833
2833
|
display: unset;
|
|
2834
2834
|
visibility: hidden;
|
|
2835
2835
|
}
|
|
2836
|
+
.pro-form.pro-form-view .pro-group .ant-space-item,
|
|
2837
|
+
.pro-form.pro-form-view .pro-group .pro-form-view-container {
|
|
2838
|
+
width: -webkit-max-content;
|
|
2839
|
+
width: -moz-max-content;
|
|
2840
|
+
width: max-content;
|
|
2841
|
+
}
|
|
2836
2842
|
.pro-form.pro-form-view .ant-form-item-label label {
|
|
2837
2843
|
color: var(--zaui-aide-text, #939599);
|
|
2838
2844
|
}
|
|
@@ -89,6 +89,9 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
89
89
|
rest = _objectWithoutProperties(props, _excluded);
|
|
90
90
|
var _ref2 = useProConfig('ProEditTable') || {},
|
|
91
91
|
isDiffAll = _ref2.isDiffAll;
|
|
92
|
+
var _ref3 = diffConfig || {},
|
|
93
|
+
_ref3$scrollFollowPar = _ref3.scrollFollowParent,
|
|
94
|
+
scrollFollowParent = _ref3$scrollFollowPar === void 0 ? true : _ref3$scrollFollowPar;
|
|
92
95
|
var namePath = toNamePath(namesStr || name);
|
|
93
96
|
var originalNamePath = toNamePath(originalName);
|
|
94
97
|
var originalNamePaths = originalNames && toNamePaths(originalNames);
|
|
@@ -119,7 +122,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
119
122
|
var tipContent = useMemo(function () {
|
|
120
123
|
var _getValueProps;
|
|
121
124
|
if (!isWatch || noChange) return undefined;
|
|
122
|
-
var orgValue = getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
125
|
+
var orgValue = getValueProps && !names ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
123
126
|
// 兼容viewRender函数和Element场景
|
|
124
127
|
var _children = children;
|
|
125
128
|
if (viewRender) {
|
|
@@ -150,12 +153,10 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
150
153
|
return _jsx(_Tooltip, {
|
|
151
154
|
// 传入undefined 鼠标移入显示移出隐藏
|
|
152
155
|
open: tipOpenCalc(),
|
|
153
|
-
getPopupContainer: function getPopupContainer(
|
|
154
|
-
return
|
|
155
|
-
},
|
|
156
|
-
overlayStyle: {
|
|
157
|
-
zIndex: 99
|
|
156
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
157
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
158
158
|
},
|
|
159
|
+
overlayClassName: "original-value-tootip",
|
|
159
160
|
title: _jsxs(_Space, {
|
|
160
161
|
direction: "vertical",
|
|
161
162
|
className: "changed-tooltip",
|
|
@@ -166,13 +167,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
166
167
|
}), _showEllipse && _jsxs(_Space, {
|
|
167
168
|
className: "current-value-container",
|
|
168
169
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
169
|
-
isView: true
|
|
170
|
+
isView: true,
|
|
171
|
+
scrollFollowParent: scrollFollowParent
|
|
170
172
|
})) : undefined]
|
|
171
173
|
})]
|
|
172
174
|
}),
|
|
173
175
|
children: _jsx("div", {
|
|
174
176
|
className: diffClassName,
|
|
175
177
|
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
178
|
+
scrollFollowParent: scrollFollowParent,
|
|
176
179
|
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
177
180
|
isDiffChange: isChanged
|
|
178
181
|
})
|
|
@@ -73,7 +73,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
73
73
|
rowDisabled = config.rowDisabled,
|
|
74
74
|
_config$validateTrigg = config.validateTrigger,
|
|
75
75
|
validateTrigger = _config$validateTrigg === void 0 ? ['onChange', 'onBlur', 'onSubmit'] : _config$validateTrigg,
|
|
76
|
-
otherProps = config.otherProps
|
|
76
|
+
otherProps = config.otherProps,
|
|
77
|
+
diffConfig = config.diffConfig;
|
|
77
78
|
var _fieldProps = fieldProps || formItemProps || {};
|
|
78
79
|
var _rules = rules || [];
|
|
79
80
|
var _required = required;
|
|
@@ -567,7 +568,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
567
568
|
normalize: _formItemProps.normalize,
|
|
568
569
|
getValueProps: _formItemProps.getValueProps,
|
|
569
570
|
viewRender: viewRender && viewRenderFun,
|
|
570
|
-
diffConfig:
|
|
571
|
+
diffConfig: diffConfig,
|
|
571
572
|
children: FieldComponent
|
|
572
573
|
});
|
|
573
574
|
}
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
9
9
|
import "antd/es/form/style";
|
|
10
10
|
import _Form from "antd/es/form";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
|
-
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection"];
|
|
12
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
15
15
|
import { get, isArray, isBoolean } from 'lodash';
|
|
@@ -23,7 +23,7 @@ import Empty from '../assets/empty.png';
|
|
|
23
23
|
import locale, { formatMessage } from '../locale';
|
|
24
24
|
import { BaseTable, DraggableTable, VirtualTable } from './components/RcTable';
|
|
25
25
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
26
|
-
var _resetProps$id, _resetProps$id$split, _themeConfig$data2;
|
|
26
|
+
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _resetProps$otherProp;
|
|
27
27
|
var value = _ref.value,
|
|
28
28
|
onChange = _ref.onChange,
|
|
29
29
|
onDrag = _ref.onDrag,
|
|
@@ -57,6 +57,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
57
57
|
footerRender = _ref.footerRender,
|
|
58
58
|
scroll = _ref.scroll,
|
|
59
59
|
actionDirection = _ref.actionDirection,
|
|
60
|
+
diffConfig = _ref.diffConfig,
|
|
60
61
|
resetProps = _objectWithoutProperties(_ref, _excluded);
|
|
61
62
|
// 上下文form
|
|
62
63
|
var contentForm = _Form.useFormInstance();
|
|
@@ -167,7 +168,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
167
168
|
originalValues: originalValues,
|
|
168
169
|
prefixCls: prefixCls,
|
|
169
170
|
rowDisabled: rowDisabled,
|
|
170
|
-
actionDirection: actionDirection
|
|
171
|
+
actionDirection: actionDirection,
|
|
172
|
+
diffConfig: _objectSpread(_objectSpread({}, resetProps === null || resetProps === void 0 ? void 0 : (_resetProps$otherProp = resetProps.otherProps) === null || _resetProps$otherProp === void 0 ? void 0 : _resetProps$otherProp.diffConfig), diffConfig)
|
|
171
173
|
}, resetProps);
|
|
172
174
|
// 编辑行设置下样式
|
|
173
175
|
var _rowClassName = function _rowClassName(record) {
|
|
@@ -26,15 +26,14 @@ var Group = function Group(props) {
|
|
|
26
26
|
value = props.value,
|
|
27
27
|
onChange = props.onChange,
|
|
28
28
|
otherProps = props.otherProps,
|
|
29
|
-
|
|
30
|
-
id = props.id,
|
|
31
|
-
isView = props.isView;
|
|
29
|
+
id = props.id;
|
|
32
30
|
var contextProps = ProForm.useFieldProps() || {};
|
|
33
31
|
var names = contextProps.names,
|
|
34
32
|
name = contextProps.name,
|
|
35
33
|
form = contextProps.form,
|
|
36
34
|
namePath = contextProps.namePath,
|
|
37
|
-
index = contextProps.index
|
|
35
|
+
index = contextProps.index,
|
|
36
|
+
isView = contextProps.isView;
|
|
38
37
|
var _option = React.useRef([]);
|
|
39
38
|
// 组合onChange
|
|
40
39
|
var handleChange = function handleChange(value, option, index) {
|
|
@@ -79,7 +79,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
79
79
|
code = _props$code === void 0 ? configCode : _props$code,
|
|
80
80
|
tooltip = props.tooltip,
|
|
81
81
|
_props$separator = props.separator,
|
|
82
|
-
separator = _props$separator === void 0 ? '' : _props$separator,
|
|
82
|
+
separator = _props$separator === void 0 ? '/' : _props$separator,
|
|
83
83
|
detailPlaceholder = props.detailPlaceholder,
|
|
84
84
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
85
85
|
var _ref3 = ProForm.useFieldProps() || {},
|
|
@@ -33,7 +33,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
33
33
|
isDiffAll = _useProConfig.isDiffAll;
|
|
34
34
|
var originalValues = diffConfig.originalValues,
|
|
35
35
|
changeTipColor = diffConfig.changeTipColor,
|
|
36
|
-
addTipColor = diffConfig.addTipColor
|
|
36
|
+
addTipColor = diffConfig.addTipColor,
|
|
37
|
+
_diffConfig$scrollFol = diffConfig.scrollFollowParent,
|
|
38
|
+
scrollFollowParent = _diffConfig$scrollFol === void 0 ? true : _diffConfig$scrollFol;
|
|
37
39
|
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
38
40
|
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
39
41
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
@@ -96,8 +98,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
96
98
|
return _jsx(_Tooltip, {
|
|
97
99
|
open: tipOpenCalc(),
|
|
98
100
|
// open
|
|
99
|
-
getPopupContainer: function getPopupContainer(
|
|
100
|
-
return
|
|
101
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
102
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
101
103
|
},
|
|
102
104
|
overlayClassName: "original-value-tootip",
|
|
103
105
|
title: _jsxs(_Space, {
|
|
@@ -110,6 +112,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
110
112
|
}), _showEllipse && _jsxs(_Space, {
|
|
111
113
|
className: "current-value-container",
|
|
112
114
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
115
|
+
scrollFollowParent: scrollFollowParent,
|
|
113
116
|
isView: true
|
|
114
117
|
})) : undefined]
|
|
115
118
|
})]
|
|
@@ -119,6 +122,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
119
122
|
className: diffClassName,
|
|
120
123
|
style: style,
|
|
121
124
|
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
125
|
+
scrollFollowParent: scrollFollowParent,
|
|
122
126
|
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
123
127
|
isDiffChange: isChanged
|
|
124
128
|
})
|
|
@@ -56,6 +56,8 @@ export interface DiffConfigProps<Values = any> {
|
|
|
56
56
|
changeTipColor?: string;
|
|
57
57
|
/** 新增提示颜色 */
|
|
58
58
|
addTipColor?: string;
|
|
59
|
+
/** 是否跟随父组件滚动 */
|
|
60
|
+
scrollFollowParent?: string;
|
|
59
61
|
}
|
|
60
62
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
61
63
|
disabled?: boolean;
|
package/es/style/theme/antd.less
CHANGED
|
@@ -94,6 +94,9 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
94
94
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
95
95
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
|
|
96
96
|
isDiffAll = _ref2.isDiffAll;
|
|
97
|
+
var _ref3 = diffConfig || {},
|
|
98
|
+
_ref3$scrollFollowPar = _ref3.scrollFollowParent,
|
|
99
|
+
scrollFollowParent = _ref3$scrollFollowPar === void 0 ? true : _ref3$scrollFollowPar;
|
|
97
100
|
var namePath = toNamePath(namesStr || name);
|
|
98
101
|
var originalNamePath = toNamePath(originalName);
|
|
99
102
|
var originalNamePaths = originalNames && toNamePaths(originalNames);
|
|
@@ -124,7 +127,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
124
127
|
var tipContent = (0, _react.useMemo)(function () {
|
|
125
128
|
var _getValueProps;
|
|
126
129
|
if (!isWatch || noChange) return undefined;
|
|
127
|
-
var orgValue = getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
130
|
+
var orgValue = getValueProps && !names ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : originalValue;
|
|
128
131
|
// 兼容viewRender函数和Element场景
|
|
129
132
|
var _children = children;
|
|
130
133
|
if (viewRender) {
|
|
@@ -157,12 +160,10 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
157
160
|
, {
|
|
158
161
|
// 传入undefined 鼠标移入显示移出隐藏
|
|
159
162
|
open: tipOpenCalc(),
|
|
160
|
-
getPopupContainer: function getPopupContainer(
|
|
161
|
-
return
|
|
162
|
-
},
|
|
163
|
-
overlayStyle: {
|
|
164
|
-
zIndex: 99
|
|
163
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
164
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
165
165
|
},
|
|
166
|
+
overlayClassName: "original-value-tootip",
|
|
166
167
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
167
168
|
direction: "vertical",
|
|
168
169
|
className: "changed-tooltip",
|
|
@@ -173,13 +174,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
173
174
|
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
174
175
|
className: "current-value-container",
|
|
175
176
|
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), {}, {
|
|
176
|
-
isView: true
|
|
177
|
+
isView: true,
|
|
178
|
+
scrollFollowParent: scrollFollowParent
|
|
177
179
|
})) : undefined]
|
|
178
180
|
})]
|
|
179
181
|
}),
|
|
180
182
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
181
183
|
className: diffClassName,
|
|
182
184
|
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
185
|
+
scrollFollowParent: scrollFollowParent,
|
|
183
186
|
otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
184
187
|
isDiffChange: isChanged
|
|
185
188
|
})
|
|
@@ -80,7 +80,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
80
80
|
rowDisabled = config.rowDisabled,
|
|
81
81
|
_config$validateTrigg = config.validateTrigger,
|
|
82
82
|
validateTrigger = _config$validateTrigg === void 0 ? ['onChange', 'onBlur', 'onSubmit'] : _config$validateTrigg,
|
|
83
|
-
otherProps = config.otherProps
|
|
83
|
+
otherProps = config.otherProps,
|
|
84
|
+
diffConfig = config.diffConfig;
|
|
84
85
|
var _fieldProps = fieldProps || formItemProps || {};
|
|
85
86
|
var _rules = rules || [];
|
|
86
87
|
var _required = required;
|
|
@@ -574,7 +575,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
574
575
|
normalize: _formItemProps.normalize,
|
|
575
576
|
getValueProps: _formItemProps.getValueProps,
|
|
576
577
|
viewRender: viewRender && viewRenderFun,
|
|
577
|
-
diffConfig:
|
|
578
|
+
diffConfig: diffConfig,
|
|
578
579
|
children: FieldComponent
|
|
579
580
|
});
|
|
580
581
|
}
|
|
@@ -24,9 +24,9 @@ var _ProForm = _interopRequireDefault(require("../ProForm"));
|
|
|
24
24
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
25
25
|
var _locale = _interopRequireWildcard(require("../locale"));
|
|
26
26
|
var _RcTable = require("./components/RcTable");
|
|
27
|
-
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection"];
|
|
27
|
+
var _excluded = ["value", "onChange", "onDrag", "className", "columns", "type", "mode", "stripe", "draggable", "virtual", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "toolbarSticky", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "rowKey", "rowDisabled", "rowDraggable", "footerRender", "scroll", "actionDirection", "diffConfig"];
|
|
28
28
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
29
|
-
var _resetProps$id, _resetProps$id$split, _themeConfig$data2;
|
|
29
|
+
var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _resetProps$otherProp;
|
|
30
30
|
var value = _ref.value,
|
|
31
31
|
onChange = _ref.onChange,
|
|
32
32
|
onDrag = _ref.onDrag,
|
|
@@ -60,6 +60,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
60
60
|
footerRender = _ref.footerRender,
|
|
61
61
|
scroll = _ref.scroll,
|
|
62
62
|
actionDirection = _ref.actionDirection,
|
|
63
|
+
diffConfig = _ref.diffConfig,
|
|
63
64
|
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
64
65
|
// 上下文form
|
|
65
66
|
var contentForm = _antd.Form.useFormInstance();
|
|
@@ -170,7 +171,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
170
171
|
originalValues: originalValues,
|
|
171
172
|
prefixCls: prefixCls,
|
|
172
173
|
rowDisabled: rowDisabled,
|
|
173
|
-
actionDirection: actionDirection
|
|
174
|
+
actionDirection: actionDirection,
|
|
175
|
+
diffConfig: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, resetProps === null || resetProps === void 0 ? void 0 : (_resetProps$otherProp = resetProps.otherProps) === null || _resetProps$otherProp === void 0 ? void 0 : _resetProps$otherProp.diffConfig), diffConfig)
|
|
174
176
|
}, resetProps);
|
|
175
177
|
// 编辑行设置下样式
|
|
176
178
|
var _rowClassName = function _rowClassName(record) {
|
|
@@ -32,15 +32,14 @@ var Group = function Group(props) {
|
|
|
32
32
|
value = props.value,
|
|
33
33
|
onChange = props.onChange,
|
|
34
34
|
otherProps = props.otherProps,
|
|
35
|
-
|
|
36
|
-
id = props.id,
|
|
37
|
-
isView = props.isView;
|
|
35
|
+
id = props.id;
|
|
38
36
|
var contextProps = _ProForm.default.useFieldProps() || {};
|
|
39
37
|
var names = contextProps.names,
|
|
40
38
|
name = contextProps.name,
|
|
41
39
|
form = contextProps.form,
|
|
42
40
|
namePath = contextProps.namePath,
|
|
43
|
-
index = contextProps.index
|
|
41
|
+
index = contextProps.index,
|
|
42
|
+
isView = contextProps.isView;
|
|
44
43
|
var _option = _react.default.useRef([]);
|
|
45
44
|
// 组合onChange
|
|
46
45
|
var handleChange = function handleChange(value, option, index) {
|
|
@@ -79,7 +79,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
79
79
|
code = _props$code === void 0 ? configCode : _props$code,
|
|
80
80
|
tooltip = props.tooltip,
|
|
81
81
|
_props$separator = props.separator,
|
|
82
|
-
separator = _props$separator === void 0 ? '' : _props$separator,
|
|
82
|
+
separator = _props$separator === void 0 ? '/' : _props$separator,
|
|
83
83
|
detailPlaceholder = props.detailPlaceholder,
|
|
84
84
|
otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
85
85
|
var _ref3 = _.default.useFieldProps() || {},
|
|
@@ -38,7 +38,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
38
38
|
isDiffAll = _useProConfig.isDiffAll;
|
|
39
39
|
var originalValues = diffConfig.originalValues,
|
|
40
40
|
changeTipColor = diffConfig.changeTipColor,
|
|
41
|
-
addTipColor = diffConfig.addTipColor
|
|
41
|
+
addTipColor = diffConfig.addTipColor,
|
|
42
|
+
_diffConfig$scrollFol = diffConfig.scrollFollowParent,
|
|
43
|
+
scrollFollowParent = _diffConfig$scrollFol === void 0 ? true : _diffConfig$scrollFol;
|
|
42
44
|
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
43
45
|
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
44
46
|
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
@@ -101,8 +103,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
101
103
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
102
104
|
open: tipOpenCalc(),
|
|
103
105
|
// open
|
|
104
|
-
getPopupContainer: function getPopupContainer(
|
|
105
|
-
return
|
|
106
|
+
getPopupContainer: function getPopupContainer(trigger) {
|
|
107
|
+
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
106
108
|
},
|
|
107
109
|
overlayClassName: "original-value-tootip",
|
|
108
110
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
@@ -115,6 +117,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
115
117
|
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
116
118
|
className: "current-value-container",
|
|
117
119
|
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), {}, {
|
|
120
|
+
scrollFollowParent: scrollFollowParent,
|
|
118
121
|
isView: true
|
|
119
122
|
})) : undefined]
|
|
120
123
|
})]
|
|
@@ -124,6 +127,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
124
127
|
className: diffClassName,
|
|
125
128
|
style: style,
|
|
126
129
|
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
130
|
+
scrollFollowParent: scrollFollowParent,
|
|
127
131
|
otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
128
132
|
isDiffChange: isChanged
|
|
129
133
|
})
|
|
@@ -56,6 +56,8 @@ export interface DiffConfigProps<Values = any> {
|
|
|
56
56
|
changeTipColor?: string;
|
|
57
57
|
/** 新增提示颜色 */
|
|
58
58
|
addTipColor?: string;
|
|
59
|
+
/** 是否跟随父组件滚动 */
|
|
60
|
+
scrollFollowParent?: string;
|
|
59
61
|
}
|
|
60
62
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
61
63
|
disabled?: boolean;
|