@digigov/form 0.10.4 → 0.10.6

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 (63) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/Field/index.js +2 -2
  3. package/FieldArray/FieldArray.stories.playwright.json +213 -28
  4. package/FieldArray/__stories__/Default.js +13 -8
  5. package/FieldArray/__stories__/WithExactLength.js +14 -8
  6. package/FieldArray/index.js +3 -3
  7. package/Form.stories.playwright.json +143 -0
  8. package/FormBuilder/FormBuilder.stories.playwright.json +52 -0
  9. package/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
  10. package/MultiplicityField/__stories__/Default.js +3 -3
  11. package/MultiplicityField/__stories__/WithExactLength.js +3 -3
  12. package/MultiplicityField/__stories__/WithMaxLength.js +3 -3
  13. package/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
  14. package/MultiplicityField/__stories__/WithMinLength.js +3 -3
  15. package/__stories__/AutoCompleteField.js +14 -4
  16. package/es/Field/index.js +2 -2
  17. package/es/FieldArray/FieldArray.stories.playwright.json +213 -28
  18. package/es/FieldArray/__stories__/Default.js +13 -8
  19. package/es/FieldArray/__stories__/WithExactLength.js +14 -8
  20. package/es/FieldArray/index.js +3 -3
  21. package/es/Form.stories.playwright.json +143 -0
  22. package/es/FormBuilder/FormBuilder.stories.playwright.json +52 -0
  23. package/es/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
  24. package/es/MultiplicityField/__stories__/Default.js +3 -3
  25. package/es/MultiplicityField/__stories__/WithExactLength.js +3 -3
  26. package/es/MultiplicityField/__stories__/WithMaxLength.js +3 -3
  27. package/es/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
  28. package/es/MultiplicityField/__stories__/WithMinLength.js +3 -3
  29. package/es/__stories__/AutoCompleteField.js +8 -4
  30. package/es/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
  31. package/es/inputs/DateInput/DateInput.stories.playwright.json +72 -0
  32. package/es/inputs/FileInput/FileInput.stories.playwright.json +75 -0
  33. package/es/inputs/Input/Input.stories.playwright.json +376 -0
  34. package/es/inputs/Label/Label.stories.playwright.json +40 -0
  35. package/es/inputs/Radio/Radio.stories.playwright.json +57 -0
  36. package/esm/Field/index.js +2 -2
  37. package/esm/FieldArray/FieldArray.stories.playwright.json +213 -28
  38. package/esm/FieldArray/__stories__/Default.js +13 -8
  39. package/esm/FieldArray/__stories__/WithExactLength.js +14 -8
  40. package/esm/FieldArray/index.js +3 -3
  41. package/esm/Form.stories.playwright.json +143 -0
  42. package/esm/FormBuilder/FormBuilder.stories.playwright.json +52 -0
  43. package/esm/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
  44. package/esm/MultiplicityField/__stories__/Default.js +3 -3
  45. package/esm/MultiplicityField/__stories__/WithExactLength.js +3 -3
  46. package/esm/MultiplicityField/__stories__/WithMaxLength.js +3 -3
  47. package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +3 -3
  48. package/esm/MultiplicityField/__stories__/WithMinLength.js +3 -3
  49. package/esm/__stories__/AutoCompleteField.js +8 -4
  50. package/esm/index.js +1 -1
  51. package/esm/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
  52. package/esm/inputs/DateInput/DateInput.stories.playwright.json +72 -0
  53. package/esm/inputs/FileInput/FileInput.stories.playwright.json +75 -0
  54. package/esm/inputs/Input/Input.stories.playwright.json +376 -0
  55. package/esm/inputs/Label/Label.stories.playwright.json +40 -0
  56. package/esm/inputs/Radio/Radio.stories.playwright.json +57 -0
  57. package/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
  58. package/inputs/DateInput/DateInput.stories.playwright.json +72 -0
  59. package/inputs/FileInput/FileInput.stories.playwright.json +75 -0
  60. package/inputs/Input/Input.stories.playwright.json +376 -0
  61. package/inputs/Label/Label.stories.playwright.json +40 -0
  62. package/inputs/Radio/Radio.stories.playwright.json +57 -0
  63. package/package.json +4 -4
@@ -6,7 +6,7 @@ var fields = [{
6
6
  key: 'string',
7
7
  type: 'string',
8
8
  label: {
9
- primary: 'Πεδίο 1',
9
+ primary: 'Πεδίο κειμένου',
10
10
  secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
11
11
  }
12
12
  }, {
@@ -73,8 +73,8 @@ var fields = [{
73
73
  type: 'phone_number',
74
74
  required: true,
75
75
  label: {
76
- primary: 'Πεδίο 2',
77
- secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
76
+ primary: 'Σταθερό τηλέφωνο',
77
+ secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
78
78
  }
79
79
  }];
80
80
 
@@ -6,7 +6,7 @@ var fields = [{
6
6
  key: 'string',
7
7
  type: 'string',
8
8
  label: {
9
- primary: 'Πεδίο 1',
9
+ primary: 'Πεδίο κειμένου',
10
10
  secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
11
11
  }
12
12
  }, {
@@ -68,8 +68,8 @@ var fields = [{
68
68
  type: 'phone_number',
69
69
  required: true,
70
70
  label: {
71
- primary: 'Πεδίο 2',
72
- secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
71
+ primary: 'Σταθερό τηλέφωνο',
72
+ secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
73
73
  }
74
74
  }];
75
75
 
@@ -6,7 +6,7 @@ var fields = [{
6
6
  key: 'string',
7
7
  type: 'string',
8
8
  label: {
9
- primary: 'Πεδίο 1',
9
+ primary: 'Πεδίο κειμένου',
10
10
  secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
11
11
  }
12
12
  }, {
@@ -71,8 +71,8 @@ var fields = [{
71
71
  type: 'phone_number',
72
72
  required: true,
73
73
  label: {
74
- primary: 'Πεδίο 2',
75
- secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
74
+ primary: 'Σταθερό τηλέφωνο',
75
+ secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
76
76
  }
77
77
  }];
78
78
 
@@ -6,7 +6,7 @@ var fields = [{
6
6
  key: 'string',
7
7
  type: 'string',
8
8
  label: {
9
- primary: 'Πεδίο 1',
9
+ primary: 'Πεδίο κειμένου',
10
10
  secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
11
11
  }
12
12
  }, {
@@ -72,8 +72,8 @@ var fields = [{
72
72
  type: 'phone_number',
73
73
  required: true,
74
74
  label: {
75
- primary: 'Πεδίο 2',
76
- secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
75
+ primary: 'Σταθερό τηλέφωνο',
76
+ secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
77
77
  }
78
78
  }];
79
79
 
@@ -6,7 +6,7 @@ var fields = [{
6
6
  key: 'string',
7
7
  type: 'string',
8
8
  label: {
9
- primary: 'Πεδίο 1',
9
+ primary: 'Πεδίο κειμένου',
10
10
  secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
11
11
  }
12
12
  }, {
@@ -71,8 +71,8 @@ var fields = [{
71
71
  type: 'phone_number',
72
72
  required: true,
73
73
  label: {
74
- primary: 'Πεδίο 2',
75
- secondary: 'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας'
74
+ primary: 'Σταθερό τηλέφωνο',
75
+ secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας'
76
76
  }
77
77
  }];
78
78
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { Suspense } from 'react';
2
2
  import FormBuilder from '@digigov/form/FormBuilder';
3
3
  import { Field } from '@digigov/form/Field';
4
4
  import Button from '@digigov/ui/core/Button';
@@ -25,12 +25,16 @@ var fields = [{
25
25
  }];
26
26
  var initialValues = {};
27
27
 
28
- var _ref = /*#__PURE__*/React.createElement(Button, {
28
+ var _ref = /*#__PURE__*/React.createElement("div", null, "loading");
29
+
30
+ var _ref2 = /*#__PURE__*/React.createElement(Button, {
29
31
  type: "submit"
30
32
  }, "Submit");
31
33
 
32
34
  export var AutoCompleteField = function AutoCompleteField() {
33
- return /*#__PURE__*/React.createElement(FormBuilder, {
35
+ return /*#__PURE__*/React.createElement(Suspense, {
36
+ fallback: _ref
37
+ }, /*#__PURE__*/React.createElement(FormBuilder, {
34
38
  fields: fields,
35
39
  onSubmit: function onSubmit(data) {
36
40
  console.log(data);
@@ -41,5 +45,5 @@ export var AutoCompleteField = function AutoCompleteField() {
41
45
  key: field.key,
42
46
  name: field.key
43
47
  });
44
- }), _ref);
48
+ }), _ref2));
45
49
  };
@@ -0,0 +1,69 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-form-inputs-checkboxes--default": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "click",
10
+ "args": {
11
+ "selector": "html>body>div:nth-child(5)>form>button"
12
+ }
13
+ }
14
+ ],
15
+ "id": "6mm9fbbYacA3",
16
+ "title": "show validation error"
17
+ },
18
+ {
19
+ "actions": [
20
+ {
21
+ "name": "keyboard.press",
22
+ "args": {
23
+ "key": "Tab"
24
+ }
25
+ },
26
+ {
27
+ "name": "keyboard.press",
28
+ "args": {
29
+ "key": "Tab"
30
+ }
31
+ },
32
+ {
33
+ "name": "keyboard.press",
34
+ "args": {
35
+ "key": "Space"
36
+ }
37
+ },
38
+ {
39
+ "name": "keyboard.press",
40
+ "args": {
41
+ "key": "Tab"
42
+ }
43
+ },
44
+ {
45
+ "name": "keyboard.press",
46
+ "args": {
47
+ "key": "Space"
48
+ }
49
+ },
50
+ {
51
+ "name": "click",
52
+ "args": {
53
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input"
54
+ }
55
+ },
56
+ {
57
+ "name": "click",
58
+ "args": {
59
+ "selector": "html>body>div:nth-child(5)>form>button"
60
+ }
61
+ }
62
+ ],
63
+ "id": "hBiOJ8xaQSWv",
64
+ "title": "Focus and check using keyboard, click box and submit"
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-form-inputs-dateinput--default": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "keyboard.press",
10
+ "args": {
11
+ "key": "Tab"
12
+ }
13
+ },
14
+ {
15
+ "name": "keyboard.press",
16
+ "args": {
17
+ "key": "Tab"
18
+ }
19
+ },
20
+ {
21
+ "name": "keyboard.press",
22
+ "args": {
23
+ "key": "Tab"
24
+ }
25
+ }
26
+ ],
27
+ "id": "n5PFnx7RcuJV",
28
+ "title": "navigate with keyboard"
29
+ },
30
+ {
31
+ "actions": [
32
+ {
33
+ "name": "click",
34
+ "args": {
35
+ "selector": "html>body>div:nth-child(5)>form>button"
36
+ }
37
+ },
38
+ {
39
+ "name": "type",
40
+ "args": {
41
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input",
42
+ "text": "33"
43
+ }
44
+ },
45
+ {
46
+ "name": "type",
47
+ "args": {
48
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(2)>label>input",
49
+ "text": "33"
50
+ }
51
+ },
52
+ {
53
+ "name": "type",
54
+ "args": {
55
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(3)>label>input",
56
+ "text": "3333"
57
+ }
58
+ },
59
+ {
60
+ "name": "click",
61
+ "args": {
62
+ "selector": "html>body>div:nth-child(5)>form>button"
63
+ }
64
+ }
65
+ ],
66
+ "id": "Ck7_BFdgITMe",
67
+ "title": "show validation errors"
68
+ }
69
+ ]
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-form-inputs-fileinput--default": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "click",
10
+ "args": {
11
+ "selector": "html>body>div:nth-child(5)>form>button"
12
+ }
13
+ }
14
+ ],
15
+ "id": "c4Jhtju9oCJZ",
16
+ "title": "show validation error"
17
+ },
18
+ {
19
+ "actions": [
20
+ {
21
+ "name": "setFiles",
22
+ "args": {
23
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
24
+ "file": {
25
+ "name": "arxeio.txt",
26
+ "size": 200
27
+ }
28
+ }
29
+ },
30
+ {
31
+ "name": "click",
32
+ "args": {
33
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>button"
34
+ }
35
+ }
36
+ ],
37
+ "id": "WPIcVVWz-299",
38
+ "title": "add file and remove"
39
+ },
40
+ {
41
+ "actions": [
42
+ {
43
+ "name": "setFiles",
44
+ "args": {
45
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
46
+ "file": {
47
+ "name": "arxeio.txt",
48
+ "size": 200
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "name": "setFiles",
54
+ "args": {
55
+ "selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
56
+ "file": {
57
+ "name": "neo_arxeio.txt",
58
+ "size": 200
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "name": "click",
64
+ "args": {
65
+ "selector": "html>body>div:nth-child(5)>form>button"
66
+ }
67
+ }
68
+ ],
69
+ "id": "inSBFd25dzkC",
70
+ "title": "add file, replace and remove"
71
+ }
72
+ ]
73
+ }
74
+ }
75
+ }