@digigov/form 0.13.2 → 1.0.0-480e3d97
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.js +2 -2
- package/Field/FieldBaseContainer.js +8 -8
- package/Field/FieldConditional.js +2 -2
- package/Field/utils.js +6 -6
- package/FieldArray/__stories__/Default.js +2 -2
- package/FieldArray/__stories__/WithExactLength.js +2 -2
- package/FieldArray/index.js +3 -3
- package/FieldObject/index.d.ts +1 -1
- package/FieldObject/index.js +5 -5
- package/Fieldset/FieldsetWithContext.js +4 -4
- package/Fieldset/index.d.ts +1 -1
- package/Fieldset/index.js +2 -2
- package/Fieldset/types.d.ts +2 -2
- package/FormBuilder/FormBuilder.js +5 -5
- package/FormBuilder/FormBuilder.mdx +29 -44
- package/FormBuilder/__stories__/Default.js +2 -2
- package/MultiplicityField/MultiplicityField.mdx +277 -267
- package/MultiplicityField/__stories__/Default.js +2 -2
- package/MultiplicityField/__stories__/PreviewDisplay.js +9 -9
- package/MultiplicityField/__stories__/WithExactLength.js +2 -2
- package/MultiplicityField/__stories__/WithMaxLength.js +2 -2
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js +2 -2
- package/MultiplicityField/__stories__/WithMinLength.js +2 -2
- package/MultiplicityField/add-objects.js +6 -6
- package/MultiplicityField/index.d.ts +2 -2
- package/MultiplicityField/index.js +7 -7
- package/Questions/Questions.js +2 -2
- package/Questions/Step/ReviewStep.js +8 -8
- package/Questions/Step/Step.js +2 -2
- package/Questions/Step/StepArrayReview.js +11 -11
- package/Questions/Step/StepDescription.js +2 -2
- package/Questions/Step/StepForm.d.ts +1 -1
- package/Questions/Step/StepForm.js +6 -6
- package/Questions/Step/StepTitle.d.ts +1 -1
- package/Questions/Step/StepTitle.js +5 -5
- package/Questions/Step/getAddMoreFields.d.ts +1 -1
- package/Questions/__snapshots__/index.spec.tsx.snap +72 -359
- package/Questions/__stories__/Default.js +7 -7
- package/Questions/index.mdx +45 -48
- package/Questions/index.spec.js +2 -2
- package/create-simple-form.mdx +258 -237
- package/es/Field/FieldBase.js +1 -1
- package/es/Field/FieldBaseContainer.js +6 -6
- package/es/Field/FieldConditional.js +1 -1
- package/es/Field/utils.js +5 -5
- package/es/FieldArray/__stories__/Default.js +1 -1
- package/es/FieldArray/__stories__/WithExactLength.js +1 -1
- package/es/FieldArray/index.js +2 -2
- package/es/FieldObject/index.js +3 -3
- package/es/Fieldset/FieldsetWithContext.js +2 -2
- package/es/Fieldset/index.js +1 -1
- package/es/FormBuilder/FormBuilder.js +3 -3
- package/es/FormBuilder/FormBuilder.mdx +29 -44
- package/es/FormBuilder/__stories__/Default.js +1 -1
- package/es/MultiplicityField/MultiplicityField.mdx +277 -267
- package/es/MultiplicityField/__stories__/Default.js +1 -1
- package/es/MultiplicityField/__stories__/PreviewDisplay.js +8 -8
- package/es/MultiplicityField/__stories__/WithExactLength.js +1 -1
- package/es/MultiplicityField/__stories__/WithMaxLength.js +1 -1
- package/es/MultiplicityField/__stories__/WithMinAndMaxLength.js +1 -1
- package/es/MultiplicityField/__stories__/WithMinLength.js +1 -1
- package/es/MultiplicityField/add-objects.js +3 -3
- package/es/MultiplicityField/index.js +5 -5
- package/es/Questions/Questions.js +1 -1
- package/es/Questions/Step/ReviewStep.js +5 -5
- package/es/Questions/Step/Step.js +1 -1
- package/es/Questions/Step/StepArrayReview.js +7 -7
- package/es/Questions/Step/StepDescription.js +1 -1
- package/es/Questions/Step/StepForm.js +5 -5
- package/es/Questions/Step/StepTitle.js +4 -4
- package/es/Questions/__snapshots__/index.spec.tsx.snap +72 -359
- package/es/Questions/__stories__/Default.js +5 -5
- package/es/Questions/index.mdx +45 -48
- package/es/Questions/index.spec.js +1 -1
- package/es/create-simple-form.mdx +258 -237
- package/es/index.mdx +13 -6
- package/es/inputs/AutoComplete/__stories__/Default.js +3 -3
- package/es/inputs/AutoComplete/index.js +1 -1
- package/es/inputs/Checkboxes/__stories__/Conditional.js +1 -1
- package/es/inputs/Checkboxes/__stories__/Default.js +1 -1
- package/es/inputs/Checkboxes/__stories__/WithDivider.js +2 -2
- package/es/inputs/Checkboxes/index.js +3 -3
- package/es/inputs/DateInput/__stories__/Default.js +1 -1
- package/es/inputs/DateInput/index.js +1 -1
- package/es/inputs/FileInput/__stories__/Default.js +1 -1
- package/es/inputs/FileInput/index.js +6 -6
- package/es/inputs/Input/__stories__/AFM.js +1 -1
- package/es/inputs/Input/__stories__/Boolean.js +1 -1
- package/es/inputs/Input/__stories__/Default.js +1 -1
- package/es/inputs/Input/__stories__/IBAN.js +1 -1
- package/es/inputs/Input/__stories__/Integer.js +1 -1
- package/es/inputs/Input/__stories__/MobilePhone.js +1 -1
- package/es/inputs/Input/__stories__/PhoneNumber.js +1 -1
- package/es/inputs/Input/__stories__/PostalCode.js +1 -1
- package/es/inputs/Input/__stories__/TextWithCharacterLimit.js +1 -1
- package/es/inputs/Input/index.js +1 -1
- package/es/inputs/Label/__stories__/Default.js +1 -1
- package/es/inputs/Label/index.js +3 -3
- package/es/inputs/OtpInput/__stories__/Default.js +1 -1
- package/es/inputs/OtpInput/index.js +5 -5
- package/es/inputs/Radio/__stories__/Conditional.js +1 -1
- package/es/inputs/Radio/__stories__/Default.js +1 -1
- package/es/inputs/Radio/__stories__/WithDivider.js +2 -2
- package/es/inputs/Radio/index.js +4 -4
- package/es/inputs/Select/__stories__/Default.js +1 -1
- package/es/installation.mdx +12 -16
- package/es/utils.js +1 -1
- package/es/validators/index.js +2 -2
- package/esm/Field/FieldBase.js +1 -1
- package/esm/Field/FieldBaseContainer.js +6 -6
- package/esm/Field/FieldConditional.js +1 -1
- package/esm/Field/utils.js +5 -5
- package/esm/FieldArray/__stories__/Default.js +1 -1
- package/esm/FieldArray/__stories__/WithExactLength.js +1 -1
- package/esm/FieldArray/index.js +2 -2
- package/esm/FieldObject/index.js +3 -3
- package/esm/Fieldset/FieldsetWithContext.js +2 -2
- package/esm/Fieldset/index.js +1 -1
- package/esm/FormBuilder/FormBuilder.js +3 -3
- package/esm/FormBuilder/FormBuilder.mdx +29 -44
- package/esm/FormBuilder/__stories__/Default.js +1 -1
- package/esm/MultiplicityField/MultiplicityField.mdx +277 -267
- package/esm/MultiplicityField/__stories__/Default.js +1 -1
- package/esm/MultiplicityField/__stories__/PreviewDisplay.js +8 -8
- package/esm/MultiplicityField/__stories__/WithExactLength.js +1 -1
- package/esm/MultiplicityField/__stories__/WithMaxLength.js +1 -1
- package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +1 -1
- package/esm/MultiplicityField/__stories__/WithMinLength.js +1 -1
- package/esm/MultiplicityField/add-objects.js +3 -3
- package/esm/MultiplicityField/index.js +5 -5
- package/esm/Questions/Questions.js +1 -1
- package/esm/Questions/Step/ReviewStep.js +5 -5
- package/esm/Questions/Step/Step.js +1 -1
- package/esm/Questions/Step/StepArrayReview.js +7 -7
- package/esm/Questions/Step/StepDescription.js +1 -1
- package/esm/Questions/Step/StepForm.js +5 -5
- package/esm/Questions/Step/StepTitle.js +4 -4
- package/esm/Questions/__snapshots__/index.spec.tsx.snap +72 -359
- package/esm/Questions/__stories__/Default.js +5 -5
- package/esm/Questions/index.mdx +45 -48
- package/esm/Questions/index.spec.js +1 -1
- package/esm/create-simple-form.mdx +258 -237
- package/esm/index.js +1 -1
- package/esm/index.mdx +13 -6
- package/esm/inputs/AutoComplete/__stories__/Default.js +3 -3
- package/esm/inputs/AutoComplete/index.js +1 -1
- package/esm/inputs/Checkboxes/__stories__/Conditional.js +1 -1
- package/esm/inputs/Checkboxes/__stories__/Default.js +1 -1
- package/esm/inputs/Checkboxes/__stories__/WithDivider.js +2 -2
- package/esm/inputs/Checkboxes/index.js +3 -3
- package/esm/inputs/DateInput/__stories__/Default.js +1 -1
- package/esm/inputs/DateInput/index.js +1 -1
- package/esm/inputs/FileInput/__stories__/Default.js +1 -1
- package/esm/inputs/FileInput/index.js +6 -6
- package/esm/inputs/Input/__stories__/AFM.js +1 -1
- package/esm/inputs/Input/__stories__/Boolean.js +1 -1
- package/esm/inputs/Input/__stories__/Default.js +1 -1
- package/esm/inputs/Input/__stories__/IBAN.js +1 -1
- package/esm/inputs/Input/__stories__/Integer.js +1 -1
- package/esm/inputs/Input/__stories__/MobilePhone.js +1 -1
- package/esm/inputs/Input/__stories__/PhoneNumber.js +1 -1
- package/esm/inputs/Input/__stories__/PostalCode.js +1 -1
- package/esm/inputs/Input/__stories__/TextWithCharacterLimit.js +1 -1
- package/esm/inputs/Input/index.js +1 -1
- package/esm/inputs/Label/__stories__/Default.js +1 -1
- package/esm/inputs/Label/index.js +3 -3
- package/esm/inputs/OtpInput/__stories__/Default.js +1 -1
- package/esm/inputs/OtpInput/index.js +5 -5
- package/esm/inputs/Radio/__stories__/Conditional.js +1 -1
- package/esm/inputs/Radio/__stories__/Default.js +1 -1
- package/esm/inputs/Radio/__stories__/WithDivider.js +2 -2
- package/esm/inputs/Radio/index.js +4 -4
- package/esm/inputs/Select/__stories__/Default.js +1 -1
- package/esm/installation.mdx +12 -16
- package/esm/utils.js +1 -1
- package/esm/validators/index.js +2 -2
- package/index.mdx +13 -6
- package/inputs/AutoComplete/__stories__/Default.js +4 -4
- package/inputs/AutoComplete/index.d.ts +2 -2
- package/inputs/AutoComplete/index.js +2 -2
- package/inputs/Checkboxes/__stories__/Conditional.js +2 -2
- package/inputs/Checkboxes/__stories__/Default.js +2 -2
- package/inputs/Checkboxes/__stories__/WithDivider.js +3 -3
- package/inputs/Checkboxes/index.d.ts +1 -1
- package/inputs/Checkboxes/index.js +4 -4
- package/inputs/DateInput/__stories__/Default.js +2 -2
- package/inputs/DateInput/index.js +2 -2
- package/inputs/FileInput/__stories__/Default.js +2 -2
- package/inputs/FileInput/index.js +6 -6
- package/inputs/Input/__stories__/AFM.js +2 -2
- package/inputs/Input/__stories__/Boolean.js +2 -2
- package/inputs/Input/__stories__/Default.js +2 -2
- package/inputs/Input/__stories__/IBAN.js +2 -2
- package/inputs/Input/__stories__/Integer.js +2 -2
- package/inputs/Input/__stories__/MobilePhone.js +2 -2
- package/inputs/Input/__stories__/PhoneNumber.js +2 -2
- package/inputs/Input/__stories__/PostalCode.js +2 -2
- package/inputs/Input/__stories__/TextWithCharacterLimit.js +2 -2
- package/inputs/Input/index.js +1 -1
- package/inputs/Label/__stories__/Default.js +2 -2
- package/inputs/Label/index.js +4 -4
- package/inputs/OtpInput/__stories__/Default.js +2 -2
- package/inputs/OtpInput/index.js +5 -5
- package/inputs/Radio/__stories__/Conditional.js +2 -2
- package/inputs/Radio/__stories__/Default.js +2 -2
- package/inputs/Radio/__stories__/WithDivider.js +3 -3
- package/inputs/Radio/index.d.ts +1 -1
- package/inputs/Radio/index.js +7 -7
- package/inputs/Select/__stories__/Default.js +2 -2
- package/inputs/Select/index.d.ts +1 -1
- package/installation.mdx +12 -16
- package/package.json +5 -5
- package/src/Field/FieldBase.tsx +1 -1
- package/src/Field/FieldBaseContainer.tsx +7 -7
- package/src/Field/FieldConditional.tsx +1 -1
- package/src/Field/index.tsx +1 -1
- package/src/Field/utils.ts +7 -7
- package/src/FieldArray/FieldArray.stories.js +1 -1
- package/src/FieldArray/__stories__/Default.tsx +1 -1
- package/src/FieldArray/__stories__/WithExactLength.tsx +1 -1
- package/src/FieldArray/index.tsx +3 -3
- package/src/FieldObject/index.tsx +6 -6
- package/src/Fieldset/FieldsetWithContext.tsx +3 -3
- package/src/Fieldset/index.tsx +5 -5
- package/src/Fieldset/types.tsx +3 -3
- package/src/FormBuilder/FormBuilder.mdx +29 -44
- package/src/FormBuilder/FormBuilder.stories.js +1 -1
- package/src/FormBuilder/FormBuilder.tsx +4 -4
- package/src/FormBuilder/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/MultiplicityField.mdx +277 -267
- package/src/MultiplicityField/MultiplicityField.stories.js +1 -1
- package/src/MultiplicityField/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +18 -18
- 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 +3 -3
- package/src/MultiplicityField/index.tsx +9 -9
- package/src/Questions/Questions.stories.js +1 -1
- package/src/Questions/Questions.tsx +2 -2
- package/src/Questions/Step/ReviewStep.tsx +6 -6
- package/src/Questions/Step/Step.tsx +1 -1
- package/src/Questions/Step/StepArrayReview.tsx +11 -11
- package/src/Questions/Step/StepDescription.tsx +1 -1
- package/src/Questions/Step/StepForm.tsx +6 -6
- package/src/Questions/Step/StepTitle.tsx +15 -13
- package/src/Questions/Step/getAddMoreFields.tsx +1 -1
- package/src/Questions/__snapshots__/index.spec.tsx.snap +72 -359
- package/src/Questions/__stories__/Default.tsx +8 -8
- package/src/Questions/index.mdx +45 -48
- package/src/Questions/index.spec.tsx +1 -1
- package/src/create-simple-form.mdx +258 -237
- package/src/index.mdx +13 -6
- package/src/inputs/AutoComplete/__stories__/Default.tsx +3 -3
- package/src/inputs/AutoComplete/index.tsx +4 -4
- package/src/inputs/Checkboxes/Checkboxes.stories.js +1 -1
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -2
- package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +2 -2
- package/src/inputs/Checkboxes/index.tsx +4 -4
- package/src/inputs/DateInput/DateInput.stories.js +1 -1
- package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
- package/src/inputs/DateInput/index.tsx +2 -2
- package/src/inputs/FileInput/FileInput.stories.js +1 -1
- package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
- package/src/inputs/FileInput/index.tsx +6 -6
- package/src/inputs/Input/__stories__/AFM.tsx +1 -1
- package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
- package/src/inputs/Input/__stories__/Default.tsx +1 -1
- package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
- package/src/inputs/Input/__stories__/Integer.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__/TextWithCharacterLimit.tsx +1 -1
- package/src/inputs/Input/index.tsx +3 -3
- package/src/inputs/Label/Label.stories.js +1 -1
- package/src/inputs/Label/__stories__/Default.tsx +1 -1
- package/src/inputs/Label/index.tsx +4 -4
- package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
- package/src/inputs/OtpInput/index.tsx +14 -10
- package/src/inputs/Radio/Radio.stories.js +1 -2
- package/src/inputs/Radio/__stories__/Conditional.tsx +3 -3
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +2 -2
- package/src/inputs/Radio/index.tsx +6 -6
- package/src/inputs/Select/Select.stories.js +1 -1
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/inputs/Select/index.tsx +2 -2
- package/src/installation.mdx +12 -16
- package/src/types.tsx +4 -2
- package/src/utils.ts +1 -1
- package/src/validators/index.ts +10 -10
- package/src/validators/utils/file.ts +1 -1
- package/src/validators/utils/phone.ts +1 -1
- package/src/validators/utils/postal_code.ts +1 -1
- package/types.d.ts +4 -2
- package/validators/index.d.ts +3 -3
- package/validators/index.js +4 -4
- package/validators/utils/file.d.ts +1 -1
- package/validators/utils/phone.d.ts +1 -1
- package/validators/utils/postal_code.d.ts +1 -1
|
@@ -2,7 +2,7 @@ import MultiplicityField from '@digigov/form/MultiplicityField';
|
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Digigov Form/MultiplicityField',
|
|
4
4
|
component: MultiplicityField,
|
|
5
|
-
displayName: 'MultiplicityField'
|
|
5
|
+
displayName: 'MultiplicityField',
|
|
6
6
|
};
|
|
7
7
|
export * from '@digigov/form/MultiplicityField/__stories__/Default';
|
|
8
8
|
export * from '@digigov/form/MultiplicityField/__stories__/WithMinLength';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Layout, { Content, Main } from '@digigov/ui/layouts/Basic/';
|
|
3
|
-
import SummaryList, {
|
|
4
|
-
SummaryListItem,
|
|
5
|
-
SummaryListItemKey,
|
|
6
|
-
SummaryListItemValue,
|
|
7
|
-
} from '@digigov/ui/core/SummaryList';
|
|
8
2
|
import {
|
|
9
3
|
Header,
|
|
10
4
|
HeaderSection,
|
|
@@ -15,12 +9,18 @@ import {
|
|
|
15
9
|
Paragraph,
|
|
16
10
|
Card,
|
|
17
11
|
CardHeading,
|
|
18
|
-
|
|
12
|
+
CardContent,
|
|
19
13
|
List,
|
|
20
14
|
ListItem,
|
|
21
15
|
} from '@digigov/ui';
|
|
16
|
+
import SummaryList, {
|
|
17
|
+
SummaryListItem,
|
|
18
|
+
SummaryListItemKey,
|
|
19
|
+
SummaryListItemValue,
|
|
20
|
+
} from '@digigov/ui/content/SummaryList';
|
|
22
21
|
import GovGRFooter from '@digigov/ui/govgr/Footer';
|
|
23
22
|
import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
|
|
23
|
+
import Layout, { Content, Main } from '@digigov/ui/layouts/Basic/';
|
|
24
24
|
|
|
25
25
|
const fields = [
|
|
26
26
|
{
|
|
@@ -64,12 +64,12 @@ const fields = [
|
|
|
64
64
|
export const PreviewDisplay = () => (
|
|
65
65
|
<Layout>
|
|
66
66
|
<Header>
|
|
67
|
-
<
|
|
68
|
-
<
|
|
67
|
+
<HeaderContent>
|
|
68
|
+
<HeaderSection>
|
|
69
69
|
<GovGRLogo href="#" />
|
|
70
70
|
<HeaderTitle>Πρότυπο-Αναφοράς</HeaderTitle>
|
|
71
|
-
</
|
|
72
|
-
</
|
|
71
|
+
</HeaderSection>
|
|
72
|
+
</HeaderContent>
|
|
73
73
|
</Header>
|
|
74
74
|
<Content>
|
|
75
75
|
<Main>
|
|
@@ -82,7 +82,7 @@ export const PreviewDisplay = () => (
|
|
|
82
82
|
</Paragraph>
|
|
83
83
|
<Card variant="border" borderColor="dark">
|
|
84
84
|
<CardHeading>Συνυπογράφοντας 1</CardHeading>
|
|
85
|
-
<
|
|
85
|
+
<CardContent>
|
|
86
86
|
<SummaryList>
|
|
87
87
|
{fields &&
|
|
88
88
|
fields.map((field, index) => {
|
|
@@ -94,11 +94,11 @@ export const PreviewDisplay = () => (
|
|
|
94
94
|
);
|
|
95
95
|
})}
|
|
96
96
|
</SummaryList>
|
|
97
|
-
</
|
|
97
|
+
</CardContent>
|
|
98
98
|
</Card>
|
|
99
99
|
<Card variant="border" borderColor="dark">
|
|
100
100
|
<CardHeading>Συνυπογράφοντας 2</CardHeading>
|
|
101
|
-
<
|
|
101
|
+
<CardContent>
|
|
102
102
|
<SummaryList>
|
|
103
103
|
{fields &&
|
|
104
104
|
fields.map((field, index) => {
|
|
@@ -110,20 +110,20 @@ export const PreviewDisplay = () => (
|
|
|
110
110
|
);
|
|
111
111
|
})}
|
|
112
112
|
</SummaryList>
|
|
113
|
-
</
|
|
113
|
+
</CardContent>
|
|
114
114
|
</Card>
|
|
115
115
|
<Card variant="border" borderColor="dark">
|
|
116
116
|
<CardHeading>Συνυπογράφοντας 3</CardHeading>
|
|
117
|
-
<
|
|
117
|
+
<CardContent>
|
|
118
118
|
<SummaryList>
|
|
119
119
|
<SummaryListItem>
|
|
120
120
|
<SummaryListItemKey>Όνομα</SummaryListItemKey>
|
|
121
121
|
<SummaryListItemValue>Μάριος</SummaryListItemValue>
|
|
122
122
|
</SummaryListItem>
|
|
123
123
|
</SummaryList>
|
|
124
|
-
</
|
|
124
|
+
</CardContent>
|
|
125
125
|
</Card>
|
|
126
|
-
<Heading size="
|
|
126
|
+
<Heading size="md">Στοιχεία Δήλωσης</Heading>
|
|
127
127
|
<SummaryList>
|
|
128
128
|
<SummaryListItem>
|
|
129
129
|
<SummaryListItemKey>Όνομα</SummaryListItemKey>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
3
|
// import { FormBuilderProps } from '@digigov/form';
|
|
4
|
-
import Button from '@digigov/ui/core/Button';
|
|
5
|
-
import Fieldset from '@digigov/react-core/Fieldset';
|
|
6
|
-
import RadioConditional from '@digigov/react-core/RadioConditional';
|
|
7
4
|
import {
|
|
8
5
|
ErrorOption,
|
|
9
6
|
FieldArrayWithId,
|
|
@@ -19,6 +16,9 @@ import {
|
|
|
19
16
|
StashedObject,
|
|
20
17
|
} from '@digigov/form/MultiplicityField';
|
|
21
18
|
import { FieldSpec } from '@digigov/form/types';
|
|
19
|
+
import Fieldset from '@digigov/react-core/Fieldset';
|
|
20
|
+
import RadioConditional from '@digigov/react-core/RadioConditional';
|
|
21
|
+
import Button from '@digigov/ui/form/Button';
|
|
22
22
|
export interface AddObjectsProps
|
|
23
23
|
extends Omit<MultiplicityProps, 'key' | 'component'> {
|
|
24
24
|
fields: FieldArrayWithId[];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import { FieldSpec } from '@digigov/form';
|
|
4
|
+
import FieldContainer from '@digigov/form/Field/FieldBaseContainer';
|
|
2
5
|
import { ControlledFieldProps } from '@digigov/form/Field/types';
|
|
6
|
+
import FieldObject from '@digigov/form/FieldObject';
|
|
7
|
+
import AddObjects from '@digigov/form/MultiplicityField/add-objects';
|
|
3
8
|
import {
|
|
4
9
|
Card,
|
|
5
|
-
|
|
10
|
+
CardContent,
|
|
6
11
|
CardAction,
|
|
7
12
|
Button,
|
|
8
13
|
Heading,
|
|
9
14
|
CardHeading,
|
|
10
15
|
} from '@digigov/react-core';
|
|
11
|
-
import { FieldSpec } from '@digigov/form';
|
|
12
|
-
import AddObjects from '@digigov/form/MultiplicityField/add-objects';
|
|
13
|
-
import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
|
|
14
|
-
import FieldObject from '@digigov/form/FieldObject';
|
|
15
|
-
import FieldContainer from '@digigov/form/Field/FieldBaseContainer';
|
|
16
16
|
|
|
17
17
|
export interface MultiplicityProps
|
|
18
18
|
extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'error' | 'extra'> {
|
|
@@ -78,7 +78,7 @@ export const Multiplicity: React.FC<MultiplicityProps> = ({
|
|
|
78
78
|
>
|
|
79
79
|
{stashedObjects.length > 0 ? (
|
|
80
80
|
<div>
|
|
81
|
-
<Heading size="
|
|
81
|
+
<Heading size="md">{extra?.label.object.title_added}</Heading>
|
|
82
82
|
{stashedObjects.map((_Object, index) => {
|
|
83
83
|
return (
|
|
84
84
|
<ListObject
|
|
@@ -147,7 +147,7 @@ export const ListObject: React.FC<ListObjectProps> = ({
|
|
|
147
147
|
<CardHeading>
|
|
148
148
|
{extra?.label.object.title} #{index + 1}
|
|
149
149
|
</CardHeading>
|
|
150
|
-
<
|
|
150
|
+
<CardContent>
|
|
151
151
|
<FieldObject
|
|
152
152
|
name={currentName}
|
|
153
153
|
formState={formState}
|
|
@@ -155,7 +155,7 @@ export const ListObject: React.FC<ListObjectProps> = ({
|
|
|
155
155
|
control={control}
|
|
156
156
|
{...extra?.of}
|
|
157
157
|
/>
|
|
158
|
-
</
|
|
158
|
+
</CardContent>
|
|
159
159
|
<CardAction>
|
|
160
160
|
<Button type="button" variant="link" onClick={() => onDelete(index)}>
|
|
161
161
|
{extra?.label.object.delete}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { getNextStep } from '@digigov/form/Questions/getNextStep';
|
|
3
|
+
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
2
4
|
import { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
3
5
|
import { QuestionsInterface } from '@digigov/form/Questions/types';
|
|
4
|
-
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
5
|
-
import { getNextStep } from '@digigov/form/Questions/getNextStep';
|
|
6
6
|
|
|
7
7
|
const isBrowser = typeof window !== 'undefined';
|
|
8
8
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
+
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
3
|
+
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
4
|
+
import { StepTitleBase } from '@digigov/form/Questions/Step/StepTitle';
|
|
2
5
|
import {
|
|
3
6
|
SummaryList,
|
|
4
7
|
SummaryListItem,
|
|
5
8
|
SummaryListItemKey,
|
|
6
9
|
SummaryListItemValue,
|
|
7
10
|
SummaryListItemAction,
|
|
8
|
-
} from '@digigov/ui/
|
|
11
|
+
} from '@digigov/ui/content/SummaryList';
|
|
12
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
13
|
+
import { useTranslation } from '@digigov/ui/i18n';
|
|
9
14
|
import Title from '@digigov/ui/typography/Title';
|
|
10
|
-
import { Button } from '@digigov/ui/core';
|
|
11
|
-
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
12
|
-
import { StepTitleBase } from '@digigov/form/Questions/Step/StepTitle';
|
|
13
|
-
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
14
|
-
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
15
15
|
|
|
16
16
|
export const ReviewStep = (): React.ReactElement => {
|
|
17
17
|
const { t } = useTranslation();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react';
|
|
2
2
|
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
3
|
-
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
4
3
|
import { StepArrayReview } from '@digigov/form/Questions/Step/StepArrayReview';
|
|
4
|
+
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
5
5
|
import { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
3
|
-
import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
|
|
4
|
-
import Button from '@digigov/ui/core/Button';
|
|
5
|
-
import FormBuilder from '@digigov/form/FormBuilder';
|
|
6
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
7
2
|
import { Field } from '@digigov/form/Field';
|
|
8
3
|
import { Fieldset } from '@digigov/form/Fieldset';
|
|
4
|
+
import FormBuilder from '@digigov/form/FormBuilder';
|
|
9
5
|
import Label from '@digigov/form/inputs/Label';
|
|
6
|
+
import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
|
|
7
|
+
import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
|
|
8
|
+
import { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
|
|
9
|
+
import { FieldSpec } from '@digigov/form/types';
|
|
10
|
+
import PageTitleContainer, { PageTitleHeading } from '@digigov/ui/app/PageTitleContainer';
|
|
10
11
|
import {
|
|
11
12
|
SummaryList,
|
|
12
13
|
SummaryListItem,
|
|
13
14
|
SummaryListItemKey,
|
|
14
15
|
SummaryListItemValue,
|
|
15
16
|
SummaryListItemAction,
|
|
16
|
-
} from '@digigov/ui/
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
|
|
17
|
+
} from '@digigov/ui/content/SummaryList';
|
|
18
|
+
import Button from '@digigov/ui/form/Button';
|
|
19
|
+
import { useTranslation } from '@digigov/ui/i18n';
|
|
20
20
|
|
|
21
21
|
export const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {
|
|
22
22
|
const { t } = useTranslation();
|
|
@@ -28,11 +28,11 @@ export const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {
|
|
|
28
28
|
) || {};
|
|
29
29
|
return (
|
|
30
30
|
<>
|
|
31
|
-
<
|
|
31
|
+
<PageTitleContainer>
|
|
32
32
|
<PageTitleHeading>
|
|
33
33
|
{currentStep.review?.title && t(currentStep.review?.title)}
|
|
34
34
|
</PageTitleHeading>
|
|
35
|
-
</
|
|
35
|
+
</PageTitleContainer>
|
|
36
36
|
<SummaryList>
|
|
37
37
|
{props.array.map(
|
|
38
38
|
(item: { [x: string]: React.ReactNode }, idx: number) => (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
3
|
+
import { useTranslation } from '@digigov/ui/i18n';
|
|
3
4
|
import Paragraph, { ParagraphProps } from '@digigov/ui/typography/Paragraph';
|
|
4
|
-
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
5
5
|
|
|
6
6
|
export interface StepDescriptionInterface extends ParagraphProps {
|
|
7
7
|
description?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
3
|
-
import FormBuilder from '@digigov/form/FormBuilder';
|
|
4
|
-
import Fieldset from '@digigov/form/Fieldset';
|
|
5
2
|
import Field from '@digigov/form/Field';
|
|
6
|
-
import { FormBuilderProps } from '@digigov/form/types';
|
|
7
3
|
import { FieldProps } from '@digigov/form/Field/types';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import Fieldset from '@digigov/form/Fieldset';
|
|
5
|
+
import FormBuilder from '@digigov/form/FormBuilder';
|
|
6
|
+
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
7
|
+
import { FormBuilderProps } from '@digigov/form/types';
|
|
8
|
+
import Button from '@digigov/ui/form/Button';
|
|
9
|
+
import { useTranslation } from '@digigov/ui/i18n';
|
|
10
10
|
|
|
11
11
|
export interface StepFormProps {
|
|
12
12
|
submitButton: boolean;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { StepContext } from '@digigov/form/Questions/Step/StepContext';
|
|
3
|
-
import
|
|
3
|
+
import PageTitleContainer, {
|
|
4
4
|
PageTitleHeading,
|
|
5
5
|
PageTitleHeadingProps,
|
|
6
|
-
PageTitleSection,
|
|
7
6
|
PageTitleCaption,
|
|
8
|
-
} from '@digigov/ui/app/
|
|
9
|
-
import BackButton from '@digigov/ui/
|
|
10
|
-
import { useTranslation } from '@digigov/ui/
|
|
7
|
+
} from '@digigov/ui/app/PageTitleContainer';
|
|
8
|
+
import BackButton from '@digigov/ui/form/Button/BackButton';
|
|
9
|
+
import { useTranslation } from '@digigov/ui/i18n';
|
|
11
10
|
|
|
12
11
|
export interface StepTitleInterface {
|
|
13
12
|
title?: string;
|
|
@@ -30,18 +29,16 @@ export const StepTitleBase: React.FC<StepTitleInterface> = ({
|
|
|
30
29
|
const { t } = useTranslation();
|
|
31
30
|
return (
|
|
32
31
|
<>
|
|
33
|
-
<BackButton>{backButton || t('back
|
|
34
|
-
<
|
|
32
|
+
<BackButton>{backButton || t('button.back')}</BackButton>
|
|
33
|
+
<PageTitleContainer>
|
|
35
34
|
{children || (
|
|
36
35
|
<>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
{step && <PageTitleCaption>{step}</PageTitleCaption>}
|
|
40
|
-
</PageTitleSection>
|
|
36
|
+
<PageTitleCaption>{caption && t(caption)}</PageTitleCaption>
|
|
37
|
+
{step && <PageTitleCaption>{step}</PageTitleCaption>}
|
|
41
38
|
<StepTitleHeading>{title && t(title)}</StepTitleHeading>
|
|
42
39
|
</>
|
|
43
40
|
)}
|
|
44
|
-
</
|
|
41
|
+
</PageTitleContainer>
|
|
45
42
|
</>
|
|
46
43
|
);
|
|
47
44
|
};
|
|
@@ -53,7 +50,12 @@ export const StepTitleBase: React.FC<StepTitleInterface> = ({
|
|
|
53
50
|
export const StepTitle: React.FC<StepTitleInterface> = (props) => {
|
|
54
51
|
const { caption, title, step, backButton } = useContext(StepContext);
|
|
55
52
|
return (
|
|
56
|
-
<StepTitleBase
|
|
53
|
+
<StepTitleBase
|
|
54
|
+
backButton={backButton}
|
|
55
|
+
caption={caption}
|
|
56
|
+
step={step}
|
|
57
|
+
title={title}
|
|
58
|
+
>
|
|
57
59
|
{props.children}
|
|
58
60
|
</StepTitleBase>
|
|
59
61
|
);
|