@nwon/react-mui-hook-form 1.3.0 → 1.3.2

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.
Files changed (27) hide show
  1. package/dist/formFields/HookFormProvider.d.ts +1 -2
  2. package/dist/formFields/InputEmail/InputEmail.d.ts +2 -3
  3. package/dist/formFields/baseTypes/BaseInputProps.d.ts +33 -0
  4. package/dist/formFields/baseTypes/InputAutocomplete/InputAutocomplete.d.ts +2 -1
  5. package/dist/formFields/baseTypes/InputAutocomplete/InputAutocompleteInterfaces.d.ts +1 -2
  6. package/dist/formFields/baseTypes/InputCheckbox/InputCheckbox.d.ts +2 -3
  7. package/dist/formFields/baseTypes/InputDatePicker/InputDatePicker.d.ts +2 -3
  8. package/dist/formFields/baseTypes/InputDateTimePicker/InputDateTimePicker.d.ts +2 -3
  9. package/dist/formFields/baseTypes/InputNumber/InputNumber.d.ts +2 -3
  10. package/dist/formFields/baseTypes/InputOutlinedInput/InputOutlinedInput.d.ts +2 -3
  11. package/dist/formFields/baseTypes/InputRadio/InputRadio.d.ts +3 -3
  12. package/dist/formFields/baseTypes/InputSelect/InputSelect.d.ts +3 -3
  13. package/dist/formFields/baseTypes/InputSelectFromEnum/InputSelectFromEnum.d.ts +2 -1
  14. package/dist/formFields/baseTypes/InputSlider/InputSlider.d.ts +2 -3
  15. package/dist/formFields/baseTypes/InputSwitch/InputSwitch.d.ts +2 -3
  16. package/dist/formFields/baseTypes/InputTextField/InputTextField.d.ts +3 -4
  17. package/dist/formFields/baseTypes/InputTimePicker/InputTimePicker.d.ts +2 -3
  18. package/dist/formFields/baseTypes/InputToggleButton/InputToggleButton.d.ts +2 -3
  19. package/dist/formFields/baseTypes/InputToggleButtonGroup/InputToggleButtonGroup.d.ts +2 -3
  20. package/dist/formFields/baseTypes/useEffectFieldUnregisterOnUnmount.d.ts +12 -0
  21. package/dist/formFields/formHelper/useHookForm.d.ts +7 -2
  22. package/dist/formFields/index.d.ts +1 -0
  23. package/dist/formFields/inputTypes.d.ts +1 -1
  24. package/dist/packageExports.d.ts +1 -1
  25. package/dist/packageExports.js +229 -66
  26. package/dist/packageExports.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Reexport of FormProvider.
4
3
  *
5
4
  * This became necessary as context is not available when the FormProvider is initialized outside of the package. Most likely this is some kind of instance mismatch.
6
5
  */
7
- export declare const HookFormProvider: <TFieldValues extends import("react-hook-form").FieldValues, TContext = any>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext>) => JSX.Element;
6
+ export declare const HookFormProvider: <TFieldValues extends import("react-hook-form").FieldValues, TContext = any, TTransformedValues extends import("react-hook-form").FieldValues | undefined = undefined>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
@@ -1,11 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from "@mui/material";
3
- import { FormField } from "../inputTypes";
3
+ import { BaseInputProps } from "../baseTypes/BaseInputProps";
4
4
  export interface InputEmailProps {
5
- formField: FormField;
6
5
  textFieldProps?: TextFieldProps;
7
6
  }
8
7
  /**
9
8
  * Renders a MUI input for an email address that is embedded in a react hook form context.
10
9
  */
