@sumaris-net/ngx-components 2.4.47 → 2.4.49

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.
@@ -613,15 +613,10 @@ class Beans {
613
613
  }) === -1;
614
614
  }
615
615
  static collectById(array) {
616
- return this.collectByProperty(array, 'id');
617
- }
618
- static collectByProperty(array, propertyName) {
619
- return (array || []).reduce((res, item) => {
620
- res['' + propertyName] = item;
621
- return res;
622
- }, {});
616
+ return collectByProperty(array, 'id');
623
617
  }
624
618
  }
619
+ Beans.collectByProperty = collectByProperty;
625
620
  function findParentWithClass(elem, className) {
626
621
  if (!className)
627
622
  return undefined;
@@ -1570,8 +1565,8 @@ class HighlightPipe {
1570
1565
  const cleanedSearchText = removeDiacritics(searchRegexp).toUpperCase();
1571
1566
  const index = removeDiacritics(value.toUpperCase()).indexOf(cleanedSearchText);
1572
1567
  if (index !== -1) {
1573
- return value.substring(0, index - 1) +
1574
- '<b>' + value.substring(index, cleanedSearchText.length) + '</b>' +
1568
+ return value.substring(0, index) +
1569
+ '<b>' + value.substring(index, index + cleanedSearchText.length) + '</b>' +
1575
1570
  value.substring(index + cleanedSearchText.length);
1576
1571
  }
1577
1572
  return value;
@@ -2730,7 +2725,7 @@ function unwrapESModule(commonJSModule) {
2730
2725
  }
2731
2726
 
2732
2727
  // // Workaround for issue https://github.com/ng-packagr/ng-packagr/issues/2215
2733
- const moment$1 = unwrapESModule(momentImported);
2728
+ const moment = unwrapESModule(momentImported);
2734
2729
  const momentTZ = unwrapESModule(momentTZImported);
2735
2730
  const DATE_UNIX_TIMESTAMP = 'X';
2736
2731
  const DATE_UNIX_MS_TIMESTAMP = 'x';
@@ -2802,7 +2797,7 @@ class DateUtils {
2802
2797
  return momentDate.day() === weekday;
2803
2798
  }
2804
2799
  }
2805
- DateUtils.moment = moment$1;
2800
+ DateUtils.moment = moment;
2806
2801
  DateUtils.momentTZ = momentTZ;
2807
2802
  DateUtils.toDateISOString = toDateISOString;
2808
2803
  DateUtils.fromDateISOString = fromDateISOString;
@@ -11520,6 +11515,10 @@ const environment = Object.freeze({
11520
11515
  // TODO: make this works
11521
11516
  //offline: true,
11522
11517
  peerMinVersion: '1.8.0',
11518
+ defaultPeer: {
11519
+ host: '192.168.0.45',
11520
+ port: 8080
11521
+ },
11523
11522
  defaultPeers: [
11524
11523
  {
11525
11524
  host: 'localhost',
@@ -11570,7 +11569,8 @@ const environment = Object.freeze({
11570
11569
  // Basic auth (using Person.username)
11571
11570
  // username: 'admq2', password: 'q22006'
11572
11571
  // Token auth (using Person.pubkey)
11573
- username: 'admin@sumaris.net', password: 'admin',
11572
+ //username: 'admin@sumaris.net', password: 'admin',
11573
+ username: 'benoit.lavenier@e-is.pro', password: 'priezPourMoi!',
11574
11574
  },
11575
11575
  account: {
11576
11576
  enableListenChanges: true,
@@ -26931,7 +26931,7 @@ class AppTable {
26931
26931
  if (row.id === -1) {
26932
26932
  this.deleteNewRow(event, row);
26933
26933
  }
26934
- // Delete existing (bu not editing) row
26934
+ // Delete existing (but not editing) row
26935
26935
  else if (!row.editing) {
26936
26936
  this.deleteExistingRow(event, row, opts);
26937
26937
  }
@@ -27067,7 +27067,12 @@ class AppTable {
27067
27067
  });
27068
27068
  }
27069
27069
  deleteSelection(event, opts) {
27070
- return this.deleteRows(event, this.selection.selected, opts);
27070
+ return __awaiter(this, void 0, void 0, function* () {
27071
+ const deleteCount = yield this.deleteRows(event, this.selection.selected, opts);
27072
+ if (deleteCount > 0)
27073
+ this.selection.clear();
27074
+ return deleteCount;
27075
+ });
27071
27076
  }
27072
27077
  /**
27073
27078
  *
@@ -27078,7 +27083,11 @@ class AppTable {
27078
27083
  */
27079
27084
  deleteRow(event, row, opts) {
27080
27085
  return __awaiter(this, void 0, void 0, function* () {
27086
+ const isSelected = this.selection.isSelected(row);
27081
27087
  const deleteCount = yield this.deleteRows(event, [row], opts);
27088
+ // Unselect the deleted row
27089
+ if (deleteCount && isSelected)
27090
+ this.selection.deselect(row);
27082
27091
  return deleteCount === 1;
27083
27092
  });
27084
27093
  }
@@ -27098,6 +27107,7 @@ class AppTable {
27098
27107
  if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
27099
27108
  return 0; // SKip
27100
27109
  event === null || event === void 0 ? void 0 : event.preventDefault();
27110
+ this.resetError();
27101
27111
  if (!this._enabled || isEmptyArray(rows))
27102
27112
  return 0; // Skip is disabled, or no rows to delete
27103
27113
  if (this.loading && (!opts || opts.interactive !== false)) {
@@ -27840,8 +27850,8 @@ class AppTable {
27840
27850
  this.selection.clear();
27841
27851
  this.editedRow = undefined; // unselect row
27842
27852
  this._dataSource.cancelOrDelete(row);
27843
- this.onCancelOrDeleteRow.next(row);
27844
27853
  this.resetError();
27854
+ this.onCancelOrDeleteRow.next(row);
27845
27855
  this.totalRowCount--;
27846
27856
  this.visibleRowCount--;
27847
27857
  }
@@ -30945,7 +30955,12 @@ class AppAsyncTable {
30945
30955
  });
30946
30956
  }
30947
30957
  deleteSelection(event, opts) {
30948
- return this.deleteRows(event, this.selection.selected, opts);
30958
+ return __awaiter(this, void 0, void 0, function* () {
30959
+ const deleteCount = yield this.deleteRows(event, this.selection.selected, opts);
30960
+ if (deleteCount > 0)
30961
+ this.selection.clear();
30962
+ return deleteCount;
30963
+ });
30949
30964
  }
30950
30965
  /**
30951
30966
  *
@@ -30975,6 +30990,7 @@ class AppAsyncTable {
30975
30990
  if (event === null || event === void 0 ? void 0 : event.defaultPrevented)
30976
30991
  return 0; // SKip
30977
30992
  event === null || event === void 0 ? void 0 : event.preventDefault();
30993
+ this.resetError();
30978
30994
  if (!this._enabled || isEmptyArray(rows))
30979
30995
  return 0; // Skip is disabled, or no rows to delete
30980
30996
  if (this.loading && (!opts || opts.interactive !== false)) {
@@ -33421,7 +33437,8 @@ class JobModule {
33421
33437
  JobModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: JobModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
33422
33438
  JobModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: JobModule, declarations: [JobProgressionIcon,
33423
33439
  JobProgressionList], imports: [CommonModule,
33424
- SharedModule, i1$2.TranslateModule], exports: [JobProgressionIcon] });
33440
+ SharedModule, i1$2.TranslateModule], exports: [JobProgressionIcon,
33441
+ JobProgressionList] });
33425
33442
  JobModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: JobModule, imports: [CommonModule,
33426
33443
  SharedModule,
33427
33444
  TranslateModule.forChild()] });
@@ -33438,7 +33455,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
33438
33455
  JobProgressionList
33439
33456
  ],
33440
33457
  exports: [
33441
- JobProgressionIcon
33458
+ JobProgressionIcon,
33459
+ JobProgressionList
33442
33460
  ]
33443
33461
  }]
33444
33462
  }] });
@@ -36409,7 +36427,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
36409
36427
  }] }];
36410
36428
  } });
36411
36429
 
36412
- const moment = momentImported;
36413
36430
  class UserEventTestingPage {
36414
36431
  constructor(userEventService, router, alertController, translateService) {
36415
36432
  this.userEventService = userEventService;