@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.
- package/dist/formio.form.js +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +1 -1
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/select/Select.js +7 -2
- package/lib/cjs/components/select/fixtures/comp4.d.ts +2 -5
- package/lib/cjs/components/select/fixtures/comp4.js +0 -4
- package/lib/mjs/components/select/Select.js +7 -2
- package/lib/mjs/components/select/fixtures/comp4.d.ts +2 -5
- package/lib/mjs/components/select/fixtures/comp4.js +0 -4
- package/package.json +1 -1
|
@@ -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
|
|
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 =>
|
|
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;
|
|
@@ -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
|
|
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 =>
|
|
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;
|