geonetwork-ui 2.11.0-dev.a5c259d9e → 2.11.0-dev.a63e6e32a

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.
Files changed (51) hide show
  1. package/fesm2022/geonetwork-ui.mjs +477 -295
  2. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  3. package/index.d.ts +137 -75
  4. package/index.d.ts.map +1 -1
  5. package/package.json +2 -1
  6. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +107 -34
  7. package/src/libs/common/domain/src/lib/model/search/filter.model.ts +20 -1
  8. package/src/libs/feature/map/src/index.ts +0 -1
  9. package/src/libs/feature/map/src/lib/feature-map.module.ts +1 -8
  10. package/src/libs/feature/router/src/lib/default/state/query-params.utils.ts +1 -1
  11. package/src/libs/feature/search/src/index.ts +2 -0
  12. package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.html +5 -4
  13. package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +20 -20
  14. package/src/libs/feature/{map/src/lib → search/src/lib/geocoding}/geocoding.service.ts +5 -1
  15. package/src/libs/feature/search/src/lib/location-search/location-search.component.html +8 -0
  16. package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +40 -0
  17. package/src/libs/feature/search/src/lib/search-filters-summary-item/search-filters-summary-item.component.ts +18 -8
  18. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +8 -2
  19. package/src/libs/feature/search/src/lib/utils/service/fields.ts +49 -5
  20. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +2 -1
  21. package/src/libs/ui/inputs/src/index.ts +1 -0
  22. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +10 -1
  23. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +8 -0
  24. package/src/libs/ui/inputs/src/lib/date-adapter.providers.ts +30 -0
  25. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +3 -24
  26. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.css +37 -3
  27. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.html +135 -16
  28. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.ts +166 -29
  29. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +3 -7
  30. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +7 -4
  31. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +12 -9
  32. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.model.ts +2 -2
  33. package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +3 -9
  34. package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +26 -2
  35. package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +2 -0
  36. package/src/libs/util/shared/src/index.ts +1 -0
  37. package/src/libs/util/shared/src/lib/autofocus.directive.ts +26 -0
  38. package/src/libs/util/shared/src/lib/links/link-utils.ts +19 -10
  39. package/src/libs/util/shared/src/lib/services/date.service.ts +3 -3
  40. package/src/libs/util/shared/src/lib/utils/geojson.ts +8 -0
  41. package/translations/de.json +9 -5
  42. package/translations/en.json +8 -4
  43. package/translations/es.json +7 -3
  44. package/translations/fr.json +9 -5
  45. package/translations/it.json +7 -3
  46. package/translations/nl.json +7 -3
  47. package/translations/pt.json +7 -3
  48. package/translations/sk.json +7 -3
  49. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.css +0 -0
  50. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +0 -41
  51. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +0 -112
