@formio/js 5.1.0-dev.6060.19e3bfc → 5.1.0-dev.6061.f2b1042

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.
@@ -2551,12 +2551,11 @@ class Component extends Element_1.default {
2551
2551
  }
2552
2552
  get shouldAddDefaultValue() {
2553
2553
  // It should add a default value if...
2554
- // 1.) Ensure they have not set "noDefaults". If that is true, then will always return false. AND
2555
- // 2.) The component is pristine (user has not manually modified it). AND
2556
- // 3.) There is a default value setting present and it is not NULL or UNDEFINED.
2557
- return !this.options.noDefaults && this.pristine && (this.hasDefaultValue ||
2558
- // Empty strings and booleans are allowed primitives whose defaults are automatically added.
2559
- (this.emptyValue === '' || (typeof this.emptyValue === 'boolean')));
2554
+ // 1.) The component is pristine (user has not manually modified it). AND
2555
+ // 1.) There is a default value setting present OR
2556
+ // 2.) The noDefaults flag is not true AND the empty value is either an empty string or boolean
2557
+ return this.pristine && (this.hasDefaultValue ||
2558
+ (!this.options.noDefaults && (this.emptyValue === '' || (typeof this.emptyValue === 'boolean'))));
2560
2559
  }
2561
2560
  get defaultValue() {
2562
2561
  let defaultValue = this.emptyValue;
@@ -2520,12 +2520,11 @@ export default class Component extends Element {
2520
2520
  }
2521
2521
  get shouldAddDefaultValue() {
2522
2522
  // It should add a default value if...
2523
- // 1.) Ensure they have not set "noDefaults". If that is true, then will always return false. AND
2524
- // 2.) The component is pristine (user has not manually modified it). AND
2525
- // 3.) There is a default value setting present and it is not NULL or UNDEFINED.
2526
- return !this.options.noDefaults && this.pristine && (this.hasDefaultValue ||
2527
- // Empty strings and booleans are allowed primitives whose defaults are automatically added.
2528
- (this.emptyValue === '' || (typeof this.emptyValue === 'boolean')));
2523
+ // 1.) The component is pristine (user has not manually modified it). AND
2524
+ // 1.) There is a default value setting present OR
2525
+ // 2.) The noDefaults flag is not true AND the empty value is either an empty string or boolean
2526
+ return this.pristine && (this.hasDefaultValue ||
2527
+ (!this.options.noDefaults && (this.emptyValue === '' || (typeof this.emptyValue === 'boolean'))));
2529
2528
  }
2530
2529
  get defaultValue() {
2531
2530
  let defaultValue = this.emptyValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6060.19e3bfc",
3
+ "version": "5.1.0-dev.6061.f2b1042",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {