@sumaris-net/ngx-components 2.2.1-rc4 → 2.2.1-rc6

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.
@@ -4500,9 +4500,14 @@ class FormArrayHelper {
4500
4500
  this.setAllowEmptyArray(toBoolean(options?.allowEmptyArray, false));
4501
4501
  }
4502
4502
  static getOrCreateArray(formBuilder, form, arrayName) {
4503
+ const disabled = form.disabled;
4503
4504
  let arrayControl = form.get(arrayName);
4504
4505
  if (!arrayControl) {
4505
4506
  arrayControl = formBuilder.array([]);
4507
+ // Apply parent disabled state, before to push it into the array
4508
+ // This is need to avoid parent form to be enabled, after calling resizeArray()
4509
+ if (disabled && arrayControl.enabled)
4510
+ arrayControl.disable({ emitEvent: false });
4506
4511
  form.addControl(arrayName, arrayControl);
4507
4512
  }
4508
4513
  return arrayControl;
@@ -13849,7 +13854,7 @@ class AppForm {
13849
13854
  this.form?.disable(opts);
13850
13855
  if (this._enable) {
13851
13856
  this._enable = false;
13852
- if (!opts || opts.emitEvent !== true)
13857
+ if (!opts || opts.emitEvent !== false)
13853
13858
  this.markForCheck();
13854
13859
  }
13855
13860
  }
@@ -13857,7 +13862,7 @@ class AppForm {
13857
13862
  this.form?.enable(opts);
13858
13863
  if (!this._enable) {
13859
13864
  this._enable = true;
13860
- if (!opts || opts.emitEvent !== true)
13865
+ if (!opts || opts.emitEvent !== false)
13861
13866
  this.markForCheck();
13862
13867
  }
13863
13868
  }
@@ -28297,7 +28302,6 @@ class AppEntityEditorModal extends AppTabEditor {
28297
28302
  this.savingSubject = new BehaviorSubject(false);
28298
28303
  this.$title = new Subject();
28299
28304
  this.i18nSuffix = null;
28300
- this.environement = injector.get(ENVIRONMENT);
28301
28305
  options = {
28302
28306
  // Default options
28303
28307
  i18nPrefix: '',
@@ -28370,7 +28374,7 @@ class AppEntityEditorModal extends AppTabEditor {
28370
28374
  // Disable
28371
28375
  if (this.disabled)
28372
28376
  this.disable();
28373
- if (this.isNewData) {
28377
+ if (this.isNew) {
28374
28378
  // Update the title.
28375
28379
  this.updateTitle();
28376
28380
  }
@@ -28445,7 +28449,7 @@ class AppEntityEditorModal extends AppTabEditor {
28445
28449
  * Enable or disable state
28446
28450
  */
28447
28451
  updateViewState(data, opts) {
28448
- if (this.isNewData || this.enabled) {
28452
+ if (this.isNew || this.enabled) {
28449
28453
  this.enable(opts);
28450
28454
  }
28451
28455
  else {
@@ -28574,7 +28578,7 @@ class AppEntityEditorModal extends AppTabEditor {
28574
28578
  }
28575
28579
  // Or dismiss, with the role 'delete'
28576
28580
  else {
28577
- if (this.isNewData) {
28581
+ if (this.isNew) {
28578
28582
  console.error(this._logPrefix + "Trying to delete a new data. Make no sense!");
28579
28583
  }
28580
28584
  await this.modalCtrl.dismiss(this.data, 'delete');