assui 2.0.131 → 2.0.132
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.
|
@@ -8,7 +8,7 @@ export interface ButtonModalProps extends ModalProps {
|
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
onOpen?: () => void;
|
|
10
10
|
trigger?: React.ReactElement;
|
|
11
|
-
children: React.ReactElement;
|
|
11
|
+
children: (v: ModalAction) => React.ReactElement | React.ReactElement;
|
|
12
12
|
}
|
|
13
13
|
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonModal;
|
package/es/button-modal/index.js
CHANGED
|
@@ -55,6 +55,7 @@ var __read = this && this.__read || function (o, n) {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
import * as React from 'react';
|
|
58
|
+
import isFunction from 'lodash/isFunction';
|
|
58
59
|
import Modal from 'antd/lib/modal';
|
|
59
60
|
|
|
60
61
|
var ButtonModal = function ButtonModal(props, ref) {
|
|
@@ -120,7 +121,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
120
121
|
onCancel: handleModalCancel,
|
|
121
122
|
centered: true,
|
|
122
123
|
maskClosable: false
|
|
123
|
-
}, restModalProps), /*#__PURE__*/React.cloneElement(children, {
|
|
124
|
+
}, restModalProps), isFunction(children) ? children(modalActionRef.current) : /*#__PURE__*/React.cloneElement(children, {
|
|
124
125
|
modalAction: modalActionRef.current
|
|
125
126
|
})));
|
|
126
127
|
};
|
|
@@ -8,7 +8,7 @@ export interface ButtonModalProps extends ModalProps {
|
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
onOpen?: () => void;
|
|
10
10
|
trigger?: React.ReactElement;
|
|
11
|
-
children: React.ReactElement;
|
|
11
|
+
children: (v: ModalAction) => React.ReactElement | React.ReactElement;
|
|
12
12
|
}
|
|
13
13
|
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonModal;
|
|
@@ -102,6 +102,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
102
102
|
|
|
103
103
|
var React = __importStar(require("react"));
|
|
104
104
|
|
|
105
|
+
var isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
106
|
+
|
|
105
107
|
var modal_1 = __importDefault(require("antd/lib/modal"));
|
|
106
108
|
|
|
107
109
|
var ButtonModal = function ButtonModal(props, ref) {
|
|
@@ -167,7 +169,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
167
169
|
onCancel: handleModalCancel,
|
|
168
170
|
centered: true,
|
|
169
171
|
maskClosable: false
|
|
170
|
-
}, restModalProps), React.cloneElement(children, {
|
|
172
|
+
}, restModalProps), isFunction_1["default"](children) ? children(modalActionRef.current) : React.cloneElement(children, {
|
|
171
173
|
modalAction: modalActionRef.current
|
|
172
174
|
})));
|
|
173
175
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.132",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b3a42ec046bc4a661b60c9b4b57d72ba1afe5fd6"
|
|
73
73
|
}
|