@foodpilot/foods 0.1.90 → 0.1.91
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/dist/components/Form/FoodsFormBase/{FormTopBar/ConfirmDialog.d.ts → ConfirmDialog.d.ts} +2 -0
- package/dist/components/Form/FoodsFormBase/FoodsFormBase.d.ts +16 -12
- package/dist/components/Form/FoodsFormBase/FormBaseContext.d.ts +8 -6
- package/dist/components/Form/FoodsFormBase/index.d.ts +2 -1
- package/dist/main.js +1547 -1541
- package/dist/main.umd.cjs +94 -94
- package/package.json +1 -1
package/dist/components/Form/FoodsFormBase/{FormTopBar/ConfirmDialog.d.ts → ConfirmDialog.d.ts}
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ConfirmOptionsType } from "./FoodsFormBase";
|
|
1
2
|
type ConfirmDialogProps = {
|
|
2
3
|
open: boolean;
|
|
3
4
|
onClose: () => void;
|
|
5
|
+
confirmOptions: ConfirmOptionsType;
|
|
4
6
|
};
|
|
5
7
|
export declare const ConfirmDialog: (props: ConfirmDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
export type
|
|
2
|
+
export type FoodsPage = {
|
|
3
3
|
title?: string;
|
|
4
4
|
subtitle?: ReactNode;
|
|
5
5
|
icon?: JSX.Element;
|
|
@@ -14,23 +14,27 @@ export type DisplayTextOptions = {
|
|
|
14
14
|
syncingMessage?: string;
|
|
15
15
|
savingDefaultMessage?: string;
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onConfirm
|
|
23
|
-
onCancel
|
|
17
|
+
export type ConfirmOptionsType = {
|
|
18
|
+
titleText: string;
|
|
19
|
+
infoText?: string;
|
|
20
|
+
confirmText: string;
|
|
21
|
+
cancelText: string;
|
|
22
|
+
onConfirm: () => void;
|
|
23
|
+
onCancel: () => void;
|
|
24
|
+
};
|
|
25
|
+
export type ConfirmOptions = ({
|
|
26
|
+
confirmExit: false;
|
|
27
|
+
}) | {
|
|
28
|
+
confirmExit: true;
|
|
29
|
+
confirmOptions: ConfirmOptionsType;
|
|
24
30
|
};
|
|
25
|
-
export type FoodsFormBaseProps = {
|
|
31
|
+
export type FoodsFormBaseProps = ConfirmOptions & {
|
|
26
32
|
textOptions: DisplayTextOptions;
|
|
27
|
-
pages:
|
|
33
|
+
pages: FoodsPage[];
|
|
28
34
|
startingPage?: number;
|
|
29
35
|
onClose?: () => void;
|
|
30
36
|
onValidate?: () => void;
|
|
31
37
|
onPageChange?: (newPageIndex: number, previousPageIndex: number) => void;
|
|
32
38
|
showSync?: boolean;
|
|
33
|
-
confirmExit?: boolean;
|
|
34
|
-
confirmOptions: ConfirmOptions;
|
|
35
39
|
};
|
|
36
40
|
export declare const FoodsFormBase: (props: FoodsFormBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { FoodsPage } from "./FoodsFormBase";
|
|
3
3
|
import { PageLocks } from "./usePageLock";
|
|
4
4
|
import { FoodsFormBaseProps } from "./FoodsFormBase";
|
|
5
5
|
type FormBasePropsBlackList = Omit<FoodsFormBaseProps, "startingPage">;
|
|
6
|
-
type
|
|
6
|
+
type ExtraFormOptions = {
|
|
7
7
|
isSaving: boolean;
|
|
8
8
|
setSaving: (isSaving: boolean) => void;
|
|
9
|
-
selectedPage:
|
|
9
|
+
selectedPage: FoodsPage;
|
|
10
10
|
selectedPageIndex: number;
|
|
11
11
|
setPage: (value: number) => void;
|
|
12
12
|
maxPage: number;
|
|
13
|
-
} & {
|
|
14
13
|
formSaved: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
setFormSaved: (isSaved: boolean) => void;
|
|
15
|
+
openConfirmDialog: () => void;
|
|
16
|
+
};
|
|
17
|
+
type FormBaseContextInitialValues = (PageLocks & FormBasePropsBlackList & ExtraFormOptions);
|
|
17
18
|
type FormBaseContextProviderProps = FoodsFormBaseProps & {
|
|
18
19
|
children: ReactNode;
|
|
20
|
+
openConfirmDialog: () => void;
|
|
19
21
|
};
|
|
20
22
|
export declare const FormBaseContextProvider: (props: FormBaseContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export declare const useFormBaseContext: () => FormBaseContextInitialValues;
|