@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
package/es/index.mdx CHANGED
@@ -1,206 +1,44 @@
1
1
  ---
2
- title: Form
3
- parent: docs/ui/components
2
+ id: Introduction
3
+ title: Digigov Form
4
+ sidebar_label: Introduction to Digigov Form
4
5
  ---
5
6
 
6
- import FormBuilder from '@digigov/form/';
7
+ import LeadText from "@site/src/components/LeadText";
7
8
 
8
- export const fields = [
9
- {
10
- key: 'custom_object.attribute1',
11
- type: 'string',
12
- required: true,
13
- label: {
14
- primary: 'Custom object Attribute 1',
15
- },
16
- layout: {
17
- xs: 5,
18
- sm: 6,
19
- },
20
- },
21
- {
22
- key: 'custom_object.attribute2',
23
- type: 'int',
24
- required: true,
25
- label: {
26
- primary: 'Custom object Attribute 2',
27
- },
28
- layout: {
29
- xs: 5,
30
- sm: 6,
31
- },
32
- },
33
- {
34
- key: 'phone',
35
- label: {
36
- primary: 'Mobile phone',
37
- secondary: 'A valid mobile number, eg. +306988848888',
38
- },
39
- required: true,
40
- type: 'mobile_phone',
41
- },
42
- {
43
- key: 'choice_single',
44
- label: { primary: 'Is this true or not' },
45
- type: 'choice:single',
46
- extra: {
47
- options: [
48
- {
49
- label: { primary: 'Yes' },
50
- value: 'yes',
51
- },
52
- {
53
- label: { primary: 'No', secondary: 'Explanation about no option' },
54
- value: 'no',
55
- },
56
- ],
57
- },
58
- },
59
- {
60
- key: 'choice_single_notitle',
61
- type: 'choice:single',
62
- editable: false,
63
- extra: {
64
- options: [
65
- {
66
- label: { primary: 'One' },
67
- value: '1',
68
- },
69
- {
70
- label: { primary: 'Two' },
71
- value: '2',
72
- },
73
- ],
74
- },
75
- },
76
- {
77
- key: 'choice_multiple',
78
- label: { primary: 'Select multiple choices' },
79
- type: 'choice:multiple',
80
- condition: {
81
- choice_single: {
82
- is: 'no',
83
- then: {
84
- enabled: true,
85
- required: true,
86
- },
87
- else: {
88
- enabled: false,
89
- required: false,
90
- },
91
- },
92
- },
93
- extra: {
94
- options: [
95
- {
96
- label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
97
- value: 'choice_1',
98
- },
99
- {
100
- label: { primary: 'Choice 2' },
101
- value: 'choice_2',
102
- },
103
- ],
104
- },
105
- },
106
- {
107
- key: 'choice_single_select',
108
- label: { primary: 'Select one choice' },
109
- type: 'choice:single',
110
- extra: {
111
- options: [
112
- {
113
- label: { primary: 'Choice 1', secondary: 'Choice 1 explanation' },
114
- value: 'choice_1',
115
- },
116
- {
117
- label: { primary: 'Choice 2 lenghty explanation without reason' },
118
- value: 'choice_2',
119
- },
120
- {
121
- label: { primary: 'Choice 3 ' },
122
- value: 'choice_3',
123
- },
124
- ],
125
- component: 'Select',
126
- },
127
- },
128
- {
129
- key: 'number',
130
- label: { primary: 'A positive number' },
131
- required: true,
132
- width: '100px',
133
- type: 'int',
134
- condition: {
135
- choice_single: {
136
- is: 'no',
137
- then: {
138
- display: true,
139
- required: true,
140
- },
141
- else: {
142
- display: false,
143
- required: false,
144
- },
145
- },
146
- },
147
- },
148
- {
149
- key: 'file',
150
- label: { primary: 'A file upload field' },
151
- required: false,
152
- extra: {
153
- accept: '.pdf,.jpeg,.png',
154
- multiple: true,
155
- maxSize: 1000,
156
- },
157
- width: '100px',
158
- type: 'file',
159
- },
160
- ];
161
- export const fieldsets = [
162
- {
163
- key: 'group1',
164
- label: {
165
- primary: 'This is group 1',
166
- secondary: 'And some more info',
167
- },
168
- body: `and here is the text
169
- that describes more for this`,
170
- fields: ['custom_object.attribute1', 'custom_object.attribute2'],
171
- },
172
- {
173
- key: 'rest',
174
- fields: fields
175
- .map(({ key }) => key)
176
- .filter((key) => !key.startsWith('custom_object')),
177
- },
178
- ];
179
- export const initialValues = {
180
- phone: '6988888888',
181
- choice_multiple: ['choice_2'],
182
- choice_single: 'yes',
183
- choice_single_select: 'choice_3',
184
- };
9
+ <LeadText>Digigov Form is an off-the-shelf solution for managing web forms using Reactjs. It supports flexible and multi-step forms and easy-to-use validation. This page will guide you through everything you need to create accessible and
10
+ dynamic forms that can handle all sorts of user inputs.</LeadText>
11
+
12
+ <img src="/img/form.svg" style={{margin: '3rem 0', maxWidth: '450px', width: '60%'}}/>
185
13
 
