@zat-design/sisyphus-react 3.4.8 → 3.4.9-beta.1
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 +13 -0
- package/dist/less.esm.css +4 -0
- package/es/ProEditTable/components/RenderField/index.js +1 -1
- package/es/ProEnum/index.js +2 -2
- package/es/ProForm/components/combination/Group/index.js +13 -15
- package/es/ProForm/components/combination/ProModalSelect/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +6 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +68 -33
- package/es/ProForm/index.d.ts +3 -1
- package/es/ProForm/index.js +13 -12
- package/es/ProForm/utils/index.d.ts +3 -1
- package/es/ProForm/utils/index.js +22 -1
- package/es/ProForm/utils/rulesCreator.js +1 -1
- package/es/ProForm/utils/useForm.js +34 -17
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
- package/es/ProLayout/components/ProCollapse/index.js +11 -2
- package/es/ProSelect/index.js +2 -0
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +3 -2
- package/es/ProStep/index.d.ts +1 -1
- package/es/style/theme/antd.less +16 -1
- package/lib/ProEditTable/components/RenderField/index.js +1 -1
- package/lib/ProEnum/index.js +2 -2
- package/lib/ProForm/components/combination/Group/index.js +13 -16
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -3
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +6 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +68 -33
- package/lib/ProForm/index.d.ts +3 -1
- package/lib/ProForm/index.js +14 -13
- package/lib/ProForm/utils/index.d.ts +3 -1
- package/lib/ProForm/utils/index.js +25 -2
- package/lib/ProForm/utils/rulesCreator.js +1 -1
- package/lib/ProForm/utils/useForm.js +34 -17
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
- package/lib/ProLayout/components/ProCollapse/index.js +11 -2
- package/lib/ProSelect/index.js +2 -0
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +3 -2
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/style/theme/antd.less +16 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -11,7 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
var _antd = require("antd");
|
|
14
|
-
var _react =
|
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
14
|
var _lodash = require("lodash");
|
|
16
15
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
17
16
|
var _utils = require("./utils");
|
|
@@ -48,20 +47,18 @@ var GroupCopy = function GroupCopy(props) {
|
|
|
48
47
|
_option.current[index] = option;
|
|
49
48
|
onChange(_value, _option.current);
|
|
50
49
|
};
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return (0, _utils.insertSeparator)(columnsProps, space);
|
|
64
|
-
}, [name, value, children, space, names, namePath, index]);
|
|
50
|
+
var columnsProps = (0, _utils.transformColumns)({
|
|
51
|
+
columns: children,
|
|
52
|
+
name: name,
|
|
53
|
+
names: names,
|
|
54
|
+
onChange: handleChange,
|
|
55
|
+
namePath: namePath,
|
|
56
|
+
form: form,
|
|
57
|
+
index: index,
|
|
58
|
+
value: value,
|
|
59
|
+
groupProps: props
|
|
60
|
+
});
|
|
61
|
+
var columns = (0, _utils.insertSeparator)(columnsProps, space);
|
|
65
62
|
var _className = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
66
63
|
'pro-group': true,
|
|
67
64
|
'pro-group-diy-width': columns.some(function (item) {
|
|
@@ -24,7 +24,7 @@ var _Container = _interopRequireDefault(require("../../Container"));
|
|
|
24
24
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
25
25
|
var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
26
26
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
27
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "defaultOne"],
|
|
27
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
28
28
|
_excluded2 = ["onOk"],
|
|
29
29
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
30
30
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -49,6 +49,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
49
49
|
beforeOpen = props.beforeOpen,
|
|
50
50
|
isTooltip = props.isTooltip,
|
|
51
51
|
searchForm = props.searchForm,
|
|
52
|
+
searchKey = props.searchKey,
|
|
52
53
|
defaultOne = props.defaultOne,
|
|
53
54
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
54
55
|
var contentForm = _antd.Form.useFormInstance();
|
|
@@ -600,7 +601,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
600
601
|
nextState.selectedRows = value;
|
|
601
602
|
}
|
|
602
603
|
} else if (value) {
|
|
603
|
-
console.log('value', value);
|
|
604
604
|
nextState.selectedRowKeys = [value];
|
|
605
605
|
}
|
|
606
606
|
setState(nextState);
|
|
@@ -693,7 +693,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
693
693
|
},
|
|
694
694
|
onSearch: (0, _lodash.debounce)(function (val) {
|
|
695
695
|
var _useRequest$options10;
|
|
696
|
-
var queryBean = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams), {}, (0, _defineProperty2.default)({}, labelKey, val));
|
|
696
|
+
var queryBean = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams), {}, (0, _defineProperty2.default)({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
|
697
697
|
var params = withPagination ? {
|
|
698
698
|
pageNum: 1,
|
|
699
699
|
pageSize: 50,
|
|
@@ -13,9 +13,14 @@
|
|
|
13
13
|
background: #fff !important;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
.@{ant-prefix}-input-number-status-error:not(.@{ant-prefix}-input-number-disabled):not(
|
|
17
|
+
.@{ant-prefix}-input-number-borderless
|
|
18
|
+
).@{ant-prefix}-input-number {
|
|
19
|
+
border-color: @zaui-danger !important;
|
|
20
|
+
}
|
|
17
21
|
.@{ant-prefix}-input-status-error {
|
|
18
22
|
&.range-split {
|
|
23
|
+
color: @zaui-danger !important;
|
|
19
24
|
border-color: @zaui-danger;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
8
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
13
|
var _lodash = require("lodash");
|
|
@@ -25,40 +27,73 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
25
27
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
26
28
|
var _ProForm$useFieldProp = _index.default.useFieldProps(),
|
|
27
29
|
form = _ProForm$useFieldProp.form;
|
|
28
|
-
var handleChange = function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
var handleChange = /*#__PURE__*/function () {
|
|
31
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
|
|
32
|
+
var _len,
|
|
33
|
+
other,
|
|
34
|
+
_key,
|
|
35
|
+
_value,
|
|
36
|
+
confirmProps,
|
|
37
|
+
_args = arguments;
|
|
38
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
for (_len = _args.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
+
other[_key - 1] = _args[_key];
|
|
43
|
+
}
|
|
44
|
+
_value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
|
|
45
|
+
if (!(0, _lodash.isFunction)(confirm)) {
|
|
46
|
+
_context.next = 8;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
_context.next = 5;
|
|
50
|
+
return confirm(value, form.getFieldsValue(), {
|
|
51
|
+
option: other[0],
|
|
52
|
+
form: form,
|
|
53
|
+
namePath: otherProps.namePath,
|
|
54
|
+
index: otherProps.index
|
|
55
|
+
});
|
|
56
|
+
case 5:
|
|
57
|
+
_context.t0 = _context.sent;
|
|
58
|
+
_context.next = 9;
|
|
59
|
+
break;
|
|
60
|
+
case 8:
|
|
61
|
+
_context.t0 = confirm;
|
|
62
|
+
case 9:
|
|
63
|
+
confirmProps = _context.t0;
|
|
64
|
+
// 只处理 false, true 和 对象的情况
|
|
65
|
+
if (confirmProps === false) {
|
|
66
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
67
|
+
}
|
|
68
|
+
if (confirmProps === true) {
|
|
69
|
+
_antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultConfirmProps), {}, {
|
|
70
|
+
onOk: function onOk() {
|
|
71
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
if ((0, _lodash.isObject)(confirmProps)) {
|
|
76
|
+
_antd.Modal.confirm((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, 'title' in confirmProps || 'content' in confirmProps ? {} : defaultConfirmProps), confirmProps), {}, {
|
|
77
|
+
onOk: function onOk() {
|
|
78
|
+
var _confirmProps$onOk;
|
|
79
|
+
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
80
|
+
arg[_key2] = arguments[_key2];
|
|
81
|
+
}
|
|
82
|
+
(_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
|
|
83
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
case 13:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
43
90
|
}
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _confirmProps$onOk;
|
|
51
|
-
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
52
|
-
arg[_key2] = arguments[_key2];
|
|
53
|
-
}
|
|
54
|
-
(_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
|
|
55
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
56
|
-
}
|
|
57
|
-
}));
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
61
|
-
};
|
|
91
|
+
}, _callee);
|
|
92
|
+
}));
|
|
93
|
+
return function handleChange(_x) {
|
|
94
|
+
return _ref.apply(this, arguments);
|
|
95
|
+
};
|
|
96
|
+
}();
|
|
62
97
|
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
63
98
|
children: /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
64
99
|
// @ts-ignore
|
package/lib/ProForm/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Form, FormInstance } from 'antd';
|
|
2
|
-
import { ForwardRefRenderFunction } from 'react';
|
|
2
|
+
import React, { ForwardRefRenderFunction } from 'react';
|
|
3
|
+
import { FormProviderProps } from 'antd/es/form/context';
|
|
3
4
|
import { ProFormProps } from './propsType';
|
|
4
5
|
interface IProForm<T = any> extends ForwardRefRenderFunction<FormInstance<T>, ProFormProps<T>> {
|
|
5
6
|
useForm: typeof Form.useForm;
|
|
@@ -7,4 +8,5 @@ interface IProForm<T = any> extends ForwardRefRenderFunction<FormInstance<T>, Pr
|
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
}
|
|
9
10
|
declare const ProFormForward: IProForm;
|
|
11
|
+
export declare const ProFormProvider: React.FC<FormProviderProps>;
|
|
10
12
|
export default ProFormForward;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -5,8 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
8
|
+
exports.default = exports.ProFormProvider = void 0;
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -283,30 +282,32 @@ ProFormForward.useWatch = function (watchValue, form) {
|
|
|
283
282
|
}
|
|
284
283
|
return _antd.Form.useWatch([], form);
|
|
285
284
|
};
|
|
286
|
-
var ProFormProvider = function ProFormProvider(props) {
|
|
285
|
+
var ProFormProvider = exports.ProFormProvider = function ProFormProvider(props) {
|
|
287
286
|
var onFormChange = props.onFormChange,
|
|
288
287
|
onFormFinish = props.onFormFinish,
|
|
289
288
|
children = props.children;
|
|
290
|
-
var handleFormChange = function handleFormChange(
|
|
289
|
+
var handleFormChange = function handleFormChange(formName, info) {
|
|
291
290
|
var changedFields = info.changedFields;
|
|
292
291
|
var _changedFields = changedFields.flatMap(function (item) {
|
|
293
|
-
var
|
|
294
|
-
_item$value = item.value,
|
|
292
|
+
var _item$value = item.value,
|
|
295
293
|
value = _item$value === void 0 ? [] : _item$value;
|
|
296
|
-
var
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var
|
|
300
|
-
|
|
294
|
+
var name = item.name;
|
|
295
|
+
var namesStr = name[name.length - 1];
|
|
296
|
+
// name中的最后一位如果包含 '-' 则是names组件
|
|
297
|
+
var isNames = String(namesStr).includes('-');
|
|
298
|
+
if (!isNames) return item; // 不是names组件直接返回
|
|
299
|
+
var namesList = (0, _index.splitNameStr)(String(namesStr)); // 拆解出name列表
|
|
300
|
+
var prefix = name.slice(0, name.length - 1);
|
|
301
|
+
return namesList.map(function (nameItem, index) {
|
|
301
302
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
302
|
-
name:
|
|
303
|
+
name: [].concat((0, _toConsumableArray2.default)(prefix), (0, _toConsumableArray2.default)(nameItem)),
|
|
303
304
|
value: value[index]
|
|
304
305
|
});
|
|
305
306
|
});
|
|
306
307
|
});
|
|
307
308
|
info.changedFields = _changedFields;
|
|
308
309
|
// @ts-ignore
|
|
309
|
-
onFormChange(
|
|
310
|
+
onFormChange(formName, info);
|
|
310
311
|
};
|
|
311
312
|
return (0, _jsxRuntime.jsx)(_antd.Form.Provider, {
|
|
312
313
|
onFormChange: onFormChange ? handleFormChange : undefined,
|
|
@@ -27,7 +27,7 @@ export declare const isTrim: (type: string, trim: boolean, configData: any) => a
|
|
|
27
27
|
export declare const isUpperCase: (type: string, upperCase: boolean) => any;
|
|
28
28
|
export declare const weedOutProps: (data: Record<string, any>, keys: string[]) => {}[];
|
|
29
29
|
export declare const diffField: (prevValues: any, curValues: any, names: NamePath[]) => boolean;
|
|
30
|
-
export declare const splitNameStr: (name: string) =>
|
|
30
|
+
export declare const splitNameStr: (name: string) => string[][];
|
|
31
31
|
export declare const filterInternalFields: (values: any) => any;
|
|
32
32
|
export declare const getAllNamePath: (object: Record<string, any>, currentPath?: InternalNamePath) => InternalNamePath[];
|
|
33
33
|
export declare const isNullValue: (value: any) => boolean;
|
|
@@ -95,4 +95,6 @@ export declare const findOptionByValue: (treeData: any[], value: string | number
|
|
|
95
95
|
export declare const equalDependencies: (dependencies: any, prevValues: any, currentValues: any) => any;
|
|
96
96
|
/** 解析namePath */
|
|
97
97
|
export declare const parseNamePath: (input: string) => any;
|
|
98
|
+
/** 解析namePath */
|
|
99
|
+
export declare function findNamesKeyInArray(arr: string[], key: string): string | null;
|
|
98
100
|
export {};
|
|
@@ -5,7 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.filterInternalFields = exports.equalDependencies = exports.diffField = exports.deleteForPath = exports.customEqualForFun = void 0;
|
|
9
|
+
exports.findNamesKeyInArray = findNamesKeyInArray;
|
|
10
|
+
exports.getAllNamePath = exports.findOptionByValue = void 0;
|
|
9
11
|
exports.getArrayBeforeNumber = getArrayBeforeNumber;
|
|
10
12
|
exports.hasRowKey = exports.getLayout = exports.getDecimalDigits = void 0;
|
|
11
13
|
exports.initialValuesToNames = initialValuesToNames;
|
|
@@ -450,4 +452,25 @@ var parseNamePath = exports.parseNamePath = function parseNamePath(input) {
|
|
|
450
452
|
return (0, _lodash.isNaN)(Number(item)) ? item : Number(item);
|
|
451
453
|
});
|
|
452
454
|
return [result];
|
|
453
|
-
};
|
|
455
|
+
};
|
|
456
|
+
/** 解析namePath */
|
|
457
|
+
function findNamesKeyInArray(arr, key) {
|
|
458
|
+
var _iterator2 = (0, _createForOfIteratorHelper2.default)(arr),
|
|
459
|
+
_step2;
|
|
460
|
+
try {
|
|
461
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
462
|
+
var item = _step2.value;
|
|
463
|
+
if (!item.includes('_')) {
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
if (item.split('_')[0].includes(key)) {
|
|
467
|
+
return item;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
} catch (err) {
|
|
471
|
+
_iterator2.e(err);
|
|
472
|
+
} finally {
|
|
473
|
+
_iterator2.f();
|
|
474
|
+
}
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
@@ -14,7 +14,7 @@ var _locale = _interopRequireWildcard(require("../../locale"));
|
|
|
14
14
|
var getNonEmptyValuesByIndex = function getNonEmptyValuesByIndex(required, valueArray) {
|
|
15
15
|
var result = [];
|
|
16
16
|
required.forEach(function (item, index) {
|
|
17
|
-
if (item && !valueArray[index] && !(0, _lodash.isNumber)(valueArray[index])) {
|
|
17
|
+
if (item && !(valueArray === null || valueArray === void 0 ? void 0 : valueArray[index]) && !(0, _lodash.isNumber)(valueArray === null || valueArray === void 0 ? void 0 : valueArray[index])) {
|
|
18
18
|
result.push(index + 1);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -27,11 +27,15 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
27
27
|
};
|
|
28
28
|
var _validateFields = /*#__PURE__*/function () {
|
|
29
29
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
|
|
30
|
-
var
|
|
30
|
+
var _rest$,
|
|
31
|
+
_len,
|
|
31
32
|
rest,
|
|
32
33
|
_key,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
isRecursive,
|
|
35
|
+
validateNames,
|
|
36
|
+
_form$getInternalHook,
|
|
37
|
+
getFields,
|
|
38
|
+
fieldsList,
|
|
35
39
|
_error$errorFields,
|
|
36
40
|
_error$errorFields$,
|
|
37
41
|
_args = arguments;
|
|
@@ -42,20 +46,33 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
42
46
|
for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
43
47
|
rest[_key - 1] = _args[_key];
|
|
44
48
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_context.next = 7;
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
isRecursive = rest === null || rest === void 0 ? void 0 : (_rest$ = rest[0]) === null || _rest$ === void 0 ? void 0 : _rest$.recursive;
|
|
51
|
+
validateNames = []; // 前缀校验模式
|
|
52
|
+
if (!isRecursive) {
|
|
53
|
+
_context.next = 10;
|
|
51
54
|
break;
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
_form$getInternalHook = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS'), getFields = _form$getInternalHook.getFields;
|
|
58
|
+
fieldsList = getFields();
|
|
59
|
+
fieldsList.forEach(function (item) {
|
|
60
|
+
var _item$name, _item$name2, _item$name2$;
|
|
61
|
+
if (nameList[0] === ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name[0]) || ((_item$name2 = item.name) === null || _item$name2 === void 0 ? void 0 : (_item$name2$ = _item$name2[0]) === null || _item$name2$ === void 0 ? void 0 : _item$name2$.startsWith("".concat(nameList[0], "_")))) {
|
|
62
|
+
validateNames.push(item.name);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
delete rest[0].recursive;
|
|
67
|
+
return _context.abrupt("return", validateFields.apply(void 0, [validateNames].concat(rest)).then(function (values) {
|
|
68
|
+
return (0, _index.filterInternalFields)(values);
|
|
69
|
+
}));
|
|
70
|
+
case 10:
|
|
71
|
+
return _context.abrupt("return", validateFields.apply(void 0, [nameList].concat(rest)).then(function (values) {
|
|
72
|
+
return nameList ? values : _getFieldsValue();
|
|
73
|
+
}));
|
|
74
|
+
case 13:
|
|
75
|
+
_context.prev = 13;
|
|
59
76
|
_context.t0 = _context["catch"](0);
|
|
60
77
|
if (_context.t0 && (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields)) {
|
|
61
78
|
form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$errorFields = _context.t0.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
@@ -64,11 +81,11 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
64
81
|
});
|
|
65
82
|
}
|
|
66
83
|
throw _context.t0;
|
|
67
|
-
case
|
|
84
|
+
case 17:
|
|
68
85
|
case "end":
|
|
69
86
|
return _context.stop();
|
|
70
87
|
}
|
|
71
|
-
}, _callee, null, [[0,
|
|
88
|
+
}, _callee, null, [[0, 13]]);
|
|
72
89
|
}));
|
|
73
90
|
return function _validateFields(_x) {
|
|
74
91
|
return _ref.apply(this, arguments);
|
|
@@ -36,7 +36,9 @@ var ProCollapse = function ProCollapse(props) {
|
|
|
36
36
|
collapseProps = props.collapseProps,
|
|
37
37
|
collapsePanelProps = props.collapsePanelProps,
|
|
38
38
|
className = props.className,
|
|
39
|
-
icon = props.icon
|
|
39
|
+
icon = props.icon,
|
|
40
|
+
_props$autoHeight = props.autoHeight,
|
|
41
|
+
autoHeight = _props$autoHeight === void 0 ? true : _props$autoHeight;
|
|
40
42
|
var cls = (0, _classnames.default)((0, _defineProperty2.default)({
|
|
41
43
|
'pro-collapse': true,
|
|
42
44
|
'pro-collapse-level2': level === '2',
|
|
@@ -116,17 +118,24 @@ var ProCollapse = function ProCollapse(props) {
|
|
|
116
118
|
};
|
|
117
119
|
// 当pro-layout-content只存在一个card时,高度动态计算
|
|
118
120
|
(0, _react.useLayoutEffect)(function () {
|
|
121
|
+
if (!autoHeight) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
119
124
|
var proCollapseContent = document.querySelector('.pro-layout-content');
|
|
120
125
|
if (!proCollapseContent) {
|
|
121
126
|
return;
|
|
122
127
|
}
|
|
123
128
|
var proCollapseNoTitles = proCollapseContent.querySelectorAll('.pro-collapse-no-level1-title');
|
|
129
|
+
var proFooterNode = proCollapseContent.querySelector('.pro-footer');
|
|
124
130
|
var proCollapses = proCollapseContent.querySelectorAll('.pro-collapse');
|
|
125
|
-
if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
|
|
131
|
+
if ((proCollapseNoTitles === null || proCollapseNoTitles === void 0 ? void 0 : proCollapseNoTitles.length) === 1 && proCollapses.length === 1) {
|
|
126
132
|
var rect = proCollapseNoTitles[0].getBoundingClientRect();
|
|
127
133
|
if ((rect === null || rect === void 0 ? void 0 : rect.height) < window.innerHeight - rect.top) {
|
|
128
134
|
proCollapseNoTitles[0].style.minHeight = "calc(100vh - ".concat(rect.top + 16, "px)");
|
|
129
135
|
}
|
|
136
|
+
if (proFooterNode) {
|
|
137
|
+
proCollapseNoTitles[0].style.minHeight = "calc(100vh - ".concat(rect.top + proFooterNode.offsetHeight + 16, "px)");
|
|
138
|
+
}
|
|
130
139
|
}
|
|
131
140
|
return function () {
|
|
132
141
|
if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -270,6 +270,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
270
270
|
return value;
|
|
271
271
|
};
|
|
272
272
|
var newSelectList = selectList;
|
|
273
|
+
console.log('otherProps', otherProps, filterInList);
|
|
274
|
+
debugger;
|
|
273
275
|
if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
|
|
274
276
|
newSelectList = (0, _utils.getSelectList)({
|
|
275
277
|
otherProps: otherProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: ({ children, }: any) => React.DetailedReactHTMLElement<{
|
|
2
|
+
declare const _default: ({ children, delayTime, }: any) => React.DetailedReactHTMLElement<{
|
|
3
3
|
onClick: import("lodash").DebouncedFunc<() => Promise<void>>;
|
|
4
4
|
}, HTMLElement>;
|
|
5
5
|
export default _default;
|
|
@@ -11,7 +11,8 @@ var _lodash = require("lodash");
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _index = require("../../index");
|
|
13
13
|
var _default = exports.default = function _default(_ref) {
|
|
14
|
-
var children = _ref.children
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
delayTime = _ref.delayTime;
|
|
15
16
|
var _useStep = (0, _index.useStep)(),
|
|
16
17
|
notify = _useStep.notify;
|
|
17
18
|
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
@@ -31,7 +32,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
31
32
|
var _children$props, _children$props$onCli;
|
|
32
33
|
children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : (_children$props$onCli = _children$props.onClick) === null || _children$props$onCli === void 0 ? void 0 : _children$props$onCli.call(_children$props, values);
|
|
33
34
|
}
|
|
34
|
-
}, 0);
|
|
35
|
+
}, delayTime !== null && delayTime !== void 0 ? delayTime : 0);
|
|
35
36
|
case 5:
|
|
36
37
|
case "end":
|
|
37
38
|
return _context.stop();
|
package/lib/ProStep/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const ProStep: {
|
|
|
7
7
|
({ children, ...resetProps }: ProStepPropsType): JSX.Element;
|
|
8
8
|
useStep: () => any;
|
|
9
9
|
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItem) => JSX.Element;
|
|
10
|
-
Listener: ({ children, }: any) => import("react").DetailedReactHTMLElement<{
|
|
10
|
+
Listener: ({ children, delayTime, }: any) => import("react").DetailedReactHTMLElement<{
|
|
11
11
|
onClick: import("lodash").DebouncedFunc<() => Promise<void>>;
|
|
12
12
|
}, HTMLElement>;
|
|
13
13
|
};
|
|
@@ -15,6 +15,22 @@
|
|
|
15
15
|
background: transparent;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
.@{ant-prefix}-drawer-body{
|
|
19
|
+
|
|
20
|
+
.@{ant-prefix}-form-item{
|
|
21
|
+
.@{ant-prefix}-form-item-label{
|
|
22
|
+
&.@{ant-prefix}-form-item-label-left{
|
|
23
|
+
& > .@{ant-prefix}-form-item-required::before{
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: calc(50% - 7px);
|
|
26
|
+
left: -8px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
right: inherit;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
18
34
|
|
|
19
35
|
.@{ant-prefix}-form-item {
|
|
20
36
|
&.@{ant-prefix}-form-item-with-help {
|
|
@@ -28,7 +44,6 @@
|
|
|
28
44
|
overflow: initial;
|
|
29
45
|
line-height: 1;
|
|
30
46
|
white-space: pre-wrap;
|
|
31
|
-
|
|
32
47
|
.@{ant-prefix}-form-item-required {
|
|
33
48
|
position: relative;
|
|
34
49
|
&::before {
|