react-toolkits 2.13.15 → 2.13.16
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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ interface UseModalOperation {
|
|
|
153
153
|
interface UseModalProps extends Omit<ModalProps, 'open' | 'confirmLoading' | 'onOk' | 'onCancel'> {
|
|
154
154
|
content?: ReactNode | ((operation: UseModalOperation) => ReactNode);
|
|
155
155
|
onConfirm?: () => void | Promise<void>;
|
|
156
|
+
afterOpen?: () => void | Promise<void>;
|
|
156
157
|
}
|
|
157
158
|
declare function useModal(props: UseModalProps): {
|
|
158
159
|
id: number;
|
package/lib/index.js
CHANGED
|
@@ -1037,7 +1037,7 @@ var init_stores4 = __esm({
|
|
|
1037
1037
|
}
|
|
1038
1038
|
});
|
|
1039
1039
|
function useModal(props) {
|
|
1040
|
-
const { content, onConfirm, ...modalProps } = props;
|
|
1040
|
+
const { content, onConfirm, afterOpen, ...modalProps } = props;
|
|
1041
1041
|
const _id = useMemo(() => ++id, []);
|
|
1042
1042
|
const { show, hide, isOpen } = useModalStore();
|
|
1043
1043
|
const open = isOpen(_id);
|
|
@@ -1045,6 +1045,7 @@ function useModal(props) {
|
|
|
1045
1045
|
const isRenderFunction = typeof content === "function";
|
|
1046
1046
|
const _show = () => {
|
|
1047
1047
|
show(_id);
|
|
1048
|
+
afterOpen?.();
|
|
1048
1049
|
};
|
|
1049
1050
|
const _hide = () => {
|
|
1050
1051
|
hide(_id);
|