@digigov/form 0.8.4 → 0.8.5-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/Field/utils.js +1 -0
  2. package/FieldArray/FieldArray.stories.playwright.json +168 -0
  3. package/FieldArray/__stories__/Default.js +3 -5
  4. package/FieldArray/__stories__/WithExactLength.js +3 -5
  5. package/FieldArray/index.js +1 -0
  6. package/FieldObject/index.js +1 -2
  7. package/{FormBuilder.d.ts → FormBuilder/FormBuilder.d.ts} +0 -0
  8. package/{FormBuilder.js → FormBuilder/FormBuilder.js} +0 -0
  9. package/FormBuilder/FormBuilder.mdx +271 -0
  10. package/FormBuilder/FormBuilder.stories.d.ts +7 -0
  11. package/FormBuilder/FormBuilder.stories.js +30 -0
  12. package/FormBuilder/__stories__/Default.d.ts +2 -0
  13. package/FormBuilder/__stories__/Default.js +45 -0
  14. package/FormBuilder/index.d.ts +2 -0
  15. package/FormBuilder/index.js +11 -0
  16. package/MultiplicityField/MultiplicityField.mdx +148 -0
  17. package/MultiplicityField/__stories__/Default.js +3 -5
  18. package/MultiplicityField/__stories__/WithExactLength.js +3 -5
  19. package/MultiplicityField/__stories__/WithMaxLength.js +3 -5
  20. package/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -5
  21. package/MultiplicityField/__stories__/WithMinLength.js +3 -5
  22. package/Questions/Step/StepArrayReview.js +2 -2
  23. package/Questions/__snapshots__/index.spec.tsx.snap +649 -449
  24. package/Questions/index.mdx +0 -187
  25. package/create-simple-form.mdx +515 -0
  26. package/es/Field/utils.js +1 -0
  27. package/es/FieldArray/FieldArray.stories.playwright.json +168 -0
  28. package/es/FieldArray/__stories__/Default.js +3 -5
  29. package/es/FieldArray/__stories__/WithExactLength.js +3 -5
  30. package/es/FieldArray/index.js +1 -0
  31. package/es/FieldObject/index.js +1 -2
  32. package/es/{FormBuilder.js → FormBuilder/FormBuilder.js} +0 -0
  33. package/es/FormBuilder/FormBuilder.mdx +271 -0
  34. package/es/FormBuilder/FormBuilder.stories.js +6 -0
  35. package/es/FormBuilder/__stories__/Default.js +25 -0
  36. package/es/FormBuilder/index.js +2 -0
  37. package/es/MultiplicityField/MultiplicityField.mdx +148 -0
  38. package/es/MultiplicityField/__stories__/Default.js +3 -5
  39. package/es/MultiplicityField/__stories__/WithExactLength.js +3 -5
  40. package/es/MultiplicityField/__stories__/WithMaxLength.js +3 -5
  41. package/es/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -5
  42. package/es/MultiplicityField/__stories__/WithMinLength.js +3 -5
  43. package/es/Questions/Step/StepArrayReview.js +1 -1
  44. package/es/Questions/__snapshots__/index.spec.tsx.snap +649 -449
  45. package/es/Questions/index.mdx +0 -187
  46. package/es/create-simple-form.mdx +515 -0
  47. package/es/index.mdx +37 -199
  48. package/es/inputs/Checkboxes/Checkboxes.stories.js +6 -0
  49. package/es/inputs/Checkboxes/__stories__/Default.js +43 -0
  50. package/es/inputs/DateInput/DateInput.stories.js +6 -0
  51. package/es/inputs/DateInput/__stories__/Default.js +44 -0
  52. package/es/inputs/Input/Input.stories.js +13 -0
  53. package/es/inputs/Input/__stories__/AFM.js +25 -0
  54. package/es/inputs/Input/__stories__/Boolean.js +26 -0
  55. package/es/inputs/Input/__stories__/Default.js +26 -0
  56. package/es/inputs/Input/__stories__/IBAN.js +26 -0
  57. package/es/inputs/Input/__stories__/Integer.js +26 -0
  58. package/es/inputs/Input/__stories__/MobilePhone.js +25 -0
  59. package/es/inputs/Input/__stories__/PhoneNumber.js +25 -0
  60. package/es/inputs/Input/__stories__/PostalCode.js +28 -0
  61. package/es/inputs/Input/index.mdx +0 -2
  62. package/es/inputs/Label/Label.stories.js +6 -0
  63. package/es/inputs/Label/__stories__/Default.js +30 -0
  64. package/es/inputs/Radio/Radio.stories.js +6 -0
  65. package/es/inputs/Radio/__stories__/Default.js +48 -0
  66. package/es/inputs/Select/Select.stories.js +6 -0
  67. package/es/inputs/Select/__stories__/Default.js +54 -0
  68. package/es/installation.mdx +72 -0
  69. package/es/registry.js +129 -0
  70. package/esm/Field/utils.js +1 -0
  71. package/esm/FieldArray/FieldArray.stories.playwright.json +168 -0
  72. package/esm/FieldArray/__stories__/Default.js +3 -5
  73. package/esm/FieldArray/__stories__/WithExactLength.js +3 -5
  74. package/esm/FieldArray/index.js +1 -0
  75. package/esm/FieldObject/index.js +1 -2
  76. package/esm/{FormBuilder.js → FormBuilder/FormBuilder.js} +0 -0
  77. package/esm/FormBuilder/FormBuilder.mdx +271 -0
  78. package/esm/FormBuilder/FormBuilder.stories.js +6 -0
  79. package/esm/FormBuilder/__stories__/Default.js +25 -0
  80. package/esm/FormBuilder/index.js +2 -0
  81. package/esm/MultiplicityField/MultiplicityField.mdx +148 -0
  82. package/esm/MultiplicityField/__stories__/Default.js +3 -5
  83. package/esm/MultiplicityField/__stories__/WithExactLength.js +3 -5
  84. package/esm/MultiplicityField/__stories__/WithMaxLength.js +3 -5
  85. package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -5
  86. package/esm/MultiplicityField/__stories__/WithMinLength.js +3 -5
  87. package/esm/Questions/Step/StepArrayReview.js +1 -1
  88. package/esm/Questions/__snapshots__/index.spec.tsx.snap +649 -449
  89. package/esm/Questions/index.mdx +0 -187
  90. package/esm/create-simple-form.mdx +515 -0
  91. package/esm/index.js +1 -1
  92. package/esm/index.mdx +37 -199
  93. package/esm/inputs/Checkboxes/Checkboxes.stories.js +6 -0
  94. package/esm/inputs/Checkboxes/__stories__/Default.js +43 -0
  95. package/esm/inputs/DateInput/DateInput.stories.js +6 -0
  96. package/esm/inputs/DateInput/__stories__/Default.js +44 -0
  97. package/esm/inputs/Input/Input.stories.js +13 -0
  98. package/esm/inputs/Input/__stories__/AFM.js +25 -0
  99. package/esm/inputs/Input/__stories__/Boolean.js +26 -0
  100. package/esm/inputs/Input/__stories__/Default.js +26 -0
  101. package/esm/inputs/Input/__stories__/IBAN.js +26 -0
  102. package/esm/inputs/Input/__stories__/Integer.js +26 -0
  103. package/esm/inputs/Input/__stories__/MobilePhone.js +25 -0
  104. package/esm/inputs/Input/__stories__/PhoneNumber.js +25 -0
  105. package/esm/inputs/Input/__stories__/PostalCode.js +28 -0
  106. package/esm/inputs/Input/index.mdx +0 -2
  107. package/esm/inputs/Label/Label.stories.js +6 -0
  108. package/esm/inputs/Label/__stories__/Default.js +30 -0
  109. package/esm/inputs/Radio/Radio.stories.js +6 -0
  110. package/esm/inputs/Radio/__stories__/Default.js +48 -0
  111. package/esm/inputs/Select/Select.stories.js +6 -0
  112. package/esm/inputs/Select/__stories__/Default.js +54 -0
  113. package/esm/installation.mdx +72 -0
  114. package/esm/registry.js +129 -0
  115. package/index.mdx +37 -199
  116. package/inputs/Checkboxes/Checkboxes.stories.d.ts +7 -0
  117. package/inputs/Checkboxes/Checkboxes.stories.js +30 -0
  118. package/inputs/Checkboxes/__stories__/Default.d.ts +2 -0
  119. package/inputs/Checkboxes/__stories__/Default.js +63 -0
  120. package/inputs/DateInput/DateInput.stories.d.ts +7 -0
  121. package/inputs/DateInput/DateInput.stories.js +30 -0
  122. package/inputs/DateInput/__stories__/Default.d.ts +2 -0
  123. package/inputs/DateInput/__stories__/Default.js +64 -0
  124. package/inputs/Input/Input.stories.d.ts +14 -0
  125. package/inputs/Input/Input.stories.js +128 -0
  126. package/inputs/Input/__stories__/AFM.d.ts +2 -0
  127. package/inputs/Input/__stories__/AFM.js +45 -0
  128. package/inputs/Input/__stories__/Boolean.d.ts +2 -0
  129. package/inputs/Input/__stories__/Boolean.js +46 -0
  130. package/inputs/Input/__stories__/Default.d.ts +2 -0
  131. package/inputs/Input/__stories__/Default.js +46 -0
  132. package/inputs/Input/__stories__/IBAN.d.ts +2 -0
  133. package/inputs/Input/__stories__/IBAN.js +46 -0
  134. package/inputs/Input/__stories__/Integer.d.ts +2 -0
  135. package/inputs/Input/__stories__/Integer.js +46 -0
  136. package/inputs/Input/__stories__/MobilePhone.d.ts +2 -0
  137. package/inputs/Input/__stories__/MobilePhone.js +45 -0
  138. package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -0
  139. package/inputs/Input/__stories__/PhoneNumber.js +45 -0
  140. package/inputs/Input/__stories__/PostalCode.d.ts +2 -0
  141. package/inputs/Input/__stories__/PostalCode.js +48 -0
  142. package/inputs/Input/index.mdx +0 -2
  143. package/inputs/Label/Label.stories.d.ts +7 -0
  144. package/inputs/Label/Label.stories.js +30 -0
  145. package/inputs/Label/__stories__/Default.d.ts +2 -0
  146. package/inputs/Label/__stories__/Default.js +50 -0
  147. package/inputs/Radio/Radio.stories.d.ts +7 -0
  148. package/inputs/Radio/Radio.stories.js +30 -0
  149. package/inputs/Radio/__stories__/Default.d.ts +2 -0
  150. package/inputs/Radio/__stories__/Default.js +68 -0
  151. package/inputs/Select/Select.stories.d.ts +7 -0
  152. package/inputs/Select/Select.stories.js +30 -0
  153. package/inputs/Select/__stories__/Default.d.ts +2 -0
  154. package/inputs/Select/__stories__/Default.js +74 -0
  155. package/installation.mdx +72 -0
  156. package/package.json +6 -6
  157. package/registry.d.ts +59 -0
  158. package/registry.js +198 -0
  159. package/types.d.ts +1 -1
