@igo2/geo 21.0.0-next.36 → 21.0.0-next.38

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.
@@ -20,12 +20,12 @@ import html2canvas from 'html2canvas';
20
20
  import jsPDF, { jsPDF as jsPDF$1 } from 'jspdf';
21
21
  import { autoTable } from 'jspdf-autotable';
22
22
  import moment from 'moment';
23
- import { Observable, of, combineLatest, BehaviorSubject, interval, tap, merge, fromEvent, firstValueFrom, Subject, forkJoin, map as map$1, catchError as catchError$1, debounceTime as debounceTime$1, switchMap, EMPTY, timer, filter as filter$1, take, from, Subscription, pairwise, lastValueFrom, throwError, first as first$1, zip } from 'rxjs';
23
+ import { Observable, of, combineLatest, BehaviorSubject, interval, tap, merge, fromEvent, firstValueFrom, Subject, forkJoin, map as map$1, catchError as catchError$1, debounceTime as debounceTime$1, switchMap, debounce, timer, filter as filter$1, take, from, Subscription, pairwise, lastValueFrom, throwError, first as first$1, zip, EMPTY } from 'rxjs';
24
24
  import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
25
25
  import { fetchImageFromDepotUrl, ImageErrorDirective, SecureImagePipe } from '@igo2/common/image';
26
26
  import { saveAs } from 'file-saver';
27
27
  import JSZip from 'jszip';
28
- import { concatMap, distinctUntilChanged, map, timeout, first, catchError, debounceTime, skip, filter, switchMap as switchMap$1, debounce, mergeMap, skipWhile, takeUntil, take as take$1, finalize, startWith } from 'rxjs/operators';
28
+ import { concatMap, distinctUntilChanged, map, timeout, first, catchError, debounceTime, skip, filter, switchMap as switchMap$1, mergeMap, skipWhile, takeUntil, take as take$1, finalize, debounce as debounce$1, startWith } from 'rxjs/operators';
29
29
  import { getUid } from 'ol/util';
30
30
  import { __decorate, __param, __metadata } from 'tslib';
31
31
  import olSourceImageWMS from 'ol/source/ImageWMS';
@@ -12580,6 +12580,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
12580
12580
  }] });
12581
12581
 
12582
12582
  class LayerSearchComponent {
12583
+ destroyRef = inject(DestroyRef);
12583
12584
  control = new FormControl();
12584
12585
  initialValue = input(...(ngDevMode ? [undefined, { debugName: "initialValue" }] : /* istanbul ignore next */ []));
12585
12586
  floatLabel = input('auto', ...(ngDevMode ? [{ debugName: "floatLabel" }] : /* istanbul ignore next */ []));
@@ -12593,7 +12594,9 @@ class LayerSearchComponent {
12593
12594
  emitEvent: false
12594
12595
  });
12595
12596
  }
12596
- this.control.valueChanges.pipe(debounceTime$1(300)).subscribe((value) => {
12597
+ this.control.valueChanges
12598
+ .pipe(debounce((value) => (value ? timer(300) : of(0))), takeUntilDestroyed(this.destroyRef))
12599
+ .subscribe((value) => {
12597
12600
  this.searchChange.emit(value);
12598
12601
  });
12599
12602
  }
@@ -13123,6 +13126,10 @@ class LayerViewerComponent {
13123
13126
  * @internal
13124
13127
  */
13125
13128
  ngOnInit() {
13129
+ const initialKeyword = this.options()?.filterAndSortOptions?.keyword;
13130
+ if (initialKeyword) {
13131
+ this.keyword$.next(initialKeyword);
13132
+ }
13126
13133
  const baseObs$ = [
13127
13134
  this.layerController.layers$,
13128
13135
  this.keyword$
@@ -13147,11 +13154,7 @@ class LayerViewerComponent {
13147
13154
  this.isLoading.set(false);
13148
13155
  this.cdr.markForCheck();
13149
13156
  });
13150
- this.keyword$
13151
- .pipe(debounce(() => {
13152
- return this.layers?.length === 0 ? EMPTY : timer(50);
13153
- }))
13154
- .subscribe((keyword) => {
13157
+ this.keyword$.subscribe((keyword) => {
13155
13158
  this.isDragDropDisabled = !!keyword;
13156
13159
  this.appliedFilterAndSort.emit({
13157
13160
  keyword
@@ -28935,7 +28938,7 @@ class TableDataService {
28935
28938
  }
28936
28939
  const columns = sourceFields?.length
28937
28940
  ? await this.getSourceColumns(sourceFields, relations)
28938
- : this.getRawColumn(features[0]);
28941
+ : this.getRawColumns(features);
28939
28942
  return this.transformFeaturesToExportFormat(features, columns);
28940
28943
  }
28941
28944
  async getSourceColumns(sourceFields, relations) {
@@ -28945,18 +28948,20 @@ class TableDataService {
28945
28948
  : [];
28946
28949
  return [...sourceFieldsColumns, ...relationsColumns].filter((col) => col.visible !== false);
28947
28950
  }
28948
- getRawColumn(feature) {
28949
- const geometryName = feature.getGeometryName();
28950
- return feature
28951
- .getKeys()
28952
- .filter((key) => !key.startsWith('_') &&
28953
- key !== 'geometry' &&
28954
- key !== geometryName &&
28955
- !/boundedby/gi.test(key))
28956
- .map((key) => ({
28957
- name: key,
28958
- title: key
28959
- }));
28951
+ getRawColumns(features) {
28952
+ const keys = new Set();
28953
+ for (const feature of features) {
28954
+ const geometryName = feature.getGeometryName();
28955
+ for (const key of feature.getKeys()) {
28956
+ if (!key.startsWith('_') &&
28957
+ key !== 'geometry' &&
28958
+ key !== geometryName &&
28959
+ !/boundedby/gi.test(key)) {
28960
+ keys.add(key);
28961
+ }
28962
+ }
28963
+ }
28964
+ return Array.from(keys, (key) => ({ name: key, title: key }));
28960
28965
  }
28961
28966
  async buildFromFields(fields) {
28962
28967
  return Promise.all(fields.map((field) => this.getColumnFromSourceField(field)));
@@ -32049,7 +32054,7 @@ class SearchBarComponent {
32049
32054
  this.empty$.next(term === undefined || term.length === 0);
32050
32055
  });
32051
32056
  this.stream$$ = this.stream$
32052
- .pipe(debounce(() => timer(this.debounce())))
32057
+ .pipe(debounce$1(() => timer(this.debounce())))
32053
32058
  .subscribe((term) => this.onSetTerm(term));
32054
32059
  this.handlePlaceholder();
32055
32060
  this.searchType$$ = this.searchType$
@@ -32953,7 +32958,7 @@ class SearchResultsComponent {
32953
32958
  liftResults() {
32954
32959
  return this.store()
32955
32960
  ?.stateView.all$()
32956
- .pipe(debounce((results) => {
32961
+ .pipe(debounce$1((results) => {
32957
32962
  return results.length === 0 ? EMPTY : timer(200);
32958
32963
  }), map((results) => {
32959
32964
  return this.groupResults(results.map((r) => r.entity).sort(this.sortByOrder));