@@ -1,41 +0,0 @@
1
- <gn-ui-search-input
2
- [(value)]="searchText"
3
- (valueChange)="onSearchChange($event)"
4
- (keyup.enter)="onEnterPress()"
5
- [placeholder]="'map.geocoding.placeholder' | translate"
6
- >
7
- </gn-ui-search-input>
8
- @if (results && results.length) {
9
- <ul
10
- class="bg-gray-50 border border-gray-200 w-full mt-2 shadow-sm rounded-lg"
11
- >
12
- @for (result of results; track result) {
13
- <li
14
- (click)="zoomToLocation(result)"
15
- class="flex items-center pl-8 pr-4 py-2 border-b border-gray-200 relative cursor-pointer hover:bg-blue-100 hover:text-gray-800 transition duration-300 ease-in-out"
16
- >
17
- <svg
18
- class="stroke-current text-blue-500 absolute w-5 h-5 left-3 top-3"
19
- xmlns="http://www.w3.org/2000/svg"
20
- fill="none"
21
- viewBox="0 0 24 24"
22
- stroke="currentColor"
23
- >
24
- <path
25
- stroke-linecap="round"
26
- stroke-linejoin="round"
27
- stroke-width="2"
28
- d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
29
- />
30
- <path
31
- stroke-linecap="round"
32
- stroke-linejoin="round"
33
- stroke-width="2"
34
- d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"
35
- />
36
- </svg>
37
- <span class="font-sans font-semibold ml-4">{{ result.label }}</span>
38
- </li>
39
- }
40
- </ul>
41
- }
@@ -1,112 +0,0 @@
1
- import { Component, OnDestroy, inject } from '@angular/core'
2
- import { catchError, firstValueFrom, from, Subject, takeUntil } from 'rxjs'
3
- import { debounceTime, switchMap } from 'rxjs/operators'
4
- import { GeocodingService } from '../geocoding.service'
5
- import { MapFacade } from '../+state/map.facade'
6
-
7
- import { SearchInputComponent } from '../../../../../../libs/ui/inputs/src'
8
- import { TranslatePipe } from '@ngx-translate/core'
9
- import { MapContextView } from '@geospatial-sdk/core'
10
-
11
- @Component({
12
- selector: 'gn-ui-geocoding',
13
- templateUrl: './geocoding.component.html',
14
- styleUrls: ['./geocoding.component.css'],
15
- standalone: true,
16
- imports: [SearchInputComponent, TranslatePipe],
17
- })
18
- export class GeocodingComponent implements OnDestroy {
19
- private mapFacade = inject(MapFacade)
20
- private geocodingService = inject(GeocodingService)
21
-
22
- searchText = ''
23
- results: any[] = []
24
- searchTextChanged = new Subject<string>()
25
- destroy$ = new Subject<void>()
26
- errorMessage: string | null = null
27
-
28
- constructor() {
29
- this.searchTextChanged
30
- .pipe(
31
- debounceTime(300),
32
- switchMap((searchText) => {
33
- return from(this.geocodingService.query(searchText)).pipe(
34
- catchError((error) => {
35
- this.errorMessage =
36
- 'An error occurred while searching. Please try again.'
37
- console.error(error)
38
- return []
39
- })
40
- )
41
- }),
42
- takeUntil(this.destroy$)
43
- )
44
- .subscribe((results) => {
45
- this.results = results
46
- })
47
- }
48
-
49
- ngOnDestroy() {
50
- this.destroy$.next()
51
- this.destroy$.complete()
52
- }
53
-
54
- onSearchChange(searchText: string) {
55
- if (!searchText) {
56
- this.clearSearch()
57
- return
58
- } else {
59
- this.searchTextChanged.next(searchText)
60
- }
61
- }
62
-
63
- clearSearch() {
64
- this.searchText = ''
65
- this.results = []
66
- this.errorMessage = null
67
- }
68
-
69
- async zoomToLocation(result: any) {
70
- const geometry = result.geom
71
-
72
- if (geometry.type === 'Point') {
73
- await this.zoomToPoint(geometry.coordinates)
74
- } else if (geometry.type === 'Polygon') {
75
- await this.zoomToPolygon(geometry.coordinates)
76
- } else {
77
- console.error(`Unsupported geometry type: ${geometry.type}`)
78
- }
79
- }
80
-
81
- async zoomToPoint(pointCoords: [number, number]) {
82
- const context = await firstValueFrom(this.mapFacade.context$)
83
- const view: MapContextView = {
84
- center: pointCoords,
85
- zoom: 10,
86
- }
87
- this.mapFacade.applyContext({
88
- ...context,
89
- view,
90
- })
91
- }
92
-
93
- async zoomToPolygon(polygonCoords: [[number, number][]]) {
94
- const context = await firstValueFrom(this.mapFacade.context$)
95
- const view: MapContextView = {
96
- geometry: {
97
- type: 'Polygon',
98
- coordinates: polygonCoords,
99
- },
100
- }
101
- this.mapFacade.applyContext({
102
- ...context,
103
- view,
104
- })
105
- }
106
-
107
- onEnterPress() {
108
- if (this.results && this.results.length > 0) {
109
- this.zoomToLocation(this.results[0])
110
- }
111
- }
112
- }