adb-shared 5.0.38 → 5.0.39
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/{esm2020 → esm2022}/lib/components/adb-artportalen-nav/adb-artportalen-footer.component.mjs +4 -4
- package/esm2022/lib/components/adb-artportalen-nav/adb-artportalen-nav.component.mjs +112 -0
- package/esm2022/lib/components/adb-artportalen-nav/adb-artportalen-nav.module.mjs +66 -0
- package/{esm2020 → esm2022}/lib/components/adb-artportalen-nav/environment.service.mjs +4 -4
- package/esm2022/lib/components/adb-buttons/adb-buttons.module.mjs +19 -0
- package/{esm2020 → esm2022}/lib/components/adb-buttons/help-button.component.mjs +6 -6
- package/esm2022/lib/components/adb-confirm-modal/adb-confirm-modal.mjs +22 -0
- package/esm2022/lib/components/adb-confirm-modal/adb-modal.module.mjs +23 -0
- package/esm2022/lib/components/adb-confirm-modal/adb-modal.service.mjs +46 -0
- package/{esm2020 → esm2022}/lib/components/adb-dropdown/adb-dropdown.directive.mjs +4 -4
- package/esm2022/lib/components/adb-dropdown/adb-dropdown.module.mjs +23 -0
- package/{esm2020 → esm2022}/lib/components/adb-dropdown/adb-dropdown.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/adb-header/adb-footer.component.mjs +4 -4
- package/esm2022/lib/components/adb-header/adb-header.module.mjs +58 -0
- package/esm2022/lib/components/adb-header/adb-nav.component.mjs +115 -0
- package/{esm2020 → esm2022}/lib/components/adb-header/environment.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/adb-toast/adb-toast.mjs +4 -4
- package/esm2022/lib/components/adb-toast/adb-toast.module.mjs +23 -0
- package/{esm2020 → esm2022}/lib/components/adb-toast/adb-toast.service.mjs +4 -4
- package/esm2022/lib/components/date-picker/adb-date-picker.component.mjs +180 -0
- package/{esm2020 → esm2022}/lib/components/date-picker/adb-date-picker.directive.mjs +12 -12
- package/esm2022/lib/components/date-picker/adb-date-picker.module.mjs +25 -0
- package/{esm2020 → esm2022}/lib/components/date-picker/adb-date-picker.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/pagers/infinite-scroll.component.mjs +4 -4
- package/esm2022/lib/components/pagers/pager-base.directive.mjs +57 -0
- package/{esm2020 → esm2022}/lib/components/pagers/pager-inline.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/pagers/pager.mjs +4 -4
- package/esm2022/lib/components/pagers/pagers.module.mjs +26 -0
- package/{esm2020 → esm2022}/lib/directives/click-outside.directive.mjs +4 -4
- package/esm2022/lib/directives/directives.module.mjs +20 -0
- package/{esm2020 → esm2022}/lib/directives/file-upload.directive.mjs +4 -4
- package/{esm2020 → esm2022}/lib/directives/focus.directive.mjs +7 -7
- package/{esm2020 → esm2022}/lib/directives/redlist-badge-class.directive.mjs +4 -4
- package/{esm2020 → esm2022}/lib/pipes/date.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/pipes/emptyValue.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/pipes/highlight.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/pipes/number-spacing.pipe.mjs +4 -4
- package/esm2022/lib/pipes/pipes.module.mjs +20 -0
- package/{fesm2020 → fesm2022}/adb-shared.mjs +185 -189
- package/{fesm2020 → fesm2022}/adb-shared.mjs.map +1 -1
- package/lib/components/adb-artportalen-nav/adb-artportalen-footer.component.d.ts +1 -1
- package/lib/components/adb-artportalen-nav/adb-artportalen-nav.component.d.ts +1 -1
- package/lib/components/adb-buttons/help-button.component.d.ts +1 -1
- package/lib/components/adb-confirm-modal/adb-confirm-modal.d.ts +1 -1
- package/lib/components/adb-confirm-modal/adb-modal.service.d.ts +1 -2
- package/lib/components/adb-dropdown/adb-dropdown.directive.d.ts +1 -1
- package/lib/components/adb-header/adb-footer.component.d.ts +1 -1
- package/lib/components/adb-header/adb-nav.component.d.ts +1 -1
- package/lib/components/adb-toast/adb-toast.d.ts +1 -1
- package/lib/components/date-picker/adb-date-picker.component.d.ts +1 -1
- package/lib/components/date-picker/adb-date-picker.directive.d.ts +1 -1
- package/lib/components/pagers/infinite-scroll.component.d.ts +1 -1
- package/lib/components/pagers/pager-base.directive.d.ts +1 -1
- package/lib/components/pagers/pager-inline.d.ts +1 -1
- package/lib/components/pagers/pager.d.ts +1 -1
- package/lib/directives/click-outside.directive.d.ts +1 -1
- package/lib/directives/file-upload.directive.d.ts +1 -1
- package/lib/directives/focus.directive.d.ts +1 -1
- package/lib/directives/redlist-badge-class.directive.d.ts +1 -1
- package/lib/pipes/date.pipe.d.ts +1 -1
- package/lib/pipes/emptyValue.pipe.d.ts +1 -1
- package/lib/pipes/highlight.pipe.d.ts +1 -1
- package/lib/pipes/number-spacing.pipe.d.ts +1 -1
- package/package.json +12 -18
- package/esm2020/lib/components/adb-artportalen-nav/adb-artportalen-nav.component.mjs +0 -112
- package/esm2020/lib/components/adb-artportalen-nav/adb-artportalen-nav.module.mjs +0 -68
- package/esm2020/lib/components/adb-buttons/adb-buttons.module.mjs +0 -19
- package/esm2020/lib/components/adb-confirm-modal/adb-confirm-modal.mjs +0 -22
- package/esm2020/lib/components/adb-confirm-modal/adb-modal.module.mjs +0 -23
- package/esm2020/lib/components/adb-confirm-modal/adb-modal.service.mjs +0 -44
- package/esm2020/lib/components/adb-dropdown/adb-dropdown.module.mjs +0 -23
- package/esm2020/lib/components/adb-header/adb-header.module.mjs +0 -60
- package/esm2020/lib/components/adb-header/adb-nav.component.mjs +0 -115
- package/esm2020/lib/components/adb-toast/adb-toast.module.mjs +0 -23
- package/esm2020/lib/components/date-picker/adb-date-picker.component.mjs +0 -180
- package/esm2020/lib/components/date-picker/adb-date-picker.module.mjs +0 -25
- package/esm2020/lib/components/pagers/pager-base.directive.mjs +0 -57
- package/esm2020/lib/components/pagers/pagers.module.mjs +0 -28
- package/esm2020/lib/directives/directives.module.mjs +0 -20
- package/esm2020/lib/pipes/pipes.module.mjs +0 -20
- package/fesm2015/adb-shared.mjs +0 -1617
- package/fesm2015/adb-shared.mjs.map +0 -1
- /package/{esm2020 → esm2022}/adb-shared.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/components/adb-artportalen-nav/navigation.model.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/components/adb-header/navigation.model.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{adb-shared.d.ts → index.d.ts} +0 -0
package/fesm2015/adb-shared.mjs
DELETED
|
@@ -1,1617 +0,0 @@
|
|
|
1
|
-
import * as i2$1 from '@angular/common';
|
|
2
|
-
import { CommonModule, DatePipe, formatDate } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Inject, EventEmitter, Directive, Output, HostListener, Input, HostBinding, NgModule, Component, Pipe, forwardRef } from '@angular/core';
|
|
5
|
-
import * as i3 from '@ngx-translate/core';
|
|
6
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
-
import * as i1 from '@angular/common/http';
|
|
8
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
9
|
-
import * as i2 from '@angular/router';
|
|
10
|
-
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
11
|
-
import { Subscription, Subject, of } from 'rxjs';
|
|
12
|
-
import { startOfDay, subYears, endOfDay, addYears, getMonth, subMonths, addMonths, isSameYear, startOfMonth, endOfMonth, eachWeekOfInterval, getISOWeek, addDays, eachDayOfInterval, getHours, getMinutes, isSameDay, isSameMonth, isWithinInterval, isValid, parseISO } from 'date-fns';
|
|
13
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
14
|
-
import { delay } from 'rxjs/operators';
|
|
15
|
-
|
|
16
|
-
class EnvironmentService$1 {
|
|
17
|
-
constructor(environment) {
|
|
18
|
-
this.environment = environment;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/** @nocollapse */ EnvironmentService$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService$1, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
-
/** @nocollapse */ EnvironmentService$1.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService$1 });
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService$1, decorators: [{
|
|
24
|
-
type: Injectable
|
|
25
|
-
}], ctorParameters: function () {
|
|
26
|
-
return [{ type: undefined, decorators: [{
|
|
27
|
-
type: Inject,
|
|
28
|
-
args: ['env']
|
|
29
|
-
}] }];
|
|
30
|
-
} });
|
|
31
|
-
|
|
32
|
-
class ClickOutsideDirective {
|
|
33
|
-
constructor(elementRef) {
|
|
34
|
-
this.elementRef = elementRef;
|
|
35
|
-
this.adbClickOutside = new EventEmitter();
|
|
36
|
-
}
|
|
37
|
-
onClick(target) {
|
|
38
|
-
const clickedInside = this.elementRef.nativeElement.contains(target);
|
|
39
|
-
if (!clickedInside) {
|
|
40
|
-
this.adbClickOutside.emit(target);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/** @nocollapse */ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
45
|
-
/** @nocollapse */ ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: { adbClickOutside: "adbClickOutside" }, host: { listeners: { "document:click": "onClick($event.target)" } }, ngImport: i0 });
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
47
|
-
type: Directive,
|
|
48
|
-
args: [{
|
|
49
|
-
selector: '[adbClickOutside]',
|
|
50
|
-
}]
|
|
51
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { adbClickOutside: [{
|
|
52
|
-
type: Output
|
|
53
|
-
}], onClick: [{
|
|
54
|
-
type: HostListener,
|
|
55
|
-
args: ['document:click', ['$event.target']]
|
|
56
|
-
}] } });
|
|
57
|
-
|
|
58
|
-
class FileUploadDirective {
|
|
59
|
-
constructor(el) {
|
|
60
|
-
this.el = el;
|
|
61
|
-
this.upload = new EventEmitter();
|
|
62
|
-
this.click = new EventEmitter();
|
|
63
|
-
}
|
|
64
|
-
onBeginUpload(target) {
|
|
65
|
-
if (target) {
|
|
66
|
-
if (target.files && target.files[0]) {
|
|
67
|
-
this.upload.emit(target.files[0]);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
onClick(target) {
|
|
72
|
-
this.el.nativeElement.value = '';
|
|
73
|
-
if (target) {
|
|
74
|
-
this.click.emit(target);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/** @nocollapse */ FileUploadDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: FileUploadDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
-
/** @nocollapse */ FileUploadDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: FileUploadDirective, selector: "input[adbFileUpload]", outputs: { upload: "upload" }, host: { listeners: { "change": "onBeginUpload($event.target)", "click": "onClick($event.target)" } }, ngImport: i0 });
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: FileUploadDirective, decorators: [{
|
|
81
|
-
type: Directive,
|
|
82
|
-
args: [{
|
|
83
|
-
selector: 'input[adbFileUpload]',
|
|
84
|
-
host: {
|
|
85
|
-
'(change)': 'onBeginUpload($event.target)',
|
|
86
|
-
'(click)': 'onClick($event.target)'
|
|
87
|
-
},
|
|
88
|
-
outputs: ['upload']
|
|
89
|
-
}]
|
|
90
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
91
|
-
|
|
92
|
-
/* eslint-disable @angular-eslint/directive-selector */
|
|
93
|
-
class FocusDirective {
|
|
94
|
-
constructor(element) {
|
|
95
|
-
this.element = element;
|
|
96
|
-
}
|
|
97
|
-
set adbFocus(value) {
|
|
98
|
-
this.focused = value;
|
|
99
|
-
if (this.focused) {
|
|
100
|
-
this.element.nativeElement.focus();
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
this.element.nativeElement.blur();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
ngAfterViewInit() {
|
|
107
|
-
// ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
|
|
108
|
-
if (this.focused) {
|
|
109
|
-
setTimeout(() => this.element.nativeElement.focus(), 0);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/** @nocollapse */ FocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: FocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
114
|
-
/** @nocollapse */ FocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: FocusDirective, selector: "[adbFocus]", inputs: { adbFocus: "adbFocus" }, ngImport: i0 });
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: FocusDirective, decorators: [{
|
|
116
|
-
type: Directive,
|
|
117
|
-
args: [{
|
|
118
|
-
selector: '[adbFocus]',
|
|
119
|
-
}]
|
|
120
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { adbFocus: [{
|
|
121
|
-
type: Input
|
|
122
|
-
}] } });
|
|
123
|
-
|
|
124
|
-
class RedListBadgeClassDirective {
|
|
125
|
-
get hostClasses() {
|
|
126
|
-
let badgeClass;
|
|
127
|
-
this.redlistId = this.redlistId ? this.redlistId.replace('°', '') : '';
|
|
128
|
-
if (this.redlistId === 'EX' || this.redlistId === 'RE') {
|
|
129
|
-
return badgeClass = 'bg-dark';
|
|
130
|
-
}
|
|
131
|
-
else if (this.redlistId === 'CR' || this.redlistId === 'EN' || this.redlistId === 'VU' || this.redlistId === 'NT') {
|
|
132
|
-
return 'bg-danger';
|
|
133
|
-
}
|
|
134
|
-
else if (this.redlistId === 'DD' || this.redlistId === 'NE' || this.redlistId === 'NA') {
|
|
135
|
-
return 'bg-secondary';
|
|
136
|
-
}
|
|
137
|
-
else if (this.redlistId === 'NONE') {
|
|
138
|
-
return '';
|
|
139
|
-
}
|
|
140
|
-
return 'bg-success';
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/** @nocollapse */ RedListBadgeClassDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: RedListBadgeClassDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
144
|
-
/** @nocollapse */ RedListBadgeClassDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: RedListBadgeClassDirective, selector: "[adbRedListBadgeClass]", inputs: { redlistId: ["adbRedListBadgeClass", "redlistId"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 });
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: RedListBadgeClassDirective, decorators: [{
|
|
146
|
-
type: Directive,
|
|
147
|
-
args: [{
|
|
148
|
-
selector: '[adbRedListBadgeClass]'
|
|
149
|
-
}]
|
|
150
|
-
}], propDecorators: { redlistId: [{
|
|
151
|
-
type: Input,
|
|
152
|
-
args: ['adbRedListBadgeClass']
|
|
153
|
-
}], hostClasses: [{
|
|
154
|
-
type: HostBinding,
|
|
155
|
-
args: ['class']
|
|
156
|
-
}] } });
|
|
157
|
-
|
|
158
|
-
class AdbDirectivesModule {
|
|
159
|
-
}
|
|
160
|
-
/** @nocollapse */ AdbDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
161
|
-
/** @nocollapse */ AdbDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDirectivesModule, declarations: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective], exports: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective] });
|
|
162
|
-
/** @nocollapse */ AdbDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDirectivesModule, imports: [[]] });
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDirectivesModule, decorators: [{
|
|
164
|
-
type: NgModule,
|
|
165
|
-
args: [{
|
|
166
|
-
imports: [],
|
|
167
|
-
declarations: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective],
|
|
168
|
-
exports: [ClickOutsideDirective, FocusDirective, FileUploadDirective, RedListBadgeClassDirective]
|
|
169
|
-
}]
|
|
170
|
-
}] });
|
|
171
|
-
|
|
172
|
-
class ADBNavComponent {
|
|
173
|
-
constructor(httpClient, router, envService, trans) {
|
|
174
|
-
this.httpClient = httpClient;
|
|
175
|
-
this.router = router;
|
|
176
|
-
this.envService = envService;
|
|
177
|
-
this.trans = trans;
|
|
178
|
-
this.subscription = new Subscription();
|
|
179
|
-
this.loginClicked = new EventEmitter();
|
|
180
|
-
this.logoutClicked = new EventEmitter();
|
|
181
|
-
this.dropMenuChange = new EventEmitter();
|
|
182
|
-
this.showPattern = false;
|
|
183
|
-
this.translationFinished = false;
|
|
184
|
-
this.lastPosition = 0;
|
|
185
|
-
this.artfakta = true;
|
|
186
|
-
this.showNavMenu = false;
|
|
187
|
-
this.showUserMenu = false;
|
|
188
|
-
this.showArtfakta = true;
|
|
189
|
-
this.showNOS = true;
|
|
190
|
-
}
|
|
191
|
-
set userName(fullName) {
|
|
192
|
-
this.fullName = fullName;
|
|
193
|
-
const splitted = fullName === null || fullName === void 0 ? void 0 : fullName.split(' ');
|
|
194
|
-
if ((splitted === null || splitted === void 0 ? void 0 : splitted.length) > 1) {
|
|
195
|
-
const initials = splitted.shift().charAt(0) + splitted.pop().charAt(0);
|
|
196
|
-
this.initials = initials.toUpperCase();
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
this.initials = this.fullName ? this.fullName.charAt(0).toUpperCase() : this.fullName;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
;
|
|
203
|
-
ngOnInit() {
|
|
204
|
-
this.url = window.location.href;
|
|
205
|
-
const baseUrl = this.envService.environment.resourceUrl;
|
|
206
|
-
const url = this.artfakta ? '/assets/links-ap3.json' : '/assets/artportalen/links-ap3.json';
|
|
207
|
-
this.subscription.add(this.httpClient.get(baseUrl + url).subscribe(result => {
|
|
208
|
-
this.navigation = result;
|
|
209
|
-
}));
|
|
210
|
-
this.initTranslations(baseUrl);
|
|
211
|
-
this.router.events.subscribe((event) => {
|
|
212
|
-
if (event instanceof NavigationEnd) {
|
|
213
|
-
this.showNavMenu = false;
|
|
214
|
-
this.dropMenuChange.emit(this.showNavMenu);
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
initTranslations(baseUrl) {
|
|
219
|
-
if (this.trans.store.translations[this.trans.currentLang]) {
|
|
220
|
-
this.loadTranslation(baseUrl, this.trans.currentLang);
|
|
221
|
-
}
|
|
222
|
-
this.subscription.add(this.trans.onLangChange.subscribe((event) => {
|
|
223
|
-
this.translationFinished = false;
|
|
224
|
-
this.loadTranslation(baseUrl, event.lang);
|
|
225
|
-
}));
|
|
226
|
-
}
|
|
227
|
-
loadTranslation(baseUrl, lang) {
|
|
228
|
-
//TODO: Prepare for diffents lang then en sv (en-GB) or add more files in devcomponentserver :)
|
|
229
|
-
const url = this.artfakta ? baseUrl + `/assets/i18n/${lang}.json` : baseUrl + `/assets/artportalen/i18n/${lang}.json`;
|
|
230
|
-
this.subscription.add(this.httpClient.get(url).subscribe(translations => {
|
|
231
|
-
this.trans.setTranslation(lang, translations, true);
|
|
232
|
-
this.translationFinished = true;
|
|
233
|
-
}));
|
|
234
|
-
}
|
|
235
|
-
showMenuDropdown(show) {
|
|
236
|
-
this.showUserMenu = false;
|
|
237
|
-
if (this.showNavMenu !== show) {
|
|
238
|
-
this.showNavMenu = show;
|
|
239
|
-
this.dropMenuChange.emit(show);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
setLanguage(lang) {
|
|
243
|
-
this.trans.use(lang);
|
|
244
|
-
this.showNavMenu = false;
|
|
245
|
-
this.dropMenuChange.emit(false);
|
|
246
|
-
//TODO: set localstorage/cookies or probaly event to main app
|
|
247
|
-
}
|
|
248
|
-
login() {
|
|
249
|
-
this.loginClicked.emit();
|
|
250
|
-
}
|
|
251
|
-
logout() {
|
|
252
|
-
this.logoutClicked.emit();
|
|
253
|
-
}
|
|
254
|
-
ngOnDestroy() {
|
|
255
|
-
this.subscription.unsubscribe();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
/** @nocollapse */ ADBNavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBNavComponent, deps: [{ token: i1.HttpClient }, { token: i2.Router }, { token: EnvironmentService$1 }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
259
|
-
/** @nocollapse */ ADBNavComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: ADBNavComponent, selector: "adb-nav", inputs: { showPattern: "showPattern", userName: "userName", artfakta: "artfakta" }, outputs: { loginClicked: "loginClicked", logoutClicked: "logoutClicked", dropMenuChange: "dropMenuChange" }, ngImport: i0, template: "<div class=\"bg-primary adb-main-header\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n <header class=\"container-lg\" *ngIf=\"translationFinished\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"d-flex align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-1\">\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 routerLink=\"/\" class=\"text-white text-decoration-none fs-1 fw-bold\">Artfakta</a>\r\n </nav>\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n attr.aria-label=\"{{'ADB_HEADER.MENY'|translate}}\"\r\n (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"fas fa-bars\"></i>\r\n <small class=\"d-none ms-2 d-md-inline-block\">{{'ADB_HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </header>\r\n <div *ngIf=\"navigation\" role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\"\r\n [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\">Artfakta</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 tabindex=\"-1\" 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 <ng-container *ngIf=\"initials\">\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'ADB_HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!initials\">\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'ADB_HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n <a *ngIf=\"navigation\" class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'ADB_HEADER.CREATE_USER'|translate}}\r\n </a>\r\n </ng-container>\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showArtfakta?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.artinfo.url}}\">\r\n {{navigation.artinfo.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showArtfakta = !showArtfakta\"\r\n attr.aria-controls=\"artfakta-links\" attr.aria-expanded=\"{{showArtfakta}}\">\r\n <span class=\"fas\" [ngClass]=\"showArtfakta?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showArtfakta\" id=\"artfakta-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.keys.url}}\" class=\"text-white\">\r\n {{navigation.keys.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.mySpecies.url}}\" class=\"text-white\">\r\n {{navigation.mySpecies.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.lists.url}}\" class=\"text-white\">\r\n {{navigation.lists.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.imageRec.url}}\" class=\"text-white\">\r\n {{navigation.imageRec.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.filter.url}}\" class=\"text-white\">\r\n {{navigation.filter.transId|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}?lang={{trans.currentLang}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showNOS?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.nameAndRelationship.url}}\">\r\n {{navigation.nameAndRelationship.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showNOS = !showNOS\"\r\n attr.aria-controls=\"nos-links\" attr.aria-expanded=\"{{showNOS}}\">\r\n <span class=\"fas\" [ngClass]=\"showNOS?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showNOS\" id=\"nos-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1 text-white\">\r\n <a href=\"{{navigation.nameSearch.url}}\" class=\"text-white\">\r\n {{navigation.nameSearch.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1 text-white\">\r\n <a href=\"{{navigation.match.url}}\" class=\"text-white\">\r\n {{navigation.match.transId|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" [href]=\"navigation.about.url\">{{navigation.about.transId|translate}}</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 {{'ADB_HEADER.ARTPORTALEN_TITLE'|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 {{'ADB_HEADER.DEVELOPED_BY'|translate}}\r\n <a href=\"https://www.artdatabanken.se/\" class=\"text-white\"><u class=\"me-1\">{{'ADB_HEADER.ARTDATABANKEN'|translate}}</u> <span class=\"fas fa-external-link\"></span></a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\">\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>", directives: [{ type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBNavComponent, decorators: [{
|
|
261
|
-
type: Component,
|
|
262
|
-
args: [{ selector: 'adb-nav', template: "<div class=\"bg-primary adb-main-header\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n <header class=\"container-lg\" *ngIf=\"translationFinished\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"d-flex align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-1\">\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 routerLink=\"/\" class=\"text-white text-decoration-none fs-1 fw-bold\">Artfakta</a>\r\n </nav>\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n attr.aria-label=\"{{'ADB_HEADER.MENY'|translate}}\"\r\n (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"fas fa-bars\"></i>\r\n <small class=\"d-none ms-2 d-md-inline-block\">{{'ADB_HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </header>\r\n <div *ngIf=\"navigation\" role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\"\r\n [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\">Artfakta</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 tabindex=\"-1\" 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 <ng-container *ngIf=\"initials\">\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'ADB_HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!initials\">\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'ADB_HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n <a *ngIf=\"navigation\" class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'ADB_HEADER.CREATE_USER'|translate}}\r\n </a>\r\n </ng-container>\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showArtfakta?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.artinfo.url}}\">\r\n {{navigation.artinfo.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showArtfakta = !showArtfakta\"\r\n attr.aria-controls=\"artfakta-links\" attr.aria-expanded=\"{{showArtfakta}}\">\r\n <span class=\"fas\" [ngClass]=\"showArtfakta?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showArtfakta\" id=\"artfakta-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.keys.url}}\" class=\"text-white\">\r\n {{navigation.keys.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.mySpecies.url}}\" class=\"text-white\">\r\n {{navigation.mySpecies.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.lists.url}}\" class=\"text-white\">\r\n {{navigation.lists.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.imageRec.url}}\" class=\"text-white\">\r\n {{navigation.imageRec.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1\">\r\n <a href=\"{{navigation.filter.url}}\" class=\"text-white\">\r\n {{navigation.filter.transId|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}?lang={{trans.currentLang}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showNOS?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.nameAndRelationship.url}}\">\r\n {{navigation.nameAndRelationship.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showNOS = !showNOS\"\r\n attr.aria-controls=\"nos-links\" attr.aria-expanded=\"{{showNOS}}\">\r\n <span class=\"fas\" [ngClass]=\"showNOS?'fa-chevron-up':'fa-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showNOS\" id=\"nos-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1 text-white\">\r\n <a href=\"{{navigation.nameSearch.url}}\" class=\"text-white\">\r\n {{navigation.nameSearch.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-1 text-white\">\r\n <a href=\"{{navigation.match.url}}\" class=\"text-white\">\r\n {{navigation.match.transId|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" [href]=\"navigation.about.url\">{{navigation.about.transId|translate}}</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 {{'ADB_HEADER.ARTPORTALEN_TITLE'|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 {{'ADB_HEADER.DEVELOPED_BY'|translate}}\r\n <a href=\"https://www.artdatabanken.se/\" class=\"text-white\"><u class=\"me-1\">{{'ADB_HEADER.ARTDATABANKEN'|translate}}</u> <span class=\"fas fa-external-link\"></span></a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\">\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>" }]
|
|
263
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.Router }, { type: EnvironmentService$1 }, { type: i3.TranslateService }]; }, propDecorators: { loginClicked: [{
|
|
264
|
-
type: Output
|
|
265
|
-
}], logoutClicked: [{
|
|
266
|
-
type: Output
|
|
267
|
-
}], dropMenuChange: [{
|
|
268
|
-
type: Output
|
|
269
|
-
}], showPattern: [{
|
|
270
|
-
type: Input
|
|
271
|
-
}], userName: [{
|
|
272
|
-
type: Input
|
|
273
|
-
}], artfakta: [{
|
|
274
|
-
type: Input
|
|
275
|
-
}] } });
|
|
276
|
-
|
|
277
|
-
class AdbDropdownService {
|
|
278
|
-
}
|
|
279
|
-
/** @nocollapse */ AdbDropdownService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
280
|
-
/** @nocollapse */ AdbDropdownService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownService });
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownService, decorators: [{
|
|
282
|
-
type: Injectable
|
|
283
|
-
}] });
|
|
284
|
-
|
|
285
|
-
class AdbDropdownDirective {
|
|
286
|
-
constructor(elementRef, adbDropdownService) {
|
|
287
|
-
this.elementRef = elementRef;
|
|
288
|
-
this.adbDropdownService = adbDropdownService;
|
|
289
|
-
this.adbDropdown = new EventEmitter();
|
|
290
|
-
this.insideClick = false;
|
|
291
|
-
this.dataToggle = "dropdown";
|
|
292
|
-
this.haspPopup = true;
|
|
293
|
-
this.expanded = false;
|
|
294
|
-
this.id = this.getId();
|
|
295
|
-
}
|
|
296
|
-
onClick() {
|
|
297
|
-
var _a;
|
|
298
|
-
this.adbDropdownService.currentMenuId = this.id;
|
|
299
|
-
const node = this.elementRef.nativeElement.parentNode;
|
|
300
|
-
const toggleButton = node.querySelector('.dropdown-toggle');
|
|
301
|
-
let style = `transform:translate3d(0px, ${(toggleButton === null || toggleButton === void 0 ? void 0 : toggleButton.clientHeight) + 1}px, 0px);`;
|
|
302
|
-
const menu = node.querySelector('.dropdown-menu');
|
|
303
|
-
if (menu) {
|
|
304
|
-
this.adbDropdownService.currentMenu = this.elementRef.nativeElement;
|
|
305
|
-
if ((_a = menu.classList) === null || _a === void 0 ? void 0 : _a.contains('dropdown-menu-end')) {
|
|
306
|
-
style = style + 'inset: 0px 0px auto auto;';
|
|
307
|
-
}
|
|
308
|
-
menu.setAttribute('style', style);
|
|
309
|
-
if (menu.classList.contains('show')) {
|
|
310
|
-
menu.classList.remove('show');
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
this.adbDropdown.emit();
|
|
314
|
-
menu.classList.add('show');
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
onCheckOutSideClick(target) {
|
|
319
|
-
if (this.adbDropdownService.currentMenuId === this.id) {
|
|
320
|
-
const parent = this.insideClick ? this.elementRef.nativeElement.parentNode : this.elementRef.nativeElement;
|
|
321
|
-
const clickedInside = parent.contains(target);
|
|
322
|
-
if (!clickedInside) {
|
|
323
|
-
const parent = this.elementRef.nativeElement.parentNode.querySelector('.dropdown-menu');
|
|
324
|
-
parent === null || parent === void 0 ? void 0 : parent.classList.remove('show');
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
const parent = this.elementRef.nativeElement.parentNode.querySelector('.dropdown-menu');
|
|
329
|
-
parent === null || parent === void 0 ? void 0 : parent.classList.remove('show');
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
close() {
|
|
333
|
-
const node = this.elementRef.nativeElement.parentNode;
|
|
334
|
-
const menu = node.querySelector('.dropdown-menu');
|
|
335
|
-
menu.classList.remove('show');
|
|
336
|
-
}
|
|
337
|
-
getId() {
|
|
338
|
-
return '' + Math.floor(Math.random() * Date.now());
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
/** @nocollapse */ AdbDropdownDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownDirective, deps: [{ token: i0.ElementRef }, { token: AdbDropdownService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
342
|
-
/** @nocollapse */ AdbDropdownDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: AdbDropdownDirective, 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" } }, exportAs: ["adbDropdown"], ngImport: i0 });
|
|
343
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownDirective, decorators: [{
|
|
344
|
-
type: Directive,
|
|
345
|
-
args: [{
|
|
346
|
-
selector: '[adbDropdown]',
|
|
347
|
-
exportAs: 'adbDropdown'
|
|
348
|
-
}]
|
|
349
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: AdbDropdownService }]; }, propDecorators: { adbDropdown: [{
|
|
350
|
-
type: Output
|
|
351
|
-
}], insideClick: [{
|
|
352
|
-
type: Input
|
|
353
|
-
}], id: [{
|
|
354
|
-
type: HostBinding,
|
|
355
|
-
args: ['id']
|
|
356
|
-
}], dataToggle: [{
|
|
357
|
-
type: HostBinding,
|
|
358
|
-
args: ['attr.data-toggle']
|
|
359
|
-
}], haspPopup: [{
|
|
360
|
-
type: HostBinding,
|
|
361
|
-
args: ['attr.aria-haspopup']
|
|
362
|
-
}], expanded: [{
|
|
363
|
-
type: HostBinding,
|
|
364
|
-
args: ['attr.aria-expanded']
|
|
365
|
-
}], onClick: [{
|
|
366
|
-
type: HostListener,
|
|
367
|
-
args: ['click']
|
|
368
|
-
}], onCheckOutSideClick: [{
|
|
369
|
-
type: HostListener,
|
|
370
|
-
args: ['document:click', ['$event.target']]
|
|
371
|
-
}] } });
|
|
372
|
-
|
|
373
|
-
class AdbDropdownModule {
|
|
374
|
-
}
|
|
375
|
-
/** @nocollapse */ AdbDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
376
|
-
/** @nocollapse */ AdbDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownModule, declarations: [AdbDropdownDirective], imports: [CommonModule, i3.TranslateModule, AdbDirectivesModule], exports: [AdbDropdownDirective] });
|
|
377
|
-
/** @nocollapse */ AdbDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownModule, providers: [AdbDropdownService], imports: [[CommonModule, TranslateModule.forChild(), AdbDirectivesModule]] });
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDropdownModule, decorators: [{
|
|
379
|
-
type: NgModule,
|
|
380
|
-
args: [{
|
|
381
|
-
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
382
|
-
declarations: [AdbDropdownDirective],
|
|
383
|
-
exports: [AdbDropdownDirective],
|
|
384
|
-
providers: [AdbDropdownService]
|
|
385
|
-
}]
|
|
386
|
-
}] });
|
|
387
|
-
|
|
388
|
-
class InfiniteScrollComponent {
|
|
389
|
-
constructor(_element) {
|
|
390
|
-
this._element = _element;
|
|
391
|
-
this.onVisible = new EventEmitter();
|
|
392
|
-
this.onHidden = new EventEmitter();
|
|
393
|
-
this.height = '1px';
|
|
394
|
-
this.checkForIntersection = (entries) => {
|
|
395
|
-
entries.forEach((entry) => {
|
|
396
|
-
const isIntersecting = entry.isIntersecting &&
|
|
397
|
-
entry.target === this._element.nativeElement;
|
|
398
|
-
if (isIntersecting) {
|
|
399
|
-
this.onVisible.emit();
|
|
400
|
-
}
|
|
401
|
-
else {
|
|
402
|
-
this.onHidden.emit();
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
ngAfterViewInit() {
|
|
408
|
-
this._intersectionObserver = new IntersectionObserver(entries => {
|
|
409
|
-
this.checkForIntersection(entries);
|
|
410
|
-
}, {});
|
|
411
|
-
this._intersectionObserver.observe(this._element.nativeElement);
|
|
412
|
-
}
|
|
413
|
-
ngOnDestroy() {
|
|
414
|
-
if (this._intersectionObserver) {
|
|
415
|
-
this._intersectionObserver.disconnect();
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
/** @nocollapse */ InfiniteScrollComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: InfiniteScrollComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
420
|
-
/** @nocollapse */ InfiniteScrollComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: InfiniteScrollComponent, selector: "[onVisible]", outputs: { onVisible: "onVisible", onHidden: "onHidden" }, host: { properties: { "style.height": "this.height" } }, ngImport: i0 });
|
|
421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: InfiniteScrollComponent, decorators: [{
|
|
422
|
-
type: Directive,
|
|
423
|
-
args: [{ selector: "[onVisible]" }]
|
|
424
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onVisible: [{
|
|
425
|
-
type: Output
|
|
426
|
-
}], onHidden: [{
|
|
427
|
-
type: Output
|
|
428
|
-
}], height: [{
|
|
429
|
-
type: HostBinding,
|
|
430
|
-
args: ['style.height']
|
|
431
|
-
}] } });
|
|
432
|
-
|
|
433
|
-
class PagerBaseDirective {
|
|
434
|
-
constructor() {
|
|
435
|
-
this.limit = PagerBaseDirective.DEFAULT_LIMIT;
|
|
436
|
-
this.currentPage = 1;
|
|
437
|
-
}
|
|
438
|
-
set setTotalCount(value) {
|
|
439
|
-
this.totalCount = value;
|
|
440
|
-
this.calculatePages();
|
|
441
|
-
}
|
|
442
|
-
set setLimit(value) {
|
|
443
|
-
this.limit = value !== null && value !== void 0 ? value : PagerBaseDirective.DEFAULT_LIMIT;
|
|
444
|
-
this.calculatePages();
|
|
445
|
-
}
|
|
446
|
-
calculatePages() {
|
|
447
|
-
if (this.totalCount >= 0 && this.limit > 0) {
|
|
448
|
-
this.amountOfPages = Math.ceil(this.totalCount / this.limit);
|
|
449
|
-
if ((this.currentPage + 1) > PagerBaseDirective.VISIBLE_PAGES) {
|
|
450
|
-
this.pages = [
|
|
451
|
-
this.currentPage - 2,
|
|
452
|
-
this.currentPage - 1, this.currentPage
|
|
453
|
-
];
|
|
454
|
-
const above = this.amountOfPages - this.currentPage;
|
|
455
|
-
if (above >= 1) {
|
|
456
|
-
this.pages.push(this.currentPage + 1);
|
|
457
|
-
}
|
|
458
|
-
if (above >= 2) {
|
|
459
|
-
this.pages.push(this.currentPage + 2);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
else if (this.totalCount) {
|
|
463
|
-
const max = this.amountOfPages > PagerBaseDirective.VISIBLE_PAGES ? 5 : this.amountOfPages;
|
|
464
|
-
this.pages = Array(Math.ceil(max)).fill(1).map((x, i) => i + 1);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
this.amountOfPages = 0;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
PagerBaseDirective.DEFAULT_LIMIT = 10;
|
|
473
|
-
PagerBaseDirective.VISIBLE_PAGES = 5;
|
|
474
|
-
PagerBaseDirective.SKIP_RESOURCE = 'offset';
|
|
475
|
-
/** @nocollapse */ PagerBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
476
|
-
/** @nocollapse */ PagerBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: PagerBaseDirective, inputs: { setTotalCount: ["totalCount", "setTotalCount"], setLimit: ["limit", "setLimit"] }, ngImport: i0 });
|
|
477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerBaseDirective, decorators: [{
|
|
478
|
-
type: Directive
|
|
479
|
-
}], propDecorators: { setTotalCount: [{
|
|
480
|
-
type: Input,
|
|
481
|
-
args: ['totalCount']
|
|
482
|
-
}], setLimit: [{
|
|
483
|
-
type: Input,
|
|
484
|
-
args: ['limit']
|
|
485
|
-
}] } });
|
|
486
|
-
|
|
487
|
-
class PagerComponent extends PagerBaseDirective {
|
|
488
|
-
constructor(activatedRoute) {
|
|
489
|
-
super();
|
|
490
|
-
this.activatedRoute = activatedRoute;
|
|
491
|
-
this.subscription = new Subscription();
|
|
492
|
-
this.offsetName = "offset";
|
|
493
|
-
this.infiniteLimit = false;
|
|
494
|
-
}
|
|
495
|
-
ngOnInit() {
|
|
496
|
-
this.subscription.add(this.activatedRoute.queryParams.subscribe(params => {
|
|
497
|
-
if (params[this.offsetName]) {
|
|
498
|
-
this.currentPage = (+params[this.offsetName] / this.limit) + 1;
|
|
499
|
-
}
|
|
500
|
-
this.calculatePages();
|
|
501
|
-
//create model
|
|
502
|
-
this.params = {
|
|
503
|
-
first: { [this.offsetName]: 0 },
|
|
504
|
-
prev: { [this.offsetName]: (this.currentPage - 2) * this.limit },
|
|
505
|
-
pages: [],
|
|
506
|
-
next: { [this.offsetName]: this.currentPage * this.limit },
|
|
507
|
-
last: { [this.offsetName]: (this.amountOfPages - 1) * this.limit },
|
|
508
|
-
};
|
|
509
|
-
if (this.pages) {
|
|
510
|
-
for (const page of this.pages) {
|
|
511
|
-
this.params.pages.push({ name: page, params: { [this.offsetName]: (page - 1) * this.limit } });
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}));
|
|
515
|
-
}
|
|
516
|
-
ngOnDestroy() {
|
|
517
|
-
this.subscription.unsubscribe();
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
/** @nocollapse */ PagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerComponent, deps: [{ token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
521
|
-
/** @nocollapse */ PagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: PagerComponent, selector: "adb-pager-nav", inputs: { offsetName: "offsetName", infiniteLimit: "infiniteLimit" }, usesInheritance: true, ngImport: i0, template: "<nav *ngIf=\"pages&&pages.length>1&¤tPage<=amountOfPages\" class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination 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 <li class=\"page-item\" [class.active]=\"currentPage===page.name\" *ngFor=\"let page of params.pages\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\"\r\n queryParamsHandling=\"merge\">{{page.name}}</a>\r\n </li>\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 <ng-container *ngIf=\"!infiniteLimit\">\r\n <li *ngIf=\"(amountOfPages-1)*limit<10000\" 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 </ng-container>\r\n <li class=\"page-item\" *ngIf=\"infiniteLimit\">\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 </ul>\r\n</nav>", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerComponent, decorators: [{
|
|
523
|
-
type: Component,
|
|
524
|
-
args: [{ selector: 'adb-pager-nav', template: "<nav *ngIf=\"pages&&pages.length>1&¤tPage<=amountOfPages\" class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination 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 <li class=\"page-item\" [class.active]=\"currentPage===page.name\" *ngFor=\"let page of params.pages\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\"\r\n queryParamsHandling=\"merge\">{{page.name}}</a>\r\n </li>\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 <ng-container *ngIf=\"!infiniteLimit\">\r\n <li *ngIf=\"(amountOfPages-1)*limit<10000\" 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 </ng-container>\r\n <li class=\"page-item\" *ngIf=\"infiniteLimit\">\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 </ul>\r\n</nav>" }]
|
|
525
|
-
}], ctorParameters: function () { return [{ type: i2.ActivatedRoute }]; }, propDecorators: { offsetName: [{
|
|
526
|
-
type: Input
|
|
527
|
-
}], infiniteLimit: [{
|
|
528
|
-
type: Input
|
|
529
|
-
}] } });
|
|
530
|
-
|
|
531
|
-
class PagerInlineComponent extends PagerBaseDirective {
|
|
532
|
-
constructor() {
|
|
533
|
-
super();
|
|
534
|
-
this.pageChanged = new EventEmitter();
|
|
535
|
-
}
|
|
536
|
-
ngOnInit() {
|
|
537
|
-
this.calculatePages();
|
|
538
|
-
}
|
|
539
|
-
onFirstClick() {
|
|
540
|
-
this.currentPage = 1;
|
|
541
|
-
this.pageChanged.emit(this.currentPage - 1);
|
|
542
|
-
this.calculatePages();
|
|
543
|
-
}
|
|
544
|
-
onPrevClick() {
|
|
545
|
-
this.currentPage = this.currentPage - 1;
|
|
546
|
-
this.pageChanged.emit(this.currentPage - 1);
|
|
547
|
-
this.calculatePages();
|
|
548
|
-
}
|
|
549
|
-
onPageClick(page) {
|
|
550
|
-
this.currentPage = page;
|
|
551
|
-
this.pageChanged.emit(this.currentPage - 1);
|
|
552
|
-
}
|
|
553
|
-
onNextClick() {
|
|
554
|
-
this.currentPage = this.currentPage + 1;
|
|
555
|
-
this.pageChanged.emit(this.currentPage - 1);
|
|
556
|
-
this.calculatePages();
|
|
557
|
-
}
|
|
558
|
-
onLastClick() {
|
|
559
|
-
this.currentPage = this.amountOfPages;
|
|
560
|
-
this.pageChanged.emit(this.currentPage - 1);
|
|
561
|
-
this.calculatePages();
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
/** @nocollapse */ PagerInlineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerInlineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
565
|
-
/** @nocollapse */ PagerInlineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: PagerInlineComponent, selector: "adb-pager", outputs: { pageChanged: "pageChanged" }, usesInheritance: true, ngImport: i0, template: "<nav *ngIf=\"pages&&pages.length>1&¤tPage<=amountOfPages\" class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination\">\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 <li class=\"page-item\" [class.active]=\"currentPage==page\" *ngFor=\"let page of pages\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\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 <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 </ul>\r\n</nav>\r\n", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: PagerInlineComponent, decorators: [{
|
|
567
|
-
type: Component,
|
|
568
|
-
args: [{ selector: 'adb-pager', template: "<nav *ngIf=\"pages&&pages.length>1&¤tPage<=amountOfPages\" class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination\">\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 <li class=\"page-item\" [class.active]=\"currentPage==page\" *ngFor=\"let page of pages\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\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 <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 </ul>\r\n</nav>\r\n" }]
|
|
569
|
-
}], ctorParameters: function () { return []; }, propDecorators: { pageChanged: [{
|
|
570
|
-
type: Output
|
|
571
|
-
}] } });
|
|
572
|
-
|
|
573
|
-
class AdbPagersModule {
|
|
574
|
-
}
|
|
575
|
-
/** @nocollapse */ AdbPagersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPagersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
576
|
-
/** @nocollapse */ AdbPagersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPagersModule, declarations: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent], imports: [CommonModule,
|
|
577
|
-
RouterModule], exports: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent] });
|
|
578
|
-
/** @nocollapse */ AdbPagersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPagersModule, imports: [[
|
|
579
|
-
CommonModule,
|
|
580
|
-
RouterModule
|
|
581
|
-
]] });
|
|
582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPagersModule, decorators: [{
|
|
583
|
-
type: NgModule,
|
|
584
|
-
args: [{
|
|
585
|
-
imports: [
|
|
586
|
-
CommonModule,
|
|
587
|
-
RouterModule
|
|
588
|
-
],
|
|
589
|
-
declarations: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent],
|
|
590
|
-
exports: [InfiniteScrollComponent, PagerComponent, PagerInlineComponent]
|
|
591
|
-
}]
|
|
592
|
-
}] });
|
|
593
|
-
|
|
594
|
-
class ADBFooterComponent {
|
|
595
|
-
constructor(httpClient, envService, trans) {
|
|
596
|
-
this.httpClient = httpClient;
|
|
597
|
-
this.envService = envService;
|
|
598
|
-
this.trans = trans;
|
|
599
|
-
this.subscription = new Subscription();
|
|
600
|
-
this.translationFinished = false;
|
|
601
|
-
this.artfakta = true;
|
|
602
|
-
}
|
|
603
|
-
ngOnInit() {
|
|
604
|
-
this.url = window.location.href;
|
|
605
|
-
this.baseUrl = this.envService.environment.resourceUrl;
|
|
606
|
-
this.initTranslations(this.baseUrl);
|
|
607
|
-
}
|
|
608
|
-
initTranslations(baseUrl) {
|
|
609
|
-
if (this.trans.store.translations[this.trans.currentLang]) {
|
|
610
|
-
this.loadTranslation(baseUrl, this.trans.currentLang);
|
|
611
|
-
}
|
|
612
|
-
this.subscription.add(this.trans.onLangChange.subscribe((event) => {
|
|
613
|
-
this.translationFinished = false;
|
|
614
|
-
this.loadTranslation(baseUrl, event.lang);
|
|
615
|
-
}));
|
|
616
|
-
}
|
|
617
|
-
loadTranslation(baseUrl, lang) {
|
|
618
|
-
//TODO: Prepare for diffents lang then en sv (en-GB) or add more files in devcomponentserver :)
|
|
619
|
-
const url = this.artfakta ? baseUrl + `/assets/i18n/${lang}.json` : baseUrl + `/assets/artportalen/i18n/${lang}.json`;
|
|
620
|
-
this.subscription.add(this.httpClient.get(url).subscribe(translations => {
|
|
621
|
-
this.trans.setTranslation(lang, translations, true);
|
|
622
|
-
this.translationFinished = true;
|
|
623
|
-
}));
|
|
624
|
-
}
|
|
625
|
-
ngOnDestroy() {
|
|
626
|
-
this.subscription.unsubscribe();
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
/** @nocollapse */ ADBFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBFooterComponent, deps: [{ token: i1.HttpClient }, { token: EnvironmentService$1 }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
630
|
-
/** @nocollapse */ ADBFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: ADBFooterComponent, selector: "adb-footer", inputs: { artfakta: "artfakta" }, ngImport: i0, template: "<footer class=\"bg-primary-dark py-2 mt-auto container-fluid\" *ngIf=\"translationFinished\">\r\n <div class=\"d-flex justify-content-center\">\r\n <div class=\"container py-3 justify-content-center\">\r\n <div class=\"row mb-3\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4 px-md-2\">\r\n <a href=\"https://artfakta.se/om\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://artfakta.se/om\" fragment=\"accessability\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a class=\"d-block text-white mb-2\" href=\"mailto:artfakta@artdatabanken.se\">{{'FOOTER.SUPPORT'|translate}}: artfakta@artdatabanken.se</a>\r\n </div>\r\n <div class=\"col-md-4 px-md-2\">\r\n <a class=\"d-block text-white mb-2\" href=\"https://www.artdatabanken.se/tjanster-och-miljodata/villkor-kontohavare/\" target=\"_blank\">{{'FOOTER.TERMS_OF_USE'|translate}} <span class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://www.artdatabanken.se/om-oss/behandling-av-personuppgifter\" target=\"_blank\">{{'FOOTER.PERSONAL_DATA'|translate}} <span\r\n class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://metadata.artfakta.se/dataproviders\" target=\"_blank\">{{'FOOTER.DATA_SOURCES'|translate}} <span class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://status.artdatabanken.se/status\" target=\"_blank\">{{'FOOTER.API'|translate}} <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 px-md-2\">\r\n <div class=\"mb-2 text-white\">{{'FOOTER.INFO'|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 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=\"align-self-center pe-5\" style=\"height: 0.7rem;\" 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>", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBFooterComponent, decorators: [{
|
|
632
|
-
type: Component,
|
|
633
|
-
args: [{ selector: 'adb-footer', template: "<footer class=\"bg-primary-dark py-2 mt-auto container-fluid\" *ngIf=\"translationFinished\">\r\n <div class=\"d-flex justify-content-center\">\r\n <div class=\"container py-3 justify-content-center\">\r\n <div class=\"row mb-3\">\r\n <div class=\"col-md-2\"></div>\r\n <div class=\"col-md-4 px-md-2\">\r\n <a href=\"https://artfakta.se/om\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://artfakta.se/om\" fragment=\"accessability\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a class=\"d-block text-white mb-2\" href=\"mailto:artfakta@artdatabanken.se\">{{'FOOTER.SUPPORT'|translate}}: artfakta@artdatabanken.se</a>\r\n </div>\r\n <div class=\"col-md-4 px-md-2\">\r\n <a class=\"d-block text-white mb-2\" href=\"https://www.artdatabanken.se/tjanster-och-miljodata/villkor-kontohavare/\" target=\"_blank\">{{'FOOTER.TERMS_OF_USE'|translate}} <span class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://www.artdatabanken.se/om-oss/behandling-av-personuppgifter\" target=\"_blank\">{{'FOOTER.PERSONAL_DATA'|translate}} <span\r\n class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://metadata.artfakta.se/dataproviders\" target=\"_blank\">{{'FOOTER.DATA_SOURCES'|translate}} <span class=\"fas fa-external-link\"></span></a>\r\n <a class=\"d-block text-white mb-2\" href=\"https://status.artdatabanken.se/status\" target=\"_blank\">{{'FOOTER.API'|translate}} <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 px-md-2\">\r\n <div class=\"mb-2 text-white\">{{'FOOTER.INFO'|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 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=\"align-self-center pe-5\" style=\"height: 0.7rem;\" 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>" }]
|
|
634
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EnvironmentService$1 }, { type: i3.TranslateService }]; }, propDecorators: { artfakta: [{
|
|
635
|
-
type: Input
|
|
636
|
-
}] } });
|
|
637
|
-
|
|
638
|
-
class ADBHeaderModule {
|
|
639
|
-
static forRoot(environment) {
|
|
640
|
-
return {
|
|
641
|
-
ngModule: ADBHeaderModule,
|
|
642
|
-
providers: [
|
|
643
|
-
EnvironmentService$1,
|
|
644
|
-
{
|
|
645
|
-
provide: 'env',
|
|
646
|
-
useValue: environment
|
|
647
|
-
}
|
|
648
|
-
]
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
/** @nocollapse */ ADBHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
653
|
-
/** @nocollapse */ ADBHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBHeaderModule, declarations: [ADBNavComponent, ADBFooterComponent], imports: [CommonModule,
|
|
654
|
-
HttpClientModule,
|
|
655
|
-
RouterModule,
|
|
656
|
-
TranslateModule,
|
|
657
|
-
AdbDirectivesModule,
|
|
658
|
-
AdbDropdownModule,
|
|
659
|
-
AdbPagersModule], exports: [ADBNavComponent, ADBFooterComponent] });
|
|
660
|
-
/** @nocollapse */ ADBHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBHeaderModule, imports: [[
|
|
661
|
-
CommonModule,
|
|
662
|
-
HttpClientModule,
|
|
663
|
-
RouterModule,
|
|
664
|
-
TranslateModule,
|
|
665
|
-
AdbDirectivesModule,
|
|
666
|
-
AdbDropdownModule,
|
|
667
|
-
AdbPagersModule
|
|
668
|
-
]] });
|
|
669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ADBHeaderModule, decorators: [{
|
|
670
|
-
type: NgModule,
|
|
671
|
-
args: [{
|
|
672
|
-
declarations: [ADBNavComponent, ADBFooterComponent],
|
|
673
|
-
imports: [
|
|
674
|
-
CommonModule,
|
|
675
|
-
HttpClientModule,
|
|
676
|
-
RouterModule,
|
|
677
|
-
TranslateModule,
|
|
678
|
-
AdbDirectivesModule,
|
|
679
|
-
AdbDropdownModule,
|
|
680
|
-
AdbPagersModule
|
|
681
|
-
],
|
|
682
|
-
exports: [ADBNavComponent, ADBFooterComponent]
|
|
683
|
-
}]
|
|
684
|
-
}] });
|
|
685
|
-
|
|
686
|
-
class EnvironmentService {
|
|
687
|
-
constructor(environment) {
|
|
688
|
-
this.environment = environment;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
/** @nocollapse */ EnvironmentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService, deps: [{ token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
692
|
-
/** @nocollapse */ EnvironmentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService });
|
|
693
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EnvironmentService, decorators: [{
|
|
694
|
-
type: Injectable
|
|
695
|
-
}], ctorParameters: function () {
|
|
696
|
-
return [{ type: undefined, decorators: [{
|
|
697
|
-
type: Inject,
|
|
698
|
-
args: ['env']
|
|
699
|
-
}] }];
|
|
700
|
-
} });
|
|
701
|
-
|
|
702
|
-
class ArtportalenNavComponent {
|
|
703
|
-
constructor(httpClient, router, trans, envService) {
|
|
704
|
-
this.httpClient = httpClient;
|
|
705
|
-
this.router = router;
|
|
706
|
-
this.trans = trans;
|
|
707
|
-
this.envService = envService;
|
|
708
|
-
this.subscription = new Subscription();
|
|
709
|
-
this.loginClicked = new EventEmitter();
|
|
710
|
-
this.logoutClicked = new EventEmitter();
|
|
711
|
-
this.dropMenuChange = new EventEmitter();
|
|
712
|
-
this.showPattern = false;
|
|
713
|
-
this.translationFinished = false;
|
|
714
|
-
this.lastPosition = 0;
|
|
715
|
-
this.showNavMenu = false;
|
|
716
|
-
this.showUserMenu = false;
|
|
717
|
-
this.showReport = true;
|
|
718
|
-
this.showObservations = true;
|
|
719
|
-
this.showSubs = false;
|
|
720
|
-
}
|
|
721
|
-
set userName(fullName) {
|
|
722
|
-
this.fullName = fullName;
|
|
723
|
-
}
|
|
724
|
-
;
|
|
725
|
-
ngOnInit() {
|
|
726
|
-
this.url = window.location.href;
|
|
727
|
-
const baseUrl = this.envService.environment.resourceUrl;
|
|
728
|
-
const url = '/assets/artportalen/links-ap3.json';
|
|
729
|
-
this.subscription.add(this.httpClient.get(baseUrl + url).subscribe(result => {
|
|
730
|
-
this.navigation = result;
|
|
731
|
-
}));
|
|
732
|
-
this.initTranslations(baseUrl);
|
|
733
|
-
this.router.events.subscribe((event) => {
|
|
734
|
-
if (event instanceof NavigationEnd) {
|
|
735
|
-
this.showNavMenu = false;
|
|
736
|
-
this.dropMenuChange.emit(this.showNavMenu);
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
}
|
|
740
|
-
showMenuDropdown(show) {
|
|
741
|
-
this.showUserMenu = false;
|
|
742
|
-
if (this.showNavMenu !== show) {
|
|
743
|
-
this.showNavMenu = show;
|
|
744
|
-
this.dropMenuChange.emit(show);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
setLanguage(lang) {
|
|
748
|
-
this.trans.use(lang);
|
|
749
|
-
this.showNavMenu = false;
|
|
750
|
-
this.dropMenuChange.emit(false);
|
|
751
|
-
}
|
|
752
|
-
onUserClick() {
|
|
753
|
-
if (this.fullName) {
|
|
754
|
-
this.logout();
|
|
755
|
-
}
|
|
756
|
-
else {
|
|
757
|
-
this.login();
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
login() {
|
|
761
|
-
this.loginClicked.emit();
|
|
762
|
-
}
|
|
763
|
-
logout() {
|
|
764
|
-
this.logoutClicked.emit();
|
|
765
|
-
}
|
|
766
|
-
initTranslations(baseUrl) {
|
|
767
|
-
if (this.trans.store.translations[this.trans.currentLang]) {
|
|
768
|
-
this.loadTranslation(baseUrl, this.trans.currentLang);
|
|
769
|
-
}
|
|
770
|
-
this.subscription.add(this.trans.onLangChange.subscribe((event) => {
|
|
771
|
-
this.translationFinished = false;
|
|
772
|
-
this.loadTranslation(baseUrl, event.lang);
|
|
773
|
-
}));
|
|
774
|
-
}
|
|
775
|
-
loadTranslation(baseUrl, lang) {
|
|
776
|
-
//TODO: Prepare for diffents lang then en sv (en-GB) or add more files in devcomponentserver :)
|
|
777
|
-
const url = baseUrl + `/assets/artportalen/i18n/${lang}.json`;
|
|
778
|
-
this.subscription.add(this.httpClient.get(url).subscribe(translations => {
|
|
779
|
-
this.trans.setTranslation(lang, translations, true);
|
|
780
|
-
this.translationFinished = true;
|
|
781
|
-
}));
|
|
782
|
-
}
|
|
783
|
-
ngOnDestroy() {
|
|
784
|
-
this.subscription.unsubscribe();
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
/** @nocollapse */ ArtportalenNavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavComponent, deps: [{ token: i1.HttpClient }, { token: i2.Router }, { token: i3.TranslateService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
788
|
-
/** @nocollapse */ ArtportalenNavComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: ArtportalenNavComponent, 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 <header class=\"container-lg px-0\" *ngIf=\"translationFinished\">\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\">Artportalen beta</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 <div *ngIf=\"navigation\" 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\">Artportalen beta</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 <ng-container *ngIf=\"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 </ng-container>\r\n <ng-container *ngIf=\"!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 <a *ngIf=\"navigation\" class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n </ng-container>\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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showReport\" 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 <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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showObservations\" 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 </ul>\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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showSubs\" 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 <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</div>", directives: [{ type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
789
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavComponent, decorators: [{
|
|
790
|
-
type: Component,
|
|
791
|
-
args: [{ selector: 'adb-artportalen-nav', template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n <header class=\"container-lg px-0\" *ngIf=\"translationFinished\">\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\">Artportalen beta</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 <div *ngIf=\"navigation\" 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\">Artportalen beta</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 <ng-container *ngIf=\"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 </ng-container>\r\n <ng-container *ngIf=\"!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 <a *ngIf=\"navigation\" class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.currentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n </ng-container>\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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showReport\" 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 <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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showObservations\" 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 </ul>\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 <li class=\"list-group-item bg-primary pt-0 px-3\" *ngIf=\"showSubs\" 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 <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</div>" }]
|
|
792
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.Router }, { type: i3.TranslateService }, { type: EnvironmentService }]; }, propDecorators: { loginClicked: [{
|
|
793
|
-
type: Output
|
|
794
|
-
}], logoutClicked: [{
|
|
795
|
-
type: Output
|
|
796
|
-
}], dropMenuChange: [{
|
|
797
|
-
type: Output
|
|
798
|
-
}], showPattern: [{
|
|
799
|
-
type: Input
|
|
800
|
-
}], userName: [{
|
|
801
|
-
type: Input
|
|
802
|
-
}] } });
|
|
803
|
-
|
|
804
|
-
class ArtportalenFooterComponent {
|
|
805
|
-
constructor(httpClient, envService, trans) {
|
|
806
|
-
this.httpClient = httpClient;
|
|
807
|
-
this.envService = envService;
|
|
808
|
-
this.trans = trans;
|
|
809
|
-
this.subscription = new Subscription();
|
|
810
|
-
this.translationFinished = false;
|
|
811
|
-
}
|
|
812
|
-
ngOnInit() {
|
|
813
|
-
this.url = window.location.href;
|
|
814
|
-
this.baseUrl = this.envService.environment.resourceUrl;
|
|
815
|
-
this.initTranslations(this.baseUrl);
|
|
816
|
-
}
|
|
817
|
-
initTranslations(baseUrl) {
|
|
818
|
-
if (this.trans.store.translations[this.trans.currentLang]) {
|
|
819
|
-
this.loadTranslation(baseUrl, this.trans.currentLang);
|
|
820
|
-
}
|
|
821
|
-
this.subscription.add(this.trans.onLangChange.subscribe((event) => {
|
|
822
|
-
this.translationFinished = false;
|
|
823
|
-
this.loadTranslation(baseUrl, event.lang);
|
|
824
|
-
}));
|
|
825
|
-
}
|
|
826
|
-
loadTranslation(baseUrl, lang) {
|
|
827
|
-
//TODO: Prepare for diffents lang then en sv (en-GB) or add more files in devcomponentserver :)
|
|
828
|
-
const url = baseUrl + `/assets/artportalen/i18n/${lang}.json`;
|
|
829
|
-
this.subscription.add(this.httpClient.get(url).subscribe(translations => {
|
|
830
|
-
this.trans.setTranslation(lang, translations, true);
|
|
831
|
-
this.translationFinished = true;
|
|
832
|
-
}));
|
|
833
|
-
}
|
|
834
|
-
ngOnDestroy() {
|
|
835
|
-
this.subscription.unsubscribe();
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
/** @nocollapse */ ArtportalenFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenFooterComponent, deps: [{ token: i1.HttpClient }, { token: EnvironmentService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
839
|
-
/** @nocollapse */ ArtportalenFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: ArtportalenFooterComponent, selector: "adb-artportalen-footer", ngImport: i0, template: "<footer class=\"bg-primary-dark py-2 mt-auto container-fluid\" *ngIf=\"translationFinished\">\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.artdatabanken.se/artportalen/\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://www.artdatabanken.se/artportalen-tillganglighetsredogorelse\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a href=\"https://www.artdatabanken.se/om-oss/kontakt/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.artdatabanken.se/tjanster-och-miljodata/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.artdatabanken.se/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>", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
840
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenFooterComponent, decorators: [{
|
|
841
|
-
type: Component,
|
|
842
|
-
args: [{ selector: 'adb-artportalen-footer', template: "<footer class=\"bg-primary-dark py-2 mt-auto container-fluid\" *ngIf=\"translationFinished\">\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.artdatabanken.se/artportalen/\" class=\"d-block text-white mb-2\">{{'FOOTER.ABOUT'|translate}}</a>\r\n <a href=\"https://www.artdatabanken.se/artportalen-tillganglighetsredogorelse\" class=\"d-block text-white mb-2\">{{'FOOTER.WCAG'|translate}}</a>\r\n <a href=\"https://www.artdatabanken.se/om-oss/kontakt/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.artdatabanken.se/tjanster-och-miljodata/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.artdatabanken.se/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>" }]
|
|
843
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EnvironmentService }, { type: i3.TranslateService }]; } });
|
|
844
|
-
|
|
845
|
-
class ArtportalenNavModule {
|
|
846
|
-
static forRoot(environment) {
|
|
847
|
-
return {
|
|
848
|
-
ngModule: ArtportalenNavModule,
|
|
849
|
-
providers: [
|
|
850
|
-
EnvironmentService,
|
|
851
|
-
{
|
|
852
|
-
provide: 'env',
|
|
853
|
-
useValue: environment
|
|
854
|
-
}
|
|
855
|
-
]
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
/** @nocollapse */ ArtportalenNavModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
860
|
-
/** @nocollapse */ ArtportalenNavModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavModule, declarations: [ArtportalenNavComponent,
|
|
861
|
-
ArtportalenFooterComponent], imports: [CommonModule,
|
|
862
|
-
HttpClientModule,
|
|
863
|
-
RouterModule,
|
|
864
|
-
TranslateModule,
|
|
865
|
-
AdbDirectivesModule,
|
|
866
|
-
AdbDropdownModule,
|
|
867
|
-
AdbPagersModule], exports: [ArtportalenNavComponent,
|
|
868
|
-
ArtportalenFooterComponent] });
|
|
869
|
-
/** @nocollapse */ ArtportalenNavModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavModule, imports: [[
|
|
870
|
-
CommonModule,
|
|
871
|
-
HttpClientModule,
|
|
872
|
-
RouterModule,
|
|
873
|
-
TranslateModule,
|
|
874
|
-
AdbDirectivesModule,
|
|
875
|
-
AdbDropdownModule,
|
|
876
|
-
AdbPagersModule
|
|
877
|
-
]] });
|
|
878
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ArtportalenNavModule, decorators: [{
|
|
879
|
-
type: NgModule,
|
|
880
|
-
args: [{
|
|
881
|
-
declarations: [
|
|
882
|
-
ArtportalenNavComponent,
|
|
883
|
-
ArtportalenFooterComponent
|
|
884
|
-
],
|
|
885
|
-
imports: [
|
|
886
|
-
CommonModule,
|
|
887
|
-
HttpClientModule,
|
|
888
|
-
RouterModule,
|
|
889
|
-
TranslateModule,
|
|
890
|
-
AdbDirectivesModule,
|
|
891
|
-
AdbDropdownModule,
|
|
892
|
-
AdbPagersModule
|
|
893
|
-
],
|
|
894
|
-
exports: [
|
|
895
|
-
ArtportalenNavComponent,
|
|
896
|
-
ArtportalenFooterComponent
|
|
897
|
-
]
|
|
898
|
-
}]
|
|
899
|
-
}] });
|
|
900
|
-
|
|
901
|
-
class LocaleDatePipe {
|
|
902
|
-
constructor(translate) {
|
|
903
|
-
this.translate = translate;
|
|
904
|
-
}
|
|
905
|
-
transform(value, format) {
|
|
906
|
-
return new DatePipe(this.translate.currentLang).transform(value, format, null, this.translate.currentLang);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
/** @nocollapse */ LocaleDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocaleDatePipe, deps: [{ token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
910
|
-
/** @nocollapse */ LocaleDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocaleDatePipe, name: "adbLocaleDate", pure: false });
|
|
911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocaleDatePipe, decorators: [{
|
|
912
|
-
type: Pipe,
|
|
913
|
-
args: [{
|
|
914
|
-
name: 'adbLocaleDate',
|
|
915
|
-
pure: false
|
|
916
|
-
}]
|
|
917
|
-
}], ctorParameters: function () { return [{ type: i3.TranslateService }]; } });
|
|
918
|
-
|
|
919
|
-
class EmptyValuePipe {
|
|
920
|
-
transform(value) {
|
|
921
|
-
if (!value) {
|
|
922
|
-
return '-';
|
|
923
|
-
}
|
|
924
|
-
if (value.trim() === '') {
|
|
925
|
-
return '-';
|
|
926
|
-
}
|
|
927
|
-
return value;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
/** @nocollapse */ EmptyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EmptyValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
931
|
-
/** @nocollapse */ EmptyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EmptyValuePipe, name: "adbEmptyValue" });
|
|
932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: EmptyValuePipe, decorators: [{
|
|
933
|
-
type: Pipe,
|
|
934
|
-
args: [{
|
|
935
|
-
name: 'adbEmptyValue'
|
|
936
|
-
}]
|
|
937
|
-
}] });
|
|
938
|
-
|
|
939
|
-
class HighlightPipe {
|
|
940
|
-
constructor() {
|
|
941
|
-
this.forbiddenSymbols = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
|
|
942
|
-
}
|
|
943
|
-
transform(value, searchs) {
|
|
944
|
-
if (!value) {
|
|
945
|
-
return value;
|
|
946
|
-
}
|
|
947
|
-
value = value + '';
|
|
948
|
-
if (searchs) {
|
|
949
|
-
if (!Array.isArray(searchs)) {
|
|
950
|
-
searchs = searchs.split(' ').filter(s => s);
|
|
951
|
-
}
|
|
952
|
-
for (let search of searchs) {
|
|
953
|
-
if (this.forbiddenSymbols.test(search)) {
|
|
954
|
-
search = search.replace(this.forbiddenSymbols, '');
|
|
955
|
-
}
|
|
956
|
-
const normalizedSearch = this.normalizeText(search);
|
|
957
|
-
const normalizedValue = this.normalizeText(value);
|
|
958
|
-
const start = normalizedValue ? normalizedValue.indexOf(normalizedSearch) : -1;
|
|
959
|
-
if (start !== -1) {
|
|
960
|
-
const regex = new RegExp(`(${search})(?![^<]*>)`, 'gi');
|
|
961
|
-
const match = value.match(regex);
|
|
962
|
-
if (match) {
|
|
963
|
-
value = value.replace(regex, '<mark>$1</mark>');
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
return value;
|
|
969
|
-
}
|
|
970
|
-
normalizeText(text) {
|
|
971
|
-
return text === null || text === void 0 ? void 0 : text.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLocaleLowerCase();
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
/** @nocollapse */ HighlightPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
975
|
-
/** @nocollapse */ HighlightPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: HighlightPipe, name: "adbHighlight" });
|
|
976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: HighlightPipe, decorators: [{
|
|
977
|
-
type: Pipe,
|
|
978
|
-
args: [{
|
|
979
|
-
name: 'adbHighlight'
|
|
980
|
-
}]
|
|
981
|
-
}] });
|
|
982
|
-
|
|
983
|
-
class NumberSpacingPipe {
|
|
984
|
-
transform(value) {
|
|
985
|
-
// If value is empty, 0 is falsy so perform an extra check to not make '0' to an empty string
|
|
986
|
-
if (!value && value !== 0) {
|
|
987
|
-
return '';
|
|
988
|
-
}
|
|
989
|
-
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
/** @nocollapse */ NumberSpacingPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NumberSpacingPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
993
|
-
/** @nocollapse */ NumberSpacingPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NumberSpacingPipe, name: "adbSpacing", pure: false });
|
|
994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NumberSpacingPipe, decorators: [{
|
|
995
|
-
type: Pipe,
|
|
996
|
-
args: [{
|
|
997
|
-
name: 'adbSpacing',
|
|
998
|
-
pure: false
|
|
999
|
-
}]
|
|
1000
|
-
}] });
|
|
1001
|
-
|
|
1002
|
-
class AdbPipesModule {
|
|
1003
|
-
}
|
|
1004
|
-
/** @nocollapse */ AdbPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1005
|
-
/** @nocollapse */ AdbPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPipesModule, declarations: [HighlightPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe], exports: [HighlightPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe] });
|
|
1006
|
-
/** @nocollapse */ AdbPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPipesModule, imports: [[]] });
|
|
1007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbPipesModule, decorators: [{
|
|
1008
|
-
type: NgModule,
|
|
1009
|
-
args: [{
|
|
1010
|
-
imports: [],
|
|
1011
|
-
declarations: [HighlightPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe],
|
|
1012
|
-
exports: [HighlightPipe, NumberSpacingPipe, LocaleDatePipe, EmptyValuePipe]
|
|
1013
|
-
}]
|
|
1014
|
-
}] });
|
|
1015
|
-
|
|
1016
|
-
class AdbDatePickerComponent {
|
|
1017
|
-
constructor(elementRef, translate) {
|
|
1018
|
-
this.elementRef = elementRef;
|
|
1019
|
-
this.translate = translate;
|
|
1020
|
-
this.subscriptions = new Subscription();
|
|
1021
|
-
this.currentdDate = new Date();
|
|
1022
|
-
this.selectedDate = new Date();
|
|
1023
|
-
this.weekDays = AdbDatePickerComponent.WEEK_DAYS;
|
|
1024
|
-
this.noYearMode = false;
|
|
1025
|
-
this.selectDate = new EventEmitter();
|
|
1026
|
-
this.hide = new EventEmitter();
|
|
1027
|
-
}
|
|
1028
|
-
;
|
|
1029
|
-
ngOnInit() {
|
|
1030
|
-
var _a, _b, _c;
|
|
1031
|
-
if (this.settings) {
|
|
1032
|
-
if (((_a = this.settings) === null || _a === void 0 ? void 0 : _a.minDate) || ((_b = this.settings) === null || _b === void 0 ? void 0 : _b.maxDate)) {
|
|
1033
|
-
const minDate = AdbDatePickerComponent.parseDate(this.settings.minDate);
|
|
1034
|
-
const maxDate = AdbDatePickerComponent.parseDate(this.settings.maxDate);
|
|
1035
|
-
this.range = {
|
|
1036
|
-
start: minDate ? startOfDay(minDate) : subYears(new Date(), 1000),
|
|
1037
|
-
end: maxDate ? endOfDay(maxDate) : addYears(new Date(), 1000)
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
if (this.settings.noYear) {
|
|
1041
|
-
this.noYearMode = this.settings.noYear;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
this.selectedDate = this.currentdDate = (_c = this.initialDate) !== null && _c !== void 0 ? _c : new Date();
|
|
1045
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1046
|
-
this.createCalendar();
|
|
1047
|
-
}
|
|
1048
|
-
onShowYear() {
|
|
1049
|
-
this.months = null;
|
|
1050
|
-
this.loadYearsInterval();
|
|
1051
|
-
}
|
|
1052
|
-
onShowMonth() {
|
|
1053
|
-
this.years = null;
|
|
1054
|
-
this.loadMonths();
|
|
1055
|
-
}
|
|
1056
|
-
onSelectYear(inYear) {
|
|
1057
|
-
this.selectedDate.setFullYear(inYear.getFullYear());
|
|
1058
|
-
this.loadMonths();
|
|
1059
|
-
this.years = null;
|
|
1060
|
-
}
|
|
1061
|
-
onSelectMonth(inMonth) {
|
|
1062
|
-
this.selectedDate.setMonth(inMonth);
|
|
1063
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1064
|
-
this.createCalendar();
|
|
1065
|
-
this.years = null;
|
|
1066
|
-
this.months = null;
|
|
1067
|
-
}
|
|
1068
|
-
onPrev() {
|
|
1069
|
-
if (this.years) {
|
|
1070
|
-
this.selectedDate = subYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1071
|
-
this.loadYearsInterval();
|
|
1072
|
-
}
|
|
1073
|
-
else if (this.months) {
|
|
1074
|
-
this.selectedDate = subYears(this.selectedDate, 1);
|
|
1075
|
-
this.loadMonths();
|
|
1076
|
-
}
|
|
1077
|
-
else {
|
|
1078
|
-
this.selectedDate = subMonths(this.selectedDate, 1);
|
|
1079
|
-
this.createCalendar();
|
|
1080
|
-
}
|
|
1081
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1082
|
-
}
|
|
1083
|
-
onNext() {
|
|
1084
|
-
if (this.years) {
|
|
1085
|
-
this.selectedDate = addYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1086
|
-
this.loadYearsInterval();
|
|
1087
|
-
}
|
|
1088
|
-
else if (this.months) {
|
|
1089
|
-
this.selectedDate = addYears(this.selectedDate, 1);
|
|
1090
|
-
this.loadMonths();
|
|
1091
|
-
}
|
|
1092
|
-
else {
|
|
1093
|
-
this.selectedDate = addMonths(this.selectedDate, 1);
|
|
1094
|
-
this.createCalendar();
|
|
1095
|
-
}
|
|
1096
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1097
|
-
}
|
|
1098
|
-
ngOnDestroy() {
|
|
1099
|
-
this.subscriptions.unsubscribe();
|
|
1100
|
-
}
|
|
1101
|
-
loadMonths() {
|
|
1102
|
-
this.months = AdbDatePickerComponent.MONTHS.map(x => {
|
|
1103
|
-
return {
|
|
1104
|
-
value: x,
|
|
1105
|
-
isThisMonth: getMonth(this.selectedDate) === x && isSameYear(this.currentdDate, this.selectedDate)
|
|
1106
|
-
};
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
loadYearsInterval() {
|
|
1110
|
-
let year = subYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1111
|
-
const years = [];
|
|
1112
|
-
for (let i = 0; i < 16; i++) {
|
|
1113
|
-
years.push({
|
|
1114
|
-
value: year,
|
|
1115
|
-
title: year.getFullYear(),
|
|
1116
|
-
isThisYear: isSameYear(year, this.currentdDate)
|
|
1117
|
-
});
|
|
1118
|
-
year = addYears(year, 1);
|
|
1119
|
-
}
|
|
1120
|
-
this.years = years;
|
|
1121
|
-
}
|
|
1122
|
-
onSelectDate(day) {
|
|
1123
|
-
this.selectDate.emit(day.value);
|
|
1124
|
-
}
|
|
1125
|
-
createCalendar() {
|
|
1126
|
-
const weeks = [];
|
|
1127
|
-
const monthInterval = { start: startOfMonth(this.selectedDate), end: endOfMonth(this.selectedDate) };
|
|
1128
|
-
var fnsWweeks = eachWeekOfInterval(monthInterval, { weekStartsOn: this.translate.currentLang === 'sv' || this.translate.currentLang === 'sv-SE' ? 1 : 0 });
|
|
1129
|
-
for (const fnsWeek of fnsWweeks) {
|
|
1130
|
-
const week = { weekNumber: 0, days: [] };
|
|
1131
|
-
week.weekNumber = getISOWeek(new Date(fnsWeek));
|
|
1132
|
-
const weekInterval = { start: new Date(fnsWeek), end: addDays(new Date(fnsWeek), 6) };
|
|
1133
|
-
week.days = eachDayOfInterval(weekInterval).map(day => {
|
|
1134
|
-
day.setHours(getHours(new Date()));
|
|
1135
|
-
day.setMinutes(getMinutes(new Date()));
|
|
1136
|
-
return {
|
|
1137
|
-
value: day,
|
|
1138
|
-
isSelected: isSameYear(day, this.initialDate) && isSameDay(day, this.initialDate) && isSameMonth(day, this.initialDate),
|
|
1139
|
-
isInRange: this.range ? isWithinInterval(day, this.range) : true,
|
|
1140
|
-
isToday: isSameDay(day, new Date()),
|
|
1141
|
-
inMonth: monthInterval.start.getMonth() === day.getMonth()
|
|
1142
|
-
};
|
|
1143
|
-
});
|
|
1144
|
-
weeks.push(week);
|
|
1145
|
-
}
|
|
1146
|
-
this.weeks = weeks;
|
|
1147
|
-
}
|
|
1148
|
-
static parseDate(value) {
|
|
1149
|
-
if (typeof value === 'string') {
|
|
1150
|
-
if (isValid(parseISO(value))) {
|
|
1151
|
-
return parseISO(value);
|
|
1152
|
-
}
|
|
1153
|
-
else {
|
|
1154
|
-
return null;
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
else if (value instanceof Date) {
|
|
1158
|
-
return value;
|
|
1159
|
-
}
|
|
1160
|
-
else {
|
|
1161
|
-
return null;
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
AdbDatePickerComponent.MONTHS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1166
|
-
AdbDatePickerComponent.WEEK_DAYS = ['1', '2', '3', '4', '5', '6', '7'];
|
|
1167
|
-
AdbDatePickerComponent.YEAR_INTERVALL = 8;
|
|
1168
|
-
/** @nocollapse */ AdbDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1169
|
-
/** @nocollapse */ AdbDatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: AdbDatePickerComponent, selector: "adb-date-picker", inputs: { initialDate: "initialDate", settings: "settings", toLeft: "toLeft", id: "id" }, outputs: { selectDate: "selectDate", hide: "hide" }, 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\" style=\"width:350px\">\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()\" [class.active]=\"year.hasObservation\" [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()\" [class.active]=\"month.observation\" [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 m-2\" *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", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "adbLocaleDate": LocaleDatePipe, "date": i2$1.DatePipe, "translate": i3.TranslatePipe } });
|
|
1170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerComponent, decorators: [{
|
|
1171
|
-
type: Component,
|
|
1172
|
-
args: [{ selector: 'adb-date-picker', template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-white shadow rounded position-absolute\" style=\"width:350px\">\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()\" [class.active]=\"year.hasObservation\" [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()\" [class.active]=\"month.observation\" [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 m-2\" *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" }]
|
|
1173
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.TranslateService }]; }, propDecorators: { initialDate: [{
|
|
1174
|
-
type: Input
|
|
1175
|
-
}], settings: [{
|
|
1176
|
-
type: Input
|
|
1177
|
-
}], toLeft: [{
|
|
1178
|
-
type: Input
|
|
1179
|
-
}], id: [{
|
|
1180
|
-
type: HostBinding,
|
|
1181
|
-
args: ['id']
|
|
1182
|
-
}, {
|
|
1183
|
-
type: Input
|
|
1184
|
-
}], selectDate: [{
|
|
1185
|
-
type: Output
|
|
1186
|
-
}], hide: [{
|
|
1187
|
-
type: Output
|
|
1188
|
-
}] } });
|
|
1189
|
-
|
|
1190
|
-
class AdbDatePickerService {
|
|
1191
|
-
}
|
|
1192
|
-
/** @nocollapse */ AdbDatePickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1193
|
-
/** @nocollapse */ AdbDatePickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerService });
|
|
1194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerService, decorators: [{
|
|
1195
|
-
type: Injectable
|
|
1196
|
-
}] });
|
|
1197
|
-
|
|
1198
|
-
class AdbDatePickerDirective {
|
|
1199
|
-
constructor(viewContainerRef, renderer, elementRef, adbDatePickerService, translate) {
|
|
1200
|
-
this.viewContainerRef = viewContainerRef;
|
|
1201
|
-
this.renderer = renderer;
|
|
1202
|
-
this.elementRef = elementRef;
|
|
1203
|
-
this.adbDatePickerService = adbDatePickerService;
|
|
1204
|
-
this.translate = translate;
|
|
1205
|
-
this.autocomplete = 'off';
|
|
1206
|
-
this.subscriptions = new Subscription();
|
|
1207
|
-
this.format = 'yyyy-MM-dd';
|
|
1208
|
-
this.settings = null;
|
|
1209
|
-
this.pickOnly = true;
|
|
1210
|
-
this.onValidationChange = () => { };
|
|
1211
|
-
//ControlValueAccessor
|
|
1212
|
-
this.onChange = () => { };
|
|
1213
|
-
this.onTouched = () => { };
|
|
1214
|
-
}
|
|
1215
|
-
ngOnInit() {
|
|
1216
|
-
if (!this.pickOnly) {
|
|
1217
|
-
this.elementRef.nativeElement.setAttribute("placeholder", this.format);
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
onClick() {
|
|
1221
|
-
if (this.adbDatePickerService.viewRef) {
|
|
1222
|
-
this.adbDatePickerService.viewRef.destroy();
|
|
1223
|
-
}
|
|
1224
|
-
const viewRef = this.viewContainerRef.createComponent(AdbDatePickerComponent);
|
|
1225
|
-
viewRef.instance.settings = this.settings;
|
|
1226
|
-
viewRef.instance.toLeft = this.toLeft;
|
|
1227
|
-
viewRef.instance.initialDate = this.initialDate;
|
|
1228
|
-
this.id = this.getId();
|
|
1229
|
-
viewRef.instance.id = this.id;
|
|
1230
|
-
viewRef.instance.selectDate.subscribe((date) => {
|
|
1231
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(date, this.format, this.translate.currentLang));
|
|
1232
|
-
this.onChange(date);
|
|
1233
|
-
this.initialDate = date;
|
|
1234
|
-
this.onHide();
|
|
1235
|
-
});
|
|
1236
|
-
viewRef.instance.hide.subscribe(() => {
|
|
1237
|
-
this.onHide();
|
|
1238
|
-
});
|
|
1239
|
-
this.adbDatePickerService.viewRef = viewRef;
|
|
1240
|
-
}
|
|
1241
|
-
onKeyup(event) {
|
|
1242
|
-
if (!this.pickOnly) {
|
|
1243
|
-
const date = AdbDatePickerDirective.tryParse(event.target.value);
|
|
1244
|
-
if (date) {
|
|
1245
|
-
const now = new Date();
|
|
1246
|
-
date.setHours(now.getHours());
|
|
1247
|
-
date.setMinutes(now.getMinutes());
|
|
1248
|
-
date.setSeconds(now.getSeconds());
|
|
1249
|
-
this.onChange(date);
|
|
1250
|
-
}
|
|
1251
|
-
else {
|
|
1252
|
-
this.onChange(event.target.value); //send inccorect values to form
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
onHide() {
|
|
1257
|
-
this.adbDatePickerService.viewRef = null;
|
|
1258
|
-
this.viewContainerRef.detach();
|
|
1259
|
-
this.viewContainerRef.clear();
|
|
1260
|
-
}
|
|
1261
|
-
handleKeyboardEvent(event) {
|
|
1262
|
-
if (event.key === 'Tab') {
|
|
1263
|
-
this.onHide();
|
|
1264
|
-
}
|
|
1265
|
-
else if (this.pickOnly) {
|
|
1266
|
-
event.preventDefault();
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
onCheckOutSideClick(target) {
|
|
1270
|
-
var _a, _b;
|
|
1271
|
-
const nativeElement = (_b = (_a = this.adbDatePickerService.viewRef) === null || _a === void 0 ? void 0 : _a.instance.elementRef.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
1272
|
-
if (nativeElement) {
|
|
1273
|
-
if (nativeElement.id === this.id) {
|
|
1274
|
-
if (!target.hasAttribute('adbdatepicker')) {
|
|
1275
|
-
const clickedInside = nativeElement.contains(target);
|
|
1276
|
-
if (!clickedInside) {
|
|
1277
|
-
this.onHide();
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
ngOnDestroy() {
|
|
1284
|
-
this.subscriptions.unsubscribe();
|
|
1285
|
-
}
|
|
1286
|
-
//Validator
|
|
1287
|
-
validate(control) {
|
|
1288
|
-
const value = control.value;
|
|
1289
|
-
if (!value) {
|
|
1290
|
-
return null;
|
|
1291
|
-
}
|
|
1292
|
-
if (value instanceof Date) {
|
|
1293
|
-
return null;
|
|
1294
|
-
}
|
|
1295
|
-
if (typeof value === 'string' || value instanceof String) {
|
|
1296
|
-
const date = AdbDatePickerDirective.tryParse(value);
|
|
1297
|
-
if (!date) {
|
|
1298
|
-
return { date: true };
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
return null;
|
|
1302
|
-
}
|
|
1303
|
-
registerOnValidatorChange(fn) {
|
|
1304
|
-
this.onValidationChange = fn;
|
|
1305
|
-
}
|
|
1306
|
-
writeValue(value) {
|
|
1307
|
-
if (!value) {
|
|
1308
|
-
this.initialDate = null;
|
|
1309
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', '');
|
|
1310
|
-
return;
|
|
1311
|
-
}
|
|
1312
|
-
if (typeof value === 'string' || value instanceof String) {
|
|
1313
|
-
const date = AdbDatePickerDirective.tryParse(value);
|
|
1314
|
-
if (!date) {
|
|
1315
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
|
|
1316
|
-
return;
|
|
1317
|
-
}
|
|
1318
|
-
value = date;
|
|
1319
|
-
}
|
|
1320
|
-
if (value instanceof Date) {
|
|
1321
|
-
this.initialDate = value;
|
|
1322
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(this.initialDate, this.format, this.translate.currentLang));
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
registerOnChange(fn) {
|
|
1326
|
-
this.onChange = fn;
|
|
1327
|
-
}
|
|
1328
|
-
registerOnTouched(fn) {
|
|
1329
|
-
this.onTouched = fn;
|
|
1330
|
-
}
|
|
1331
|
-
setDisabledState(isDisabled) {
|
|
1332
|
-
this.viewContainerRef.clear();
|
|
1333
|
-
}
|
|
1334
|
-
static tryParse(dateString) {
|
|
1335
|
-
const parsed = parseISO(dateString);
|
|
1336
|
-
return isValid(parsed) ? parsed : null;
|
|
1337
|
-
}
|
|
1338
|
-
getId() {
|
|
1339
|
-
return '' + Math.floor(Math.random() * Date.now());
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
/** @nocollapse */ AdbDatePickerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: AdbDatePickerService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1343
|
-
/** @nocollapse */ AdbDatePickerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: AdbDatePickerDirective, selector: "input[adbDatepicker]", inputs: { format: "format", toLeft: "toLeft", settings: "settings", pickOnly: "pickOnly" }, host: { listeners: { "click": "onClick()", "keyup": "onKeyup($event)", "keyup.esc": "onHide()", "keydown": "handleKeyboardEvent($event)", "document:click": "onCheckOutSideClick($event.target)" }, properties: { "autocomplete": "this.autocomplete" } }, providers: [{
|
|
1344
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => AdbDatePickerDirective)),
|
|
1345
|
-
multi: true
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
provide: NG_VALIDATORS,
|
|
1349
|
-
useExisting: AdbDatePickerDirective,
|
|
1350
|
-
multi: true,
|
|
1351
|
-
},], ngImport: i0 });
|
|
1352
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerDirective, decorators: [{
|
|
1353
|
-
type: Directive,
|
|
1354
|
-
args: [{
|
|
1355
|
-
selector: `input[adbDatepicker]`,
|
|
1356
|
-
providers: [{
|
|
1357
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => AdbDatePickerDirective)),
|
|
1358
|
-
multi: true
|
|
1359
|
-
},
|
|
1360
|
-
{
|
|
1361
|
-
provide: NG_VALIDATORS,
|
|
1362
|
-
useExisting: AdbDatePickerDirective,
|
|
1363
|
-
multi: true,
|
|
1364
|
-
},]
|
|
1365
|
-
}]
|
|
1366
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: AdbDatePickerService }, { type: i3.TranslateService }]; }, propDecorators: { autocomplete: [{
|
|
1367
|
-
type: HostBinding,
|
|
1368
|
-
args: ['autocomplete']
|
|
1369
|
-
}], format: [{
|
|
1370
|
-
type: Input
|
|
1371
|
-
}], toLeft: [{
|
|
1372
|
-
type: Input
|
|
1373
|
-
}], settings: [{
|
|
1374
|
-
type: Input
|
|
1375
|
-
}], pickOnly: [{
|
|
1376
|
-
type: Input
|
|
1377
|
-
}], onClick: [{
|
|
1378
|
-
type: HostListener,
|
|
1379
|
-
args: ['click']
|
|
1380
|
-
}], onKeyup: [{
|
|
1381
|
-
type: HostListener,
|
|
1382
|
-
args: ['keyup', ['$event']]
|
|
1383
|
-
}], onHide: [{
|
|
1384
|
-
type: HostListener,
|
|
1385
|
-
args: ['keyup.esc']
|
|
1386
|
-
}], handleKeyboardEvent: [{
|
|
1387
|
-
type: HostListener,
|
|
1388
|
-
args: ['keydown', ['$event']]
|
|
1389
|
-
}], onCheckOutSideClick: [{
|
|
1390
|
-
type: HostListener,
|
|
1391
|
-
args: ['document:click', ['$event.target']]
|
|
1392
|
-
}] } });
|
|
1393
|
-
|
|
1394
|
-
class AdbDatePickerModule {
|
|
1395
|
-
}
|
|
1396
|
-
/** @nocollapse */ AdbDatePickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1397
|
-
/** @nocollapse */ AdbDatePickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerModule, declarations: [AdbDatePickerComponent, AdbDatePickerDirective], imports: [CommonModule, i3.TranslateModule, AdbPipesModule, AdbDirectivesModule], exports: [AdbDatePickerComponent, AdbDatePickerDirective] });
|
|
1398
|
-
/** @nocollapse */ AdbDatePickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerModule, providers: [AdbDatePickerService], imports: [[CommonModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule]] });
|
|
1399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbDatePickerModule, decorators: [{
|
|
1400
|
-
type: NgModule,
|
|
1401
|
-
args: [{
|
|
1402
|
-
imports: [CommonModule, TranslateModule.forChild(), AdbPipesModule, AdbDirectivesModule],
|
|
1403
|
-
declarations: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1404
|
-
exports: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1405
|
-
providers: [AdbDatePickerService]
|
|
1406
|
-
}]
|
|
1407
|
-
}] });
|
|
1408
|
-
|
|
1409
|
-
class AdbModalService {
|
|
1410
|
-
constructor(componentFactoryResolver, rendererFactory, appRef, injector) {
|
|
1411
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
1412
|
-
this.appRef = appRef;
|
|
1413
|
-
this.injector = injector;
|
|
1414
|
-
this.closeSubject = new Subject();
|
|
1415
|
-
this.close$ = this.closeSubject.asObservable();
|
|
1416
|
-
this.renderer = rendererFactory.createRenderer(null, null);
|
|
1417
|
-
}
|
|
1418
|
-
hide(confirm) {
|
|
1419
|
-
this.closeSubject.next(confirm);
|
|
1420
|
-
document.body.removeChild(this.domElem);
|
|
1421
|
-
document.body.removeChild(this.backdrop);
|
|
1422
|
-
this.renderer.removeClass(document.body, 'modal-open');
|
|
1423
|
-
this.closeSubject.unsubscribe();
|
|
1424
|
-
this.closeSubject = new Subject();
|
|
1425
|
-
this.close$ = this.closeSubject.asObservable();
|
|
1426
|
-
}
|
|
1427
|
-
showConfirm(model) {
|
|
1428
|
-
var _a, _b, _c, _d;
|
|
1429
|
-
this.renderer.addClass(document.body, 'modal-open');
|
|
1430
|
-
this.backdrop = this.renderer.createElement('div');
|
|
1431
|
-
this.backdrop.classList.add('modal-backdrop', 'fade', 'show');
|
|
1432
|
-
this.renderer.appendChild(document.body, this.backdrop);
|
|
1433
|
-
let componentRef = this.componentFactoryResolver.resolveComponentFactory(AdbConfirmModal).create(this.injector);
|
|
1434
|
-
model.header = (_a = model.header) !== null && _a !== void 0 ? _a : 'NOT_SET';
|
|
1435
|
-
model.text = (_b = model.text) !== null && _b !== void 0 ? _b : 'NOT_SET';
|
|
1436
|
-
model.confirm = (_c = model.confirm) !== null && _c !== void 0 ? _c : 'OK';
|
|
1437
|
-
model.decline = (_d = model.decline) !== null && _d !== void 0 ? _d : 'CANCEL';
|
|
1438
|
-
componentRef.instance.model = model;
|
|
1439
|
-
this.appRef.attachView(componentRef.hostView);
|
|
1440
|
-
this.domElem = componentRef.hostView.rootNodes[0];
|
|
1441
|
-
document.body.appendChild(this.domElem);
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
/** @nocollapse */ AdbModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1445
|
-
/** @nocollapse */ AdbModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalService });
|
|
1446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalService, decorators: [{
|
|
1447
|
-
type: Injectable
|
|
1448
|
-
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
1449
|
-
|
|
1450
|
-
class AdbConfirmModal {
|
|
1451
|
-
constructor(modalRef) {
|
|
1452
|
-
this.modalRef = modalRef;
|
|
1453
|
-
}
|
|
1454
|
-
onClose(confirm) {
|
|
1455
|
-
this.modalRef.hide(confirm);
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
/** @nocollapse */ AdbConfirmModal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbConfirmModal, deps: [{ token: AdbModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1459
|
-
/** @nocollapse */ AdbConfirmModal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: AdbConfirmModal, selector: "ng-component", inputs: { model: "model" }, ngImport: i0, template: "<div class=\"modal fade show\" *ngIf=\"model\">\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\" translate>{{model.header}}</h1>\r\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n {{model.text|translate}}\r\n <div *ngIf=\"model.value\">\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"text-right\">\r\n <button type=\"button\" class=\"btn btn-primary me-2\"\r\n (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n <button type=\"button\" class=\"btn btn-secondary\"\r\n (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
1460
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbConfirmModal, decorators: [{
|
|
1461
|
-
type: Component,
|
|
1462
|
-
args: [{ template: "<div class=\"modal fade show\" *ngIf=\"model\">\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\" translate>{{model.header}}</h1>\r\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n {{model.text|translate}}\r\n <div *ngIf=\"model.value\">\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"text-right\">\r\n <button type=\"button\" class=\"btn btn-primary me-2\"\r\n (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n <button type=\"button\" class=\"btn btn-secondary\"\r\n (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>" }]
|
|
1463
|
-
}], ctorParameters: function () { return [{ type: AdbModalService }]; }, propDecorators: { model: [{
|
|
1464
|
-
type: Input
|
|
1465
|
-
}] } });
|
|
1466
|
-
|
|
1467
|
-
class AdbModalModule {
|
|
1468
|
-
}
|
|
1469
|
-
/** @nocollapse */ AdbModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1470
|
-
/** @nocollapse */ AdbModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalModule, declarations: [AdbConfirmModal], imports: [CommonModule, i3.TranslateModule, AdbDirectivesModule], exports: [AdbConfirmModal] });
|
|
1471
|
-
/** @nocollapse */ AdbModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalModule, providers: [AdbModalService], imports: [[CommonModule, TranslateModule.forChild(), AdbDirectivesModule]] });
|
|
1472
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbModalModule, decorators: [{
|
|
1473
|
-
type: NgModule,
|
|
1474
|
-
args: [{
|
|
1475
|
-
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
1476
|
-
declarations: [AdbConfirmModal],
|
|
1477
|
-
exports: [AdbConfirmModal],
|
|
1478
|
-
providers: [AdbModalService]
|
|
1479
|
-
}]
|
|
1480
|
-
}] });
|
|
1481
|
-
|
|
1482
|
-
class AdbToastService {
|
|
1483
|
-
constructor(componentFactoryResolver, rendererFactory, appRef, injector) {
|
|
1484
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
1485
|
-
this.rendererFactory = rendererFactory;
|
|
1486
|
-
this.appRef = appRef;
|
|
1487
|
-
this.injector = injector;
|
|
1488
|
-
this.toasts = new Array();
|
|
1489
|
-
this.toastsSubject = new Subject();
|
|
1490
|
-
this.$toasts = this.toastsSubject.asObservable();
|
|
1491
|
-
}
|
|
1492
|
-
add(toastMessage, time = 4000) {
|
|
1493
|
-
this.addContainer();
|
|
1494
|
-
toastMessage.type = toastMessage.type ? toastMessage.type : ToastType.Success;
|
|
1495
|
-
toastMessage.index = this.toasts.length;
|
|
1496
|
-
toastMessage.delay = of(toastMessage).pipe(delay(time)).subscribe(toast => {
|
|
1497
|
-
this.remove(toast);
|
|
1498
|
-
});
|
|
1499
|
-
this.toasts.push(toastMessage);
|
|
1500
|
-
this.toastsSubject.next(this.toasts);
|
|
1501
|
-
}
|
|
1502
|
-
remove(toast) {
|
|
1503
|
-
var _a;
|
|
1504
|
-
this.toasts = (_a = this.toasts) === null || _a === void 0 ? void 0 : _a.filter(x => x.index !== toast.index);
|
|
1505
|
-
this.toastsSubject.next(this.toasts);
|
|
1506
|
-
}
|
|
1507
|
-
addContainer() {
|
|
1508
|
-
if (!this.container) {
|
|
1509
|
-
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
1510
|
-
//create container i top
|
|
1511
|
-
this.container = this.renderer.createElement('div');
|
|
1512
|
-
this.renderer.appendChild(document.body, this.container);
|
|
1513
|
-
let componentRef = this.componentFactoryResolver.resolveComponentFactory(AdbToast).create(this.injector);
|
|
1514
|
-
this.appRef.attachView(componentRef.hostView);
|
|
1515
|
-
const element = componentRef.hostView.rootNodes[0];
|
|
1516
|
-
this.container.prepend(element);
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
|
-
/** @nocollapse */ AdbToastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1521
|
-
/** @nocollapse */ AdbToastService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastService });
|
|
1522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastService, decorators: [{
|
|
1523
|
-
type: Injectable
|
|
1524
|
-
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
1525
|
-
var ToastType;
|
|
1526
|
-
(function (ToastType) {
|
|
1527
|
-
ToastType[ToastType["Info"] = 1] = "Info";
|
|
1528
|
-
ToastType[ToastType["Success"] = 2] = "Success";
|
|
1529
|
-
ToastType[ToastType["Warn"] = 3] = "Warn";
|
|
1530
|
-
})(ToastType || (ToastType = {}));
|
|
1531
|
-
|
|
1532
|
-
class AdbToast {
|
|
1533
|
-
constructor(toastService) {
|
|
1534
|
-
this.toastService = toastService;
|
|
1535
|
-
this.toastType = ToastType;
|
|
1536
|
-
this.toastService.$toasts.subscribe(toasts => {
|
|
1537
|
-
this.toasts = toasts;
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
onRemoveToast(toast) {
|
|
1541
|
-
this.toastService.remove(toast);
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
/** @nocollapse */ AdbToast.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToast, deps: [{ token: AdbToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1545
|
-
/** @nocollapse */ AdbToast.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: AdbToast, selector: "ng-component", ngImport: i0, template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\">\r\n <div class=\"text-white px-3 pb-3 pt-2 mb-2\" *ngFor=\"let toast of toasts\"\r\n [class.bg-success]=\"toast.type===toastType.Success\" [class.bg-info]=\"toast.type===toastType.Info\" [class.bg-danger]=\"toast.type===toastType.Warn\">\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\" *ngIf=\"toast.header\">\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n <button class=\"btn top-0 end-0 btn p-0 ms-2 text-white\" (click)=\"onRemoveToast(toast)\"><i class=\"fas fa-times\"></i></button>\r\n </div>\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n <div *ngIf=\"!toast.messageValue\">{{toast.message|translate}}</div>\r\n <div *ngIf=\"toast.messageValue\">{{(toast.message|translate:{value:toast.messageValue} )}}</div>\r\n <button *ngIf=\"!toast.header\" class=\"btn p-0 ms-2 text-white\" (click)=\"onRemoveToast(toast)\"><i class=\"fas fa-times\"></i></button>\r\n </div>\r\n </div>\r\n</div>", directives: [{ type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i3.TranslatePipe } });
|
|
1546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToast, decorators: [{
|
|
1547
|
-
type: Component,
|
|
1548
|
-
args: [{ template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\">\r\n <div class=\"text-white px-3 pb-3 pt-2 mb-2\" *ngFor=\"let toast of toasts\"\r\n [class.bg-success]=\"toast.type===toastType.Success\" [class.bg-info]=\"toast.type===toastType.Info\" [class.bg-danger]=\"toast.type===toastType.Warn\">\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\" *ngIf=\"toast.header\">\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n <button class=\"btn top-0 end-0 btn p-0 ms-2 text-white\" (click)=\"onRemoveToast(toast)\"><i class=\"fas fa-times\"></i></button>\r\n </div>\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n <div *ngIf=\"!toast.messageValue\">{{toast.message|translate}}</div>\r\n <div *ngIf=\"toast.messageValue\">{{(toast.message|translate:{value:toast.messageValue} )}}</div>\r\n <button *ngIf=\"!toast.header\" class=\"btn p-0 ms-2 text-white\" (click)=\"onRemoveToast(toast)\"><i class=\"fas fa-times\"></i></button>\r\n </div>\r\n </div>\r\n</div>" }]
|
|
1549
|
-
}], ctorParameters: function () { return [{ type: AdbToastService }]; } });
|
|
1550
|
-
|
|
1551
|
-
class AdbToastModule {
|
|
1552
|
-
}
|
|
1553
|
-
/** @nocollapse */ AdbToastModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1554
|
-
/** @nocollapse */ AdbToastModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastModule, declarations: [AdbToast], imports: [CommonModule, i3.TranslateModule, AdbDirectivesModule], exports: [AdbToast] });
|
|
1555
|
-
/** @nocollapse */ AdbToastModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastModule, providers: [AdbToastService], imports: [[CommonModule, TranslateModule.forChild(), AdbDirectivesModule]] });
|
|
1556
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbToastModule, decorators: [{
|
|
1557
|
-
type: NgModule,
|
|
1558
|
-
args: [{
|
|
1559
|
-
imports: [CommonModule, TranslateModule.forChild(), AdbDirectivesModule],
|
|
1560
|
-
declarations: [AdbToast],
|
|
1561
|
-
exports: [AdbToast],
|
|
1562
|
-
providers: [AdbToastService]
|
|
1563
|
-
}]
|
|
1564
|
-
}] });
|
|
1565
|
-
|
|
1566
|
-
class AdbHelpButtonComponent {
|
|
1567
|
-
constructor(elementRef) {
|
|
1568
|
-
this.elementRef = elementRef;
|
|
1569
|
-
this.showHelp = false;
|
|
1570
|
-
}
|
|
1571
|
-
ngOnInit() {
|
|
1572
|
-
this.id = +Math.floor(Math.random() * Date.now());
|
|
1573
|
-
}
|
|
1574
|
-
onClick() {
|
|
1575
|
-
const node = this.elementRef.nativeElement.parentNode;
|
|
1576
|
-
if (node) {
|
|
1577
|
-
if (this.showHelp) {
|
|
1578
|
-
node.classList.remove('position-relative');
|
|
1579
|
-
}
|
|
1580
|
-
else {
|
|
1581
|
-
node.classList.add('position-relative');
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
this.showHelp = !this.showHelp;
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
/** @nocollapse */ AdbHelpButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbHelpButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1588
|
-
/** @nocollapse */ AdbHelpButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: AdbHelpButtonComponent, selector: "adb-help-button", ngImport: i0, template: "<div>\r\n <button type=\"button\" id=\"help-button\" tabindex=\"-1\" (adbClickOutside)=\"showHelp=false\" class=\"ms-auto btn btn-help p-0 w-auto\" \r\n [attr.aria-controls]=\"id\" attr.aria-label=\"Help\" [attr.aria-expanded]=\"showHelp\" (click)=\"onClick()\">\r\n </button>\r\n</div>\r\n<div>\r\n <div *ngIf=\"showHelp\" [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><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</div>", directives: [{ type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1589
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbHelpButtonComponent, decorators: [{
|
|
1590
|
-
type: Component,
|
|
1591
|
-
args: [{ selector: 'adb-help-button', template: "<div>\r\n <button type=\"button\" id=\"help-button\" tabindex=\"-1\" (adbClickOutside)=\"showHelp=false\" class=\"ms-auto btn btn-help p-0 w-auto\" \r\n [attr.aria-controls]=\"id\" attr.aria-label=\"Help\" [attr.aria-expanded]=\"showHelp\" (click)=\"onClick()\">\r\n </button>\r\n</div>\r\n<div>\r\n <div *ngIf=\"showHelp\" [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><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</div>" }]
|
|
1592
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
1593
|
-
|
|
1594
|
-
class AdbButtonsModule {
|
|
1595
|
-
}
|
|
1596
|
-
/** @nocollapse */ AdbButtonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbButtonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1597
|
-
/** @nocollapse */ AdbButtonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbButtonsModule, declarations: [AdbHelpButtonComponent], imports: [CommonModule, AdbDirectivesModule], exports: [AdbHelpButtonComponent] });
|
|
1598
|
-
/** @nocollapse */ AdbButtonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbButtonsModule, imports: [[CommonModule, AdbDirectivesModule]] });
|
|
1599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AdbButtonsModule, decorators: [{
|
|
1600
|
-
type: NgModule,
|
|
1601
|
-
args: [{
|
|
1602
|
-
imports: [CommonModule, AdbDirectivesModule],
|
|
1603
|
-
declarations: [AdbHelpButtonComponent],
|
|
1604
|
-
exports: [AdbHelpButtonComponent]
|
|
1605
|
-
}]
|
|
1606
|
-
}] });
|
|
1607
|
-
|
|
1608
|
-
/*
|
|
1609
|
-
* Public API Surface of artdata-shared
|
|
1610
|
-
*/
|
|
1611
|
-
|
|
1612
|
-
/**
|
|
1613
|
-
* Generated bundle index. Do not edit.
|
|
1614
|
-
*/
|
|
1615
|
-
|
|
1616
|
-
export { ADBFooterComponent, ADBHeaderModule, ADBNavComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdownDirective, AdbDropdownModule, AdbHelpButtonComponent, AdbModalModule, AdbModalService, AdbPagersModule, AdbPipesModule, AdbToast, AdbToastModule, AdbToastService, ArtportalenFooterComponent, ArtportalenNavComponent, ArtportalenNavModule, ClickOutsideDirective, EmptyValuePipe, FileUploadDirective, FocusDirective, HighlightPipe, InfiniteScrollComponent, LocaleDatePipe, NumberSpacingPipe, PagerComponent, PagerInlineComponent, RedListBadgeClassDirective, ToastType };
|
|
1617
|
-
//# sourceMappingURL=adb-shared.mjs.map
|