assui 2.0.30 → 2.0.34
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ModalProps } from 'antd/es/modal';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ModalAction {
|
|
4
4
|
open: () => void;
|
|
5
5
|
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends ModalProps {
|
|
8
|
-
content: React.ReactElement;
|
|
9
|
-
children: React.ReactElement;
|
|
10
8
|
onClose?: () => void;
|
|
11
9
|
onOpen?: () => void;
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
children: 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
|
@@ -63,12 +63,12 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
63
63
|
setModalVisible = _a[1];
|
|
64
64
|
|
|
65
65
|
var children = props.children,
|
|
66
|
-
|
|
66
|
+
trigger = props.trigger,
|
|
67
67
|
onOpen = props.onOpen,
|
|
68
68
|
onClose = props.onClose,
|
|
69
69
|
onOk = props.onOk,
|
|
70
70
|
onCancel = props.onCancel,
|
|
71
|
-
restModalProps = __rest(props, ["children", "
|
|
71
|
+
restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
|
|
72
72
|
|
|
73
73
|
var openModal = function openModal() {
|
|
74
74
|
if (onOpen) {
|
|
@@ -111,7 +111,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
111
111
|
closeModal();
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
var buttonNode =
|
|
114
|
+
var buttonNode = trigger && /*#__PURE__*/React.cloneElement(trigger, {
|
|
115
115
|
onClick: openModal
|
|
116
116
|
});
|
|
117
117
|
return /*#__PURE__*/React.createElement(React.Fragment, null, buttonNode, /*#__PURE__*/React.createElement(Modal, __assign({
|
|
@@ -120,7 +120,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
120
120
|
onCancel: handleModalCancel,
|
|
121
121
|
centered: true,
|
|
122
122
|
maskClosable: false
|
|
123
|
-
}, restModalProps), /*#__PURE__*/React.cloneElement(
|
|
123
|
+
}, restModalProps), /*#__PURE__*/React.cloneElement(children, {
|
|
124
124
|
modalAction: modalActionRef.current
|
|
125
125
|
})));
|
|
126
126
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ModalProps } from 'antd/es/modal';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ModalAction {
|
|
4
4
|
open: () => void;
|
|
5
5
|
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends ModalProps {
|
|
8
|
-
content: React.ReactElement;
|
|
9
|
-
children: React.ReactElement;
|
|
10
8
|
onClose?: () => void;
|
|
11
9
|
onOpen?: () => void;
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
children: React.ReactElement;
|
|
12
12
|
}
|
|
13
13
|
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<ButtonModalProps & React.RefAttributes<unknown>>;
|
|
14
14
|
export default ForwardRefButtonModal;
|
|
@@ -110,12 +110,12 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
110
110
|
setModalVisible = _a[1];
|
|
111
111
|
|
|
112
112
|
var children = props.children,
|
|
113
|
-
|
|
113
|
+
trigger = props.trigger,
|
|
114
114
|
onOpen = props.onOpen,
|
|
115
115
|
onClose = props.onClose,
|
|
116
116
|
onOk = props.onOk,
|
|
117
117
|
onCancel = props.onCancel,
|
|
118
|
-
restModalProps = __rest(props, ["children", "
|
|
118
|
+
restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
|
|
119
119
|
|
|
120
120
|
var openModal = function openModal() {
|
|
121
121
|
if (onOpen) {
|
|
@@ -158,7 +158,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
158
158
|
closeModal();
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
var buttonNode =
|
|
161
|
+
var buttonNode = trigger && React.cloneElement(trigger, {
|
|
162
162
|
onClick: openModal
|
|
163
163
|
});
|
|
164
164
|
return React.createElement(React.Fragment, null, buttonNode, React.createElement(modal_1["default"], __assign({
|
|
@@ -167,7 +167,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
167
167
|
onCancel: handleModalCancel,
|
|
168
168
|
centered: true,
|
|
169
169
|
maskClosable: false
|
|
170
|
-
}, restModalProps), React.cloneElement(
|
|
170
|
+
}, restModalProps), React.cloneElement(children, {
|
|
171
171
|
modalAction: modalActionRef.current
|
|
172
172
|
})));
|
|
173
173
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.34",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ahooksjs/use-url-state": "^2.5.8",
|
|
34
34
|
"@tinymce/tinymce-react": "^3.13.0",
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
|
-
"a-icons": "^1.0.
|
|
36
|
+
"a-icons": "^1.0.20",
|
|
37
37
|
"ahooks": "^2.10.9",
|
|
38
38
|
"bignumber.js": "^9.0.1",
|
|
39
39
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=10.0.0"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f5a14525d523426cc473063c0d004a609fc53f43"
|
|
73
73
|
}
|