adb-shared 22.0.0-beta.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adb-shared",
3
- "version": "22.0.0-beta.2",
3
+ "version": "22.0.0-beta.4",
4
4
  "author": "ADB",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">= 22.x",
@@ -16,10 +16,8 @@
16
16
  "dependencies": {
17
17
  "tslib": "^2.9.1"
18
18
  },
19
- "sideEffects": false,
20
- "module": "fesm2022/adb-shared.mjs",
21
- "typings": "types/adb-shared.d.ts",
22
19
  "exports": {
20
+ "./redlist-colors.css": "./redlist-colors.css",
23
21
  "./package.json": {
24
22
  "default": "./package.json"
25
23
  },
@@ -32,5 +30,8 @@
32
30
  "default": "./fesm2022/adb-shared-map.mjs"
33
31
  }
34
32
  },
33
+ "sideEffects": false,
34
+ "module": "fesm2022/adb-shared.mjs",
35
+ "typings": "types/adb-shared.d.ts",
35
36
  "type": "module"
36
37
  }
@@ -0,0 +1,7 @@
1
+ .text-redlist-re { color: #41172f; }
2
+ .text-redlist-dd { color: #dcdcdc; }
3
+ .text-redlist-cr { color: #c4004e; }
4
+ .text-redlist-en { color: #cb506a; }
5
+ .text-redlist-vu { color: #d7828d; }
6
+ .text-redlist-nt { color: #ebc5c6; }
7
+ .text-redlist-lc { color: #cdd425; }
@@ -5,15 +5,17 @@ import { Extent } from "ol/extent.js";
5
5
  import Map from "ol/Map.js";
6
6
  import * as i11 from "@angular/router";
7
7
  import { ActivatedRoute, ParamMap, Params, Router } from "@angular/router";
8
+ import { Observable, Subscription } from "rxjs";
8
9
  import * as i10 from "@angular/forms";
9
10
  import { ControlValueAccessor, FormArray, FormControl, FormGroup } from "@angular/forms";
10
- import { Observable, Subscription } from "rxjs";
11
11
  import { HttpClient } from "@angular/common/http";
12
12
  import * as i8 from "@angular/common";
13
13
  import * as i9 from "adb-shared";
14
14
  import * as i12 from "@ngx-translate/core";
15
+ import { FitOptions } from "ol/View.js";
15
16
  import TileLayer from "ol/layer/Tile.js";
16
17
  import TileWMS from "ol/source/TileWMS.js";
18
+ import XYZ from "ol/source/XYZ.js";
17
19
  import CircleGeometry from "ol/geom/Circle.js";
18
20
  import { Style } from "ol/style.js";
19
21
  export interface AdbMapConfig {
@@ -179,18 +181,50 @@ declare class MapLegendComponent {
179
181
  };
180
182
  }, {}, never, never, false, never>;
181
183
  }
184
+ export interface AdbMapRequest {
185
+ url: string;
186
+ params: Params;
187
+ metersPerPixel: number;
188
+ dataProviderIds?: readonly number[];
189
+ }
190
+ export interface AdbMapDataSource {
191
+ load(request: AdbMapRequest): Observable<GeoJson>;
192
+ }
193
+ /** Default transport for the shared BFF observation-features contract. */
194
+ export declare class AdbBffMapDataSource implements AdbMapDataSource {
195
+ private readonly http;
196
+ load(request: AdbMapRequest): Observable<GeoJson>;
197
+ static ɵfac: i0.ɵɵFactoryDeclaration<AdbBffMapDataSource, never>;
198
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
199
+ }
200
+ /** Applications normally use the default BFF source without overriding this token. */
201
+ export declare const ADB_MAP_DATA_SOURCE: InjectionToken<AdbMapDataSource>;
202
+ export type MapHeaderButton = 'layers' | 'export' | 'settings';
182
203
  export type MapPresentationMode = 'locations' | 'observations';
183
204
  export declare class AdbMapComponent implements AfterViewInit, OnDestroy {
184
205
  private activatedRoute;
185
206
  private config;
186
207
  private router;
208
+ private readonly dataSource;
187
209
  showLegend: import("@angular/core").InputSignal<boolean>;
188
- showHeader: import("@angular/core").InputSignal<boolean>;
210
+ headerButtons: import("@angular/core").InputSignal<readonly MapHeaderButton[]>;
211
+ showLayersButton: import("@angular/core").Signal<boolean>;
212
+ showExportButton: import("@angular/core").Signal<boolean>;
213
+ showSettingsButton: import("@angular/core").Signal<boolean>;
214
+ providerLayers: import("@angular/core").WritableSignal<{
215
+ backgrounds: {
216
+ name: string;
217
+ layer: import("ol/layer/Tile").default<import("ol/source").TileWMS> | import("ol/layer/Tile").default<import("ol/source").XYZ>;
218
+ }[];
219
+ overlays: {
220
+ name: string;
221
+ layer: import("ol/layer/Tile").default<import("ol/source").TileWMS>;
222
+ }[];
223
+ }>;
189
224
  allowPresentationMode: import("@angular/core").InputSignal<boolean>;
190
225
  presentationMode: import("@angular/core").InputSignal<MapPresentationMode>;
191
226
  private route;
192
227
  activePresentationMode: import("@angular/core").Signal<any>;
193
- private readonly dataSource;
194
228
  private requestedParams;
195
229
  settingsOpen: import("@angular/core").WritableSignal<boolean>;
196
230
  savingSettings: import("@angular/core").WritableSignal<boolean>;
@@ -228,8 +262,9 @@ export declare class AdbMapComponent implements AfterViewInit, OnDestroy {
228
262
  map: Map;
229
263
  private mapReady;
230
264
  queryParams: Params;
231
- constructor(activatedRoute: ActivatedRoute, config: AdbMapConfigService, router: Router);
265
+ constructor(activatedRoute: ActivatedRoute, config: AdbMapConfigService, router: Router, dataSource: AdbMapDataSource);
232
266
  ngAfterViewInit(): void;
267
+ selectBackground(index: number): void;
233
268
  openSettings(): void;
234
269
  cancelSettings(button: HTMLButtonElement): void;
235
270
  saveSettings(button: HTMLButtonElement): Promise<void>;
@@ -254,8 +289,8 @@ export declare class AdbMapComponent implements AfterViewInit, OnDestroy {
254
289
  "required": false;
255
290
  "isSignal": true;
256
291
  };
257
- "showHeader": {
258
- "alias": "showHeader";
292
+ "headerButtons": {
293
+ "alias": "headerButtons";
259
294
  "required": false;
260
295
  "isSignal": true;
261
296
  };
@@ -277,9 +312,9 @@ export declare class AdbMapComponent implements AfterViewInit, OnDestroy {
277
312
  export declare class PolygonDrawerInput implements ControlValueAccessor, AfterViewInit, OnDestroy {
278
313
  mapId: string;
279
314
  map: Map;
280
- polygonDraw: boolean;
315
+ readonly polygonDraw: import("@angular/core").WritableSignal<boolean>;
281
316
  disabled: boolean;
282
- shapeLayer: boolean;
317
+ readonly shapeLayer: import("@angular/core").WritableSignal<boolean>;
283
318
  private source;
284
319
  private format;
285
320
  private draw;
@@ -324,6 +359,8 @@ export declare class AdbMapFilters implements OnInit, OnDestroy {
324
359
  static datasets: string[];
325
360
  subscriptions: Subscription;
326
361
  form: FormGroup;
362
+ readonly canFilter: import("@angular/core").WritableSignal<boolean>;
363
+ private formEvents;
327
364
  thisYear: Date;
328
365
  lastYear: Date;
329
366
  queryParamsMap: ParamMap;
@@ -404,23 +441,13 @@ interface ListItem {
404
441
  export declare class AdbMapModule {
405
442
  static forRoot(config?: AdbMapConfig): ModuleWithProviders<AdbMapModule>;
406
443
  static ɵfac: i0.ɵɵFactoryDeclaration<AdbMapModule, never>;
407
- static ɵmod: i0.ɵɵNgModuleDeclaration<AdbMapModule, [typeof AdbLocationMapComponent, typeof MapFeaturePickerComponent, typeof MapLegendComponent, typeof AdbMapComponent, typeof PolygonDrawerInput, typeof AdbMapFilters, typeof TreeviewComponent], [typeof i8.CommonModule, typeof i9.AdbButtonsModule, typeof i9.AdbDirectivesModule, typeof i10.FormsModule, typeof i11.RouterModule, typeof i10.ReactiveFormsModule, typeof i9.AdbDatePickerModule, typeof i9.AdbPipesModule, typeof i9.AdbFilterSectionModule, typeof i9.AdbPickerModule, typeof i12.TranslatePipe], [typeof AdbLocationMapComponent, typeof AdbMapComponent, typeof PolygonDrawerInput, typeof AdbMapFilters]>;
444
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AdbMapModule, [typeof AdbLocationMapComponent, typeof MapFeaturePickerComponent, typeof MapLegendComponent, typeof AdbMapComponent, typeof PolygonDrawerInput, typeof AdbMapFilters, typeof TreeviewComponent], [typeof i8.CommonModule, typeof i9.AdbButtonsModule, typeof i9.AdbDirectivesModule, typeof i9.AdbDropdownModule, typeof i10.FormsModule, typeof i11.RouterModule, typeof i10.ReactiveFormsModule, typeof i9.AdbDatePickerModule, typeof i9.AdbPipesModule, typeof i9.AdbFilterSectionModule, typeof i9.AdbPickerModule, typeof i12.TranslatePipe], [typeof AdbLocationMapComponent, typeof AdbMapComponent, typeof PolygonDrawerInput, typeof AdbMapFilters]>;
408
445
  static ɵinj: i0.ɵɵInjectorDeclaration<AdbMapModule>;
409
446
  }
410
447
  export declare class AdbMapUtils {
411
- static locationSymbol(feature: FeatureLike, selected?: boolean, hovered?: boolean): Style;
412
- static isNotRecovered(presentation: any): boolean;
413
- static aggregatedSymbol(style: Style, presentation: any, cutoffYear: string, selected: boolean, geometryType?: string): Style | Style[];
414
- static createUncertaintyCircle(center: number[], radius: number): CircleGeometry;
415
448
  static readonly INITIAL_METERS_PER_PIXEL = 500;
416
449
  static readonly INITIAL_CENTER_LAT = 62;
417
450
  static readonly INITIAL_CENTER_LNG = 17;
418
- static gridLevels(result: GeoJson): {
419
- min: number;
420
- max: number;
421
- color: string;
422
- }[];
423
- static getMetersPerPixel(bbox: string, mapWidth: number): number;
424
451
  static OverlayMaps: {
425
452
  Altitude: TileLayer<TileWMS>;
426
453
  Fjällkarta: TileLayer<TileWMS>;
@@ -430,8 +457,34 @@ export declare class AdbMapUtils {
430
457
  'Ekonomisk zon': TileLayer<TileWMS>;
431
458
  };
432
459
  static Providers: MapProvider[];
460
+ static fitExtentIfReady(map: Map, extent: Extent | null | undefined, options: FitOptions): boolean;
461
+ static isCluster(properties: Record<string, unknown>): boolean;
462
+ static locationSymbol(feature: FeatureLike, selected?: boolean, hovered?: boolean): Style;
463
+ static isNotRecovered(presentation: any): boolean;
464
+ static aggregatedSymbol(style: Style, presentation: any, cutoffYear: string, selected: boolean, geometryType?: string): Style | Style[];
465
+ static createUncertaintyCircle(center: number[], radius: number): CircleGeometry;
466
+ static gridSymbol(observationCount: number, levels: readonly {
467
+ max: number;
468
+ color: string;
469
+ }[]): Style;
470
+ static gridLevels(result: GeoJson): {
471
+ min: number;
472
+ max: number;
473
+ color: string;
474
+ }[];
475
+ static getMetersPerPixel(bbox: string, mapWidth: number): number;
433
476
  private static wms;
434
477
  static createMap(elementId: string, options?: MapOptions): Map;
478
+ static addProviderLayers(map: Map): {
479
+ backgrounds: {
480
+ name: string;
481
+ layer: TileLayer<TileWMS> | TileLayer<XYZ>;
482
+ }[];
483
+ overlays: {
484
+ name: string;
485
+ layer: TileLayer<TileWMS>;
486
+ }[];
487
+ };
435
488
  private static addProviders;
436
489
  static createFile(source: Blob, fileName?: string): boolean;
437
490
  }
@@ -444,22 +497,4 @@ interface MapProvider {
444
497
  wms: boolean;
445
498
  params?: any;
446
499
  }
447
- export interface AdbMapRequest {
448
- url: string;
449
- params: Params;
450
- metersPerPixel: number;
451
- dataProviderIds?: readonly number[];
452
- }
453
- export interface AdbMapDataSource {
454
- load(request: AdbMapRequest): Observable<GeoJson>;
455
- }
456
- /** Default transport for the shared BFF observation-features contract. */
457
- export declare class AdbBffMapDataSource implements AdbMapDataSource {
458
- private readonly http;
459
- load(request: AdbMapRequest): Observable<GeoJson>;
460
- static ɵfac: i0.ɵɵFactoryDeclaration<AdbBffMapDataSource, never>;
461
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
462
- }
463
- /** Applications normally use the default BFF source without overriding this token. */
464
- export declare const ADB_MAP_DATA_SOURCE: InjectionToken<AdbMapDataSource>;
465
500
  export {};
@@ -155,6 +155,17 @@ export declare class RedListBadgeClassDirective {
155
155
  };
156
156
  }, {}, never, never, false, never>;
157
157
  }
158
+ export declare class RedListColorClassDirective {
159
+ redlistId: string | null;
160
+ get colorClass(): string | null;
161
+ static ɵfac: i0.ɵɵFactoryDeclaration<RedListColorClassDirective, never>;
162
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RedListColorClassDirective, "[adbRedListColorClass]", never, {
163
+ "redlistId": {
164
+ "alias": "adbRedListColorClass";
165
+ "required": false;
166
+ };
167
+ }, {}, never, never, false, never>;
168
+ }
158
169
  export declare class RiskClassDirective {
159
170
  category: string;
160
171
  get hostClasses(): string;
@@ -214,7 +225,7 @@ export declare class RouterLinkActiveFragmentDirective implements OnInit, OnDest
214
225
  }
215
226
  export declare class AdbDirectivesModule {
216
227
  static ɵfac: i0.ɵɵFactoryDeclaration<AdbDirectivesModule, never>;
217
- static ɵmod: i0.ɵɵNgModuleDeclaration<AdbDirectivesModule, [typeof ClickOutsideDirective, typeof FocusDirective, typeof FileUploadDirective, typeof RedListBadgeClassDirective, typeof RiskClassDirective, typeof ImageLoaderDirective, typeof RouterLinkActiveFragmentDirective], never, [typeof ClickOutsideDirective, typeof FocusDirective, typeof FileUploadDirective, typeof RedListBadgeClassDirective, typeof RiskClassDirective, typeof ImageLoaderDirective, typeof RouterLinkActiveFragmentDirective]>;
228
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AdbDirectivesModule, [typeof ClickOutsideDirective, typeof FocusDirective, typeof FileUploadDirective, typeof RedListBadgeClassDirective, typeof RedListColorClassDirective, typeof RiskClassDirective, typeof ImageLoaderDirective, typeof RouterLinkActiveFragmentDirective], never, [typeof ClickOutsideDirective, typeof FocusDirective, typeof FileUploadDirective, typeof RedListBadgeClassDirective, typeof RedListColorClassDirective, typeof RiskClassDirective, typeof ImageLoaderDirective, typeof RouterLinkActiveFragmentDirective]>;
218
229
  static ɵinj: i0.ɵɵInjectorDeclaration<AdbDirectivesModule>;
219
230
  }
220
231
  declare class AdbDropdownService {
@@ -423,7 +434,7 @@ export declare class AdbAlertComponent implements OnInit {
423
434
  static ɵcmp: i0.ɵɵComponentDeclaration<AdbAlertComponent, "adb-alert", never, {}, {}, never, never, false, never>;
424
435
  }
425
436
  interface RichModuleConfig {
426
- taxonUrl: string;
437
+ taxonUrl?: string;
427
438
  }
428
439
  export declare class AdbRichEditorComponent implements ControlValueAccessor, OnDestroy {
429
440
  private el;
@@ -440,6 +451,7 @@ export declare class AdbRichEditorComponent implements ControlValueAccessor, OnD
440
451
  onBoldClick(): void;
441
452
  private applyFormatting;
442
453
  private findWrappingMarker;
454
+ onLinkClick(): void;
443
455
  onTaxonClick(): void;
444
456
  onReferenceClick(): void;
445
457
  private replaceMarked;
@@ -482,11 +494,13 @@ export interface RichTextPart {
482
494
  export declare class RichTextComponent {
483
495
  text: string;
484
496
  parts: RichTextPart[];
485
- taxonUrl: string;
486
- constructor(config: RichModuleConfig);
497
+ readonly taxonUrl: string | null;
498
+ constructor(config: RichModuleConfig | null);
487
499
  ngOnChanges(): void;
488
500
  private parseCustomMarkdown;
489
- static ɵfac: i0.ɵɵFactoryDeclaration<RichTextComponent, never>;
501
+ static ɵfac: i0.ɵɵFactoryDeclaration<RichTextComponent, [{
502
+ optional: true;
503
+ }]>;
490
504
  static ɵcmp: i0.ɵɵComponentDeclaration<RichTextComponent, "adb-rich-text", never, {
491
505
  "text": {
492
506
  "alias": "text";
@@ -495,7 +509,7 @@ export declare class RichTextComponent {
495
509
  }, {}, never, never, false, never>;
496
510
  }
497
511
  export declare class AdbRichEditorModule {
498
- static forRoot(config: RichModuleConfig): ModuleWithProviders<AdbRichEditorModule>;
512
+ static forRoot(config?: RichModuleConfig): ModuleWithProviders<AdbRichEditorModule>;
499
513
  static ɵfac: i0.ɵɵFactoryDeclaration<AdbRichEditorModule, never>;
500
514
  static ɵmod: i0.ɵɵNgModuleDeclaration<AdbRichEditorModule, [typeof AdbRichEditorComponent, typeof RichTextComponent], [typeof i2.CommonModule, typeof i4.FormsModule, typeof i3.TranslatePipe], [typeof AdbRichEditorComponent, typeof RichTextComponent]>;
501
515
  static ɵinj: i0.ɵɵInjectorDeclaration<AdbRichEditorModule>;
@@ -902,6 +916,11 @@ export declare class AdbPickerConfigService {
902
916
  static ɵfac: i0.ɵɵFactoryDeclaration<AdbPickerConfigService, never>;
903
917
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
904
918
  }
919
+ interface SOSArea {
920
+ name: string;
921
+ areaType: string;
922
+ featureId: string;
923
+ }
905
924
  interface Area {
906
925
  identifier: string;
907
926
  name: string;
@@ -1003,9 +1022,11 @@ export declare class AdbAreaPickerComponent implements ControlValueAccessor {
1003
1022
  private onTouched;
1004
1023
  constructor(translate: TranslateService, config: AdbPickerConfigService, http: HttpClient);
1005
1024
  getAreas: (query: string) => import("rxjs").Observable<PagedResult<Area>>;
1006
- displayArea: (area: Area) => string;
1007
- loadAreaIdentifier: (identifier: string) => import("rxjs").Observable<Area>;
1008
- onSelect(area: Area | null): void;
1025
+ displayArea: (area: SOSArea) => string;
1026
+ loadAreaId: (id: any) => import("rxjs").Observable<Area>;
1027
+ onSelect(area: (Partial<Area> & {
1028
+ id?: string;
1029
+ }) | null): void;
1009
1030
  onFocus(): void;
1010
1031
  writeValue(value: any): void;
1011
1032
  registerOnChange(fn: any): void;