@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.
- package/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Webform.js +11 -9
- package/lib/cjs/utils/index.d.ts +0 -3
- package/lib/cjs/utils/index.js +1 -6
- package/lib/mjs/Webform.js +11 -9
- package/lib/mjs/utils/index.d.ts +0 -3
- package/lib/mjs/utils/index.js +1 -3
- package/package.json +1 -1
package/lib/cjs/Webform.js
CHANGED
@@ -1199,12 +1199,13 @@ class Webform extends NestedDataComponent_1.default {
|
|
1199
1199
|
return submission;
|
1200
1200
|
}
|
1201
1201
|
normalizeError(error) {
|
1202
|
-
if (error) {
|
1203
|
-
|
1204
|
-
|
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
|
1207
|
-
error = { message:
|
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
|
-
|
1430
|
-
|
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
|
1438
|
-
this.serverErrors = [{ fromServer: true, level: 'error', message:
|
1439
|
+
else if (typeof errorData === 'string') {
|
1440
|
+
this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
|
1439
1441
|
}
|
1440
1442
|
}
|
1441
1443
|
executeSubmit(options) {
|
package/lib/cjs/utils/index.d.ts
CHANGED
@@ -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;
|
package/lib/cjs/utils/index.js
CHANGED
@@ -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;
|
package/lib/mjs/Webform.js
CHANGED
@@ -1199,12 +1199,13 @@ export default class Webform extends NestedDataComponent {
|
|
1199
1199
|
return submission;
|
1200
1200
|
}
|
1201
1201
|
normalizeError(error) {
|
1202
|
-
if (error) {
|
1203
|
-
|
1204
|
-
|
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
|
1207
|
-
error = { message:
|
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
|
-
|
1431
|
-
|
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
|
1439
|
-
this.serverErrors = [{ fromServer: true, level: 'error', message:
|
1440
|
+
else if (typeof errorData === 'string') {
|
1441
|
+
this.serverErrors = [{ fromServer: true, level: 'error', message: errorData }];
|
1440
1442
|
}
|
1441
1443
|
}
|
1442
1444
|
executeSubmit(options) {
|
package/lib/mjs/utils/index.d.ts
CHANGED
@@ -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;
|
package/lib/mjs/utils/index.js
CHANGED
@@ -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;
|