@sumaris-net/ngx-components 1.20.39 → 1.20.41

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.
@@ -46,7 +46,7 @@
46
46
  var SPACE_PLACEHOLDER_CHAR = '\u2000';
47
47
  var KEYBOARD_HIDE_DELAY_MS = 250; // 1s
48
48
 
49
- /*! *****************************************************************************
49
+ /******************************************************************************
50
50
  Copyright (c) Microsoft Corporation.
51
51
 
52
52
  Permission to use, copy, modify, and/or distribute this software for any
@@ -144,7 +144,7 @@
144
144
  function step(op) {
145
145
  if (f)
146
146
  throw new TypeError("Generator is already executing.");
147
- while (_)
147
+ while (g && (g = 0, op[0] && (_ = 0)), _)
148
148
  try {
149
149
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
150
150
  return t;
@@ -208,7 +208,11 @@
208
208
  var __createBinding = Object.create ? (function (o, m, k, k2) {
209
209
  if (k2 === undefined)
210
210
  k2 = k;
211
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
211
+ var desc = Object.getOwnPropertyDescriptor(m, k);
212
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
213
+ desc = { enumerable: true, get: function () { return m[k]; } };
214
+ }
215
+ Object.defineProperty(o, k2, desc);
212
216
  }) : (function (o, m, k, k2) {
213
217
  if (k2 === undefined)
214
218
  k2 = k;
@@ -363,6 +367,11 @@
363
367
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
364
368
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
365
369
  }
370
+ function __classPrivateFieldIn(state, receiver) {
371
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
372
+ throw new TypeError("Cannot use 'in' operator on non-object");
373
+ return typeof state === "function" ? receiver === state : state.has(receiver);
374
+ }
366
375
 
367
376
  function isNil(obj) {
368
377
  return obj === undefined || obj === null;
@@ -18726,8 +18735,6 @@
18726
18735
  PlatformService.prototype.configureTranslate = function () {
18727
18736
  var _this = this;
18728
18737
  console.info('[platform] Configuring i18n ...');
18729
- // this language will be used as a fallback when a translation isn't found in the current language
18730
- this.translate.setDefaultLang(this.environment.defaultLocale);
18731
18738
  // When locale changes, apply to date adapter
18732
18739
  this.translate.onLangChange.subscribe(function (event) {
18733
18740
  if (event && event.lang) {
@@ -18749,6 +18756,10 @@
18749
18756
  _this.dateAdapter.setLocale(moment$4.locale());
18750
18757
  }
18751
18758
  });
18759
+ // This language will be used as a fallback when a translation isn't found in the current language
18760
+ this.translate.setDefaultLang(this.environment.defaultLocale);
18761
+ // Use this language (must be called after onLangChange subscription)
18762
+ this.translate.use(this.environment.defaultLocale);
18752
18763
  this.settings.onChange.subscribe(function (data) {
18753
18764
  if (data && data.locale && data.locale !== _this.translate.currentLang) {
18754
18765
  _this.translate.use(data.locale);
@@ -19309,7 +19320,7 @@
19309
19320
  { type: i0.Component, args: [{
19310
19321
  selector: 'app-upload-file',
19311
19322
  template: "<div *ngIf=\"!uniqueFile || files.length === 0\"\n class=\"container\"\n appDragAndDrop (fileDropped)=\"onFileDropped($event)\">\n <input\n type=\"file\"\n #fileDropRef\n id=\"fileDropRef\"\n multiple\n [accept]=\"fileExtension\"\n (change)=\"fileBrowseHandler($any($event.target).files)\"\n />\n <mat-icon style=\"font-size: xx-large\" color=\"accent\">file_upload</mat-icon>\n <ion-label\n [innerHTML]=\"\n 'FILE.UPLOAD.DRAG_AND_DROP' | translate: { extension: !fileExtension ? '' : ' (' + fileExtension + ')' }\n \"\n ></ion-label>\n <ion-button>{{ 'FILE.UPLOAD.BROWSE' | translate }}</ion-button>\n</div>\n<div class=\"files-list\">\n <div *ngFor=\"let file of files; index as i\"\n class=\"single-file\"\n [class.deleting]=\"file.deleting\">\n <mat-icon>description</mat-icon>\n <div class=\"info\">\n <h4 class=\"name\">\n {{ file.name }}\n </h4>\n <p class=\"size\">\n {{ file.size | fileSize }}\n </p>\n <ion-progress-bar *ngIf=\"!file.error\"\n [value]=\"file.progress||0\"\n [type]=\"(file.deleting || file.progress === -1) ? 'indeterminate' : 'determinate'\"></ion-progress-bar>\n <ion-label *ngIf=\"file.error\" color=\"danger\" [innerHTML]=\"file.error | translate\"></ion-label>\n </div>\n <!-- remote from list (before importation) -->\n <button *ngIf=\"!(file.progress) || file.error\" mat-icon-button (click)=\"deleteFile(i)\">\n <mat-icon>clear</mat-icon>\n </button>\n <!-- delete file (remotely - after importation) -->\n <button *ngIf=\"file.progress === 1 && !!deleteFn && !file.deleting\" mat-icon-button (click)=\"deleteFile(i)\">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n</div>\n",
19312
- styles: [".container{width:calc(100% - 3rem);min-height:200px;padding:2rem;text-align:center;border:1px dashed #979797;position:relative;margin:1.5rem}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0;cursor:pointer}.container ion-label{display:block;font-size:20px;font-weight:600;color:#38424c}.container label{display:inline-block;color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.fileover{-webkit-animation:shake 1s;animation:shake 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.files-list{max-height:300px;overflow:auto}.files-list .single-file{display:flex;flex-grow:1;padding:.5rem;justify-content:space-between;align-items:center;border:1px dashed #979797;margin-bottom:1rem}.files-list .single-file.deleting .name{color:grey!important;font-style:italic!important}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0 0 .25rem}.files-list .single-file .info{width:100%}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0deg)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0deg)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0deg)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0deg)}to{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0deg)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0deg)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0deg)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0deg)}to{transform:translate(1px,-2px) rotate(-1deg)}}"]
19323
+ styles: [".container{width:calc(100% - 3rem);min-height:200px;padding:2rem;text-align:center;border:1px dashed #979797;position:relative;margin:1.5rem}.container input{opacity:0;position:absolute;z-index:2;width:100%;height:100%;top:0;left:0;cursor:pointer}.container ion-label{display:block;font-size:20px;font-weight:600;color:#38424c}.container label{display:inline-block;color:#fff;width:183px;height:44px;border-radius:21.5px;background-color:#db202f;padding:8px 16px}.fileover{animation:shake 1s;animation-iteration-count:infinite}.files-list{max-height:300px;overflow:auto}.files-list .single-file{display:flex;flex-grow:1;padding:.5rem;justify-content:space-between;align-items:center;border:1px dashed #979797;margin-bottom:1rem}.files-list .single-file.deleting .name{color:grey!important;font-style:italic!important}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0 0 .25rem}.files-list .single-file .info{width:100%}@keyframes shake{0%{transform:translate(1px,1px) rotate(0deg)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0deg)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0deg)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0deg)}to{transform:translate(1px,-2px) rotate(-1deg)}}"]
19313
19324
  },] }
19314
19325
  ];
19315
19326
  UploadFileComponent.ctorParameters = function () { return [
@@ -29775,18 +29786,22 @@
29775
29786
  console.debug(this._logPrefix + 'Saving data...');
29776
29787
  _c.label = 2;
29777
29788
  case 2:
29778
- _c.trys.push([2, 4, 5, 6]);
29779
- saved = Promise.all((this.tables || [])
29780
- .filter(function (c) { return c.dirty; })
29781
- .map(function (c) { return c.save(); }))
29782
- .then(function (res) { return res.findIndex(function (r) { return r !== true; }) === -1; });
29789
+ _c.trys.push([2, 5, 6, 7]);
29790
+ return [4 /*yield*/, this.saveDirtyTables()];
29791
+ case 3:
29792
+ saved = _c.sent();
29793
+ if (!saved)
29794
+ return [2 /*return*/, false];
29795
+ // Fill data
29783
29796
  _b = this;
