@ehfuse/mui-form-controls 1.3.19 → 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/README.md +55 -0
- package/dist/SwitchField.d.ts +10 -0
- package/dist/ToggleButtonGroupField.d.ts +10 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +4 -4
- package/dist/types.d.ts +23 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -14,11 +14,13 @@ 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";
|
|
20
21
|
import type { SelectProps as MuiSelectProps, SelectChangeEvent } from "@mui/material/Select";
|
|
21
22
|
import type { FormControlProps } from "@mui/material/FormControl";
|
|
23
|
+
import type { FormControlLabelProps } from "@mui/material/FormControlLabel";
|
|
22
24
|
import type { InputBaseComponentProps } from "@mui/material/InputBase";
|
|
23
25
|
export type TextFieldProps = MuiTextFieldProps;
|
|
24
26
|
export type ButtonGroupProps = MuiButtonGroupProps;
|
|
@@ -32,6 +34,7 @@ export type PopoverOrigin = {
|
|
|
32
34
|
export type FormLike = {
|
|
33
35
|
useFormValue: (name: string) => unknown;
|
|
34
36
|
handleFormChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
37
|
+
setFormValue?: (name: string, value: unknown) => void;
|
|
35
38
|
};
|
|
36
39
|
export type BaseTextFieldProps = {
|
|
37
40
|
readonly?: boolean;
|
|
@@ -66,6 +69,11 @@ export type SwitchProps = Omit<MuiSwitchProps, "checked" | "onChange" | "form">
|
|
|
66
69
|
label?: React.ReactNode;
|
|
67
70
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
68
71
|
};
|
|
72
|
+
export type SwitchFieldProps = Omit<SwitchProps, "label"> & {
|
|
73
|
+
label: React.ReactNode;
|
|
74
|
+
labelPlacement?: FormControlLabelProps["labelPlacement"];
|
|
75
|
+
sx?: SxProps<Theme>;
|
|
76
|
+
};
|
|
69
77
|
export type RadioOption = {
|
|
70
78
|
value: string;
|
|
71
79
|
label: React.ReactNode;
|
|
@@ -112,6 +120,21 @@ export type ToggleButtonProps = Omit<MuiToggleButtonProps, "value" | "onChange"
|
|
|
112
120
|
selected?: boolean;
|
|
113
121
|
onChange?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
|
|
114
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
|
+
};
|
|
115
138
|
export type AutocompleteOption = {
|
|
116
139
|
value: string | number;
|
|
117
140
|
label: string;
|