adb-shared 6.2.2 → 6.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/adb-shared.mjs +176 -135
- package/fesm2022/adb-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/types/adb-shared.d.ts +47 -14
package/fesm2022/adb-shared.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import * as i1$2 from '@angular/common/http';
|
|
|
8
8
|
import { provideHttpClient, withInterceptorsFromDi, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
9
9
|
import * as i1 from '@angular/router';
|
|
10
10
|
import { NavigationEnd, RouterModule, NavigationStart } from '@angular/router';
|
|
11
|
-
import { Subscription, Subject, of, BehaviorSubject, catchError, throwError, map as map$1, tap, combineLatest, debounceTime as debounceTime$1
|
|
11
|
+
import { Subscription, Subject, of, BehaviorSubject, catchError, throwError, map as map$1, tap, combineLatest, debounceTime as debounceTime$1 } from 'rxjs';
|
|
12
12
|
import { endOfDay, addYears, startOfDay, subYears, getMonth, subMonths, addMonths, isSameYear, endOfMonth, startOfMonth, eachWeekOfInterval, getISOWeek, addDays, eachDayOfInterval, getHours, getMinutes, isSameDay, isWithinInterval, isSameMonth, isValid, parseISO, addSeconds, format, subDays, startOfYear, endOfYear } from 'date-fns';
|
|
13
13
|
import * as i4 from '@angular/forms';
|
|
14
14
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule, FormControl, FormGroup, FormArray, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -1780,46 +1780,90 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1780
1780
|
}]
|
|
1781
1781
|
}] });
|
|
1782
1782
|
|
|
1783
|
+
const FORMAT_MARKERS = {
|
|
1784
|
+
italic: ['*', '_'],
|
|
1785
|
+
bold: ['**', '__']
|
|
1786
|
+
};
|
|
1787
|
+
const DEFAULT_MARKER = {
|
|
1788
|
+
italic: '*',
|
|
1789
|
+
bold: '**'
|
|
1790
|
+
};
|
|
1783
1791
|
class AdbRichEditorComponent {
|
|
1784
1792
|
constructor(el) {
|
|
1785
1793
|
this.el = el;
|
|
1794
|
+
this.text = '';
|
|
1786
1795
|
this.hasTaxon = false;
|
|
1787
1796
|
this.hasReference = false;
|
|
1788
1797
|
this.rows = 3;
|
|
1789
|
-
//
|
|
1798
|
+
// ---------------------------------------
|
|
1799
|
+
// ControlValueAccessor
|
|
1800
|
+
// ---------------------------------------
|
|
1790
1801
|
this.onChange = () => { };
|
|
1791
1802
|
this.onTouched = () => { };
|
|
1792
1803
|
}
|
|
1804
|
+
getTextarea() {
|
|
1805
|
+
return this.el.nativeElement.querySelector('textarea');
|
|
1806
|
+
}
|
|
1793
1807
|
onDoubleClick() {
|
|
1794
|
-
const textarea = this.
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1808
|
+
const textarea = this.getTextarea();
|
|
1809
|
+
if (!textarea)
|
|
1810
|
+
return;
|
|
1811
|
+
const start = textarea.selectionStart;
|
|
1812
|
+
let end = textarea.selectionEnd;
|
|
1813
|
+
while (end > start && textarea.value[end - 1] === ' ') {
|
|
1814
|
+
end--;
|
|
1799
1815
|
}
|
|
1800
|
-
textarea.setSelectionRange(
|
|
1816
|
+
textarea.setSelectionRange(start, end);
|
|
1801
1817
|
}
|
|
1802
1818
|
onItalicClick() {
|
|
1803
|
-
this.applyFormatting('
|
|
1819
|
+
this.applyFormatting('italic');
|
|
1804
1820
|
}
|
|
1805
1821
|
onBoldClick() {
|
|
1806
|
-
this.applyFormatting('
|
|
1807
|
-
}
|
|
1808
|
-
applyFormatting(
|
|
1809
|
-
const textarea = this.
|
|
1810
|
-
if (textarea)
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1822
|
+
this.applyFormatting('bold');
|
|
1823
|
+
}
|
|
1824
|
+
applyFormatting(type) {
|
|
1825
|
+
const textarea = this.getTextarea();
|
|
1826
|
+
if (!textarea)
|
|
1827
|
+
return;
|
|
1828
|
+
const start = textarea.selectionStart;
|
|
1829
|
+
const end = textarea.selectionEnd;
|
|
1830
|
+
const value = textarea.value;
|
|
1831
|
+
if (start === end) {
|
|
1832
|
+
const marker = DEFAULT_MARKER[type];
|
|
1833
|
+
const newValue = value.slice(0, start) +
|
|
1834
|
+
marker +
|
|
1835
|
+
marker +
|
|
1836
|
+
value.slice(start);
|
|
1837
|
+
this.updateValue(newValue);
|
|
1838
|
+
const cursor = start + marker.length;
|
|
1821
1839
|
textarea.focus();
|
|
1840
|
+
textarea.setSelectionRange(cursor, cursor);
|
|
1841
|
+
return;
|
|
1822
1842
|
}
|
|
1843
|
+
const existingMarker = this.findWrappingMarker(value, start, end, FORMAT_MARKERS[type]);
|
|
1844
|
+
const marker = existingMarker ?? DEFAULT_MARKER[type];
|
|
1845
|
+
const newValue = existingMarker
|
|
1846
|
+
? value.slice(0, start - marker.length) +
|
|
1847
|
+
value.slice(start, end) +
|
|
1848
|
+
value.slice(end + marker.length)
|
|
1849
|
+
: value.slice(0, start) +
|
|
1850
|
+
marker +
|
|
1851
|
+
value.slice(start, end) +
|
|
1852
|
+
marker +
|
|
1853
|
+
value.slice(end);
|
|
1854
|
+
this.updateValue(newValue);
|
|
1855
|
+
const cursorStart = existingMarker
|
|
1856
|
+
? start - marker.length
|
|
1857
|
+
: start + marker.length;
|
|
1858
|
+
const cursorEnd = existingMarker
|
|
1859
|
+
? end - marker.length
|
|
1860
|
+
: end + marker.length;
|
|
1861
|
+
textarea.focus();
|
|
1862
|
+
textarea.setSelectionRange(cursorStart, cursorEnd);
|
|
1863
|
+
}
|
|
1864
|
+
findWrappingMarker(value, start, end, markers) {
|
|
1865
|
+
return (markers.find(marker => value.substring(start - marker.length, start) === marker &&
|
|
1866
|
+
value.substring(end, end + marker.length) === marker) ?? null);
|
|
1823
1867
|
}
|
|
1824
1868
|
onTaxonClick() {
|
|
1825
1869
|
this.replaceMarked('[Name](taxon:0)');
|
|
@@ -1828,34 +1872,33 @@ class AdbRichEditorComponent {
|
|
|
1828
1872
|
this.replaceMarked('[Name](reference:0)');
|
|
1829
1873
|
}
|
|
1830
1874
|
replaceMarked(replaceTag) {
|
|
1831
|
-
const textarea = this.
|
|
1832
|
-
if (textarea)
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
this.onChange(this.text);
|
|
1875
|
+
const textarea = this.getTextarea();
|
|
1876
|
+
if (!textarea)
|
|
1877
|
+
return;
|
|
1878
|
+
const start = textarea.selectionStart;
|
|
1879
|
+
const end = textarea.selectionEnd;
|
|
1880
|
+
const value = textarea.value;
|
|
1881
|
+
const before = start > 0 ? value[start - 1] : '';
|
|
1882
|
+
const after = end < value.length ? value[end] : '';
|
|
1883
|
+
const spaceBefore = before && !/\s/.test(before) ? ' ' : '';
|
|
1884
|
+
const spaceAfter = after && !/\s/.test(after) ? ' ' : '';
|
|
1885
|
+
const newValue = value.slice(0, start) +
|
|
1886
|
+
spaceBefore +
|
|
1887
|
+
replaceTag +
|
|
1888
|
+
spaceAfter +
|
|
1889
|
+
value.slice(end);
|
|
1890
|
+
this.updateValue(newValue);
|
|
1891
|
+
const nameStart = newValue.indexOf('Name', start);
|
|
1892
|
+
if (nameStart === -1)
|
|
1893
|
+
return;
|
|
1894
|
+
const nameEnd = nameStart + 'Name'.length;
|
|
1895
|
+
requestAnimationFrame(() => {
|
|
1896
|
+
textarea.focus();
|
|
1897
|
+
textarea.setSelectionRange(nameStart, nameEnd);
|
|
1898
|
+
});
|
|
1856
1899
|
}
|
|
1857
1900
|
writeValue(value) {
|
|
1858
|
-
this.text = value;
|
|
1901
|
+
this.text = value ?? '';
|
|
1859
1902
|
}
|
|
1860
1903
|
registerOnChange(fn) {
|
|
1861
1904
|
this.onChange = fn;
|
|
@@ -1864,21 +1907,35 @@ class AdbRichEditorComponent {
|
|
|
1864
1907
|
this.onTouched = fn;
|
|
1865
1908
|
}
|
|
1866
1909
|
setDisabledState(isDisabled) {
|
|
1910
|
+
// Intentionally left minimal
|
|
1911
|
+
// Disabled state should be handled via template binding
|
|
1867
1912
|
}
|
|
1868
|
-
|
|
1913
|
+
onTextChange() {
|
|
1914
|
+
this.onChange(this.text);
|
|
1915
|
+
}
|
|
1916
|
+
updateValue(value) {
|
|
1917
|
+
this.text = value;
|
|
1918
|
+
this.onChange(this.text);
|
|
1869
1919
|
}
|
|
1920
|
+
ngOnDestroy() { }
|
|
1870
1921
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AdbRichEditorComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1871
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AdbRichEditorComponent, isStandalone: false, selector: "adb-rich-editor", inputs: { hasTaxon: "hasTaxon", hasReference: "hasReference", rows: "rows" }, providers: [
|
|
1872
|
-
|
|
1922
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AdbRichEditorComponent, isStandalone: false, selector: "adb-rich-editor", inputs: { hasTaxon: "hasTaxon", hasReference: "hasReference", rows: "rows" }, providers: [
|
|
1923
|
+
{
|
|
1924
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1925
|
+
useExisting: forwardRef((() => AdbRichEditorComponent)),
|
|
1873
1926
|
multi: true
|
|
1874
|
-
}
|
|
1927
|
+
}
|
|
1928
|
+
], ngImport: i0, template: "<div>\r\n <div class=\"d-flex justify-content-end gap-3 mb-1\">\r\n <button class=\"btn btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"fas fa-italic\"></span></button>\r\n <button class=\"btn btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"fas fa-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"fas fa-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"fas fa-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
1875
1929
|
}
|
|
1876
1930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AdbRichEditorComponent, decorators: [{
|
|
1877
1931
|
type: Component,
|
|
1878
|
-
args: [{ selector: 'adb-rich-editor', providers: [
|
|
1879
|
-
|
|
1932
|
+
args: [{ selector: 'adb-rich-editor', providers: [
|
|
1933
|
+
{
|
|
1934
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1935
|
+
useExisting: forwardRef((() => AdbRichEditorComponent)),
|
|
1880
1936
|
multi: true
|
|
1881
|
-
}
|
|
1937
|
+
}
|
|
1938
|
+
], standalone: false, template: "<div>\r\n <div class=\"d-flex justify-content-end gap-3 mb-1\">\r\n <button class=\"btn btn-secondary\" (click)=\"onItalicClick()\" title=\"Italic\" aria-label=\"Italic\" type=\"button\"><span class=\"fas fa-italic\"></span></button>\r\n <button class=\"btn btn-secondary\" (click)=\"onBoldClick()\" title=\"Italic\" aria-label=\"strong\" type=\"button\"><span class=\"fas fa-bold\"></span></button>\r\n @if (hasTaxon) {\r\n <button class=\"btn btn-secondary\" (click)=\"onTaxonClick()\" title=\"Taxon\" aria-label=\"Taxon\" type=\"button\"><span class=\"fas fa-bug\"></span></button>\r\n }\r\n @if (hasReference) {\r\n <button class=\"btn btn-secondary\" (click)=\"onReferenceClick()\" title=\"Reference\" aria-label=\"Reference\" type=\"button\"><span class=\"fas fa-asterisk\"></span></button>\r\n }\r\n </div>\r\n <textarea class=\"form-control\" [(ngModel)]=\"text\" (ngModelChange)=\"onTextChange()\" [rows]=\"rows\" (dblclick)=\"onDoubleClick()\"></textarea>\r\n</div>\r\n" }]
|
|
1882
1939
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasTaxon: [{
|
|
1883
1940
|
type: Input
|
|
1884
1941
|
}], hasReference: [{
|
|
@@ -1891,49 +1948,78 @@ const RICH_MODULE_CONFIG = new InjectionToken('richModule.config');
|
|
|
1891
1948
|
|
|
1892
1949
|
class RichTextComponent {
|
|
1893
1950
|
constructor(config) {
|
|
1894
|
-
this.config = config;
|
|
1895
1951
|
this.text = '';
|
|
1896
1952
|
this.parts = [];
|
|
1897
1953
|
this.taxonUrl = config.taxonUrl;
|
|
1898
1954
|
}
|
|
1899
1955
|
ngOnChanges() {
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1956
|
+
this.parts = this.text
|
|
1957
|
+
? this.parseCustomMarkdown(this.text)
|
|
1958
|
+
: [];
|
|
1903
1959
|
}
|
|
1904
1960
|
parseCustomMarkdown(input) {
|
|
1905
1961
|
const parts = [];
|
|
1906
|
-
const
|
|
1907
|
-
const
|
|
1962
|
+
const boldRegex = /(\*\*|__)(.+?)\1/g;
|
|
1963
|
+
const italicRegex = /(\*|_)([^*_]+?)\1/g;
|
|
1908
1964
|
const taxonRegex = /\[([^\]]+)\]\(taxon:([^)]+)\)/g;
|
|
1909
1965
|
const termRegex = /\[([^\]]+)\]\(term:([^)]+)\)/g;
|
|
1910
1966
|
const referenceRegex = /\[([^\]]+)\]\(reference:([^)]+)\)/g;
|
|
1911
|
-
const combinedRegex = new RegExp(
|
|
1967
|
+
const combinedRegex = new RegExp([
|
|
1968
|
+
boldRegex.source,
|
|
1969
|
+
italicRegex.source,
|
|
1970
|
+
taxonRegex.source,
|
|
1971
|
+
termRegex.source,
|
|
1972
|
+
referenceRegex.source
|
|
1973
|
+
].join('|'), 'g');
|
|
1912
1974
|
let lastIndex = 0;
|
|
1913
1975
|
let match;
|
|
1914
1976
|
while ((match = combinedRegex.exec(input)) !== null) {
|
|
1915
1977
|
if (match.index > lastIndex) {
|
|
1916
|
-
parts.push({
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1978
|
+
parts.push({
|
|
1979
|
+
type: 'text',
|
|
1980
|
+
content: input.slice(lastIndex, match.index)
|
|
1981
|
+
});
|
|
1920
1982
|
}
|
|
1921
|
-
|
|
1922
|
-
parts.push({
|
|
1983
|
+
if (match[2]) {
|
|
1984
|
+
parts.push({
|
|
1985
|
+
type: 'bold',
|
|
1986
|
+
content: match[2]
|
|
1987
|
+
});
|
|
1923
1988
|
}
|
|
1924
|
-
else if (match[
|
|
1925
|
-
parts.push({
|
|
1989
|
+
else if (match[4]) {
|
|
1990
|
+
parts.push({
|
|
1991
|
+
type: 'italic',
|
|
1992
|
+
content: match[4]
|
|
1993
|
+
});
|
|
1926
1994
|
}
|
|
1927
1995
|
else if (match[5]) {
|
|
1928
|
-
parts.push({
|
|
1996
|
+
parts.push({
|
|
1997
|
+
type: 'taxon',
|
|
1998
|
+
content: match[5],
|
|
1999
|
+
id: match[6]
|
|
2000
|
+
});
|
|
1929
2001
|
}
|
|
1930
2002
|
else if (match[7]) {
|
|
1931
|
-
parts.push({
|
|
2003
|
+
parts.push({
|
|
2004
|
+
type: 'term',
|
|
2005
|
+
content: match[7],
|
|
2006
|
+
id: match[8]
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
else if (match[9]) {
|
|
2010
|
+
parts.push({
|
|
2011
|
+
type: 'reference',
|
|
2012
|
+
content: match[9],
|
|
2013
|
+
id: match[10]
|
|
2014
|
+
});
|
|
1932
2015
|
}
|
|
1933
2016
|
lastIndex = combinedRegex.lastIndex;
|
|
1934
2017
|
}
|
|
1935
2018
|
if (lastIndex < input.length) {
|
|
1936
|
-
parts.push({
|
|
2019
|
+
parts.push({
|
|
2020
|
+
type: 'text',
|
|
2021
|
+
content: input.slice(lastIndex)
|
|
2022
|
+
});
|
|
1937
2023
|
}
|
|
1938
2024
|
return parts;
|
|
1939
2025
|
}
|
|
@@ -2753,7 +2839,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
2753
2839
|
}]
|
|
2754
2840
|
}] });
|
|
2755
2841
|
|
|
2756
|
-
class
|
|
2842
|
+
class AdbMapUtils {
|
|
2757
2843
|
static { this.INITIAL_CENTER_LAT = 62; }
|
|
2758
2844
|
static { this.INITIAL_CENTER_LNG = 17; }
|
|
2759
2845
|
static { this.OverlayMaps = {
|
|
@@ -2850,13 +2936,13 @@ class MapUtils {
|
|
|
2850
2936
|
}
|
|
2851
2937
|
static addProviders(map) {
|
|
2852
2938
|
const backgroundMaps = {};
|
|
2853
|
-
for (const value of Object.values(
|
|
2939
|
+
for (const value of Object.values(AdbMapUtils.Providers)) {
|
|
2854
2940
|
backgroundMaps[value.name] = value.wms
|
|
2855
2941
|
? Leaflet.tileLayer.wms(value.url, value.params)
|
|
2856
2942
|
: Leaflet.tileLayer(value.url, value.params);
|
|
2857
2943
|
}
|
|
2858
2944
|
map.addLayer(backgroundMaps['Open Streetmap']);
|
|
2859
|
-
Leaflet.control.layers(backgroundMaps,
|
|
2945
|
+
Leaflet.control.layers(backgroundMaps, AdbMapUtils.OverlayMaps).addTo(map);
|
|
2860
2946
|
}
|
|
2861
2947
|
}
|
|
2862
2948
|
|
|
@@ -2870,7 +2956,7 @@ class PolygonDrawerInput {
|
|
|
2870
2956
|
this.onTouched = () => { };
|
|
2871
2957
|
}
|
|
2872
2958
|
ngAfterViewInit() {
|
|
2873
|
-
this.map =
|
|
2959
|
+
this.map = AdbMapUtils.createMap(this.mapId, {
|
|
2874
2960
|
zoom: true,
|
|
2875
2961
|
scrollZoom: true,
|
|
2876
2962
|
providers: true
|
|
@@ -2912,7 +2998,7 @@ class PolygonDrawerInput {
|
|
|
2912
2998
|
this.map.fitBounds(this.shapeLayer.getBounds());
|
|
2913
2999
|
}
|
|
2914
3000
|
else {
|
|
2915
|
-
this.map.setView([
|
|
3001
|
+
this.map.setView([AdbMapUtils.INITIAL_CENTER_LAT, AdbMapUtils.INITIAL_CENTER_LNG], 5);
|
|
2916
3002
|
}
|
|
2917
3003
|
}
|
|
2918
3004
|
clearShape() {
|
|
@@ -2997,8 +3083,6 @@ class AdbMapConfigService {
|
|
|
2997
3083
|
showTime: this.hasFilter(AdbMapFilterType.Time, config.filters),
|
|
2998
3084
|
showArea: this.hasFilter(AdbMapFilterType.Area, config.filters),
|
|
2999
3085
|
showOwnArea: this.hasFilter(AdbMapFilterType.OwnArea, config.filters),
|
|
3000
|
-
showRedList: this.hasFilter(AdbMapFilterType.RedList, config.filters),
|
|
3001
|
-
showRiskList: this.hasFilter(AdbMapFilterType.RiskList, config.filters),
|
|
3002
3086
|
showTaxaLists: this.hasFilter(AdbMapFilterType.TaxaLists, config.filters),
|
|
3003
3087
|
showDatasets: this.hasFilter(AdbMapFilterType.Datasources, config.filters),
|
|
3004
3088
|
};
|
|
@@ -3119,7 +3203,7 @@ class AdbObsMapComponent {
|
|
|
3119
3203
|
});
|
|
3120
3204
|
}
|
|
3121
3205
|
ngAfterViewInit() {
|
|
3122
|
-
this.map =
|
|
3206
|
+
this.map = AdbMapUtils.createMap(this.mapId, {
|
|
3123
3207
|
zoom: true,
|
|
3124
3208
|
scrollZoom: true,
|
|
3125
3209
|
providers: true
|
|
@@ -3159,7 +3243,6 @@ class AdbObsMapComponent {
|
|
|
3159
3243
|
this.mapLoading.set(true);
|
|
3160
3244
|
this.error = null;
|
|
3161
3245
|
const url = this.config.observationFeatures;
|
|
3162
|
-
// params: { includeFilterAreasInResult: true ,observationsLimit: 0 } }
|
|
3163
3246
|
this.subscriptions.add(this.http.get(url, { observe: 'response', params: qParams }).
|
|
3164
3247
|
pipe(finalize(() => {
|
|
3165
3248
|
this.mapLoading.set(false);
|
|
@@ -3266,8 +3349,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
3266
3349
|
|
|
3267
3350
|
class AdbMapFilters {
|
|
3268
3351
|
static { this.AlienSpecies = 35; }
|
|
3269
|
-
static { this.Risklist = 38; }
|
|
3270
|
-
static { this.Redlist = 227; }
|
|
3271
3352
|
static { this.datasets = ['1', '3', '5', '6', '4', '8']; }
|
|
3272
3353
|
constructor(cdr, config, http, router, activatedRoute) {
|
|
3273
3354
|
this.cdr = cdr;
|
|
@@ -3284,7 +3365,7 @@ class AdbMapFilters {
|
|
|
3284
3365
|
this.filters = config.filters;
|
|
3285
3366
|
}
|
|
3286
3367
|
ngOnInit() {
|
|
3287
|
-
const lists$ = this.
|
|
3368
|
+
const lists$ = this.http.get(this.config.taxaListsApi);
|
|
3288
3369
|
const combined$ = combineLatest([this.activatedRoute.paramMap, this.activatedRoute.queryParamMap, lists$])
|
|
3289
3370
|
.pipe(map$1(results => ({ params: results[0], qParams: results[1], lists: results[2] })), debounceTime$1(0));
|
|
3290
3371
|
this.subscriptions.add(combined$.subscribe(result => {
|
|
@@ -3343,16 +3424,8 @@ class AdbMapFilters {
|
|
|
3343
3424
|
else {
|
|
3344
3425
|
params.taxonId = data.taxonId ?? null;
|
|
3345
3426
|
}
|
|
3346
|
-
if (data.
|
|
3347
|
-
|
|
3348
|
-
params.rlc = selected.length ? selected : null;
|
|
3349
|
-
}
|
|
3350
|
-
if (data.rc?.length > 0) {
|
|
3351
|
-
const selected = data.rc.filter(f => f.selected).map(m => m.id);
|
|
3352
|
-
params.rc = selected.length ? selected : null;
|
|
3353
|
-
}
|
|
3354
|
-
if (data.tl?.length > 0) {
|
|
3355
|
-
params.tl = data.tl;
|
|
3427
|
+
if (data.list?.length > 0) {
|
|
3428
|
+
params.list = data.list;
|
|
3356
3429
|
}
|
|
3357
3430
|
if (data.ds?.length > 0) {
|
|
3358
3431
|
const selected = data.ds.filter(f => f.selected).map(m => m.id);
|
|
@@ -3377,24 +3450,10 @@ class AdbMapFilters {
|
|
|
3377
3450
|
this.areaCount = areas?.length;
|
|
3378
3451
|
if (!this.hasTaxonInUrlParameter) {
|
|
3379
3452
|
form.addControl('taxonId', new FormControl(qMap.get('taxonId') ?? null));
|
|
3380
|
-
|
|
3381
|
-
this.
|
|
3382
|
-
form.addControl('rlc', new FormArray(lists.redlist.map(redlistCat => new FormGroup({
|
|
3383
|
-
id: new FormControl(redlistCat.id),
|
|
3384
|
-
selected: new FormControl(selectedRedLists?.includes('' + redlistCat.id))
|
|
3385
|
-
}))));
|
|
3386
|
-
this.rlcControls = form.get('rlc').controls;
|
|
3387
|
-
let selectedRisks = qMap.has('rc') ? (Array.isArray(qMap.getAll('rc')) ? qMap.getAll('rc') : [qMap.get('rc')]) : null;
|
|
3388
|
-
this.riskListCount = selectedRisks?.length;
|
|
3389
|
-
form.addControl('rc', new FormArray(lists.riskList.map(risklistCat => new FormGroup({
|
|
3390
|
-
id: new FormControl(risklistCat.id),
|
|
3391
|
-
selected: new FormControl(selectedRisks?.includes('' + risklistCat.id))
|
|
3392
|
-
}))));
|
|
3393
|
-
this.rcControls = form.get('rc').controls;
|
|
3394
|
-
const selectedTaxonList = qMap.has('tl') ? qMap.getAll('tl').map(val => Number(val)).filter(val => !isNaN(val)) : null;
|
|
3395
|
-
this.taxaLists = lists.others;
|
|
3453
|
+
const selectedTaxonList = qMap.has('list') ? qMap.getAll('list').map(val => Number(val)).filter(val => !isNaN(val)) : null;
|
|
3454
|
+
this.taxaLists = lists;
|
|
3396
3455
|
this.taxonListCount = selectedTaxonList?.length;
|
|
3397
|
-
form.addControl('
|
|
3456
|
+
form.addControl('list', new FormControl(selectedTaxonList));
|
|
3398
3457
|
let datasets = qMap.has('ds') ? (Array.isArray(qMap.getAll('ds')) ? qMap.getAll('ds') : [qMap.get('ds')]) : null;
|
|
3399
3458
|
this.dataSetCount = datasets?.length;
|
|
3400
3459
|
form.addControl('ds', new FormArray(AdbMapFilters.datasets.map(id => new FormGroup({
|
|
@@ -3420,33 +3479,15 @@ class AdbMapFilters {
|
|
|
3420
3479
|
}
|
|
3421
3480
|
}
|
|
3422
3481
|
;
|
|
3423
|
-
getLists() {
|
|
3424
|
-
return this.http.get(this.config.taxaListsApi).pipe(map$1(lists => {
|
|
3425
|
-
const alienSpecies = lists.find(f => f.id === AdbMapFilters.AlienSpecies);
|
|
3426
|
-
const redlist = lists.find(f => f.id === AdbMapFilters.Redlist);
|
|
3427
|
-
return {
|
|
3428
|
-
others: lists.filter(f => f.id !== AdbMapFilters.AlienSpecies && f.id !== AdbMapFilters.Redlist) ?? [],
|
|
3429
|
-
redlist: redlist?.children ?? [],
|
|
3430
|
-
riskList: alienSpecies?.children?.find(c => c.id === AdbMapFilters.Risklist)?.children ?? []
|
|
3431
|
-
};
|
|
3432
|
-
}), catchError(err => {
|
|
3433
|
-
this.listsError = err;
|
|
3434
|
-
return of({
|
|
3435
|
-
others: [],
|
|
3436
|
-
redlist: [],
|
|
3437
|
-
riskList: []
|
|
3438
|
-
});
|
|
3439
|
-
}), shareReplay(1));
|
|
3440
|
-
}
|
|
3441
3482
|
ngOnDestroy() {
|
|
3442
3483
|
this.subscriptions.unsubscribe();
|
|
3443
3484
|
}
|
|
3444
3485
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AdbMapFilters, deps: [{ token: i0.ChangeDetectorRef }, { token: AdbMapConfigService }, { token: i1$2.HttpClient }, { token: i1.Router }, { token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3445
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AdbMapFilters, isStandalone: false, selector: "adb-map-filters", inputs: { inline: "inline" }, ngImport: i0, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.showRedList){\r\n <adb-filter-section [count]=\"redListCount\" titleResource=\"REDLIST.REDLIST_2025\">\r\n @if (form.get('rlc')) {\r\n <div formArrayName=\"rlc\">\r\n @for (item of rlcControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'rlc-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'rlc-' + item.value.id\" class=\"form-check-label\">{{ 'REDLIST_CATEGORIES_LIST_ID.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showRiskList){\r\n <adb-filter-section [count]=\"riskListCount\" titleResource=\"ALIEN.ALIEN_SPECIES_SHORT\">\r\n @if(form.get('rc')){\r\n <div formArrayName=\"rc\">\r\n @for ( item of rcControls; track item.id; let i = $index ) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'rc-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'rc-' + item.value.id\" class=\"form-check-label\">{{ 'RISKLIST_CATEGORIES.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showTaxaLists){\r\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\r\n <div class=\"mb-3\">\r\n <app-treeview formControlName=\"tl\" [nodes]=\"taxaLists\"></app-treeview>\r\n </div>\r\n {{'LISTS.READ_MORE'|translate}}\r\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\r\n </adb-filter-section>\r\n }\r\n @if(filters.showDatasets){\r\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\r\n @if (form.get('ds')) {\r\n <div formArrayName=\"ds\">\r\n @for (item of dsControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n }\r\n </div>\r\n <div class=\"d-flex justify-content-end gap-2\">\r\n @if (inline) {\r\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\r\n {{'CANCEL'|translate}}\r\n </a>\r\n }\r\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"form.invalid||form.pristine\">{{'FILTER'|translate}}</button>\r\n </div>\r\n</form>\r\n}", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: AdbDatePickerDirective, selector: "input[adbDatepicker]", inputs: ["format", "toLeft", "settings"], outputs: ["adbBlur"] }, { kind: "component", type: FilterSectionComponent, selector: "adb-filter-section", inputs: ["titleResource", "helpResource", "count", "expanded", "lazy"] }, { kind: "component", type: AdbAreaPickerComponent, selector: "adb-area-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: AdbTaxonPickerComponent, selector: "adb-taxon-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: PolygonDrawerInput, selector: "adb-polygon-drawer" }, { kind: "component", type: TreeviewComponent, selector: "app-treeview", inputs: ["nodes"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3486
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AdbMapFilters, isStandalone: false, selector: "adb-map-filters", inputs: { inline: "inline" }, ngImport: i0, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.showTaxaLists){\r\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\r\n <div class=\"mb-3\">\r\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\r\n </div>\r\n {{'LISTS.READ_MORE'|translate}}\r\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\r\n </adb-filter-section>\r\n }\r\n @if(filters.showDatasets){\r\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\r\n @if (form.get('ds')) {\r\n <div formArrayName=\"ds\">\r\n @for (item of dsControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n }\r\n </div>\r\n <div class=\"d-flex justify-content-end gap-2\">\r\n @if (inline) {\r\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\r\n {{'CANCEL'|translate}}\r\n </a>\r\n }\r\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"form.invalid||form.pristine\">{{'FILTER'|translate}}</button>\r\n </div>\r\n</form>\r\n}", dependencies: [{ kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: AdbDatePickerDirective, selector: "input[adbDatepicker]", inputs: ["format", "toLeft", "settings"], outputs: ["adbBlur"] }, { kind: "component", type: FilterSectionComponent, selector: "adb-filter-section", inputs: ["titleResource", "helpResource", "count", "expanded", "lazy"] }, { kind: "component", type: AdbAreaPickerComponent, selector: "adb-area-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: AdbTaxonPickerComponent, selector: "adb-taxon-picker", inputs: ["placeholder", "useObject", "prefill"] }, { kind: "component", type: PolygonDrawerInput, selector: "adb-polygon-drawer" }, { kind: "component", type: TreeviewComponent, selector: "app-treeview", inputs: ["nodes"] }, { kind: "pipe", type: i1$3.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3446
3487
|
}
|
|
3447
3488
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AdbMapFilters, decorators: [{
|
|
3448
3489
|
type: Component,
|
|
3449
|
-
args: [{ selector: 'adb-map-filters', standalone: false, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.
|
|
3490
|
+
args: [{ selector: 'adb-map-filters', standalone: false, template: "@if(form){\r\n<form [formGroup]=\"form\" class=\"form mb-3\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"mb-3\">\r\n <adb-filter-section titleResource=\"TAXON.TAXA\" [expanded]=\"true\">\r\n @if(filters.showTaxon&&!hasTaxonInUrlParameter){\r\n <div class=\"mb-3\">\r\n <label for=\"species\">{{'TAXON.TAXON'|translate}}</label>\r\n <adb-taxon-picker formControlName=\"taxonId\" id=\"species\"></adb-taxon-picker>\r\n </div>\r\n }\r\n </adb-filter-section>\r\n @if(filters.showTime){\r\n <adb-filter-section [count]=\"periodCount\" titleResource=\"OBSERVATION.PERIOD\">\r\n <div class=\"mb-1\">\r\n <select class=\"form-select\" formControlName=\"period\" id=\"period\">\r\n <option value=\"1\">{{thisYear|date:'yyyy'}}</option>\r\n <option value=\"2\">{{lastYear|date:'yyyy'}}</option>\r\n <option value=\"3\">{{'OBSERVATION.ALL_YEAR'|translate}}</option>\r\n <option value=\"4\">{{'OBSERVATION.LAST_5_YEAR'|translate}}</option>\r\n <option value=\"5\">{{'OBSERVATION.LAST_25_YEAR'|translate}}</option>\r\n <option value=\"6\">{{'OBSERVATION.CUSTOMIZED'|translate}}</option>\r\n </select>\r\n </div>\r\n @if (form.value?.period==='6') {\r\n <div class=\"mb-2\">\r\n <label for=\"startAt\">{{'FROM' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"startAt\" formControlName=\"startAt\" [settings]=\"dateConfig\">\r\n </div>\r\n <div class=\"mb-2\">\r\n <label for=\"endAt\">{{'TO' |translate}}</label>\r\n <input adbDatepicker type=\"text\" class=\"form-control datepicker\" id=\"endAt\" formControlName=\"endAt\" [settings]=\"dateConfig\">\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n @if(filters.showArea){\r\n <adb-filter-section [count]=\"areaCount\" titleResource=\"GEOGRAPHY\" [lazy]=\"true\">\r\n <ng-template>\r\n @if(filters.showOwnArea){\r\n <div role=\"tablist\" aria-label=\"{{'AREA'|translate}}\" class=\"d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"!hasOwnArea\" (click)=\"hasOwnArea=false\" role=\"tab\" id=\"tab-select\" aria-selected=\"{{!hasOwnArea}}\" aria-controls=\"panel-select\">\r\n {{'CHOOSE'|translate}}\r\n </button>\r\n <button class=\"btn btn-link p-0\" [class.text-dark]=\"hasOwnArea\" (click)=\"hasOwnArea=true\" role=\"tab\" id=\"tab-draw\" aria-selected=\"false\" aria-controls=\"panel-draw\">\r\n {{'OWN_AREA'|translate}}\r\n </button>\r\n </div>\r\n }\r\n <div class=\"mb-2\">\r\n @if(hasOwnArea&&filters.showOwnArea){\r\n <div class=\"pt-1\" role=\"tabpanel\" id=\"area-draw\" aria-labelledby=\"tab-draw\">\r\n <div>\r\n <adb-polygon-drawer formControlName=\"geo\"></adb-polygon-drawer>\r\n </div>\r\n </div>\r\n }@else{\r\n <div role=\"tabpanel\" id=\"area-select\" aria-labelledby=\"tab-select\">\r\n <div formArrayName=\"areas\">\r\n <div class=\"d-flex align-items-end mb-1\">\r\n <label>{{'AREAS'|translate}}</label>\r\n <button class=\"ms-auto text-dark btn btn-sm btn-secondary\" attr.aria-label=\"{{'OBSERVATION.ADD_AREA'|translate}}\" title=\"{{'OBSERVATION.ADD_AREA'|translate}}\" type=\"button\" (click)=\"addArea()\">\r\n <span class=\"fas fa-plus\"></span>\r\n </button>\r\n </div>\r\n @for (ctrl of areasArray.controls; track ctrl; let i = $index; let last = $last) {\r\n <div class=\"d-flex mb-2\">\r\n <adb-area-picker id=\"area-{{i}}\" [formControlName]=\"i\"></adb-area-picker>\r\n @if(areasArray.length>1){\r\n <button class=\"btn btn-secondary ms-1\" attr.aria-label=\"{{'DELETE'|translate}}\" title=\"{{'DELETE'|translate}}\" type=\"button\" (click)=\"removeArea(i)\">\r\n <span class=\"fas fa-trash\"></span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n </adb-filter-section>\r\n }\r\n @if(form.get('taxonId')){\r\n @if(filters.showTaxaLists){\r\n <adb-filter-section [count]=\"taxonListCount\" titleResource=\"LISTS.NATURE_CONSERVATION_LISTS\">\r\n <div class=\"mb-3\">\r\n <app-treeview formControlName=\"list\" [nodes]=\"taxaLists\"></app-treeview>\r\n </div>\r\n {{'LISTS.READ_MORE'|translate}}\r\n <a [href]=\"artfakta\">{{'LISTS.LIST_CONTENT'|translate}}</a>\r\n </adb-filter-section>\r\n }\r\n @if(filters.showDatasets){\r\n <adb-filter-section [count]=\"dataSetCount\" titleResource=\"DATASET.DATASETS\">\r\n @if (form.get('ds')) {\r\n <div formArrayName=\"ds\">\r\n @for (item of dsControls; track item; let i = $index) {\r\n <div [formGroupName]=\"i\" class=\"form-check\">\r\n <input type=\"checkbox\" formControlName=\"selected\" [id]=\"'ds-' + item.value.id\" class=\"form-check-input\">\r\n <label [for]=\"'ds-' + item.value.id\" class=\"form-check-label\">{{ 'PROVIDERS.'+item.value.id |translate }}</label>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </adb-filter-section>\r\n }\r\n }\r\n </div>\r\n <div class=\"d-flex justify-content-end gap-2\">\r\n @if (inline) {\r\n <a class=\"btn btn-secondary\" [routerLink]=\"[]\">\r\n {{'CANCEL'|translate}}\r\n </a>\r\n }\r\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"form.invalid||form.pristine\">{{'FILTER'|translate}}</button>\r\n </div>\r\n</form>\r\n}" }]
|
|
3450
3491
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: AdbMapConfigService }, { type: i1$2.HttpClient }, { type: i1.Router }, { type: i1.ActivatedRoute }], propDecorators: { inline: [{
|
|
3451
3492
|
type: Input
|
|
3452
3493
|
}] } });
|
|
@@ -3531,5 +3572,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
3531
3572
|
* Generated bundle index. Do not edit.
|
|
3532
3573
|
*/
|
|
3533
3574
|
|
|
3534
|
-
export { ADB_MAP_CONFIG, ADB_PICKER_CONFIG, ADB_USER_SERVICE_CONFIG, AdbAreaPickerComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdown2Directive, AdbDropdownDirective, AdbDropdownModule, AdbFilterSectionModule, AdbHelpButtonComponent, AdbMapConfigService, AdbMapFilterType, AdbMapFilters, AdbMapModule, AdbModalModule, AdbModalService, AdbObsMapComponent, 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, PolygonDrawerInput, RedListBadgeClassDirective, RichTextComponent, RiskClassDirective, RouterLinkActiveFragmentDirective, ToastType, UserModuleConstants, VisibleFilters };
|
|
3575
|
+
export { ADB_MAP_CONFIG, ADB_PICKER_CONFIG, ADB_USER_SERVICE_CONFIG, AdbAreaPickerComponent, AdbButtonsModule, AdbConfirmModal, AdbDatePickerComponent, AdbDatePickerDirective, AdbDatePickerModule, AdbDirectivesModule, AdbDropdown2Directive, AdbDropdownDirective, AdbDropdownModule, AdbFilterSectionModule, AdbHelpButtonComponent, AdbMapConfigService, AdbMapFilterType, AdbMapFilters, AdbMapModule, AdbMapUtils, AdbModalModule, AdbModalService, AdbObsMapComponent, 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, PolygonDrawerInput, RedListBadgeClassDirective, RichTextComponent, RiskClassDirective, RouterLinkActiveFragmentDirective, ToastType, UserModuleConstants, VisibleFilters };
|
|
3535
3576
|
//# sourceMappingURL=adb-shared.mjs.map
|