@@ -0,0 +1,271 @@
1
+ ---
2
+ id: FormBuilder
3
+ title: FormBuilder
4
+ sidebar_label: FormBuilder
5
+ ---
6
+
7
+ `FormBuilder` is a React component that provides an easy way to efficiently create reusable form page. Forms are a flexible mechanism for collecting user input because there are suitable widgets for entering many different types of data, including text boxes, checkboxes, radio buttons, dropdowns and so on for submission to a server. Actually when we use `stepForm` for building step-forms all we do is to render `FormBuilder` component.
8
+
9
+ `stepForm` component:
10
+
11
+ <Story packageName="@digigov/form" component="FormBuilder" story="Default.tsx" />
12
+
13
+ ### Importing and using FormBuilder Component
14
+
15
+ To import `FormBuilder` component simply import it from `'@digigov/form`.
16
+
17
+ ```javascript
18
+
19
+ import {FormBuilder} from '@digigov/form';
20
+
21
+ ```
22
+ Now you can use the current component inisde of your component
23
+
24
+
25
+ ```javascript
26
+ import BasicLayout, {
27
+ Top,
28
+ Content,
29
+ Main,
30
+ Bottom,
31
+ } from '@digigov/ui/layouts/Basic';
32
+ import {FormBuilder} from '@digigov/form';
33
+
34
+ export default function MyComponent({ props }) {
35
+
36
+ return (
37
+ <BasicLayout>
38
+ .
39
+ .
40
+ <Content>
41
+ <Main>
42
+ .
43
+ .
44
+ <FormBuilder></FormBuilder>
45
+ .
46
+ .
47
+ </Main>
48
+ </Content>
49
+ <Bottom>
50
+ <GovGRFooter />
51
+ </Bottom>
52
+ </BasicLayout>
53
+ );
54
+ }
55
+ }
56
+ ```
57
+
58
+ ### Props
59
+
60
+ `FormBuilder` component accepts several arguments as input props.
61
+
62
+ | Name | Type | Default | Description |
63
+ | ------------- | :-----------: | :-----------: | :-----------: |
64
+ | children | node | | allow you to pass components as data. |
65
+ | steps | array | | an array which includes each step-form format data |
66
+ | name | string | | the name of the step. |
67
+ | title | string | | the title from each step |
68
+ | fields | array | | an array of object fields which they describe each field for each step-form |
69
+ | key | string | | the key value of the input field |
70
+ | label | object | | an object prop which describes the label primary and the secondary name of the field |
71
+ | primary | string | | the name of te field |
72
+ | required | boolean | false | describes the validation of the field |
73
+ | submitButton | boolean | false | if true, it creates a button to continue to the next step |
74
+ | type | string | | describes the format of each field, e.x `type:'string'` is a simple input format field |
75
+
76
+
77
+
78
+ ### Field types
79
+
80
+ Below are demostrated some examples for each type of field
81
+
82
+
83
+ ### FormBuilder implementation
84
+
85
+ The examples above are implemented by using the code below
86
+
87
+ ```javascript
88
+
89
+ import React, { useState } from 'react';
90
+ import BasicLayout, {
91
+ Top,
92
+ Content,
93
+ Main,
94
+ Bottom,
95
+ } from '@digigov/ui/layouts/Basic';
96
+ import Header, { HeaderTitle } from '@digigov/ui/app/Header';
97
+ import GovGRLogo from '@digigov/ui/govgr/Logo';
98
+ import GovGRFooter from '@digigov/ui/govgr/Footer';
99
+ import Button from '@digigov/ui/core/Button';
100
+ import PageTitle, {
101
+ PageTitleSection,
102
+ PageTitleCaption,
103
+ PageTitleHeading,
104
+ } from '@digigov/ui/app/PageTitle';
105
+ import BackButton from '@digigov/ui/core/Button/BackButton';
106
+ import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
107
+ import { useTranslation } from '@digigov/ui/app';
108
+
109
+ const FIELDS = [
110
+ {
111
+ key: 'phone',
112
+ label: {
113
+ primary: 'Mobile phone',
114
+ secondary: 'A valid mobile number, eg. +306988848888',
115
+ },
116
+ required: true,
117
+ type: 'mobile_phone',
118
+ },
119
+ {
120
+ key: 'choice_single',
121
+ label: { primary: 'Is this true or not' },
122
+ type: 'choice:single',
123
+ required: true,
124
+ extra: {
125
+ options: [
126
+ {
127
+ label: { primary: 'Yes' },
128
+ value: 'yes',
129
+ },
130
+ {
131
+ label: { primary: 'No', secondary: 'Explanation about no option' },
132
+ value: 'no',
133
+ },
134
+ ],
135
+ },
136
+ },
137
+ {
138
+ key: 'choice_single_notitle',
139
+ type: 'choice:single',
140
+ extra: {
141
+ options: [
142
+ {
143
+ label: { primary: 'One' },
144
+ value: '1',
145
+ },
146
+ {
147
+ label: { primary: 'Two' },
148
+ value: '2',
149
+ },
150
+ ],
151
+ },
152
+ },
153
+ {
154
+ key: 'choice_multiple',
155
+ label: 'Select from below',
156
+ type: 'choice:multiple',
157
+ extra: {
158
+ options: [
159
+ {
160
+ label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
161
+ value: 'choice_1',
162
+ },
163
+ {
164
+ label: { primary: 'Choice 2' },
165
+ value: 'choice_2',
166
+ },
167
+ ],
168
+ },
169
+ },
170
+ {
171
+ key: 'choice_single_select',
172
+ label: 'Select from below',
173
+ type: 'choice:single',
174
+ extra: {
175
+ options: [
176
+ {
177
+ label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
178
+ value: 'choice_1',
179
+ },
180
+ {
181
+ label: { primary: 'Choice 2 lenghty explanation without reason' },
182
+ value: 'choice_2',
183
+ },
184
+ ],
185
+ component: 'Select',
186
+ },
187
+ },
188
+ {
189
+ key: 'number',
190
+ label: { primary: 'A positive number' },
191
+ required: true,
192
+ width: '100px',
193
+ type: 'int',
194
+ },
195
+ {
196
+ key: 'string',
197
+ label: null,
198
+ width: '100px',
199
+ required: true,
200
+ type: 'string',
201
+ },
202
+ ];
203
+ const initialValues = {
204
+ phone: '6988888888',
205
+ choice_multiple: ['choice_2'],
206
+ string: 'default content',
207
+ };
208
+
209
+ const useStyles = makeStyles(
210
+ {
211
+ top: { minHeight: '75px' },
212
+ main: {},
213
+ side: {},
214
+ },
215
+ { name: 'MuiSite' }
216
+ );
217
+
218
+ export default function Index() {
219
+ const styles = useStyles();
220
+ const [data, setData] = useState(null);
221
+ const { t } = useTranslation();
222
+ return (
223
+ <BasicLayout>
224
+ <Top className={styles.top}>
225
+ <Header>
226
+ <GovGRLogo />
227
+ <HeaderTitle>Service name</HeaderTitle>
228
+ </Header>
229
+ </Top>
230
+ <Content>
231
+ <Main className={styles.main}>
232
+ <BackButton>{t('button.back')}</BackButton>
233
+ <PageTitle>
234
+ <PageTitleSection>
235
+ <PageTitleCaption>Before we start</PageTitleCaption>
236
+ </PageTitleSection>
237
+ <PageTitleHeading>Submit a form</PageTitleHeading>
238
+ </PageTitle>
239
+ <FormBuilder
240
+ fields={FIELDS}
241
+ onSubmit={setData}
242
+ initial={initialValues}
243
+ >
244
+ <Fieldset>
245
+ <FieldsetLabel>This is a fieldset</FieldsetLabel>
246
+ {FIELDS.map((field) => (
247
+ <Field key={field.key} name={field.key} />
248
+ ))}
249
+ </Fieldset>
250
+ <Button type="submit">{t('button.continue')}</Button>
251
+ </FormBuilder>
252
+ {data && <pre>{JSON.stringify(data, null, 2)}</pre>}
253
+ </Main>
254
+ </Content>
255
+ <Bottom>
256
+ <GovGRFooter />
257
+ </Bottom>
258
+ </BasicLayout>
259
+ );
260
+ }
261
+
262
+ ```
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
@@ -0,0 +1,6 @@
1
+ import FormBuilder from '@digigov/form/FormBuilder';
2
+ export default {
3
+ title: 'Digigov Form/FormBuilder',
4
+ component: FormBuilder
5
+ };
6
+ export * from '@digigov/form/FormBuilder/__stories__/Default';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import FormBuilder, { Field } from '@digigov/form';
3
+ import { Button } from '@digigov/ui/core';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(Button, {
6
+ type: "submit"
7
+ }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
8
+
9
+ export var Default = function Default() {
10
+ return /*#__PURE__*/React.createElement(FormBuilder, {
11
+ onSubmit: function onSubmit(data) {
12
+ debugger;
13
+ console.log(data);
14
+ }
15
+ }, /*#__PURE__*/React.createElement(Field, {
16
+ key: "business-title",
17
+ name: "business-title",
18
+ type: "string",
19
+ label: {
20
+ primary: 'Όνομα επιχείρησης'
21
+ },
22
+ required: true
23
+ }), _ref);
24
+ };
25
+ export default Default;
@@ -0,0 +1,2 @@
1
+ import { FormBuilder } from '@digigov/form/FormBuilder/FormBuilder';
2
+ export default FormBuilder;
@@ -0,0 +1,148 @@
1
+ ---
2
+ id: MultiplicityField
3
+ title: Multiplicity Field
4
+ sidebar_label: Recursively ask user data
5
+ ---
6
+
7
+ import LeadText from "@site/src/components/LeadText";
8
+
9
+ <LeadText>Multiplicity field enables users add instances of a particular schema for an
10
+ arbitrary amount of times until they are done. It can be used with a fixed
11
+ length of instances, or a minimum and maximum length.</LeadText>
12
+
13
+ ## What we are trying to achieve
14
+
15
+ This field was developed as an accessible and guided way to fill arrays with
16
+ objects described by a schema. For example, we can define the schema for a usual form by describing the fields
17
+ it will render.
18
+
19
+ These fields may describe an entity and its properties and it can be reused
20
+ multiple times to generate data objects following this schema.
21
+
22
+ ```js
23
+ const fields = [
24
+ {
25
+ key: "fullname",
26
+ name: "fullname",
27
+ type: "string",
28
+ required: true
29
+ },
30
+ {
31
+ key: "afm",
32
+ name: "afm",
33
+ type: "afm",
34
+ required: true
35
+ },
36
+ ];
37
+ ```
38
+
39
+ We aim to have semantically correct and valid forms. What this means is that we
40
+ cannot mix form-related HTML elements (eg. form, input, label) with generic ones
41
+ (eg. div, cards, custom components). React will start throwing warnings left and
42
+ right if we try to add a paragraph element inside a form.
43
+
44
+ Apart from this, Digigov Form recommends using forms in their original way of
45
+ filling and validating inputs, then submitting the form as a whole. The process
46
+ repeats if validation fails or proceeds if validation is successful. In any
47
+ case, it is imperative to provide meaningful information to the users on
48
+ how they proceed to fix the validation errors.
49
+
50
+ Last but not least, we should make our interfaces entirely accessible to screen
51
+ readers and other accessibilty tools and this requirement adds another dimension
52
+ to this problem. Forms and fields should read like a well-written piece of text
53
+ and make sense to the users. Thus we should avoid the use of magic UX solutions
54
+ that require users to have some well-developed digital skills and most of the
55
+ time are used for expert users.
56
+
57
+ Users should fill in data as this schema dictates, and every time they add
58
+ something we should ask them if they want to continue adding or escape the loop.
59
+ We can also add some limitations so we can ask for an array with specific
60
+ cardinality. In this way we can validate each form state regardless of whether a
61
+ user is in the process of data input or reviewing what they've added. In any
62
+ case, the form should guide users through steps and validation errors, and avoid
63
+ giving too much freedom in actions that could lead to estranged users losing
64
+ their way out of the maze.
65
+
66
+ But how can we code this feature as part of a Digigov form?
67
+
68
+ ## Enter the Multiplicity field
69
+
70
+ To deal with this problem, we have decided to create a composite field that uses
71
+ externally defined object schema alongside some internal helpers. This field in
72
+ fact is considered as a single key-value pair by the form. The only difference is that
73
+ the value will be of type `Array` instead of any other primitive used for a
74
+ field type.
75
+
76
+ The component internally uses the
77
+ [useFieldArray](https://www.react-hook-form.com/api/usefieldarray) hook from
78
+ react-hook-form.
79
+
80
+ ```jsx live
81
+ import React from 'react';
82
+ import Form, { Field } from '@digigov/form';
83
+
84
+ export default function SimpleForm() {
85
+ return <Form>
86
+ <Field
87
+ key="children"
88
+ label={{ primary: "Children" }}
89
+ type="array"
90
+ multiplicity={true}
91
+ extra={{
92
+
93
+ label: {
94
+ object: {
95
+ title: 'Συνυπογράφοντας',
96
+ title_added: 'Οι συνυπογράφοντες που έχετε προσθέσει',
97
+ add: 'Προσθήκη',
98
+ delete: 'Αφαίρεση συνυπογράφοντος',
99
+ },
100
+ question: {
101
+ title: 'Do you want to add any additional children?',
102
+ objectLabel: {
103
+ primary: 'Προσθήκη νέου συνυπογράφοντα',
104
+ secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»',
105
+ },
106
+ yes: 'Yes',
107
+ no: 'No',
108
+ },
109
+ },
110
+ of: {
111
+ type: 'object',
112
+ label: {
113
+ primary: 'Στοιχεία συνυπογράφοντα',
114
+ secondary: 'Δείτε και αλλάξτε τα στοιχεία του συνυπογράφοντα',
115
+ },
116
+ extra: {
117
+ fields: [
118
+ {
119
+ key: 'afm',
120
+ type: 'afm',
121
+ required: true,
122
+ label: { primary: 'ΑΦΜ' },
123
+ },
124
+ {
125
+ key: 'firstName',
126
+ required: true,
127
+ type: 'string',
128
+ label: {
129
+ primary: 'Όνομα',
130
+ },
131
+ },
132
+ {
133
+ key: 'lastName',
134
+ required: true,
135
+ type: 'string',
136
+ label: {
137
+ primary: 'Επώνυμο',
138
+ },
139
+ },
140
+ ],
141
+ },
142
+ },
143
+ }}
144
+ required
145
+ />
146
+ </Form>
147
+ }
148
+ ```
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { Suspense } from 'react';
2
+ import React from 'react';
3
3
  import FormBuilder, { Field } from '@digigov/form';
4
4
  import { Button } from '@digigov/ui/core';
5
5
  var fields = [{
@@ -83,9 +83,7 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
83
83
  }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
84
84
 
85
85
  export var Default = function Default() {
86
- return /*#__PURE__*/React.createElement(Suspense, {
87
- fallback: "loading"
88
- }, /*#__PURE__*/React.createElement(FormBuilder, {
86
+ return /*#__PURE__*/React.createElement(FormBuilder, {
89
87
  onSubmit: function onSubmit(data) {
90
88
  debugger;
91
89
  console.log(data);
@@ -96,5 +94,5 @@ export var Default = function Default() {
96
94
  name: "multiplicity"
97
95
  }, fields[1])), /*#__PURE__*/React.createElement(Field, _extends({
98
96
  name: "phonenumber"
99
- }, fields[2])), _ref));
97
+ }, fields[2])), _ref);
100
98
  };
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { Suspense } from 'react';
2
+ import React from 'react';
3
3
  import FormBuilder, { Field } from '@digigov/form';
4
4
  import { Button } from '@digigov/ui/core';
5
5
  var fields = [{
@@ -78,9 +78,7 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
78
78
  }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
79
79
 
80
80
  export var WithExactLength = function WithExactLength() {
81
- return /*#__PURE__*/React.createElement(Suspense, {
82
- fallback: "loading"
83
- }, /*#__PURE__*/React.createElement(FormBuilder, {
81
+ return /*#__PURE__*/React.createElement(FormBuilder, {
84
82
  onSubmit: function onSubmit(data) {
85
83
  debugger;
86
84
  console.log(data);
@@ -91,5 +89,5 @@ export var WithExactLength = function WithExactLength() {
91
89
  name: "multiplicity"
92
90
  }, fields[1])), /*#__PURE__*/React.createElement(Field, _extends({
93
91
  name: "phonenumber"
94
- }, fields[2])), _ref));
92
+ }, fields[2])), _ref);
95
93
  };
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { Suspense } from 'react';
2
+ import React from 'react';
3
3
  import FormBuilder, { Field } from '@digigov/form';
