@sumaris-net/ngx-components 1.23.30 → 1.23.32

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.
@@ -4347,6 +4347,7 @@
4347
4347
  this.error = null;
4348
4348
  this.enabled = false;
4349
4349
  this.loading = false;
4350
+ this.touched = false;
4350
4351
  }
4351
4352
  Object.defineProperty(AppNullForm.prototype, "disabled", {
4352
4353
  get: function () {
@@ -4355,6 +4356,13 @@
4355
4356
  enumerable: false,
4356
4357
  configurable: true
4357
4358
  });
4359
+ Object.defineProperty(AppNullForm.prototype, "untouched", {
4360
+ get: function () {
4361
+ return !this.touched;
4362
+ },
4363
+ enumerable: false,
4364
+ configurable: true
4365
+ });
4358
4366
  AppNullForm.prototype.disable = function (opts) { };
4359
4367
  AppNullForm.prototype.enable = function (opts) { };
4360
4368
  AppNullForm.prototype.markAsPristine = function (opts) { };
@@ -4456,6 +4464,20 @@
4456
4464
  enumerable: false,
4457
4465
  configurable: true
4458
4466
  });
4467
+ Object.defineProperty(AppFormProvider.prototype, "touched", {
4468
+ get: function () {
4469
+ return this.delegate.touched;
4470
+ },
4471
+ enumerable: false,
4472
+ configurable: true
4473
+ });
4474
+ Object.defineProperty(AppFormProvider.prototype, "untouched", {
4475
+ get: function () {
4476
+ return this.delegate.untouched;
4477
+ },
4478
+ enumerable: false,
4479
+ configurable: true
4480
+ });
4459
4481
  AppFormProvider.prototype.ready = function () {
4460
4482
  return this.delegate.ready();
4461
4483
  };
@@ -20344,6 +20366,14 @@
20344
20366
  enumerable: false,
20345
20367
  configurable: true
20346
20368
  });
20369
+ Object.defineProperty(AppForm.prototype, "touched", {
20370
+ get: function () {
20371
+ var _a;
20372
+ return ((_a = this.form) === null || _a === void 0 ? void 0 : _a.touched) || false;
20373
+ },
20374
+ enumerable: false,
20375
+ configurable: true
20376
+ });
20347
20377
  Object.defineProperty(AppForm.prototype, "untouched", {
20348
20378
  get: function () {
20349
20379
  return !this.form || this.form.untouched;
@@ -26573,6 +26603,7 @@
26573
26603
  this.readySubject = new rxjs.BehaviorSubject(false);
26574
26604
  this.loadingSubject = new rxjs.BehaviorSubject(true);
26575
26605
  this.savingSubject = new rxjs.BehaviorSubject(false);
26606
+ this.touchedSubject = new rxjs.BehaviorSubject(false);
26576
26607
  this.dirtySubject = new rxjs.BehaviorSubject(false);
26577
26608
  this.errorSubject = new rxjs.BehaviorSubject(undefined);
26578
26609
  this.selection = new collections.SelectionModel(true, []);
@@ -26728,6 +26759,20 @@
26728
26759
  enumerable: false,
26729
26760
  configurable: true
26730
26761
  });
26762
+ Object.defineProperty(AppTable.prototype, "touched", {
26763
+ get: function () {
26764
+ return this.touchedSubject.value;
26765
+ },
26766
+ enumerable: false,
26767
+ configurable: true
26768
+ });
26769
+ Object.defineProperty(AppTable.prototype, "untouched", {
26770
+ get: function () {
26771
+ return !this.touchedSubject.value;
26772
+ },
26773
+ enumerable: false,
26774
+ configurable: true
26775
+ });
26731
26776
  AppTable.prototype.disable = function (opts) {
26732
26777
  if (this.sort)
26733
26778
  this.sort.disabled = true;
@@ -26779,18 +26824,24 @@
26779
26824
  };
26780
26825
  AppTable.prototype.markAsUntouched = function (opts) {
26781
26826
  var _a;
26782
- if (this.dirtySubject.value !== false || (this.editedRow && this.editedRow.id !== this.previouslyEditedRowId)) {
26827
+ var needEmitEvent = false;
26828
+ if (this.touchedSubject.value) {
26829
+ this.touchedSubject.next(false);
26830
+ needEmitEvent = true;
26831
+ }
26832
+ if (this.dirty || (this.editedRow && this.editedRow.id !== this.previouslyEditedRowId)) {
26783
26833
  // Cancel the current editing row only if editing and if it was not previously saved
26784
- this.dirtySubject.next(false);
26785
26834
  if ((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) {
26786
26835
  this.dataSource.cancelOrDelete(this.editedRow);
26836
+ // Mark row as pristine
26837
+ this.checkIfRowPristine(this.editedRow, { emitEvent: false });
26787
26838
  }
26788
26839
  this.editedRow = null;
26789
- if (!opts || opts.emitEvent !== false) {
26790
- this.markForCheck();
26791
- }
26840
+ needEmitEvent = true;
26792
26841
  }
26793
26842
  this.previouslyEditedRowId = undefined;
26843
+ if (needEmitEvent && (!opts || opts.emitEvent !== false))
26844
+ this.markForCheck();
26794
26845
  };
26795
26846
  /**
26796
26847
  * @deprecated prefer to use markAllAsTouched()
@@ -26808,11 +26859,13 @@
26808
26859
  };
26809
26860
  AppTable.prototype.markAllAsTouched = function (opts) {
26810
26861
  var _a, _b;
26862
+ if (this.touchedSubject.value !== true) {
26863
+ this.touchedSubject.next(true);
26864
+ if (!opts || opts.emitEvent !== false)
26865
+ this.markForCheck();
26866
+ }
26811
26867
  if ((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) {
26812
26868
  (_b = this.editedRow.validator) === null || _b === void 0 ? void 0 : _b.markAllAsTouched();
26813
- if (!opts || opts.emitEvent !== false) {
26814
- this.markForCheck();
26815
- }
26816
26869
  }
26817
26870
  };
26818
26871
  AppTable.prototype.markAsSaving = function (opts) {
@@ -28478,6 +28531,7 @@
28478
28531
  this.loadingSubject = new rxjs.BehaviorSubject(true);
28479
28532
  this.errorSubject = new rxjs.BehaviorSubject(undefined);
28480
28533
  this.savingSubject = new rxjs.BehaviorSubject(false);
28534
+ this.touchedSubject = new rxjs.BehaviorSubject(false);
28481
28535
  this.debug = false;
28482
28536
  this.submitted = false;
28483
28537
  this.toolbar = null;
@@ -28597,6 +28651,20 @@
28597
28651
  enumerable: false,
28598
28652
  configurable: true
28599
28653
  });
28654
+ Object.defineProperty(AppEditor.prototype, "touched", {
28655
+ get: function () {
28656
+ return this.touchedSubject.value || (this._children && this._children.findIndex(function (c) { return c.enabled && c.touched; }) !== -1) || false;
28657
+ },
28658
+ enumerable: false,
28659
+ configurable: true
28660
+ });
28661
+ Object.defineProperty(AppEditor.prototype, "untouched", {
28662
+ get: function () {
28663
+ return !this.touchedSubject.value && (!this._children || this._children.findIndex(function (c) { return c.enabled && c.touched; }) === -1) || false;
28664
+ },
28665
+ enumerable: false,
28666
+ configurable: true
28667
+ });
28600
28668
  Object.defineProperty(AppEditor.prototype, "enabled", {
28601
28669
  get: function () {
28602
28670
  return this._enabled;