@digigov/form 2.0.0-a32ad9b2 → 2.0.0-abd768eb
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/Field/FieldBase/index.js +7 -2
- package/Field/FieldBase.js.map +2 -2
- package/Field/FieldBaseContainer/index.js +37 -18
- package/Field/FieldBaseContainer.d.ts +1 -1
- package/Field/FieldBaseContainer.js.map +2 -2
- package/Field/FieldConditional/index.js +4 -0
- package/Field/FieldConditional.js.map +2 -2
- package/Field/index.js +10 -4
- package/Field/index.js.map +2 -2
- package/Field/types.d.ts +10 -3
- package/Field/utils/index.js +3 -1
- package/Field/utils/index.js.map +2 -2
- package/Field/utils/useField/index.js +8 -1
- package/Field/utils/useField.js.map +2 -2
- package/FieldArray/FormDialog/index.js +314 -196
- package/FieldArray/FormDialog.d.ts +20 -7
- package/FieldArray/FormDialog.js.map +3 -3
- package/FieldArray/__stories__/Default.d.ts +1 -1
- package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
- package/FieldArray/__stories__/WithModal.d.ts +1 -1
- package/FieldArray/index.d.ts +1 -0
- package/FieldArray/index.js +32 -8
- package/FieldArray/index.js.map +2 -2
- package/FieldObject/index.d.ts +3 -0
- package/FieldObject/index.js +26 -15
- package/FieldObject/index.js.map +2 -2
- package/FormBuilder/FormBuilder.stories.d.ts +2 -0
- package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +1 -1
- package/FormBuilder/__stories__/Default.d.ts +1 -1
- package/FormBuilder/__stories__/ErrorGrouping.d.ts +1 -1
- package/FormBuilder/index.d.ts +1 -1
- package/FormBuilder/index.js +11 -7
- package/FormBuilder/index.js.map +2 -2
- package/FormContext/index.js +6 -2
- package/FormContext.d.ts +1 -0
- package/FormContext.js.map +2 -2
- package/MultiplicityField/MultiplicityField.stories.d.ts +2 -0
- package/MultiplicityField/__stories__/Default.d.ts +1 -1
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
- package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
- package/MultiplicityField/add-objects/index.js +2 -0
- package/MultiplicityField/add-objects.js.map +2 -2
- package/MultiplicityField/index.js +4 -1
- package/MultiplicityField/index.js.map +2 -2
- package/MultiplicityField/types.d.ts +1 -0
- package/Questions/Questions.stories.d.ts +2 -0
- package/Questions/__stories__/Default.d.ts +1 -1
- package/cjs/Field/FieldBase/index.js +7 -2
- package/cjs/Field/FieldBase.js.map +2 -2
- package/cjs/Field/FieldBaseContainer/index.js +36 -17
- package/cjs/Field/FieldBaseContainer.js.map +3 -3
- package/cjs/Field/FieldConditional/index.js +4 -0
- package/cjs/Field/FieldConditional.js.map +2 -2
- package/cjs/Field/index.js +10 -4
- package/cjs/Field/index.js.map +2 -2
- package/cjs/Field/types.js.map +1 -1
- package/cjs/Field/utils/index.js +3 -1
- package/cjs/Field/utils/index.js.map +2 -2
- package/cjs/Field/utils/useField/index.js +8 -1
- package/cjs/Field/utils/useField.js.map +2 -2
- package/cjs/FieldArray/FormDialog/index.js +309 -194
- package/cjs/FieldArray/FormDialog.js.map +3 -3
- package/cjs/FieldArray/index.js +31 -7
- package/cjs/FieldArray/index.js.map +2 -2
- package/cjs/FieldObject/index.js +26 -15
- package/cjs/FieldObject/index.js.map +2 -2
- package/cjs/FormBuilder/index.js +11 -7
- package/cjs/FormBuilder/index.js.map +2 -2
- package/cjs/FormContext/index.js +7 -2
- package/cjs/FormContext.js.map +2 -2
- package/cjs/MultiplicityField/add-objects/index.js +2 -0
- package/cjs/MultiplicityField/add-objects.js.map +2 -2
- package/cjs/MultiplicityField/index.js +4 -1
- package/cjs/MultiplicityField/index.js.map +2 -2
- package/cjs/MultiplicityField/types.js.map +1 -1
- package/cjs/inputs/Checkboxes/index.js +2 -2
- package/cjs/inputs/Checkboxes/index.js.map +2 -2
- package/cjs/inputs/DateInput/index.js +41 -14
- package/cjs/inputs/DateInput/index.js.map +2 -2
- package/cjs/inputs/DateTimeInput/index.js +68 -34
- package/cjs/inputs/DateTimeInput/index.js.map +2 -2
- package/cjs/inputs/FileInput/index.js +52 -29
- package/cjs/inputs/FileInput/index.js.map +2 -2
- package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/cjs/inputs/ImageInput/index.js +41 -10
- package/cjs/inputs/ImageInput/index.js.map +2 -2
- package/cjs/inputs/Input/index.js +4 -4
- package/cjs/inputs/Input/index.js.map +2 -2
- package/cjs/inputs/Select/index.js +4 -3
- package/cjs/inputs/Select/index.js.map +2 -2
- package/cjs/inputs/inputsScenarios/index.js +2 -2
- package/cjs/inputs/inputsScenarios.js.map +2 -2
- package/cjs/lazy/index.js +2 -1
- package/cjs/lazy.js.map +2 -2
- package/cjs/registry/index.js +6 -6
- package/cjs/registry.js.map +2 -2
- package/cjs/types.js.map +1 -1
- package/cjs/utils/index.js +20 -6
- package/cjs/utils.js.map +2 -2
- package/cjs/validators/index.js +11 -6
- package/cjs/validators/index.js.map +2 -2
- package/cjs/validators/utils/amka/index.js +60 -0
- package/cjs/validators/utils/amka.js.map +7 -0
- package/cjs/validators/utils/date/index.js +26 -3
- package/cjs/validators/utils/date.js.map +2 -2
- package/cjs/validators/utils/datetime/index.js +118 -24
- package/cjs/validators/utils/datetime.js.map +2 -2
- package/cjs/validators/utils/file/index.js +30 -17
- package/cjs/validators/utils/file.js.map +2 -2
- package/cjs/validators/utils/index.js +5 -1
- package/cjs/validators/utils/index.js.map +2 -2
- package/index.js +1 -1
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -0
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +2 -0
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Checkboxes/index.js +2 -2
- package/inputs/Checkboxes/index.js.map +2 -2
- package/inputs/DateInput/DateInput.stories.d.ts +6 -0
- package/inputs/DateInput/__stories__/Default.d.ts +1 -1
- package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateInput/index.js +42 -15
- package/inputs/DateInput/index.js.map +2 -2
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +10 -3
- package/inputs/DateTimeInput/__stories__/Default.d.ts +1 -1
- package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/index.js +69 -35
- package/inputs/DateTimeInput/index.js.map +2 -2
- package/inputs/FileInput/FileInput.stories.d.ts +3 -0
- package/inputs/FileInput/__stories__/Default.d.ts +1 -1
- package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
- package/inputs/FileInput/index.d.ts +11 -4
- package/inputs/FileInput/index.js +57 -31
- package/inputs/FileInput/index.js.map +2 -2
- package/inputs/ImageInput/ImageInput.stories.d.ts +4 -1
- package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
- package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
- package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
- package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/inputs/ImageInput/__stories__/logo.d/package.json +6 -0
- package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/inputs/ImageInput/index.d.ts +9 -1
- package/inputs/ImageInput/index.js +42 -11
- package/inputs/ImageInput/index.js.map +2 -2
- package/inputs/Input/Input.stories.d.ts +4 -0
- package/inputs/Input/__stories__/AFM.d.ts +1 -1
- package/inputs/Input/__stories__/AMKA.d.ts +3 -0
- package/inputs/Input/__stories__/Boolean.d.ts +1 -1
- package/inputs/Input/__stories__/Email.d.ts +3 -0
- package/inputs/Input/__stories__/IBAN.d.ts +1 -1
- package/inputs/Input/__stories__/Integer.d.ts +1 -1
- package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
- package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
- package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
- package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
- package/inputs/Input/__stories__/String.d.ts +1 -1
- package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +1 -1
- package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
- package/inputs/Input/index.d.ts +2 -1
- package/inputs/Input/index.js +4 -4
- package/inputs/Input/index.js.map +2 -2
- package/inputs/Label/Label.stories.d.ts +2 -0
- package/inputs/Label/__stories__/Default.d.ts +1 -1
- package/inputs/OtpInput/OtpInput.stories.d.ts +2 -0
- package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
- package/inputs/Radio/Radio.stories.d.ts +2 -0
- package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
- package/inputs/Radio/__stories__/Default.d.ts +1 -1
- package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Select/Select.stories.d.ts +2 -0
- package/inputs/Select/__stories__/Default.d.ts +1 -1
- package/inputs/Select/index.d.ts +2 -1
- package/inputs/Select/index.js +4 -3
- package/inputs/Select/index.js.map +2 -2
- package/inputs/inputsScenarios/index.js +2 -2
- package/inputs/inputsScenarios.d.ts +1 -1
- package/inputs/inputsScenarios.js.map +2 -2
- package/lazy/index.js +2 -1
- package/package.json +4 -4
- package/registry/index.js +6 -6
- package/src/Field/FieldBase.tsx +6 -1
- package/src/Field/FieldBaseContainer.tsx +68 -48
- package/src/Field/FieldConditional.tsx +4 -0
- package/src/Field/index.tsx +15 -5
- package/src/Field/types.tsx +11 -3
- package/src/Field/utils/index.ts +2 -0
- package/src/Field/utils/useField.ts +9 -1
- package/src/FieldArray/FormDialog.tsx +430 -243
- package/src/FieldArray/__stories__/Default.tsx +1 -1
- package/src/FieldArray/__stories__/WithExactLength.tsx +1 -1
- package/src/FieldArray/__stories__/WithModal.tsx +4 -3
- package/src/FieldArray/index.tsx +53 -30
- package/src/FieldObject/index.tsx +33 -18
- package/src/FormBuilder/FormBuilder.stories.js +3 -0
- package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +1 -1
- package/src/FormBuilder/__stories__/Default.tsx +1 -1
- package/src/FormBuilder/__stories__/ErrorGrouping.tsx +1 -1
- package/src/FormBuilder/index.tsx +12 -7
- package/src/FormBuilder/scenarios.test.tsx +763 -5
- package/src/FormContext.tsx +5 -1
- package/src/MultiplicityField/MultiplicityField.stories.js +3 -0
- package/src/MultiplicityField/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
- package/src/MultiplicityField/add-objects.tsx +2 -0
- package/src/MultiplicityField/index.tsx +3 -0
- package/src/MultiplicityField/types.ts +1 -0
- package/src/Questions/Questions.stories.js +3 -0
- package/src/Questions/__stories__/Default.tsx +1 -1
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +3 -0
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -1
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +1 -1
- package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -0
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Checkboxes/index.tsx +2 -6
- package/src/inputs/DateInput/DateInput.stories.js +7 -0
- package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
- package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateInput/index.test.tsx +16 -0
- package/src/inputs/DateInput/index.tsx +46 -14
- package/src/inputs/DateTimeInput/DateTimeInput.stories.js +12 -6
- package/src/inputs/DateTimeInput/__stories__/Default.tsx +1 -1
- package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/index.test.tsx +16 -0
- package/src/inputs/DateTimeInput/index.tsx +73 -34
- package/src/inputs/FileInput/FileInput.stories.js +4 -0
- package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
- package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
- package/src/inputs/FileInput/index.test.tsx +4 -0
- package/src/inputs/FileInput/index.tsx +90 -48
- package/src/inputs/ImageInput/ImageInput.stories.js +5 -1
- package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
- package/src/inputs/ImageInput/__stories__/MaxSize.tsx +3 -2
- package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +45 -0
- package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +1 -1
- package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
- package/src/inputs/ImageInput/__stories__/logo.png +0 -0
- package/src/inputs/ImageInput/index.test.tsx +21 -17
- package/src/inputs/ImageInput/index.tsx +100 -48
- package/src/inputs/Input/Input.stories.js +5 -0
- package/src/inputs/Input/__stories__/AFM.tsx +1 -1
- package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
- package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
- package/src/inputs/Input/__stories__/Email.tsx +23 -0
- package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
- package/src/inputs/Input/__stories__/Integer.tsx +1 -1
- package/src/inputs/Input/__stories__/LandlineNumber.tsx +1 -1
- package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
- package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
- package/src/inputs/Input/__stories__/String.tsx +1 -1
- package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +1 -1
- package/src/inputs/Input/__stories__/TextWithLimit.tsx +1 -1
- package/src/inputs/Input/index.test.tsx +8 -0
- package/src/inputs/Input/index.tsx +5 -3
- package/src/inputs/Label/Label.stories.js +3 -0
- package/src/inputs/Label/__stories__/Default.tsx +1 -1
- package/src/inputs/OtpInput/OtpInput.stories.js +3 -0
- package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/Radio.stories.js +3 -0
- package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Select/Select.stories.js +3 -0
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/inputs/Select/index.tsx +7 -4
- package/src/inputs/inputsScenarios.ts +2 -2
- package/src/lazy.js +2 -1
- package/src/registry.js +6 -6
- package/src/types.tsx +2 -1
- package/src/utils.ts +27 -6
- package/src/validators/index.ts +17 -6
- package/src/validators/utils/amka.ts +39 -0
- package/src/validators/utils/date.ts +28 -4
- package/src/validators/utils/datetime.ts +121 -29
- package/src/validators/utils/file.ts +33 -19
- package/src/validators/utils/index.ts +4 -1
- package/types.d.ts +2 -1
- package/types.js.map +1 -1
- package/utils/index.js +20 -6
- package/utils.d.ts +2 -0
- package/utils.js.map +2 -2
- package/validators/index.d.ts +1 -1
- package/validators/index.js +12 -6
- package/validators/index.js.map +2 -2
- package/validators/utils/amka/index.js +36 -0
- package/{inputs/Input/inputsInputScenarios → validators/utils/amka}/package.json +1 -1
- package/validators/utils/amka.d.ts +6 -0
- package/validators/utils/amka.js.map +7 -0
- package/validators/utils/date/index.js +26 -3
- package/validators/utils/date.d.ts +1 -1
- package/validators/utils/date.js.map +2 -2
- package/validators/utils/datetime/index.js +118 -24
- package/validators/utils/datetime.d.ts +1 -1
- package/validators/utils/datetime.js.map +2 -2
- package/validators/utils/file/index.js +30 -17
- package/validators/utils/file.js.map +2 -2
- package/validators/utils/index.d.ts +1 -0
- package/validators/utils/index.js +4 -1
- package/validators/utils/index.js.map +2 -2
- package/cjs/inputs/Input/inputsInputScenarios/index.js +0 -439
- package/cjs/inputs/Input/inputsInputScenarios.js.map +0 -7
- package/inputs/Input/inputsInputScenarios/index.js +0 -406
- package/inputs/Input/inputsInputScenarios.d.ts +0 -57
- package/inputs/Input/inputsInputScenarios.js.map +0 -7
- package/src/inputs/Input/inputsInputScenarios.ts +0 -404
package/src/FormContext.tsx
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import React, { createContext } from 'react';
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
2
|
import { FormContextProps } from '@digigov/form/types';
|
|
3
3
|
|
|
4
4
|
export const FormContext: React.Context<FormContextProps> = createContext({
|
|
5
5
|
fieldsMap: {},
|
|
6
6
|
fieldsetsMap: {},
|
|
7
7
|
} as FormContextProps);
|
|
8
|
+
|
|
9
|
+
export const useFormContext = () => {
|
|
10
|
+
return useContext(FormContext);
|
|
11
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import MultiplicityField from '@digigov/form/MultiplicityField';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov Form/MultiplicityField',
|
|
4
5
|
component: MultiplicityField,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
5
8
|
displayName: 'MultiplicityField',
|
|
6
9
|
};
|
|
7
10
|
export { Default } from '@digigov/form/MultiplicityField/__stories__/Default';
|
|
@@ -47,6 +47,7 @@ export const AddObjects: React.FC<AddObjectsProps> = ({
|
|
|
47
47
|
setValue,
|
|
48
48
|
stashedObjects,
|
|
49
49
|
getValues,
|
|
50
|
+
resetField,
|
|
50
51
|
onStash,
|
|
51
52
|
error,
|
|
52
53
|
Field,
|
|
@@ -187,6 +188,7 @@ export const AddObjects: React.FC<AddObjectsProps> = ({
|
|
|
187
188
|
control={control}
|
|
188
189
|
register={register}
|
|
189
190
|
reset={reset}
|
|
191
|
+
resetField={resetField}
|
|
190
192
|
Field={Field}
|
|
191
193
|
error={
|
|
192
194
|
extra?.max - stashedObjects.length === 0 ||
|
|
@@ -31,6 +31,7 @@ export const Multiplicity: React.FC<MultiplicityProps> = ({
|
|
|
31
31
|
setValue,
|
|
32
32
|
getValues,
|
|
33
33
|
unregister,
|
|
34
|
+
resetField,
|
|
34
35
|
Field,
|
|
35
36
|
}) => {
|
|
36
37
|
const { fields, append, remove } = useFieldArray({
|
|
@@ -60,6 +61,7 @@ export const Multiplicity: React.FC<MultiplicityProps> = ({
|
|
|
60
61
|
hasError={formState.isSubmitted && !formState.isSubmitting && !!error}
|
|
61
62
|
wrapper="fieldset"
|
|
62
63
|
name={name}
|
|
64
|
+
register={register}
|
|
63
65
|
>
|
|
64
66
|
{stashedObjects.length > 0 ? (
|
|
65
67
|
<div>
|
|
@@ -98,6 +100,7 @@ export const Multiplicity: React.FC<MultiplicityProps> = ({
|
|
|
98
100
|
getValues={getValues}
|
|
99
101
|
unregister={unregister}
|
|
100
102
|
trigger={trigger}
|
|
103
|
+
resetField={resetField}
|
|
101
104
|
clearErrors={clearErrors}
|
|
102
105
|
Field={Field}
|
|
103
106
|
/>
|
|
@@ -12,6 +12,7 @@ export interface MultiplicityProps
|
|
|
12
12
|
setValue: UseFormReturn['setValue'];
|
|
13
13
|
getValues: UseFormReturn['getValues'];
|
|
14
14
|
unregister: UseFormReturn['unregister'];
|
|
15
|
+
resetField?: UseFormReturn['resetField'];
|
|
15
16
|
error?: ErrorOption;
|
|
16
17
|
extra?: Record<string, any>;
|
|
17
18
|
label?: FieldSpec['label'];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Questions from '@digigov/form/Questions';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov Form/Questions',
|
|
4
5
|
component: Questions,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
5
8
|
displayName: 'Questions',
|
|
6
9
|
};
|
|
7
10
|
export { Default } from '@digigov/form/Questions/__stories__/Default';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import AutoComplete from '@digigov/form/inputs/AutoCompleteInput';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov Form/inputs/AutoCompleteInput',
|
|
4
5
|
component: AutoComplete,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
5
8
|
displayName: 'AutoCompleteInput',
|
|
6
9
|
};
|
|
7
10
|
export { Default } from '@digigov/form/inputs/AutoCompleteInput/__stories__/Default';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Checkboxes from '@digigov/form/inputs/Checkboxes';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov Form/inputs/Checkboxes',
|
|
4
5
|
component: Checkboxes,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
5
8
|
displayName: 'Checkboxes',
|
|
6
9
|
};
|
|
7
10
|
export { Default } from '@digigov/form/inputs/Checkboxes/__stories__/Default';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import FormBuilder, { Field } from '@digigov/form';
|
|
3
3
|
import { Button } from '@digigov/ui/form/Button';
|
|
4
4
|
|
|
5
|
-
export const WithDivider = () => (
|
|
5
|
+
export const WithDivider = (_: any) => (
|
|
6
6
|
<FormBuilder
|
|
7
7
|
onSubmit={(data) => {
|
|
8
8
|
console.log(data);
|
|
@@ -32,14 +32,10 @@ export const Checkboxes: React.FC<CheckboxesProps> = ({
|
|
|
32
32
|
const handleChange =
|
|
33
33
|
(optionValue, idx, show) =>
|
|
34
34
|
(evt): void => {
|
|
35
|
-
let newValue;
|
|
35
|
+
let newValue: any = [];
|
|
36
36
|
if (evt.currentTarget.checked) {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
38
|
-
// @ts-ignore
|
|
39
37
|
newValue = value.concat([optionValue]);
|
|
40
38
|
} else {
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
42
|
-
// @ts-ignore
|
|
43
39
|
newValue = value.filter((val) => val !== optionValue);
|
|
44
40
|
}
|
|
45
41
|
if (show && show.length > 0) {
|
|
@@ -85,9 +81,9 @@ export const Checkboxes: React.FC<CheckboxesProps> = ({
|
|
|
85
81
|
...props,
|
|
86
82
|
reset: undefined,
|
|
87
83
|
defaultValue: undefined,
|
|
84
|
+
error: undefined,
|
|
88
85
|
onBlur: undefined,
|
|
89
86
|
required: undefined,
|
|
90
|
-
Field: undefined,
|
|
91
87
|
'aria-describedby': undefined,
|
|
92
88
|
type: 'checkbox',
|
|
93
89
|
}}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import DateInput from '@digigov/form/inputs/DateInput';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Digigov Form/inputs/DateInput',
|
|
4
5
|
component: DateInput,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
5
8
|
displayName: 'DateInput',
|
|
6
9
|
};
|
|
7
10
|
export { Default } from '@digigov/form/inputs/DateInput/__stories__/Default';
|
|
11
|
+
export { WithDefaultValue } from '@digigov/form/inputs/DateInput/__stories__/WithDefaultValue';
|
|
12
|
+
export { WithWrongDefaultValue } from '@digigov/form/inputs/DateInput/__stories__/WithWrongDefaultValue';
|
|
13
|
+
export { WithInitialValue } from '@digigov/form/inputs/DateInput/__stories__/WithInitialValue';
|
|
14
|
+
export { WithWrongInitialValue } from '@digigov/form/inputs/DateInput/__stories__/WithWrongInitialValue';
|
|
@@ -14,7 +14,7 @@ const fields = [
|
|
|
14
14
|
} as const,
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
-
export const Default = () => (
|
|
17
|
+
export const Default = (_: any) => (
|
|
18
18
|
<FormBuilder onSubmit={() => console.log('kati')}>
|
|
19
19
|
{fields.map(({ key, ...field }) => {
|
|
20
20
|
return <Field {...field} name={key} key={key} />;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'date_example',
|
|
8
|
+
type: 'date',
|
|
9
|
+
required: true,
|
|
10
|
+
defaultValue: '05/11/2020',
|
|
11
|
+
label: {
|
|
12
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
+
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
14
|
+
},
|
|
15
|
+
} as const,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const WithDefaultValue = (_: any) => (
|
|
19
|
+
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
+
{fields.map(({ key, ...field }) => {
|
|
21
|
+
return <Field {...field} name={key} key={key} />;
|
|
22
|
+
})}
|
|
23
|
+
<Button type="submit">Συνέχεια</Button>
|
|
24
|
+
</FormBuilder>
|
|
25
|
+
);
|
|
26
|
+
export default WithDefaultValue;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'date_example',
|
|
8
|
+
type: 'date',
|
|
9
|
+
required: true,
|
|
10
|
+
label: {
|
|
11
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
+
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
+
},
|
|
14
|
+
} as const,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const WithInitialValue = (_: any) => (
|
|
18
|
+
<FormBuilder
|
|
19
|
+
initial={{ date_example: '05/01/2020' }}
|
|
20
|
+
onSubmit={(data) => console.log(data)}
|
|
21
|
+
>
|
|
22
|
+
{fields.map(({ key, ...field }) => {
|
|
23
|
+
return <Field {...field} name={key} key={key} />;
|
|
24
|
+
})}
|
|
25
|
+
<Button type="submit">Συνέχεια</Button>
|
|
26
|
+
</FormBuilder>
|
|
27
|
+
);
|
|
28
|
+
export default WithInitialValue;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'date_example',
|
|
8
|
+
type: 'date',
|
|
9
|
+
required: true,
|
|
10
|
+
defaultValue: '5/1/2020',
|
|
11
|
+
label: {
|
|
12
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
+
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
14
|
+
},
|
|
15
|
+
} as const,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const WithWrongDefaultValue = (_: any) => (
|
|
19
|
+
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
+
{fields.map(({ key, ...field }) => {
|
|
21
|
+
return <Field {...field} name={key} key={key} />;
|
|
22
|
+
})}
|
|
23
|
+
<Button type="submit">Συνέχεια</Button>
|
|
24
|
+
</FormBuilder>
|
|
25
|
+
);
|
|
26
|
+
export default WithWrongDefaultValue;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'date_example',
|
|
8
|
+
type: 'date',
|
|
9
|
+
required: true,
|
|
10
|
+
label: {
|
|
11
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
+
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
+
},
|
|
14
|
+
} as const,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const WithWrongInitialValue = (_: any) => (
|
|
18
|
+
<FormBuilder
|
|
19
|
+
initial={{ date_example: '5/1/2020' }}
|
|
20
|
+
onSubmit={(data) => console.log(data)}
|
|
21
|
+
>
|
|
22
|
+
{fields.map(({ key, ...field }) => {
|
|
23
|
+
return <Field {...field} name={key} key={key} />;
|
|
24
|
+
})}
|
|
25
|
+
<Button type="submit">Συνέχεια</Button>
|
|
26
|
+
</FormBuilder>
|
|
27
|
+
);
|
|
28
|
+
export default WithWrongInitialValue;
|
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { test, expect } from '@playwright/experimental-ct-react';
|
|
3
3
|
import TestVariant from '@digigov/ui/utils/TestVariant'
|
|
4
4
|
import { Default } from '@digigov/form/inputs/DateInput/__stories__/Default';
|
|
5
|
+
import { WithDefaultValue } from '@digigov/form/inputs/DateInput/__stories__/WithDefaultValue';
|
|
6
|
+
import { WithInitialValue } from '@digigov/form/inputs/DateInput/__stories__/WithInitialValue';
|
|
7
|
+
import { WithWrongDefaultValue } from '@digigov/form/inputs/DateInput/__stories__/WithWrongDefaultValue';
|
|
8
|
+
import { WithWrongInitialValue } from '@digigov/form/inputs/DateInput/__stories__/WithWrongInitialValue';
|
|
5
9
|
|
|
6
10
|
test('renders the All DateInput variants', async ({ mount, page }) => {
|
|
7
11
|
await mount(
|
|
@@ -10,6 +14,18 @@ test('renders the All DateInput variants', async ({ mount, page }) => {
|
|
|
10
14
|
<TestVariant title="Default">
|
|
11
15
|
<Default />
|
|
12
16
|
</TestVariant>
|
|
17
|
+
<TestVariant title="WithDefaultValue">
|
|
18
|
+
<WithDefaultValue />
|
|
19
|
+
</TestVariant>
|
|
20
|
+
<TestVariant title="WithInitialValue">
|
|
21
|
+
<WithInitialValue />
|
|
22
|
+
</TestVariant>
|
|
23
|
+
<TestVariant title="WithWrongDefaultValue">
|
|
24
|
+
<WithWrongDefaultValue />
|
|
25
|
+
</TestVariant>
|
|
26
|
+
<TestVariant title="WithWrongInitialValue">
|
|
27
|
+
<WithWrongInitialValue />
|
|
28
|
+
</TestVariant>
|
|
13
29
|
</div>
|
|
14
30
|
)
|
|
15
31
|
await page.evaluate(() => document.fonts.ready);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { useMemo,
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
4
4
|
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
5
|
+
import { useFormContext } from '@digigov/form/FormContext';
|
|
5
6
|
import {
|
|
6
7
|
DateInputContainer,
|
|
7
8
|
DateInputItem,
|
|
@@ -16,22 +17,25 @@ export interface DateInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
function useDate(value,
|
|
20
|
+
function useDate(name, value, form) {
|
|
20
21
|
const [year, month, day] = useMemo(() => {
|
|
21
22
|
if (!value || value.length === 0) {
|
|
22
|
-
onChange('');
|
|
23
23
|
return ['', '', ''];
|
|
24
24
|
}
|
|
25
25
|
const [day, month, year] = value.split('/');
|
|
26
26
|
return [year, month, day];
|
|
27
27
|
}, [value]);
|
|
28
28
|
|
|
29
|
+
function update(value) {
|
|
30
|
+
form.setValue(name, value, { shouldValidate: false });
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
function set(year, month, day) {
|
|
30
34
|
const value = `${day || ''}/${month || ''}/${year || ''}`;
|
|
31
35
|
if (!year && !month && !day) {
|
|
32
|
-
|
|
36
|
+
update('');
|
|
33
37
|
} else {
|
|
34
|
-
|
|
38
|
+
update(value);
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
41
|
|
|
@@ -56,6 +60,12 @@ function useDate(value, onChange) {
|
|
|
56
60
|
set(year, month, val);
|
|
57
61
|
}
|
|
58
62
|
|
|
63
|
+
function trigger() {
|
|
64
|
+
if (form.formState.isSubmitted) {
|
|
65
|
+
form.trigger(name);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
59
69
|
return {
|
|
60
70
|
day,
|
|
61
71
|
month,
|
|
@@ -63,6 +73,7 @@ function useDate(value, onChange) {
|
|
|
63
73
|
setYear,
|
|
64
74
|
setMonth,
|
|
65
75
|
setDay,
|
|
76
|
+
trigger,
|
|
66
77
|
};
|
|
67
78
|
}
|
|
68
79
|
|
|
@@ -82,22 +93,37 @@ const DatePart = ({ label, ...props }) => {
|
|
|
82
93
|
|
|
83
94
|
export const DateInput = ({ name, ...props }) => {
|
|
84
95
|
const { t } = useTranslation();
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
const form = useFormContext();
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const initialValue = form.getValues(name);
|
|
100
|
+
// checks if the initial value is undefined and if the default value is valid date
|
|
101
|
+
if (initialValue === undefined && props.defaultValue) {
|
|
102
|
+
form.setValue(name, makeDate(props.defaultValue), {
|
|
103
|
+
shouldValidate: false,
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
// checks if the initial value is a valid date
|
|
107
|
+
form.setValue(name, makeDate(initialValue), {
|
|
108
|
+
shouldValidate: false,
|
|
109
|
+
});
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
}, [props.value, initial]);
|
|
111
|
+
}, []);
|
|
92
112
|
|
|
93
|
-
const
|
|
113
|
+
const value = form.getValues(name);
|
|
114
|
+
const date = useDate(name, value, form);
|
|
94
115
|
|
|
95
116
|
return (
|
|
96
117
|
<DateInputContainer>
|
|
97
118
|
<DatePart
|
|
98
119
|
label={t('form.label.day')}
|
|
99
120
|
onChange={date.setDay}
|
|
100
|
-
onBlur={(e) =>
|
|
121
|
+
onBlur={(e) => {
|
|
122
|
+
if (date.day && date.day.length === 1) {
|
|
123
|
+
date.setDay(e, true);
|
|
124
|
+
}
|
|
125
|
+
date.trigger();
|
|
126
|
+
}}
|
|
101
127
|
value={date.day}
|
|
102
128
|
width={2}
|
|
103
129
|
name={`${name}-day`}
|
|
@@ -110,7 +136,12 @@ export const DateInput = ({ name, ...props }) => {
|
|
|
110
136
|
<DatePart
|
|
111
137
|
label={t('form.label.month')}
|
|
112
138
|
onChange={date.setMonth}
|
|
113
|
-
onBlur={(e) =>
|
|
139
|
+
onBlur={(e) => {
|
|
140
|
+
if (date.month && date.month.length === 1) {
|
|
141
|
+
date.setMonth(e, true);
|
|
142
|
+
}
|
|
143
|
+
date.trigger();
|
|
144
|
+
}}
|
|
114
145
|
value={date.month}
|
|
115
146
|
width={2}
|
|
116
147
|
name={`${name}-month`}
|
|
@@ -123,6 +154,7 @@ export const DateInput = ({ name, ...props }) => {
|
|
|
123
154
|
<DatePart
|
|
124
155
|
label={t('form.label.year')}
|
|
125
156
|
onChange={date.setYear}
|
|
157
|
+
onBlur={date.trigger}
|
|
126
158
|
value={date.year}
|
|
127
159
|
width={4}
|
|
128
160
|
name={`${name}-year`}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import DateTimeInput from '@digigov/form/inputs/DateTimeInput';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Form/
|
|
5
|
-
component:
|
|
4
|
+
title: 'Digigov Form/inputs/DateTimeInput',
|
|
5
|
+
component: DateTimeInput,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
markdown: doc,
|
|
8
|
+
displayName: 'DateTimeInput',
|
|
6
9
|
};
|
|
7
|
-
|
|
8
|
-
export {
|
|
10
|
+
export { Default } from '@digigov/form/inputs/DateTimeInput/__stories__/Default';
|
|
11
|
+
export { WithDefaultValue } from '@digigov/form/inputs/DateTimeInput/__stories__/WithDefaultValue';
|
|
12
|
+
export { WithWrongDefaultValue } from '@digigov/form/inputs/DateTimeInput/__stories__/WithWrongDefaultValue';
|
|
13
|
+
export { WithInitialValue } from '@digigov/form/inputs/DateTimeInput/__stories__/WithInitialValue';
|
|
14
|
+
export { WithWrongInitialValue } from '@digigov/form/inputs/DateTimeInput/__stories__/WithWrongInitialValue';
|
|
@@ -14,7 +14,7 @@ const fields = [
|
|
|
14
14
|
} as const,
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
-
export const Default = () => (
|
|
17
|
+
export const Default = (_: any) => (
|
|
18
18
|
<FormBuilder onSubmit={() => console.log('kati')}>
|
|
19
19
|
{fields.map(({ key, ...field }) => {
|
|
20
20
|
return <Field {...field} name={key} key={key} />;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'datetime_example',
|
|
8
|
+
type: 'datetime',
|
|
9
|
+
defaultValue: '05/11/2020 13:30',
|
|
10
|
+
required: true,
|
|
11
|
+
label: {
|
|
12
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
13
|
+
secondary: 'Για παράδειγμα, 05 11 2020 13:30',
|
|
14
|
+
},
|
|
15
|
+
} as const,
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const WithDefaultValue = (_: any) => (
|
|
19
|
+
<FormBuilder onSubmit={(data) => console.log(data)}>
|
|
20
|
+
{fields.map(({ key, ...field }) => {
|
|
21
|
+
return <Field {...field} name={key} key={key} />;
|
|
22
|
+
})}
|
|
23
|
+
<Button type="submit">Συνέχεια</Button>
|
|
24
|
+
</FormBuilder>
|
|
25
|
+
);
|
|
26
|
+
export default WithDefaultValue;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'date_example',
|
|
8
|
+
type: 'datetime',
|
|
9
|
+
required: true,
|
|
10
|
+
label: {
|
|
11
|
+
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
12
|
+
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
13
|
+
},
|
|
14
|
+
} as const,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const WithInitialValue = (_: any) => (
|
|
18
|
+
<FormBuilder
|
|
19
|
+
initial={{ date_example: '05/01/2020 13:30' }}
|
|
20
|
+
onSubmit={(data) => console.log(data)}
|
|
21
|
+
>
|
|
22
|
+
{fields.map(({ key, ...field }) => {
|
|
23
|
+
return <Field {...field} name={key} key={key} />;
|
|
24
|
+
})}
|
|
25
|
+
<Button type="submit">Συνέχεια</Button>
|
|
26
|
+
</FormBuilder>
|
|
27
|
+
);
|
|
28
|
+
export default WithInitialValue;
|