@formio/js 5.1.0-dev.6139.a8d2eb1 → 5.1.0-dev.6143.f9fee80

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.
@@ -1199,13 +1199,12 @@ class Webform extends NestedDataComponent_1.default {
1199
1199
  return submission;
1200
1200
  }
1201
1201
  normalizeError(error) {
1202
- if (error === null || error === void 0 ? void 0 : error.error) {
1203
- let errorData = error.error;
1204
- if (typeof errorData === 'object' && 'details' in errorData) {
1205
- error = errorData.details;
1202
+ if (error) {
1203
+ if (typeof error === 'object' && 'details' in error) {
1204
+ error = error.details;
1206
1205
  }
1207
- if (typeof errorData === 'string') {
1208
- error = { message: errorData };
1206
+ if (typeof error === 'string') {
1207
+ error = { message: error };
1209
1208
  }
1210
1209
  }
1211
1210
  return error;
@@ -1427,17 +1426,16 @@ class Webform extends NestedDataComponent_1.default {
1427
1426
  });
1428
1427
  }
1429
1428
  setServerErrors(error) {
1430
- const errorData = error.error;
1431
- if (errorData.details) {
1432
- this.serverErrors = errorData.details
1429
+ if (error.details) {
1430
+ this.serverErrors = error.details
1433
1431
  .filter((err) => (err.level ? err.level === 'error' : err))
1434
1432
  .map((err) => {
1435
1433
  err.fromServer = true;
1436
1434
  return err;
1437
1435
  });
1438
1436
  }
1439
- else if (typeof errorData === 'string') {
1440
- this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
1437
+ else if (typeof error === 'string') {
1438
+ this.serverErrors = [{ fromServer: true, level: 'error', message: error }];
1441
1439
  }
1442
1440
  }
1443
1441
  executeSubmit(options) {
@@ -265,9 +265,7 @@ class CalendarWidget extends InputWidget_1.default {
265
265
  }
266
266
  // If the component is a textfield that does not have timezone information included in the string value then skip
267
267
  // the timezone offset
268
- if (this.component.type === 'textfield' && !(0, utils_1.hasEncodedTimezone)(value)) {
269
- this.settings.skipOffset = true;
270
- }
268
+ this.settings.skipOffset = this.component.type === 'textfield' && !(0, utils_1.hasEncodedTimezone)(value);
271
269
  if (value) {
272
270
  if (!saveAsText && this.settings.readOnly) {
273
271
  this.calendar.setDate((0, utils_1.dayjsDate)(value, this.valueFormat, this.timezone).format(), false);
@@ -1199,13 +1199,12 @@ export default class Webform extends NestedDataComponent {
1199
1199
  return submission;
1200
1200
  }
1201
1201
  normalizeError(error) {
1202
- if (error?.error) {
1203
- let errorData = error.error;
1204
- if (typeof errorData === 'object' && 'details' in errorData) {
1205
- error = errorData.details;
1202
+ if (error) {
1203
+ if (typeof error === 'object' && 'details' in error) {
1204
+ error = error.details;
1206
1205
  }
1207
- if (typeof errorData === 'string') {
1208
- error = { message: errorData };
1206
+ if (typeof error === 'string') {
1207
+ error = { message: error };
1209
1208
  }
1210
1209
  }
1211
1210
  return error;
@@ -1428,17 +1427,16 @@ export default class Webform extends NestedDataComponent {
1428
1427
  });
1429
1428
  }
1430
1429
  setServerErrors(error) {
1431
- const errorData = error.error;
1432
- if (errorData.details) {
1433
- this.serverErrors = errorData.details
1430
+ if (error.details) {
1431
+ this.serverErrors = error.details
1434
1432
  .filter((err) => (err.level ? err.level === 'error' : err))
1435
1433
  .map((err) => {
1436
1434
  err.fromServer = true;
1437
1435
  return err;
1438
1436
  });
1439
1437
  }
1440
- else if (typeof errorData === 'string') {
1441
- this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
1438
+ else if (typeof error === 'string') {
1439
+ this.serverErrors = [{ fromServer: true, level: 'error', message: error }];
1442
1440
  }
1443
1441
  }
1444
1442
  executeSubmit(options) {
@@ -257,9 +257,7 @@ export default class CalendarWidget extends InputWidget {
257
257
  }
258
258
  // If the component is a textfield that does not have timezone information included in the string value then skip
259
259
  // the timezone offset
260
- if (this.component.type === 'textfield' && !hasEncodedTimezone(value)) {
261
- this.settings.skipOffset = true;
262
- }
260
+ this.settings.skipOffset = this.component.type === 'textfield' && !hasEncodedTimezone(value);
263
261
  if (value) {
264
262
  if (!saveAsText && this.settings.readOnly) {
265
263
  this.calendar.setDate(dayjsDate(value, this.valueFormat, this.timezone).format(), false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6139.a8d2eb1",
3
+ "version": "5.1.0-dev.6143.f9fee80",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {