@foodpilot/foods 0.1.71 → 0.1.72

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,4 +1,4 @@
1
- import { CheckboxProps } from "@mui/material";
1
+ import { CheckboxProps, FormGroupProps, FormControlLabelProps } from "@mui/material";
2
2
  export type CheckboxId = string | number;
3
3
  export type CheckboxName = string | number;
4
4
  export type CheckboxProperties<T> = Record<CheckboxId, CheckboxPropertyValue<T>>;
@@ -8,11 +8,12 @@ export type CheckboxPropertyValue<T> = {
8
8
  disabled?: boolean;
9
9
  rawData: T;
10
10
  };
11
- export type MandatoryFields = {
12
- id: number;
13
- name: string;
11
+ export type BaseCheckboxOverrides = {
12
+ FormGroupProps?: FormGroupProps;
13
+ FormControlLabelProps?: Omit<FormControlLabelProps, "control" | "label">;
14
+ CheckboxProps?: Omit<CheckboxProps, "onChange">;
14
15
  };
15
- type BaseCheckboxProps<T> = Omit<CheckboxProps, "onChange"> & {
16
+ type BaseCheckboxProps<T> = BaseCheckboxOverrides & {
16
17
  values: CheckboxProperties<T>;
17
18
  onChange: (newCheckbox: CheckboxProperties<T>) => void;
18
19
  };
@@ -1,4 +1,5 @@
1
- export type FoodsCheckboxProps<T> = {
1
+ import { BaseCheckboxOverrides } from "./BaseCheckbox";
2
+ export type FoodsCheckboxProps<T> = BaseCheckboxOverrides & {
2
3
  selectedItems: T[] | undefined;
3
4
  values: T[];
4
5
  onChange: (selectedValues: T[]) => void;
@@ -1,4 +1,4 @@
1
- import { RadioProps } from "@mui/material";
1
+ import { RadioProps, FormControlProps, FormControlLabelProps } from "@mui/material";
2
2
  import { CSSProperties } from "react";
3
3
  export type RadioProperties<T> = Record<string | number, RadioPropertyValue<T>>;
4
4
  export type RadioPropertyValue<T> = {
@@ -7,7 +7,12 @@ export type RadioPropertyValue<T> = {
7
7
  disabled?: boolean;
8
8
  rawData?: T;
9
9
  };
10
- type BaseRadioProps<T> = Omit<RadioProps, "onChange"> & {
10
+ export type BaseRadioOverrides = {
11
+ FormControlProps?: FormControlProps;
12
+ FormControlLabelProps?: Omit<FormControlLabelProps, "onChange" | "control" | "label" | "key">;
13
+ RadioProps?: RadioProps;
14
+ };
15
+ type BaseRadioProps<T> = BaseRadioOverrides & {
11
16
  values: RadioProperties<T>;
12
17
  onChange: (newRadio: RadioProperties<T>) => void;
13
18
  flexDirection?: CSSProperties["flexDirection"];
@@ -1,5 +1,6 @@
1
- export type FoodsRadioListProps<T> = {
2
- selectedId: T | undefined;
1
+ import { BaseRadioOverrides } from "./BaseRadio";
2
+ export type FoodsRadioListProps<T> = BaseRadioOverrides & {
3
+ selectedItem: T | undefined;
3
4
  values: T[];
4
5
  onChange: (newValue: T) => void;
5
6
  getId?: (item: T) => string | number;
@@ -1,5 +1,8 @@
1
- export type RadioBooleanProps = {
1
+ import { BaseRadioOverrides } from "./BaseRadio";
2
+ export type RadioBooleanProps = BaseRadioOverrides & {
2
3
  value: boolean | undefined;
3
4
  onChange: (value: boolean) => void;
5
+ trueKeyName?: string;
6
+ falseKeyName?: string;
4
7
  };
5
8
  export declare const RadioBoolean: (props: RadioBooleanProps) => import("react/jsx-runtime").JSX.Element;