@formio/js 5.0.0-dev.5902.bf899bf → 5.0.0-dev.5904.e376ad2

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.
@@ -20,6 +20,8 @@
20
20
 
21
21
  /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
22
22
 
23
+ /*! @license DOMPurify 3.2.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.0/LICENSE */
24
+
23
25
  /*! formiojs v5.0.0-rc.59 | https://unpkg.com/formiojs@5.0.0-rc.59/LICENSE.txt */
24
26
 
25
27
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -3286,12 +3286,6 @@ class Component extends Element_1.default {
3286
3286
  return (this.component.protected || !this.component.persistent || (this.component.persistent === 'client-only'));
3287
3287
  }
3288
3288
  shouldSkipValidation(data, row, flags = {}) {
3289
- const { validateWhenHidden = false } = this.component || {};
3290
- const forceValidOnHidden = (!this.visible || !this.checkCondition(row, data)) && !validateWhenHidden;
3291
- if (forceValidOnHidden) {
3292
- // If this component is forced valid when it is hidden, then we also need to reset the errors for this component.
3293
- this._errors = [];
3294
- }
3295
3289
  const rules = [
3296
3290
  // Do not validate if the flags say not too.
3297
3291
  () => flags.noValidate,
@@ -3302,7 +3296,13 @@ class Component extends Element_1.default {
3302
3296
  // Check to see if we are editing and if so, check component persistence.
3303
3297
  () => this.isValueHidden(),
3304
3298
  // Force valid if component is hidden.
3305
- () => forceValidOnHidden
3299
+ () => {
3300
+ if (!this.component.validateWhenHidden && (!this.visible || !this.checkCondition(row, data))) {
3301
+ this._errors = [];
3302
+ return true;
3303
+ }
3304
+ return false;
3305
+ }
3306
3306
  ];
3307
3307
  return rules.some(pred => pred());
3308
3308
  }
@@ -3248,12 +3248,6 @@ export default class Component extends Element {
3248
3248
  return (this.component.protected || !this.component.persistent || (this.component.persistent === 'client-only'));
3249
3249
  }
3250
3250
  shouldSkipValidation(data, row, flags = {}) {
3251
- const { validateWhenHidden = false } = this.component || {};
3252
- const forceValidOnHidden = (!this.visible || !this.checkCondition(row, data)) && !validateWhenHidden;
3253
- if (forceValidOnHidden) {
3254
- // If this component is forced valid when it is hidden, then we also need to reset the errors for this component.
3255
- this._errors = [];
3256
- }
3257
3251
  const rules = [
3258
3252
  // Do not validate if the flags say not too.
3259
3253
  () => flags.noValidate,
@@ -3264,7 +3258,13 @@ export default class Component extends Element {
3264
3258
  // Check to see if we are editing and if so, check component persistence.
3265
3259
  () => this.isValueHidden(),
3266
3260
  // Force valid if component is hidden.
3267
- () => forceValidOnHidden
3261
+ () => {
3262
+ if (!this.component.validateWhenHidden && (!this.visible || !this.checkCondition(row, data))) {
3263
+ this._errors = [];
3264
+ return true;
3265
+ }
3266
+ return false;
3267
+ }
3268
3268
  ];
3269
3269
  return rules.some(pred => pred());
3270
3270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5902.bf899bf",
3
+ "version": "5.0.0-dev.5904.e376ad2",
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.174.9a3c6ec",
85
+ "@formio/core": "2.1.0-dev.191.8c609ab",
86
86
  "@formio/text-mask-addons": "^3.8.0-formio.3",
87
87
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
88
88
  "abortcontroller-polyfill": "^1.7.5",