@sumaris-net/ngx-components 2.1.2 → 2.1.4-rc1

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.
@@ -4210,7 +4210,7 @@ function pushValueInArray(arrayControl, createControl, equals, isEmpty, value, o
4210
4210
  return hasChanged;
4211
4211
  }
4212
4212
  /**
4213
- * Patch an array using given default values. Each default value will be pass to the 'createControl()' function
4213
+ * Set an array using given default values. Each default value will be pass to the 'createControl()' function
4214
4214
  * @param arrayControl
4215
4215
  * @param createControl
4216
4216
  * @param values
@@ -4605,7 +4605,12 @@ class AppFormArray extends UntypedFormArray {
4605
4605
  * @param options
4606
4606
  */
4607
4607
  setValue(values, options) {
4608
- setValueInArray(this, this.createControl, values);
4608
+ setValueInArray(this, this.createControl, values, options);
4609
+ }
4610
+ patchValue(values, options) {
4611
+ // this.resize(values?.length || 0);
4612
+ // super.patchValue(values, options);
4613
+ setValueInArray(this, this.createControl, values, options);
4609
4614
  }
4610
4615
  enable(opts) {
4611
4616
  this.controls.forEach(c => c.enable(opts));
@@ -4667,8 +4672,9 @@ class AppFormArray extends UntypedFormArray {
4667
4672
  this.setValidators(this.options.validators || null);
4668
4673
  }
4669
4674
  else {
4670
- const validators = Array.isArray(this.options?.validators) ? this.options.validators : (this.options.validators ? [this.options.validators] : []);
4671
- this.setValidators(validators.concat(SharedFormArrayValidators.requiredArrayMinLength(1)));
4675
+ const validators = this.options?.validators || [];
4676
+ this.setValidators((Array.isArray(validators) ? validators : [validators])
4677
+ .concat(SharedFormArrayValidators.requiredArrayMinLength(1)));
4672
4678
  }
4673
4679
  }
4674
4680
  }