@zat-design/sisyphus-react 3.4.8-beta.9 → 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/es/ProEnum/index.js +2 -2
- 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/render/ConfirmWrapper.js +21 -32
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -1
- package/es/ProSelect/index.js +2 -0
- package/lib/ProEnum/index.js +2 -2
- 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/render/ConfirmWrapper.js +21 -32
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +5 -0
- package/lib/ProLayout/components/ProCollapse/index.js +6 -1
- package/lib/ProSelect/index.js +2 -0
- package/package.json +1 -1
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,
|
|
@@ -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,
|
|
@@ -55,41 +55,30 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
55
55
|
_context.t0 = confirm;
|
|
56
56
|
case 9:
|
|
57
57
|
confirmProps = _context.t0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
return _context.abrupt("return");
|
|
63
|
-
case 12:
|
|
64
|
-
if (!(confirmProps === true)) {
|
|
65
|
-
_context.next = 15;
|
|
66
|
-
break;
|
|
58
|
+
// 只处理 false, true 和 对象的情况
|
|
59
|
+
if (confirmProps === false) {
|
|
60
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
case 15:
|
|
75
|
-
if (!isObject(confirmProps)) {
|
|
76
|
-
_context.next = 18;
|
|
77
|
-
break;
|
|
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
|
+
}));
|
|
78
68
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
arg
|
|
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));
|
|
84
78
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}));
|
|
89
|
-
return _context.abrupt("return");
|
|
90
|
-
case 18:
|
|
91
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
92
|
-
case 19:
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
case 13:
|
|
93
82
|
case "end":
|
|
94
83
|
return _context.stop();
|
|
95
84
|
}
|
|
@@ -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,6 +116,9 @@ 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;
|
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,
|
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,
|
|
@@ -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,
|
|
@@ -61,41 +61,30 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
61
61
|
_context.t0 = confirm;
|
|
62
62
|
case 9:
|
|
63
63
|
confirmProps = _context.t0;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
return _context.abrupt("return");
|
|
69
|
-
case 12:
|
|
70
|
-
if (!(confirmProps === true)) {
|
|
71
|
-
_context.next = 15;
|
|
72
|
-
break;
|
|
64
|
+
// 只处理 false, true 和 对象的情况
|
|
65
|
+
if (confirmProps === false) {
|
|
66
|
+
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
73
67
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
case 15:
|
|
81
|
-
if (!(0, _lodash.isObject)(confirmProps)) {
|
|
82
|
-
_context.next = 18;
|
|
83
|
-
break;
|
|
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
|
+
}));
|
|
84
74
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
arg
|
|
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));
|
|
90
84
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}));
|
|
95
|
-
return _context.abrupt("return");
|
|
96
|
-
case 18:
|
|
97
|
-
onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [_value].concat(other));
|
|
98
|
-
case 19:
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
case 13:
|
|
99
88
|
case "end":
|
|
100
89
|
return _context.stop();
|
|
101
90
|
}
|
|
@@ -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,6 +118,9 @@ 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;
|
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,
|