@zat-design/sisyphus-react 4.0.0-beta.3 → 4.0.0-beta.4
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/babel.config.js +7 -30
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/regExp/index.d.ts +19 -0
- package/dist/esm/regExp/index.js +73 -0
- package/dist/esm/tools/calc/index.d.ts +4 -0
- package/dist/esm/tools/calc/index.js +67 -0
- package/dist/esm/tools/dateUtils.d.ts +7 -0
- package/dist/esm/tools/dateUtils.js +23 -0
- package/dist/esm/tools/disableDate/index.d.ts +9 -0
- package/dist/esm/tools/disableDate/index.js +43 -0
- package/dist/esm/tools/disableTimeRange/index.d.ts +9 -0
- package/dist/esm/tools/disableTimeRange/index.js +121 -0
- package/dist/esm/tools/formatAmount/index.d.ts +7 -0
- package/dist/esm/tools/formatAmount/index.js +14 -0
- package/dist/esm/tools/formatPerMill/index.d.ts +7 -0
- package/dist/esm/tools/formatPerMill/index.js +11 -0
- package/dist/esm/tools/formatPercent/index.d.ts +7 -0
- package/dist/esm/tools/formatPercent/index.js +11 -0
- package/dist/esm/tools/getDataByIdCard/index.d.ts +16 -0
- package/dist/esm/tools/getDataByIdCard/index.js +65 -0
- package/dist/esm/tools/index.d.ts +12 -0
- package/dist/esm/tools/index.js +14 -0
- package/dist/esm/tools/sumAmount/index.d.ts +16 -0
- package/dist/esm/tools/sumAmount/index.js +40 -0
- package/dist/esm/tools/toChineseNum/index.d.ts +7 -0
- package/dist/esm/tools/toChineseNum/index.js +103 -0
- package/dist/esm/tools/toFixed/index.d.ts +2 -0
- package/dist/esm/tools/toFixed/index.js +5 -0
- package/dist/esm/tools/transformDataName/index.d.ts +12 -0
- package/dist/esm/tools/transformDataName/index.js +37 -0
- package/dist/esm/transforms/dateTransformer/index.d.ts +24 -0
- package/dist/esm/transforms/dateTransformer/index.js +67 -0
- package/dist/esm/transforms/index.d.ts +6 -0
- package/dist/esm/transforms/index.js +6 -0
- package/dist/esm/transforms/propTypes.d.ts +7 -0
- package/dist/esm/transforms/propTypes.js +1 -0
- package/dist/esm/transforms/transformDate/index.d.ts +21 -0
- package/dist/esm/transforms/transformDate/index.js +141 -0
- package/dist/esm/transforms/transformDatePicker/index.d.ts +12 -0
- package/dist/esm/transforms/transformDatePicker/index.js +24 -0
- package/dist/esm/transforms/transformRangePicker/index.d.ts +29 -0
- package/dist/esm/transforms/transformRangePicker/index.js +61 -0
- package/dist/esm/transforms/transformSwitch/index.d.ts +13 -0
- package/dist/esm/transforms/transformSwitch/index.js +35 -0
- package/dist/esm/transforms/utils.d.ts +2 -0
- package/dist/esm/transforms/utils.js +8 -0
- package/dist/esm/validate/index.d.ts +107 -0
- package/dist/esm/validate/index.js +284 -0
- package/es/ProAction/index.less +0 -2
- package/es/ProConfigProvider/index.d.ts +1 -0
- package/es/ProConfigProvider/index.js +4 -5
- package/es/ProDownload/style/index.less +0 -2
- package/es/ProDrawerForm/index.js +33 -29
- package/es/ProDrawerForm/style/index.less +0 -2
- package/es/ProEditLabel/style/index.less +0 -2
- package/es/ProEditTable/components/RcTable/DraggableTable.js +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +14 -2
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/style/index.less +2 -4
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/es/ProEditTable/utils/diffOriginal.js +68 -1
- package/es/ProEnum/hooks/useEnum.js +5 -0
- package/es/ProEnum/style/index.less +0 -2
- package/es/ProForm/components/FormFooter/index.js +6 -6
- package/es/ProForm/components/base/DatePicker/index.js +19 -34
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/es/ProForm/components/base/TextArea/index.less +0 -2
- package/es/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/es/ProForm/components/combination/Container/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/style/index.less +0 -2
- package/es/ProForm/components/combination/Group/component/ComRender.js +9 -8
- package/es/ProForm/components/combination/Group/hooks/index.js +17 -4
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +10 -16
- package/es/ProForm/components/combination/ProCascader/index.js +106 -52
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/es/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +38 -64
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/es/ProForm/components/render/ChangedWrapper.js +2 -2
- package/es/ProForm/components/render/Render.js +17 -5
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/index.js +5 -2
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +0 -2
- package/es/ProForm/utils/diffOriginal.d.ts +1 -0
- package/es/ProForm/utils/diffOriginal.js +66 -1
- package/es/ProForm/utils/index.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/es/ProForm/utils/useShouldUpdate.js +89 -3
- package/es/ProIcon/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +60 -8
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +25 -3
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/index.js +4 -1
- package/es/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/es/ProLayout/components/ProCollapse/index.js +27 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/es/ProLayout/components/ProFooter/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/style/index.less +0 -2
- package/es/ProLayout/index.d.ts +0 -11
- package/es/ProLayout/index.js +60 -32
- package/es/ProLayout/propTypes.d.ts +9 -0
- package/es/ProLayout/style/index.less +0 -2
- package/es/ProLayout/utils/index.d.ts +7 -0
- package/es/ProLayout/utils/index.js +30 -0
- package/es/ProSelect/index.less +0 -2
- package/es/ProSelect/utils/index.js +62 -1
- package/es/ProStep/components/Item/index.js +1 -2
- package/es/ProStep/style/index.less +0 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +1 -1
- package/es/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/es/ProTable/hooks/useAntdTable.js +92 -64
- package/es/ProTable/index.d.ts +3 -7
- package/es/ProTable/index.js +14 -14
- package/es/ProTable/propsType.d.ts +3 -2
- package/es/ProTable/style/index.less +4 -6
- package/es/ProTabs/style/index.less +0 -2
- package/es/ProThemeTools/index.d.ts +0 -7
- package/es/ProThemeTools/index.js +10 -12
- package/es/ProThemeTools/style/index.less +0 -2
- package/es/ProTooltip/style/index.less +0 -2
- package/es/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/es/ProTree/style/index.less +0 -2
- package/es/ProTreeModal/style/index.less +0 -2
- package/es/ProUpload/style/index.less +0 -2
- package/es/ProViewer/style/index.less +0 -2
- package/es/style/theme/antd.less +0 -2
- package/jest.config.js +46 -4
- package/lib/ProAction/index.less +0 -2
- package/lib/ProConfigProvider/index.d.ts +1 -0
- package/lib/ProConfigProvider/index.js +4 -3
- package/lib/ProDownload/style/index.less +0 -2
- package/lib/ProDrawerForm/index.js +25 -28
- package/lib/ProDrawerForm/style/index.less +0 -2
- package/lib/ProEditLabel/style/index.less +0 -2
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -2
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/style/index.less +2 -4
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/lib/ProEditTable/utils/diffOriginal.js +48 -1
- package/lib/ProEnum/hooks/useEnum.js +3 -0
- package/lib/ProEnum/style/index.less +0 -2
- package/lib/ProForm/components/FormFooter/index.js +6 -5
- package/lib/ProForm/components/base/DatePicker/index.js +21 -33
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/lib/ProForm/components/base/TextArea/index.less +0 -2
- package/lib/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/lib/ProForm/components/combination/Container/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/style/index.less +0 -2
- package/lib/ProForm/components/combination/Group/component/ComRender.js +8 -7
- package/lib/ProForm/components/combination/Group/hooks/index.js +8 -2
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +8 -13
- package/lib/ProForm/components/combination/ProCascader/index.js +73 -16
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/lib/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +26 -52
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +2 -2
- package/lib/ProForm/components/render/Render.js +11 -3
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/index.js +3 -1
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +0 -2
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -0
- package/lib/ProForm/utils/diffOriginal.js +48 -1
- package/lib/ProForm/utils/index.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/lib/ProForm/utils/useShouldUpdate.js +50 -1
- package/lib/ProIcon/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +33 -4
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +7 -2
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +2 -1
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/index.js +4 -1
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/lib/ProLayout/components/ProCollapse/index.js +27 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -2
- package/lib/ProLayout/index.d.ts +0 -11
- package/lib/ProLayout/index.js +51 -32
- package/lib/ProLayout/propTypes.d.ts +9 -0
- package/lib/ProLayout/style/index.less +0 -2
- package/lib/ProLayout/utils/index.d.ts +7 -0
- package/lib/ProLayout/utils/index.js +15 -0
- package/lib/ProSelect/index.less +0 -2
- package/lib/ProSelect/utils/index.js +34 -5
- package/lib/ProStep/components/Item/index.js +1 -2
- package/lib/ProStep/style/index.less +0 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +1 -1
- package/lib/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/lib/ProTable/hooks/useAntdTable.js +71 -36
- package/lib/ProTable/index.d.ts +3 -7
- package/lib/ProTable/index.js +8 -13
- package/lib/ProTable/propsType.d.ts +3 -2
- package/lib/ProTable/style/index.less +4 -6
- package/lib/ProTabs/style/index.less +0 -2
- package/lib/ProThemeTools/index.d.ts +0 -7
- package/lib/ProThemeTools/index.js +5 -12
- package/lib/ProThemeTools/style/index.less +0 -2
- package/lib/ProTooltip/style/index.less +0 -2
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/lib/ProTree/style/index.less +0 -2
- package/lib/ProTreeModal/style/index.less +0 -2
- package/lib/ProUpload/style/index.less +0 -2
- package/lib/ProViewer/style/index.less +0 -2
- package/lib/style/theme/antd.less +0 -2
- package/package.json +7 -6
- package/tests/__mocks__/fileMock.js +1 -0
- package/tests/__mocks__/zatUtils.js +27 -0
- package/tests/setup.ts +484 -0
- package/tests/test-utils.tsx +81 -0
- package/dist/index.esm.css +0 -6445
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5871
- package/dist/less.esm.js +0 -3
@@ -1,14 +1,13 @@
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
6
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
7
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
8
6
|
var _excluded = ["className", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator", "detailPlaceholder", "scrollFollowParent", "desensitization", "otherProps"];
|
9
|
-
import { useEffect, useState, memo, useMemo } from 'react';
|
10
|
-
import { Cascader, Tooltip } from 'antd';
|
7
|
+
import { useEffect, useState, memo, useMemo, useCallback } from 'react';
|
8
|
+
import { Cascader, Tooltip, message } from 'antd';
|
11
9
|
import { omit, find as _find, isBoolean, isEqual } from 'lodash';
|
10
|
+
import { useRequest as useRequestFunc, useDeepCompareEffect } from 'ahooks';
|
12
11
|
import { transformDataName } from "./utils/index";
|
13
12
|
import { useProConfig } from "../../../../ProConfigProvider";
|
14
13
|
import Input from "../../base/Input";
|
@@ -50,7 +49,7 @@ var getViewLabel = function getViewLabel(_ref) {
|
|
50
49
|
return viewLabel;
|
51
50
|
};
|
52
51
|
var ProCascader = function ProCascader(props) {
|
53
|
-
var _props$otherProps, _value$slice,
|
52
|
+
var _props$otherProps, _useRequest$options3, _value$slice, _ref7, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
|
54
53
|
var _ref2 = useProConfig('ProAddressBar') || {},
|
55
54
|
configDetailMaxLength = _ref2.detailMaxLength,
|
56
55
|
configEnumCode = _ref2.enumCode,
|
@@ -113,10 +112,6 @@ var ProCascader = function ProCascader(props) {
|
|
113
112
|
}
|
114
113
|
return disabled;
|
115
114
|
}, [disabled]);
|
116
|
-
var _useRequest = _objectSpread({}, useRequest),
|
117
|
-
service = _useRequest.service,
|
118
|
-
_useRequest$defaultPa = _useRequest.defaultParams,
|
119
|
-
defaultParams = _useRequest$defaultPa === void 0 ? {} : _useRequest$defaultPa;
|
120
115
|
var _useState = useState([]),
|
121
116
|
_useState2 = _slicedToArray(_useState, 2),
|
122
117
|
serviceData = _useState2[0],
|
@@ -125,54 +120,112 @@ var ProCascader = function ProCascader(props) {
|
|
125
120
|
_useState4 = _slicedToArray(_useState3, 2),
|
126
121
|
defaultLabel = _useState4[0],
|
127
122
|
setDefaultLabel = _useState4[1];
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
}
|
159
|
-
|
123
|
+
|
124
|
+
// 默认成功处理函数
|
125
|
+
var defaultOnSuccessFun = function defaultOnSuccessFun(res) {
|
126
|
+
var _ref4 = res || {},
|
127
|
+
_ref4$status = _ref4.status,
|
128
|
+
status = _ref4$status === void 0 ? 200 : _ref4$status,
|
129
|
+
msg = _ref4.message,
|
130
|
+
data = _ref4.data;
|
131
|
+
if (status !== 200) {
|
132
|
+
message.error(msg);
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
var newData = data;
|
136
|
+
if (transformResponse) {
|
137
|
+
newData = transformResponse(data);
|
138
|
+
}
|
139
|
+
var transFormData = transformDataName(newData, {
|
140
|
+
label: fieldNames.label,
|
141
|
+
value: fieldNames.value,
|
142
|
+
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
143
|
+
});
|
144
|
+
var serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level, fieldNames) : transFormData;
|
145
|
+
setServiceData(serviceData);
|
146
|
+
};
|
147
|
+
|
148
|
+
// 数据转换处理
|
149
|
+
var successTransformDataHandle = useCallback(function (res) {
|
150
|
+
if (transformResponse && typeof transformResponse === 'function') {
|
151
|
+
return transformResponse(res);
|
152
|
+
}
|
153
|
+
var _ref5 = res || {},
|
154
|
+
_ref5$status = _ref5.status,
|
155
|
+
status = _ref5$status === void 0 ? 200 : _ref5$status,
|
156
|
+
msg = _ref5.message,
|
157
|
+
data = _ref5.data;
|
158
|
+
if (status !== 200) {
|
159
|
+
message.error(msg);
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
return data;
|
163
|
+
}, [transformResponse]);
|
164
|
+
|
165
|
+
// 使用ahooks的useRequest
|
166
|
+
var fetchFunction = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
|
167
|
+
manual: true,
|
168
|
+
debounceWait: 300
|
169
|
+
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
170
|
+
onSuccess: function onSuccess(data) {
|
171
|
+
var _useRequest$options, _useRequest$options$o, _useRequest$options2;
|
172
|
+
if (transformResponse && typeof transformResponse === 'function') {
|
173
|
+
var responseData = transformResponse(data);
|
174
|
+
var transFormData = transformDataName(responseData, {
|
175
|
+
label: fieldNames.label,
|
176
|
+
value: fieldNames.value,
|
177
|
+
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
178
|
+
});
|
179
|
+
var _serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level, fieldNames) : transFormData;
|
180
|
+
setServiceData(_serviceData);
|
181
|
+
} else {
|
182
|
+
defaultOnSuccessFun(data);
|
183
|
+
}
|
184
|
+
// 执行传入的onSuccess
|
185
|
+
useRequest === null || useRequest === void 0 || (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 || (_useRequest$options$o = _useRequest$options.onSuccess) === null || _useRequest$options$o === void 0 || _useRequest$options$o.call(_useRequest$options, data, useRequest === null || useRequest === void 0 || (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams);
|
186
|
+
}
|
187
|
+
}));
|
188
|
+
|
189
|
+
// 缓存数据处理
|
190
|
+
var cacheList = useRequest !== null && useRequest !== void 0 && (_useRequest$options3 = useRequest.options) !== null && _useRequest$options3 !== void 0 && _useRequest$options3.cacheKey ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
|
160
191
|
|
161
192
|
// 提取出来默认每次都执行
|
162
193
|
if (transformResponse) {
|
163
194
|
realDataSource = transformResponse(realDataSource);
|
164
195
|
}
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
196
|
+
|
197
|
+
// 设置缓存数据
|
198
|
+
useDeepCompareEffect(function () {
|
199
|
+
var _useRequest$options4;
|
200
|
+
if (!(serviceData !== null && serviceData !== void 0 && serviceData.length) && useRequest !== null && useRequest !== void 0 && (_useRequest$options4 = useRequest.options) !== null && _useRequest$options4 !== void 0 && _useRequest$options4.cacheKey) {
|
201
|
+
if (cacheList !== null && cacheList !== void 0 && cacheList.length) {
|
202
|
+
setServiceData(cacheList);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
206
|
+
|
207
|
+
// 初始化请求数据
|
208
|
+
useDeepCompareEffect(function () {
|
209
|
+
var _useRequest$options5;
|
210
|
+
if (!(useRequest !== null && useRequest !== void 0 && useRequest.service)) {
|
211
|
+
return;
|
169
212
|
}
|
170
|
-
|
213
|
+
var _ref6 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
214
|
+
manual = _ref6.manual;
|
215
|
+
if (manual || cacheList !== null && cacheList !== void 0 && cacheList.length) {
|
216
|
+
return;
|
217
|
+
}
|
218
|
+
|
219
|
+
// 向后兼容性:优先使用 options.defaultParams,fallback 到 useRequest.defaultParams
|
220
|
+
var defaultParams = (useRequest === null || useRequest === void 0 || (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.defaultParams) || (useRequest === null || useRequest === void 0 ? void 0 : useRequest.defaultParams);
|
221
|
+
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
222
|
+
fetchFunction.run(params);
|
223
|
+
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
171
224
|
useEffect(function () {
|
172
225
|
if (realIsView && value) {
|
173
226
|
var _realDataSource;
|
174
227
|
// 传入dataSource + 查看时初始化展示
|
175
|
-
if (service) {
|
228
|
+
if (useRequest !== null && useRequest !== void 0 && useRequest.service) {
|
176
229
|
setDefaultLabel(getViewLabel({
|
177
230
|
dataSource: serviceData,
|
178
231
|
value: isAddressMode && hasDetail ? value === null || value === void 0 ? void 0 : value.slice(0, realLevel) : value
|
@@ -212,9 +265,9 @@ var ProCascader = function ProCascader(props) {
|
|
212
265
|
var addressValue = isAddressMode ? value && (_value$slice = value.slice(0, realLevel)) !== null && _value$slice !== void 0 && _value$slice.some(function (item) {
|
213
266
|
return !!item;
|
214
267
|
}) ? value.slice(0, realLevel) : undefined : value;
|
215
|
-
var viewValue = isAddressMode ? ((
|
268
|
+
var viewValue = isAddressMode ? ((_ref7 = [].concat(_toConsumableArray(defaultLabel), [value === null || value === void 0 ? void 0 : value[realLevel]])) === null || _ref7 === void 0 || (_ref7 = _ref7.filter(function (item) {
|
216
269
|
return !!item;
|
217
|
-
})) === null ||
|
270
|
+
})) === null || _ref7 === void 0 ? void 0 : _ref7.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 || (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
218
271
|
return !!item;
|
219
272
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
220
273
|
var findSelectedOptions = function findSelectedOptions(options, value) {
|
@@ -247,8 +300,8 @@ var ProCascader = function ProCascader(props) {
|
|
247
300
|
return null;
|
248
301
|
};
|
249
302
|
var _selectedOptions = useMemo(function () {
|
250
|
-
return findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
251
|
-
}, [service, serviceData, realDataSource, addressValue]);
|
303
|
+
return findSelectedOptions(useRequest !== null && useRequest !== void 0 && useRequest.service ? serviceData : realDataSource, addressValue);
|
304
|
+
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, serviceData, realDataSource, addressValue]);
|
252
305
|
var handleAddressChange = function handleAddressChange(e) {
|
253
306
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
254
307
|
if (onChange) {
|
@@ -273,8 +326,9 @@ var ProCascader = function ProCascader(props) {
|
|
273
326
|
className: hasDetail ? '' : 'no-detail',
|
274
327
|
placeholder: locale === null || locale === void 0 || (_locale$ProAddressBar = locale.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
275
328
|
value: addressValue,
|
276
|
-
options: service ? serviceData : realDataSource,
|
329
|
+
options: useRequest !== null && useRequest !== void 0 && useRequest.service ? serviceData : realDataSource,
|
277
330
|
disabled: lastDisabled[0],
|
331
|
+
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
278
332
|
displayRender: displayRender,
|
279
333
|
showSearch: {
|
280
334
|
filter: handlefilter,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import { DefaultOptionType } from 'rc-select/lib/Select';
|
3
|
-
import { Service } from 'ahooks/lib/useRequest/src/types';
|
3
|
+
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
4
4
|
export interface FieldNamesType {
|
5
5
|
label: string;
|
6
6
|
value: string;
|
@@ -19,10 +19,18 @@ export interface ProCascaderType {
|
|
19
19
|
fieldNames?: FieldNamesType;
|
20
20
|
dataSource?: DefaultOptionType[];
|
21
21
|
useRequest?: {
|
22
|
-
|
23
|
-
|
22
|
+
/**
|
23
|
+
* @description 请求服务函数
|
24
|
+
*/
|
25
|
+
service?: Service<any, any>;
|
26
|
+
/**
|
27
|
+
* @description 请求选项
|
28
|
+
*/
|
29
|
+
options?: Options<any, any>;
|
30
|
+
/**
|
31
|
+
* @deprecated 保留向后兼容性,使用 options.defaultParams 替代
|
32
|
+
*/
|
24
33
|
defaultParams?: any;
|
25
|
-
parentKey?: string;
|
26
34
|
};
|
27
35
|
onChange?: (value: string[], selectedOptions?: any[]) => void;
|
28
36
|
transformResponse?: (data: any[]) => any[];
|
@@ -63,7 +63,7 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
63
63
|
queryBean: _condition !== null && _condition !== void 0 ? _condition : {}
|
64
64
|
}) : _condition;
|
65
65
|
return transformParams ? transformParams(tempParams) : tempParams;
|
66
|
-
}, [page, searchValues]);
|
66
|
+
}, [page, searchValues, _defaultParams, transformParams]);
|
67
67
|
|
68
68
|
// 调接口
|
69
69
|
var result = useRequest(service || defaultService, _objectSpread(_objectSpread({}, useRequestOptions), {}, {
|
@@ -103,9 +103,7 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
103
103
|
|
104
104
|
// 重置查询条件
|
105
105
|
var onReset = useCallback(function () {
|
106
|
-
onSearch({
|
107
|
-
d: Date.now()
|
108
|
-
});
|
106
|
+
onSearch({});
|
109
107
|
}, [onSearch]);
|
110
108
|
var dataSource = useMemo(function () {
|
111
109
|
if (data) {
|
@@ -5,13 +5,13 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
8
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
|
8
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "mode", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "tooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
|
9
9
|
_excluded2 = ["onOk"],
|
10
10
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
11
11
|
import { SearchOutlined } from '@ant-design/icons';
|
12
12
|
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
13
13
|
import { Form, message, Input, Tooltip, Space, Button, Spin } from 'antd';
|
14
|
-
import { debounce, isArray, isEqual, isFunction } from 'lodash';
|
14
|
+
import { debounce, isArray, isBoolean, isEqual, isFunction, isObject } from 'lodash';
|
15
15
|
import classNames from 'classnames';
|
16
16
|
import { ReactSVG } from 'react-svg';
|
17
17
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
@@ -34,6 +34,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
34
34
|
fieldNames = props.fieldNames,
|
35
35
|
_props$readOnly = props.readOnly,
|
36
36
|
readOnly = _props$readOnly === void 0 ? true : _props$readOnly,
|
37
|
+
_props$mode = props.mode,
|
38
|
+
mode = _props$mode === void 0 ? 'select' : _props$mode,
|
37
39
|
addonAfter = props.addonAfter,
|
38
40
|
configOption = props.configOption,
|
39
41
|
title = props.title,
|
@@ -46,11 +48,19 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
46
48
|
beforeOpen = props.beforeOpen,
|
47
49
|
afterOpen = props.afterOpen,
|
48
50
|
isTooltip = props.isTooltip,
|
51
|
+
tooltip = props.tooltip,
|
49
52
|
searchForm = props.searchForm,
|
50
53
|
searchKey = props.searchKey,
|
51
54
|
defaultOne = props.defaultOne,
|
52
55
|
otherProps = props.otherProps,
|
53
56
|
restProps = _objectWithoutProperties(props, _excluded);
|
57
|
+
var _tooltip = tooltip !== null && tooltip !== void 0 ? tooltip : isTooltip;
|
58
|
+
var nextMode = useMemo(function () {
|
59
|
+
if (isBoolean(readOnly) && readOnly === false) {
|
60
|
+
return 'input';
|
61
|
+
}
|
62
|
+
return mode;
|
63
|
+
}, [mode, readOnly]);
|
54
64
|
var contentForm = Form.useFormInstance();
|
55
65
|
if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
|
56
66
|
throw new Error('error: 请检查枚举选择弹框的配置项【configOption】');
|
@@ -160,8 +170,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
160
170
|
transformParams: transformParams,
|
161
171
|
transformResponse: transformResponse
|
162
172
|
}, _objectSpread({
|
163
|
-
|
164
|
-
ready: (initParams || defaultOne) && !readOnly || open
|
173
|
+
ready: (initParams || defaultOne) && nextMode === 'input' || open
|
165
174
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
166
175
|
data = _useRequestList2.data,
|
167
176
|
loading = _useRequestList2.loading,
|
@@ -193,7 +202,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
193
202
|
if (typeof data === 'string' || typeof data === 'number') {
|
194
203
|
return data;
|
195
204
|
}
|
196
|
-
if (
|
205
|
+
if (isObject(data)) {
|
197
206
|
return handleFormat(_objectSpread(_objectSpread({}, data), {}, {
|
198
207
|
value: data[valueKey],
|
199
208
|
label: data[labelKey]
|
@@ -231,7 +240,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
231
240
|
* @returns {any}
|
232
241
|
*/
|
233
242
|
var getRowKey = function getRowKey(record) {
|
234
|
-
if (
|
243
|
+
if (isFunction(rowKey)) {
|
235
244
|
return rowKey(record);
|
236
245
|
}
|
237
246
|
return record[rowKey];
|
@@ -254,7 +263,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
254
263
|
var handleChangeValue = function handleChangeValue(e) {
|
255
264
|
onChange(e.target.value);
|
256
265
|
preValue.current = e.target.value;
|
257
|
-
if (
|
266
|
+
if (nextMode === 'input') {
|
258
267
|
setState({
|
259
268
|
_value: e.target.value
|
260
269
|
});
|
@@ -515,7 +524,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
515
524
|
selectedRows: list,
|
516
525
|
selectedRowKeys: nextSelectRowKeys
|
517
526
|
});
|
518
|
-
} else if (
|
527
|
+
} else if (nextMode === 'input') {
|
519
528
|
// 当传入initParams且文本框非只读时,不调用接口获取初始化数据
|
520
529
|
setState({
|
521
530
|
_value: value,
|
@@ -604,13 +613,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
604
613
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || [],
|
605
614
|
_value: undefined
|
606
615
|
});
|
607
|
-
} else if (
|
616
|
+
} else if (isArray(value)) {
|
608
617
|
setState({
|
609
618
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || value,
|
610
619
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || value,
|
611
620
|
_value: value
|
612
621
|
});
|
613
|
-
} else if (
|
622
|
+
} else if (isObject(value)) {
|
614
623
|
var initialValue = _defineProperty(_defineProperty({}, valueKey, value[valueKey]), labelKey, value[labelKey]);
|
615
624
|
setState({
|
616
625
|
selectedRowKeys: [value],
|
@@ -633,7 +642,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
633
642
|
nextState.selectedRowKeys = [];
|
634
643
|
nextState.selectedRows = [];
|
635
644
|
}
|
636
|
-
if (
|
645
|
+
if (isObject(value)) {
|
637
646
|
nextState.selectedRowKeys = [getRowKey(value)];
|
638
647
|
nextState.selectedRows = [value];
|
639
648
|
}
|
@@ -659,12 +668,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
659
668
|
hideTooltipIfOpen(fieldRef.current, open);
|
660
669
|
}, [open]);
|
661
670
|
useEffect(function () {
|
662
|
-
if (value && !open && isInit &&
|
671
|
+
if (value && !open && isInit && nextMode === 'input') {
|
663
672
|
getInitValues();
|
664
673
|
}
|
665
674
|
}, [JSON.stringify(value), open, isInit]);
|
666
675
|
useDebounceEffect(function () {
|
667
|
-
if (value && !open &&
|
676
|
+
if (value && !open && nextMode === 'select' && (!isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
668
677
|
var _options$some;
|
669
678
|
preValue.current = value;
|
670
679
|
var _data3 = labelInValue ? value[valueKey] : value;
|
@@ -731,7 +740,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
731
740
|
});
|
732
741
|
}
|
733
742
|
}
|
734
|
-
if (
|
743
|
+
if (nextMode === 'input') {
|
735
744
|
if (labelInValue && _value && !isEqual(value, _value)) {
|
736
745
|
setState({
|
737
746
|
_value: value,
|
@@ -755,7 +764,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
755
764
|
width: '100%'
|
756
765
|
},
|
757
766
|
block: true,
|
758
|
-
children: [
|
767
|
+
children: [nextMode === 'select' ? /*#__PURE__*/_jsx(ProSelect, _objectSpread({
|
759
768
|
value: value,
|
760
769
|
onChange: handleSelectValue,
|
761
770
|
disabled: disabled,
|
@@ -771,16 +780,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
771
780
|
}) : null,
|
772
781
|
onFocus: handleSelectFocus,
|
773
782
|
onSearch: handleSelectSearch,
|
783
|
+
tooltip: _tooltip,
|
774
784
|
style: {
|
775
785
|
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
776
786
|
}
|
777
|
-
}, restProps)) : /*#__PURE__*/_jsx(
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
787
|
+
}, restProps)) : /*#__PURE__*/_jsx(Tooltip, {
|
788
|
+
title: _tooltip ? viewText : null,
|
789
|
+
placement: "topLeft",
|
790
|
+
children: /*#__PURE__*/_jsx(Input, _objectSpread({
|
791
|
+
value: viewText,
|
792
|
+
onChange: handleChangeValue,
|
793
|
+
disabled: disabled,
|
794
|
+
autoComplete: "off",
|
795
|
+
allowClear: true
|
796
|
+
}, restProps))
|
797
|
+
}), isView || disabled ? null : /*#__PURE__*/_jsx(Button, {
|
784
798
|
onClick: handleClick,
|
785
799
|
icon: /*#__PURE__*/_jsx(ReactSVG, {
|
786
800
|
className: "viewSvg",
|
@@ -795,41 +809,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
795
809
|
children: customRender
|
796
810
|
});
|
797
811
|
}
|
798
|
-
useDeepCompareEffect(function () {
|
799
|
-
if (isTooltip && value) {
|
800
|
-
var dom = document.getElementById(uuid);
|
801
|
-
dom.addEventListener('mouseover', function (e) {
|
802
|
-
if (value && e.target.tagName === 'INPUT') {
|
803
|
-
setState({
|
804
|
-
open: true
|
805
|
-
});
|
806
|
-
}
|
807
|
-
});
|
808
|
-
dom.addEventListener('mouseout', function (e) {
|
809
|
-
if (e.target.tagName === 'INPUT') {
|
810
|
-
setState({
|
811
|
-
open: false
|
812
|
-
});
|
813
|
-
}
|
814
|
-
});
|
815
|
-
return function () {
|
816
|
-
dom.removeEventListener('mouseover', function (e) {
|
817
|
-
if (value && e.target.tagName === 'INPUT') {
|
818
|
-
setState({
|
819
|
-
open: true
|
820
|
-
});
|
821
|
-
}
|
822
|
-
});
|
823
|
-
dom.removeEventListener('mouseout', function (e) {
|
824
|
-
if (e.target.tagName === 'INPUT') {
|
825
|
-
setState({
|
826
|
-
open: false
|
827
|
-
});
|
828
|
-
}
|
829
|
-
});
|
830
|
-
};
|
831
|
-
}
|
832
|
-
}, [value, isTooltip]);
|
833
812
|
useDeepCompareEffect(function () {
|
834
813
|
setState({
|
835
814
|
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
@@ -868,14 +847,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
868
847
|
className: _className,
|
869
848
|
style: style,
|
870
849
|
ref: fieldRef,
|
871
|
-
children:
|
872
|
-
placement: "topLeft",
|
873
|
-
open: open,
|
874
|
-
title: viewText,
|
875
|
-
children: initRender
|
876
|
-
}) : initRender
|
850
|
+
children: initRender
|
877
851
|
}), /*#__PURE__*/_jsxs(ProDrawerForm, _objectSpread(_objectSpread({
|
878
|
-
|
852
|
+
mode: "Modal",
|
879
853
|
title: title,
|
880
854
|
onOk: handleFinish
|
881
855
|
// @ts-ignore
|
@@ -80,17 +80,21 @@ interface ProModalPropsType {
|
|
80
80
|
beforeOpen?: any;
|
81
81
|
/** 打开弹框后的回调函数 */
|
82
82
|
afterOpen?: any;
|
83
|
-
/** 是否启用tooltip提示 */
|
83
|
+
/** 废弃 是否启用tooltip提示 */
|
84
84
|
isTooltip?: boolean;
|
85
|
+
/** 是否启用tooltip提示 */
|
86
|
+
tooltip?: boolean;
|
85
87
|
/** 是否以"值-名称"形式展示 */
|
86
88
|
showCodeName?: boolean;
|
87
89
|
/** 查询表单实例,用于获取查询表单数据 */
|
88
90
|
searchForm?: FormInstance;
|
89
91
|
/** 模糊查询的字段名 */
|
90
92
|
searchKey?: string;
|
93
|
+
/** 展示形式 */
|
94
|
+
mode?: 'input' | 'select';
|
91
95
|
}
|
92
96
|
/** 模态框选择器属性类型(结合Select和Input属性) */
|
93
|
-
export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
|
97
|
+
export declare type ProModalSelectPropsType = Omit<SelectProps & InputProps, 'mode'> & ProModalPropsType;
|
94
98
|
/** 配置选项类型 */
|
95
99
|
export type ProModalSelectConfigType = ConfigOption;
|
96
100
|
/** 模态框属性类型 */
|
@@ -98,5 +102,5 @@ export type ProModalType = Omit<ProModalPropsType, 'configOption'> & {
|
|
98
102
|
configOption: ProModalSelectConfigType;
|
99
103
|
};
|
100
104
|
/** 模态框选择器类型(结合Select和Input属性) */
|
101
|
-
export type ProModalSelectType = SelectProps & InputProps & ProModalType;
|
105
|
+
export type ProModalSelectType = Omit<SelectProps & InputProps, 'mode'> & ProModalType;
|
102
106
|
export {};
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* @root-entry-name: 'default'; */
|
2
|
-
/* @import (reference) '~antd/es/style/themes/index.less'; */
|
3
1
|
|
4
2
|
.pro-modal-select,
|
5
3
|
.pro-tree-modal {
|
@@ -53,7 +51,7 @@
|
|
53
51
|
}
|
54
52
|
}
|
55
53
|
|
56
|
-
// 新加适用于
|
54
|
+
// 新加适用于 _readOnly false
|
57
55
|
.@{ant-prefix}-input-affix-wrapper {
|
58
56
|
border-top-right-radius: 0;
|
59
57
|
border-bottom-right-radius: 0;
|
@@ -102,7 +100,6 @@
|
|
102
100
|
}
|
103
101
|
}
|
104
102
|
|
105
|
-
|
106
103
|
.@{ant-prefix}-input-group-wrapper-status-error {
|
107
104
|
&:hover {
|
108
105
|
.@{ant-prefix}-input,
|
@@ -58,8 +58,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
58
58
|
value: _value,
|
59
59
|
originalValue: _originalValue,
|
60
60
|
form: form,
|
61
|
-
onDiff: onDiff
|
62
|
-
|
61
|
+
onDiff: onDiff,
|
62
|
+
type: props.type
|
63
63
|
});
|
64
64
|
}, [isWatch, noChange, props[valuePropName], originalValue, _typeof(onDiff)]);
|
65
65
|
var isAdd = diffType === 'add';
|