@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.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 +100 -4
- package/dist/less.esm.css +97 -4
- package/es/ProAction/index.js +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +29 -14
- package/es/ProEditTable/components/RenderField/index.js +10 -8
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.js +6 -5
- package/es/ProEnum/style/index.less +14 -4
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- 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/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +6 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +6 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +57 -46
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ChangedWrapper.js +110 -0
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +11 -11
- 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 +5 -4
- package/es/ProForm/index.js +4 -7
- package/es/ProForm/propsType.d.ts +13 -2
- package/es/ProForm/style/index.less +103 -5
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/transformValue.js +17 -11
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +12 -11
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +6 -3
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/index.js +25 -18
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +38 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.js +17 -8
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/style/index.less +14 -0
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/es/style/theme/antd.less +5 -0
- package/es/style/theme/index.less +2 -1
- 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 +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +32 -15
- package/lib/ProEditTable/components/RenderField/index.js +10 -8
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +6 -5
- package/lib/ProEnum/style/index.less +14 -4
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- 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/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +5 -4
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +6 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +56 -45
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +115 -0
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +11 -11
- 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 +5 -4
- package/lib/ProForm/index.js +4 -7
- package/lib/ProForm/propsType.d.ts +13 -2
- package/lib/ProForm/style/index.less +103 -5
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/transformValue.js +17 -11
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +12 -11
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +6 -3
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/index.js +25 -18
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +38 -5
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.js +19 -7
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/style/index.less +14 -0
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/lib/style/theme/antd.less +5 -0
- package/lib/style/theme/index.less +2 -1
- 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 +4 -4
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/es/ProForm/components/render/Changed.js +0 -64
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.js +0 -69
- /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
|
@@ -17,11 +17,9 @@ var _utils = require("@zat-design/utils");
|
|
|
17
17
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
18
18
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
19
19
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
20
|
-
var formatAmount = _utils.tools.formatAmount
|
|
21
|
-
formatPercent = _utils.tools.formatPercent,
|
|
22
|
-
formatPerMill = _utils.tools.formatPerMill;
|
|
20
|
+
var formatAmount = _utils.tools.formatAmount;
|
|
23
21
|
var ProNumberRange = function ProNumberRange(props) {
|
|
24
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
22
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
25
23
|
var _props$value = props.value,
|
|
26
24
|
value = _props$value === void 0 ? [] : _props$value,
|
|
27
25
|
_props$onChange = props.onChange,
|
|
@@ -46,6 +44,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
46
44
|
viewEmpty = _ref.viewEmpty,
|
|
47
45
|
valueType = _ref.valueType;
|
|
48
46
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
47
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
49
48
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
50
49
|
range: value || []
|
|
51
50
|
}),
|
|
@@ -91,11 +90,15 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
91
90
|
};
|
|
92
91
|
var cls = (0, _classnames.default)({
|
|
93
92
|
'pro-number-range': true,
|
|
93
|
+
'pro-number-range-after': addonAfter,
|
|
94
|
+
'pro-number-range-before': addonBefore,
|
|
94
95
|
className: className
|
|
95
96
|
});
|
|
96
97
|
// 查看模式
|
|
97
98
|
if (isView || props.isView) {
|
|
98
|
-
if ((0, _lodash.isEmpty)(value)) {
|
|
99
|
+
if ((0, _lodash.isEmpty)(value) || (value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
100
|
+
return typeof item !== 'number';
|
|
101
|
+
}))) {
|
|
99
102
|
return viewEmpty;
|
|
100
103
|
}
|
|
101
104
|
switch (valueType) {
|
|
@@ -192,6 +195,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
192
195
|
},
|
|
193
196
|
addonBefore: addonBefore
|
|
194
197
|
}, valueProps), {}, {
|
|
198
|
+
style: addonAfter ? {
|
|
199
|
+
width: "calc(50% - ".concat(16 + addonAfterDomWidth / 2, "px)")
|
|
200
|
+
} : null,
|
|
195
201
|
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
196
202
|
max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
|
|
197
203
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
@@ -212,6 +218,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
212
218
|
},
|
|
213
219
|
addonAfter: addonAfter
|
|
214
220
|
}, valueProps), {}, {
|
|
221
|
+
style: addonAfter ? {
|
|
222
|
+
width: "calc(50% - ".concat(16 - addonAfterDomWidth / 2, "px)")
|
|
223
|
+
} : null,
|
|
215
224
|
min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
|
|
216
225
|
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
217
226
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
|
|
@@ -93,7 +93,7 @@ function ProAddress(_ref3) {
|
|
|
93
93
|
secondCitys = _useState6[0],
|
|
94
94
|
setSecondCitys = _useState6[1];
|
|
95
95
|
var queryCity = /*#__PURE__*/function () {
|
|
96
|
-
var _ref5 = (0, _asyncToGenerator2.default)(
|
|
96
|
+
var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(code, type) {
|
|
97
97
|
var cityList, _cityList, newList, _secondCitys;
|
|
98
98
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
99
99
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
valuePropName?: string;
|
|
14
|
+
[name: string]: any;
|
|
15
|
+
}
|
|
16
|
+
declare const ChangedWrapper: React.FC<Props>;
|
|
17
|
+
export default ChangedWrapper;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _diffOriginal = require("../../utils/diffOriginal");
|
|
18
|
+
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
|
+
var _utils = require("../../../utils");
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
21
|
+
var ChangedWrapper = function ChangedWrapper(props) {
|
|
22
|
+
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
23
|
+
var name = props.name,
|
|
24
|
+
names = props.names,
|
|
25
|
+
namesStr = props.namesStr,
|
|
26
|
+
form = props.form,
|
|
27
|
+
equalWith = props.equalWith,
|
|
28
|
+
children = props.children,
|
|
29
|
+
type = props.type,
|
|
30
|
+
diffConfig = props.diffConfig,
|
|
31
|
+
_props$valuePropName = props.valuePropName,
|
|
32
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
33
|
+
normalize = props.normalize,
|
|
34
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
35
|
+
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
|
|
36
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
37
|
+
var originalValues = diffConfig.originalValues,
|
|
38
|
+
changeTipColor = diffConfig.changeTipColor,
|
|
39
|
+
addTipColor = diffConfig.addTipColor;
|
|
40
|
+
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
41
|
+
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
42
|
+
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
43
|
+
return (0, _lodash.get)(originalValues, name);
|
|
44
|
+
}) : (0, _lodash.get)(originalValues, name);
|
|
45
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
|
46
|
+
var diffType = (0, _react.useMemo)(function () {
|
|
47
|
+
if (!isWatch || noChange) return 'same';
|
|
48
|
+
var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
|
|
49
|
+
return (0, _diffOriginal.diffOriginal)({
|
|
50
|
+
originalValue: originalValue,
|
|
51
|
+
value: _value,
|
|
52
|
+
form: form,
|
|
53
|
+
equalWith: equalWith
|
|
54
|
+
// name: namesStr || name,
|
|
55
|
+
});
|
|
56
|
+
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
57
|
+
var isAdd = diffType === 'add';
|
|
58
|
+
var isChanged = diffType === 'changed';
|
|
59
|
+
var tipContent = (0, _react.useMemo)(function () {
|
|
60
|
+
if (!isWatch || noChange) return undefined;
|
|
61
|
+
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
|
62
|
+
isView: true
|
|
63
|
+
}, valuePropName, originalValue))) : undefined;
|
|
64
|
+
}, [originalValue, children]);
|
|
65
|
+
if (!isWatch || noChange) {
|
|
66
|
+
// 嵌套子组件
|
|
67
|
+
var isNestedField = ['ProEditTable'].includes(type);
|
|
68
|
+
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({
|
|
69
|
+
originalValues: isNestedField ? originalValues : undefined
|
|
70
|
+
}, children.props), rest));
|
|
71
|
+
}
|
|
72
|
+
var tipOpenCalc = function tipOpenCalc() {
|
|
73
|
+
if (!toolTip) return false;
|
|
74
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
75
|
+
return isChanged ? undefined : false;
|
|
76
|
+
};
|
|
77
|
+
var style = {
|
|
78
|
+
'--zaui-contract-bg': changeTipColor,
|
|
79
|
+
'--zaui-contract-bg-add': addTipColor
|
|
80
|
+
};
|
|
81
|
+
var diffClassName = (0, _classnames.default)({
|
|
82
|
+
'pro-form-item-changed': isChanged,
|
|
83
|
+
'pro-form-item-add': isAdd
|
|
84
|
+
});
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
87
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
88
|
+
open: tipOpenCalc(),
|
|
89
|
+
// mouseEnterDelay={1}
|
|
90
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
91
|
+
return target.parentElement;
|
|
92
|
+
},
|
|
93
|
+
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
94
|
+
direction: "vertical",
|
|
95
|
+
children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
96
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
97
|
+
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
98
|
+
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
|
+
isView: true
|
|
100
|
+
})) : undefined]
|
|
101
|
+
})]
|
|
102
|
+
}),
|
|
103
|
+
placement: "topLeft",
|
|
104
|
+
children: (0, _jsxRuntime.jsx)("div", {
|
|
105
|
+
className: diffClassName,
|
|
106
|
+
style: style,
|
|
107
|
+
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
108
|
+
otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
109
|
+
isDiffChange: isChanged
|
|
110
|
+
})
|
|
111
|
+
})) : undefined
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
var _default = exports.default = ChangedWrapper;
|
|
@@ -28,7 +28,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
28
28
|
var _ProForm$useFieldProp = _index.default.useFieldProps(),
|
|
29
29
|
form = _ProForm$useFieldProp.form;
|
|
30
30
|
var handleChange = /*#__PURE__*/function () {
|
|
31
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
31
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
|
|
32
32
|
var _len,
|
|
33
33
|
other,
|
|
34
34
|
_key,
|
|
@@ -26,7 +26,7 @@ var _valueType = _interopRequireDefault(require("../../utils/valueType"));
|
|
|
26
26
|
var _tip = _interopRequireDefault(require("../../../assets/tip.svg"));
|
|
27
27
|
var _useRules = _interopRequireDefault(require("../../utils/useRules"));
|
|
28
28
|
var _ConfirmWrapper = _interopRequireDefault(require("./ConfirmWrapper"));
|
|
29
|
-
var
|
|
29
|
+
var _ChangedWrapper = _interopRequireDefault(require("./ChangedWrapper"));
|
|
30
30
|
var _excluded = ["labelWidth", "hiddenNames", "trim", "upperCase", "className", "rules", "required", "labelRequired", "tooltip"];
|
|
31
31
|
/* eslint-disable prefer-destructuring */
|
|
32
32
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
@@ -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,
|
|
@@ -241,7 +240,7 @@ var Render = function Render(props) {
|
|
|
241
240
|
_args = functionArgs([].concat(args));
|
|
242
241
|
}
|
|
243
242
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
|
244
|
-
if (
|
|
243
|
+
if (/*#__PURE__*/_react.default.isValidElement(AutoComponent)) {
|
|
245
244
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
|
246
245
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat((0, _toConsumableArray2.default)(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args))));
|
|
247
246
|
return false;
|
|
@@ -291,7 +290,7 @@ var Render = function Render(props) {
|
|
|
291
290
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
|
292
291
|
*/
|
|
293
292
|
var handleBlur = /*#__PURE__*/function () {
|
|
294
|
-
var _ref7 = (0, _asyncToGenerator2.default)(
|
|
293
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
295
294
|
var _len3,
|
|
296
295
|
args,
|
|
297
296
|
_key3,
|
|
@@ -374,7 +373,7 @@ var Render = function Render(props) {
|
|
|
374
373
|
if (originComponent) {
|
|
375
374
|
delete childProps.otherProps;
|
|
376
375
|
}
|
|
377
|
-
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (
|
|
376
|
+
var child = /*#__PURE__*/_react.default.isValidElement(AutoComponent) ? (/*#__PURE__*/_react.default.cloneElement(AutoComponent, childProps)) : (0, _jsxRuntime.jsx)(AutoComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
|
378
377
|
otherProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
|
379
378
|
show: show,
|
|
380
379
|
disabled: lastDisabled,
|
|
@@ -427,17 +426,18 @@ var Render = function Render(props) {
|
|
|
427
426
|
span: 24 // 默认占一行
|
|
428
427
|
});
|
|
429
428
|
}
|
|
430
|
-
if (
|
|
431
|
-
child = (0, _jsxRuntime.jsx)(
|
|
429
|
+
if (diffConfig) {
|
|
430
|
+
child = (0, _jsxRuntime.jsx)(_ChangedWrapper.default, {
|
|
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,
|
|
440
|
+
normalize: _otherFormItemProps.normalize,
|
|
441
441
|
children: child
|
|
442
442
|
});
|
|
443
443
|
}
|
|
@@ -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>;
|
|
@@ -30,11 +30,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
30
30
|
viewEmpty = _props$viewEmpty === void 0 ? '-' : _props$viewEmpty,
|
|
31
31
|
openState = props.openState,
|
|
32
32
|
labelWidth = props.labelWidth,
|
|
33
|
-
originalValues = props.originalValues,
|
|
34
33
|
outerClearNotShow = props.clearNotShow,
|
|
35
34
|
requiredOnView = props.requiredOnView,
|
|
36
35
|
required = props.required,
|
|
37
|
-
|
|
36
|
+
diffConfig = props.diffConfig,
|
|
38
37
|
globalControl = props.globalControl;
|
|
39
38
|
// 是否包含隐藏字段
|
|
40
39
|
var hiddenData = columns.filter(function (item) {
|
|
@@ -162,6 +161,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
162
161
|
if (['ProCollapse', 'Container'].includes(_type)) {
|
|
163
162
|
componentProps.show = show;
|
|
164
163
|
componentProps.clearNotShow = clearNotShow;
|
|
164
|
+
componentProps.diffConfig = diffConfig;
|
|
165
165
|
}
|
|
166
166
|
// switch与SwitchCheckbox单独添加valuePropName
|
|
167
167
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
@@ -214,10 +214,9 @@ var RenderFields = function RenderFields(props) {
|
|
|
214
214
|
otherProps: otherProps,
|
|
215
215
|
fieldProps: (0, _lodash.isFunction)(fieldProps) ? fieldProps : null,
|
|
216
216
|
isSelect: _isSelect,
|
|
217
|
-
|
|
217
|
+
diffConfig: diffConfig,
|
|
218
218
|
equalWith: equalWith,
|
|
219
219
|
requiredOnView: requiredOnView,
|
|
220
|
-
originalDiffTip: originalDiffTip,
|
|
221
220
|
globalControl: globalControl
|
|
222
221
|
})
|
|
223
222
|
}, "".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;
|
|
@@ -196,12 +197,12 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
196
197
|
* @default -
|
|
197
198
|
*/
|
|
198
199
|
labelWidth?: string | number;
|
|
199
|
-
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
200
|
+
disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
200
201
|
trim?: boolean;
|
|
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;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useForm3 = require("./utils/useForm");
|
|
|
25
25
|
var _useFieldProps = require("./utils/useFieldProps");
|
|
26
26
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
27
27
|
var _useWatch = _interopRequireDefault(require("./utils/useWatch"));
|
|
28
|
-
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "
|
|
28
|
+
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "diffConfig", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required", "formKey", "globalControl", "scrollToError", "optimize"];
|
|
29
29
|
var ProForm = function ProForm(props, ref) {
|
|
30
30
|
var _forms$formKey, _localStorage, _ref;
|
|
31
31
|
var _props$mode = props.mode,
|
|
@@ -54,7 +54,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
54
54
|
labelWidth = props.labelWidth,
|
|
55
55
|
onValuesChange = props.onValuesChange,
|
|
56
56
|
onFinish = props.onFinish,
|
|
57
|
-
|
|
57
|
+
diffConfig = props.diffConfig,
|
|
58
58
|
submitOnEnter = props.submitOnEnter,
|
|
59
59
|
_props$clearNotShow = props.clearNotShow,
|
|
60
60
|
clearNotShow = _props$clearNotShow === void 0 ? true : _props$clearNotShow,
|
|
@@ -63,8 +63,6 @@ var ProForm = function ProForm(props, ref) {
|
|
|
63
63
|
requiredOnView = _props$requiredOnView === void 0 ? true : _props$requiredOnView,
|
|
64
64
|
formId = props.formId,
|
|
65
65
|
required = props.required,
|
|
66
|
-
_props$originalDiffTi = props.originalDiffTip,
|
|
67
|
-
originalDiffTip = _props$originalDiffTi === void 0 ? true : _props$originalDiffTi,
|
|
68
66
|
formKey = props.formKey,
|
|
69
67
|
globalControl = props.globalControl,
|
|
70
68
|
_props$scrollToError = props.scrollToError,
|
|
@@ -203,7 +201,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
203
201
|
if (isView || disabled) {
|
|
204
202
|
// 查看或禁用模式
|
|
205
203
|
footerEle = null;
|
|
206
|
-
} else if (
|
|
204
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(footer)) {
|
|
207
205
|
// 传入组件渲染组件
|
|
208
206
|
footerEle = footer;
|
|
209
207
|
} else if (footer === undefined || footer || (0, _lodash.isObject)(footer)) {
|
|
@@ -262,11 +260,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
262
260
|
colProps: colProps,
|
|
263
261
|
viewEmpty: viewEmpty,
|
|
264
262
|
labelWidth: labelWidth,
|
|
265
|
-
|
|
263
|
+
diffConfig: diffConfig,
|
|
266
264
|
clearNotShow: clearNotShow,
|
|
267
265
|
requiredOnView: requiredOnView,
|
|
268
266
|
required: required,
|
|
269
|
-
originalDiffTip: originalDiffTip,
|
|
270
267
|
globalControl: globalControl
|
|
271
268
|
}), footerRender()]
|
|
272
269
|
})), children]
|
|
@@ -44,6 +44,17 @@ export interface ProFormOtherProps {
|
|
|
44
44
|
listName?: any[] | string | number;
|
|
45
45
|
globalControl?: boolean;
|
|
46
46
|
formDisabled?: boolean;
|
|
47
|
+
isDiffChange?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DiffConfigProps<Values = any> {
|
|
50
|
+
/** 比对原始数据源 */
|
|
51
|
+
originalValues: Values;
|
|
52
|
+
/** 是否显示对比值气泡 */
|
|
53
|
+
toolTip?: boolean;
|
|
54
|
+
/** 变更提示颜色 */
|
|
55
|
+
changeTipColor?: string;
|
|
56
|
+
/** 新增提示颜色 */
|
|
57
|
+
addTipColor?: string;
|
|
47
58
|
}
|
|
48
59
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
49
60
|
disabled?: boolean;
|
|
@@ -67,14 +78,14 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
|
67
78
|
viewEmpty?: React.ReactNode | string;
|
|
68
79
|
confirmLoading?: boolean;
|
|
69
80
|
labelWidth?: string | number;
|
|
70
|
-
originalValues?: Values;
|
|
71
81
|
/** 是否回车提交 */
|
|
72
82
|
submitOnEnter?: boolean;
|
|
73
83
|
clearNotShow?: boolean;
|
|
74
84
|
requiredOnView?: boolean;
|
|
75
85
|
formId?: string;
|
|
76
86
|
required?: boolean | boolean[];
|
|
77
|
-
|
|
87
|
+
/** 表单比对配置 */
|
|
88
|
+
diffConfig?: DiffConfigProps;
|
|
78
89
|
scrollToError?: boolean;
|
|
79
90
|
/** 性能模式,谨慎使用,默认不开启
|
|
80
91
|
* 1. 开启不过滤names的中间态值
|
|
@@ -99,10 +99,12 @@
|
|
|
99
99
|
|
|
100
100
|
&.pro-form-item-width-auto {
|
|
101
101
|
.@{ant-prefix}-form-item-control-input {
|
|
102
|
+
width: 100%;
|
|
102
103
|
flex-grow: inherit;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
.@{ant-prefix}-form-item-control-input-content {
|
|
107
|
+
width: 100%;
|
|
106
108
|
flex: initial;
|
|
107
109
|
}
|
|
108
110
|
}
|
|
@@ -216,7 +218,7 @@
|
|
|
216
218
|
|
|
217
219
|
.site-input-left,
|
|
218
220
|
.site-input-right {
|
|
219
|
-
width: calc(50% -
|
|
221
|
+
width: calc(50% - 16px);
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
.site-input-left {
|
|
@@ -314,16 +316,23 @@
|
|
|
314
316
|
vertical-align: middle;
|
|
315
317
|
}
|
|
316
318
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
319
|
+
|
|
320
|
+
.pro-form-list-mode-block {
|
|
321
|
+
.pro-collapse-content {
|
|
322
|
+
.@{ant-prefix}-row {
|
|
320
323
|
width: auto;
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
326
|
}
|
|
324
327
|
|
|
325
|
-
// 比较原始值场景下 不同时的样式
|
|
326
328
|
.pro-form-item-changed {
|
|
329
|
+
border-radius: 4px;
|
|
330
|
+
background: @zaui-contract-bg !important;
|
|
331
|
+
|
|
332
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
|
|
333
|
+
background: @zaui-contract-bg !important;
|
|
334
|
+
}
|
|
335
|
+
|
|
327
336
|
span.@{ant-prefix}-input-affix-wrapper,
|
|
328
337
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
|
329
338
|
.@{ant-prefix}-picker,
|
|
@@ -367,10 +376,99 @@
|
|
|
367
376
|
}
|
|
368
377
|
}
|
|
369
378
|
|
|
379
|
+
// checkbox
|
|
380
|
+
.@{ant-prefix}-checkbox-group {
|
|
381
|
+
padding: 5px 0
|
|
382
|
+
}
|
|
383
|
+
// switch
|
|
384
|
+
&:has(.@{ant-prefix}-switch) {
|
|
385
|
+
padding: 5px 0;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// textArea
|
|
389
|
+
.@{ant-prefix}-input-textarea > textarea {
|
|
390
|
+
background: @zaui-contract-bg;
|
|
391
|
+
}
|
|
392
|
+
|
|
370
393
|
.pro-form-view-container {
|
|
371
394
|
padding: 4px 8px;
|
|
372
395
|
background: @zaui-contract-bg;
|
|
373
396
|
border-radius: 4px;
|
|
374
397
|
}
|
|
375
398
|
}
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
// 比较原始值场景下 不同时的样式
|
|
402
|
+
.pro-form-item-add {
|
|
403
|
+
border-radius: 4px;
|
|
404
|
+
background: @zaui-contract-bg-add !important;
|
|
405
|
+
|
|
406
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
|
|
407
|
+
background: @zaui-contract-bg-add !important;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
span.@{ant-prefix}-input-affix-wrapper,
|
|
411
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-selector,
|
|
412
|
+
.@{ant-prefix}-picker,
|
|
413
|
+
.@{ant-prefix}-input-number {
|
|
414
|
+
background: @zaui-contract-bg-add !important;
|
|
415
|
+
|
|
416
|
+
input {
|
|
417
|
+
background: transparent !important;
|
|
418
|
+
}
|
|
419
|
+
.@{ant-prefix}-select-selection-placeholder {
|
|
420
|
+
z-index: 9;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-switch-handle),
|
|
425
|
+
.@{ant-prefix}-form-item-control:has(.@{ant-prefix}-checkbox-wrapper-in-form-item) {
|
|
426
|
+
background: @zaui-contract-bg-add;
|
|
427
|
+
border-radius: 4px;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// 地址组件
|
|
431
|
+
.@{ant-prefix}-form-item-control-input-content {
|
|
432
|
+
// 查看模式
|
|
433
|
+
& > span {
|
|
434
|
+
border-radius: 4px;
|
|
435
|
+
padding: 5px 8px;
|
|
436
|
+
background: @zaui-contract-bg-add;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
& > .pro-address {
|
|
440
|
+
.@{ant-prefix}-select-selector,
|
|
441
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
442
|
+
.@{ant-prefix}-input-disabled {
|
|
443
|
+
background: @zaui-contract-bg-add;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
& > .@{ant-prefix}-input-group {
|
|
447
|
+
.forever-checkbox {
|
|
448
|
+
background: @zaui-contract-bg-add;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// checkbox
|
|
454
|
+
.@{ant-prefix}-checkbox-group {
|
|
455
|
+
padding: 5px 0
|
|
456
|
+
}
|
|
457
|
+
// switch
|
|
458
|
+
&:has(.@{ant-prefix}-switch) {
|
|
459
|
+
padding: 5px 0;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// textArea
|
|
463
|
+
.@{ant-prefix}-input-textarea > textarea {
|
|
464
|
+
background: @zaui-contract-bg-add;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
.pro-form-view-container {
|
|
469
|
+
padding: 4px 8px;
|
|
470
|
+
background: @zaui-contract-bg-add;
|
|
471
|
+
border-radius: 4px;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
376
474
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FormInstance } from 'antd';
|
|
2
|
-
interface
|
|
2
|
+
export interface DiffOriginalParams {
|
|
3
3
|
originalValue: any;
|
|
4
4
|
value: any;
|
|
5
5
|
form: FormInstance;
|
|
6
|
-
equalWith?: (originalValue: any, currentValue: any) => boolean;
|
|
6
|
+
equalWith?: (originalValue: any, currentValue: any) => DiffType | boolean | undefined;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
export
|
|
8
|
+
export type DiffType = 'same' | 'add' | 'changed';
|
|
9
|
+
export declare const diffOriginal: (params: DiffOriginalParams) => DiffType;
|