11
- export declare const InputEmail: (props: InputEmailProps) => JSX.Element;
10
+ export declare const InputEmail: (props: BaseInputProps<InputEmailProps>) => JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { FormField } from "../inputTypes";
2
+ import { UnregisterOptions } from "./useEffectFieldUnregisterOnUnmount";
3
+ interface SharedProps {
4
+ /**
5
+ * The form field that the input is bound to.
6
+ *
7
+ * Central configurations like the name of the field, label and validations
8
+ * are stored here.
9
+ */
10
+ formField: FormField;
11
+ /**
12
+ * If true, the field will unregister when the component unmounts. In that
13
+ * case additional options for handling the unregistering can be passed in.
14
+ *
15
+ * @default false
16
+ */
17
+ isUnregisteringOnUnmount?: boolean;
18
+ }
19
+ interface UnregisterOnUnmountProps extends SharedProps {
20
+ isUnregisteringOnUnmount?: true;
21
+ /**
22
+ * Options for handling the current state when unregistering the field.
23
+ *
24
+ * Documentation: https://react-hook-form.com/docs/useform/unregister.
25
+ */
26
+ unregisterOptions?: UnregisterOptions;
27
+ }
28
+ interface DontUnregisterOnUnmountProps extends SharedProps {
29
+ isUnregisteringOnUnmount?: false;
30
+ unregisterOptions?: never;
31
+ }
32
+ export type BaseInputProps<T> = (T & UnregisterOnUnmountProps) | (T & DontUnregisterOnUnmountProps);
33
+ export {};
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
+ import { BaseInputProps } from "../BaseInputProps";
2
3
  import { InputAutocompleteProps } from "./InputAutocompleteInterfaces";
3
4
  /**
4
5
  * Renders a MUI autocomplete input that is embedded in a react hook form context.
5
6
  *
6
7
  * @throws Error when FormContext is null.
7
8
  */
