@formio/js 5.0.0-dev.5801.effff2f → 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;
@@ -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 && instance.root) {
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 && instance.root) {
22
- const conditionTriggerComponent = ((_a = instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) && instance.root.getComponent(conditionComponentPath);
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 && instance.root) {
26
- const conditionTriggerComponent = ((_a = instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) && instance.root.getComponent(conditionComponentPath);
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)) {
@@ -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;
@@ -19,7 +19,7 @@ export default class DateGeaterThan extends ConditionOperator {
19
19
  return false;
20
20
  }
21
21
  let conditionTriggerComponent = null;
22
- if (instance && instance.root) {
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 && instance.root) {
16
- const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
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 && instance.root) {
20
- const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5801.effff2f",
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": {