4
4
  import { Button } from '@digigov/ui/core';
5
5
  var fields = [{
@@ -81,9 +81,7 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
81
81
  }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
82
82
 
83
83
  export var WithMaxLength = function WithMaxLength() {
84
- return /*#__PURE__*/React.createElement(Suspense, {
85
- fallback: "loading"
86
- }, /*#__PURE__*/React.createElement(FormBuilder, {
84
+ return /*#__PURE__*/React.createElement(FormBuilder, {
87
85
  onSubmit: function onSubmit(data) {
88
86
  debugger;
89
87
  console.log(data);
@@ -94,5 +92,5 @@ export var WithMaxLength = function WithMaxLength() {
94
92
  name: "multiplicity"
95
93
  }, fields[1])), /*#__PURE__*/React.createElement(Field, _extends({
96
94
  name: "phonenumber"
97
- }, fields[2])), _ref));
95
+ }, fields[2])), _ref);
98
96
  };
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { Suspense } from 'react';
2
+ import React from 'react';
3
3
  import FormBuilder, { Field } from '@digigov/form';
4
4
  import { Button } from '@digigov/ui/core';
5
5
  var fields = [{
@@ -82,9 +82,7 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
82
82
  }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
83
83
 
84
84
  export var WithMinAndMaxLength = function WithMinAndMaxLength() {
85
- return /*#__PURE__*/React.createElement(Suspense, {
86
- fallback: "loading"
87
- }, /*#__PURE__*/React.createElement(FormBuilder, {
85
+ return /*#__PURE__*/React.createElement(FormBuilder, {
88
86
  onSubmit: function onSubmit(data) {
89
87
  debugger;
90
88
  console.log(data);
@@ -95,5 +93,5 @@ export var WithMinAndMaxLength = function WithMinAndMaxLength() {
95
93
  name: "multiplicity"
96
94
  }, fields[1])), /*#__PURE__*/React.createElement(Field, _extends({
97
95
  name: "phonenumber"
98
- }, fields[2])), _ref));
96
+ }, fields[2])), _ref);
99
97
  };
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { Suspense } from 'react';
2
+ import React from 'react';
3
3
  import FormBuilder, { Field } from '@digigov/form';
