adb-shared 22.0.0-beta.3 → 22.0.0-beta.4
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/fesm2022/adb-shared-map.mjs +124 -83
- package/fesm2022/adb-shared-map.mjs.map +1 -1
- package/package.json +1 -1
- package/types/adb-shared-map.d.ts +52 -25
|
@@ -2,7 +2,7 @@ import * as i1$2 from "@angular/common";
|
|
|
2
2
|
import { CommonModule } from "@angular/common";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ChangeDetectionStrategy, Component, ElementRef, Inject, Injectable, InjectionToken, Input, NgModule, afterRenderEffect, computed, effect, forwardRef, inject, input, output, signal } from "@angular/core";
|
|
5
|
-
import * as
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
6
|
import { FormArray, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from "@angular/forms";
|
|
7
7
|
import GeoJSON from "ol/format/GeoJSON.js";
|
|
8
8
|
import Draw from "ol/interaction/Draw.js";
|
|
@@ -33,10 +33,10 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
|
33
33
|
import * as i2 from "@angular/common/http";
|
|
34
34
|
import { HttpClient } from "@angular/common/http";
|
|
35
35
|
import { Subscription, combineLatest, debounceTime, map } from "rxjs";
|
|
36
|
+
import * as i1$1 from "adb-shared";
|
|
37
|
+
import { AdbButtonsModule, AdbDatePickerModule, AdbDirectivesModule, AdbDropdownModule, AdbFilterSectionModule, AdbPickerModule, AdbPipesModule } from "adb-shared";
|
|
36
38
|
import LineString from "ol/geom/LineString.js";
|
|
37
39
|
import MultiPolygon from "ol/geom/MultiPolygon.js";
|
|
38
|
-
import * as i1$1 from "adb-shared";
|
|
39
|
-
import { AdbButtonsModule, AdbDatePickerModule, AdbDirectivesModule, AdbFilterSectionModule, AdbPickerModule, AdbPipesModule } from "adb-shared";
|
|
40
40
|
import { addYears, endOfDay, endOfYear, parseISO, startOfDay, startOfYear } from "date-fns";
|
|
41
41
|
const DateTypes = {
|
|
42
42
|
THIS_YEAR: "1",
|
|
@@ -48,6 +48,12 @@ const DateTypes = {
|
|
|
48
48
|
};
|
|
49
49
|
const MapConstants = {
|
|
50
50
|
INITIAL_METERS_PER_PIXEL: 200,
|
|
51
|
+
FIT_PADDING: [
|
|
52
|
+
20,
|
|
53
|
+
20,
|
|
54
|
+
20,
|
|
55
|
+
20
|
|
56
|
+
],
|
|
51
57
|
LOCATION_MARKER_BACKGROUND_COLOR: "#f3db60",
|
|
52
58
|
LOCATION_MARKER_BORDER_COLOR: "#665500",
|
|
53
59
|
OBSERVATION_MARKER_BACKGROUND_COLOR: "#007c91",
|
|
@@ -143,9 +149,12 @@ var AdbMapUtils = class AdbMapUtils {
|
|
|
143
149
|
map.getView().fit(extent, options);
|
|
144
150
|
return true;
|
|
145
151
|
}
|
|
152
|
+
static isCluster(properties) {
|
|
153
|
+
return properties["groupingType"] === "pixelCluster" || !!properties["isCluster"];
|
|
154
|
+
}
|
|
146
155
|
static locationSymbol(feature, selected = false, hovered = false) {
|
|
147
156
|
const props = feature.getProperties();
|
|
148
|
-
const cluster = props
|
|
157
|
+
const cluster = AdbMapUtils.isCluster(props);
|
|
149
158
|
const point = ["Point", "MultiPoint"].includes(feature.getGeometry()?.getType());
|
|
150
159
|
const text = point && !cluster && props["observationCount"] === 1 && (props["locations"]?.count === 1 || !!props["location"]) ? new Text({
|
|
151
160
|
text: "1",
|
|
@@ -228,7 +237,7 @@ var AdbMapUtils = class AdbMapUtils {
|
|
|
228
237
|
const color = before ? MapConstants.BEFORE_CUTOFF_YEAR_COLOR : MapConstants.AFTER_CUTOFF_YEAR_COLOR;
|
|
229
238
|
const image = style.getImage();
|
|
230
239
|
if (image instanceof Circle) {
|
|
231
|
-
image.setFill(before ?
|
|
240
|
+
image.setFill(new Fill({ color: before ? "transparent" : color }));
|
|
232
241
|
image.setStroke(new Stroke({
|
|
233
242
|
color: before ? color : "#000",
|
|
234
243
|
width: before ? 2 : image.getStroke().getWidth()
|
|
@@ -317,12 +326,7 @@ var AdbMapUtils = class AdbMapUtils {
|
|
|
317
326
|
if (options.providers !== false) this.addProviders(map);
|
|
318
327
|
return map;
|
|
319
328
|
}
|
|
320
|
-
static
|
|
321
|
-
const element = document.createElement("details");
|
|
322
|
-
element.className = "ol-control adb-map-layers";
|
|
323
|
-
const summary = document.createElement("summary");
|
|
324
|
-
summary.textContent = "Kartlager";
|
|
325
|
-
element.append(summary);
|
|
329
|
+
static addProviderLayers(map) {
|
|
326
330
|
const backgrounds = this.Providers.map((provider) => {
|
|
327
331
|
const layer = provider.wms ? this.wms(provider.url, provider.params) : new TileLayer({ source: new XYZ({
|
|
328
332
|
url: provider.url.replace("{s}", "{a-c}"),
|
|
@@ -347,10 +351,28 @@ var AdbMapUtils = class AdbMapUtils {
|
|
|
347
351
|
maxZoom: original.getMaxZoom()
|
|
348
352
|
})
|
|
349
353
|
}));
|
|
350
|
-
for (const [index, entry] of
|
|
351
|
-
const background = index < backgrounds.length;
|
|
354
|
+
for (const [index, entry] of backgrounds.entries()) {
|
|
352
355
|
entry.layer.setVisible(index === 0);
|
|
353
356
|
map.addLayer(entry.layer);
|
|
357
|
+
}
|
|
358
|
+
for (const entry of overlays) {
|
|
359
|
+
entry.layer.setVisible(false);
|
|
360
|
+
map.addLayer(entry.layer);
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
backgrounds,
|
|
364
|
+
overlays
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
static addProviders(map) {
|
|
368
|
+
const element = document.createElement("details");
|
|
369
|
+
element.className = "ol-control adb-map-layers";
|
|
370
|
+
const summary = document.createElement("summary");
|
|
371
|
+
summary.textContent = "Kartlager";
|
|
372
|
+
element.append(summary);
|
|
373
|
+
const { backgrounds, overlays } = this.addProviderLayers(map);
|
|
374
|
+
for (const [index, entry] of [...backgrounds, ...overlays].entries()) {
|
|
375
|
+
const background = index < backgrounds.length;
|
|
354
376
|
const label = document.createElement("label");
|
|
355
377
|
const input = document.createElement("input");
|
|
356
378
|
input.type = background ? "radio" : "checkbox";
|
|
@@ -481,12 +503,7 @@ var PolygonDrawerInput = class PolygonDrawerInput {
|
|
|
481
503
|
fitShape() {
|
|
482
504
|
if (!this.pendingFit) return;
|
|
483
505
|
if (!AdbMapUtils.fitExtentIfReady(this.map, this.source.getExtent(), {
|
|
484
|
-
padding:
|
|
485
|
-
20,
|
|
486
|
-
20,
|
|
487
|
-
20,
|
|
488
|
-
20
|
|
489
|
-
],
|
|
506
|
+
padding: MapConstants.FIT_PADDING,
|
|
490
507
|
maxZoom: 18
|
|
491
508
|
})) return;
|
|
492
509
|
this.pendingFit = false;
|
|
@@ -534,8 +551,7 @@ var PolygonDrawerInput = class PolygonDrawerInput {
|
|
|
534
551
|
kind: "pipe",
|
|
535
552
|
type: i1$3.TranslatePipe,
|
|
536
553
|
name: "translate"
|
|
537
|
-
}]
|
|
538
|
-
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
554
|
+
}]
|
|
539
555
|
});
|
|
540
556
|
};
|
|
541
557
|
i0.ɵɵngDeclareClassMetadata({
|
|
@@ -548,7 +564,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
548
564
|
args: [{
|
|
549
565
|
selector: "adb-polygon-drawer",
|
|
550
566
|
standalone: false,
|
|
551
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
552
567
|
providers: [{
|
|
553
568
|
provide: NG_VALUE_ACCESSOR,
|
|
554
569
|
useExisting: forwardRef(() => PolygonDrawerInput),
|
|
@@ -727,7 +742,12 @@ var AdbBffMapDataSource = class AdbBffMapDataSource {
|
|
|
727
742
|
for (const key of Object.keys(params)) if (params[key] == null) delete params[key];
|
|
728
743
|
return this.http.get(request.url, { params }).pipe(map((response) => {
|
|
729
744
|
const geoJson = response?.geoJson;
|
|
730
|
-
if (
|
|
745
|
+
if (geoJson == null) return {
|
|
746
|
+
type: "FeatureCollection",
|
|
747
|
+
features: [],
|
|
748
|
+
properties: { count: 0 }
|
|
749
|
+
};
|
|
750
|
+
if (geoJson.type !== "FeatureCollection") throw new Error("Invalid BFF GeoJSON response");
|
|
731
751
|
return {
|
|
732
752
|
...geoJson,
|
|
733
753
|
properties: {
|
|
@@ -786,7 +806,7 @@ var MapFeaturePickerComponent = class MapFeaturePickerComponent {
|
|
|
786
806
|
const choices = [];
|
|
787
807
|
const ids = /* @__PURE__ */ new Set();
|
|
788
808
|
for (const feature of this.features()) {
|
|
789
|
-
if (
|
|
809
|
+
if (AdbMapUtils.isCluster(feature.getProperties())) continue;
|
|
790
810
|
for (const item of feature.get("locations")?.items ?? []) {
|
|
791
811
|
if (ids.has(item.locationId)) continue;
|
|
792
812
|
ids.add(item.locationId);
|
|
@@ -888,8 +908,7 @@ var MapFeaturePickerComponent = class MapFeaturePickerComponent {
|
|
|
888
908
|
kind: "pipe",
|
|
889
909
|
type: i1$3.TranslatePipe,
|
|
890
910
|
name: "translate"
|
|
891
|
-
}]
|
|
892
|
-
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
911
|
+
}]
|
|
893
912
|
});
|
|
894
913
|
};
|
|
895
914
|
i0.ɵɵngDeclareClassMetadata({
|
|
@@ -902,7 +921,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
902
921
|
args: [{
|
|
903
922
|
selector: "adb-map-feature-picker",
|
|
904
923
|
host: { class: "adb-map-feature-picker" },
|
|
905
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
906
924
|
standalone: false,
|
|
907
925
|
template: "@if (choices().length > 1) {\n<section class=\"adb-plate-primary shadow adb-map-feature-picker-panel\" [style.left.px]=\"position().left\" [style.top.px]=\"position().top\" [attr.aria-label]=\"'MAP.FEATURE_PICKER.TITLE' | translate\"\n (adbClickOutside)=\"dismissed.emit(false)\"\n (keydown.escape)=\"$event.stopPropagation(); dismissed.emit(true)\">\n <div class=\"d-flex align-items-center justify-content-between gap-3 mb-2\">\n <h2 class=\"h6 mb-0\">{{'MAP.FEATURE_PICKER.TITLE' | translate}}</h2>\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'MAP.FEATURE_PICKER.CLOSE' | translate\" (click)=\"dismissed.emit(true)\"></button>\n </div>\n <ul class=\"list-group list-group-flush\">\n @for (choice of choices(); track choice.item.locationId) {\n <li class=\"list-group-item p-0\">\n <button type=\"button\" class=\"list-group-item list-group-item-action border-0 text-break\" (click)=\"choose(choice)\">\n @if (choice.item.locality) {\n {{choice.item.locality}}\n @if (choice.item.municipality) {, {{choice.item.municipality}}}\n } @else if (choice.item.municipality) {\n {{choice.item.municipality}}\n }\n ({{choice.item.locationId}})\n </button>\n </li>\n }\n </ul>\n</section>\n}\n"
|
|
908
926
|
}]
|
|
@@ -1061,8 +1079,17 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1061
1079
|
activatedRoute;
|
|
1062
1080
|
config;
|
|
1063
1081
|
router;
|
|
1082
|
+
dataSource;
|
|
1064
1083
|
showLegend = input(true, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
|
|
1065
|
-
|
|
1084
|
+
headerButtons = input([
|
|
1085
|
+
"layers",
|
|
1086
|
+
"export",
|
|
1087
|
+
"settings"
|
|
1088
|
+
], ...ngDevMode ? [{ debugName: "headerButtons" }] : /* istanbul ignore next */ []);
|
|
1089
|
+
showLayersButton = computed(() => this.headerButtons().includes("layers"), ...ngDevMode ? [{ debugName: "showLayersButton" }] : /* istanbul ignore next */ []);
|
|
1090
|
+
showExportButton = computed(() => this.headerButtons().includes("export"), ...ngDevMode ? [{ debugName: "showExportButton" }] : /* istanbul ignore next */ []);
|
|
1091
|
+
showSettingsButton = computed(() => this.headerButtons().includes("settings"), ...ngDevMode ? [{ debugName: "showSettingsButton" }] : /* istanbul ignore next */ []);
|
|
1092
|
+
providerLayers = signal(null, ...ngDevMode ? [{ debugName: "providerLayers" }] : /* istanbul ignore next */ []);
|
|
1066
1093
|
allowPresentationMode = input(false, ...ngDevMode ? [{ debugName: "allowPresentationMode" }] : /* istanbul ignore next */ []);
|
|
1067
1094
|
presentationMode = input("locations", ...ngDevMode ? [{ debugName: "presentationMode" }] : /* istanbul ignore next */ []);
|
|
1068
1095
|
route = signal(null, ...ngDevMode ? [{ debugName: "route" }] : /* istanbul ignore next */ []);
|
|
@@ -1071,7 +1098,6 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1071
1098
|
if (this.allowPresentationMode() && (mode === "locations" || mode === "observations")) return mode;
|
|
1072
1099
|
return this.presentationMode();
|
|
1073
1100
|
}, ...ngDevMode ? [{ debugName: "activePresentationMode" }] : /* istanbul ignore next */ []);
|
|
1074
|
-
dataSource = inject(ADB_MAP_DATA_SOURCE);
|
|
1075
1101
|
requestedParams = "";
|
|
1076
1102
|
settingsOpen = signal(false, ...ngDevMode ? [{ debugName: "settingsOpen" }] : /* istanbul ignore next */ []);
|
|
1077
1103
|
savingSettings = signal(false, ...ngDevMode ? [{ debugName: "savingSettings" }] : /* istanbul ignore next */ []);
|
|
@@ -1102,15 +1128,16 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1102
1128
|
pendingExtent;
|
|
1103
1129
|
mapResult = signal(null, ...ngDevMode ? [{ debugName: "mapResult" }] : /* istanbul ignore next */ []);
|
|
1104
1130
|
cutoffYear = computed(() => this.activePresentationMode() === "observations" ? this.route()?.queryParams["cutoff"] ?? null : null, ...ngDevMode ? [{ debugName: "cutoffYear" }] : /* istanbul ignore next */ []);
|
|
1105
|
-
gridLevels =
|
|
1131
|
+
gridLevels = [];
|
|
1106
1132
|
mapId = "" + Math.floor(Math.random() * Date.now());
|
|
1107
1133
|
map;
|
|
1108
1134
|
mapReady = signal(false, ...ngDevMode ? [{ debugName: "mapReady" }] : /* istanbul ignore next */ []);
|
|
1109
1135
|
queryParams = {};
|
|
1110
|
-
constructor(activatedRoute, config, router) {
|
|
1136
|
+
constructor(activatedRoute, config, router, dataSource) {
|
|
1111
1137
|
this.activatedRoute = activatedRoute;
|
|
1112
1138
|
this.config = config;
|
|
1113
1139
|
this.router = router;
|
|
1140
|
+
this.dataSource = dataSource;
|
|
1114
1141
|
this.route.set(this.activatedRoute.snapshot);
|
|
1115
1142
|
this.settingsForm.controls.presentationMode.valueChanges.pipe(takeUntilDestroyed()).subscribe((mode) => {
|
|
1116
1143
|
const cutoff = this.settingsForm.controls.cutoff;
|
|
@@ -1142,8 +1169,9 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1142
1169
|
this.map = AdbMapUtils.createMap(this.mapId, {
|
|
1143
1170
|
zoom: true,
|
|
1144
1171
|
scrollZoom: false,
|
|
1145
|
-
providers:
|
|
1172
|
+
providers: false
|
|
1146
1173
|
});
|
|
1174
|
+
this.providerLayers.set(AdbMapUtils.addProviderLayers(this.map));
|
|
1147
1175
|
this.map.addLayer(new VectorLayer({
|
|
1148
1176
|
source: this.uncertaintySource,
|
|
1149
1177
|
style: new Style({ stroke: new Stroke({
|
|
@@ -1165,6 +1193,9 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1165
1193
|
if (size?.[0] && size[1]) this.mapReady.set(true);
|
|
1166
1194
|
this.attachUserListeners();
|
|
1167
1195
|
}
|
|
1196
|
+
selectBackground(index) {
|
|
1197
|
+
this.providerLayers().backgrounds.forEach((entry, layerIndex) => entry.layer.setVisible(layerIndex === index));
|
|
1198
|
+
}
|
|
1168
1199
|
openSettings() {
|
|
1169
1200
|
this.settingsForm.reset({
|
|
1170
1201
|
presentationMode: this.activePresentationMode(),
|
|
@@ -1253,7 +1284,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1253
1284
|
onFeatureChosen(selection) {
|
|
1254
1285
|
this.closeLocationPicker(selection.restoreFocus);
|
|
1255
1286
|
const { feature, properties: props } = selection;
|
|
1256
|
-
const cluster = props
|
|
1287
|
+
const cluster = AdbMapUtils.isCluster(props);
|
|
1257
1288
|
const location = !cluster && !!(props["location"] || props["observationCount"]);
|
|
1258
1289
|
if ((cluster || location) && this.config.enableClusterSelection && selection.selectMode) {
|
|
1259
1290
|
this.selectedFeature = feature;
|
|
@@ -1270,12 +1301,12 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1270
1301
|
let extent = feature.getGeometry().getExtent();
|
|
1271
1302
|
if (cluster) {
|
|
1272
1303
|
const projectedCenter = getCenter(extent);
|
|
1273
|
-
const center = toLonLat(projectedCenter);
|
|
1274
1304
|
const radius = props["cluster"].radiusMeters;
|
|
1275
|
-
extent =
|
|
1305
|
+
extent = AdbMapUtils.createUncertaintyCircle(projectedCenter, radius).getExtent();
|
|
1276
1306
|
const view = this.map.getView();
|
|
1277
1307
|
const size = this.map.getSize();
|
|
1278
|
-
const
|
|
1308
|
+
const [top, right, bottom, left] = MapConstants.FIT_PADDING;
|
|
1309
|
+
const fitSize = [size[0] - left - right, size[1] - top - bottom];
|
|
1279
1310
|
if (view.getResolutionForExtent(extent, fitSize) >= view.getResolution()) extent = getForViewAndSize(projectedCenter, view.getResolution() / 2, 0, fitSize);
|
|
1280
1311
|
}
|
|
1281
1312
|
const bbox = transformExtent(extent, this.map.getView().getProjection(), "EPSG:4326").join(",");
|
|
@@ -1317,6 +1348,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1317
1348
|
return qParams.bbox ? AdbMapUtils.getMetersPerPixel(qParams.bbox, this.map.getSize()?.[0]) : MapConstants.INITIAL_METERS_PER_PIXEL;
|
|
1318
1349
|
}
|
|
1319
1350
|
buildMap(geojson, fitView) {
|
|
1351
|
+
this.gridLevels = AdbMapUtils.gridLevels(geojson);
|
|
1320
1352
|
this.mapResult.set(geojson);
|
|
1321
1353
|
const features = this.format.readFeatures(geojson, { featureProjection: this.map.getView().getProjection() });
|
|
1322
1354
|
this.closeLocationPicker(false);
|
|
@@ -1348,12 +1380,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1348
1380
|
}
|
|
1349
1381
|
fitPendingExtent() {
|
|
1350
1382
|
if (!AdbMapUtils.fitExtentIfReady(this.map, this.pendingExtent, {
|
|
1351
|
-
padding:
|
|
1352
|
-
20,
|
|
1353
|
-
20,
|
|
1354
|
-
20,
|
|
1355
|
-
20
|
|
1356
|
-
],
|
|
1383
|
+
padding: MapConstants.FIT_PADDING,
|
|
1357
1384
|
maxZoom: 18
|
|
1358
1385
|
})) return;
|
|
1359
1386
|
this.fittedView = this.viewKey();
|
|
@@ -1368,7 +1395,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1368
1395
|
}),
|
|
1369
1396
|
fill: new Fill({ color: "transparent" })
|
|
1370
1397
|
});
|
|
1371
|
-
const cluster = props
|
|
1398
|
+
const cluster = AdbMapUtils.isCluster(props);
|
|
1372
1399
|
const location = props["locations"] || props["location"];
|
|
1373
1400
|
const point = ["Point", "MultiPoint"].includes(feature.getGeometry()?.getType());
|
|
1374
1401
|
if (cluster || location || point) return this.activePresentationMode() === "observations" ? this.aggregatedSymbol(feature) : this.locationSymbol(feature);
|
|
@@ -1379,7 +1406,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1379
1406
|
}),
|
|
1380
1407
|
fill: new Fill({ color: "rgba(0,118,129,0.1)" })
|
|
1381
1408
|
});
|
|
1382
|
-
return AdbMapUtils.gridSymbol(props["ObservationsCount"], this.gridLevels
|
|
1409
|
+
return AdbMapUtils.gridSymbol(props["ObservationsCount"], this.gridLevels);
|
|
1383
1410
|
}
|
|
1384
1411
|
locationSymbol(feature) {
|
|
1385
1412
|
return AdbMapUtils.locationSymbol(feature, feature === this.selectedFeature, feature === this.hoveredFeature);
|
|
@@ -1400,7 +1427,8 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1400
1427
|
deps: [
|
|
1401
1428
|
{ token: i1.ActivatedRoute },
|
|
1402
1429
|
{ token: AdbMapConfigService },
|
|
1403
|
-
{ token: i1.Router }
|
|
1430
|
+
{ token: i1.Router },
|
|
1431
|
+
{ token: ADB_MAP_DATA_SOURCE }
|
|
1404
1432
|
],
|
|
1405
1433
|
target: i0.ɵɵFactoryTarget.Component
|
|
1406
1434
|
});
|
|
@@ -1418,9 +1446,9 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1418
1446
|
isRequired: false,
|
|
1419
1447
|
transformFunction: null
|
|
1420
1448
|
},
|
|
1421
|
-
|
|
1422
|
-
classPropertyName: "
|
|
1423
|
-
publicName: "
|
|
1449
|
+
headerButtons: {
|
|
1450
|
+
classPropertyName: "headerButtons",
|
|
1451
|
+
publicName: "headerButtons",
|
|
1424
1452
|
isSignal: true,
|
|
1425
1453
|
isRequired: false,
|
|
1426
1454
|
transformFunction: null
|
|
@@ -1445,54 +1473,62 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1445
1473
|
clusterSelected: "clusterSelected"
|
|
1446
1474
|
},
|
|
1447
1475
|
ngImport: i0,
|
|
1448
|
-
template: "@if(error){\n<div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'ERROR.SERVER_ERROR'|translate}}</span>\n</div>\n}\n<div [class.loading]=\"mapLoading()\">\n <div class=\"d-flex align-items-center justify-content-end flex-wrap gap-1
|
|
1476
|
+
template: "@if(error){\n<div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'ERROR.SERVER_ERROR'|translate}}</span>\n</div>\n}\n<div [class.loading]=\"mapLoading()\">\n <div class=\"bg-light d-flex align-items-center justify-content-end border-bottom flex-wrap gap-1 p-1\" [class.d-none]=\"!headerButtons().length && mapResult()?.properties?.count == null\">\n @if (!mapLoading() && mapResult()?.properties?.count != null) {\n <span class=\"me-auto\">{{mapResult().properties.count | adbSpacing}} {{'MAP.OBSERVATIONS' | translate}}</span>\n }\n @if (showLayersButton() && !settingsOpen()) {\n @if (providerLayers(); as layers) {\n <div class=\"dropdown\" (keydown.escape)=\"layerPicker.close(); layerButton.focus(); $event.stopPropagation()\">\n <button #layerButton #layerPicker=\"adbDropdown\" adbDropdown [insideClick]=\"true\"\n type=\"button\" class=\"btn btn-sm btn-secondary dropdown-toggle no-caret\"\n [attr.aria-label]=\"'MAP.LAYERS' | translate\" [title]=\"'MAP.LAYERS' | translate\">\n <span class=\"bi bi-layers\" aria-hidden=\"true\"></span>\n </button>\n <div class=\"dropdown-menu z-3 bg-light shadow p-3 text-nowrap\">\n <fieldset>\n <legend class=\"visually-hidden\">{{'MAP.LAYERS' | translate}}</legend>\n @for (entry of layers.backgrounds; track entry.name; let index = $index) {\n <label class=\"d-block\">\n <input type=\"radio\" [name]=\"mapId + '-background'\" [checked]=\"entry.layer.getVisible()\"\n (change)=\"selectBackground(index)\">\n {{entry.name}}\n </label>\n }\n </fieldset>\n @if (layers.overlays.length) {\n <hr class=\"my-2\">\n @for (entry of layers.overlays; track entry.name) {\n <label class=\"d-block\">\n <input #overlay type=\"checkbox\" [checked]=\"entry.layer.getVisible()\"\n (change)=\"entry.layer.setVisible(overlay.checked)\">\n {{entry.name}}\n </label>\n }\n }\n </div>\n </div>\n }\n }\n @if (showExportButton()) {\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" [attr.aria-label]=\"'MAP.EXPORT' | translate\" [title]=\"'MAP.EXPORT' | translate\" [disabled]=\"settingsOpen()\" (click)=\"onExport()\">\n <span class=\"bi bi-download\" aria-hidden=\"true\"></span>\n </button>\n }\n <button #settingsButton [hidden]=\"!showSettingsButton() && !settingsOpen()\" type=\"button\" class=\"btn btn-sm btn-secondary\" [attr.aria-label]=\"'MAP.SETTINGS.TITLE' | translate\"\n [title]=\"'MAP.SETTINGS.TITLE' | translate\" [attr.aria-expanded]=\"settingsOpen()\" [attr.aria-controls]=\"mapId + '-settings'\"\n (click)=\"settingsOpen() ? cancelSettings(settingsButton) : openSettings()\">\n <span class=\"bi bi-gear\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"position-relative\">\n <div [id]=\"mapId\" tabindex=\"0\" class=\"adb-map\" [class.invisible]=\"settingsOpen()\" [attr.inert]=\"settingsOpen() ? '' : null\"></div>\n @if (locationOptions(); as options) {\n <adb-map-feature-picker [locationOptions]=\"options\" (featureChosen)=\"onFeatureChosen($event)\" (dismissed)=\"closeLocationPicker($event)\" />\n }\n @if (settingsOpen()) {\n <form [id]=\"mapId + '-settings'\" [formGroup]=\"settingsForm\" (ngSubmit)=\"saveSettings(settingsButton)\"\n class=\"p-3 position-absolute top-0 start-0 w-100 h-100 overflow-auto m-0\"\n [class.loading]=\"savingSettings()\" [attr.aria-labelledby]=\"mapId + '-settings-title'\" [attr.aria-busy]=\"savingSettings()\"\n (keydown.escape)=\"cancelSettings(settingsButton); $event.stopPropagation()\">\n <h2 [id]=\"mapId + '-settings-title'\" class=\"h5\">{{'MAP.SETTINGS.TITLE' | translate}}</h2>\n <div class=\"form-check mb-3\">\n <input [id]=\"mapId + '-uncertain'\" type=\"checkbox\" formControlName=\"uncertain\" class=\"form-check-input\">\n <label [for]=\"mapId + '-uncertain'\" class=\"form-check-label\">{{'MAP.SETTINGS.UNCERTAINTY' | translate}}</label>\n </div>\n @if (allowPresentationMode()) {\n <div class=\"mb-3\">\n <label [for]=\"mapId + '-presentation-mode'\">{{'MAP.SETTINGS.PRESENTATION_MODE' | translate}}</label>\n <select [id]=\"mapId + '-presentation-mode'\" formControlName=\"presentationMode\" class=\"form-select\">\n <option value=\"locations\">{{'MAP.SETTINGS.LOCATIONS_MODE' | translate}}</option>\n <option value=\"observations\">{{'MAP.SETTINGS.OBSERVATIONS_MODE' | translate}}</option>\n </select>\n </div>\n @if (settingsForm.controls.presentationMode.value === 'observations') {\n <div class=\"mb-3\">\n <label [for]=\"mapId + '-cutoff'\">{{'MAP.SETTINGS.CUTOFF' | translate}}</label>\n <input [id]=\"mapId + '-cutoff'\" type=\"text\" inputmode=\"numeric\" formControlName=\"cutoff\" class=\"form-control\"\n [attr.aria-invalid]=\"settingsForm.controls.cutoff.invalid\" [attr.aria-describedby]=\"mapId + '-cutoff-error'\">\n @if (settingsForm.controls.cutoff.invalid) {\n <div [id]=\"mapId + '-cutoff-error'\" class=\"invalid-feedback\">{{'MAP.SETTINGS.INVALID_CUTOFF' | translate}}</div>\n }\n </div>\n }\n }\n @if (settingsError()) {\n <div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'MAP.SETTINGS.SAVE_ERROR' | translate}}</span>\n </div>\n }\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelSettings(settingsButton)\">{{'MAP.SETTINGS.CANCEL' | translate}}</button>\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"settingsForm.invalid || settingsForm.pristine\">{{'MAP.SETTINGS.SAVE' | translate}}</button>\n </div>\n </form>\n }\n </div>\n</div>\n@if (showLegend() && !settingsOpen()) {\n <adb-map-legend [result]=\"mapResult()\" [cutoffYear]=\"cutoffYear()\" [loading]=\"mapLoading()\"\n [showObservationStatus]=\"activePresentationMode() === 'observations'\" />\n}\n",
|
|
1449
1477
|
dependencies: [
|
|
1450
1478
|
{
|
|
1451
1479
|
kind: "directive",
|
|
1452
|
-
type:
|
|
1480
|
+
type: i1$1.AdbDropdownDirective,
|
|
1481
|
+
selector: "[adbDropdown]",
|
|
1482
|
+
inputs: ["insideClick"],
|
|
1483
|
+
outputs: ["adbDropdown", "dropdownClose"],
|
|
1484
|
+
exportAs: ["adbDropdown"]
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
kind: "directive",
|
|
1488
|
+
type: i4.ɵNgNoValidate,
|
|
1453
1489
|
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
1454
1490
|
},
|
|
1455
1491
|
{
|
|
1456
1492
|
kind: "directive",
|
|
1457
|
-
type:
|
|
1493
|
+
type: i4.NgSelectOption,
|
|
1458
1494
|
selector: "option",
|
|
1459
1495
|
inputs: ["ngValue", "value"]
|
|
1460
1496
|
},
|
|
1461
1497
|
{
|
|
1462
1498
|
kind: "directive",
|
|
1463
|
-
type:
|
|
1499
|
+
type: i4.ɵNgSelectMultipleOption,
|
|
1464
1500
|
selector: "option",
|
|
1465
1501
|
inputs: ["ngValue", "value"]
|
|
1466
1502
|
},
|
|
1467
1503
|
{
|
|
1468
1504
|
kind: "directive",
|
|
1469
|
-
type:
|
|
1505
|
+
type: i4.DefaultValueAccessor,
|
|
1470
1506
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
1471
1507
|
},
|
|
1472
1508
|
{
|
|
1473
1509
|
kind: "directive",
|
|
1474
|
-
type:
|
|
1510
|
+
type: i4.CheckboxControlValueAccessor,
|
|
1475
1511
|
selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
|
|
1476
1512
|
},
|
|
1477
1513
|
{
|
|
1478
1514
|
kind: "directive",
|
|
1479
|
-
type:
|
|
1515
|
+
type: i4.SelectControlValueAccessor,
|
|
1480
1516
|
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
1481
1517
|
inputs: ["compareWith"]
|
|
1482
1518
|
},
|
|
1483
1519
|
{
|
|
1484
1520
|
kind: "directive",
|
|
1485
|
-
type:
|
|
1521
|
+
type: i4.NgControlStatus,
|
|
1486
1522
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
1487
1523
|
},
|
|
1488
1524
|
{
|
|
1489
1525
|
kind: "directive",
|
|
1490
|
-
type:
|
|
1526
|
+
type: i4.NgControlStatusGroup,
|
|
1491
1527
|
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
1492
1528
|
},
|
|
1493
1529
|
{
|
|
1494
1530
|
kind: "directive",
|
|
1495
|
-
type:
|
|
1531
|
+
type: i4.FormGroupDirective,
|
|
1496
1532
|
selector: "[formGroup]",
|
|
1497
1533
|
inputs: ["formGroup"],
|
|
1498
1534
|
outputs: ["ngSubmit"],
|
|
@@ -1500,7 +1536,7 @@ var AdbMapComponent = class AdbMapComponent {
|
|
|
1500
1536
|
},
|
|
1501
1537
|
{
|
|
1502
1538
|
kind: "directive",
|
|
1503
|
-
type:
|
|
1539
|
+
type: i4.FormControlName,
|
|
1504
1540
|
selector: "[formControlName]",
|
|
1505
1541
|
inputs: [
|
|
1506
1542
|
"formControlName",
|
|
@@ -1552,13 +1588,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1552
1588
|
selector: "adb-map",
|
|
1553
1589
|
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1554
1590
|
standalone: false,
|
|
1555
|
-
template: "@if(error){\n<div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'ERROR.SERVER_ERROR'|translate}}</span>\n</div>\n}\n<div [class.loading]=\"mapLoading()\">\n <div class=\"d-flex align-items-center justify-content-end flex-wrap gap-1
|
|
1591
|
+
template: "@if(error){\n<div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'ERROR.SERVER_ERROR'|translate}}</span>\n</div>\n}\n<div [class.loading]=\"mapLoading()\">\n <div class=\"bg-light d-flex align-items-center justify-content-end border-bottom flex-wrap gap-1 p-1\" [class.d-none]=\"!headerButtons().length && mapResult()?.properties?.count == null\">\n @if (!mapLoading() && mapResult()?.properties?.count != null) {\n <span class=\"me-auto\">{{mapResult().properties.count | adbSpacing}} {{'MAP.OBSERVATIONS' | translate}}</span>\n }\n @if (showLayersButton() && !settingsOpen()) {\n @if (providerLayers(); as layers) {\n <div class=\"dropdown\" (keydown.escape)=\"layerPicker.close(); layerButton.focus(); $event.stopPropagation()\">\n <button #layerButton #layerPicker=\"adbDropdown\" adbDropdown [insideClick]=\"true\"\n type=\"button\" class=\"btn btn-sm btn-secondary dropdown-toggle no-caret\"\n [attr.aria-label]=\"'MAP.LAYERS' | translate\" [title]=\"'MAP.LAYERS' | translate\">\n <span class=\"bi bi-layers\" aria-hidden=\"true\"></span>\n </button>\n <div class=\"dropdown-menu z-3 bg-light shadow p-3 text-nowrap\">\n <fieldset>\n <legend class=\"visually-hidden\">{{'MAP.LAYERS' | translate}}</legend>\n @for (entry of layers.backgrounds; track entry.name; let index = $index) {\n <label class=\"d-block\">\n <input type=\"radio\" [name]=\"mapId + '-background'\" [checked]=\"entry.layer.getVisible()\"\n (change)=\"selectBackground(index)\">\n {{entry.name}}\n </label>\n }\n </fieldset>\n @if (layers.overlays.length) {\n <hr class=\"my-2\">\n @for (entry of layers.overlays; track entry.name) {\n <label class=\"d-block\">\n <input #overlay type=\"checkbox\" [checked]=\"entry.layer.getVisible()\"\n (change)=\"entry.layer.setVisible(overlay.checked)\">\n {{entry.name}}\n </label>\n }\n }\n </div>\n </div>\n }\n }\n @if (showExportButton()) {\n <button type=\"button\" class=\"btn btn-sm btn-secondary\" [attr.aria-label]=\"'MAP.EXPORT' | translate\" [title]=\"'MAP.EXPORT' | translate\" [disabled]=\"settingsOpen()\" (click)=\"onExport()\">\n <span class=\"bi bi-download\" aria-hidden=\"true\"></span>\n </button>\n }\n <button #settingsButton [hidden]=\"!showSettingsButton() && !settingsOpen()\" type=\"button\" class=\"btn btn-sm btn-secondary\" [attr.aria-label]=\"'MAP.SETTINGS.TITLE' | translate\"\n [title]=\"'MAP.SETTINGS.TITLE' | translate\" [attr.aria-expanded]=\"settingsOpen()\" [attr.aria-controls]=\"mapId + '-settings'\"\n (click)=\"settingsOpen() ? cancelSettings(settingsButton) : openSettings()\">\n <span class=\"bi bi-gear\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <div class=\"position-relative\">\n <div [id]=\"mapId\" tabindex=\"0\" class=\"adb-map\" [class.invisible]=\"settingsOpen()\" [attr.inert]=\"settingsOpen() ? '' : null\"></div>\n @if (locationOptions(); as options) {\n <adb-map-feature-picker [locationOptions]=\"options\" (featureChosen)=\"onFeatureChosen($event)\" (dismissed)=\"closeLocationPicker($event)\" />\n }\n @if (settingsOpen()) {\n <form [id]=\"mapId + '-settings'\" [formGroup]=\"settingsForm\" (ngSubmit)=\"saveSettings(settingsButton)\"\n class=\"p-3 position-absolute top-0 start-0 w-100 h-100 overflow-auto m-0\"\n [class.loading]=\"savingSettings()\" [attr.aria-labelledby]=\"mapId + '-settings-title'\" [attr.aria-busy]=\"savingSettings()\"\n (keydown.escape)=\"cancelSettings(settingsButton); $event.stopPropagation()\">\n <h2 [id]=\"mapId + '-settings-title'\" class=\"h5\">{{'MAP.SETTINGS.TITLE' | translate}}</h2>\n <div class=\"form-check mb-3\">\n <input [id]=\"mapId + '-uncertain'\" type=\"checkbox\" formControlName=\"uncertain\" class=\"form-check-input\">\n <label [for]=\"mapId + '-uncertain'\" class=\"form-check-label\">{{'MAP.SETTINGS.UNCERTAINTY' | translate}}</label>\n </div>\n @if (allowPresentationMode()) {\n <div class=\"mb-3\">\n <label [for]=\"mapId + '-presentation-mode'\">{{'MAP.SETTINGS.PRESENTATION_MODE' | translate}}</label>\n <select [id]=\"mapId + '-presentation-mode'\" formControlName=\"presentationMode\" class=\"form-select\">\n <option value=\"locations\">{{'MAP.SETTINGS.LOCATIONS_MODE' | translate}}</option>\n <option value=\"observations\">{{'MAP.SETTINGS.OBSERVATIONS_MODE' | translate}}</option>\n </select>\n </div>\n @if (settingsForm.controls.presentationMode.value === 'observations') {\n <div class=\"mb-3\">\n <label [for]=\"mapId + '-cutoff'\">{{'MAP.SETTINGS.CUTOFF' | translate}}</label>\n <input [id]=\"mapId + '-cutoff'\" type=\"text\" inputmode=\"numeric\" formControlName=\"cutoff\" class=\"form-control\"\n [attr.aria-invalid]=\"settingsForm.controls.cutoff.invalid\" [attr.aria-describedby]=\"mapId + '-cutoff-error'\">\n @if (settingsForm.controls.cutoff.invalid) {\n <div [id]=\"mapId + '-cutoff-error'\" class=\"invalid-feedback\">{{'MAP.SETTINGS.INVALID_CUTOFF' | translate}}</div>\n }\n </div>\n }\n }\n @if (settingsError()) {\n <div class=\"d-flex align-items-baseline gap-2 p-2 mb-3\" role=\"alert\">\n <span class=\"bi bi-circle-fill text-danger\" aria-hidden=\"true\"></span>\n <span>{{'MAP.SETTINGS.SAVE_ERROR' | translate}}</span>\n </div>\n }\n <div class=\"d-flex justify-content-end gap-2\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelSettings(settingsButton)\">{{'MAP.SETTINGS.CANCEL' | translate}}</button>\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"settingsForm.invalid || settingsForm.pristine\">{{'MAP.SETTINGS.SAVE' | translate}}</button>\n </div>\n </form>\n }\n </div>\n</div>\n@if (showLegend() && !settingsOpen()) {\n <adb-map-legend [result]=\"mapResult()\" [cutoffYear]=\"cutoffYear()\" [loading]=\"mapLoading()\"\n [showObservationStatus]=\"activePresentationMode() === 'observations'\" />\n}\n"
|
|
1556
1592
|
}]
|
|
1557
1593
|
}],
|
|
1558
1594
|
ctorParameters: () => [
|
|
1559
1595
|
{ type: i1.ActivatedRoute },
|
|
1560
1596
|
{ type: AdbMapConfigService },
|
|
1561
|
-
{ type: i1.Router }
|
|
1597
|
+
{ type: i1.Router },
|
|
1598
|
+
{
|
|
1599
|
+
type: void 0,
|
|
1600
|
+
decorators: [{
|
|
1601
|
+
type: Inject,
|
|
1602
|
+
args: [ADB_MAP_DATA_SOURCE]
|
|
1603
|
+
}]
|
|
1604
|
+
}
|
|
1562
1605
|
],
|
|
1563
1606
|
propDecorators: {
|
|
1564
1607
|
showLegend: [{
|
|
@@ -1569,11 +1612,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1569
1612
|
required: false
|
|
1570
1613
|
}]
|
|
1571
1614
|
}],
|
|
1572
|
-
|
|
1615
|
+
headerButtons: [{
|
|
1573
1616
|
type: i0.Input,
|
|
1574
1617
|
args: [{
|
|
1575
1618
|
isSignal: true,
|
|
1576
|
-
alias: "
|
|
1619
|
+
alias: "headerButtons",
|
|
1577
1620
|
required: false
|
|
1578
1621
|
}]
|
|
1579
1622
|
}],
|
|
@@ -1675,12 +1718,7 @@ var AdbLocationMapComponent = class AdbLocationMapComponent {
|
|
|
1675
1718
|
}
|
|
1676
1719
|
fitPendingExtent() {
|
|
1677
1720
|
if (!AdbMapUtils.fitExtentIfReady(this.map, this.pendingExtent, {
|
|
1678
|
-
padding:
|
|
1679
|
-
20,
|
|
1680
|
-
20,
|
|
1681
|
-
20,
|
|
1682
|
-
20
|
|
1683
|
-
],
|
|
1721
|
+
padding: MapConstants.FIT_PADDING,
|
|
1684
1722
|
maxZoom: 18
|
|
1685
1723
|
})) return;
|
|
1686
1724
|
this.pendingExtent = null;
|
|
@@ -1975,49 +2013,49 @@ var AdbMapFilters = class AdbMapFilters {
|
|
|
1975
2013
|
}
|
|
1976
2014
|
},
|
|
1977
2015
|
ngImport: i0,
|
|
1978
|
-
template: "@if(form){\n<form [formGroup]=\"form\" class=\"
|
|
2016
|
+
template: "@if(form){\n<form [formGroup]=\"form\" class=\"mb-3\" (ngSubmit)=\"onSubmit()\">\n <div class=\"mb-3\">\n @if(visibleFilters().taxon){\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\n @if(!hasTaxonInUrlParameter){\n <div class=\"mb-3\">\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\n </div>\n }\n </adb-filter-section>\n }\n @if(visibleFilters().time){\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\n <div class=\"mb-1\">\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\n </select>\n </div>\n @if (form.value?.period==='6') {\n <div class=\"mb-2\">\n <label for=\"startAt\">{{'FROM' |translate}}</label>\n <input adbDatepicker type=\"text\" class=\"form-control\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateStartConfig\">\n </div>\n <div class=\"mb-2\">\n <label for=\"endAt\">{{'TO' |translate}}</label>\n <input adbDatepicker type=\"text\" class=\"form-control\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateEndConfig\">\n </div>\n }\n </adb-filter-section>\n }\n @if(visibleFilters().area){\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\n <ng-template>\n @if(visibleFilters().ownArea){\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\n <button type=\"button\" class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"area-select\">\n {{'CHOOSE'|translate}}\n </button>\n <button type=\"button\" class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"{{hasOwnArea}}\" aria-controls=\"area-draw\">\n {{'OWN_AREA'|translate}}\n </button>\n </div>\n }\n <div class=\"mb-2\">\n @if(hasOwnArea&&visibleFilters().ownArea){\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\n <div>\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\n </div>\n </div>\n }@else{\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\n <div formArrayName=\"areas\">\n <div class=\"d-flex align-items-end mb-1\">\n <label>{{'AREAS'|translate}}</label>\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\n <span class=\"bi bi-plus\"></span>\n </button>\n </div>\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\n <div class=\"d-flex mb-2\">\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\n @if(areasArray.length>1){\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\n <span class=\"bi bi-trash\"></span>\n </button>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n </ng-template>\n </adb-filter-section>\n }\n @if(form.get('taxonId')){\n @if(visibleFilters().taxaLists){\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\n <div class=\"mb-3\">\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\n </div>\n {{'LISTS.READ_MORE'|translate}}\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\n </adb-filter-section>\n }\n @if(visibleFilters().datasources){\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\n @if (form.get('ds')) {\n <div formArrayName=\"ds\">\n @for (item of dsControls; track item; let i = $index) {\n <div [formGroupName]=\"i\" class=\"form-check\">\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\n </div>\n }\n </div>\n }\n </adb-filter-section>\n }\n }\n </div>\n <div class=\"d-flex justify-content-end gap-2\">\n @if (inline) {\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\n {{'CANCEL'|translate}}\n </a>\n }\n <a [routerLink]=\"[]\" class=\"btn btn-secondary\" [queryParams]=\"null\">\n {{'CLEAR'|translate}}\n </a>\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"!canFilter()\">{{'FILTER'|translate}}</button>\n </div>\n</form>\n}\n",
|
|
1979
2017
|
dependencies: [
|
|
1980
2018
|
{
|
|
1981
2019
|
kind: "directive",
|
|
1982
|
-
type:
|
|
2020
|
+
type: i4.ɵNgNoValidate,
|
|
1983
2021
|
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
1984
2022
|
},
|
|
1985
2023
|
{
|
|
1986
2024
|
kind: "directive",
|
|
1987
|
-
type:
|
|
2025
|
+
type: i4.NgSelectOption,
|
|
1988
2026
|
selector: "option",
|
|
1989
2027
|
inputs: ["ngValue", "value"]
|
|
1990
2028
|
},
|
|
1991
2029
|
{
|
|
1992
2030
|
kind: "directive",
|
|
1993
|
-
type:
|
|
2031
|
+
type: i4.ɵNgSelectMultipleOption,
|
|
1994
2032
|
selector: "option",
|
|
1995
2033
|
inputs: ["ngValue", "value"]
|
|
1996
2034
|
},
|
|
1997
2035
|
{
|
|
1998
2036
|
kind: "directive",
|
|
1999
|
-
type:
|
|
2037
|
+
type: i4.DefaultValueAccessor,
|
|
2000
2038
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
2001
2039
|
},
|
|
2002
2040
|
{
|
|
2003
2041
|
kind: "directive",
|
|
2004
|
-
type:
|
|
2042
|
+
type: i4.CheckboxControlValueAccessor,
|
|
2005
2043
|
selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
|
|
2006
2044
|
},
|
|
2007
2045
|
{
|
|
2008
2046
|
kind: "directive",
|
|
2009
|
-
type:
|
|
2047
|
+
type: i4.SelectControlValueAccessor,
|
|
2010
2048
|
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
2011
2049
|
inputs: ["compareWith"]
|
|
2012
2050
|
},
|
|
2013
2051
|
{
|
|
2014
2052
|
kind: "directive",
|
|
2015
|
-
type:
|
|
2053
|
+
type: i4.NgControlStatus,
|
|
2016
2054
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
2017
2055
|
},
|
|
2018
2056
|
{
|
|
2019
2057
|
kind: "directive",
|
|
2020
|
-
type:
|
|
2058
|
+
type: i4.NgControlStatusGroup,
|
|
2021
2059
|
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
2022
2060
|
},
|
|
2023
2061
|
{
|
|
@@ -2041,7 +2079,7 @@ var AdbMapFilters = class AdbMapFilters {
|
|
|
2041
2079
|
},
|
|
2042
2080
|
{
|
|
2043
2081
|
kind: "directive",
|
|
2044
|
-
type:
|
|
2082
|
+
type: i4.FormGroupDirective,
|
|
2045
2083
|
selector: "[formGroup]",
|
|
2046
2084
|
inputs: ["formGroup"],
|
|
2047
2085
|
outputs: ["ngSubmit"],
|
|
@@ -2049,7 +2087,7 @@ var AdbMapFilters = class AdbMapFilters {
|
|
|
2049
2087
|
},
|
|
2050
2088
|
{
|
|
2051
2089
|
kind: "directive",
|
|
2052
|
-
type:
|
|
2090
|
+
type: i4.FormControlName,
|
|
2053
2091
|
selector: "[formControlName]",
|
|
2054
2092
|
inputs: [
|
|
2055
2093
|
"formControlName",
|
|
@@ -2060,13 +2098,13 @@ var AdbMapFilters = class AdbMapFilters {
|
|
|
2060
2098
|
},
|
|
2061
2099
|
{
|
|
2062
2100
|
kind: "directive",
|
|
2063
|
-
type:
|
|
2101
|
+
type: i4.FormGroupName,
|
|
2064
2102
|
selector: "[formGroupName]",
|
|
2065
2103
|
inputs: ["formGroupName"]
|
|
2066
2104
|
},
|
|
2067
2105
|
{
|
|
2068
2106
|
kind: "directive",
|
|
2069
|
-
type:
|
|
2107
|
+
type: i4.FormArrayName,
|
|
2070
2108
|
selector: "[formArrayName]",
|
|
2071
2109
|
inputs: ["formArrayName"]
|
|
2072
2110
|
},
|
|
@@ -2150,7 +2188,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2150
2188
|
selector: "adb-map-filters",
|
|
2151
2189
|
changeDetection: ChangeDetectionStrategy.Eager,
|
|
2152
2190
|
standalone: false,
|
|
2153
|
-
template: "@if(form){\n<form [formGroup]=\"form\" class=\"
|
|
2191
|
+
template: "@if(form){\n<form [formGroup]=\"form\" class=\"mb-3\" (ngSubmit)=\"onSubmit()\">\n <div class=\"mb-3\">\n @if(visibleFilters().taxon){\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\n @if(!hasTaxonInUrlParameter){\n <div class=\"mb-3\">\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\n </div>\n }\n </adb-filter-section>\n }\n @if(visibleFilters().time){\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\n <div class=\"mb-1\">\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\n </select>\n </div>\n @if (form.value?.period==='6') {\n <div class=\"mb-2\">\n <label for=\"startAt\">{{'FROM' |translate}}</label>\n <input adbDatepicker type=\"text\" class=\"form-control\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateStartConfig\">\n </div>\n <div class=\"mb-2\">\n <label for=\"endAt\">{{'TO' |translate}}</label>\n <input adbDatepicker type=\"text\" class=\"form-control\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateEndConfig\">\n </div>\n }\n </adb-filter-section>\n }\n @if(visibleFilters().area){\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\n <ng-template>\n @if(visibleFilters().ownArea){\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\n <button type=\"button\" class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"area-select\">\n {{'CHOOSE'|translate}}\n </button>\n <button type=\"button\" class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"{{hasOwnArea}}\" aria-controls=\"area-draw\">\n {{'OWN_AREA'|translate}}\n </button>\n </div>\n }\n <div class=\"mb-2\">\n @if(hasOwnArea&&visibleFilters().ownArea){\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\n <div>\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\n </div>\n </div>\n }@else{\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\n <div formArrayName=\"areas\">\n <div class=\"d-flex align-items-end mb-1\">\n <label>{{'AREAS'|translate}}</label>\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\n <span class=\"bi bi-plus\"></span>\n </button>\n </div>\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\n <div class=\"d-flex mb-2\">\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\n @if(areasArray.length>1){\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\n <span class=\"bi bi-trash\"></span>\n </button>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n </ng-template>\n </adb-filter-section>\n }\n @if(form.get('taxonId')){\n @if(visibleFilters().taxaLists){\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\n <div class=\"mb-3\">\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\n </div>\n {{'LISTS.READ_MORE'|translate}}\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\n </adb-filter-section>\n }\n @if(visibleFilters().datasources){\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\n @if (form.get('ds')) {\n <div formArrayName=\"ds\">\n @for (item of dsControls; track item; let i = $index) {\n <div [formGroupName]=\"i\" class=\"form-check\">\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\n </div>\n }\n </div>\n }\n </adb-filter-section>\n }\n }\n </div>\n <div class=\"d-flex justify-content-end gap-2\">\n @if (inline) {\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\n {{'CANCEL'|translate}}\n </a>\n }\n <a [routerLink]=\"[]\" class=\"btn btn-secondary\" [queryParams]=\"null\">\n {{'CLEAR'|translate}}\n </a>\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"!canFilter()\">{{'FILTER'|translate}}</button>\n </div>\n</form>\n}\n"
|
|
2154
2192
|
}]
|
|
2155
2193
|
}],
|
|
2156
2194
|
ctorParameters: () => [
|
|
@@ -2208,6 +2246,7 @@ var AdbMapModule = class AdbMapModule {
|
|
|
2208
2246
|
CommonModule,
|
|
2209
2247
|
AdbButtonsModule,
|
|
2210
2248
|
AdbDirectivesModule,
|
|
2249
|
+
AdbDropdownModule,
|
|
2211
2250
|
FormsModule,
|
|
2212
2251
|
RouterModule,
|
|
2213
2252
|
ReactiveFormsModule,
|
|
@@ -2234,6 +2273,7 @@ var AdbMapModule = class AdbMapModule {
|
|
|
2234
2273
|
CommonModule,
|
|
2235
2274
|
AdbButtonsModule,
|
|
2236
2275
|
AdbDirectivesModule,
|
|
2276
|
+
AdbDropdownModule,
|
|
2237
2277
|
FormsModule,
|
|
2238
2278
|
RouterModule,
|
|
2239
2279
|
ReactiveFormsModule,
|
|
@@ -2256,6 +2296,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2256
2296
|
CommonModule,
|
|
2257
2297
|
AdbButtonsModule,
|
|
2258
2298
|
AdbDirectivesModule,
|
|
2299
|
+
AdbDropdownModule,
|
|
2259
2300
|
FormsModule,
|
|
2260
2301
|
RouterModule,
|
|
2261
2302
|
ReactiveFormsModule,
|