@formio/js 5.0.0-dev.5613.77144cc → 5.0.0-dev.5615.4672b8c
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 +3 -3
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/WebformBuilder.js +6 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +3 -5
- package/lib/cjs/components/_classes/component/Component.js +2 -1
- package/lib/cjs/translations/en.d.ts +0 -1
- package/lib/cjs/translations/en.js +0 -1
- package/lib/mjs/WebformBuilder.js +5 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +3 -5
- package/lib/mjs/components/_classes/component/Component.js +2 -1
- package/lib/mjs/translations/en.d.ts +0 -1
- package/lib/mjs/translations/en.js +0 -1
- package/package.json +1 -1
|
@@ -1119,11 +1119,16 @@ class WebformBuilder extends Component_1.default {
|
|
|
1119
1119
|
const repeatablePaths = this.findRepeatablePaths();
|
|
1120
1120
|
let hasInvalidComponents = false;
|
|
1121
1121
|
this.webform.everyComponent((comp) => {
|
|
1122
|
+
var _a;
|
|
1122
1123
|
const path = comp.path;
|
|
1124
|
+
const errors = comp.visibleErrors || [];
|
|
1123
1125
|
if (repeatablePaths.includes(path)) {
|
|
1124
|
-
comp.setCustomValidity(
|
|
1126
|
+
comp.setCustomValidity(`API Key is not unique: ${comp.key}`);
|
|
1125
1127
|
hasInvalidComponents = true;
|
|
1126
1128
|
}
|
|
1129
|
+
else if (errors.length && ((_a = errors[0].message) === null || _a === void 0 ? void 0 : _a.startsWith('API Key is not unique'))) {
|
|
1130
|
+
comp.setCustomValidity('');
|
|
1131
|
+
}
|
|
1127
1132
|
});
|
|
1128
1133
|
this.emit('builderFormValidityChange', hasInvalidComponents);
|
|
1129
1134
|
}
|
|
@@ -492,12 +492,10 @@ declare class Component extends Element {
|
|
|
492
492
|
/**
|
|
493
493
|
* Add a new input error to this element.
|
|
494
494
|
*
|
|
495
|
-
* @param
|
|
495
|
+
* @param message
|
|
496
|
+
* @param dirty
|
|
496
497
|
*/
|
|
497
|
-
addMessages(messages:
|
|
498
|
-
level: string;
|
|
499
|
-
message: string;
|
|
500
|
-
}[]): void;
|
|
498
|
+
addMessages(messages: any): void;
|
|
501
499
|
setErrorClasses(elements: any, dirty: any, hasErrors: any, hasMessages: any, element?: any): void;
|
|
502
500
|
setElementInvalid(element: any, invalid: any): void;
|
|
503
501
|
clearOnHide(): void;
|
|
@@ -1831,7 +1831,8 @@ class Component extends Element_1.default {
|
|
|
1831
1831
|
/**
|
|
1832
1832
|
* Add a new input error to this element.
|
|
1833
1833
|
*
|
|
1834
|
-
* @param
|
|
1834
|
+
* @param message
|
|
1835
|
+
* @param dirty
|
|
1835
1836
|
*/
|
|
1836
1837
|
addMessages(messages) {
|
|
1837
1838
|
if (!messages) {
|
|
@@ -73,5 +73,4 @@ exports.default = {
|
|
|
73
73
|
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
|
74
74
|
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
|
75
75
|
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
|
76
|
-
apiKey: 'API Key is not unique: {{key}}'
|
|
77
76
|
};
|
|
@@ -1104,10 +1104,14 @@ export default class WebformBuilder extends Component {
|
|
|
1104
1104
|
let hasInvalidComponents = false;
|
|
1105
1105
|
this.webform.everyComponent((comp) => {
|
|
1106
1106
|
const path = comp.path;
|
|
1107
|
+
const errors = comp.visibleErrors || [];
|
|
1107
1108
|
if (repeatablePaths.includes(path)) {
|
|
1108
|
-
comp.setCustomValidity(
|
|
1109
|
+
comp.setCustomValidity(`API Key is not unique: ${comp.key}`);
|
|
1109
1110
|
hasInvalidComponents = true;
|
|
1110
1111
|
}
|
|
1112
|
+
else if (errors.length && errors[0].message?.startsWith('API Key is not unique')) {
|
|
1113
|
+
comp.setCustomValidity('');
|
|
1114
|
+
}
|
|
1111
1115
|
});
|
|
1112
1116
|
this.emit('builderFormValidityChange', hasInvalidComponents);
|
|
1113
1117
|
}
|
|
@@ -492,12 +492,10 @@ declare class Component extends Element {
|
|
|
492
492
|
/**
|
|
493
493
|
* Add a new input error to this element.
|
|
494
494
|
*
|
|
495
|
-
* @param
|
|
495
|
+
* @param message
|
|
496
|
+
* @param dirty
|
|
496
497
|
*/
|
|
497
|
-
addMessages(messages:
|
|
498
|
-
level: string;
|
|
499
|
-
message: string;
|
|
500
|
-
}[]): void;
|
|
498
|
+
addMessages(messages: any): void;
|
|
501
499
|
setErrorClasses(elements: any, dirty: any, hasErrors: any, hasMessages: any, element?: any): void;
|
|
502
500
|
setElementInvalid(element: any, invalid: any): void;
|
|
503
501
|
clearOnHide(): void;
|
|
@@ -1795,7 +1795,8 @@ export default class Component extends Element {
|
|
|
1795
1795
|
/**
|
|
1796
1796
|
* Add a new input error to this element.
|
|
1797
1797
|
*
|
|
1798
|
-
* @param
|
|
1798
|
+
* @param message
|
|
1799
|
+
* @param dirty
|
|
1799
1800
|
*/
|
|
1800
1801
|
addMessages(messages) {
|
|
1801
1802
|
if (!messages) {
|
|
@@ -71,5 +71,4 @@ export default {
|
|
|
71
71
|
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
|
72
72
|
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
|
73
73
|
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
|
74
|
-
apiKey: 'API Key is not unique: {{key}}'
|
|
75
74
|
};
|