@formio/js 5.1.0-dev.6137.1f04cf3 → 5.1.0-dev.6139.a8d2eb1

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,12 +1199,13 @@ class Webform extends NestedDataComponent_1.default {
1199
1199
  return submission;
1200
1200
  }
1201
1201
  normalizeError(error) {
1202
- if (error) {
1203
- if (typeof error === 'object' && 'details' in error) {
1204
- error = error.details;
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;
1205
1206
  }
1206
- if (typeof error === 'string') {
1207
- error = { message: error };
1207
+ if (typeof errorData === 'string') {
1208
+ error = { message: errorData };
1208
1209
  }
1209
1210
  }
1210
1211
  return error;
@@ -1426,16 +1427,17 @@ class Webform extends NestedDataComponent_1.default {
1426
1427
  });
1427
1428
  }
1428
1429
  setServerErrors(error) {
1429
- if (error.details) {
1430
- this.serverErrors = error.details
1430
+ const errorData = error.error;
1431
+ if (errorData.details) {
1432
+ this.serverErrors = errorData.details
1431
1433
  .filter((err) => (err.level ? err.level === 'error' : err))
1432
1434
  .map((err) => {
1433
1435
  err.fromServer = true;
1434
1436
  return err;
1435
1437
  });
1436
1438
  }
1437
- else if (typeof error === 'string') {
1438
- this.serverErrors = [{ fromServer: true, level: 'error', message: error }];
1439
+ else if (typeof errorData === 'string') {
1440
+ this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
1439
1441
  }
1440
1442
  }
1441
1443
  executeSubmit(options) {
@@ -4,9 +4,6 @@ export default FormioUtils;
4
4
  declare const FormioUtils: {
5
5
  Evaluator: import("./Evaluator").DefaultEvaluator;
6
6
  interpolate: (rawTemplate: any, data: any, _options: any) => any;
7
- ConditionOperators: {
8
- [x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/DateGreaterThan").default;
9
- };
10
7
  flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
11
8
  guid: typeof import("@formio/core/lib/utils/formUtil").guid;
12
9
  uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
@@ -25,9 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
28
  Object.defineProperty(exports, "__esModule", { value: true });
32
29
  exports.registerEvaluator = exports.Evaluator = exports.Utils = void 0;
33
30
  const utils = __importStar(require("./utils"));
@@ -35,10 +32,8 @@ const formUtils = __importStar(require("./formUtils"));
35
32
  const Evaluator_1 = require("./Evaluator");
36
33
  Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
37
34
  Object.defineProperty(exports, "registerEvaluator", { enumerable: true, get: function () { return Evaluator_1.registerEvaluator; } });
38
- const conditionOperators_1 = __importDefault(require("./conditionOperators"));
39
35
  const FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator,
40
- interpolate: Evaluator_1.interpolate,
41
- ConditionOperators: conditionOperators_1.default });
36
+ interpolate: Evaluator_1.interpolate });
42
37
  exports.Utils = FormioUtils;
43
38
  if (typeof global === 'object') {
44
39
  global.FormioUtils = FormioUtils;
@@ -1199,12 +1199,13 @@ export default class Webform extends NestedDataComponent {
1199
1199
  return submission;
1200
1200
  }
1201
1201
  normalizeError(error) {
1202
- if (error) {
1203
- if (typeof error === 'object' && 'details' in error) {
1204
- error = error.details;
1202
+ if (error?.error) {
1203
+ let errorData = error.error;
1204
+ if (typeof errorData === 'object' && 'details' in errorData) {
1205
+ error = errorData.details;
1205
1206
  }
1206
- if (typeof error === 'string') {
1207
- error = { message: error };
1207
+ if (typeof errorData === 'string') {
1208
+ error = { message: errorData };
1208
1209
  }
1209
1210
  }
1210
1211
  return error;
@@ -1427,16 +1428,17 @@ export default class Webform extends NestedDataComponent {
1427
1428
  });
1428
1429
  }
1429
1430
  setServerErrors(error) {
1430
- if (error.details) {
1431
- this.serverErrors = error.details
1431
+ const errorData = error.error;
1432
+ if (errorData.details) {
1433
+ this.serverErrors = errorData.details
1432
1434
  .filter((err) => (err.level ? err.level === 'error' : err))
1433
1435
  .map((err) => {
1434
1436
  err.fromServer = true;
1435
1437
  return err;
1436
1438
  });
1437
1439
  }
1438
- else if (typeof error === 'string') {
1439
- this.serverErrors = [{ fromServer: true, level: 'error', message: error }];
1440
+ else if (typeof errorData === 'string') {
1441
+ this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
1440
1442
  }
1441
1443
  }
1442
1444
  executeSubmit(options) {
@@ -4,9 +4,6 @@ export default FormioUtils;
4
4
  declare const FormioUtils: {
5
5
  Evaluator: import("./Evaluator").DefaultEvaluator;
6
6
  interpolate: (rawTemplate: any, data: any, _options: any) => any;
7
- ConditionOperators: {
8
- [x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/DateGreaterThan").default;
9
- };
10
7
  flattenComponents: typeof import("@formio/core/lib/utils/formUtil").flattenComponents;
11
8
  guid: typeof import("@formio/core/lib/utils/formUtil").guid;
12
9
  uniqueName: typeof import("@formio/core/lib/utils/formUtil").uniqueName;
@@ -1,13 +1,11 @@
1
1
  import * as utils from './utils';
2
2
  import * as formUtils from './formUtils';
3
3
  import { Evaluator, registerEvaluator, interpolate } from './Evaluator';
4
- import ConditionOperators from './conditionOperators';
5
4
  const FormioUtils = {
6
5
  ...utils,
7
6
  ...formUtils,
8
7
  Evaluator,
9
- interpolate,
10
- ConditionOperators
8
+ interpolate
11
9
  };
12
10
  if (typeof global === 'object') {
13
11
  global.FormioUtils = FormioUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6137.1f04cf3",
3
+ "version": "5.1.0-dev.6139.a8d2eb1",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {