@baton8/general-components 3.1.0-alpha.10 → 3.1.0-alpha.12
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,11 +1,9 @@
|
|
|
1
1
|
import { Dispatch, ReactElement, ReactNode, SetStateAction } from "react";
|
|
2
2
|
type DialogContextValue = {
|
|
3
3
|
open: () => Promise<void>;
|
|
4
|
-
|
|
5
|
-
setDialogSpec: Dispatch<SetStateAction<{
|
|
6
|
-
element: ReactElement;
|
|
7
|
-
} | null>>;
|
|
4
|
+
setRender: Dispatch<SetStateAction<DialogRenderFunction>>;
|
|
8
5
|
};
|
|
6
|
+
type DialogRenderFunction = (onClose: () => void, isLoadingState: [boolean, Dispatch<SetStateAction<boolean>>]) => ReactElement;
|
|
9
7
|
export declare const dialogContext: import("react").Context<DialogContextValue>;
|
|
10
8
|
export declare const DialogProvider: React.FC<{
|
|
11
9
|
children: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
export type OpenDialog = (render: (onClose: () => void) => ReactElement) => Promise<void>;
|
|
1
|
+
import { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
|
+
export type OpenDialog = (render: (onClose: () => void, isLoadingState: [boolean, Dispatch<SetStateAction<boolean>>]) => ReactElement) => Promise<void>;
|
|
3
3
|
/**
|
|
4
4
|
* ダイアログを表示する関数 `openDialog` を返します。
|
|
5
5
|
* `openDialog` 関数にダイアログのレンダー関数を渡すと、そのダイアログが表示されます。
|