@zat-design/sisyphus-react 3.4.8 → 3.4.9-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 +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/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/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
package/dist/index.esm.css
CHANGED
|
@@ -2255,7 +2255,11 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2255
2255
|
.pro-number-range .range-split.ant-input[disabled] {
|
|
2256
2256
|
background: #fff !important;
|
|
2257
2257
|
}
|
|
2258
|
+
.pro-number-range .ant-input-number-status-error:not(.ant-input-number-disabled):not( .ant-input-number-borderless).ant-input-number {
|
|
2259
|
+
border-color: var(--zaui-danger, #ff5050) !important;
|
|
2260
|
+
}
|
|
2258
2261
|
.pro-number-range .ant-input-status-error.range-split {
|
|
2262
|
+
color: var(--zaui-danger, #ff5050) !important;
|
|
2259
2263
|
border-color: var(--zaui-danger, #ff5050);
|
|
2260
2264
|
}
|
|
2261
2265
|
.pro-number-range .ant-input-rtl.range-right {
|
|
@@ -5163,6 +5167,15 @@ input[type='button'] {
|
|
|
5163
5167
|
.ant-modal .ant-input-textarea-show-count.ant-input-textarea-in-form-item::after {
|
|
5164
5168
|
background: transparent;
|
|
5165
5169
|
}
|
|
5170
|
+
.ant-form .ant-drawer-body .ant-form-item .ant-form-item-label.ant-form-item-label-left > .ant-form-item-required::before,
|
|
5171
|
+
.ant-drawer .ant-drawer-body .ant-form-item .ant-form-item-label.ant-form-item-label-left > .ant-form-item-required::before,
|
|
5172
|
+
.ant-modal .ant-drawer-body .ant-form-item .ant-form-item-label.ant-form-item-label-left > .ant-form-item-required::before {
|
|
5173
|
+
position: absolute;
|
|
5174
|
+
top: calc(50% - 7px);
|
|
5175
|
+
left: -8px;
|
|
5176
|
+
margin: 0;
|
|
5177
|
+
right: inherit;
|
|
5178
|
+
}
|
|
5166
5179
|
.ant-form .ant-form-item.ant-form-item-with-help,
|
|
5167
5180
|
.ant-drawer .ant-form-item.ant-form-item-with-help,
|
|
5168
5181
|
.ant-modal .ant-form-item.ant-form-item-with-help {
|
package/dist/less.esm.css
CHANGED
|
@@ -2255,7 +2255,11 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2255
2255
|
.pro-number-range .range-split.ant-input[disabled] {
|
|
2256
2256
|
background: #fff !important;
|
|
2257
2257
|
}
|
|
2258
|
+
.pro-number-range .ant-input-number-status-error:not(.ant-input-number-disabled):not( .ant-input-number-borderless).ant-input-number {
|
|
2259
|
+
border-color: var(--zaui-danger, #ff5050) !important;
|
|
2260
|
+
}
|
|
2258
2261
|
.pro-number-range .ant-input-status-error.range-split {
|
|
2262
|
+
color: var(--zaui-danger, #ff5050) !important;
|
|
2259
2263
|
border-color: var(--zaui-danger, #ff5050);
|
|
2260
2264
|
}
|
|
2261
2265
|
.pro-number-range .ant-input-rtl.range-right {
|
|
@@ -406,7 +406,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
406
406
|
}
|
|
407
407
|
_args = formatArgs([].concat(args));
|
|
408
408
|
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
|
409
|
-
row =
|
|
409
|
+
row = form.getFieldValue(rowPath, true);
|
|
410
410
|
orgRow = cloneDeep(row);
|
|
411
411
|
_args[1] = row;
|
|
412
412
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
package/es/ProEnum/index.js
CHANGED
|
@@ -41,8 +41,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
41
41
|
enumProps = _objectWithoutProperties(props, _excluded);
|
|
42
42
|
var _ref = otherProps || {},
|
|
43
43
|
isView = _ref.isView,
|
|
44
|
-
viewEmpty = _ref.viewEmpty
|
|
45
|
-
disabled = _ref.disabled;
|
|
44
|
+
viewEmpty = _ref.viewEmpty;
|
|
46
45
|
var _ref2 = useProConfig('ProEnum') || {},
|
|
47
46
|
fieldNames = _ref2.fieldNames,
|
|
48
47
|
_ref2$clear = _ref2.clear,
|
|
@@ -165,6 +164,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
165
164
|
switch (type) {
|
|
166
165
|
case 'ProSelect':
|
|
167
166
|
return _jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
|
|
167
|
+
otherProps: otherProps,
|
|
168
168
|
dataSource: list,
|
|
169
169
|
fieldNames: {
|
|
170
170
|
label: label,
|
|
@@ -4,7 +4,7 @@ import _Space from "antd/es/space";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import React
|
|
7
|
+
import React from 'react';
|
|
8
8
|
import { omit } from 'lodash';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
10
|
import { insertSeparator, transformColumns } from './utils';
|
|
@@ -41,20 +41,18 @@ var GroupCopy = function GroupCopy(props) {
|
|
|
41
41
|
_option.current[index] = option;
|
|
42
42
|
onChange(_value, _option.current);
|
|
43
43
|
};
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return insertSeparator(columnsProps, space);
|
|
57
|
-
}, [name, value, children, space, names, namePath, index]);
|
|
44
|
+
var columnsProps = transformColumns({
|
|
45
|
+
columns: children,
|
|
46
|
+
name: name,
|
|
47
|
+
names: names,
|
|
48
|
+
onChange: handleChange,
|
|
49
|
+
namePath: namePath,
|
|
50
|
+
form: form,
|
|
51
|
+
index: index,
|
|
52
|
+
value: value,
|
|
53
|
+
groupProps: props
|
|
54
|
+
});
|
|
55
|
+
var columns = insertSeparator(columnsProps, space);
|
|
58
56
|
var _className = classnames(_defineProperty({
|
|
59
57
|
'pro-group': true,
|
|
60
58
|
'pro-group-diy-width': columns.some(function (item) {
|
|
@@ -16,7 +16,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
16
16
|
import "antd/es/form/style";
|
|
17
17
|
import _Form from "antd/es/form";
|
|
18
18
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
19
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "defaultOne"],
|
|
19
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
20
20
|
_excluded2 = ["onOk"],
|
|
21
21
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -52,6 +52,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
52
52
|
beforeOpen = props.beforeOpen,
|
|
53
53
|
isTooltip = props.isTooltip,
|
|
54
54
|
searchForm = props.searchForm,
|
|
55
|
+
searchKey = props.searchKey,
|
|
55
56
|
defaultOne = props.defaultOne,
|
|
56
57
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
57
58
|
var contentForm = _Form.useFormInstance();
|
|
@@ -603,7 +604,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
603
604
|
nextState.selectedRows = value;
|
|
604
605
|
}
|
|
605
606
|
} else if (value) {
|
|
606
|
-
console.log('value', value);
|
|
607
607
|
nextState.selectedRowKeys = [value];
|
|
608
608
|
}
|
|
609
609
|
setState(nextState);
|
|
@@ -696,7 +696,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
696
696
|
},
|
|
697
697
|
onSearch: debounce(function (val) {
|
|
698
698
|
var _useRequest$options10;
|
|
699
|
-
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams), {}, _defineProperty({}, labelKey, val));
|
|
699
|
+
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
|
700
700
|
var params = withPagination ? {
|
|
701
701
|
pageNum: 1,
|
|
702
702
|
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
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
import "antd/es/modal/style";
|
|
3
4
|
import _Modal from "antd/es/modal";
|
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
6
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
7
|
var _excluded = ["onChange", "children", "confirm", "otherProps"];
|
|
6
8
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -19,40 +21,73 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
19
21
|
rest = _objectWithoutProperties(props, _excluded);
|
|
20
22
|
var _ProForm$useFieldProp = ProForm.useFieldProps(),
|
|
21
23
|
form = _ProForm$useFieldProp.form;
|
|
22
|
-
var handleChange = function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
var handleChange = /*#__PURE__*/function () {
|
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
26
|
+
var _len,
|
|
27
|
+
other,
|
|
28
|
+
_key,
|
|
29
|
+
_value,
|
|
30
|
+
confirmProps,
|
|
31
|
+
_args = arguments;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
for (_len = _args.length, other = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
36
|
+
other[_key - 1] = _args[_key];
|
|
37
|
+
}
|
|
38
|
+
_value = (value === null || value === void 0 ? void 0 : value.target) ? value.target.value : value;
|
|
39
|
+
if (!isFunction(confirm)) {
|
|
40
|
+
_context.next = 8;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
_context.next = 5;
|
|
44
|
+
return confirm(value, form.getFieldsValue(), {
|
|
45
|
+
option: other[0],
|
|
46
|
+
form: form,
|
|
47
|
+
namePath: otherProps.namePath,
|
|
48
|
+
index: otherProps.index
|
|
49
|
+
});
|
|
50
|
+
case 5:
|
|
51
|
+
_context.t0 = _context.sent;
|
|
52
|
+
_context.next = 9;
|
|
53
|
+
break;
|
|
54
|
+
case 8:
|
|
55
|
+
_context.t0 = confirm;
|
|
56
|
+
case 9:
|
|
57
|
+
confirmProps = _context.t0;
|
|
58
|
+
// 只处理 false, true 和 对象的情况
|
|
59
|
+
if (confirmProps === false) {
|
|
60
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
61
|
+
}
|
|
62
|
+
if (confirmProps === true) {
|
|
63
|
+
_Modal.confirm(_objectSpread(_objectSpread({}, defaultConfirmProps), {}, {
|
|
64
|
+
onOk: function onOk() {
|
|
65
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
if (isObject(confirmProps)) {
|
|
70
|
+
_Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, 'title' in confirmProps || 'content' in confirmProps ? {} : defaultConfirmProps), confirmProps), {}, {
|
|
71
|
+
onOk: function onOk() {
|
|
72
|
+
var _confirmProps$onOk;
|
|
73
|
+
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
74
|
+
arg[_key2] = arguments[_key2];
|
|
75
|
+
}
|
|
76
|
+
(_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
|
|
77
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
case 13:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context.stop();
|
|
37
84
|
}
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var _confirmProps$onOk;
|
|
45
|
-
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
46
|
-
arg[_key2] = arguments[_key2];
|
|
47
|
-
}
|
|
48
|
-
(_confirmProps$onOk = confirmProps.onOk) === null || _confirmProps$onOk === void 0 ? void 0 : _confirmProps$onOk.call.apply(_confirmProps$onOk, [confirmProps].concat(arg));
|
|
49
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
55
|
-
};
|
|
85
|
+
}, _callee);
|
|
86
|
+
}));
|
|
87
|
+
return function handleChange(_x) {
|
|
88
|
+
return _ref.apply(this, arguments);
|
|
89
|
+
};
|
|
90
|
+
}();
|
|
56
91
|
return _jsx(_Fragment, {
|
|
57
92
|
children: /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, rest), {}, {
|
|
58
93
|
// @ts-ignore
|
package/es/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/es/ProForm/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
2
1
|
import "antd/es/row/style";
|
|
3
2
|
import _Row from "antd/es/row";
|
|
4
3
|
import "antd/es/form/style";
|
|
@@ -282,30 +281,32 @@ ProFormForward.useWatch = function (watchValue, form) {
|
|
|
282
281
|
}
|
|
283
282
|
return _Form.useWatch([], form);
|
|
284
283
|
};
|
|
285
|
-
var ProFormProvider = function ProFormProvider(props) {
|
|
284
|
+
export var ProFormProvider = function ProFormProvider(props) {
|
|
286
285
|
var onFormChange = props.onFormChange,
|
|
287
286
|
onFormFinish = props.onFormFinish,
|
|
288
287
|
children = props.children;
|
|
289
|
-
var handleFormChange = function handleFormChange(
|
|
288
|
+
var handleFormChange = function handleFormChange(formName, info) {
|
|
290
289
|
var changedFields = info.changedFields;
|
|
291
290
|
var _changedFields = changedFields.flatMap(function (item) {
|
|
292
|
-
var
|
|
293
|
-
_item$value = item.value,
|
|
291
|
+
var _item$value = item.value,
|
|
294
292
|
value = _item$value === void 0 ? [] : _item$value;
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
|
|
293
|
+
var name = item.name;
|
|
294
|
+
var namesStr = name[name.length - 1];
|
|
295
|
+
// name中的最后一位如果包含 '-' 则是names组件
|
|
296
|
+
var isNames = String(namesStr).includes('-');
|
|
297
|
+
if (!isNames) return item; // 不是names组件直接返回
|
|
298
|
+
var namesList = splitNameStr(String(namesStr)); // 拆解出name列表
|
|
299
|
+
var prefix = name.slice(0, name.length - 1);
|
|
300
|
+
return namesList.map(function (nameItem, index) {
|
|
300
301
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
301
|
-
name:
|
|
302
|
+
name: [].concat(_toConsumableArray(prefix), _toConsumableArray(nameItem)),
|
|
302
303
|
value: value[index]
|
|
303
304
|
});
|
|
304
305
|
});
|
|
305
306
|
});
|
|
306
307
|
info.changedFields = _changedFields;
|
|
307
308
|
// @ts-ignore
|
|
308
|
-
onFormChange(
|
|
309
|
+
onFormChange(formName, info);
|
|
309
310
|
};
|
|
310
311
|
return _jsx(_Form.Provider, {
|
|
311
312
|
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 {};
|
|
@@ -434,4 +434,25 @@ export var parseNamePath = function parseNamePath(input) {
|
|
|
434
434
|
return isNaN(Number(item)) ? item : Number(item);
|
|
435
435
|
});
|
|
436
436
|
return [result];
|
|
437
|
-
};
|
|
437
|
+
};
|
|
438
|
+
/** 解析namePath */
|
|
439
|
+
export function findNamesKeyInArray(arr, key) {
|
|
440
|
+
var _iterator2 = _createForOfIteratorHelper(arr),
|
|
441
|
+
_step2;
|
|
442
|
+
try {
|
|
443
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
444
|
+
var item = _step2.value;
|
|
445
|
+
if (!item.includes('_')) {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
if (item.split('_')[0].includes(key)) {
|
|
449
|
+
return item;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
} catch (err) {
|
|
453
|
+
_iterator2.e(err);
|
|
454
|
+
} finally {
|
|
455
|
+
_iterator2.f();
|
|
456
|
+
}
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
@@ -6,7 +6,7 @@ import locale, { formatMessage } from '../../locale';
|
|
|
6
6
|
var getNonEmptyValuesByIndex = function getNonEmptyValuesByIndex(required, valueArray) {
|
|
7
7
|
var result = [];
|
|
8
8
|
required.forEach(function (item, index) {
|
|
9
|
-
if (item && !valueArray[index] && !isNumber(valueArray[index])) {
|
|
9
|
+
if (item && !(valueArray === null || valueArray === void 0 ? void 0 : valueArray[index]) && !isNumber(valueArray === null || valueArray === void 0 ? void 0 : valueArray[index])) {
|
|
10
10
|
result.push(index + 1);
|
|
11
11
|
}
|
|
12
12
|
});
|
|
@@ -21,11 +21,15 @@ export var useForm = function useForm(originForm) {
|
|
|
21
21
|
};
|
|
22
22
|
var _validateFields = /*#__PURE__*/function () {
|
|
23
23
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
|
|
24
|
-
var
|
|
24
|
+
var _rest$,
|
|
25
|
+
_len,
|
|
25
26
|
rest,
|
|
26
27
|
_key,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
isRecursive,
|
|
29
|
+
validateNames,
|
|
30
|
+
_form$getInternalHook,
|
|
31
|
+
getFields,
|
|
32
|
+
fieldsList,
|
|
29
33
|
_error$errorFields,
|
|
30
34
|
_error$errorFields$,
|
|
31
35
|
_args = arguments;
|
|
@@ -36,20 +40,33 @@ export var useForm = function useForm(originForm) {
|
|
|
36
40
|
for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37
41
|
rest[_key - 1] = _args[_key];
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_context.next = 7;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
isRecursive = rest === null || rest === void 0 ? void 0 : (_rest$ = rest[0]) === null || _rest$ === void 0 ? void 0 : _rest$.recursive;
|
|
45
|
+
validateNames = []; // 前缀校验模式
|
|
46
|
+
if (!isRecursive) {
|
|
47
|
+
_context.next = 10;
|
|
45
48
|
break;
|
|
46
49
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
_form$getInternalHook = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS'), getFields = _form$getInternalHook.getFields;
|
|
52
|
+
fieldsList = getFields();
|
|
53
|
+
fieldsList.forEach(function (item) {
|
|
54
|
+
var _item$name, _item$name2, _item$name2$;
|
|
55
|
+
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], "_")))) {
|
|
56
|
+
validateNames.push(item.name);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
delete rest[0].recursive;
|
|
61
|
+
return _context.abrupt("return", validateFields.apply(void 0, [validateNames].concat(rest)).then(function (values) {
|
|
62
|
+
return filterInternalFields(values);
|
|
63
|
+
}));
|
|
64
|
+
case 10:
|
|
65
|
+
return _context.abrupt("return", validateFields.apply(void 0, [nameList].concat(rest)).then(function (values) {
|
|
66
|
+
return nameList ? values : _getFieldsValue();
|
|
67
|
+
}));
|
|
68
|
+
case 13:
|
|
69
|
+
_context.prev = 13;
|
|
53
70
|
_context.t0 = _context["catch"](0);
|
|
54
71
|
if (_context.t0 && (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields)) {
|
|
55
72
|
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, {
|
|
@@ -58,11 +75,11 @@ export var useForm = function useForm(originForm) {
|
|
|
58
75
|
});
|
|
59
76
|
}
|
|
60
77
|
throw _context.t0;
|
|
61
|
-
case
|
|
78
|
+
case 17:
|
|
62
79
|
case "end":
|
|
63
80
|
return _context.stop();
|
|
64
81
|
}
|
|
65
|
-
}, _callee, null, [[0,
|
|
82
|
+
}, _callee, null, [[0, 13]]);
|
|
66
83
|
}));
|
|
67
84
|
return function _validateFields(_x) {
|
|
68
85
|
return _ref.apply(this, arguments);
|
|
@@ -34,7 +34,9 @@ var ProCollapse = function ProCollapse(props) {
|
|
|
34
34
|
collapseProps = props.collapseProps,
|
|
35
35
|
collapsePanelProps = props.collapsePanelProps,
|
|
36
36
|
className = props.className,
|
|
37
|
-
icon = props.icon
|
|
37
|
+
icon = props.icon,
|
|
38
|
+
_props$autoHeight = props.autoHeight,
|
|
39
|
+
autoHeight = _props$autoHeight === void 0 ? true : _props$autoHeight;
|
|
38
40
|
var cls = classNames(_defineProperty({
|
|
39
41
|
'pro-collapse': true,
|
|
40
42
|
'pro-collapse-level2': level === '2',
|
|
@@ -114,17 +116,24 @@ var ProCollapse = function ProCollapse(props) {
|
|
|
114
116
|
};
|
|
115
117
|
// 当pro-layout-content只存在一个card时,高度动态计算
|
|
116
118
|
useLayoutEffect(function () {
|
|
119
|
+
if (!autoHeight) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
117
122
|
var proCollapseContent = document.querySelector('.pro-layout-content');
|
|
118
123
|
if (!proCollapseContent) {
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
121
126
|
var proCollapseNoTitles = proCollapseContent.querySelectorAll('.pro-collapse-no-level1-title');
|
|
127
|
+
var proFooterNode = proCollapseContent.querySelector('.pro-footer');
|
|
122
128
|
var proCollapses = proCollapseContent.querySelectorAll('.pro-collapse');
|
|
123
|
-
if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
|
|
129
|
+
if ((proCollapseNoTitles === null || proCollapseNoTitles === void 0 ? void 0 : proCollapseNoTitles.length) === 1 && proCollapses.length === 1) {
|
|
124
130
|
var rect = proCollapseNoTitles[0].getBoundingClientRect();
|
|
125
131
|
if ((rect === null || rect === void 0 ? void 0 : rect.height) < window.innerHeight - rect.top) {
|
|
126
132
|
proCollapseNoTitles[0].style.minHeight = "calc(100vh - ".concat(rect.top + 16, "px)");
|
|
127
133
|
}
|
|
134
|
+
if (proFooterNode) {
|
|
135
|
+
proCollapseNoTitles[0].style.minHeight = "calc(100vh - ".concat(rect.top + proFooterNode.offsetHeight + 16, "px)");
|
|
136
|
+
}
|
|
128
137
|
}
|
|
129
138
|
return function () {
|
|
130
139
|
if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
|
|
@@ -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;
|
|
@@ -4,7 +4,8 @@ import { throttle } from 'lodash';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useStep } from '../../index';
|
|
6
6
|
export default (function (_ref) {
|
|
7
|
-
var children = _ref.children
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
delayTime = _ref.delayTime;
|
|
8
9
|
var _useStep = useStep(),
|
|
9
10
|
notify = _useStep.notify;
|
|
10
11
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
@@ -24,7 +25,7 @@ export default (function (_ref) {
|
|
|
24
25
|
var _children$props, _children$props$onCli;
|
|
25
26
|
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);
|
|
26
27
|
}
|
|
27
|
-
}, 0);
|
|
28
|
+
}, delayTime !== null && delayTime !== void 0 ? delayTime : 0);
|
|
28
29
|
case 5:
|
|
29
30
|
case "end":
|
|
30
31
|
return _context.stop();
|
package/es/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
|
};
|
package/es/style/theme/antd.less
CHANGED
|
@@ -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 {
|
|
@@ -409,7 +409,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
409
409
|
}
|
|
410
410
|
_args = formatArgs([].concat(args));
|
|
411
411
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
412
|
-
row =
|
|
412
|
+
row = form.getFieldValue(rowPath, true);
|
|
413
413
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
414
414
|
_args[1] = row;
|
|
415
415
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
package/lib/ProEnum/index.js
CHANGED
|
@@ -42,8 +42,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
42
42
|
enumProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
43
43
|
var _ref = otherProps || {},
|
|
44
44
|
isView = _ref.isView,
|
|
45
|
-
viewEmpty = _ref.viewEmpty
|
|
46
|
-
disabled = _ref.disabled;
|
|
45
|
+
viewEmpty = _ref.viewEmpty;
|
|
47
46
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
|
|
48
47
|
fieldNames = _ref2.fieldNames,
|
|
49
48
|
_ref2$clear = _ref2.clear,
|
|
@@ -166,6 +165,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
166
165
|
switch (type) {
|
|
167
166
|
case 'ProSelect':
|
|
168
167
|
return (0, _jsxRuntime.jsx)(_ProSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
168
|
+
otherProps: otherProps,
|
|
169
169
|
dataSource: list,
|
|
170
170
|
fieldNames: {
|
|
171
171
|
label: label,
|
|
@@ -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) {
|
|
@@ -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 {
|