adb-shared 6.2.20 → 6.2.21
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/README.md +56 -6
- package/fesm2022/adb-shared-src-map.mjs +824 -0
- package/fesm2022/adb-shared-src-map.mjs.map +1 -0
- package/fesm2022/adb-shared.mjs +490 -1159
- package/fesm2022/adb-shared.mjs.map +1 -1
- package/package.json +8 -5
- package/types/adb-shared-src-map.d.ts +260 -0
- package/types/adb-shared.d.ts +12 -259
package/fesm2022/adb-shared.mjs
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import * as i1$3 from '@angular/common';
|
|
2
2
|
import { CommonModule, DatePipe, formatDate } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Inject, Injectable, EventEmitter, HostListener, Output, Directive, Input, HostBinding, NgModule, Component, Pipe, forwardRef, InjectionToken, TemplateRef, ContentChild, signal
|
|
4
|
+
import { Inject, Injectable, EventEmitter, HostListener, Output, Directive, Input, HostBinding, NgModule, Component, Pipe, forwardRef, InjectionToken, TemplateRef, ContentChild, signal } from '@angular/core';
|
|
5
5
|
import * as i1$1 from '@ngx-translate/core';
|
|
6
6
|
import { TranslateModule } from '@ngx-translate/core';
|
|
7
7
|
import * as i1$2 from '@angular/common/http';
|
|
8
8
|
import { provideHttpClient, withInterceptorsFromDi, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
10
|
import { NavigationEnd, RouterModule, NavigationStart } from '@angular/router';
|
|
11
|
-
import { Subscription, Subject, of, BehaviorSubject, catchError, throwError, map as map$1, tap
|
|
12
|
-
import { endOfDay, addYears, startOfDay, subYears, getMonth, subMonths, addMonths, isSameYear, endOfMonth, startOfMonth, eachWeekOfInterval, getISOWeek, addDays, eachDayOfInterval, getHours, getMinutes, isSameDay, isWithinInterval, isSameMonth, isValid, parseISO, addSeconds, format
|
|
13
|
-
import * as
|
|
14
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule
|
|
15
|
-
import { delay, debounceTime, switchMap, map, catchError as catchError$1
|
|
16
|
-
import * as Leaflet from 'leaflet';
|
|
17
|
-
import Leaflet__default from 'leaflet';
|
|
18
|
-
import '@geoman-io/leaflet-geoman-free';
|
|
11
|
+
import { Subscription, Subject, of, BehaviorSubject, catchError, throwError, map as map$1, tap } from 'rxjs';
|
|
12
|
+
import { endOfDay, addYears, startOfDay, subYears, getMonth, subMonths, addMonths, isSameYear, endOfMonth, startOfMonth, eachWeekOfInterval, getISOWeek, addDays, eachDayOfInterval, getHours, getMinutes, isSameDay, isWithinInterval, isSameMonth, isValid, parseISO, addSeconds, format } from 'date-fns';
|
|
13
|
+
import * as i1$4 from '@angular/forms';
|
|
14
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
|
|
15
|
+
import { delay, debounceTime, switchMap, map, catchError as catchError$1 } from 'rxjs/operators';
|
|
19
16
|
|
|
20
17
|
class EnvironmentService {
|
|
18
|
+
environment;
|
|
21
19
|
constructor(environment) {
|
|
22
20
|
this.environment = environment;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: EnvironmentService, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
23
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: EnvironmentService, providedIn: 'root' });
|
|
26
24
|
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: EnvironmentService, decorators: [{
|
|
28
26
|
type: Injectable,
|
|
29
27
|
args: [{ providedIn: 'root' }]
|
|
30
28
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -33,9 +31,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
33
31
|
}] }] });
|
|
34
32
|
|
|
35
33
|
class ClickOutsideDirective {
|
|
34
|
+
elementRef;
|
|
35
|
+
adbClickOutside = new EventEmitter();
|
|
36
36
|
constructor(elementRef) {
|
|
37
37
|
this.elementRef = elementRef;
|
|
38
|
-
this.adbClickOutside = new EventEmitter();
|
|
39
38
|
}
|
|
40
39
|
onClick(target) {
|
|
41
40
|
const clickedInside = this.elementRef.nativeElement.contains(target);
|
|
@@ -43,10 +42,10 @@ class ClickOutsideDirective {
|
|
|
43
42
|
this.adbClickOutside.emit(target);
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
46
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: ClickOutsideDirective, isStandalone: false, selector: "[adbClickOutside]", outputs: { adbClickOutside: "adbClickOutside" }, host: { listeners: { "document:click": "onClick($event.target)" } }, ngImport: i0 });
|
|
48
47
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
50
49
|
type: Directive,
|
|
51
50
|
args: [{
|
|
52
51
|
selector: '[adbClickOutside]',
|
|
@@ -60,10 +59,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
60
59
|
}] } });
|
|
61
60
|
|
|
62
61
|
class FileUploadDirective {
|
|
62
|
+
el;
|
|
63
|
+
upload = new EventEmitter();
|
|
64
|
+
click = new EventEmitter();
|
|
63
65
|
constructor(el) {
|
|
64
66
|
this.el = el;
|
|
65
|
-
this.upload = new EventEmitter();
|
|
66
|
-
this.click = new EventEmitter();
|
|
67
67
|
}
|
|
68
68
|
onBeginUpload(target) {
|
|
69
69
|
if (target) {
|
|
@@ -78,10 +78,10 @@ class FileUploadDirective {
|
|
|
78
78
|
this.click.emit(target);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FileUploadDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
82
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: FileUploadDirective, isStandalone: false, selector: "input[adbFileUpload]", outputs: { upload: "upload" }, host: { listeners: { "change": "onBeginUpload($event.target)", "click": "onClick($event.target)" } }, ngImport: i0 });
|
|
83
83
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FileUploadDirective, decorators: [{
|
|
85
85
|
type: Directive,
|
|
86
86
|
args: [{
|
|
87
87
|
selector: 'input[adbFileUpload]',
|
|
@@ -96,6 +96,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
96
96
|
|
|
97
97
|
/* eslint-disable @angular-eslint/directive-selector */
|
|
98
98
|
class FocusDirective {
|
|
99
|
+
element;
|
|
100
|
+
focused;
|
|
99
101
|
set adbFocus(value) {
|
|
100
102
|
this.focused = value;
|
|
101
103
|
if (this.focused) {
|
|
@@ -114,10 +116,10 @@ class FocusDirective {
|
|
|
114
116
|
setTimeout(() => this.element.nativeElement.focus(), 0);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
120
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: FocusDirective, isStandalone: false, selector: "[adbFocus]", inputs: { adbFocus: "adbFocus" }, ngImport: i0 });
|
|
119
121
|
}
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FocusDirective, decorators: [{
|
|
121
123
|
type: Directive,
|
|
122
124
|
args: [{
|
|
123
125
|
selector: '[adbFocus]',
|
|
@@ -128,6 +130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
128
130
|
}] } });
|
|
129
131
|
|
|
130
132
|
class RedListBadgeClassDirective {
|
|
133
|
+
redlistId;
|
|
131
134
|
get hostClasses() {
|
|
132
135
|
this.redlistId = this.redlistId ? this.redlistId.replace('°', '') : '';
|
|
133
136
|
if (this.redlistId === 'EX' || this.redlistId === 'RE') {
|
|
@@ -153,10 +156,10 @@ class RedListBadgeClassDirective {
|
|
|
153
156
|
}
|
|
154
157
|
return 'bg-redlist-lc border';
|
|
155
158
|
}
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RedListBadgeClassDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
160
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: RedListBadgeClassDirective, isStandalone: false, selector: "[adbRedListBadgeClass]", inputs: { redlistId: ["adbRedListBadgeClass", "redlistId"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 });
|
|
158
161
|
}
|
|
159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RedListBadgeClassDirective, decorators: [{
|
|
160
163
|
type: Directive,
|
|
161
164
|
args: [{
|
|
162
165
|
selector: '[adbRedListBadgeClass]',
|
|
@@ -171,6 +174,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
171
174
|
}] } });
|
|
172
175
|
|
|
173
176
|
class RiskClassDirective {
|
|
177
|
+
category;
|
|
174
178
|
get hostClasses() {
|
|
175
179
|
if (this.category === 'NK') {
|
|
176
180
|
return 'bg-risk-class-nk text-dark border';
|
|
@@ -189,10 +193,10 @@ class RiskClassDirective {
|
|
|
189
193
|
}
|
|
190
194
|
return 'text-dark';
|
|
191
195
|
}
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RiskClassDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
197
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: RiskClassDirective, isStandalone: false, selector: "[adbRiskClass]", inputs: { category: ["adbRiskClass", "category"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 });
|
|
194
198
|
}
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RiskClassDirective, decorators: [{
|
|
196
200
|
type: Directive,
|
|
197
201
|
args: [{
|
|
198
202
|
selector: '[adbRiskClass]',
|
|
@@ -207,12 +211,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
207
211
|
}] } });
|
|
208
212
|
|
|
209
213
|
class RouterLinkActiveFragmentDirective {
|
|
214
|
+
router;
|
|
215
|
+
el;
|
|
216
|
+
renderer;
|
|
217
|
+
activeClass = 'active';
|
|
218
|
+
fragment = null;
|
|
219
|
+
sub;
|
|
210
220
|
constructor(router, el, renderer) {
|
|
211
221
|
this.router = router;
|
|
212
222
|
this.el = el;
|
|
213
223
|
this.renderer = renderer;
|
|
214
|
-
this.activeClass = 'active';
|
|
215
|
-
this.fragment = null;
|
|
216
224
|
}
|
|
217
225
|
ngOnInit() {
|
|
218
226
|
this.updateActiveState();
|
|
@@ -244,10 +252,10 @@ class RouterLinkActiveFragmentDirective {
|
|
|
244
252
|
this.sub.unsubscribe();
|
|
245
253
|
}
|
|
246
254
|
}
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RouterLinkActiveFragmentDirective, deps: [{ token: i1.Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
256
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: RouterLinkActiveFragmentDirective, isStandalone: false, selector: "[adbActiveFragment]", inputs: { activeClass: ["adbActiveFragment", "activeClass"], fragment: "fragment" }, ngImport: i0 });
|
|
249
257
|
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RouterLinkActiveFragmentDirective, decorators: [{
|
|
251
259
|
type: Directive,
|
|
252
260
|
args: [{
|
|
253
261
|
selector: '[adbActiveFragment]',
|
|
@@ -261,17 +269,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
261
269
|
}] } });
|
|
262
270
|
|
|
263
271
|
class ImageLoaderDirective {
|
|
272
|
+
el;
|
|
273
|
+
renderer;
|
|
274
|
+
translate;
|
|
275
|
+
_fallbackKey = 'IMAGE_MISSING';
|
|
264
276
|
set fallbackKey(value) {
|
|
265
277
|
this._fallbackKey = value && value.trim() ? value : 'IMAGE_MISSING';
|
|
266
278
|
}
|
|
267
279
|
get fallbackKey() {
|
|
268
280
|
return this._fallbackKey;
|
|
269
281
|
}
|
|
282
|
+
translationSub;
|
|
283
|
+
spinnerElement;
|
|
270
284
|
constructor(el, renderer, translate) {
|
|
271
285
|
this.el = el;
|
|
272
286
|
this.renderer = renderer;
|
|
273
287
|
this.translate = translate;
|
|
274
|
-
this._fallbackKey = 'IMAGE_MISSING';
|
|
275
288
|
this.showSpinner();
|
|
276
289
|
}
|
|
277
290
|
showSpinner() {
|
|
@@ -313,10 +326,10 @@ class ImageLoaderDirective {
|
|
|
313
326
|
this.translationSub?.unsubscribe();
|
|
314
327
|
this.hideSpinner();
|
|
315
328
|
}
|
|
316
|
-
|
|
317
|
-
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ImageLoaderDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
330
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: ImageLoaderDirective, isStandalone: false, selector: "img[adbImageLoader]", inputs: { fallbackKey: ["adbImageLoader", "fallbackKey"] }, host: { listeners: { "load": "onLoad()", "error": "onError()" } }, ngImport: i0 });
|
|
318
331
|
}
|
|
319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ImageLoaderDirective, decorators: [{
|
|
320
333
|
type: Directive,
|
|
321
334
|
args: [{
|
|
322
335
|
selector: 'img[adbImageLoader]',
|
|
@@ -334,11 +347,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
334
347
|
}] } });
|
|
335
348
|
|
|
336
349
|
class AdbDirectivesModule {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
350
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
351
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbDirectivesModule, declarations: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective, RiskClassDirective, ImageLoaderDirective, RouterLinkActiveFragmentDirective], exports: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective, RiskClassDirective, ImageLoaderDirective, RouterLinkActiveFragmentDirective] });
|
|
352
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDirectivesModule });
|
|
340
353
|
}
|
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDirectivesModule, decorators: [{
|
|
342
355
|
type: NgModule,
|
|
343
356
|
args: [{
|
|
344
357
|
imports: [],
|
|
@@ -348,27 +361,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
348
361
|
}] });
|
|
349
362
|
|
|
350
363
|
class ArtportalenNavComponent {
|
|
364
|
+
httpClient;
|
|
365
|
+
router;
|
|
366
|
+
trans;
|
|
367
|
+
envService;
|
|
368
|
+
subscription = new Subscription();
|
|
369
|
+
loginClicked = new EventEmitter();
|
|
370
|
+
logoutClicked = new EventEmitter();
|
|
371
|
+
dropMenuChange = new EventEmitter();
|
|
372
|
+
showPattern = false;
|
|
373
|
+
fullName;
|
|
374
|
+
translationFinished = false;
|
|
375
|
+
lastPosition = 0;
|
|
351
376
|
set userName(fullName) {
|
|
352
377
|
this.fullName = fullName;
|
|
353
378
|
}
|
|
354
379
|
;
|
|
380
|
+
navigation;
|
|
381
|
+
url;
|
|
382
|
+
showNavMenu = false;
|
|
383
|
+
showUserMenu = false;
|
|
384
|
+
showReport = true;
|
|
385
|
+
showObservations = true;
|
|
386
|
+
showSubs = false;
|
|
355
387
|
constructor(httpClient, router, trans, envService) {
|
|
356
388
|
this.httpClient = httpClient;
|
|
357
389
|
this.router = router;
|
|
358
390
|
this.trans = trans;
|
|
359
391
|
this.envService = envService;
|
|
360
|
-
this.subscription = new Subscription();
|
|
361
|
-
this.loginClicked = new EventEmitter();
|
|
362
|
-
this.logoutClicked = new EventEmitter();
|
|
363
|
-
this.dropMenuChange = new EventEmitter();
|
|
364
|
-
this.showPattern = false;
|
|
365
|
-
this.translationFinished = false;
|
|
366
|
-
this.lastPosition = 0;
|
|
367
|
-
this.showNavMenu = false;
|
|
368
|
-
this.showUserMenu = false;
|
|
369
|
-
this.showReport = true;
|
|
370
|
-
this.showObservations = true;
|
|
371
|
-
this.showSubs = false;
|
|
372
392
|
}
|
|
373
393
|
ngOnInit() {
|
|
374
394
|
this.url = window.location.href;
|
|
@@ -429,10 +449,10 @@ class ArtportalenNavComponent {
|
|
|
429
449
|
ngOnDestroy() {
|
|
430
450
|
this.subscription.unsubscribe();
|
|
431
451
|
}
|
|
432
|
-
|
|
433
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ArtportalenNavComponent, isStandalone: false, selector: "adb-artportalen-nav", inputs: { showPattern: "showPattern", userName: "userName" }, outputs: { loginClicked: "loginClicked", logoutClicked: "logoutClicked", dropMenuChange: "dropMenuChange" }, ngImport: i0, template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n @if (translationFinished) {\r\n <header class=\"container-lg px-0\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"px-1 d-flex flex-wrap align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-2\">\r\n <a class=\"d-flex text-white text-decoration-none d-flex gap-2\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <img class=\"d-none d-sm-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n <a [href]=\"navigation?.home\" class=\"text-white text-decoration-none fs-1 fw-bold\">{{'HEADER.TITLE'|translate}}</a>\r\n </nav>\r\n <div class=\"ms-auto d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"d-none d-md-block btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\" title=\"{{'HEADER.MENY'|translate}}\" attr.aria-label=\"{{'HEADER.MENY'|translate}}\" (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"fas fa-bars\"></i>\r\n <small class=\"ms-2 d-none d-md-inline-block\">{{'HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"d-flex justify-content-center d-md-none p-2 border-dark border-top\">\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\" (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n </header>\r\n }\r\n @if (navigation) {\r\n <div role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\" [class.show]=\"showNavMenu\" tabindex=\"-1\" aria-labelledby=\"offcanvasNav\">\r\n <div class=\"offcanvas-header\">\r\n <h1 class=\"offcanvas-title h-section mb-0\" id=\"offcanvasNav\"><a [href]=\"navigation.home\" class=\"text-white text-decoration-none\">{{'HEADER.TITLE'|translate}}</a></h1>\r\n <button type=\"button\" class=\"btn-close btn-close-white\" attr.aria-label=\"{{'CLOSE'|translate}}\" (click)=\"showMenuDropdown(false)\"></button>\r\n </div>\r\n <div class=\"offcanvas-body d-flex flex-column p-0\">\r\n <div class=\"px-3\">\r\n <div class=\"d-flex flex-wrap justify-content-between align-items-center mb-2 gap-1 px-2\">\r\n @if (fullName) {\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n }\r\n @if (!fullName) {\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n @if (navigation) {\r\n <a class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n }\r\n }\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showReport?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.report.url}}\">\r\n {{navigation.report.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showReport = !showReport\" attr.aria-controls=\"report-links\" attr.aria-expanded=\"{{showReport}}\">\r\n <span class=\"fas\" [ngClass]=\"showReport?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showReport) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"report-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.checklist.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.checklist.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.report.url}}\">\r\n {{'HEADER.REPORT'|translate}}\r\n </a>\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex \">\r\n <a href=\"{{navigation.wanted.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.wanted.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showObservations?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.observations.url}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showObservations = !showObservations\" attr.aria-controls=\"observations-links\" attr.aria-expanded=\"{{showObservations}}\">\r\n <span class=\"fas\" [ngClass]=\"showObservations?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showObservations) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"observations-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}\">\r\n {{'HEADER.TODAYS_OBSERVATIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-0\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fieldDiary.url}}\">\r\n {{'HEADER.FIELD_DIARY'|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showSubs?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <button class=\"btn btn-link p-0 text-white w-100 text-start\" (click)=\"showSubs = !showSubs\">\r\n {{navigation.subcriptions.transId|translate}}\r\n </button>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showSubs = !showSubs\" attr.aria-controls=\"subs-links\" attr.aria-expanded=\"{{showSubs}}\">\r\n <span class=\"fas\" [ngClass]=\"showSubs?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showSubs) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"subs-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.subcriptions.url}}\">\r\n {{'HEADER.MY_SUBSCRIPTIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.events.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.events.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fyndregler.url}}\">\r\n {{navigation.fyndregler.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artportalenUrl\">\r\n Artportalen.se\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artfaktaUrl\">\r\n {{'HEADER.ARTFAKTA'|translate}}\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <small class=\"d-block text-white pt-1\">\r\n {{'HEADER.DEVELOPED_BY'|translate}}\r\n <a href=\"https://www.artdatabanken.se/\" class=\"text-white\">\r\n {{'HEADER.ARTDATABANKEN'|translate}}\r\n <span class=\"fas fa-external-link\"></span>\r\n </a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\"> </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
452
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavComponent, deps: [{ token: i1$2.HttpClient }, { token: i1.Router }, { token: i1$1.TranslateService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
453
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ArtportalenNavComponent, isStandalone: false, selector: "adb-artportalen-nav", inputs: { showPattern: "showPattern", userName: "userName" }, outputs: { loginClicked: "loginClicked", logoutClicked: "logoutClicked", dropMenuChange: "dropMenuChange" }, ngImport: i0, template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n @if (translationFinished) {\r\n <header class=\"container-lg px-0\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"px-1 d-flex flex-wrap align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-2\">\r\n <a class=\"d-flex text-white text-decoration-none d-flex gap-2\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <img class=\"d-none d-sm-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n <a [href]=\"navigation?.home\" class=\"text-white text-decoration-none fs-1 fw-bold\">{{'HEADER.TITLE'|translate}}</a>\r\n </nav>\r\n <div class=\"ms-auto d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"d-none d-md-block btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\" title=\"{{'HEADER.MENY'|translate}}\" attr.aria-label=\"{{'HEADER.MENY'|translate}}\" (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"fas fa-bars\"></i>\r\n <small class=\"ms-2 d-none d-md-inline-block\">{{'HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"d-flex justify-content-center d-md-none p-2 border-dark border-top\">\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\" (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n </header>\r\n }\r\n @if (navigation) {\r\n <div role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\" [class.show]=\"showNavMenu\" tabindex=\"-1\" aria-labelledby=\"offcanvasNav\">\r\n <div class=\"offcanvas-header\">\r\n <h1 class=\"offcanvas-title h-section mb-0\" id=\"offcanvasNav\"><a [href]=\"navigation.home\" class=\"text-white text-decoration-none\">{{'HEADER.TITLE'|translate}}</a></h1>\r\n <button type=\"button\" class=\"btn-close btn-close-white\" attr.aria-label=\"{{'CLOSE'|translate}}\" (click)=\"showMenuDropdown(false)\"></button>\r\n </div>\r\n <div class=\"offcanvas-body d-flex flex-column p-0\">\r\n <div class=\"px-3\">\r\n <div class=\"d-flex flex-wrap justify-content-between align-items-center mb-2 gap-1 px-2\">\r\n @if (fullName) {\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n }\r\n @if (!fullName) {\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n @if (navigation) {\r\n <a class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n }\r\n }\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showReport?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.report.url}}\">\r\n {{navigation.report.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showReport = !showReport\" attr.aria-controls=\"report-links\" attr.aria-expanded=\"{{showReport}}\">\r\n <span class=\"fas\" [ngClass]=\"showReport?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showReport) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"report-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.checklist.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.checklist.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.report.url}}\">\r\n {{'HEADER.REPORT'|translate}}\r\n </a>\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex \">\r\n <a href=\"{{navigation.wanted.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.wanted.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showObservations?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.observations.url}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showObservations = !showObservations\" attr.aria-controls=\"observations-links\" attr.aria-expanded=\"{{showObservations}}\">\r\n <span class=\"fas\" [ngClass]=\"showObservations?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showObservations) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"observations-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}\">\r\n {{'HEADER.TODAYS_OBSERVATIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-0\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fieldDiary.url}}\">\r\n {{'HEADER.FIELD_DIARY'|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showSubs?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <button class=\"btn btn-link p-0 text-white w-100 text-start\" (click)=\"showSubs = !showSubs\">\r\n {{navigation.subcriptions.transId|translate}}\r\n </button>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showSubs = !showSubs\" attr.aria-controls=\"subs-links\" attr.aria-expanded=\"{{showSubs}}\">\r\n <span class=\"fas\" [ngClass]=\"showSubs?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showSubs) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"subs-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.subcriptions.url}}\">\r\n {{'HEADER.MY_SUBSCRIPTIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.events.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.events.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fyndregler.url}}\">\r\n {{navigation.fyndregler.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artportalenUrl\">\r\n Artportalen.se\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artfaktaUrl\">\r\n {{'HEADER.ARTFAKTA'|translate}}\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <small class=\"d-block text-white pt-1\">\r\n {{'HEADER.DEVELOPED_BY'|translate}}\r\n <a href=\"https://www.artdatabanken.se/\" class=\"text-white\">\r\n {{'HEADER.ARTDATABANKEN'|translate}}\r\n <span class=\"fas fa-external-link\"></span>\r\n </a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\"> </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
434
454
|
}
|
|
435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavComponent, decorators: [{
|
|
436
456
|
type: Component,
|
|
437
457
|
args: [{ selector: 'adb-artportalen-nav', standalone: false, template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n @if (translationFinished) {\r\n <header class=\"container-lg px-0\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"px-1 d-flex flex-wrap align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-2\">\r\n <a class=\"d-flex text-white text-decoration-none d-flex gap-2\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <img class=\"d-none d-sm-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n <a [href]=\"navigation?.home\" class=\"text-white text-decoration-none fs-1 fw-bold\">{{'HEADER.TITLE'|translate}}</a>\r\n </nav>\r\n <div class=\"ms-auto d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"d-none d-md-block btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\" title=\"{{'HEADER.MENY'|translate}}\" attr.aria-label=\"{{'HEADER.MENY'|translate}}\" (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"fas fa-bars\"></i>\r\n <small class=\"ms-2 d-none d-md-inline-block\">{{'HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"d-flex justify-content-center d-md-none p-2 border-dark border-top\">\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\" (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n </header>\r\n }\r\n @if (navigation) {\r\n <div role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\" [class.show]=\"showNavMenu\" tabindex=\"-1\" aria-labelledby=\"offcanvasNav\">\r\n <div class=\"offcanvas-header\">\r\n <h1 class=\"offcanvas-title h-section mb-0\" id=\"offcanvasNav\"><a [href]=\"navigation.home\" class=\"text-white text-decoration-none\">{{'HEADER.TITLE'|translate}}</a></h1>\r\n <button type=\"button\" class=\"btn-close btn-close-white\" attr.aria-label=\"{{'CLOSE'|translate}}\" (click)=\"showMenuDropdown(false)\"></button>\r\n </div>\r\n <div class=\"offcanvas-body d-flex flex-column p-0\">\r\n <div class=\"px-3\">\r\n <div class=\"d-flex flex-wrap justify-content-between align-items-center mb-2 gap-1 px-2\">\r\n @if (fullName) {\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n }\r\n @if (!fullName) {\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n @if (navigation) {\r\n <a class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n }\r\n }\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showReport?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.report.url}}\">\r\n {{navigation.report.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showReport = !showReport\" attr.aria-controls=\"report-links\" attr.aria-expanded=\"{{showReport}}\">\r\n <span class=\"fas\" [ngClass]=\"showReport?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showReport) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"report-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.checklist.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.checklist.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.report.url}}\">\r\n {{'HEADER.REPORT'|translate}}\r\n </a>\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex \">\r\n <a href=\"{{navigation.wanted.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.wanted.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showObservations?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.observations.url}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showObservations = !showObservations\" attr.aria-controls=\"observations-links\" attr.aria-expanded=\"{{showObservations}}\">\r\n <span class=\"fas\" [ngClass]=\"showObservations?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showObservations) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"observations-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}\">\r\n {{'HEADER.TODAYS_OBSERVATIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-0\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fieldDiary.url}}\">\r\n {{'HEADER.FIELD_DIARY'|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showSubs?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <button class=\"btn btn-link p-0 text-white w-100 text-start\" (click)=\"showSubs = !showSubs\">\r\n {{navigation.subcriptions.transId|translate}}\r\n </button>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showSubs = !showSubs\" attr.aria-controls=\"subs-links\" attr.aria-expanded=\"{{showSubs}}\">\r\n <span class=\"fas\" [ngClass]=\"showSubs?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showSubs) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"subs-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.subcriptions.url}}\">\r\n {{'HEADER.MY_SUBSCRIPTIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.events.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.events.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fyndregler.url}}\">\r\n {{navigation.fyndregler.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artportalenUrl\">\r\n Artportalen.se\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artfaktaUrl\">\r\n {{'HEADER.ARTFAKTA'|translate}}\r\n <i class=\"fas fa-external-link\"></i>\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <small class=\"d-block text-white pt-1\">\r\n {{'HEADER.DEVELOPED_BY'|translate}}\r\n <a href=\"https://www.artdatabanken.se/\" class=\"text-white\">\r\n {{'HEADER.ARTDATABANKEN'|translate}}\r\n <span class=\"fas fa-external-link\"></span>\r\n </a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\"> </div>\r\n </div>\r\n </div>\r\n }\r\n</div>" }]
|
|
438
458
|
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i1.Router }, { type: i1$1.TranslateService }, { type: EnvironmentService }], propDecorators: { loginClicked: [{
|
|
@@ -448,25 +468,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
448
468
|
}] } });
|
|
449
469
|
|
|
450
470
|
class AdbDropdownService {
|
|
451
|
-
|
|
452
|
-
|
|
471
|
+
currentMenu;
|
|
472
|
+
currentMenuId;
|
|
473
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
474
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownService });
|
|
453
475
|
}
|
|
454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownService, decorators: [{
|
|
455
477
|
type: Injectable
|
|
456
478
|
}] });
|
|
457
479
|
|
|
458
480
|
class AdbDropdownDirective {
|
|
481
|
+
elementRef;
|
|
482
|
+
adbDropdownService;
|
|
459
483
|
constructor(elementRef, adbDropdownService) {
|
|
460
484
|
this.elementRef = elementRef;
|
|
461
485
|
this.adbDropdownService = adbDropdownService;
|
|
462
|
-
this.adbDropdown = new EventEmitter();
|
|
463
|
-
this.insideClick = false;
|
|
464
|
-
this.dataToggle = "dropdown";
|
|
465
|
-
this.haspPopup = true;
|
|
466
|
-
this.expanded = false;
|
|
467
486
|
this.id = this.getId();
|
|
468
487
|
this.dropId = this.getId();
|
|
469
488
|
}
|
|
489
|
+
adbDropdown = new EventEmitter();
|
|
490
|
+
insideClick = false;
|
|
491
|
+
id;
|
|
492
|
+
dataToggle = "dropdown";
|
|
493
|
+
haspPopup = true;
|
|
494
|
+
expanded = false;
|
|
495
|
+
dropId;
|
|
470
496
|
onClick() {
|
|
471
497
|
this.adbDropdownService.currentMenuId = this.id;
|
|
472
498
|
const node = this.elementRef.nativeElement.parentNode;
|
|
@@ -516,10 +542,10 @@ class AdbDropdownDirective {
|
|
|
516
542
|
getId() {
|
|
517
543
|
return '' + Math.floor(Math.random() * Date.now());
|
|
518
544
|
}
|
|
519
|
-
|
|
520
|
-
|
|
545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownDirective, deps: [{ token: i0.ElementRef }, { token: AdbDropdownService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
546
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: AdbDropdownDirective, isStandalone: false, selector: "[adbDropdown]", inputs: { insideClick: "insideClick" }, outputs: { adbDropdown: "adbDropdown" }, host: { listeners: { "click": "onClick()", "document:click": "onCheckOutSideClick($event.target)" }, properties: { "id": "this.id", "attr.data-toggle": "this.dataToggle", "attr.aria-haspopup": "this.haspPopup", "attr.aria-expanded": "this.expanded", "attr.aria-controls": "this.dropId" } }, exportAs: ["adbDropdown"], ngImport: i0 });
|
|
521
547
|
}
|
|
522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownDirective, decorators: [{
|
|
523
549
|
type: Directive,
|
|
524
550
|
args: [{
|
|
525
551
|
selector: '[adbDropdown]',
|
|
@@ -554,17 +580,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
554
580
|
}] } });
|
|
555
581
|
|
|
556
582
|
class AdbDropdown2Directive {
|
|
583
|
+
elementRef;
|
|
584
|
+
adbDropdownService;
|
|
557
585
|
constructor(elementRef, adbDropdownService) {
|
|
558
586
|
this.elementRef = elementRef;
|
|
559
587
|
this.adbDropdownService = adbDropdownService;
|
|
560
|
-
this.adbDropdown = new EventEmitter();
|
|
561
|
-
this.insideClick = false;
|
|
562
|
-
this.dataToggle = "dropdown";
|
|
563
|
-
this.haspPopup = true;
|
|
564
|
-
this.expanded = false;
|
|
565
588
|
this.id = this.getId();
|
|
566
589
|
this.dropId = this.getId();
|
|
567
590
|
}
|
|
591
|
+
adbDropdown = new EventEmitter();
|
|
592
|
+
insideClick = false;
|
|
593
|
+
id;
|
|
594
|
+
dataToggle = "dropdown";
|
|
595
|
+
haspPopup = true;
|
|
596
|
+
expanded = false;
|
|
597
|
+
dropId;
|
|
568
598
|
onClick() {
|
|
569
599
|
this.adbDropdownService.currentMenuId = this.id;
|
|
570
600
|
const node = this.elementRef.nativeElement.parentNode;
|
|
@@ -630,10 +660,10 @@ class AdbDropdown2Directive {
|
|
|
630
660
|
getId() {
|
|
631
661
|
return '' + Math.floor(Math.random() * Date.now());
|
|
632
662
|
}
|
|
633
|
-
|
|
634
|
-
|
|
663
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdown2Directive, deps: [{ token: i0.ElementRef }, { token: AdbDropdownService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
664
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: AdbDropdown2Directive, isStandalone: false, selector: "[adbDropdown2]", inputs: { insideClick: "insideClick" }, outputs: { adbDropdown: "adbDropdown" }, host: { listeners: { "click": "onClick()", "document:click": "onCheckOutSideClick($event.target)", "window:scroll": "onWindowScroll()" }, properties: { "id": "this.id", "attr.data-toggle": "this.dataToggle", "attr.aria-haspopup": "this.haspPopup", "attr.aria-expanded": "this.expanded", "attr.aria-controls": "this.dropId" } }, exportAs: ["adbDropdown"], ngImport: i0 });
|
|
635
665
|
}
|
|
636
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdown2Directive, decorators: [{
|
|
637
667
|
type: Directive,
|
|
638
668
|
args: [{
|
|
639
669
|
selector: '[adbDropdown2]',
|
|
@@ -671,11 +701,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
671
701
|
}] } });
|
|
672
702
|
|
|
673
703
|
class AdbDropdownModule {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
704
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
705
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownModule, declarations: [AdbDropdownDirective, AdbDropdown2Directive], imports: [CommonModule, i1$1.TranslateModule, AdbDirectivesModule], exports: [AdbDropdownDirective, AdbDropdown2Directive] });
|
|
706
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownModule, providers: [AdbDropdownService], imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule] });
|
|
677
707
|
}
|
|
678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
708
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDropdownModule, decorators: [{
|
|
679
709
|
type: NgModule,
|
|
680
710
|
args: [{
|
|
681
711
|
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
@@ -686,23 +716,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
686
716
|
}] });
|
|
687
717
|
|
|
688
718
|
class InfiniteScrollComponent {
|
|
719
|
+
_element;
|
|
720
|
+
onVisible = new EventEmitter();
|
|
721
|
+
onHidden = new EventEmitter();
|
|
722
|
+
height = '1px';
|
|
723
|
+
_intersectionObserver;
|
|
689
724
|
constructor(_element) {
|
|
690
725
|
this._element = _element;
|
|
691
|
-
this.onVisible = new EventEmitter();
|
|
692
|
-
this.onHidden = new EventEmitter();
|
|
693
|
-
this.height = '1px';
|
|
694
|
-
this.checkForIntersection = (entries) => {
|
|
695
|
-
entries.forEach((entry) => {
|
|
696
|
-
const isIntersecting = entry.isIntersecting &&
|
|
697
|
-
entry.target === this._element.nativeElement;
|
|
698
|
-
if (isIntersecting) {
|
|
699
|
-
this.onVisible.emit();
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
this.onHidden.emit();
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
};
|
|
706
726
|
}
|
|
707
727
|
ngAfterViewInit() {
|
|
708
728
|
this._intersectionObserver = new IntersectionObserver(entries => {
|
|
@@ -715,10 +735,22 @@ class InfiniteScrollComponent {
|
|
|
715
735
|
this._intersectionObserver.disconnect();
|
|
716
736
|
}
|
|
717
737
|
}
|
|
718
|
-
|
|
719
|
-
|
|
738
|
+
checkForIntersection = (entries) => {
|
|
739
|
+
entries.forEach((entry) => {
|
|
740
|
+
const isIntersecting = entry.isIntersecting &&
|
|
741
|
+
entry.target === this._element.nativeElement;
|
|
742
|
+
if (isIntersecting) {
|
|
743
|
+
this.onVisible.emit();
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
this.onHidden.emit();
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
};
|
|
750
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: InfiniteScrollComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
751
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: InfiniteScrollComponent, isStandalone: false, selector: "[onVisible]", outputs: { onVisible: "onVisible", onHidden: "onHidden" }, host: { properties: { "style.height": "this.height" } }, ngImport: i0 });
|
|
720
752
|
}
|
|
721
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: InfiniteScrollComponent, decorators: [{
|
|
722
754
|
type: Directive,
|
|
723
755
|
args: [{
|
|
724
756
|
selector: "[onVisible]",
|
|
@@ -734,13 +766,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
734
766
|
}] } });
|
|
735
767
|
|
|
736
768
|
class PagerBaseDirective {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
static { this.VISIBLE_PAGES = 5; }
|
|
743
|
-
static { this.SKIP_RESOURCE = 'offset'; }
|
|
769
|
+
static DEFAULT_LIMIT = 10;
|
|
770
|
+
static VISIBLE_PAGES = 5;
|
|
771
|
+
static SKIP_RESOURCE = 'offset';
|
|
772
|
+
limit = PagerBaseDirective.DEFAULT_LIMIT;
|
|
773
|
+
totalCount;
|
|
744
774
|
set setTotalCount(count) {
|
|
745
775
|
this.totalCount = count;
|
|
746
776
|
this.ngOnInitReady();
|
|
@@ -749,6 +779,9 @@ class PagerBaseDirective {
|
|
|
749
779
|
this.limit = value ?? PagerBaseDirective.DEFAULT_LIMIT;
|
|
750
780
|
this.ngOnInitReady();
|
|
751
781
|
}
|
|
782
|
+
pages;
|
|
783
|
+
amountOfPages;
|
|
784
|
+
currentPage = 1;
|
|
752
785
|
calculatePages() {
|
|
753
786
|
if (this.totalCount >= 0 && this.limit > 0) {
|
|
754
787
|
this.amountOfPages = Math.ceil(this.totalCount / this.limit);
|
|
@@ -774,10 +807,10 @@ class PagerBaseDirective {
|
|
|
774
807
|
this.amountOfPages = 0;
|
|
775
808
|
}
|
|
776
809
|
}
|
|
777
|
-
|
|
778
|
-
|
|
810
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
811
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: PagerBaseDirective, isStandalone: true, inputs: { setTotalCount: ["totalCount", "setTotalCount"], setLimit: ["limit", "setLimit"] }, ngImport: i0 });
|
|
779
812
|
}
|
|
780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerBaseDirective, decorators: [{
|
|
781
814
|
type: Directive
|
|
782
815
|
}], propDecorators: { setTotalCount: [{
|
|
783
816
|
type: Input,
|
|
@@ -788,12 +821,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
788
821
|
}] } });
|
|
789
822
|
|
|
790
823
|
class PagerComponent extends PagerBaseDirective {
|
|
824
|
+
activatedRoute;
|
|
825
|
+
subscription = new Subscription();
|
|
826
|
+
offsetName = "offset";
|
|
827
|
+
infiniteLimit = false;
|
|
828
|
+
params;
|
|
791
829
|
constructor(activatedRoute) {
|
|
792
830
|
super();
|
|
793
831
|
this.activatedRoute = activatedRoute;
|
|
794
|
-
this.subscription = new Subscription();
|
|
795
|
-
this.offsetName = "offset";
|
|
796
|
-
this.infiniteLimit = false;
|
|
797
832
|
}
|
|
798
833
|
ngOnInitReady() {
|
|
799
834
|
this.subscription.add(this.activatedRoute.queryParams.subscribe(params => {
|
|
@@ -822,10 +857,10 @@ class PagerComponent extends PagerBaseDirective {
|
|
|
822
857
|
ngOnDestroy() {
|
|
823
858
|
this.subscription.unsubscribe();
|
|
824
859
|
}
|
|
825
|
-
|
|
826
|
-
|
|
860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: PagerComponent, isStandalone: false, selector: "adb-pager-nav", inputs: { offsetName: "offsetName", infiniteLimit: "infiniteLimit" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) {\r\n <nav class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination flex-wrap mb-0\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.first\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\">\r\n <i class=\"fas fa-chevron-double-left\"></i>\r\n </a>\r\n </li>\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.prev\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\">\r\n <i class=\"fas fa-chevron-left\"></i>\r\n </a>\r\n </li>\r\n @for (page of params.pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage===page.name\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\"\r\n queryParamsHandling=\"merge\">{{page.name}}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.next\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\" [attr.aria-disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-right\"></i>\r\n </a>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\"\r\n [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </a>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\"\r\n [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n}", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
827
862
|
}
|
|
828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerComponent, decorators: [{
|
|
829
864
|
type: Component,
|
|
830
865
|
args: [{ selector: 'adb-pager-nav', standalone: false, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) {\r\n <nav class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination flex-wrap mb-0\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.first\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\">\r\n <i class=\"fas fa-chevron-double-left\"></i>\r\n </a>\r\n </li>\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.prev\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\">\r\n <i class=\"fas fa-chevron-left\"></i>\r\n </a>\r\n </li>\r\n @for (page of params.pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage===page.name\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\"\r\n queryParamsHandling=\"merge\">{{page.name}}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.next\" queryParamsHandling=\"merge\"\r\n [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\" [attr.aria-disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-right\"></i>\r\n </a>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\"\r\n [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </a>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\"\r\n [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-50':currentPage>=amountOfPages}\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n}" }]
|
|
831
866
|
}], ctorParameters: () => [{ type: i1.ActivatedRoute }], propDecorators: { offsetName: [{
|
|
@@ -835,10 +870,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
835
870
|
}] } });
|
|
836
871
|
|
|
837
872
|
class PagerInlineComponent extends PagerBaseDirective {
|
|
873
|
+
pageChanged = new EventEmitter();
|
|
874
|
+
infiniteLimit = false;
|
|
838
875
|
constructor() {
|
|
839
876
|
super();
|
|
840
|
-
this.pageChanged = new EventEmitter();
|
|
841
|
-
this.infiniteLimit = false;
|
|
842
877
|
}
|
|
843
878
|
ngOnInitReady() {
|
|
844
879
|
this.calculatePages();
|
|
@@ -867,10 +902,10 @@ class PagerInlineComponent extends PagerBaseDirective {
|
|
|
867
902
|
this.pageChanged.emit(this.currentPage - 1);
|
|
868
903
|
this.calculatePages();
|
|
869
904
|
}
|
|
870
|
-
|
|
871
|
-
|
|
905
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerInlineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
906
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: PagerInlineComponent, isStandalone: false, selector: "adb-pager", inputs: { infiniteLimit: "infiniteLimit" }, outputs: { pageChanged: "pageChanged" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) {\r\n <nav class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination flex-wrap\">\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onFirstClick()\" [ngClass]=\"currentPage==1?'opacity-50 pe-none':''\" [disabled]=\"currentPage==1\">\r\n <i class=\"fas fa-chevron-double-left\"></i>\r\n </button>\r\n </li>\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onPrevClick()\" [ngClass]=\"currentPage==1?'opacity-50 pe-none':''\" [disabled]=\"currentPage==1\">\r\n <i class=\"fas fa-chevron-left\"></i>\r\n </button>\r\n </li>\r\n @for (page of pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage==page\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onNextClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-right\"></i>\r\n </button>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </button>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n}\r\n", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
872
907
|
}
|
|
873
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
908
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: PagerInlineComponent, decorators: [{
|
|
874
909
|
type: Component,
|
|
875
910
|
args: [{ selector: 'adb-pager', standalone: false, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) {\r\n <nav class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination flex-wrap\">\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onFirstClick()\" [ngClass]=\"currentPage==1?'opacity-50 pe-none':''\" [disabled]=\"currentPage==1\">\r\n <i class=\"fas fa-chevron-double-left\"></i>\r\n </button>\r\n </li>\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onPrevClick()\" [ngClass]=\"currentPage==1?'opacity-50 pe-none':''\" [disabled]=\"currentPage==1\">\r\n <i class=\"fas fa-chevron-left\"></i>\r\n </button>\r\n </li>\r\n @for (page of pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage==page\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onNextClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-right\"></i>\r\n </button>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </button>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-50 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\">\r\n <i class=\"fas fa-chevron-double-right\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n}\r\n" }]
|
|
876
911
|
}], ctorParameters: () => [], propDecorators: { pageChanged: [{
|
|
@@ -880,13 +915,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
880
915
|
}] } });
|
|
881
916
|
|
|
882
917
|
class AdbPagersModule {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
RouterModule], exports: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent] });
|
|
886
|
-
|
|
887
|
-
RouterModule] });
|
|
918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPagersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
919
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbPagersModule, declarations: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent], imports: [CommonModule,
|
|
920
|
+
RouterModule], exports: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent] });
|
|
921
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPagersModule, imports: [CommonModule,
|
|
922
|
+
RouterModule] });
|
|
888
923
|
}
|
|
889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPagersModule, decorators: [{
|
|
890
925
|
type: NgModule,
|
|
891
926
|
args: [{
|
|
892
927
|
imports: [
|
|
@@ -899,12 +934,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
899
934
|
}] });
|
|
900
935
|
|
|
901
936
|
class ArtportalenFooterComponent {
|
|
937
|
+
httpClient;
|
|
938
|
+
envService;
|
|
939
|
+
trans;
|
|
940
|
+
subscription = new Subscription();
|
|
941
|
+
translationFinished = false;
|
|
942
|
+
url;
|
|
943
|
+
navigation;
|
|
944
|
+
baseUrl;
|
|
902
945
|
constructor(httpClient, envService, trans) {
|
|
903
946
|
this.httpClient = httpClient;
|
|
904
947
|
this.envService = envService;
|
|
905
948
|
this.trans = trans;
|
|
906
|
-
this.subscription = new Subscription();
|
|
907
|
-
this.translationFinished = false;
|
|
908
949
|
}
|
|
909
950
|
ngOnInit() {
|
|
910
951
|
this.url = window.location.href;
|
|
@@ -929,10 +970,10 @@ class ArtportalenFooterComponent {
|
|
|
929
970
|
ngOnDestroy() {
|
|
930
971
|
this.subscription.unsubscribe();
|
|
931
972
|
}
|
|
932
|
-
|
|
933
|
-
|
|
973
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenFooterComponent, deps: [{ token: i1$2.HttpClient }, { token: EnvironmentService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
974
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ArtportalenFooterComponent, isStandalone: false, selector: "adb-artportalen-footer", ngImport: i0, template: "@if (translationFinished) {\r\n <footer class=\"bg-primary-dark py-2 mt-auto container-fluid\">\r\n <div class=\"d-flex justify-content-center\">\r\n <div class=\"container py-3 px-5 justify-content-center text-white\">\r\n <div class=\"row mb-4\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4 mb-3\">\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/artportalen/om\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/artportalen/artportalen-tillganglighetsredogorelse\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a href=\"https://www.slu.se/artdatabanken/om-oss/kontakt/artportalen-support\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.SUPPORT'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/villkor-kontohavare\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.TERMS_OF_USE'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.slu.se/artdatabanken/om-oss/behandling-av-personuppgifter\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.PERSONAL_DATA'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n <div class=\"col-md-4\">\r\n <div class=\"mb-2\" style=\"font-variant: small-caps;\"><sub><strong>{{'FOOTER.PARTNERS'|translate}}</strong></sub></div>\r\n <a href=\"https://birdlife.se\" class=\"d-block text-white mb-2\"><span class=\"me-1\">BirdLife Sverige</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://svenskbotanik.se\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Svenska Botaniska F\u00F6reningen</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.sef.nu\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Sveriges Entomologiska F\u00F6rening</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.svampar.se\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Sveriges Mykologiska F\u00F6rening</span><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n <div class=\"col-md-2\"></div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4\">\r\n <div class=\"mb-3 text-white\">\r\n <div>{{'FOOTER.INFO'|translate}}</div>\r\n <div>{{'FOOTER.INFO2'|translate}}</div>\r\n <div>{{'FOOTER.INFO3'|translate}}\r\n <a href=\"https://www.naturvardsverket.se\" class=\"text-white mb-2\"><u class=\"me-1\">Naturv\u00E5rdsverket.</u><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n </div>\r\n <div class=\"mb-3\">{{'FOOTER.INFO4'|translate}}.</div>\r\n </div>\r\n <div class=\"col-md-4\">\r\n <a class=\"text-white text-decoration-none d-flex gap-2 mb-3\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img class=\"d-block d-md-none\" style=\"height: 2.6rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <img class=\"d-none d-md-block\" style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <div class=\"border-end d-block d-sm-none\"></div>\r\n <img class=\"d-none d-md-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n <img class=\"d-block d-md-none align-self-center pe-5\" style=\"height: 0.8rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n </div>\r\n <div class=\"col-md-2\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </footer>\r\n}", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
934
975
|
}
|
|
935
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenFooterComponent, decorators: [{
|
|
936
977
|
type: Component,
|
|
937
978
|
args: [{ selector: 'adb-artportalen-footer', standalone: false, template: "@if (translationFinished) {\r\n <footer class=\"bg-primary-dark py-2 mt-auto container-fluid\">\r\n <div class=\"d-flex justify-content-center\">\r\n <div class=\"container py-3 px-5 justify-content-center text-white\">\r\n <div class=\"row mb-4\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4 mb-3\">\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/artportalen/om\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/artportalen/artportalen-tillganglighetsredogorelse\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a href=\"https://www.slu.se/artdatabanken/om-oss/kontakt/artportalen-support\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.SUPPORT'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.slu.se/artdatabanken/rapportering-och-fynd/villkor-kontohavare\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.TERMS_OF_USE'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.slu.se/artdatabanken/om-oss/behandling-av-personuppgifter\" class=\"d-block text-white mb-2\"><span class=\"me-1\">{{'FOOTER.PERSONAL_DATA'|translate}}</span><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n <div class=\"col-md-4\">\r\n <div class=\"mb-2\" style=\"font-variant: small-caps;\"><sub><strong>{{'FOOTER.PARTNERS'|translate}}</strong></sub></div>\r\n <a href=\"https://birdlife.se\" class=\"d-block text-white mb-2\"><span class=\"me-1\">BirdLife Sverige</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://svenskbotanik.se\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Svenska Botaniska F\u00F6reningen</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.sef.nu\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Sveriges Entomologiska F\u00F6rening</span><span class=\"fas fa-external-link\"></span></a>\r\n <a href=\"https://www.svampar.se\" class=\"d-block text-nowrap text-white mb-2\"><span class=\"me-1\">Sveriges Mykologiska F\u00F6rening</span><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n <div class=\"col-md-2\"></div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4\">\r\n <div class=\"mb-3 text-white\">\r\n <div>{{'FOOTER.INFO'|translate}}</div>\r\n <div>{{'FOOTER.INFO2'|translate}}</div>\r\n <div>{{'FOOTER.INFO3'|translate}}\r\n <a href=\"https://www.naturvardsverket.se\" class=\"text-white mb-2\"><u class=\"me-1\">Naturv\u00E5rdsverket.</u><span class=\"fas fa-external-link\"></span></a>\r\n </div>\r\n </div>\r\n <div class=\"mb-3\">{{'FOOTER.INFO4'|translate}}.</div>\r\n </div>\r\n <div class=\"col-md-4\">\r\n <a class=\"text-white text-decoration-none d-flex gap-2 mb-3\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img class=\"d-block d-md-none\" style=\"height: 2.6rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <img class=\"d-none d-md-block\" style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <div class=\"border-end d-block d-sm-none\"></div>\r\n <img class=\"d-none d-md-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n <img class=\"d-block d-md-none align-self-center pe-5\" style=\"height: 0.8rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n </div>\r\n <div class=\"col-md-2\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </footer>\r\n}" }]
|
|
938
979
|
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: EnvironmentService }, { type: i1$1.TranslateService }] });
|
|
@@ -950,23 +991,23 @@ class ArtportalenNavModule {
|
|
|
950
991
|
]
|
|
951
992
|
};
|
|
952
993
|
}
|
|
953
|
-
|
|
954
|
-
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
995
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavModule, declarations: [ArtportalenNavComponent,
|
|
955
996
|
ArtportalenFooterComponent], imports: [CommonModule,
|
|
956
997
|
RouterModule,
|
|
957
998
|
TranslateModule,
|
|
958
999
|
AdbDirectivesModule,
|
|
959
1000
|
AdbDropdownModule,
|
|
960
1001
|
AdbPagersModule], exports: [ArtportalenNavComponent,
|
|
961
|
-
ArtportalenFooterComponent] });
|
|
962
|
-
|
|
1002
|
+
ArtportalenFooterComponent] });
|
|
1003
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavModule, providers: [EnvironmentService, provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule,
|
|
963
1004
|
RouterModule,
|
|
964
1005
|
TranslateModule,
|
|
965
1006
|
AdbDirectivesModule,
|
|
966
1007
|
AdbDropdownModule,
|
|
967
|
-
AdbPagersModule] });
|
|
1008
|
+
AdbPagersModule] });
|
|
968
1009
|
}
|
|
969
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ArtportalenNavModule, decorators: [{
|
|
970
1011
|
type: NgModule,
|
|
971
1012
|
args: [{ declarations: [
|
|
972
1013
|
ArtportalenNavComponent,
|
|
@@ -985,16 +1026,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
985
1026
|
}] });
|
|
986
1027
|
|
|
987
1028
|
class LocaleDatePipe {
|
|
1029
|
+
translate;
|
|
988
1030
|
constructor(translate) {
|
|
989
1031
|
this.translate = translate;
|
|
990
1032
|
}
|
|
991
1033
|
transform(value, format) {
|
|
992
1034
|
return new DatePipe(this.translate.currentLang).transform(value, format, null, this.translate.currentLang);
|
|
993
1035
|
}
|
|
994
|
-
|
|
995
|
-
|
|
1036
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LocaleDatePipe, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1037
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: LocaleDatePipe, isStandalone: false, name: "adbLocaleDate", pure: false });
|
|
996
1038
|
}
|
|
997
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1039
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LocaleDatePipe, decorators: [{
|
|
998
1040
|
type: Pipe,
|
|
999
1041
|
args: [{
|
|
1000
1042
|
name: 'adbLocaleDate',
|
|
@@ -1013,10 +1055,10 @@ class EmptyValuePipe {
|
|
|
1013
1055
|
}
|
|
1014
1056
|
return value;
|
|
1015
1057
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1058
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: EmptyValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1059
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: EmptyValuePipe, isStandalone: false, name: "adbEmptyValue" });
|
|
1018
1060
|
}
|
|
1019
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1061
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: EmptyValuePipe, decorators: [{
|
|
1020
1062
|
type: Pipe,
|
|
1021
1063
|
args: [{
|
|
1022
1064
|
name: 'adbEmptyValue',
|
|
@@ -1025,9 +1067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1025
1067
|
}] });
|
|
1026
1068
|
|
|
1027
1069
|
class HighlightPipe {
|
|
1028
|
-
|
|
1029
|
-
this.forbiddenSymbols = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
1030
|
-
}
|
|
1070
|
+
forbiddenSymbols = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
1031
1071
|
transform(value, searchs) {
|
|
1032
1072
|
if (!value) {
|
|
1033
1073
|
return value;
|
|
@@ -1058,10 +1098,10 @@ class HighlightPipe {
|
|
|
1058
1098
|
normalizeText(text) {
|
|
1059
1099
|
return text?.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLocaleLowerCase();
|
|
1060
1100
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1101
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1102
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: HighlightPipe, isStandalone: false, name: "adbHighlight" });
|
|
1063
1103
|
}
|
|
1064
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HighlightPipe, decorators: [{
|
|
1065
1105
|
type: Pipe,
|
|
1066
1106
|
args: [{
|
|
1067
1107
|
name: 'adbHighlight',
|
|
@@ -1077,10 +1117,10 @@ class NumberSpacingPipe {
|
|
|
1077
1117
|
}
|
|
1078
1118
|
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
1079
1119
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NumberSpacingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1121
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: NumberSpacingPipe, isStandalone: false, name: "adbSpacing", pure: false });
|
|
1082
1122
|
}
|
|
1083
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NumberSpacingPipe, decorators: [{
|
|
1084
1124
|
type: Pipe,
|
|
1085
1125
|
args: [{
|
|
1086
1126
|
name: 'adbSpacing',
|
|
@@ -1090,9 +1130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1090
1130
|
}] });
|
|
1091
1131
|
|
|
1092
1132
|
class HighlightHtmlPipe {
|
|
1093
|
-
|
|
1094
|
-
this.forbiddenSymbols = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
1095
|
-
}
|
|
1133
|
+
forbiddenSymbols = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
1096
1134
|
transform(value, searchs) {
|
|
1097
1135
|
if (!value) {
|
|
1098
1136
|
return value;
|
|
@@ -1123,10 +1161,10 @@ class HighlightHtmlPipe {
|
|
|
1123
1161
|
escapeRegExp(text) {
|
|
1124
1162
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
1125
1163
|
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1164
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HighlightHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1165
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: HighlightHtmlPipe, isStandalone: false, name: "adbHighlightHtml" });
|
|
1128
1166
|
}
|
|
1129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: HighlightHtmlPipe, decorators: [{
|
|
1130
1168
|
type: Pipe,
|
|
1131
1169
|
args: [{
|
|
1132
1170
|
name: 'adbHighlightHtml',
|
|
@@ -1135,11 +1173,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1135
1173
|
}] });
|
|
1136
1174
|
|
|
1137
1175
|
class AdbPipesModule {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1176
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1177
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbPipesModule, declarations: [HighlightPipe, HighlightHtmlPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe], exports: [HighlightPipe, HighlightHtmlPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe] });
|
|
1178
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPipesModule });
|
|
1141
1179
|
}
|
|
1142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPipesModule, decorators: [{
|
|
1143
1181
|
type: NgModule,
|
|
1144
1182
|
args: [{
|
|
1145
1183
|
imports: [],
|
|
@@ -1149,19 +1187,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1149
1187
|
}] });
|
|
1150
1188
|
|
|
1151
1189
|
class AdbDatePickerComponent {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1190
|
+
elementRef;
|
|
1191
|
+
translate;
|
|
1192
|
+
subscriptions = new Subscription();
|
|
1193
|
+
static MONTHS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1194
|
+
static WEEK_DAYS = ['1', '2', '3', '4', '5', '6', '7'];
|
|
1195
|
+
static YEAR_INTERVALL = 8;
|
|
1196
|
+
currentdDate = new Date();
|
|
1197
|
+
currentMonth;
|
|
1198
|
+
selectedDate = new Date();
|
|
1199
|
+
years;
|
|
1200
|
+
months;
|
|
1201
|
+
weekDays = AdbDatePickerComponent.WEEK_DAYS;
|
|
1202
|
+
weeks;
|
|
1203
|
+
range;
|
|
1204
|
+
noYearMode = false;
|
|
1155
1205
|
;
|
|
1206
|
+
initialDate;
|
|
1207
|
+
settings;
|
|
1208
|
+
toLeft;
|
|
1209
|
+
id;
|
|
1210
|
+
selectDate = new EventEmitter();
|
|
1156
1211
|
constructor(elementRef, translate) {
|
|
1157
1212
|
this.elementRef = elementRef;
|
|
1158
1213
|
this.translate = translate;
|
|
1159
|
-
this.subscriptions = new Subscription();
|
|
1160
|
-
this.currentdDate = new Date();
|
|
1161
|
-
this.selectedDate = new Date();
|
|
1162
|
-
this.weekDays = AdbDatePickerComponent.WEEK_DAYS;
|
|
1163
|
-
this.noYearMode = false;
|
|
1164
|
-
this.selectDate = new EventEmitter();
|
|
1165
1214
|
}
|
|
1166
1215
|
ngOnInit() {
|
|
1167
1216
|
if (this.settings) {
|
|
@@ -1297,12 +1346,12 @@ class AdbDatePickerComponent {
|
|
|
1297
1346
|
return null;
|
|
1298
1347
|
}
|
|
1299
1348
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1349
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1350
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: AdbDatePickerComponent, isStandalone: false, selector: "adb-date-picker", inputs: { initialDate: "initialDate", settings: "settings", toLeft: "toLeft", id: "id" }, outputs: { selectDate: "selectDate" }, host: { properties: { "id": "this.id" } }, ngImport: i0, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-white shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"fa fa-chevron-left\"></span></button>\r\n <ng-container *ngIf=\"!years&&!months\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n </ng-container>\r\n <button tabIndex=\"-1\" *ngIf=\"years\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n <button tabIndex=\"-1\" *ngIf=\"months\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"fa fa-chevron-right\"></span></button>\r\n </header>\r\n <div class=\"p-0 border calendar\">\r\n <ul class=\"list-unstyled row\" *ngIf=\"years\">\r\n <li class=\"col-3 text-center px-2 py-3\" *ngFor=\"let year of years\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectYear(year.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n <ul class=\"list-unstyled row\" *ngIf=\"months\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" \r\n [class.border]=\"day.isToday\" [class.bg-primary]=\"day.isSelected\" [class.text-white]=\"day.isSelected\" [ngClass]=\"{'pe-none text-muted opacity-50':!day.inMonth||!day.isInRange}\">\r\n <small>{{day.value|date:'d'}}</small>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </nav>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: LocaleDatePipe, name: "adbLocaleDate" }] });
|
|
1302
1351
|
}
|
|
1303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerComponent, decorators: [{
|
|
1304
1353
|
type: Component,
|
|
1305
|
-
args: [{ selector: 'adb-date-picker', standalone: false, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-white shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"fa fa-chevron-left\"></span></button>\r\n <ng-container *ngIf=\"!years&&!months\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n </ng-container>\r\n <button tabIndex=\"-1\" *ngIf=\"years\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n <button tabIndex=\"-1\" *ngIf=\"months\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"fa fa-chevron-right\"></span></button>\r\n </header>\r\n <div class=\"p-0 border calendar\">\r\n <ul class=\"list-unstyled row\" *ngIf=\"years\">\r\n <li class=\"col-3 text-center px-2 py-3\" *ngFor=\"let year of years\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectYear(year.value);$event.stopPropagation()\" [
|
|
1354
|
+
args: [{ selector: 'adb-date-picker', standalone: false, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-white shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"fa fa-chevron-left\"></span></button>\r\n <ng-container *ngIf=\"!years&&!months\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n </ng-container>\r\n <button tabIndex=\"-1\" *ngIf=\"years\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n <button tabIndex=\"-1\" *ngIf=\"months\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n <button tabIndex=\"-1\" class=\"btn btn-primary text-white rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"fa fa-chevron-right\"></span></button>\r\n </header>\r\n <div class=\"p-0 border calendar\">\r\n <ul class=\"list-unstyled row\" *ngIf=\"years\">\r\n <li class=\"col-3 text-center px-2 py-3\" *ngFor=\"let year of years\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectYear(year.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n <ul class=\"list-unstyled row\" *ngIf=\"months\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" \r\n [class.border]=\"day.isToday\" [class.bg-primary]=\"day.isSelected\" [class.text-white]=\"day.isSelected\" [ngClass]=\"{'pe-none text-muted opacity-50':!day.inMonth||!day.isInRange}\">\r\n <small>{{day.value|date:'d'}}</small>\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </nav>\r\n</div>\r\n" }]
|
|
1306
1355
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.TranslateService }], propDecorators: { initialDate: [{
|
|
1307
1356
|
type: Input
|
|
1308
1357
|
}], settings: [{
|
|
@@ -1319,29 +1368,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1319
1368
|
}] } });
|
|
1320
1369
|
|
|
1321
1370
|
class AdbDatePickerService {
|
|
1322
|
-
|
|
1323
|
-
|
|
1371
|
+
viewRef;
|
|
1372
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1373
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerService });
|
|
1324
1374
|
}
|
|
1325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerService, decorators: [{
|
|
1326
1376
|
type: Injectable
|
|
1327
1377
|
}] });
|
|
1328
1378
|
|
|
1329
1379
|
class AdbDatePickerDirective {
|
|
1380
|
+
viewContainerRef;
|
|
1381
|
+
renderer;
|
|
1382
|
+
elementRef;
|
|
1383
|
+
adbDatePickerService;
|
|
1384
|
+
translate;
|
|
1385
|
+
subscriptions = new Subscription();
|
|
1386
|
+
autocomplete = 'off';
|
|
1387
|
+
adbBlur = new EventEmitter();
|
|
1388
|
+
format = 'yyyy-MM-dd';
|
|
1389
|
+
toLeft;
|
|
1390
|
+
settings = null;
|
|
1391
|
+
id;
|
|
1392
|
+
currentDate;
|
|
1393
|
+
isValid;
|
|
1330
1394
|
constructor(viewContainerRef, renderer, elementRef, adbDatePickerService, translate) {
|
|
1331
1395
|
this.viewContainerRef = viewContainerRef;
|
|
1332
1396
|
this.renderer = renderer;
|
|
1333
1397
|
this.elementRef = elementRef;
|
|
1334
1398
|
this.adbDatePickerService = adbDatePickerService;
|
|
1335
1399
|
this.translate = translate;
|
|
1336
|
-
this.subscriptions = new Subscription();
|
|
1337
|
-
this.autocomplete = 'off';
|
|
1338
|
-
this.adbBlur = new EventEmitter();
|
|
1339
|
-
this.format = 'yyyy-MM-dd';
|
|
1340
|
-
this.settings = null;
|
|
1341
|
-
//ControlValueAccessor
|
|
1342
|
-
this.onChange = () => { };
|
|
1343
|
-
this.onTouched = () => { };
|
|
1344
|
-
this.onValidationChange = () => { };
|
|
1345
1400
|
}
|
|
1346
1401
|
ngOnInit() {
|
|
1347
1402
|
this.elementRef.nativeElement.setAttribute("placeholder", this.format);
|
|
@@ -1443,6 +1498,10 @@ class AdbDatePickerDirective {
|
|
|
1443
1498
|
this.isValid = true;
|
|
1444
1499
|
return null;
|
|
1445
1500
|
}
|
|
1501
|
+
//ControlValueAccessor
|
|
1502
|
+
onChange = () => { };
|
|
1503
|
+
onTouched = () => { };
|
|
1504
|
+
onValidationChange = () => { };
|
|
1446
1505
|
registerOnValidatorChange(fn) {
|
|
1447
1506
|
this.onValidationChange = fn;
|
|
1448
1507
|
}
|
|
@@ -1481,23 +1540,23 @@ class AdbDatePickerDirective {
|
|
|
1481
1540
|
getId() {
|
|
1482
1541
|
return '' + Math.floor(Math.random() * Date.now());
|
|
1483
1542
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((
|
|
1543
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: AdbDatePickerService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1544
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.0", type: AdbDatePickerDirective, isStandalone: false, selector: "input[adbDatepicker]", inputs: { format: "format", toLeft: "toLeft", settings: "settings" }, outputs: { adbBlur: "adbBlur" }, host: { listeners: { "click": "onClick()", "keyup": "onKeyup($event)", "keydown.shift.tab": "onTabDown()", "keydown.tab": "onTabDown()", "keydown.esc": "onEscdOWN()", "document:click": "onCheckOutSideClick($event.target)" }, properties: { "autocomplete": "this.autocomplete" } }, providers: [{
|
|
1545
|
+
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1487
1546
|
multi: true
|
|
1488
1547
|
},
|
|
1489
1548
|
{
|
|
1490
1549
|
provide: NG_VALIDATORS,
|
|
1491
1550
|
useExisting: AdbDatePickerDirective,
|
|
1492
1551
|
multi: true,
|
|
1493
|
-
},], ngImport: i0 });
|
|
1552
|
+
},], ngImport: i0 });
|
|
1494
1553
|
}
|
|
1495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerDirective, decorators: [{
|
|
1496
1555
|
type: Directive,
|
|
1497
1556
|
args: [{
|
|
1498
1557
|
selector: `input[adbDatepicker]`,
|
|
1499
1558
|
providers: [{
|
|
1500
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((
|
|
1559
|
+
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1501
1560
|
multi: true
|
|
1502
1561
|
},
|
|
1503
1562
|
{
|
|
@@ -1539,11 +1598,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1539
1598
|
}] } });
|
|
1540
1599
|
|
|
1541
1600
|
class AdbDatePickerModule {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1601
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1602
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerModule, declarations: [AdbDatePickerComponent, AdbDatePickerDirective], imports: [CommonModule, i1$1.TranslateModule, AdbPipesModule, AdbDirectivesModule], exports: [AdbDatePickerComponent, AdbDatePickerDirective] });
|
|
1603
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerModule, providers: [AdbDatePickerService], imports: [CommonModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule] });
|
|
1545
1604
|
}
|
|
1546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbDatePickerModule, decorators: [{
|
|
1547
1606
|
type: NgModule,
|
|
1548
1607
|
args: [{
|
|
1549
1608
|
imports: [CommonModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule],
|
|
@@ -1554,12 +1613,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1554
1613
|
}] });
|
|
1555
1614
|
|
|
1556
1615
|
class AdbModalService {
|
|
1616
|
+
componentFactoryResolver;
|
|
1617
|
+
appRef;
|
|
1618
|
+
injector;
|
|
1619
|
+
closeSubject = new Subject();
|
|
1620
|
+
close$ = this.closeSubject.asObservable();
|
|
1621
|
+
renderer;
|
|
1622
|
+
domElem;
|
|
1623
|
+
backdrop;
|
|
1557
1624
|
constructor(componentFactoryResolver, rendererFactory, appRef, injector) {
|
|
1558
1625
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1559
1626
|
this.appRef = appRef;
|
|
1560
1627
|
this.injector = injector;
|
|
1561
|
-
this.closeSubject = new Subject();
|
|
1562
|
-
this.close$ = this.closeSubject.asObservable();
|
|
1563
1628
|
this.renderer = rendererFactory.createRenderer(null, null);
|
|
1564
1629
|
}
|
|
1565
1630
|
hide(confirm) {
|
|
@@ -1589,14 +1654,17 @@ class AdbModalService {
|
|
|
1589
1654
|
this.domElem = componentRef.hostView.rootNodes[0];
|
|
1590
1655
|
document.body.appendChild(this.domElem);
|
|
1591
1656
|
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1657
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1658
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalService });
|
|
1594
1659
|
}
|
|
1595
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1660
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalService, decorators: [{
|
|
1596
1661
|
type: Injectable
|
|
1597
1662
|
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }, { type: i0.Injector }] });
|
|
1598
1663
|
|
|
1599
1664
|
class AdbConfirmModal {
|
|
1665
|
+
modalRef;
|
|
1666
|
+
elementRef;
|
|
1667
|
+
model;
|
|
1600
1668
|
constructor(modalRef, elementRef) {
|
|
1601
1669
|
this.modalRef = modalRef;
|
|
1602
1670
|
this.elementRef = elementRef;
|
|
@@ -1610,10 +1678,10 @@ class AdbConfirmModal {
|
|
|
1610
1678
|
onClose(confirm) {
|
|
1611
1679
|
this.modalRef.hide(confirm);
|
|
1612
1680
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbConfirmModal, deps: [{ token: AdbModalService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1682
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbConfirmModal, isStandalone: false, selector: "ng-component", inputs: { model: "model" }, ngImport: i0, template: "@if (model) {\r\n <div class=\"modal fade show\" role=\"dialog\"\r\n attr.aria-labelledby=\"mod_header\"\r\n attr.aria-describedby=\"mod_desc\">\r\n <div class=\"modal-dialog modal-dialog-centered\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h1 class=\"h-subsection mb-0 modal-title\" id=\"mod_header\">{{model.header|translate}}</h1>\r\n <button type=\"button\" class=\"btn-close\" id=\"modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div id=\"mod_desc\">{{model.text|translate}}</div>\r\n @if (model.value) {\r\n <div>\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"d-flex gap-2 justify-content-end\">\r\n @if (model.showDecline) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n }\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
1615
1683
|
}
|
|
1616
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbConfirmModal, decorators: [{
|
|
1617
1685
|
type: Component,
|
|
1618
1686
|
args: [{ standalone: false, template: "@if (model) {\r\n <div class=\"modal fade show\" role=\"dialog\"\r\n attr.aria-labelledby=\"mod_header\"\r\n attr.aria-describedby=\"mod_desc\">\r\n <div class=\"modal-dialog modal-dialog-centered\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h1 class=\"h-subsection mb-0 modal-title\" id=\"mod_header\">{{model.header|translate}}</h1>\r\n <button type=\"button\" class=\"btn-close\" id=\"modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div id=\"mod_desc\">{{model.text|translate}}</div>\r\n @if (model.value) {\r\n <div>\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"d-flex gap-2 justify-content-end\">\r\n @if (model.showDecline) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n }\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}" }]
|
|
1619
1687
|
}], ctorParameters: () => [{ type: AdbModalService }, { type: i0.ElementRef }], propDecorators: { model: [{
|
|
@@ -1621,11 +1689,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1621
1689
|
}] } });
|
|
1622
1690
|
|
|
1623
1691
|
class AdbModalModule {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1693
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbModalModule, declarations: [AdbConfirmModal], imports: [CommonModule, i1$1.TranslateModule, AdbDirectivesModule], exports: [AdbConfirmModal] });
|
|
1694
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalModule, providers: [AdbModalService], imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule] });
|
|
1627
1695
|
}
|
|
1628
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbModalModule, decorators: [{
|
|
1629
1697
|
type: NgModule,
|
|
1630
1698
|
args: [{
|
|
1631
1699
|
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
@@ -1636,14 +1704,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1636
1704
|
}] });
|
|
1637
1705
|
|
|
1638
1706
|
class AdbToastService {
|
|
1707
|
+
componentFactoryResolver;
|
|
1708
|
+
rendererFactory;
|
|
1709
|
+
appRef;
|
|
1710
|
+
injector;
|
|
1711
|
+
toasts = new Array();
|
|
1712
|
+
toastsSubject = new Subject();
|
|
1713
|
+
$toasts = this.toastsSubject.asObservable();
|
|
1714
|
+
renderer;
|
|
1715
|
+
domElement;
|
|
1716
|
+
container;
|
|
1639
1717
|
constructor(componentFactoryResolver, rendererFactory, appRef, injector) {
|
|
1640
1718
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1641
1719
|
this.rendererFactory = rendererFactory;
|
|
1642
1720
|
this.appRef = appRef;
|
|
1643
1721
|
this.injector = injector;
|
|
1644
|
-
this.toasts = new Array();
|
|
1645
|
-
this.toastsSubject = new Subject();
|
|
1646
|
-
this.$toasts = this.toastsSubject.asObservable();
|
|
1647
1722
|
}
|
|
1648
1723
|
add(toastMessage, time = 4000) {
|
|
1649
1724
|
this.addContainer();
|
|
@@ -1671,10 +1746,10 @@ class AdbToastService {
|
|
|
1671
1746
|
this.container.prepend(element);
|
|
1672
1747
|
}
|
|
1673
1748
|
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1750
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastService });
|
|
1676
1751
|
}
|
|
1677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastService, decorators: [{
|
|
1678
1753
|
type: Injectable
|
|
1679
1754
|
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }, { type: i0.Injector }] });
|
|
1680
1755
|
var ToastType;
|
|
@@ -1686,9 +1761,11 @@ var ToastType;
|
|
|
1686
1761
|
})(ToastType || (ToastType = {}));
|
|
1687
1762
|
|
|
1688
1763
|
class AdbToast {
|
|
1764
|
+
toastService;
|
|
1765
|
+
toasts;
|
|
1766
|
+
toastType = ToastType;
|
|
1689
1767
|
constructor(toastService) {
|
|
1690
1768
|
this.toastService = toastService;
|
|
1691
|
-
this.toastType = ToastType;
|
|
1692
1769
|
this.toastService.$toasts.subscribe(toasts => {
|
|
1693
1770
|
this.toasts = toasts;
|
|
1694
1771
|
});
|
|
@@ -1696,20 +1773,20 @@ class AdbToast {
|
|
|
1696
1773
|
onRemoveToast(toast) {
|
|
1697
1774
|
this.toastService.remove(toast);
|
|
1698
1775
|
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1776
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToast, deps: [{ token: AdbToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1777
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbToast, isStandalone: false, selector: "ng-component", ngImport: i0, template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\">\r\n @for (toast of toasts; track toast) {\r\n <div class=\"alert alert-dismissible\" role=\"alert\"\r\n [class.alert-primary]=\"toast.type===toastType.Primary\"\r\n [class.alert-success]=\"toast.type===toastType.Success\"\r\n [class.alert-warning]=\"toast.type===toastType.Warn\"\r\n [class.alert-danger]=\"toast.type===toastType.Danger\">\r\n @if (toast.header) {\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\">\r\n @if (!toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n }\r\n @if (toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{(toast.header|translate:toast.headerValue )}}</div>\r\n }\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n </div>\r\n }\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n @if (!toast.messageValue) {\r\n <div>{{toast.message|translate}}</div>\r\n }\r\n @if (toast.messageValue) {\r\n <div>{{(toast.message|translate:toast.messageValue )}}</div>\r\n }\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
1701
1778
|
}
|
|
1702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1779
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToast, decorators: [{
|
|
1703
1780
|
type: Component,
|
|
1704
1781
|
args: [{ standalone: false, template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\">\r\n @for (toast of toasts; track toast) {\r\n <div class=\"alert alert-dismissible\" role=\"alert\"\r\n [class.alert-primary]=\"toast.type===toastType.Primary\"\r\n [class.alert-success]=\"toast.type===toastType.Success\"\r\n [class.alert-warning]=\"toast.type===toastType.Warn\"\r\n [class.alert-danger]=\"toast.type===toastType.Danger\">\r\n @if (toast.header) {\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\">\r\n @if (!toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n }\r\n @if (toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{(toast.header|translate:toast.headerValue )}}</div>\r\n }\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n </div>\r\n }\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n @if (!toast.messageValue) {\r\n <div>{{toast.message|translate}}</div>\r\n }\r\n @if (toast.messageValue) {\r\n <div>{{(toast.message|translate:toast.messageValue )}}</div>\r\n }\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n </div>\r\n </div>\r\n }\r\n</div>" }]
|
|
1705
1782
|
}], ctorParameters: () => [{ type: AdbToastService }] });
|
|
1706
1783
|
|
|
1707
1784
|
class AdbToastModule {
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1785
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1786
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbToastModule, declarations: [AdbToast], imports: [CommonModule, i1$1.TranslateModule, AdbDirectivesModule], exports: [AdbToast] });
|
|
1787
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastModule, providers: [AdbToastService], imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule] });
|
|
1711
1788
|
}
|
|
1712
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbToastModule, decorators: [{
|
|
1713
1790
|
type: NgModule,
|
|
1714
1791
|
args: [{
|
|
1715
1792
|
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
@@ -1720,6 +1797,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1720
1797
|
}] });
|
|
1721
1798
|
|
|
1722
1799
|
class AdbHelpButtonComponent {
|
|
1800
|
+
elementRef;
|
|
1801
|
+
showHelp = false;
|
|
1802
|
+
buttonClass = 'btn btn-invisible p-0';
|
|
1803
|
+
iconClass = 'fas fa-question-circle text-primary';
|
|
1804
|
+
label = '';
|
|
1805
|
+
id;
|
|
1723
1806
|
onClickDoc(event) {
|
|
1724
1807
|
const target = event.target;
|
|
1725
1808
|
const parent = target.parentElement;
|
|
@@ -1730,10 +1813,6 @@ class AdbHelpButtonComponent {
|
|
|
1730
1813
|
}
|
|
1731
1814
|
constructor(elementRef) {
|
|
1732
1815
|
this.elementRef = elementRef;
|
|
1733
|
-
this.showHelp = false;
|
|
1734
|
-
this.buttonClass = 'btn btn-invisible p-0';
|
|
1735
|
-
this.iconClass = 'fas fa-question-circle text-primary';
|
|
1736
|
-
this.label = '';
|
|
1737
1816
|
}
|
|
1738
1817
|
ngOnInit() {
|
|
1739
1818
|
this.id = +Math.floor(Math.random() * Date.now());
|
|
@@ -1750,10 +1829,10 @@ class AdbHelpButtonComponent {
|
|
|
1750
1829
|
}
|
|
1751
1830
|
this.showHelp = !this.showHelp;
|
|
1752
1831
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1832
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbHelpButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1833
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbHelpButtonComponent, isStandalone: false, selector: "adb-help-button", inputs: { buttonClass: "buttonClass", iconClass: "iconClass", label: "label" }, host: { listeners: { "document:click": "onClickDoc($event)" } }, ngImport: i0, template: "<button type=\"button\"\r\n class=\"w-auto d-flex gap-1 align-items-baseline help-button\"\r\n [ngClass]=\"buttonClass\"\r\n [attr.aria-controls]=\"id\" aria-label=\"Help\"\r\n [attr.aria-expanded]=\"showHelp\" (click)=\"onClose()\">\r\n <span [ngClass]=\"iconClass\"></span>\r\n {{label}}\r\n</button>\r\n<div>\r\n @if (showHelp) {\r\n <div [id]=\"id\" class=\"position-absolute start-0 w-100 adb-plate-primary text-start shadow\" style=\"z-index:4\">\r\n <div class=\"d-flex align-items-center\">\r\n <div class=\"flex-grow-1\"><ng-content></ng-content></div>\r\n <div class=\"ms-auto align-self-start d-flex align-items-start\">\r\n <button type=\"button\" class=\"btn-close p-1\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"showHelp=false\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1755
1834
|
}
|
|
1756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbHelpButtonComponent, decorators: [{
|
|
1757
1836
|
type: Component,
|
|
1758
1837
|
args: [{ selector: 'adb-help-button', standalone: false, template: "<button type=\"button\"\r\n class=\"w-auto d-flex gap-1 align-items-baseline help-button\"\r\n [ngClass]=\"buttonClass\"\r\n [attr.aria-controls]=\"id\" aria-label=\"Help\"\r\n [attr.aria-expanded]=\"showHelp\" (click)=\"onClose()\">\r\n <span [ngClass]=\"iconClass\"></span>\r\n {{label}}\r\n</button>\r\n<div>\r\n @if (showHelp) {\r\n <div [id]=\"id\" class=\"position-absolute start-0 w-100 adb-plate-primary text-start shadow\" style=\"z-index:4\">\r\n <div class=\"d-flex align-items-center\">\r\n <div class=\"flex-grow-1\"><ng-content></ng-content></div>\r\n <div class=\"ms-auto align-self-start d-flex align-items-start\">\r\n <button type=\"button\" class=\"btn-close p-1\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"showHelp=false\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>" }]
|
|
1759
1838
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { buttonClass: [{
|
|
@@ -1768,11 +1847,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1768
1847
|
}] } });
|
|
1769
1848
|
|
|
1770
1849
|
class AdbButtonsModule {
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1850
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbButtonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1851
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbButtonsModule, declarations: [AdbHelpButtonComponent], imports: [CommonModule, AdbDirectivesModule], exports: [AdbHelpButtonComponent] });
|
|
1852
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbButtonsModule, imports: [CommonModule, AdbDirectivesModule] });
|
|
1774
1853
|
}
|
|
1775
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbButtonsModule, decorators: [{
|
|
1776
1855
|
type: NgModule,
|
|
1777
1856
|
args: [{
|
|
1778
1857
|
imports: [CommonModule, AdbDirectivesModule],
|
|
@@ -1790,17 +1869,13 @@ const DEFAULT_MARKER = {
|
|
|
1790
1869
|
bold: '**'
|
|
1791
1870
|
};
|
|
1792
1871
|
class AdbRichEditorComponent {
|
|
1872
|
+
el;
|
|
1873
|
+
text = '';
|
|
1874
|
+
hasTaxon = false;
|
|
1875
|
+
hasReference = false;
|
|
1876
|
+
rows = 3;
|
|
1793
1877
|
constructor(el) {
|
|
1794
1878
|
this.el = el;
|
|
1795
|
-
this.text = '';
|
|
1796
|
-
this.hasTaxon = false;
|
|
1797
|
-
this.hasReference = false;
|
|
1798
|
-
this.rows = 3;
|
|
1799
|
-
// ---------------------------------------
|
|
1800
|
-
// ControlValueAccessor
|
|
1801
|
-
// ---------------------------------------
|
|
1802
|
-
this.onChange = () => { };
|
|
1803
|
-
this.onTouched = () => { };
|
|
1804
1879
|
}
|
|
1805
1880
|
getTextarea() {
|
|
1806
1881
|
return this.el.nativeElement.querySelector('textarea');
|
|
@@ -1898,6 +1973,11 @@ class AdbRichEditorComponent {
|
|
|
1898
1973
|
textarea.setSelectionRange(nameStart, nameEnd);
|
|
1899
1974
|
});
|
|
1900
1975
|
}
|
|
1976
|
+
// ---------------------------------------
|
|
1977
|
+
// ControlValueAccessor
|
|
1978
|
+
// ---------------------------------------
|
|
1979
|
+
onChange = () => { };
|
|
1980
|
+
onTouched = () => { };
|
|
1901
1981
|
writeValue(value) {
|
|
1902
1982
|
this.text = value ?? '';
|
|
1903
1983
|
}
|
|
@@ -1919,21 +1999,21 @@ class AdbRichEditorComponent {
|
|
|
1919
1999
|
this.onChange(this.text);
|
|
1920
2000
|
}
|
|
1921
2001
|
ngOnDestroy() { }
|
|
1922
|
-
|
|
1923
|
-
|
|
2002
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2003
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbRichEditorComponent, isStandalone: false, selector: "adb-rich-editor", inputs: { hasTaxon: "hasTaxon", hasReference: "hasReference", rows: "rows" }, providers: [
|
|
1924
2004
|
{
|
|
1925
2005
|
provide: NG_VALUE_ACCESSOR,
|
|
1926
|
-
useExisting: forwardRef((
|
|
2006
|
+
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1927
2007
|
multi: true
|
|
1928
2008
|
}
|
|
1929
|
-
], ngImport: i0, template: "<div>\r\n <div class=\"d-flex justify-content-end gap-3 mb-1\">\r\n <button class=\"btn btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"fas fa-italic\"></span></button>\r\n <button class=\"btn btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"fas fa-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"fas fa-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"fas fa-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n", dependencies: [{ kind: "directive", type:
|
|
2009
|
+
], ngImport: i0, template: "<div>\r\n <div class=\"d-flex justify-content-end gap-3 mb-1\">\r\n <button class=\"btn btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"fas fa-italic\"></span></button>\r\n <button class=\"btn btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"fas fa-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"fas fa-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"fas fa-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1930
2010
|
}
|
|
1931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2011
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorComponent, decorators: [{
|
|
1932
2012
|
type: Component,
|
|
1933
2013
|
args: [{ selector: 'adb-rich-editor', providers: [
|
|
1934
2014
|
{
|
|
1935
2015
|
provide: NG_VALUE_ACCESSOR,
|
|
1936
|
-
useExisting: forwardRef((
|
|
2016
|
+
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1937
2017
|
multi: true
|
|
1938
2018
|
}
|
|
1939
2019
|
], standalone: false, template: "<div>\r\n <div class=\"d-flex justify-content-end gap-3 mb-1\">\r\n <button class=\"btn btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"fas fa-italic\"></span></button>\r\n <button class=\"btn btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"fas fa-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"fas fa-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"fas fa-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n" }]
|
|
@@ -1948,9 +2028,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1948
2028
|
const RICH_MODULE_CONFIG = new InjectionToken('richModule.config');
|
|
1949
2029
|
|
|
1950
2030
|
class RichTextComponent {
|
|
2031
|
+
text = '';
|
|
2032
|
+
parts = [];
|
|
2033
|
+
taxonUrl;
|
|
1951
2034
|
constructor(config) {
|
|
1952
|
-
this.text = '';
|
|
1953
|
-
this.parts = [];
|
|
1954
2035
|
this.taxonUrl = config.taxonUrl;
|
|
1955
2036
|
}
|
|
1956
2037
|
ngOnChanges() {
|
|
@@ -2024,10 +2105,10 @@ class RichTextComponent {
|
|
|
2024
2105
|
}
|
|
2025
2106
|
return parts;
|
|
2026
2107
|
}
|
|
2027
|
-
|
|
2028
|
-
|
|
2108
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RichTextComponent, deps: [{ token: RICH_MODULE_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
2109
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: RichTextComponent, isStandalone: false, selector: "adb-rich-text", inputs: { text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track part) {\r\n @if (part.type === 'text') {\r\n <span>{{ part.content }}</span>\r\n }\r\n @if (part.type === 'italic') {\r\n <em>{{ part.content }}</em>\r\n }\r\n @if (part.type === 'bold') {\r\n <b>{{ part.content }}</b>\r\n }\r\n @if (part.type === 'taxon') {\r\n <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a>\r\n }\r\n @if (part.type === 'term') {\r\n <span>{{ part.content }}</span>\r\n }\r\n @if (part.type === 'reference') {\r\n <span>{{ part.content }}</span>\r\n }\r\n }\r\n</div>\r\n" });
|
|
2029
2110
|
}
|
|
2030
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: RichTextComponent, decorators: [{
|
|
2031
2112
|
type: Component,
|
|
2032
2113
|
args: [{ selector: 'adb-rich-text', standalone: false, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track part) {\r\n @if (part.type === 'text') {\r\n <span>{{ part.content }}</span>\r\n }\r\n @if (part.type === 'italic') {\r\n <em>{{ part.content }}</em>\r\n }\r\n @if (part.type === 'bold') {\r\n <b>{{ part.content }}</b>\r\n }\r\n @if (part.type === 'taxon') {\r\n <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a>\r\n }\r\n @if (part.type === 'term') {\r\n <span>{{ part.content }}</span>\r\n }\r\n @if (part.type === 'reference') {\r\n <span>{{ part.content }}</span>\r\n }\r\n }\r\n</div>\r\n" }]
|
|
2033
2114
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -2046,11 +2127,11 @@ class AdbRichEditorModule {
|
|
|
2046
2127
|
]
|
|
2047
2128
|
};
|
|
2048
2129
|
}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2131
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorModule, declarations: [AdbRichEditorComponent, RichTextComponent], imports: [CommonModule, FormsModule], exports: [AdbRichEditorComponent, RichTextComponent] });
|
|
2132
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorModule, imports: [CommonModule, FormsModule] });
|
|
2052
2133
|
}
|
|
2053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbRichEditorModule, decorators: [{
|
|
2054
2135
|
type: NgModule,
|
|
2055
2136
|
args: [{
|
|
2056
2137
|
imports: [CommonModule, FormsModule],
|
|
@@ -2060,20 +2141,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2060
2141
|
}] });
|
|
2061
2142
|
|
|
2062
2143
|
class FilterSectionComponent {
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2144
|
+
titleResource = 'Not set';
|
|
2145
|
+
helpResource = null;
|
|
2146
|
+
count;
|
|
2147
|
+
expanded;
|
|
2148
|
+
lazy = false;
|
|
2149
|
+
id;
|
|
2150
|
+
template;
|
|
2068
2151
|
ngOnInit() {
|
|
2069
2152
|
this.id = +Math.floor(Math.random() * Date.now());
|
|
2070
2153
|
}
|
|
2071
2154
|
ngOnDestroy() {
|
|
2072
2155
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FilterSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2157
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: FilterSectionComponent, isStandalone: false, selector: "adb-filter-section", inputs: { titleResource: "titleResource", helpResource: "helpResource", count: "count", expanded: "expanded", lazy: "lazy" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: "<button [attr.aria-expanded]=\"expanded\" [attr.aria-controls]=\"id\" class=\"btn btn-invisible px-1 bg-white\" type=\"button\" (click)=\"expanded = !expanded\">\r\n <div class=\"d-flex align-items-center gap-1 flex-wrap \">\r\n <div class=\"d-flex align-items-center\">\r\n <i class=\"fas fa-fw\" [ngClass]=\"expanded?'fa-chevron-down':'fa-chevron-right'\"></i>\r\n {{titleResource|translate}}\r\n </div>\r\n @if(helpResource){\r\n <adb-help-button (click)=\"$event.stopPropagation()\">{{helpResource|translate}}</adb-help-button>\r\n }\r\n @if(count > 0){\r\n <div class=\"ms-auto badge bg-dark\">{{count}}</div>\r\n }\r\n </div>\r\n</button>\r\n@if (expanded) {\r\n<div class=\"px-3 pb-3 border-bottom\" [id]=\"id\">\r\n @if (lazy && template) {\r\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</div>\r\n}", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AdbHelpButtonComponent, selector: "adb-help-button", inputs: ["buttonClass", "iconClass", "label"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
2075
2158
|
}
|
|
2076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: FilterSectionComponent, decorators: [{
|
|
2077
2160
|
type: Component,
|
|
2078
2161
|
args: [{ selector: 'adb-filter-section', standalone: false, template: "<button [attr.aria-expanded]=\"expanded\" [attr.aria-controls]=\"id\" class=\"btn btn-invisible px-1 bg-white\" type=\"button\" (click)=\"expanded = !expanded\">\r\n <div class=\"d-flex align-items-center gap-1 flex-wrap \">\r\n <div class=\"d-flex align-items-center\">\r\n <i class=\"fas fa-fw\" [ngClass]=\"expanded?'fa-chevron-down':'fa-chevron-right'\"></i>\r\n {{titleResource|translate}}\r\n </div>\r\n @if(helpResource){\r\n <adb-help-button (click)=\"$event.stopPropagation()\">{{helpResource|translate}}</adb-help-button>\r\n }\r\n @if(count > 0){\r\n <div class=\"ms-auto badge bg-dark\">{{count}}</div>\r\n }\r\n </div>\r\n</button>\r\n@if (expanded) {\r\n<div class=\"px-3 pb-3 border-bottom\" [id]=\"id\">\r\n @if (lazy && template) {\r\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</div>\r\n}" }]
|
|
2079
2162
|
}], propDecorators: { titleResource: [{
|
|
@@ -2092,11 +2175,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2092
2175
|
}] } });
|
|
2093
2176
|
|
|
2094
2177
|
class AdbFilterSectionModule {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbFilterSectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2179
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbFilterSectionModule, declarations: [FilterSectionComponent], imports: [CommonModule, FormsModule, TranslateModule, AdbButtonsModule], exports: [FilterSectionComponent, AdbButtonsModule] });
|
|
2180
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbFilterSectionModule, imports: [CommonModule, FormsModule, TranslateModule, AdbButtonsModule, AdbButtonsModule] });
|
|
2098
2181
|
}
|
|
2099
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbFilterSectionModule, decorators: [{
|
|
2100
2183
|
type: NgModule,
|
|
2101
2184
|
args: [{
|
|
2102
2185
|
imports: [CommonModule, FormsModule, TranslateModule, AdbButtonsModule],
|
|
@@ -2116,25 +2199,29 @@ const DEFAULT_ADB_USER_SERVICE_CONFIG = {
|
|
|
2116
2199
|
};
|
|
2117
2200
|
|
|
2118
2201
|
class UserModuleConstants {
|
|
2119
|
-
static
|
|
2120
|
-
static
|
|
2121
|
-
static
|
|
2122
|
-
static
|
|
2123
|
-
static
|
|
2124
|
-
static
|
|
2125
|
-
static
|
|
2202
|
+
static CURRENT_URL = "current_url";
|
|
2203
|
+
static CODE_VERIFIER = 'nonce';
|
|
2204
|
+
static REFRESH_TOKEN = 'refresh-token';
|
|
2205
|
+
static TOKEN_EXPIRES = 'token_expires';
|
|
2206
|
+
static ACCESS_TOKEN = 'access-token';
|
|
2207
|
+
static USER_LAST_ACTIVE = 'lastActive';
|
|
2208
|
+
static ONGOING_CODEFLOW = 'ongoing-codeflow';
|
|
2126
2209
|
}
|
|
2127
2210
|
|
|
2128
2211
|
class AdbUserService {
|
|
2212
|
+
config;
|
|
2213
|
+
http;
|
|
2214
|
+
router;
|
|
2215
|
+
subscriptions = new Subscription();
|
|
2216
|
+
userSubject = new BehaviorSubject(null);
|
|
2217
|
+
user$ = this.userSubject.asObservable();
|
|
2218
|
+
lastRefreshTime = 0;
|
|
2219
|
+
intervalId;
|
|
2129
2220
|
// hasEmitted = false;
|
|
2130
2221
|
constructor(config, http, router) {
|
|
2131
2222
|
this.config = config;
|
|
2132
2223
|
this.http = http;
|
|
2133
2224
|
this.router = router;
|
|
2134
|
-
this.subscriptions = new Subscription();
|
|
2135
|
-
this.userSubject = new BehaviorSubject(null);
|
|
2136
|
-
this.user$ = this.userSubject.asObservable();
|
|
2137
|
-
this.lastRefreshTime = 0;
|
|
2138
2225
|
this.config = { ...{ scope: 'roles', idleTime: 30, response_type: 'code' }, ...config };
|
|
2139
2226
|
}
|
|
2140
2227
|
init() {
|
|
@@ -2319,10 +2406,10 @@ class AdbUserService {
|
|
|
2319
2406
|
ngOnDestroy() {
|
|
2320
2407
|
this.subscriptions.unsubscribe();
|
|
2321
2408
|
}
|
|
2322
|
-
|
|
2323
|
-
|
|
2409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserService, deps: [{ token: ADB_USER_SERVICE_CONFIG }, { token: i1$2.HttpClient }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2410
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserService });
|
|
2324
2411
|
}
|
|
2325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserService, decorators: [{
|
|
2326
2413
|
type: Injectable
|
|
2327
2414
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2328
2415
|
type: Inject,
|
|
@@ -2330,12 +2417,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2330
2417
|
}] }, { type: i1$2.HttpClient }, { type: i1.Router }] });
|
|
2331
2418
|
|
|
2332
2419
|
class AuthCallbackComponent {
|
|
2420
|
+
activatedRoute;
|
|
2421
|
+
router;
|
|
2422
|
+
http;
|
|
2423
|
+
adbUserService;
|
|
2424
|
+
subscriptions = new Subscription();
|
|
2333
2425
|
constructor(activatedRoute, router, http, adbUserService) {
|
|
2334
2426
|
this.activatedRoute = activatedRoute;
|
|
2335
2427
|
this.router = router;
|
|
2336
2428
|
this.http = http;
|
|
2337
2429
|
this.adbUserService = adbUserService;
|
|
2338
|
-
this.subscriptions = new Subscription();
|
|
2339
2430
|
}
|
|
2340
2431
|
ngOnInit() {
|
|
2341
2432
|
this.subscriptions.add(this.activatedRoute.queryParamMap.subscribe(qParmas => {
|
|
@@ -2368,10 +2459,10 @@ class AuthCallbackComponent {
|
|
|
2368
2459
|
}
|
|
2369
2460
|
}));
|
|
2370
2461
|
}
|
|
2371
|
-
|
|
2372
|
-
|
|
2462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AuthCallbackComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }, { token: i1$2.HttpClient }, { token: AdbUserService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2463
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.0", type: AuthCallbackComponent, isStandalone: false, selector: "ng-component", ngImport: i0, template: '<div class="loading-dead-spinner"></div>', isInline: true });
|
|
2373
2464
|
}
|
|
2374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AuthCallbackComponent, decorators: [{
|
|
2375
2466
|
type: Component,
|
|
2376
2467
|
args: [{
|
|
2377
2468
|
template: '<div class="loading-dead-spinner"></div>',
|
|
@@ -2380,7 +2471,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2380
2471
|
}], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: i1$2.HttpClient }, { type: AdbUserService }] });
|
|
2381
2472
|
|
|
2382
2473
|
class AdbUserInterceptor {
|
|
2383
|
-
|
|
2474
|
+
adbUserService;
|
|
2475
|
+
static UNAUTHENTICATED = 401;
|
|
2384
2476
|
constructor(adbUserService) {
|
|
2385
2477
|
this.adbUserService = adbUserService;
|
|
2386
2478
|
}
|
|
@@ -2413,10 +2505,10 @@ class AdbUserInterceptor {
|
|
|
2413
2505
|
}
|
|
2414
2506
|
return throwError(() => error);
|
|
2415
2507
|
}
|
|
2416
|
-
|
|
2417
|
-
|
|
2508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserInterceptor, deps: [{ token: AdbUserService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2509
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserInterceptor });
|
|
2418
2510
|
}
|
|
2419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserInterceptor, decorators: [{
|
|
2420
2512
|
type: Injectable
|
|
2421
2513
|
}], ctorParameters: () => [{ type: AdbUserService }] });
|
|
2422
2514
|
|
|
@@ -2439,18 +2531,18 @@ class AdbUserModule {
|
|
|
2439
2531
|
],
|
|
2440
2532
|
};
|
|
2441
2533
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2534
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2535
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbUserModule, declarations: [AuthCallbackComponent], imports: [CommonModule, i1.RouterModule, i1$1.TranslateModule], exports: [AuthCallbackComponent] });
|
|
2536
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserModule, providers: [
|
|
2445
2537
|
AdbUserService,
|
|
2446
2538
|
{
|
|
2447
2539
|
provide: HTTP_INTERCEPTORS,
|
|
2448
2540
|
useClass: AdbUserInterceptor,
|
|
2449
2541
|
multi: true
|
|
2450
2542
|
}
|
|
2451
|
-
], imports: [CommonModule, RouterModule.forChild(routes), TranslateModule.forChild()] });
|
|
2543
|
+
], imports: [CommonModule, RouterModule.forChild(routes), TranslateModule.forChild()] });
|
|
2452
2544
|
}
|
|
2453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbUserModule, decorators: [{
|
|
2454
2546
|
type: NgModule,
|
|
2455
2547
|
args: [{
|
|
2456
2548
|
imports: [CommonModule, RouterModule.forChild(routes), TranslateModule.forChild()],
|
|
@@ -2468,21 +2560,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2468
2560
|
}] });
|
|
2469
2561
|
|
|
2470
2562
|
class GenericPickerComponent {
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
this.items$ = of([]);
|
|
2482
|
-
this.itemsSnapshot = [];
|
|
2483
|
-
this.showPop = false;
|
|
2484
|
-
this.rowIndex = -1;
|
|
2485
|
-
}
|
|
2563
|
+
subs = new Subscription();
|
|
2564
|
+
searchChanged$ = new BehaviorSubject('');
|
|
2565
|
+
search;
|
|
2566
|
+
displayFn;
|
|
2567
|
+
loadById;
|
|
2568
|
+
disabled = false;
|
|
2569
|
+
placeholder = '';
|
|
2570
|
+
itemTemplate;
|
|
2571
|
+
selectItemChange = new EventEmitter();
|
|
2572
|
+
focus = new EventEmitter();
|
|
2486
2573
|
set initialValue(item) {
|
|
2487
2574
|
if (item) {
|
|
2488
2575
|
this.searchQuery = this.displayFn(item);
|
|
@@ -2491,6 +2578,13 @@ class GenericPickerComponent {
|
|
|
2491
2578
|
this.searchQuery = '';
|
|
2492
2579
|
}
|
|
2493
2580
|
}
|
|
2581
|
+
searchQuery = '';
|
|
2582
|
+
loading = false;
|
|
2583
|
+
error = null;
|
|
2584
|
+
items$ = of([]);
|
|
2585
|
+
itemsSnapshot = [];
|
|
2586
|
+
showPop = false;
|
|
2587
|
+
rowIndex = -1;
|
|
2494
2588
|
ngOnInit() {
|
|
2495
2589
|
this.items$ = this.searchChanged$.pipe(debounceTime(300), switchMap(query => {
|
|
2496
2590
|
if (!query) {
|
|
@@ -2555,10 +2649,10 @@ class GenericPickerComponent {
|
|
|
2555
2649
|
ngOnDestroy() {
|
|
2556
2650
|
this.subs.unsubscribe();
|
|
2557
2651
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2652
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2653
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: GenericPickerComponent, isStandalone: false, selector: "adb-generic-picker", inputs: { search: "search", displayFn: "displayFn", loadById: "loadById", disabled: "disabled", placeholder: "placeholder", initialValue: "initialValue" }, outputs: { selectItemChange: "selectItemChange", focus: "focus" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], ngImport: i0, template: "<div (adbClickOutside)=\"resetPopup()\">\r\n <div class=\"input-group\">\r\n <input [(ngModel)]=\"searchQuery\" class=\"form-control\" role=\"combobox\" aria-autocomplete=\"list\" [attr.aria-expanded]=\"showPop\" aria-controls=\"picker-listbox\" [disabled]=\"disabled\" autocomplete=\"off\" (keyup.arrowdown)=\"onArrowDown()\"\r\n (keyup.arrowup)=\"onArrowUp()\" (keydown.enter)=\"onEnter($event)\" (keydown.escape)=\"resetPopup()\" (keydown.tab)=\"resetPopup()\" (ngModelChange)=\"onModelChange()\" (focus)=\"focus.emit($event)\" [placeholder]=\"placeholder\" />\r\n @if (searchQuery && !showPop) {\r\n <div>\r\n <button type=\"button\" (click)=\"resetModel()\" class=\"btn btn-secondary border border-start-0\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n@let items = items$ | async;\r\n@if (showPop) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div [class.loading]=\"loading\">\r\n @if (error) {\r\n <div class=\"alert alert-danger mb-0\">\r\n Serverfel\r\n </div>\r\n }\r\n @else {\r\n <ul class=\"list-group list-group-flush\" role=\"listbox\" id=\"picker-listbox\">\r\n @for (item of items; track item; let i = $index) {\r\n <li role=\"option\" class=\"list-group-item list-group-item-action pointer\" [class.active]=\"i === rowIndex\" (click)=\"$event.preventDefault(); $event.stopPropagation(); selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, searchQuery: searchQuery }\"></ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { kind: "pipe", type: i1$3.AsyncPipe, name: "async" }] });
|
|
2560
2654
|
}
|
|
2561
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GenericPickerComponent, decorators: [{
|
|
2562
2656
|
type: Component,
|
|
2563
2657
|
args: [{ selector: 'adb-generic-picker', standalone: false, template: "<div (adbClickOutside)=\"resetPopup()\">\r\n <div class=\"input-group\">\r\n <input [(ngModel)]=\"searchQuery\" class=\"form-control\" role=\"combobox\" aria-autocomplete=\"list\" [attr.aria-expanded]=\"showPop\" aria-controls=\"picker-listbox\" [disabled]=\"disabled\" autocomplete=\"off\" (keyup.arrowdown)=\"onArrowDown()\"\r\n (keyup.arrowup)=\"onArrowUp()\" (keydown.enter)=\"onEnter($event)\" (keydown.escape)=\"resetPopup()\" (keydown.tab)=\"resetPopup()\" (ngModelChange)=\"onModelChange()\" (focus)=\"focus.emit($event)\" [placeholder]=\"placeholder\" />\r\n @if (searchQuery && !showPop) {\r\n <div>\r\n <button type=\"button\" (click)=\"resetModel()\" class=\"btn btn-secondary border border-start-0\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n@let items = items$ | async;\r\n@if (showPop) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div [class.loading]=\"loading\">\r\n @if (error) {\r\n <div class=\"alert alert-danger mb-0\">\r\n Serverfel\r\n </div>\r\n }\r\n @else {\r\n <ul class=\"list-group list-group-flush\" role=\"listbox\" id=\"picker-listbox\">\r\n @for (item of items; track item; let i = $index) {\r\n <li role=\"option\" class=\"list-group-item list-group-item-action pointer\" [class.active]=\"i === rowIndex\" (click)=\"$event.preventDefault(); $event.stopPropagation(); selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, searchQuery: searchQuery }\"></ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}" }]
|
|
2564
2658
|
}], propDecorators: { search: [{
|
|
@@ -2584,14 +2678,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2584
2678
|
|
|
2585
2679
|
const ADB_PICKER_CONFIG = new InjectionToken('ADB_PICKER_CONFIG');
|
|
2586
2680
|
class AdbPickerConfigService {
|
|
2681
|
+
areas;
|
|
2682
|
+
taxa;
|
|
2587
2683
|
constructor(config) {
|
|
2588
2684
|
this.areas = config.api + '/areas';
|
|
2589
2685
|
this.taxa = config.api + '/taxalookup';
|
|
2590
2686
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2687
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerConfigService, deps: [{ token: ADB_PICKER_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2688
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerConfigService });
|
|
2593
2689
|
}
|
|
2594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerConfigService, decorators: [{
|
|
2595
2691
|
type: Injectable
|
|
2596
2692
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2597
2693
|
type: Inject,
|
|
@@ -2599,36 +2695,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2599
2695
|
}] }] });
|
|
2600
2696
|
|
|
2601
2697
|
class AdbTaxonPickerComponent {
|
|
2698
|
+
config;
|
|
2699
|
+
http;
|
|
2700
|
+
fullWidth = true;
|
|
2701
|
+
placeholder = 'Sök taxon';
|
|
2702
|
+
useObject = false;
|
|
2703
|
+
prefill = false;
|
|
2704
|
+
initialValue = signal(null, ...(ngDevMode ? [{ debugName: "initialValue" }] : []));
|
|
2705
|
+
isDisabled = false;
|
|
2706
|
+
loading = false;
|
|
2707
|
+
showPrefill = false;
|
|
2708
|
+
onChange = () => { };
|
|
2709
|
+
onTouched = () => { };
|
|
2602
2710
|
constructor(config, http) {
|
|
2603
2711
|
this.config = config;
|
|
2604
2712
|
this.http = http;
|
|
2605
|
-
this.fullWidth = true;
|
|
2606
|
-
this.placeholder = 'Sök taxon';
|
|
2607
|
-
this.useObject = false;
|
|
2608
|
-
this.prefill = false;
|
|
2609
|
-
this.initialValue = signal(null, ...(ngDevMode ? [{ debugName: "initialValue" }] : []));
|
|
2610
|
-
this.isDisabled = false;
|
|
2611
|
-
this.loading = false;
|
|
2612
|
-
this.showPrefill = false;
|
|
2613
|
-
this.onChange = () => { };
|
|
2614
|
-
this.onTouched = () => { };
|
|
2615
|
-
this.getTaxa = (query) => {
|
|
2616
|
-
this.loading = true;
|
|
2617
|
-
const params = { search: query };
|
|
2618
|
-
return this.http.get(this.config.taxa, { params }).pipe(map$1(result => Array.isArray(result) ? { items: result } : result), tap(() => this.loading = false), catchError(() => {
|
|
2619
|
-
this.loading = false;
|
|
2620
|
-
return of({ items: [] });
|
|
2621
|
-
}));
|
|
2622
|
-
};
|
|
2623
|
-
this.displayTaxon = (taxon) => {
|
|
2624
|
-
if (!taxon)
|
|
2625
|
-
return '';
|
|
2626
|
-
if (taxon.swedishName && taxon.scientificName) {
|
|
2627
|
-
return `${taxon.swedishName} ${taxon.scientificName}`;
|
|
2628
|
-
}
|
|
2629
|
-
return taxon.scientificName ?? '';
|
|
2630
|
-
};
|
|
2631
2713
|
}
|
|
2714
|
+
getTaxa = (query) => {
|
|
2715
|
+
this.loading = true;
|
|
2716
|
+
const params = { search: query };
|
|
2717
|
+
return this.http.get(this.config.taxa, { params }).pipe(map$1(result => Array.isArray(result) ? { items: result } : result), tap(() => this.loading = false), catchError(() => {
|
|
2718
|
+
this.loading = false;
|
|
2719
|
+
return of({ items: [] });
|
|
2720
|
+
}));
|
|
2721
|
+
};
|
|
2722
|
+
displayTaxon = (taxon) => {
|
|
2723
|
+
if (!taxon)
|
|
2724
|
+
return '';
|
|
2725
|
+
if (taxon.swedishName && taxon.scientificName) {
|
|
2726
|
+
return `${taxon.swedishName} ${taxon.scientificName}`;
|
|
2727
|
+
}
|
|
2728
|
+
return taxon.scientificName ?? '';
|
|
2729
|
+
};
|
|
2632
2730
|
loadTaxonById(id) {
|
|
2633
2731
|
if (!id)
|
|
2634
2732
|
return of(null);
|
|
@@ -2675,21 +2773,21 @@ class AdbTaxonPickerComponent {
|
|
|
2675
2773
|
setDisabledState(isDisabled) {
|
|
2676
2774
|
this.isDisabled = isDisabled;
|
|
2677
2775
|
}
|
|
2678
|
-
|
|
2679
|
-
|
|
2776
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbTaxonPickerComponent, deps: [{ token: AdbPickerConfigService }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
|
|
2777
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbTaxonPickerComponent, isStandalone: false, selector: "adb-taxon-picker", inputs: { placeholder: "placeholder", useObject: "useObject", prefill: "prefill" }, host: { properties: { "class.w-100": "this.fullWidth" } }, providers: [
|
|
2680
2778
|
{
|
|
2681
2779
|
provide: NG_VALUE_ACCESSOR,
|
|
2682
|
-
useExisting: forwardRef((
|
|
2780
|
+
useExisting: forwardRef(() => AdbTaxonPickerComponent),
|
|
2683
2781
|
multi: true
|
|
2684
2782
|
}
|
|
2685
|
-
], ngImport: i0, template: "<adb-generic-picker [search]=\"getTaxa\" [displayFn]=\"displayTaxon\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-taxon let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{taxon.swedishName | adbHighlight: searchQuery}}\"></div>\r\n <em innerHTML=\"{{taxon.scientificName | adbHighlight: searchQuery}}\"></em>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "component", type: GenericPickerComponent, selector: "adb-generic-picker", inputs: ["search", "displayFn", "loadById", "disabled", "placeholder", "initialValue"], outputs: ["selectItemChange", "focus"] }, { kind: "pipe", type: HighlightPipe, name: "adbHighlight" }] });
|
|
2783
|
+
], ngImport: i0, template: "<adb-generic-picker [search]=\"getTaxa\" [displayFn]=\"displayTaxon\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-taxon let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{taxon.swedishName | adbHighlight: searchQuery}}\"></div>\r\n <em innerHTML=\"{{taxon.scientificName | adbHighlight: searchQuery}}\"></em>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "component", type: GenericPickerComponent, selector: "adb-generic-picker", inputs: ["search", "displayFn", "loadById", "disabled", "placeholder", "initialValue"], outputs: ["selectItemChange", "focus"] }, { kind: "pipe", type: HighlightPipe, name: "adbHighlight" }] });
|
|
2686
2784
|
}
|
|
2687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbTaxonPickerComponent, decorators: [{
|
|
2688
2786
|
type: Component,
|
|
2689
2787
|
args: [{ selector: 'adb-taxon-picker', standalone: false, providers: [
|
|
2690
2788
|
{
|
|
2691
2789
|
provide: NG_VALUE_ACCESSOR,
|
|
2692
|
-
useExisting: forwardRef((
|
|
2790
|
+
useExisting: forwardRef(() => AdbTaxonPickerComponent),
|
|
2693
2791
|
multi: true
|
|
2694
2792
|
}
|
|
2695
2793
|
], template: "<adb-generic-picker [search]=\"getTaxa\" [displayFn]=\"displayTaxon\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-taxon let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{taxon.swedishName | adbHighlight: searchQuery}}\"></div>\r\n <em innerHTML=\"{{taxon.scientificName | adbHighlight: searchQuery}}\"></em>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}" }]
|
|
@@ -2705,37 +2803,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2705
2803
|
}] } });
|
|
2706
2804
|
|
|
2707
2805
|
class AdbAreaPickerComponent {
|
|
2806
|
+
translate;
|
|
2807
|
+
config;
|
|
2808
|
+
http;
|
|
2809
|
+
fullWidth = true;
|
|
2810
|
+
placeholder = 'Sök område';
|
|
2811
|
+
useObject = false;
|
|
2812
|
+
prefill = false;
|
|
2813
|
+
initialValue = signal(null, ...(ngDevMode ? [{ debugName: "initialValue" }] : []));
|
|
2814
|
+
isDisabled = false;
|
|
2815
|
+
loading = false;
|
|
2816
|
+
showPrefill = false;
|
|
2817
|
+
onChange = () => { };
|
|
2818
|
+
onTouched = () => { };
|
|
2708
2819
|
constructor(translate, config, http) {
|
|
2709
2820
|
this.translate = translate;
|
|
2710
2821
|
this.config = config;
|
|
2711
2822
|
this.http = http;
|
|
2712
|
-
this.fullWidth = true;
|
|
2713
|
-
this.placeholder = 'Sök område';
|
|
2714
|
-
this.useObject = false;
|
|
2715
|
-
this.prefill = false;
|
|
2716
|
-
this.initialValue = signal(null, ...(ngDevMode ? [{ debugName: "initialValue" }] : []));
|
|
2717
|
-
this.isDisabled = false;
|
|
2718
|
-
this.loading = false;
|
|
2719
|
-
this.showPrefill = false;
|
|
2720
|
-
this.onChange = () => { };
|
|
2721
|
-
this.onTouched = () => { };
|
|
2722
|
-
this.getAreas = (query) => {
|
|
2723
|
-
this.showPrefill = false;
|
|
2724
|
-
const params = { search: query, skip: 0, take: 10 };
|
|
2725
|
-
return this.http.get(this.config.areas, { params: params });
|
|
2726
|
-
};
|
|
2727
|
-
this.displayArea = (area) => {
|
|
2728
|
-
if (!area || Object.keys(area).length === 0) {
|
|
2729
|
-
return '';
|
|
2730
|
-
}
|
|
2731
|
-
return area ? `${area.name} ${this.translate.instant('AREATYPES.' + area.areaType)}` : '';
|
|
2732
|
-
};
|
|
2733
|
-
this.loadAreaId = (id) => {
|
|
2734
|
-
this.loading = true;
|
|
2735
|
-
const url = `${this.config.areas}/${id}`;
|
|
2736
|
-
return this.http.get(url).pipe(tap(() => this.loading = false));
|
|
2737
|
-
};
|
|
2738
2823
|
}
|
|
2824
|
+
getAreas = (query) => {
|
|
2825
|
+
this.showPrefill = false;
|
|
2826
|
+
const params = { search: query, skip: 0, take: 10 };
|
|
2827
|
+
return this.http.get(this.config.areas, { params: params });
|
|
2828
|
+
};
|
|
2829
|
+
displayArea = (area) => {
|
|
2830
|
+
if (!area || Object.keys(area).length === 0) {
|
|
2831
|
+
return '';
|
|
2832
|
+
}
|
|
2833
|
+
return area ? `${area.name} ${this.translate.instant('AREATYPES.' + area.areaType)}` : '';
|
|
2834
|
+
};
|
|
2835
|
+
loadAreaId = (id) => {
|
|
2836
|
+
this.loading = true;
|
|
2837
|
+
const url = `${this.config.areas}/${id}`;
|
|
2838
|
+
return this.http.get(url).pipe(tap(() => this.loading = false));
|
|
2839
|
+
};
|
|
2739
2840
|
onSelect(area) {
|
|
2740
2841
|
const value = this.useObject ? area : area?.id ?? null;
|
|
2741
2842
|
this.onChange(value);
|
|
@@ -2773,21 +2874,21 @@ class AdbAreaPickerComponent {
|
|
|
2773
2874
|
setDisabledState(isDisabled) {
|
|
2774
2875
|
this.isDisabled = isDisabled;
|
|
2775
2876
|
}
|
|
2776
|
-
|
|
2777
|
-
|
|
2877
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbAreaPickerComponent, deps: [{ token: i1$1.TranslateService }, { token: AdbPickerConfigService }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
|
|
2878
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AdbAreaPickerComponent, isStandalone: false, selector: "adb-area-picker", inputs: { placeholder: "placeholder", useObject: "useObject", prefill: "prefill" }, host: { properties: { "class.w-100": "this.fullWidth" } }, providers: [
|
|
2778
2879
|
{
|
|
2779
2880
|
provide: NG_VALUE_ACCESSOR,
|
|
2780
|
-
useExisting: forwardRef((
|
|
2881
|
+
useExisting: forwardRef(() => AdbAreaPickerComponent),
|
|
2781
2882
|
multi: true
|
|
2782
2883
|
}
|
|
2783
|
-
], ngImport: i0, template: "<adb-generic-picker [search]=\"getAreas\" [displayFn]=\"displayArea\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-area let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{area.name|adbHighlight: searchQuery}}\"></div>\r\n <div>{{'AREATYPES.'+area.areaType|translate}}</div>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "component", type: GenericPickerComponent, selector: "adb-generic-picker", inputs: ["search", "displayFn", "loadById", "disabled", "placeholder", "initialValue"], outputs: ["selectItemChange", "focus"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: HighlightPipe, name: "adbHighlight" }] });
|
|
2884
|
+
], ngImport: i0, template: "<adb-generic-picker [search]=\"getAreas\" [displayFn]=\"displayArea\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-area let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{area.name|adbHighlight: searchQuery}}\"></div>\r\n <div>{{'AREATYPES.'+area.areaType|translate}}</div>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "component", type: GenericPickerComponent, selector: "adb-generic-picker", inputs: ["search", "displayFn", "loadById", "disabled", "placeholder", "initialValue"], outputs: ["selectItemChange", "focus"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: HighlightPipe, name: "adbHighlight" }] });
|
|
2784
2885
|
}
|
|
2785
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbAreaPickerComponent, decorators: [{
|
|
2786
2887
|
type: Component,
|
|
2787
2888
|
args: [{ selector: 'adb-area-picker', standalone: false, providers: [
|
|
2788
2889
|
{
|
|
2789
2890
|
provide: NG_VALUE_ACCESSOR,
|
|
2790
|
-
useExisting: forwardRef((
|
|
2891
|
+
useExisting: forwardRef(() => AdbAreaPickerComponent),
|
|
2791
2892
|
multi: true
|
|
2792
2893
|
}
|
|
2793
2894
|
], template: "<adb-generic-picker [search]=\"getAreas\" [displayFn]=\"displayArea\" [placeholder]=\"placeholder\" [disabled]=\"isDisabled\" [initialValue]=\"initialValue()\" (selectItemChange)=\"onSelect($event)\" (focus)=\"onFocus()\">\r\n <ng-template #itemTemplate let-area let-searchQuery=\"searchQuery\">\r\n <div class=\"d-flex flex-wrap gap-1 align-items-center\">\r\n <div innerHTML=\"{{area.name|adbHighlight: searchQuery}}\"></div>\r\n <div>{{'AREATYPES.'+area.areaType|translate}}</div>\r\n </div>\r\n </ng-template>\r\n</adb-generic-picker>\r\n@if (showPrefill && prefill) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div class=\"p-3\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n}" }]
|
|
@@ -2814,15 +2915,15 @@ class AdbPickerModule {
|
|
|
2814
2915
|
]
|
|
2815
2916
|
};
|
|
2816
2917
|
}
|
|
2817
|
-
|
|
2818
|
-
|
|
2918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2919
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerModule, declarations: [GenericPickerComponent,
|
|
2819
2920
|
AdbAreaPickerComponent,
|
|
2820
2921
|
AdbTaxonPickerComponent], imports: [CommonModule, FormsModule, i1$1.TranslateModule, AdbPipesModule, AdbDirectivesModule], exports: [GenericPickerComponent,
|
|
2821
2922
|
AdbAreaPickerComponent,
|
|
2822
|
-
AdbTaxonPickerComponent] });
|
|
2823
|
-
|
|
2923
|
+
AdbTaxonPickerComponent] });
|
|
2924
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerModule, providers: [AdbPickerConfigService], imports: [CommonModule, FormsModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule] });
|
|
2824
2925
|
}
|
|
2825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AdbPickerModule, decorators: [{
|
|
2826
2927
|
type: NgModule,
|
|
2827
2928
|
args: [{
|
|
2828
2929
|
imports: [CommonModule, FormsModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule],
|
|
@@ -2840,783 +2941,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2840
2941
|
}]
|
|
2841
2942
|
}] });
|
|
2842
2943
|
|
|
2843
|
-
class AdbMapUtils {
|
|
2844
|
-
static { this.INITIAL_CENTER_LAT = 62; }
|
|
2845
|
-
static { this.INITIAL_CENTER_LNG = 17; }
|
|
2846
|
-
static { this.OverlayMaps = {
|
|
2847
|
-
'Altitude': new Leaflet.TileLayer.WMS("https://maps.sgu.se/lmv/hojdmodell/v1.1?SERVICE=WMS", { layers: "terrangskuggning", format: "image/png", transparent: true, opacity: 0.3, maxZoom: 16, version: "1.3.0" }),
|
|
2848
|
-
'Fjällkarta': new Leaflet.TileLayer.WMS('api/maps/mountain', {
|
|
2849
|
-
minZoom: 6,
|
|
2850
|
-
maxZoom: 18,
|
|
2851
|
-
maxNativeZoom: 14,
|
|
2852
|
-
attribution: '© <a href="https://www.lantmateriet.se/">Fjällkart</a>',
|
|
2853
|
-
wms: true
|
|
2854
|
-
}),
|
|
2855
|
-
'Kommuner': new Leaflet.TileLayer.WMS('https://sosgeo.artdata.slu.se/geoserver/GeoRegion/wms?', {
|
|
2856
|
-
layers: 'GeoRegion:Municipality',
|
|
2857
|
-
version: '1.1.0',
|
|
2858
|
-
transparent: true,
|
|
2859
|
-
format: 'image/png'
|
|
2860
|
-
}),
|
|
2861
|
-
'Län': new Leaflet.TileLayer.WMS('https://sosgeo.artdata.slu.se/geoserver/GeoRegion/wms?', {
|
|
2862
|
-
layers: 'GeoRegion:County',
|
|
2863
|
-
version: '1.1.0',
|
|
2864
|
-
transparent: true,
|
|
2865
|
-
format: 'image/png'
|
|
2866
|
-
}),
|
|
2867
|
-
'Ortnamn': new Leaflet.TileLayer.WMS("https://maps.sgu.se/lmv/topowebb-skikt/v1.1?SERVICE=WMS", {
|
|
2868
|
-
layers: "text",
|
|
2869
|
-
format: "image/png",
|
|
2870
|
-
transparent: true,
|
|
2871
|
-
version: "1.3.0",
|
|
2872
|
-
}),
|
|
2873
|
-
'Ekonomisk zon': new Leaflet.TileLayer.WMS("https://sosgeo.artdata.slu.se/geoserver/it.geosolutions/wms?", {
|
|
2874
|
-
layers: "it.geosolutions:Ekonomiska_zonens_yttre_avgränsningslinjer_linje",
|
|
2875
|
-
format: "image/png",
|
|
2876
|
-
transparent: true,
|
|
2877
|
-
version: "1.1.0"
|
|
2878
|
-
})
|
|
2879
|
-
}; }
|
|
2880
|
-
static { this.Providers = [
|
|
2881
|
-
{
|
|
2882
|
-
name: 'Open Streetmap',
|
|
2883
|
-
id: 3,
|
|
2884
|
-
url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
2885
|
-
minZoom: 0,
|
|
2886
|
-
maxZoom: 18,
|
|
2887
|
-
params: {
|
|
2888
|
-
maxNativeZoom: 18,
|
|
2889
|
-
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
2890
|
-
},
|
|
2891
|
-
wms: false
|
|
2892
|
-
},
|
|
2893
|
-
{
|
|
2894
|
-
name: 'Sveriges gränser',
|
|
2895
|
-
id: 7,
|
|
2896
|
-
url: 'https://sosgeo.artdata.slu.se/geoserver/GeoRegion/wms',
|
|
2897
|
-
minZoom: 6,
|
|
2898
|
-
maxZoom: 18,
|
|
2899
|
-
params: {
|
|
2900
|
-
maxNativeZoom: 14,
|
|
2901
|
-
attribution: '© <a href="https://www.lantmateriet.se/">Sveriges gränser</a>',
|
|
2902
|
-
layers: 'GeoRegion:County', styles: 'municipality_name_yellow'
|
|
2903
|
-
},
|
|
2904
|
-
wms: true
|
|
2905
|
-
}
|
|
2906
|
-
]; }
|
|
2907
|
-
//NOTE: Will be move
|
|
2908
|
-
static { this.redListMapper2 = {
|
|
2909
|
-
'VU': '228',
|
|
2910
|
-
'EN': '229',
|
|
2911
|
-
'CR': '230',
|
|
2912
|
-
'RE': '231',
|
|
2913
|
-
'DD': '232',
|
|
2914
|
-
'NT': '233'
|
|
2915
|
-
}; }
|
|
2916
|
-
static createMap(elementId, options = {}) {
|
|
2917
|
-
const map = Leaflet.map(elementId, {
|
|
2918
|
-
zoomAnimation: false,
|
|
2919
|
-
fadeAnimation: false,
|
|
2920
|
-
markerZoomAnimation: false,
|
|
2921
|
-
inertia: false,
|
|
2922
|
-
scrollWheelZoom: options.scrollZoom ?? true,
|
|
2923
|
-
zoomControl: options.zoom ?? true,
|
|
2924
|
-
dragging: options.zoom ?? true,
|
|
2925
|
-
minZoom: -1
|
|
2926
|
-
});
|
|
2927
|
-
map.setView([62, 17], 5);
|
|
2928
|
-
Leaflet.control.scale().addTo(map);
|
|
2929
|
-
if (options.providers !== false) {
|
|
2930
|
-
this.addProviders(map);
|
|
2931
|
-
}
|
|
2932
|
-
return map;
|
|
2933
|
-
}
|
|
2934
|
-
static addProviders(map) {
|
|
2935
|
-
const backgroundMaps = {};
|
|
2936
|
-
for (const value of Object.values(AdbMapUtils.Providers)) {
|
|
2937
|
-
const baseOptions = {
|
|
2938
|
-
...value.params,
|
|
2939
|
-
updateWhenZooming: false,
|
|
2940
|
-
updateWhenIdle: true,
|
|
2941
|
-
keepBuffer: 2,
|
|
2942
|
-
crossOrigin: true
|
|
2943
|
-
};
|
|
2944
|
-
backgroundMaps[value.name] = value.wms
|
|
2945
|
-
? Leaflet.tileLayer.wms(value.url, baseOptions)
|
|
2946
|
-
: Leaflet.tileLayer(value.url, baseOptions);
|
|
2947
|
-
}
|
|
2948
|
-
map.addLayer(backgroundMaps['Open Streetmap']);
|
|
2949
|
-
Leaflet.control.layers(backgroundMaps, AdbMapUtils.OverlayMaps).addTo(map);
|
|
2950
|
-
}
|
|
2951
|
-
}
|
|
2952
|
-
|
|
2953
|
-
class PolygonDrawerInput {
|
|
2954
|
-
constructor() {
|
|
2955
|
-
this.subscriptions = new Subscription();
|
|
2956
|
-
this.mapId = "" + Math.floor(Math.random() * Date.now());
|
|
2957
|
-
this.polygonDraw = false;
|
|
2958
|
-
// ControlValueAccessor
|
|
2959
|
-
this.onChange = () => { };
|
|
2960
|
-
this.onTouched = () => { };
|
|
2961
|
-
}
|
|
2962
|
-
ngAfterViewInit() {
|
|
2963
|
-
this.map = AdbMapUtils.createMap(this.mapId, {
|
|
2964
|
-
zoom: true,
|
|
2965
|
-
scrollZoom: true,
|
|
2966
|
-
providers: true
|
|
2967
|
-
});
|
|
2968
|
-
this.map.whenReady(() => {
|
|
2969
|
-
this.initDraw();
|
|
2970
|
-
this.renderInitialShape();
|
|
2971
|
-
});
|
|
2972
|
-
}
|
|
2973
|
-
ngOnInit() { }
|
|
2974
|
-
ngOnDestroy() {
|
|
2975
|
-
this.subscriptions.unsubscribe();
|
|
2976
|
-
}
|
|
2977
|
-
initDraw() {
|
|
2978
|
-
this.map.pm.removeControls();
|
|
2979
|
-
this.map.pm.enableDraw('Polygon', {
|
|
2980
|
-
tooltips: false,
|
|
2981
|
-
finishOn: 'snap',
|
|
2982
|
-
snapDistance: 30,
|
|
2983
|
-
snapMiddle: false
|
|
2984
|
-
});
|
|
2985
|
-
this.map.on("pm:create", (e) => {
|
|
2986
|
-
if (e.shape !== 'Polygon' && e.shape !== 'Circle')
|
|
2987
|
-
return;
|
|
2988
|
-
this.polygonDraw = false;
|
|
2989
|
-
this.map.pm.disableDraw();
|
|
2990
|
-
this.clearShape();
|
|
2991
|
-
this.shapeLayer = e.layer;
|
|
2992
|
-
if (this.shapeLayer instanceof Leaflet__default.Path) {
|
|
2993
|
-
this.shapeLayer.setStyle({ fillOpacity: 0.5 });
|
|
2994
|
-
}
|
|
2995
|
-
this.shapeLayer.interactive = false;
|
|
2996
|
-
this.map.fitBounds(this.shapeLayer.getBounds());
|
|
2997
|
-
const geo = this.shapeLayer.toGeoJSON();
|
|
2998
|
-
if (this.shapeLayer instanceof Leaflet__default.Circle) {
|
|
2999
|
-
geo.properties = {
|
|
3000
|
-
...geo.properties,
|
|
3001
|
-
radius: Math.ceil(this.shapeLayer.getRadius())
|
|
3002
|
-
};
|
|
3003
|
-
}
|
|
3004
|
-
this.onChange(geo);
|
|
3005
|
-
});
|
|
3006
|
-
}
|
|
3007
|
-
renderInitialShape() {
|
|
3008
|
-
if (this.geoJson?.type === "Feature") {
|
|
3009
|
-
this.shapeLayer = Leaflet__default.geoJSON(this.geoJson, {
|
|
3010
|
-
interactive: false
|
|
3011
|
-
});
|
|
3012
|
-
this.map.addLayer(this.shapeLayer);
|
|
3013
|
-
this.map.fitBounds(this.shapeLayer.getBounds());
|
|
3014
|
-
}
|
|
3015
|
-
else {
|
|
3016
|
-
this.map.setView([AdbMapUtils.INITIAL_CENTER_LAT, AdbMapUtils.INITIAL_CENTER_LNG], 5);
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
3019
|
-
clearShape() {
|
|
3020
|
-
if (this.shapeLayer) {
|
|
3021
|
-
this.map.removeLayer(this.shapeLayer);
|
|
3022
|
-
this.shapeLayer = null;
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
onDrawPolygon() {
|
|
3026
|
-
this.polygonDraw = true;
|
|
3027
|
-
this.map.pm.enableDraw("Polygon", {
|
|
3028
|
-
allowSelfIntersection: false,
|
|
3029
|
-
snappable: false
|
|
3030
|
-
});
|
|
3031
|
-
}
|
|
3032
|
-
onDrawCircle() {
|
|
3033
|
-
this.polygonDraw = true;
|
|
3034
|
-
this.map.pm.enableDraw("Circle", {
|
|
3035
|
-
allowSelfIntersection: false,
|
|
3036
|
-
snappable: false
|
|
3037
|
-
});
|
|
3038
|
-
}
|
|
3039
|
-
onUndoStep() {
|
|
3040
|
-
const draw = this.map.pm.Draw?.Polygon;
|
|
3041
|
-
draw?._removeLastVertex();
|
|
3042
|
-
}
|
|
3043
|
-
onDeleteShape() {
|
|
3044
|
-
this.clearShape();
|
|
3045
|
-
this.map.pm.disableDraw();
|
|
3046
|
-
this.polygonDraw = false;
|
|
3047
|
-
this.onChange(null);
|
|
3048
|
-
this.map.setView([62, 17], 5);
|
|
3049
|
-
}
|
|
3050
|
-
writeValue(geoJson) {
|
|
3051
|
-
this.geoJson = geoJson;
|
|
3052
|
-
}
|
|
3053
|
-
registerOnChange(fn) {
|
|
3054
|
-
this.onChange = fn;
|
|
3055
|
-
}
|
|
3056
|
-
registerOnTouched(fn) {
|
|
3057
|
-
this.onTouched = fn;
|
|
3058
|
-
}
|
|
3059
|
-
setDisabledState(isDisabled) { }
|
|
3060
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PolygonDrawerInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3061
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: PolygonDrawerInput, isStandalone: false, selector: "adb-polygon-drawer", providers: [
|
|
3062
|
-
{
|
|
3063
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3064
|
-
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3065
|
-
multi: true
|
|
3066
|
-
}
|
|
3067
|
-
], ngImport: i0, template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" [disabled]=\"shapeLayer\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" [disabled]=\"shapeLayer\" (click)=\"onDrawCircle()\" title=\"Circle\">\r\n <span class=\"fas fa-draw-circle\"></span> {{'OBSERVATION.DRAW_CIRCLE'|translate}}\r\n </button>\r\n @if (shapeLayer) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n }\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3068
|
-
}
|
|
3069
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PolygonDrawerInput, decorators: [{
|
|
3070
|
-
type: Component,
|
|
3071
|
-
args: [{ selector: "adb-polygon-drawer", standalone: false, providers: [
|
|
3072
|
-
{
|
|
3073
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3074
|
-
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3075
|
-
multi: true
|
|
3076
|
-
}
|
|
3077
|
-
], template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" [disabled]=\"shapeLayer\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" [disabled]=\"shapeLayer\" (click)=\"onDrawCircle()\" title=\"Circle\">\r\n <span class=\"fas fa-draw-circle\"></span> {{'OBSERVATION.DRAW_CIRCLE'|translate}}\r\n </button>\r\n @if (shapeLayer) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n }\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>" }]
|
|
3078
|
-
}] });
|
|
3079
|
-
|
|
3080
|
-
var AdbMapFilterType;
|
|
3081
|
-
(function (AdbMapFilterType) {
|
|
3082
|
-
AdbMapFilterType["Taxon"] = "taxon";
|
|
3083
|
-
AdbMapFilterType["Area"] = "area";
|
|
3084
|
-
AdbMapFilterType["OwnArea"] = "ownArea";
|
|
3085
|
-
AdbMapFilterType["Time"] = "time";
|
|
3086
|
-
AdbMapFilterType["RedList"] = "redlist";
|
|
3087
|
-
AdbMapFilterType["RiskList"] = "risklist";
|
|
3088
|
-
AdbMapFilterType["TaxaLists"] = "taxonLists";
|
|
3089
|
-
AdbMapFilterType["Datasources"] = "datasources";
|
|
3090
|
-
})(AdbMapFilterType || (AdbMapFilterType = {}));
|
|
3091
|
-
class VisibleFilters {
|
|
3092
|
-
}
|
|
3093
|
-
const ADB_MAP_CONFIG = new InjectionToken('ADB_MAP_CONFIG');
|
|
3094
|
-
class AdbMapConfigService {
|
|
3095
|
-
constructor(config) {
|
|
3096
|
-
this.log = config.log ?? false;
|
|
3097
|
-
this.artfaktaTaxonLists = config.artfaktaTaxonLists ?? 'https://artfakta.se/metadata/listor';
|
|
3098
|
-
this.taxaListsApi = config.api + '/taxalists';
|
|
3099
|
-
this.observationFeatures = config.api + '/observation-features';
|
|
3100
|
-
this.observationPage = config.observationPage ?? 'https://mobil.artportalen.se/observationer';
|
|
3101
|
-
this.filters = {
|
|
3102
|
-
showTaxon: this.hasFilter(AdbMapFilterType.Taxon, config.filters),
|
|
3103
|
-
showTime: this.hasFilter(AdbMapFilterType.Time, config.filters),
|
|
3104
|
-
showArea: this.hasFilter(AdbMapFilterType.Area, config.filters),
|
|
3105
|
-
showOwnArea: this.hasFilter(AdbMapFilterType.OwnArea, config.filters),
|
|
3106
|
-
showTaxaLists: this.hasFilter(AdbMapFilterType.TaxaLists, config.filters),
|
|
3107
|
-
showDatasets: this.hasFilter(AdbMapFilterType.Datasources, config.filters),
|
|
3108
|
-
};
|
|
3109
|
-
}
|
|
3110
|
-
hasFilter(f, filters) {
|
|
3111
|
-
return filters?.includes(f) ?? true;
|
|
3112
|
-
}
|
|
3113
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapConfigService, deps: [{ token: ADB_MAP_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3114
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapConfigService }); }
|
|
3115
|
-
}
|
|
3116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapConfigService, decorators: [{
|
|
3117
|
-
type: Injectable
|
|
3118
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3119
|
-
type: Inject,
|
|
3120
|
-
args: [ADB_MAP_CONFIG]
|
|
3121
|
-
}] }] });
|
|
3122
|
-
|
|
3123
|
-
class TreeviewComponent {
|
|
3124
|
-
constructor() {
|
|
3125
|
-
this.nodes = [];
|
|
3126
|
-
this.selectedIds = [];
|
|
3127
|
-
this.onChange = () => { };
|
|
3128
|
-
this.onTouched = () => { };
|
|
3129
|
-
}
|
|
3130
|
-
writeValue(ids) {
|
|
3131
|
-
this.selectedIds = ids ?? [];
|
|
3132
|
-
this.applySelection(this.nodes);
|
|
3133
|
-
}
|
|
3134
|
-
registerOnChange(fn) {
|
|
3135
|
-
this.onChange = fn;
|
|
3136
|
-
}
|
|
3137
|
-
registerOnTouched(fn) {
|
|
3138
|
-
this.onTouched = fn;
|
|
3139
|
-
}
|
|
3140
|
-
setDisabledState(isDisabled) {
|
|
3141
|
-
this.setReadOnly(this.nodes, isDisabled);
|
|
3142
|
-
}
|
|
3143
|
-
onLeafToggle(node) {
|
|
3144
|
-
if (node._readOnly)
|
|
3145
|
-
return;
|
|
3146
|
-
node._selected = !node._selected;
|
|
3147
|
-
this.selectedIds = TreeviewComponent.collectSelectedLeafIds(this.nodes);
|
|
3148
|
-
this.onChange(this.selectedIds);
|
|
3149
|
-
this.onTouched();
|
|
3150
|
-
}
|
|
3151
|
-
applySelection(nodes) {
|
|
3152
|
-
for (const node of nodes) {
|
|
3153
|
-
if (node.children?.length) {
|
|
3154
|
-
this.applySelection(node.children);
|
|
3155
|
-
}
|
|
3156
|
-
else {
|
|
3157
|
-
node._selected = this.selectedIds.includes(node.id);
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
setReadOnly(nodes, readOnly) {
|
|
3162
|
-
for (const node of nodes) {
|
|
3163
|
-
node._readOnly = readOnly;
|
|
3164
|
-
if (node.children?.length) {
|
|
3165
|
-
this.setReadOnly(node.children, readOnly);
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
3169
|
-
static collectSelectedLeafIds(nodes) {
|
|
3170
|
-
const ids = [];
|
|
3171
|
-
for (const node of nodes) {
|
|
3172
|
-
if (node.children?.length) {
|
|
3173
|
-
ids.push(...this.collectSelectedLeafIds(node.children));
|
|
3174
|
-
}
|
|
3175
|
-
else if (node._selected) {
|
|
3176
|
-
ids.push(node.id);
|
|
3177
|
-
}
|
|
3178
|
-
}
|
|
3179
|
-
return ids;
|
|
3180
|
-
}
|
|
3181
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TreeviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3182
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: TreeviewComponent, isStandalone: false, selector: "app-treeview", inputs: { nodes: "nodes" }, providers: [
|
|
3183
|
-
{
|
|
3184
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3185
|
-
useExisting: forwardRef((() => TreeviewComponent)),
|
|
3186
|
-
multi: true
|
|
3187
|
-
}
|
|
3188
|
-
], ngImport: i0, template: "<ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: nodes }\">\r\n</ng-container>\r\n<ng-template #nodeTpl let-nodes>\r\n @for (node of nodes; track node) {\r\n <div class=\"ms-3\">\r\n @if(!node.children || node.children.length === 0){\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <input id=\"{{node.id}}\" type=\"checkbox\" class=\"form-check-input m-0\" [checked]=\"node._selected\" [disabled]=\"node._readOnly\" (change)=\"onLeafToggle(node)\" />\r\n <label for=\"{{node.id}}\">{{ node.name }}</label>\r\n </div>\r\n }\r\n @else {\r\n {{ node.name }}\r\n <div>\r\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: node.children }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n}\r\n</ng-template>", dependencies: [{ kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
3189
|
-
}
|
|
3190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: TreeviewComponent, decorators: [{
|
|
3191
|
-
type: Component,
|
|
3192
|
-
args: [{ selector: 'app-treeview', standalone: false, providers: [
|
|
3193
|
-
{
|
|
3194
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3195
|
-
useExisting: forwardRef((() => TreeviewComponent)),
|
|
3196
|
-
multi: true
|
|
3197
|
-
}
|
|
3198
|
-
], template: "<ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: nodes }\">\r\n</ng-container>\r\n<ng-template #nodeTpl let-nodes>\r\n @for (node of nodes; track node) {\r\n <div class=\"ms-3\">\r\n @if(!node.children || node.children.length === 0){\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <input id=\"{{node.id}}\" type=\"checkbox\" class=\"form-check-input m-0\" [checked]=\"node._selected\" [disabled]=\"node._readOnly\" (change)=\"onLeafToggle(node)\" />\r\n <label for=\"{{node.id}}\">{{ node.name }}</label>\r\n </div>\r\n }\r\n @else {\r\n {{ node.name }}\r\n <div>\r\n <ng-container *ngTemplateOutlet=\"nodeTpl; context: { $implicit: node.children }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </div>\r\n}\r\n</ng-template>" }]
|
|
3199
|
-
}], propDecorators: { nodes: [{
|
|
3200
|
-
type: Input
|
|
3201
|
-
}] } });
|
|
3202
|
-
|
|
3203
|
-
class AdbObsMapComponent {
|
|
3204
|
-
//Lock end
|
|
3205
|
-
constructor(activatedRoute, config, router, http) {
|
|
3206
|
-
this.activatedRoute = activatedRoute;
|
|
3207
|
-
this.config = config;
|
|
3208
|
-
this.router = router;
|
|
3209
|
-
this.http = http;
|
|
3210
|
-
this.subscriptions = new Subscription();
|
|
3211
|
-
this.mapLoading = signal(false, ...(ngDevMode ? [{ debugName: "mapLoading" }] : []));
|
|
3212
|
-
this.mapId = '' + Math.floor(Math.random() * Date.now());
|
|
3213
|
-
this.map = Leaflet.map;
|
|
3214
|
-
//Lock start
|
|
3215
|
-
this.mapReady = signal(false, ...(ngDevMode ? [{ debugName: "mapReady" }] : []));
|
|
3216
|
-
this.hasQueryParams = false;
|
|
3217
|
-
this.hasUrlParams = false;
|
|
3218
|
-
effect(() => {
|
|
3219
|
-
// This will re-run whenever mapReady() changes
|
|
3220
|
-
if (this.mapReady() && this.hasQueryParams && this.hasUrlParams) {
|
|
3221
|
-
this.tryLoad();
|
|
3222
|
-
}
|
|
3223
|
-
});
|
|
3224
|
-
}
|
|
3225
|
-
ngAfterViewInit() {
|
|
3226
|
-
this.map = AdbMapUtils.createMap(this.mapId, {
|
|
3227
|
-
zoom: true,
|
|
3228
|
-
scrollZoom: false,
|
|
3229
|
-
providers: true
|
|
3230
|
-
});
|
|
3231
|
-
this.map.whenReady(() => {
|
|
3232
|
-
this.mapReady.set(true);
|
|
3233
|
-
});
|
|
3234
|
-
}
|
|
3235
|
-
// Loads data only after:
|
|
3236
|
-
// - the Leaflet map is ready
|
|
3237
|
-
// - Angular has emitted query params (may be empty)
|
|
3238
|
-
// - Angular has emitted route params (may be empty)
|
|
3239
|
-
tryLoad() {
|
|
3240
|
-
if (!this.mapReady() || !this.hasQueryParams || !this.hasUrlParams) {
|
|
3241
|
-
return;
|
|
3242
|
-
}
|
|
3243
|
-
const params = { ...this.queryParams };
|
|
3244
|
-
this.hasBox = params.bbox ? true : false;
|
|
3245
|
-
if (this.urlParams.has('taxonId')) {
|
|
3246
|
-
params.taxonId = this.urlParams.get('taxonId');
|
|
3247
|
-
}
|
|
3248
|
-
this.loadFeature(params);
|
|
3249
|
-
}
|
|
3250
|
-
ngOnInit() {
|
|
3251
|
-
this.subscriptions.add(this.activatedRoute.queryParams.subscribe(q => {
|
|
3252
|
-
this.queryParams = q ?? {};
|
|
3253
|
-
this.hasQueryParams = true;
|
|
3254
|
-
this.tryLoad();
|
|
3255
|
-
}));
|
|
3256
|
-
this.subscriptions.add(this.activatedRoute.paramMap.subscribe(p => {
|
|
3257
|
-
this.urlParams = p;
|
|
3258
|
-
this.hasUrlParams = true;
|
|
3259
|
-
this.tryLoad();
|
|
3260
|
-
}));
|
|
3261
|
-
}
|
|
3262
|
-
loadFeature(qParams) {
|
|
3263
|
-
this.mapLoading.set(true);
|
|
3264
|
-
this.error = null;
|
|
3265
|
-
const url = this.config.observationFeatures;
|
|
3266
|
-
this.subscriptions.add(this.http.get(url, { observe: 'response', params: qParams }).
|
|
3267
|
-
pipe(finalize(() => {
|
|
3268
|
-
this.mapLoading.set(false);
|
|
3269
|
-
})).
|
|
3270
|
-
subscribe({
|
|
3271
|
-
next: (response) => {
|
|
3272
|
-
if (!response.body) {
|
|
3273
|
-
throw new Error('No GeoJson body');
|
|
3274
|
-
}
|
|
3275
|
-
const geo = response.body;
|
|
3276
|
-
geo.properties = { count: response.headers.get('X-Observations-TotalCount') };
|
|
3277
|
-
this.buildMap(geo);
|
|
3278
|
-
}, error: err => {
|
|
3279
|
-
this.error = err;
|
|
3280
|
-
}
|
|
3281
|
-
}));
|
|
3282
|
-
}
|
|
3283
|
-
buildMap(geojson) {
|
|
3284
|
-
if (this.siteLayer) {
|
|
3285
|
-
this.map.removeLayer(this.siteLayer);
|
|
3286
|
-
}
|
|
3287
|
-
this.count = geojson?.properties?.count;
|
|
3288
|
-
this.siteLayer = Leaflet.geoJson(geojson, {
|
|
3289
|
-
style: (feature) => {
|
|
3290
|
-
return {
|
|
3291
|
-
className: `svg ${this.getPolygonClassName(feature.properties)}`, // Leaflet applies this class to the SVG path
|
|
3292
|
-
weight: 1,
|
|
3293
|
-
fillOpacity: 0.8,
|
|
3294
|
-
};
|
|
3295
|
-
},
|
|
3296
|
-
pointToLayer: (feature, latlng) => {
|
|
3297
|
-
const marker = Leaflet.marker(latlng, {
|
|
3298
|
-
icon: Leaflet.divIcon({
|
|
3299
|
-
className: '',
|
|
3300
|
-
html: '<div class="adb-map-marker"></div>',
|
|
3301
|
-
iconAnchor: [3, 3]
|
|
3302
|
-
})
|
|
3303
|
-
});
|
|
3304
|
-
// if (feature.properties && feature.properties['Occurrence.OccurrenceId']) {
|
|
3305
|
-
// marker.on('click', () => {
|
|
3306
|
-
// window.location.href = this.config.observationPage + '/' + feature.properties['Occurrence.OccurrenceId'];
|
|
3307
|
-
// });
|
|
3308
|
-
// }
|
|
3309
|
-
return marker;
|
|
3310
|
-
}, onEachFeature: (feature, layer) => {
|
|
3311
|
-
if (feature.geometry.type === "Polygon" ||
|
|
3312
|
-
feature.geometry.type === "MultiPolygon") {
|
|
3313
|
-
layer.setStyle({ interactive: false });
|
|
3314
|
-
// if (feature.properties.ObservationsCount > 0) {
|
|
3315
|
-
// layer.on('click', () => {
|
|
3316
|
-
// const boundBox = JSON.stringify(this.getMapBoundsToBbox(layer.getBounds()));
|
|
3317
|
-
// this.router.navigate([], { queryParams: { bbox: boundBox }, queryParamsHandling: 'merge' });
|
|
3318
|
-
// });
|
|
3319
|
-
// layer.on('mouseover', () => {
|
|
3320
|
-
// layer.setStyle({ className: 'svg cursor-pointer' });
|
|
3321
|
-
// });
|
|
3322
|
-
// layer.on('mouseout', () => {
|
|
3323
|
-
// layer.setStyle({ className: 'svg' });
|
|
3324
|
-
// });
|
|
3325
|
-
// }
|
|
3326
|
-
// if (feature.properties.FeatureType) { //area
|
|
3327
|
-
// layer.setStyle({ interactive: false });
|
|
3328
|
-
// }
|
|
3329
|
-
}
|
|
3330
|
-
}
|
|
3331
|
-
});
|
|
3332
|
-
const circleLayer = Leaflet.featureGroup();
|
|
3333
|
-
circleLayer.addTo(this.siteLayer);
|
|
3334
|
-
this.map.addLayer(this.siteLayer);
|
|
3335
|
-
if (geojson.bbox) {
|
|
3336
|
-
const [minLon, minLat, maxLon, maxLat] = geojson.bbox;
|
|
3337
|
-
const bounds = Leaflet.latLngBounds([[minLat, minLon], [maxLat, maxLon]]);
|
|
3338
|
-
if (bounds.isValid()) {
|
|
3339
|
-
// Safari sometimes needs extra time after layer adds
|
|
3340
|
-
setTimeout(() => {
|
|
3341
|
-
this.map.invalidateSize({ animate: false });
|
|
3342
|
-
this.map.fitBounds(bounds, { animate: false });
|
|
3343
|
-
}, 50); // 30–50ms works best in Safari
|
|
3344
|
-
}
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
getPolygonClassName(props) {
|
|
3348
|
-
if (props.FeatureType) {
|
|
3349
|
-
return 'map-area';
|
|
3350
|
-
}
|
|
3351
|
-
if (props.ObservationsCount < 10)
|
|
3352
|
-
return 'map-heat-low';
|
|
3353
|
-
if (props.ObservationsCount < 500)
|
|
3354
|
-
return 'map-heat-small';
|
|
3355
|
-
return 'map-heat-high';
|
|
3356
|
-
}
|
|
3357
|
-
getMapBoundsToBbox(bounds) {
|
|
3358
|
-
return [bounds.getNorthWest().lat, bounds.getNorthWest().lng, bounds.getSouthEast().lat, bounds.getSouthEast().lng];
|
|
3359
|
-
}
|
|
3360
|
-
ngOnDestroy() {
|
|
3361
|
-
this.subscriptions.unsubscribe();
|
|
3362
|
-
}
|
|
3363
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbObsMapComponent, deps: [{ token: i1.ActivatedRoute }, { token: AdbMapConfigService }, { token: i1.Router }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3364
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: AdbObsMapComponent, isStandalone: false, selector: "adb-obs-map", ngImport: i0, template: "<!-- @if(hasBox&&!mapLoading()){\r\n<div class=\"mb-1 d-flex justify-content-between flex-wrap\">\r\n <a [routerLink]=\"[]\" [queryParams]=\"{bbox:null,z:null}\" queryParamsHandling=\"merge\" class=\"d-flex gap-1 align-items-baseline\">\r\n <span class=\"fas fa-chevron-left\"></span>\r\n Tillbaka upp\r\n </a>\r\n</div>\r\n} -->\r\n@if(error){\r\n<div class=\"alert alert-danger\">\r\n {{'ERROR.SERVER_ERROR'|translate}}\r\n</div>\r\n}\r\n<div [class.loading]=\"mapLoading()\">\r\n <div [id]=\"mapId\" class=\"mb-1 map-container\"></div>\r\n</div>\r\n<div class=\"mb-1 d-flex gap-3 justify-content-between flex-wrap\">\r\n @if (!mapLoading()&&count) {\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-low\"></div>\r\n <10\r\n </div>\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-medium\"></div>\r\n 10 - 500\r\n </div>\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-high\"></div>\r\n >500\r\n </div>\r\n <div class=\"ms-auto\">\r\n {{count|adbSpacing}} {{'OBSERVATION.OBSERVATIONS'|translate}}\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: NumberSpacingPipe, name: "adbSpacing" }] }); }
|
|
3365
|
-
}
|
|
3366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbObsMapComponent, decorators: [{
|
|
3367
|
-
type: Component,
|
|
3368
|
-
args: [{ selector: 'adb-obs-map', standalone: false, template: "<!-- @if(hasBox&&!mapLoading()){\r\n<div class=\"mb-1 d-flex justify-content-between flex-wrap\">\r\n <a [routerLink]=\"[]\" [queryParams]=\"{bbox:null,z:null}\" queryParamsHandling=\"merge\" class=\"d-flex gap-1 align-items-baseline\">\r\n <span class=\"fas fa-chevron-left\"></span>\r\n Tillbaka upp\r\n </a>\r\n</div>\r\n} -->\r\n@if(error){\r\n<div class=\"alert alert-danger\">\r\n {{'ERROR.SERVER_ERROR'|translate}}\r\n</div>\r\n}\r\n<div [class.loading]=\"mapLoading()\">\r\n <div [id]=\"mapId\" class=\"mb-1 map-container\"></div>\r\n</div>\r\n<div class=\"mb-1 d-flex gap-3 justify-content-between flex-wrap\">\r\n @if (!mapLoading()&&count) {\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-low\"></div>\r\n <10\r\n </div>\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-medium\"></div>\r\n 10 - 500\r\n </div>\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <div class=\"legend map-heat-high\"></div>\r\n >500\r\n </div>\r\n <div class=\"ms-auto\">\r\n {{count|adbSpacing}} {{'OBSERVATION.OBSERVATIONS'|translate}}\r\n </div>\r\n }\r\n</div>" }]
|
|
3369
|
-
}], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: AdbMapConfigService }, { type: i1.Router }, { type: i1$2.HttpClient }] });
|
|
3370
|
-
|
|
3371
|
-
const DateTypes = {
|
|
3372
|
-
THIS_YEAR: '1',
|
|
3373
|
-
LAST_YEAR: '2',
|
|
3374
|
-
ALL_YEAR: '3',
|
|
3375
|
-
LAST_5_YEAR: '4',
|
|
3376
|
-
LAST_25_YEAR: '5',
|
|
3377
|
-
CUSTOM: '6',
|
|
3378
|
-
};
|
|
3379
|
-
|
|
3380
|
-
class AdbMapFilters {
|
|
3381
|
-
static { this.datasets = ['1', '3', '5', '6', '4', '8']; }
|
|
3382
|
-
constructor(cdr, config, http, router, activatedRoute) {
|
|
3383
|
-
this.cdr = cdr;
|
|
3384
|
-
this.config = config;
|
|
3385
|
-
this.http = http;
|
|
3386
|
-
this.router = router;
|
|
3387
|
-
this.activatedRoute = activatedRoute;
|
|
3388
|
-
this.inline = false;
|
|
3389
|
-
this.artfakta = this.config.artfaktaTaxonLists;
|
|
3390
|
-
this.subscriptions = new Subscription();
|
|
3391
|
-
this.thisYear = new Date();
|
|
3392
|
-
this.lastYear = addYears(new Date(), -1);
|
|
3393
|
-
this.filters = config.filters;
|
|
3394
|
-
}
|
|
3395
|
-
ngOnInit() {
|
|
3396
|
-
const lists$ = this.http.get(this.config.taxaListsApi);
|
|
3397
|
-
const combined$ = combineLatest([this.activatedRoute.paramMap, this.activatedRoute.queryParamMap, lists$])
|
|
3398
|
-
.pipe(map$1(results => ({ params: results[0], qParams: results[1], lists: results[2] })), debounceTime$1(0));
|
|
3399
|
-
this.subscriptions.add(combined$.subscribe(result => {
|
|
3400
|
-
this.form = this.createForm(result.params, result.qParams, result.lists);
|
|
3401
|
-
this.cdr.markForCheck();
|
|
3402
|
-
}));
|
|
3403
|
-
}
|
|
3404
|
-
removeArea(index) {
|
|
3405
|
-
this.form.get('areas').removeAt(index);
|
|
3406
|
-
this.form.markAsDirty();
|
|
3407
|
-
}
|
|
3408
|
-
addArea() {
|
|
3409
|
-
const areas = this.form.get('areas');
|
|
3410
|
-
areas.push(new FormControl(null));
|
|
3411
|
-
this.form.updateValueAndValidity();
|
|
3412
|
-
this.form.markAsDirty();
|
|
3413
|
-
}
|
|
3414
|
-
onSubmit() {
|
|
3415
|
-
const data = this.form.value;
|
|
3416
|
-
let params = {};
|
|
3417
|
-
params.p = data.period ?? null;
|
|
3418
|
-
if (data.period === DateTypes.THIS_YEAR) {
|
|
3419
|
-
params.startAt = startOfYear(this.thisYear).toISOString();
|
|
3420
|
-
params.endAt = null;
|
|
3421
|
-
}
|
|
3422
|
-
else if (data.period === DateTypes.LAST_YEAR) {
|
|
3423
|
-
params.startAt = startOfYear(this.lastYear).toISOString();
|
|
3424
|
-
params.endAt = endOfYear(this.lastYear).toISOString();
|
|
3425
|
-
}
|
|
3426
|
-
else if (data.period === DateTypes.ALL_YEAR) {
|
|
3427
|
-
params.startAt = null;
|
|
3428
|
-
params.endAt = null;
|
|
3429
|
-
params.p = null;
|
|
3430
|
-
}
|
|
3431
|
-
else if (data.period === DateTypes.LAST_5_YEAR) {
|
|
3432
|
-
params.startAt = startOfYear(addYears(new Date(), -5)).toISOString();
|
|
3433
|
-
params.endAt = null;
|
|
3434
|
-
}
|
|
3435
|
-
else if (data.period === DateTypes.LAST_25_YEAR) {
|
|
3436
|
-
params.startAt = startOfYear(addYears(new Date(), -25)).toISOString();
|
|
3437
|
-
params.endAt = null;
|
|
3438
|
-
}
|
|
3439
|
-
else if (data.period === DateTypes.CUSTOM) {
|
|
3440
|
-
params.startAt = startOfDay(data.startAt).toISOString();
|
|
3441
|
-
params.endAt = endOfDay(data.endAt).toISOString();
|
|
3442
|
-
}
|
|
3443
|
-
if (this.hasOwnArea && data.geo) {
|
|
3444
|
-
params.geo = JSON.stringify(data.geo.geometry?.coordinates[0]);
|
|
3445
|
-
}
|
|
3446
|
-
const cleaned = data.areas?.filter(v => v != null && v !== '');
|
|
3447
|
-
if (cleaned.length > 0) {
|
|
3448
|
-
params.area = cleaned;
|
|
3449
|
-
}
|
|
3450
|
-
if (this.activatedRoute.snapshot.paramMap.has('taxonId')) {
|
|
3451
|
-
params.taxonId = this.activatedRoute.snapshot.paramMap.get('taxonId');
|
|
3452
|
-
}
|
|
3453
|
-
else {
|
|
3454
|
-
params.taxonId = data.taxonId ?? null;
|
|
3455
|
-
}
|
|
3456
|
-
if (data.list?.length > 0) {
|
|
3457
|
-
params.list = data.list;
|
|
3458
|
-
}
|
|
3459
|
-
if (data.ds?.length > 0) {
|
|
3460
|
-
const selected = data.ds.filter(f => f.selected).map(m => m.id);
|
|
3461
|
-
params.ds = selected.length ? selected : null;
|
|
3462
|
-
}
|
|
3463
|
-
this.router.navigate([], { queryParams: params, relativeTo: this.activatedRoute });
|
|
3464
|
-
}
|
|
3465
|
-
createForm(params, qMap, lists) {
|
|
3466
|
-
this.hasTaxonInUrlParameter = params.has('taxonId');
|
|
3467
|
-
this.hasOwnArea = qMap.has('geo') && this.filters.showOwnArea;
|
|
3468
|
-
const areas = qMap.getAll('area').filter(a => a != null && a.trim() !== '' && a.includes('-'));
|
|
3469
|
-
const form = new FormGroup({
|
|
3470
|
-
period: new FormControl(qMap.has('p') ? qMap.get('p') : '3'),
|
|
3471
|
-
areas: new FormArray((Array.isArray(areas) && areas.length ? areas : [null]).map(a => new FormControl(a))),
|
|
3472
|
-
geo: new FormControl(qMap.has('geo') ? {
|
|
3473
|
-
type: 'Feature',
|
|
3474
|
-
geometry: { type: 'Polygon', coordinates: [JSON.parse(qMap.get('geo'))] }
|
|
3475
|
-
} : null)
|
|
3476
|
-
});
|
|
3477
|
-
this.areasArray = form.get('areas');
|
|
3478
|
-
this.periodCount = qMap.has('p') && qMap.get('p') !== '3' ? 1 : 0;
|
|
3479
|
-
this.areaCount = areas?.length;
|
|
3480
|
-
if (!this.hasTaxonInUrlParameter) {
|
|
3481
|
-
form.addControl('taxonId', new FormControl(qMap.get('taxonId') ?? null));
|
|
3482
|
-
const selectedTaxonList = qMap.has('list') ? qMap.getAll('list').map(val => Number(val)).filter(val => !isNaN(val)) : null;
|
|
3483
|
-
this.taxaLists = lists;
|
|
3484
|
-
this.taxonListCount = selectedTaxonList?.length;
|
|
3485
|
-
form.addControl('list', new FormControl(selectedTaxonList));
|
|
3486
|
-
let datasets = qMap.has('ds') ? (Array.isArray(qMap.getAll('ds')) ? qMap.getAll('ds') : [qMap.get('ds')]) : null;
|
|
3487
|
-
this.dataSetCount = datasets?.length;
|
|
3488
|
-
form.addControl('ds', new FormArray(AdbMapFilters.datasets.map(id => new FormGroup({
|
|
3489
|
-
id: new FormControl(id),
|
|
3490
|
-
selected: new FormControl(datasets?.includes(id))
|
|
3491
|
-
}))));
|
|
3492
|
-
this.dsControls = form.get('ds').controls;
|
|
3493
|
-
}
|
|
3494
|
-
this.updateCustomDate(form, qMap.get('p'), qMap);
|
|
3495
|
-
this.subscriptions.add(form.get('period').valueChanges.subscribe(period => {
|
|
3496
|
-
this.updateCustomDate(form, period, qMap);
|
|
3497
|
-
}));
|
|
3498
|
-
return form;
|
|
3499
|
-
}
|
|
3500
|
-
updateCustomDate(form, period, qMap) {
|
|
3501
|
-
if (form.contains('startAt')) {
|
|
3502
|
-
form.removeControl('startAt');
|
|
3503
|
-
}
|
|
3504
|
-
if (form.contains('endAt')) {
|
|
3505
|
-
form.removeControl('endAt');
|
|
3506
|
-
}
|
|
3507
|
-
if (period === DateTypes.CUSTOM) {
|
|
3508
|
-
let start = qMap.has('startAt') ? parseISO(qMap.get('startAt')) : null;
|
|
3509
|
-
let end = qMap.has('endAt') ? parseISO(qMap.get('endAt')) : null;
|
|
3510
|
-
if (qMap.get('p') !== DateTypes.CUSTOM) {
|
|
3511
|
-
start = new Date();
|
|
3512
|
-
end = new Date();
|
|
3513
|
-
}
|
|
3514
|
-
this.dateStartConfig = { maxDate: end ?? new Date() };
|
|
3515
|
-
this.dateEndConfig = { minDate: start ?? null, maxDate: new Date() };
|
|
3516
|
-
const startControl = new FormControl(start, Validators.required);
|
|
3517
|
-
const endControl = new FormControl(end, Validators.required);
|
|
3518
|
-
form.addControl('startAt', startControl);
|
|
3519
|
-
form.addControl('endAt', endControl);
|
|
3520
|
-
this.subscriptions.add(startControl.valueChanges.subscribe(startAt => {
|
|
3521
|
-
this.dateEndConfig = { minDate: startAt ?? null, maxDate: new Date() };
|
|
3522
|
-
}));
|
|
3523
|
-
this.subscriptions.add(endControl.valueChanges.subscribe(endAt => {
|
|
3524
|
-
this.dateStartConfig = { maxDate: endAt ?? new Date() };
|
|
3525
|
-
}));
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
ngOnDestroy() {
|
|
3529
|
-
this.subscriptions.unsubscribe();
|
|
3530
|
-
}
|
|
3531
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapFilters, deps: [{ token: i0.ChangeDetectorRef }, { token: AdbMapConfigService }, { token: i1$2.HttpClient }, { token: i1.Router }, { token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3532
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: AdbMapFilters, isStandalone: false, selector: "adb-map-filters", inputs: { inline: "inline" }, ngImport: i0, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateStartConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateEndConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\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()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.showTaxaLists){\r\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\r\n <div class=\"mb-3\">\r\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\r\n </div>\r\n {{'LISTS.READ_MORE'|translate}}\r\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\r\n </adb-filter-section>\r\n }\r\n @if(filters.showDatasets){\r\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\r\n @if (form.get('ds')) {\r\n <div formArrayName=\"ds\">\r\n @for (item of dsControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n }\r\n </div>\r\n <div class=\"d-flex justify-content-end gap-2\">\r\n @if (inline) {\r\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\r\n {{'CANCEL'|translate}}\r\n </a>\r\n }\r\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"form.invalid||form.pristine\">{{'FILTER'|translate}}</button>\r\n </div>\r\n</form>\r\n}", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: AdbDatePickerDirective, selector: "input[adbDatepicker]", inputs: ["format", "toLeft", "settings"], outputs: ["adbBlur"] }, { kind: "component", type: FilterSectionComponent, selector: "adb-filter-section", inputs: ["titleResource", "helpResource", "count", "expanded", "lazy"] }, { kind: "component", type: AdbAreaPickerComponent, selector: "adb-area-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: AdbTaxonPickerComponent, selector: "adb-taxon-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: PolygonDrawerInput, selector: "adb-polygon-drawer" }, { kind: "component", type: TreeviewComponent, selector: "app-treeview", inputs: ["nodes"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3533
|
-
}
|
|
3534
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapFilters, decorators: [{
|
|
3535
|
-
type: Component,
|
|
3536
|
-
args: [{ selector: 'adb-map-filters', standalone: false, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateStartConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateEndConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\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()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.showTaxaLists){\r\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\r\n <div class=\"mb-3\">\r\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\r\n </div>\r\n {{'LISTS.READ_MORE'|translate}}\r\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\r\n </adb-filter-section>\r\n }\r\n @if(filters.showDatasets){\r\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\r\n @if (form.get('ds')) {\r\n <div formArrayName=\"ds\">\r\n @for (item of dsControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n }\r\n </div>\r\n <div class=\"d-flex justify-content-end gap-2\">\r\n @if (inline) {\r\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\r\n {{'CANCEL'|translate}}\r\n </a>\r\n }\r\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"form.invalid||form.pristine\">{{'FILTER'|translate}}</button>\r\n </div>\r\n</form>\r\n}" }]
|
|
3537
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: AdbMapConfigService }, { type: i1$2.HttpClient }, { type: i1.Router }, { type: i1.ActivatedRoute }], propDecorators: { inline: [{
|
|
3538
|
-
type: Input
|
|
3539
|
-
}] } });
|
|
3540
|
-
|
|
3541
|
-
class AdbMapModule {
|
|
3542
|
-
static forRoot(config) {
|
|
3543
|
-
return {
|
|
3544
|
-
ngModule: AdbMapModule,
|
|
3545
|
-
providers: [
|
|
3546
|
-
{
|
|
3547
|
-
provide: ADB_MAP_CONFIG,
|
|
3548
|
-
useValue: config
|
|
3549
|
-
}
|
|
3550
|
-
]
|
|
3551
|
-
};
|
|
3552
|
-
}
|
|
3553
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3554
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: AdbMapModule, declarations: [AdbObsMapComponent,
|
|
3555
|
-
PolygonDrawerInput,
|
|
3556
|
-
AdbMapFilters,
|
|
3557
|
-
TreeviewComponent], imports: [CommonModule,
|
|
3558
|
-
FormsModule,
|
|
3559
|
-
RouterModule,
|
|
3560
|
-
ReactiveFormsModule,
|
|
3561
|
-
AdbDatePickerModule, i1$1.TranslateModule, AdbPipesModule,
|
|
3562
|
-
AdbFilterSectionModule,
|
|
3563
|
-
AdbPickerModule], exports: [AdbObsMapComponent,
|
|
3564
|
-
PolygonDrawerInput,
|
|
3565
|
-
AdbMapFilters] }); }
|
|
3566
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapModule, providers: [
|
|
3567
|
-
AdbMapConfigService
|
|
3568
|
-
], imports: [CommonModule,
|
|
3569
|
-
FormsModule,
|
|
3570
|
-
RouterModule,
|
|
3571
|
-
ReactiveFormsModule,
|
|
3572
|
-
AdbDatePickerModule,
|
|
3573
|
-
TranslateModule.forChild(),
|
|
3574
|
-
AdbPipesModule,
|
|
3575
|
-
AdbFilterSectionModule,
|
|
3576
|
-
AdbPickerModule] }); }
|
|
3577
|
-
}
|
|
3578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AdbMapModule, decorators: [{
|
|
3579
|
-
type: NgModule,
|
|
3580
|
-
args: [{
|
|
3581
|
-
imports: [
|
|
3582
|
-
CommonModule,
|
|
3583
|
-
FormsModule,
|
|
3584
|
-
RouterModule,
|
|
3585
|
-
ReactiveFormsModule,
|
|
3586
|
-
AdbDatePickerModule,
|
|
3587
|
-
TranslateModule.forChild(),
|
|
3588
|
-
AdbPipesModule,
|
|
3589
|
-
AdbFilterSectionModule,
|
|
3590
|
-
AdbPickerModule
|
|
3591
|
-
],
|
|
3592
|
-
declarations: [
|
|
3593
|
-
AdbObsMapComponent,
|
|
3594
|
-
PolygonDrawerInput,
|
|
3595
|
-
AdbMapFilters,
|
|
3596
|
-
TreeviewComponent,
|
|
3597
|
-
// Stats,
|
|
3598
|
-
// AdbGeojsonPolygonDirective
|
|
3599
|
-
],
|
|
3600
|
-
exports: [
|
|
3601
|
-
AdbObsMapComponent,
|
|
3602
|
-
PolygonDrawerInput,
|
|
3603
|
-
AdbMapFilters,
|
|
3604
|
-
// Stats,
|
|
3605
|
-
// AdbGeojsonPolygonDirective
|
|
3606
|
-
],
|
|
3607
|
-
providers: [
|
|
3608
|
-
AdbMapConfigService
|
|
3609
|
-
]
|
|
3610
|
-
}]
|
|
3611
|
-
}] });
|
|
3612
|
-
|
|
3613
2944
|
/*
|
|
3614
|
-
* Public API Surface of
|
|
2945
|
+
* Public API Surface of adb-shared
|
|
3615
2946
|
*/
|
|
3616
2947
|
|
|
3617
2948
|
/**
|
|
3618
2949
|
* Generated bundle index. Do not edit.
|
|
3619
2950
|
*/
|
|
3620
2951
|
|
|
3621
|
-
export {
|
|
2952
|
+
export { ADB_PICKER_CONFIG, ADB_USER_SERVICE_CONFIG, AdbAreaPickerComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdown2Directive, AdbDropdownDirective, AdbDropdownModule, AdbFilterSectionModule, AdbHelpButtonComponent, AdbModalModule, AdbModalService, AdbPagersModule, AdbPickerConfigService, AdbPickerModule, AdbPipesModule, AdbRichEditorComponent, AdbRichEditorModule, AdbTaxonPickerComponent, AdbToast, AdbToastModule, AdbToastService, AdbUserInterceptor, AdbUserModule, AdbUserService, ArtportalenFooterComponent, ArtportalenNavComponent, ArtportalenNavModule, AuthCallbackComponent, ClickOutsideDirective, DEFAULT_ADB_USER_SERVICE_CONFIG, EmptyValuePipe, EnvironmentService, FileUploadDirective, FilterSectionComponent, FocusDirective, GenericPickerComponent, HighlightHtmlPipe, HighlightPipe, ImageLoaderDirective, InfiniteScrollComponent, LocaleDatePipe, NumberSpacingPipe, PagerComponent, PagerInlineComponent, RedListBadgeClassDirective, RichTextComponent, RiskClassDirective, RouterLinkActiveFragmentDirective, ToastType, UserModuleConstants };
|
|
3622
2953
|
//# sourceMappingURL=adb-shared.mjs.map
|