@sumaris-net/ngx-components 2.4.27 → 2.4.28

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.
@@ -56,7 +56,7 @@ import * as i6 from '@angular/material/autocomplete';
56
56
  import { MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteModule, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';
57
57
  import * as i1$3 from '@angular/forms';
58
58
  import { Validators, NG_VALUE_ACCESSOR, AbstractControl, UntypedFormGroup, UntypedFormArray, UntypedFormControl, ReactiveFormsModule, FormControl, FormGroup } from '@angular/forms';
59
- import { timer, merge, fromEvent, BehaviorSubject, Subscription, Subject, isObservable, from, of, noop as noop$9, Observable, forkJoin, defer, interval, EMPTY } from 'rxjs';
59
+ import { timer, merge, fromEvent, BehaviorSubject, Subscription, Subject, isObservable, of, from, noop as noop$9, Observable, forkJoin, defer, interval, EMPTY } from 'rxjs';
60
60
  import { filter, map, takeUntil, first, switchMap, tap, debounceTime, startWith, distinctUntilChanged, mergeMap, catchError, throttleTime, skip, bufferWhen, mapTo, take } from 'rxjs/operators';
61
61
  import { trigger, transition, style, animate, state } from '@angular/animations';
62
62
  import * as i1 from '@ionic/angular';
@@ -3471,6 +3471,23 @@ class TranslateContextService {
3471
3471
  // No context: do a normal translate
3472
3472
  if (!key || !isNil(context))
3473
3473
  return this.translate.get(key, interpolateParams);
3474
+ if (Array.isArray(key)) {
3475
+ if (!key.length)
3476
+ return of();
3477
+ // Observe the first key, then add other
3478
+ return this.get(key[0])
3479
+ .pipe(map(translation => {
3480
+ return key.slice(1) // Skip 1, because we already have it
3481
+ .reduce((map, k) => {
3482
+ map[k] = this.instant(k, context);
3483
+ return map;
3484
+ },
3485
+ // Init with the first value
3486
+ {
3487
+ [key[0]]: translation
3488
+ });
3489
+ }));
3490
+ }
3474
3491
  // Compute a contextual i18n key, using the context as suffix
3475
3492
  const contextualKeys = this.contextualKeys(key, context);
3476
3493
  // Return the contextual translation, or default of not exists
@@ -3481,6 +3498,12 @@ class TranslateContextService {
3481
3498
  // No context: do a normal translate
3482
3499
  if (!key || isNilOrBlank(context))
3483
3500
  return this.translate.instant(key, interpolateParams);
3501
+ if (Array.isArray(key)) {
3502
+ return key.reduce((map, k) => {
3503
+ map[k] = this.instant(k, context);
3504
+ return map;
3505
+ }, {});
3506
+ }
3484
3507
  // Compute a contextual i18n key, using the context as suffix
3485
3508
  const contextualKeys = this.contextualKeys(key, context);
3486
3509
  const translations = this.translate.instant(contextualKeys, interpolateParams);
@@ -19426,11 +19449,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
19426
19449
  class Alerts {
19427
19450
  /**
19428
19451
  * Ask the user to save before leaving. If return undefined: user has cancelled
19452
+ * <p>
19453
+ * from a routed page, prefer using ComponentDirtyGuard
19429
19454
  *
19430
19455
  * @param alertCtrl
19431
19456
  * @param translate
19432
19457
  * @param event
19433
- * @deprecated prefer ComponentDirtyGuard
19434
19458
  */
19435
19459
  static async askSaveBeforeLeave(alertCtrl, translate, event) {
19436
19460
  let confirm = false;
@@ -26584,7 +26608,7 @@ class AppTable {
26584
26608
  return this.clickRow(null, row);
26585
26609
  }
26586
26610
  /**
26587
- * Try to select row by data. Will use dataEquals() (that call EntityUtils.equals()) to find same row's data
26611
+ * Try to select row by data. Will use equals() to find same row's data
26588
26612
  * @param data
26589
26613
  */
26590
26614
  async selectRowByData(data) {
@@ -27120,7 +27144,7 @@ class AppTable {
27120
27144
  }
27121
27145
  }
27122
27146
  /**
27123
- * Compare data equality (default by id)
27147
+ * Compare data equality (default by id, using EntityUtils.equals())
27124
27148
  * Can be overridden to add additional properties to compare
27125
27149
  *
27126
27150
  * @param d1