@nwon/react-mui-hook-form 1.1.1 → 1.1.3
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/errors/FormFieldError.d.ts +9 -0
- package/dist/errors/FormFieldErrorDisplay.d.ts +9 -0
- package/dist/formFields/baseTypes/InputSelect/InputSelect.d.ts +5 -2
- package/dist/formFields/formHelper/{getFormError.d.ts → getFormErrorForNestedKeys.d.ts} +1 -1
- package/dist/formFields/index.d.ts +7 -7
- package/dist/packageExports.d.ts +4 -2
- package/dist/packageExports.js +239 -206
- package/dist/packageExports.js.map +1 -1
- package/package.json +79 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldError } from "react-hook-form";
|
|
3
|
+
/**
|
|
4
|
+
* Renders field errors in an opinionated way.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare const FormFieldErrorDisplay: ({ error, }: {
|
|
8
|
+
error: FieldError | FieldError[] | undefined;
|
|
9
|
+
}) => JSX.Element | null;
|
|
@@ -4,7 +4,10 @@ import { FormField, LabeledValueWithGrouping } from "../../inputTypes";
|
|
|
4
4
|
export interface InputSelectProps {
|
|
5
5
|
formField: FormField;
|
|
6
6
|
selectableOptions: LabeledValueWithGrouping[];
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Text of an disabled item that can be rendered above the selectable options.
|
|
9
|
+
*/
|
|
10
|
+
optionsTitle?: string;
|
|
8
11
|
selectComponentProps?: Omit<SelectProps, "labelId" | "error" | "label" | "value">;
|
|
9
12
|
/**
|
|
10
13
|
* Element that is rendered in the end of a select item and holds
|
|
@@ -20,4 +23,4 @@ export interface InputSelectProps {
|
|
|
20
23
|
*
|
|
21
24
|
* @throws Error when FormContext is null.
|
|
22
25
|
*/
|
|
23
|
-
export declare const InputSelect: ({ formField, selectableOptions,
|
|
26
|
+
export declare const InputSelect: ({ formField, selectableOptions, optionsTitle, selectComponentProps, tooltipHolder, }: InputSelectProps) => JSX.Element;
|
|
@@ -8,4 +8,4 @@ import { FieldError, FormState } from "react-hook-form";
|
|
|
8
8
|
*
|
|
9
9
|
* Did not find a built-in way to do this … there might be one though.
|
|
10
10
|
*/
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const getFormErrorForNestedKeys: (errors: FormState<AnyObject>["errors"], fieldName: string) => FieldError | FieldError[] | undefined;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export { HookFormProvider } from "./HookFormProvider";
|
|
2
|
-
export { InputEmail } from "./InputEmail/InputEmail";
|
|
3
|
-
export type { InputEmailProps } from "./InputEmail/InputEmail";
|
|
4
|
-
export { InputPasswordSet } from "./InputPasswordSet/InputPasswordSet";
|
|
5
|
-
export type { InputPasswordSetProps } from "./InputPasswordSet/InputPasswordSetInterfaces";
|
|
6
|
-
export type { TranslatedString } from "./TranslatedString";
|
|
7
1
|
export { InputAutocomplete } from "./baseTypes/InputAutocomplete/InputAutocomplete";
|
|
8
2
|
export type { InputAutocompleteProps } from "./baseTypes/InputAutocomplete/InputAutocompleteInterfaces";
|
|
9
3
|
export { InputCheckbox } from "./baseTypes/InputCheckbox/InputCheckbox";
|
|
@@ -22,7 +16,7 @@ export { InputSelectFromEnum } from "./baseTypes/InputSelectFromEnum/InputSelect
|
|
|
22
16
|
export type { InputSelectFromEnumProps } from "./baseTypes/InputSelectFromEnum/InputSelectFromEnumInterfaces";
|
|
23
17
|
export { InputTextField } from "./baseTypes/InputText/InputTextField";
|
|
24
18
|
export type { InputTextFieldProps } from "./baseTypes/InputText/InputTextField";
|
|
25
|
-
export { getFormError } from "./formHelper/
|
|
19
|
+
export { getFormErrorForNestedKeys as getFormError } from "./formHelper/getFormErrorForNestedKeys";
|
|
26
20
|
export { syncSubmit } from "./formHelper/syncSubmit";
|
|
27
21
|
export type { FormSubmitHandler, FormSubmitHandlerAsync, } from "./formHelper/syncSubmit";
|
|
28
22
|
export { useHookForm } from "./formHelper/useHookForm";
|
|
@@ -31,4 +25,10 @@ export { useHookFormContext } from "./formHelper/useHookFormContext";
|
|
|
31
25
|
export { useMergedFormField } from "./formHelper/useMergedFormField";
|
|
32
26
|
export { useSortedOptionsWithGroup } from "./formHelper/useSortedOptionsWithGroup";
|
|
33
27
|
export { useTranslateString } from "./formHelper/useTranslateString";
|
|
28
|
+
export { HookFormProvider } from "./HookFormProvider";
|
|
29
|
+
export { InputEmail } from "./InputEmail/InputEmail";
|
|
30
|
+
export type { InputEmailProps } from "./InputEmail/InputEmail";
|
|
31
|
+
export { InputPasswordSet } from "./InputPasswordSet/InputPasswordSet";
|
|
32
|
+
export type { InputPasswordSetProps } from "./InputPasswordSet/InputPasswordSetInterfaces";
|
|
34
33
|
export type { FormField, FormFieldTranslated, LabeledValue, LabeledValueWithGrouping, TranslatedValidate, } from "./inputTypes";
|
|
34
|
+
export type { TranslatedString } from "./TranslatedString";
|
package/dist/packageExports.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is the main package file, containing everything that our package exports.
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
4
|
+
export { FormFieldError } from "./errors/FormFieldError";
|
|
5
|
+
export { FormFieldErrorDisplay } from "./errors/FormFieldErrorDisplay";
|
|
6
6
|
export { HookFormProvider, InputAutocomplete, InputCheckbox, InputDatePicker, InputDateTimePicker, InputEmail, InputOutlinedInput, InputPasswordSet, InputRadio, InputSelect, InputSelectFromEnum, InputText, InputTextField, getFormError, syncSubmit, useHookForm, useHookFormContext, useMergedFormField, useSortedOptionsWithGroup, useTranslateString, } from "./formFields";
|
|
7
7
|
export type { FieldNameGetter, FormField, FormFieldTranslated, FormReturn, FormSubmitHandler, FormSubmitHandlerAsync, InputAutocompleteProps, InputCheckboxProps, InputDatePickerProps, InputDateTimePickerProps, InputEmailProps, InputOutlinedInputProps, InputPasswordSetProps, InputRadioProps, InputSelectFromEnumProps, InputSelectProps, InputTextFieldProps, InputTextProps, LabeledValue, LabeledValueWithGrouping, TranslatedString, TranslatedValidate, } from "./formFields/";
|
|
8
|
+
export { LoadingButton, LoadingButtonState, loadingButtonStateFromFormState, loadingButtonStateFromReactQueryMutationStatus, useLoadingButtonStateFromFormContext, } from "./LoadingButton";
|
|
9
|
+
export type { LoadingButtonProps } from "./LoadingButton";
|
package/dist/packageExports.js
CHANGED
|
@@ -9,88 +9,16 @@ function ___$insertStyle(css) {
|
|
|
9
9
|
return css;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { useFormContext, useFormState, Controller, useForm, FormProvider } from 'react-hook-form';
|
|
13
|
+
import { FormHelperText, useFormControl, Checkbox, FormControl, Autocomplete, TextField, FormControlLabel, Box, InputLabel, OutlinedInput, FormLabel, RadioGroup, Radio, Select, MenuItem, Stack, Tooltip, ListSubheader } from '@mui/material';
|
|
14
|
+
import { filterNoUndefinedNoNull, uppercaseFirstLetter, assertTruthy, objectHasKey, rethrow } from '@nvon/baseline';
|
|
13
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
-
import {
|
|
15
|
-
import { useFormControl, FormControl, InputLabel, OutlinedInput, FormHelperText, Checkbox, Autocomplete, TextField, FormControlLabel, Box, FormLabel, RadioGroup, Radio, Select, MenuItem, Stack, Tooltip, ListSubheader } from '@mui/material';
|
|
16
|
-
import { uppercaseFirstLetter, assertTruthy, objectHasKey, rethrow } from '@nvon/baseline';
|
|
16
|
+
import { CheckBoxOutlineBlank, CheckBox } from '@mui/icons-material';
|
|
17
17
|
import { useCallback, useMemo, useState, createElement } from 'react';
|
|
18
18
|
import { t } from 'i18next';
|
|
19
|
-
import { CheckBoxOutlineBlank, CheckBox } from '@mui/icons-material';
|
|
20
19
|
import { DatePicker, DateTimePicker } from '@mui/x-date-pickers';
|
|
21
20
|
import { identity } from 'lodash-es';
|
|
22
|
-
|
|
23
|
-
var LoadingButtonState;
|
|
24
|
-
(function (LoadingButtonState) {
|
|
25
|
-
LoadingButtonState["Idle"] = "idle";
|
|
26
|
-
LoadingButtonState["Loading"] = "loading";
|
|
27
|
-
LoadingButtonState["Success"] = "success";
|
|
28
|
-
})(LoadingButtonState || (LoadingButtonState = {}));
|
|
29
|
-
|
|
30
|
-
const LoadingButton = ({
|
|
31
|
-
buttonText,
|
|
32
|
-
buttonTextSuccess,
|
|
33
|
-
loadingButtonProps,
|
|
34
|
-
loadingButtonPropsPropsSuccess,
|
|
35
|
-
buttonState,
|
|
36
|
-
successIcon
|
|
37
|
-
}) => {
|
|
38
|
-
const isSuccess = buttonState === LoadingButtonState.Success;
|
|
39
|
-
const propsToSpread = isSuccess ? loadingButtonPropsPropsSuccess : loadingButtonProps;
|
|
40
|
-
return /*#__PURE__*/jsx(LoadingButton$1, {
|
|
41
|
-
loading: buttonState === LoadingButtonState.Loading,
|
|
42
|
-
disabled: buttonState !== LoadingButtonState.Idle,
|
|
43
|
-
...propsToSpread,
|
|
44
|
-
children: buttonState === LoadingButtonState.Success ? /*#__PURE__*/jsxs(Fragment, {
|
|
45
|
-
children: [successIcon ? successIcon : null, buttonTextSuccess ? buttonTextSuccess : buttonText]
|
|
46
|
-
}) : buttonText
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Get loading button state from react-query mutation status.
|
|
52
|
-
*/
|
|
53
|
-
const loadingButtonStateFromReactQueryMutationStatus = mutationStatus => {
|
|
54
|
-
const mapStatus = {
|
|
55
|
-
idle: LoadingButtonState.Idle,
|
|
56
|
-
error: LoadingButtonState.Idle,
|
|
57
|
-
success: LoadingButtonState.Success,
|
|
58
|
-
loading: LoadingButtonState.Loading
|
|
59
|
-
};
|
|
60
|
-
return mapStatus[mutationStatus];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Get loading button state from a react-hook-form context.
|
|
64
|
-
*/
|
|
65
|
-
const useLoadingButtonStateFromFormContext = () => {
|
|
66
|
-
const formContext = useFormContext();
|
|
67
|
-
return loadingButtonStateFromFormState(formContext.formState);
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Get loading button state from a react-hook-form state.
|
|
71
|
-
*/
|
|
72
|
-
const loadingButtonStateFromFormState = (
|
|
73
|
-
// we are not interested in the value types FormState holds
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
|
-
formState) => {
|
|
76
|
-
if (formState.isSubmitting) {
|
|
77
|
-
return LoadingButtonState.Loading;
|
|
78
|
-
}
|
|
79
|
-
if (formState.isDirty) {
|
|
80
|
-
return LoadingButtonState.Idle;
|
|
81
|
-
}
|
|
82
|
-
if (formState.isSubmitSuccessful) {
|
|
83
|
-
return LoadingButtonState.Success;
|
|
84
|
-
}
|
|
85
|
-
return LoadingButtonState.Idle;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Reexport of FormProvider.
|
|
90
|
-
*
|
|
91
|
-
* 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.
|
|
92
|
-
*/
|
|
93
|
-
const HookFormProvider = FormProvider;
|
|
21
|
+
import { LoadingButton as LoadingButton$1 } from '@mui/lab';
|
|
94
22
|
|
|
95
23
|
const formContextNull = "FormContext is null. This should not happen. You may need to use the HookFormProvider instead of the FormProvider exported by react-hook-form";
|
|
96
24
|
|
|
@@ -102,7 +30,7 @@ const formContextNull = "FormContext is null. This should not happen. You may ne
|
|
|
102
30
|
*
|
|
103
31
|
* Did not find a built-in way to do this … there might be one though.
|
|
104
32
|
*/
|
|
105
|
-
const
|
|
33
|
+
const getFormErrorForNestedKeys = (errors, fieldName) => {
|
|
106
34
|
const nestedKeys = fieldName.split(".");
|
|
107
35
|
//
|
|
108
36
|
// To my best knowledge, this works as expected.
|
|
@@ -121,6 +49,38 @@ const getFormError = (errors, fieldName) => {
|
|
|
121
49
|
/* eslint-enable */
|
|
122
50
|
};
|
|
123
51
|
|
|
52
|
+
const FormFieldErrorDisplay = ({
|
|
53
|
+
error
|
|
54
|
+
}) => {
|
|
55
|
+
if (Array.isArray(error)) {
|
|
56
|
+
return /*#__PURE__*/jsx(FormHelperText, {
|
|
57
|
+
children: error.map(e => e.message).filter(filterNoUndefinedNoNull).join(", ")
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (error?.message) {
|
|
61
|
+
return /*#__PURE__*/jsx(FormHelperText, {
|
|
62
|
+
children: error?.message
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const FormFieldError = ({
|
|
69
|
+
fieldName
|
|
70
|
+
}) => {
|
|
71
|
+
const form = useFormContext();
|
|
72
|
+
if (!form) {
|
|
73
|
+
throw Error(formContextNull);
|
|
74
|
+
}
|
|
75
|
+
const {
|
|
76
|
+
formState
|
|
77
|
+
} = form;
|
|
78
|
+
const error = getFormErrorForNestedKeys(formState.errors, fieldName);
|
|
79
|
+
return /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
80
|
+
error: error
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
124
84
|
/**
|
|
125
85
|
* Return a function which turns our TranslatedString into a plain string.
|
|
126
86
|
*
|
|
@@ -184,109 +144,6 @@ formFieldDefaults) => {
|
|
|
184
144
|
return withPlainStrings;
|
|
185
145
|
};
|
|
186
146
|
|
|
187
|
-
const InputOutlinedInput = ({
|
|
188
|
-
formField,
|
|
189
|
-
outlinedInputProps
|
|
190
|
-
}) => {
|
|
191
|
-
const form = useFormContext();
|
|
192
|
-
const muiFormControl = useFormControl();
|
|
193
|
-
const {
|
|
194
|
-
label,
|
|
195
|
-
name,
|
|
196
|
-
required,
|
|
197
|
-
requiredErrorMessage,
|
|
198
|
-
validate
|
|
199
|
-
} = useMergedFormField(formField, formField.t);
|
|
200
|
-
if (!form) {
|
|
201
|
-
throw Error(formContextNull);
|
|
202
|
-
}
|
|
203
|
-
const {
|
|
204
|
-
register,
|
|
205
|
-
formState
|
|
206
|
-
} = form;
|
|
207
|
-
const error = getFormError(formState.errors, formField.name);
|
|
208
|
-
return /*#__PURE__*/jsxs(FormControl, {
|
|
209
|
-
error: !!error,
|
|
210
|
-
required: required,
|
|
211
|
-
disabled: muiFormControl?.disabled,
|
|
212
|
-
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
213
|
-
required: required,
|
|
214
|
-
children: label
|
|
215
|
-
}), /*#__PURE__*/jsx(OutlinedInput, {
|
|
216
|
-
...register(name, {
|
|
217
|
-
required: required ? requiredErrorMessage : false,
|
|
218
|
-
validate,
|
|
219
|
-
disabled: muiFormControl?.disabled
|
|
220
|
-
}),
|
|
221
|
-
required: required,
|
|
222
|
-
label: label,
|
|
223
|
-
...outlinedInputProps
|
|
224
|
-
}), error?.message && /*#__PURE__*/jsx(FormHelperText, {
|
|
225
|
-
children: error?.message
|
|
226
|
-
})]
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
const InputEmail = props => {
|
|
231
|
-
const merged = useMergedFormField(props.formField, props.formField.t, formDefaults);
|
|
232
|
-
return /*#__PURE__*/jsx(InputOutlinedInput, {
|
|
233
|
-
outlinedInputProps: {
|
|
234
|
-
type: "email",
|
|
235
|
-
...props.outlinedInputProps,
|
|
236
|
-
autoComplete: "email"
|
|
237
|
-
},
|
|
238
|
-
formField: merged
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
const formDefaults = {
|
|
242
|
-
required: true,
|
|
243
|
-
validate: emailInput => {
|
|
244
|
-
if (emailInput.match(/.@./)) {
|
|
245
|
-
return true;
|
|
246
|
-
}
|
|
247
|
-
return "E-Mail address invalid";
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
const InputPasswordSet = ({
|
|
252
|
-
passwordField,
|
|
253
|
-
passwordValidationField,
|
|
254
|
-
doNotMatchError
|
|
255
|
-
}) => {
|
|
256
|
-
const {
|
|
257
|
-
watch
|
|
258
|
-
} = useFormContext();
|
|
259
|
-
const passwordFieldMerged = useMergedFormField(passwordField, passwordField.t, {
|
|
260
|
-
required: true
|
|
261
|
-
});
|
|
262
|
-
const validationFieldMerged = useMergedFormField(passwordValidationField, passwordValidationField.t, {
|
|
263
|
-
required: true
|
|
264
|
-
});
|
|
265
|
-
const validatePasswordMatch = useCallback(value => {
|
|
266
|
-
const passwordValue = watch(passwordFieldMerged.name);
|
|
267
|
-
return value === passwordValue || doNotMatchError;
|
|
268
|
-
}, [doNotMatchError, passwordFieldMerged.name, watch]);
|
|
269
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
270
|
-
children: [/*#__PURE__*/jsx(InputOutlinedInput, {
|
|
271
|
-
formField: passwordFieldMerged,
|
|
272
|
-
outlinedInputProps: {
|
|
273
|
-
type: "password",
|
|
274
|
-
autoComplete: "new-password"
|
|
275
|
-
}
|
|
276
|
-
}), /*#__PURE__*/jsx(InputOutlinedInput, {
|
|
277
|
-
formField: {
|
|
278
|
-
...validationFieldMerged,
|
|
279
|
-
validate: validatePasswordMatch,
|
|
280
|
-
t: passwordValidationField.t
|
|
281
|
-
},
|
|
282
|
-
outlinedInputProps: {
|
|
283
|
-
type: "password",
|
|
284
|
-
autoComplete: "new-password"
|
|
285
|
-
}
|
|
286
|
-
})]
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
|
|
290
147
|
var GroupLabelSorting;
|
|
291
148
|
(function (GroupLabelSorting) {
|
|
292
149
|
GroupLabelSorting["Alphabetical"] = "alphabetical";
|
|
@@ -371,7 +228,7 @@ const InputAutocomplete = ({
|
|
|
371
228
|
formState,
|
|
372
229
|
setValue
|
|
373
230
|
} = form;
|
|
374
|
-
const error =
|
|
231
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
375
232
|
const muiFormControl = useFormControl();
|
|
376
233
|
const {
|
|
377
234
|
label,
|
|
@@ -461,8 +318,8 @@ const InputAutocomplete = ({
|
|
|
461
318
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
462
319
|
,
|
|
463
320
|
...autoCompleteProps
|
|
464
|
-
}),
|
|
465
|
-
|
|
321
|
+
}), /*#__PURE__*/jsx(FormFieldError, {
|
|
322
|
+
fieldName: formField.name
|
|
466
323
|
})]
|
|
467
324
|
});
|
|
468
325
|
};
|
|
@@ -481,7 +338,7 @@ const InputCheckbox = ({
|
|
|
481
338
|
const {
|
|
482
339
|
errors
|
|
483
340
|
} = useFormState();
|
|
484
|
-
const error =
|
|
341
|
+
const error = getFormErrorForNestedKeys(errors, formField.name);
|
|
485
342
|
const muiFormControl = useFormControl();
|
|
486
343
|
const {
|
|
487
344
|
label,
|
|
@@ -519,8 +376,8 @@ const InputCheckbox = ({
|
|
|
519
376
|
}),
|
|
520
377
|
label: jsxLabel ?? label,
|
|
521
378
|
...formControlLabelProps
|
|
522
|
-
}),
|
|
523
|
-
|
|
379
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
380
|
+
error: error
|
|
524
381
|
})]
|
|
525
382
|
});
|
|
526
383
|
};
|
|
@@ -533,7 +390,7 @@ const InputDatePicker = ({
|
|
|
533
390
|
formState,
|
|
534
391
|
control
|
|
535
392
|
} = useFormContext();
|
|
536
|
-
const error =
|
|
393
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
537
394
|
const muiFormControl = useFormControl();
|
|
538
395
|
const {
|
|
539
396
|
label,
|
|
@@ -571,8 +428,8 @@ const InputDatePicker = ({
|
|
|
571
428
|
...restField,
|
|
572
429
|
...datePickerProps
|
|
573
430
|
})
|
|
574
|
-
}),
|
|
575
|
-
|
|
431
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
432
|
+
error: error
|
|
576
433
|
})]
|
|
577
434
|
})
|
|
578
435
|
});
|
|
@@ -586,7 +443,7 @@ const InputDateTimePicker = ({
|
|
|
586
443
|
formState,
|
|
587
444
|
control
|
|
588
445
|
} = useFormContext();
|
|
589
|
-
const error =
|
|
446
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
590
447
|
const muiFormControl = useFormControl();
|
|
591
448
|
const {
|
|
592
449
|
label,
|
|
@@ -625,13 +482,56 @@ const InputDateTimePicker = ({
|
|
|
625
482
|
...restField,
|
|
626
483
|
...dateTimePickerProps
|
|
627
484
|
})
|
|
628
|
-
}),
|
|
629
|
-
|
|
485
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
486
|
+
error: error
|
|
630
487
|
})]
|
|
631
488
|
})
|
|
632
489
|
});
|
|
633
490
|
};
|
|
634
491
|
|
|
492
|
+
const InputOutlinedInput = ({
|
|
493
|
+
formField,
|
|
494
|
+
outlinedInputProps
|
|
495
|
+
}) => {
|
|
496
|
+
const form = useFormContext();
|
|
497
|
+
const muiFormControl = useFormControl();
|
|
498
|
+
const {
|
|
499
|
+
label,
|
|
500
|
+
name,
|
|
501
|
+
required,
|
|
502
|
+
requiredErrorMessage,
|
|
503
|
+
validate
|
|
504
|
+
} = useMergedFormField(formField, formField.t);
|
|
505
|
+
if (!form) {
|
|
506
|
+
throw Error(formContextNull);
|
|
507
|
+
}
|
|
508
|
+
const {
|
|
509
|
+
register,
|
|
510
|
+
formState
|
|
511
|
+
} = form;
|
|
512
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
513
|
+
return /*#__PURE__*/jsxs(FormControl, {
|
|
514
|
+
error: !!error,
|
|
515
|
+
required: required,
|
|
516
|
+
disabled: muiFormControl?.disabled,
|
|
517
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
518
|
+
required: required,
|
|
519
|
+
children: label
|
|
520
|
+
}), /*#__PURE__*/jsx(OutlinedInput, {
|
|
521
|
+
...register(name, {
|
|
522
|
+
required: required ? requiredErrorMessage : false,
|
|
523
|
+
validate,
|
|
524
|
+
disabled: muiFormControl?.disabled
|
|
525
|
+
}),
|
|
526
|
+
required: required,
|
|
527
|
+
label: label,
|
|
528
|
+
...outlinedInputProps
|
|
529
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
530
|
+
error: error
|
|
531
|
+
})]
|
|
532
|
+
});
|
|
533
|
+
};
|
|
534
|
+
|
|
635
535
|
const InputRadio = ({
|
|
636
536
|
formField,
|
|
637
537
|
selectableOptions,
|
|
@@ -646,7 +546,7 @@ const InputRadio = ({
|
|
|
646
546
|
const {
|
|
647
547
|
errors
|
|
648
548
|
} = useFormState();
|
|
649
|
-
const error =
|
|
549
|
+
const error = getFormErrorForNestedKeys(errors, formField.name);
|
|
650
550
|
const muiFormControl = useFormControl();
|
|
651
551
|
const {
|
|
652
552
|
label,
|
|
@@ -692,8 +592,8 @@ const InputRadio = ({
|
|
|
692
592
|
...formControlLabelProps
|
|
693
593
|
});
|
|
694
594
|
})
|
|
695
|
-
}),
|
|
696
|
-
|
|
595
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
596
|
+
error: error
|
|
697
597
|
})]
|
|
698
598
|
});
|
|
699
599
|
};
|
|
@@ -719,7 +619,7 @@ const useSortedOptionsWithGroup = selectableOptions => {
|
|
|
719
619
|
const InputSelect = ({
|
|
720
620
|
formField,
|
|
721
621
|
selectableOptions,
|
|
722
|
-
|
|
622
|
+
optionsTitle,
|
|
723
623
|
selectComponentProps,
|
|
724
624
|
tooltipHolder
|
|
725
625
|
}) => {
|
|
@@ -732,7 +632,7 @@ const InputSelect = ({
|
|
|
732
632
|
watch,
|
|
733
633
|
formState
|
|
734
634
|
} = form;
|
|
735
|
-
const error =
|
|
635
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
736
636
|
const muiFormControl = useFormControl();
|
|
737
637
|
const {
|
|
738
638
|
label,
|
|
@@ -769,10 +669,11 @@ const InputSelect = ({
|
|
|
769
669
|
validate,
|
|
770
670
|
disabled: muiFormControl?.disabled
|
|
771
671
|
}),
|
|
772
|
-
children: [/*#__PURE__*/jsx(MenuItem, {
|
|
672
|
+
children: [optionsTitle && /*#__PURE__*/jsx(MenuItem, {
|
|
773
673
|
value: "",
|
|
674
|
+
disabled: true,
|
|
774
675
|
children: /*#__PURE__*/jsx("em", {
|
|
775
|
-
children:
|
|
676
|
+
children: optionsTitle
|
|
776
677
|
})
|
|
777
678
|
}), sortedOptions?.map((option, index) => {
|
|
778
679
|
const optionBefore = sortedOptions[index - 1];
|
|
@@ -810,8 +711,8 @@ const InputSelect = ({
|
|
|
810
711
|
children: option.group
|
|
811
712
|
}, option.group), wrappedMenuItem] : wrappedMenuItem;
|
|
812
713
|
})]
|
|
813
|
-
}),
|
|
814
|
-
|
|
714
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
715
|
+
error: error
|
|
815
716
|
})]
|
|
816
717
|
});
|
|
817
718
|
};
|
|
@@ -866,7 +767,7 @@ const InputTextField = ({
|
|
|
866
767
|
register,
|
|
867
768
|
formState
|
|
868
769
|
} = form;
|
|
869
|
-
const error =
|
|
770
|
+
const error = getFormErrorForNestedKeys(formState.errors, formField.name);
|
|
870
771
|
return /*#__PURE__*/jsxs(FormControl, {
|
|
871
772
|
error: !!error,
|
|
872
773
|
required: required,
|
|
@@ -880,8 +781,8 @@ const InputTextField = ({
|
|
|
880
781
|
required: required,
|
|
881
782
|
label: label,
|
|
882
783
|
...textFieldProps
|
|
883
|
-
}),
|
|
884
|
-
|
|
784
|
+
}), /*#__PURE__*/jsx(FormFieldErrorDisplay, {
|
|
785
|
+
error: error
|
|
885
786
|
})]
|
|
886
787
|
});
|
|
887
788
|
};
|
|
@@ -931,5 +832,137 @@ const useHookFormContext = () => {
|
|
|
931
832
|
};
|
|
932
833
|
};
|
|
933
834
|
|
|
934
|
-
|
|
835
|
+
/**
|
|
836
|
+
* Reexport of FormProvider.
|
|
837
|
+
*
|
|
838
|
+
* 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.
|
|
839
|
+
*/
|
|
840
|
+
const HookFormProvider = FormProvider;
|
|
841
|
+
|
|
842
|
+
const InputEmail = props => {
|
|
843
|
+
const merged = useMergedFormField(props.formField, props.formField.t, formDefaults);
|
|
844
|
+
return /*#__PURE__*/jsx(InputOutlinedInput, {
|
|
845
|
+
outlinedInputProps: {
|
|
846
|
+
type: "email",
|
|
847
|
+
...props.outlinedInputProps,
|
|
848
|
+
autoComplete: "email"
|
|
849
|
+
},
|
|
850
|
+
formField: merged
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
const formDefaults = {
|
|
854
|
+
required: true,
|
|
855
|
+
validate: emailInput => {
|
|
856
|
+
if (emailInput.match(/.@./)) {
|
|
857
|
+
return true;
|
|
858
|
+
}
|
|
859
|
+
return "E-Mail address invalid";
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const InputPasswordSet = ({
|
|
864
|
+
passwordField,
|
|
865
|
+
passwordValidationField,
|
|
866
|
+
doNotMatchError
|
|
867
|
+
}) => {
|
|
868
|
+
const {
|
|
869
|
+
watch
|
|
870
|
+
} = useFormContext();
|
|
871
|
+
const passwordFieldMerged = useMergedFormField(passwordField, passwordField.t, {
|
|
872
|
+
required: true
|
|
873
|
+
});
|
|
874
|
+
const validationFieldMerged = useMergedFormField(passwordValidationField, passwordValidationField.t, {
|
|
875
|
+
required: true
|
|
876
|
+
});
|
|
877
|
+
const validatePasswordMatch = useCallback(value => {
|
|
878
|
+
const passwordValue = watch(passwordFieldMerged.name);
|
|
879
|
+
return value === passwordValue || doNotMatchError;
|
|
880
|
+
}, [doNotMatchError, passwordFieldMerged.name, watch]);
|
|
881
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
882
|
+
children: [/*#__PURE__*/jsx(InputOutlinedInput, {
|
|
883
|
+
formField: passwordFieldMerged,
|
|
884
|
+
outlinedInputProps: {
|
|
885
|
+
type: "password",
|
|
886
|
+
autoComplete: "new-password"
|
|
887
|
+
}
|
|
888
|
+
}), /*#__PURE__*/jsx(InputOutlinedInput, {
|
|
889
|
+
formField: {
|
|
890
|
+
...validationFieldMerged,
|
|
891
|
+
validate: validatePasswordMatch,
|
|
892
|
+
t: passwordValidationField.t
|
|
893
|
+
},
|
|
894
|
+
outlinedInputProps: {
|
|
895
|
+
type: "password",
|
|
896
|
+
autoComplete: "new-password"
|
|
897
|
+
}
|
|
898
|
+
})]
|
|
899
|
+
});
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
var LoadingButtonState;
|
|
903
|
+
(function (LoadingButtonState) {
|
|
904
|
+
LoadingButtonState["Idle"] = "idle";
|
|
905
|
+
LoadingButtonState["Loading"] = "loading";
|
|
906
|
+
LoadingButtonState["Success"] = "success";
|
|
907
|
+
})(LoadingButtonState || (LoadingButtonState = {}));
|
|
908
|
+
|
|
909
|
+
const LoadingButton = ({
|
|
910
|
+
buttonText,
|
|
911
|
+
buttonTextSuccess,
|
|
912
|
+
loadingButtonProps,
|
|
913
|
+
loadingButtonPropsPropsSuccess,
|
|
914
|
+
buttonState,
|
|
915
|
+
successIcon
|
|
916
|
+
}) => {
|
|
917
|
+
const isSuccess = buttonState === LoadingButtonState.Success;
|
|
918
|
+
const propsToSpread = isSuccess ? loadingButtonPropsPropsSuccess : loadingButtonProps;
|
|
919
|
+
return /*#__PURE__*/jsx(LoadingButton$1, {
|
|
920
|
+
loading: buttonState === LoadingButtonState.Loading,
|
|
921
|
+
disabled: buttonState !== LoadingButtonState.Idle,
|
|
922
|
+
...propsToSpread,
|
|
923
|
+
children: buttonState === LoadingButtonState.Success ? /*#__PURE__*/jsxs(Fragment, {
|
|
924
|
+
children: [successIcon ? successIcon : null, buttonTextSuccess ? buttonTextSuccess : buttonText]
|
|
925
|
+
}) : buttonText
|
|
926
|
+
});
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Get loading button state from react-query mutation status.
|
|
931
|
+
*/
|
|
932
|
+
const loadingButtonStateFromReactQueryMutationStatus = mutationStatus => {
|
|
933
|
+
const mapStatus = {
|
|
934
|
+
idle: LoadingButtonState.Idle,
|
|
935
|
+
error: LoadingButtonState.Idle,
|
|
936
|
+
success: LoadingButtonState.Success,
|
|
937
|
+
loading: LoadingButtonState.Loading
|
|
938
|
+
};
|
|
939
|
+
return mapStatus[mutationStatus];
|
|
940
|
+
};
|
|
941
|
+
/**
|
|
942
|
+
* Get loading button state from a react-hook-form context.
|
|
943
|
+
*/
|
|
944
|
+
const useLoadingButtonStateFromFormContext = () => {
|
|
945
|
+
const formContext = useFormContext();
|
|
946
|
+
return loadingButtonStateFromFormState(formContext.formState);
|
|
947
|
+
};
|
|
948
|
+
/**
|
|
949
|
+
* Get loading button state from a react-hook-form state.
|
|
950
|
+
*/
|
|
951
|
+
const loadingButtonStateFromFormState = (
|
|
952
|
+
// we are not interested in the value types FormState holds
|
|
953
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
954
|
+
formState) => {
|
|
955
|
+
if (formState.isSubmitting) {
|
|
956
|
+
return LoadingButtonState.Loading;
|
|
957
|
+
}
|
|
958
|
+
if (formState.isDirty) {
|
|
959
|
+
return LoadingButtonState.Idle;
|
|
960
|
+
}
|
|
961
|
+
if (formState.isSubmitSuccessful) {
|
|
962
|
+
return LoadingButtonState.Success;
|
|
963
|
+
}
|
|
964
|
+
return LoadingButtonState.Idle;
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
export { FormFieldError, FormFieldErrorDisplay, HookFormProvider, InputAutocomplete, InputCheckbox, InputDatePicker, InputDateTimePicker, InputEmail, InputOutlinedInput, InputPasswordSet, InputRadio, InputSelect, InputSelectFromEnum, InputOutlinedInput as InputText, InputTextField, LoadingButton, LoadingButtonState, getFormErrorForNestedKeys as getFormError, loadingButtonStateFromFormState, loadingButtonStateFromReactQueryMutationStatus, syncSubmit, useHookForm, useHookFormContext, useLoadingButtonStateFromFormContext, useMergedFormField, useSortedOptionsWithGroup, useTranslateString };
|
|
935
968
|
//# sourceMappingURL=packageExports.js.map
|
|
@@ -1 +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/InputOutlinedInput/InputOutlinedInput.tsx","../../src/formFields/InputEmail/InputEmail.tsx","../../src/formFields/InputPasswordSet/InputPasswordSet.tsx","../../src/formFields/baseTypes/InputAutocomplete/useSortedOptionsWithGroup.ts","../../src/formFields/baseTypes/InputAutocomplete/InputAutocomplete.tsx","../../src/formFields/baseTypes/InputCheckbox/InputCheckbox.tsx","../../src/formFields/baseTypes/InputDatePicker/InputDatePicker.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/baseTypes/InputText/InputTextField.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 InputOutlinedInputProps {\n formField: FormField;\n outlinedInputProps?: 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 InputOutlinedInput = ({\n formField,\n outlinedInputProps,\n}: InputOutlinedInputProps): 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 {...outlinedInputProps}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n );\n};\n","import {\n InputOutlinedInput,\n InputOutlinedInputProps,\n} from \"../baseTypes/InputOutlinedInput/InputOutlinedInput\";\nimport { useMergedFormField } from \"../formHelper/useMergedFormField\";\nimport { FormField } from \"../inputTypes\";\n\nexport interface InputEmailProps {\n formField: FormField;\n outlinedInputProps?: InputOutlinedInputProps[\"outlinedInputProps\"];\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 <InputOutlinedInput\n outlinedInputProps={{\n type: \"email\",\n ...props.outlinedInputProps,\n autoComplete: \"email\",\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 { InputOutlinedInput } from \"../baseTypes/InputOutlinedInput/InputOutlinedInput\";\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 <InputOutlinedInput\n formField={passwordFieldMerged}\n outlinedInputProps={{\n type: \"password\",\n autoComplete: \"new-password\",\n }}\n />\n\n <InputOutlinedInput\n formField={{\n ...validationFieldMerged,\n validate: validatePasswordMatch,\n t: passwordValidationField.t,\n }}\n outlinedInputProps={{\n type: \"password\",\n autoComplete: \"new-password\",\n }}\n />\n </>\n );\n};\n","import { useMemo } from \"react\";\nimport { LabeledValueWithGrouping } from \"../../inputTypes\";\n\nexport enum GroupLabelSorting {\n Alphabetical = \"alphabetical\",\n GroupMemberCountAsc = \"groupMemberCountAsc\",\n}\n\n/**\n * Sorts option in the desired order.\n */\nexport const useSortedOptionsWithGroup = (\n selectableOptions: LabeledValueWithGrouping[],\n sorting: GroupLabelSorting = GroupLabelSorting.Alphabetical\n): LabeledValueWithGrouping[] => {\n return useMemo(() => {\n if (sorting === GroupLabelSorting.GroupMemberCountAsc) {\n const groupCounts = selectableOptions.reduce((acc, option) => {\n if (option.group) {\n acc[option.group] = (acc[option.group] || 0) + 1;\n }\n return acc;\n }, {} as Record<string, number>);\n\n return selectableOptions.sort((a, b) => {\n if (a.group == undefined && !!b.group) {\n return -1;\n }\n\n if (a.group && b.group) {\n const groupA = groupCounts[a.group];\n const groupB = groupCounts[b.group];\n\n if (groupA && groupB && groupA < groupB) {\n return -1;\n } else if (groupCounts[a.group] === groupCounts[b.group]) {\n if (b.label > a.label) {\n return -1;\n }\n\n return 1;\n }\n\n return 1;\n }\n\n if (b.label > a.label) {\n return -1;\n }\n\n return 1;\n });\n }\n\n return 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.label > a.label) {\n return 1;\n }\n\n return 0;\n });\n }, [selectableOptions, sorting]);\n};\n","import { CheckBox, CheckBoxOutlineBlank } from \"@mui/icons-material\";\nimport {\n Autocomplete,\n Checkbox,\n ChipTypeMap,\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 {\n FormField,\n LabeledValue,\n LabeledValueWithGrouping,\n} from \"../../inputTypes\";\nimport { InputAutocompleteProps } from \"./InputAutocompleteInterfaces\";\nimport { useSortedOptionsWithGroup } from \"./useSortedOptionsWithGroup\";\n\nconst icon = <CheckBoxOutlineBlank fontSize=\"small\" />;\nconst checkedIcon = <CheckBox fontSize=\"small\" />;\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 T,\n Multiple extends boolean | undefined = false,\n DisableClearable extends boolean | undefined = false,\n FreeSolo extends boolean | undefined = false,\n ChipComponent extends React.ElementType = ChipTypeMap[\"defaultComponent\"]\n>({\n formField,\n selectableOptions,\n noOptions,\n autoCompleteProps,\n checkboxesForMultiselect: renderCheckboxes,\n groupSorting,\n}: InputAutocompleteProps<\n T,\n Multiple,\n DisableClearable,\n FreeSolo,\n ChipComponent\n>): 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 sortedOptions = useSortedOptionsWithGroup(\n selectableOptions,\n groupSorting\n );\n\n const value = watch(name) as\n | string\n | number\n | string[]\n | number[]\n | undefined;\n\n const multiSelect = !!autoCompleteProps?.multiple;\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 return multiSelect\n ? selectableOptions.filter((o) => {\n if (Array.isArray(valueToUse)) {\n return valueToUse.includes(o.value as never);\n }\n\n return selectableOptions.find(\n (option) => option.value === valueToUse\n );\n })\n : selectableOptions.find((option) => option.value === valueToUse);\n }, [multiSelect, selectableOptions, valueToUse]);\n\n const renderOption = useMemo(() => {\n if (autoCompleteProps?.renderOption) {\n return autoCompleteProps.renderOption;\n }\n\n return multiSelect && renderCheckboxes\n ? (liProps: object, option: LabeledValue) => (\n <li {...liProps}>\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n sx={{ mr: 2 }}\n checked={\n Array.isArray(currentValue)\n ? !!currentValue.find((item) => item.value === option.value)\n : false\n }\n />\n\n {option.label}\n </li>\n )\n : undefined;\n }, [\n autoCompleteProps?.renderOption,\n currentValue,\n multiSelect,\n renderCheckboxes,\n ]);\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <Autocomplete\n options={sortedOptions}\n value={currentValue || \"\"}\n {...props}\n label={label}\n renderOption={renderOption}\n multiple={multiSelect}\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 shouldDirty: true,\n shouldValidate: true,\n shouldTouch: true,\n }\n );\n } else if (selectedOption) {\n setValue(name, selectedOption.value, {\n shouldDirty: true,\n shouldValidate: true,\n shouldTouch: true,\n });\n }\n }}\n noOptionsText={noOptions}\n renderInput={(params) => (\n <TextField {...params} label={label} variant=\"outlined\" />\n )}\n groupBy={(option: LabeledValueWithGrouping) => option.group || \"Choose\"}\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 CheckboxProps,\n FormControl,\n FormControlLabel,\n FormControlLabelProps,\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 checkboxProps?: Omit<CheckboxProps, \"checked\">;\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\">;\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 checkboxProps,\n formControlLabelProps,\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\n checked={value}\n aria-labelledby={id}\n {...registered}\n {...checkboxProps}\n />\n }\n label={jsxLabel ?? label}\n {...formControlLabelProps}\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 {\n DatePicker,\n DatePickerProps as MuiDatePickerProps,\n} 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\n/**\n * Mangled version of the original DatePickerProps type\n * from @mui/x-date-pickers.\n */\ninterface DatePickerProps\n extends Omit<\n MuiDatePickerProps<TextFieldProps, Date>,\n \"label\" | \"onChange\" | \"disabled\" | \"value\" | \"renderInput\"\n > {\n renderInput?: MuiDatePickerProps<TextFieldProps, Date>[\"renderInput\"];\n}\n\nexport interface InputDatePickerProps {\n formField: FormField;\n datePickerProps?: DatePickerProps;\n}\n\n/**\n * A Datetime picker that works with react hook form.\n */\nexport const InputDatePicker = ({\n formField,\n datePickerProps,\n}: InputDatePickerProps): 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 <DatePicker\n label={label}\n onChange={(event: Date | null) => {\n onChange(event);\n\n if (event) {\n setDate(event);\n }\n }}\n disabled={muiFormControl?.disabled}\n renderInput={\n datePickerProps?.renderInput\n ? datePickerProps.renderInput\n : (params) => <TextField required={required} {...params} />\n }\n {...restField}\n {...datePickerProps}\n />\n )}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n </Box>\n );\n};\n","import {\n Box,\n FormControl,\n FormHelperText,\n TextField,\n TextFieldProps,\n useFormControl,\n} from \"@mui/material\";\nimport {\n DateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n} 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\n/**\n * Mangled version of the original DateTimePickerProps type\n * from @mui/x-date-pickers.\n */\ninterface DateTimePickerProps\n extends Omit<\n MuiDateTimePickerProps<TextFieldProps, Date>,\n \"label\" | \"onChange\" | \"disabled\" | \"value\" | \"renderInput\"\n > {\n renderInput?: MuiDateTimePickerProps<TextFieldProps, Date>[\"renderInput\"];\n}\n\nexport interface InputDateTimePickerProps {\n formField: FormField;\n dateTimePickerProps?: DateTimePickerProps;\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={\n dateTimePickerProps?.renderInput\n ? dateTimePickerProps?.renderInput\n : (params) => <TextField required={required} {...params} />\n }\n {...restField}\n {...dateTimePickerProps}\n />\n )}\n />\n\n {error?.message && <FormHelperText>{error?.message}</FormHelperText>}\n </FormControl>\n </Box>\n );\n};\n","import {\n FormControl,\n FormControlLabel,\n FormControlLabelProps,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\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 formControlLabelProps?: FormControlLabelProps;\n radioGroupProps?: RadioGroupProps;\n}\n\n/**\n * Input for selecting between a list of options using radio buttons.\n */\nexport const InputRadio = ({\n formField,\n selectableOptions,\n formControlLabelProps,\n radioGroupProps,\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} {...radioGroupProps}>\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 {...formControlLabelProps}\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 {\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?: Omit<\n SelectProps,\n \"labelId\" | \"error\" | \"label\" | \"value\"\n >;\n /**\n * Element that is rendered in the end of a select item and holds\n * a tooltip with the disabled message for this option.\n *\n * If none is given the element is disabled without rendering a tooltip.\n */\n tooltipHolder?: JSX.Element;\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 tooltipHolder,\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 defaultValue = selectComponentProps?.multiple ? [] : \"\";\n\n const value =\n (watch(name) as string | number | undefined | string[] | number[]) ??\n defaultValue;\n\n if (selectComponentProps?.multiple && value) {\n assertTruthy(\n Array.isArray(value),\n \"Value for multiple select need to be an array or undefined\"\n );\n } else if (value) {\n assertTruthy(\n [\"string\", \"number\"].includes(typeof value),\n \"Value for select input has unexpected type\"\n );\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 {tooltipHolder ? (\n <Tooltip title={disabledText}>{tooltipHolder}</Tooltip>\n ) : null}\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 props: InputSelectFromEnumProps<EnumType>\n): JSX.Element => {\n const { enumData, formField } = props;\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 {...props} selectableOptions={options} formField={formField} />\n );\n};\n","import {\n FormControl,\n FormHelperText,\n TextField,\n TextFieldProps,\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 InputTextFieldProps {\n formField: FormField;\n textFieldProps?: Omit<TextFieldProps, \"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 InputTextField = ({\n formField,\n textFieldProps,\n}: InputTextFieldProps): 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 <TextField\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 { 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","InputOutlinedInput","outlinedInputProps","form","muiFormControl","useFormControl","register","FormControl","InputLabel","OutlinedInput","message","FormHelperText","InputEmail","props","formDefaults","type","autoComplete","emailInput","match","InputPasswordSet","passwordField","passwordValidationField","doNotMatchError","watch","passwordFieldMerged","validationFieldMerged","validatePasswordMatch","value","passwordValue","GroupLabelSorting","useSortedOptionsWithGroup","selectableOptions","sorting","Alphabetical","GroupMemberCountAsc","groupCounts","acc","option","group","sort","a","b","groupA","groupB","icon","CheckBoxOutlineBlank","fontSize","checkedIcon","CheckBox","InputAutocomplete","noOptions","autoCompleteProps","checkboxesForMultiselect","renderCheckboxes","groupSorting","setValue","sortedOptions","multiSelect","multiple","valueToUse","assertTruthy","includes","currentValue","filter","o","Array","isArray","find","renderOption","liProps","Checkbox","sx","mr","checked","item","Autocomplete","options","getOptionLabel","objectHasKey","onChange","e","selectedOption","map","shouldDirty","shouldValidate","shouldTouch","noOptionsText","renderInput","params","TextField","variant","groupBy","InputCheckbox","jsxLabel","checkboxProps","formControlLabelProps","useFormState","changeEv","target","id","registered","FormControlLabel","control","InputDatePicker","datePickerProps","date","setDate","useState","Date","Box","Controller","defaultValue","render","field","restField","DatePicker","event","InputDateTimePicker","dateTimePickerProps","DateTimePicker","ampm","InputRadio","radioGroupProps","FormLabel","RadioGroup","_createElement","key","Radio","InputSelect","placeholderText","selectComponentProps","tooltipHolder","Select","labelId","MenuItem","index","optionBefore","showGroup","disabledText","isDisabled","menuItem","title","selected","wrappedMenuItem","position","Stack","direction","justifyContent","spacing","right","th","top","bottom","Tooltip","ListSubheader","InputSelectFromEnum","enumData","translateFunction","Object","entries","enumToUse","labelsForEnum","InputTextField","textFieldProps","syncSubmit","asyncSubmitHandler","catch","rethrow","useHookForm","useForm","identity","useHookFormContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAGYA,mBAIX;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,oBAC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tB3J,KAAwD,IAC5B;AAC5B,EAAA,MAAMV,IAAI,GAAGsK,OAAO,CAAe5J,KAAK,CAAC,CAAA;EAEzC,OAAO;AACL,IAAA,GAAGV,IAAI;AACP7B,IAAAA,SAAS,EAAEoM,QAAAA;GACZ,CAAA;AACH;;AC/CA;;;;;AAKG;AACUC,MAAAA,kBAAkB,GAAGA,MAEF;EAC9B,MAAMxK,IAAI,GAAGxC,cAAc,EAAgB,CAAA;EAE3C,OAAO;AACL,IAAA,GAAGwC,IAAI;AACP7B,IAAAA,SAAS,EAAEoM,QAAAA;GACZ,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"packageExports.js","sources":["../../src/formFields/errorMessages.ts","../../src/formFields/formHelper/getFormErrorForNestedKeys.ts","../../src/errors/FormFieldErrorDisplay.tsx","../../src/errors/FormFieldError.tsx","../../src/formFields/formHelper/useTranslateString.ts","../../src/formFields/formHelper/useMergedFormField.ts","../../src/formFields/baseTypes/InputAutocomplete/useSortedOptionsWithGroup.ts","../../src/formFields/baseTypes/InputAutocomplete/InputAutocomplete.tsx","../../src/formFields/baseTypes/InputCheckbox/InputCheckbox.tsx","../../src/formFields/baseTypes/InputDatePicker/InputDatePicker.tsx","../../src/formFields/baseTypes/InputDateTimePicker/InputDateTimePicker.tsx","../../src/formFields/baseTypes/InputOutlinedInput/InputOutlinedInput.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/baseTypes/InputText/InputTextField.tsx","../../src/formFields/formHelper/syncSubmit.ts","../../src/formFields/formHelper/useHookForm.ts","../../src/formFields/formHelper/useHookFormContext.ts","../../src/formFields/HookFormProvider.tsx","../../src/formFields/InputEmail/InputEmail.tsx","../../src/formFields/InputPasswordSet/InputPasswordSet.tsx","../../src/LoadingButton/LoadingButtonInterfaces.ts","../../src/LoadingButton/LoadingButton.tsx","../../src/LoadingButton/getLoadingButtonState.ts"],"sourcesContent":["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 getFormErrorForNestedKeys = (\n errors: FormState<AnyObject>[\"errors\"],\n fieldName: string\n): FieldError | 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 { FormHelperText } from \"@mui/material\";\nimport { filterNoUndefinedNoNull } from \"@nvon/baseline\";\nimport { FieldError } from \"react-hook-form\";\n\n/**\n * Renders field errors in an opinionated way.\n *\n */\nexport const FormFieldErrorDisplay = ({\n error,\n}: {\n error: FieldError | FieldError[] | undefined;\n}): JSX.Element | null => {\n if (Array.isArray(error)) {\n return (\n <FormHelperText>\n {error\n .map((e) => e.message)\n .filter(filterNoUndefinedNoNull)\n .join(\", \")}\n </FormHelperText>\n );\n }\n\n if (error?.message) {\n return <FormHelperText>{error?.message}</FormHelperText>;\n }\n\n return null;\n};\n","import { useFormContext } from \"react-hook-form\";\nimport { formContextNull } from \"../formFields/errorMessages\";\nimport { getFormErrorForNestedKeys } from \"../formFields/formHelper/getFormErrorForNestedKeys\";\nimport { FormFieldErrorDisplay } from \"./FormFieldErrorDisplay\";\n\n/**\n * Renders field errors in an opinionated way.\n *\n * @throws Error when FormContext is null.\n */\nexport const FormFieldError = ({\n fieldName,\n}: {\n fieldName: string;\n}): JSX.Element | null => {\n const form = useFormContext();\n\n if (!form) {\n throw Error(formContextNull);\n }\n\n const { formState } = form;\n\n const error = getFormErrorForNestedKeys(formState.errors, fieldName);\n\n return <FormFieldErrorDisplay error={error} />;\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 { useMemo } from \"react\";\nimport { LabeledValueWithGrouping } from \"../../inputTypes\";\n\nexport enum GroupLabelSorting {\n Alphabetical = \"alphabetical\",\n GroupMemberCountAsc = \"groupMemberCountAsc\",\n}\n\n/**\n * Sorts option in the desired order.\n */\nexport const useSortedOptionsWithGroup = (\n selectableOptions: LabeledValueWithGrouping[],\n sorting: GroupLabelSorting = GroupLabelSorting.Alphabetical\n): LabeledValueWithGrouping[] => {\n return useMemo(() => {\n if (sorting === GroupLabelSorting.GroupMemberCountAsc) {\n const groupCounts = selectableOptions.reduce((acc, option) => {\n if (option.group) {\n acc[option.group] = (acc[option.group] || 0) + 1;\n }\n return acc;\n }, {} as Record<string, number>);\n\n return selectableOptions.sort((a, b) => {\n if (a.group == undefined && !!b.group) {\n return -1;\n }\n\n if (a.group && b.group) {\n const groupA = groupCounts[a.group];\n const groupB = groupCounts[b.group];\n\n if (groupA && groupB && groupA < groupB) {\n return -1;\n } else if (groupCounts[a.group] === groupCounts[b.group]) {\n if (b.label > a.label) {\n return -1;\n }\n\n return 1;\n }\n\n return 1;\n }\n\n if (b.label > a.label) {\n return -1;\n }\n\n return 1;\n });\n }\n\n return 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.label > a.label) {\n return 1;\n }\n\n return 0;\n });\n }, [selectableOptions, sorting]);\n};\n","import { CheckBox, CheckBoxOutlineBlank } from \"@mui/icons-material\";\nimport {\n Autocomplete,\n Checkbox,\n ChipTypeMap,\n FormControl,\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 { FormFieldError } from \"../../../errors/FormFieldError\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport {\n FormField,\n LabeledValue,\n LabeledValueWithGrouping,\n} from \"../../inputTypes\";\nimport { InputAutocompleteProps } from \"./InputAutocompleteInterfaces\";\nimport { useSortedOptionsWithGroup } from \"./useSortedOptionsWithGroup\";\n\nconst icon = <CheckBoxOutlineBlank fontSize=\"small\" />;\nconst checkedIcon = <CheckBox fontSize=\"small\" />;\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 T,\n Multiple extends boolean | undefined = false,\n DisableClearable extends boolean | undefined = false,\n FreeSolo extends boolean | undefined = false,\n ChipComponent extends React.ElementType = ChipTypeMap[\"defaultComponent\"],\n>({\n formField,\n selectableOptions,\n noOptions,\n autoCompleteProps,\n checkboxesForMultiselect: renderCheckboxes,\n groupSorting,\n}: InputAutocompleteProps<\n T,\n Multiple,\n DisableClearable,\n FreeSolo,\n ChipComponent\n>): 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 = getFormErrorForNestedKeys(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 sortedOptions = useSortedOptionsWithGroup(\n selectableOptions,\n groupSorting\n );\n\n const value = watch(name) as\n | string\n | number\n | string[]\n | number[]\n | undefined;\n\n const multiSelect = !!autoCompleteProps?.multiple;\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 return multiSelect\n ? selectableOptions.filter((o) => {\n if (Array.isArray(valueToUse)) {\n return valueToUse.includes(o.value as never);\n }\n\n return selectableOptions.find(\n (option) => option.value === valueToUse\n );\n })\n : selectableOptions.find((option) => option.value === valueToUse);\n }, [multiSelect, selectableOptions, valueToUse]);\n\n const renderOption = useMemo(() => {\n if (autoCompleteProps?.renderOption) {\n return autoCompleteProps.renderOption;\n }\n\n return multiSelect && renderCheckboxes\n ? (liProps: object, option: LabeledValue) => (\n <li {...liProps}>\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n sx={{ mr: 2 }}\n checked={\n Array.isArray(currentValue)\n ? !!currentValue.find((item) => item.value === option.value)\n : false\n }\n />\n\n {option.label}\n </li>\n )\n : undefined;\n }, [\n autoCompleteProps?.renderOption,\n currentValue,\n multiSelect,\n renderCheckboxes,\n ]);\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <Autocomplete\n options={sortedOptions}\n value={currentValue || \"\"}\n {...props}\n label={label}\n renderOption={renderOption}\n multiple={multiSelect}\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 shouldDirty: true,\n shouldValidate: true,\n shouldTouch: true,\n }\n );\n } else if (selectedOption) {\n setValue(name, selectedOption.value, {\n shouldDirty: true,\n shouldValidate: true,\n shouldTouch: true,\n });\n }\n }}\n noOptionsText={noOptions}\n renderInput={(params) => (\n <TextField {...params} label={label} variant=\"outlined\" />\n )}\n groupBy={(option: LabeledValueWithGrouping) => option.group || \"Choose\"}\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 <FormFieldError fieldName={formField.name} />\n </FormControl>\n );\n};\n","import {\n Checkbox,\n CheckboxProps,\n FormControl,\n FormControlLabel,\n FormControlLabelProps,\n useFormControl,\n} from \"@mui/material\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputCheckboxProps {\n formField: FormField;\n checkboxProps?: Omit<CheckboxProps, \"checked\">;\n formControlLabelProps?: Omit<FormControlLabelProps, \"control\" | \"label\">;\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 checkboxProps,\n formControlLabelProps,\n}: InputCheckboxProps): JSX.Element => {\n const { register, watch, setValue } = useFormContext();\n const { errors } = useFormState();\n\n const error = getFormErrorForNestedKeys(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\n checked={value}\n aria-labelledby={id}\n {...registered}\n {...checkboxProps}\n />\n }\n label={jsxLabel ?? label}\n {...formControlLabelProps}\n />\n\n <FormFieldErrorDisplay error={error} />\n </FormControl>\n );\n};\n","import {\n Box,\n FormControl,\n TextField,\n TextFieldProps,\n useFormControl,\n} from \"@mui/material\";\nimport {\n DatePicker,\n DatePickerProps as MuiDatePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\n/**\n * Mangled version of the original DatePickerProps type\n * from @mui/x-date-pickers.\n */\ninterface DatePickerProps\n extends Omit<\n MuiDatePickerProps<TextFieldProps, Date>,\n \"label\" | \"onChange\" | \"disabled\" | \"value\" | \"renderInput\"\n > {\n renderInput?: MuiDatePickerProps<TextFieldProps, Date>[\"renderInput\"];\n}\n\nexport interface InputDatePickerProps {\n formField: FormField;\n datePickerProps?: DatePickerProps;\n}\n\n/**\n * A Datetime picker that works with react hook form.\n */\nexport const InputDatePicker = ({\n formField,\n datePickerProps,\n}: InputDatePickerProps): JSX.Element => {\n const { formState, control } = useFormContext();\n const error = getFormErrorForNestedKeys(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 <DatePicker\n label={label}\n onChange={(event: Date | null) => {\n onChange(event);\n\n if (event) {\n setDate(event);\n }\n }}\n disabled={muiFormControl?.disabled}\n renderInput={\n datePickerProps?.renderInput\n ? datePickerProps.renderInput\n : (params) => <TextField required={required} {...params} />\n }\n {...restField}\n {...datePickerProps}\n />\n )}\n />\n\n <FormFieldErrorDisplay error={error} />\n </FormControl>\n </Box>\n );\n};\n","import {\n Box,\n FormControl,\n TextField,\n TextFieldProps,\n useFormControl,\n} from \"@mui/material\";\nimport {\n DateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n} from \"@mui/x-date-pickers\";\nimport { useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\n/**\n * Mangled version of the original DateTimePickerProps type\n * from @mui/x-date-pickers.\n */\ninterface DateTimePickerProps\n extends Omit<\n MuiDateTimePickerProps<TextFieldProps, Date>,\n \"label\" | \"onChange\" | \"disabled\" | \"value\" | \"renderInput\"\n > {\n renderInput?: MuiDateTimePickerProps<TextFieldProps, Date>[\"renderInput\"];\n}\n\nexport interface InputDateTimePickerProps {\n formField: FormField;\n dateTimePickerProps?: DateTimePickerProps;\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 = getFormErrorForNestedKeys(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={\n dateTimePickerProps?.renderInput\n ? dateTimePickerProps?.renderInput\n : (params) => <TextField required={required} {...params} />\n }\n {...restField}\n {...dateTimePickerProps}\n />\n )}\n />\n\n <FormFieldErrorDisplay error={error} />\n </FormControl>\n </Box>\n );\n};\n","import {\n FormControl,\n InputLabel,\n OutlinedInput,\n OutlinedInputProps,\n useFormControl,\n} from \"@mui/material\";\nimport { useFormContext } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputOutlinedInputProps {\n formField: FormField;\n outlinedInputProps?: 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 InputOutlinedInput = ({\n formField,\n outlinedInputProps,\n}: InputOutlinedInputProps): 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 = getFormErrorForNestedKeys(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 {...outlinedInputProps}\n />\n\n <FormFieldErrorDisplay error={error} />\n </FormControl>\n );\n};\n","import {\n FormControl,\n FormControlLabel,\n FormControlLabelProps,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\n useFormControl,\n} from \"@mui/material\";\nimport { assertTruthy } from \"@nvon/baseline\";\nimport { ChangeEvent, useCallback } from \"react\";\nimport { useFormContext, useFormState } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField, LabeledValue } from \"../../inputTypes\";\n\nexport interface InputRadioProps {\n formField: FormField;\n selectableOptions: LabeledValue[];\n formControlLabelProps?: FormControlLabelProps;\n radioGroupProps?: RadioGroupProps;\n}\n\n/**\n * Input for selecting between a list of options using radio buttons.\n */\nexport const InputRadio = ({\n formField,\n selectableOptions,\n formControlLabelProps,\n radioGroupProps,\n}: InputRadioProps): JSX.Element => {\n const { register, watch, setValue } = useFormContext();\n const { errors } = useFormState();\n\n const error = getFormErrorForNestedKeys(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} {...radioGroupProps}>\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 {...formControlLabelProps}\n />\n );\n })}\n </RadioGroup>\n\n <FormFieldErrorDisplay error={error} />\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 {\n Box,\n FormControl,\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 { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\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 /**\n * Text of an disabled item that can be rendered above the selectable options.\n */\n optionsTitle?: string;\n selectComponentProps?: Omit<\n SelectProps,\n \"labelId\" | \"error\" | \"label\" | \"value\"\n >;\n /**\n * Element that is rendered in the end of a select item and holds\n * a tooltip with the disabled message for this option.\n *\n * If none is given the element is disabled without rendering a tooltip.\n */\n tooltipHolder?: JSX.Element;\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 optionsTitle,\n selectComponentProps,\n tooltipHolder,\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 = getFormErrorForNestedKeys(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 defaultValue = selectComponentProps?.multiple ? [] : \"\";\n\n const value =\n (watch(name) as\n | string\n | number\n | undefined\n | string[]\n | number[]\n | undefined) ?? defaultValue;\n\n if (selectComponentProps?.multiple && value) {\n assertTruthy(\n Array.isArray(value),\n \"Value for multiple select need to be an array or undefined\"\n );\n } else if (value) {\n assertTruthy(\n [\"string\", \"number\"].includes(typeof value),\n \"Value for select input has unexpected type\"\n );\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 {optionsTitle && (\n <MenuItem value=\"\" disabled={true}>\n <em>{optionsTitle}</em>\n </MenuItem>\n )}\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 {tooltipHolder ? (\n <Tooltip title={disabledText}>{tooltipHolder}</Tooltip>\n ) : null}\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 <FormFieldErrorDisplay error={error} />\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 props: InputSelectFromEnumProps<EnumType>\n): JSX.Element => {\n const { enumData, formField } = props;\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 {...props} selectableOptions={options} formField={formField} />\n );\n};\n","import {\n FormControl,\n TextField,\n TextFieldProps,\n useFormControl,\n} from \"@mui/material\";\nimport { useFormContext } from \"react-hook-form\";\nimport { FormFieldErrorDisplay } from \"../../../errors/FormFieldErrorDisplay\";\nimport { formContextNull } from \"../../errorMessages\";\nimport { getFormErrorForNestedKeys } from \"../../formHelper/getFormErrorForNestedKeys\";\nimport { useMergedFormField } from \"../../formHelper/useMergedFormField\";\nimport { FormField } from \"../../inputTypes\";\n\nexport interface InputTextFieldProps {\n formField: FormField;\n textFieldProps?: Omit<TextFieldProps, \"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 InputTextField = ({\n formField,\n textFieldProps,\n}: InputTextFieldProps): 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 = getFormErrorForNestedKeys(formState.errors, formField.name);\n\n return (\n <FormControl\n error={!!error}\n required={required}\n disabled={muiFormControl?.disabled}\n >\n <TextField\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 <FormFieldErrorDisplay error={error} />\n </FormControl>\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","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","import {\n InputOutlinedInput,\n InputOutlinedInputProps,\n} from \"../baseTypes/InputOutlinedInput/InputOutlinedInput\";\nimport { useMergedFormField } from \"../formHelper/useMergedFormField\";\nimport { FormField } from \"../inputTypes\";\n\nexport interface InputEmailProps {\n formField: FormField;\n outlinedInputProps?: InputOutlinedInputProps[\"outlinedInputProps\"];\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 <InputOutlinedInput\n outlinedInputProps={{\n type: \"email\",\n ...props.outlinedInputProps,\n autoComplete: \"email\",\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 { InputOutlinedInput } from \"../baseTypes/InputOutlinedInput/InputOutlinedInput\";\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 <InputOutlinedInput\n formField={passwordFieldMerged}\n outlinedInputProps={{\n type: \"password\",\n autoComplete: \"new-password\",\n }}\n />\n\n <InputOutlinedInput\n formField={{\n ...validationFieldMerged,\n validate: validatePasswordMatch,\n t: passwordValidationField.t,\n }}\n outlinedInputProps={{\n type: \"password\",\n autoComplete: \"new-password\",\n }}\n />\n </>\n );\n};\n","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"],"names":["formContextNull","getFormErrorForNestedKeys","errors","fieldName","nestedKeys","split","reduce","errorObj","pathKey","FormFieldErrorDisplay","error","Array","isArray","_jsx","FormHelperText","children","map","e","message","filter","filterNoUndefinedNoNull","join","FormFieldError","form","useFormContext","Error","formState","useTranslateString","t","useCallback","input","useMergedFormField","formField","formFieldDefaults","translate","merged","useMemo","builtInDefaults","label","uppercaseFirstLetter","name","required","requiredErrorMessage","validate","undefined","withPlainStrings","translated","GroupLabelSorting","useSortedOptionsWithGroup","selectableOptions","sorting","Alphabetical","GroupMemberCountAsc","groupCounts","acc","option","group","sort","a","b","groupA","groupB","icon","CheckBoxOutlineBlank","fontSize","checkedIcon","CheckBox","InputAutocomplete","noOptions","autoCompleteProps","checkboxesForMultiselect","renderCheckboxes","groupSorting","register","watch","setValue","muiFormControl","useFormControl","sortedOptions","value","multiSelect","multiple","valueToUse","assertTruthy","includes","props","disabled","currentValue","o","find","renderOption","liProps","_jsxs","Checkbox","sx","mr","checked","item","FormControl","Autocomplete","options","getOptionLabel","objectHasKey","onChange","selectedOption","shouldDirty","shouldValidate","shouldTouch","noOptionsText","renderInput","params","TextField","variant","groupBy","InputCheckbox","jsxLabel","checkboxProps","formControlLabelProps","useFormState","changeEv","target","id","registered","FormControlLabel","control","InputDatePicker","datePickerProps","date","setDate","useState","Date","Box","Controller","defaultValue","render","field","restField","DatePicker","event","InputDateTimePicker","dateTimePickerProps","DateTimePicker","ampm","InputOutlinedInput","outlinedInputProps","InputLabel","OutlinedInput","InputRadio","radioGroupProps","FormLabel","RadioGroup","_createElement","key","Radio","InputSelect","optionsTitle","selectComponentProps","tooltipHolder","Select","labelId","MenuItem","index","optionBefore","showGroup","disabledText","isDisabled","menuItem","title","selected","wrappedMenuItem","position","Stack","direction","justifyContent","spacing","right","th","top","bottom","Tooltip","ListSubheader","InputSelectFromEnum","enumData","translateFunction","Object","entries","enumToUse","labelsForEnum","InputTextField","textFieldProps","syncSubmit","asyncSubmitHandler","catch","rethrow","useHookForm","useForm","identity","useHookFormContext","HookFormProvider","FormProvider","InputEmail","formDefaults","type","autoComplete","emailInput","match","InputPasswordSet","passwordField","passwordValidationField","doNotMatchError","passwordFieldMerged","validationFieldMerged","validatePasswordMatch","passwordValue","_Fragment","LoadingButtonState","LoadingButton","buttonText","buttonTextSuccess","loadingButtonProps","loadingButtonPropsPropsSuccess","buttonState","successIcon","isSuccess","Success","propsToSpread","MuiLoadingButton","loading","Loading","Idle","loadingButtonStateFromReactQueryMutationStatus","mutationStatus","mapStatus","idle","success","useLoadingButtonStateFromFormContext","formContext","loadingButtonStateFromFormState","isSubmitting","isDirty","isSubmitSuccessful"],"mappings":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AGpN,cAAc,EAAE,CAAA;AAEpC,EAAA,OAAOqN,+BAA+B,CAACD,WAAW,CAAClN,SAAS,CAAC,CAAA;AAC/D,EAAC;AAED;;AAEG;AACI,MAAMmN,+BAA+B,GAAGA;AAC7C;AACA;AACAnN,SAAyB,KACH;EACtB,IAAIA,SAAS,CAACoN,YAAY,EAAE;IAC1B,OAAOvB,kBAAkB,CAACa,OAAO,CAAA;AAClC,GAAA;EAED,IAAI1M,SAAS,CAACqN,OAAO,EAAE;IACrB,OAAOxB,kBAAkB,CAACc,IAAI,CAAA;AAC/B,GAAA;EAED,IAAI3M,SAAS,CAACsN,kBAAkB,EAAE;IAChC,OAAOzB,kBAAkB,CAACS,OAAO,CAAA;AAClC,GAAA;EAED,OAAOT,kBAAkB,CAACc,IAAI,CAAA;AAChC;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1,79 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@nwon/react-mui-hook-form",
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"MUI",
|
|
8
|
+
"React Hook Form",
|
|
9
|
+
"forms",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://gitlab.com/nwon-group/nwon-tooling/npm-packages/react-mui-hook-form"
|
|
15
|
+
},
|
|
16
|
+
"description": "Making react forms easy - A connection of MUI and React Hook Form",
|
|
17
|
+
"types": "dist/packageExports.d.ts",
|
|
18
|
+
"main": "dist/packageExports.js",
|
|
19
|
+
"cracoConfig": "craco.config.cjs",
|
|
20
|
+
"scripts": {},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"readme.md",
|
|
24
|
+
"license"
|
|
25
|
+
],
|
|
26
|
+
"author": "NWON",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@babel/core": "^7.21.3",
|
|
30
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
31
|
+
"@babel/preset-flow": "^7.18.6",
|
|
32
|
+
"@babel/preset-react": "^7.18.6",
|
|
33
|
+
"@craco/craco": "^6.4.3",
|
|
34
|
+
"@nvon/eslint-config": "^1.21.1",
|
|
35
|
+
"@nvon/node-toolbox": "^0.20.4",
|
|
36
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
37
|
+
"@types/lodash-es": "^4.17.6",
|
|
38
|
+
"@types/node": "^18.11.11",
|
|
39
|
+
"@types/react-dom": ">=17.0.0",
|
|
40
|
+
"@types/webpack": "^4.41.32",
|
|
41
|
+
"cross-env": "^7.0.3",
|
|
42
|
+
"npm": "^9.5.0",
|
|
43
|
+
"react-scripts": "^4.0.3",
|
|
44
|
+
"rimraf": "^3.0.2",
|
|
45
|
+
"rollup": "^3.19.1",
|
|
46
|
+
"rollup-plugin-sass": "^1.12.17",
|
|
47
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
48
|
+
"typescript": "^4.9.5"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@babel/runtime": "^7.21.0",
|
|
52
|
+
"@mui/icons-material": "^5.15.10",
|
|
53
|
+
"@mui/lab": "^5.0.0-alpha.134",
|
|
54
|
+
"@mui/material": "^5.15.5",
|
|
55
|
+
"@mui/x-date-pickers": "^5.0.20",
|
|
56
|
+
"@nvon/baseline": "^0.33.0",
|
|
57
|
+
"dayjs": "^1.11.10",
|
|
58
|
+
"i18next": "^22.4.10",
|
|
59
|
+
"lodash-es": "^4.17.21",
|
|
60
|
+
"react-hook-form": "^7.41.3",
|
|
61
|
+
"react-i18next": "^11.18.5"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"react": ">=17.0.0",
|
|
65
|
+
"react-dom": ">=17.0.0"
|
|
66
|
+
},
|
|
67
|
+
"browserslist": {
|
|
68
|
+
"production": [
|
|
69
|
+
">0.2%",
|
|
70
|
+
"not dead",
|
|
71
|
+
"not op_mini all"
|
|
72
|
+
],
|
|
73
|
+
"development": [
|
|
74
|
+
"last 1 chrome version",
|
|
75
|
+
"last 1 firefox version",
|
|
76
|
+
"last 1 safari version"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|