29784
29797
  return [4 /*yield*/, this.getValue()];
29785
- case 3:
29798
+ case 4:
29799
+ // Fill data
29786
29800
  _b.data = _c.sent();
29801
+ // Mark as submitted
29787
29802
  this.submitted = true;
29788
- return [2 /*return*/, saved];
29789
- case 4:
29803
+ return [2 /*return*/, true];
29804
+ case 5:
29790
29805
  err_2 = _c.sent();
29791
29806
  this.submitted = true;
29792
29807
  this.setError(err_2);
@@ -29795,10 +29810,10 @@
29795
29810
  this.markAsDirty();
29796
29811
  this.enable();
29797
29812
  return [2 /*return*/, false];
29798
- case 5:
29813
+ case 6:
29799
29814
  this.markAsSaved();
29800
29815
  return [7 /*endfinally*/];
29801
- case 6: return [2 /*return*/];
29816
+ case 7: return [2 /*return*/];
29802
29817
  }
29803
29818
  });
29804
29819
  });
@@ -29922,6 +29937,22 @@
29922
29937
  this.markForCheck();
29923
29938
  };
29924
29939
  /* -- protected methods -- */
29940
+ AppEntityEditorModal.prototype.saveDirtyTables = function () {
29941
+ return __awaiter(this, void 0, void 0, function () {
29942
+ var results, saved;
29943
+ return __generator(this, function (_b) {
29944
+ switch (_b.label) {
29945
+ case 0: return [4 /*yield*/, Promise.all((this.tables || [])
29946
+ .filter(function (c) { return c.dirty; })
29947
+ .map(function (c) { return c.save(); }))];
29948
+ case 1:
29949
+ results = _b.sent();
29950
+ saved = results.findIndex(function (result) { return result !== true; }) === -1;
29951
+ return [2 /*return*/, saved];
29952
+ }
29953
+ });
29954
+ });
29955
+ };
29925
29956
  AppEntityEditorModal.prototype.waitWhilePending = function (opts) {
29926
29957
  return AppFormUtils.waitWhilePending(this, opts);
29927
29958
  };