@zat-design/sisyphus-react 3.8.2-beta.2 → 3.8.2-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/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +4 -2
- package/es/ProForm/components/combination/Group/index.js +6 -3
- package/es/ProForm/components/render/Render.js +1 -1
- package/es/ProForm/components/render/propsType.d.ts +4 -0
- package/es/ProForm/utils/useShouldUpdate.js +21 -6
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +4 -2
- package/lib/ProForm/components/combination/Group/index.js +6 -3
- package/lib/ProForm/components/render/Render.js +1 -1
- package/lib/ProForm/components/render/propsType.d.ts +4 -0
- package/lib/ProForm/utils/useShouldUpdate.js +19 -4
- package/package.json +3 -2
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
- package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
- package/coverage/lcov-report/src/.umi/core/index.html +0 -206
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
- package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
- package/coverage/lcov-report/src/.umi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
- package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType"];
|
|
4
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
|
|
@@ -41,6 +41,7 @@ var ComRender = function ComRender(props) {
|
|
|
41
41
|
_props$valuePropName = props.valuePropName,
|
|
42
42
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
43
43
|
valueType = props.valueType,
|
|
44
|
+
isView = props.isView,
|
|
44
45
|
rest = _objectWithoutProperties(props, _excluded);
|
|
45
46
|
var TypeComponent = componentMap[type];
|
|
46
47
|
var mergedGetValueProps = getValueProps || function (val) {
|
|
@@ -53,7 +54,8 @@ var ComRender = function ComRender(props) {
|
|
|
53
54
|
return _jsx(FieldProvider, {
|
|
54
55
|
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
|
55
56
|
valueType: valueType,
|
|
56
|
-
type: type
|
|
57
|
+
type: type,
|
|
58
|
+
isView: isView
|
|
57
59
|
}),
|
|
58
60
|
children: Com
|
|
59
61
|
});
|
|
@@ -27,7 +27,8 @@ var Group = function Group(props) {
|
|
|
27
27
|
onChange = props.onChange,
|
|
28
28
|
otherProps = props.otherProps,
|
|
29
29
|
disabled = props.disabled,
|
|
30
|
-
id = props.id
|
|
30
|
+
id = props.id,
|
|
31
|
+
isView = props.isView;
|
|
31
32
|
var contextProps = ProForm.useFieldProps() || {};
|
|
32
33
|
var names = contextProps.names,
|
|
33
34
|
name = contextProps.name,
|
|
@@ -70,7 +71,8 @@ var Group = function Group(props) {
|
|
|
70
71
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? _jsx(_Space.Compact, {
|
|
71
72
|
children: columns.map(function (column, index) {
|
|
72
73
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
|
73
|
-
contextProps: contextProps
|
|
74
|
+
contextProps: contextProps,
|
|
75
|
+
isView: isView
|
|
74
76
|
}, column), {}, {
|
|
75
77
|
otherProps: otherProps
|
|
76
78
|
}), column.name);
|
|
@@ -80,7 +82,8 @@ var Group = function Group(props) {
|
|
|
80
82
|
}, omit(space, ['separator', 'compact'])), {}, {
|
|
81
83
|
children: columns.map(function (column, index) {
|
|
82
84
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
|
83
|
-
contextProps: contextProps
|
|
85
|
+
contextProps: contextProps,
|
|
86
|
+
isView: isView
|
|
84
87
|
}, column), {}, {
|
|
85
88
|
otherProps: otherProps
|
|
86
89
|
}), column.name);
|
|
@@ -155,7 +155,7 @@ var Render = function Render(props) {
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
/** 移除多余参数,防止透传给formItem报错 */
|
|
158
|
-
var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow']);
|
|
158
|
+
var _otherFormItemProps = omit(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames']);
|
|
159
159
|
/**
|
|
160
160
|
* globalControl 全局控制优先
|
|
161
161
|
* globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
|
|
@@ -182,6 +182,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
182
182
|
}) => React.ReactElement<any, any> | string | undefined | null;
|
|
183
183
|
viewType?: ViewType;
|
|
184
184
|
colProps?: ColProps;
|
|
185
|
+
/** 依赖刷新字段列表 */
|
|
186
|
+
dependNames?: NamePath[];
|
|
185
187
|
/**
|
|
186
188
|
* @description 表单item的props属性
|
|
187
189
|
* @deprecated 将于下个版本 4.0.0 被弃用
|
|
@@ -190,6 +192,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
190
192
|
formItemProps?: FormItemProps<Values> & {
|
|
191
193
|
index?: number;
|
|
192
194
|
namePath?: NamePath;
|
|
195
|
+
/** 依赖刷新字段列表 */
|
|
196
|
+
dependNames?: NamePath[];
|
|
193
197
|
};
|
|
194
198
|
/**
|
|
195
199
|
* @description 表单props属性
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
|
-
import { isFunction, isEqualWith } from 'lodash';
|
|
4
|
-
import { customEqualForFun
|
|
3
|
+
import { isFunction, isEqualWith, get } from 'lodash';
|
|
4
|
+
import { customEqualForFun } from './index';
|
|
5
5
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
|
6
6
|
var useShouldUpdate = function useShouldUpdate(props) {
|
|
7
7
|
var show = props.show,
|
|
@@ -20,7 +20,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
20
20
|
index = formItemProps.index,
|
|
21
21
|
namePath = formItemProps.namePath,
|
|
22
22
|
names = formItemProps.names,
|
|
23
|
-
|
|
23
|
+
dependNames = formItemProps.dependNames;
|
|
24
24
|
var timerRef = useRef();
|
|
25
25
|
var needClear = useRef(); // 是否需要执行清值操作
|
|
26
26
|
var showRef = useRef();
|
|
@@ -29,13 +29,14 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
29
29
|
var rulesRef = useRef();
|
|
30
30
|
var fieldPropsRef = useRef();
|
|
31
31
|
var originComponentRef = useRef();
|
|
32
|
+
var dependNamesRef = useRef();
|
|
32
33
|
var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
|
|
33
34
|
var _useState = useState({}),
|
|
34
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
36
|
reRender = _useState2[1];
|
|
36
37
|
var values = {};
|
|
37
38
|
// 不是动态函数直接返回
|
|
38
|
-
if (!isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent)) {
|
|
39
|
+
if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !isFunction(show) && !isFunction(disabled) && !isFunction(required) && !isFunction(rules) && !isFunction(fieldProps) && !isFunction(originComponent)) {
|
|
39
40
|
return {
|
|
40
41
|
shouldUpdate: _shouldUpdate,
|
|
41
42
|
show: show,
|
|
@@ -119,9 +120,22 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
119
120
|
} else {
|
|
120
121
|
fieldPropsRef.current = fieldProps;
|
|
121
122
|
}
|
|
123
|
+
if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
|
|
124
|
+
dependNamesRef.current = dependNames.map(function (name) {
|
|
125
|
+
return get(values, name);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
122
128
|
return {
|
|
123
129
|
shouldUpdate: function shouldUpdate(prevValues, currentValues) {
|
|
124
130
|
// @ts-ignore formList场景取当前行数据,不取shouldUpdate变更后值
|
|
131
|
+
if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
|
|
132
|
+
var curDependNamesValue = dependNames.map(function (name) {
|
|
133
|
+
return get(currentValues, name);
|
|
134
|
+
});
|
|
135
|
+
var dependNamesChanged = !isEqualWith(dependNamesRef.current, curDependNamesValue, customEqualForFun);
|
|
136
|
+
dependNamesRef.current = curDependNamesValue;
|
|
137
|
+
if (!dependNamesChanged) return false;
|
|
138
|
+
}
|
|
125
139
|
var _currentValues;
|
|
126
140
|
if (namePath) {
|
|
127
141
|
// formList场景values取当前行数据
|
|
@@ -182,11 +196,12 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
182
196
|
}
|
|
183
197
|
var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
|
|
184
198
|
var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
|
|
185
|
-
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
|
|
199
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
|
|
186
200
|
// 值变更,需要同步更新函数式的fieldProps
|
|
187
201
|
// (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
|
|
188
202
|
// !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
|
|
189
|
-
equalDependencies(dependencies, prevValues, _currentValues)
|
|
203
|
+
// equalDependencies(dependencies, prevValues, _currentValues)
|
|
204
|
+
) {
|
|
190
205
|
showRef.current = _show;
|
|
191
206
|
disabledRef.current = _disabled;
|
|
192
207
|
requiredRef.current = _required;
|
|
@@ -15,7 +15,7 @@ var _ConfirmWrapper = _interopRequireDefault(require("../../../../components/ren
|
|
|
15
15
|
var _useFieldProps = require("../../../../utils/useFieldProps");
|
|
16
16
|
var componentMap = _interopRequireWildcard(require("../../../../../index"));
|
|
17
17
|
var _AddonWrapper = _interopRequireDefault(require("./AddonWrapper"));
|
|
18
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType"];
|
|
18
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
|
19
19
|
// 这里的key与组件内参数一致, 决定使用哪个包裹组件
|
|
20
20
|
var wrapperMap = {
|
|
21
21
|
confirm: _ConfirmWrapper.default,
|
|
@@ -49,6 +49,7 @@ var ComRender = function ComRender(props) {
|
|
|
49
49
|
_props$valuePropName = props.valuePropName,
|
|
50
50
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
51
51
|
valueType = props.valueType,
|
|
52
|
+
isView = props.isView,
|
|
52
53
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
53
54
|
var TypeComponent = componentMap[type];
|
|
54
55
|
var mergedGetValueProps = getValueProps || function (val) {
|
|
@@ -61,7 +62,8 @@ var ComRender = function ComRender(props) {
|
|
|
61
62
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
62
63
|
value: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, contextProps), {}, {
|
|
63
64
|
valueType: valueType,
|
|
64
|
-
type: type
|
|
65
|
+
type: type,
|
|
66
|
+
isView: isView
|
|
65
67
|
}),
|
|
66
68
|
children: Com
|
|
67
69
|
});
|
|
@@ -33,7 +33,8 @@ var Group = function Group(props) {
|
|
|
33
33
|
onChange = props.onChange,
|
|
34
34
|
otherProps = props.otherProps,
|
|
35
35
|
disabled = props.disabled,
|
|
36
|
-
id = props.id
|
|
36
|
+
id = props.id,
|
|
37
|
+
isView = props.isView;
|
|
37
38
|
var contextProps = _ProForm.default.useFieldProps() || {};
|
|
38
39
|
var names = contextProps.names,
|
|
39
40
|
name = contextProps.name,
|
|
@@ -76,7 +77,8 @@ var Group = function Group(props) {
|
|
|
76
77
|
children: space.compact || (space === null || space === void 0 ? void 0 : space.separator) ? (0, _jsxRuntime.jsx)(_antd.Space.Compact, {
|
|
77
78
|
children: columns.map(function (column, index) {
|
|
78
79
|
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
79
|
-
contextProps: contextProps
|
|
80
|
+
contextProps: contextProps,
|
|
81
|
+
isView: isView
|
|
80
82
|
}, column), {}, {
|
|
81
83
|
otherProps: otherProps
|
|
82
84
|
}), column.name);
|
|
@@ -86,7 +88,8 @@ var Group = function Group(props) {
|
|
|
86
88
|
}, (0, _lodash.omit)(space, ['separator', 'compact'])), {}, {
|
|
87
89
|
children: columns.map(function (column, index) {
|
|
88
90
|
return (0, _jsxRuntime.jsx)(_ComRender.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
89
|
-
contextProps: contextProps
|
|
91
|
+
contextProps: contextProps,
|
|
92
|
+
isView: isView
|
|
90
93
|
}, column), {}, {
|
|
91
94
|
otherProps: otherProps
|
|
92
95
|
}), column.name);
|
|
@@ -155,7 +155,7 @@ var Render = function Render(props) {
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
/** 移除多余参数,防止透传给formItem报错 */
|
|
158
|
-
var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow']);
|
|
158
|
+
var _otherFormItemProps = (0, _lodash.omit)(otherFormItemProps, ['component', 'names', 'format', 'toISOString', 'toCSTString', 'switchValue', 'precision', 'clearNotShow', 'dependNames']);
|
|
159
159
|
/**
|
|
160
160
|
* globalControl 全局控制优先
|
|
161
161
|
* globalControl true时,优先级 全局【formDisabled】> formitem上【column.disabled】 > 组件上【fieldProps.disabled】
|
|
@@ -182,6 +182,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
182
182
|
}) => React.ReactElement<any, any> | string | undefined | null;
|
|
183
183
|
viewType?: ViewType;
|
|
184
184
|
colProps?: ColProps;
|
|
185
|
+
/** 依赖刷新字段列表 */
|
|
186
|
+
dependNames?: NamePath[];
|
|
185
187
|
/**
|
|
186
188
|
* @description 表单item的props属性
|
|
187
189
|
* @deprecated 将于下个版本 4.0.0 被弃用
|
|
@@ -190,6 +192,8 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
190
192
|
formItemProps?: FormItemProps<Values> & {
|
|
191
193
|
index?: number;
|
|
192
194
|
namePath?: NamePath;
|
|
195
|
+
/** 依赖刷新字段列表 */
|
|
196
|
+
dependNames?: NamePath[];
|
|
193
197
|
};
|
|
194
198
|
/**
|
|
195
199
|
* @description 表单props属性
|
|
@@ -27,7 +27,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
27
27
|
index = formItemProps.index,
|
|
28
28
|
namePath = formItemProps.namePath,
|
|
29
29
|
names = formItemProps.names,
|
|
30
|
-
|
|
30
|
+
dependNames = formItemProps.dependNames;
|
|
31
31
|
var timerRef = (0, _react.useRef)();
|
|
32
32
|
var needClear = (0, _react.useRef)(); // 是否需要执行清值操作
|
|
33
33
|
var showRef = (0, _react.useRef)();
|
|
@@ -36,13 +36,14 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
36
36
|
var rulesRef = (0, _react.useRef)();
|
|
37
37
|
var fieldPropsRef = (0, _react.useRef)();
|
|
38
38
|
var originComponentRef = (0, _react.useRef)();
|
|
39
|
+
var dependNamesRef = (0, _react.useRef)();
|
|
39
40
|
var newComponent = originComponent || component; // 解决component默认赋值污染问题,需要使用originComponent
|
|
40
41
|
var _useState = (0, _react.useState)({}),
|
|
41
42
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
43
|
reRender = _useState2[1];
|
|
43
44
|
var values = {};
|
|
44
45
|
// 不是动态函数直接返回
|
|
45
|
-
if (!(0, _lodash.isFunction)(show) && !(0, _lodash.isFunction)(disabled) && !(0, _lodash.isFunction)(required) && !(0, _lodash.isFunction)(rules) && !(0, _lodash.isFunction)(fieldProps) && !(0, _lodash.isFunction)(originComponent)) {
|
|
46
|
+
if (!(dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) && !(0, _lodash.isFunction)(show) && !(0, _lodash.isFunction)(disabled) && !(0, _lodash.isFunction)(required) && !(0, _lodash.isFunction)(rules) && !(0, _lodash.isFunction)(fieldProps) && !(0, _lodash.isFunction)(originComponent)) {
|
|
46
47
|
return {
|
|
47
48
|
shouldUpdate: _shouldUpdate,
|
|
48
49
|
show: show,
|
|
@@ -126,9 +127,22 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
126
127
|
} else {
|
|
127
128
|
fieldPropsRef.current = fieldProps;
|
|
128
129
|
}
|
|
130
|
+
if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
|
|
131
|
+
dependNamesRef.current = dependNames.map(function (name) {
|
|
132
|
+
return (0, _lodash.get)(values, name);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
129
135
|
return {
|
|
130
136
|
shouldUpdate: function shouldUpdate(prevValues, currentValues) {
|
|
131
137
|
// @ts-ignore formList场景取当前行数据,不取shouldUpdate变更后值
|
|
138
|
+
if (dependNames === null || dependNames === void 0 ? void 0 : dependNames.length) {
|
|
139
|
+
var curDependNamesValue = dependNames.map(function (name) {
|
|
140
|
+
return (0, _lodash.get)(currentValues, name);
|
|
141
|
+
});
|
|
142
|
+
var dependNamesChanged = !(0, _lodash.isEqualWith)(dependNamesRef.current, curDependNamesValue, _index.customEqualForFun);
|
|
143
|
+
dependNamesRef.current = curDependNamesValue;
|
|
144
|
+
if (!dependNamesChanged) return false;
|
|
145
|
+
}
|
|
132
146
|
var _currentValues;
|
|
133
147
|
if (namePath) {
|
|
134
148
|
// formList场景values取当前行数据
|
|
@@ -189,11 +203,12 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
189
203
|
}
|
|
190
204
|
var equalRes = (0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun);
|
|
191
205
|
var proEqualRes = (0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun);
|
|
192
|
-
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
|
|
206
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes
|
|
193
207
|
// 值变更,需要同步更新函数式的fieldProps
|
|
194
208
|
// (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
|
|
195
209
|
// !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
|
|
196
|
-
|
|
210
|
+
// equalDependencies(dependencies, prevValues, _currentValues)
|
|
211
|
+
) {
|
|
197
212
|
showRef.current = _show;
|
|
198
213
|
disabledRef.current = _disabled;
|
|
199
214
|
requiredRef.current = _required;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "3.8.2-beta.
|
|
3
|
+
"version": "3.8.2-beta.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"Android >= 4"
|
|
50
50
|
],
|
|
51
51
|
"resolutions": {
|
|
52
|
-
"@types/react": "^17.0.53"
|
|
52
|
+
"@types/react": "^17.0.53",
|
|
53
|
+
"mockjs/commander": "9.2.0"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@ant-design/icons": "^4.2.2",
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for src/.umi/core/devScripts.ts</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../../../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../../../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/.umi/core</a> devScripts.ts</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">0% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/18</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">0% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/15</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">0% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>0/5</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">0% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/18</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line low'></div>
|
|
65
|
-
<pre><table class="coverage">
|
|
66
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
-
<a name='L27'></a><a href='#L27'>27</a>
|
|
93
|
-
<a name='L28'></a><a href='#L28'>28</a>
|
|
94
|
-
<a name='L29'></a><a href='#L29'>29</a>
|
|
95
|
-
<a name='L30'></a><a href='#L30'>30</a>
|
|
96
|
-
<a name='L31'></a><a href='#L31'>31</a>
|
|
97
|
-
<a name='L32'></a><a href='#L32'>32</a>
|
|
98
|
-
<a name='L33'></a><a href='#L33'>33</a>
|
|
99
|
-
<a name='L34'></a><a href='#L34'>34</a>
|
|
100
|
-
<a name='L35'></a><a href='#L35'>35</a>
|
|
101
|
-
<a name='L36'></a><a href='#L36'>36</a>
|
|
102
|
-
<a name='L37'></a><a href='#L37'>37</a>
|
|
103
|
-
<a name='L38'></a><a href='#L38'>38</a>
|
|
104
|
-
<a name='L39'></a><a href='#L39'>39</a>
|
|
105
|
-
<a name='L40'></a><a href='#L40'>40</a>
|
|
106
|
-
<a name='L41'></a><a href='#L41'>41</a>
|
|
107
|
-
<a name='L42'></a><a href='#L42'>42</a>
|
|
108
|
-
<a name='L43'></a><a href='#L43'>43</a>
|
|
109
|
-
<a name='L44'></a><a href='#L44'>44</a>
|
|
110
|
-
<a name='L45'></a><a href='#L45'>45</a>
|
|
111
|
-
<a name='L46'></a><a href='#L46'>46</a>
|
|
112
|
-
<a name='L47'></a><a href='#L47'>47</a>
|
|
113
|
-
<a name='L48'></a><a href='#L48'>48</a>
|
|
114
|
-
<a name='L49'></a><a href='#L49'>49</a>
|
|
115
|
-
<a name='L50'></a><a href='#L50'>50</a>
|
|
116
|
-
<a name='L51'></a><a href='#L51'>51</a>
|
|
117
|
-
<a name='L52'></a><a href='#L52'>52</a>
|
|
118
|
-
<a name='L53'></a><a href='#L53'>53</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
119
|
-
<span class="cline-any cline-neutral"> </span>
|
|
120
|
-
<span class="cline-any cline-no"> </span>
|
|
121
|
-
<span class="cline-any cline-neutral"> </span>
|
|
122
|
-
<span class="cline-any cline-neutral"> </span>
|
|
123
|
-
<span class="cline-any cline-no"> </span>
|
|
124
|
-
<span class="cline-any cline-no"> </span>
|
|
125
|
-
<span class="cline-any cline-no"> </span>
|
|
126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
127
|
-
<span class="cline-any cline-neutral"> </span>
|
|
128
|
-
<span class="cline-any cline-neutral"> </span>
|
|
129
|
-
<span class="cline-any cline-neutral"> </span>
|
|
130
|
-
<span class="cline-any cline-no"> </span>
|
|
131
|
-
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-neutral"> </span>
|
|
133
|
-
<span class="cline-any cline-neutral"> </span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span>
|
|
135
|
-
<span class="cline-any cline-no"> </span>
|
|
136
|
-
<span class="cline-any cline-no"> </span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-neutral"> </span>
|
|
139
|
-
<span class="cline-any cline-neutral"> </span>
|
|
140
|
-
<span class="cline-any cline-no"> </span>
|
|
141
|
-
<span class="cline-any cline-no"> </span>
|
|
142
|
-
<span class="cline-any cline-no"> </span>
|
|
143
|
-
<span class="cline-any cline-neutral"> </span>
|
|
144
|
-
<span class="cline-any cline-neutral"> </span>
|
|
145
|
-
<span class="cline-any cline-no"> </span>
|
|
146
|
-
<span class="cline-any cline-neutral"> </span>
|
|
147
|
-
<span class="cline-any cline-no"> </span>
|
|
148
|
-
<span class="cline-any cline-neutral"> </span>
|
|
149
|
-
<span class="cline-any cline-no"> </span>
|
|
150
|
-
<span class="cline-any cline-neutral"> </span>
|
|
151
|
-
<span class="cline-any cline-neutral"> </span>
|
|
152
|
-
<span class="cline-any cline-neutral"> </span>
|
|
153
|
-
<span class="cline-any cline-neutral"> </span>
|
|
154
|
-
<span class="cline-any cline-no"> </span>
|
|
155
|
-
<span class="cline-any cline-neutral"> </span>
|
|
156
|
-
<span class="cline-any cline-no"> </span>
|
|
157
|
-
<span class="cline-any cline-neutral"> </span>
|
|
158
|
-
<span class="cline-any cline-neutral"> </span>
|
|
159
|
-
<span class="cline-any cline-no"> </span>
|
|
160
|
-
<span class="cline-any cline-neutral"> </span>
|
|
161
|
-
<span class="cline-any cline-neutral"> </span>
|
|
162
|
-
<span class="cline-any cline-neutral"> </span>
|
|
163
|
-
<span class="cline-any cline-neutral"> </span>
|
|
164
|
-
<span class="cline-any cline-no"> </span>
|
|
165
|
-
<span class="cline-any cline-neutral"> </span>
|
|
166
|
-
<span class="cline-any cline-neutral"> </span>
|
|
167
|
-
<span class="cline-any cline-neutral"> </span>
|
|
168
|
-
<span class="cline-any cline-neutral"> </span>
|
|
169
|
-
<span class="cline-any cline-no"> </span>
|
|
170
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// @ts-nocheck
|
|
171
|
-
|
|
172
|
-
<span class="cstat-no" title="statement not covered" >if (window.g_initWebpackHotDevClient) {</span>
|
|
173
|
-
function <span class="fstat-no" title="function not covered" >tryApplyUpdates(</span>onHotUpdateSuccess?: Function) {
|
|
174
|
-
// @ts-ignore
|
|
175
|
-
<span class="cstat-no" title="statement not covered" > if (!module.hot) {</span>
|
|
176
|
-
<span class="cstat-no" title="statement not covered" > window.location.reload();</span>
|
|
177
|
-
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function <span class="fstat-no" title="function not covered" >isUpdateAvailable(</span>) {
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
<span class="cstat-no" title="statement not covered" > return window.g_getMostRecentCompilationHash() !== __webpack_hash__;</span>
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// TODO: is update available?
|
|
186
|
-
// @ts-ignore
|
|
187
|
-
<span class="cstat-no" title="statement not covered" > if (!isUpdateAvailable() || module.hot.status() !== 'idle') {</span>
|
|
188
|
-
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function <span class="fstat-no" title="function not covered" >handleApplyUpdates(</span>err: Error | null, updatedModules: any) {
|
|
192
|
-
<span class="cstat-no" title="statement not covered" > if (err || !updatedModules || window.g_getHadRuntimeError()) {</span>
|
|
193
|
-
<span class="cstat-no" title="statement not covered" > window.location.reload();</span>
|
|
194
|
-
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
<span class="cstat-no" title="statement not covered" > onHotUpdateSuccess?.();</span>
|
|
198
|
-
|
|
199
|
-
<span class="cstat-no" title="statement not covered" > if (isUpdateAvailable()) {</span>
|
|
200
|
-
// While we were updating, there was a new update! Do it again.
|
|
201
|
-
<span class="cstat-no" title="statement not covered" > tryApplyUpdates();</span>
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// @ts-ignore
|
|
206
|
-
<span class="cstat-no" title="statement not covered" > module.hot.check(true).then(</span>
|
|
207
|
-
<span class="fstat-no" title="function not covered" > fu</span>nction (updatedModules: any) {
|
|
208
|
-
<span class="cstat-no" title="statement not covered" > handleApplyUpdates(null, updatedModules);</span>
|
|
209
|
-
},
|
|
210
|
-
<span class="fstat-no" title="function not covered" > fu</span>nction (err: Error) {
|
|
211
|
-
<span class="cstat-no" title="statement not covered" > handleApplyUpdates(err, null);</span>
|
|
212
|
-
},
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
<span class="cstat-no" title="statement not covered" > window.g_initWebpackHotDevClient({</span>
|
|
217
|
-
tryApplyUpdates,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export const __mfsu = <span class="cstat-no" title="statement not covered" >1;</span>
|
|
222
|
-
</pre></td></tr></table></pre>
|
|
223
|
-
|
|
224
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
225
|
-
</div><!-- /wrapper -->
|
|
226
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
227
|
-
Code coverage generated by
|
|
228
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
229
|
-
at 2024-01-24T02:49:50.075Z
|
|
230
|
-
</div>
|
|
231
|
-
<script src="../../../prettify.js"></script>
|
|
232
|
-
<script>
|
|
233
|
-
window.onload = function () {
|
|
234
|
-
prettyPrint();
|
|
235
|
-
};
|
|
236
|
-
</script>
|
|
237
|
-
<script src="../../../sorter.js"></script>
|
|
238
|
-
<script src="../../../block-navigation.js"></script>
|
|
239
|
-
</body>
|
|
240
|
-
</html>
|
|
241
|
-
|