@formio/js 5.0.0-rc.80 → 5.0.0-rc.81

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 (38) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +7 -7
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.full.js +8 -8
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  10. package/dist/formio.js +2 -2
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +2 -2
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  16. package/lib/cjs/components/_classes/component/Component.js +1 -1
  17. package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -0
  18. package/lib/cjs/components/editgrid/fixtures/comp18.d.ts +38 -0
  19. package/lib/cjs/components/editgrid/fixtures/comp18.js +74 -0
  20. package/lib/cjs/components/editgrid/fixtures/index.d.ts +8 -7
  21. package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
  22. package/lib/cjs/components/select/Select.js +3 -6
  23. package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +36 -2
  24. package/lib/cjs/components/select/editForm/Select.edit.data.js +29 -10
  25. package/lib/cjs/components/select/fixtures/comp4.d.ts +5 -2
  26. package/lib/cjs/components/select/fixtures/comp4.js +4 -0
  27. package/lib/mjs/components/_classes/component/Component.js +1 -1
  28. package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -0
  29. package/lib/mjs/components/editgrid/fixtures/comp18.d.ts +38 -0
  30. package/lib/mjs/components/editgrid/fixtures/comp18.js +72 -0
  31. package/lib/mjs/components/editgrid/fixtures/index.d.ts +8 -7
  32. package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
  33. package/lib/mjs/components/select/Select.js +3 -6
  34. package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +36 -2
  35. package/lib/mjs/components/select/editForm/Select.edit.data.js +27 -8
  36. package/lib/mjs/components/select/fixtures/comp4.d.ts +5 -2
  37. package/lib/mjs/components/select/fixtures/comp4.js +4 -0
  38. package/package.json +2 -2
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
22
22
 
23
- /*! formiojs v5.0.0-rc.80 | https://unpkg.com/formiojs@5.0.0-rc.80/LICENSE.txt */
23
+ /*! formiojs v5.0.0-rc.81 | https://unpkg.com/formiojs@5.0.0-rc.81/LICENSE.txt */
24
24
 
