@formio/js 5.0.0-dev.5829.167a315 → 5.0.0-dev.5829.56191dc
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 +6 -6
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +6 -6
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Webform.js +1 -1
- package/lib/cjs/Wizard.d.ts +1 -0
- package/lib/cjs/Wizard.js +12 -1
- package/lib/cjs/components/textarea/TextArea.d.ts +7 -0
- package/lib/cjs/components/textarea/TextArea.js +17 -0
- package/lib/mjs/Webform.js +1 -1
- package/lib/mjs/Wizard.d.ts +1 -0
- package/lib/mjs/Wizard.js +12 -1
- package/lib/mjs/components/textarea/TextArea.d.ts +7 -0
- package/lib/mjs/components/textarea/TextArea.js +17 -0
- package/package.json +2 -2
package/lib/cjs/Webform.js
CHANGED
|
@@ -1253,7 +1253,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1253
1253
|
const errors = shouldValidate
|
|
1254
1254
|
? this.validate(value.data, Object.assign(Object.assign({}, flags), { noValidate: false, process: 'change' }))
|
|
1255
1255
|
: [];
|
|
1256
|
-
value.isValid = errors.length === 0;
|
|
1256
|
+
value.isValid = (errors || []).filter(err => !err.fromServer).length === 0;
|
|
1257
1257
|
this.loading = false;
|
|
1258
1258
|
if (this.submitted) {
|
|
1259
1259
|
// show server errors while they are not cleaned/fixed
|
package/lib/cjs/Wizard.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ declare class Wizard extends Webform {
|
|
|
105
105
|
pageId(page: any): any;
|
|
106
106
|
onChange(flags: any, changed: any, modified: any, changes: any): void;
|
|
107
107
|
checkValidity(data: any, dirty: any, row: any, currentPageOnly: any, childErrors?: any[]): any;
|
|
108
|
+
showErrors(errors: any, triggerEvent: any): void | any[];
|
|
108
109
|
focusOnComponent(key: any): void | Promise<void>;
|
|
109
110
|
}
|
|
110
111
|
declare namespace Wizard {
|
package/lib/cjs/Wizard.js
CHANGED
|
@@ -924,6 +924,17 @@ class Wizard extends Webform_1.default {
|
|
|
924
924
|
}
|
|
925
925
|
return super.errors;
|
|
926
926
|
}
|
|
927
|
+
showErrors(errors, triggerEvent) {
|
|
928
|
+
if (this.hasExtraPages) {
|
|
929
|
+
this.subWizards.forEach((subWizard) => {
|
|
930
|
+
if (Array.isArray(subWizard.errors)) {
|
|
931
|
+
errors = [...errors, ...subWizard.errors];
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
;
|
|
936
|
+
return super.showErrors(errors, triggerEvent);
|
|
937
|
+
}
|
|
927
938
|
focusOnComponent(key) {
|
|
928
939
|
const component = this.getComponent(key);
|
|
929
940
|
if (component) {
|
|
@@ -931,7 +942,7 @@ class Wizard extends Webform_1.default {
|
|
|
931
942
|
while (!(topPanel.parent instanceof Wizard)) {
|
|
932
943
|
topPanel = topPanel.parent;
|
|
933
944
|
}
|
|
934
|
-
const pageIndex = this.pages.findIndex(page => page === topPanel);
|
|
945
|
+
const pageIndex = this.pages.findIndex(page => page.id === topPanel.id);
|
|
935
946
|
if (pageIndex >= 0) {
|
|
936
947
|
const page = this.pages[pageIndex];
|
|
937
948
|
if (page && page !== this.currentPage) {
|
|
@@ -19,6 +19,13 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
|
19
19
|
setContent(element: any, content: any, forceSanitize: any): void;
|
|
20
20
|
setReadOnlyValue(value: any, index: any): void;
|
|
21
21
|
get isJsonValue(): any;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
|
24
|
+
* @param {*} value - The value to normalize
|
|
25
|
+
* @returns {*} - Returns the normalized value
|
|
26
|
+
*/
|
|
27
|
+
normalizeValue(value: any): any;
|
|
28
|
+
normalizeSingleValue(value: any): any;
|
|
22
29
|
setConvertedValue(value: any, index: any): any;
|
|
23
30
|
setAsyncConvertedValue(value: any): Promise<any>;
|
|
24
31
|
setImagesUrl(images: any): Promise<any>;
|
|
@@ -309,6 +309,23 @@ class TextAreaComponent extends TextField_1.default {
|
|
|
309
309
|
get isJsonValue() {
|
|
310
310
|
return this.component.as && this.component.as === 'json';
|
|
311
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
|
314
|
+
* @param {*} value - The value to normalize
|
|
315
|
+
* @returns {*} - Returns the normalized value
|
|
316
|
+
*/
|
|
317
|
+
normalizeValue(value) {
|
|
318
|
+
if (this.component.multiple && Array.isArray(value)) {
|
|
319
|
+
return value.map((singleValue) => this.normalizeSingleValue(singleValue));
|
|
320
|
+
}
|
|
321
|
+
return super.normalizeValue(this.normalizeSingleValue(value));
|
|
322
|
+
}
|
|
323
|
+
normalizeSingleValue(value) {
|
|
324
|
+
if (lodash_1.default.isNil(value)) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
return this.isJsonValue ? value : String(value);
|
|
328
|
+
}
|
|
312
329
|
isSingleInputValue() {
|
|
313
330
|
return !this.component.multiple;
|
|
314
331
|
}
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -1259,7 +1259,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
1259
1259
|
process: 'change'
|
|
1260
1260
|
})
|
|
1261
1261
|
: [];
|
|
1262
|
-
value.isValid = errors.length === 0;
|
|
1262
|
+
value.isValid = (errors || []).filter(err => !err.fromServer).length === 0;
|
|
1263
1263
|
this.loading = false;
|
|
1264
1264
|
if (this.submitted) {
|
|
1265
1265
|
// show server errors while they are not cleaned/fixed
|
package/lib/mjs/Wizard.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ declare class Wizard extends Webform {
|
|
|
105
105
|
pageId(page: any): any;
|
|
106
106
|
onChange(flags: any, changed: any, modified: any, changes: any): void;
|
|
107
107
|
checkValidity(data: any, dirty: any, row: any, currentPageOnly: any, childErrors?: any[]): any;
|
|
108
|
+
showErrors(errors: any, triggerEvent: any): void | any[];
|
|
108
109
|
focusOnComponent(key: any): void | Promise<void>;
|
|
109
110
|
}
|
|
110
111
|
declare namespace Wizard {
|
package/lib/mjs/Wizard.js
CHANGED
|
@@ -911,6 +911,17 @@ export default class Wizard extends Webform {
|
|
|
911
911
|
}
|
|
912
912
|
return super.errors;
|
|
913
913
|
}
|
|
914
|
+
showErrors(errors, triggerEvent) {
|
|
915
|
+
if (this.hasExtraPages) {
|
|
916
|
+
this.subWizards.forEach((subWizard) => {
|
|
917
|
+
if (Array.isArray(subWizard.errors)) {
|
|
918
|
+
errors = [...errors, ...subWizard.errors];
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
;
|
|
923
|
+
return super.showErrors(errors, triggerEvent);
|
|
924
|
+
}
|
|
914
925
|
focusOnComponent(key) {
|
|
915
926
|
const component = this.getComponent(key);
|
|
916
927
|
if (component) {
|
|
@@ -918,7 +929,7 @@ export default class Wizard extends Webform {
|
|
|
918
929
|
while (!(topPanel.parent instanceof Wizard)) {
|
|
919
930
|
topPanel = topPanel.parent;
|
|
920
931
|
}
|
|
921
|
-
const pageIndex = this.pages.findIndex(page => page === topPanel);
|
|
932
|
+
const pageIndex = this.pages.findIndex(page => page.id === topPanel.id);
|
|
922
933
|
if (pageIndex >= 0) {
|
|
923
934
|
const page = this.pages[pageIndex];
|
|
924
935
|
if (page && page !== this.currentPage) {
|
|
@@ -19,6 +19,13 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
|
19
19
|
setContent(element: any, content: any, forceSanitize: any): void;
|
|
20
20
|
setReadOnlyValue(value: any, index: any): void;
|
|
21
21
|
get isJsonValue(): any;
|
|
22
|
+
/**
|
|
23
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
|
24
|
+
* @param {*} value - The value to normalize
|
|
25
|
+
* @returns {*} - Returns the normalized value
|
|
26
|
+
*/
|
|
27
|
+
normalizeValue(value: any): any;
|
|
28
|
+
normalizeSingleValue(value: any): any;
|
|
22
29
|
setConvertedValue(value: any, index: any): any;
|
|
23
30
|
setAsyncConvertedValue(value: any): Promise<any>;
|
|
24
31
|
setImagesUrl(images: any): Promise<any>;
|
|
@@ -304,6 +304,23 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
|
304
304
|
get isJsonValue() {
|
|
305
305
|
return this.component.as && this.component.as === 'json';
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
|
309
|
+
* @param {*} value - The value to normalize
|
|
310
|
+
* @returns {*} - Returns the normalized value
|
|
311
|
+
*/
|
|
312
|
+
normalizeValue(value) {
|
|
313
|
+
if (this.component.multiple && Array.isArray(value)) {
|
|
314
|
+
return value.map((singleValue) => this.normalizeSingleValue(singleValue));
|
|
315
|
+
}
|
|
316
|
+
return super.normalizeValue(this.normalizeSingleValue(value));
|
|
317
|
+
}
|
|
318
|
+
normalizeSingleValue(value) {
|
|
319
|
+
if (_.isNil(value)) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
return this.isJsonValue ? value : String(value);
|
|
323
|
+
}
|
|
307
324
|
isSingleInputValue() {
|
|
308
325
|
return !this.component.multiple;
|
|
309
326
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/js",
|
|
3
|
-
"version": "5.0.0-dev.5829.
|
|
3
|
+
"version": "5.0.0-dev.5829.56191dc",
|
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
|
|
84
84
|
"@formio/choices.js": "^10.2.1",
|
|
85
|
-
"@formio/core": "v2.1.0-dev.156.
|
|
85
|
+
"@formio/core": "v2.1.0-dev.156.78a83fd",
|
|
86
86
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
|
87
87
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
|
88
88
|
"abortcontroller-polyfill": "^1.7.5",
|