@digigov/form 0.9.0 → 0.10.0

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.
@@ -17,6 +17,7 @@ import FieldObject from '@digigov/form/FieldObject';
17
17
  export var AddObjects = function AddObjects(_ref) {
18
18
  var name = _ref.name,
19
19
  fields = _ref.fields,
20
+ formState = _ref.formState,
20
21
  extra = _ref.extra,
21
22
  append = _ref.append,
22
23
  remove = _ref.remove,
@@ -57,6 +58,7 @@ export var AddObjects = function AddObjects(_ref) {
57
58
  name: currentName,
58
59
  error: error && error[currentIndex],
59
60
  register: register,
61
+ formState: formState,
60
62
  control: control
61
63
  }, extra === null || extra === void 0 ? void 0 : extra.of, {
62
64
  label: (extra === null || extra === void 0 ? void 0 : extra.label.question.objectLabel) || (extra === null || extra === void 0 ? void 0 : extra.of.label)
@@ -73,6 +73,7 @@ export var Multiplicity = function Multiplicity(_ref) {
73
73
  register: register,
74
74
  control: control,
75
75
  fields: fields,
76
+ formState: formState,
76
77
  error: error,
77
78
  stashedObjects: stashedObjects,
78
79
  extra: extra,
@@ -2,7 +2,7 @@ import React 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';
5
- import { results } from '@digigov/ui/admin/AutoComplete/__stories__/utils';
5
+ import { results } from '@digigov/ui/admin/AutoComplete/utils';
6
6
  var fields = [{
7
7
  key: 'autocomplete',
8
8
  label: {
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v0.9.0
1
+ /** @license Digigov v0.10.0
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -32,8 +32,11 @@ export var Checkboxes = function Checkboxes(_ref) {
32
32
  newValue = value.filter(function (val) {
33
33
  return val !== optionValue;
34
34
  });
35
- }
35
+ } // reset value to undefined instead of an empty array
36
+ // so the error state mechanism can throw validation errors
36
37
 
38
+
39
+ if (newValue.length === 0) newValue = undefined;
37
40
  onChange(newValue);
38
41
  };
39
42
  };
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-form-inputs-select--default": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "selectHtmlOption",
10
+ "args": {
11
+ "selector": "html>body>div:nth-child(5)>form>div>label>select",
12
+ "values": "greece"
13
+ }
14
+ }
15
+ ],
16
+ "id": "nGzokC6y1_5m",
17
+ "title": "select option"
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -48,8 +48,11 @@ var Checkboxes = function Checkboxes(_ref) {
48
48
  newValue = value.filter(function (val) {
49
49
  return val !== optionValue;
50
50
  });
51
- }
51
+ } // reset value to undefined instead of an empty array
52
+ // so the error state mechanism can throw validation errors
52
53
 
54
+
55
+ if (newValue.length === 0) newValue = undefined;
53
56
  onChange(newValue);
54
57
  };
55
58
  };
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-form-inputs-select--default": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "selectHtmlOption",
10
+ "args": {
11
+ "selector": "html>body>div:nth-child(5)>form>div>label>select",
12
+ "values": "greece"
13
+ }
14
+ }
15
+ ],
16
+ "id": "nGzokC6y1_5m",
17
+ "title": "select option"
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/form",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "@digigov form builder",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
@@ -18,9 +18,9 @@
18
18
  "@hookform/resolvers": "2.9.6"
19
19
  },
20
20
  "peerDependencies": {
21
- "@digigov/ui": "0.26.7",
22
- "@digigov/react-core": "0.16.5",
23
- "@digigov/react-extensions": "0.18.4",
21
+ "@digigov/ui": "0.27.0",
22
+ "@digigov/react-core": "0.17.0",
23
+ "@digigov/react-extensions": "0.19.0",
24
24
  "clsx": "1.1.1",
25
25
  "react": "^16.8.0 || ^17.0.0",
26
26
  "react-dom": "^16.8.0 || ^17.0.0"