@formio/js 5.0.0-dev.5801.effff2f → 5.0.0-dev.5803.ec5a0e0
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 +4 -4
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +4 -4
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/components/select/Select.js +1 -5
- package/lib/cjs/components/select/fixtures/comp4.d.ts +5 -2
- package/lib/cjs/components/select/fixtures/comp4.js +4 -0
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +2 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/mjs/components/select/Select.js +1 -5
- package/lib/mjs/components/select/fixtures/comp4.d.ts +5 -2
- package/lib/mjs/components/select/fixtures/comp4.js +4 -0
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +1 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/package.json +1 -1
|
@@ -1499,11 +1499,7 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1499
1499
|
data = data.toString();
|
|
1500
1500
|
}
|
|
1501
1501
|
if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
|
|
1502
|
-
data = data.map(item =>
|
|
1503
|
-
if (this.isBooleanOrNumber(item)) {
|
|
1504
|
-
item = item.toString();
|
|
1505
|
-
}
|
|
1506
|
-
});
|
|
1502
|
+
data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
|
|
1507
1503
|
}
|
|
1508
1504
|
return data;
|
|
1509
1505
|
};
|
|
@@ -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;
|
|
@@ -19,12 +19,13 @@ class DateGeaterThan extends ConditionOperator_1.default {
|
|
|
19
19
|
return { date, comparedDate };
|
|
20
20
|
}
|
|
21
21
|
execute(options, functionName = 'isAfter') {
|
|
22
|
+
var _a;
|
|
22
23
|
const { value, instance, conditionComponentPath } = options;
|
|
23
24
|
if (!value) {
|
|
24
25
|
return false;
|
|
25
26
|
}
|
|
26
27
|
let conditionTriggerComponent = null;
|
|
27
|
-
if (instance
|
|
28
|
+
if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
|
|
28
29
|
conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
29
30
|
}
|
|
30
31
|
if (conditionTriggerComponent && conditionTriggerComponent.isPartialDay && conditionTriggerComponent.isPartialDay(value)) {
|
|
@@ -18,8 +18,8 @@ class IsEmptyValue extends ConditionOperator_1.default {
|
|
|
18
18
|
execute({ value, instance, conditionComponentPath }) {
|
|
19
19
|
var _a;
|
|
20
20
|
const isEmptyValue = lodash_1.default.isEmpty(lodash_1.default.isNumber(value) ? String(value) : value);
|
|
21
|
-
if (instance
|
|
22
|
-
const conditionTriggerComponent =
|
|
21
|
+
if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
|
|
22
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
23
23
|
return (conditionTriggerComponent === null || conditionTriggerComponent === void 0 ? void 0 : conditionTriggerComponent.isEmpty) ? conditionTriggerComponent.isEmpty() : isEmptyValue;
|
|
24
24
|
}
|
|
25
25
|
return isEmptyValue;
|
|
@@ -22,8 +22,8 @@ class IsEqualTo extends ConditionOperator_1.default {
|
|
|
22
22
|
// eslint-disable-next-line no-empty
|
|
23
23
|
catch (e) { }
|
|
24
24
|
}
|
|
25
|
-
if (instance
|
|
26
|
-
const conditionTriggerComponent =
|
|
25
|
+
if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
|
|
26
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
27
27
|
if (conditionTriggerComponent
|
|
28
28
|
&& (0, utils_1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component)
|
|
29
29
|
&& ((_b = conditionTriggerComponent.component) === null || _b === void 0 ? void 0 : _b.template)) {
|
|
@@ -1526,11 +1526,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
1526
1526
|
data = data.toString();
|
|
1527
1527
|
}
|
|
1528
1528
|
if (Array.isArray(data) && data.some(item => this.isBooleanOrNumber(item))) {
|
|
1529
|
-
data = data.map(item =>
|
|
1530
|
-
if (this.isBooleanOrNumber(item)) {
|
|
1531
|
-
item = item.toString();
|
|
1532
|
-
}
|
|
1533
|
-
});
|
|
1529
|
+
data = data.map(item => this.isBooleanOrNumber(item) ? item.toString() : item);
|
|
1534
1530
|
}
|
|
1535
1531
|
return data;
|
|
1536
1532
|
};
|
|
@@ -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;
|
|
@@ -19,7 +19,7 @@ export default class DateGeaterThan extends ConditionOperator {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
let conditionTriggerComponent = null;
|
|
22
|
-
if (instance
|
|
22
|
+
if (instance?.root?.getComponent) {
|
|
23
23
|
conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
24
24
|
}
|
|
25
25
|
if (conditionTriggerComponent && conditionTriggerComponent.isPartialDay && conditionTriggerComponent.isPartialDay(value)) {
|
|
@@ -12,8 +12,8 @@ export default class IsEmptyValue extends ConditionOperator {
|
|
|
12
12
|
}
|
|
13
13
|
execute({ value, instance, conditionComponentPath }) {
|
|
14
14
|
const isEmptyValue = _.isEmpty(_.isNumber(value) ? String(value) : value);
|
|
15
|
-
if (instance
|
|
16
|
-
const conditionTriggerComponent = instance.root
|
|
15
|
+
if (instance?.root?.getComponent) {
|
|
16
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
17
17
|
return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue;
|
|
18
18
|
}
|
|
19
19
|
return isEmptyValue;
|
|
@@ -16,8 +16,8 @@ export default class IsEqualTo extends ConditionOperator {
|
|
|
16
16
|
// eslint-disable-next-line no-empty
|
|
17
17
|
catch (e) { }
|
|
18
18
|
}
|
|
19
|
-
if (instance
|
|
20
|
-
const conditionTriggerComponent = instance.root
|
|
19
|
+
if (instance?.root?.getComponent) {
|
|
20
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
21
21
|
if (conditionTriggerComponent
|
|
22
22
|
&& isSelectResourceWithObjectValue(conditionTriggerComponent.component)
|
|
23
23
|
&& conditionTriggerComponent.component?.template) {
|