@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.
- 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/lib/cjs/Webform.js +9 -11
- package/lib/cjs/widgets/CalendarWidget.js +1 -3
- package/lib/mjs/Webform.js +9 -11
- package/lib/mjs/widgets/CalendarWidget.js +1 -3
- package/package.json +1 -1
package/lib/cjs/Webform.js
CHANGED
@@ -1199,13 +1199,12 @@ class Webform extends NestedDataComponent_1.default {
|
|
1199
1199
|
return submission;
|
1200
1200
|
}
|
1201
1201
|
normalizeError(error) {
|
1202
|
-
if (error
|
1203
|
-
|
1204
|
-
|
1205
|
-
error = errorData.details;
|
1202
|
+
if (error) {
|
1203
|
+
if (typeof error === 'object' && 'details' in error) {
|
1204
|
+
error = error.details;
|
1206
1205
|
}
|
1207
|
-
if (typeof
|
1208
|
-
error = { message:
|
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
|
-
|
1431
|
-
|
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
|
1440
|
-
this.serverErrors = [{ fromServer: true, level: 'error', message:
|
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
|
-
|
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);
|
package/lib/mjs/Webform.js
CHANGED
@@ -1199,13 +1199,12 @@ export default class Webform extends NestedDataComponent {
|
|
1199
1199
|
return submission;
|
1200
1200
|
}
|
1201
1201
|
normalizeError(error) {
|
1202
|
-
if (error
|
1203
|
-
|
1204
|
-
|
1205
|
-
error = errorData.details;
|
1202
|
+
if (error) {
|
1203
|
+
if (typeof error === 'object' && 'details' in error) {
|
1204
|
+
error = error.details;
|
1206
1205
|
}
|
1207
|
-
if (typeof
|
1208
|
-
error = { message:
|
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
|
-
|
1432
|
-
|
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
|
1441
|
-
this.serverErrors = [{ fromServer: true, level: 'error', message:
|
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
|
-
|
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);
|