186
- ## Example
14
+ ## Before we start
187
15
 
188
- <FormBuilder
189
- fields={fields}
190
- fieldsets={fieldsets}
191
- onSubmit={(data) => {
192
- console.log(data);
193
- }}
194
- initial={initialValues}
195
- auto={true}
196
- >
197
- {/* <Fieldset>
198
- <FieldsetLabel>This is a fieldset</FieldsetLabel>
199
- {fields.map((field) => (
200
- <Field key={field.key} name={field.key} />
201
- ))}
202
- </Fieldset> */}
203
- <button type="submit">Submit</button>
204
- </FormBuilder>
16
+ Forms are essential for any modern application. We have done the heavy lifting of
17
+ creating a library that will help you increase the productivity and the quality
18
+ of your forms. You can choose from a variety of input types and validations and
19
+ describe how form fields behave and restrict data input.
205
20
 
206
- ## API
21
+ Finally, we also offer an easy way to spread your forms across multiple pages or
22
+ steps and still be able to gather data in a single serialized object that you
23
+ will be able to save via an JSON API.
24
+
25
+ ## Overview
26
+
27
+ The `@digigov/form` NPM package contains React components and validators. The
28
+ library uses basic, semantically correct HTML5 input fields.
29
+
30
+ It adds dynamic control, interactivity and validations to the core input
31
+ components implemented in `@digigov/react-core`. Styling is provided by
32
+ `@digigov/css` library following the [GOV.GR design
33
+ system](https://guide.services.gov.gr).
34
+
35
+ Digigov Form uses two main libraries internally. The first is [React Hook
36
+ Form](https://www.react-hook-form.com/) which helps us manage the form state and
37
+ perform actions and mutations on it. The second is
38
+ [Yup](https://github.com/jquense/yup) and it is used to validate form data. It
39
+ interfaces with React Hook Form right out of the box, but also enables us to
40
+ define custom validation types such as AMKA, AFM etc.
41
+
42
+ Some basic functionalites of `@digigov/form` will be presented in the following
43
+ sections and also we are going to guide you through some more advanced topics
44
+ such as internationalisation, custom data validation etc.
@@ -0,0 +1,6 @@
1
+ import Checkboxes from '@digigov/form/inputs/Checkboxes';
2
+ export default {
3
+ title: 'Digigov Form/inputs/Checkboxes',
4
+ component: Checkboxes
5
+ };
6
+ export * from '@digigov/form/inputs/Checkboxes/__stories__/Default';
@@ -0,0 +1,43 @@
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: 'string',
17
+ name: "string",
18
+ type: "choice:multiple",
19
+ required: true,
20
+ label: {
21
+ primary: 'Πώς αισθάνεστε αυτή τη στιγμή;'
22
+ },
23
+ extra: {
24
+ options: [{
25
+ label: {
26
+ primary: 'Έχω συνάχι'
27
+ },
28
+ value: 'runny-nose'
29
+ }, {
30
+ label: {
31
+ primary: 'Έχω πυρετό'
32
+ },
33
+ value: 'fever'
34
+ }, {
35
+ label: {
36
+ primary: 'Αισθάνομαι κούραση'
37
+ },
38
+ value: 'fatigue'
39
+ }]
40
+ }
41
+ }), _ref);
42
+ };
43
+ export default Default;
@@ -0,0 +1,6 @@
1
+ import DateInput from '@digigov/form/inputs/DateInput';
2
+ export default {
3
+ title: 'Digigov Form/inputs/DateInput',
4
+ component: DateInput
5
+ };
6
+ export * from '@digigov/form/inputs/DateInput/__stories__/Default';
@@ -0,0 +1,44 @@
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: 'string',
17
+ name: "string",
18
+ type: "date",
19
+ required: true,
20
+ label: {
21
+ primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
22
+ secondary: 'Για παράδειγμα, 05 11 2020'
23
+ },
24
+ extra: {
25
+ options: [{
26
+ label: {
27
+ primary: 'Έχω συνάχι'
28
+ },
29
+ value: 'runny-nose'
30
+ }, {
31
+ label: {
32
+ primary: 'Έχω πυρετό'
33
+ },
34
+ value: 'fever'
35
+ }, {
36
+ label: {
37
+ primary: 'Αισθάνομαι κούραση'
38
+ },
39
+ value: 'fatigue'
40
+ }]
41
+ }
42
+ }), _ref);
43
+ };
44
+ export default Default;
@@ -0,0 +1,13 @@
1
+ import Input from '@digigov/form/inputs/Input';
2
+ export default {
3
+ title: 'Digigov Form/inputs/Input',
4
+ component: Input
5
+ };
6
+ export * from '@digigov/form/inputs/Input/__stories__/Default';
7
+ export * from '@digigov/form/inputs/Input/__stories__/Integer';
8
+ export * from '@digigov/form/inputs/Input/__stories__/Boolean';
9
+ export * from '@digigov/form/inputs/Input/__stories__/PhoneNumber';
10
+ export * from '@digigov/form/inputs/Input/__stories__/MobilePhone';
11
+ export * from '@digigov/form/inputs/Input/__stories__/AFM';
12
+ export * from '@digigov/form/inputs/Input/__stories__/IBAN';
13
+ export * from '@digigov/form/inputs/Input/__stories__/PostalCode';
@@ -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 AFM = function AFM() {
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: "afm",
17
+ name: "afm",
18
+ type: "afm",
19
+ label: {
20
+ primary: 'Αριθμός φορολογικού μητρώου'
21
+ },
22
+ required: true
23
+ }), _ref);
24
+ };
25
+ export default AFM;
@@ -0,0 +1,26 @@
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 Boolean = function Boolean() {
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: "boolean-value",
17
+ name: "boolean-value",
18
+ type: "boolean",
19
+ label: {
20
+ primary: 'Ένα απλό true ή false',
21
+ secondary: 'Το πεδίο είναι τύπου boolean, δηλαδή λογικού μηδέν ή ένα. Μπορείτε να εισάγετε true, false, 0, 1.'
22
+ },
23
+ required: true
24
+ }), _ref);
25
+ };
26
+ export default Boolean;
@@ -0,0 +1,26 @@
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
+ secondary: 'Εισάγετε μια σειρά από χαρακτήρες και αριθμούς'
22
+ },
23
+ required: true
24
+ }), _ref);
25
+ };
26
+ export default Default;
@@ -0,0 +1,26 @@
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 IBAN = function IBAN() {
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: "iban",
17
+ name: "iban",
18
+ type: "iban",
19
+ label: {
20
+ primary: 'Αριθμός IBAN',
21
+ secondary: 'IBAN σημαίνει Διεθνής Αριθμός Τραπεζικού Λογαριασμού. Είναι ένας διεθνώς συμφωνημένος κωδικός, που αποτελείται από έως και 34 γράμματα και αριθμούς, που βοηθά τις τράπεζες να διεκπεραιώνουν μεταφορές σε όλο τον κόσμο.'
22
+ },
23
+ required: true
24
+ }), _ref);
25
+ };
26
+ export default IBAN;
@@ -0,0 +1,26 @@
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 Integer = function Integer() {
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: "random-number",
17
+ name: "random-number",
18
+ type: "int",
19
+ label: {
20
+ primary: 'Ένας τυχαίος αριθμός',
21
+ secondary: 'Εισάγετε έναν οποιοδήποτε αριθμό μεγαλύτερο από το μηδέν'
22
+ },
23
+ required: true
24
+ }), _ref);
25
+ };
26
+ export default Integer;
@@ -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 MobilePhone = function MobilePhone() {
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: "mobile-phone",
17
+ name: "mobile-phone",
18
+ type: "mobile_phone",
19
+ label: {
20
+ primary: 'Κινητό τηλέφωνο'
21
+ },
22
+ required: true
23
+ }), _ref);
24
+ };
25
+ export default MobilePhone;
@@ -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 PhoneNumber = function PhoneNumber() {
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: "phone-number",
17
+ name: "phone-number",
18
+ type: "phone_number",
19
+ label: {
20
+ primary: 'Σταθερό τηλέφωνο'
21
+ },
22
+ required: true
23
+ }), _ref);
24
+ };
25
+ export default PhoneNumber;
@@ -0,0 +1,28 @@
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 PostalCode = function PostalCode() {
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: "postal-code",
17
+ name: "postal-code",
18
+ type: "postal_code",
19
+ label: {
20
+ primary: 'Ταχυδρομικός κωδικός'
21
+ },
22
+ required: true,
23
+ extra: {
24
+ countries: ['GR']
25
+ }
26
+ }), _ref);
27
+ };
28
+ export default PostalCode;
@@ -3,8 +3,6 @@ title: Input
3
3
  parent: docs/ui/components
