@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
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) {
|
package/es/ProSelect/index.js
CHANGED
|
@@ -269,6 +269,8 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
269
269
|
return value;
|
|
270
270
|
};
|
|
271
271
|
var newSelectList = selectList;
|
|
272
|
+
console.log('otherProps', otherProps, filterInList);
|
|
273
|
+
debugger;
|
|
272
274
|
if ((otherProps === null || otherProps === void 0 ? void 0 : otherProps.listName) && filterInList) {
|
|
273
275
|
newSelectList = getSelectList({
|
|
274
276
|
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;
|
|
@@ -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,
|