@foodpilot/foods 0.1.17 → 0.1.21

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,8 +1,18 @@
1
1
  import { CheckboxProps } from "@mui/material";
2
- export type CheckboxProperties = Record<string, boolean>;
2
+ export type CheckboxProperties = Record<string, CheckboxPropertyValue>;
3
+ export type CheckboxPropertyValue = {
4
+ name: string;
5
+ state: boolean;
6
+ };
3
7
  type PrimaryCheckboxProps = Omit<CheckboxProps, "onChange"> & {
4
8
  values: CheckboxProperties;
5
- onChange: (label: string, isChecked: boolean) => void;
9
+ onChange: (newCheckbox: CheckboxProperties) => void;
6
10
  };
7
11
  export declare const PrimaryCheckbox: (props: PrimaryCheckboxProps) => import("react/jsx-runtime").JSX.Element;
12
+ export type MandatoryFields = {
13
+ id: string;
14
+ displayName: string;
15
+ };
16
+ export declare const checkboxToAny: <T extends MandatoryFields, U extends T>(startingValues: T[], allValues: CheckboxProperties, defaultValue: (fields: MandatoryFields) => U) => T[];
17
+ export declare const anyToCheckbox: <T extends MandatoryFields>(selectedValues: T[], allValues: T[]) => CheckboxProperties;
8
18
  export {};
@@ -15,5 +15,7 @@ export type FormBaseProps = {
15
15
  title: string;
16
16
  icon: JSX.Element;
17
17
  pages: Page[];
18
+ onPageChange?: (page: number) => void;
19
+ onSaveDraft?: () => void;
18
20
  };
19
21
  export declare const FormBase: (props: FormBaseProps) => JSX.Element;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { Icon } from "./IconThread";
2
+ import { Icon } from "../Navigation/IconThread";
3
3
  type FormTopBarProps = {
4
4
  title: string;
5
5
  icon: JSX.Element;
6
6
  pageIcons: Icon[];
7
7
  currentPage: number;
8
8
  setPage: (value: number) => void;
9
+ onSaveDraft?: () => void;
9
10
  };
10
11
  export declare const FormTopBar: (props: FormTopBarProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -1,3 +1,3 @@
1
- export * from "./FormTopBar";
1
+ export * from "../Form/FormTopBar";
2
2
  export * from "./IconThread";
3
3
  export * from "./Navbar";