@formio/js 5.0.0-dev.5894.b7db66e → 5.0.0-dev.5896.56bf2bd

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.
@@ -312,12 +312,13 @@ class RadioComponent extends ListComponent_1.default {
312
312
  .then((response) => {
313
313
  this.loading = false;
314
314
  this.setItems(response);
315
- this.optionsLoaded = true;
316
- this.redraw();
317
315
  })
318
316
  .catch((err) => {
319
- this.optionsLoaded = true;
320
317
  this.handleLoadingError(err);
318
+ })
319
+ .finally(() => {
320
+ this.optionsLoaded = true;
321
+ this.redraw();
321
322
  });
322
323
  }
323
324
  loadItemsFromMetadata() {
@@ -341,9 +342,8 @@ class RadioComponent extends ListComponent_1.default {
341
342
  label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
342
343
  };
343
344
  listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
344
- if ((this.component.valueProperty || !this.isRadio) && (lodash_1.default.isUndefined(valueAtProperty) ||
345
- (!this.isRadio && lodash_1.default.isObject(valueAtProperty)) ||
346
- (!this.isRadio && lodash_1.default.isBoolean(valueAtProperty)))) {
345
+ const value = this.loadedOptions[i].value;
346
+ if (!this.isRadio && (lodash_1.default.isObject(value) || lodash_1.default.isBoolean(value) || lodash_1.default.isUndefined(value))) {
347
347
  this.loadedOptions[i].invalid = true;
348
348
  }
349
349
  });
@@ -1239,7 +1239,7 @@ class SelectComponent extends ListComponent_1.default {
1239
1239
  }
1240
1240
  lodash_1.default.set(submission.metadata.selectData, this.path, templateData);
1241
1241
  }
1242
- if (flags.resetValue && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission)) {
1242
+ if (flags.resetValue && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submission) && !this.options.readOnly) {
1243
1243
  const submission = this.root.submission;
1244
1244
  if (!submission.metadata) {
1245
1245
  submission.metadata = {};
@@ -312,12 +312,13 @@ export default class RadioComponent extends ListComponent {
312
312
  .then((response) => {
313
313
  this.loading = false;
314
314
  this.setItems(response);
315
- this.optionsLoaded = true;
316
- this.redraw();
317
315
  })
318
316
  .catch((err) => {
319
- this.optionsLoaded = true;
320
317
  this.handleLoadingError(err);
318
+ })
319
+ .finally(() => {
320
+ this.optionsLoaded = true;
321
+ this.redraw();
321
322
  });
322
323
  }
323
324
  loadItemsFromMetadata() {
@@ -341,9 +342,8 @@ export default class RadioComponent extends ListComponent {
341
342
  label: this.component.valueProperty ? this.itemTemplate(item, valueAtProperty) : this.itemTemplate(item, item, i)
342
343
  };
343
344
  listData.push(this.templateData[this.component.valueProperty ? valueAtProperty : i]);
344
- if ((this.component.valueProperty || !this.isRadio) && (_.isUndefined(valueAtProperty) ||
345
- (!this.isRadio && _.isObject(valueAtProperty)) ||
346
- (!this.isRadio && _.isBoolean(valueAtProperty)))) {
345
+ const value = this.loadedOptions[i].value;
346
+ if (!this.isRadio && (_.isObject(value) || _.isBoolean(value) || _.isUndefined(value))) {
347
347
  this.loadedOptions[i].invalid = true;
348
348
  }
349
349
  });
@@ -1267,7 +1267,7 @@ export default class SelectComponent extends ListComponent {
1267
1267
  }
1268
1268
  _.set(submission.metadata.selectData, this.path, templateData);
1269
1269
  }
1270
- if (flags.resetValue && this.root?.submission) {
1270
+ if (flags.resetValue && this.root?.submission && !this.options.readOnly) {
1271
1271
  const submission = this.root.submission;
1272
1272
  if (!submission.metadata) {
1273
1273
  submission.metadata = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5894.b7db66e",
3
+ "version": "5.0.0-dev.5896.56bf2bd",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {