geonetwork-ui 2.8.0-dev.94b119e28 → 2.8.0-dev.b7a1670bc
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.
- package/esm2022/libs/api/metadata-converter/src/lib/common/resource-types.mjs +6 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +6 -4
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/constant.mjs +2 -1
- package/esm2022/libs/feature/dataviz/src/index.mjs +1 -2
- package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +9 -2
- package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +3 -3
- package/esm2022/libs/feature/map/src/lib/map-state-container/map-state-container.component.mjs +2 -2
- package/esm2022/libs/feature/record/src/index.mjs +2 -1
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.mjs +4 -4
- package/esm2022/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -3
- package/esm2022/libs/feature/record/src/lib/stac-view/stac-view.component.mjs +230 -0
- package/esm2022/libs/feature/record/src/lib/stac-view/utils.mjs +26 -0
- package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +2 -2
- package/esm2022/libs/feature/search/src/lib/constants.mjs +2 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +36 -22
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +2 -1
- package/esm2022/libs/ui/elements/src/index.mjs +2 -1
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.mjs +18 -0
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +21 -7
- package/esm2022/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.mjs +35 -0
- package/esm2022/libs/ui/layout/src/lib/paginable.interface.mjs +1 -1
- package/esm2022/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.mjs +13 -5
- package/esm2022/libs/ui/map/src/lib/components/map-container/map-container.component.mjs +86 -32
- package/esm2022/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.mjs +1 -1
- package/esm2022/libs/ui/widgets/src/lib/loading-mask/loading-mask.component.mjs +3 -3
- package/esm2022/translations/de.json +7 -3
- package/esm2022/translations/en.json +7 -3
- package/esm2022/translations/es.json +7 -3
- package/esm2022/translations/fr.json +7 -3
- package/esm2022/translations/it.json +7 -3
- package/esm2022/translations/nl.json +7 -3
- package/esm2022/translations/pt.json +7 -3
- package/esm2022/translations/sk.json +7 -3
- package/fesm2022/{geonetwork-ui-date-locales-MYnkDJ5h.mjs → geonetwork-ui-date-locales-DhlIiWpT.mjs} +2 -2
- package/fesm2022/{geonetwork-ui-date-locales-MYnkDJ5h.mjs.map → geonetwork-ui-date-locales-DhlIiWpT.mjs.map} +1 -1
- package/fesm2022/geonetwork-ui.mjs +563 -195
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/common/resource-types.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/common/resource-types.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/constant.d.ts.map +1 -1
- package/libs/feature/dataviz/src/index.d.ts +0 -1
- package/libs/feature/dataviz/src/index.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +2 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/record/src/index.d.ts +1 -0
- package/libs/feature/record/src/index.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +5 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.d.ts +12 -5
- package/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.d.ts +3 -1
- package/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +5 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/stac-view/stac-view.component.d.ts +53 -0
- package/libs/feature/record/src/lib/stac-view/stac-view.component.d.ts.map +1 -0
- package/libs/feature/record/src/lib/stac-view/utils.d.ts +7 -0
- package/libs/feature/record/src/lib/stac-view/utils.d.ts.map +1 -0
- package/libs/feature/search/src/lib/constants.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +1 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.d.ts +8 -0
- package/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/index.d.ts +1 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts +5 -0
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.d.ts +12 -0
- package/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/paginable.interface.d.ts +3 -3
- package/libs/ui/layout/src/lib/paginable.interface.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts +2 -1
- package/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts +24 -14
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/libs/api/metadata-converter/src/lib/common/resource-types.ts +11 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +11 -3
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +1 -0
- package/src/libs/feature/dataviz/src/index.ts +0 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +14 -0
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +1 -0
- package/src/libs/feature/record/src/index.ts +1 -0
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +5 -1
- package/src/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.ts +10 -8
- package/src/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.ts +1 -1
- package/src/libs/feature/record/src/lib/map-view/map-view.component.html +1 -2
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +5 -2
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.css +8 -0
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.html +87 -0
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.ts +339 -0
- package/src/libs/feature/record/src/lib/stac-view/utils.ts +57 -0
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +1 -1
- package/src/libs/feature/search/src/lib/constants.ts +1 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +1 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +37 -33
- package/src/libs/ui/elements/src/index.ts +1 -0
- package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.html +13 -0
- package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.ts +15 -0
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.html +3 -3
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +17 -1
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.css +0 -0
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.html +15 -0
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.ts +41 -0
- package/src/libs/ui/layout/src/lib/paginable.interface.ts +3 -3
- package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.html +12 -6
- package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.ts +4 -1
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.html +16 -14
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +144 -65
- package/translations/de.json +7 -3
- package/translations/en.json +7 -3
- package/translations/es.json +7 -3
- package/translations/fr.json +7 -3
- package/translations/it.json +7 -3
- package/translations/nl.json +7 -3
- package/translations/pt.json +7 -3
- package/translations/sk.json +7 -3
- package/esm2022/libs/feature/dataviz/src/lib/stac-view/stac-view.component.mjs +0 -51
- package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts +0 -16
- package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts.map +0 -1
- package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.html +0 -40
- package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.ts +0 -62
- /package/src/libs/{feature/dataviz/src/lib/stac-view/stac-view.component.css → ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.css} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DatasetTemporalExtent } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
2
|
+
import { Extent } from '@geospatial-sdk/core/dist/model'
|
|
3
|
+
import { StacFilterState } from './stac-view.component'
|
|
4
|
+
|
|
5
|
+
export function areTemporalExtentsEqual(
|
|
6
|
+
previous: DatasetTemporalExtent | null,
|
|
7
|
+
current: DatasetTemporalExtent | null
|
|
8
|
+
): boolean {
|
|
9
|
+
const previousStartTime = previous?.start?.getTime() ?? null
|
|
10
|
+
const previousEndTime = previous?.end?.getTime() ?? null
|
|
11
|
+
|
|
12
|
+
const currentStartTime = current?.start?.getTime() ?? null
|
|
13
|
+
const currentEndTime = current?.end?.getTime() ?? null
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
previousStartTime === currentStartTime && previousEndTime === currentEndTime
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function areSpatialExtentsEqual(
|
|
21
|
+
previous: Extent | null,
|
|
22
|
+
current: Extent | null
|
|
23
|
+
): boolean {
|
|
24
|
+
return (
|
|
25
|
+
previous?.[0] === current?.[0] &&
|
|
26
|
+
previous?.[1] === current?.[1] &&
|
|
27
|
+
previous?.[2] === current?.[2] &&
|
|
28
|
+
previous?.[3] === current?.[3]
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function areFilterStatesEqual(
|
|
33
|
+
previous: StacFilterState,
|
|
34
|
+
current: StacFilterState
|
|
35
|
+
): boolean {
|
|
36
|
+
const sameTemporalExtents = areTemporalExtentsEqual(
|
|
37
|
+
previous.temporalExtent,
|
|
38
|
+
current.temporalExtent
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const sameSpatialExtents =
|
|
42
|
+
!current.isSpatialExtentFilterEnabled ||
|
|
43
|
+
areSpatialExtentsEqual(previous.spatialExtent, current.spatialExtent)
|
|
44
|
+
|
|
45
|
+
const sameIsSpatialExtentFilterEnabled =
|
|
46
|
+
previous.isSpatialExtentFilterEnabled ===
|
|
47
|
+
current.isSpatialExtentFilterEnabled
|
|
48
|
+
|
|
49
|
+
const samePageUrl = previous.pageUrl === current.pageUrl
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
sameTemporalExtents &&
|
|
53
|
+
sameSpatialExtents &&
|
|
54
|
+
sameIsSpatialExtentFilterEnabled &&
|
|
55
|
+
samePageUrl
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -68,7 +68,7 @@ export class MdViewEffects {
|
|
|
68
68
|
map((related) => {
|
|
69
69
|
return MdViewActions.setRelated({ related })
|
|
70
70
|
}),
|
|
71
|
-
catchError((
|
|
71
|
+
catchError(() => of(MdViewActions.setRelated({ related: null })))
|
|
72
72
|
)
|
|
73
73
|
)
|
|
74
74
|
|
|
@@ -34,6 +34,7 @@ marker('search.filters.publicationYear')
|
|
|
34
34
|
marker('search.filters.organization')
|
|
35
35
|
marker('search.filters.representationType')
|
|
36
36
|
marker('search.filters.resourceType')
|
|
37
|
+
marker('search.filters.recordKind')
|
|
37
38
|
marker('search.filters.standard')
|
|
38
39
|
marker('search.filters.topic')
|
|
39
40
|
marker('search.filters.contact')
|
|
@@ -505,11 +505,15 @@ export class ResourceTypeLegacyField extends TranslatedSearchField {
|
|
|
505
505
|
|
|
506
506
|
export class RecordKindField extends SimpleSearchField {
|
|
507
507
|
TYPE_MAPPING = {
|
|
508
|
-
dataset: ['dataset', 'series', 'featureCatalog'],
|
|
508
|
+
dataset: ['dataset', 'series', 'featureCatalog', 'document'],
|
|
509
509
|
service: ['service'],
|
|
510
|
-
reuse:
|
|
511
|
-
.
|
|
512
|
-
|
|
510
|
+
reuse: [
|
|
511
|
+
...Object.entries(PossibleResourceTypes)
|
|
512
|
+
.filter(([_, v]) => v === 'reuse')
|
|
513
|
+
.map(([k]) => k), // = ['application', 'map', 'staticMap', 'interactiveMap', ...]
|
|
514
|
+
'dataset', // allow datasets and documents to be filtered as 'reuse' by cl_presentationForm
|
|
515
|
+
'document',
|
|
516
|
+
],
|
|
513
517
|
}
|
|
514
518
|
|
|
515
519
|
constructor(injector: Injector) {
|
|
@@ -517,38 +521,25 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
517
521
|
}
|
|
518
522
|
|
|
519
523
|
getAvailableValues(): Observable<FieldAvailableValue[]> {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
acc[key] = (acc[key] || 0) + count
|
|
536
|
-
return acc
|
|
537
|
-
},
|
|
538
|
-
{} as Record<string, number>
|
|
539
|
-
)
|
|
540
|
-
|
|
541
|
-
return Object.keys(this.TYPE_MAPPING).map((type) => ({
|
|
542
|
-
label: type,
|
|
543
|
-
value: type,
|
|
544
|
-
count: counts[type] ?? 0,
|
|
545
|
-
}))
|
|
546
|
-
})
|
|
547
|
-
)
|
|
524
|
+
// simplified as available values now depend on 'resourceType' and 'cl_presentationForm' fields
|
|
525
|
+
return of([
|
|
526
|
+
{
|
|
527
|
+
label: 'dataset',
|
|
528
|
+
value: 'dataset',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
label: 'service',
|
|
532
|
+
value: 'service',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
label: 'reuse',
|
|
536
|
+
value: 'reuse',
|
|
537
|
+
},
|
|
538
|
+
])
|
|
548
539
|
}
|
|
549
540
|
|
|
550
541
|
getFiltersForValues(values: FieldValue[]): Observable<FieldFilters> {
|
|
551
|
-
const filters = {
|
|
542
|
+
const filters: FieldFilters = {
|
|
552
543
|
[this.esFieldName]: values.reduce((acc, value) => {
|
|
553
544
|
if (value === '') return { ...acc, [value]: true }
|
|
554
545
|
|
|
@@ -559,6 +550,19 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
559
550
|
}, {}),
|
|
560
551
|
}
|
|
561
552
|
|
|
553
|
+
const presentationFormFilter = {}
|
|
554
|
+
if (values.includes('reuse') && !values.includes('dataset')) {
|
|
555
|
+
presentationFormFilter['mapDigital'] = true
|
|
556
|
+
presentationFormFilter['mapHardcopy'] = true
|
|
557
|
+
} else if (values.includes('dataset') && !values.includes('reuse')) {
|
|
558
|
+
presentationFormFilter['mapDigital'] = false
|
|
559
|
+
presentationFormFilter['mapHardcopy'] = false
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (Object.keys(presentationFormFilter).length > 0) {
|
|
563
|
+
filters['cl_presentationForm.key'] = presentationFormFilter
|
|
564
|
+
}
|
|
565
|
+
|
|
562
566
|
return of(filters)
|
|
563
567
|
}
|
|
564
568
|
|
|
@@ -27,3 +27,4 @@ export * from './lib/application-banner/application-banner.component'
|
|
|
27
27
|
export * from './lib/internal-link-card/internal-link-card.component'
|
|
28
28
|
export * from './lib/service-capabilities/service-capabilities.component'
|
|
29
29
|
export * from './lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component'
|
|
30
|
+
export * from './lib/stac-items-result-grid/stac-items-result-grid.component'
|
package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-[10px]">
|
|
2
|
+
<div *ngFor="let item of items">
|
|
3
|
+
<div
|
|
4
|
+
data-cy="stac-item-card"
|
|
5
|
+
class="h-[173px] flex flex-col justify-between gap-4 bg-white rounded-lg border border-gray-300 px-5 py-3 mx-auto"
|
|
6
|
+
>
|
|
7
|
+
<h2 class="text-xl text-black line-clamp-4 break-words">
|
|
8
|
+
{{ item.id }}
|
|
9
|
+
</h2>
|
|
10
|
+
<p class="truncate">{{ item.properties.datetime }}</p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
3
|
+
import { StacItem } from '@camptocamp/ogc-client'
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'gn-ui-stac-items-result-grid',
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [CommonModule],
|
|
9
|
+
templateUrl: './stac-items-result-grid.component.html',
|
|
10
|
+
styleUrl: './stac-items-result-grid.component.css',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
})
|
|
13
|
+
export class StacItemsResultGridComponent {
|
|
14
|
+
@Input() items: StacItem[] = []
|
|
15
|
+
}
|
|
@@ -24,3 +24,4 @@ export * from './lib/text-input/text-input.component'
|
|
|
24
24
|
export * from './lib/url-input/url-input.component'
|
|
25
25
|
export * from './lib/viewport-intersector/viewport-intersector.component'
|
|
26
26
|
export * from './lib/search-feature-catalog/search-feature-catalog.component'
|
|
27
|
+
export * from './lib/date-range-inputs/date-range-inputs.component'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<label
|
|
2
|
-
class="
|
|
2
|
+
class="flex relative items-center cursor-pointer w-full"
|
|
3
3
|
[title]="title || label"
|
|
4
4
|
>
|
|
5
|
-
<span class="shrink-0">
|
|
5
|
+
<span class="shrink-0 relative">
|
|
6
6
|
<input
|
|
7
7
|
type="checkbox"
|
|
8
8
|
class="sr-only peer"
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"
|
|
19
19
|
></div>
|
|
20
20
|
</span>
|
|
21
|
-
<span class="ml-3 mt-[2px] text-sm font-medium">{{ label }}</span>
|
|
21
|
+
<span class="ml-3 mt-[2px] text-sm font-medium flex-1">{{ label }}</span>
|
|
22
22
|
</label>
|
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
Input,
|
|
6
6
|
Output,
|
|
7
7
|
} from '@angular/core'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DateAdapter,
|
|
10
|
+
MAT_DATE_LOCALE,
|
|
11
|
+
MatNativeDateModule,
|
|
12
|
+
} from '@angular/material/core'
|
|
9
13
|
import { MatDatepickerModule } from '@angular/material/datepicker'
|
|
10
14
|
import { ButtonComponent } from '../button/button.component'
|
|
11
15
|
import {
|
|
@@ -14,6 +18,7 @@ import {
|
|
|
14
18
|
provideNgIconsConfig,
|
|
15
19
|
} from '@ng-icons/core'
|
|
16
20
|
import { iconoirCalendar } from '@ng-icons/iconoir'
|
|
21
|
+
import { TranslateService } from '@ngx-translate/core'
|
|
17
22
|
|
|
18
23
|
@Component({
|
|
19
24
|
selector: 'gn-ui-date-picker',
|
|
@@ -32,9 +37,20 @@ import { iconoirCalendar } from '@ng-icons/iconoir'
|
|
|
32
37
|
provideNgIconsConfig({
|
|
33
38
|
size: '1.5rem',
|
|
34
39
|
}),
|
|
40
|
+
{
|
|
41
|
+
provide: MAT_DATE_LOCALE,
|
|
42
|
+
useFactory: (locale: string) => locale,
|
|
43
|
+
},
|
|
35
44
|
],
|
|
36
45
|
})
|
|
37
46
|
export class DatePickerComponent {
|
|
38
47
|
@Input() date: Date
|
|
39
48
|
@Output() dateChange = new EventEmitter<Date>()
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
private dateAdapter: DateAdapter<Date>,
|
|
52
|
+
private translate: TranslateService
|
|
53
|
+
) {
|
|
54
|
+
this.dateAdapter.setLocale(this.translate.currentLang)
|
|
55
|
+
}
|
|
40
56
|
}
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div class="m-8">
|
|
2
|
+
<p class="mb-4" translate>daterange.filter.period</p>
|
|
3
|
+
<p translate>daterange.filter.from</p>
|
|
4
|
+
<gn-ui-date-picker
|
|
5
|
+
id="start-date-picker"
|
|
6
|
+
[date]="temporalExtent?.start"
|
|
7
|
+
(dateChange)="onStartDateChange($event)"
|
|
8
|
+
></gn-ui-date-picker>
|
|
9
|
+
<p class="mt-4" translate>daterange.filter.to</p>
|
|
10
|
+
<gn-ui-date-picker
|
|
11
|
+
id="end-date-picker"
|
|
12
|
+
[date]="temporalExtent?.end"
|
|
13
|
+
(dateChange)="onEndDateChange($event)"
|
|
14
|
+
></gn-ui-date-picker>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
Output,
|
|
7
|
+
} from '@angular/core'
|
|
8
|
+
import { DatePickerComponent } from '../date-picker/date-picker.component'
|
|
9
|
+
import { DatasetTemporalExtent } from '../../../../../../libs/common/domain/src/lib/model/record/metadata.model'
|
|
10
|
+
import { TranslateDirective } from '@ngx-translate/core'
|
|
11
|
+
import { CommonModule } from '@angular/common'
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'gn-ui-date-range-inputs',
|
|
15
|
+
standalone: true,
|
|
16
|
+
imports: [CommonModule, TranslateDirective, DatePickerComponent],
|
|
17
|
+
templateUrl: './date-range-inputs.component.html',
|
|
18
|
+
styleUrl: './date-range-inputs.component.css',
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
})
|
|
21
|
+
export class DateRangeInputsComponent {
|
|
22
|
+
@Input() temporalExtent: DatasetTemporalExtent | null
|
|
23
|
+
@Output() temporalExtentChange =
|
|
24
|
+
new EventEmitter<DatasetTemporalExtent | null>()
|
|
25
|
+
|
|
26
|
+
onStartDateChange(date: Date) {
|
|
27
|
+
this.temporalExtent = {
|
|
28
|
+
...this.temporalExtent,
|
|
29
|
+
start: date,
|
|
30
|
+
}
|
|
31
|
+
this.temporalExtentChange.emit(this.temporalExtent)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
onEndDateChange(date: Date) {
|
|
35
|
+
this.temporalExtent = {
|
|
36
|
+
...this.temporalExtent,
|
|
37
|
+
end: date,
|
|
38
|
+
}
|
|
39
|
+
this.temporalExtentChange.emit(this.temporalExtent)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
export interface Paginable {
|
|
7
7
|
isFirstPage: boolean
|
|
8
8
|
isLastPage: boolean
|
|
9
|
-
pagesCount
|
|
10
|
-
currentPage
|
|
11
|
-
goToPage(index: number): void
|
|
9
|
+
pagesCount?: number
|
|
10
|
+
currentPage?: number
|
|
11
|
+
goToPage?(index: number): void
|
|
12
12
|
goToNextPage(): void
|
|
13
13
|
goToPrevPage(): void
|
|
14
14
|
}
|
package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.html
CHANGED
|
@@ -3,28 +3,34 @@
|
|
|
3
3
|
data-test="previousButton"
|
|
4
4
|
type="light"
|
|
5
5
|
[extraClass]="
|
|
6
|
-
'w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
6
|
+
'w-auto min-w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
7
7
|
(!listComponent.isFirstPage
|
|
8
|
-
? 'border border-gray-300'
|
|
9
|
-
: 'border border-gray-100')
|
|
8
|
+
? 'border border-gray-300 text-main'
|
|
9
|
+
: 'border border-gray-100 text-gray-300')
|
|
10
10
|
"
|
|
11
11
|
[disabled]="listComponent.isFirstPage"
|
|
12
12
|
(buttonClick)="listComponent.goToPrevPage()"
|
|
13
13
|
>
|
|
14
14
|
<ng-icon name="matArrowBackIos"></ng-icon>
|
|
15
|
+
<span *ngIf="displayLabels" class="ml-2" translate
|
|
16
|
+
>pagination.previousPage</span
|
|
17
|
+
>
|
|
15
18
|
</gn-ui-button>
|
|
16
19
|
<gn-ui-button
|
|
17
20
|
data-test="nextButton"
|
|
18
21
|
type="light"
|
|
19
22
|
[extraClass]="
|
|
20
|
-
'w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
23
|
+
'w-auto min-w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
21
24
|
(!listComponent.isLastPage
|
|
22
|
-
? 'border border-gray-300'
|
|
23
|
-
: 'border border-gray-100')
|
|
25
|
+
? 'border border-gray-300 text-main'
|
|
26
|
+
: 'border border-gray-100 text-gray-300')
|
|
24
27
|
"
|
|
25
28
|
[disabled]="listComponent.isLastPage"
|
|
26
29
|
(buttonClick)="listComponent.goToNextPage()"
|
|
27
30
|
>
|
|
31
|
+
<span *ngIf="displayLabels" class="mr-2" translate
|
|
32
|
+
>pagination.nextPage</span
|
|
33
|
+
>
|
|
28
34
|
<ng-icon name="matArrowForwardIos"></ng-icon>
|
|
29
35
|
</gn-ui-button>
|
|
30
36
|
</div>
|
|
@@ -10,13 +10,15 @@ import {
|
|
|
10
10
|
} from '@ng-icons/material-icons/baseline'
|
|
11
11
|
import { Paginable } from '../paginable.interface'
|
|
12
12
|
import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
|
|
13
|
+
import { CommonModule } from '@angular/common'
|
|
14
|
+
import { TranslateDirective } from '@ngx-translate/core'
|
|
13
15
|
|
|
14
16
|
@Component({
|
|
15
17
|
selector: 'gn-ui-previous-next-buttons',
|
|
16
18
|
templateUrl: './previous-next-buttons.component.html',
|
|
17
19
|
styleUrls: ['./previous-next-buttons.component.css'],
|
|
18
20
|
standalone: true,
|
|
19
|
-
imports: [ButtonComponent, NgIconComponent],
|
|
21
|
+
imports: [CommonModule, ButtonComponent, NgIconComponent, TranslateDirective],
|
|
20
22
|
providers: [
|
|
21
23
|
provideIcons({ matArrowBackIos, matArrowForwardIos }),
|
|
22
24
|
provideNgIconsConfig({
|
|
@@ -26,4 +28,5 @@ import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
|
|
|
26
28
|
})
|
|
27
29
|
export class PreviousNextButtonsComponent {
|
|
28
30
|
@Input() listComponent: Paginable
|
|
31
|
+
@Input() displayLabels = false
|
|
29
32
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
<div class="h-full w-full" #map
|
|
2
|
-
<
|
|
3
|
-
class="absolute inset-0 p-2 rounded z-40 transition-all flex flex-col justify-center items-center text-primary font-sans pointer-events-none"
|
|
4
|
-
[ngClass]="
|
|
5
|
-
(displayMessage$ | async) ? 'visible opacity-100' : 'invisible opacity-0'
|
|
6
|
-
"
|
|
7
|
-
>
|
|
1
|
+
<div class="relative h-full w-full" #map>
|
|
2
|
+
<ng-content></ng-content>
|
|
8
3
|
<div
|
|
9
|
-
class="absolute
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
class="absolute inset-0 p-2 rounded z-40 transition-all flex flex-col justify-center items-center text-primary font-sans pointer-events-none"
|
|
5
|
+
[ngClass]="
|
|
6
|
+
(displayMessage$ | async) ? 'visible opacity-100' : 'invisible opacity-0'
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="absolute z-[-1] inset-0 bg-gradient-to-b from-white to-primary-lightest opacity-60"
|
|
11
|
+
></div>
|
|
12
|
+
<ng-icon
|
|
13
|
+
class="!w-16 !h-16 text-[64px] mb-4"
|
|
14
|
+
name="matSwipeOutline"
|
|
15
|
+
></ng-icon>
|
|
16
|
+
<p translate>map.navigation.message</p>
|
|
17
|
+
</div>
|
|
16
18
|
</div>
|