4
4
  import { Button } from '@digigov/ui/core';
5
5
  var fields = [{
@@ -81,9 +81,7 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
81
81
  }, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
82
82
 
83
83
  export var WithMinLength = function WithMinLength() {
84
- return /*#__PURE__*/React.createElement(Suspense, {
85
- fallback: "loading"
86
- }, /*#__PURE__*/React.createElement(FormBuilder, {
84
+ return /*#__PURE__*/React.createElement(FormBuilder, {
87
85
  onSubmit: function onSubmit(data) {
88
86
  debugger;
89
87
  console.log(data);
@@ -94,5 +92,5 @@ export var WithMinLength = function WithMinLength() {
94
92
  name: "multiplicity"
95
93
  }, fields[1])), /*#__PURE__*/React.createElement(Field, _extends({
96
94
  name: "phonenumber"
97
- }, fields[2])), _ref));
95
+ }, fields[2])), _ref);
98
96
  };
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
2
2
  import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
3
3
  import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
4
4
  import Button from '@digigov/ui/core/Button';
5
- import { FormBuilder } from '@digigov/form/FormBuilder';
5
+ import FormBuilder from '@digigov/form/FormBuilder';
6
6
  import { Field } from '@digigov/form/Field';
7
7
  import { Fieldset } from '@digigov/form/Fieldset';
8
8
  import Label from '@digigov/form/inputs/Label';