4
4
  ---
5
5
 
6
- import Input from '@digigov/form/inputs/Input';
7
-
8
6
  ## Example
9
7
 
10
8
  <Input type="text" />
@@ -0,0 +1,6 @@
1
+ import Label from '@digigov/form/inputs/Label';
2
+ export default {
3
+ title: 'Digigov Form/inputs/Label',
4
+ component: Label
5
+ };
6
+ export * from '@digigov/form/inputs/Label/__stories__/Default';
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import FormBuilder, { Field, Label } 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(Label, {
16
+ label: {
17
+ primary: 'Στοιχεία επιχείρησης',
18
+ secondary: 'Συμπληρώστε τα στοιχεία'
19
+ }
20
+ }), /*#__PURE__*/React.createElement(Field, {
21
+ key: "business-title",
22
+ name: "business-title",
23
+ type: "string",
24
+ label: {
25
+ primary: 'Όνομα επιχείρησης'
26
+ },
27
+ required: true
28
+ }), _ref);
29
+ };
30
+ export default Default;
@@ -0,0 +1,6 @@
1
+ import Radio from '@digigov/form/inputs/Radio';
2
+ export default {
3
+ title: 'Digigov Form/inputs/Radio',
4
+ component: Radio
5
+ };
6
+ export * from '@digigov/form/inputs/Radio/__stories__/Default';
@@ -0,0 +1,48 @@
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: 'string',
17
+ name: "string",
18
+ type: "choice:single",
19
+ required: true,
20
+ label: {
21
+ primary: 'Ποια ειναι η χώρα της διαμονής σας;'
22
+ },
23
+ extra: {
24
+ options: [{
25
+ label: {
26
+ primary: 'Ελλάδα'
27
+ },
28
+ value: 'greece'
29
+ }, {
30
+ label: {
31
+ primary: 'Κύπρος'
32
+ },
33
+ value: 'cyprus'
34
+ }, {
35
+ label: {
36
+ primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
37
+ },
38
+ value: 'eu'
39
+ }, {
40
+ label: {
41
+ primary: 'Ηνωμένες Πολιτείες της Αμερικής'
42
+ },
43
+ value: 'usa'
44
+ }]
45
+ }
46
+ }), _ref);
47
+ };
48
+ export default Default;