@formio/js 5.0.0-dev.5620.dedc19b → 5.0.0-dev.5625.9910504

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.
@@ -1119,16 +1119,11 @@ 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;
1123
1122
  const path = comp.path;
1124
- const errors = comp.visibleErrors || [];
1125
1123
  if (repeatablePaths.includes(path)) {
1126
- comp.setCustomValidity(`API Key is not unique: ${comp.key}`);
1124
+ comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
1127
1125
  hasInvalidComponents = true;
1128
1126
  }
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
- }
1132
1127
  });
1133
1128
  this.emit('builderFormValidityChange', hasInvalidComponents);
1134
1129
  }
@@ -492,10 +492,12 @@ declare class Component extends Element {
492
492
  /**
493
493
  * Add a new input error to this element.
494
494
  *
495
- * @param message
496
- * @param dirty
495
+ * @param {{level: string, message: string}[]} messages
497
496
  */
498
- addMessages(messages: any): void;
497
+ addMessages(messages: {
498
+ level: string;
499
+ message: string;
500
+ }[]): void;
499
501
  setErrorClasses(elements: any, dirty: any, hasErrors: any, hasMessages: any, element?: any): void;
500
502
  setElementInvalid(element: any, invalid: any): void;
501
503
  clearOnHide(): void;
@@ -1831,8 +1831,7 @@ class Component extends Element_1.default {
1831
1831
  /**
1832
1832
  * Add a new input error to this element.
1833
1833
  *
1834
- * @param message
1835
- * @param dirty
1834
+ * @param {{level: string, message: string}[]} messages
1836
1835
  */
1837
1836
  addMessages(messages) {
1838
1837
  if (!messages) {
@@ -2563,7 +2562,7 @@ class Component extends Element_1.default {
2563
2562
  }
2564
2563
  this.calculatedValue = (0, utils_1.fastCloneDeep)(calculatedValue);
2565
2564
  if (changed) {
2566
- if (!flags.noPristineChangeOnModified) {
2565
+ if (!flags.noPristineChangeOnModified && this.root.initialized) {
2567
2566
  this.pristine = false;
2568
2567
  }
2569
2568
  flags.triggeredComponentId = this.id;
@@ -71,5 +71,6 @@ declare namespace _default {
71
71
  let submitButtonAriaLabel: string;
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
+ let apiKey: string;
74
75
  }
75
76
  export default _default;
@@ -73,4 +73,5 @@ 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}}'
76
77
  };
@@ -1104,14 +1104,10 @@ 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 || [];
1108
1107
  if (repeatablePaths.includes(path)) {
1109
- comp.setCustomValidity(`API Key is not unique: ${comp.key}`);
1108
+ comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
1110
1109
  hasInvalidComponents = true;
1111
1110
  }
1112
- else if (errors.length && errors[0].message?.startsWith('API Key is not unique')) {
1113
- comp.setCustomValidity('');
1114
- }
1115
1111
  });
1116
1112
  this.emit('builderFormValidityChange', hasInvalidComponents);
1117
1113
  }
@@ -492,10 +492,12 @@ declare class Component extends Element {
492
492
  /**
493
493
  * Add a new input error to this element.
494
494
  *
495
- * @param message
496
- * @param dirty
495
+ * @param {{level: string, message: string}[]} messages
497
496
  */
498
- addMessages(messages: any): void;
497
+ addMessages(messages: {
498
+ level: string;
499
+ message: string;
500
+ }[]): void;
499
501
  setErrorClasses(elements: any, dirty: any, hasErrors: any, hasMessages: any, element?: any): void;
500
502
  setElementInvalid(element: any, invalid: any): void;
501
503
  clearOnHide(): void;
@@ -1795,8 +1795,7 @@ export default class Component extends Element {
1795
1795
  /**
1796
1796
  * Add a new input error to this element.
1797
1797
  *
1798
- * @param message
1799
- * @param dirty
1798
+ * @param {{level: string, message: string}[]} messages
1800
1799
  */
1801
1800
  addMessages(messages) {
1802
1801
  if (!messages) {
@@ -2531,7 +2530,7 @@ export default class Component extends Element {
2531
2530
  }
2532
2531
  this.calculatedValue = fastCloneDeep(calculatedValue);
2533
2532
  if (changed) {
2534
- if (!flags.noPristineChangeOnModified) {
2533
+ if (!flags.noPristineChangeOnModified && this.root.initialized) {
2535
2534
  this.pristine = false;
2536
2535
  }
2537
2536
  flags.triggeredComponentId = this.id;
@@ -71,5 +71,6 @@ declare namespace _default {
71
71
  let submitButtonAriaLabel: string;
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
+ let apiKey: string;
74
75
  }
75
76
  export default _default;
@@ -71,4 +71,5 @@ 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}}'
74
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5620.dedc19b",
3
+ "version": "5.0.0-dev.5625.9910504",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {