@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
@@ -53,29 +53,44 @@ exports[`renders the Questions 1`] = `
53
53
  >
54
54
  <withDeprecationComponent>
55
55
  <ForwardRef(BackLink)>
56
- <a
56
+ <ForwardRef(Base)
57
+ as="a"
57
58
  className="govgr-back-link"
58
59
  onClick={[Function]}
59
60
  tabIndex={0}
60
61
  >
61
- <ForwardRef(CaretIcon)>
62
- <ForwardRef(SvgIcon)
63
- className="govgr-caret--left"
64
- >
65
- <svg
66
- aria-hidden="true"
67
- className="govgr-caret--left govgr-svg-icon"
68
- focusable="false"
69
- viewBox="0 0 24 24"
62
+ <a
63
+ className="govgr-back-link"
64
+ onClick={[Function]}
65
+ tabIndex={0}
66
+ >
67
+ <ForwardRef(CaretIcon)>
68
+ <ForwardRef(SvgIcon)
69
+ className="govgr-caret--left"
70
70
  >
71
- <path
72
- d="M18,22V2L6,12L18,22z"
73
- />
74
- </svg>
75
- </ForwardRef(SvgIcon)>
76
- </ForwardRef(CaretIcon)>
77
- Πίσω
78
- </a>
71
+ <ForwardRef(Base)
72
+ aria-hidden="true"
73
+ as="svg"
74
+ className="govgr-caret--left govgr-svg-icon"
75
+ focusable="false"
76
+ viewBox="0 0 24 24"
77
+ >
78
+ <svg
79
+ aria-hidden="true"
80
+ className="govgr-caret--left govgr-svg-icon"
81
+ focusable="false"
82
+ viewBox="0 0 24 24"
83
+ >
84
+ <path
85
+ d="M18,22V2L6,12L18,22z"
86
+ />
87
+ </svg>
88
+ </ForwardRef(Base)>
89
+ </ForwardRef(SvgIcon)>
90
+ </ForwardRef(CaretIcon)>
91
+ Πίσω
92
+ </a>
93
+ </ForwardRef(Base)>
79
94
  </ForwardRef(BackLink)>
80
95
  </withDeprecationComponent>
81
96
  <withDeprecationComponent>
@@ -85,11 +100,16 @@ exports[`renders the Questions 1`] = `
85
100
  <withDeprecationComponent>
86
101
  <withDeprecationComponent>
87
102
  <ForwardRef(HeadingCaption)>
88
- <span
103
+ <ForwardRef(Base)
104
+ as="span"
89
105
  className="govgr-caption-l"
90
106
  >
91
- intro.caption
92
- </span>
107
+ <span
108
+ className="govgr-caption-l"
109
+ >
110
+ intro.caption
111
+ </span>
112
+ </ForwardRef(Base)>
93
113
  </ForwardRef(HeadingCaption)>
94
114
  </withDeprecationComponent>
95
115
  </withDeprecationComponent>
@@ -107,11 +127,16 @@ exports[`renders the Questions 1`] = `
107
127
  <ForwardRef(Heading)
108
128
  size="xl"
109
129
  >
110
- <h1
130
+ <ForwardRef(Base)
131
+ as="h1"
111
132
  className="govgr-heading-xl"
112
133
  >
113
- intro.title
114
- </h1>
134
+ <h1
135
+ className="govgr-heading-xl"
136
+ >
137
+ intro.title
138
+ </h1>
139
+ </ForwardRef(Base)>
115
140
  </ForwardRef(Heading)>
116
141
  </Component>
117
142
  </withDeprecationComponent>
@@ -124,11 +149,16 @@ exports[`renders the Questions 1`] = `
124
149
  </StepTitle>
125
150
  <StepQuote>
126
151
  <ForwardRef(Paragraph)>
127
- <p
152
+ <ForwardRef(Base)
153
+ as="p"
128
154
  className="govgr-body"
129
155
  >
130
- This is the intro
131
- </p>
156
+ <p
157
+ className="govgr-body"
158
+ >
159
+ This is the intro
160
+ </p>
161
+ </ForwardRef(Base)>
132
162
  </ForwardRef(Paragraph)>
133
163
  </StepQuote>
134
164
  <StepForm
@@ -151,7 +181,7 @@ exports[`renders the Questions 1`] = `
151
181
  onSubmit={[Function]}
152
182
  >
153
183
  <ForwardRef(FormBase)
154
- criteriaMode="firstError"
184
+ criteriaMode="all"
155
185
  fieldsMap={
156
186
  Object {
157
187
  "name": Object {
@@ -165,6 +195,7 @@ exports[`renders the Questions 1`] = `
165
195
  },
166
196
  }
167
197
  }
198
+ grid={false}
168
199
  initial={Object {}}
169
200
  mode="onSubmit"
170
201
  onSubmit={[Function]}
@@ -173,216 +204,233 @@ exports[`renders the Questions 1`] = `
173
204
  resolver={[Function]}
174
205
  shouldFocusError={true}
175
206
  >
176
- <form
207
+ <ForwardRef(Form)
208
+ grid={false}
177
209
  onSubmit={[Function]}
178
210
  >
179
- <ForwardRef(Grid)
180
- container={true}
211
+ <ForwardRef(Base)
212
+ as="form"
213
+ className="govgr-form"
214
+ onSubmit={[Function]}
181
215
  >
182
- <div
183
- className="govgr-grid"
216
+ <form
217
+ className="govgr-form"
218
+ onSubmit={[Function]}
184
219
  >
185
- <ForwardRef(Grid)
186
- item={true}
187
- xs={12}
220
+ <Field
221
+ key="name"
222
+ name="name"
188
223
  >
189
- <div
190
- className="xs:govgr-grid__col-span-12"
191
- >
192
- <Field
193
- key="name"
194
- name="name"
195
- >
196
- <FieldBase
197
- component={
198
- Object {
199
- "$$typeof": Symbol(react.forward_ref),
200
- "render": [Function],
201
- }
202
- }
203
- control={
204
- Object {
205
- "defaultValuesRef": Object {
206
- "current": Object {},
207
- },
208
- "fieldArrayDefaultValuesRef": Object {
209
- "current": Object {},
210
- },
211
- "fieldArrayNamesRef": Object {
212
- "current": Set {},
213
- },
214
- "fieldArrayValuesRef": Object {
215
- "current": Object {},
216
- },
217
- "fieldsRef": Object {
218
- "current": Object {
219
- "name": Object {
220
- "ref": <input
221
- aria-required="true"
222
- class="govgr-input"
223
- control="[object Object]"
224
- name="name"
225
- type="text"
226
- />,
227
- },
228
- },
229
- },
230
- "fieldsWithValidationRef": Object {
231
- "current": Object {},
232
- },
233
- "formStateRef": Object {
234
- "current": Object {
235
- "dirtyFields": Object {},
236
- "errors": Object {},
237
- "isDirty": false,
238
- "isSubmitSuccessful": false,
239
- "isSubmitted": false,
240
- "isSubmitting": false,
241
- "isValid": false,
242
- "submitCount": 0,
243
- "touched": Object {},
244
- },
245
- },
246
- "getValues": [Function],
247
- "isFormDirty": [Function],
248
- "mode": Object {
249
- "isOnAll": false,
250
- "isOnBlur": false,
251
- "isOnChange": false,
252
- "isOnSubmit": true,
253
- "isOnTouch": false,
254
- },
255
- "reValidateMode": Object {
256
- "isReValidateOnBlur": false,
257
- "isReValidateOnChange": false,
224
+ <FieldBase
225
+ component={
226
+ Object {
227
+ "$$typeof": Symbol(react.forward_ref),
228
+ "render": [Function],
229
+ }
230
+ }
231
+ control={
232
+ Object {
233
+ "_defaultValues": Object {},
234
+ "_executeSchema": [Function],
235
+ "_fields": Object {
236
+ "name": Object {
237
+ "_f": Object {
238
+ "mount": true,
239
+ "name": "name",
240
+ "ref": <input
241
+ aria-required="true"
242
+ class="govgr-input"
243
+ control="[object Object]"
244
+ name="name"
245
+ type="text"
246
+ />,
258
247
  },
259
- "readFormStateRef": Object {
260
- "current": Object {
261
- "dirtyFields": false,
262
- "isDirty": false,
263
- "isSubmitting": false,
264
- "isValid": false,
265
- "touched": false,
248
+ },
249
+ },
250
+ "_formState": Object {
251
+ "dirtyFields": Object {},
252
+ "errors": Object {},
253
+ "isDirty": false,
254
+ "isSubmitSuccessful": false,
255
+ "isSubmitted": false,
256
+ "isSubmitting": false,
257
+ "isValid": false,
258
+ "isValidating": false,
259
+ "submitCount": 0,
260
+ "touchedFields": Object {},
261
+ },
262
+ "_formValues": Object {
263
+ "name": "",
264
+ },
265
+ "_getDirty": [Function],
266
+ "_getFieldArray": [Function],
267
+ "_getWatch": [Function],
268
+ "_names": Object {
269
+ "array": Set {},
270
+ "mount": Set {
271
+ "name",
272
+ },
273
+ "unMount": Set {},
274
+ "watch": Set {},
275
+ },
276
+ "_options": Object {
277
+ "criteriaMode": "all",
278
+ "defaultValues": Object {},
279
+ "mode": "onSubmit",
280
+ "reValidateMode": "onSubmit",
281
+ "resolver": [Function],
282
+ "shouldFocusError": true,
283
+ },
284
+ "_proxyFormState": Object {
285
+ "dirtyFields": false,
286
+ "errors": "all",
287
+ "isDirty": false,
288
+ "isValid": false,
289
+ "isValidating": false,
290
+ "touchedFields": false,
291
+ },
292
+ "_removeUnmounted": [Function],
293
+ "_stateFlags": Object {
294
+ "action": false,
295
+ "mount": true,
296
+ "watch": false,
297
+ },
298
+ "_subjects": Object {
299
+ "array": Object {
300
+ "next": [Function],
301
+ "observers": Array [],
302
+ "subscribe": [Function],
303
+ "unsubscribe": [Function],
304
+ },
305
+ "state": Object {
306
+ "next": [Function],
307
+ "observers": Array [
308
+ Object {
309
+ "next": [Function],
266
310
  },
267
- },
268
- "register": [Function],
269
- "removeFieldEventListener": [Function],
270
- "resetFieldArrayFunctionRef": Object {
271
- "current": Object {},
272
- },
273
- "setValue": [Function],
274
- "shallowFieldsStateRef": Object {
275
- "current": Object {},
276
- },
277
- "shouldUnregister": true,
278
- "trigger": [Function],
279
- "unregister": [Function],
280
- "updateFormState": [Function],
281
- "updateWatchedValue": [Function],
282
- "useWatchFieldsRef": Object {
283
- "current": Object {},
284
- },
285
- "useWatchRenderFunctionsRef": Object {
286
- "current": Object {},
287
- },
288
- "validFieldsRef": Object {
289
- "current": Object {},
290
- },
291
- "validateResolver": [Function],
292
- "watchInternal": [Function],
293
- }
294
- }
295
- controlled={false}
296
- key="name"
297
- label={
298
- Object {
299
- "primary": "name.field.primary",
300
- "secondary": "name.field.secondary",
301
- }
311
+ ],
312
+ "subscribe": [Function],
313
+ "unsubscribe": [Function],
314
+ },
315
+ "watch": Object {
316
+ "next": [Function],
317
+ "observers": Array [],
318
+ "subscribe": [Function],
319
+ "unsubscribe": [Function],
320
+ },
321
+ },
322
+ "_updateFieldArray": [Function],
323
+ "_updateValid": [Function],
324
+ "getFieldState": [Function],
325
+ "register": [Function],
326
+ "unregister": [Function],
327
+ }
328
+ }
329
+ controlled={false}
330
+ key="name"
331
+ label={
332
+ Object {
333
+ "primary": "name.field.primary",
334
+ "secondary": "name.field.secondary",
335
+ }
336
+ }
337
+ name="name"
338
+ register={[Function]}
339
+ required={true}
340
+ type="string"
341
+ >
342
+ <FieldContainer
343
+ label={
344
+ Object {
345
+ "primary": "name.field.primary",
346
+ "secondary": "name.field.secondary",
302
347
  }
303
- name="name"
304
- register={[Function]}
305
- required={true}
306
- type="string"
348
+ }
349
+ name="name"
350
+ >
351
+ <ForwardRef(Field)
352
+ error={false}
307
353
  >
308
- <FieldContainer
309
- label={
310
- Object {
311
- "primary": "name.field.primary",
312
- "secondary": "name.field.secondary",
313
- }
314
- }
315
- name="name"
354
+ <ForwardRef(Grid)
355
+ className="govgr-field"
356
+ item={true}
357
+ lg={12}
358
+ md={12}
359
+ xl={12}
360
+ xs={12}
316
361
  >
317
- <ForwardRef(Field)
318
- error={false}
362
+ <ForwardRef(Base)
363
+ as="div"
364
+ className="govgr-field xs:govgr-grid__col-span-12 md:govgr-grid__col-span-12 lg:govgr-grid__col-span-12 xl:govgr-grid__col-span-12"
319
365
  >
320
366
  <div
321
- className="govgr-field"
367
+ className="govgr-field xs:govgr-grid__col-span-12 md:govgr-grid__col-span-12 lg:govgr-grid__col-span-12 xl:govgr-grid__col-span-12"
322
368
  >
323
369
  <ForwardRef(Label)>
324
- <label
370
+ <ForwardRef(Base)
371
+ as="label"
325
372
  className="govgr-label"
326
373
  >
327
- <Label
328
- label={
329
- Object {
330
- "primary": "name.field.primary",
331
- "secondary": "name.field.secondary",
332
- }
333
- }
374
+ <label
375
+ className="govgr-label"
334
376
  >
335
- <ForwardRef(LabelTitle)
336
- size="s"
377
+ <Label
378
+ label={
379
+ Object {
380
+ "primary": "name.field.primary",
381
+ "secondary": "name.field.secondary",
382
+ }
383
+ }
337
384
  >
338
- <span
339
- className="govgr-heading-s"
385
+ <ForwardRef(LabelTitle)
386
+ size="s"
340
387
  >
341
- name.field.primary
342
- </span>
343
- </ForwardRef(LabelTitle)>
344
- <ForwardRef(Hint)>
345
- <p
346
- className="govgr-hint"
347
- >
348
- name.field.secondary
349
- </p>
350
- </ForwardRef(Hint)>
351
- </Label>
352
- <ForwardRef(WrappedInput)
353
- aria-required={true}
354
- control={
355
- Object {
356
- "defaultValuesRef": Object {
357
- "current": Object {},
358
- },
359
- "fieldArrayDefaultValuesRef": Object {
360
- "current": Object {},
361
- },
362
- "fieldArrayNamesRef": Object {
363
- "current": Set {},
364
- },
365
- "fieldArrayValuesRef": Object {
366
- "current": Object {},
367
- },
368
- "fieldsRef": Object {
369
- "current": Object {
388
+ <ForwardRef(Base)
389
+ as="span"
390
+ className="govgr-heading-s"
391
+ >
392
+ <span
393
+ className="govgr-heading-s"
394
+ >
395
+ name.field.primary
396
+ </span>
397
+ </ForwardRef(Base)>
398
+ </ForwardRef(LabelTitle)>
399
+ <ForwardRef(Hint)>
400
+ <ForwardRef(Base)
401
+ as="p"
402
+ className="govgr-hint"
403
+ >
404
+ <p
405
+ className="govgr-hint"
406
+ >
407
+ name.field.secondary
408
+ </p>
409
+ </ForwardRef(Base)>
410
+ </ForwardRef(Hint)>
411
+ </Label>
412
+ <ForwardRef(WrappedInput)
413
+ aria-required={true}
414
+ control={
415
+ Object {
416
+ "_defaultValues": Object {},
417
+ "_executeSchema": [Function],
418
+ "_fields": Object {
370
419
  "name": Object {
371
- "ref": <input
372
- aria-required="true"
373
- class="govgr-input"
374
- control="[object Object]"
375
- name="name"
376
- type="text"
377
- />,
420
+ "_f": Object {
421
+ "mount": true,
422
+ "name": "name",
423
+ "ref": <input
424
+ aria-required="true"
425
+ class="govgr-input"
426
+ control="[object Object]"
427
+ name="name"
428
+ type="text"
429
+ />,
430
+ },
378
431
  },
379
432
  },
380
- },
381
- "fieldsWithValidationRef": Object {
382
- "current": Object {},
383
- },
384
- "formStateRef": Object {
385
- "current": Object {
433
+ "_formState": Object {
386
434
  "dirtyFields": Object {},
387
435
  "errors": Object {},
388
436
  "isDirty": false,
@@ -390,185 +438,97 @@ exports[`renders the Questions 1`] = `
390
438
  "isSubmitted": false,
391
439
  "isSubmitting": false,
392
440
  "isValid": false,
441
+ "isValidating": false,
393
442
  "submitCount": 0,
394
- "touched": Object {},
443
+ "touchedFields": Object {},
395
444
  },
396
- },
397
- "getValues": [Function],
398
- "isFormDirty": [Function],
399
- "mode": Object {
400
- "isOnAll": false,
401
- "isOnBlur": false,
402
- "isOnChange": false,
403
- "isOnSubmit": true,
404
- "isOnTouch": false,
405
- },
406
- "reValidateMode": Object {
407
- "isReValidateOnBlur": false,
408
- "isReValidateOnChange": false,
409
- },
410
- "readFormStateRef": Object {
411
- "current": Object {
412
- "dirtyFields": false,
413
- "isDirty": false,
414
- "isSubmitting": false,
415
- "isValid": false,
416
- "touched": false,
445
+ "_formValues": Object {
446
+ "name": "",
417
447
  },
418
- },
419
- "register": [Function],
420
- "removeFieldEventListener": [Function],
421
- "resetFieldArrayFunctionRef": Object {
422
- "current": Object {},
423
- },
424
- "setValue": [Function],
425
- "shallowFieldsStateRef": Object {
426
- "current": Object {},
427
- },
428
- "shouldUnregister": true,
429
- "trigger": [Function],
430
- "unregister": [Function],
431
- "updateFormState": [Function],
432
- "updateWatchedValue": [Function],
433
- "useWatchFieldsRef": Object {
434
- "current": Object {},
435
- },
436
- "useWatchRenderFunctionsRef": Object {
437
- "current": Object {},
438
- },
439
- "validFieldsRef": Object {
440
- "current": Object {},
441
- },
442
- "validateResolver": [Function],
443
- "watchInternal": [Function],
444
- }
445
- }
446
- disabled={false}
447
- error={false}
448
- extra={Object {}}
449
- name="name"
450
- required={true}
451
- type="string"
452
- >
453
- <ForwardRef(TextInput)
454
- aria-required={true}
455
- control={
456
- Object {
457
- "defaultValuesRef": Object {
458
- "current": Object {},
448
+ "_getDirty": [Function],
449
+ "_getFieldArray": [Function],
450
+ "_getWatch": [Function],
451
+ "_names": Object {
452
+ "array": Set {},
453
+ "mount": Set {
454
+ "name",
455
+ },
456
+ "unMount": Set {},
457
+ "watch": Set {},
459
458
  },
460
- "fieldArrayDefaultValuesRef": Object {
461
- "current": Object {},
459
+ "_options": Object {
460
+ "criteriaMode": "all",
461
+ "defaultValues": Object {},
462
+ "mode": "onSubmit",
463
+ "reValidateMode": "onSubmit",
464
+ "resolver": [Function],
465
+ "shouldFocusError": true,
462
466
  },
463
- "fieldArrayNamesRef": Object {
464
- "current": Set {},
467
+ "_proxyFormState": Object {
468
+ "dirtyFields": false,
469
+ "errors": "all",
470
+ "isDirty": false,
471
+ "isValid": false,
472
+ "isValidating": false,
473
+ "touchedFields": false,
465
474
  },
466
- "fieldArrayValuesRef": Object {
467
- "current": Object {},
475
+ "_removeUnmounted": [Function],
476
+ "_stateFlags": Object {
477
+ "action": false,
478
+ "mount": true,
479
+ "watch": false,
468
480
  },
469
- "fieldsRef": Object {
470
- "current": Object {
471
- "name": Object {
472
- "ref": <input
473
- aria-required="true"
474
- class="govgr-input"
475
- control="[object Object]"
476
- name="name"
477
- type="text"
478
- />,
479
- },
481
+ "_subjects": Object {
482
+ "array": Object {
483
+ "next": [Function],
484
+ "observers": Array [],
485
+ "subscribe": [Function],
486
+ "unsubscribe": [Function],
480
487
  },
481
- },
482
- "fieldsWithValidationRef": Object {
483
- "current": Object {},
484
- },
485
- "formStateRef": Object {
486
- "current": Object {
487
- "dirtyFields": Object {},
488
- "errors": Object {},
489
- "isDirty": false,
490
- "isSubmitSuccessful": false,
491
- "isSubmitted": false,
492
- "isSubmitting": false,
493
- "isValid": false,
494
- "submitCount": 0,
495
- "touched": Object {},
488
+ "state": Object {
489
+ "next": [Function],
490
+ "observers": Array [
491
+ Object {
492
+ "next": [Function],
493
+ },
494
+ ],
495
+ "subscribe": [Function],
496
+ "unsubscribe": [Function],
496
497
  },
497
- },
498
- "getValues": [Function],
499
- "isFormDirty": [Function],
500
- "mode": Object {
501
- "isOnAll": false,
502
- "isOnBlur": false,
503
- "isOnChange": false,
504
- "isOnSubmit": true,
505
- "isOnTouch": false,
506
- },
507
- "reValidateMode": Object {
508
- "isReValidateOnBlur": false,
509
- "isReValidateOnChange": false,
510
- },
511
- "readFormStateRef": Object {
512
- "current": Object {
513
- "dirtyFields": false,
514
- "isDirty": false,
515
- "isSubmitting": false,
516
- "isValid": false,
517
- "touched": false,
498
+ "watch": Object {
499
+ "next": [Function],
500
+ "observers": Array [],
501
+ "subscribe": [Function],
502
+ "unsubscribe": [Function],
518
503
  },
519
504
  },
505
+ "_updateFieldArray": [Function],
506
+ "_updateValid": [Function],
507
+ "getFieldState": [Function],
520
508
  "register": [Function],
521
- "removeFieldEventListener": [Function],
522
- "resetFieldArrayFunctionRef": Object {
523
- "current": Object {},
524
- },
525
- "setValue": [Function],
526
- "shallowFieldsStateRef": Object {
527
- "current": Object {},
528
- },
529
- "shouldUnregister": true,
530
- "trigger": [Function],
531
509
  "unregister": [Function],
532
- "updateFormState": [Function],
533
- "updateWatchedValue": [Function],
534
- "useWatchFieldsRef": Object {
535
- "current": Object {},
536
- },
537
- "useWatchRenderFunctionsRef": Object {
538
- "current": Object {},
539
- },
540
- "validFieldsRef": Object {
541
- "current": Object {},
542
- },
543
- "validateResolver": [Function],
544
- "watchInternal": [Function],
545
510
  }
546
511
  }
547
512
  disabled={false}
548
513
  error={false}
514
+ extra={Object {}}
549
515
  name="name"
550
- type="text"
516
+ onBlur={[Function]}
517
+ onChange={[Function]}
518
+ required={true}
519
+ type="string"
551
520
  >
552
- <input
521
+ <ForwardRef(TextInput)
553
522
  aria-required={true}
554
- className="govgr-input"
555
523
  control={
556
524
  Object {
557
- "defaultValuesRef": Object {
558
- "current": Object {},
559
- },
560
- "fieldArrayDefaultValuesRef": Object {
561
- "current": Object {},
562
- },
563
- "fieldArrayNamesRef": Object {
564
- "current": Set {},
565
- },
566
- "fieldArrayValuesRef": Object {
567
- "current": Object {},
568
- },
569
- "fieldsRef": Object {
570
- "current": Object {
571
- "name": Object {
525
+ "_defaultValues": Object {},
526
+ "_executeSchema": [Function],
527
+ "_fields": Object {
528
+ "name": Object {
529
+ "_f": Object {
530
+ "mount": true,
531
+ "name": "name",
572
532
  "ref": <input
573
533
  aria-required="true"
574
534
  class="govgr-input"
@@ -579,11 +539,116 @@ exports[`renders the Questions 1`] = `
579
539
  },
580
540
  },
581
541
  },
582
- "fieldsWithValidationRef": Object {
583
- "current": Object {},
542
+ "_formState": Object {
543
+ "dirtyFields": Object {},
544
+ "errors": Object {},
545
+ "isDirty": false,
546
+ "isSubmitSuccessful": false,
547
+ "isSubmitted": false,
548
+ "isSubmitting": false,
549
+ "isValid": false,
550
+ "isValidating": false,
551
+ "submitCount": 0,
552
+ "touchedFields": Object {},
553
+ },
554
+ "_formValues": Object {
555
+ "name": "",
556
+ },
557
+ "_getDirty": [Function],
558
+ "_getFieldArray": [Function],
559
+ "_getWatch": [Function],
560
+ "_names": Object {
561
+ "array": Set {},
562
+ "mount": Set {
563
+ "name",
564
+ },
565
+ "unMount": Set {},
566
+ "watch": Set {},
567
+ },
568
+ "_options": Object {
569
+ "criteriaMode": "all",
570
+ "defaultValues": Object {},
571
+ "mode": "onSubmit",
572
+ "reValidateMode": "onSubmit",
573
+ "resolver": [Function],
574
+ "shouldFocusError": true,
584
575
  },
585
- "formStateRef": Object {
586
- "current": Object {
576
+ "_proxyFormState": Object {
577
+ "dirtyFields": false,
578
+ "errors": "all",
579
+ "isDirty": false,
580
+ "isValid": false,
581
+ "isValidating": false,
582
+ "touchedFields": false,
583
+ },
584
+ "_removeUnmounted": [Function],
585
+ "_stateFlags": Object {
586
+ "action": false,
587
+ "mount": true,
588
+ "watch": false,
589
+ },
590
+ "_subjects": Object {
591
+ "array": Object {
592
+ "next": [Function],
593
+ "observers": Array [],
594
+ "subscribe": [Function],
595
+ "unsubscribe": [Function],
596
+ },
597
+ "state": Object {
598
+ "next": [Function],
599
+ "observers": Array [
600
+ Object {
601
+ "next": [Function],
602
+ },
603
+ ],
604
+ "subscribe": [Function],
605
+ "unsubscribe": [Function],
606
+ },
607
+ "watch": Object {
608
+ "next": [Function],
609
+ "observers": Array [],
610
+ "subscribe": [Function],
611
+ "unsubscribe": [Function],
612
+ },
613
+ },
614
+ "_updateFieldArray": [Function],
615
+ "_updateValid": [Function],
616
+ "getFieldState": [Function],
617
+ "register": [Function],
618
+ "unregister": [Function],
619
+ }
620
+ }
621
+ disabled={false}
622
+ error={false}
623
+ name="name"
624
+ onBlur={[Function]}
625
+ onChange={[Function]}
626
+ type="text"
627
+ >
628
+ <ForwardRef(Base)
629
+ aria-required={true}
630
+ as="input"
631
+ className="govgr-input"
632
+ control={
633
+ Object {
634
+ "_defaultValues": Object {},
635
+ "_executeSchema": [Function],
636
+ "_fields": Object {
637
+ "name": Object {
638
+ "_f": Object {
639
+ "mount": true,
640
+ "name": "name",
641
+ "ref": <input
642
+ aria-required="true"
643
+ class="govgr-input"
644
+ control="[object Object]"
645
+ name="name"
646
+ type="text"
647
+ />,
648
+ },
649
+ },
650
+ },
651
+ "_formState": Object {
587
652
  "dirtyFields": Object {},
588
653
  "errors": Object {},
589
654
  "isDirty": false,
@@ -591,91 +656,226 @@ exports[`renders the Questions 1`] = `
591
656
  "isSubmitted": false,
592
657
  "isSubmitting": false,
593
658
  "isValid": false,
659
+ "isValidating": false,
594
660
  "submitCount": 0,
595
- "touched": Object {},
661
+ "touchedFields": Object {},
596
662
  },
597
- },
598
- "getValues": [Function],
599
- "isFormDirty": [Function],
600
- "mode": Object {
601
- "isOnAll": false,
602
- "isOnBlur": false,
603
- "isOnChange": false,
604
- "isOnSubmit": true,
605
- "isOnTouch": false,
606
- },
607
- "reValidateMode": Object {
608
- "isReValidateOnBlur": false,
609
- "isReValidateOnChange": false,
610
- },
611
- "readFormStateRef": Object {
612
- "current": Object {
663
+ "_formValues": Object {
664
+ "name": "",
665
+ },
666
+ "_getDirty": [Function],
667
+ "_getFieldArray": [Function],
668
+ "_getWatch": [Function],
669
+ "_names": Object {
670
+ "array": Set {},
671
+ "mount": Set {
672
+ "name",
673
+ },
674
+ "unMount": Set {},
675
+ "watch": Set {},
676
+ },
677
+ "_options": Object {
678
+ "criteriaMode": "all",
679
+ "defaultValues": Object {},
680
+ "mode": "onSubmit",
681
+ "reValidateMode": "onSubmit",
682
+ "resolver": [Function],
683
+ "shouldFocusError": true,
684
+ },
685
+ "_proxyFormState": Object {
613
686
  "dirtyFields": false,
687
+ "errors": "all",
614
688
  "isDirty": false,
615
- "isSubmitting": false,
616
689
  "isValid": false,
617
- "touched": false,
690
+ "isValidating": false,
691
+ "touchedFields": false,
618
692
  },
619
- },
620
- "register": [Function],
621
- "removeFieldEventListener": [Function],
622
- "resetFieldArrayFunctionRef": Object {
623
- "current": Object {},
624
- },
625
- "setValue": [Function],
626
- "shallowFieldsStateRef": Object {
627
- "current": Object {},
628
- },
629
- "shouldUnregister": true,
630
- "trigger": [Function],
631
- "unregister": [Function],
632
- "updateFormState": [Function],
633
- "updateWatchedValue": [Function],
634
- "useWatchFieldsRef": Object {
635
- "current": Object {},
636
- },
637
- "useWatchRenderFunctionsRef": Object {
638
- "current": Object {},
639
- },
640
- "validFieldsRef": Object {
641
- "current": Object {},
642
- },
643
- "validateResolver": [Function],
644
- "watchInternal": [Function],
693
+ "_removeUnmounted": [Function],
694
+ "_stateFlags": Object {
695
+ "action": false,
696
+ "mount": true,
697
+ "watch": false,
698
+ },
699
+ "_subjects": Object {
700
+ "array": Object {
701
+ "next": [Function],
702
+ "observers": Array [],
703
+ "subscribe": [Function],
704
+ "unsubscribe": [Function],
705
+ },
706
+ "state": Object {
707
+ "next": [Function],
708
+ "observers": Array [
709
+ Object {
710
+ "next": [Function],
711
+ },
712
+ ],
713
+ "subscribe": [Function],
714
+ "unsubscribe": [Function],
715
+ },
716
+ "watch": Object {
717
+ "next": [Function],
718
+ "observers": Array [],
719
+ "subscribe": [Function],
720
+ "unsubscribe": [Function],
721
+ },
722
+ },
723
+ "_updateFieldArray": [Function],
724
+ "_updateValid": [Function],
725
+ "getFieldState": [Function],
726
+ "register": [Function],
727
+ "unregister": [Function],
728
+ }
645
729
  }
646
- }
647
- disabled={false}
648
- name="name"
649
- type="text"
650
- />
651
- </ForwardRef(TextInput)>
652
- </ForwardRef(WrappedInput)>
653
- </label>
730
+ disabled={false}
731
+ name="name"
732
+ onBlur={[Function]}
733
+ onChange={[Function]}
734
+ type="text"
735
+ >
736
+ <input
737
+ aria-required={true}
738
+ className="govgr-input"
739
+ control={
740
+ Object {
741
+ "_defaultValues": Object {},
742
+ "_executeSchema": [Function],
743
+ "_fields": Object {
744
+ "name": Object {
745
+ "_f": Object {
746
+ "mount": true,
747
+ "name": "name",
748
+ "ref": <input
749
+ aria-required="true"
750
+ class="govgr-input"
751
+ control="[object Object]"
752
+ name="name"
753
+ type="text"
754
+ />,
755
+ },
756
+ },
757
+ },
758
+ "_formState": Object {
759
+ "dirtyFields": Object {},
760
+ "errors": Object {},
761
+ "isDirty": false,
762
+ "isSubmitSuccessful": false,
763
+ "isSubmitted": false,
764
+ "isSubmitting": false,
765
+ "isValid": false,
766
+ "isValidating": false,
767
+ "submitCount": 0,
768
+ "touchedFields": Object {},
769
+ },
770
+ "_formValues": Object {
771
+ "name": "",
772
+ },
773
+ "_getDirty": [Function],
774
+ "_getFieldArray": [Function],
775
+ "_getWatch": [Function],
776
+ "_names": Object {
777
+ "array": Set {},
778
+ "mount": Set {
779
+ "name",
780
+ },
781
+ "unMount": Set {},
782
+ "watch": Set {},
783
+ },
784
+ "_options": Object {
785
+ "criteriaMode": "all",
786
+ "defaultValues": Object {},
787
+ "mode": "onSubmit",
788
+ "reValidateMode": "onSubmit",
789
+ "resolver": [Function],
790
+ "shouldFocusError": true,
791
+ },
792
+ "_proxyFormState": Object {
793
+ "dirtyFields": false,
794
+ "errors": "all",
795
+ "isDirty": false,
796
+ "isValid": false,
797
+ "isValidating": false,
798
+ "touchedFields": false,
799
+ },
800
+ "_removeUnmounted": [Function],
801
+ "_stateFlags": Object {
802
+ "action": false,
803
+ "mount": true,
804
+ "watch": false,
805
+ },
806
+ "_subjects": Object {
807
+ "array": Object {
808
+ "next": [Function],
809
+ "observers": Array [],
810
+ "subscribe": [Function],
811
+ "unsubscribe": [Function],
812
+ },
813
+ "state": Object {
814
+ "next": [Function],
815
+ "observers": Array [
816
+ Object {
817
+ "next": [Function],
818
+ },
819
+ ],
820
+ "subscribe": [Function],
821
+ "unsubscribe": [Function],
822
+ },
823
+ "watch": Object {
824
+ "next": [Function],
825
+ "observers": Array [],
826
+ "subscribe": [Function],
827
+ "unsubscribe": [Function],
828
+ },
829
+ },
830
+ "_updateFieldArray": [Function],
831
+ "_updateValid": [Function],
832
+ "getFieldState": [Function],
833
+ "register": [Function],
834
+ "unregister": [Function],
835
+ }
836
+ }
837
+ disabled={false}
838
+ name="name"
839
+ onBlur={[Function]}
840
+ onChange={[Function]}
841
+ type="text"
842
+ />
843
+ </ForwardRef(Base)>
844
+ </ForwardRef(TextInput)>
845
+ </ForwardRef(WrappedInput)>
846
+ </label>
847
+ </ForwardRef(Base)>
654
848
  </ForwardRef(Label)>
655
849
  </div>
656
- </ForwardRef(Field)>
657
- </FieldContainer>
658
- </FieldBase>
659
- </Field>
660
- <withDeprecationComponent
850
+ </ForwardRef(Base)>
851
+ </ForwardRef(Grid)>
852
+ </ForwardRef(Field)>
853
+ </FieldContainer>
854
+ </FieldBase>
855
+ </Field>
856
+ <withDeprecationComponent
857
+ type="submit"
858
+ >
859
+ <ForwardRef(Button)
860
+ type="submit"
861
+ >
862
+ <ForwardRef(Base)
863
+ as="button"
864
+ className="govgr-btn-primary govgr-btn"
661
865
  type="submit"
662
866
  >
663
- <ForwardRef(Button)
867
+ <button
868
+ className="govgr-btn-primary govgr-btn"
664
869
  type="submit"
665
870
  >
666
- <button
667
- className="govgr-btn-primary govgr-btn"
668
- type="submit"
669
- >
670
- Συνέχεια
671
- </button>
672
- </ForwardRef(Button)>
673
- </withDeprecationComponent>
674
- </div>
675
- </ForwardRef(Grid)>
676
- </div>
677
- </ForwardRef(Grid)>
678
- </form>
871
+ Συνέχεια
872
+ </button>
873
+ </ForwardRef(Base)>
874
+ </ForwardRef(Button)>
875
+ </withDeprecationComponent>
876
+ </form>
877
+ </ForwardRef(Base)>
878
+ </ForwardRef(Form)>
679
879
  </ForwardRef(FormBase)>
680
880
  </ForwardRef(FormBuilder)>
681
881
  </StepForm>