@digigov/form 0.10.3 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/Field/index.js +2 -2
- package/FieldArray/FieldArray.stories.playwright.json +213 -28
- package/FieldArray/__stories__/Default.js +13 -8
- package/FieldArray/__stories__/WithExactLength.js +14 -8
- package/FieldArray/index.js +3 -3
- package/Form.stories.playwright.json +143 -0
- package/FormBuilder/FormBuilder.stories.playwright.json +52 -0
- package/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
- package/MultiplicityField/__stories__/Default.js +3 -3
- package/MultiplicityField/__stories__/WithExactLength.js +3 -3
- package/MultiplicityField/__stories__/WithMaxLength.js +3 -3
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
- package/MultiplicityField/__stories__/WithMinLength.js +3 -3
- package/__stories__/AutoCompleteField.js +14 -4
- package/es/Field/index.js +2 -2
- package/es/FieldArray/FieldArray.stories.playwright.json +213 -28
- package/es/FieldArray/__stories__/Default.js +13 -8
- package/es/FieldArray/__stories__/WithExactLength.js +14 -8
- package/es/FieldArray/index.js +3 -3
- package/es/Form.stories.playwright.json +143 -0
- package/es/FormBuilder/FormBuilder.stories.playwright.json +52 -0
- package/es/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
- package/es/MultiplicityField/__stories__/Default.js +3 -3
- package/es/MultiplicityField/__stories__/WithExactLength.js +3 -3
- package/es/MultiplicityField/__stories__/WithMaxLength.js +3 -3
- package/es/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
- package/es/MultiplicityField/__stories__/WithMinLength.js +3 -3
- package/es/__stories__/AutoCompleteField.js +8 -4
- package/es/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
- package/es/inputs/DateInput/DateInput.stories.playwright.json +72 -0
- package/es/inputs/FileInput/FileInput.stories.playwright.json +75 -0
- package/es/inputs/Input/Input.stories.playwright.json +376 -0
- package/es/inputs/Label/Label.stories.playwright.json +40 -0
- package/es/inputs/Radio/Radio.stories.playwright.json +57 -0
- package/esm/Field/index.js +2 -2
- package/esm/FieldArray/FieldArray.stories.playwright.json +213 -28
- package/esm/FieldArray/__stories__/Default.js +13 -8
- package/esm/FieldArray/__stories__/WithExactLength.js +14 -8
- package/esm/FieldArray/index.js +3 -3
- package/esm/Form.stories.playwright.json +143 -0
- package/esm/FormBuilder/FormBuilder.stories.playwright.json +52 -0
- package/esm/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
- package/esm/MultiplicityField/__stories__/Default.js +3 -3
- package/esm/MultiplicityField/__stories__/WithExactLength.js +3 -3
- package/esm/MultiplicityField/__stories__/WithMaxLength.js +3 -3
- package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
- package/esm/MultiplicityField/__stories__/WithMinLength.js +3 -3
- package/esm/__stories__/AutoCompleteField.js +8 -4
- package/esm/index.js +1 -1
- package/esm/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
- package/esm/inputs/DateInput/DateInput.stories.playwright.json +72 -0
- package/esm/inputs/FileInput/FileInput.stories.playwright.json +75 -0
- package/esm/inputs/Input/Input.stories.playwright.json +376 -0
- package/esm/inputs/Label/Label.stories.playwright.json +40 -0
- package/esm/inputs/Radio/Radio.stories.playwright.json +57 -0
- package/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
- package/inputs/DateInput/DateInput.stories.playwright.json +72 -0
- package/inputs/FileInput/FileInput.stories.playwright.json +75 -0
- package/inputs/Input/Input.stories.playwright.json +376 -0
- package/inputs/Label/Label.stories.playwright.json +40 -0
- package/inputs/Radio/Radio.stories.playwright.json +57 -0
- package/package.json +3 -3
- package/types.d.ts +1 -1
|
@@ -25,7 +25,7 @@ var fields = [{
|
|
|
25
25
|
key: 'string',
|
|
26
26
|
type: 'string',
|
|
27
27
|
label: {
|
|
28
|
-
primary: 'Πεδίο
|
|
28
|
+
primary: 'Πεδίο κειμένου',
|
|
29
29
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
@@ -92,8 +92,8 @@ var fields = [{
|
|
|
92
92
|
type: 'phone_number',
|
|
93
93
|
required: true,
|
|
94
94
|
label: {
|
|
95
|
-
primary: '
|
|
96
|
-
secondary: '
|
|
95
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
96
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
97
97
|
}
|
|
98
98
|
}];
|
|
99
99
|
|
|
@@ -25,7 +25,7 @@ var fields = [{
|
|
|
25
25
|
key: 'string',
|
|
26
26
|
type: 'string',
|
|
27
27
|
label: {
|
|
28
|
-
primary: 'Πεδίο
|
|
28
|
+
primary: 'Πεδίο κειμένου',
|
|
29
29
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
@@ -87,8 +87,8 @@ var fields = [{
|
|
|
87
87
|
type: 'phone_number',
|
|
88
88
|
required: true,
|
|
89
89
|
label: {
|
|
90
|
-
primary: '
|
|
91
|
-
secondary: '
|
|
90
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
91
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
92
92
|
}
|
|
93
93
|
}];
|
|
94
94
|
|
|
@@ -25,7 +25,7 @@ var fields = [{
|
|
|
25
25
|
key: 'string',
|
|
26
26
|
type: 'string',
|
|
27
27
|
label: {
|
|
28
|
-
primary: 'Πεδίο
|
|
28
|
+
primary: 'Πεδίο κειμένου',
|
|
29
29
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
@@ -90,8 +90,8 @@ var fields = [{
|
|
|
90
90
|
type: 'phone_number',
|
|
91
91
|
required: true,
|
|
92
92
|
label: {
|
|
93
|
-
primary: '
|
|
94
|
-
secondary: '
|
|
93
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
94
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
95
95
|
}
|
|
96
96
|
}];
|
|
97
97
|
|
|
@@ -25,7 +25,7 @@ var fields = [{
|
|
|
25
25
|
key: 'string',
|
|
26
26
|
type: 'string',
|
|
27
27
|
label: {
|
|
28
|
-
primary: 'Πεδίο
|
|
28
|
+
primary: 'Πεδίο κειμένου',
|
|
29
29
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
@@ -91,8 +91,8 @@ var fields = [{
|
|
|
91
91
|
type: 'phone_number',
|
|
92
92
|
required: true,
|
|
93
93
|
label: {
|
|
94
|
-
primary: '
|
|
95
|
-
secondary: '
|
|
94
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
95
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
96
96
|
}
|
|
97
97
|
}];
|
|
98
98
|
|
|
@@ -25,7 +25,7 @@ var fields = [{
|
|
|
25
25
|
key: 'string',
|
|
26
26
|
type: 'string',
|
|
27
27
|
label: {
|
|
28
|
-
primary: 'Πεδίο
|
|
28
|
+
primary: 'Πεδίο κειμένου',
|
|
29
29
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
30
30
|
}
|
|
31
31
|
}, {
|
|
@@ -90,8 +90,8 @@ var fields = [{
|
|
|
90
90
|
type: 'phone_number',
|
|
91
91
|
required: true,
|
|
92
92
|
label: {
|
|
93
|
-
primary: '
|
|
94
|
-
secondary: '
|
|
93
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
94
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
95
95
|
}
|
|
96
96
|
}];
|
|
97
97
|
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports.AutoCompleteField = void 0;
|
|
9
11
|
|
|
10
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _FormBuilder = _interopRequireDefault(require("@digigov/form/FormBuilder"));
|
|
13
15
|
|
|
@@ -17,6 +19,10 @@ var _Button = _interopRequireDefault(require("@digigov/ui/core/Button"));
|
|
|
17
19
|
|
|
18
20
|
var _utils = require("@digigov/ui/admin/AutoComplete/utils");
|
|
19
21
|
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
20
26
|
var fields = [{
|
|
21
27
|
key: 'autocomplete',
|
|
22
28
|
label: {
|
|
@@ -39,12 +45,16 @@ var fields = [{
|
|
|
39
45
|
}];
|
|
40
46
|
var initialValues = {};
|
|
41
47
|
|
|
42
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(
|
|
48
|
+
var _ref = /*#__PURE__*/_react["default"].createElement("div", null, "loading");
|
|
49
|
+
|
|
50
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
43
51
|
type: "submit"
|
|
44
52
|
}, "Submit");
|
|
45
53
|
|
|
46
54
|
var AutoCompleteField = function AutoCompleteField() {
|
|
47
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Suspense, {
|
|
56
|
+
fallback: _ref
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormBuilder["default"], {
|
|
48
58
|
fields: fields,
|
|
49
59
|
onSubmit: function onSubmit(data) {
|
|
50
60
|
console.log(data);
|
|
@@ -55,7 +65,7 @@ var AutoCompleteField = function AutoCompleteField() {
|
|
|
55
65
|
key: field.key,
|
|
56
66
|
name: field.key
|
|
57
67
|
});
|
|
58
|
-
}),
|
|
68
|
+
}), _ref2));
|
|
59
69
|
};
|
|
60
70
|
|
|
61
71
|
exports.AutoCompleteField = AutoCompleteField;
|
package/es/Field/index.js
CHANGED
|
@@ -40,7 +40,7 @@ export var Field = function Field(_ref) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
if (calculatedField.type === 'array' && calculatedField.multiplicity
|
|
43
|
+
if (calculatedField.type === 'array' && !calculatedField.multiplicity) {
|
|
44
44
|
calculatedField.name = name;
|
|
45
45
|
return /*#__PURE__*/React.createElement(FieldArray, _extends({
|
|
46
46
|
control: control,
|
|
@@ -50,7 +50,7 @@ export var Field = function Field(_ref) {
|
|
|
50
50
|
}, calculatedField));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
if (calculatedField.type === 'array') {
|
|
53
|
+
if (calculatedField.type === 'array' && calculatedField.multiplicity === true) {
|
|
54
54
|
calculatedField.name = name;
|
|
55
55
|
return /*#__PURE__*/React.createElement(Multiplicity, _extends({
|
|
56
56
|
control: control,
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "click",
|
|
10
10
|
"args": {
|
|
11
|
-
"selector": "
|
|
11
|
+
"selector": "text=Προσθήκη συνυπογράφοντα"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "click",
|
|
16
16
|
"args": {
|
|
17
|
-
"selector": "
|
|
17
|
+
"selector": "text=Συνέχεια"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{
|
|
30
30
|
"name": "click",
|
|
31
31
|
"args": {
|
|
32
|
-
"selector": "
|
|
32
|
+
"selector": "text=Προσθήκη συνυπογράφοντα",
|
|
33
33
|
"options": {
|
|
34
34
|
"clickCount": 2
|
|
35
35
|
}
|
|
@@ -66,38 +66,87 @@
|
|
|
66
66
|
],
|
|
67
67
|
"id": "iMmV-vvS4iNn",
|
|
68
68
|
"title": "Add new items to FieldArray"
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"digigov-form-fieldarray--with-exact-length": {
|
|
73
|
-
"actionSets": [
|
|
69
|
+
},
|
|
74
70
|
{
|
|
75
71
|
"actions": [
|
|
76
72
|
{
|
|
77
73
|
"name": "click",
|
|
78
74
|
"args": {
|
|
79
|
-
"selector": "
|
|
75
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"id": "Lhj8o_MByws7",
|
|
80
|
+
"title": "Validation errors"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"actions": [
|
|
84
|
+
{
|
|
85
|
+
"name": "type",
|
|
86
|
+
"args": {
|
|
87
|
+
"selector": "html>body",
|
|
88
|
+
"text": "hello"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "click",
|
|
93
|
+
"args": {
|
|
94
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "type",
|
|
99
|
+
"args": {
|
|
100
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
101
|
+
"text": "150000496"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "type",
|
|
106
|
+
"args": {
|
|
107
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
108
|
+
"text": "Jon"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "type",
|
|
113
|
+
"args": {
|
|
114
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
115
|
+
"text": "Doe"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "click",
|
|
120
|
+
"args": {
|
|
121
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
80
122
|
}
|
|
81
123
|
},
|
|
82
124
|
{
|
|
83
125
|
"name": "type",
|
|
84
126
|
"args": {
|
|
85
|
-
"selector": "
|
|
86
|
-
"text": "
|
|
127
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
128
|
+
"text": "150000496"
|
|
87
129
|
}
|
|
88
130
|
},
|
|
89
131
|
{
|
|
90
132
|
"name": "type",
|
|
91
133
|
"args": {
|
|
92
|
-
"selector": "
|
|
93
|
-
"text": "
|
|
134
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
135
|
+
"text": "Mar"
|
|
94
136
|
}
|
|
95
137
|
},
|
|
96
138
|
{
|
|
97
139
|
"name": "type",
|
|
98
140
|
"args": {
|
|
99
|
-
"selector": "
|
|
100
|
-
"text": "
|
|
141
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
142
|
+
"text": "P"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "type",
|
|
147
|
+
"args": {
|
|
148
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
149
|
+
"text": "6977777777"
|
|
101
150
|
}
|
|
102
151
|
},
|
|
103
152
|
{
|
|
@@ -105,51 +154,187 @@
|
|
|
105
154
|
"args": {
|
|
106
155
|
"selector": "html>body>div:nth-child(5)>form>button"
|
|
107
156
|
}
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"id": "OCWrR7oFA3YV",
|
|
160
|
+
"title": "add 2 items"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"actions": [
|
|
164
|
+
{
|
|
165
|
+
"name": "type",
|
|
166
|
+
"args": {
|
|
167
|
+
"selector": "html>body",
|
|
168
|
+
"text": "hello"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "click",
|
|
173
|
+
"args": {
|
|
174
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
175
|
+
}
|
|
108
176
|
},
|
|
109
177
|
{
|
|
110
178
|
"name": "type",
|
|
111
179
|
"args": {
|
|
112
|
-
"selector": "
|
|
113
|
-
"text": "
|
|
180
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
181
|
+
"text": "150000496"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "type",
|
|
186
|
+
"args": {
|
|
187
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
188
|
+
"text": "Jon"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "type",
|
|
193
|
+
"args": {
|
|
194
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
195
|
+
"text": "Doe"
|
|
114
196
|
}
|
|
115
197
|
},
|
|
116
198
|
{
|
|
117
199
|
"name": "click",
|
|
118
200
|
"args": {
|
|
119
|
-
"selector": "
|
|
201
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "type",
|
|
206
|
+
"args": {
|
|
207
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
208
|
+
"text": "150000496"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "type",
|
|
213
|
+
"args": {
|
|
214
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
215
|
+
"text": "Mar"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "type",
|
|
220
|
+
"args": {
|
|
221
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
222
|
+
"text": "P"
|
|
120
223
|
}
|
|
121
224
|
},
|
|
122
225
|
{
|
|
123
226
|
"name": "click",
|
|
124
227
|
"args": {
|
|
125
|
-
"selector": "
|
|
228
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(3)>div>fieldset>button"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "type",
|
|
233
|
+
"args": {
|
|
234
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
235
|
+
"text": "6977777777"
|
|
126
236
|
}
|
|
127
237
|
},
|
|
128
238
|
{
|
|
129
239
|
"name": "click",
|
|
130
240
|
"args": {
|
|
131
|
-
"selector": "
|
|
241
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"id": "8ZxUUjo0Yxnr",
|
|
246
|
+
"title": "add 2 items and remove 1"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"digigov-form-fieldarray--with-exact-length": {
|
|
251
|
+
"actionSets": [
|
|
252
|
+
{
|
|
253
|
+
"actions": [
|
|
254
|
+
{
|
|
255
|
+
"name": "click",
|
|
256
|
+
"args": {
|
|
257
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "click",
|
|
262
|
+
"args": {
|
|
263
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"id": "WG3dAbfXa-Sn",
|
|
268
|
+
"title": "validation errors"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"actions": [
|
|
272
|
+
{
|
|
273
|
+
"name": "type",
|
|
274
|
+
"args": {
|
|
275
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(1)>label>input",
|
|
276
|
+
"text": "Hello"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "click",
|
|
281
|
+
"args": {
|
|
282
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
132
283
|
}
|
|
133
284
|
},
|
|
134
285
|
{
|
|
135
286
|
"name": "type",
|
|
136
287
|
"args": {
|
|
137
|
-
"selector": "
|
|
138
|
-
"text": "
|
|
288
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
289
|
+
"text": "150000496"
|
|
139
290
|
}
|
|
140
291
|
},
|
|
141
292
|
{
|
|
142
293
|
"name": "type",
|
|
143
294
|
"args": {
|
|
144
|
-
"selector": "
|
|
145
|
-
"text": "
|
|
295
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
296
|
+
"text": "Μάρω"
|
|
146
297
|
}
|
|
147
298
|
},
|
|
148
299
|
{
|
|
149
300
|
"name": "type",
|
|
150
301
|
"args": {
|
|
151
|
-
"selector": "
|
|
152
|
-
"text": "
|
|
302
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
303
|
+
"text": "Μενεξέ"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "click",
|
|
308
|
+
"args": {
|
|
309
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "type",
|
|
314
|
+
"args": {
|
|
315
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
316
|
+
"text": "150000496"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "type",
|
|
321
|
+
"args": {
|
|
322
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
323
|
+
"text": "Ηλέκτρα"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "type",
|
|
328
|
+
"args": {
|
|
329
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
330
|
+
"text": "Αποστόλου"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "type",
|
|
335
|
+
"args": {
|
|
336
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
337
|
+
"text": "6977654321"
|
|
153
338
|
}
|
|
154
339
|
},
|
|
155
340
|
{
|
|
@@ -159,8 +344,8 @@
|
|
|
159
344
|
}
|
|
160
345
|
}
|
|
161
346
|
],
|
|
162
|
-
"id": "
|
|
163
|
-
"title": "
|
|
347
|
+
"id": "-U0EryxXC-g7",
|
|
348
|
+
"title": "add exact length of items"
|
|
164
349
|
}
|
|
165
350
|
]
|
|
166
351
|
}
|
|
@@ -6,7 +6,7 @@ var fields = [{
|
|
|
6
6
|
key: 'string',
|
|
7
7
|
type: 'string',
|
|
8
8
|
label: {
|
|
9
|
-
primary: 'Πεδίο
|
|
9
|
+
primary: 'Πεδίο κειμένου',
|
|
10
10
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
11
11
|
}
|
|
12
12
|
}, {
|
|
@@ -18,15 +18,20 @@ var fields = [{
|
|
|
18
18
|
},
|
|
19
19
|
extra: {
|
|
20
20
|
label: {
|
|
21
|
+
object: {
|
|
22
|
+
title: 'Συνυπογράφοντας',
|
|
23
|
+
add: 'Προσθήκη συνυπογράφοντα',
|
|
24
|
+
"delete": 'Αφαίρεση συνυπογράφοντος'
|
|
25
|
+
},
|
|
21
26
|
question: {
|
|
22
27
|
title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
|
|
28
|
+
objectLabel: {
|
|
29
|
+
primary: 'Προσθήκη νέου συνυπογράφοντα',
|
|
30
|
+
secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»'
|
|
31
|
+
},
|
|
23
32
|
yes: 'Ναι',
|
|
24
33
|
no: 'Όχι'
|
|
25
|
-
}
|
|
26
|
-
edit: 'Επεξεργασία',
|
|
27
|
-
add: 'Προσθέστε τα στοιχεία του επόμενου συνυπογράφοντα',
|
|
28
|
-
"delete": 'Αφαίρεση συνυπογράφοντος',
|
|
29
|
-
save: 'Αποθήκευση'
|
|
34
|
+
}
|
|
30
35
|
},
|
|
31
36
|
min: 2,
|
|
32
37
|
max: 4,
|
|
@@ -63,8 +68,8 @@ var fields = [{
|
|
|
63
68
|
type: 'phone_number',
|
|
64
69
|
required: true,
|
|
65
70
|
label: {
|
|
66
|
-
primary: '
|
|
67
|
-
secondary: '
|
|
71
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
72
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου'
|
|
68
73
|
}
|
|
69
74
|
}];
|
|
70
75
|
|
|
@@ -6,7 +6,7 @@ var fields = [{
|
|
|
6
6
|
key: 'string',
|
|
7
7
|
type: 'string',
|
|
8
8
|
label: {
|
|
9
|
-
primary: 'Πεδίο
|
|
9
|
+
primary: 'Πεδίο κειμένου',
|
|
10
10
|
secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
|
|
11
11
|
}
|
|
12
12
|
}, {
|
|
@@ -18,15 +18,21 @@ var fields = [{
|
|
|
18
18
|
},
|
|
19
19
|
extra: {
|
|
20
20
|
label: {
|
|
21
|
+
object: {
|
|
22
|
+
title: 'Συνυπογράφοντας',
|
|
23
|
+
title_added: 'Οι συνυπογράφοντες που έχετε προσθέσει',
|
|
24
|
+
add: 'Προσθήκη',
|
|
25
|
+
"delete": 'Αφαίρεση συνυπογράφοντος'
|
|
26
|
+
},
|
|
21
27
|
question: {
|
|
22
28
|
title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
|
|
29
|
+
objectLabel: {
|
|
30
|
+
primary: 'Προσθήκη νέου συνυπογράφοντα',
|
|
31
|
+
secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»'
|
|
32
|
+
},
|
|
23
33
|
yes: 'Ναι',
|
|
24
34
|
no: 'Όχι'
|
|
25
|
-
}
|
|
26
|
-
edit: 'Επεξεργασία',
|
|
27
|
-
add: 'Προσθέστε τα στοιχεία του επόμενου συνυπογράφοντα',
|
|
28
|
-
"delete": 'Αφαίρεση συνυπογράφοντος',
|
|
29
|
-
save: 'Αποθήκευση'
|
|
35
|
+
}
|
|
30
36
|
},
|
|
31
37
|
length: 2,
|
|
32
38
|
of: {
|
|
@@ -62,8 +68,8 @@ var fields = [{
|
|
|
62
68
|
type: 'phone_number',
|
|
63
69
|
required: true,
|
|
64
70
|
label: {
|
|
65
|
-
primary: '
|
|
66
|
-
secondary: '
|
|
71
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
72
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
|
|
67
73
|
}
|
|
68
74
|
}];
|
|
69
75
|
|
package/es/FieldArray/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { FieldsetLabel } from '@digigov/form/Fieldset';
|
|
|
9
9
|
import Fieldset from '@digigov/react-core/Fieldset';
|
|
10
10
|
import FieldContainer from '@digigov/form/Field/FieldContainer';
|
|
11
11
|
export var FieldArray = function FieldArray(_ref) {
|
|
12
|
-
var _customField$extra, _customField$extra4;
|
|
12
|
+
var _customField$extra, _customField$extra$la, _customField$extra4, _customField$extra4$l;
|
|
13
13
|
|
|
14
14
|
var name = _ref.name,
|
|
15
15
|
register = _ref.register,
|
|
@@ -34,7 +34,7 @@ export var FieldArray = function FieldArray(_ref) {
|
|
|
34
34
|
error: formState.isSubmitted && !formState.isSubmitting && error !== null && error !== void 0 && error.message && error ? error : undefined,
|
|
35
35
|
wrapper: "fieldset",
|
|
36
36
|
name: name
|
|
37
|
-
}, fields.length === 0 && /*#__PURE__*/React.createElement(Hint, null, (_customField$extra = customField.extra) === null || _customField$extra === void 0 ? void 0 : _customField$extra.label.object.nothing_added), fields.map(function (field, index) {
|
|
37
|
+
}, fields.length === 0 && /*#__PURE__*/React.createElement(Hint, null, (_customField$extra = customField.extra) === null || _customField$extra === void 0 ? void 0 : (_customField$extra$la = _customField$extra.label.object) === null || _customField$extra$la === void 0 ? void 0 : _customField$extra$la.nothing_added), fields.map(function (field, index) {
|
|
38
38
|
var _customField$extra2, _customField$extra3;
|
|
39
39
|
|
|
40
40
|
return /*#__PURE__*/React.createElement(Card, {
|
|
@@ -60,6 +60,6 @@ export var FieldArray = function FieldArray(_ref) {
|
|
|
60
60
|
ev.preventDefault();
|
|
61
61
|
append({});
|
|
62
62
|
}
|
|
63
|
-
}, (_customField$extra4 = customField.extra) === null || _customField$extra4 === void 0 ? void 0 : _customField$extra4.label.object.add));
|
|
63
|
+
}, (_customField$extra4 = customField.extra) === null || _customField$extra4 === void 0 ? void 0 : (_customField$extra4$l = _customField$extra4.label.object) === null || _customField$extra4$l === void 0 ? void 0 : _customField$extra4$l.add));
|
|
64
64
|
};
|
|
65
65
|
export default FieldArray;
|