@ehfuse/mui-form-controls 1.3.20 → 1.3.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.
package/dist/types.d.ts CHANGED
@@ -14,6 +14,7 @@ import type { RadioGroupProps as MuiRadioGroupProps } from "@mui/material/RadioG
14
14
  import type { SliderProps as MuiSliderProps } from "@mui/material/Slider";
15
15
  import type { RatingProps as MuiRatingProps } from "@mui/material/Rating";
16
16
  import type { ToggleButtonProps as MuiToggleButtonProps } from "@mui/material/ToggleButton";
17
+ import type { ToggleButtonGroupProps as MuiToggleButtonGroupProps } from "@mui/material/ToggleButtonGroup";
17
18
  import type { ButtonGroupProps as MuiButtonGroupProps } from "@mui/material/ButtonGroup";
18
19
  import type { StepperProps as MuiStepperProps } from "@mui/material/Stepper";
19
20
  import type { AutocompleteProps as MuiAutocompleteProps } from "@mui/material/Autocomplete";
@@ -33,6 +34,7 @@ export type PopoverOrigin = {
33
34
  export type FormLike = {
34
35
  useFormValue: (name: string) => unknown;
35
36
  handleFormChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
37
+ setFormValue?: (name: string, value: unknown) => void;
36
38
  };
37
39
  export type BaseTextFieldProps = {
38
40
  readonly?: boolean;
@@ -118,6 +120,21 @@ export type ToggleButtonProps = Omit<MuiToggleButtonProps, "value" | "onChange"
118
120
  selected?: boolean;
119
121
  onChange?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
120
122
  };
123
+ export type ToggleButtonGroupFieldOption = {
124
+ label: React.ReactNode;
125
+ value: string | number | boolean;
126
+ disabled?: boolean;
127
+ };
128
+ export type ToggleButtonGroupFieldProps = Omit<MuiToggleButtonGroupProps, "value" | "onChange" | "children"> & BaseTextFieldProps & {
129
+ name?: string;
130
+ options: ToggleButtonGroupFieldOption[];
131
+ value?: unknown;
132
+ exclusive?: boolean;
133
+ fullWidth?: boolean;
134
+ size?: "small" | "medium" | "large";
135
+ onDeselect?: "keep" | "clear";
136
+ onChange?: (event: React.MouseEvent<HTMLElement>, value: unknown) => void;
137
+ };
121
138
  export type AutocompleteOption = {
122
139
  value: string | number;
123
140
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/mui-form-controls",
3
- "version": "1.3.20",
3
+ "version": "1.3.21",
4
4
  "description": "Material-UI form controls and text fields for complex forms",
5
5
  "private": false,
6
6
  "publishConfig": {