25
25
  /**
26
26
  * @license
@@ -2187,7 +2187,7 @@ class Component extends Element_1.default {
2187
2187
  this.addClass(this.getElement(), 'formio-modified');
2188
2188
  }
2189
2189
  // If we are supposed to validate on blur, then don't trigger validation yet.
2190
- if (this.component.validateOn === 'blur') {
2190
+ if (this.component.validateOn === 'blur' || this.component.validateOn === 'submit') {
2191
2191
  flags.noValidate = true;
2192
2192
  }
2193
2193
  if (this.component.onChange) {
@@ -37,6 +37,9 @@ class Multivalue extends Field_1.default {
37
37
  if (this.component.storeas === 'string') {
38
38
  return super.normalizeValue(value.join(this.delimiter || ''), flags);
39
39
  }
40
+ if (this.component.type === 'hidden' && value.length > 1) {
41
+ return super.normalizeValue(value, flags);
42
+ }
40
43
  return super.normalizeValue(value[0] || emptyValue, flags);
41
44
  }
42
45
  else {
@@ -0,0 +1,38 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ let name: string;
4
+ let path: string;
5
+ let type: string;
6
+ let display: string;
7
+ let components: {
8
+ label: string;
9
+ tableView: boolean;
10
+ validateWhenHidden: boolean;
11
+ rowDrafts: boolean;
12
+ key: string;
13
+ validateOn: string;
14
+ type: string;
15
+ displayAsTable: boolean;
16
+ input: boolean;
17
+ components: {
18
+ label: string;
19
+ widget: string;
20
+ tableView: boolean;
21
+ data: {
22
+ values: {
23
+ label: string;
24
+ value: string;
25
+ }[];
26
+ };
27
+ validate: {
28
+ required: boolean;
29
+ };
30
+ validateWhenHidden: boolean;
31
+ validateOn: string;
32
+ key: string;
33
+ type: string;
34
+ input: boolean;
35
+ }[];
36
+ }[];
37
+ }
38
+ export default _default;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ title: "validate_submit",
5
+ name: "validate_submit",
6
+ path: "validate_submit",
7
+ type: "form",
8
+ display: "form",
9
+ components: [
10
+ {
11
+ label: "Edit Grid",
12
+ tableView: false,
13
+ validateWhenHidden: false,
14
+ rowDrafts: false,
15
+ key: "editGrid",
16
+ validateOn: 'submit',
17
+ type: "editgrid",
18
+ displayAsTable: false,
19
+ input: true,
20
+ components: [
21
+ {
22
+ label: "Select",
23
+ widget: "choicesjs",
24
+ tableView: true,
25
+ data: {
26
+ values: [
27
+ {
28
+ label: "one",
29
+ value: "one",
30
+ },
31
+ {
32
+ label: "two",
33
+ value: "two",
34
+ },
35
+ ],
36
+ },
37
+ validate: {
38
+ required: true,
39
+ },
40
+ validateWhenHidden: false,
41
+ validateOn: 'submit',
42
+ key: "select1",
43
+ type: "select",
44
+ input: true,
45
+ },
46
+ {
47
+ label: "Select",
48
+ widget: "choicesjs",
49
+ tableView: true,
50
+ data: {
51
+ values: [
52
+ {
53
+ label: "three",
54
+ value: "three",
55
+ },
56
+ {
57
+ label: "four",
58
+ value: "four",
59
+ },
60
+ ],
61
+ },
62
+ validate: {
63
+ required: true,
64
+ },
65
+ validateWhenHidden: false,
66
+ validateOn: 'submit',
67
+ key: "select2",
68
+ type: "select",
69
+ input: true,
70
+ },
71
+ ],
72
+ },
73
+ ],
74
+ };
@@ -1,6 +1,12 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
+ import comp4 from './comp4';
5
+ import comp5 from './comp5';
6
+ import comp6 from './comp6';
7
+ import comp7 from './comp7';
8
+ import comp8 from './comp8';
9
+ import comp9 from './comp9';
4
10
  import comp10 from './comp10';
5
11
  import comp11 from './comp11';
6
12
  import comp12 from './comp12';
@@ -8,13 +14,8 @@ import comp13 from './comp13';
8
14
  import comp14 from './comp14';
9
15
  import comp15 from './comp15';
10
16
  import comp16 from './comp16';
11
- import comp4 from './comp4';
12
- import comp5 from './comp5';
13
- import comp6 from './comp6';
14
- import comp7 from './comp7';
15
- import comp8 from './comp8';
16
- import comp9 from './comp9';
17
+ import comp18 from './comp18';
17
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
18
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue };
21
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp18 = exports.comp17 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
9
  const comp2_1 = __importDefault(require("./comp2"));
@@ -36,9 +36,15 @@ const comp15_1 = __importDefault(require("./comp15"));
36
36
  exports.comp15 = comp15_1.default;
37
37
  const comp16_1 = __importDefault(require("./comp16"));
38
38
  exports.comp16 = comp16_1.default;
39
+ const comp17_1 = __importDefault(require("./comp17"));
40
+ exports.comp17 = comp17_1.default;
41
+ const comp18_1 = __importDefault(require("./comp18"));
42
+ exports.comp18 = comp18_1.default;
39
43
  const comp_with_conditions_and_openWhenEmpty_1 = __importDefault(require("./comp-with-conditions-and-openWhenEmpty"));
40
44
  exports.withOpenWhenEmptyAndConditions = comp_with_conditions_and_openWhenEmpty_1.default;
41
45
  const comp_openWhenEmpty_1 = __importDefault(require("./comp-openWhenEmpty"));
42
46
  exports.compOpenWhenEmpty = comp_openWhenEmpty_1.default;
43
47
  const comp_with_custom_default_value_1 = __importDefault(require("./comp-with-custom-default-value"));
44
48
  exports.compWithCustomDefaultValue = comp_with_custom_default_value_1.default;
49
+ const comp_test_events_1 = __importDefault(require("./comp-test-events"));
50
+ exports.compTestEvents = comp_test_events_1.default;
@@ -258,7 +258,8 @@ class SelectComponent extends ListComponent_1.default {
258
258
  const value = (typeof itemLabel === 'string') ? this.t(itemLabel, { _userInput: true }) : itemLabel;
259
259
  return this.sanitize(value, this.shouldSanitizeValue);
260
260
  }
261
- if (this.component.multiple && lodash_1.default.isArray(this.dataValue) ? this.dataValue.find((val) => value === val) : (this.dataValue === value)) {
261
+ if (this.component.multiple
262
+ && lodash_1.default.isArray(this.dataValue) ? this.dataValue.find((val) => this.normalizeSingleValue(value) === val) : (this.dataValue === value)) {
262
263
  const selectData = this.selectData;
263
264
  if (selectData) {
264
265
  const templateValue = this.component.reference && (value === null || value === void 0 ? void 0 : value._id) ? value._id.toString() : value;
@@ -1500,11 +1501,7 @@ class SelectComponent extends ListComponent_1.default {
1500
1501
  data = data.toString();
1501
1502
  }
1502
1503
  if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
1503
- data = data.map(item => {
1504
- if (this.isBooleanOrNumber(item)) {
1505
- item = item.toString();
1506
- }
1507
- });
1504
+ data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
1508
1505
  }
1509
1506
  return data;
1510
1507
  };
@@ -1102,13 +1102,47 @@ declare const _default: ({
1102
1102
  conditional: {
1103
1103
  json: {
1104
1104
  and: ({
1105
- '!==': ({
1105
+ var: string;
1106
+ '==='?: undefined;
1107
+ '!=='?: undefined;
1108
+ or?: undefined;
1109
+ } | {
1110
+ '===': (boolean | {
1106
1111
  var: string;
1107
- } | null)[];
1112
+ })[];
1113
+ var?: undefined;
1114
+ '!=='?: undefined;
1115
+ or?: undefined;
1108
1116
  } | {
1109
1117
  '!==': (string | {
1110
1118
  var: string;
1111
1119
  })[];
1120
+ var?: undefined;
1121
+ '==='?: undefined;
1122
+ or?: undefined;
1123
+ } | {
1124
+ or: ({
1125
+ '===': (string | {
1126
+ var: string;
1127
+ })[];
1128
+ and?: undefined;
1129
+ } | {
1130
+ and: ({
1131
+ '===': (string | {
1132
+ var: string;
1133
+ })[];
1134
+ '!=='?: undefined;
1135
+ } | {
1136
+ '!==': (string | {
1137
+ var: string;
1138
+ })[];
1139
+ '==='?: undefined;
1140
+ })[];
1141
+ '==='?: undefined;
1142
+ })[];
1143
+ var?: undefined;
1144
+ '==='?: undefined;
1145
+ '!=='?: undefined;
1112
1146
  })[];
1113
1147
  '==='?: undefined;
1114
1148
  in?: undefined;
@@ -31,18 +31,22 @@ const calculateSelectData = (context) => {
31
31
  const setSelectData = (context) => {
32
32
  // Wait before downloadedResources will be set
33
33
  setTimeout(() => {
34
- var _a;
34
+ var _a, _b;
35
35
  const { instance, data } = context;
36
- const selectDataComponent = instance === null || instance === void 0 ? void 0 : instance.root.getComponent('selectData');
36
+ const selectDataComponent = (_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent('selectData');
37
+ // clear selectData if conditions are not met or clearing default value
38
+ if (selectDataComponent && (!selectDataComponent.visible || !data.defaultValue)) {
39
+ selectDataComponent.setValue(null, { resetValue: true });
40
+ return;
41
+ }
37
42
  // nothing can set if don't have downloaded resources
38
- if (!selectDataComponent || !instance.getValue() || !((_a = instance.downloadedResources) === null || _a === void 0 ? void 0 : _a.length)) {
43
+ if (!selectDataComponent || !instance.getValue() || !((_b = instance.downloadedResources) === null || _b === void 0 ? void 0 : _b.length)) {
39
44
  return;
40
45
  }
41
- // if valueProperty is not provided, we have entire object
42
46
  const shouldCalculateUrlData = data.dataSrc === 'url' && data.data.url && data.valueProperty;
43
47
  const shouldCalculateResourceData = data.dataSrc === 'resource' && data.data.resource && data.valueProperty;
44
- const newValue = shouldCalculateUrlData || shouldCalculateResourceData ? calculateSelectData(context) : undefined;
45
- selectDataComponent.setValue(newValue);
48
+ const newValue = shouldCalculateUrlData || shouldCalculateResourceData ? calculateSelectData(context) : null;
49
+ selectDataComponent.setValue(newValue, { resetValue: newValue === null });
46
50
  }, 0);
47
51
  };
48
52
  exports.default = [
@@ -684,10 +688,25 @@ exports.default = [
684
688
  {
685
689
  key: 'selectData',
686
690
  conditional: {
687
- json: { 'and': [
688
- { '!==': [{ var: 'data.valueProperty' }, null] },
689
- { '!==': [{ var: 'data.valueProperty' }, ''] },
690
- ] },
691
+ json: {
692
+ and: [
693
+ { var: 'data.valueProperty' },
694
+ { '===': [{ var: 'data.lazyLoad' }, true] },
695
+ { '!==': [{ var: 'data.widget' }, 'html5'] },
696
+ {
697
+ or: [
698
+ { '===': [{ var: 'data.dataSrc' }, 'url'] },
699
+ {
700
+ and: [
701
+ { '===': [{ var: 'data.dataSrc' }, 'resource'] },
702
+ // 'data' means entire object from resource will be used
703
+ { '!==': [{ var: 'data.valueProperty' }, 'data'] },
704
+ ],
705
+ }
706
+ ]
707
+ }
708
+ ]
709
+ },
691
710
  },
692
711
  },
693
712
  {
@@ -7,10 +7,13 @@ declare namespace _default {
7
7
  export let multiple: boolean;
8
8
  export let dataSrc: string;
9
9
  export namespace data {
10
- let values: {
10
+ let values: ({
11
11
  label: string;
12
12
  value: string;
13
- }[];
13
+ } | {
14
+ label: string;
15
+ value: number[];
16
+ })[];
14
17
  let resource: string;
15
18
  let json: string;
16
19
  let url: string;
@@ -21,6 +21,10 @@ exports.default = {
21
21
  }, {
22
22
  'label': 'test',
23
23
  'value': 'test'
24
+ },
25
+ {
26
+ 'label': '1',
27
+ 'value': [1, 2, 3]
24
28
  }],
25
29
  'resource': '',
26
30
  'json': '',
@@ -2151,7 +2151,7 @@ export default class Component extends Element {
2151
2151
  this.addClass(this.getElement(), 'formio-modified');
2152
2152
  }
2153
2153
  // If we are supposed to validate on blur, then don't trigger validation yet.
2154
- if (this.component.validateOn === 'blur') {
2154
+ if (this.component.validateOn === 'blur' || this.component.validateOn === 'submit') {
2155
2155
  flags.noValidate = true;
2156
2156
  }
2157
2157
  if (this.component.onChange) {
@@ -32,6 +32,9 @@ export default class Multivalue extends Field {
32
32
  if (this.component.storeas === 'string') {
33
33
  return super.normalizeValue(value.join(this.delimiter || ''), flags);
34
34
  }
35
+ if (this.component.type === 'hidden' && value.length > 1) {
36
+ return super.normalizeValue(value, flags);
37
+ }
35
38
  return super.normalizeValue(value[0] || emptyValue, flags);
36
39
  }
37
40
  else {
@@ -0,0 +1,38 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ let name: string;
4
+ let path: string;
5
+ let type: string;
6
+ let display: string;
7
+ let components: {
8
+ label: string;
9
+ tableView: boolean;
10
+ validateWhenHidden: boolean;
11
+ rowDrafts: boolean;
12
+ key: string;
13
+ validateOn: string;
14
+ type: string;
15
+ displayAsTable: boolean;
16
+ input: boolean;
17
+ components: {
18
+ label: string;
19
+ widget: string;
20
+ tableView: boolean;
21
+ data: {
22
+ values: {
23
+ label: string;
24
+ value: string;
25
+ }[];
26
+ };
27
+ validate: {
28
+ required: boolean;
29
+ };
30
+ validateWhenHidden: boolean;
31
+ validateOn: string;
32
+ key: string;
33
+ type: string;
34
+ input: boolean;
35
+ }[];
36
+ }[];
37
+ }
38
+ export default _default;
@@ -0,0 +1,72 @@
1
+ export default {
2
+ title: "validate_submit",
3
+ name: "validate_submit",
4
+ path: "validate_submit",
5
+ type: "form",
6
+ display: "form",
7
+ components: [
8
+ {
9
+ label: "Edit Grid",
10
+ tableView: false,
11
+ validateWhenHidden: false,
12
+ rowDrafts: false,
13
+ key: "editGrid",
14
+ validateOn: 'submit',
15
+ type: "editgrid",
16
+ displayAsTable: false,
17
+ input: true,
18
+ components: [
19
+ {
20
+ label: "Select",
21
+ widget: "choicesjs",
22
+ tableView: true,
23
+ data: {
24
+ values: [
25
+ {
26
+ label: "one",
27
+ value: "one",
28
+ },
29
+ {
30
+ label: "two",
31
+ value: "two",
32
+ },
33
+ ],
34
+ },
35
+ validate: {
36
+ required: true,
37
+ },
38
+ validateWhenHidden: false,
39
+ validateOn: 'submit',
40
+ key: "select1",
41
+ type: "select",
42
+ input: true,
43
+ },
44
+ {
45
+ label: "Select",
46
+ widget: "choicesjs",
47
+ tableView: true,
48
+ data: {
49
+ values: [
50
+ {
51
+ label: "three",
52
+ value: "three",
53
+ },
54
+ {
55
+ label: "four",
56
+ value: "four",
57
+ },
58
+ ],
59
+ },
60
+ validate: {
61
+ required: true,
62
+ },
63
+ validateWhenHidden: false,
64
+ validateOn: 'submit',
65
+ key: "select2",
66
+ type: "select",
67
+ input: true,
68
+ },
69
+ ],
70
+ },
71
+ ],
72
+ };
@@ -1,6 +1,12 @@
1
1
  import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
+ import comp4 from './comp4';
5
+ import comp5 from './comp5';
6
+ import comp6 from './comp6';
7
+ import comp7 from './comp7';
8
+ import comp8 from './comp8';
9
+ import comp9 from './comp9';
4
10
  import comp10 from './comp10';
5
11
  import comp11 from './comp11';
6
12
  import comp12 from './comp12';
@@ -8,13 +14,8 @@ import comp13 from './comp13';
8
14
  import comp14 from './comp14';
9
15
  import comp15 from './comp15';
10
16
  import comp16 from './comp16';
11
- import comp4 from './comp4';
12
- import comp5 from './comp5';
13
- import comp6 from './comp6';
14
- import comp7 from './comp7';
15
- import comp8 from './comp8';
16
- import comp9 from './comp9';
17
+ import comp18 from './comp18';
17
18
  import compOpenWhenEmpty from './comp-openWhenEmpty';
18
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
19
20
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue };
21
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -14,7 +14,10 @@ import comp13 from './comp13';
14
14
  import comp14 from './comp14';
15
15
  import comp15 from './comp15';
16
16
  import comp16 from './comp16';
17
+ import comp17 from './comp17';
18
+ import comp18 from './comp18';
17
19
  import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
18
20
  import compOpenWhenEmpty from './comp-openWhenEmpty';
19
21
  import compWithCustomDefaultValue from './comp-with-custom-default-value';
20
- export { comp1, comp2, comp3, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp4, comp5, comp6, comp7, comp8, comp9, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue };
22
+ import compTestEvents from './comp-test-events';
23
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
@@ -258,7 +258,8 @@ export default class SelectComponent extends ListComponent {
258
258
  const value = (typeof itemLabel === 'string') ? this.t(itemLabel, { _userInput: true }) : itemLabel;
259
259
  return this.sanitize(value, this.shouldSanitizeValue);
260
260
  }
261
- if (this.component.multiple && _.isArray(this.dataValue) ? this.dataValue.find((val) => value === val) : (this.dataValue === value)) {
261
+ if (this.component.multiple
262
+ && _.isArray(this.dataValue) ? this.dataValue.find((val) => this.normalizeSingleValue(value) === val) : (this.dataValue === value)) {
262
263
  const selectData = this.selectData;
263
264
  if (selectData) {
264
265
  const templateValue = this.component.reference && value?._id ? value._id.toString() : value;
@@ -1527,11 +1528,7 @@ export default class SelectComponent extends ListComponent {
1527
1528
  data = data.toString();
1528
1529
  }
1529
1530
  if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
1530
- data = data.map(item => {
1531
- if (this.isBooleanOrNumber(item)) {
1532
- item = item.toString();
1533
- }
1534
- });
1531
+ data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
1535
1532
  }
1536
1533
  return data;
1537
1534
  };
@@ -1102,13 +1102,47 @@ declare const _default: ({
1102
1102
  conditional: {
1103
1103
  json: {
1104
1104
  and: ({
1105
- '!==': ({
1105
+ var: string;
1106
+ '==='?: undefined;
1107
+ '!=='?: undefined;
1108
+ or?: undefined;
1109
+ } | {
1110
+ '===': (boolean | {
1106
1111
  var: string;
1107
- } | null)[];
1112
+ })[];
1113
+ var?: undefined;
1114
+ '!=='?: undefined;
1115
+ or?: undefined;
1108
1116
  } | {
1109
1117
  '!==': (string | {
1110
1118
  var: string;
1111
1119
  })[];
1120
+ var?: undefined;
1121
+ '==='?: undefined;
1122
+ or?: undefined;
1123
+ } | {
1124
+ or: ({
1125
+ '===': (string | {
1126
+ var: string;
1127
+ })[];
1128
+ and?: undefined;
1129
+ } | {
1130
+ and: ({
1131
+ '===': (string | {
1132
+ var: string;
1133
+ })[];
1134
+ '!=='?: undefined;
1135
+ } | {
1136
+ '!==': (string | {
1137
+ var: string;
1138
+ })[];
1139
+ '==='?: undefined;
1140
+ })[];
1141
+ '==='?: undefined;
1142
+ })[];
1143
+ var?: undefined;
1144
+ '==='?: undefined;
1145
+ '!=='?: undefined;
1112
1146
  })[];
1113
1147
  '==='?: undefined;
1114
1148
  in?: undefined;