@nwon/react-mui-hook-form 1.0.0
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 +106 -0
- package/dist/LoadingButton/LoadingButton.d.ts +6 -0
- package/dist/LoadingButton/LoadingButtonInterfaces.d.ts +33 -0
- package/dist/LoadingButton/getLoadingButtonState.d.ts +20 -0
- package/dist/LoadingButton/index.d.ts +4 -0
- package/dist/formFields/HookFormProvider.d.ts +7 -0
- package/dist/formFields/InputEmail/InputEmail.d.ts +11 -0
- package/dist/formFields/InputPasswordSet/InputPasswordSet.d.ts +8 -0
- package/dist/formFields/InputPasswordSet/InputPasswordSetInterfaces.d.ts +15 -0
- package/dist/formFields/TranslatedString.d.ts +13 -0
- package/dist/formFields/baseTypes/InputAutocomplete/InputAutocomplete.d.ts +8 -0
- package/dist/formFields/baseTypes/InputAutocomplete/InputAutocompleteInterfaces.d.ts +22 -0
- package/dist/formFields/baseTypes/InputCheckbox/InputCheckbox.d.ts +16 -0
- package/dist/formFields/baseTypes/InputDateTimePicker/InputDateTimePicker.d.ts +12 -0
- package/dist/formFields/baseTypes/InputRadio/InputRadio.d.ts +10 -0
- package/dist/formFields/baseTypes/InputSelect/InputSelect.d.ts +16 -0
- package/dist/formFields/baseTypes/InputSelectFromEnum/InputSelectFromEnum.d.ts +6 -0
- package/dist/formFields/baseTypes/InputSelectFromEnum/InputSelectFromEnumInterfaces.d.ts +10 -0
- package/dist/formFields/baseTypes/InputText/InputText.d.ts +14 -0
- package/dist/formFields/errorMessages.d.ts +1 -0
- package/dist/formFields/formHelper/getFormError.d.ts +11 -0
- package/dist/formFields/formHelper/syncSubmit.d.ts +15 -0
- package/dist/formFields/formHelper/useHookForm.d.ts +50 -0
- package/dist/formFields/formHelper/useHookFormContext.d.ts +9 -0
- package/dist/formFields/formHelper/useMergedFormField.d.ts +6 -0
- package/dist/formFields/formHelper/useSortedOptionsWithGroup.d.ts +5 -0
- package/dist/formFields/formHelper/useTranslateString.d.ts +8 -0
- package/dist/formFields/index.d.ts +28 -0
- package/dist/formFields/inputTypes.d.ts +76 -0
- package/dist/packageExports.d.ts +7 -0
- package/dist/packageExports.js +727 -0
- package/dist/packageExports.js.map +1 -0
- package/license +9 -0
- package/package.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageExports.js","sources":["../../src/LoadingButton/LoadingButtonInterfaces.ts","../../src/LoadingButton/LoadingButton.tsx","../../src/LoadingButton/getLoadingButtonState.ts","../../src/formFields/HookFormProvider.tsx","../../src/formFields/errorMessages.ts","../../src/formFields/formHelper/getFormError.ts","../../src/formFields/formHelper/useTranslateString.ts","../../src/formFields/formHelper/useMergedFormField.ts","../../src/formFields/baseTypes/InputText/InputText.tsx","../../src/formFields/InputEmail/InputEmail.tsx","../../src/formFields/InputPasswordSet/InputPasswordSet.tsx","../../src/formFields/baseTypes/InputAutocomplete/InputAutocomplete.tsx","../../src/formFields/baseTypes/InputCheckbox/InputCheckbox.tsx","../../src/formFields/baseTypes/InputDateTimePicker/InputDateTimePicker.tsx","../../src/formFields/baseTypes/InputRadio/InputRadio.tsx","../../src/formFields/formHelper/useSortedOptionsWithGroup.ts","../../src/formFields/baseTypes/InputSelect/InputSelect.tsx","../../src/formFields/baseTypes/InputSelectFromEnum/InputSelectFromEnum.tsx","../../src/formFields/formHelper/syncSubmit.ts","../../src/formFields/formHelper/useHookForm.ts","../../src/formFields/formHelper/useHookFormContext.ts"],"sourcesContent":["import { LoadingButtonProps as MuiLoadingButtonProps } from \"@mui/lab\";\nimport { ReactElement } from \"react\";\n\nexport enum LoadingButtonState {\n Idle = \"idle\",\n Loading = \"loading\",\n Success = \"success\",\n}\n\ntype SelectedButtonProps = Omit<MuiLoadingButtonProps, \"children\">;\n\nexport interface LoadingButtonProps {\n buttonState: LoadingButtonState;\n /**\n * Button label.\n */\n buttonText: string;\n /**\n * Button label that is displayed on success.\n */\n buttonTextSuccess?: string;\n /**\n * Provide an icon that is displayed in front of the text\n * when state is successful.\n */\n successIcon?: JSX.Element | ReactElement;\n /**\n * Adjust the button when the state is any other than successful.\n */\n loadingButtonProps?: SelectedButtonProps;\n /**\n * Adjust the button when the state is successful.\n */\n loadingButtonPropsPropsSuccess?: SelectedButtonProps;\n}\n","import { LoadingButton as MuiLoadingButton } from \"@mui/lab\";\nimport {\n LoadingButtonProps,\n LoadingButtonState,\n} from \"./LoadingButtonInterfaces\";\n\n/**\n * A loading button component.\n */\nexport const LoadingButton = ({\n buttonText,\n buttonTextSuccess,\n loadingButtonProps,\n loadingButtonPropsPropsSuccess,\n buttonState,\n successIcon,\n}: LoadingButtonProps): JSX.Element => {\n const isSuccess = buttonState === LoadingButtonState.Success;\n\n const propsToSpread = isSuccess\n ? loadingButtonPropsPropsSuccess\n : loadingButtonProps;\n\n return (\n <MuiLoadingButton\n loading={buttonState === LoadingButtonState.Loading}\n disabled={buttonState !== LoadingButtonState.Idle}\n {...propsToSpread}\n >\n {buttonState === LoadingButtonState.Success ? (\n <>\n {successIcon ? successIcon : null}\n\n {buttonTextSuccess ? buttonTextSuccess : buttonText}\n </>\n ) : (\n buttonText\n )}\n </MuiLoadingButton>\n );\n};\n","import { FormState, useFormContext } from \"react-hook-form\";\nimport { LoadingButtonState } from \"./LoadingButtonInterfaces\";\n\n/**\n * Redefinition of mutation status defined by react query. By doing this\n * we don't need to import react-query in the package.\n */\ndeclare type MutationStatus = \"idle\" | \"loading\" | \"success\" | \"error\";\n\n/**\n * Get loading button state from react-query mutation status.\n */\nexport const loadingButtonStateFromReactQueryMutationStatus = (\n mutationStatus: MutationStatus\n): LoadingButtonState => {\n const mapStatus: Record<MutationStatus, LoadingButtonState> = {\n idle: LoadingButtonState.Idle,\n error: LoadingButtonState.Idle,\n success: LoadingButtonState.Success,\n loading: LoadingButtonState.Loading,\n };\n\n return mapStatus[mutationStatus];\n};\n\n/**\n * Get loading button state from a react-hook-form context.\n */\nexport const useLoadingButtonStateFromFormContext = (): LoadingButtonState => {\n const formContext = useFormContext();\n\n return loadingButtonStateFromFormState(formContext.formState);\n};\n\n/**\n * Get loading button state from a react-hook-form state.\n */\nexport const loadingButtonStateFromFormState = (\n // we are not interested in the value types FormState holds\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formState: FormState<any>\n): LoadingButtonState => {\n if (formState.isSubmitting) {\n return LoadingButtonState.Loading;\n }\n\n if (formState.isDirty) {\n return LoadingButtonState.Idle;\n }\n\n if (formState.isSubmitSuccessful) {\n return LoadingButtonState.Success;\n }\n\n return LoadingButtonState.Idle;\n};\n","import { FormProvider } from \"react-hook-form\";\n\n/**\n * Reexport of FormProvider.\n *\n * 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.\n */\nexport const HookFormProvider = FormProvider;\n","export const formContextNull =\n \"FormContext is null. This should not happen. You may need to use the HookFormProvider instead of the FormProvider exported by react-hook-form\";\n","import { AnyObject } from \"@nvon/baseline\";\nimport { FieldError, FormState } from \"react-hook-form\";\n\n/**\n * Get the field errors for a (possibly nested) field name.\n *\n * Checking `formState.errors[fieldName]` only works if fieldName is not a path\n * (e.g. Does not include dots).\n *\n * Did not find a built-in way to do this … there might be one though.\n */\nexport const getFormError = (\n errors: FormState<AnyObject>[\"errors\"],\n fieldName: string\n): FieldError | undefined => {\n const nestedKeys = fieldName.split(\".\");\n\n //\n // To my best knowledge, this works as expected.\n //\n // It recursively walks the error object by the given keys\n // until the lowest level is reached, or undefined returned.\n //\n // Typescript is just not very happy with the dynamic nature of this,\n // hence the errors.\n //\n\n /* eslint-disable @typescript-eslint/ban-ts-comment,@typescript-eslint/no-unsafe-return */\n // @ts-expect-error\n return nestedKeys.reduce(\n // @ts-expect-error\n (errorObj: FieldError | undefined, pathKey) => errorObj?.[pathKey],\n errors\n );\n /* eslint-enable */\n};\n","import { t, TFunction } from \"i18next\";\nimport { useCallback } from \"react\";\nimport { TranslatedString } from \"../TranslatedString\";\n\n/**\n * Return a function which turns our TranslatedString into a plain string.\n *\n * @throws Error if no t was provided but a translated string.\n */\nexport const useTranslateString = (): ((\n input: TranslatedString | string,\n t?: TFunction\n) => string) => {\n if (!t) {\n throw Error(\n \"If you pass in a translated validate function you need to provide a t\"\n );\n }\n\n return useCallback((input: TranslatedString | string) => {\n return typeof input === \"string\" ? input : input(t);\n }, []);\n};\n","import { uppercaseFirstLetter } from \"@nvon/baseline\";\nimport { TFunction } from \"i18next\";\nimport { useMemo } from \"react\";\nimport { RegisterOptions } from \"react-hook-form\";\nimport {\n FormField,\n FormFieldTranslated,\n TranslatedValidate,\n} from \"../inputTypes\";\nimport { useTranslateString } from \"./useTranslateString\";\n\n/**\n * Merge a form field with defaults.\n */\nexport const useMergedFormField = (\n /**\n * Form fields, typically those passed into a component.\n *\n */\n formField: FormField,\n t?: TFunction,\n /**\n * Additional defaults. Duplicate values will be overridden by the formField.\n */\n formFieldDefaults?: Partial<FormField>\n): FormFieldTranslated => {\n const translate = useTranslateString();\n\n const merged = useMemo(() => {\n const builtInDefaults = {\n label: uppercaseFirstLetter(formField.name),\n required: false,\n requiredErrorMessage: \"Please fill in required information\",\n validate: undefined,\n };\n\n return {\n ...builtInDefaults,\n ...formFieldDefaults,\n ...formField,\n };\n }, [formField, formFieldDefaults]);\n\n const withPlainStrings = useMemo(() => {\n // Translating the validate function is a bit tricky,\n // since it can be an object in both cases.\n const validate = (() => {\n if (\n typeof merged.validate === \"object\" &&\n typeof merged.validate.translated === \"function\"\n ) {\n if (!t) {\n throw Error(\n \"If you pass in a translated validate function you need to provide a t\"\n );\n }\n\n return (merged.validate.translated as TranslatedValidate)(t);\n }\n\n return merged.validate;\n })() as RegisterOptions[\"validate\"]; // This should be fine. Not sure why TS is complaining.\n\n return {\n ...merged,\n label: translate(merged.label, t),\n requiredErrorMessage: translate(merged.requiredErrorMessage, t),\n validate,\n };\n }, [merged, t, translate]);\n\n return withPlainStrings;\n};\n","import {\n FormControl,\n FormHelperText,\n InputLabel,\n OutlinedInput,\n OutlinedInputProps,\n useFormControl,\n} from \"@mui/material\";\nimport { useFormContext } from \"react-hook-form\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputTextProps {\n formField: FormField;\n textFieldProps?: Omit<OutlinedInputProps, \"required\" | \"label\">;\n}\n\n/**\n * Renders a MUI input text fields that is embedded in a react\n * hook form context.\n *\n * @throws Error when FormContext is null.\n */\nexport const InputText = ({\n formField,\n textFieldProps,\n}: InputTextProps): JSX.Element | null => {\n const form = useFormContext();\n const muiFormControl = useFormControl();\n\n const { label, name, required, requiredErrorMessage, validate } =\n useMergedFormField(formField, formField.t);\n\n if (!form) {\n throw Error(formContextNull);\n }\n\n const { register, formState } = form;\n const error = getFormError(formState.errors, formField.name);\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <InputLabel required={required}>{label}</InputLabel>\n\n <OutlinedInput\n {...register(name, {\n required: required ? requiredErrorMessage : false,\n validate,\n disabled: muiFormControl?.disabled,\n })}\n required={required}\n label={label}\n {...textFieldProps}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import { InputText, InputTextProps } from \"../baseTypes/InputText/InputText\";\nimport { useMergedFormField } from \"../formHelper/useMergedFormField\";\nimport { FormField } from \"../inputTypes\";\n\nexport interface InputEmailProps {\n formField: FormField;\n textFieldProps?: InputTextProps[\"textFieldProps\"];\n}\n\n/**\n * Renders a MUI input for an email address that is embedded in a react hook form context.\n */\nexport const InputEmail = (props: InputEmailProps): JSX.Element => {\n const merged = useMergedFormField(\n props.formField,\n props.formField.t,\n formDefaults\n );\n\n return (\n <InputText\n textFieldProps={{\n type: \"email\",\n ...props.textFieldProps,\n }}\n formField={merged}\n />\n );\n};\n\nconst formDefaults: Omit<FormField, \"name\" | \"t\"> = {\n required: true,\n validate: (emailInput: string) => {\n if (emailInput.match(/.@./)) {\n return true;\n }\n\n return \"E-Mail address invalid\";\n },\n};\n","import { useCallback } from \"react\";\nimport {\n RegisterOptions,\n useFormContext,\n ValidateResult,\n} from \"react-hook-form\";\nimport { InputText } from \"../baseTypes/InputText/InputText\";\nimport { useMergedFormField } from \"../formHelper/useMergedFormField\";\nimport { InputPasswordSetProps } from \"./InputPasswordSetInterfaces\";\n\n/**\n * Two fields for setting a password set: input & validation.\n *\n * Checks for equality of both.\n */\nexport const InputPasswordSet = ({\n passwordField,\n passwordValidationField,\n doNotMatchError,\n}: InputPasswordSetProps): JSX.Element => {\n const { watch } = useFormContext();\n\n const passwordFieldMerged = useMergedFormField(\n passwordField,\n passwordField.t,\n { required: true }\n );\n const validationFieldMerged = useMergedFormField(\n passwordValidationField,\n passwordValidationField.t,\n { required: true }\n );\n\n const validatePasswordMatch: RegisterOptions[\"validate\"] = useCallback(\n (value: string): ValidateResult => {\n const passwordValue = watch(passwordFieldMerged.name) as string;\n\n return value === passwordValue || doNotMatchError;\n },\n [doNotMatchError, passwordFieldMerged.name, watch]\n );\n\n return (\n <>\n <InputText\n formField={passwordFieldMerged}\n textFieldProps={{\n type: \"password\",\n }}\n />\n\n <InputText\n formField={{\n ...validationFieldMerged,\n validate: validatePasswordMatch,\n t: passwordValidationField.t,\n }}\n textFieldProps={{\n type: \"password\",\n }}\n />\n </>\n );\n};\n","import {\n Autocomplete,\n FormControl,\n FormHelperText,\n TextField,\n useFormControl,\n} from \"@mui/material\";\nimport { assertTruthy, objectHasKey } from \"@nvon/baseline\";\nimport { useMemo } from \"react\";\nimport { useFormContext } from \"react-hook-form\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField, LabeledValue } from \"../../inputTypes\";\nimport { InputAutocompleteProps } from \"./InputAutocompleteInterfaces\";\n\n/**\n * Renders a MUI autocomplete input that is embedded in a react hook form context.\n *\n * @throws Error when FormContext is null.\n */\nexport const InputAutocomplete = ({\n formField,\n selectableOptions,\n multiSelect,\n noOptions,\n autoCompleteProps,\n}: InputAutocompleteProps): JSX.Element => {\n const form = useFormContext();\n\n if (!form) {\n throw Error(formContextNull);\n }\n\n const { register, watch, formState, setValue } = form;\n\n const error = getFormError(formState.errors, formField.name);\n const muiFormControl = useFormControl();\n\n const { label, name, required, requiredErrorMessage, validate }: FormField =\n useMergedFormField(formField, formField.t);\n\n const value = watch(name) as string | number | string[] | undefined;\n\n let valueToUse = value;\n if (!value) {\n valueToUse = multiSelect ? [] : \"\";\n }\n\n assertTruthy(\n [\"string\", \"number\", \"object\"].includes(typeof valueToUse),\n \"Value for select input has unexpected type\"\n );\n\n const props = register(name, {\n required: required ? requiredErrorMessage : false,\n validate,\n disabled: muiFormControl?.disabled,\n });\n\n const currentValue = useMemo(\n () =>\n multiSelect\n ? selectableOptions.filter((o) => {\n if (Array.isArray(valueToUse)) {\n return valueToUse.includes(o.value as never);\n }\n\n return valueToUse;\n })\n : valueToUse,\n [multiSelect, selectableOptions, valueToUse]\n );\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <Autocomplete\n options={selectableOptions}\n multiple={multiSelect}\n value={currentValue}\n label={label}\n {...props}\n getOptionLabel={(o) => {\n if (objectHasKey(o, \"label\")) {\n return o.label;\n }\n\n return \"\";\n }}\n onChange={(e, selectedOption: LabeledValue | LabeledValue[]) => {\n if (Array.isArray(selectedOption)) {\n setValue(\n name,\n selectedOption.map((o) => o.value)\n );\n } else {\n setValue(name, selectedOption.value);\n }\n }}\n noOptionsText={noOptions}\n renderInput={(params) => (\n <TextField {...params} label={label} variant=\"outlined\" />\n )}\n // need to parse this as any in order to get no typing errors\n // for multiselect\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {...(autoCompleteProps as any)}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import {\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n useFormControl,\n} from \"@mui/material\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputCheckboxProps {\n formField: FormField;\n /**\n * In contrast to other FormFields,\n * the checkbox supports jsx elements as a label.\n *\n * If this is provided, formField.label will be ignored.\n */\n jsxLabel?: JSX.Element;\n}\n\n/**\n * Input for Checking a box indicating acceptance of something.\n */\nexport const InputCheckbox = ({\n formField,\n jsxLabel,\n}: InputCheckboxProps): JSX.Element => {\n const { register, watch, setValue } = useFormContext();\n const { errors } = useFormState();\n\n const error = getFormError(errors, formField.name);\n const muiFormControl = useFormControl();\n\n const { label, name, required, requiredErrorMessage, validate }: FormField =\n useMergedFormField(formField);\n\n const changeEv = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setValue(name, e.target.checked, {\n shouldValidate: true,\n shouldDirty: true,\n shouldTouch: true,\n });\n },\n [name, setValue]\n );\n\n const id = `rvo-input-checkbox-${name}`;\n\n const registered = register(name, {\n required: required ? requiredErrorMessage : false,\n onChange: changeEv,\n validate,\n disabled: muiFormControl?.disabled,\n });\n\n const value = (watch(name, false) as boolean | undefined) ?? false;\n\n return (\n <FormControl error={!!error} disabled={muiFormControl?.disabled}>\n <FormControlLabel\n required={jsxLabel ? false : required} // If jsxLabel is set, we don't want to show the asterisk.\n control={\n <Checkbox checked={value} aria-labelledby={id} {...registered} />\n }\n label={jsxLabel ?? label}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import {\n Box,\n FormControl,\n FormHelperText,\n TextField,\n TextFieldProps,\n useFormControl,\n} from \"@mui/material\";\nimport { DateTimePicker, DateTimePickerProps } from \"@mui/x-date-pickers\";\nimport { useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputDateTimePickerProps {\n formField: FormField;\n dateTimePickerProps?: Pick<\n DateTimePickerProps<TextFieldProps, TextFieldProps>,\n \"ampm\"\n >;\n}\n\n/**\n * A Datetime picker that works with react hook form.\n */\nexport const InputDateTimePicker = ({\n formField,\n dateTimePickerProps,\n}: InputDateTimePickerProps): JSX.Element => {\n const { formState, control } = useFormContext();\n const error = getFormError(formState.errors, formField.name);\n const muiFormControl = useFormControl();\n\n const { label, name, required } = useMergedFormField(formField);\n\n const [date, setDate] = useState<Date>(new Date());\n\n return (\n <Box>\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <Controller\n name={name}\n defaultValue={date}\n control={control}\n render={({ field: { onChange, ...restField } }) => (\n <DateTimePicker\n label={label}\n ampm={\n dateTimePickerProps?.ampm ? dateTimePickerProps.ampm : false\n }\n onChange={(event: Date | null) => {\n onChange(event);\n\n if (event) {\n setDate(event);\n }\n }}\n disabled={muiFormControl?.disabled}\n renderInput={(params) => (\n <TextField required={required} {...params} />\n )}\n {...restField}\n />\n )}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n </Box>\n );\n};\n","import {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n useFormControl,\n} from \"@mui/material\";\nimport { assertTruthy } from \"@nvon/baseline\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField, LabeledValue } from \"../../inputTypes\";\n\nexport interface InputRadioProps {\n formField: FormField;\n selectableOptions: LabeledValue[];\n}\n\n/**\n * Input for selecting between a list of options using radio buttons.\n */\nexport const InputRadio = ({\n formField,\n selectableOptions,\n}: InputRadioProps): JSX.Element => {\n const { register, watch, setValue } = useFormContext();\n const { errors } = useFormState();\n\n const error = getFormError(errors, formField.name);\n const muiFormControl = useFormControl();\n\n const { label, name, required, requiredErrorMessage, validate }: FormField =\n useMergedFormField(formField);\n\n const changeEv = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setValue(name, e.target.value, {\n shouldValidate: true,\n shouldDirty: true,\n shouldTouch: true,\n });\n },\n [name, setValue]\n );\n\n const value = (watch(name) as string | number | undefined) ?? \"\";\n\n assertTruthy(\n [\"string\", \"number\"].includes(typeof value),\n \"Value for select input has unexpected type\"\n );\n\n const id = `rvo-input-radio-${name}`;\n\n const registered = register(name, {\n required: required ? requiredErrorMessage : false,\n onChange: changeEv,\n validate,\n disabled: muiFormControl?.disabled,\n });\n\n return (\n <FormControl error={!!error} disabled={muiFormControl?.disabled}>\n <FormLabel id={id} required={required}>\n {label}\n </FormLabel>\n\n <RadioGroup value={value} aria-labelledby={id}>\n {selectableOptions?.map((option) => {\n return (\n <FormControlLabel\n {...registered}\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n );\n })}\n </RadioGroup>\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import { useMemo } from \"react\";\nimport { LabeledValueWithGrouping } from \"../inputTypes\";\n\n/**\n * Sorts the options by group and value.\n */\nexport const useSortedOptionsWithGroup = (\n selectableOptions: LabeledValueWithGrouping[]\n): LabeledValueWithGrouping[] => {\n return useMemo(\n () =>\n selectableOptions.sort((a, b) => {\n if (a.group == undefined && !!b.group) {\n return -1;\n }\n\n if (a.group && b.group && a.group < b.group) {\n return -1;\n }\n\n if (a.group == b.group && b.value > a.value) {\n return 1;\n }\n\n return 0;\n }),\n [selectableOptions]\n );\n};\n","import ErrorOutlineIcon from \"@mui/icons-material/ErrorOutline\";\nimport {\n Box,\n FormControl,\n FormHelperText,\n InputLabel,\n ListSubheader,\n MenuItem,\n Select,\n SelectProps,\n Stack,\n Tooltip,\n useFormControl,\n} from \"@mui/material\";\nimport { assertTruthy } from \"@nvon/baseline\";\nimport { useFormContext } from \"react-hook-form\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormError } from \"../../formHelper/getFormError\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { useSortedOptionsWithGroup } from \"../../formHelper/useSortedOptionsWithGroup\";\nimport { FormField, LabeledValueWithGrouping } from \"../../inputTypes\";\n\nexport interface InputSelectProps {\n formField: FormField;\n selectableOptions: LabeledValueWithGrouping[];\n placeholderText: string;\n selectComponentProps?: Pick<SelectProps, \"sx\">;\n}\n\n/**\n * Renders a MUI select based that is embedded in a react hook\n * form context.\n *\n * @throws Error when FormContext is null.\n */\nexport const InputSelect = ({\n formField,\n selectableOptions,\n placeholderText,\n selectComponentProps,\n}: InputSelectProps): JSX.Element => {\n const form = useFormContext();\n\n if (!form) {\n throw Error(formContextNull);\n }\n\n const { register, watch, formState } = form;\n\n const error = getFormError(formState.errors, formField.name);\n const muiFormControl = useFormControl();\n\n const { label, name, required, requiredErrorMessage, validate }: FormField =\n useMergedFormField(formField, formField.t);\n\n const value = (watch(name) as string | number | undefined) ?? \"\";\n assertTruthy(\n [\"string\", \"number\"].includes(typeof value),\n \"Value for select input has unexpected type\"\n );\n\n const id = `input-select-${name}`;\n const sortedOptions = useSortedOptionsWithGroup(selectableOptions);\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <InputLabel id={id} required={required}>\n {label}\n </InputLabel>\n\n <Select\n labelId={id}\n {...selectComponentProps}\n error={!!formState.errors[name]}\n label={label}\n value={value}\n {...register(name, {\n required: required ? requiredErrorMessage : false,\n validate,\n disabled: muiFormControl?.disabled,\n })}\n >\n <MenuItem value=\"\">\n <em>{placeholderText}</em>\n </MenuItem>\n\n {sortedOptions?.map((option, index) => {\n const optionBefore = sortedOptions[index - 1];\n const showGroup =\n (optionBefore || index == 0) &&\n option.group &&\n optionBefore?.group !== option.group;\n const disabledText =\n typeof option.disabled === \"string\" ? option.disabled : undefined;\n const isDisabled = !!disabledText || !!option.disabled;\n\n const menuItem = (\n <MenuItem\n key={option.label}\n value={option.value}\n disabled={isDisabled}\n title={\n typeof option.disabled === \"string\"\n ? option.disabled\n : undefined\n }\n selected={value === option.value}\n >\n {option.label}\n </MenuItem>\n );\n\n const wrappedMenuItem = disabledText ? (\n <Box sx={{ position: \"relative\" }}>\n {menuItem}\n\n <Stack\n direction=\"column\"\n justifyContent={\"center\"}\n spacing={1}\n sx={{\n position: \"absolute\",\n right: (th) => th.spacing(0.5),\n top: 0,\n bottom: 0,\n }}\n >\n <Tooltip title={disabledText}>\n <ErrorOutlineIcon />\n </Tooltip>\n </Stack>\n </Box>\n ) : (\n menuItem\n );\n\n return showGroup\n ? [\n <ListSubheader key={option.group}>\n {option.group}\n </ListSubheader>,\n wrappedMenuItem,\n ]\n : wrappedMenuItem;\n })}\n </Select>\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import { assertTruthy } from \"@nvon/baseline\";\nimport { useMemo } from \"react\";\nimport { LabeledValue } from \"../../inputTypes\";\nimport { InputSelect } from \"../InputSelect/InputSelect\";\nimport { InputSelectFromEnumProps } from \"./InputSelectFromEnumInterfaces\";\n\n/**\n * Renders a MUI select based on an enum that is embedded in a react hook form context.\n */\nexport const InputSelectFromEnum = <EnumType extends Record<string, string>>({\n enumData,\n formField,\n placeholderText,\n}: InputSelectFromEnumProps<EnumType>): JSX.Element => {\n const translateFunction = formField.t;\n\n const options: LabeledValue[] = useMemo(() => {\n return Object.entries(enumData.enumToUse).map(([, value]) => {\n const label = enumData.labelsForEnum[value];\n\n assertTruthy(label, \"Could not find a label for value\" + value);\n\n if (typeof label === \"string\") {\n return { label, value };\n }\n\n assertTruthy(\n translateFunction,\n \"If you want to use translated labels you need to provide a translate function in the HookFormProvider.\"\n );\n\n return {\n label: label(translateFunction),\n value,\n };\n });\n }, [enumData.enumToUse, enumData.labelsForEnum, translateFunction]);\n\n return (\n <InputSelect\n selectableOptions={options}\n formField={formField}\n placeholderText={placeholderText}\n />\n );\n};\n","import { rethrow } from \"@nvon/baseline\";\nimport { FormEvent } from \"react\";\n\nexport type FormSubmitHandlerAsync = (event?: FormEvent) => Promise<void>;\nexport type FormSubmitHandler = (event?: FormEvent) => void;\n\n/**\n * Turn an async submitHandler into a synchronous one.\n *\n * Reasoning:\n * - we're often talking to the API during form submission. The onSubmit handler will be returning a Promise in this case.\n * - the `form` element, per definition, always expects a synchronous function.\n * - creating on inline function in every form is a bit clumsy, and does not look clean.\n *\n * Then/catch cases should be properly handled by the submit handler itself,\n * the catch supplied here is only a last safety net against an \"unhandled promise rejection\" error.\n */\nexport const syncSubmit = (\n asyncSubmitHandler: FormSubmitHandlerAsync\n): FormSubmitHandler => {\n return (e) => {\n asyncSubmitHandler(e).catch(rethrow);\n };\n};\n","import { identity } from \"lodash-es\";\nimport {\n FieldPath,\n FieldValues,\n useForm,\n UseFormProps,\n UseFormReturn,\n} from \"react-hook-form\";\n\n/**\n * Gets a TypeScript-validated field name.\n */\nexport type FieldNameGetter<TFieldValues extends FieldValues> = (\n fieldName: FieldPath<TFieldValues>\n) => FieldPath<TFieldValues>;\n\n/**\n * Not sure what this represents,\n * but it's the seconds generic argument in RHFs type declarations.\n *\n * Using any here seems fine so far.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ReactHookFormContext = any;\n\n/**\n * The react-hook-form useForm returnType,\n * amended with our custom function to validate a field name.\n */\nexport type FormReturn<TFieldValues extends FieldValues> = UseFormReturn<\n TFieldValues,\n ReactHookFormContext\n> & {\n fieldName: FieldNameGetter<TFieldValues>;\n};\n\n/**\n * Wrapper around react-hook-form's useForm.\n *\n * Should behave like the original function, only exposing a \"fieldName\"\n * function on top which is used to validate field names.\n */\nexport const useHookForm = <TFieldValues extends FieldValues>(\n props?: UseFormProps<TFieldValues, ReactHookFormContext>\n): FormReturn<TFieldValues> => {\n const form = useForm<TFieldValues>(props);\n\n return {\n ...form,\n fieldName: identity,\n };\n};\n","import { identity } from \"lodash-es\";\nimport { FieldValues, useFormContext } from \"react-hook-form\";\nimport { FormReturn } from \"./useHookForm\";\n\n/**\n * Wrapper around react-hook-form's useFormContext.\n *\n * Should behave like the original function, only exposing a \"fieldName\"\n * function on top which is used to validate field names.\n */\nexport const useHookFormContext = <\n TFieldValues extends FieldValues\n>(): FormReturn<TFieldValues> => {\n const form = useFormContext<TFieldValues>();\n\n return {\n ...form,\n fieldName: identity,\n };\n};\n"],"names":["LoadingButtonState","LoadingButton","buttonText","buttonTextSuccess","loadingButtonProps","loadingButtonPropsPropsSuccess","buttonState","successIcon","isSuccess","Success","propsToSpread","_jsx","MuiLoadingButton","loading","Loading","disabled","Idle","children","_jsxs","_Fragment","loadingButtonStateFromReactQueryMutationStatus","mutationStatus","mapStatus","idle","error","success","useLoadingButtonStateFromFormContext","formContext","useFormContext","loadingButtonStateFromFormState","formState","isSubmitting","isDirty","isSubmitSuccessful","HookFormProvider","FormProvider","formContextNull","getFormError","errors","fieldName","nestedKeys","split","reduce","errorObj","pathKey","useTranslateString","t","Error","useCallback","input","useMergedFormField","formField","formFieldDefaults","translate","merged","useMemo","builtInDefaults","label","uppercaseFirstLetter","name","required","requiredErrorMessage","validate","undefined","withPlainStrings","translated","InputText","textFieldProps","form","muiFormControl","useFormControl","register","FormControl","InputLabel","OutlinedInput","message","FormHelperText","InputEmail","props","formDefaults","type","emailInput","match","InputPasswordSet","passwordField","passwordValidationField","doNotMatchError","watch","passwordFieldMerged","validationFieldMerged","validatePasswordMatch","value","passwordValue","InputAutocomplete","selectableOptions","multiSelect","noOptions","autoCompleteProps","setValue","valueToUse","assertTruthy","includes","currentValue","filter","o","Array","isArray","Autocomplete","options","multiple","getOptionLabel","objectHasKey","onChange","e","selectedOption","map","noOptionsText","renderInput","params","TextField","variant","InputCheckbox","jsxLabel","useFormState","changeEv","target","checked","shouldValidate","shouldDirty","shouldTouch","id","registered","FormControlLabel","control","Checkbox","InputDateTimePicker","dateTimePickerProps","date","setDate","useState","Date","Box","Controller","defaultValue","render","field","restField","DateTimePicker","ampm","event","InputRadio","FormLabel","RadioGroup","option","_createElement","key","Radio","useSortedOptionsWithGroup","sort","a","b","group","InputSelect","placeholderText","selectComponentProps","sortedOptions","Select","labelId","MenuItem","index","optionBefore","showGroup","disabledText","isDisabled","menuItem","title","selected","wrappedMenuItem","sx","position","Stack","direction","justifyContent","spacing","right","th","top","bottom","Tooltip","ErrorOutlineIcon","ListSubheader","InputSelectFromEnum","enumData","translateFunction","Object","entries","enumToUse","labelsForEnum","syncSubmit","asyncSubmitHandler","catch","rethrow","useHookForm","useForm","identity","useHookFormContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA,IAAYA,kBAIX,CAAA;AAJD,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACbA,EAAAA,kBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnBA,EAAAA,kBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACrB,CAAC,EAJWA,kBAAkB,KAAlBA,kBAAkB,GAI7B,EAAA,CAAA,CAAA;;ACEM,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,UAAU;EACVC,iBAAiB;EACjBC,kBAAkB;EAClBC,8BAA8B;EAC9BC,WAAW;AACXC,EAAAA,WAAAA;AAAW,CACQ,KAAiB;AACpC,EAAA,MAAMC,SAAS,GAAGF,WAAW,KAAKN,kBAAkB,CAACS,OAAO,CAAA;AAE5D,EAAA,MAAMC,aAAa,GAAGF,SAAS,GAC3BH,8BAA8B,GAC9BD,kBAAkB,CAAA;EAEtB,oBACEO,GAAA,CAACC,eAAgB,EAAA;AACfC,IAAAA,OAAO,EAAEP,WAAW,KAAKN,kBAAkB,CAACc,OAAQ;AACpDC,IAAAA,QAAQ,E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C,CAAC,CAAA;AACJ,GAAC,EAAE,CAACqG,QAAQ,CAACI,SAAS,EAAEJ,QAAQ,CAACK,aAAa,EAAEJ,iBAAiB,CAAC,CAAC,CAAA;EAEnE,oBACEtL,GAAA,CAACuJ,WAAW,EAAA;AACVpE,IAAAA,iBAAiB,EAAEc,OAAQ;AAC3BzD,IAAAA,SAAS,EAAEA,SAAU;AACrBgH,IAAAA,eAAe,EAAEA,eAAAA;GACjB,CAAA,CAAA;AAEN;;ACvCA;;;;;;;;;;AAUG;AACUmC,MAAAA,UAAU,GACrBC,kBAA0C,IACrB;AACrB,EAAA,OAAQtF,CAAC,IAAI;AACXsF,IAAAA,kBAAkB,CAACtF,CAAC,CAAC,CAACuF,KAAK,CAACC,OAAO,CAAC,CAAA;GACrC,CAAA;AACH;;ACaA;;;;;AAKG;AACUC,MAAAA,WAAW,GACtB5H,KAAwD,IAC5B;AAC5B,EAAA,MAAMV,IAAI,GAAGuI,OAAO,CAAe7H,KAAK,CAAC,CAAA;EAEzC,OAAO;AACL,IAAA,GAAGV,IAAI;AACP7B,IAAAA,SAAS,EAAEqK,QAAAA;GACZ,CAAA;AACH;;AC/CA;;;;;AAKG;AACUC,MAAAA,kBAAkB,GAAGA,MAEF;EAC9B,MAAMzI,IAAI,GAAGxC,cAAc,EAAgB,CAAA;EAE3C,OAAO;AACL,IAAA,GAAGwC,IAAI;AACP7B,IAAAA,SAAS,EAAEqK,QAAAA;GACZ,CAAA;AACH;;;;"}
|
package/license
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) NVON <team@nvon.com> (https://nvon.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@nwon/react-mui-hook-form","version":"1.0.0","type":"module","repository":{"type":"git","url":"https://gitlab.com/nwon-group/nwon-tooling/npm-packages/react-mui-hook-form"},"description":"Making react forms easy - A connection of MUI and React Hook Form","types":"dist/packageExports.d.ts","main":"dist/packageExports.js","cracoConfig":"craco.config.cjs","scripts":{},"files":["dist","readme.md","license"],"author":"NWON","license":"MIT","devDependencies":{"@babel/core":"^7.21.3","@babel/plugin-transform-runtime":"^7.21.0","@babel/preset-flow":"^7.18.6","@babel/preset-react":"^7.18.6","@craco/craco":"^6.4.3","@nvon/eslint-config":"^1.21.1","@nvon/node-toolbox":"^0.20.4","@rollup/plugin-babel":"^6.0.3","@types/lodash-es":"^4.17.6","@types/node":"^18.11.11","@types/react-dom":">=17.0.0","@types/webpack":"^4.41.32","cross-env":"^7.0.3","npm":"^9.5.0","react-scripts":"^4.0.3","rimraf":"^3.0.2","rollup":"^3.19.1","rollup-plugin-sass":"^1.12.17","rollup-plugin-typescript2":"^0.34.1","typescript":"^4.9.5"},"dependencies":{"@babel/runtime":"^7.21.0","@mui/icons-material":"^5.15.3","@mui/lab":"^5.0.0-alpha.134","@mui/material":"^5.13.5","@mui/x-date-pickers":"^5.0.20","@nvon/baseline":"^0.33.0","dayjs":"^1.11.10","fuse.js":"^6.5.3","i18next":"^22.4.10","lodash-es":"^4.17.21","react-hook-form":"^7.41.3","react-i18next":"^11.18.5"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}
|