adb-shared 7.0.12 → 7.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/adb-shared.mjs +909 -841
- package/fesm2022/adb-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/types/adb-shared.d.ts +107 -70
package/fesm2022/adb-shared.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
2
|
import { CommonModule, DatePipe, formatDate } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Inject, Injectable, EventEmitter, HostListener, Output, Directive, Input, HostBinding, NgModule, ChangeDetectionStrategy, Component, output, input, Pipe, forwardRef, createComponent, signal,
|
|
4
|
+
import { Inject, Injectable, EventEmitter, HostListener, Output, Directive, Input, HostBinding, NgModule, ChangeDetectionStrategy, Component, output, input, Pipe, InjectionToken, forwardRef, createComponent, signal, model, contentChild, TemplateRef, ContentChild } from '@angular/core';
|
|
5
5
|
import * as i1$2 from '@angular/common/http';
|
|
6
6
|
import { provideHttpClient, withInterceptorsFromDi, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
7
7
|
import * as i1 from '@angular/router';
|
|
@@ -9,9 +9,9 @@ import { NavigationEnd, RouterModule, NavigationStart } from '@angular/router';
|
|
|
9
9
|
import * as i1$1 from '@ngx-translate/core';
|
|
10
10
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
11
11
|
import { Subscription, Subject, of, BehaviorSubject, catchError, throwError, map as map$1, tap } from 'rxjs';
|
|
12
|
+
import * as i1$3 from '@angular/forms';
|
|
13
|
+
import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS } from '@angular/forms';
|
|
12
14
|
import { endOfDay, addYears, startOfDay, subYears, getMonth, subMonths, addMonths, isSameYear, endOfMonth, startOfMonth, eachWeekOfInterval, getISOWeek, addDays, eachDayOfInterval, getHours, getMinutes, isSameDay, isWithinInterval, isSameMonth, isValid, parseISO, addSeconds, format } from 'date-fns';
|
|
13
|
-
import * as i1$4 from '@angular/forms';
|
|
14
|
-
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
|
|
15
15
|
import { delay, debounceTime, switchMap, map, catchError as catchError$1 } from 'rxjs/operators';
|
|
16
16
|
|
|
17
17
|
class EnvironmentService {
|
|
@@ -451,7 +451,7 @@ class ArtportalenNavComponent {
|
|
|
451
451
|
this.subscription.unsubscribe();
|
|
452
452
|
}
|
|
453
453
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ArtportalenNavComponent, deps: [{ token: i1$2.HttpClient }, { token: i1.Router }, { token: i1$1.TranslateService }, { token: EnvironmentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
454
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: ArtportalenNavComponent, isStandalone: false, selector: "adb-artportalen-nav", inputs: { showPattern: "showPattern", userName: "userName" }, outputs: { loginClicked: "loginClicked", logoutClicked: "logoutClicked", dropMenuChange: "dropMenuChange" }, ngImport: i0, template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n @if (translationFinished) {\r\n <header class=\"container-lg px-0\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"px-1 d-flex flex-wrap align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-2\">\r\n <a class=\"d-flex text-white text-decoration-none d-flex gap-2\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <img class=\"d-none d-sm-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n <a [href]=\"$safeNavigationMigration(navigation?.home)\" class=\"text-white text-decoration-none fs-1 fw-bold\">{{'HEADER.TITLE'|translate}}</a>\r\n </nav>\r\n <div class=\"ms-auto d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"d-none d-md-block btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\" title=\"{{'HEADER.MENY'|translate}}\" attr.aria-label=\"{{'HEADER.MENY'|translate}}\" (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"bi bi-list\"></i>\r\n <small class=\"ms-2 d-none d-md-inline-block\">{{'HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"d-flex justify-content-center d-md-none p-2 border-dark border-top\">\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\" (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n </header>\r\n }\r\n @if (navigation) {\r\n <div role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\" [class.show]=\"showNavMenu\" tabindex=\"-1\" aria-labelledby=\"offcanvasNav\">\r\n <div class=\"offcanvas-header\">\r\n <h1 class=\"offcanvas-title h-section mb-0\" id=\"offcanvasNav\"><a [href]=\"navigation.home\" class=\"text-white text-decoration-none\">{{'HEADER.TITLE'|translate}}</a></h1>\r\n <button type=\"button\" class=\"btn-close btn-close-white\" attr.aria-label=\"{{'CLOSE'|translate}}\" (click)=\"showMenuDropdown(false)\"></button>\r\n </div>\r\n <div class=\"offcanvas-body d-flex flex-column p-0\">\r\n <div class=\"px-3\">\r\n <div class=\"d-flex flex-wrap justify-content-between align-items-center mb-2 gap-1 px-2\">\r\n @if (fullName) {\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n }\r\n @if (!fullName) {\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n @if (navigation) {\r\n <a class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.getCurrentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n }\r\n }\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showReport?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.report.url}}\">\r\n {{navigation.report.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showReport = !showReport\" attr.aria-controls=\"report-links\" attr.aria-expanded=\"{{showReport}}\">\r\n <span class=\"bi\" [ngClass]=\"showReport?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showReport) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"report-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.checklist.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.checklist.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.report.url}}\">\r\n {{'HEADER.REPORT'|translate}}\r\n </a>\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex \">\r\n <a href=\"{{navigation.wanted.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.wanted.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showObservations?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.observations.url}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showObservations = !showObservations\" attr.aria-controls=\"observations-links\" attr.aria-expanded=\"{{showObservations}}\">\r\n <span class=\"bi\" [ngClass]=\"showObservations?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showObservations) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"observations-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}\">\r\n {{'HEADER.TODAYS_OBSERVATIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-0\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fieldDiary.url}}\">\r\n {{'HEADER.FIELD_DIARY'|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showSubs?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <button class=\"btn btn-link p-0 text-white w-100 text-start\" (click)=\"showSubs = !showSubs\">\r\n {{navigation.subcriptions.transId|translate}}\r\n </button>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showSubs = !showSubs\" attr.aria-controls=\"subs-links\" attr.aria-expanded=\"{{showSubs}}\">\r\n <span class=\"bi\" [ngClass]=\"showSubs?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showSubs) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"subs-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.subcriptions.url}}\">\r\n {{'HEADER.MY_SUBSCRIPTIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.events.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.events.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fyndregler.url}}\">\r\n {{navigation.fyndregler.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artportalenUrl\">\r\n Artportalen.se\r\n </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 </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 </a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\"> </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
454
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: ArtportalenNavComponent, isStandalone: false, selector: "adb-artportalen-nav", inputs: { showPattern: "showPattern", userName: "userName" }, outputs: { loginClicked: "loginClicked", logoutClicked: "logoutClicked", dropMenuChange: "dropMenuChange" }, ngImport: i0, template: "<div class=\"bg-primary adb-main-header position-static\" (adbClickOutside)=\"showMenuDropdown(false);\">\r\n @if (translationFinished) {\r\n <header class=\"container-lg px-0\">\r\n <div [attr.id]=\"showPattern?'banner':''\" class=\"px-1 d-flex flex-wrap align-items-center gap-2\">\r\n <nav class=\"d-flex flex-grow-1 align-items-center pe-2 py-2 gap-2\">\r\n <a class=\"d-flex text-white text-decoration-none d-flex gap-2\" href=\"https://www.artdatabanken.se/\" target=\"new\">\r\n <img style=\"height: 2rem;\" src=\"/assets/images/slu.svg\" alt=\"logo\">\r\n <div class=\"border-end d-none d-sm-block\"></div>\r\n <img class=\"d-none d-sm-block align-self-center pe-5\" style=\"height: 0.7rem;\" src=\"/assets/images/artdatabanken.svg\" alt=\"logo\">\r\n </a>\r\n <a [href]=\"$safeNavigationMigration(navigation?.home)\" class=\"text-white text-decoration-none fs-1 fw-bold\">{{'HEADER.TITLE'|translate}}</a>\r\n </nav>\r\n <div class=\"ms-auto d-flex align-items-center gap-2\">\r\n <div><ng-content></ng-content></div>\r\n <div>\r\n <button class=\"d-none d-md-block btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n <div>\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\" title=\"{{'HEADER.MENY'|translate}}\" attr.aria-label=\"{{'HEADER.MENY'|translate}}\" (click)=\"showMenuDropdown(!showNavMenu)\">\r\n <i class=\"bi bi-list\"></i>\r\n <small class=\"ms-2 d-none d-md-inline-block\">{{'HEADER.MENY'|translate}}</small>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"d-flex justify-content-center d-md-none p-2 border-dark border-top\">\r\n <button class=\"btn btn-primary-dark btn-lg\" type=\"button\"\r\n title=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\"\r\n attr.aria-label=\"{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}\" (click)=\"onUserClick()\">\r\n <small>{{(!fullName ? 'HEADER.LOGIN' : 'HEADER.LOGOUT')|translate}}</small>\r\n </button>\r\n </div>\r\n </header>\r\n }\r\n @if (navigation) {\r\n <div role=\"dialog\" class=\"offcanvas offcanvas-end bg-primary text-white\" [class.show]=\"showNavMenu\" tabindex=\"-1\" aria-labelledby=\"offcanvasNav\">\r\n <div class=\"offcanvas-header\">\r\n <h1 class=\"offcanvas-title h-section mb-0\" id=\"offcanvasNav\"><a [href]=\"navigation.home\" class=\"text-white text-decoration-none\">{{'HEADER.TITLE'|translate}}</a></h1>\r\n <button type=\"button\" class=\"btn-close btn-close-white\" attr.aria-label=\"{{'CLOSE'|translate}}\" (click)=\"showMenuDropdown(false)\"></button>\r\n </div>\r\n <div class=\"offcanvas-body d-flex flex-column p-0\">\r\n <div class=\"px-3\">\r\n <div class=\"d-flex flex-wrap justify-content-between align-items-center mb-2 gap-1 px-2\">\r\n @if (fullName) {\r\n <div>\r\n <button (click)=\"logout()\" type=\"button\" class=\"btn btn-primary-dark\">\r\n {{'HEADER.LOGOUT'|translate}}\r\n </button>\r\n </div>\r\n <div>{{fullName}}</div>\r\n }\r\n @if (!fullName) {\r\n <div class=\"text-center\">\r\n <button type=\"button\" class=\"btn btn-primary-dark\" (click)=\"login()\" id=\"start-login\">{{'HEADER.LOGIN'|translate}}</button>\r\n </div>\r\n @if (navigation) {\r\n <a class=\"text-white\" href=\"{{navigation.createAccountLink}}?lang={{trans.getCurrentLang}}&returnUrl={{url}}\">\r\n {{'HEADER.CREATE_USER'|translate}}\r\n </a>\r\n }\r\n }\r\n </div>\r\n <ul class=\"list-group list-group-flush border-top\">\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showReport?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.report.url}}\">\r\n {{navigation.report.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showReport = !showReport\" attr.aria-controls=\"report-links\" attr.aria-expanded=\"{{showReport}}\">\r\n <span class=\"bi\" [ngClass]=\"showReport?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showReport) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"report-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.checklist.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.checklist.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.report.url}}\">\r\n {{'HEADER.REPORT'|translate}}\r\n </a>\r\n <li class=\"d-block py-1\">\r\n <div class=\"d-flex \">\r\n <a href=\"{{navigation.wanted.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.wanted.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showObservations?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <a class=\"py-1 text-white flex-grow-1\" href=\"{{navigation.observations.url}}\">\r\n {{navigation.observations.transId|translate}}\r\n </a>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showObservations = !showObservations\" attr.aria-controls=\"observations-links\" attr.aria-expanded=\"{{showObservations}}\">\r\n <span class=\"bi\" [ngClass]=\"showObservations?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showObservations) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"observations-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.observations.url}}\">\r\n {{'HEADER.TODAYS_OBSERVATIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"d-block py-0\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fieldDiary.url}}\">\r\n {{'HEADER.FIELD_DIARY'|translate}}\r\n </a>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\" [ngClass]=\"showSubs?'border-bottom-0 pb-0':''\">\r\n <div class=\"d-flex justify-content-between gap-2\">\r\n <button class=\"btn btn-link p-0 text-white w-100 text-start\" (click)=\"showSubs = !showSubs\">\r\n {{navigation.subcriptions.transId|translate}}\r\n </button>\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"showSubs = !showSubs\" attr.aria-controls=\"subs-links\" attr.aria-expanded=\"{{showSubs}}\">\r\n <span class=\"bi\" [ngClass]=\"showSubs?'bi-chevron-up':'bi-chevron-down'\"></span>\r\n </button>\r\n </div>\r\n </li>\r\n @if (showSubs) {\r\n <li class=\"list-group-item bg-primary pt-0 px-3\" id=\"subs-links\">\r\n <ul class=\"list-unstyled\">\r\n <li class=\"d-block py-1\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.subcriptions.url}}\">\r\n {{'HEADER.MY_SUBSCRIPTIONS'|translate}}\r\n </a>\r\n </li>\r\n <li class=\"py-1\">\r\n <div class=\"d-flex\">\r\n <a href=\"{{navigation.events.url}}\" class=\"text-white flex-grow-1\">\r\n {{navigation.events.transId|translate}}\r\n </a>\r\n </div>\r\n </li>\r\n </ul>\r\n </li>\r\n }\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block py-1 text-white\" href=\"{{navigation.fyndregler.url}}\">\r\n {{navigation.fyndregler.transId|translate}}\r\n </a>\r\n </li>\r\n <li class=\"list-group-item bg-primary\">\r\n <a class=\"d-block fw-bold py-1 text-white\" [href]=\"navigation.artportalenUrl\">\r\n Artportalen.se\r\n </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 </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 </a>\r\n </small>\r\n </li>\r\n </ul>\r\n </div>\r\n <div id=\"pattern\" class=\"flex-grow-1\"> </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
455
455
|
}
|
|
456
456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: ArtportalenNavComponent, decorators: [{
|
|
457
457
|
type: Component,
|
|
@@ -766,7 +766,7 @@ class PagerComponent extends PagerBaseDirective {
|
|
|
766
766
|
this.subscription.unsubscribe();
|
|
767
767
|
}
|
|
768
768
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PagerComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
769
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PagerComponent, isStandalone: false, selector: "adb-pager-nav", inputs: { offsetName: "offsetName", infiniteLimit: "infiniteLimit" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) { <nav class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination flex-wrap mb-0\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.first\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\" [attr.tabindex]=\"currentPage === 1 ? -1 : null\"\r\n aria-label=\"F\u00F6rsta sidan\">\r\n <span class=\"bi bi-chevron-double-left\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.prev\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\" [attr.tabindex]=\"currentPage === 1 ? -1 : null\"\r\n aria-label=\"F\u00F6reg\u00E5ende\">\r\n <span class=\"bi bi-chevron-left\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n @for (page of params.pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage===page.name\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\" [attr.aria-current]=\"currentPage == page.name ? 'page' : null\" queryParamsHandling=\"merge\" [attr.aria-label]=\"'Sida ' + page.name\">{{page.name}}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.next\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage>=amountOfPages}\" [attr.aria-disabled]=\"currentPage>=amountOfPages\"\r\n [attr.tabindex]=\"currentPage>=amountOfPages ? -1 : null\" aria-label=\"N\u00E4sta sida\">\r\n <span class=\"bi bi-chevron-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) { <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\" [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-25':currentPage>=amountOfPages}\"\r\n [attr.tabindex]=\"currentPage>=amountOfPages ? -1 : null\" aria-label=\"Sista sida\">\r\n <span class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\" [attr.aria-disabled]=\"currentPage >= amountOfPages\" [ngClass]=\"{'pe-none opacity-50': currentPage >= amountOfPages}\"\r\n [attr.tabindex]=\"currentPage >= amountOfPages ? -1 : null\" aria-label=\"Sista sidan\">\r\n <span class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n }", dependencies: [{ kind: "directive", type:
|
|
769
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PagerComponent, isStandalone: false, selector: "adb-pager-nav", inputs: { offsetName: "offsetName", infiniteLimit: "infiniteLimit" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) { <nav class=\"d-flex justify-content-end my-1\">\r\n <ul class=\"pagination flex-wrap mb-0\">\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.first\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\" [attr.tabindex]=\"currentPage === 1 ? -1 : null\"\r\n aria-label=\"F\u00F6rsta sidan\">\r\n <span class=\"bi bi-chevron-double-left\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.prev\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage===1}\" [attr.aria-disabled]=\"currentPage===1\" [attr.tabindex]=\"currentPage === 1 ? -1 : null\"\r\n aria-label=\"F\u00F6reg\u00E5ende\">\r\n <span class=\"bi bi-chevron-left\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n @for (page of params.pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage===page.name\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"page.params\" [attr.aria-current]=\"currentPage == page.name ? 'page' : null\" queryParamsHandling=\"merge\" [attr.aria-label]=\"'Sida ' + page.name\">{{page.name}}</a>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.next\" queryParamsHandling=\"merge\" [ngClass]=\"{'pe-none opacity-25':currentPage>=amountOfPages}\" [attr.aria-disabled]=\"currentPage>=amountOfPages\"\r\n [attr.tabindex]=\"currentPage>=amountOfPages ? -1 : null\" aria-label=\"N\u00E4sta sida\">\r\n <span class=\"bi bi-chevron-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) { <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\" [attr.aria-disabled]=\"currentPage>=amountOfPages\" [ngClass]=\"{'pe-none opacity-25':currentPage>=amountOfPages}\"\r\n [attr.tabindex]=\"currentPage>=amountOfPages ? -1 : null\" aria-label=\"Sista sida\">\r\n <span class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <a class=\"page-link\" [routerLink]=\"[]\" [queryParams]=\"params.last\" queryParamsHandling=\"merge\" [attr.aria-disabled]=\"currentPage >= amountOfPages\" [ngClass]=\"{'pe-none opacity-50': currentPage >= amountOfPages}\"\r\n [attr.tabindex]=\"currentPage >= amountOfPages ? -1 : null\" aria-label=\"Sista sidan\">\r\n <span class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></span>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n }", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
770
770
|
}
|
|
771
771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PagerComponent, decorators: [{
|
|
772
772
|
type: Component,
|
|
@@ -811,7 +811,7 @@ class PagerInlineComponent extends PagerBaseDirective {
|
|
|
811
811
|
this.calculatePages();
|
|
812
812
|
}
|
|
813
813
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PagerInlineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
814
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PagerInlineComponent, isStandalone: false, selector: "adb-pager", inputs: { infiniteLimit: "infiniteLimit" }, outputs: { pageChanged: "pageChanged" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) { <nav class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination flex-wrap\">\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onFirstClick()\" [ngClass]=\"currentPage==1?'opacity-25 pe-none':''\" [disabled]=\"currentPage==1\" aria-label=\"F\u00F6rsta sidan\">\r\n <i class=\"bi bi-chevron-double-left\" aria-hidden=\"true\"></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-25 pe-none':''\" [disabled]=\"currentPage==1\" aria-label=\"F\u00F6reg\u00E5ende sida\">\r\n <i class=\"bi bi-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n @for (page of pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage==page\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onNextClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"N\u00E4sta sida\">\r\n <i class=\"bi bi-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) { <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"Sista sidan\">\r\n <i class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"Sista sidan\">\r\n <i class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n }", dependencies: [{ kind: "directive", type:
|
|
814
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: PagerInlineComponent, isStandalone: false, selector: "adb-pager", inputs: { infiniteLimit: "infiniteLimit" }, outputs: { pageChanged: "pageChanged" }, usesInheritance: true, ngImport: i0, template: "@if (pages&&pages.length>1&¤tPage<=amountOfPages) { <nav class=\"d-flex justify-content-end pr-2 my-1\">\r\n <ul class=\"pagination flex-wrap\">\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onFirstClick()\" [ngClass]=\"currentPage==1?'opacity-25 pe-none':''\" [disabled]=\"currentPage==1\" aria-label=\"F\u00F6rsta sidan\">\r\n <i class=\"bi bi-chevron-double-left\" aria-hidden=\"true\"></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-25 pe-none':''\" [disabled]=\"currentPage==1\" aria-label=\"F\u00F6reg\u00E5ende sida\">\r\n <i class=\"bi bi-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n @for (page of pages; track page) {\r\n <li class=\"page-item\" [class.active]=\"currentPage==page\">\r\n <button class=\"page-link\" (click)=\"onPageClick(page)\">\r\n {{page}}\r\n </button>\r\n </li>\r\n }\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onNextClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"N\u00E4sta sida\">\r\n <i class=\"bi bi-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n @if (!infiniteLimit) {\r\n @if ((amountOfPages-1)*limit<10000) { <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"Sista sidan\">\r\n <i class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n }\r\n }\r\n @if (infiniteLimit) {\r\n <li class=\"page-item\">\r\n <button class=\"page-link\" (click)=\"onLastClick()\" [ngClass]=\"currentPage>=amountOfPages?'opacity-25 pe-none':''\" [disabled]=\"currentPage>=amountOfPages\" aria-label=\"Sista sidan\">\r\n <i class=\"bi bi-chevron-double-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n }", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
815
815
|
}
|
|
816
816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: PagerInlineComponent, decorators: [{
|
|
817
817
|
type: Component,
|
|
@@ -1091,948 +1091,1016 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1091
1091
|
}]
|
|
1092
1092
|
}] });
|
|
1093
1093
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
years;
|
|
1105
|
-
months;
|
|
1106
|
-
weekDays = AdbDatePickerComponent.WEEK_DAYS;
|
|
1107
|
-
weeks;
|
|
1108
|
-
range;
|
|
1109
|
-
noYearMode = false;
|
|
1110
|
-
;
|
|
1111
|
-
initialDate;
|
|
1112
|
-
settings;
|
|
1113
|
-
toLeft;
|
|
1114
|
-
id;
|
|
1115
|
-
selectDate = new EventEmitter();
|
|
1116
|
-
constructor(elementRef, translate) {
|
|
1117
|
-
this.elementRef = elementRef;
|
|
1118
|
-
this.translate = translate;
|
|
1094
|
+
const ADB_ALERT_CONFIG = new InjectionToken('ADB_ALERT_CONFIG');
|
|
1095
|
+
|
|
1096
|
+
const RICH_MODULE_CONFIG = new InjectionToken('richModule.config');
|
|
1097
|
+
|
|
1098
|
+
class RichTextComponent {
|
|
1099
|
+
text = '';
|
|
1100
|
+
parts = [];
|
|
1101
|
+
taxonUrl;
|
|
1102
|
+
constructor(config) {
|
|
1103
|
+
this.taxonUrl = config.taxonUrl;
|
|
1119
1104
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1105
|
+
ngOnChanges() {
|
|
1106
|
+
this.parts = this.text
|
|
1107
|
+
? this.parseCustomMarkdown(this.text)
|
|
1108
|
+
: [];
|
|
1109
|
+
}
|
|
1110
|
+
parseCustomMarkdown(input) {
|
|
1111
|
+
const parts = [];
|
|
1112
|
+
let i = 0;
|
|
1113
|
+
const pushText = (text) => {
|
|
1114
|
+
if (text) {
|
|
1115
|
+
parts.push({ type: 'text', content: text });
|
|
1129
1116
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1117
|
+
};
|
|
1118
|
+
while (i < input.length) {
|
|
1119
|
+
if (input.startsWith('**', i) || input.startsWith('__', i)) {
|
|
1120
|
+
const marker = input.slice(i, i + 2);
|
|
1121
|
+
const end = input.indexOf(marker, i + 2);
|
|
1122
|
+
if (end !== -1) {
|
|
1123
|
+
parts.push({
|
|
1124
|
+
type: 'bold',
|
|
1125
|
+
content: input.slice(i + 2, end)
|
|
1126
|
+
});
|
|
1127
|
+
i = end + 2;
|
|
1128
|
+
continue;
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
if (input[i] === '*' || input[i] === '_') {
|
|
1132
|
+
const marker = input[i];
|
|
1133
|
+
const end = input.indexOf(marker, i + 1);
|
|
1134
|
+
if (end !== -1) {
|
|
1135
|
+
parts.push({
|
|
1136
|
+
type: 'italic',
|
|
1137
|
+
content: input.slice(i + 1, end)
|
|
1138
|
+
});
|
|
1139
|
+
i = end + 1;
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
if (input[i] === '[') {
|
|
1144
|
+
const textEnd = input.indexOf(']', i);
|
|
1145
|
+
const linkStart = input.indexOf('(', textEnd);
|
|
1146
|
+
const linkEnd = input.indexOf(')', linkStart);
|
|
1147
|
+
if (textEnd !== -1 && linkStart !== -1 && linkEnd !== -1) {
|
|
1148
|
+
const label = input.slice(i + 1, textEnd);
|
|
1149
|
+
const link = input.slice(linkStart + 1, linkEnd);
|
|
1150
|
+
const [type, id] = link.split(':');
|
|
1151
|
+
if (type === 'taxon' || type === 'reference') {
|
|
1152
|
+
parts.push({
|
|
1153
|
+
type: type,
|
|
1154
|
+
content: label,
|
|
1155
|
+
id
|
|
1156
|
+
});
|
|
1157
|
+
i = linkEnd + 1;
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
let next = input.length;
|
|
1163
|
+
for (const c of ['*', '_', '[']) {
|
|
1164
|
+
const idx = input.indexOf(c, i + 1);
|
|
1165
|
+
if (idx !== -1 && idx < next) {
|
|
1166
|
+
next = idx;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
if (next === input.length) {
|
|
1170
|
+
pushText(input.slice(i));
|
|
1171
|
+
break;
|
|
1132
1172
|
}
|
|
1173
|
+
pushText(input.slice(i, next));
|
|
1174
|
+
i = next;
|
|
1133
1175
|
}
|
|
1134
|
-
|
|
1135
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1136
|
-
this.createCalendar();
|
|
1137
|
-
}
|
|
1138
|
-
onShowYear() {
|
|
1139
|
-
this.months = null;
|
|
1140
|
-
this.loadYearsInterval();
|
|
1176
|
+
return parts;
|
|
1141
1177
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RichTextComponent, deps: [{ token: RICH_MODULE_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
1179
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: RichTextComponent, isStandalone: false, selector: "adb-rich-text", inputs: { text: "text" }, usesOnChanges: true, ngImport: i0, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div>", changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1180
|
+
}
|
|
1181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: RichTextComponent, decorators: [{
|
|
1182
|
+
type: Component,
|
|
1183
|
+
args: [{ selector: 'adb-rich-text', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div style=\"white-space: pre-wrap;\">\r\n @for (part of parts; track $index) {\r\n @switch (part.type) {\r\n @case ('text') { <span>{{ part.content }}</span> }\r\n @case ('italic') { <em>{{ part.content }}</em> }\r\n @case ('bold') { <b>{{ part.content }}</b> }\r\n @case ('taxon') { <a [href]=\"taxonUrl + part.id\">{{ part.content }}</a> }\r\n @default { <span>{{ part.content }}</span> }\r\n }\r\n}\r\n</div>" }]
|
|
1184
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1185
|
+
type: Inject,
|
|
1186
|
+
args: [RICH_MODULE_CONFIG]
|
|
1187
|
+
}] }], propDecorators: { text: [{
|
|
1188
|
+
type: Input
|
|
1189
|
+
}] } });
|
|
1190
|
+
|
|
1191
|
+
class AdbAlertComponent {
|
|
1192
|
+
http;
|
|
1193
|
+
config;
|
|
1194
|
+
alerts = [];
|
|
1195
|
+
constructor(http, config) {
|
|
1196
|
+
this.http = http;
|
|
1197
|
+
this.config = config;
|
|
1145
1198
|
}
|
|
1146
|
-
|
|
1147
|
-
this.
|
|
1148
|
-
this.loadMonths();
|
|
1149
|
-
this.years = null;
|
|
1199
|
+
ngOnInit() {
|
|
1200
|
+
this.loadAlerts();
|
|
1150
1201
|
}
|
|
1151
|
-
|
|
1152
|
-
this.
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1202
|
+
loadAlerts() {
|
|
1203
|
+
this.http.get(this.config.apiUrl).subscribe(alerts => {
|
|
1204
|
+
const dismissedIds = this.getItem(`${this.config.clientId}-alert-dismissed`) ?? [];
|
|
1205
|
+
this.alerts = alerts.filter(alert => !dismissedIds.includes(alert.id) &&
|
|
1206
|
+
(!alert.affectedSystems?.length || alert.affectedSystems.includes(this.config.clientId)));
|
|
1207
|
+
});
|
|
1157
1208
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
this.selectedDate = subYears(this.selectedDate, 1);
|
|
1165
|
-
this.loadMonths();
|
|
1166
|
-
}
|
|
1167
|
-
else {
|
|
1168
|
-
this.selectedDate = subMonths(this.selectedDate, 1);
|
|
1169
|
-
this.createCalendar();
|
|
1209
|
+
dismiss(alert) {
|
|
1210
|
+
this.alerts = this.alerts.filter(item => item.id !== alert.id);
|
|
1211
|
+
const storageKey = `${this.config.clientId}-alert-dismissed`;
|
|
1212
|
+
const dismissedIds = this.getItem(storageKey) ?? [];
|
|
1213
|
+
if (!dismissedIds.includes(alert.id)) {
|
|
1214
|
+
dismissedIds.push(alert.id);
|
|
1170
1215
|
}
|
|
1171
|
-
this.
|
|
1216
|
+
this.setItem(storageKey, dismissedIds);
|
|
1172
1217
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
this.selectedDate = addYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1176
|
-
this.loadYearsInterval();
|
|
1177
|
-
}
|
|
1178
|
-
else if (this.months) {
|
|
1179
|
-
this.selectedDate = addYears(this.selectedDate, 1);
|
|
1180
|
-
this.loadMonths();
|
|
1181
|
-
}
|
|
1182
|
-
else {
|
|
1183
|
-
this.selectedDate = addMonths(this.selectedDate, 1);
|
|
1184
|
-
this.createCalendar();
|
|
1185
|
-
}
|
|
1186
|
-
this.currentMonth = getMonth(this.selectedDate);
|
|
1218
|
+
setItem(key, value) {
|
|
1219
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
1187
1220
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1221
|
+
getItem(key) {
|
|
1222
|
+
return localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : null;
|
|
1190
1223
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
})
|
|
1224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertComponent, deps: [{ token: i1$2.HttpClient }, { token: ADB_ALERT_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
1225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbAlertComponent, isStandalone: false, selector: "adb-alert", ngImport: i0, template: "@for (alert of alerts; track alert.id) {\r\n <div class=\"alert alert-dismissible\" [ngClass]=\"alert.severity === 2 ? 'alert-warning' : 'alert-info'\">\r\n <div role=\"status\" aria-atomic=\"true\" [id]=\"'adb-alert-message-' + alert.id\">\r\n <adb-rich-text [text]=\"alert.message\"></adb-rich-text>\r\n </div>\r\n @if(!alert.sticky){\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'CLOSE' | translate\" [attr.aria-describedby]=\"'adb-alert-message-' + alert.id\" (click)=\"dismiss(alert)\">\r\n </button>\r\n }\r\n </div>\r\n}", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: RichTextComponent, selector: "adb-rich-text", inputs: ["text"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
1226
|
+
}
|
|
1227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertComponent, decorators: [{
|
|
1228
|
+
type: Component,
|
|
1229
|
+
args: [{ selector: 'adb-alert', standalone: false, template: "@for (alert of alerts; track alert.id) {\r\n <div class=\"alert alert-dismissible\" [ngClass]=\"alert.severity === 2 ? 'alert-warning' : 'alert-info'\">\r\n <div role=\"status\" aria-atomic=\"true\" [id]=\"'adb-alert-message-' + alert.id\">\r\n <adb-rich-text [text]=\"alert.message\"></adb-rich-text>\r\n </div>\r\n @if(!alert.sticky){\r\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'CLOSE' | translate\" [attr.aria-describedby]=\"'adb-alert-message-' + alert.id\" (click)=\"dismiss(alert)\">\r\n </button>\r\n }\r\n </div>\r\n}" }]
|
|
1230
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
1231
|
+
type: Inject,
|
|
1232
|
+
args: [ADB_ALERT_CONFIG]
|
|
1233
|
+
}] }] });
|
|
1234
|
+
|
|
1235
|
+
const FORMAT_MARKERS = {
|
|
1236
|
+
italic: ['*', '_'],
|
|
1237
|
+
bold: ['**', '__']
|
|
1238
|
+
};
|
|
1239
|
+
const DEFAULT_MARKER = {
|
|
1240
|
+
italic: '*',
|
|
1241
|
+
bold: '**'
|
|
1242
|
+
};
|
|
1243
|
+
class AdbRichEditorComponent {
|
|
1244
|
+
el;
|
|
1245
|
+
text = '';
|
|
1246
|
+
hasTaxon = false;
|
|
1247
|
+
hasReference = false;
|
|
1248
|
+
rows = 3;
|
|
1249
|
+
label = 'Set label';
|
|
1250
|
+
id;
|
|
1251
|
+
constructor(el) {
|
|
1252
|
+
this.el = el;
|
|
1253
|
+
this.id = this.getId();
|
|
1198
1254
|
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1255
|
+
getTextarea() {
|
|
1256
|
+
return this.el.nativeElement.querySelector('textarea');
|
|
1257
|
+
}
|
|
1258
|
+
onDoubleClick() {
|
|
1259
|
+
const textarea = this.getTextarea();
|
|
1260
|
+
if (!textarea)
|
|
1261
|
+
return;
|
|
1262
|
+
const start = textarea.selectionStart;
|
|
1263
|
+
let end = textarea.selectionEnd;
|
|
1264
|
+
while (end > start && textarea.value[end - 1] === ' ') {
|
|
1265
|
+
end--;
|
|
1209
1266
|
}
|
|
1210
|
-
|
|
1267
|
+
textarea.setSelectionRange(start, end);
|
|
1211
1268
|
}
|
|
1212
|
-
|
|
1213
|
-
this.
|
|
1269
|
+
onItalicClick() {
|
|
1270
|
+
this.applyFormatting('italic');
|
|
1214
1271
|
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
const monthInterval = { start: startOfMonth(this.selectedDate), end: endOfMonth(this.selectedDate) };
|
|
1218
|
-
var fnsWweeks = eachWeekOfInterval(monthInterval, { weekStartsOn: this.translate.currentLang() === 'sv' || this.translate.currentLang() === 'sv-SE' ? 1 : 0 });
|
|
1219
|
-
for (const fnsWeek of fnsWweeks) {
|
|
1220
|
-
const week = { weekNumber: 0, days: [] };
|
|
1221
|
-
week.weekNumber = getISOWeek(new Date(fnsWeek));
|
|
1222
|
-
const weekInterval = { start: new Date(fnsWeek), end: addDays(new Date(fnsWeek), 6) };
|
|
1223
|
-
week.days = eachDayOfInterval(weekInterval).map(day => {
|
|
1224
|
-
day.setHours(getHours(new Date()));
|
|
1225
|
-
day.setMinutes(getMinutes(new Date()));
|
|
1226
|
-
return {
|
|
1227
|
-
value: day,
|
|
1228
|
-
isSelected: isSameYear(day, this.initialDate) && isSameDay(day, this.initialDate) && isSameMonth(day, this.initialDate),
|
|
1229
|
-
isInRange: this.range ? isWithinInterval(day, this.range) : true,
|
|
1230
|
-
isToday: isSameDay(day, new Date()),
|
|
1231
|
-
inMonth: monthInterval.start.getMonth() === day.getMonth()
|
|
1232
|
-
};
|
|
1233
|
-
});
|
|
1234
|
-
weeks.push(week);
|
|
1235
|
-
}
|
|
1236
|
-
this.weeks = weeks;
|
|
1237
|
-
}
|
|
1238
|
-
static parseDate(value) {
|
|
1239
|
-
if (typeof value === 'string') {
|
|
1240
|
-
if (isValid(parseISO(value))) {
|
|
1241
|
-
return parseISO(value);
|
|
1242
|
-
}
|
|
1243
|
-
else {
|
|
1244
|
-
return null;
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
else if (value instanceof Date) {
|
|
1248
|
-
return value;
|
|
1249
|
-
}
|
|
1250
|
-
else {
|
|
1251
|
-
return null;
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1255
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbDatePickerComponent, isStandalone: false, selector: "adb-date-picker", inputs: { initialDate: "initialDate", settings: "settings", toLeft: "toLeft", id: "id" }, outputs: { selectDate: "selectDate" }, host: { properties: { "id": "this.id" } }, ngImport: i0, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-body shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"bi bi-chevron-left\"></span></button>\r\n @if(!years&&!months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n @if(years){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n }\r\n @if(months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"bi bi-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()\"\r\n [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n @if(months){\r\n <ul class=\"list-unstyled row\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n }\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" [class.border]=\"day.isToday\" [class.btn-primary]=\"day.isSelected\"\r\n [ngClass]=\"{'border-0 opacity-50':!day.inMonth||!day.isInRange}\" [disabled]=\"!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>", dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }, { kind: "pipe", type: LocaleDatePipe, name: "adbLocaleDate" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1256
|
-
}
|
|
1257
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerComponent, decorators: [{
|
|
1258
|
-
type: Component,
|
|
1259
|
-
args: [{ selector: 'adb-date-picker', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-body shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"bi bi-chevron-left\"></span></button>\r\n @if(!years&&!months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n @if(years){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n }\r\n @if(months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"bi bi-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()\"\r\n [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n @if(months){\r\n <ul class=\"list-unstyled row\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n }\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" [class.border]=\"day.isToday\" [class.btn-primary]=\"day.isSelected\"\r\n [ngClass]=\"{'border-0 opacity-50':!day.inMonth||!day.isInRange}\" [disabled]=\"!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>" }]
|
|
1260
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.TranslateService }], propDecorators: { initialDate: [{
|
|
1261
|
-
type: Input
|
|
1262
|
-
}], settings: [{
|
|
1263
|
-
type: Input
|
|
1264
|
-
}], toLeft: [{
|
|
1265
|
-
type: Input
|
|
1266
|
-
}], id: [{
|
|
1267
|
-
type: HostBinding,
|
|
1268
|
-
args: ['id']
|
|
1269
|
-
}, {
|
|
1270
|
-
type: Input
|
|
1271
|
-
}], selectDate: [{
|
|
1272
|
-
type: Output
|
|
1273
|
-
}] } });
|
|
1274
|
-
|
|
1275
|
-
class AdbDatePickerService {
|
|
1276
|
-
viewRef;
|
|
1277
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1278
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService });
|
|
1279
|
-
}
|
|
1280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService, decorators: [{
|
|
1281
|
-
type: Injectable
|
|
1282
|
-
}] });
|
|
1283
|
-
|
|
1284
|
-
class AdbDatePickerDirective {
|
|
1285
|
-
viewContainerRef;
|
|
1286
|
-
renderer;
|
|
1287
|
-
elementRef;
|
|
1288
|
-
adbDatePickerService;
|
|
1289
|
-
translate;
|
|
1290
|
-
subscriptions = new Subscription();
|
|
1291
|
-
autocomplete = 'off';
|
|
1292
|
-
adbBlur = new EventEmitter();
|
|
1293
|
-
format = 'yyyy-MM-dd';
|
|
1294
|
-
toLeft;
|
|
1295
|
-
settings = null;
|
|
1296
|
-
id;
|
|
1297
|
-
currentDate;
|
|
1298
|
-
isValid;
|
|
1299
|
-
constructor(viewContainerRef, renderer, elementRef, adbDatePickerService, translate) {
|
|
1300
|
-
this.viewContainerRef = viewContainerRef;
|
|
1301
|
-
this.renderer = renderer;
|
|
1302
|
-
this.elementRef = elementRef;
|
|
1303
|
-
this.adbDatePickerService = adbDatePickerService;
|
|
1304
|
-
this.translate = translate;
|
|
1305
|
-
}
|
|
1306
|
-
ngOnInit() {
|
|
1307
|
-
this.elementRef.nativeElement.setAttribute("placeholder", this.format);
|
|
1272
|
+
onBoldClick() {
|
|
1273
|
+
this.applyFormatting('bold');
|
|
1308
1274
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1275
|
+
applyFormatting(type) {
|
|
1276
|
+
const textarea = this.getTextarea();
|
|
1277
|
+
if (!textarea)
|
|
1278
|
+
return;
|
|
1279
|
+
const start = textarea.selectionStart;
|
|
1280
|
+
const end = textarea.selectionEnd;
|
|
1281
|
+
const value = textarea.value;
|
|
1282
|
+
if (start === end) {
|
|
1283
|
+
const marker = DEFAULT_MARKER[type];
|
|
1284
|
+
const newValue = value.slice(0, start) +
|
|
1285
|
+
marker +
|
|
1286
|
+
marker +
|
|
1287
|
+
value.slice(start);
|
|
1288
|
+
this.updateValue(newValue);
|
|
1289
|
+
const cursor = start + marker.length;
|
|
1290
|
+
requestAnimationFrame(() => {
|
|
1291
|
+
textarea.focus();
|
|
1292
|
+
textarea.setSelectionRange(cursorStart, cursorEnd);
|
|
1293
|
+
});
|
|
1294
|
+
return;
|
|
1312
1295
|
}
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1296
|
+
const existingMarker = this.findWrappingMarker(value, start, end, FORMAT_MARKERS[type]);
|
|
1297
|
+
const marker = existingMarker ?? DEFAULT_MARKER[type];
|
|
1298
|
+
const newValue = existingMarker
|
|
1299
|
+
? value.slice(0, start - marker.length) +
|
|
1300
|
+
value.slice(start, end) +
|
|
1301
|
+
value.slice(end + marker.length)
|
|
1302
|
+
: value.slice(0, start) +
|
|
1303
|
+
marker +
|
|
1304
|
+
value.slice(start, end) +
|
|
1305
|
+
marker +
|
|
1306
|
+
value.slice(end);
|
|
1307
|
+
this.updateValue(newValue);
|
|
1308
|
+
const cursorStart = existingMarker
|
|
1309
|
+
? start - marker.length
|
|
1310
|
+
: start + marker.length;
|
|
1311
|
+
const cursorEnd = existingMarker
|
|
1312
|
+
? end - marker.length
|
|
1313
|
+
: end + marker.length;
|
|
1314
|
+
requestAnimationFrame(() => {
|
|
1315
|
+
textarea.focus();
|
|
1316
|
+
textarea.setSelectionRange(cursorStart, cursorEnd);
|
|
1325
1317
|
});
|
|
1326
|
-
this.adbDatePickerService.viewRef = viewRef;
|
|
1327
|
-
}
|
|
1328
|
-
onKeyup(event) {
|
|
1329
|
-
const date = AdbDatePickerDirective.tryParse(event.target.value);
|
|
1330
|
-
if (date) {
|
|
1331
|
-
const now = new Date();
|
|
1332
|
-
date.setHours(now.getHours());
|
|
1333
|
-
date.setMinutes(now.getMinutes());
|
|
1334
|
-
date.setSeconds(now.getSeconds());
|
|
1335
|
-
this.onChange(date);
|
|
1336
|
-
}
|
|
1337
|
-
else {
|
|
1338
|
-
this.onChange(event.target.value); //send inccorect values to form
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
onTabDown() {
|
|
1342
|
-
this.updateValueOnLeave();
|
|
1343
|
-
this.onHide();
|
|
1344
|
-
this.adbBlur.emit(this.currentDate);
|
|
1345
1318
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
onHide() {
|
|
1351
|
-
this.adbDatePickerService.viewRef = null;
|
|
1352
|
-
this.viewContainerRef.detach();
|
|
1353
|
-
this.viewContainerRef.clear();
|
|
1354
|
-
}
|
|
1355
|
-
onCheckOutSideClick(target) {
|
|
1356
|
-
const nativeElement = this.adbDatePickerService.viewRef?.instance.elementRef.nativeElement ?? null;
|
|
1357
|
-
if (nativeElement) {
|
|
1358
|
-
if (nativeElement.id === this.id) {
|
|
1359
|
-
if (!target.hasAttribute('adbdatepicker')) {
|
|
1360
|
-
const clickedInside = nativeElement.contains(target);
|
|
1361
|
-
if (!clickedInside) {
|
|
1362
|
-
this.updateValueOnLeave();
|
|
1363
|
-
this.onHide();
|
|
1364
|
-
this.adbBlur.emit(this.currentDate);
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1319
|
+
findWrappingMarker(value, start, end, markers) {
|
|
1320
|
+
return (markers.find(marker => value.substring(start - marker.length, start) === marker &&
|
|
1321
|
+
value.substring(end, end + marker.length) === marker) ?? null);
|
|
1369
1322
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
if (this.currentDate) {
|
|
1373
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(this.currentDate, this.format, this.translate.currentLang()));
|
|
1374
|
-
}
|
|
1375
|
-
else {
|
|
1376
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', '');
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1323
|
+
onTaxonClick() {
|
|
1324
|
+
this.replaceMarked('[Name](taxon:0)');
|
|
1379
1325
|
}
|
|
1380
|
-
|
|
1381
|
-
this.
|
|
1326
|
+
onReferenceClick() {
|
|
1327
|
+
this.replaceMarked('[Name](reference:0)');
|
|
1382
1328
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1329
|
+
replaceMarked(replaceTag) {
|
|
1330
|
+
const textarea = this.getTextarea();
|
|
1331
|
+
if (!textarea)
|
|
1332
|
+
return;
|
|
1333
|
+
const start = textarea.selectionStart;
|
|
1334
|
+
const end = textarea.selectionEnd;
|
|
1335
|
+
const value = textarea.value;
|
|
1336
|
+
const before = start > 0 ? value[start - 1] : '';
|
|
1337
|
+
const after = end < value.length ? value[end] : '';
|
|
1338
|
+
const spaceBefore = before && !/\s/.test(before) ? ' ' : '';
|
|
1339
|
+
const spaceAfter = after && !/\s/.test(after) ? ' ' : '';
|
|
1340
|
+
const newValue = value.slice(0, start) +
|
|
1341
|
+
spaceBefore +
|
|
1342
|
+
replaceTag +
|
|
1343
|
+
spaceAfter +
|
|
1344
|
+
value.slice(end);
|
|
1345
|
+
this.updateValue(newValue);
|
|
1346
|
+
const nameStart = newValue.indexOf('Name', start);
|
|
1347
|
+
if (nameStart === -1)
|
|
1348
|
+
return;
|
|
1349
|
+
const nameEnd = nameStart + 'Name'.length;
|
|
1350
|
+
requestAnimationFrame(() => {
|
|
1351
|
+
textarea.focus();
|
|
1352
|
+
textarea.setSelectionRange(nameStart, nameEnd);
|
|
1353
|
+
});
|
|
1405
1354
|
}
|
|
1406
|
-
//
|
|
1355
|
+
// ---------------------------------------
|
|
1356
|
+
// ControlValueAccessor
|
|
1357
|
+
// ---------------------------------------
|
|
1407
1358
|
onChange = () => { };
|
|
1408
1359
|
onTouched = () => { };
|
|
1409
|
-
onValidationChange = () => { };
|
|
1410
|
-
registerOnValidatorChange(fn) {
|
|
1411
|
-
this.onValidationChange = fn;
|
|
1412
|
-
}
|
|
1413
1360
|
writeValue(value) {
|
|
1414
|
-
|
|
1415
|
-
this.currentDate = null;
|
|
1416
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', '');
|
|
1417
|
-
return;
|
|
1418
|
-
}
|
|
1419
|
-
if (typeof value === 'string' || value instanceof String) {
|
|
1420
|
-
const date = AdbDatePickerDirective.tryParse(value);
|
|
1421
|
-
if (!date) {
|
|
1422
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
|
|
1423
|
-
return;
|
|
1424
|
-
}
|
|
1425
|
-
value = date;
|
|
1426
|
-
}
|
|
1427
|
-
if (value instanceof Date) {
|
|
1428
|
-
this.currentDate = value;
|
|
1429
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(this.currentDate, this.format, this.translate.currentLang()));
|
|
1430
|
-
}
|
|
1361
|
+
this.text = value ?? '';
|
|
1431
1362
|
}
|
|
1432
1363
|
registerOnChange(fn) {
|
|
1433
1364
|
this.onChange = fn;
|
|
1434
1365
|
}
|
|
1435
1366
|
registerOnTouched(fn) {
|
|
1436
|
-
this.onTouched = fn;
|
|
1437
|
-
}
|
|
1438
|
-
setDisabledState(isDisabled) {
|
|
1439
|
-
this.viewContainerRef.clear();
|
|
1440
|
-
}
|
|
1441
|
-
static tryParse(dateString) {
|
|
1442
|
-
const parsed = parseISO(dateString);
|
|
1443
|
-
return isValid(parsed) ? parsed : null;
|
|
1444
|
-
}
|
|
1445
|
-
getId() {
|
|
1446
|
-
return '' + Math.floor(Math.random() * Date.now());
|
|
1447
|
-
}
|
|
1448
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: AdbDatePickerService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1449
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: AdbDatePickerDirective, isStandalone: false, selector: "input[adbDatepicker]", inputs: { format: "format", toLeft: "toLeft", settings: "settings" }, outputs: { adbBlur: "adbBlur" }, host: { listeners: { "click": "onClick()", "keyup": "onKeyup($event)", "keydown.shift.tab": "onTabDown()", "keydown.tab": "onTabDown()", "keydown.esc": "onEscdOWN()", "document:click": "onCheckOutSideClick($event.target)" }, properties: { "autocomplete": "this.autocomplete" } }, providers: [{
|
|
1450
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1451
|
-
multi: true
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
provide: NG_VALIDATORS,
|
|
1455
|
-
useExisting: AdbDatePickerDirective,
|
|
1456
|
-
multi: true,
|
|
1457
|
-
},], ngImport: i0 });
|
|
1458
|
-
}
|
|
1459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerDirective, decorators: [{
|
|
1460
|
-
type: Directive,
|
|
1461
|
-
args: [{
|
|
1462
|
-
selector: `input[adbDatepicker]`,
|
|
1463
|
-
providers: [{
|
|
1464
|
-
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1465
|
-
multi: true
|
|
1466
|
-
},
|
|
1467
|
-
{
|
|
1468
|
-
provide: NG_VALIDATORS,
|
|
1469
|
-
useExisting: AdbDatePickerDirective,
|
|
1470
|
-
multi: true,
|
|
1471
|
-
},],
|
|
1472
|
-
standalone: false
|
|
1473
|
-
}]
|
|
1474
|
-
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: AdbDatePickerService }, { type: i1$1.TranslateService }], propDecorators: { autocomplete: [{
|
|
1475
|
-
type: HostBinding,
|
|
1476
|
-
args: ['autocomplete']
|
|
1477
|
-
}], adbBlur: [{
|
|
1478
|
-
type: Output
|
|
1479
|
-
}], format: [{
|
|
1480
|
-
type: Input
|
|
1481
|
-
}], toLeft: [{
|
|
1482
|
-
type: Input
|
|
1483
|
-
}], settings: [{
|
|
1484
|
-
type: Input
|
|
1485
|
-
}], onClick: [{
|
|
1486
|
-
type: HostListener,
|
|
1487
|
-
args: ['click']
|
|
1488
|
-
}], onKeyup: [{
|
|
1489
|
-
type: HostListener,
|
|
1490
|
-
args: ['keyup', ['$event']]
|
|
1491
|
-
}], onTabDown: [{
|
|
1492
|
-
type: HostListener,
|
|
1493
|
-
args: ['keydown.shift.tab']
|
|
1494
|
-
}, {
|
|
1495
|
-
type: HostListener,
|
|
1496
|
-
args: ['keydown.tab']
|
|
1497
|
-
}], onEscdOWN: [{
|
|
1498
|
-
type: HostListener,
|
|
1499
|
-
args: ['keydown.esc']
|
|
1500
|
-
}], onCheckOutSideClick: [{
|
|
1501
|
-
type: HostListener,
|
|
1502
|
-
args: ['document:click', ['$event.target']]
|
|
1503
|
-
}] } });
|
|
1504
|
-
|
|
1505
|
-
class AdbDatePickerModule {
|
|
1506
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1507
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, declarations: [AdbDatePickerComponent, AdbDatePickerDirective], imports: [CommonModule, AdbPipesModule, AdbDirectivesModule, TranslatePipe], exports: [AdbDatePickerComponent, AdbDatePickerDirective] });
|
|
1508
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, providers: [AdbDatePickerService], imports: [CommonModule, AdbPipesModule, AdbDirectivesModule] });
|
|
1509
|
-
}
|
|
1510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, decorators: [{
|
|
1511
|
-
type: NgModule,
|
|
1512
|
-
args: [{
|
|
1513
|
-
imports: [CommonModule, AdbPipesModule, AdbDirectivesModule, TranslatePipe],
|
|
1514
|
-
declarations: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1515
|
-
exports: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1516
|
-
providers: [AdbDatePickerService]
|
|
1517
|
-
}]
|
|
1518
|
-
}] });
|
|
1519
|
-
|
|
1520
|
-
class AdbModalService {
|
|
1521
|
-
environmentInjector;
|
|
1522
|
-
appRef;
|
|
1523
|
-
closeSubject = new Subject();
|
|
1524
|
-
close$ = this.closeSubject.asObservable();
|
|
1525
|
-
renderer;
|
|
1526
|
-
domElem;
|
|
1527
|
-
backdrop;
|
|
1528
|
-
constructor(environmentInjector, rendererFactory, appRef) {
|
|
1529
|
-
this.environmentInjector = environmentInjector;
|
|
1530
|
-
this.appRef = appRef;
|
|
1531
|
-
this.renderer = rendererFactory.createRenderer(null, null);
|
|
1532
|
-
}
|
|
1533
|
-
hide(confirm) {
|
|
1534
|
-
this.closeSubject.next(confirm);
|
|
1535
|
-
document.body.removeChild(this.domElem);
|
|
1536
|
-
document.body.removeChild(this.backdrop);
|
|
1537
|
-
var main = this.renderer.selectRootElement('main', true);
|
|
1538
|
-
this.renderer.removeAttribute(main, 'inert');
|
|
1539
|
-
this.closeSubject.unsubscribe();
|
|
1540
|
-
this.closeSubject = new Subject();
|
|
1541
|
-
this.close$ = this.closeSubject.asObservable();
|
|
1542
|
-
}
|
|
1543
|
-
showConfirm(model) {
|
|
1544
|
-
const main = this.renderer.selectRootElement('main', true);
|
|
1545
|
-
main.setAttribute('inert', '');
|
|
1546
|
-
this.backdrop = this.renderer.createElement('div');
|
|
1547
|
-
this.backdrop.classList.add('modal-backdrop', 'fade', 'show');
|
|
1548
|
-
this.renderer.appendChild(document.body, this.backdrop);
|
|
1549
|
-
const componentRef = createComponent(AdbConfirmModal, {
|
|
1550
|
-
environmentInjector: this.environmentInjector
|
|
1551
|
-
});
|
|
1552
|
-
model.header = model.header ?? 'NOT_SET';
|
|
1553
|
-
model.text = model.text ?? 'NOT_SET';
|
|
1554
|
-
model.confirm = model.confirm ?? 'OK';
|
|
1555
|
-
model.decline = model.decline ?? 'CANCEL';
|
|
1556
|
-
model.showDecline = model.showDecline ?? true;
|
|
1557
|
-
componentRef.instance.model = model;
|
|
1558
|
-
this.appRef.attachView(componentRef.hostView);
|
|
1559
|
-
this.domElem = componentRef.location.nativeElement;
|
|
1560
|
-
document.body.appendChild(this.domElem);
|
|
1561
|
-
}
|
|
1562
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService, deps: [{ token: i0.EnvironmentInjector }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1563
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService });
|
|
1564
|
-
}
|
|
1565
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService, decorators: [{
|
|
1566
|
-
type: Injectable
|
|
1567
|
-
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }] });
|
|
1568
|
-
|
|
1569
|
-
class AdbConfirmModal {
|
|
1570
|
-
modalRef;
|
|
1571
|
-
elementRef;
|
|
1572
|
-
model;
|
|
1573
|
-
constructor(modalRef, elementRef) {
|
|
1574
|
-
this.modalRef = modalRef;
|
|
1575
|
-
this.elementRef = elementRef;
|
|
1367
|
+
this.onTouched = fn;
|
|
1576
1368
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
element.focus();
|
|
1581
|
-
}
|
|
1369
|
+
setDisabledState(isDisabled) {
|
|
1370
|
+
// Intentionally left minimal
|
|
1371
|
+
// Disabled state should be handled via template binding
|
|
1582
1372
|
}
|
|
1583
|
-
|
|
1584
|
-
this.
|
|
1373
|
+
onTextChange() {
|
|
1374
|
+
this.onChange(this.text);
|
|
1585
1375
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1376
|
+
updateValue(value) {
|
|
1377
|
+
this.text = value;
|
|
1378
|
+
this.onChange(this.text);
|
|
1379
|
+
}
|
|
1380
|
+
getId() {
|
|
1381
|
+
return '' + Math.floor(Math.random() * Date.now());
|
|
1382
|
+
}
|
|
1383
|
+
ngOnDestroy() { }
|
|
1384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1385
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbRichEditorComponent, isStandalone: false, selector: "adb-rich-editor", inputs: { hasTaxon: "hasTaxon", hasReference: "hasReference", rows: "rows", label: "label" }, providers: [
|
|
1386
|
+
{
|
|
1387
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1388
|
+
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1389
|
+
multi: true
|
|
1390
|
+
}
|
|
1391
|
+
], ngImport: i0, template: "<div>\r\n <div class=\"d-flex justify-content-end align-items-end gap-3 mb-1\">\r\n <label class=\"me-auto\" [for]=\"id\">{{label|translate}}</label>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"bi bi-type-italic\"></span></button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"bi bi-type-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"bi bi-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"bi bi-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea [id]=\"id\" class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1588
1392
|
}
|
|
1589
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorComponent, decorators: [{
|
|
1590
1394
|
type: Component,
|
|
1591
|
-
args: [{
|
|
1592
|
-
|
|
1395
|
+
args: [{ selector: 'adb-rich-editor', providers: [
|
|
1396
|
+
{
|
|
1397
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1398
|
+
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1399
|
+
multi: true
|
|
1400
|
+
}
|
|
1401
|
+
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div>\r\n <div class=\"d-flex justify-content-end align-items-end gap-3 mb-1\">\r\n <label class=\"me-auto\" [for]=\"id\">{{label|translate}}</label>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"bi bi-type-italic\"></span></button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"bi bi-type-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"bi bi-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"bi bi-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea [id]=\"id\" class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n" }]
|
|
1402
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasTaxon: [{
|
|
1403
|
+
type: Input
|
|
1404
|
+
}], hasReference: [{
|
|
1405
|
+
type: Input
|
|
1406
|
+
}], rows: [{
|
|
1407
|
+
type: Input
|
|
1408
|
+
}], label: [{
|
|
1593
1409
|
type: Input
|
|
1594
1410
|
}] } });
|
|
1595
1411
|
|
|
1596
|
-
class
|
|
1597
|
-
static
|
|
1598
|
-
|
|
1599
|
-
|
|
1412
|
+
class AdbRichEditorModule {
|
|
1413
|
+
static forRoot(config) {
|
|
1414
|
+
return {
|
|
1415
|
+
ngModule: AdbRichEditorModule,
|
|
1416
|
+
providers: [
|
|
1417
|
+
{ provide: RICH_MODULE_CONFIG, useValue: config }
|
|
1418
|
+
]
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1422
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, declarations: [AdbRichEditorComponent, RichTextComponent], imports: [CommonModule, FormsModule, TranslatePipe], exports: [AdbRichEditorComponent, RichTextComponent] });
|
|
1423
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, imports: [CommonModule, FormsModule] });
|
|
1600
1424
|
}
|
|
1601
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, decorators: [{
|
|
1602
1426
|
type: NgModule,
|
|
1603
1427
|
args: [{
|
|
1604
|
-
imports: [CommonModule,
|
|
1605
|
-
declarations: [
|
|
1606
|
-
exports: [
|
|
1607
|
-
providers: [AdbModalService]
|
|
1428
|
+
imports: [CommonModule, FormsModule, TranslatePipe],
|
|
1429
|
+
declarations: [AdbRichEditorComponent, RichTextComponent],
|
|
1430
|
+
exports: [AdbRichEditorComponent, RichTextComponent]
|
|
1608
1431
|
}]
|
|
1609
1432
|
}] });
|
|
1610
1433
|
|
|
1611
|
-
class
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1434
|
+
class AdbAlertModule {
|
|
1435
|
+
static forRoot(config) {
|
|
1436
|
+
return {
|
|
1437
|
+
ngModule: AdbAlertModule,
|
|
1438
|
+
providers: [
|
|
1439
|
+
{ provide: ADB_ALERT_CONFIG, useValue: config }
|
|
1440
|
+
]
|
|
1441
|
+
};
|
|
1619
1442
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1444
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertModule, declarations: [AdbAlertComponent], imports: [CommonModule, TranslatePipe, AdbRichEditorModule], exports: [AdbAlertComponent] });
|
|
1445
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertModule, imports: [CommonModule, AdbRichEditorModule] });
|
|
1446
|
+
}
|
|
1447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbAlertModule, decorators: [{
|
|
1448
|
+
type: NgModule,
|
|
1449
|
+
args: [{
|
|
1450
|
+
imports: [CommonModule, TranslatePipe, AdbRichEditorModule],
|
|
1451
|
+
declarations: [AdbAlertComponent],
|
|
1452
|
+
exports: [AdbAlertComponent]
|
|
1453
|
+
}]
|
|
1454
|
+
}] });
|
|
1455
|
+
|
|
1456
|
+
class AdbDatePickerComponent {
|
|
1457
|
+
elementRef;
|
|
1458
|
+
translate;
|
|
1459
|
+
subscriptions = new Subscription();
|
|
1460
|
+
static MONTHS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1461
|
+
static WEEK_DAYS = ['1', '2', '3', '4', '5', '6', '7'];
|
|
1462
|
+
static YEAR_INTERVALL = 8;
|
|
1463
|
+
currentdDate = new Date();
|
|
1464
|
+
currentMonth;
|
|
1465
|
+
selectedDate = new Date();
|
|
1466
|
+
years;
|
|
1467
|
+
months;
|
|
1468
|
+
weekDays = AdbDatePickerComponent.WEEK_DAYS;
|
|
1469
|
+
weeks;
|
|
1470
|
+
range;
|
|
1471
|
+
noYearMode = false;
|
|
1472
|
+
;
|
|
1473
|
+
initialDate;
|
|
1474
|
+
settings;
|
|
1475
|
+
toLeft;
|
|
1476
|
+
id;
|
|
1477
|
+
selectDate = new EventEmitter();
|
|
1478
|
+
constructor(elementRef, translate) {
|
|
1479
|
+
this.elementRef = elementRef;
|
|
1480
|
+
this.translate = translate;
|
|
1628
1481
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1482
|
+
ngOnInit() {
|
|
1483
|
+
if (this.settings) {
|
|
1484
|
+
if (this.settings?.minDate || this.settings?.maxDate) {
|
|
1485
|
+
const minDate = AdbDatePickerComponent.parseDate(this.settings.minDate);
|
|
1486
|
+
const maxDate = AdbDatePickerComponent.parseDate(this.settings.maxDate);
|
|
1487
|
+
this.range = {
|
|
1488
|
+
start: minDate ? startOfDay(minDate) : subYears(new Date(), 1000),
|
|
1489
|
+
end: maxDate ? endOfDay(maxDate) : addYears(new Date(), 1000)
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
if (this.settings.noYear) {
|
|
1493
|
+
this.noYearMode = this.settings.noYear;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
this.selectedDate = this.currentdDate = this.initialDate ?? new Date();
|
|
1497
|
+
this.currentMonth = getMonth(this.selectedDate);
|
|
1498
|
+
this.createCalendar();
|
|
1631
1499
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1500
|
+
onShowYear() {
|
|
1501
|
+
this.months = null;
|
|
1502
|
+
this.loadYearsInterval();
|
|
1503
|
+
}
|
|
1504
|
+
onShowMonth() {
|
|
1505
|
+
this.years = null;
|
|
1506
|
+
this.loadMonths();
|
|
1507
|
+
}
|
|
1508
|
+
onSelectYear(inYear) {
|
|
1509
|
+
this.selectedDate.setFullYear(inYear.getFullYear());
|
|
1510
|
+
this.loadMonths();
|
|
1511
|
+
this.years = null;
|
|
1512
|
+
}
|
|
1513
|
+
onSelectMonth(inMonth) {
|
|
1514
|
+
this.selectedDate.setMonth(inMonth);
|
|
1515
|
+
this.currentMonth = getMonth(this.selectedDate);
|
|
1516
|
+
this.createCalendar();
|
|
1517
|
+
this.years = null;
|
|
1518
|
+
this.months = null;
|
|
1519
|
+
}
|
|
1520
|
+
onPrev() {
|
|
1521
|
+
if (this.years) {
|
|
1522
|
+
this.selectedDate = subYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1523
|
+
this.loadYearsInterval();
|
|
1524
|
+
}
|
|
1525
|
+
else if (this.months) {
|
|
1526
|
+
this.selectedDate = subYears(this.selectedDate, 1);
|
|
1527
|
+
this.loadMonths();
|
|
1528
|
+
}
|
|
1529
|
+
else {
|
|
1530
|
+
this.selectedDate = subMonths(this.selectedDate, 1);
|
|
1531
|
+
this.createCalendar();
|
|
1532
|
+
}
|
|
1533
|
+
this.currentMonth = getMonth(this.selectedDate);
|
|
1534
|
+
}
|
|
1535
|
+
onNext() {
|
|
1536
|
+
if (this.years) {
|
|
1537
|
+
this.selectedDate = addYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1538
|
+
this.loadYearsInterval();
|
|
1539
|
+
}
|
|
1540
|
+
else if (this.months) {
|
|
1541
|
+
this.selectedDate = addYears(this.selectedDate, 1);
|
|
1542
|
+
this.loadMonths();
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
this.selectedDate = addMonths(this.selectedDate, 1);
|
|
1546
|
+
this.createCalendar();
|
|
1547
|
+
}
|
|
1548
|
+
this.currentMonth = getMonth(this.selectedDate);
|
|
1549
|
+
}
|
|
1550
|
+
ngOnDestroy() {
|
|
1551
|
+
this.subscriptions.unsubscribe();
|
|
1552
|
+
}
|
|
1553
|
+
loadMonths() {
|
|
1554
|
+
this.months = AdbDatePickerComponent.MONTHS.map(x => {
|
|
1555
|
+
return {
|
|
1556
|
+
value: x,
|
|
1557
|
+
isThisMonth: getMonth(this.selectedDate) === x && isSameYear(this.currentdDate, this.selectedDate)
|
|
1558
|
+
};
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
loadYearsInterval() {
|
|
1562
|
+
let year = subYears(this.selectedDate, AdbDatePickerComponent.YEAR_INTERVALL);
|
|
1563
|
+
const years = [];
|
|
1564
|
+
for (let i = 0; i < 16; i++) {
|
|
1565
|
+
years.push({
|
|
1566
|
+
value: year,
|
|
1567
|
+
title: year.getFullYear(),
|
|
1568
|
+
isThisYear: isSameYear(year, this.currentdDate)
|
|
1636
1569
|
});
|
|
1637
|
-
|
|
1638
|
-
this.container = componentRef.location.nativeElement;
|
|
1639
|
-
document.body.appendChild(this.container);
|
|
1570
|
+
year = addYears(year, 1);
|
|
1640
1571
|
}
|
|
1572
|
+
this.years = years;
|
|
1641
1573
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
var
|
|
1649
|
-
(
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1574
|
+
onSelectDate(day) {
|
|
1575
|
+
this.selectDate.emit(day.value);
|
|
1576
|
+
}
|
|
1577
|
+
createCalendar() {
|
|
1578
|
+
const weeks = [];
|
|
1579
|
+
const monthInterval = { start: startOfMonth(this.selectedDate), end: endOfMonth(this.selectedDate) };
|
|
1580
|
+
var fnsWweeks = eachWeekOfInterval(monthInterval, { weekStartsOn: this.translate.currentLang() === 'sv' || this.translate.currentLang() === 'sv-SE' ? 1 : 0 });
|
|
1581
|
+
for (const fnsWeek of fnsWweeks) {
|
|
1582
|
+
const week = { weekNumber: 0, days: [] };
|
|
1583
|
+
week.weekNumber = getISOWeek(new Date(fnsWeek));
|
|
1584
|
+
const weekInterval = { start: new Date(fnsWeek), end: addDays(new Date(fnsWeek), 6) };
|
|
1585
|
+
week.days = eachDayOfInterval(weekInterval).map(day => {
|
|
1586
|
+
day.setHours(getHours(new Date()));
|
|
1587
|
+
day.setMinutes(getMinutes(new Date()));
|
|
1588
|
+
return {
|
|
1589
|
+
value: day,
|
|
1590
|
+
isSelected: isSameYear(day, this.initialDate) && isSameDay(day, this.initialDate) && isSameMonth(day, this.initialDate),
|
|
1591
|
+
isInRange: this.range ? isWithinInterval(day, this.range) : true,
|
|
1592
|
+
isToday: isSameDay(day, new Date()),
|
|
1593
|
+
inMonth: monthInterval.start.getMonth() === day.getMonth()
|
|
1594
|
+
};
|
|
1595
|
+
});
|
|
1596
|
+
weeks.push(week);
|
|
1597
|
+
}
|
|
1598
|
+
this.weeks = weeks;
|
|
1661
1599
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1600
|
+
static parseDate(value) {
|
|
1601
|
+
if (typeof value === 'string') {
|
|
1602
|
+
if (isValid(parseISO(value))) {
|
|
1603
|
+
return parseISO(value);
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
return null;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
else if (value instanceof Date) {
|
|
1610
|
+
return value;
|
|
1611
|
+
}
|
|
1612
|
+
else {
|
|
1613
|
+
return null;
|
|
1614
|
+
}
|
|
1664
1615
|
}
|
|
1665
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1666
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type:
|
|
1616
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1617
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbDatePickerComponent, isStandalone: false, selector: "adb-date-picker", inputs: { initialDate: "initialDate", settings: "settings", toLeft: "toLeft", id: "id" }, outputs: { selectDate: "selectDate" }, host: { properties: { "id": "this.id" } }, ngImport: i0, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-body shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"bi bi-chevron-left\"></span></button>\r\n @if(!years&&!months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n @if(years){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n }\r\n @if(months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"bi bi-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()\"\r\n [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n @if(months){\r\n <ul class=\"list-unstyled row\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n }\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" [class.border]=\"day.isToday\" [class.btn-primary]=\"day.isSelected\"\r\n [ngClass]=\"{'border-0 opacity-50':!day.inMonth||!day.isInRange}\" [disabled]=\"!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>", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: LocaleDatePipe, name: "adbLocaleDate" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1667
1618
|
}
|
|
1668
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerComponent, decorators: [{
|
|
1669
1620
|
type: Component,
|
|
1670
|
-
args: [{ standalone: false, template: "<div class=\"position-
|
|
1671
|
-
}], ctorParameters: () => [{ type:
|
|
1621
|
+
args: [{ selector: 'adb-date-picker', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div class=\"position-relative\" [class.to-left]=\"toLeft\">\r\n <nav class=\"bg-body shadow rounded position-absolute\">\r\n <header class=\"bg-primary p-2 rounded-top d-flex justify-content-between align-items-center gap-1\">\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onPrev()\" [disabled]=\"noYearMode&¤tMonth===0\"><span class=\"bi bi-chevron-left\"></span></button>\r\n @if(!years&&!months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowMonth();$event.stopPropagation()\">{{selectedDate|adbLocaleDate:'MMM'}}</button>\r\n <button *ngIf=\"!noYearMode\" tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n @if(years){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"years=null;$event.stopPropagation()\">{{years[0].title}} - {{years[years.length-1].title}}</button>\r\n }\r\n @if(months){\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onShowYear();$event.stopPropagation()\">{{selectedDate|date:'yyyy'}}</button>\r\n }\r\n <button tabIndex=\"-1\" class=\"btn btn-primary-dark rounded-pill\" type=\"button\" (click)=\"onNext()\" [disabled]=\"noYearMode&¤tMonth===11\"><span class=\"bi bi-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()\"\r\n [ngClass]=\"{'border border-secondary':year.isThisYear}\">{{year.title}}</button>\r\n </li>\r\n </ul>\r\n @if(months){\r\n <ul class=\"list-unstyled row\">\r\n <li class=\"col-4 text-center px-2 py-3\" *ngFor=\"let month of months\">\r\n <button type=\"button\" tabIndex=\"-1\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" (click)=\"onSelectMonth(month.value);$event.stopPropagation()\" [ngClass]=\"{'border border-secondary':month.isThisMonth}\">\r\n {{'MONTHS.'+(month.value+1)|translate}}\r\n </button>\r\n </li>\r\n </ul>\r\n }\r\n <div class=\"days\" *ngIf=\"!years&&!months\">\r\n <div class=\"text-center border-bottom py-2 text-muted\" *ngFor=\"let weekDay of weekDays\">{{'WEEK_DAYS.'+weekDay|translate}}</div>\r\n <ng-container *ngFor=\"let week of weeks\">\r\n <button tabIndex=\"-1\" class=\"btn rounded-circle p-0\" *ngFor=\"let day of week.days\" (click)=\"onSelectDate(day)\" type=\"button\" [class.border]=\"day.isToday\" [class.btn-primary]=\"day.isSelected\"\r\n [ngClass]=\"{'border-0 opacity-50':!day.inMonth||!day.isInRange}\" [disabled]=\"!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>" }]
|
|
1622
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.TranslateService }], propDecorators: { initialDate: [{
|
|
1623
|
+
type: Input
|
|
1624
|
+
}], settings: [{
|
|
1625
|
+
type: Input
|
|
1626
|
+
}], toLeft: [{
|
|
1627
|
+
type: Input
|
|
1628
|
+
}], id: [{
|
|
1629
|
+
type: HostBinding,
|
|
1630
|
+
args: ['id']
|
|
1631
|
+
}, {
|
|
1632
|
+
type: Input
|
|
1633
|
+
}], selectDate: [{
|
|
1634
|
+
type: Output
|
|
1635
|
+
}] } });
|
|
1672
1636
|
|
|
1673
|
-
class
|
|
1674
|
-
|
|
1675
|
-
static
|
|
1676
|
-
static
|
|
1637
|
+
class AdbDatePickerService {
|
|
1638
|
+
viewRef;
|
|
1639
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1640
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService });
|
|
1677
1641
|
}
|
|
1678
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1679
|
-
type:
|
|
1680
|
-
args: [{
|
|
1681
|
-
imports: [CommonModule, AdbDirectivesModule, TranslatePipe],
|
|
1682
|
-
declarations: [AdbToast],
|
|
1683
|
-
exports: [AdbToast],
|
|
1684
|
-
providers: [AdbToastService]
|
|
1685
|
-
}]
|
|
1642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerService, decorators: [{
|
|
1643
|
+
type: Injectable
|
|
1686
1644
|
}] });
|
|
1687
1645
|
|
|
1688
|
-
class
|
|
1646
|
+
class AdbDatePickerDirective {
|
|
1647
|
+
viewContainerRef;
|
|
1648
|
+
renderer;
|
|
1689
1649
|
elementRef;
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1650
|
+
adbDatePickerService;
|
|
1651
|
+
translate;
|
|
1652
|
+
subscriptions = new Subscription();
|
|
1653
|
+
autocomplete = 'off';
|
|
1654
|
+
adbBlur = new EventEmitter();
|
|
1655
|
+
format = 'yyyy-MM-dd';
|
|
1656
|
+
toLeft;
|
|
1657
|
+
settings = null;
|
|
1693
1658
|
id;
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
this.showHelp = false;
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
constructor(elementRef) {
|
|
1659
|
+
currentDate;
|
|
1660
|
+
isValid;
|
|
1661
|
+
constructor(viewContainerRef, renderer, elementRef, adbDatePickerService, translate) {
|
|
1662
|
+
this.viewContainerRef = viewContainerRef;
|
|
1663
|
+
this.renderer = renderer;
|
|
1703
1664
|
this.elementRef = elementRef;
|
|
1665
|
+
this.adbDatePickerService = adbDatePickerService;
|
|
1666
|
+
this.translate = translate;
|
|
1704
1667
|
}
|
|
1705
1668
|
ngOnInit() {
|
|
1706
|
-
this.
|
|
1669
|
+
this.elementRef.nativeElement.setAttribute("placeholder", this.format);
|
|
1707
1670
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1671
|
+
onClick() {
|
|
1672
|
+
if (this.adbDatePickerService.viewRef) {
|
|
1673
|
+
this.adbDatePickerService.viewRef.destroy();
|
|
1674
|
+
}
|
|
1675
|
+
const viewRef = this.viewContainerRef.createComponent(AdbDatePickerComponent);
|
|
1676
|
+
viewRef.instance.settings = this.settings;
|
|
1677
|
+
viewRef.instance.toLeft = this.toLeft;
|
|
1678
|
+
viewRef.instance.initialDate = this.currentDate;
|
|
1679
|
+
this.id = this.getId();
|
|
1680
|
+
viewRef.instance.id = this.id;
|
|
1681
|
+
viewRef.instance.selectDate.subscribe((date) => {
|
|
1682
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(date, this.format, this.translate.currentLang()));
|
|
1683
|
+
this.onChange(date);
|
|
1684
|
+
this.currentDate = date;
|
|
1685
|
+
this.onHide();
|
|
1686
|
+
this.adbBlur.emit(date);
|
|
1687
|
+
});
|
|
1688
|
+
this.adbDatePickerService.viewRef = viewRef;
|
|
1689
|
+
}
|
|
1690
|
+
onKeyup(event) {
|
|
1691
|
+
const date = AdbDatePickerDirective.tryParse(event.target.value);
|
|
1692
|
+
if (date) {
|
|
1693
|
+
const now = new Date();
|
|
1694
|
+
date.setHours(now.getHours());
|
|
1695
|
+
date.setMinutes(now.getMinutes());
|
|
1696
|
+
date.setSeconds(now.getSeconds());
|
|
1697
|
+
this.onChange(date);
|
|
1698
|
+
}
|
|
1699
|
+
else {
|
|
1700
|
+
this.onChange(event.target.value); //send inccorect values to form
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
onTabDown() {
|
|
1704
|
+
this.updateValueOnLeave();
|
|
1705
|
+
this.onHide();
|
|
1706
|
+
this.adbBlur.emit(this.currentDate);
|
|
1707
|
+
}
|
|
1708
|
+
onEscdOWN() {
|
|
1709
|
+
this.updateValueOnLeave();
|
|
1710
|
+
this.onHide();
|
|
1711
|
+
}
|
|
1712
|
+
onHide() {
|
|
1713
|
+
this.adbDatePickerService.viewRef = null;
|
|
1714
|
+
this.viewContainerRef.detach();
|
|
1715
|
+
this.viewContainerRef.clear();
|
|
1716
|
+
}
|
|
1717
|
+
onCheckOutSideClick(target) {
|
|
1718
|
+
const nativeElement = this.adbDatePickerService.viewRef?.instance.elementRef.nativeElement ?? null;
|
|
1719
|
+
if (nativeElement) {
|
|
1720
|
+
if (nativeElement.id === this.id) {
|
|
1721
|
+
if (!target.hasAttribute('adbdatepicker')) {
|
|
1722
|
+
const clickedInside = nativeElement.contains(target);
|
|
1723
|
+
if (!clickedInside) {
|
|
1724
|
+
this.updateValueOnLeave();
|
|
1725
|
+
this.onHide();
|
|
1726
|
+
this.adbBlur.emit(this.currentDate);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
updateValueOnLeave() {
|
|
1733
|
+
if (this.isValid) {
|
|
1734
|
+
if (this.currentDate) {
|
|
1735
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(this.currentDate, this.format, this.translate.currentLang()));
|
|
1713
1736
|
}
|
|
1714
1737
|
else {
|
|
1715
|
-
|
|
1738
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', '');
|
|
1716
1739
|
}
|
|
1717
1740
|
}
|
|
1718
|
-
this.showHelp = !this.showHelp;
|
|
1719
1741
|
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1742
|
+
ngOnDestroy() {
|
|
1743
|
+
this.subscriptions.unsubscribe();
|
|
1744
|
+
}
|
|
1745
|
+
//Validator
|
|
1746
|
+
validate(control) {
|
|
1747
|
+
const value = control.value;
|
|
1748
|
+
if (!value) {
|
|
1749
|
+
this.currentDate = null;
|
|
1750
|
+
this.isValid = true;
|
|
1751
|
+
return null;
|
|
1752
|
+
}
|
|
1753
|
+
if (value instanceof Date) {
|
|
1754
|
+
this.currentDate = value;
|
|
1755
|
+
this.isValid = true;
|
|
1756
|
+
return null;
|
|
1757
|
+
}
|
|
1758
|
+
if (typeof value === 'string' || value instanceof String) {
|
|
1759
|
+
const date = AdbDatePickerDirective.tryParse(value);
|
|
1760
|
+
if (!date) {
|
|
1761
|
+
this.isValid = false;
|
|
1762
|
+
return { date: true };
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
this.isValid = true;
|
|
1766
|
+
return null;
|
|
1767
|
+
}
|
|
1768
|
+
//ControlValueAccessor
|
|
1769
|
+
onChange = () => { };
|
|
1770
|
+
onTouched = () => { };
|
|
1771
|
+
onValidationChange = () => { };
|
|
1772
|
+
registerOnValidatorChange(fn) {
|
|
1773
|
+
this.onValidationChange = fn;
|
|
1774
|
+
}
|
|
1775
|
+
writeValue(value) {
|
|
1776
|
+
if (!value) {
|
|
1777
|
+
this.currentDate = null;
|
|
1778
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', '');
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1781
|
+
if (typeof value === 'string' || value instanceof String) {
|
|
1782
|
+
const date = AdbDatePickerDirective.tryParse(value);
|
|
1783
|
+
if (!date) {
|
|
1784
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', value);
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
value = date;
|
|
1788
|
+
}
|
|
1789
|
+
if (value instanceof Date) {
|
|
1790
|
+
this.currentDate = value;
|
|
1791
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'value', formatDate(this.currentDate, this.format, this.translate.currentLang()));
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
registerOnChange(fn) {
|
|
1795
|
+
this.onChange = fn;
|
|
1796
|
+
}
|
|
1797
|
+
registerOnTouched(fn) {
|
|
1798
|
+
this.onTouched = fn;
|
|
1799
|
+
}
|
|
1800
|
+
setDisabledState(isDisabled) {
|
|
1801
|
+
this.viewContainerRef.clear();
|
|
1802
|
+
}
|
|
1803
|
+
static tryParse(dateString) {
|
|
1804
|
+
const parsed = parseISO(dateString);
|
|
1805
|
+
return isValid(parsed) ? parsed : null;
|
|
1806
|
+
}
|
|
1807
|
+
getId() {
|
|
1808
|
+
return '' + Math.floor(Math.random() * Date.now());
|
|
1809
|
+
}
|
|
1810
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: AdbDatePickerService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1811
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: AdbDatePickerDirective, isStandalone: false, selector: "input[adbDatepicker]", inputs: { format: "format", toLeft: "toLeft", settings: "settings" }, outputs: { adbBlur: "adbBlur" }, host: { listeners: { "click": "onClick()", "keyup": "onKeyup($event)", "keydown.shift.tab": "onTabDown()", "keydown.tab": "onTabDown()", "keydown.esc": "onEscdOWN()", "document:click": "onCheckOutSideClick($event.target)" }, properties: { "autocomplete": "this.autocomplete" } }, providers: [{
|
|
1812
|
+
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1813
|
+
multi: true
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
provide: NG_VALIDATORS,
|
|
1817
|
+
useExisting: AdbDatePickerDirective,
|
|
1818
|
+
multi: true,
|
|
1819
|
+
},], ngImport: i0 });
|
|
1722
1820
|
}
|
|
1723
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1724
|
-
type:
|
|
1725
|
-
args: [{
|
|
1726
|
-
|
|
1821
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerDirective, decorators: [{
|
|
1822
|
+
type: Directive,
|
|
1823
|
+
args: [{
|
|
1824
|
+
selector: `input[adbDatepicker]`,
|
|
1825
|
+
providers: [{
|
|
1826
|
+
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AdbDatePickerDirective),
|
|
1827
|
+
multi: true
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
provide: NG_VALIDATORS,
|
|
1831
|
+
useExisting: AdbDatePickerDirective,
|
|
1832
|
+
multi: true,
|
|
1833
|
+
},],
|
|
1834
|
+
standalone: false
|
|
1835
|
+
}]
|
|
1836
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: AdbDatePickerService }, { type: i1$1.TranslateService }], propDecorators: { autocomplete: [{
|
|
1837
|
+
type: HostBinding,
|
|
1838
|
+
args: ['autocomplete']
|
|
1839
|
+
}], adbBlur: [{
|
|
1840
|
+
type: Output
|
|
1841
|
+
}], format: [{
|
|
1842
|
+
type: Input
|
|
1843
|
+
}], toLeft: [{
|
|
1844
|
+
type: Input
|
|
1845
|
+
}], settings: [{
|
|
1846
|
+
type: Input
|
|
1847
|
+
}], onClick: [{
|
|
1727
1848
|
type: HostListener,
|
|
1728
|
-
args: ['
|
|
1849
|
+
args: ['click']
|
|
1850
|
+
}], onKeyup: [{
|
|
1851
|
+
type: HostListener,
|
|
1852
|
+
args: ['keyup', ['$event']]
|
|
1853
|
+
}], onTabDown: [{
|
|
1854
|
+
type: HostListener,
|
|
1855
|
+
args: ['keydown.shift.tab']
|
|
1856
|
+
}, {
|
|
1857
|
+
type: HostListener,
|
|
1858
|
+
args: ['keydown.tab']
|
|
1859
|
+
}], onEscdOWN: [{
|
|
1860
|
+
type: HostListener,
|
|
1861
|
+
args: ['keydown.esc']
|
|
1862
|
+
}], onCheckOutSideClick: [{
|
|
1863
|
+
type: HostListener,
|
|
1864
|
+
args: ['document:click', ['$event.target']]
|
|
1729
1865
|
}] } });
|
|
1730
1866
|
|
|
1731
|
-
class
|
|
1732
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1733
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1734
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1867
|
+
class AdbDatePickerModule {
|
|
1868
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1869
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, declarations: [AdbDatePickerComponent, AdbDatePickerDirective], imports: [CommonModule, AdbPipesModule, AdbDirectivesModule, TranslatePipe], exports: [AdbDatePickerComponent, AdbDatePickerDirective] });
|
|
1870
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, providers: [AdbDatePickerService], imports: [CommonModule, AdbPipesModule, AdbDirectivesModule] });
|
|
1735
1871
|
}
|
|
1736
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbDatePickerModule, decorators: [{
|
|
1737
1873
|
type: NgModule,
|
|
1738
1874
|
args: [{
|
|
1739
|
-
imports: [CommonModule, AdbDirectivesModule],
|
|
1740
|
-
declarations: [
|
|
1741
|
-
exports: [
|
|
1875
|
+
imports: [CommonModule, AdbPipesModule, AdbDirectivesModule, TranslatePipe],
|
|
1876
|
+
declarations: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1877
|
+
exports: [AdbDatePickerComponent, AdbDatePickerDirective],
|
|
1878
|
+
providers: [AdbDatePickerService]
|
|
1742
1879
|
}]
|
|
1743
1880
|
}] });
|
|
1744
1881
|
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
hasReference = false;
|
|
1758
|
-
rows = 3;
|
|
1759
|
-
label = 'Set label';
|
|
1760
|
-
id;
|
|
1761
|
-
constructor(el) {
|
|
1762
|
-
this.el = el;
|
|
1763
|
-
this.id = this.getId();
|
|
1764
|
-
}
|
|
1765
|
-
getTextarea() {
|
|
1766
|
-
return this.el.nativeElement.querySelector('textarea');
|
|
1767
|
-
}
|
|
1768
|
-
onDoubleClick() {
|
|
1769
|
-
const textarea = this.getTextarea();
|
|
1770
|
-
if (!textarea)
|
|
1771
|
-
return;
|
|
1772
|
-
const start = textarea.selectionStart;
|
|
1773
|
-
let end = textarea.selectionEnd;
|
|
1774
|
-
while (end > start && textarea.value[end - 1] === ' ') {
|
|
1775
|
-
end--;
|
|
1776
|
-
}
|
|
1777
|
-
textarea.setSelectionRange(start, end);
|
|
1778
|
-
}
|
|
1779
|
-
onItalicClick() {
|
|
1780
|
-
this.applyFormatting('italic');
|
|
1882
|
+
class AdbModalService {
|
|
1883
|
+
environmentInjector;
|
|
1884
|
+
appRef;
|
|
1885
|
+
closeSubject = new Subject();
|
|
1886
|
+
close$ = this.closeSubject.asObservable();
|
|
1887
|
+
renderer;
|
|
1888
|
+
domElem;
|
|
1889
|
+
backdrop;
|
|
1890
|
+
constructor(environmentInjector, rendererFactory, appRef) {
|
|
1891
|
+
this.environmentInjector = environmentInjector;
|
|
1892
|
+
this.appRef = appRef;
|
|
1893
|
+
this.renderer = rendererFactory.createRenderer(null, null);
|
|
1781
1894
|
}
|
|
1782
|
-
|
|
1783
|
-
this.
|
|
1895
|
+
hide(confirm) {
|
|
1896
|
+
this.closeSubject.next(confirm);
|
|
1897
|
+
document.body.removeChild(this.domElem);
|
|
1898
|
+
document.body.removeChild(this.backdrop);
|
|
1899
|
+
var main = this.renderer.selectRootElement('main', true);
|
|
1900
|
+
this.renderer.removeAttribute(main, 'inert');
|
|
1901
|
+
this.closeSubject.unsubscribe();
|
|
1902
|
+
this.closeSubject = new Subject();
|
|
1903
|
+
this.close$ = this.closeSubject.asObservable();
|
|
1784
1904
|
}
|
|
1785
|
-
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
const marker = DEFAULT_MARKER[type];
|
|
1794
|
-
const newValue = value.slice(0, start) +
|
|
1795
|
-
marker +
|
|
1796
|
-
marker +
|
|
1797
|
-
value.slice(start);
|
|
1798
|
-
this.updateValue(newValue);
|
|
1799
|
-
const cursor = start + marker.length;
|
|
1800
|
-
requestAnimationFrame(() => {
|
|
1801
|
-
textarea.focus();
|
|
1802
|
-
textarea.setSelectionRange(cursorStart, cursorEnd);
|
|
1803
|
-
});
|
|
1804
|
-
return;
|
|
1805
|
-
}
|
|
1806
|
-
const existingMarker = this.findWrappingMarker(value, start, end, FORMAT_MARKERS[type]);
|
|
1807
|
-
const marker = existingMarker ?? DEFAULT_MARKER[type];
|
|
1808
|
-
const newValue = existingMarker
|
|
1809
|
-
? value.slice(0, start - marker.length) +
|
|
1810
|
-
value.slice(start, end) +
|
|
1811
|
-
value.slice(end + marker.length)
|
|
1812
|
-
: value.slice(0, start) +
|
|
1813
|
-
marker +
|
|
1814
|
-
value.slice(start, end) +
|
|
1815
|
-
marker +
|
|
1816
|
-
value.slice(end);
|
|
1817
|
-
this.updateValue(newValue);
|
|
1818
|
-
const cursorStart = existingMarker
|
|
1819
|
-
? start - marker.length
|
|
1820
|
-
: start + marker.length;
|
|
1821
|
-
const cursorEnd = existingMarker
|
|
1822
|
-
? end - marker.length
|
|
1823
|
-
: end + marker.length;
|
|
1824
|
-
requestAnimationFrame(() => {
|
|
1825
|
-
textarea.focus();
|
|
1826
|
-
textarea.setSelectionRange(cursorStart, cursorEnd);
|
|
1905
|
+
showConfirm(model) {
|
|
1906
|
+
const main = this.renderer.selectRootElement('main', true);
|
|
1907
|
+
main.setAttribute('inert', '');
|
|
1908
|
+
this.backdrop = this.renderer.createElement('div');
|
|
1909
|
+
this.backdrop.classList.add('modal-backdrop', 'fade', 'show');
|
|
1910
|
+
this.renderer.appendChild(document.body, this.backdrop);
|
|
1911
|
+
const componentRef = createComponent(AdbConfirmModal, {
|
|
1912
|
+
environmentInjector: this.environmentInjector
|
|
1827
1913
|
});
|
|
1914
|
+
model.header = model.header ?? 'NOT_SET';
|
|
1915
|
+
model.text = model.text ?? 'NOT_SET';
|
|
1916
|
+
model.confirm = model.confirm ?? 'OK';
|
|
1917
|
+
model.decline = model.decline ?? 'CANCEL';
|
|
1918
|
+
model.showDecline = model.showDecline ?? true;
|
|
1919
|
+
componentRef.instance.model = model;
|
|
1920
|
+
this.appRef.attachView(componentRef.hostView);
|
|
1921
|
+
this.domElem = componentRef.location.nativeElement;
|
|
1922
|
+
document.body.appendChild(this.domElem);
|
|
1828
1923
|
}
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1924
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService, deps: [{ token: i0.EnvironmentInjector }, { token: i0.RendererFactory2 }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1925
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService });
|
|
1926
|
+
}
|
|
1927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalService, decorators: [{
|
|
1928
|
+
type: Injectable
|
|
1929
|
+
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }, { type: i0.RendererFactory2 }, { type: i0.ApplicationRef }] });
|
|
1930
|
+
|
|
1931
|
+
class AdbConfirmModal {
|
|
1932
|
+
modalRef;
|
|
1933
|
+
elementRef;
|
|
1934
|
+
model;
|
|
1935
|
+
constructor(modalRef, elementRef) {
|
|
1936
|
+
this.modalRef = modalRef;
|
|
1937
|
+
this.elementRef = elementRef;
|
|
1838
1938
|
}
|
|
1839
|
-
|
|
1840
|
-
const
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
const end = textarea.selectionEnd;
|
|
1845
|
-
const value = textarea.value;
|
|
1846
|
-
const before = start > 0 ? value[start - 1] : '';
|
|
1847
|
-
const after = end < value.length ? value[end] : '';
|
|
1848
|
-
const spaceBefore = before && !/\s/.test(before) ? ' ' : '';
|
|
1849
|
-
const spaceAfter = after && !/\s/.test(after) ? ' ' : '';
|
|
1850
|
-
const newValue = value.slice(0, start) +
|
|
1851
|
-
spaceBefore +
|
|
1852
|
-
replaceTag +
|
|
1853
|
-
spaceAfter +
|
|
1854
|
-
value.slice(end);
|
|
1855
|
-
this.updateValue(newValue);
|
|
1856
|
-
const nameStart = newValue.indexOf('Name', start);
|
|
1857
|
-
if (nameStart === -1)
|
|
1858
|
-
return;
|
|
1859
|
-
const nameEnd = nameStart + 'Name'.length;
|
|
1860
|
-
requestAnimationFrame(() => {
|
|
1861
|
-
textarea.focus();
|
|
1862
|
-
textarea.setSelectionRange(nameStart, nameEnd);
|
|
1863
|
-
});
|
|
1939
|
+
ngAfterViewInit() {
|
|
1940
|
+
const element = this.elementRef.nativeElement.querySelector('#modal-close');
|
|
1941
|
+
if (element) {
|
|
1942
|
+
element.focus();
|
|
1943
|
+
}
|
|
1864
1944
|
}
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
// ---------------------------------------
|
|
1868
|
-
onChange = () => { };
|
|
1869
|
-
onTouched = () => { };
|
|
1870
|
-
writeValue(value) {
|
|
1871
|
-
this.text = value ?? '';
|
|
1945
|
+
onClose(confirm) {
|
|
1946
|
+
this.modalRef.hide(confirm);
|
|
1872
1947
|
}
|
|
1873
|
-
|
|
1874
|
-
|
|
1948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbConfirmModal, deps: [{ token: AdbModalService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1949
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbConfirmModal, isStandalone: false, selector: "ng-component", inputs: { model: "model" }, ngImport: i0, template: "@if (model) {\r\n <div class=\"modal fade show\" role=\"dialog\"\r\n attr.aria-labelledby=\"mod_header\"\r\n attr.aria-describedby=\"mod_desc\">\r\n <div class=\"modal-dialog\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h1 class=\"h-subsection mb-0 modal-title\" id=\"mod_header\">{{model.header|translate}}</h1>\r\n <button type=\"button\" class=\"btn-close\" id=\"modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div id=\"mod_desc\">{{model.text|translate}}</div>\r\n @if (model.value) {\r\n <div>\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"d-flex gap-2 justify-content-end\">\r\n @if (model.showDecline) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n }\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
1950
|
+
}
|
|
1951
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbConfirmModal, decorators: [{
|
|
1952
|
+
type: Component,
|
|
1953
|
+
args: [{ changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "@if (model) {\r\n <div class=\"modal fade show\" role=\"dialog\"\r\n attr.aria-labelledby=\"mod_header\"\r\n attr.aria-describedby=\"mod_desc\">\r\n <div class=\"modal-dialog\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h1 class=\"h-subsection mb-0 modal-title\" id=\"mod_header\">{{model.header|translate}}</h1>\r\n <button type=\"button\" class=\"btn-close\" id=\"modal-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"onClose(false)\"></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div id=\"mod_desc\">{{model.text|translate}}</div>\r\n @if (model.value) {\r\n <div>\r\n <strong>{{model.value}}</strong>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"modal-footer\">\r\n <div class=\"d-flex gap-2 justify-content-end\">\r\n @if (model.showDecline) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onClose(false)\">{{model.decline|translate}}</button>\r\n }\r\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"onClose(true)\">{{model.confirm|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n}" }]
|
|
1954
|
+
}], ctorParameters: () => [{ type: AdbModalService }, { type: i0.ElementRef }], propDecorators: { model: [{
|
|
1955
|
+
type: Input
|
|
1956
|
+
}] } });
|
|
1957
|
+
|
|
1958
|
+
class AdbModalModule {
|
|
1959
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1960
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbModalModule, declarations: [AdbConfirmModal], imports: [CommonModule, AdbDirectivesModule, TranslatePipe], exports: [AdbConfirmModal] });
|
|
1961
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalModule, providers: [AdbModalService], imports: [CommonModule, AdbDirectivesModule] });
|
|
1962
|
+
}
|
|
1963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbModalModule, decorators: [{
|
|
1964
|
+
type: NgModule,
|
|
1965
|
+
args: [{
|
|
1966
|
+
imports: [CommonModule, AdbDirectivesModule, TranslatePipe],
|
|
1967
|
+
declarations: [AdbConfirmModal],
|
|
1968
|
+
exports: [AdbConfirmModal],
|
|
1969
|
+
providers: [AdbModalService]
|
|
1970
|
+
}]
|
|
1971
|
+
}] });
|
|
1972
|
+
|
|
1973
|
+
class AdbToastService {
|
|
1974
|
+
environmentInjector;
|
|
1975
|
+
appRef;
|
|
1976
|
+
toastsSignal = signal([], ...(ngDevMode ? [{ debugName: "toastsSignal" }] : /* istanbul ignore next */ []));
|
|
1977
|
+
container;
|
|
1978
|
+
constructor(environmentInjector, appRef) {
|
|
1979
|
+
this.environmentInjector = environmentInjector;
|
|
1980
|
+
this.appRef = appRef;
|
|
1875
1981
|
}
|
|
1876
|
-
|
|
1877
|
-
this.
|
|
1982
|
+
add(toastMessage, time = 4000) {
|
|
1983
|
+
this.addContainer();
|
|
1984
|
+
toastMessage.type ??= ToastType.Primary;
|
|
1985
|
+
toastMessage.id = Date.now();
|
|
1986
|
+
toastMessage.delay = of(toastMessage)
|
|
1987
|
+
.pipe(delay(time))
|
|
1988
|
+
.subscribe(toast => this.remove(toast));
|
|
1989
|
+
this.toastsSignal.update(toasts => [...toasts, toastMessage]);
|
|
1878
1990
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
// Disabled state should be handled via template binding
|
|
1991
|
+
remove(toast) {
|
|
1992
|
+
this.toastsSignal.update(toasts => toasts.filter(x => x.id !== toast.id));
|
|
1882
1993
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1994
|
+
addContainer() {
|
|
1995
|
+
if (!this.container) {
|
|
1996
|
+
const componentRef = createComponent(AdbToast, {
|
|
1997
|
+
environmentInjector: this.environmentInjector
|
|
1998
|
+
});
|
|
1999
|
+
this.appRef.attachView(componentRef.hostView);
|
|
2000
|
+
this.container = componentRef.location.nativeElement;
|
|
2001
|
+
document.body.appendChild(this.container);
|
|
2002
|
+
}
|
|
1885
2003
|
}
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
2004
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastService, deps: [{ token: i0.EnvironmentInjector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2005
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastService });
|
|
2006
|
+
}
|
|
2007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastService, decorators: [{
|
|
2008
|
+
type: Injectable
|
|
2009
|
+
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }, { type: i0.ApplicationRef }] });
|
|
2010
|
+
var ToastType;
|
|
2011
|
+
(function (ToastType) {
|
|
2012
|
+
ToastType[ToastType["Primary"] = 1] = "Primary";
|
|
2013
|
+
ToastType[ToastType["Success"] = 2] = "Success";
|
|
2014
|
+
ToastType[ToastType["Warn"] = 3] = "Warn";
|
|
2015
|
+
ToastType[ToastType["Danger"] = 4] = "Danger";
|
|
2016
|
+
})(ToastType || (ToastType = {}));
|
|
2017
|
+
|
|
2018
|
+
class AdbToast {
|
|
2019
|
+
toastService;
|
|
2020
|
+
toastType = ToastType;
|
|
2021
|
+
constructor(toastService) {
|
|
2022
|
+
this.toastService = toastService;
|
|
1889
2023
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
2024
|
+
onRemoveToast(toast) {
|
|
2025
|
+
this.toastService.remove(toast);
|
|
1892
2026
|
}
|
|
1893
|
-
|
|
1894
|
-
static
|
|
1895
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbRichEditorComponent, isStandalone: false, selector: "adb-rich-editor", inputs: { hasTaxon: "hasTaxon", hasReference: "hasReference", rows: "rows", label: "label" }, providers: [
|
|
1896
|
-
{
|
|
1897
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1898
|
-
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1899
|
-
multi: true
|
|
1900
|
-
}
|
|
1901
|
-
], ngImport: i0, template: "<div>\r\n <div class=\"d-flex justify-content-end align-items-end gap-3 mb-1\">\r\n <label class=\"me-auto\" [for]=\"id\">{{label|translate}}</label>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"bi bi-type-italic\"></span></button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"bi bi-type-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"bi bi-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"bi bi-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea [id]=\"id\" class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2027
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToast, deps: [{ token: AdbToastService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2028
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbToast, isStandalone: false, selector: "ng-component", ngImport: i0, template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\" aria-live=\"polite\" aria-atomic=\"true\">\r\n @for (toast of toastService.toastsSignal(); track toast.id) {\r\n <div class=\"alert alert-dismissible position-relative\" role=\"status\"\r\n [class.alert-primary]=\"toast.type===toastType.Primary\"\r\n [class.alert-success]=\"toast.type===toastType.Success\"\r\n [class.alert-warning]=\"toast.type===toastType.Warn\"\r\n [class.alert-danger]=\"toast.type===toastType.Danger\">\r\n\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n \r\n @if (toast.header) {\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\">\r\n @if (!toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n }\r\n @if (toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{(toast.header|translate:toast.headerValue )}}</div>\r\n }\r\n </div>\r\n }\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n @if (!toast.messageValue) {\r\n <div>{{toast.message|translate}}</div>\r\n }\r\n @if (toast.messageValue) {\r\n <div>{{(toast.message|translate:toast.messageValue )}}</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
1902
2029
|
}
|
|
1903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
2030
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToast, decorators: [{
|
|
1904
2031
|
type: Component,
|
|
1905
|
-
args: [{
|
|
1906
|
-
|
|
1907
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1908
|
-
useExisting: forwardRef(() => AdbRichEditorComponent),
|
|
1909
|
-
multi: true
|
|
1910
|
-
}
|
|
1911
|
-
], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<div>\r\n <div class=\"d-flex justify-content-end align-items-end gap-3 mb-1\">\r\n <label class=\"me-auto\" [for]=\"id\">{{label|translate}}</label>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"bi bi-type-italic\"></span></button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"bi bi-type-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"bi bi-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"bi bi-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea [id]=\"id\" class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n" }]
|
|
1912
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasTaxon: [{
|
|
1913
|
-
type: Input
|
|
1914
|
-
}], hasReference: [{
|
|
1915
|
-
type: Input
|
|
1916
|
-
}], rows: [{
|
|
1917
|
-
type: Input
|
|
1918
|
-
}], label: [{
|
|
1919
|
-
type: Input
|
|
1920
|
-
}] } });
|
|
2032
|
+
args: [{ standalone: false, template: "<div class=\"position-fixed bottom-0 end-0\" style=\"z-index: 50000;min-width: 15rem;\" aria-live=\"polite\" aria-atomic=\"true\">\r\n @for (toast of toastService.toastsSignal(); track toast.id) {\r\n <div class=\"alert alert-dismissible position-relative\" role=\"status\"\r\n [class.alert-primary]=\"toast.type===toastType.Primary\"\r\n [class.alert-success]=\"toast.type===toastType.Success\"\r\n [class.alert-warning]=\"toast.type===toastType.Warn\"\r\n [class.alert-danger]=\"toast.type===toastType.Danger\">\r\n\r\n <button type=\"button\" class=\"btn-close\" (click)=\"onRemoveToast(toast)\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\r\n \r\n @if (toast.header) {\r\n <div class=\"d-flex align-items-center justify-content-between pb-1\">\r\n @if (!toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{toast.header|translate}}</div>\r\n }\r\n @if (toast.headerValue) {\r\n <div class=\"fw-bold pb-1\">{{(toast.header|translate:toast.headerValue )}}</div>\r\n }\r\n </div>\r\n }\r\n <div class=\"d-flex align-items-center justify-content-between mt-1\">\r\n @if (!toast.messageValue) {\r\n <div>{{toast.message|translate}}</div>\r\n }\r\n @if (toast.messageValue) {\r\n <div>{{(toast.message|translate:toast.messageValue )}}</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>" }]
|
|
2033
|
+
}], ctorParameters: () => [{ type: AdbToastService }] });
|
|
1921
2034
|
|
|
1922
|
-
|
|
2035
|
+
class AdbToastModule {
|
|
2036
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2037
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbToastModule, declarations: [AdbToast], imports: [CommonModule, AdbDirectivesModule, TranslatePipe], exports: [AdbToast] });
|
|
2038
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastModule, providers: [AdbToastService], imports: [CommonModule, AdbDirectivesModule] });
|
|
2039
|
+
}
|
|
2040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbToastModule, decorators: [{
|
|
2041
|
+
type: NgModule,
|
|
2042
|
+
args: [{
|
|
2043
|
+
imports: [CommonModule, AdbDirectivesModule, TranslatePipe],
|
|
2044
|
+
declarations: [AdbToast],
|
|
2045
|
+
exports: [AdbToast],
|
|
2046
|
+
providers: [AdbToastService]
|
|
2047
|
+
}]
|
|
2048
|
+
}] });
|
|
1923
2049
|
|
|
1924
|
-
class
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
2050
|
+
class AdbHelpButtonComponent {
|
|
2051
|
+
elementRef;
|
|
2052
|
+
showHelp = false;
|
|
2053
|
+
buttonClassSignal = input('btn btn-invisible p-0', { ...(ngDevMode ? { debugName: "buttonClassSignal" } : /* istanbul ignore next */ {}), alias: 'buttonClass' });
|
|
2054
|
+
labelSignal = input('', { ...(ngDevMode ? { debugName: "labelSignal" } : /* istanbul ignore next */ {}), alias: 'label' });
|
|
2055
|
+
id;
|
|
2056
|
+
onClickDoc(event) {
|
|
2057
|
+
const target = event.target;
|
|
2058
|
+
const parent = target.parentElement;
|
|
2059
|
+
const clickedInside = this.elementRef.nativeElement.contains(parent);
|
|
2060
|
+
if (!clickedInside) {
|
|
2061
|
+
this.showHelp = false;
|
|
2062
|
+
}
|
|
1930
2063
|
}
|
|
1931
|
-
|
|
1932
|
-
this.
|
|
1933
|
-
? this.parseCustomMarkdown(this.text)
|
|
1934
|
-
: [];
|
|
2064
|
+
constructor(elementRef) {
|
|
2065
|
+
this.elementRef = elementRef;
|
|
1935
2066
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
while (i < input.length) {
|
|
1945
|
-
if (input.startsWith('**', i) || input.startsWith('__', i)) {
|
|
1946
|
-
const marker = input.slice(i, i + 2);
|
|
1947
|
-
const end = input.indexOf(marker, i + 2);
|
|
1948
|
-
if (end !== -1) {
|
|
1949
|
-
parts.push({
|
|
1950
|
-
type: 'bold',
|
|
1951
|
-
content: input.slice(i + 2, end)
|
|
1952
|
-
});
|
|
1953
|
-
i = end + 2;
|
|
1954
|
-
continue;
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
if (input[i] === '*' || input[i] === '_') {
|
|
1958
|
-
const marker = input[i];
|
|
1959
|
-
const end = input.indexOf(marker, i + 1);
|
|
1960
|
-
if (end !== -1) {
|
|
1961
|
-
parts.push({
|
|
1962
|
-
type: 'italic',
|
|
1963
|
-
content: input.slice(i + 1, end)
|
|
1964
|
-
});
|
|
1965
|
-
i = end + 1;
|
|
1966
|
-
continue;
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
if (input[i] === '[') {
|
|
1970
|
-
const textEnd = input.indexOf(']', i);
|
|
1971
|
-
const linkStart = input.indexOf('(', textEnd);
|
|
1972
|
-
const linkEnd = input.indexOf(')', linkStart);
|
|
1973
|
-
if (textEnd !== -1 && linkStart !== -1 && linkEnd !== -1) {
|
|
1974
|
-
const label = input.slice(i + 1, textEnd);
|
|
1975
|
-
const link = input.slice(linkStart + 1, linkEnd);
|
|
1976
|
-
const [type, id] = link.split(':');
|
|
1977
|
-
if (type === 'taxon' || type === 'reference') {
|
|
1978
|
-
parts.push({
|
|
1979
|
-
type: type,
|
|
1980
|
-
content: label,
|
|
1981
|
-
id
|
|
1982
|
-
});
|
|
1983
|
-
i = linkEnd + 1;
|
|
1984
|
-
continue;
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
let next = input.length;
|
|
1989
|
-
for (const c of ['*', '_', '[']) {
|
|
1990
|
-
const idx = input.indexOf(c, i + 1);
|
|
1991
|
-
if (idx !== -1 && idx < next) {
|
|
1992
|
-
next = idx;
|
|
1993
|
-
}
|
|
2067
|
+
ngOnInit() {
|
|
2068
|
+
this.id = +Math.floor(Math.random() * Date.now());
|
|
2069
|
+
}
|
|
2070
|
+
onClose() {
|
|
2071
|
+
const node = this.elementRef.nativeElement.parentNode;
|
|
2072
|
+
if (node) {
|
|
2073
|
+
if (this.showHelp) {
|
|
2074
|
+
node.classList.remove('position-relative');
|
|
1994
2075
|
}
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
break;
|
|
2076
|
+
else {
|
|
2077
|
+
node.classList.add('position-relative');
|
|
1998
2078
|
}
|
|
1999
|
-
pushText(input.slice(i, next));
|
|
2000
|
-
i = next;
|
|
2001
2079
|
}
|
|
2002
|
-
|
|
2080
|
+
this.showHelp = !this.showHelp;
|
|
2003
2081
|
}
|
|
2004
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
2005
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type:
|
|
2082
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbHelpButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2083
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: AdbHelpButtonComponent, isStandalone: false, selector: "adb-help-button", inputs: { buttonClassSignal: { classPropertyName: "buttonClassSignal", publicName: "buttonClass", isSignal: true, isRequired: false, transformFunction: null }, labelSignal: { classPropertyName: "labelSignal", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onClickDoc($event)" } }, ngImport: i0, template: "<button type=\"button\"\r\n class=\"w-auto d-flex gap-1 align-items-baseline help-button\"\r\n [ngClass]=\"buttonClassSignal()\"\r\n [attr.aria-controls]=\"id\" aria-label=\"Help\"\r\n [attr.aria-expanded]=\"showHelp\" (click)=\"onClose()\">\r\n <span class=\"bi bi-question-circle-fill text-primary\"></span>\r\n {{labelSignal()}}\r\n</button>\r\n<div>\r\n @if (showHelp) {\r\n <div [id]=\"id\" class=\"position-absolute start-0 w-100 adb-plate-primary text-start shadow fw-normal\" style=\"z-index:4\">\r\n <div class=\"d-flex align-items-center\">\r\n <div class=\"flex-grow-1\"><ng-content></ng-content></div>\r\n <div class=\"ms-auto align-self-start d-flex align-items-start\">\r\n <button type=\"button\" class=\"btn-close p-1\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"showHelp=false\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2006
2084
|
}
|
|
2007
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
2085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbHelpButtonComponent, decorators: [{
|
|
2008
2086
|
type: Component,
|
|
2009
|
-
args: [{ selector: 'adb-
|
|
2010
|
-
}], ctorParameters: () => [{ type:
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
}] }], propDecorators: { text: [{
|
|
2014
|
-
type: Input
|
|
2087
|
+
args: [{ selector: 'adb-help-button', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<button type=\"button\"\r\n class=\"w-auto d-flex gap-1 align-items-baseline help-button\"\r\n [ngClass]=\"buttonClassSignal()\"\r\n [attr.aria-controls]=\"id\" aria-label=\"Help\"\r\n [attr.aria-expanded]=\"showHelp\" (click)=\"onClose()\">\r\n <span class=\"bi bi-question-circle-fill text-primary\"></span>\r\n {{labelSignal()}}\r\n</button>\r\n<div>\r\n @if (showHelp) {\r\n <div [id]=\"id\" class=\"position-absolute start-0 w-100 adb-plate-primary text-start shadow fw-normal\" style=\"z-index:4\">\r\n <div class=\"d-flex align-items-center\">\r\n <div class=\"flex-grow-1\"><ng-content></ng-content></div>\r\n <div class=\"ms-auto align-self-start d-flex align-items-start\">\r\n <button type=\"button\" class=\"btn-close p-1\" data-bs-dismiss=\"modal\" aria-label=\"Close\" (click)=\"showHelp=false\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>" }]
|
|
2088
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { buttonClassSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonClass", required: false }] }], labelSignal: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], onClickDoc: [{
|
|
2089
|
+
type: HostListener,
|
|
2090
|
+
args: ['document:click', ['$event']]
|
|
2015
2091
|
}] } });
|
|
2016
2092
|
|
|
2017
|
-
class
|
|
2018
|
-
static
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
providers: [
|
|
2022
|
-
{ provide: RICH_MODULE_CONFIG, useValue: config }
|
|
2023
|
-
]
|
|
2024
|
-
};
|
|
2025
|
-
}
|
|
2026
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2027
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, declarations: [AdbRichEditorComponent, RichTextComponent], imports: [CommonModule, FormsModule, TranslatePipe], exports: [AdbRichEditorComponent, RichTextComponent] });
|
|
2028
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbRichEditorModule, imports: [CommonModule, FormsModule] });
|
|
2093
|
+
class AdbButtonsModule {
|
|
2094
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbButtonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2095
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: AdbButtonsModule, declarations: [AdbHelpButtonComponent], imports: [CommonModule, AdbDirectivesModule], exports: [AdbHelpButtonComponent] });
|
|
2096
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbButtonsModule, imports: [CommonModule, AdbDirectivesModule] });
|
|
2029
2097
|
}
|
|
2030
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
2098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: AdbButtonsModule, decorators: [{
|
|
2031
2099
|
type: NgModule,
|
|
2032
2100
|
args: [{
|
|
2033
|
-
imports: [CommonModule,
|
|
2034
|
-
declarations: [
|
|
2035
|
-
exports: [
|
|
2101
|
+
imports: [CommonModule, AdbDirectivesModule],
|
|
2102
|
+
declarations: [AdbHelpButtonComponent],
|
|
2103
|
+
exports: [AdbHelpButtonComponent]
|
|
2036
2104
|
}]
|
|
2037
2105
|
}] });
|
|
2038
2106
|
|
|
@@ -2045,7 +2113,7 @@ class FilterSectionComponent {
|
|
|
2045
2113
|
templateSignal = contentChild(TemplateRef, ...(ngDevMode ? [{ debugName: "templateSignal" }] : /* istanbul ignore next */ []));
|
|
2046
2114
|
id = `filter-section-${Math.floor(Math.random() * Date.now())}`;
|
|
2047
2115
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FilterSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2048
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FilterSectionComponent, isStandalone: false, selector: "adb-filter-section", inputs: { countSignal: { classPropertyName: "countSignal", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, titleResourceSignal: { classPropertyName: "titleResourceSignal", publicName: "titleResource", isSignal: true, isRequired: false, transformFunction: null }, helpResourceSignal: { classPropertyName: "helpResourceSignal", publicName: "helpResource", isSignal: true, isRequired: false, transformFunction: null }, lazySignal: { classPropertyName: "lazySignal", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, expandedSignal: { classPropertyName: "expandedSignal", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedSignal: "expandedChange" }, queries: [{ propertyName: "templateSignal", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<button [attr.aria-expanded]=\"expandedSignal()\" [attr.aria-controls]=\"id\" class=\"btn btn-invisible px-1\" type=\"button\" (click)=\"expandedSignal.update(value => !value)\">\r\n <div class=\"d-flex align-items-center gap-1 flex-wrap\">\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <span [ngClass]=\"expandedSignal()? 'bi bi-chevron-down': 'bi bi-chevron-right'\"></span>\r\n @if (countSignal() > 0) {\r\n <div class=\"badge bg-primary\">{{ countSignal() }}</div>\r\n }\r\n {{ titleResourceSignal() | translate }}\r\n </div>\r\n @if (helpResourceSignal()) {\r\n <adb-help-button (click)=\"$event.stopPropagation()\">\r\n <adb-rich-text [text]=\"helpResourceSignal() | translate\"></adb-rich-text>\r\n </adb-help-button>\r\n }\r\n </div>\r\n</button>\r\n@if (expandedSignal()) {\r\n<div class=\"px-3 pb-3 border-bottom\" [id]=\"id\">\r\n @if (lazySignal() && templateSignal()) {\r\n <ng-container *ngTemplateOutlet=\"templateSignal()\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</div>\r\n}", dependencies: [{ kind: "directive", type:
|
|
2116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FilterSectionComponent, isStandalone: false, selector: "adb-filter-section", inputs: { countSignal: { classPropertyName: "countSignal", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, titleResourceSignal: { classPropertyName: "titleResourceSignal", publicName: "titleResource", isSignal: true, isRequired: false, transformFunction: null }, helpResourceSignal: { classPropertyName: "helpResourceSignal", publicName: "helpResource", isSignal: true, isRequired: false, transformFunction: null }, lazySignal: { classPropertyName: "lazySignal", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, expandedSignal: { classPropertyName: "expandedSignal", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedSignal: "expandedChange" }, queries: [{ propertyName: "templateSignal", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<button [attr.aria-expanded]=\"expandedSignal()\" [attr.aria-controls]=\"id\" class=\"btn btn-invisible px-1\" type=\"button\" (click)=\"expandedSignal.update(value => !value)\">\r\n <div class=\"d-flex align-items-center gap-1 flex-wrap\">\r\n <div class=\"d-flex align-items-center gap-1\">\r\n <span [ngClass]=\"expandedSignal()? 'bi bi-chevron-down': 'bi bi-chevron-right'\"></span>\r\n @if (countSignal() > 0) {\r\n <div class=\"badge bg-primary\">{{ countSignal() }}</div>\r\n }\r\n {{ titleResourceSignal() | translate }}\r\n </div>\r\n @if (helpResourceSignal()) {\r\n <adb-help-button (click)=\"$event.stopPropagation()\">\r\n <adb-rich-text [text]=\"helpResourceSignal() | translate\"></adb-rich-text>\r\n </adb-help-button>\r\n }\r\n </div>\r\n</button>\r\n@if (expandedSignal()) {\r\n<div class=\"px-3 pb-3 border-bottom\" [id]=\"id\">\r\n @if (lazySignal() && templateSignal()) {\r\n <ng-container *ngTemplateOutlet=\"templateSignal()\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n</div>\r\n}", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AdbHelpButtonComponent, selector: "adb-help-button", inputs: ["buttonClass", "label"] }, { kind: "component", type: RichTextComponent, selector: "adb-rich-text", inputs: ["text"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2049
2117
|
}
|
|
2050
2118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FilterSectionComponent, decorators: [{
|
|
2051
2119
|
type: Component,
|
|
@@ -2529,7 +2597,7 @@ class GenericPickerComponent {
|
|
|
2529
2597
|
this.subs.unsubscribe();
|
|
2530
2598
|
}
|
|
2531
2599
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: GenericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2532
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: GenericPickerComponent, isStandalone: false, selector: "adb-generic-picker", inputs: { search: "search", displayFn: "displayFn", loadById: "loadById", disabled: "disabled", placeholder: "placeholder", initialValue: "initialValue" }, outputs: { selectItemChange: "selectItemChange", focus: "focus" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], ngImport: i0, template: "<div (adbClickOutside)=\"resetPopup()\">\r\n <div class=\"input-group\">\r\n <input [(ngModel)]=\"searchQuery\" class=\"form-control\" role=\"combobox\" aria-autocomplete=\"list\" [attr.aria-expanded]=\"showPop\" aria-controls=\"picker-listbox\" [disabled]=\"disabled\" autocomplete=\"off\" (keyup.arrowdown)=\"onArrowDown()\"\r\n (keyup.arrowup)=\"onArrowUp()\" (keydown.enter)=\"onEnter($event)\" (keydown.escape)=\"resetPopup()\" (keydown.tab)=\"resetPopup()\" (ngModelChange)=\"onModelChange()\" (focus)=\"focus.emit($event)\" [placeholder]=\"placeholder\" />\r\n @if (searchQuery && !showPop) {\r\n <div>\r\n <button type=\"button\" (click)=\"resetModel()\" class=\"btn btn-secondary border border-start-0\">\r\n <span class=\"bi bi-x\"></span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n@let items = items$ | async;\r\n@if (showPop) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div [class.loading]=\"loading\">\r\n @if (error) {\r\n <div class=\"alert alert-danger mb-0\">\r\n Serverfel\r\n </div>\r\n }\r\n @else {\r\n <ul class=\"list-group list-group-flush\" role=\"listbox\" id=\"picker-listbox\">\r\n @for (item of items; track item; let i = $index) {\r\n <li role=\"option\" class=\"list-group-item list-group-item-action pointer\" [class.active]=\"i === rowIndex\" (click)=\"$event.preventDefault(); $event.stopPropagation(); selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, searchQuery: searchQuery }\"></ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "directive", type:
|
|
2600
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: GenericPickerComponent, isStandalone: false, selector: "adb-generic-picker", inputs: { search: "search", displayFn: "displayFn", loadById: "loadById", disabled: "disabled", placeholder: "placeholder", initialValue: "initialValue" }, outputs: { selectItemChange: "selectItemChange", focus: "focus" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], ngImport: i0, template: "<div (adbClickOutside)=\"resetPopup()\">\r\n <div class=\"input-group\">\r\n <input [(ngModel)]=\"searchQuery\" class=\"form-control\" role=\"combobox\" aria-autocomplete=\"list\" [attr.aria-expanded]=\"showPop\" aria-controls=\"picker-listbox\" [disabled]=\"disabled\" autocomplete=\"off\" (keyup.arrowdown)=\"onArrowDown()\"\r\n (keyup.arrowup)=\"onArrowUp()\" (keydown.enter)=\"onEnter($event)\" (keydown.escape)=\"resetPopup()\" (keydown.tab)=\"resetPopup()\" (ngModelChange)=\"onModelChange()\" (focus)=\"focus.emit($event)\" [placeholder]=\"placeholder\" />\r\n @if (searchQuery && !showPop) {\r\n <div>\r\n <button type=\"button\" (click)=\"resetModel()\" class=\"btn btn-secondary border border-start-0\">\r\n <span class=\"bi bi-x\"></span>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n@let items = items$ | async;\r\n@if (showPop) {\r\n<div class=\"pop\">\r\n <div class=\"pop-body\">\r\n <div [class.loading]=\"loading\">\r\n @if (error) {\r\n <div class=\"alert alert-danger mb-0\">\r\n Serverfel\r\n </div>\r\n }\r\n @else {\r\n <ul class=\"list-group list-group-flush\" role=\"listbox\" id=\"picker-listbox\">\r\n @for (item of items; track item; let i = $index) {\r\n <li role=\"option\" class=\"list-group-item list-group-item-action pointer\" [class.active]=\"i === rowIndex\" (click)=\"$event.preventDefault(); $event.stopPropagation(); selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, searchQuery: searchQuery }\"></ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n}", dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[adbClickOutside]", outputs: ["adbClickOutside"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
2533
2601
|
}
|
|
2534
2602
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: GenericPickerComponent, decorators: [{
|
|
2535
2603
|
type: Component,
|
|
@@ -2828,5 +2896,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
2828
2896
|
* Generated bundle index. Do not edit.
|
|
2829
2897
|
*/
|
|
2830
2898
|
|
|
2831
|
-
export { ADB_PICKER_CONFIG, ADB_USER_SERVICE_CONFIG, AdbAreaPickerComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdownDirective, AdbDropdownModule, AdbFilterSectionModule, AdbHelpButtonComponent, AdbModalModule, AdbModalService, AdbPagersModule, AdbPickerConfigService, AdbPickerModule, AdbPipesModule, AdbRichEditorComponent, AdbRichEditorModule, AdbTaxonPickerComponent, AdbToast, AdbToastModule, AdbToastService, AdbUserInterceptor, AdbUserModule, AdbUserService, ArtportalenFooterComponent, ArtportalenNavComponent, ArtportalenNavModule, AuthCallbackComponent, ClickOutsideDirective, DEFAULT_ADB_USER_SERVICE_CONFIG, EmptyValuePipe, EnvironmentService, FileUploadDirective, FilterSectionComponent, FocusDirective, GenericPickerComponent, HighlightHtmlPipe, HighlightPipe, ImageLoaderDirective, InfiniteScrollComponent, LocaleDatePipe, NumberSpacingPipe, PagerComponent, PagerInlineComponent, RedListBadgeClassDirective, RichTextComponent, RiskClassDirective, RouterLinkActiveFragmentDirective, ToastType, UserModuleConstants };
|
|
2899
|
+
export { ADB_ALERT_CONFIG, ADB_PICKER_CONFIG, ADB_USER_SERVICE_CONFIG, AdbAlertComponent, AdbAlertModule, AdbAreaPickerComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdownDirective, AdbDropdownModule, AdbFilterSectionModule, AdbHelpButtonComponent, AdbModalModule, AdbModalService, AdbPagersModule, AdbPickerConfigService, AdbPickerModule, AdbPipesModule, AdbRichEditorComponent, AdbRichEditorModule, AdbTaxonPickerComponent, AdbToast, AdbToastModule, AdbToastService, AdbUserInterceptor, AdbUserModule, AdbUserService, ArtportalenFooterComponent, ArtportalenNavComponent, ArtportalenNavModule, AuthCallbackComponent, ClickOutsideDirective, DEFAULT_ADB_USER_SERVICE_CONFIG, EmptyValuePipe, EnvironmentService, FileUploadDirective, FilterSectionComponent, FocusDirective, GenericPickerComponent, HighlightHtmlPipe, HighlightPipe, ImageLoaderDirective, InfiniteScrollComponent, LocaleDatePipe, NumberSpacingPipe, PagerComponent, PagerInlineComponent, RedListBadgeClassDirective, RichTextComponent, RiskClassDirective, RouterLinkActiveFragmentDirective, ToastType, UserModuleConstants };
|
|
2832
2900
|
//# sourceMappingURL=adb-shared.mjs.map
|