@formio/js 5.0.0-dev.5803.ec5a0e0 → 5.0.0-dev.5804.10012e4

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.
@@ -257,7 +257,8 @@ class SelectComponent extends ListComponent_1.default {
257
257
  const value = (typeof itemLabel === 'string') ? this.t(itemLabel, { _userInput: true }) : itemLabel;
258
258
  return this.sanitize(value, this.shouldSanitizeValue);
259
259
  }
260
- if (this.component.multiple && lodash_1.default.isArray(this.dataValue) ? this.dataValue.find((val) => value === val) : (this.dataValue === value)) {
260
+ if (this.component.multiple
261
+ && lodash_1.default.isArray(this.dataValue) ? this.dataValue.find((val) => this.normalizeSingleValue(value) === val) : (this.dataValue === value)) {
261
262
  const selectData = this.selectData;
262
263
  if (selectData) {
263
264
  const templateValue = this.component.reference && (value === null || value === void 0 ? void 0 : value._id) ? value._id.toString() : value;
@@ -1499,7 +1500,11 @@ class SelectComponent extends ListComponent_1.default {
1499
1500
  data = data.toString();
1500
1501
  }
1501
1502
  if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
1502
- data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
1503
+ data = data.map(item => {
1504
+ if (this.isBooleanOrNumber(item)) {
1505
+ item = item.toString();
1506
+ }
1507
+ });
1503
1508
  }
1504
1509
  return data;
1505
1510
  };
@@ -7,13 +7,10 @@ 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
- } | {
14
- label: string;
15
- value: number[];
16
- })[];
13
+ }[];
17
14
  let resource: string;
18
15
  let json: string;
19
16
  let url: string;
@@ -21,10 +21,6 @@ exports.default = {
21
21
  }, {
22
22
  'label': 'test',
23
23
  'value': 'test'
24
- },
25
- {
26
- 'label': '1',
27
- 'value': [1, 2, 3]
28
24
  }],
29
25
  'resource': '',
30
26
  'json': '',
@@ -257,7 +257,8 @@ export default class SelectComponent extends ListComponent {
257
257
  const value = (typeof itemLabel === 'string') ? this.t(itemLabel, { _userInput: true }) : itemLabel;
258
258
  return this.sanitize(value, this.shouldSanitizeValue);
259
259
  }
260
- if (this.component.multiple && _.isArray(this.dataValue) ? this.dataValue.find((val) => value === val) : (this.dataValue === value)) {
260
+ if (this.component.multiple
261
+ && _.isArray(this.dataValue) ? this.dataValue.find((val) => this.normalizeSingleValue(value) === val) : (this.dataValue === value)) {
261
262
  const selectData = this.selectData;
262
263
  if (selectData) {
263
264
  const templateValue = this.component.reference && value?._id ? value._id.toString() : value;
@@ -1526,7 +1527,11 @@ export default class SelectComponent extends ListComponent {
1526
1527
  data = data.toString();
1527
1528
  }
1528
1529
  if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
1529
- data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
1530
+ data = data.map(item => {
1531
+ if (this.isBooleanOrNumber(item)) {
1532
+ item = item.toString();
1533
+ }
1534
+ });
1530
1535
  }
1531
1536
  return data;
1532
1537
  };
@@ -7,13 +7,10 @@ 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
- } | {
14
- label: string;
15
- value: number[];
16
- })[];
13
+ }[];
17
14
  let resource: string;
18
15
  let json: string;
19
16
  let url: string;
@@ -19,10 +19,6 @@ export default {
19
19
  }, {
20
20
  'label': 'test',
21
21
  'value': 'test'
22
- },
23
- {
24
- 'label': '1',
25
- 'value': [1, 2, 3]
26
22
  }],
27
23
  'resource': '',
28
24
  'json': '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5803.ec5a0e0",
3
+ "version": "5.0.0-dev.5804.10012e4",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {