@sumaris-net/ngx-components 0.26.0 → 0.26.4

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.
@@ -7760,6 +7760,87 @@
7760
7760
  },] }
7761
7761
  ];
7762
7762
 
7763
+ var MatBadgeIconDirective = /** @class */ (function () {
7764
+ function MatBadgeIconDirective(el) {
7765
+ this.el = el;
7766
+ }
7767
+ MatBadgeIconDirective.prototype.ngOnInit = function () {
7768
+ this.size = this.size || 'medium';
7769
+ this.color = this.color || 'primary';
7770
+ if (this.color === 'warn')
7771
+ this.color = 'warning';
7772
+ var fontSize;
7773
+ switch (this.size) {
7774
+ case 'large':
7775
+ fontSize = '24px';
7776
+ break;
7777
+ case 'medium':
7778
+ fontSize = '22px';
7779
+ break;
7780
+ case 'small':
7781
+ fontSize = '16px';
7782
+ break;
7783
+ }
7784
+ var badge = this.el.nativeElement.querySelector('.mat-badge-content');
7785
+ badge.style.display = 'flex';
7786
+ badge.style.alignItems = 'center';
7787
+ badge.style.justifyContent = 'center';
7788
+ if (this.fill !== 'clear') {
7789
+ badge.style.background = "var(--ion-color-" + this.color + ")";
7790
+ badge.style.color = "var(--ion-color-" + this.color + "-contrast)";
7791
+ }
7792
+ else {
7793
+ badge.style.color = "var(--ion-color-" + this.color + ")";
7794
+ badge.style.background = 'transparent';
7795
+ }
7796
+ if (this.matIcon) {
7797
+ badge.innerHTML = "<i class=\"material-icons\" style=\"font-size: " + fontSize + ";\">" + this.matIcon + "</i>";
7798
+ }
7799
+ else if (this.ionIcon) {
7800
+ badge.innerHTML = "<ion-icon style=\"font-size: " + fontSize + ";\" name=\"" + this.ionIcon + "\"></ion-icon>";
7801
+ }
7802
+ };
7803
+ return MatBadgeIconDirective;
7804
+ }());
7805
+ MatBadgeIconDirective.decorators = [
7806
+ { type: i0.Directive, args: [{
7807
+ selector: '[matBadgeIcon], [ionBadgeIcon]',
7808
+ inputs: [
7809
+ 'size: matBadgeSize',
7810
+ 'color: matBadgeColor',
7811
+ 'fill: matBadgeFill',
7812
+ ]
7813
+ },] }
7814
+ ];
7815
+ MatBadgeIconDirective.ctorParameters = function () { return [
7816
+ { type: i0.ElementRef }
7817
+ ]; };
7818
+ MatBadgeIconDirective.propDecorators = {
7819
+ matIcon: [{ type: i0.Input, args: ['matBadgeIcon',] }],
7820
+ ionIcon: [{ type: i0.Input, args: ['ionBadgeIcon',] }]
7821
+ };
7822
+
7823
+ var SharedMatBadgeIconModule = /** @class */ (function () {
7824
+ function SharedMatBadgeIconModule() {
7825
+ }
7826
+ return SharedMatBadgeIconModule;
7827
+ }());
7828
+ SharedMatBadgeIconModule.decorators = [
7829
+ { type: i0.NgModule, args: [{
7830
+ imports: [
7831
+ i1$4.CommonModule,
7832
+ i1$5.IonicModule,
7833
+ badge.MatBadgeModule,
7834
+ ],
7835
+ exports: [
7836
+ MatBadgeIconDirective
7837
+ ],
7838
+ declarations: [
7839
+ MatBadgeIconDirective
7840
+ ]
7841
+ },] }
7842
+ ];
7843
+
7763
7844
  var modules = [
7764
7845
  // Angular material components
7765
7846
  i1$3.MatCommonModule,
@@ -7801,7 +7882,8 @@
7801
7882
  SharedMatBooleanModule,
7802
7883
  SharedMatNumpadModule,
7803
7884
  SharedMatSwipeModule,
7804
- MaterialChipsModule
7885
+ MaterialChipsModule,
7886
+ SharedMatBadgeIconModule
7805
7887
  ];
7806
7888
  var SharedMaterialModule = /** @class */ (function () {
7807
7889
  function SharedMaterialModule() {
@@ -18462,7 +18544,7 @@
18462
18544
  MaterialTestingPage.decorators = [
18463
18545
  { type: i0.Component, args: [{
18464
18546
  selector: 'app-material-testing',
18465
- template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Material components</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <ion-list>\n\n <ion-item-divider>Shared Material components</ion-item-divider>\n\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./datetime')\">\n Date/Time field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./autocomplete')\">\n Autocomplete field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./latlong')\">\n Lat/Long field\n </ion-item>\n<!-- <ion-item tappable class=\"text-1x\" (click)=\"openPage('./numpad')\">-->\n<!-- Numeric pad component-->\n<!-- </ion-item>-->\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./swipe')\">\n Swipe component\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./chips')\">\n Chips component\n </ion-item>\n\n <ng-container *ngIf=\"pages && pages.length\">\n <ion-item-divider>Other components</ion-item-divider>\n\n <ion-item *ngFor=\"let item of pages\"\n tappable class=\"text-1x\"\n (click)=\"openPage(item.page)\">{{item.label}}</ion-item>\n\n </ng-container>\n </ion-list>\n\n</ion-content>\n"
18547
+ template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Material components</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <ion-list>\n\n <ion-item-divider>Shared Material components</ion-item-divider>\n\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./datetime')\">\n Date/Time field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./autocomplete')\">\n Autocomplete field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./latlong')\">\n Lat/Long field\n </ion-item>\n<!-- <ion-item tappable class=\"text-1x\" (click)=\"openPage('./numpad')\">-->\n<!-- Numeric pad component-->\n<!-- </ion-item>-->\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./swipe')\">\n Swipe component\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./chips')\">\n Chips component\n </ion-item>\n\n <ion-item-divider>Directive</ion-item-divider>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./badge-icon')\">\n Badge icon directive\n </ion-item>\n\n <ng-container *ngIf=\"pages && pages.length\">\n <ion-item-divider>Other components</ion-item-divider>\n\n <ion-item *ngFor=\"let item of pages\"\n tappable class=\"text-1x\"\n (click)=\"openPage(item.page)\">{{item.label}}</ion-item>\n\n </ng-container>\n </ion-list>\n\n</ion-content>\n"
18466
18548
  },] }
18467
18549
  ];
18468
18550
  MaterialTestingPage.ctorParameters = function () { return [
@@ -18747,6 +18829,18 @@
18747
18829
  { type: i1.FormBuilder }
18748
18830
  ]; };
18749
18831
 
18832
+ var MatBadgeIconTestPage = /** @class */ (function () {
18833
+ function MatBadgeIconTestPage() {
18834
+ }
18835
+ return MatBadgeIconTestPage;
18836
+ }());
18837
+ MatBadgeIconTestPage.decorators = [
18838
+ { type: i0.Component, args: [{
18839
+ selector: 'mat-badge-icon-test',
18840
+ template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>matBadgeIcon directive</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <!-- small badge -->\n <p>\n <ion-text color=\"tertiary\">\n <span matBadge matIcon=\"check\"\n matBadgeSize=\"small\"\n matBadgeColor=\"accent\"\n matBadgeOverlap=\"false\">Small badge</span>\n </ion-text>\n </p>\n\n <!-- medium badge -->\n <p>\n <ion-text matBadge matBadgeIcon=\"check\"\n matBadgeSize=\"medium\"\n matBadgeColor=\"tertiary\"\n matBadgeOverlap=\"false\"\n >Medium badge</ion-text>\n </p>\n\n <!-- small badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"close\" matBadgeSize=\"large\"\n matBadgeOverlap=\"false\">Large badge</ion-label>\n </p>\n\n <!-- default size badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"check\" matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge (no size, no color)\n </ion-label>\n </p>\n\n <!-- ion icon -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark\"\n matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge with ion-icon\n </ion-label>\n </p>\n\n <!-- ion icon clear -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark-circle\"\n matBadgeColor=\"tertiary\"\n matBadgeFill=\"clear\"\n matBadgeOverlap=\"false\">Badge with clear icon\n </ion-label>\n </p>\n\n\n</ion-content>\n"
18841
+ },] }
18842
+ ];
18843
+
18750
18844
  var routes$1 = [
18751
18845
  {
18752
18846
  path: '',
@@ -18782,6 +18876,11 @@
18782
18876
  path: 'chips',
18783
18877
  pathMatch: 'full',
18784
18878
  component: ChipsTestPage
18879
+ },
18880
+ {
18881
+ path: 'badge-icon',
18882
+ pathMatch: 'full',
18883
+ component: MatBadgeIconTestPage
18785
18884
  }
18786
18885
  ];
18787
18886
  var MaterialTestingModule = /** @class */ (function () {
@@ -18806,7 +18905,8 @@
18806
18905
  LatLongTestPage,
18807
18906
  // NumpadTestPage,
18808
18907
  SwipeTestPage,
18809
- ChipsTestPage
18908
+ ChipsTestPage,
18909
+ MatBadgeIconTestPage
18810
18910
  ],
18811
18911
  exports: [
18812
18912
  SharedMaterialModule,
@@ -25978,7 +26078,7 @@
25978
26078
  idChanged = isNotNil(data.id)
25979
26079
  && this.previousDataId !== undefined // Ignore if first loading (=undefined)
25980
26080
  && this.previousDataId !== data.id;
25981
- opts = Object.assign({ updateRoute: this._autoUpdateRoute && idChanged && !this.loading, openTabIndex: this._autoOpenNextTab && idChanged && this.computeNextTabIndex() }, opts);
26081
+ opts = Object.assign({ updateRoute: this._autoUpdateRoute && idChanged && !this.loading, openTabIndex: this._autoOpenNextTab && idChanged && isNil(this.previousDataId) && this.computeNextTabIndex() }, opts);
25982
26082
  this.data = data;
25983
26083
  this.previousDataId = data.id || null;
25984
26084
  promiseOrVoid = this.setValue(data);
@@ -25999,7 +26099,7 @@
25999
26099
  .then(function () { return _this.updateTitle(data); });
26000
26100
  }
26001
26101
  else {
26002
- // Update the tag group index
26102
+ // Update the next tab
26003
26103
  this.updateTabIndex(opts.openTabIndex);
26004
26104
  // Update the title.
26005
26105
  this.updateTitle(data);
@@ -26034,7 +26134,7 @@
26034
26134
  switch (_b.label) {
26035
26135
  case 0:
26036
26136
  this.queryParams = this.queryParams || {};
26037
- // Open the tab group
26137
+ // Open the next tab
26038
26138
  this.updateTabIndex(opts && opts.openTabIndex);
26039
26139
  // Save the opened tab into the queryParams
26040
26140
  this.queryParams.tab = this.selectedTabIndex;
@@ -26067,12 +26167,9 @@
26067
26167
  * Update the route location, and open the next tab
26068
26168
  */
26069
26169
  AppEntityEditor.prototype.updateTabIndex = function (tabIndex) {
26070
- // Open the second tab
26071
- if (isNotNil(tabIndex)) {
26072
- if (this.selectedTabIndex !== tabIndex) {
26073
- this.selectedTabIndex = tabIndex;
26074
- this.markForCheck();
26075
- }
26170
+ if (isNotNil(tabIndex) && tabIndex > this.selectedTabIndex) {
26171
+ this.selectedTabIndex = tabIndex;
26172
+ this.markForCheck();
26076
26173
  }
26077
26174
  };
26078
26175
  AppEntityEditor.prototype.saveAndClose = function (event, options) {
@@ -26315,7 +26412,7 @@
26315
26412
  });
26316
26413
  };
26317
26414
  AppEntityEditor.prototype.setError = function (err) {
26318
- console.error('[data-editor] ' + err && err.message || err, err);
26415
+ console.error('[entity-editor] Error: ' + err && err.message || '', err);
26319
26416
  var userMessage = err && err.message && this.translate.instant(err.message) || err;
26320
26417
  // Add details error (if any) under the main message
26321
26418
  var detailMessage = err && err.details && (err.details.message || err.details) || undefined;
@@ -26327,8 +26424,13 @@
26327
26424
  this.error = userMessage;
26328
26425
  };
26329
26426
  /* -- protected methods -- */
26427
+ /**
26428
+ * Return undefined to keep same tab
26429
+ * @protected
26430
+ */
26330
26431
  AppEntityEditor.prototype.computeNextTabIndex = function () {
26331
- return this.selectedTabIndex + 1 < this.tabCount ? this.selectedTabIndex + 1 : undefined;
26432
+ var nextTabIndex = this.selectedTabIndex + 1;
26433
+ return nextTabIndex < this.tabCount ? nextTabIndex : undefined;
26332
26434
  };
26333
26435
  AppEntityEditor.prototype.unload = function () {
26334
26436
  return __awaiter(this, void 0, void 0, function () {
@@ -28047,12 +28149,15 @@
28047
28149
  exports["ɵ0"] = ɵ0$5;
28048
28150
  exports["ɵa"] = CustomReuseStrategy;
28049
28151
  exports["ɵb"] = MatNumpadDomService;
28050
- exports["ɵc"] = isFocusableElement;
28051
- exports["ɵd"] = RegisterForm;
28052
- exports["ɵe"] = AccountValidatorService;
28053
- exports["ɵf"] = RegisterModal;
28054
- exports["ɵg"] = UserSettingsValidatorService;
28055
- exports["ɵh"] = LocalSettingsValidatorService;
28152
+ exports["ɵc"] = SharedMatBadgeIconModule;
28153
+ exports["ɵd"] = MatBadgeIconDirective;
28154
+ exports["ɵe"] = isFocusableElement;
28155
+ exports["ɵf"] = MatBadgeIconTestPage;
28156
+ exports["ɵg"] = RegisterForm;
28157
+ exports["ɵh"] = AccountValidatorService;
28158
+ exports["ɵi"] = RegisterModal;
28159
+ exports["ɵj"] = UserSettingsValidatorService;
28160
+ exports["ɵk"] = LocalSettingsValidatorService;
28056
28161
 
28057
28162
  Object.defineProperty(exports, '__esModule', { value: true });
28058
28163