8
- export declare const InputAutocomplete: <T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends import("react").ElementType<any> = "div">({ formField, selectableOptions, noOptions, autoCompleteProps, checkboxesForMultiselect: renderCheckboxes, groupSorting, inputTextFieldProps, }: InputAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>) => JSX.Element;
9
+ export declare const InputAutocomplete: <T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends import("react").ElementType<any> = "div">({ formField, selectableOptions, noOptions, autoCompleteProps, checkboxesForMultiselect: renderCheckboxes, groupSorting, inputTextFieldProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputAutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>>) => JSX.Element;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { AutocompleteProps, ChipTypeMap, TextFieldProps } from "@mui/material";
3
- import { FormField, LabeledValueWithGrouping } from "../../inputTypes";
3
+ import { LabeledValueWithGrouping } from "../../inputTypes";
4
4
  import { GroupLabelSorting } from "./useSortedOptionsWithGroup";
5
5
  export interface CustomAutocompleteProps<T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> extends Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>, "renderInput" | "options"> {
6
6
  renderInput?: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>["renderInput"];
7
7
  }
8
8
  export interface InputAutocompleteProps<T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]> {
9
- formField: FormField;
10
9
  groupSorting?: GroupLabelSorting;
11
10
  selectableOptions: LabeledValueWithGrouping[];
12
11
  /**
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CheckboxProps, FormControlLabelProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputCheckboxProps {
5
- formField: FormField;
6
5
  checkboxProps?: Omit<CheckboxProps, "checked">;
7
6
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label">;
8
7
  /**
@@ -16,4 +15,4 @@ export interface InputCheckboxProps {
16
15
  /**
17
16
  * Input for Checking a box indicating acceptance of something.
18
17
  */
19
- export declare const InputCheckbox: ({ formField, jsxLabel, checkboxProps, formControlLabelProps, }: InputCheckboxProps) => JSX.Element;
18
+ export declare const InputCheckbox: ({ formField, jsxLabel, checkboxProps, formControlLabelProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputCheckboxProps>) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { DatePickerProps as MuiDatePickerProps } from "@mui/x-date-pickers";
3
3
  import dayjs from "dayjs";
4
- import { FormField } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
5
5
  /**
6
6
  * Mangled version of the original DatePickerProps type
7
7
  * from @mui/x-date-pickers.
@@ -9,11 +9,10 @@ import { FormField } from "../../inputTypes";
9
9
  interface DatePickerProps extends Omit<MuiDatePickerProps<dayjs.Dayjs, false>, "label" | "onChange" | "value"> {
10
10
  }
11
11
  export interface InputDatePickerProps {
12
- formField: FormField;
13
12
  datePickerProps?: DatePickerProps;
14
13
  }
15
14
  /**
16
15
  * A Datetime picker that works with react hook form.
17
16
  */
18
- export declare const InputDatePicker: ({ formField, datePickerProps, }: InputDatePickerProps) => JSX.Element;
17
+ export declare const InputDatePicker: ({ formField, datePickerProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputDatePickerProps>) => JSX.Element;
19
18
  export {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { DateTimePickerProps as MuiDateTimePickerProps } from "@mui/x-date-pickers";
3
3
  import { Dayjs } from "dayjs";
4
- import { FormField } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
5
5
  /**
6
6
  * Mangled version of the original DateTimePickerProps type
7
7
  * from @mui/x-date-pickers.
@@ -9,11 +9,10 @@ import { FormField } from "../../inputTypes";
9
9
  interface DateTimePickerProps extends Omit<MuiDateTimePickerProps<Dayjs, false>, "label" | "onChange" | "value"> {
10
10
  }
11
11
  export interface InputDateTimePickerProps {
12
- formField: FormField;
13
12
  dateTimePickerProps?: DateTimePickerProps;
14
13
  }
15
14
  /**
16
15
  * A Datetime picker that works with react hook form.
17
16
  */
18
- export declare const InputDateTimePicker: ({ formField, dateTimePickerProps, }: InputDateTimePickerProps) => JSX.Element;
17
+ export declare const InputDateTimePicker: ({ formField, dateTimePickerProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputDateTimePickerProps>) => JSX.Element;
19
18
  export {};
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from "@mui/material";
3
3
  import { NumericFormatProps } from "react-number-format";
4
- import { FormField } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
5
5
  export interface InputNumberProps {
6
- formField: FormField;
7
6
  textFieldProps?: Omit<TextFieldProps, "required" | "label" | "value">;
8
7
  numericFormatProps?: Omit<NumericFormatProps, "customInput">;
9
8
  }
@@ -13,4 +12,4 @@ export interface InputNumberProps {
13
12
  *
14
13
  * @throws Error when FormContext is null.
15
14
  */
16
- export declare const InputNumber: ({ formField, textFieldProps, numericFormatProps, }: InputNumberProps) => JSX.Element | null;
15
+ export declare const InputNumber: ({ formField, textFieldProps, numericFormatProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputNumberProps>) => JSX.Element | null;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { OutlinedInputProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputOutlinedInputProps {
5
- formField: FormField;
6
5
  outlinedInputProps?: Omit<OutlinedInputProps, "required" | "label">;
7
6
  }
8
7
  /**
@@ -11,4 +10,4 @@ export interface InputOutlinedInputProps {
11
10
  *
12
11
  * @throws Error when FormContext is null.
13
12
  */
14
- export declare const InputOutlinedInput: ({ formField, outlinedInputProps, }: InputOutlinedInputProps) => JSX.Element | null;
13
+ export declare const InputOutlinedInput: ({ formField, outlinedInputProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputOutlinedInputProps>) => JSX.Element | null;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { FormControlLabelProps, RadioGroupProps } from "@mui/material";
3
- import { FormField, LabeledValue } from "../../inputTypes";
3
+ import { LabeledValue } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
4
5
  export interface InputRadioProps {
5
- formField: FormField;
6
6
  selectableOptions: LabeledValue[];
7
7
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label" | "value">;
8
8
  radioGroupProps?: RadioGroupProps;
@@ -10,4 +10,4 @@ export interface InputRadioProps {
10
10
  /**
11
11
  * Input for selecting between a list of options using radio buttons.
12
12
  */
13
- export declare const InputRadio: ({ formField, selectableOptions, formControlLabelProps, radioGroupProps, }: InputRadioProps) => JSX.Element;
13
+ export declare const InputRadio: ({ formField, selectableOptions, formControlLabelProps, radioGroupProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputRadioProps>) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectProps } from "@mui/material";
3
- import { FormField, LabeledValueWithGrouping } from "../../inputTypes";
3
+ import { LabeledValueWithGrouping } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
4
5
  export interface InputSelectProps {
5
- formField: FormField;
6
6
  selectableOptions: LabeledValueWithGrouping[];
7
7
  /**
8
8
  * Text of an disabled item that can be rendered above the selectable options.
@@ -23,4 +23,4 @@ export interface InputSelectProps {
23
23
  *
24
24
  * @throws Error when FormContext is null.
25
25
  */
26
- export declare const InputSelect: ({ formField, selectableOptions, optionsTitle, selectComponentProps, tooltipHolder, }: InputSelectProps) => JSX.Element;
26
+ export declare const InputSelect: ({ formField, selectableOptions, optionsTitle, selectComponentProps, tooltipHolder, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputSelectProps>) => JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { BaseInputProps } from "../BaseInputProps";
2
3
  import { InputSelectFromEnumProps } from "./InputSelectFromEnumInterfaces";
3
4
  /**
4
5
  * Renders a MUI select based on an enum that is embedded in a react hook form context.
5
6
  */
6
- export declare const InputSelectFromEnum: <EnumType extends Record<string, string>>(props: InputSelectFromEnumProps<EnumType>) => JSX.Element;
7
+ export declare const InputSelectFromEnum: <EnumType extends Record<string, string>>(props: BaseInputProps<InputSelectFromEnumProps<EnumType>>) => JSX.Element;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { SliderProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputSliderProps {
5
- formField: FormField;
6
5
  sliderProps?: Omit<SliderProps, "required" | "label">;
7
6
  }
8
7
  /**
@@ -11,4 +10,4 @@ export interface InputSliderProps {
11
10
  *
12
11
  * @throws Error when FormContext is null.
13
12
  */
14
- export declare const InputSlider: ({ formField, sliderProps, }: InputSliderProps) => JSX.Element | null;
13
+ export declare const InputSlider: ({ formField, sliderProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputSliderProps>) => JSX.Element | null;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { FormControlLabelProps, SwitchProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputSwitchProps {
5
- formField: FormField;
6
5
  switchProps?: Omit<SwitchProps, "checked">;
7
6
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label">;
8
7
  }
9
8
  /**
10
9
  * Input for Checking a box indicating acceptance of something.
11
10
  */
12
- export declare const InputSwitch: ({ formField, switchProps, formControlLabelProps, }: InputSwitchProps) => JSX.Element;
11
+ export declare const InputSwitch: ({ formField, switchProps, formControlLabelProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputSwitchProps>) => JSX.Element;
@@ -1,14 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { TextFieldProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputTextFieldProps {
5
- formField: FormField;
6
5
  textFieldProps?: Omit<TextFieldProps, "required" | "label">;
7
6
  }
8
7
  /**
9
- * Renders a MUI input text fields that is embedded in a react
8
+ * Renders a MUI input text field that is embedded in a react
10
9
  * hook form context.
11
10
  *
12
11
  * @throws Error when FormContext is null.
13
12
  */
14
- export declare const InputTextField: ({ formField, textFieldProps, }: InputTextFieldProps) => JSX.Element | null;
13
+ export declare const InputTextField: ({ formField, textFieldProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputTextFieldProps>) => JSX.Element | null;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TimePickerProps } from "@mui/x-date-pickers";
3
3
  import dayjs from "dayjs";
4
- import { FormField } from "../../inputTypes";
4
+ import { BaseInputProps } from "../BaseInputProps";
5
5
  /**
6
6
  * Mangled version of the original DateTimePickerProps type
7
7
  * from @mui/x-date-pickers.
@@ -9,11 +9,10 @@ import { FormField } from "../../inputTypes";
9
9
  interface MangledTimePickerProps extends Omit<TimePickerProps<dayjs.Dayjs>, "label" | "onChange" | "value"> {
10
10
  }
11
11
  export interface InputTimePickerProps {
12
- formField: FormField;
13
12
  timePickerProps?: MangledTimePickerProps;
14
13
  }
15
14
  /**
16
15
  * A Datetime picker that works with react hook form.
17
16
  */
18
- export declare const InputTimePicker: ({ formField, timePickerProps, }: InputTimePickerProps) => JSX.Element;
17
+ export declare const InputTimePicker: ({ formField, timePickerProps, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputTimePickerProps>) => JSX.Element;
19
18
  export {};
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { FormControlLabelProps, ToggleButtonProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputToggleButtonProps {
5
- formField: FormField;
6
5
  toggleButtonProps?: Omit<ToggleButtonProps, "children" | "value">;
7
6
  formControlLabelProps?: Omit<FormControlLabelProps, "control" | "label">;
8
7
  children: React.ReactNode;
@@ -10,4 +9,4 @@ export interface InputToggleButtonProps {
10
9
  /**
11
10
  * Input Toggle button.
12
11
  */
13
- export declare const InputToggleButton: ({ formField, toggleButtonProps, formControlLabelProps, children, }: InputToggleButtonProps) => JSX.Element;
12
+ export declare const InputToggleButton: ({ formField, toggleButtonProps, formControlLabelProps, children, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputToggleButtonProps>) => JSX.Element;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { StackProps, ToggleButtonGroupProps, ToggleButtonProps, TypographyProps } from "@mui/material";
3
- import { FormField } from "../../inputTypes";
3
+ import { BaseInputProps } from "../BaseInputProps";
4
4
  export interface InputToggleButtonGroupProps {
5
- formField: FormField;
6
5
  toggleButtonGroupProps?: Omit<ToggleButtonGroupProps, "onChange" | "value">;
7
6
  /**
8
7
  * Props for the Stack component acting as the label-element.
@@ -32,4 +31,4 @@ export interface SingleToggleButton {
32
31
  /**
33
32
  * Input for a toggle button group.
34
33
  */
35
- export declare const InputToggleButtonGroup: ({ formField, toggleButtonGroupProps, stackProps, typographyProps, buttons, enforceValueSelected, }: InputToggleButtonGroupProps) => JSX.Element;
34
+ export declare const InputToggleButtonGroup: ({ formField, toggleButtonGroupProps, stackProps, typographyProps, buttons, enforceValueSelected, unregisterOptions, isUnregisteringOnUnmount, }: BaseInputProps<InputToggleButtonGroupProps>) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { UseFormUnregister } from "react-hook-form";
2
+ export type UnregisterOptions = Parameters<UseFormUnregister<any>>[1];
3
+ /**
4
+ * An effect that unregisters a field from the form when the component unmounts.
5
+ *
6
+ * @throws Error when FormContext is null.
7
+ */
8
+ export declare const useEffectFieldUnregisterOnUnmount: ({ name, unregisterOptions, isUnregisteringOnUnmount, }: {
9
+ name: string;
10
+ isUnregisteringOnUnmount?: boolean | undefined;
11
+ unregisterOptions?: UnregisterOptions;
12
+ }) => void;
@@ -24,10 +24,12 @@ export type FormReturn<TFieldValues extends FieldValues> = UseFormReturn<TFieldV
24
24
  * function on top which is used to validate field names.
25
25
  */
26
26
  export declare const useHookForm: <TFieldValues extends FieldValues>(props?: Partial<{
27
- mode: keyof import("react-hook-form").ValidationMode;
27
+ mode: "onBlur" | "onChange" | "onSubmit" | "all" | "onTouched";
28
+ disabled: boolean;
28
29
  reValidateMode: "onBlur" | "onChange" | "onSubmit";
29
- defaultValues: import("react-hook-form").DeepPartial<TFieldValues> | ((payload?: unknown) => Promise<TFieldValues>);
30
+ defaultValues: ((payload?: unknown) => Promise<TFieldValues>) | import("react-hook-form").DefaultValues<TFieldValues>;
30
31
  values: TFieldValues;
32
+ errors: import("react-hook-form").FieldErrors<TFieldValues>;
31
33
  resetOptions: Partial<{
32
34
  keepDirtyValues: boolean;
33
35
  keepErrors: boolean;
@@ -35,7 +37,9 @@ export declare const useHookForm: <TFieldValues extends FieldValues>(props?: Par
35
37
  keepValues: boolean;
36
38
  keepDefaultValues: boolean;
37
39
  keepIsSubmitted: boolean;
40
+ keepIsSubmitSuccessful: boolean;
38
41
  keepTouched: boolean;
42
+ keepIsValidating: boolean;
39
43
  keepIsValid: boolean;
40
44
  keepSubmitCount: boolean;
41
45
  }> | undefined;
@@ -44,6 +48,7 @@ export declare const useHookForm: <TFieldValues extends FieldValues>(props?: Par
44
48
  shouldFocusError: boolean;
45
49
  shouldUnregister: boolean;
46
50
  shouldUseNativeValidation: boolean;
51
+ progressive: boolean;
47
52
  criteriaMode: import("react-hook-form").CriteriaMode;
48
53
  delayError: number;
49
54
  }> | undefined) => FormReturn<TFieldValues>;
@@ -1,5 +1,6 @@
1
1
  export { InputAutocomplete } from "./baseTypes/InputAutocomplete/InputAutocomplete";
2
2
  export type { InputAutocompleteProps } from "./baseTypes/InputAutocomplete/InputAutocompleteInterfaces";
3
+ export type { GroupLabelSorting } from "./baseTypes/InputAutocomplete/useSortedOptionsWithGroup";
3
4
  export { InputCheckbox } from "./baseTypes/InputCheckbox/InputCheckbox";
4
5
  export type { InputCheckboxProps } from "./baseTypes/InputCheckbox/InputCheckbox";
5
6
  export { InputDatePicker } from "./baseTypes/InputDatePicker/InputDatePicker";
@@ -7,7 +7,7 @@ import { TranslatedString } from "./TranslatedString";
7
7
  */
8
8
  export interface LabeledValue {
9
9
  label: string;
10
- value: string | number;
10
+ value: string | number | boolean;
11
11
  /**
12
12
  * A string can be provided to indicate a reason for being disabled.
13
13
  */
@@ -2,7 +2,7 @@
2
2
  * This is the main package file, containing everything that our package exports.
3
3
  */
4
4
  export { HookFormProvider, InputAutocomplete, InputCheckbox, InputDatePicker, InputDateTimePicker, InputEmail, InputNumber, InputOutlinedInput, InputPasswordSet, InputRadio, InputSelect, InputSelectFromEnum, InputSlider, InputSwitch, InputText, InputTextField, InputTimePicker, InputToggleButton, InputToggleButtonGroup, getFormErrorForNestedKeys, syncSubmit, useFormFieldError, useFormFieldHasError, useHookForm, useHookFormContext, useMergedFormField, useSortedOptionsWithGroup, useTranslateString, } from "./formFields";
5
- export type { FieldNameGetter, FormField, FormFieldTranslated, FormReturn, FormSubmitHandler, FormSubmitHandlerAsync, InputAutocompleteProps, InputCheckboxProps, InputDatePickerProps, InputDateTimePickerProps, InputEmailProps, InputNumberProps, InputOutlinedInputProps, InputPasswordSetProps, InputRadioProps, InputSelectFromEnumProps, InputSelectProps, InputSliderProps, InputSwitchProps, InputTextFieldProps, InputTextProps, InputTimePickerProps, InputToggleButtonGroupProps, InputToggleButtonProps, LabeledValue, LabeledValueWithGrouping, SingleToggleButton, TranslatedString, TranslatedValidate, } from "./formFields/";
5
+ export type { FieldNameGetter, FormField, FormFieldTranslated, FormReturn, FormSubmitHandler, FormSubmitHandlerAsync, GroupLabelSorting, InputAutocompleteProps, InputCheckboxProps, InputDatePickerProps, InputDateTimePickerProps, InputEmailProps, InputNumberProps, InputOutlinedInputProps, InputPasswordSetProps, InputRadioProps, InputSelectFromEnumProps, InputSelectProps, InputSliderProps, InputSwitchProps, InputTextFieldProps, InputTextProps, InputTimePickerProps, InputToggleButtonGroupProps, InputToggleButtonProps, LabeledValue, LabeledValueWithGrouping, SingleToggleButton, TranslatedString, TranslatedValidate, } from "./formFields/";
6
6
  export { FormFieldError } from "./formFields/errors/FormFieldError";
7
7
  export { FormFieldErrorDisplay } from "./formFields/errors/FormFieldErrorDisplay";
8
8
  export { LoadingButton, LoadingButtonState, loadingButtonStateFromFormState, loadingButtonStateFromReactQueryMutationStatus, useLoadingButtonStateFromFormContext, } from "./LoadingButton";