@sumaris-net/ngx-components 1.23.0-rc4 → 1.23.0

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.
@@ -22895,7 +22895,7 @@
22895
22895
  FormButtonsBarComponent.decorators = [
22896
22896
  { type: i0.Component, args: [{
22897
22897
  selector: 'app-form-buttons-bar',
22898
- template: "\n<ion-toolbar [class]=\"classList\">\n <ion-row class=\"ion-no-padding\" nowrap>\n <!-- show menu button -->\n <ion-col size=\"auto\" class=\"hidden-xs hidden-sm\">\n <ion-menu-toggle>\n <button\n mat-icon-button\n color=\"accent\"\n [title]=\"'COMMON.BTN_SHOW_MENU' | translate\"\n (click)=\"menu.toggleSplitPaneWhen()\">\n <mat-icon><span>&#xbb;</span></mat-icon>\n </button>\n </ion-menu-toggle>\n </ion-col>\n\n <ion-col>\n <ng-content></ng-content>\n </ion-col>\n\n <ion-col size=\"auto\">\n\n <ng-content select=\"[slot=end]\"></ng-content>\n\n <!-- close (go back) -->\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"onBack.emit($event)\"\n (keyup.enter)=\"onBack.emit($event)\"\n *ngIf=\"onBack.observers | isNotEmptyArray\">\n <ion-label translate>COMMON.BTN_CLOSE</ion-label>\n </ion-button>\n\n <!-- reload -->\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"onCancel.emit($event)\"\n (keyup.enter)=\"onCancel.emit($event)\"\n [disabled]=\"disabledCancel\">\n <ion-icon slot=\"start\" name=\"refresh\"></ion-icon>\n <ion-label translate>COMMON.BTN_RESET</ion-label>\n </ion-button>\n\n <!-- next -->\n <ion-button fill=\"solid\" (click)=\"onNext.emit($event)\" (keyup.enter)=\"onNext.emit($event)\" *ngIf=\"onNext.observers | isNotEmptyArray\">\n <ion-label translate>COMMON.BTN_NEXT</ion-label>\n <ion-icon slot=\"end\" name=\"arrow-forward\"></ion-icon>\n </ion-button>\n\n <!-- save -->\n <ion-button [fill]=\"disabled ? 'clear' : 'solid'\"\n (click)=\"onSave.emit($event)\"\n (keyup.enter)=\"onSave.emit($event)\" color=\"danger\"\n [disabled]=\"disabled\">\n <ion-label [innerHTML]=\"'COMMON.BTN_SAVE_WITH_SHORTCUT'|translate\" [title]=\"'COMMON.BTN_SAVE_WITH_SHORTCUT_HELP'|translate\"></ion-label>\n </ion-button>\n </ion-col>\n </ion-row>\n</ion-toolbar>\n",
22898
+ template: "\n<ion-toolbar [class]=\"classList\">\n <ion-row class=\"ion-no-padding\" nowrap>\n <!-- show menu button -->\n <ion-col size=\"auto\" class=\"hidden-xs hidden-sm\">\n <ion-menu-toggle>\n <button\n mat-icon-button\n color=\"accent\"\n [title]=\"'COMMON.BTN_SHOW_MENU' | translate\"\n (click)=\"menu.toggleSplitPaneWhen()\">\n <mat-icon><span>&#xbb;</span></mat-icon>\n </button>\n </ion-menu-toggle>\n </ion-col>\n\n <ion-col class=\"app-form-buttons-bar-content\">\n <ng-content></ng-content>\n </ion-col>\n\n <ion-col size=\"auto\">\n\n <ng-content select=\"[slot=end]\"></ng-content>\n\n <!-- close (go back) -->\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"onBack.emit($event)\"\n (keyup.enter)=\"onBack.emit($event)\"\n *ngIf=\"onBack.observers | isNotEmptyArray\">\n <ion-label translate>COMMON.BTN_CLOSE</ion-label>\n </ion-button>\n\n <!-- reload -->\n <ion-button fill=\"clear\" color=\"dark\" (click)=\"onCancel.emit($event)\"\n (keyup.enter)=\"onCancel.emit($event)\"\n [disabled]=\"disabledCancel\">\n <ion-icon slot=\"start\" name=\"refresh\"></ion-icon>\n <ion-label translate>COMMON.BTN_RESET</ion-label>\n </ion-button>\n\n <!-- next -->\n <ion-button fill=\"solid\" (click)=\"onNext.emit($event)\" (keyup.enter)=\"onNext.emit($event)\" *ngIf=\"onNext.observers | isNotEmptyArray\">\n <ion-label translate>COMMON.BTN_NEXT</ion-label>\n <ion-icon slot=\"end\" name=\"arrow-forward\"></ion-icon>\n </ion-button>\n\n <!-- save -->\n <ion-button [fill]=\"disabled ? 'clear' : 'solid'\"\n (click)=\"onSave.emit($event)\"\n (keyup.enter)=\"onSave.emit($event)\" color=\"danger\"\n [disabled]=\"disabled\">\n <ion-label [innerHTML]=\"'COMMON.BTN_SAVE_WITH_SHORTCUT'|translate\" [title]=\"'COMMON.BTN_SAVE_WITH_SHORTCUT_HELP'|translate\"></ion-label>\n </ion-button>\n </ion-col>\n </ion-row>\n</ion-toolbar>\n",
22899
22899
  providers: [
22900
22900
  { provide: FormButtonsBarToken, useExisting: FormButtonsBarComponent }
22901
22901
  ],
@@ -25831,15 +25831,43 @@
25831
25831
  return _this;
25832
25832
  }
25833
25833
  Object.defineProperty(EntitiesTableDataSource.prototype, "serviceOptions", {
25834
+ /**
25835
+ * @deprecated Use watchAllOptions or saveAllOptions
25836
+ */
25834
25837
  get: function () {
25835
- return this.config.dataServiceOptions;
25838
+ return this.config.dataServiceOptions
25839
+ || Object.assign(Object.assign({}, this.watchAllOptions), this.saveAllOptions);
25836
25840
  },
25841
+ /**
25842
+ * @deprecated Use watchAllOptions or saveAllOptions
25843
+ */
25837
25844
  set: function (value) {
25845
+ console.warn('dataSource.serviceOptions is deprecated! Please use \'watchAllOptions\' or \'saveAllOptions\' instead');
25838
25846
  this.config.dataServiceOptions = value;
25839
25847
  },
25840
25848
  enumerable: false,
25841
25849
  configurable: true
25842
25850
  });
25851
+ Object.defineProperty(EntitiesTableDataSource.prototype, "watchAllOptions", {
25852
+ get: function () {
25853
+ return this.config.watchAllOptions;
25854
+ },
25855
+ set: function (value) {
25856
+ this.config.watchAllOptions = value;
25857
+ },
25858
+ enumerable: false,
25859
+ configurable: true
25860
+ });
25861
+ Object.defineProperty(EntitiesTableDataSource.prototype, "saveAllOptions", {
25862
+ get: function () {
25863
+ return this.config.saveAllOptions;
25864
+ },
25865
+ set: function (value) {
25866
+ this.config.saveAllOptions = value;
25867
+ },
25868
+ enumerable: false,
25869
+ configurable: true
25870
+ });
25843
25871
  Object.defineProperty(EntitiesTableDataSource.prototype, "loaded", {
25844
25872
  get: function () {
25845
25873
  return this.loadingSubject.value === false; // Should be false when undefined (initial state)
@@ -26604,11 +26632,12 @@
26604
26632
  });
26605
26633
  AppTable.prototype.ngOnInit = function () {
26606
26634
  var _this = this;
26635
+ var _a;
26607
26636
  if (this._initialized)
26608
26637
  return; // Init only once
26609
26638
  this._initialized = true;
26610
26639
  // Set defaults
26611
- this.readOnly = toBoolean(this.readOnly, false); // read/write by default
26640
+ this.readOnly = toBoolean(this.readOnly, ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.config.readOnly) || false); // read/write by default
26612
26641
  this.inlineEdition = !this.readOnly && toBoolean(this.inlineEdition, false); // force to false when readonly
26613
26642
  this.saveBeforeDelete = toBoolean(this.saveBeforeDelete, !this.readOnly); // force to false when readonly
26614
26643
  this.saveBeforeSort = toBoolean(this.saveBeforeSort, !this.readOnly); // force to false when readonly
@@ -27774,23 +27803,25 @@
27774
27803
  var row;
27775
27804
  return __generator(this, function (_e) {
27776
27805
  switch (_e.label) {
27777
- case 0:
27778
- this.focusFirstColumn = true;
27779
- this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27780
- return [4 /*yield*/, this._dataSource.createNew(insertAt, Object.assign({ editing: true }, opts))];
27806
+ case 0: return [4 /*yield*/, this._dataSource.createNew(insertAt, Object.assign({ editing: true }, opts))];
27781
27807
  case 1:
27782
27808
  row = _e.sent();
27783
27809
  if (!row)
27784
27810
  return [2 /*return*/, undefined];
27785
- // Emit start editing event
27786
27811
  if (row.editing) {
27812
+ // Update focused column
27813
+ this.focusFirstColumn = true;
27814
+ this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
27815
+ // Emit start editing event
27787
27816
  this.editedRow = row;
27788
27817
  this.onStartEditingRow.emit(this.editedRow);
27789
27818
  }
27790
27819
  this.totalRowCount++;
27791
27820
  this.visibleRowCount++;
27792
27821
  this.markAsDirty({ emitEvent: false /*markForCheck() is called just after*/ });
27793
- this.markForCheck();
27822
+ // Emit event
27823
+ if (!opts || opts.emitEvent !== false)
27824
+ this.markForCheck();
27794
27825
  return [2 /*return*/, row];
27795
27826
  }
27796
27827
  });
@@ -33913,9 +33944,12 @@
33913
33944
  case 1:
33914
33945
  fetched = _a.sent();
33915
33946
  if (!(fetched && (event === null || event === void 0 ? void 0 : event.target) && event.target.complete)) return [3 /*break*/, 3];
33947
+ // Wait end of load
33916
33948
  return [4 /*yield*/, this.waitIdle()];
33917
33949
  case 2:
33950
+ // Wait end of load
33918
33951
  _a.sent();
33952
+ // Mark target event as completed (e.g. IonRefresher)
33919
33953
  event.target.complete();
33920
33954
  _a.label = 3;
33921
33955
  case 3: return [2 /*return*/];