@zat-design/sisyphus-react 3.9.7 → 3.9.8-beta.2
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 +7 -1
- package/dist/less.esm.css +7 -1
- package/es/ProAction/index.js +5 -5
- package/es/ProDownload/index.d.ts +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.d.ts +1 -1
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -5
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/es/ProEditTable/components/RenderToolbar/index.js +2 -2
- package/es/ProEditTable/components/Summary/index.d.ts +1 -1
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +8 -9
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +4 -4
- package/es/ProEnum/components/Group.d.ts +1 -1
- package/es/ProEnum/components/Tag.d.ts +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/index.js +1 -1
- package/es/ProEnum/utils/eventCenter.js +2 -1
- package/es/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/es/ProForm/components/base/Input/index.d.ts +1 -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 +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.js +8 -8
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +15 -7
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/components/render/propsType.d.ts +2 -0
- package/es/ProForm/index.js +1 -1
- package/es/ProForm/utils/index.js +10 -14
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.js +25 -5
- package/es/ProForm/utils/valueType.d.ts +10 -0
- package/es/ProForm/utils/valueType.js +69 -33
- package/es/ProIcon/utils/index.js +3 -4
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/style/index.less +1 -1
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/utils/index.js +9 -9
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProStep/components/Anchor/index.d.ts +1 -1
- package/es/ProStep/components/Item/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +1 -1
- package/es/ProStep/components/Step/index.d.ts +1 -1
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/index.js +13 -12
- package/es/ProTable/components/FormatColumn/index.js +33 -5
- package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/es/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/es/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/es/ProTable/components/TableResizable/index.d.ts +1 -1
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +8 -5
- package/es/ProTable/style/index.less +7 -0
- package/es/ProTabs/components/Card/index.d.ts +1 -1
- package/es/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProTooltip/index.d.ts +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/es/ProTree/components/CloseIcon.d.ts +2 -1
- package/es/ProTree/components/List.d.ts +1 -1
- package/es/ProTree/components/ProTree.d.ts +1 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +22 -22
- package/es/ProTree/components/SearchTitle.d.ts +1 -1
- package/es/ProTree/components/Tree.d.ts +1 -1
- package/es/ProTree/components/Tree.js +4 -4
- package/es/ProTree/index.d.ts +1 -1
- package/es/ProTree/utils.js +11 -12
- package/es/ProTreeModal/components/Cascader.d.ts +1 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/es/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/es/ProTreeModal/components/Tree.js +6 -6
- package/es/ProTreeModal/components/Trigger.d.ts +1 -1
- package/es/ProTreeModal/index.d.ts +1 -1
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/utils.js +14 -16
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +1 -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/lib/ProAction/index.js +5 -5
- package/lib/ProDownload/index.d.ts +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.d.ts +1 -1
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RcTable/BaseTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/DraggableTable.d.ts +1 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -5
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -1
- package/lib/ProEditTable/components/RenderToolbar/index.js +2 -2
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -1
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +8 -9
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +4 -4
- package/lib/ProEnum/components/Group.d.ts +1 -1
- package/lib/ProEnum/components/Tag.d.ts +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/index.js +1 -1
- package/lib/ProEnum/utils/eventCenter.js +2 -1
- package/lib/ProEnum/utils/getEnumLabel.d.ts +1 -1
- package/lib/ProForm/components/base/Input/index.d.ts +1 -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 +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +8 -8
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +5 -5
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +15 -7
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/components/render/propsType.d.ts +2 -0
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/utils/index.js +10 -10
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.js +25 -5
- package/lib/ProForm/utils/valueType.d.ts +10 -0
- package/lib/ProForm/utils/valueType.js +70 -34
- package/lib/ProIcon/utils/index.js +3 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/style/index.less +1 -1
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/utils/index.js +9 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProStep/components/Anchor/index.d.ts +1 -1
- package/lib/ProStep/components/Item/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +1 -1
- package/lib/ProStep/components/Step/index.d.ts +1 -1
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/index.js +12 -11
- package/lib/ProTable/components/FormatColumn/index.js +33 -5
- package/lib/ProTable/components/RcTable/components/BaseTable/index.d.ts +1 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +8 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.d.ts +1 -1
- package/lib/ProTable/components/RenderFooter/index.d.ts +1 -1
- package/lib/ProTable/components/RenderTableHeader/index.d.ts +1 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -1
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +8 -5
- package/lib/ProTable/style/index.less +7 -0
- package/lib/ProTabs/components/Card/index.d.ts +1 -1
- package/lib/ProThemeTools/component/ProTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProTooltip/index.d.ts +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +1 -1
- package/lib/ProTree/components/CloseIcon.d.ts +2 -1
- package/lib/ProTree/components/List.d.ts +1 -1
- package/lib/ProTree/components/ProTree.d.ts +1 -1
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +22 -22
- package/lib/ProTree/components/SearchTitle.d.ts +1 -1
- package/lib/ProTree/components/Tree.d.ts +1 -1
- package/lib/ProTree/components/Tree.js +4 -4
- package/lib/ProTree/index.d.ts +1 -1
- package/lib/ProTree/utils.js +11 -11
- package/lib/ProTreeModal/components/Cascader.d.ts +1 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +2 -1
- package/lib/ProTreeModal/components/SearchTitle.d.ts +1 -1
- package/lib/ProTreeModal/components/Tree.js +6 -6
- package/lib/ProTreeModal/components/Trigger.d.ts +1 -1
- package/lib/ProTreeModal/index.d.ts +1 -1
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/utils.js +13 -13
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +1 -1
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ProCascaderProps } from './propsType';
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) =>
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
4
4
|
export default _default;
|
@@ -29,9 +29,9 @@ var defaultFieldNames = {
|
|
29
29
|
value: 'code',
|
30
30
|
children: 'children'
|
31
31
|
};
|
32
|
-
var
|
32
|
+
var filterDataSource = function filterDataSource(dataSource, level, fieldNames) {
|
33
33
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
34
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] :
|
34
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children', level === 1 ? [] : filterDataSource(item === null || item === void 0 ? void 0 : item[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], level - 1, fieldNames)));
|
35
35
|
});
|
36
36
|
};
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
@@ -108,7 +108,7 @@ var ProCascader = function ProCascader(props) {
|
|
108
108
|
}, [dics === null || dics === void 0 ? void 0 : dics[addressCode], enumData]);
|
109
109
|
var realDataSource = useMemo(function () {
|
110
110
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
111
|
-
var result = transformDataName(isAddressMode && realLevel === 2 ?
|
111
|
+
var result = transformDataName(isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
112
112
|
return result;
|
113
113
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
114
114
|
var lastDisabled = useMemo(function () {
|
@@ -130,7 +130,7 @@ var ProCascader = function ProCascader(props) {
|
|
130
130
|
defaultLabel = _useState4[0],
|
131
131
|
setDefaultLabel = _useState4[1];
|
132
132
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
133
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
133
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
134
134
|
var _yield$service, data, newData, transFormData, serviceData;
|
135
135
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
136
136
|
while (1) switch (_context.prev = _context.next) {
|
@@ -149,7 +149,7 @@ var ProCascader = function ProCascader(props) {
|
|
149
149
|
value: fieldNames.value,
|
150
150
|
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
151
151
|
});
|
152
|
-
serviceData = isAddressMode && realLevel === 2 ?
|
152
|
+
serviceData = isAddressMode && realLevel === 2 ? filterDataSource(transFormData, level, fieldNames) : transFormData;
|
153
153
|
setServiceData(serviceData);
|
154
154
|
case 9:
|
155
155
|
case "end":
|
@@ -219,7 +219,7 @@ var ProCascader = function ProCascader(props) {
|
|
219
219
|
})) === null || _ref5$filter === void 0 ? void 0 : _ref5$filter.join(separator)) || '-' : (defaultLabel === null || defaultLabel === void 0 ? void 0 : (_defaultLabel$filter = defaultLabel.filter(function (item) {
|
220
220
|
return !!item;
|
221
221
|
})) === null || _defaultLabel$filter === void 0 ? void 0 : _defaultLabel$filter.join(separator)) || '-';
|
222
|
-
var
|
222
|
+
var findSelectedOptions = function findSelectedOptions(options, value) {
|
223
223
|
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
224
224
|
var _value = value !== null && value !== void 0 ? value : [];
|
225
225
|
// 基准情况:如果 value 数组为空,且 path 不为空,说明找到了完整的路径
|
@@ -238,7 +238,7 @@ var ProCascader = function ProCascader(props) {
|
|
238
238
|
if (foundOption) {
|
239
239
|
// 如果找到了匹配的选项,并且还有更多的 value 需要匹配,递归地在子选项中查找
|
240
240
|
if (_value.length > 1 && foundOption.children) {
|
241
|
-
return
|
241
|
+
return findSelectedOptions(foundOption.children, _value.slice(1), [].concat(_toConsumableArray(path), [foundOption]));
|
242
242
|
}
|
243
243
|
// 如果没有更多的 value 需要匹配,返回当前选项(以及之前的路径)
|
244
244
|
return [].concat(_toConsumableArray(path), [foundOption]);
|
@@ -247,7 +247,7 @@ var ProCascader = function ProCascader(props) {
|
|
247
247
|
return null;
|
248
248
|
};
|
249
249
|
var _selectedOptions = useMemo(function () {
|
250
|
-
return
|
250
|
+
return findSelectedOptions(service ? serviceData : realDataSource, addressValue);
|
251
251
|
}, [service, serviceData, realDataSource, addressValue]);
|
252
252
|
var handleAddressChange = function handleAddressChange(e) {
|
253
253
|
var cascaderValue = value === null || value === void 0 ? void 0 : value.slice(0, realLevel);
|
@@ -24,7 +24,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
24
24
|
});
|
25
25
|
};
|
26
26
|
var defaultService = /*#__PURE__*/function () {
|
27
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
27
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
28
28
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
30
30
|
case 0:
|
@@ -260,7 +260,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
260
260
|
onChange(val, option);
|
261
261
|
};
|
262
262
|
var handleClick = /*#__PURE__*/function () {
|
263
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
263
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
264
264
|
var _yield$beforeOpen, res;
|
265
265
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
266
266
|
while (1) switch (_context.prev = _context.next) {
|
@@ -327,7 +327,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
327
327
|
}
|
328
328
|
};
|
329
329
|
var handleFinish = /*#__PURE__*/function () {
|
330
|
-
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
330
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
331
331
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
332
332
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
333
333
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -392,7 +392,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
392
392
|
};
|
393
393
|
}();
|
394
394
|
var handleSearch = /*#__PURE__*/function () {
|
395
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
395
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
396
396
|
var values;
|
397
397
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
398
398
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -465,7 +465,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
465
465
|
};
|
466
466
|
// 初始化回显,当传入initParams时,前端用来回险
|
467
467
|
var getInitValues = /*#__PURE__*/function () {
|
468
|
-
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
468
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
469
469
|
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
470
470
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
471
471
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -525,7 +525,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
525
525
|
}();
|
526
526
|
// 初始化回显,当传入initParams时,前端用来回险
|
527
527
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
528
|
-
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
528
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
529
529
|
var _useRequest$options4, _useRequest$options5;
|
530
530
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
531
531
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -12,5 +12,5 @@ export interface InputRangeProps {
|
|
12
12
|
isPositiveInteger?: boolean;
|
13
13
|
precision?: number;
|
14
14
|
}
|
15
|
-
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) =>
|
15
|
+
declare const InputRange: ({ value, onChange, min, max, group, disabled, precision, isPositiveInteger, }: InputRangeProps) => JSX.Element;
|
16
16
|
export default InputRange;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { ProAddressPropsType } from './propsTypes';
|
2
3
|
export declare const transferAddressInfoToRegion: () => {
|
3
4
|
normalize: (value: any) => {
|
@@ -23,5 +24,5 @@ export declare const transferAddressInfoToRegion: () => {
|
|
23
24
|
};
|
24
25
|
};
|
25
26
|
};
|
26
|
-
export declare function ProAddress({ ...props }: ProAddressPropsType):
|
27
|
+
export declare function ProAddress({ ...props }: ProAddressPropsType): JSX.Element;
|
27
28
|
export default ProAddress;
|
@@ -92,7 +92,7 @@ export function ProAddress(_ref3) {
|
|
92
92
|
secondCitys = _useState6[0],
|
93
93
|
setSecondCitys = _useState6[1];
|
94
94
|
var queryCity = /*#__PURE__*/function () {
|
95
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, type) {
|
95
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, type) {
|
96
96
|
var cityList, _cityList, newList, _secondCitys;
|
97
97
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
98
98
|
while (1) switch (_context.prev = _context.next) {
|
@@ -1,2 +1,3 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { ProRangeBoxPropsType } from './propsType';
|
2
|
-
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType):
|
3
|
+
export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): JSX.Element;
|
@@ -22,7 +22,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
22
22
|
var _ProForm$useFieldProp = ProForm.useFieldProps(),
|
23
23
|
form = _ProForm$useFieldProp.form;
|
24
24
|
var handleChange = /*#__PURE__*/function () {
|
25
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
26
26
|
var _len,
|
27
27
|
other,
|
28
28
|
_key,
|
@@ -51,7 +51,8 @@ var Render = function Render(props) {
|
|
51
51
|
confirm = props.confirm,
|
52
52
|
globalControl = props.globalControl,
|
53
53
|
diffConfig = props.diffConfig,
|
54
|
-
viewRender = props.viewRender
|
54
|
+
viewRender = props.viewRender,
|
55
|
+
desensitization = props.desensitization;
|
55
56
|
var colProps = props.colProps;
|
56
57
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
57
58
|
var labelWidth = formItemProps.labelWidth,
|
@@ -75,7 +76,8 @@ var Render = function Render(props) {
|
|
75
76
|
fieldProps: fieldProps,
|
76
77
|
component: component,
|
77
78
|
originComponent: originComponent,
|
78
|
-
type: type
|
79
|
+
type: type,
|
80
|
+
desensitization: desensitization
|
79
81
|
}),
|
80
82
|
shouldUpdate = _useShouldUpdate.shouldUpdate,
|
81
83
|
_show = _useShouldUpdate.show,
|
@@ -83,7 +85,8 @@ var Render = function Render(props) {
|
|
83
85
|
_rules = _useShouldUpdate.rules,
|
84
86
|
_required = _useShouldUpdate.required,
|
85
87
|
_fieldProps = _useShouldUpdate.fieldProps,
|
86
|
-
AutoComponent = _useShouldUpdate.component
|
88
|
+
AutoComponent = _useShouldUpdate.component,
|
89
|
+
_desensitization = _useShouldUpdate.desensitization;
|
87
90
|
otherFormItemProps.shouldUpdate = shouldUpdate;
|
88
91
|
var namesStr = useMemo(function () {
|
89
92
|
var _otherProps$names;
|
@@ -121,11 +124,16 @@ var Render = function Render(props) {
|
|
121
124
|
if (type === 'Input') {
|
122
125
|
valueType = valueType || 'trim';
|
123
126
|
}
|
127
|
+
if (_desensitization === null || _desensitization === void 0 ? void 0 : _desensitization.length) {
|
128
|
+
valueType = 'desensitization';
|
129
|
+
}
|
124
130
|
// 不存在valueType返回空
|
125
131
|
if (!valueType) {
|
126
132
|
return {};
|
127
133
|
}
|
128
|
-
var params = _objectSpread(_objectSpread({}, otherProps), otherFormItemProps)
|
134
|
+
var params = _objectSpread(_objectSpread(_objectSpread({}, otherProps), otherFormItemProps), {}, {
|
135
|
+
desensitization: _desensitization
|
136
|
+
});
|
129
137
|
return isFunction(valueTypeMap[valueType]) ? valueTypeMap[valueType](params) : {};
|
130
138
|
};
|
131
139
|
/**
|
@@ -245,7 +253,7 @@ var Render = function Render(props) {
|
|
245
253
|
_args = functionArgs([].concat(args));
|
246
254
|
}
|
247
255
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
248
|
-
if (/*#__PURE__*/React.isValidElement(AutoComponent)) {
|
256
|
+
if ( /*#__PURE__*/React.isValidElement(AutoComponent)) {
|
249
257
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
250
258
|
((_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(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_args))));
|
251
259
|
return false;
|
@@ -295,7 +303,7 @@ var Render = function Render(props) {
|
|
295
303
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
296
304
|
*/
|
297
305
|
var handleBlur = /*#__PURE__*/function () {
|
298
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
306
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
299
307
|
var _len3,
|
300
308
|
args,
|
301
309
|
_key3,
|
@@ -378,7 +386,7 @@ var Render = function Render(props) {
|
|
378
386
|
if (originComponent) {
|
379
387
|
delete childProps.otherProps;
|
380
388
|
}
|
381
|
-
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (/*#__PURE__*/React.cloneElement(AutoComponent, childProps)) : _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
389
|
+
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? ( /*#__PURE__*/React.cloneElement(AutoComponent, childProps)) : _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
382
390
|
otherProps: _objectSpread(_objectSpread({}, otherProps), {}, {
|
383
391
|
show: show,
|
384
392
|
disabled: lastDisabled,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm"];
|
3
|
+
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm", "desensitization"];
|
4
4
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
5
5
|
import React from 'react';
|
6
6
|
import { isBoolean, isFunction, union, isString } from 'lodash';
|
@@ -74,6 +74,7 @@ var RenderFields = function RenderFields(props) {
|
|
74
74
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
75
75
|
columnRequired = column.required,
|
76
76
|
confirm = column.confirm,
|
77
|
+
desensitization = column.desensitization,
|
77
78
|
otherFormItemProps = _objectWithoutProperties(column, _excluded);
|
78
79
|
var component = column.component;
|
79
80
|
var _isView = typeof column.isView === 'boolean' ? column.isView : isView;
|
@@ -212,7 +213,8 @@ var RenderFields = function RenderFields(props) {
|
|
212
213
|
equalWith: onDiff || equalWith,
|
213
214
|
requiredOnView: requiredOnView,
|
214
215
|
globalControl: globalControl,
|
215
|
-
viewRender: viewRender
|
216
|
+
viewRender: viewRender,
|
217
|
+
desensitization: desensitization
|
216
218
|
})
|
217
219
|
}, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
|
218
220
|
});
|
@@ -229,6 +229,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
229
229
|
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
|
230
230
|
/** 防抖模式 */
|
231
231
|
debounceWait?: number;
|
232
|
+
/** 脱敏数据位置下标 */
|
233
|
+
desensitization?: [number, number] | ReactiveFunction<Values, [number, number]>;
|
232
234
|
}
|
233
235
|
export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
|
234
236
|
/**
|
package/es/ProForm/index.js
CHANGED
@@ -174,7 +174,7 @@ var ProForm = function ProForm(props, ref) {
|
|
174
174
|
if (isView || disabled) {
|
175
175
|
// 查看或禁用模式
|
176
176
|
footerEle = null;
|
177
|
-
} else if (/*#__PURE__*/React.isValidElement(footer)) {
|
177
|
+
} else if ( /*#__PURE__*/React.isValidElement(footer)) {
|
178
178
|
// 传入组件渲染组件
|
179
179
|
footerEle = footer;
|
180
180
|
} else if (footer === undefined || footer || isObject(footer)) {
|
@@ -120,7 +120,7 @@ export var splitNameStr = function splitNameStr(name) {
|
|
120
120
|
});
|
121
121
|
};
|
122
122
|
// 过滤掉字段名中包含 '-' 的字段
|
123
|
-
var
|
123
|
+
export var filterInternalFields = function filterInternalFields(values, optimize) {
|
124
124
|
if (optimize) {
|
125
125
|
return values;
|
126
126
|
}
|
@@ -134,21 +134,20 @@ var _filterInternalFields = function filterInternalFields(values, optimize) {
|
|
134
134
|
}
|
135
135
|
if (Array.isArray(nextValues)) {
|
136
136
|
return nextValues.map(function (item) {
|
137
|
-
return
|
137
|
+
return filterInternalFields(item);
|
138
138
|
});
|
139
139
|
}
|
140
140
|
if (isObject(nextValues)) {
|
141
141
|
var result = {};
|
142
142
|
Object.keys(nextValues).forEach(function (key) {
|
143
143
|
if (key.includes('-')) return;
|
144
|
-
result[key] =
|
144
|
+
result[key] = filterInternalFields(nextValues[key]);
|
145
145
|
});
|
146
146
|
return result;
|
147
147
|
}
|
148
148
|
return nextValues;
|
149
149
|
};
|
150
|
-
export
|
151
|
-
var _getAllNamePath = function getAllNamePath(object) {
|
150
|
+
export var getAllNamePath = function getAllNamePath(object) {
|
152
151
|
var currentPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
153
152
|
var keys = Object.keys(object);
|
154
153
|
var resultKeys = [];
|
@@ -162,14 +161,13 @@ var _getAllNamePath = function getAllNamePath(object) {
|
|
162
161
|
}
|
163
162
|
// 深度获取对象key
|
164
163
|
if (isObject(value)) {
|
165
|
-
resultKeys.concat(
|
164
|
+
resultKeys.concat(getAllNamePath(value, [].concat(_toConsumableArray(currentPath), [key])));
|
166
165
|
}
|
167
166
|
resultKeys.push([].concat(_toConsumableArray(currentPath), [key]));
|
168
167
|
});
|
169
168
|
return resultKeys;
|
170
169
|
};
|
171
170
|
// 判断一个字段值是否算空
|
172
|
-
export { _getAllNamePath as getAllNamePath };
|
173
171
|
var nullList = [undefined, 'null', '""', '[]'];
|
174
172
|
export var isNullValue = function isNullValue(value) {
|
175
173
|
return nullList.includes(JSON.stringify(value));
|
@@ -306,7 +304,7 @@ export var customEqualForFun = function customEqualForFun(value, other) {
|
|
306
304
|
/**
|
307
305
|
* 查询数据中是否包含rowKey
|
308
306
|
*/
|
309
|
-
var
|
307
|
+
export var hasRowKey = function hasRowKey(obj) {
|
310
308
|
if (_typeof(obj) !== 'object' || obj === null) {
|
311
309
|
return false;
|
312
310
|
}
|
@@ -316,13 +314,12 @@ var _hasRowKey = function hasRowKey(obj) {
|
|
316
314
|
return true;
|
317
315
|
}
|
318
316
|
return keys.some(function (key) {
|
319
|
-
return
|
317
|
+
return hasRowKey(obj[key]);
|
320
318
|
});
|
321
319
|
};
|
322
320
|
/**
|
323
321
|
* 查询数据中是否包含rowKey
|
324
322
|
*/
|
325
|
-
export { _hasRowKey as hasRowKey };
|
326
323
|
export var view = function view(obj) {
|
327
324
|
if (_typeof(obj) !== 'object' || obj === null) {
|
328
325
|
return false;
|
@@ -333,7 +330,7 @@ export var view = function view(obj) {
|
|
333
330
|
return true;
|
334
331
|
}
|
335
332
|
return keys.some(function (key) {
|
336
|
-
return
|
333
|
+
return hasRowKey(obj[key]);
|
337
334
|
});
|
338
335
|
};
|
339
336
|
/**
|
@@ -369,7 +366,7 @@ export var deleteForPath = function deleteForPath(values, namePath) {
|
|
369
366
|
* @param value 选中值
|
370
367
|
* @returns {}
|
371
368
|
*/
|
372
|
-
var
|
369
|
+
export var findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
373
370
|
if (isObject(value)) {
|
374
371
|
return value;
|
375
372
|
}
|
@@ -379,7 +376,7 @@ var _findOptionByValue = function findOptionByValue(treeData, value, fieldNames)
|
|
379
376
|
return omit(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
380
377
|
}
|
381
378
|
if (node.children) {
|
382
|
-
var foundNode =
|
379
|
+
var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
383
380
|
if (foundNode) {
|
384
381
|
return omit(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
385
382
|
}
|
@@ -389,7 +386,6 @@ var _findOptionByValue = function findOptionByValue(treeData, value, fieldNames)
|
|
389
386
|
/**
|
390
387
|
* 对比依赖列表中的 值是否变更
|
391
388
|
*/
|
392
|
-
export { _findOptionByValue as findOptionByValue };
|
393
389
|
export var equalDependencies = function equalDependencies(dependencies, prevValues, currentValues) {
|
394
390
|
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
395
391
|
return dependencies.some(function (namePath) {
|
@@ -47,7 +47,7 @@ export var useForm = function useForm(originForm, options) {
|
|
47
47
|
return getFieldsValue(nameList, filterFunc);
|
48
48
|
};
|
49
49
|
var _validateFields = /*#__PURE__*/function () {
|
50
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
|
50
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
|
51
51
|
var _rest$,
|
52
52
|
_len,
|
53
53
|
rest,
|
@@ -21,7 +21,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
21
21
|
fieldProps = props.fieldProps,
|
22
22
|
component = props.component,
|
23
23
|
originComponent = props.originComponent,
|
24
|
-
type = props.type
|
24
|
+
type = props.type,
|
25
|
+
desensitization = props.desensitization;
|
25
26
|
var _shouldUpdate = formItemProps.shouldUpdate,
|
26
27
|
name = formItemProps.name,
|
27
28
|
clearNotShow = formItemProps.clearNotShow,
|
@@ -38,13 +39,14 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
38
39
|
var fieldPropsRef = useRef();
|
39
40
|
var originComponentRef = useRef();
|
40
41
|
var dependNamesRef = useRef();
|
42
|
+
var desensitizationRef = useRef();
|
41
43
|
var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
|
42
44
|
var _useState = useState({}),
|
43
45
|
_useState2 = _slicedToArray(_useState, 2),
|
44
46
|
reRender = _useState2[1];
|
45
47
|
var values = {};
|
46
48
|
// 不是动态函数直接返回
|
47
|
-
if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent)) {
|
49
|
+
if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent) && !isFunction(desensitization)) {
|
48
50
|
return {
|
49
51
|
shouldUpdate: _shouldUpdate,
|
50
52
|
show: show,
|
@@ -52,7 +54,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
52
54
|
required: required,
|
53
55
|
rules: rules,
|
54
56
|
fieldProps: fieldProps,
|
55
|
-
component: newComponent
|
57
|
+
component: newComponent,
|
58
|
+
desensitization: desensitization
|
56
59
|
};
|
57
60
|
}
|
58
61
|
if (namePath) {
|
@@ -70,6 +73,15 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
70
73
|
} else {
|
71
74
|
showRef.current = show;
|
72
75
|
}
|
76
|
+
if (isFunction(desensitization)) {
|
77
|
+
desensitizationRef.current = desensitization(values, {
|
78
|
+
form: form,
|
79
|
+
index: index,
|
80
|
+
namePath: namePath
|
81
|
+
});
|
82
|
+
} else {
|
83
|
+
desensitizationRef.current = desensitization;
|
84
|
+
}
|
73
85
|
if (isFunction(disabled)) {
|
74
86
|
// RangePicker返回数组时,特殊处理
|
75
87
|
if (['Group', 'RangePicker', 'ProCascader'].includes(type) && Array.isArray(disabled(values, {
|
@@ -176,6 +188,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
176
188
|
index: index,
|
177
189
|
namePath: namePath
|
178
190
|
}) : fieldProps;
|
191
|
+
var _desensitization = isFunction(desensitization) ? desensitization(_currentValues, {
|
192
|
+
form: form,
|
193
|
+
index: index,
|
194
|
+
namePath: namePath
|
195
|
+
}) : desensitization;
|
179
196
|
// 清值防抖 多次刷新时以最后一次为准
|
180
197
|
if (clearNotShow !== false && (name || names) && !isDeleteLine(form, namePath)) {
|
181
198
|
// 当show为其他变为false的时候记录一次需要清值
|
@@ -201,13 +218,15 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
201
218
|
}
|
202
219
|
var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
|
203
220
|
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
|
204
|
-
|
221
|
+
var desensitizationRes = isEqualWith(desensitizationRef.current, _desensitization);
|
222
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes || !desensitizationRes || (_fieldProps === null || _fieldProps === void 0 ? void 0 : _fieldProps.transformResponse) // 防止fieldProps变更时,transformResponse根据fieldProps新值无法触发更新
|
205
223
|
) {
|
206
224
|
showRef.current = _show;
|
207
225
|
disabledRef.current = _disabled;
|
208
226
|
requiredRef.current = _required;
|
209
227
|
rulesRef.current = _rules;
|
210
228
|
fieldPropsRef.current = _fieldProps;
|
229
|
+
desensitizationRef.current = _desensitization;
|
211
230
|
reRender({});
|
212
231
|
return false;
|
213
232
|
}
|
@@ -224,7 +243,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
224
243
|
rules: rulesRef.current,
|
225
244
|
required: requiredRef.current,
|
226
245
|
component: originComponentRef.current,
|
227
|
-
fieldProps: fieldPropsRef.current
|
246
|
+
fieldProps: fieldPropsRef.current,
|
247
|
+
desensitization: desensitizationRef.current
|
228
248
|
};
|
229
249
|
};
|
230
250
|
export default useShouldUpdate;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/** 脱敏处理函数 */
|
2
|
+
export declare const maskStringRangeWithRegex: (input: string, range: [number, number]) => string;
|
1
3
|
declare const _default: {
|
2
4
|
/** 年月日 */
|
3
5
|
date: ({ type, toISOString, toCSTString, mode }: {
|
@@ -64,5 +66,13 @@ declare const _default: {
|
|
64
66
|
value: any;
|
65
67
|
};
|
66
68
|
};
|
69
|
+
/** 脱敏 转换 */
|
70
|
+
desensitization: ({ desensitization }: {
|
71
|
+
desensitization: any;
|
72
|
+
}) => {
|
73
|
+
getValueProps: (value: any) => {
|
74
|
+
value: any;
|
75
|
+
};
|
76
|
+
};
|
67
77
|
};
|
68
78
|
export default _default;
|