@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.
@@ -4485,9 +4485,14 @@ class FormArrayHelper {
4485
4485
  this.setAllowEmptyArray(toBoolean(options === null || options === void 0 ? void 0 : options.allowEmptyArray, false));
4486
4486
  }
4487
4487
  static getOrCreateArray(formBuilder, form, arrayName) {
4488
+ const disabled = form.disabled;
4488
4489
  let arrayControl = form.get(arrayName);
4489
4490
  if (!arrayControl) {
4490
4491
  arrayControl = formBuilder.array([]);
4492
+ // Apply parent disabled state, before to push it into the array
4493
+ // This is need to avoid parent form to be enabled, after calling resizeArray()
4494
+ if (disabled && arrayControl.enabled)
4495
+ arrayControl.disable({ emitEvent: false });
4491
4496
  form.addControl(arrayName, arrayControl);
4492
4497
  }
4493
4498
  return arrayControl;
@@ -13995,7 +14000,7 @@ class AppForm {
13995
14000
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.disable(opts);
13996
14001
  if (this._enable) {
13997
14002
  this._enable = false;
13998
- if (!opts || opts.emitEvent !== true)
14003
+ if (!opts || opts.emitEvent !== false)
13999
14004
  this.markForCheck();
14000
14005
  }
14001
14006
  }
@@ -14004,7 +14009,7 @@ class AppForm {
14004
14009
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.enable(opts);
14005
14010
  if (!this._enable) {
14006
14011
  this._enable = true;
14007
- if (!opts || opts.emitEvent !== true)
14012
+ if (!opts || opts.emitEvent !== false)
14008
14013
  this.markForCheck();
14009
14014
  }
14010
14015
  }
@@ -28904,7 +28909,6 @@ class AppEntityEditorModal extends AppTabEditor {
28904
28909
  this.savingSubject = new BehaviorSubject(false);
28905
28910
  this.$title = new Subject();
28906
28911
  this.i18nSuffix = null;
28907
- this.environement = injector.get(ENVIRONMENT);
28908
28912
  options = Object.assign({
28909
28913
  // Default options
28910
28914
  i18nPrefix: '' }, options);
@@ -28975,7 +28979,7 @@ class AppEntityEditorModal extends AppTabEditor {
28975
28979
  // Disable
28976
28980
  if (this.disabled)
28977
28981
  this.disable();
28978
- if (this.isNewData) {
28982
+ if (this.isNew) {
28979
28983
  // Update the title.
28980
28984
  this.updateTitle();
28981
28985
  }
@@ -29055,7 +29059,7 @@ class AppEntityEditorModal extends AppTabEditor {
29055
29059
  */
29056
29060
  updateViewState(data, opts) {
29057
29061
  var _a;
29058
- if (this.isNewData || this.enabled) {
29062
+ if (this.isNew || this.enabled) {
29059
29063
  this.enable(opts);
29060
29064
  }
29061
29065
  else {
@@ -29193,7 +29197,7 @@ class AppEntityEditorModal extends AppTabEditor {
29193
29197
  }
29194
29198
  // Or dismiss, with the role 'delete'
29195
29199
  else {
29196
- if (this.isNewData) {
29200
+ if (this.isNew) {
29197
29201
  console.error(this._logPrefix + "Trying to delete a new data. Make no sense!");
29198
29202
  }
29199
29203
  yield this.modalCtrl.dismiss(this.data, 'delete');