@konce-pt/angular 0.11.2 → 0.14.0
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/CHANGELOG.md +792 -333
- package/README.md +111 -55
- package/charts/src/lib/llms.txt +23 -15
- package/chat/src/lib/llms.txt +68 -33
- package/fesm2022/konce-pt-angular-charts.mjs +149 -68
- package/fesm2022/konce-pt-angular-charts.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-chat.mjs +296 -135
- package/fesm2022/konce-pt-angular-chat.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-grid.mjs +16 -16
- package/fesm2022/konce-pt-angular-grid.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-icons.mjs +5 -5
- package/fesm2022/konce-pt-angular-icons.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-map.mjs +360 -293
- package/fesm2022/konce-pt-angular-map.mjs.map +1 -1
- package/fesm2022/konce-pt-angular-roadmap.mjs +120 -34
- package/fesm2022/konce-pt-angular-roadmap.mjs.map +1 -1
- package/fesm2022/konce-pt-angular.mjs +7117 -3373
- package/fesm2022/konce-pt-angular.mjs.map +1 -1
- package/grid/src/lib/llms.txt +18 -18
- package/map/src/lib/llms.txt +142 -140
- package/package.json +14 -12
- package/roadmap/src/lib/llms.txt +37 -27
- package/src/lib/accordion/llms.txt +18 -6
- package/src/lib/alert/llms.txt +5 -4
- package/src/lib/app-shell/llms.txt +25 -22
- package/src/lib/auth/llms.txt +26 -22
- package/src/lib/autocomplete/llms.txt +18 -4
- package/src/lib/avatar/llms.txt +3 -3
- package/src/lib/avatar-group/llms.txt +5 -5
- package/src/lib/backdrop/llms.txt +35 -35
- package/src/lib/badge/llms.txt +7 -7
- package/src/lib/bottom-sheet/llms.txt +6 -3
- package/src/lib/breadcrumb/llms.txt +9 -1
- package/src/lib/breakpoint/llms.txt +8 -8
- package/src/lib/button/llms.txt +26 -18
- package/src/lib/button-group/llms.txt +40 -31
- package/src/lib/card/llms.txt +19 -19
- package/src/lib/carousel/llms.txt +6 -6
- package/src/lib/checkbox/llms.txt +17 -2
- package/src/lib/chip/llms.txt +6 -6
- package/src/lib/chips-input/llms.txt +14 -4
- package/src/lib/color-picker/llms.txt +7 -4
- package/src/lib/confirm/llms.txt +9 -3
- package/src/lib/context-menu/llms.txt +7 -4
- package/src/lib/data-table/llms.txt +280 -227
- package/src/lib/data-view/llms.txt +25 -4
- package/src/lib/date-range/llms.txt +37 -18
- package/src/lib/datepicker/llms.txt +46 -29
- package/src/lib/dialog/llms.txt +29 -26
- package/src/lib/divider/llms.txt +2 -1
- package/src/lib/drawer/llms.txt +9 -6
- package/src/lib/empty/llms.txt +4 -4
- package/src/lib/fab/llms.txt +6 -2
- package/src/lib/fieldset/llms.txt +22 -4
- package/src/lib/file-upload/llms.txt +3 -0
- package/src/lib/form-field/llms.txt +33 -19
- package/src/lib/galleria/llms.txt +3 -3
- package/src/lib/i18n/llms.txt +15 -8
- package/src/lib/icon/llms.txt +9 -9
- package/src/lib/icon-button/llms.txt +8 -3
- package/src/lib/image/llms.txt +4 -4
- package/src/lib/input/llms.txt +21 -7
- package/src/lib/input-mask/llms.txt +5 -2
- package/src/lib/input-number/llms.txt +18 -15
- package/src/lib/input-otp/llms.txt +15 -4
- package/src/lib/knob/llms.txt +14 -7
- package/src/lib/listbox/llms.txt +8 -5
- package/src/lib/loader/llms.txt +72 -0
- package/src/lib/megamenu/llms.txt +16 -5
- package/src/lib/mention/llms.txt +15 -15
- package/src/lib/menu/llms.txt +12 -12
- package/src/lib/menubar/llms.txt +16 -5
- package/src/lib/meter-group/llms.txt +7 -7
- package/src/lib/order-list/llms.txt +20 -5
- package/src/lib/paginator/llms.txt +5 -5
- package/src/lib/panel/llms.txt +20 -8
- package/src/lib/password/llms.txt +17 -5
- package/src/lib/peek/llms.txt +11 -11
- package/src/lib/pick-list/llms.txt +28 -5
- package/src/lib/popover/llms.txt +9 -6
- package/src/lib/progress/llms.txt +16 -16
- package/src/lib/radio-group/llms.txt +13 -3
- package/src/lib/rating/llms.txt +13 -6
- package/src/lib/rich-text/llms.txt +42 -24
- package/src/lib/scroll-top/llms.txt +3 -3
- package/src/lib/select/llms.txt +23 -13
- package/src/lib/sidenav/llms.txt +8 -8
- package/src/lib/slider/llms.txt +23 -7
- package/src/lib/speech/llms.txt +108 -0
- package/src/lib/speed-dial/llms.txt +9 -3
- package/src/lib/spinner/llms.txt +2 -2
- package/src/lib/split-button/llms.txt +14 -8
- package/src/lib/splitter/llms.txt +8 -8
- package/src/lib/stepper/llms.txt +26 -7
- package/src/lib/switch/llms.txt +13 -3
- package/src/lib/switch-group/llms.txt +12 -9
- package/src/lib/tabs/llms.txt +7 -4
- package/src/lib/textarea/llms.txt +16 -5
- package/src/lib/timeline/llms.txt +1 -1
- package/src/lib/toast/llms.txt +36 -5
- package/src/lib/toolbar/llms.txt +3 -3
- package/src/lib/tooltip/llms.txt +13 -10
- package/src/lib/tree/llms.txt +19 -5
- package/src/lib/update/llms.txt +52 -0
- package/types/konce-pt-angular-charts.d.ts +11 -0
- package/types/konce-pt-angular-charts.d.ts.map +1 -1
- package/types/konce-pt-angular-chat.d.ts +98 -40
- package/types/konce-pt-angular-chat.d.ts.map +1 -1
- package/types/konce-pt-angular-grid.d.ts +14 -14
- package/types/konce-pt-angular-icons.d.ts +3 -3
- package/types/konce-pt-angular-map.d.ts +147 -119
- package/types/konce-pt-angular-map.d.ts.map +1 -1
- package/types/konce-pt-angular-roadmap.d.ts +34 -9
- package/types/konce-pt-angular-roadmap.d.ts.map +1 -1
- package/types/konce-pt-angular.d.ts +1774 -651
- package/types/konce-pt-angular.d.ts.map +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, model, input, booleanAttribute, output, inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, Injector, effect, untracked, runInInjectionContext, numberAttribute, DestroyRef, TemplateRef, Directive, viewChild, contentChildren, contentChild, afterNextRender } from '@angular/core';
|
|
4
|
-
import { KptI18n, KptCheckbox, KptDatepicker, KptIcon, KptIconButton, KptFileUpload, KptInput, KptFormField, KptTextarea, KptInputNumber, KptSelect, KptButton, KptIconRegistry, KptDialog } from '@konce-pt/angular';
|
|
4
|
+
import { KptI18n, KptCheckbox, KptDatepicker, KptIcon, KptIconButton, KptFileUpload, KptInput, KptFormField, KptTextarea, KptInputNumber, KptSelect, KptButton, KptSpeechButton, KptIconRegistry, KptDialog } from '@konce-pt/angular';
|
|
5
5
|
import { isFittableBounds, emptyWeek, weekdayName, parseTime, contrastVarOf, colorVarOf, createLeafletEngine, createGoogleEngine, countByCategory, clusterLocations, isCluster, renderClusterHtml, renderMarkerHtml, haversine, resolveCountryView, boundsOf, KPT_MAP_DEFAULT_TILE_URL, KPT_MAP_DEFAULT_ATTRIBUTION, renderUserMarkerHtml, isSplittable, foregroundVarOf, formatDistance, isAlwaysOpen, isOpenAt, groupWeek, nextChange, normalizeUrl, prettyUrl, formatLatLng } from '@konce-pt/map';
|
|
6
6
|
export { KPT_CLUSTER_DEFAULTS, KPT_EARTH_RADIUS, KPT_MAP_COUNTRIES, KPT_MAP_DEFAULT_ATTRIBUTION, KPT_MAP_DEFAULT_COUNTRY, KPT_MAP_DEFAULT_TILE_URL, KPT_MAX_LATITUDE, KPT_MIN_FIT_SPAN, KPT_TILE_SIZE, boundsCenter, boundsContain, boundsOf, centerOfBounds, clampLat, clusterLocations, clusterTier, colorVarOf, contrastVarOf, countByCategory, countryCodes, countryPreset, createGoogleEngine, createLeafletEngine, dominantCategory, emptyWeek, foregroundVarOf, formatDistance, formatLatLng, formatTime, groupWeek, haversine, isAlwaysOpen, isCluster, isFittableBounds, isOpenAt, isSplittable, isoWeekday, loadGoogleMapsApi, metersPerPixel, nextChange, normalizeLng, padBounds, parseTime, project, renderClusterHtml, renderMarkerHtml, renderUserMarkerHtml, resolveCountryView, unproject, weekdayName, worldSize, zoomForBounds } from '@konce-pt/map';
|
|
7
7
|
import { form, required, min, max, email, pattern, validate, submit, FormRoot, FormField } from '@angular/forms/signals';
|
|
8
8
|
import { of, Observable } from 'rxjs';
|
|
9
9
|
|
|
10
10
|
const KPT_MAP_GEOCODER = new InjectionToken('KPT_MAP_GEOCODER');
|
|
11
|
-
/** Publiczna instancja OSM. Ma twardą politykę użycia
|
|
11
|
+
/** Publiczna instancja OSM. Ma twardą politykę użycia - patrz JSDoc providera. */
|
|
12
12
|
const NOMINATIM_URL = 'https://nominatim.openstreetmap.org';
|
|
13
13
|
/** Polityka publicznej instancji Nominatim: maksymalnie jedno zapytanie na sekundę. */
|
|
14
14
|
const NOMINATIM_MIN_INTERVAL_MS = 1000;
|
|
@@ -19,7 +19,7 @@ const NOMINATIM_MIN_INTERVAL_MS = 1000;
|
|
|
19
19
|
class KptNominatimGeocoder {
|
|
20
20
|
constructor(options = {}) {
|
|
21
21
|
this.options = options;
|
|
22
|
-
/** Ogon kolejki
|
|
22
|
+
/** Ogon kolejki - każde kolejne zapytanie czeka na swoją kolej. */
|
|
23
23
|
this.next = Promise.resolve();
|
|
24
24
|
/** Kiedy wystrzeliło poprzednie zapytanie. `0` = jeszcze żadne. */
|
|
25
25
|
this.lastAt = 0;
|
|
@@ -29,9 +29,9 @@ class KptNominatimGeocoder {
|
|
|
29
29
|
* Rezerwuje miejsce w kolejce: czeka na poprzednie zapytanie, a potem tylko tyle,
|
|
30
30
|
* ile brakuje do pełnego odstępu od jego wystrzału.
|
|
31
31
|
*
|
|
32
|
-
* Odstęp liczony od zegara, a nie stałym `delay()` przed każdym zapytaniem
|
|
32
|
+
* Odstęp liczony od zegara, a nie stałym `delay()` przed każdym zapytaniem -
|
|
33
33
|
* inaczej pierwsza podpowiedź po minucie bezczynności też płaciłaby sekundę, a przy
|
|
34
|
-
* podpowiadaniu w trakcie pisania to jest różnica między
|
|
34
|
+
* podpowiadaniu w trakcie pisania to jest różnica między "działa" a "zacina się".
|
|
35
35
|
* Górna granica jednego zapytania na sekundę zostaje nienaruszona.
|
|
36
36
|
*
|
|
37
37
|
* Bez odstępu nie ma czego kolejkować: łańcuch obietnic zostaje nietknięty, żeby
|
|
@@ -73,7 +73,7 @@ class KptNominatimGeocoder {
|
|
|
73
73
|
.catch((error) => {
|
|
74
74
|
if (controller.signal.aborted || error?.name === 'AbortError')
|
|
75
75
|
return;
|
|
76
|
-
// Brak adresu to nie awaria formularza
|
|
76
|
+
// Brak adresu to nie awaria formularza - pole zostaje puste.
|
|
77
77
|
subscriber.next(null);
|
|
78
78
|
subscriber.complete();
|
|
79
79
|
});
|
|
@@ -81,7 +81,7 @@ class KptNominatimGeocoder {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Podpowiedzi adresowe. Wchodzi w **tę samą** kolejkę co `reverse()`
|
|
84
|
+
* Podpowiedzi adresowe. Wchodzi w **tę samą** kolejkę co `reverse()` - polityka Nominatim
|
|
85
85
|
* liczy jedno zapytanie na sekundę na całego klienta, a nie na metodę.
|
|
86
86
|
*/
|
|
87
87
|
search(query, options) {
|
|
@@ -166,7 +166,7 @@ function mapNominatim(a, label) {
|
|
|
166
166
|
return {
|
|
167
167
|
street,
|
|
168
168
|
houseNumber,
|
|
169
|
-
// Jedno pole
|
|
169
|
+
// Jedno pole "Adres" chce ulicy z numerem; bez ulicy nie ma czego sklejać.
|
|
170
170
|
address: street ? [street, houseNumber].filter(Boolean).join(' ') : undefined,
|
|
171
171
|
// Nominatim rozrzuca miejscowość po kilku kluczach zależnie od jej wielkości.
|
|
172
172
|
city: a.city ?? a.town ?? a.village ?? a.municipality ?? a.hamlet,
|
|
@@ -181,7 +181,7 @@ function mapNominatim(a, label) {
|
|
|
181
181
|
function mapPlace(place, index) {
|
|
182
182
|
const lat = Number(place.lat);
|
|
183
183
|
const lng = Number(place.lon);
|
|
184
|
-
// Wynik bez współrzędnych jest bezużyteczny
|
|
184
|
+
// Wynik bez współrzędnych jest bezużyteczny - nie ma dokąd polecieć.
|
|
185
185
|
if (!Number.isFinite(lat) || !Number.isFinite(lng))
|
|
186
186
|
return null;
|
|
187
187
|
return {
|
|
@@ -195,15 +195,15 @@ function mapPlace(place, index) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
|
-
* `[south, north, west, east]` jako napisy
|
|
198
|
+
* `[south, north, west, east]` jako napisy -> `KptMapBounds`.
|
|
199
199
|
*
|
|
200
|
-
* `undefined` dla zasięgu zbyt ciasnego, żeby go wpasowywać w kadr
|
|
200
|
+
* `undefined` dla zasięgu zbyt ciasnego, żeby go wpasowywać w kadr - pojedynczy adres
|
|
201
201
|
* dostaje wtedy `[searchZoom]` mapy i ląduje w powtarzalnym zbliżeniu, zamiast
|
|
202
202
|
* w przypadkowym, zależnym od tego, jak dostawca obrysował budynek. Regułę trzyma
|
|
203
|
-
* `isFittableBounds()` z rdzenia
|
|
203
|
+
* `isFittableBounds()` z rdzenia - jest testowana i wspólna dla wszystkich adapterów.
|
|
204
204
|
*/
|
|
205
205
|
function mapBoundingBox(box) {
|
|
206
|
-
if (
|
|
206
|
+
if (box?.length !== 4)
|
|
207
207
|
return undefined;
|
|
208
208
|
const [south, north, west, east] = box.map(Number);
|
|
209
209
|
if (![south, north, west, east].every(Number.isFinite))
|
|
@@ -215,7 +215,7 @@ function delay(ms) {
|
|
|
215
215
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
|
-
* Włącza podpowiadanie adresu z Nominatim (OpenStreetMap) w formularzu
|
|
218
|
+
* Włącza podpowiadanie adresu z Nominatim (OpenStreetMap) w formularzu "dodaj lokalizację".
|
|
219
219
|
*
|
|
220
220
|
* **Polityka użycia.** Publiczna instancja `nominatim.openstreetmap.org` dopuszcza
|
|
221
221
|
* maksymalnie jedno zapytanie na sekundę, wymaga rozpoznawalnego `Referer`/`User-Agent`
|
|
@@ -224,7 +224,7 @@ function delay(ms) {
|
|
|
224
224
|
* podstaw własną instancję (`baseUrl`) albo komercyjnego dostawcę przez własny
|
|
225
225
|
* `KPT_MAP_GEOCODER`.
|
|
226
226
|
*
|
|
227
|
-
* Podanie `baseUrl` **zdejmuje sekundowy odstęp** (`minIntervalMs` domyślnie 0)
|
|
227
|
+
* Podanie `baseUrl` **zdejmuje sekundowy odstęp** (`minIntervalMs` domyślnie 0) - regulamin
|
|
228
228
|
* publicznej instancji nie obowiązuje na Twoim serwerze. Cudzą, współdzieloną instancję
|
|
229
229
|
* podstawiaj z jawnym `minIntervalMs`.
|
|
230
230
|
*
|
|
@@ -239,10 +239,10 @@ function provideKptNominatimGeocoder(options = {}) {
|
|
|
239
239
|
return { provide: KPT_MAP_GEOCODER, useValue: new KptNominatimGeocoder(options) };
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
|
-
* Stały adres i stała lista podpowiedzi
|
|
242
|
+
* Stały adres i stała lista podpowiedzi - Storybook i testy, bez ruchu sieciowego.
|
|
243
243
|
*
|
|
244
|
-
* Podpowiedzi filtruje po `label` bez znaków diakrytycznych, żeby
|
|
245
|
-
* w
|
|
244
|
+
* Podpowiedzi filtruje po `label` bez znaków diakrytycznych, żeby "warszawa" trafiało
|
|
245
|
+
* w "Warszawa". Prawdziwy geokoder dopasowuje po swojemu - atrapa tylko udaje, że umie.
|
|
246
246
|
*/
|
|
247
247
|
class KptMapGeocoderStub {
|
|
248
248
|
constructor(address, results = [], options = {}) {
|
|
@@ -260,17 +260,17 @@ class KptMapGeocoderStub {
|
|
|
260
260
|
const hits = this.results.filter((r) => fold(r.label).includes(q)).slice(0, options?.limit ?? 5);
|
|
261
261
|
if (!this.options.deferCoordinates)
|
|
262
262
|
return of(hits);
|
|
263
|
-
// Współrzędne i zasięg zostają po stronie atrapy
|
|
263
|
+
// Współrzędne i zasięg zostają po stronie atrapy - pole ma po nie sięgnąć `resolve()`.
|
|
264
264
|
return of(hits.map(({ at: _at, bounds: _bounds, ...rest }) => rest));
|
|
265
265
|
}
|
|
266
266
|
resolve(suggestion) {
|
|
267
|
-
// Podpowiedź ze współrzędnymi wraca nietknięta
|
|
267
|
+
// Podpowiedź ze współrzędnymi wraca nietknięta - tak samo zachowa się prawdziwy adapter.
|
|
268
268
|
if (suggestion.at)
|
|
269
269
|
return of(suggestion);
|
|
270
270
|
return of(this.results.find((r) => r.id === suggestion.id) ?? null);
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
/** Bez znaków diakrytycznych i wielkości liter
|
|
273
|
+
/** Bez znaków diakrytycznych i wielkości liter - tylko na potrzeby atrapy. */
|
|
274
274
|
function fold(value) {
|
|
275
275
|
return value.trim().toLowerCase().normalize('NFD').replace(/\p{Diacritic}/gu, '');
|
|
276
276
|
}
|
|
@@ -296,7 +296,7 @@ function KptMapHoursField_For_3_Conditional_4_For_1_Template(rf, ctx) { if (rf &
|
|
|
296
296
|
i0.ɵɵlistener("valueChange", function KptMapHoursField_For_3_Conditional_4_For_1_Template_kpt_datepicker_valueChange_1_listener($event) { const $index_r3 = i0.ɵɵrestoreView(_r2).$index; const row_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.setTime(row_r4, $index_r3, "from", $event)); })("touch", function KptMapHoursField_For_3_Conditional_4_For_1_Template_kpt_datepicker_touch_1_listener() { i0.ɵɵrestoreView(_r2); const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.touch.emit()); });
|
|
297
297
|
i0.ɵɵelementEnd();
|
|
298
298
|
i0.ɵɵelementStart(2, "span", 9);
|
|
299
|
-
i0.ɵɵtext(3, "
|
|
299
|
+
i0.ɵɵtext(3, "-");
|
|
300
300
|
i0.ɵɵelementEnd();
|
|
301
301
|
i0.ɵɵelementStart(4, "kpt-datepicker", 8);
|
|
302
302
|
i0.ɵɵlistener("valueChange", function KptMapHoursField_For_3_Conditional_4_For_1_Template_kpt_datepicker_valueChange_4_listener($event) { const $index_r3 = i0.ɵɵrestoreView(_r2).$index; const row_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.setTime(row_r4, $index_r3, "to", $event)); })("touch", function KptMapHoursField_For_3_Conditional_4_For_1_Template_kpt_datepicker_touch_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.touch.emit()); });
|
|
@@ -308,9 +308,9 @@ function KptMapHoursField_For_3_Conditional_4_For_1_Template(rf, ctx) { if (rf &
|
|
|
308
308
|
const row_r4 = i0.ɵɵnextContext(2).$implicit;
|
|
309
309
|
const ctx_r4 = i0.ɵɵnextContext();
|
|
310
310
|
i0.ɵɵadvance();
|
|
311
|
-
i0.ɵɵproperty("minuteStep", ctx_r4.minuteStep)("value", range_r7.from)("disabled", ctx_r4.locked(row_r4))("ariaLabel", ctx_r4.i18n.t("map.field.hoursFrom") + "
|
|
311
|
+
i0.ɵɵproperty("minuteStep", ctx_r4.minuteStep)("value", range_r7.from)("disabled", ctx_r4.locked(row_r4))("ariaLabel", ctx_r4.i18n.t("map.field.hoursFrom") + " - " + row_r4.name);
|
|
312
312
|
i0.ɵɵadvance(3);
|
|
313
|
-
i0.ɵɵproperty("minuteStep", ctx_r4.minuteStep)("value", range_r7.to)("disabled", ctx_r4.locked(row_r4))("ariaLabel", ctx_r4.i18n.t("map.field.hoursTo") + "
|
|
313
|
+
i0.ɵɵproperty("minuteStep", ctx_r4.minuteStep)("value", range_r7.to)("disabled", ctx_r4.locked(row_r4))("ariaLabel", ctx_r4.i18n.t("map.field.hoursTo") + " - " + row_r4.name);
|
|
314
314
|
i0.ɵɵadvance();
|
|
315
315
|
i0.ɵɵconditional(row_r4.ranges.length > 1 ? 5 : -1);
|
|
316
316
|
} }
|
|
@@ -363,15 +363,15 @@ function KptMapHoursField_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
363
363
|
/** Ile przedziałów na dobę dopuszczamy. Dwa pokrywają przerwę i dobę przez północ. */
|
|
364
364
|
const MAX_RANGES = 2;
|
|
365
365
|
/**
|
|
366
|
-
* Snap minut na tarczy zegara. Godziny otwarcia chodzą co kwadrans, a nie co minutę
|
|
366
|
+
* Snap minut na tarczy zegara. Godziny otwarcia chodzą co kwadrans, a nie co minutę -
|
|
367
367
|
* krok 5 daje trafienie w 07:30 czy 22:45 bez celowania w pojedynczą minutę.
|
|
368
368
|
*/
|
|
369
369
|
const MINUTE_STEP = 5;
|
|
370
370
|
/**
|
|
371
|
-
* Pole
|
|
371
|
+
* Pole "godziny otwarcia" formularza dodawania lokalizacji (`type: 'hours'` w schemie).
|
|
372
372
|
*
|
|
373
|
-
* Siedem wierszy od poniedziałku, każdy z parą godzin i znacznikiem
|
|
374
|
-
* Skrót
|
|
373
|
+
* Siedem wierszy od poniedziałku, każdy z parą godzin i znacznikiem "zamknięte".
|
|
374
|
+
* Skrót "tak samo przez cały tydzień" kopiuje poniedziałek na pozostałe dni - to
|
|
375
375
|
* najczęstszy przypadek, a bez niego wypełnienie formularza to czternaście pól.
|
|
376
376
|
*
|
|
377
377
|
* Nazwy dni idą z `Intl`, nie ze słownika `KptMessages`: rozkład tygodnia jest
|
|
@@ -389,7 +389,7 @@ class KptMapHoursField {
|
|
|
389
389
|
this.i18n = inject(KptI18n);
|
|
390
390
|
this.maxRanges = MAX_RANGES;
|
|
391
391
|
this.minuteStep = MINUTE_STEP;
|
|
392
|
-
/** Skrót
|
|
392
|
+
/** Skrót "tak samo przez cały tydzień" - trzymany w modelu, nie w wartości. */
|
|
393
393
|
this.sameAllWeek = model(false, /* @ts-ignore */
|
|
394
394
|
...(ngDevMode ? [{ debugName: "sameAllWeek" }] : /* istanbul ignore next */ []));
|
|
395
395
|
this.rows = computed(() => {
|
|
@@ -463,7 +463,7 @@ class KptMapHoursField {
|
|
|
463
463
|
: { day: entry.day, closed: monday.closed, ranges: monday.ranges.map((r) => ({ ...r })) });
|
|
464
464
|
});
|
|
465
465
|
}
|
|
466
|
-
/** Zapis zawsze przez pełny, uporządkowany tydzień
|
|
466
|
+
/** Zapis zawsze przez pełny, uporządkowany tydzień - model nie ma dziur. */
|
|
467
467
|
write(change) {
|
|
468
468
|
const current = this.value();
|
|
469
469
|
const base = emptyWeek().map((day) => current.find((d) => d.day === day.day) ?? day);
|
|
@@ -486,7 +486,7 @@ class KptMapHoursField {
|
|
|
486
486
|
}
|
|
487
487
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptMapHoursField, [{
|
|
488
488
|
type: Component,
|
|
489
|
-
args: [{ selector: 'kpt-map-hours-field', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptCheckbox, KptDatepicker, KptIcon, KptIconButton], host: { class: 'kpt-map-hours-field' }, template: "<kpt-checkbox\n class=\"kpt-map-hours-field__same\"\n [checked]=\"sameAllWeek()\"\n (checkedChange)=\"onSameAllWeek($event)\"\n [disabled]=\"disabled() || readonly()\"\n [label]=\"i18n.t('map.field.hoursSameAllWeek')\"\n/>\n\n<ul class=\"kpt-map-hours-field__week\">\n @for (row of rows(); track row.day) {\n <li class=\"kpt-map-hours-field__day\" [attr.data-locked]=\"locked(row) ? '' : null\">\n <span class=\"kpt-map-hours-field__name\">{{ row.name }}</span>\n\n <!-- Przy zamkni\u0119tym dniu kolumna godzin zostaje pusta: \
|
|
489
|
+
args: [{ selector: 'kpt-map-hours-field', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptCheckbox, KptDatepicker, KptIcon, KptIconButton], host: { class: 'kpt-map-hours-field' }, template: "<kpt-checkbox\n class=\"kpt-map-hours-field__same\"\n [checked]=\"sameAllWeek()\"\n (checkedChange)=\"onSameAllWeek($event)\"\n [disabled]=\"disabled() || readonly()\"\n [label]=\"i18n.t('map.field.hoursSameAllWeek')\"\n/>\n\n<ul class=\"kpt-map-hours-field__week\">\n @for (row of rows(); track row.day) {\n <li class=\"kpt-map-hours-field__day\" [attr.data-locked]=\"locked(row) ? '' : null\">\n <span class=\"kpt-map-hours-field__name\">{{ row.name }}</span>\n\n <!-- Przy zamkni\u0119tym dniu kolumna godzin zostaje pusta: \"zamkni\u0119te\" m\u00F3wi ju\u017C checkbox. -->\n <div class=\"kpt-map-hours-field__ranges\">\n @if (!row.closed) {\n @for (range of row.ranges; track $index) {\n <div class=\"kpt-map-hours-field__range\">\n <kpt-datepicker\n selectionMode=\"time\"\n [minuteStep]=\"minuteStep\"\n [value]=\"range.from\"\n (valueChange)=\"setTime(row, $index, 'from', $event)\"\n [disabled]=\"locked(row)\"\n [ariaLabel]=\"i18n.t('map.field.hoursFrom') + ' - ' + row.name\"\n (touch)=\"touch.emit()\"\n />\n <span class=\"kpt-map-hours-field__dash\" aria-hidden=\"true\">-</span>\n <kpt-datepicker\n selectionMode=\"time\"\n [minuteStep]=\"minuteStep\"\n [value]=\"range.to\"\n (valueChange)=\"setTime(row, $index, 'to', $event)\"\n [disabled]=\"locked(row)\"\n [ariaLabel]=\"i18n.t('map.field.hoursTo') + ' - ' + row.name\"\n (touch)=\"touch.emit()\"\n />\n @if (row.ranges.length > 1) {\n <kpt-icon-button\n variant=\"text\"\n size=\"sm\"\n [disabled]=\"locked(row)\"\n [ariaLabel]=\"i18n.t('map.field.hoursRemoveRange')\"\n (click)=\"removeRange(row, $index)\"\n >\n <kpt-icon name=\"minus\" />\n </kpt-icon-button>\n }\n </div>\n }\n\n @if (row.ranges.length < maxRanges) {\n <button\n class=\"kpt-map-hours-field__add\"\n type=\"button\"\n [disabled]=\"locked(row)\"\n (click)=\"addRange(row)\"\n >\n <kpt-icon name=\"plus\" />\n {{ i18n.t('map.field.hoursAddRange') }}\n </button>\n }\n }\n </div>\n\n <kpt-checkbox\n class=\"kpt-map-hours-field__closed\"\n [checked]=\"row.closed\"\n (checkedChange)=\"setClosed(row, $event)\"\n [disabled]=\"locked(row)\"\n [label]=\"i18n.t('map.field.hoursClosed')\"\n />\n </li>\n }\n</ul>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-hours-field{display:flex;flex-direction:column;gap:var(--kpt-space-2)}.kpt-map-hours-field__week{display:flex;flex-direction:column;gap:var(--kpt-space-1);margin:0;padding:0;list-style:none}.kpt-map-hours-field__day{display:grid;grid-template-columns:3.5rem 1fr auto;gap:var(--kpt-space-2);align-items:center;padding:var(--kpt-space-1) 0}.kpt-map-hours-field__day[data-locked]{opacity:.6}.kpt-map-hours-field__name{font-size:var(--kpt-font-size-sm);color:var(--kpt-color-on-surface-muted)}.kpt-map-hours-field__ranges{display:flex;flex-direction:column;gap:var(--kpt-space-1);min-width:0}.kpt-map-hours-field__range{display:flex;gap:var(--kpt-space-1);align-items:center}.kpt-map-hours-field__range .kpt-datepicker-host{flex:1 1 0;min-width:0}.kpt-map-hours-field__dash{color:var(--kpt-color-on-surface-muted)}.kpt-map-hours-field__add{display:inline-flex;gap:var(--kpt-space-1);align-items:center;align-self:flex-start;padding:0;font:inherit;font-size:var(--kpt-font-size-sm);color:var(--kpt-color-primary);cursor:pointer;background:none;border:0}.kpt-map-hours-field__add:disabled{color:var(--kpt-color-text-subtle);cursor:default}.kpt-map-hours-field__add:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:2px}}\n"] }]
|
|
490
490
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], sameAllWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "sameAllWeek", required: false }] }, { type: i0.Output, args: ["sameAllWeekChange"] }] }); })();
|
|
491
491
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMapHoursField, { className: "KptMapHoursField", filePath: "lib/map-hours-field.component.ts", lineNumber: 53 }); })();
|
|
492
492
|
|
|
@@ -514,16 +514,16 @@ function KptMapImageField_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
514
514
|
i0.ɵɵproperty("title", ctx_r1.i18n.t("map.field.removeImage"))("disabled", ctx_r1.disabled() || ctx_r1.readonly());
|
|
515
515
|
i0.ɵɵattribute("aria-label", ctx_r1.i18n.t("map.field.removeImage"));
|
|
516
516
|
} }
|
|
517
|
-
/** Domyślny limit pliku. Data URL puchnie o
|
|
517
|
+
/** Domyślny limit pliku. Data URL puchnie o ~1/3, a wartość leci w `locationCreate`. */
|
|
518
518
|
const DEFAULT_MAX_BYTES = 2 * 1024 * 1024;
|
|
519
519
|
/**
|
|
520
|
-
* Pole
|
|
520
|
+
* Pole "zdjęcie" formularza dodawania lokalizacji (`type: 'image'` w schemie kategorii).
|
|
521
521
|
*
|
|
522
522
|
* Wartością jest zawsze **string**: albo `data:` z wybranego pliku, albo adres wklejony
|
|
523
523
|
* przez użytkownika. Karta miejsca nie rozróżnia jednego od drugiego, więc formularz
|
|
524
524
|
* nie musi decydować za aplikację, gdzie zdjęcia mieszkają.
|
|
525
525
|
*
|
|
526
|
-
* Plik czytamy w przeglądarce i nigdzie nie wysyłamy
|
|
526
|
+
* Plik czytamy w przeglądarce i nigdzie nie wysyłamy - biblioteka nie ma i nie chce
|
|
527
527
|
* mieć wiedzy o storage'u aplikacji.
|
|
528
528
|
*/
|
|
529
529
|
class KptMapImageField {
|
|
@@ -569,12 +569,12 @@ class KptMapImageField {
|
|
|
569
569
|
return;
|
|
570
570
|
}
|
|
571
571
|
const reader = new FileReader();
|
|
572
|
-
reader.onload = () => this.value.set(
|
|
572
|
+
reader.onload = () => this.value.set(typeof reader.result === 'string' ? reader.result : '');
|
|
573
573
|
reader.onerror = () => this.sizeError.set(this.i18n.t('map.field.imageTooLarge', { max: this.maxLabel() }));
|
|
574
574
|
reader.readAsDataURL(file);
|
|
575
575
|
}
|
|
576
576
|
onUrl(url) {
|
|
577
|
-
// Adres i plik wykluczają się
|
|
577
|
+
// Adres i plik wykluczają się - dwa źródła jednej wartości myliłyby użytkownika.
|
|
578
578
|
if (url)
|
|
579
579
|
this.files.set([]);
|
|
580
580
|
this.sizeError.set(null);
|
|
@@ -818,7 +818,7 @@ function KptMapCreateDialog_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
818
818
|
i0.ɵɵadvance();
|
|
819
819
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("map.save"));
|
|
820
820
|
} }
|
|
821
|
-
/** Pusta wartość właściwa dla typu pola
|
|
821
|
+
/** Pusta wartość właściwa dla typu pola - formularz startuje bez `undefined`. */
|
|
822
822
|
function initialValue(def) {
|
|
823
823
|
if (def.initial !== undefined)
|
|
824
824
|
return def.initial;
|
|
@@ -838,7 +838,7 @@ function initialValue(def) {
|
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
/** Typy pól, które przyjmą fragment adresu. Data czy liczba nie mają z nim nic wspólnego. */
|
|
841
|
-
const
|
|
841
|
+
const TEXTUAL_TYPES = new Set(['text', 'textarea']);
|
|
842
842
|
function initialModel(fields) {
|
|
843
843
|
const out = {};
|
|
844
844
|
for (const def of fields)
|
|
@@ -846,11 +846,11 @@ function initialModel(fields) {
|
|
|
846
846
|
return out;
|
|
847
847
|
}
|
|
848
848
|
/**
|
|
849
|
-
* Treść dialogu
|
|
849
|
+
* Treść dialogu "dodaj lokalizację" budowana ze schemy kategorii (`category.fields`).
|
|
850
850
|
*
|
|
851
|
-
* Przy dynamicznej schemie typowanie pól znika
|
|
851
|
+
* Przy dynamicznej schemie typowanie pól znika - model to `Record<string, unknown>`,
|
|
852
852
|
* a ścieżki walidatorów trzeba rzutować. Reszta kontraktu Signal Forms zostaje bez zmian:
|
|
853
|
-
* walidatory deklarujemy raz, a bramka
|
|
853
|
+
* walidatory deklarujemy raz, a bramka "nie strasz czerwienią" siedzi w prezentacji.
|
|
854
854
|
*/
|
|
855
855
|
class KptMapCreateDialog {
|
|
856
856
|
constructor() {
|
|
@@ -859,7 +859,7 @@ class KptMapCreateDialog {
|
|
|
859
859
|
this.at = input.required(/* @ts-ignore */
|
|
860
860
|
...(ngDevMode ? [{ debugName: "at" }] : /* istanbul ignore next */ []));
|
|
861
861
|
/**
|
|
862
|
-
* Geokoder tego formularza. Podany wygrywa nad `KPT_MAP_GEOCODER` z DI
|
|
862
|
+
* Geokoder tego formularza. Podany wygrywa nad `KPT_MAP_GEOCODER` z DI - `kpt-map` podaje
|
|
863
863
|
* tędy port swojej mapy, bo geokoder jest per mapa, a nie per aplikacja.
|
|
864
864
|
*/
|
|
865
865
|
this.geocoder = input(null, /* @ts-ignore */
|
|
@@ -868,12 +868,12 @@ class KptMapCreateDialog {
|
|
|
868
868
|
this.cancelled = output();
|
|
869
869
|
this.i18n = inject(KptI18n);
|
|
870
870
|
this.injector = inject(Injector);
|
|
871
|
-
/** Opcjonalny
|
|
871
|
+
/** Opcjonalny - wejście `[geocoder]` i tak ma nad nim pierwszeństwo. */
|
|
872
872
|
this.injectedGeocoder = inject(KPT_MAP_GEOCODER, { optional: true });
|
|
873
873
|
/** Rozstrzygnięty port: wejście przed DI. Bez obu formularz po prostu nie podpowiada adresu. */
|
|
874
874
|
this.port = computed(() => this.geocoder() ?? this.injectedGeocoder, /* @ts-ignore */
|
|
875
875
|
...(ngDevMode ? [{ debugName: "port" }] : /* istanbul ignore next */ []));
|
|
876
|
-
/** Trwa zapytanie do geokodera
|
|
876
|
+
/** Trwa zapytanie do geokodera - szablon pokazuje wtedy notkę zamiast ciszy. */
|
|
877
877
|
this.geocoding = signal(false, /* @ts-ignore */
|
|
878
878
|
...(ngDevMode ? [{ debugName: "geocoding" }] : /* istanbul ignore next */ []));
|
|
879
879
|
/** Ostatnio ustalony adres; `label` bywa czytelniejszy niż suma pól. */
|
|
@@ -882,18 +882,18 @@ class KptMapCreateDialog {
|
|
|
882
882
|
this.fields = computed(() => this.category().fields ?? [], /* @ts-ignore */
|
|
883
883
|
...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
884
884
|
/** Czy kategoria ma pola do podpowiedzenia i jest czym je podpowiedzieć. */
|
|
885
|
-
this.hasAutofill = computed(() => !!this.port() && this.fields().some((f) => f.autofill &&
|
|
885
|
+
this.hasAutofill = computed(() => !!this.port() && this.fields().some((f) => f.autofill && TEXTUAL_TYPES.has(f.type)), /* @ts-ignore */
|
|
886
886
|
...(ngDevMode ? [{ debugName: "hasAutofill" }] : /* istanbul ignore next */ []));
|
|
887
887
|
/**
|
|
888
888
|
* Model i formularz dla aktualnej kategorii. Budowane w efekcie, nie w `computed()`,
|
|
889
889
|
* bo `form()` zakłada dwie rzeczy, których ciało `computed()` nie spełnia:
|
|
890
890
|
*
|
|
891
|
-
* - wstrzykuje sobie zależności
|
|
891
|
+
* - wstrzykuje sobie zależności -> stąd `runInInjectionContext`;
|
|
892
892
|
* - zakłada własny `effect()`, a tego nie wolno tworzyć w kontekście reaktywnym
|
|
893
|
-
* (NG0602)
|
|
893
|
+
* (NG0602) -> stąd `untracked`, które zdejmuje aktywnego konsumenta.
|
|
894
894
|
*
|
|
895
895
|
* Zależność od `fields()` zostaje śledzona na zewnątrz `untracked`, więc zmiana
|
|
896
|
-
* kategorii przebudowuje formularz
|
|
896
|
+
* kategorii przebudowuje formularz - inny zestaw pól to inny formularz, a Signal Forms
|
|
897
897
|
* wiąże schemę tylko raz, przy tworzeniu.
|
|
898
898
|
*/
|
|
899
899
|
this.built = signal(null, /* @ts-ignore */
|
|
@@ -903,7 +903,7 @@ class KptMapCreateDialog {
|
|
|
903
903
|
...(ngDevMode ? [{ debugName: "formRoot" }] : /* istanbul ignore next */ []));
|
|
904
904
|
this.formInvalid = computed(() => this.formRoot()?.().invalid() ?? true, /* @ts-ignore */
|
|
905
905
|
...(ngDevMode ? [{ debugName: "formInvalid" }] : /* istanbul ignore next */ []));
|
|
906
|
-
/** Współrzędne z prawego kliknięcia
|
|
906
|
+
/** Współrzędne z prawego kliknięcia - pokazujemy je, ale nie pozwalamy edytować. */
|
|
907
907
|
this.coords = computed(() => {
|
|
908
908
|
const at = this.at();
|
|
909
909
|
return { lat: at.lat.toFixed(5), lng: at.lng.toFixed(5) };
|
|
@@ -915,7 +915,7 @@ class KptMapCreateDialog {
|
|
|
915
915
|
const model = signal(initialModel(fields), /* @ts-ignore */
|
|
916
916
|
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
917
917
|
const f = runInInjectionContext(this.injector, () => form(model, (path) => {
|
|
918
|
-
// Ścieżki są dynamiczne, więc indeksujemy proxy po kluczu
|
|
918
|
+
// Ścieżki są dynamiczne, więc indeksujemy proxy po kluczu - stąd rzutowanie.
|
|
919
919
|
const paths = path;
|
|
920
920
|
for (const def of fields) {
|
|
921
921
|
const node = paths[def.key];
|
|
@@ -951,7 +951,7 @@ class KptMapCreateDialog {
|
|
|
951
951
|
/**
|
|
952
952
|
* Podpowiada adres z geokodowania wstecznego współrzędnych kliknięcia.
|
|
953
953
|
*
|
|
954
|
-
* Wypełnia wyłącznie pola z `autofill` i wyłącznie te, które są jeszcze puste
|
|
954
|
+
* Wypełnia wyłącznie pola z `autofill` i wyłącznie te, które są jeszcze puste -
|
|
955
955
|
* podpowiedź nigdy nie kasuje tego, co użytkownik zdążył wpisać. Brak portu
|
|
956
956
|
* `KPT_MAP_GEOCODER` albo nieudane zapytanie to nie błąd: pola zostają puste.
|
|
957
957
|
*/
|
|
@@ -963,8 +963,8 @@ class KptMapCreateDialog {
|
|
|
963
963
|
const built = this.built();
|
|
964
964
|
if (!geocoder || !built)
|
|
965
965
|
return;
|
|
966
|
-
const
|
|
967
|
-
if (
|
|
966
|
+
const autofillFields = fields.filter((f) => f.autofill && TEXTUAL_TYPES.has(f.type));
|
|
967
|
+
if (autofillFields.length === 0)
|
|
968
968
|
return;
|
|
969
969
|
this.geocoding.set(true);
|
|
970
970
|
const subscription = geocoder
|
|
@@ -977,11 +977,11 @@ class KptMapCreateDialog {
|
|
|
977
977
|
return;
|
|
978
978
|
built.model.update((current) => {
|
|
979
979
|
const next = { ...current };
|
|
980
|
-
for (const def of
|
|
981
|
-
const
|
|
980
|
+
for (const def of autofillFields) {
|
|
981
|
+
const value = address[def.autofill];
|
|
982
982
|
// Puste pole = to, czego użytkownik nie tknął.
|
|
983
|
-
if (typeof
|
|
984
|
-
next[def.key] =
|
|
983
|
+
if (typeof value === 'string' && value && !next[def.key])
|
|
984
|
+
next[def.key] = value;
|
|
985
985
|
}
|
|
986
986
|
return next;
|
|
987
987
|
});
|
|
@@ -994,11 +994,11 @@ class KptMapCreateDialog {
|
|
|
994
994
|
});
|
|
995
995
|
});
|
|
996
996
|
}
|
|
997
|
-
/** Kontrolka pola po kluczu
|
|
997
|
+
/** Kontrolka pola po kluczu - szablon podaje ją do `[formField]`. */
|
|
998
998
|
fieldOf(key) {
|
|
999
999
|
return this.formRoot()?.[key];
|
|
1000
1000
|
}
|
|
1001
|
-
/** Komunikat pokazujemy dopiero po dotknięciu pola
|
|
1001
|
+
/** Komunikat pokazujemy dopiero po dotknięciu pola - bramka żyje w prezentacji. */
|
|
1002
1002
|
errorOf(key) {
|
|
1003
1003
|
const node = this.fieldOf(key);
|
|
1004
1004
|
if (!node)
|
|
@@ -1010,7 +1010,7 @@ class KptMapCreateDialog {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Dzień otwarty musi mieć obie godziny i różne od siebie. Dzień oznaczony jako
|
|
1013
|
-
* zamknięty przechodzi bez zastrzeżeń
|
|
1013
|
+
* zamknięty przechodzi bez zastrzeżeń - to prawidłowa odpowiedź, a nie brak danych.
|
|
1014
1014
|
*/
|
|
1015
1015
|
hoursError(week) {
|
|
1016
1016
|
if (!week)
|
|
@@ -1146,7 +1146,7 @@ function KptMapLegend_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
1146
1146
|
i0.ɵɵconditional(entry_r2.count !== null ? 5 : -1);
|
|
1147
1147
|
} }
|
|
1148
1148
|
/**
|
|
1149
|
-
* Legenda mapy
|
|
1149
|
+
* Legenda mapy - lista kategorii ze znacznikiem koloru i ikoną. Pozycje są przyciskami:
|
|
1150
1150
|
* kliknięcie chowa i pokazuje kategorię (`hidden` dwukierunkowe).
|
|
1151
1151
|
*
|
|
1152
1152
|
* `kpt-map` renderuje ją sam pod mapą przy `[legend]="true"`; kto chce ją gdzie indziej,
|
|
@@ -1162,12 +1162,12 @@ class KptMapLegend {
|
|
|
1162
1162
|
/** Identyfikatory ukrytych kategorii (dwukierunkowe). */
|
|
1163
1163
|
this.hidden = model([], /* @ts-ignore */
|
|
1164
1164
|
...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
1165
|
-
/** Opcjonalne liczniki `{ categoryId: liczba }`
|
|
1165
|
+
/** Opcjonalne liczniki `{ categoryId: liczba }` - pokazywane przy etykiecie. */
|
|
1166
1166
|
this.counts = input(null, /* @ts-ignore */
|
|
1167
1167
|
...(ngDevMode ? [{ debugName: "counts" }] : /* istanbul ignore next */ []));
|
|
1168
1168
|
this.orientation = input('horizontal', /* @ts-ignore */
|
|
1169
1169
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
1170
|
-
/** Wyłącza chowanie kategorii
|
|
1170
|
+
/** Wyłącza chowanie kategorii - legenda staje się czysto informacyjna. */
|
|
1171
1171
|
this.interactive = input(true, /* @ts-ignore */
|
|
1172
1172
|
...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
|
|
1173
1173
|
this.i18n = inject(KptI18n);
|
|
@@ -1218,19 +1218,26 @@ class KptMapLegend {
|
|
|
1218
1218
|
|
|
1219
1219
|
const _c0$2 = a0 => ({ count: a0 });
|
|
1220
1220
|
const _forTrack0$2 = ($index, $item) => $item.id;
|
|
1221
|
-
function
|
|
1221
|
+
function KptMapSearch_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
1222
1222
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
1223
|
-
i0.ɵɵelementStart(0, "button",
|
|
1224
|
-
i0.ɵɵlistener("click", function
|
|
1225
|
-
i0.ɵɵelement(1, "kpt-icon",
|
|
1223
|
+
i0.ɵɵelementStart(0, "button", 9);
|
|
1224
|
+
i0.ɵɵlistener("click", function KptMapSearch_Conditional_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.clear()); });
|
|
1225
|
+
i0.ɵɵelement(1, "kpt-icon", 10);
|
|
1226
1226
|
i0.ɵɵelementEnd();
|
|
1227
1227
|
} if (rf & 2) {
|
|
1228
1228
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
1229
1229
|
i0.ɵɵproperty("title", ctx_r1.i18n.t("map.search.clear"));
|
|
1230
1230
|
i0.ɵɵattribute("aria-label", ctx_r1.i18n.t("map.search.clear"));
|
|
1231
1231
|
} }
|
|
1232
|
-
function
|
|
1233
|
-
i0.ɵɵ
|
|
1232
|
+
function KptMapSearch_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
1233
|
+
i0.ɵɵelement(0, "kpt-speech-button", 6);
|
|
1234
|
+
} if (rf & 2) {
|
|
1235
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
1236
|
+
const fieldEl_r3 = i0.ɵɵreference(4);
|
|
1237
|
+
i0.ɵɵproperty("continuous", false)("target", fieldEl_r3)("lang", ctx_r1.speechLang())("listeningColor", ctx_r1.speechColor())("disabled", ctx_r1.disabled() || !ctx_r1.canSearch());
|
|
1238
|
+
} }
|
|
1239
|
+
function KptMapSearch_Conditional_7_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
1240
|
+
i0.ɵɵelementStart(0, "p", 11);
|
|
1234
1241
|
i0.ɵɵtext(1);
|
|
1235
1242
|
i0.ɵɵelementEnd();
|
|
1236
1243
|
} if (rf & 2) {
|
|
@@ -1238,8 +1245,8 @@ function KptMapSearch_Conditional_5_Conditional_1_Template(rf, ctx) { if (rf & 1
|
|
|
1238
1245
|
i0.ɵɵadvance();
|
|
1239
1246
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("map.search.minLength", i0.ɵɵpureFunction1(1, _c0$2, ctx_r1.minLength())));
|
|
1240
1247
|
} }
|
|
1241
|
-
function
|
|
1242
|
-
i0.ɵɵelementStart(0, "p",
|
|
1248
|
+
function KptMapSearch_Conditional_7_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1249
|
+
i0.ɵɵelementStart(0, "p", 11);
|
|
1243
1250
|
i0.ɵɵtext(1);
|
|
1244
1251
|
i0.ɵɵelementEnd();
|
|
1245
1252
|
} if (rf & 2) {
|
|
@@ -1247,38 +1254,39 @@ function KptMapSearch_Conditional_5_Conditional_2_Template(rf, ctx) { if (rf & 1
|
|
|
1247
1254
|
i0.ɵɵadvance();
|
|
1248
1255
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("map.search.searching"));
|
|
1249
1256
|
} }
|
|
1250
|
-
function
|
|
1251
|
-
const
|
|
1252
|
-
i0.ɵɵelementStart(0, "li",
|
|
1253
|
-
i0.ɵɵlistener("mousedown", function
|
|
1254
|
-
i0.ɵɵelementStart(1, "span",
|
|
1255
|
-
i0.ɵɵelement(2, "kpt-icon",
|
|
1257
|
+
function KptMapSearch_Conditional_7_Conditional_3_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
1258
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
1259
|
+
i0.ɵɵelementStart(0, "li", 14);
|
|
1260
|
+
i0.ɵɵlistener("mousedown", function KptMapSearch_Conditional_7_Conditional_3_For_2_Template_li_mousedown_0_listener($event) { const result_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.pick(result_r5)); })("mouseenter", function KptMapSearch_Conditional_7_Conditional_3_For_2_Template_li_mouseenter_0_listener() { const ɵ$index_31_r6 = i0.ɵɵrestoreView(_r4).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.activeIndex.set(ɵ$index_31_r6)); });
|
|
1261
|
+
i0.ɵɵelementStart(1, "span", 15);
|
|
1262
|
+
i0.ɵɵelement(2, "kpt-icon", 16);
|
|
1256
1263
|
i0.ɵɵelementEnd();
|
|
1257
|
-
i0.ɵɵelementStart(3, "span",
|
|
1264
|
+
i0.ɵɵelementStart(3, "span", 17);
|
|
1258
1265
|
i0.ɵɵtext(4);
|
|
1259
1266
|
i0.ɵɵelementEnd()();
|
|
1260
1267
|
} if (rf & 2) {
|
|
1261
|
-
const
|
|
1262
|
-
const ɵ$
|
|
1268
|
+
const result_r5 = ctx.$implicit;
|
|
1269
|
+
const ɵ$index_31_r6 = ctx.$index;
|
|
1263
1270
|
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
1264
|
-
i0.ɵɵclassProp("is-active", ɵ$
|
|
1265
|
-
i0.ɵɵproperty("id", ctx_r1.optionId(ɵ$
|
|
1266
|
-
i0.ɵɵattribute("aria-selected", ɵ$
|
|
1271
|
+
i0.ɵɵclassProp("is-active", ɵ$index_31_r6 === ctx_r1.activeIndex());
|
|
1272
|
+
i0.ɵɵproperty("id", ctx_r1.optionId(ɵ$index_31_r6));
|
|
1273
|
+
i0.ɵɵattribute("aria-selected", ɵ$index_31_r6 === ctx_r1.activeIndex());
|
|
1267
1274
|
i0.ɵɵadvance(4);
|
|
1268
|
-
i0.ɵɵtextInterpolate(
|
|
1275
|
+
i0.ɵɵtextInterpolate(result_r5.label);
|
|
1269
1276
|
} }
|
|
1270
|
-
function
|
|
1271
|
-
i0.ɵɵelementStart(0, "ul",
|
|
1272
|
-
i0.ɵɵrepeaterCreate(1,
|
|
1277
|
+
function KptMapSearch_Conditional_7_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
1278
|
+
i0.ɵɵelementStart(0, "ul", 12);
|
|
1279
|
+
i0.ɵɵrepeaterCreate(1, KptMapSearch_Conditional_7_Conditional_3_For_2_Template, 5, 5, "li", 13, _forTrack0$2);
|
|
1273
1280
|
i0.ɵɵelementEnd();
|
|
1274
1281
|
} if (rf & 2) {
|
|
1275
1282
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
1283
|
+
i0.ɵɵproperty("id", ctx_r1.uid + "-list");
|
|
1276
1284
|
i0.ɵɵattribute("aria-label", ctx_r1.i18n.t("map.search.results"));
|
|
1277
1285
|
i0.ɵɵadvance();
|
|
1278
1286
|
i0.ɵɵrepeater(ctx_r1.results());
|
|
1279
1287
|
} }
|
|
1280
|
-
function
|
|
1281
|
-
i0.ɵɵelementStart(0, "p",
|
|
1288
|
+
function KptMapSearch_Conditional_7_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
1289
|
+
i0.ɵɵelementStart(0, "p", 11);
|
|
1282
1290
|
i0.ɵɵtext(1);
|
|
1283
1291
|
i0.ɵɵelementEnd();
|
|
1284
1292
|
} if (rf & 2) {
|
|
@@ -1286,9 +1294,9 @@ function KptMapSearch_Conditional_5_Conditional_4_Template(rf, ctx) { if (rf & 1
|
|
|
1286
1294
|
i0.ɵɵadvance();
|
|
1287
1295
|
i0.ɵɵtextInterpolate(ctx_r1.i18n.t("map.search.noResults"));
|
|
1288
1296
|
} }
|
|
1289
|
-
function
|
|
1290
|
-
i0.ɵɵelementStart(0, "div",
|
|
1291
|
-
i0.ɵɵconditionalCreate(1,
|
|
1297
|
+
function KptMapSearch_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
1298
|
+
i0.ɵɵelementStart(0, "div", 7);
|
|
1299
|
+
i0.ɵɵconditionalCreate(1, KptMapSearch_Conditional_7_Conditional_1_Template, 2, 3, "p", 11)(2, KptMapSearch_Conditional_7_Conditional_2_Template, 2, 1, "p", 11)(3, KptMapSearch_Conditional_7_Conditional_3_Template, 3, 2, "ul", 12)(4, KptMapSearch_Conditional_7_Conditional_4_Template, 2, 1, "p", 11);
|
|
1292
1300
|
i0.ɵɵelementEnd();
|
|
1293
1301
|
} if (rf & 2) {
|
|
1294
1302
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -1296,13 +1304,13 @@ function KptMapSearch_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
1296
1304
|
i0.ɵɵadvance();
|
|
1297
1305
|
i0.ɵɵconditional(ctx_r1.tooShort() ? 1 : ctx_r1.busy() ? 2 : ctx_r1.results().length ? 3 : 4);
|
|
1298
1306
|
} }
|
|
1299
|
-
/** Identyfikatory pozycji listy dla `aria-activedescendant`
|
|
1307
|
+
/** Identyfikatory pozycji listy dla `aria-activedescendant` - muszą być unikalne w dokumencie. */
|
|
1300
1308
|
let nextId = 0;
|
|
1301
1309
|
/**
|
|
1302
1310
|
* Wyszukiwarka adresów: pole z podpowiedziami z geokodera. Wynik wyboru leci w `selected`,
|
|
1303
|
-
* a co z nim zrobić
|
|
1311
|
+
* a co z nim zrobić - decyduje rodzic (`kpt-map` przenosi na niego widok).
|
|
1304
1312
|
*
|
|
1305
|
-
* Wymaga portu `KPT_MAP_GEOCODER` **z metodą `search()`**
|
|
1313
|
+
* Wymaga portu `KPT_MAP_GEOCODER` **z metodą `search()`** - biblioteka nie odpytuje cudzego
|
|
1306
1314
|
* serwera bez zgody aplikacji. Bez portu pole renderuje się wyłączone, zamiast udawać, że
|
|
1307
1315
|
* coś znajdzie; `kpt-map` idzie dalej i w ogóle go wtedy nie pokazuje.
|
|
1308
1316
|
*
|
|
@@ -1325,7 +1333,7 @@ class KptMapSearch {
|
|
|
1325
1333
|
this.debounce = input(300, { ...(ngDevMode ? { debugName: "debounce" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1326
1334
|
/** Ile podpowiedzi najwyżej. */
|
|
1327
1335
|
this.limit = input(5, { ...(ngDevMode ? { debugName: "limit" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1328
|
-
/** Zawężenie twarde do krajów (ISO 3166-1 alpha-2)
|
|
1336
|
+
/** Zawężenie twarde do krajów (ISO 3166-1 alpha-2) - wyniki spoza nich nie wrócą. */
|
|
1329
1337
|
this.countryCodes = input(null, /* @ts-ignore */
|
|
1330
1338
|
...(ngDevMode ? [{ debugName: "countryCodes" }] : /* istanbul ignore next */ []));
|
|
1331
1339
|
/** Preferowany prostokąt wyników. Nie odcina reszty świata, tylko przesuwa ją niżej. */
|
|
@@ -1333,7 +1341,19 @@ class KptMapSearch {
|
|
|
1333
1341
|
...(ngDevMode ? [{ debugName: "viewbox" }] : /* istanbul ignore next */ []));
|
|
1334
1342
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1335
1343
|
/**
|
|
1336
|
-
*
|
|
1344
|
+
* Mikrofon w polu (Web Speech API): kliknięcie czyści frazę, a jedna podyktowana wypowiedź
|
|
1345
|
+
* staje się zapytaniem - z tym samym `debounce` i `minLength` co pisanie. Bez wsparcia
|
|
1346
|
+
* przeglądarki się nie pokazuje.
|
|
1347
|
+
*/
|
|
1348
|
+
this.speech = input(false, { ...(ngDevMode ? { debugName: "speech" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1349
|
+
/** Język dyktowania (BCP 47); bez niego z języka interfejsu. */
|
|
1350
|
+
this.speechLang = input(null, /* @ts-ignore */
|
|
1351
|
+
...(ngDevMode ? [{ debugName: "speechLang" }] : /* istanbul ignore next */ []));
|
|
1352
|
+
/** Kolor "stop" i fali w trakcie nasłuchu; domyślnie kolor motywu. */
|
|
1353
|
+
this.speechColor = input('primary', /* @ts-ignore */
|
|
1354
|
+
...(ngDevMode ? [{ debugName: "speechColor" }] : /* istanbul ignore next */ []));
|
|
1355
|
+
/**
|
|
1356
|
+
* Geokoder tego pola. Podany wygrywa nad `KPT_MAP_GEOCODER` z DI - `kpt-map` podaje tędy
|
|
1337
1357
|
* port swojej mapy, bo geokoder jest per mapa, a nie per aplikacja. Bez niego wszystko
|
|
1338
1358
|
* działa jak dotąd: port przychodzi z DI.
|
|
1339
1359
|
*/
|
|
@@ -1344,7 +1364,7 @@ class KptMapSearch {
|
|
|
1344
1364
|
* pole najpierw uzupełnia przez `resolve()` portu, a dopiero potem emituje.
|
|
1345
1365
|
*/
|
|
1346
1366
|
this.selected = output();
|
|
1347
|
-
/** Pole wyczyszczone
|
|
1367
|
+
/** Pole wyczyszczone - rodzic sprząta po sobie (np. chowa tymczasową pinezkę). */
|
|
1348
1368
|
this.cleared = output();
|
|
1349
1369
|
this.i18n = inject(KptI18n);
|
|
1350
1370
|
this.injectedGeocoder = inject(KPT_MAP_GEOCODER, { optional: true });
|
|
@@ -1357,7 +1377,7 @@ class KptMapSearch {
|
|
|
1357
1377
|
...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
1358
1378
|
/**
|
|
1359
1379
|
* Fraza do odpytania geokodera. Osobna od `query`, bo wybór podpowiedzi zmienia treść
|
|
1360
|
-
* pola
|
|
1380
|
+
* pola - a to nie może wywołać kolejnego zapytania o coś, co już znaleźliśmy.
|
|
1361
1381
|
*/
|
|
1362
1382
|
this.term = signal('', /* @ts-ignore */
|
|
1363
1383
|
...(ngDevMode ? [{ debugName: "term" }] : /* istanbul ignore next */ []));
|
|
@@ -1371,16 +1391,16 @@ class KptMapSearch {
|
|
|
1371
1391
|
*/
|
|
1372
1392
|
this.resolving = signal(false, /* @ts-ignore */
|
|
1373
1393
|
...(ngDevMode ? [{ debugName: "resolving" }] : /* istanbul ignore next */ []));
|
|
1374
|
-
/** Subskrypcja `resolve()` w locie
|
|
1394
|
+
/** Subskrypcja `resolve()` w locie - kolejny wybór i czyszczenie pola ją przerywają. */
|
|
1375
1395
|
this.pending = null;
|
|
1376
|
-
/** Czy jakieś zapytanie już wróciło
|
|
1396
|
+
/** Czy jakieś zapytanie już wróciło - bez tego "brak wyników" mignąłby przed pierwszym. */
|
|
1377
1397
|
this.searched = signal(false, /* @ts-ignore */
|
|
1378
1398
|
...(ngDevMode ? [{ debugName: "searched" }] : /* istanbul ignore next */ []));
|
|
1379
1399
|
this.open = signal(false, /* @ts-ignore */
|
|
1380
1400
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
1381
1401
|
this.activeIndex = signal(-1, /* @ts-ignore */
|
|
1382
1402
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
1383
|
-
/** Fraza za krótka, ale niepusta
|
|
1403
|
+
/** Fraza za krótka, ale niepusta - zamiast ciszy pokazujemy, ile znaków brakuje. */
|
|
1384
1404
|
this.tooShort = computed(() => {
|
|
1385
1405
|
const length = this.query().trim().length;
|
|
1386
1406
|
return length > 0 && length < this.minLength();
|
|
@@ -1389,15 +1409,18 @@ class KptMapSearch {
|
|
|
1389
1409
|
this.hasPanel = computed(() => this.open() &&
|
|
1390
1410
|
(this.tooShort() || this.busy() || this.results().length > 0 || this.searched()), /* @ts-ignore */
|
|
1391
1411
|
...(ngDevMode ? [{ debugName: "hasPanel" }] : /* istanbul ignore next */ []));
|
|
1392
|
-
/** Cokolwiek leci do geokodera
|
|
1412
|
+
/** Cokolwiek leci do geokodera - lista albo pojedyncze miejsce. Jeden stan dla szablonu. */
|
|
1393
1413
|
this.busy = computed(() => this.loading() || this.resolving(), /* @ts-ignore */
|
|
1394
1414
|
...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
1415
|
+
/** Panel pokazuje listę (a nie notę) - tylko wtedy `aria-controls` ma na co wskazać. */
|
|
1416
|
+
this.listShown = computed(() => this.hasPanel() && !this.tooShort() && !this.busy() && this.results().length > 0, /* @ts-ignore */
|
|
1417
|
+
...(ngDevMode ? [{ debugName: "listShown" }] : /* istanbul ignore next */ []));
|
|
1395
1418
|
this.canSearch = computed(() => !!this.port()?.search, /* @ts-ignore */
|
|
1396
1419
|
...(ngDevMode ? [{ debugName: "canSearch" }] : /* istanbul ignore next */ []));
|
|
1397
|
-
/** Nie udało się ustalić miejsca wybranej podpowiedzi
|
|
1420
|
+
/** Nie udało się ustalić miejsca wybranej podpowiedzi - komunikat zamiast cichej ciszy. */
|
|
1398
1421
|
this.unresolved = signal(false, /* @ts-ignore */
|
|
1399
1422
|
...(ngDevMode ? [{ debugName: "unresolved" }] : /* istanbul ignore next */ []));
|
|
1400
|
-
/** Komunikat dla `aria-live`
|
|
1423
|
+
/** Komunikat dla `aria-live` - czytnik dostaje stan, którego wzrokowo nie da się przegapić. */
|
|
1401
1424
|
this.status = computed(() => {
|
|
1402
1425
|
if (this.tooShort())
|
|
1403
1426
|
return this.i18n.t('map.search.minLength', { count: this.minLength() });
|
|
@@ -1424,7 +1447,7 @@ class KptMapSearch {
|
|
|
1424
1447
|
* Debounce stoi na `setTimeout`, a nie na operatorach rxjs: porty tego pakietu używają
|
|
1425
1448
|
* wyłącznie `Observable`/`of`, a rxjs nie jest zadeklarowany jako `peerDependency`
|
|
1426
1449
|
* biblioteki (wchodzi tranzytywnie przez `@angular/core`). `onCleanup` kasuje zarówno
|
|
1427
|
-
* niewystrzelony timer, jak i zapytanie w locie
|
|
1450
|
+
* niewystrzelony timer, jak i zapytanie w locie - adapter Nominatim przerywa wtedy
|
|
1428
1451
|
* `fetch` własnym `AbortController`.
|
|
1429
1452
|
*/
|
|
1430
1453
|
watchTerm() {
|
|
@@ -1468,7 +1491,7 @@ class KptMapSearch {
|
|
|
1468
1491
|
applyResults(results) {
|
|
1469
1492
|
// Podpowiedź bez współrzędnych jest do czegokolwiek dobra tylko wtedy, gdy port umie
|
|
1470
1493
|
// ją uzupełnić. Bez `resolve()` kliknięcie w nią nie miałoby dokąd polecieć, a pozycja,
|
|
1471
|
-
// która nic nie robi, jest gorsza od jej braku
|
|
1494
|
+
// która nic nie robi, jest gorsza od jej braku - więc taka nie trafia na listę.
|
|
1472
1495
|
this.results.set(this.port()?.resolve ? results : results.filter((r) => r.at));
|
|
1473
1496
|
this.loading.set(false);
|
|
1474
1497
|
this.searched.set(true);
|
|
@@ -1492,15 +1515,15 @@ class KptMapSearch {
|
|
|
1492
1515
|
this.open.set(false);
|
|
1493
1516
|
}
|
|
1494
1517
|
/**
|
|
1495
|
-
* Wybór podpowiedzi. Dostawca, który podał współrzędne na liście, emituje natychmiast
|
|
1518
|
+
* Wybór podpowiedzi. Dostawca, który podał współrzędne na liście, emituje natychmiast -
|
|
1496
1519
|
* dla Nominatima i każdego geokodera pytanego wprost nic się nie zmienia.
|
|
1497
1520
|
*
|
|
1498
1521
|
* Podpowiedź bez `at` (Google Places Autocomplete) trzeba najpierw uzupełnić: jedno
|
|
1499
1522
|
* wywołanie `resolve()` na *wybór*, nigdy w trakcie pisania. Panel zostaje otwarty
|
|
1500
|
-
* z komunikatem
|
|
1523
|
+
* z komunikatem "Szukam...", żeby czekanie nie wyglądało na zawieszenie pola.
|
|
1501
1524
|
*/
|
|
1502
1525
|
pick(suggestion) {
|
|
1503
|
-
// Etykieta wraca do pola, ale `term` zostaje
|
|
1526
|
+
// Etykieta wraca do pola, ale `term` zostaje - inaczej wybór odpaliłby kolejne zapytanie.
|
|
1504
1527
|
this.query.set(suggestion.label);
|
|
1505
1528
|
this.activeIndex.set(-1);
|
|
1506
1529
|
this.unresolved.set(false);
|
|
@@ -1563,14 +1586,14 @@ class KptMapSearch {
|
|
|
1563
1586
|
case 'Enter': {
|
|
1564
1587
|
const result = results[this.activeIndex()];
|
|
1565
1588
|
if (result) {
|
|
1566
|
-
// Pole bywa w formularzu aplikacji
|
|
1589
|
+
// Pole bywa w formularzu aplikacji - Enter nie ma go wysyłać.
|
|
1567
1590
|
event.preventDefault();
|
|
1568
1591
|
this.pick(result);
|
|
1569
1592
|
}
|
|
1570
1593
|
break;
|
|
1571
1594
|
}
|
|
1572
1595
|
case 'Escape':
|
|
1573
|
-
// Pierwszy Esc zamyka listę, drugi czyści pole
|
|
1596
|
+
// Pierwszy Esc zamyka listę, drugi czyści pole - jak w polu wyszukiwania przeglądarki.
|
|
1574
1597
|
if (this.open())
|
|
1575
1598
|
this.open.set(false);
|
|
1576
1599
|
else if (this.query())
|
|
@@ -1581,35 +1604,38 @@ class KptMapSearch {
|
|
|
1581
1604
|
}
|
|
1582
1605
|
}
|
|
1583
1606
|
static { this.ɵfac = function KptMapSearch_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KptMapSearch)(); }; }
|
|
1584
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMapSearch, selectors: [["kpt-map-search"]], hostAttrs: [1, "kpt-map-search"], inputs: { placeholder: [1, "placeholder"], minLength: [1, "minLength"], debounce: [1, "debounce"], limit: [1, "limit"], countryCodes: [1, "countryCodes"], viewbox: [1, "viewbox"], disabled: [1, "disabled"], geocoder: [1, "geocoder"] }, outputs: { selected: "selected", cleared: "cleared" }, decls:
|
|
1585
|
-
i0.ɵɵelementStart(0, "div",
|
|
1586
|
-
i0.ɵɵelement(2, "kpt-icon",
|
|
1607
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: KptMapSearch, selectors: [["kpt-map-search"]], hostAttrs: [1, "kpt-map-search"], inputs: { placeholder: [1, "placeholder"], minLength: [1, "minLength"], debounce: [1, "debounce"], limit: [1, "limit"], countryCodes: [1, "countryCodes"], viewbox: [1, "viewbox"], disabled: [1, "disabled"], speech: [1, "speech"], speechLang: [1, "speechLang"], speechColor: [1, "speechColor"], geocoder: [1, "geocoder"] }, outputs: { selected: "selected", cleared: "cleared" }, decls: 10, vars: 13, consts: [["fieldEl", ""], [1, "kpt-map-search__field"], ["aria-hidden", "true", 1, "kpt-map-search__icon"], ["name", "search"], ["type", "text", "autocomplete", "off", "autocapitalize", "off", "spellcheck", "false", "role", "combobox", "aria-autocomplete", "list", 1, "kpt-map-search__input", 3, "input", "focus", "blur", "keydown", "id", "value", "placeholder", "disabled"], ["type", "button", 1, "kpt-map-search__clear", 3, "title"], ["size", "sm", "unsupported", "hide", "mode", "replace", 1, "kpt-map-search__speech", 3, "continuous", "target", "lang", "listeningColor", "disabled"], [1, "kpt-map-search__panel", 3, "id"], ["aria-live", "polite", 1, "kpt-map-search__status"], ["type", "button", 1, "kpt-map-search__clear", 3, "click", "title"], ["name", "x"], [1, "kpt-map-search__note"], ["role", "listbox", 1, "kpt-map-search__list", 3, "id"], ["role", "option", 1, "kpt-map-search__option", 3, "id", "is-active"], ["role", "option", 1, "kpt-map-search__option", 3, "mousedown", "mouseenter", "id"], ["aria-hidden", "true", 1, "kpt-map-search__pin"], ["name", "map-pin"], [1, "kpt-map-search__label"]], template: function KptMapSearch_Template(rf, ctx) { if (rf & 1) {
|
|
1608
|
+
i0.ɵɵelementStart(0, "div", 1)(1, "span", 2);
|
|
1609
|
+
i0.ɵɵelement(2, "kpt-icon", 3);
|
|
1587
1610
|
i0.ɵɵelementEnd();
|
|
1588
|
-
i0.ɵɵelementStart(3, "input",
|
|
1611
|
+
i0.ɵɵelementStart(3, "input", 4, 0);
|
|
1589
1612
|
i0.ɵɵlistener("input", function KptMapSearch_Template_input_input_3_listener($event) { return ctx.onInput($event); })("focus", function KptMapSearch_Template_input_focus_3_listener() { return ctx.onFocus(); })("blur", function KptMapSearch_Template_input_blur_3_listener() { return ctx.onBlur(); })("keydown", function KptMapSearch_Template_input_keydown_3_listener($event) { return ctx.onKeydown($event); });
|
|
1590
1613
|
i0.ɵɵelementEnd();
|
|
1591
|
-
i0.ɵɵconditionalCreate(
|
|
1614
|
+
i0.ɵɵconditionalCreate(5, KptMapSearch_Conditional_5_Template, 2, 2, "button", 5);
|
|
1615
|
+
i0.ɵɵconditionalCreate(6, KptMapSearch_Conditional_6_Template, 1, 5, "kpt-speech-button", 6);
|
|
1592
1616
|
i0.ɵɵelementEnd();
|
|
1593
|
-
i0.ɵɵconditionalCreate(
|
|
1594
|
-
i0.ɵɵelementStart(
|
|
1595
|
-
i0.ɵɵtext(
|
|
1617
|
+
i0.ɵɵconditionalCreate(7, KptMapSearch_Conditional_7_Template, 5, 2, "div", 7);
|
|
1618
|
+
i0.ɵɵelementStart(8, "p", 8);
|
|
1619
|
+
i0.ɵɵtext(9);
|
|
1596
1620
|
i0.ɵɵelementEnd();
|
|
1597
1621
|
} if (rf & 2) {
|
|
1598
1622
|
i0.ɵɵadvance(3);
|
|
1599
1623
|
i0.ɵɵproperty("id", ctx.uid)("value", ctx.query())("placeholder", ctx.placeholderText())("disabled", ctx.disabled() || !ctx.canSearch());
|
|
1600
|
-
i0.ɵɵattribute("aria-label", ctx.i18n.t("map.search.label"))("aria-expanded", ctx.hasPanel())("aria-busy", ctx.busy() ? "true" : null)("aria-controls", ctx.
|
|
1624
|
+
i0.ɵɵattribute("aria-label", ctx.i18n.t("map.search.label"))("aria-expanded", ctx.hasPanel())("aria-busy", ctx.busy() ? "true" : null)("aria-controls", ctx.listShown() ? ctx.uid + "-list" : null)("aria-activedescendant", ctx.activeIndex() >= 0 ? ctx.optionId(ctx.activeIndex()) : null);
|
|
1625
|
+
i0.ɵɵadvance(2);
|
|
1626
|
+
i0.ɵɵconditional(ctx.query() ? 5 : -1);
|
|
1601
1627
|
i0.ɵɵadvance();
|
|
1602
|
-
i0.ɵɵconditional(ctx.
|
|
1628
|
+
i0.ɵɵconditional(ctx.speech() ? 6 : -1);
|
|
1603
1629
|
i0.ɵɵadvance();
|
|
1604
|
-
i0.ɵɵconditional(ctx.hasPanel() ?
|
|
1630
|
+
i0.ɵɵconditional(ctx.hasPanel() ? 7 : -1);
|
|
1605
1631
|
i0.ɵɵadvance(2);
|
|
1606
1632
|
i0.ɵɵtextInterpolate(ctx.status());
|
|
1607
|
-
} }, dependencies: [KptIcon], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-search{position:relative;display:block;width:var(--%NS%kpt-map-search-width, 20rem);max-width:100%;font-size:var(--%NS%kpt-font-size-sm)}.kpt-map-search__field{display:flex;gap:var(--%NS%kpt-space-1);align-items:center;padding-inline:var(--%NS%kpt-space-2);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map-search__field:focus-within{border-color:var(--%NS%kpt-color-border-strong);outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__icon{display:inline-flex;flex:none;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__input{min-width:0;flex:1 1 auto;padding:var(--%NS%kpt-space-2) 0;font:inherit;color:var(--%NS%kpt-color-on-surface);background:transparent;border:none}.kpt-map-search__input::placeholder{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__input:focus{outline:none}.kpt-map-search__input:disabled{color:var(--%NS%kpt-color-on-surface-muted);cursor:not-allowed}.kpt-map-search__clear{display:inline-flex;flex:none;align-items:center;justify-content:center;padding:var(--%NS%kpt-space-1);color:var(--%NS%kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-full)}.kpt-map-search__clear:hover{color:var(--%NS%kpt-color-on-surface);background:var(--%NS%kpt-color-surface-hover)}.kpt-map-search__clear:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__panel{position:absolute;top:calc(100% + var(--%NS%kpt-space-1));right:0;left:0;z-index:1;max-height:var(--%NS%kpt-map-search-panel-max-height, 18rem);overflow-y:auto;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-map-search__list{margin:0;padding:var(--%NS%kpt-space-1);list-style:none}.kpt-map-search__option{display:flex;gap:var(--%NS%kpt-space-2);align-items:start;padding:var(--%NS%kpt-space-2);color:var(--%NS%kpt-color-on-surface);cursor:pointer;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map-search__option.is-active{background:var(--%NS%kpt-color-surface-hover)}.kpt-map-search__pin{display:inline-flex;flex:none;margin-top:.125rem;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__label{overflow-wrap:anywhere}.kpt-map-search__note{margin:0;padding:var(--%NS%kpt-space-3);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"], encapsulation: 2 }); }
|
|
1633
|
+
} }, dependencies: [KptIcon, KptSpeechButton], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-search{position:relative;display:block;width:var(--%NS%kpt-map-search-width, 20rem);max-width:100%;font-size:var(--%NS%kpt-font-size-sm)}.kpt-map-search__field{display:flex;gap:var(--%NS%kpt-space-1);align-items:center;padding-inline:var(--%NS%kpt-space-2);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map-search__field:focus-within{border-color:var(--%NS%kpt-color-border-strong);outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__icon{display:inline-flex;flex:none;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__input{min-width:0;flex:1 1 auto;padding:var(--%NS%kpt-space-2) 0;font:inherit;color:var(--%NS%kpt-color-on-surface);background:transparent;border:none}.kpt-map-search__input::placeholder{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__input:focus{outline:none}.kpt-map-search__input:disabled{color:var(--%NS%kpt-color-on-surface-muted);cursor:not-allowed}.kpt-map-search__speech{flex:none;gap:var(--%NS%kpt-space-1)}.kpt-map-search__clear{display:inline-flex;flex:none;align-items:center;justify-content:center;padding:var(--%NS%kpt-space-1);color:var(--%NS%kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-full)}.kpt-map-search__clear:hover{color:var(--%NS%kpt-color-on-surface);background:var(--%NS%kpt-color-surface-hover)}.kpt-map-search__clear:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__panel{position:absolute;top:calc(100% + var(--%NS%kpt-space-1));right:0;left:0;z-index:1;max-height:var(--%NS%kpt-map-search-panel-max-height, 18rem);overflow-y:auto;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-map-search__list{margin:0;padding:var(--%NS%kpt-space-1);list-style:none}.kpt-map-search__option{display:flex;gap:var(--%NS%kpt-space-2);align-items:start;padding:var(--%NS%kpt-space-2);color:var(--%NS%kpt-color-on-surface);cursor:pointer;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map-search__option.is-active{background:var(--%NS%kpt-color-surface-hover)}.kpt-map-search__pin{display:inline-flex;flex:none;margin-top:.125rem;color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__label{overflow-wrap:anywhere}.kpt-map-search__note{margin:0;padding:var(--%NS%kpt-space-3);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-search__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"], encapsulation: 2 }); }
|
|
1608
1634
|
}
|
|
1609
1635
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptMapSearch, [{
|
|
1610
1636
|
type: Component,
|
|
1611
|
-
args: [{ selector: 'kpt-map-search', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon], host: { class: 'kpt-map-search' }, template: "<div class=\"kpt-map-search__field\">\n <span class=\"kpt-map-search__icon\" aria-hidden=\"true\">\n <kpt-icon name=\"search\" />\n </span>\n\n <input\n class=\"kpt-map-search__input\"\n type=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [id]=\"uid\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n [disabled]=\"disabled() || !canSearch()\"\n [attr.aria-label]=\"i18n.t('map.search.label')\"\n [attr.aria-expanded]=\"hasPanel()\"\n [attr.aria-busy]=\"busy() ? 'true' : null\"\n [attr.aria-controls]=\"
|
|
1612
|
-
}], () => [], { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }], countryCodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryCodes", required: false }] }], viewbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewbox", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], geocoder: [{ type: i0.Input, args: [{ isSignal: true, alias: "geocoder", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], cleared: [{ type: i0.Output, args: ["cleared"] }] }); })();
|
|
1637
|
+
args: [{ selector: 'kpt-map-search', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptIcon, KptSpeechButton], host: { class: 'kpt-map-search' }, template: "<div class=\"kpt-map-search__field\">\n <span class=\"kpt-map-search__icon\" aria-hidden=\"true\">\n <kpt-icon name=\"search\" />\n </span>\n\n <input\n #fieldEl\n class=\"kpt-map-search__input\"\n type=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [id]=\"uid\"\n [value]=\"query()\"\n [placeholder]=\"placeholderText()\"\n [disabled]=\"disabled() || !canSearch()\"\n [attr.aria-label]=\"i18n.t('map.search.label')\"\n [attr.aria-expanded]=\"hasPanel()\"\n [attr.aria-busy]=\"busy() ? 'true' : null\"\n [attr.aria-controls]=\"listShown() ? uid + '-list' : null\"\n [attr.aria-activedescendant]=\"activeIndex() >= 0 ? optionId(activeIndex()) : null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n\n @if (query()) {\n <button\n class=\"kpt-map-search__clear\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.search.clear')\"\n [title]=\"i18n.t('map.search.clear')\"\n (click)=\"clear()\"\n >\n <!-- `kpt-icon` sam ustawia sobie aria-hidden; nazw\u0119 niesie aria-label przycisku. -->\n <kpt-icon name=\"x\" />\n </button>\n }\n\n @if (speech()) {\n <!-- Wyszukiwanie g\u0142osem: pole czy\u015Bci si\u0119 po klikni\u0119ciu, a fraza wchodzi przez (input). -->\n <kpt-speech-button\n class=\"kpt-map-search__speech\"\n size=\"sm\"\n unsupported=\"hide\"\n mode=\"replace\"\n [continuous]=\"false\"\n [target]=\"fieldEl\"\n [lang]=\"speechLang()\"\n [listeningColor]=\"speechColor()\"\n [disabled]=\"disabled() || !canSearch()\"\n />\n }\n</div>\n\n@if (hasPanel()) {\n <div class=\"kpt-map-search__panel\" [id]=\"uid + '-panel'\">\n @if (tooShort()) {\n <p class=\"kpt-map-search__note\">{{ i18n.t('map.search.minLength', { count: minLength() }) }}</p>\n } @else if (busy()) {\n <!-- Ta sama nota dla listy i dla doci\u0105gania wsp\u00F3\u0142rz\u0119dnych wybranej pozycji. -->\n <p class=\"kpt-map-search__note\">{{ i18n.t('map.search.searching') }}</p>\n } @else if (results().length) {\n <!-- Panel stoi w DOM obok pola, wi\u0119c aktywn\u0105 pozycj\u0119 wskazuje `aria-activedescendant`. -->\n <ul class=\"kpt-map-search__list\" [id]=\"uid + '-list'\" role=\"listbox\" [attr.aria-label]=\"i18n.t('map.search.results')\">\n @for (result of results(); track result.id; let i = $index) {\n <li\n class=\"kpt-map-search__option\"\n role=\"option\"\n [id]=\"optionId(i)\"\n [class.is-active]=\"i === activeIndex()\"\n [attr.aria-selected]=\"i === activeIndex()\"\n (mousedown)=\"$event.preventDefault(); pick(result)\"\n (mouseenter)=\"activeIndex.set(i)\"\n >\n <span class=\"kpt-map-search__pin\" aria-hidden=\"true\">\n <kpt-icon name=\"map-pin\" />\n </span>\n <span class=\"kpt-map-search__label\">{{ result.label }}</span>\n </li>\n }\n </ul>\n } @else {\n <p class=\"kpt-map-search__note\">{{ i18n.t('map.search.noResults') }}</p>\n }\n </div>\n}\n\n<!-- Stan wyszukiwania dla czytnika - wzrokowo niesie go panel. -->\n<p class=\"kpt-map-search__status\" aria-live=\"polite\">{{ status() }}</p>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-search{position:relative;display:block;width:var(--kpt-map-search-width, 20rem);max-width:100%;font-size:var(--kpt-font-size-sm)}.kpt-map-search__field{display:flex;gap:var(--kpt-space-1);align-items:center;padding-inline:var(--kpt-space-2);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-1)}.kpt-map-search__field:focus-within{border-color:var(--kpt-color-border-strong);outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__icon{display:inline-flex;flex:none;color:var(--kpt-color-on-surface-muted)}.kpt-map-search__input{min-width:0;flex:1 1 auto;padding:var(--kpt-space-2) 0;font:inherit;color:var(--kpt-color-on-surface);background:transparent;border:none}.kpt-map-search__input::placeholder{color:var(--kpt-color-on-surface-muted)}.kpt-map-search__input:focus{outline:none}.kpt-map-search__input:disabled{color:var(--kpt-color-on-surface-muted);cursor:not-allowed}.kpt-map-search__speech{flex:none;gap:var(--kpt-space-1)}.kpt-map-search__clear{display:inline-flex;flex:none;align-items:center;justify-content:center;padding:var(--kpt-space-1);color:var(--kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--kpt-radius-full)}.kpt-map-search__clear:hover{color:var(--kpt-color-on-surface);background:var(--kpt-color-surface-hover)}.kpt-map-search__clear:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map-search__panel{position:absolute;top:calc(100% + var(--kpt-space-1));right:0;left:0;z-index:1;max-height:var(--kpt-map-search-panel-max-height, 18rem);overflow-y:auto;background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-3)}.kpt-map-search__list{margin:0;padding:var(--kpt-space-1);list-style:none}.kpt-map-search__option{display:flex;gap:var(--kpt-space-2);align-items:start;padding:var(--kpt-space-2);color:var(--kpt-color-on-surface);cursor:pointer;border-radius:var(--kpt-radius-sm)}.kpt-map-search__option.is-active{background:var(--kpt-color-surface-hover)}.kpt-map-search__pin{display:inline-flex;flex:none;margin-top:.125rem;color:var(--kpt-color-on-surface-muted)}.kpt-map-search__label{overflow-wrap:anywhere}.kpt-map-search__note{margin:0;padding:var(--kpt-space-3);color:var(--kpt-color-on-surface-muted)}.kpt-map-search__status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"] }]
|
|
1638
|
+
}], () => [], { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }], countryCodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryCodes", required: false }] }], viewbox: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewbox", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], speech: [{ type: i0.Input, args: [{ isSignal: true, alias: "speech", required: false }] }], speechLang: [{ type: i0.Input, args: [{ isSignal: true, alias: "speechLang", required: false }] }], speechColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "speechColor", required: false }] }], geocoder: [{ type: i0.Input, args: [{ isSignal: true, alias: "geocoder", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], cleared: [{ type: i0.Output, args: ["cleared"] }] }); })();
|
|
1613
1639
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMapSearch, { className: "KptMapSearch", filePath: "lib/map-search.component.ts", lineNumber: 49 }); })();
|
|
1614
1640
|
|
|
1615
1641
|
/**
|
|
@@ -1618,7 +1644,7 @@ class KptMapSearch {
|
|
|
1618
1644
|
*
|
|
1619
1645
|
* Typ `data` domyślnie jest luźny (jak `let-row` w tabeli CDK), bo Angular nie potrafi
|
|
1620
1646
|
* przenieść generyka z `kpt-map` na dyrektywę osadzoną w jego treści. Kto chce pełnego
|
|
1621
|
-
* wnioskowania, wiąże `[kptMapPopupTypeFor]` z tą samą tablicą, którą karmi mapę
|
|
1647
|
+
* wnioskowania, wiąże `[kptMapPopupTypeFor]` z tą samą tablicą, którą karmi mapę -
|
|
1622
1648
|
* wtedy `data` dostaje konkretny typ.
|
|
1623
1649
|
*
|
|
1624
1650
|
* @example
|
|
@@ -1633,15 +1659,22 @@ class KptMapSearch {
|
|
|
1633
1659
|
* <p>{{ data.address }}</p>
|
|
1634
1660
|
* </ng-template>
|
|
1635
1661
|
*/
|
|
1662
|
+
// `any` jako domyślne `T`: bez `kptMapPopupTypeFor` szablon ma działać jak zwykły `let-data`
|
|
1663
|
+
// (bez strictTemplates wywalających `data.address`). `unknown` złamałby istniejące szablony.
|
|
1664
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- patrz wyżej
|
|
1636
1665
|
class KptMapPopupTemplate {
|
|
1637
1666
|
constructor() {
|
|
1638
1667
|
/** Kategoria, do której szablon się stosuje; pusta wartość = szablon zapasowy. */
|
|
1639
|
-
this.category = input('',
|
|
1668
|
+
this.category = input('', /* @ts-ignore */
|
|
1669
|
+
...(ngDevMode ? [{ debugName: "category" }] : /* istanbul ignore next */ []));
|
|
1640
1670
|
/**
|
|
1641
|
-
* Nośnik typu
|
|
1671
|
+
* Nośnik typu - w runtime nieużywany. Jedyne zadanie: pozwolić Angularowi wywnioskować
|
|
1642
1672
|
* `T` z tablicy lokalizacji, tak jak `ngFor` wnioskuje typ elementu z bindowanej kolekcji.
|
|
1643
1673
|
*/
|
|
1644
|
-
this.typeFor = input(undefined, { ...(ngDevMode ? { debugName: "typeFor" } : /* istanbul ignore next */ {}),
|
|
1674
|
+
this.typeFor = input(undefined, { ...(ngDevMode ? { debugName: "typeFor" } : /* istanbul ignore next */ {}),
|
|
1675
|
+
// Alias z prefiksem selektora jest wymagany przez mikroskładnię (`kptMapPopupTypeFor` jak `ngForOf`).
|
|
1676
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename -- patrz wyżej
|
|
1677
|
+
alias: 'kptMapPopupTypeFor' });
|
|
1645
1678
|
this.templateRef = inject(TemplateRef);
|
|
1646
1679
|
}
|
|
1647
1680
|
/** Zawęża typ kontekstu w szablonie (`strictTemplates`). */
|
|
@@ -1656,7 +1689,7 @@ class KptMapPopupTemplate {
|
|
|
1656
1689
|
args: [{ selector: 'ng-template[kptMapPopup]' }]
|
|
1657
1690
|
}], null, { category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: false }] }], typeFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "kptMapPopupTypeFor", required: false }] }] }); })();
|
|
1658
1691
|
/**
|
|
1659
|
-
* Własny formularz
|
|
1692
|
+
* Własny formularz "dodaj lokalizację". Jego obecność wyłącza formularz budowany
|
|
1660
1693
|
* ze schemy kategorii.
|
|
1661
1694
|
*
|
|
1662
1695
|
* @example
|
|
@@ -1680,7 +1713,7 @@ class KptMapCreateFormTemplate {
|
|
|
1680
1713
|
}], null, null); })();
|
|
1681
1714
|
|
|
1682
1715
|
const KPT_MAP_GEOLOCATION = new InjectionToken('KPT_MAP_GEOLOCATION');
|
|
1683
|
-
/** Błąd geolokalizacji rozpoznany po kodzie
|
|
1716
|
+
/** Błąd geolokalizacji rozpoznany po kodzie - rzucany strumieniem, nie wyjątkiem. */
|
|
1684
1717
|
class KptMapGeolocationFailure extends Error {
|
|
1685
1718
|
constructor(detail) {
|
|
1686
1719
|
super(detail.message);
|
|
@@ -1690,7 +1723,7 @@ class KptMapGeolocationFailure extends Error {
|
|
|
1690
1723
|
}
|
|
1691
1724
|
const DEFAULT_OPTIONS = {
|
|
1692
1725
|
enableHighAccuracy: true,
|
|
1693
|
-
// Pozycja starsza niż pół minuty jest już bezużyteczna dla
|
|
1726
|
+
// Pozycja starsza niż pół minuty jest już bezużyteczna dla "gdzie jestem".
|
|
1694
1727
|
maximumAge: 30_000,
|
|
1695
1728
|
timeout: 15_000,
|
|
1696
1729
|
};
|
|
@@ -1698,7 +1731,7 @@ const DEFAULT_OPTIONS = {
|
|
|
1698
1731
|
* Domyślna implementacja na `navigator.geolocation.watchPosition`.
|
|
1699
1732
|
*
|
|
1700
1733
|
* Uwaga: Geolocation API działa wyłącznie w bezpiecznym kontekście (HTTPS albo
|
|
1701
|
-
* `localhost`). Na `http://` z adresem IP przeglądarka odmówi
|
|
1734
|
+
* `localhost`). Na `http://` z adresem IP przeglądarka odmówi - to nie jest błąd mapy.
|
|
1702
1735
|
*/
|
|
1703
1736
|
class KptBrowserGeolocation {
|
|
1704
1737
|
watch(options) {
|
|
@@ -1728,7 +1761,7 @@ function describeError(error) {
|
|
|
1728
1761
|
return { kind: 'unsupported', message: error.message };
|
|
1729
1762
|
}
|
|
1730
1763
|
}
|
|
1731
|
-
/** Stała pozycja
|
|
1764
|
+
/** Stała pozycja - Storybook, testy, demo bez pytania o zgodę. */
|
|
1732
1765
|
class KptMapGeolocationStub {
|
|
1733
1766
|
constructor(at, accuracy = 50) {
|
|
1734
1767
|
this.at = at;
|
|
@@ -1749,7 +1782,7 @@ function provideKptMapGeolocationStub(at, accuracy = 50) {
|
|
|
1749
1782
|
}
|
|
1750
1783
|
|
|
1751
1784
|
/**
|
|
1752
|
-
* Fabryka silnika mapy. Fabryka, a nie gotowa instancja
|
|
1785
|
+
* Fabryka silnika mapy. Fabryka, a nie gotowa instancja - każda mapa na stronie
|
|
1753
1786
|
* potrzebuje własnego obiektu, a provider jest jeden.
|
|
1754
1787
|
*/
|
|
1755
1788
|
const KPT_MAP_ENGINE = new InjectionToken('KPT_MAP_ENGINE');
|
|
@@ -1764,14 +1797,14 @@ const KPT_MAP_ENGINE = new InjectionToken('KPT_MAP_ENGINE');
|
|
|
1764
1797
|
function provideKptLeafletMap(options = {}) {
|
|
1765
1798
|
return [
|
|
1766
1799
|
{ provide: KPT_MAP_ENGINE, useValue: () => createLeafletEngine(options) },
|
|
1767
|
-
// Nadpisywalne
|
|
1800
|
+
// Nadpisywalne - wystarczy podać własny provider PO tym.
|
|
1768
1801
|
{ provide: KPT_MAP_GEOLOCATION, useClass: KptBrowserGeolocation },
|
|
1769
1802
|
];
|
|
1770
1803
|
}
|
|
1771
1804
|
/**
|
|
1772
|
-
* Silnik Google Maps. Nie wymaga żadnej paczki npm
|
|
1773
|
-
* mapie
|
|
1774
|
-
* (*Map management
|
|
1805
|
+
* Silnik Google Maps. Nie wymaga żadnej paczki npm - API dogrywa się skryptem przy pierwszej
|
|
1806
|
+
* mapie - ale wymaga klucza, konta rozliczeniowego i **`mapId`** z konsoli Google
|
|
1807
|
+
* (*Map management -> Create Map ID*): bez niego znaczniki się nie pojawią.
|
|
1775
1808
|
*
|
|
1776
1809
|
* Różnice wobec Leafleta: `[tileUrl]` i `[attribution]` są bez znaczenia (kafle i atrybucję
|
|
1777
1810
|
* dostarcza Google i nie wolno ich zasłonić), wczytanie mapy liczy się do SKU Dynamic Maps
|
|
@@ -1797,32 +1830,32 @@ const _c1 = ["popupEl"];
|
|
|
1797
1830
|
const _c2 = (a0, a1, a2, a3, a4) => ({ $implicit: a0, data: a1, category: a2, distance: a3, close: a4 });
|
|
1798
1831
|
const _c3 = (a0, a1, a2) => ({ $implicit: a0, at: a1, category: a2 });
|
|
1799
1832
|
const _forTrack0$1 = ($index, $item) => $item.id;
|
|
1800
|
-
function
|
|
1833
|
+
function KptMap_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
1801
1834
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
1802
|
-
i0.ɵɵelementStart(0, "button",
|
|
1803
|
-
i0.ɵɵlistener("click", function
|
|
1804
|
-
i0.ɵɵelement(1, "span",
|
|
1835
|
+
i0.ɵɵelementStart(0, "button", 12);
|
|
1836
|
+
i0.ɵɵlistener("click", function KptMap_Conditional_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.centreOnUser()); });
|
|
1837
|
+
i0.ɵɵelement(1, "span", 13);
|
|
1805
1838
|
i0.ɵɵelementEnd();
|
|
1806
1839
|
} if (rf & 2) {
|
|
1807
1840
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1808
1841
|
i0.ɵɵproperty("title", ctx_r2.locationBlocked() ? ctx_r2.i18n.t("map.locationDenied") : ctx_r2.i18n.t("map.locateMe"))("disabled", !ctx_r2.userPosition());
|
|
1809
1842
|
i0.ɵɵattribute("aria-label", ctx_r2.locationBlocked() ? ctx_r2.i18n.t("map.locationDenied") : ctx_r2.i18n.t("map.locateMe"));
|
|
1810
1843
|
} }
|
|
1811
|
-
function
|
|
1844
|
+
function KptMap_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
1812
1845
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
1813
|
-
i0.ɵɵelementStart(0, "div",
|
|
1814
|
-
i0.ɵɵlistener("selected", function
|
|
1846
|
+
i0.ɵɵelementStart(0, "div", 9)(1, "kpt-map-search", 14);
|
|
1847
|
+
i0.ɵɵlistener("selected", function KptMap_Conditional_9_Template_kpt_map_search_selected_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onSearchSelect($event)); })("cleared", function KptMap_Conditional_9_Template_kpt_map_search_cleared_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.clearSearchPin()); });
|
|
1815
1848
|
i0.ɵɵelementEnd()();
|
|
1816
1849
|
} if (rf & 2) {
|
|
1817
1850
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1818
1851
|
i0.ɵɵadvance();
|
|
1819
|
-
i0.ɵɵproperty("geocoder", ctx_r2.activeGeocoder())("placeholder", ctx_r2.searchPlaceholder())("minLength", ctx_r2.searchOptions().minLength ?? 3)("debounce", ctx_r2.searchOptions().debounce ?? 300)("limit", ctx_r2.searchOptions().limit ?? 5)("viewbox", ctx_r2.searchViewbox())("countryCodes", ctx_r2.searchCountryCodes());
|
|
1852
|
+
i0.ɵɵproperty("geocoder", ctx_r2.activeGeocoder())("placeholder", ctx_r2.searchPlaceholder())("minLength", ctx_r2.searchOptions().minLength ?? 3)("debounce", ctx_r2.searchOptions().debounce ?? 300)("limit", ctx_r2.searchOptions().limit ?? 5)("viewbox", ctx_r2.searchViewbox())("countryCodes", ctx_r2.searchCountryCodes())("speech", ctx_r2.searchSpeech())("speechLang", ctx_r2.searchSpeechLang())("speechColor", ctx_r2.searchSpeechColor());
|
|
1820
1853
|
} }
|
|
1821
|
-
function
|
|
1854
|
+
function KptMap_Conditional_10_Conditional_0_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
1822
1855
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
1823
|
-
i0.ɵɵelementStart(0, "button",
|
|
1824
|
-
i0.ɵɵlistener("click", function
|
|
1825
|
-
i0.ɵɵelement(1, "span",
|
|
1856
|
+
i0.ɵɵelementStart(0, "button", 20);
|
|
1857
|
+
i0.ɵɵlistener("click", function KptMap_Conditional_10_Conditional_0_For_4_Template_button_click_0_listener() { const category_r6 = i0.ɵɵrestoreView(_r5).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.startCreate(category_r6)); });
|
|
1858
|
+
i0.ɵɵelement(1, "span", 21);
|
|
1826
1859
|
i0.ɵɵtext(2);
|
|
1827
1860
|
i0.ɵɵelementEnd();
|
|
1828
1861
|
} if (rf & 2) {
|
|
@@ -1830,8 +1863,8 @@ function KptMap_Conditional_12_Conditional_0_For_4_Template(rf, ctx) { if (rf &
|
|
|
1830
1863
|
i0.ɵɵadvance(2);
|
|
1831
1864
|
i0.ɵɵtextInterpolate1(" ", category_r6.label, " ");
|
|
1832
1865
|
} }
|
|
1833
|
-
function
|
|
1834
|
-
i0.ɵɵelementStart(0, "p",
|
|
1866
|
+
function KptMap_Conditional_10_Conditional_0_ForEmpty_5_Template(rf, ctx) { if (rf & 1) {
|
|
1867
|
+
i0.ɵɵelementStart(0, "p", 19);
|
|
1835
1868
|
i0.ɵɵtext(1);
|
|
1836
1869
|
i0.ɵɵelementEnd();
|
|
1837
1870
|
} if (rf & 2) {
|
|
@@ -1839,11 +1872,11 @@ function KptMap_Conditional_12_Conditional_0_ForEmpty_5_Template(rf, ctx) { if (
|
|
|
1839
1872
|
i0.ɵɵadvance();
|
|
1840
1873
|
i0.ɵɵtextInterpolate(ctx_r2.i18n.t("map.empty"));
|
|
1841
1874
|
} }
|
|
1842
|
-
function
|
|
1843
|
-
i0.ɵɵelementStart(0, "div",
|
|
1875
|
+
function KptMap_Conditional_10_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
1876
|
+
i0.ɵɵelementStart(0, "div", 16)(1, "p", 17);
|
|
1844
1877
|
i0.ɵɵtext(2);
|
|
1845
1878
|
i0.ɵɵelementEnd();
|
|
1846
|
-
i0.ɵɵrepeaterCreate(3,
|
|
1879
|
+
i0.ɵɵrepeaterCreate(3, KptMap_Conditional_10_Conditional_0_For_4_Template, 3, 1, "button", 18, _forTrack0$1, false, KptMap_Conditional_10_Conditional_0_ForEmpty_5_Template, 2, 1, "p", 19);
|
|
1847
1880
|
i0.ɵɵelementEnd();
|
|
1848
1881
|
} if (rf & 2) {
|
|
1849
1882
|
const position_r7 = ctx;
|
|
@@ -1855,28 +1888,28 @@ function KptMap_Conditional_12_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
1855
1888
|
i0.ɵɵadvance();
|
|
1856
1889
|
i0.ɵɵrepeater(ctx_r2.creatableCategories());
|
|
1857
1890
|
} }
|
|
1858
|
-
function
|
|
1859
|
-
i0.ɵɵconditionalCreate(0,
|
|
1891
|
+
function KptMap_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
1892
|
+
i0.ɵɵconditionalCreate(0, KptMap_Conditional_10_Conditional_0_Template, 6, 7, "div", 15);
|
|
1860
1893
|
} if (rf & 2) {
|
|
1861
1894
|
let tmp_2_0;
|
|
1862
1895
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1863
1896
|
i0.ɵɵconditional((tmp_2_0 = ctx_r2.contextPosition()) ? 0 : -1, tmp_2_0);
|
|
1864
1897
|
} }
|
|
1865
|
-
function
|
|
1898
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1866
1899
|
const _r8 = i0.ɵɵgetCurrentView();
|
|
1867
|
-
i0.ɵɵelementStart(0, "button",
|
|
1868
|
-
i0.ɵɵlistener("click", function
|
|
1869
|
-
i0.ɵɵelementStart(1, "span",
|
|
1870
|
-
i0.ɵɵtext(2, "
|
|
1900
|
+
i0.ɵɵelementStart(0, "button", 27);
|
|
1901
|
+
i0.ɵɵlistener("click", function KptMap_Conditional_11_Conditional_0_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.closePopup()); });
|
|
1902
|
+
i0.ɵɵelementStart(1, "span", 28);
|
|
1903
|
+
i0.ɵɵtext(2, "x");
|
|
1871
1904
|
i0.ɵɵelementEnd()();
|
|
1872
1905
|
} if (rf & 2) {
|
|
1873
1906
|
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
1874
1907
|
i0.ɵɵattribute("aria-label", ctx_r2.i18n.t("common.close"));
|
|
1875
1908
|
} }
|
|
1876
|
-
function
|
|
1909
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_3_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
1877
1910
|
const _r9 = i0.ɵɵgetCurrentView();
|
|
1878
|
-
i0.ɵɵelementStart(0, "button",
|
|
1879
|
-
i0.ɵɵlistener("click", function
|
|
1911
|
+
i0.ɵɵelementStart(0, "button", 32);
|
|
1912
|
+
i0.ɵɵlistener("click", function KptMap_Conditional_11_Conditional_0_Conditional_3_For_4_Template_button_click_0_listener() { const item_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.selectFromGroup(item_r10)); });
|
|
1880
1913
|
i0.ɵɵtext(1);
|
|
1881
1914
|
i0.ɵɵelementEnd();
|
|
1882
1915
|
} if (rf & 2) {
|
|
@@ -1886,12 +1919,12 @@ function KptMap_Conditional_13_Conditional_0_Conditional_3_For_4_Template(rf, ct
|
|
|
1886
1919
|
i0.ɵɵadvance();
|
|
1887
1920
|
i0.ɵɵtextInterpolate1(" ", item_r10.title, " ");
|
|
1888
1921
|
} }
|
|
1889
|
-
function
|
|
1890
|
-
i0.ɵɵelementStart(0, "p",
|
|
1922
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
1923
|
+
i0.ɵɵelementStart(0, "p", 29);
|
|
1891
1924
|
i0.ɵɵtext(1);
|
|
1892
1925
|
i0.ɵɵelementEnd();
|
|
1893
|
-
i0.ɵɵelementStart(2, "div",
|
|
1894
|
-
i0.ɵɵrepeaterCreate(3,
|
|
1926
|
+
i0.ɵɵelementStart(2, "div", 30);
|
|
1927
|
+
i0.ɵɵrepeaterCreate(3, KptMap_Conditional_11_Conditional_0_Conditional_3_For_4_Template, 2, 2, "button", 31, _forTrack0$1);
|
|
1895
1928
|
i0.ɵɵelementEnd();
|
|
1896
1929
|
} if (rf & 2) {
|
|
1897
1930
|
const state_r11 = i0.ɵɵnextContext(2);
|
|
@@ -1901,26 +1934,26 @@ function KptMap_Conditional_13_Conditional_0_Conditional_3_Template(rf, ctx) { i
|
|
|
1901
1934
|
i0.ɵɵadvance(2);
|
|
1902
1935
|
i0.ɵɵrepeater(state_r11.group.items);
|
|
1903
1936
|
} }
|
|
1904
|
-
function
|
|
1905
|
-
i0.ɵɵelementContainer(0,
|
|
1937
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
1938
|
+
i0.ɵɵelementContainer(0, 26);
|
|
1906
1939
|
} if (rf & 2) {
|
|
1907
1940
|
const state_r11 = i0.ɵɵnextContext(2);
|
|
1908
1941
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1909
1942
|
i0.ɵɵproperty("ngTemplateOutlet", ctx.templateRef)("ngTemplateOutletContext", i0.ɵɵpureFunction5(2, _c2, state_r11.location, state_r11.location.data, ctx_r2.popupCategory(), ctx_r2.popupDistance(), ctx_r2.closePopupFn));
|
|
1910
1943
|
} }
|
|
1911
|
-
function
|
|
1912
|
-
i0.ɵɵelementStart(0, "p",
|
|
1944
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
1945
|
+
i0.ɵɵelementStart(0, "p", 34);
|
|
1913
1946
|
i0.ɵɵtext(1);
|
|
1914
1947
|
i0.ɵɵelementEnd();
|
|
1915
1948
|
} if (rf & 2) {
|
|
1916
1949
|
i0.ɵɵadvance();
|
|
1917
1950
|
i0.ɵɵtextInterpolate(ctx.label);
|
|
1918
1951
|
} }
|
|
1919
|
-
function
|
|
1920
|
-
i0.ɵɵelementStart(0, "strong",
|
|
1952
|
+
function KptMap_Conditional_11_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
1953
|
+
i0.ɵɵelementStart(0, "strong", 33);
|
|
1921
1954
|
i0.ɵɵtext(1);
|
|
1922
1955
|
i0.ɵɵelementEnd();
|
|
1923
|
-
i0.ɵɵconditionalCreate(2,
|
|
1956
|
+
i0.ɵɵconditionalCreate(2, KptMap_Conditional_11_Conditional_0_Conditional_6_Conditional_2_Template, 2, 1, "p", 34);
|
|
1924
1957
|
} if (rf & 2) {
|
|
1925
1958
|
let tmp_8_0;
|
|
1926
1959
|
const state_r11 = i0.ɵɵnextContext(2);
|
|
@@ -1930,12 +1963,12 @@ function KptMap_Conditional_13_Conditional_0_Conditional_6_Template(rf, ctx) { i
|
|
|
1930
1963
|
i0.ɵɵadvance();
|
|
1931
1964
|
i0.ɵɵconditional((tmp_8_0 = ctx_r2.popupCategory()) ? 2 : -1, tmp_8_0);
|
|
1932
1965
|
} }
|
|
1933
|
-
function
|
|
1934
|
-
i0.ɵɵelementStart(0, "div",
|
|
1935
|
-
i0.ɵɵconditionalCreate(2,
|
|
1936
|
-
i0.ɵɵconditionalCreate(3,
|
|
1937
|
-
i0.ɵɵelementStart(4, "div",
|
|
1938
|
-
i0.ɵɵconditionalCreate(5,
|
|
1966
|
+
function KptMap_Conditional_11_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
1967
|
+
i0.ɵɵelementStart(0, "div", 23, 1);
|
|
1968
|
+
i0.ɵɵconditionalCreate(2, KptMap_Conditional_11_Conditional_0_Conditional_2_Template, 3, 1, "button", 24);
|
|
1969
|
+
i0.ɵɵconditionalCreate(3, KptMap_Conditional_11_Conditional_0_Conditional_3_Template, 5, 1);
|
|
1970
|
+
i0.ɵɵelementStart(4, "div", 25);
|
|
1971
|
+
i0.ɵɵconditionalCreate(5, KptMap_Conditional_11_Conditional_0_Conditional_5_Template, 1, 8, "ng-container", 26)(6, KptMap_Conditional_11_Conditional_0_Conditional_6_Template, 3, 2);
|
|
1939
1972
|
i0.ɵɵelementEnd()();
|
|
1940
1973
|
} if (rf & 2) {
|
|
1941
1974
|
let tmp_12_0;
|
|
@@ -1951,17 +1984,17 @@ function KptMap_Conditional_13_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
1951
1984
|
i0.ɵɵadvance(2);
|
|
1952
1985
|
i0.ɵɵconditional((tmp_12_0 = ctx_r2.popupTemplate()) ? 5 : 6, tmp_12_0);
|
|
1953
1986
|
} }
|
|
1954
|
-
function
|
|
1955
|
-
i0.ɵɵconditionalCreate(0,
|
|
1987
|
+
function KptMap_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
1988
|
+
i0.ɵɵconditionalCreate(0, KptMap_Conditional_11_Conditional_0_Template, 7, 9, "div", 22);
|
|
1956
1989
|
} if (rf & 2) {
|
|
1957
1990
|
let tmp_3_0;
|
|
1958
1991
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1959
1992
|
i0.ɵɵconditional((tmp_3_0 = ctx_r2.popupPosition()) ? 0 : -1, tmp_3_0);
|
|
1960
1993
|
} }
|
|
1961
|
-
function
|
|
1994
|
+
function KptMap_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
1962
1995
|
const _r13 = i0.ɵɵgetCurrentView();
|
|
1963
|
-
i0.ɵɵelementStart(0, "kpt-map-legend",
|
|
1964
|
-
i0.ɵɵtwoWayListener("hiddenChange", function
|
|
1996
|
+
i0.ɵɵelementStart(0, "kpt-map-legend", 35);
|
|
1997
|
+
i0.ɵɵtwoWayListener("hiddenChange", function KptMap_Conditional_12_Template_kpt_map_legend_hiddenChange_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r2 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r2.hiddenCategories, $event) || (ctx_r2.hiddenCategories = $event); return i0.ɵɵresetView($event); });
|
|
1965
1998
|
i0.ɵɵelementEnd();
|
|
1966
1999
|
} if (rf & 2) {
|
|
1967
2000
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
@@ -1969,38 +2002,38 @@ function KptMap_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
|
1969
2002
|
i0.ɵɵtwoWayProperty("hidden", ctx_r2.hiddenCategories);
|
|
1970
2003
|
i0.ɵɵproperty("counts", ctx_r2.counts());
|
|
1971
2004
|
} }
|
|
1972
|
-
function
|
|
1973
|
-
i0.ɵɵelementContainer(0,
|
|
2005
|
+
function KptMap_Conditional_14_Conditional_0_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
2006
|
+
i0.ɵɵelementContainer(0, 26);
|
|
1974
2007
|
} if (rf & 2) {
|
|
1975
2008
|
const tpl_r14 = i0.ɵɵnextContext();
|
|
1976
2009
|
const target_r15 = i0.ɵɵnextContext();
|
|
1977
2010
|
i0.ɵɵproperty("ngTemplateOutlet", tpl_r14.templateRef)("ngTemplateOutletContext", i0.ɵɵpureFunction3(2, _c3, ctx, target_r15.at, target_r15.category));
|
|
1978
2011
|
} }
|
|
1979
|
-
function
|
|
1980
|
-
i0.ɵɵconditionalCreate(0,
|
|
2012
|
+
function KptMap_Conditional_14_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
2013
|
+
i0.ɵɵconditionalCreate(0, KptMap_Conditional_14_Conditional_0_Conditional_0_Template, 1, 6, "ng-container", 26);
|
|
1981
2014
|
} if (rf & 2) {
|
|
1982
2015
|
let tmp_5_0;
|
|
1983
2016
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
1984
2017
|
i0.ɵɵconditional((tmp_5_0 = ctx_r2.createFormApi()) ? 0 : -1, tmp_5_0);
|
|
1985
2018
|
} }
|
|
1986
|
-
function
|
|
2019
|
+
function KptMap_Conditional_14_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
1987
2020
|
const _r16 = i0.ɵɵgetCurrentView();
|
|
1988
|
-
i0.ɵɵelementStart(0, "kpt-map-create-dialog",
|
|
1989
|
-
i0.ɵɵlistener("save", function
|
|
2021
|
+
i0.ɵɵelementStart(0, "kpt-map-create-dialog", 37);
|
|
2022
|
+
i0.ɵɵlistener("save", function KptMap_Conditional_14_Conditional_1_Template_kpt_map_create_dialog_save_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.emitCreate($event)); })("cancelled", function KptMap_Conditional_14_Conditional_1_Template_kpt_map_create_dialog_cancelled_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.closeCreate()); });
|
|
1990
2023
|
i0.ɵɵelementEnd();
|
|
1991
2024
|
} if (rf & 2) {
|
|
1992
2025
|
const target_r15 = i0.ɵɵnextContext();
|
|
1993
2026
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
1994
2027
|
i0.ɵɵproperty("geocoder", ctx_r2.activeGeocoder())("category", target_r15.category)("at", target_r15.at);
|
|
1995
2028
|
} }
|
|
1996
|
-
function
|
|
1997
|
-
i0.ɵɵconditionalCreate(0,
|
|
2029
|
+
function KptMap_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
2030
|
+
i0.ɵɵconditionalCreate(0, KptMap_Conditional_14_Conditional_0_Template, 1, 1)(1, KptMap_Conditional_14_Conditional_1_Template, 1, 3, "kpt-map-create-dialog", 36);
|
|
1998
2031
|
} if (rf & 2) {
|
|
1999
2032
|
let tmp_3_0;
|
|
2000
2033
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
2001
2034
|
i0.ɵɵconditional((tmp_3_0 = ctx_r2.createFormTemplate()) ? 0 : 1, tmp_3_0);
|
|
2002
2035
|
} }
|
|
2003
|
-
/** Rozmiary ikon w pikselach
|
|
2036
|
+
/** Rozmiary ikon w pikselach - silnik potrzebuje ich do zakotwiczenia znacznika. */
|
|
2004
2037
|
const MARKER_SIZE = { width: 32, height: 42 };
|
|
2005
2038
|
const DOT_SIZE = { width: 24, height: 24 };
|
|
2006
2039
|
const CLUSTER_SIZE = { width: 44, height: 44 };
|
|
@@ -2008,13 +2041,13 @@ const CLUSTER_SIZE = { width: 44, height: 44 };
|
|
|
2008
2041
|
const FIT_PADDING = 48;
|
|
2009
2042
|
/**
|
|
2010
2043
|
* Identyfikator tymczasowej pinezki wyszukiwarki. Nie należy do `entries()`, więc
|
|
2011
|
-
* `onMarkerClick()` nie znajdzie dla niego wpisu i cicho wyjdzie
|
|
2044
|
+
* `onMarkerClick()` nie znajdzie dla niego wpisu i cicho wyjdzie - kliknięcie w wynik
|
|
2012
2045
|
* wyszukiwania niczego nie otwiera.
|
|
2013
2046
|
*/
|
|
2014
2047
|
const SEARCH_MARKER_ID = 'kpt-map:search';
|
|
2015
|
-
/** Brak silnika to najczęstsza pomyłka przy pierwszym użyciu
|
|
2016
|
-
const NO_ENGINE_ERROR = 'kpt-map: brak silnika mapy. Zarejestruj go w aplikacji
|
|
2017
|
-
'`provideKptLeafletMap()` albo `provideKptGoogleMap({ apiKey, mapId })`
|
|
2048
|
+
/** Brak silnika to najczęstsza pomyłka przy pierwszym użyciu - komunikat niesie instrukcję. */
|
|
2049
|
+
const NO_ENGINE_ERROR = 'kpt-map: brak silnika mapy. Zarejestruj go w aplikacji - ' +
|
|
2050
|
+
'`provideKptLeafletMap()` albo `provideKptGoogleMap({ apiKey, mapId })` - ' +
|
|
2018
2051
|
'albo podaj fabrykę wprost przez `[engine]`.';
|
|
2019
2052
|
/**
|
|
2020
2053
|
* Mapa z konfigurowalnymi znacznikami: kategorie z kolorem i ikoną, grupowanie z licznikiem,
|
|
@@ -2038,7 +2071,7 @@ class KptMap {
|
|
|
2038
2071
|
...(ngDevMode ? [{ debugName: "locations" }] : /* istanbul ignore next */ []));
|
|
2039
2072
|
this.categories = input.required(/* @ts-ignore */
|
|
2040
2073
|
...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
|
|
2041
|
-
/** Kod kraju z presetów (`PL`, `DE`, `EU
|
|
2074
|
+
/** Kod kraju z presetów (`PL`, `DE`, `EU`...). Nieznany kod cofa się do Polski. */
|
|
2042
2075
|
this.country = input('PL', /* @ts-ignore */
|
|
2043
2076
|
...(ngDevMode ? [{ debugName: "country" }] : /* istanbul ignore next */ []));
|
|
2044
2077
|
/** Jawny widok startowy; nadpisuje `country`. */
|
|
@@ -2057,7 +2090,7 @@ class KptMap {
|
|
|
2057
2090
|
...(ngDevMode ? [{ debugName: "clusterColorBy" }] : /* istanbul ignore next */ []));
|
|
2058
2091
|
/** Renderuje legendę pod mapą. Wyłącz, jeśli chcesz ją umieścić gdzie indziej. */
|
|
2059
2092
|
this.legend = input(true, { ...(ngDevMode ? { debugName: "legend" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2060
|
-
/** Identyfikatory ukrytych kategorii (dwukierunkowe)
|
|
2093
|
+
/** Identyfikatory ukrytych kategorii (dwukierunkowe) - legenda je przełącza. */
|
|
2061
2094
|
this.hiddenCategories = model([], /* @ts-ignore */
|
|
2062
2095
|
...(ngDevMode ? [{ debugName: "hiddenCategories" }] : /* istanbul ignore next */ []));
|
|
2063
2096
|
/** Pokazuje liczniki przy pozycjach legendy. */
|
|
@@ -2065,11 +2098,11 @@ class KptMap {
|
|
|
2065
2098
|
this.showUserLocation = input(false, { ...(ngDevMode ? { debugName: "showUserLocation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2066
2099
|
/** Przy każdej nowej pozycji centruje mapę na użytkowniku. */
|
|
2067
2100
|
this.followUser = input(false, { ...(ngDevMode ? { debugName: "followUser" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2068
|
-
/** Włącza menu
|
|
2101
|
+
/** Włącza menu "Dodaj lokalizację" pod prawym przyciskiem myszy. */
|
|
2069
2102
|
this.allowCreate = input(false, { ...(ngDevMode ? { debugName: "allowCreate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2070
2103
|
/**
|
|
2071
2104
|
* Pokazuje wyszukiwarkę adresów w rogu mapy. Wymaga portu `KPT_MAP_GEOCODER`
|
|
2072
|
-
* **z metodą `search()`**
|
|
2105
|
+
* **z metodą `search()`** - bez niego pole się nie renderuje, bo biblioteka nie
|
|
2073
2106
|
* odpytuje cudzego serwera bez zgody aplikacji.
|
|
2074
2107
|
*/
|
|
2075
2108
|
this.search = input(false, { ...(ngDevMode ? { debugName: "search" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -2081,11 +2114,19 @@ class KptMap {
|
|
|
2081
2114
|
...(ngDevMode ? [{ debugName: "searchOptions" }] : /* istanbul ignore next */ []));
|
|
2082
2115
|
/**
|
|
2083
2116
|
* Zoom, na jaki mapa wchodzi po wybraniu wyniku bez własnego zasięgu (pojedynczy adres).
|
|
2084
|
-
* Wynik z zasięgiem
|
|
2117
|
+
* Wynik z zasięgiem - miasto, region - dostaje `fitBounds` zamiast tego.
|
|
2085
2118
|
*/
|
|
2086
2119
|
this.searchZoom = input(16, { ...(ngDevMode ? { debugName: "searchZoom" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2087
2120
|
/** Zostawia tymczasową pinezkę w znalezionym punkcie. */
|
|
2088
2121
|
this.searchMarker = input(true, { ...(ngDevMode ? { debugName: "searchMarker" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2122
|
+
/** Mikrofon w wyszukiwarce - adres podyktowany zamiast wpisanego (patrz `kpt-map-search`). */
|
|
2123
|
+
this.searchSpeech = input(false, { ...(ngDevMode ? { debugName: "searchSpeech" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2124
|
+
/** Język dyktowania adresu (BCP 47); bez niego z języka interfejsu. */
|
|
2125
|
+
this.searchSpeechLang = input(null, /* @ts-ignore */
|
|
2126
|
+
...(ngDevMode ? [{ debugName: "searchSpeechLang" }] : /* istanbul ignore next */ []));
|
|
2127
|
+
/** Kolor "stop" i fali w trakcie nasłuchu; domyślnie kolor motywu. */
|
|
2128
|
+
this.searchSpeechColor = input('primary', /* @ts-ignore */
|
|
2129
|
+
...(ngDevMode ? [{ debugName: "searchSpeechColor" }] : /* istanbul ignore next */ []));
|
|
2089
2130
|
/**
|
|
2090
2131
|
* Wygląd popupu. `plain` to wąska ramka na treść tekstową (domyślna),
|
|
2091
2132
|
* `card` oddaje całą szerokość i wysokość karcie miejsca: bez paddingu,
|
|
@@ -2095,15 +2136,15 @@ class KptMap {
|
|
|
2095
2136
|
...(ngDevMode ? [{ debugName: "popupLayout" }] : /* istanbul ignore next */ []));
|
|
2096
2137
|
/**
|
|
2097
2138
|
* Punkt odniesienia dystansu podawanego szablonowi popupu jako `distance`.
|
|
2098
|
-
* `null` znaczy
|
|
2139
|
+
* `null` znaczy "pozycja użytkownika z `KPT_MAP_GEOLOCATION`", więc domyślnie
|
|
2099
2140
|
* jest to odległość od miejsca, w którym stoi patrzący. Aplikacja może podstawić
|
|
2100
|
-
* inny punkt
|
|
2141
|
+
* inny punkt - wyszukany adres, siedzibę firmy, stałą pozycję w demie.
|
|
2101
2142
|
*/
|
|
2102
2143
|
this.distanceFrom = input(null, /* @ts-ignore */
|
|
2103
2144
|
...(ngDevMode ? [{ debugName: "distanceFrom" }] : /* istanbul ignore next */ []));
|
|
2104
2145
|
this.height = input('480px', /* @ts-ignore */
|
|
2105
2146
|
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
2106
|
-
/** Bez znaczenia dla silnika Google
|
|
2147
|
+
/** Bez znaczenia dla silnika Google - kafle i atrybucję dostarcza tam Google. */
|
|
2107
2148
|
this.tileUrl = input(null, /* @ts-ignore */
|
|
2108
2149
|
...(ngDevMode ? [{ debugName: "tileUrl" }] : /* istanbul ignore next */ []));
|
|
2109
2150
|
this.attribution = input(null, /* @ts-ignore */
|
|
@@ -2111,10 +2152,10 @@ class KptMap {
|
|
|
2111
2152
|
/**
|
|
2112
2153
|
* Silnik **tej** mapy. Podany wygrywa nad `KPT_MAP_ENGINE` z DI, więc dwie mapy o różnych
|
|
2113
2154
|
* silnikach mieszczą się na jednej stronie bez komponentów-opakowań. Bez niego wszystko
|
|
2114
|
-
* działa jak dotąd
|
|
2155
|
+
* działa jak dotąd - silnik przychodzi z DI.
|
|
2115
2156
|
*
|
|
2116
2157
|
* Fabryka, a nie gotowa instancja: każda mapa potrzebuje własnego obiektu. Czytany raz,
|
|
2117
|
-
* przy inicjalizacji
|
|
2158
|
+
* przy inicjalizacji - podmiana po starcie nie przeładowuje mapy.
|
|
2118
2159
|
*
|
|
2119
2160
|
* @example
|
|
2120
2161
|
* readonly google: KptMapEngineFactory = () => createGoogleEngine({ apiKey, mapId });
|
|
@@ -2122,15 +2163,15 @@ class KptMap {
|
|
|
2122
2163
|
this.engine = input(null, /* @ts-ignore */
|
|
2123
2164
|
...(ngDevMode ? [{ debugName: "engine" }] : /* istanbul ignore next */ []));
|
|
2124
2165
|
/**
|
|
2125
|
-
* Geokoder **tej** mapy. Podany wygrywa nad `KPT_MAP_GEOCODER` z DI
|
|
2166
|
+
* Geokoder **tej** mapy. Podany wygrywa nad `KPT_MAP_GEOCODER` z DI - tak samo jak
|
|
2126
2167
|
* `[engine]` nad `KPT_MAP_ENGINE` i z tego samego powodu: Service Specific Terms wiążą
|
|
2127
2168
|
* geokoder Google z **mapą** Google, a nie z aplikacją. Na stronie z dwoma silnikami
|
|
2128
2169
|
* globalny provider nie umiałby tej reguły dotrzymać; wejście umie.
|
|
2129
2170
|
*
|
|
2130
|
-
* Trafia i do wyszukiwarki, i do formularza
|
|
2171
|
+
* Trafia i do wyszukiwarki, i do formularza "dodaj lokalizację" - jeden port na oba kierunki.
|
|
2131
2172
|
*
|
|
2132
2173
|
* @example
|
|
2133
|
-
* <kpt-map [engine]="google" [geocoder]="googleGeocoder"
|
|
2174
|
+
* <kpt-map [engine]="google" [geocoder]="googleGeocoder" ... />
|
|
2134
2175
|
*/
|
|
2135
2176
|
this.geocoder = input(null, /* @ts-ignore */
|
|
2136
2177
|
...(ngDevMode ? [{ debugName: "geocoder" }] : /* istanbul ignore next */ []));
|
|
@@ -2142,12 +2183,17 @@ class KptMap {
|
|
|
2142
2183
|
this.viewChange = output();
|
|
2143
2184
|
this.userPositionChange = output();
|
|
2144
2185
|
this.userLocationError = output();
|
|
2186
|
+
/**
|
|
2187
|
+
* Silnika nie udało się uruchomić - brak fabryki, brak paczki `leaflet`, odrzucony klucz Google.
|
|
2188
|
+
* Bez słuchacza błąd ląduje w konsoli; ze słuchaczem aplikacja może pokazać własny komunikat.
|
|
2189
|
+
*/
|
|
2190
|
+
this.engineError = output();
|
|
2145
2191
|
this.i18n = inject(KptI18n);
|
|
2146
2192
|
this.icons = inject(KptIconRegistry);
|
|
2147
2193
|
/** Opcjonalny, bo silnik może przyjść wejściem `[engine]` zamiast z DI. */
|
|
2148
2194
|
this.engineFactory = inject(KPT_MAP_ENGINE, { optional: true });
|
|
2149
2195
|
this.geolocation = inject(KPT_MAP_GEOLOCATION, { optional: true });
|
|
2150
|
-
/** Opcjonalny
|
|
2196
|
+
/** Opcjonalny - wejście `[geocoder]` i tak ma nad nim pierwszeństwo. */
|
|
2151
2197
|
this.injectedGeocoder = inject(KPT_MAP_GEOCODER, { optional: true });
|
|
2152
2198
|
this.destroyRef = inject(DestroyRef);
|
|
2153
2199
|
this.injector = inject(Injector);
|
|
@@ -2163,6 +2209,10 @@ class KptMap {
|
|
|
2163
2209
|
this.createFormTemplate = contentChild(KptMapCreateFormTemplate, /* @ts-ignore */
|
|
2164
2210
|
...(ngDevMode ? [{ debugName: "createFormTemplate" }] : /* istanbul ignore next */ []));
|
|
2165
2211
|
this.mapEngine = null;
|
|
2212
|
+
/** Komponent zniszczony - `initEngine()` po `await` nie może już podpinać zdarzeń ani obserwatorów. */
|
|
2213
|
+
this.destroyed = false;
|
|
2214
|
+
/** Trwający montaż silnika; zniszczenie czeka na jego koniec (patrz konstruktor). */
|
|
2215
|
+
this.engineInit = Promise.resolve();
|
|
2166
2216
|
this.engineKind = signal(null, /* @ts-ignore */
|
|
2167
2217
|
...(ngDevMode ? [{ debugName: "engineKind" }] : /* istanbul ignore next */ []));
|
|
2168
2218
|
this.ready = signal(false, /* @ts-ignore */
|
|
@@ -2170,7 +2220,7 @@ class KptMap {
|
|
|
2170
2220
|
/** Zoom trzymamy w sygnale, bo od niego zależy wynik grupowania. */
|
|
2171
2221
|
this.zoom = signal(6, /* @ts-ignore */
|
|
2172
2222
|
...(ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []));
|
|
2173
|
-
/** Rośnie przy każdym ruchu mapy
|
|
2223
|
+
/** Rośnie przy każdym ruchu mapy - wymusza przeliczenie pozycji popupu. */
|
|
2174
2224
|
this.viewportTick = signal(0, /* @ts-ignore */
|
|
2175
2225
|
...(ngDevMode ? [{ debugName: "viewportTick" }] : /* istanbul ignore next */ []));
|
|
2176
2226
|
this.popup = signal(null, /* @ts-ignore */
|
|
@@ -2183,7 +2233,7 @@ class KptMap {
|
|
|
2183
2233
|
...(ngDevMode ? [{ debugName: "createOpen" }] : /* istanbul ignore next */ []));
|
|
2184
2234
|
this.userPosition = signal(null, /* @ts-ignore */
|
|
2185
2235
|
...(ngDevMode ? [{ debugName: "userPosition" }] : /* istanbul ignore next */ []));
|
|
2186
|
-
/** Ostatni wybrany wynik wyszukiwania
|
|
2236
|
+
/** Ostatni wybrany wynik wyszukiwania - źródło tymczasowej pinezki. */
|
|
2187
2237
|
this.searchPin = signal(null, /* @ts-ignore */
|
|
2188
2238
|
...(ngDevMode ? [{ debugName: "searchPin" }] : /* istanbul ignore next */ []));
|
|
2189
2239
|
this.locationBlocked = signal(false, /* @ts-ignore */
|
|
@@ -2200,7 +2250,7 @@ class KptMap {
|
|
|
2200
2250
|
...(ngDevMode ? [{ debugName: "visibleLocations" }] : /* istanbul ignore next */ []));
|
|
2201
2251
|
this.counts = computed(() => this.legendCounts() ? countByCategory(this.locations()) : null, /* @ts-ignore */
|
|
2202
2252
|
...(ngDevMode ? [{ debugName: "counts" }] : /* istanbul ignore next */ []));
|
|
2203
|
-
/** Wynik grupowania dla aktualnego zoomu
|
|
2253
|
+
/** Wynik grupowania dla aktualnego zoomu - grupy i punkty pojedyncze. */
|
|
2204
2254
|
this.entries = computed(() => {
|
|
2205
2255
|
const locations = this.visibleLocations();
|
|
2206
2256
|
if (!this.cluster())
|
|
@@ -2230,7 +2280,7 @@ class KptMap {
|
|
|
2230
2280
|
}),
|
|
2231
2281
|
size: CLUSTER_SIZE,
|
|
2232
2282
|
anchor: { x: CLUSTER_SIZE.width / 2, y: CLUSTER_SIZE.height / 2 },
|
|
2233
|
-
// Grupy nad pojedynczymi punktami
|
|
2283
|
+
// Grupy nad pojedynczymi punktami - licznik ma być czytelny.
|
|
2234
2284
|
zIndex: 500,
|
|
2235
2285
|
};
|
|
2236
2286
|
}
|
|
@@ -2268,14 +2318,14 @@ class KptMap {
|
|
|
2268
2318
|
}),
|
|
2269
2319
|
size: MARKER_SIZE,
|
|
2270
2320
|
anchor: { x: MARKER_SIZE.width / 2, y: MARKER_SIZE.height },
|
|
2271
|
-
// Nad grupami (500)
|
|
2321
|
+
// Nad grupami (500) - to na nią użytkownik właśnie kazał mapie polecieć.
|
|
2272
2322
|
zIndex: 600,
|
|
2273
2323
|
});
|
|
2274
2324
|
}
|
|
2275
2325
|
return rendered;
|
|
2276
2326
|
}, /* @ts-ignore */
|
|
2277
2327
|
...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
|
|
2278
|
-
/** Szablon popupu dla kategorii; bez dopasowania
|
|
2328
|
+
/** Szablon popupu dla kategorii; bez dopasowania - szablon zapasowy (bez `category`). */
|
|
2279
2329
|
this.popupTemplateFor = computed(() => {
|
|
2280
2330
|
const exact = new Map();
|
|
2281
2331
|
let fallback = null;
|
|
@@ -2300,7 +2350,7 @@ class KptMap {
|
|
|
2300
2350
|
...(ngDevMode ? [{ debugName: "popupCategory" }] : /* istanbul ignore next */ []));
|
|
2301
2351
|
/**
|
|
2302
2352
|
* Odległość otwartego punktu od `distanceFrom` (albo od użytkownika) w metrach.
|
|
2303
|
-
* `null`, gdy nie ma od czego liczyć
|
|
2353
|
+
* `null`, gdy nie ma od czego liczyć - szablon chowa wtedy wiersz dystansu,
|
|
2304
2354
|
* zamiast pokazywać zero.
|
|
2305
2355
|
*/
|
|
2306
2356
|
this.popupDistance = computed(() => {
|
|
@@ -2313,7 +2363,7 @@ class KptMap {
|
|
|
2313
2363
|
...(ngDevMode ? [{ debugName: "popupDistance" }] : /* istanbul ignore next */ []));
|
|
2314
2364
|
/**
|
|
2315
2365
|
* Pozycja popupu w pikselach kontenera. Zależy od `viewportTick`, więc przelicza się
|
|
2316
|
-
* przy każdym ruchu mapy
|
|
2366
|
+
* przy każdym ruchu mapy - jeden sygnał zamiast nasłuchu w szablonie.
|
|
2317
2367
|
*/
|
|
2318
2368
|
this.popupPosition = computed(() => {
|
|
2319
2369
|
this.viewportTick();
|
|
@@ -2331,18 +2381,18 @@ class KptMap {
|
|
|
2331
2381
|
return this.mapEngine.project(target.at);
|
|
2332
2382
|
}, /* @ts-ignore */
|
|
2333
2383
|
...(ngDevMode ? [{ debugName: "contextPosition" }] : /* istanbul ignore next */ []));
|
|
2334
|
-
/** Kategorie oferowane w menu
|
|
2384
|
+
/** Kategorie oferowane w menu "dodaj" - ukryte w legendzie odpadają. */
|
|
2335
2385
|
this.creatableCategories = computed(() => {
|
|
2336
2386
|
const hidden = new Set(this.hiddenCategories());
|
|
2337
2387
|
return this.categories().filter((c) => !hidden.has(c.id) && (c.fields?.length || this.createFormTemplate()));
|
|
2338
2388
|
}, /* @ts-ignore */
|
|
2339
2389
|
...(ngDevMode ? [{ debugName: "creatableCategories" }] : /* istanbul ignore next */ []));
|
|
2340
|
-
/** Czy jest czym szukać
|
|
2390
|
+
/** Czy jest czym szukać - port bez `search()` nie zasługuje na pole, które nic nie robi. */
|
|
2341
2391
|
this.searchEnabled = computed(() => this.search() && !!this.activeGeocoder()?.search, /* @ts-ignore */
|
|
2342
2392
|
...(ngDevMode ? [{ debugName: "searchEnabled" }] : /* istanbul ignore next */ []));
|
|
2343
2393
|
/**
|
|
2344
|
-
* Prostokąt preferowanych wyników. Bierzemy zasięg jawny, a bez niego preset kraju
|
|
2345
|
-
*
|
|
2394
|
+
* Prostokąt preferowanych wyników. Bierzemy zasięg jawny, a bez niego preset kraju -
|
|
2395
|
+
* "Kwiatowa" ma trafiać w tę pod nosem, nie w tę z drugiego końca świata. To sam bias:
|
|
2346
2396
|
* adresu z zagranicy dalej da się poszukać.
|
|
2347
2397
|
*/
|
|
2348
2398
|
this.searchViewbox = computed(() => this.bounds() ?? resolveCountryView(this.country()).bounds, /* @ts-ignore */
|
|
@@ -2350,7 +2400,7 @@ class KptMap {
|
|
|
2350
2400
|
/**
|
|
2351
2401
|
* Twarde zawężenie do krajów. Jawne `searchOptions.countryCodes` wygrywa; bez niego
|
|
2352
2402
|
* odcinamy zagranicę dopiero przy `restrictToCountry`, bo tam mapa i tak nie pozwoli
|
|
2353
|
-
* przesunąć widoku poza kraj
|
|
2403
|
+
* przesunąć widoku poza kraj - znaleziony adres byłby nie do pokazania.
|
|
2354
2404
|
*/
|
|
2355
2405
|
this.searchCountryCodes = computed(() => {
|
|
2356
2406
|
const explicit = this.searchOptions().countryCodes;
|
|
@@ -2371,21 +2421,31 @@ class KptMap {
|
|
|
2371
2421
|
};
|
|
2372
2422
|
}, /* @ts-ignore */
|
|
2373
2423
|
...(ngDevMode ? [{ debugName: "createFormApi" }] : /* istanbul ignore next */ []));
|
|
2374
|
-
/** Gotowa referencja dla kontekstu szablonu
|
|
2424
|
+
/** Gotowa referencja dla kontekstu szablonu - szablon nie ma jak zrobić `bind`. */
|
|
2375
2425
|
this.closePopupFn = () => this.closePopup();
|
|
2376
|
-
/** Zasięg wszystkich widocznych lokalizacji
|
|
2426
|
+
/** Zasięg wszystkich widocznych lokalizacji - `null`, gdy nie ma żadnej. */
|
|
2377
2427
|
this.dataBounds = computed(() => boundsOf(this.visibleLocations().map((l) => l.at)), /* @ts-ignore */
|
|
2378
2428
|
...(ngDevMode ? [{ debugName: "dataBounds" }] : /* istanbul ignore next */ []));
|
|
2379
|
-
afterNextRender(() =>
|
|
2380
|
-
|
|
2381
|
-
|
|
2429
|
+
afterNextRender(() => {
|
|
2430
|
+
this.engineInit = this.initEngine().catch((error) => this.reportEngineError(error));
|
|
2431
|
+
});
|
|
2432
|
+
// Zniszczenie w trakcie `init()` trafiłoby w mapę, której jeszcze nie ma, a ta powstałaby potem
|
|
2433
|
+
// na odpiętym kontenerze - dlatego `destroy()` czeka na koniec montażu.
|
|
2434
|
+
this.destroyRef.onDestroy(() => {
|
|
2435
|
+
this.destroyed = true;
|
|
2436
|
+
void this.engineInit.finally(() => {
|
|
2437
|
+
this.mapEngine?.destroy();
|
|
2438
|
+
this.mapEngine = null;
|
|
2439
|
+
});
|
|
2440
|
+
});
|
|
2441
|
+
// Zmiana źródła kafli w locie - bez przeładowania mapy.
|
|
2382
2442
|
effect(() => {
|
|
2383
2443
|
const url = this.tileUrl() ?? KPT_MAP_DEFAULT_TILE_URL;
|
|
2384
2444
|
const attribution = this.attribution() ?? KPT_MAP_DEFAULT_ATTRIBUTION;
|
|
2385
2445
|
if (untracked(this.ready))
|
|
2386
2446
|
this.mapEngine?.setTileSource(url, attribution);
|
|
2387
2447
|
});
|
|
2388
|
-
// Wypychanie znaczników do silnika
|
|
2448
|
+
// Wypychanie znaczników do silnika - jedyne miejsce, które je rysuje.
|
|
2389
2449
|
effect(() => {
|
|
2390
2450
|
const markers = this.markers();
|
|
2391
2451
|
if (this.ready())
|
|
@@ -2405,7 +2465,7 @@ class KptMap {
|
|
|
2405
2465
|
iconSvgInner: this.icons.get('user'),
|
|
2406
2466
|
}));
|
|
2407
2467
|
});
|
|
2408
|
-
// `<dialog>` zamyka się też Esc-em i backdropem
|
|
2468
|
+
// `<dialog>` zamyka się też Esc-em i backdropem - cel czyścimy przy każdym zamknięciu.
|
|
2409
2469
|
effect(() => {
|
|
2410
2470
|
if (!this.createOpen())
|
|
2411
2471
|
untracked(() => this.createFor.set(null));
|
|
@@ -2417,6 +2477,13 @@ class KptMap {
|
|
|
2417
2477
|
return null;
|
|
2418
2478
|
return this.bounds() ?? resolveCountryView(this.country()).bounds;
|
|
2419
2479
|
}
|
|
2480
|
+
reportEngineError(error) {
|
|
2481
|
+
if (this.destroyed)
|
|
2482
|
+
return;
|
|
2483
|
+
// Output bez słuchacza nie zgłosi niczego, a mapa bez silnika to szary prostokąt bez wyjaśnienia.
|
|
2484
|
+
console.error(error);
|
|
2485
|
+
this.engineError.emit(error);
|
|
2486
|
+
}
|
|
2420
2487
|
async initEngine() {
|
|
2421
2488
|
// Wejście wygrywa nad DI: dwie mapy o różnych silnikach na jednej stronie.
|
|
2422
2489
|
const factory = this.engine() ?? this.engineFactory;
|
|
@@ -2437,15 +2504,17 @@ class KptMap {
|
|
|
2437
2504
|
});
|
|
2438
2505
|
}
|
|
2439
2506
|
catch (error) {
|
|
2440
|
-
// Brak paczki `leaflet` to najczęstsza przyczyna
|
|
2507
|
+
// Brak paczki `leaflet` to najczęstsza przyczyna - komunikat niesie instrukcję.
|
|
2441
2508
|
this.mapEngine = null;
|
|
2442
2509
|
throw error;
|
|
2443
2510
|
}
|
|
2511
|
+
if (this.destroyed)
|
|
2512
|
+
return;
|
|
2444
2513
|
// Jawny zasięg wygrywa nad środkiem i zoomem: dopiero teraz znamy rozmiar kontenera.
|
|
2445
2514
|
if (startBounds && !view)
|
|
2446
2515
|
engine.fitBounds(startBounds, FIT_PADDING);
|
|
2447
2516
|
// Leaflet emituje `move` co klatkę przeciągania. Bez popupu i menu nikt tej pozycji
|
|
2448
|
-
// nie czyta, a każdy zapis sygnału planowałby przebieg detekcji zmian
|
|
2517
|
+
// nie czyta, a każdy zapis sygnału planowałby przebieg detekcji zmian - stąd bramka.
|
|
2449
2518
|
engine.on('move', () => {
|
|
2450
2519
|
if (untracked(this.popup) || untracked(this.contextTarget)) {
|
|
2451
2520
|
this.viewportTick.update((t) => t + 1);
|
|
@@ -2512,7 +2581,7 @@ class KptMap {
|
|
|
2512
2581
|
return;
|
|
2513
2582
|
if (isCluster(entry)) {
|
|
2514
2583
|
this.clusterClick.emit(entry);
|
|
2515
|
-
// Grupa punktów o tej samej współrzędnej nie da się rozbić zoomem
|
|
2584
|
+
// Grupa punktów o tej samej współrzędnej nie da się rozbić zoomem - pokaż listę.
|
|
2516
2585
|
if (isSplittable(entry)) {
|
|
2517
2586
|
this.mapEngine?.fitBounds(entry.bounds, FIT_PADDING);
|
|
2518
2587
|
return;
|
|
@@ -2583,7 +2652,7 @@ class KptMap {
|
|
|
2583
2652
|
engine.panBy({ x: dx, y: dy });
|
|
2584
2653
|
}, { injector: this.injector });
|
|
2585
2654
|
}
|
|
2586
|
-
/** Pozycja z grupy nierozdzielalnej
|
|
2655
|
+
/** Pozycja z grupy nierozdzielalnej - przełącza popup bez ruszania mapy. */
|
|
2587
2656
|
selectFromGroup(location) {
|
|
2588
2657
|
const state = this.popup();
|
|
2589
2658
|
this.popup.set({ location, group: state?.group ?? null });
|
|
@@ -2605,13 +2674,13 @@ class KptMap {
|
|
|
2605
2674
|
const target = this.createFor();
|
|
2606
2675
|
if (!target)
|
|
2607
2676
|
return;
|
|
2608
|
-
// Komponent nie dopisuje nic do `locations`
|
|
2677
|
+
// Komponent nie dopisuje nic do `locations` - źródłem prawdy jest aplikacja.
|
|
2609
2678
|
this.locationCreate.emit({ at: target.at, categoryId: target.category.id, value });
|
|
2610
2679
|
this.closeCreate();
|
|
2611
2680
|
}
|
|
2612
2681
|
/**
|
|
2613
2682
|
* Przenosi widok na wybrany wynik. Zasięg (miasto, region) wpasowujemy w kadr,
|
|
2614
|
-
* a pojedynczy punkt dostaje `[searchZoom]`
|
|
2683
|
+
* a pojedynczy punkt dostaje `[searchZoom]` - inaczej każdy adres lądowałby
|
|
2615
2684
|
* w innym przybliżeniu, zależnym od tego, jak dostawca obrysował budynek.
|
|
2616
2685
|
*/
|
|
2617
2686
|
onSearchSelect(result) {
|
|
@@ -2634,7 +2703,7 @@ class KptMap {
|
|
|
2634
2703
|
return;
|
|
2635
2704
|
this.mapEngine.setView(position.at, Math.max(this.mapEngine.getZoom(), 13));
|
|
2636
2705
|
}
|
|
2637
|
-
/** Wraca do widoku startowego
|
|
2706
|
+
/** Wraca do widoku startowego - po zabłądzeniu na drugim końcu świata. */
|
|
2638
2707
|
resetView() {
|
|
2639
2708
|
if (!this.mapEngine)
|
|
2640
2709
|
return;
|
|
@@ -2664,30 +2733,28 @@ class KptMap {
|
|
|
2664
2733
|
} }, hostAttrs: [1, "kpt-map"], hostVars: 3, hostBindings: function KptMap_HostBindings(rf, ctx) { if (rf & 2) {
|
|
2665
2734
|
i0.ɵɵattribute("data-engine", ctx.engineKind());
|
|
2666
2735
|
i0.ɵɵstyleProp("--%NS%kpt-map-height", ctx.height());
|
|
2667
|
-
} }, inputs: { locations: [1, "locations"], categories: [1, "categories"], country: [1, "country"], view: [1, "view"], restrictToCountry: [1, "restrictToCountry"], bounds: [1, "bounds"], cluster: [1, "cluster"], clusterOptions: [1, "clusterOptions"], clusterColorBy: [1, "clusterColorBy"], legend: [1, "legend"], hiddenCategories: [1, "hiddenCategories"], legendCounts: [1, "legendCounts"], showUserLocation: [1, "showUserLocation"], followUser: [1, "followUser"], allowCreate: [1, "allowCreate"], search: [1, "search"], searchPlaceholder: [1, "searchPlaceholder"], searchOptions: [1, "searchOptions"], searchZoom: [1, "searchZoom"], searchMarker: [1, "searchMarker"], popupLayout: [1, "popupLayout"], distanceFrom: [1, "distanceFrom"], height: [1, "height"], tileUrl: [1, "tileUrl"], attribution: [1, "attribution"], engine: [1, "engine"], geocoder: [1, "geocoder"] }, outputs: { hiddenCategories: "hiddenCategoriesChange", locationClick: "locationClick", clusterClick: "clusterClick", locationCreate: "locationCreate", searchSelect: "searchSelect", viewChange: "viewChange", userPositionChange: "userPositionChange", userLocationError: "userLocationError" }, decls:
|
|
2736
|
+
} }, inputs: { locations: [1, "locations"], categories: [1, "categories"], country: [1, "country"], view: [1, "view"], restrictToCountry: [1, "restrictToCountry"], bounds: [1, "bounds"], cluster: [1, "cluster"], clusterOptions: [1, "clusterOptions"], clusterColorBy: [1, "clusterColorBy"], legend: [1, "legend"], hiddenCategories: [1, "hiddenCategories"], legendCounts: [1, "legendCounts"], showUserLocation: [1, "showUserLocation"], followUser: [1, "followUser"], allowCreate: [1, "allowCreate"], search: [1, "search"], searchPlaceholder: [1, "searchPlaceholder"], searchOptions: [1, "searchOptions"], searchZoom: [1, "searchZoom"], searchMarker: [1, "searchMarker"], searchSpeech: [1, "searchSpeech"], searchSpeechLang: [1, "searchSpeechLang"], searchSpeechColor: [1, "searchSpeechColor"], popupLayout: [1, "popupLayout"], distanceFrom: [1, "distanceFrom"], height: [1, "height"], tileUrl: [1, "tileUrl"], attribution: [1, "attribution"], engine: [1, "engine"], geocoder: [1, "geocoder"] }, outputs: { hiddenCategories: "hiddenCategoriesChange", locationClick: "locationClick", clusterClick: "clusterClick", locationCreate: "locationCreate", searchSelect: "searchSelect", viewChange: "viewChange", userPositionChange: "userPositionChange", userLocationError: "userLocationError", engineError: "engineError" }, decls: 15, vars: 15, consts: [["canvas", ""], ["popupEl", ""], [1, "kpt-map__viewport"], [1, "kpt-map__canvas"], ["role", "group", 1, "kpt-map__controls"], ["type", "button", 1, "kpt-map__control", 3, "click", "title", "disabled"], ["name", "plus"], ["name", "minus"], ["type", "button", 1, "kpt-map__control", "kpt-map__control--locate", 3, "title", "disabled"], [1, "kpt-map__search"], [1, "kpt-map__legend", 3, "categories", "hidden", "counts"], [3, "openChange", "open", "header"], ["type", "button", 1, "kpt-map__control", "kpt-map__control--locate", 3, "click", "title", "disabled"], ["aria-hidden", "true", 1, "kpt-map__crosshair"], [3, "selected", "cleared", "geocoder", "placeholder", "minLength", "debounce", "limit", "viewbox", "countryCodes", "speech", "speechLang", "speechColor"], ["role", "menu", 1, "kpt-map__context", 3, "--%NS%_kpt-map-x", "--%NS%_kpt-map-y"], ["role", "menu", 1, "kpt-map__context"], [1, "kpt-map__context-title"], ["type", "button", "role", "menuitem", 1, "kpt-map__context-item"], [1, "kpt-map__context-empty"], ["type", "button", "role", "menuitem", 1, "kpt-map__context-item", 3, "click"], ["aria-hidden", "true", 1, "kpt-map__context-dot"], ["role", "dialog", 1, "kpt-map__popup", 3, "--%NS%_kpt-map-x", "--%NS%_kpt-map-y"], ["role", "dialog", 1, "kpt-map__popup"], ["type", "button", 1, "kpt-map__popup-close"], [1, "kpt-map__popup-body"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], ["type", "button", 1, "kpt-map__popup-close", 3, "click"], ["aria-hidden", "true"], [1, "kpt-map__popup-group"], ["role", "tablist", 1, "kpt-map__popup-tabs"], ["type", "button", "role", "tab", 1, "kpt-map__popup-tab"], ["type", "button", "role", "tab", 1, "kpt-map__popup-tab", 3, "click"], [1, "kpt-map__popup-title"], [1, "kpt-map__popup-category"], [1, "kpt-map__legend", 3, "hiddenChange", "categories", "hidden", "counts"], [3, "geocoder", "category", "at"], [3, "save", "cancelled", "geocoder", "category", "at"]], template: function KptMap_Template(rf, ctx) { if (rf & 1) {
|
|
2668
2737
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
2669
2738
|
i0.ɵɵelementStart(0, "div", 2);
|
|
2670
2739
|
i0.ɵɵelement(1, "div", 3, 0);
|
|
2671
2740
|
i0.ɵɵelementStart(3, "div", 4)(4, "button", 5);
|
|
2672
2741
|
i0.ɵɵlistener("click", function KptMap_Template_button_click_4_listener() { return ctx.zoomBy(1); });
|
|
2673
|
-
i0.ɵɵ
|
|
2674
|
-
i0.ɵɵ
|
|
2675
|
-
i0.ɵɵ
|
|
2676
|
-
i0.ɵɵ
|
|
2677
|
-
i0.ɵɵ
|
|
2678
|
-
i0.ɵɵ
|
|
2679
|
-
i0.ɵɵ
|
|
2680
|
-
i0.ɵɵelementEnd()();
|
|
2681
|
-
i0.ɵɵconditionalCreate(10, KptMap_Conditional_10_Template, 2, 3, "button", 7);
|
|
2742
|
+
i0.ɵɵelement(5, "kpt-icon", 6);
|
|
2743
|
+
i0.ɵɵelementEnd();
|
|
2744
|
+
i0.ɵɵelementStart(6, "button", 5);
|
|
2745
|
+
i0.ɵɵlistener("click", function KptMap_Template_button_click_6_listener() { return ctx.zoomBy(-1); });
|
|
2746
|
+
i0.ɵɵelement(7, "kpt-icon", 7);
|
|
2747
|
+
i0.ɵɵelementEnd();
|
|
2748
|
+
i0.ɵɵconditionalCreate(8, KptMap_Conditional_8_Template, 2, 3, "button", 8);
|
|
2682
2749
|
i0.ɵɵelementEnd();
|
|
2683
|
-
i0.ɵɵconditionalCreate(
|
|
2684
|
-
i0.ɵɵconditionalCreate(
|
|
2685
|
-
i0.ɵɵconditionalCreate(
|
|
2750
|
+
i0.ɵɵconditionalCreate(9, KptMap_Conditional_9_Template, 2, 10, "div", 9);
|
|
2751
|
+
i0.ɵɵconditionalCreate(10, KptMap_Conditional_10_Template, 1, 1);
|
|
2752
|
+
i0.ɵɵconditionalCreate(11, KptMap_Conditional_11_Template, 1, 1);
|
|
2686
2753
|
i0.ɵɵelementEnd();
|
|
2687
|
-
i0.ɵɵconditionalCreate(
|
|
2688
|
-
i0.ɵɵelementStart(
|
|
2689
|
-
i0.ɵɵtwoWayListener("openChange", function
|
|
2690
|
-
i0.ɵɵconditionalCreate(
|
|
2754
|
+
i0.ɵɵconditionalCreate(12, KptMap_Conditional_12_Template, 1, 3, "kpt-map-legend", 10);
|
|
2755
|
+
i0.ɵɵelementStart(13, "kpt-dialog", 11);
|
|
2756
|
+
i0.ɵɵtwoWayListener("openChange", function KptMap_Template_kpt_dialog_openChange_13_listener($event) { i0.ɵɵrestoreView(_r1); i0.ɵɵtwoWayBindingSet(ctx.createOpen, $event) || (ctx.createOpen = $event); return i0.ɵɵresetView($event); });
|
|
2757
|
+
i0.ɵɵconditionalCreate(14, KptMap_Conditional_14_Template, 2, 1);
|
|
2691
2758
|
i0.ɵɵelementEnd();
|
|
2692
2759
|
} if (rf & 2) {
|
|
2693
2760
|
let tmp_11_0;
|
|
@@ -2697,34 +2764,34 @@ class KptMap {
|
|
|
2697
2764
|
i0.ɵɵadvance();
|
|
2698
2765
|
i0.ɵɵproperty("title", ctx.i18n.t("map.zoomIn"))("disabled", !ctx.ready());
|
|
2699
2766
|
i0.ɵɵattribute("aria-label", ctx.i18n.t("map.zoomIn"));
|
|
2700
|
-
i0.ɵɵadvance(
|
|
2767
|
+
i0.ɵɵadvance(2);
|
|
2701
2768
|
i0.ɵɵproperty("title", ctx.i18n.t("map.zoomOut"))("disabled", !ctx.ready());
|
|
2702
2769
|
i0.ɵɵattribute("aria-label", ctx.i18n.t("map.zoomOut"));
|
|
2703
|
-
i0.ɵɵadvance(
|
|
2704
|
-
i0.ɵɵconditional(ctx.showUserLocation() ?
|
|
2770
|
+
i0.ɵɵadvance(2);
|
|
2771
|
+
i0.ɵɵconditional(ctx.showUserLocation() ? 8 : -1);
|
|
2705
2772
|
i0.ɵɵadvance();
|
|
2706
|
-
i0.ɵɵconditional(ctx.searchEnabled() ?
|
|
2773
|
+
i0.ɵɵconditional(ctx.searchEnabled() ? 9 : -1);
|
|
2707
2774
|
i0.ɵɵadvance();
|
|
2708
|
-
i0.ɵɵconditional(ctx.allowCreate() && ctx.contextTarget() ?
|
|
2775
|
+
i0.ɵɵconditional(ctx.allowCreate() && ctx.contextTarget() ? 10 : -1);
|
|
2709
2776
|
i0.ɵɵadvance();
|
|
2710
|
-
i0.ɵɵconditional((tmp_11_0 = ctx.popup()) ?
|
|
2777
|
+
i0.ɵɵconditional((tmp_11_0 = ctx.popup()) ? 11 : -1, tmp_11_0);
|
|
2711
2778
|
i0.ɵɵadvance();
|
|
2712
|
-
i0.ɵɵconditional(ctx.legend() ?
|
|
2779
|
+
i0.ɵɵconditional(ctx.legend() ? 12 : -1);
|
|
2713
2780
|
i0.ɵɵadvance();
|
|
2714
2781
|
i0.ɵɵtwoWayProperty("open", ctx.createOpen);
|
|
2715
2782
|
i0.ɵɵproperty("header", ctx.i18n.t("map.addLocation"));
|
|
2716
2783
|
i0.ɵɵadvance();
|
|
2717
|
-
i0.ɵɵconditional((tmp_15_0 = ctx.createFor()) ?
|
|
2718
|
-
} }, dependencies: [NgTemplateOutlet, KptDialog, KptMapLegend, KptMapSearch, KptMapCreateDialog], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map{--%NS%kpt-map-height: 480px;display:flex;flex-direction:column;gap:var(--%NS%kpt-space-3);width:100%;isolation:isolate}.kpt-map__viewport{position:relative;height:var(--%NS%kpt-map-height);overflow:hidden;background:var(--%NS%kpt-map-bg, var(--%NS%kpt-color-surface-sunken));border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-map-border, var(--%NS%kpt-color-border));border-radius:var(--%NS%kpt-map-radius, var(--%NS%kpt-radius-lg))}.kpt-map__canvas{width:100%;height:100%}.kpt-map__controls{position:absolute;top:var(--%NS%kpt-space-3);left:var(--%NS%kpt-space-3);z-index:2;display:flex;flex-direction:column;gap:var(--%NS%kpt-space-1)}.kpt-map__control{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:var(--%NS%kpt-font-size-lg);line-height:1;color:var(--%NS%kpt-color-on-surface);cursor:pointer;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map__control:hover:not(:disabled){background:var(--%NS%kpt-color-surface-hover)}.kpt-map__control:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:2px}.kpt-map__control:disabled{color:var(--%NS%kpt-color-on-surface-muted);cursor:not-allowed;opacity:.6}.kpt-map__search{position:absolute;top:var(--%NS%kpt-space-3);right:var(--%NS%kpt-space-3);z-index:5;max-width:calc(100% - 2rem - var(--%NS%kpt-space-3) * 3)}.kpt-map__crosshair{position:relative;width:.875rem;height:.875rem;border:var(--%NS%kpt-border-width-medium) solid currentcolor;border-radius:var(--%NS%kpt-radius-full)}.kpt-map__crosshair:after{position:absolute;inset:50% auto auto 50%;width:.25rem;height:.25rem;content:\"\";background:currentcolor;border-radius:var(--%NS%kpt-radius-full);translate:-50% -50%}.kpt-map__marker{position:relative;display:block;width:100%;height:100%;color:var(--%NS%_kpt-map-marker-fg, var(--%NS%kpt-color-text-inverse))}.kpt-map__marker-shape{display:block;width:100%;height:100%;fill:var(--%NS%_kpt-map-marker-bg, var(--%NS%kpt-color-muted));stroke:var(--%NS%kpt-color-surface-raised);stroke-width:1.5;filter:drop-shadow(0 1px 2px rgba(0,0,0,.25))}.kpt-map__marker-glyph{position:absolute;display:grid;place-items:center;font-size:.875rem}.kpt-map__marker-glyph svg{width:1em;height:1em}.kpt-map__marker--pin .kpt-map__marker-glyph{inset:0 0 auto;height:76%}.kpt-map__marker--dot,.kpt-map__marker--square{display:grid;place-items:center;background:var(--%NS%_kpt-map-marker-bg, var(--%NS%kpt-color-muted));border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map__marker--dot{border-radius:var(--%NS%kpt-radius-full)}.kpt-map__marker--square{border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__marker--dot .kpt-map__marker-glyph,.kpt-map__marker--square .kpt-map__marker-glyph{position:static}.kpt-map__marker--selected{z-index:1}.kpt-map__marker--selected .kpt-map__marker-shape{stroke:var(--%NS%kpt-color-focus-ring);stroke-width:2.5}.kpt-map__cluster{display:grid;place-items:center;width:100%;height:100%;font-weight:var(--%NS%kpt-font-weight-semibold);font-variant-numeric:tabular-nums;color:var(--%NS%_kpt-map-cluster-fg, var(--%NS%kpt-color-primary-contrast));background:var(--%NS%_kpt-map-cluster-bg, var(--%NS%kpt-map-cluster-bg, var(--%NS%kpt-color-primary)));border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);border-radius:var(--%NS%kpt-radius-full);box-shadow:var(--%NS%kpt-elevation-2)}.kpt-map__cluster--sm{font-size:var(--%NS%kpt-font-size-xs);scale:.78}.kpt-map__cluster--md{font-size:var(--%NS%kpt-font-size-sm);scale:.9}.kpt-map__cluster--lg{font-size:var(--%NS%kpt-font-size-sm);scale:1}.kpt-map__user-marker{display:grid;place-items:center;width:100%;height:100%;font-size:.875rem;color:var(--%NS%kpt-color-info-contrast);background:var(--%NS%kpt-color-info);border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);border-radius:var(--%NS%kpt-radius-full);box-shadow:var(--%NS%kpt-elevation-2)}.kpt-map__user-marker svg{width:1em;height:1em}.kpt-map__popup{position:absolute;top:var(--%NS%_kpt-map-y, 0);left:var(--%NS%_kpt-map-x, 0);z-index:3;max-width:min(var(--%NS%kpt-map-popup-width, 20rem),100% - var(--%NS%kpt-space-6));padding:var(--%NS%kpt-space-4);color:var(--%NS%kpt-color-on-surface);background:var(--%NS%kpt-map-popup-bg, var(--%NS%kpt-color-surface-raised));border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-lg);box-shadow:var(--%NS%kpt-map-popup-shadow, var(--%NS%kpt-elevation-3));translate:-50% calc(-100% - var(--%NS%kpt-space-3))}.kpt-map__popup:after{position:absolute;top:100%;left:50%;width:.75rem;height:.75rem;content:\"\";background:inherit;border-right:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-bottom:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);rotate:45deg;translate:-50% -50%}.kpt-map__popup[data-layout=card]{max-width:min(var(--%NS%kpt-map-popup-width-card, 26rem),100% - var(--%NS%kpt-space-6));width:min(var(--%NS%kpt-map-popup-width-card, 26rem),100% - var(--%NS%kpt-space-6));max-height:min(var(--%NS%kpt-map-popup-max-height, 32rem),100% - var(--%NS%kpt-space-8));padding:0;display:flex;flex-direction:column}.kpt-map__popup[data-layout=card] .kpt-map__popup-body{display:flex;min-height:0;padding:0;overflow:hidden}.kpt-map__popup[data-layout=card] .kpt-map__popup-body>*{flex:1 1 auto;min-height:0}.kpt-map__popup[data-layout=card] .kpt-map__popup-group,.kpt-map__popup[data-layout=card] .kpt-map__popup-tabs{margin-inline:var(--%NS%kpt-space-4)}.kpt-map__popup[data-layout=card] .kpt-map__popup-group{margin-top:var(--%NS%kpt-space-3)}.kpt-map__popup-close{position:absolute;top:var(--%NS%kpt-space-2);right:var(--%NS%kpt-space-2);display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--%NS%kpt-font-size-lg);line-height:1;color:var(--%NS%kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-full)}.kpt-map__popup-close:hover{background:var(--%NS%kpt-color-surface-hover)}.kpt-map__popup-close:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map__popup-body{padding-right:var(--%NS%kpt-space-5);font-size:var(--%NS%kpt-font-size-sm)}.kpt-map__popup-body p{margin:0 0 var(--%NS%kpt-space-1)}.kpt-map__popup-title{display:block;margin-bottom:var(--%NS%kpt-space-1);font-size:var(--%NS%kpt-font-size-base)}.kpt-map__popup-category{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__popup-group{margin:0 var(--%NS%kpt-space-5) var(--%NS%kpt-space-2) 0;font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted);text-transform:uppercase}.kpt-map__popup-tabs{display:flex;flex-wrap:wrap;gap:var(--%NS%kpt-space-1);margin-bottom:var(--%NS%kpt-space-2)}.kpt-map__popup-tab{padding:var(--%NS%kpt-space-1) var(--%NS%kpt-space-2);font:inherit;font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface);cursor:pointer;background:var(--%NS%kpt-color-surface-variant);border:var(--%NS%kpt-border-width-thin) solid transparent;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__popup-tab[aria-selected=true]{background:var(--%NS%kpt-color-surface-selected);border-color:var(--%NS%kpt-color-border-strong)}.kpt-map__popup-tab:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map__context{position:absolute;top:var(--%NS%_kpt-map-y, 0);left:var(--%NS%_kpt-map-x, 0);z-index:4;min-width:12rem;padding:var(--%NS%kpt-space-2);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-map__context-title{margin:0 0 var(--%NS%kpt-space-1);padding:0 var(--%NS%kpt-space-2);font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__context-item{display:flex;gap:var(--%NS%kpt-space-2);align-items:center;width:100%;padding:var(--%NS%kpt-space-2);font:inherit;font-size:var(--%NS%kpt-font-size-sm);color:var(--%NS%kpt-color-on-surface);text-align:start;cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__context-item:hover{background:var(--%NS%kpt-color-surface-hover)}.kpt-map__context-item:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:-2px}.kpt-map__context-empty{margin:0;padding:var(--%NS%kpt-space-2);font-size:var(--%NS%kpt-font-size-sm);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__context-dot{width:.5rem;height:.5rem;background:var(--%NS%kpt-color-border-strong);border-radius:var(--%NS%kpt-radius-full)}.kpt-map[data-engine=google] .kpt-map__accuracy{background:color-mix(in oklch,var(--%NS%kpt-color-info) 15%,transparent);border:var(--%NS%kpt-border-width-thin) solid color-mix(in oklch,var(--%NS%kpt-color-info) 50%,transparent)}}.kpt-map .leaflet-container{font-family:var(--%NS%kpt-font-family-sans);font-size:var(--%NS%kpt-font-size-sm);background:var(--%NS%kpt-color-surface-sunken);z-index:0}.kpt-map .leaflet-div-icon,.kpt-map .kpt-map__icon{background:transparent;border:none}.kpt-map .leaflet-control-attribution{padding:0 var(--%NS%kpt-space-1);font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted);background:color-mix(in oklch,var(--%NS%kpt-color-surface-raised) 85%,transparent)}.kpt-map .leaflet-control-attribution a{color:var(--%NS%kpt-color-primary)}.kpt-map .kpt-map__accuracy{fill:var(--%NS%kpt-color-info);fill-opacity:.15;stroke:var(--%NS%kpt-color-info);stroke-opacity:.5}.kpt-map .leaflet-popup-content-wrapper,.kpt-map .leaflet-popup-tip{display:none}\n"], encapsulation: 2 }); }
|
|
2784
|
+
i0.ɵɵconditional((tmp_15_0 = ctx.createFor()) ? 14 : -1, tmp_15_0);
|
|
2785
|
+
} }, dependencies: [NgTemplateOutlet, KptDialog, KptIcon, KptMapLegend, KptMapSearch, KptMapCreateDialog], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map{--%NS%kpt-map-height: 480px;display:flex;flex-direction:column;gap:var(--%NS%kpt-space-3);width:100%;isolation:isolate}.kpt-map__viewport{position:relative;height:var(--%NS%kpt-map-height);overflow:hidden;background:var(--%NS%kpt-map-bg, var(--%NS%kpt-color-surface-sunken));border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-map-border, var(--%NS%kpt-color-border));border-radius:var(--%NS%kpt-map-radius, var(--%NS%kpt-radius-lg))}.kpt-map__canvas{width:100%;height:100%}.kpt-map__controls{position:absolute;top:var(--%NS%kpt-space-3);left:var(--%NS%kpt-space-3);z-index:2;display:flex;flex-direction:column;gap:var(--%NS%kpt-space-1)}.kpt-map__control{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:var(--%NS%kpt-font-size-lg);line-height:1;color:var(--%NS%kpt-color-on-surface);cursor:pointer;background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map__control:hover:not(:disabled){background:var(--%NS%kpt-color-surface-hover)}.kpt-map__control:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:2px}.kpt-map__control:disabled{color:var(--%NS%kpt-color-on-surface-muted);cursor:not-allowed;opacity:.6}.kpt-map__search{position:absolute;top:var(--%NS%kpt-space-3);right:var(--%NS%kpt-space-3);z-index:5;max-width:calc(100% - 2rem - var(--%NS%kpt-space-3) * 3)}.kpt-map__crosshair{position:relative;width:.875rem;height:.875rem;border:var(--%NS%kpt-border-width-medium) solid currentcolor;border-radius:var(--%NS%kpt-radius-full)}.kpt-map__crosshair:after{position:absolute;inset:50% auto auto 50%;width:.25rem;height:.25rem;content:\"\";background:currentcolor;border-radius:var(--%NS%kpt-radius-full);translate:-50% -50%}.kpt-map__marker{position:relative;display:block;width:100%;height:100%;color:var(--%NS%_kpt-map-marker-fg, var(--%NS%kpt-color-text-inverse))}.kpt-map__marker-shape{display:block;width:100%;height:100%;fill:var(--%NS%_kpt-map-marker-bg, var(--%NS%kpt-color-muted));stroke:var(--%NS%kpt-color-surface-raised);stroke-width:1.5;filter:drop-shadow(0 1px 2px rgba(0,0,0,.25))}.kpt-map__marker-glyph{position:absolute;display:grid;place-items:center;font-size:.875rem}.kpt-map__marker-glyph svg{width:1em;height:1em}.kpt-map__marker--pin .kpt-map__marker-glyph{inset:0 0 auto;height:76%}.kpt-map__marker--dot,.kpt-map__marker--square{display:grid;place-items:center;background:var(--%NS%_kpt-map-marker-bg, var(--%NS%kpt-color-muted));border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);box-shadow:var(--%NS%kpt-elevation-1)}.kpt-map__marker--dot{border-radius:var(--%NS%kpt-radius-full)}.kpt-map__marker--square{border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__marker--dot .kpt-map__marker-glyph,.kpt-map__marker--square .kpt-map__marker-glyph{position:static}.kpt-map__marker--selected{z-index:1}.kpt-map__marker--selected .kpt-map__marker-shape{stroke:var(--%NS%kpt-color-focus-ring);stroke-width:2.5}.kpt-map__cluster{display:grid;place-items:center;width:100%;height:100%;font-weight:var(--%NS%kpt-font-weight-semibold);font-variant-numeric:tabular-nums;color:var(--%NS%_kpt-map-cluster-fg, var(--%NS%kpt-color-primary-contrast));background:var(--%NS%_kpt-map-cluster-bg, var(--%NS%kpt-map-cluster-bg, var(--%NS%kpt-color-primary)));border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);border-radius:var(--%NS%kpt-radius-full);box-shadow:var(--%NS%kpt-elevation-2)}.kpt-map__cluster--sm{font-size:var(--%NS%kpt-font-size-xs);scale:.78}.kpt-map__cluster--md{font-size:var(--%NS%kpt-font-size-sm);scale:.9}.kpt-map__cluster--lg{font-size:var(--%NS%kpt-font-size-sm);scale:1}.kpt-map__user-marker{display:grid;place-items:center;width:100%;height:100%;font-size:.875rem;color:var(--%NS%kpt-color-info-contrast);background:var(--%NS%kpt-color-info);border:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-surface-raised);border-radius:var(--%NS%kpt-radius-full);box-shadow:var(--%NS%kpt-elevation-2)}.kpt-map__user-marker svg{width:1em;height:1em}.kpt-map__popup{position:absolute;top:var(--%NS%_kpt-map-y, 0);left:var(--%NS%_kpt-map-x, 0);z-index:3;max-width:min(var(--%NS%kpt-map-popup-width, 20rem),100% - var(--%NS%kpt-space-6));padding:var(--%NS%kpt-space-4);color:var(--%NS%kpt-color-on-surface);background:var(--%NS%kpt-map-popup-bg, var(--%NS%kpt-color-surface-raised));border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-lg);box-shadow:var(--%NS%kpt-map-popup-shadow, var(--%NS%kpt-elevation-3));translate:-50% calc(-100% - var(--%NS%kpt-space-3))}.kpt-map__popup:after{position:absolute;top:100%;left:50%;width:.75rem;height:.75rem;content:\"\";background:inherit;border-right:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-bottom:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);rotate:45deg;translate:-50% -50%}.kpt-map__popup[data-layout=card]{max-width:min(var(--%NS%kpt-map-popup-width-card, 26rem),100% - var(--%NS%kpt-space-6));width:min(var(--%NS%kpt-map-popup-width-card, 26rem),100% - var(--%NS%kpt-space-6));max-height:min(var(--%NS%kpt-map-popup-max-height, 32rem),100% - var(--%NS%kpt-space-8));padding:0;display:flex;flex-direction:column}.kpt-map__popup[data-layout=card] .kpt-map__popup-body{display:flex;min-height:0;padding:0;overflow:hidden}.kpt-map__popup[data-layout=card] .kpt-map__popup-body>*{flex:1 1 auto;min-height:0}.kpt-map__popup[data-layout=card] .kpt-map__popup-group,.kpt-map__popup[data-layout=card] .kpt-map__popup-tabs{margin-inline:var(--%NS%kpt-space-4)}.kpt-map__popup[data-layout=card] .kpt-map__popup-group{margin-top:var(--%NS%kpt-space-3)}.kpt-map__popup-close{position:absolute;top:var(--%NS%kpt-space-2);right:var(--%NS%kpt-space-2);display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--%NS%kpt-font-size-lg);line-height:1;color:var(--%NS%kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-full)}.kpt-map__popup-close:hover{background:var(--%NS%kpt-color-surface-hover)}.kpt-map__popup-close:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map__popup-body{padding-right:var(--%NS%kpt-space-5);font-size:var(--%NS%kpt-font-size-sm)}.kpt-map__popup-body p{margin:0 0 var(--%NS%kpt-space-1)}.kpt-map__popup-title{display:block;margin-bottom:var(--%NS%kpt-space-1);font-size:var(--%NS%kpt-font-size-base)}.kpt-map__popup-category{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__popup-group{margin:0 var(--%NS%kpt-space-5) var(--%NS%kpt-space-2) 0;font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted);text-transform:uppercase}.kpt-map__popup-tabs{display:flex;flex-wrap:wrap;gap:var(--%NS%kpt-space-1);margin-bottom:var(--%NS%kpt-space-2)}.kpt-map__popup-tab{padding:var(--%NS%kpt-space-1) var(--%NS%kpt-space-2);font:inherit;font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface);cursor:pointer;background:var(--%NS%kpt-color-surface-variant);border:var(--%NS%kpt-border-width-thin) solid transparent;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__popup-tab[aria-selected=true]{background:var(--%NS%kpt-color-surface-selected);border-color:var(--%NS%kpt-color-border-strong)}.kpt-map__popup-tab:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}.kpt-map__context{position:absolute;top:var(--%NS%_kpt-map-y, 0);left:var(--%NS%_kpt-map-x, 0);z-index:4;min-width:12rem;padding:var(--%NS%kpt-space-2);background:var(--%NS%kpt-color-surface-raised);border:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-md);box-shadow:var(--%NS%kpt-elevation-3)}.kpt-map__context-title{margin:0 0 var(--%NS%kpt-space-1);padding:0 var(--%NS%kpt-space-2);font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__context-item{display:flex;gap:var(--%NS%kpt-space-2);align-items:center;width:100%;padding:var(--%NS%kpt-space-2);font:inherit;font-size:var(--%NS%kpt-font-size-sm);color:var(--%NS%kpt-color-on-surface);text-align:start;cursor:pointer;background:transparent;border:none;border-radius:var(--%NS%kpt-radius-sm)}.kpt-map__context-item:hover{background:var(--%NS%kpt-color-surface-hover)}.kpt-map__context-item:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:-2px}.kpt-map__context-empty{margin:0;padding:var(--%NS%kpt-space-2);font-size:var(--%NS%kpt-font-size-sm);color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map__context-dot{width:.5rem;height:.5rem;background:var(--%NS%kpt-color-border-strong);border-radius:var(--%NS%kpt-radius-full)}.kpt-map[data-engine=google] .kpt-map__accuracy{background:color-mix(in oklch,var(--%NS%kpt-color-info) 15%,transparent);border:var(--%NS%kpt-border-width-thin) solid color-mix(in oklch,var(--%NS%kpt-color-info) 50%,transparent)}}.kpt-map .leaflet-container{font-family:var(--%NS%kpt-font-family-sans);font-size:var(--%NS%kpt-font-size-sm);background:var(--%NS%kpt-color-surface-sunken);z-index:0}.kpt-map .leaflet-div-icon,.kpt-map .kpt-map__icon{background:transparent;border:none}.kpt-map .leaflet-control-attribution{padding:0 var(--%NS%kpt-space-1);font-size:var(--%NS%kpt-font-size-xs);color:var(--%NS%kpt-color-on-surface-muted);background:color-mix(in oklch,var(--%NS%kpt-color-surface-raised) 85%,transparent)}.kpt-map .leaflet-control-attribution a{color:var(--%NS%kpt-color-primary)}.kpt-map .kpt-map__accuracy{fill:var(--%NS%kpt-color-info);fill-opacity:.15;stroke:var(--%NS%kpt-color-info);stroke-opacity:.5}.kpt-map .leaflet-popup-content-wrapper,.kpt-map .leaflet-popup-tip{display:none}\n"], encapsulation: 2 }); }
|
|
2719
2786
|
}
|
|
2720
2787
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptMap, [{
|
|
2721
2788
|
type: Component,
|
|
2722
|
-
args: [{ selector: 'kpt-map', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet, KptDialog, KptMapLegend, KptMapSearch, KptMapCreateDialog], host: {
|
|
2789
|
+
args: [{ selector: 'kpt-map', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet, KptDialog, KptIcon, KptMapLegend, KptMapSearch, KptMapCreateDialog], host: {
|
|
2723
2790
|
class: 'kpt-map',
|
|
2724
2791
|
'[style.--kpt-map-height]': 'height()',
|
|
2725
2792
|
'[attr.data-engine]': 'engineKind()',
|
|
2726
|
-
}, template: "<div class=\"kpt-map__viewport\">\n <!-- Kontener silnika. Wszystko poni\u017Cej to warstwa Angulara rozpi\u0119ta nad map\u0105. -->\n <div #canvas class=\"kpt-map__canvas\"></div>\n\n <div class=\"kpt-map__controls\" role=\"group\" [attr.aria-label]=\"i18n.t('map.legend')\">\n <button\n class=\"kpt-map__control\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.zoomIn')\"\n [title]=\"i18n.t('map.zoomIn')\"\n [disabled]=\"!ready()\"\n (click)=\"zoomBy(1)\"\n >\n <span aria-hidden=\"true\">+</span>\n </button>\n <button\n class=\"kpt-map__control\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.zoomOut')\"\n [title]=\"i18n.t('map.zoomOut')\"\n [disabled]=\"!ready()\"\n (click)=\"zoomBy(-1)\"\n >\n <span aria-hidden=\"true\">\u2212</span>\n </button>\n @if (showUserLocation()) {\n <button\n class=\"kpt-map__control kpt-map__control--locate\"\n type=\"button\"\n [attr.aria-label]=\"locationBlocked() ? i18n.t('map.locationDenied') : i18n.t('map.locateMe')\"\n [title]=\"locationBlocked() ? i18n.t('map.locationDenied') : i18n.t('map.locateMe')\"\n [disabled]=\"!userPosition()\"\n (click)=\"centreOnUser()\"\n >\n <span class=\"kpt-map__crosshair\" aria-hidden=\"true\"></span>\n </button>\n }\n </div>\n\n <!--\n Wyszukiwarka adres\u00F3w. Renderowana tylko wtedy, gdy port ma czym szuka\u0107.\n\n Pozycjonuje j\u0105 OPAKOWANIE, a nie klasa postawiona wprost na <kpt-map-search> \u2014\n pow\u00F3d stoi przy regule .kpt-map__search w map.component.scss.\n -->\n @if (searchEnabled()) {\n <div class=\"kpt-map__search\">\n <kpt-map-search\n [geocoder]=\"activeGeocoder()\"\n [placeholder]=\"searchPlaceholder()\"\n [minLength]=\"searchOptions().minLength ?? 3\"\n [debounce]=\"searchOptions().debounce ?? 300\"\n [limit]=\"searchOptions().limit ?? 5\"\n [viewbox]=\"searchViewbox()\"\n [countryCodes]=\"searchCountryCodes()\"\n (selected)=\"onSearchSelect($event)\"\n (cleared)=\"clearSearchPin()\"\n />\n </div>\n }\n\n <!-- Menu pod prawym przyciskiem: wyb\u00F3r kategorii nowej lokalizacji. -->\n @if (allowCreate() && contextTarget()) {\n @if (contextPosition(); as position) {\n <div\n class=\"kpt-map__context\"\n role=\"menu\"\n [attr.aria-label]=\"i18n.t('map.addLocation')\"\n [style.--_kpt-map-x.px]=\"position.x\"\n [style.--_kpt-map-y.px]=\"position.y\"\n >\n <p class=\"kpt-map__context-title\">{{ i18n.t('map.chooseCategory') }}</p>\n @for (category of creatableCategories(); track category.id) {\n <button class=\"kpt-map__context-item\" type=\"button\" role=\"menuitem\" (click)=\"startCreate(category)\">\n <span class=\"kpt-map__context-dot\" aria-hidden=\"true\"></span>\n {{ category.label }}\n </button>\n } @empty {\n <p class=\"kpt-map__context-empty\">{{ i18n.t('map.empty') }}</p>\n }\n </div>\n }\n }\n\n <!-- Popup szczeg\u00F3\u0142\u00F3w. Renderowany przez Angulara, pozycjonowany z engine.project(). -->\n @if (popup(); as state) {\n @if (popupPosition(); as position) {\n <div\n #popupEl\n class=\"kpt-map__popup\"\n role=\"dialog\"\n [attr.data-layout]=\"popupLayout()\"\n [attr.aria-label]=\"state.location.title\"\n [style.--_kpt-map-x.px]=\"position.x\"\n [style.--_kpt-map-y.px]=\"position.y\"\n >\n <!-- W wariancie `card` krzy\u017Cyk daje karta, wi\u0119c wbudowany by\u0142by drugim. -->\n @if (popupLayout() === 'plain') {\n <button\n class=\"kpt-map__popup-close\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('common.close')\"\n (click)=\"closePopup()\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n }\n\n @if (state.group) {\n <!-- Grupa punkt\u00F3w o tej samej wsp\u00F3\u0142rz\u0119dnej \u2014 zoom jej nie rozdzieli. -->\n <p class=\"kpt-map__popup-group\">{{ i18n.t('map.clusterItems') }}</p>\n <div class=\"kpt-map__popup-tabs\" role=\"tablist\">\n @for (item of state.group.items; track item.id) {\n <button\n class=\"kpt-map__popup-tab\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"item.id === state.location.id\"\n (click)=\"selectFromGroup(item)\"\n >\n {{ item.title }}\n </button>\n }\n </div>\n }\n\n <div class=\"kpt-map__popup-body\">\n @if (popupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: state.location,\n data: state.location.data,\n category: popupCategory(),\n distance: popupDistance(),\n close: closePopupFn\n }\"\n />\n } @else {\n <strong class=\"kpt-map__popup-title\">{{ state.location.title }}</strong>\n @if (popupCategory(); as category) {\n <p class=\"kpt-map__popup-category\">{{ category.label }}</p>\n }\n }\n </div>\n </div>\n }\n }\n</div>\n\n@if (legend()) {\n <kpt-map-legend\n class=\"kpt-map__legend\"\n [categories]=\"categories()\"\n [(hidden)]=\"hiddenCategories\"\n [counts]=\"counts()\"\n />\n}\n\n<!-- Dialog dodawania: schema z kategorii, a w\u0142asny szablon ma pierwsze\u0144stwo. -->\n<kpt-dialog [(open)]=\"createOpen\" [header]=\"i18n.t('map.addLocation')\">\n @if (createFor(); as target) {\n @if (createFormTemplate(); as tpl) {\n @if (createFormApi(); as api) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: api, at: target.at, category: target.category }\"\n />\n }\n } @else {\n <kpt-map-create-dialog\n [geocoder]=\"activeGeocoder()\"\n [category]=\"target.category\"\n [at]=\"target.at\"\n (save)=\"emitCreate($event)\"\n (cancelled)=\"closeCreate()\"\n />\n }\n }\n</kpt-dialog>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map{--kpt-map-height: 480px;display:flex;flex-direction:column;gap:var(--kpt-space-3);width:100%;isolation:isolate}.kpt-map__viewport{position:relative;height:var(--kpt-map-height);overflow:hidden;background:var(--kpt-map-bg, var(--kpt-color-surface-sunken));border:var(--kpt-border-width-thin) solid var(--kpt-map-border, var(--kpt-color-border));border-radius:var(--kpt-map-radius, var(--kpt-radius-lg))}.kpt-map__canvas{width:100%;height:100%}.kpt-map__controls{position:absolute;top:var(--kpt-space-3);left:var(--kpt-space-3);z-index:2;display:flex;flex-direction:column;gap:var(--kpt-space-1)}.kpt-map__control{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:var(--kpt-font-size-lg);line-height:1;color:var(--kpt-color-on-surface);cursor:pointer;background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-1)}.kpt-map__control:hover:not(:disabled){background:var(--kpt-color-surface-hover)}.kpt-map__control:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-map__control:disabled{color:var(--kpt-color-on-surface-muted);cursor:not-allowed;opacity:.6}.kpt-map__search{position:absolute;top:var(--kpt-space-3);right:var(--kpt-space-3);z-index:5;max-width:calc(100% - 2rem - var(--kpt-space-3) * 3)}.kpt-map__crosshair{position:relative;width:.875rem;height:.875rem;border:var(--kpt-border-width-medium) solid currentcolor;border-radius:var(--kpt-radius-full)}.kpt-map__crosshair:after{position:absolute;inset:50% auto auto 50%;width:.25rem;height:.25rem;content:\"\";background:currentcolor;border-radius:var(--kpt-radius-full);translate:-50% -50%}.kpt-map__marker{position:relative;display:block;width:100%;height:100%;color:var(--_kpt-map-marker-fg, var(--kpt-color-text-inverse))}.kpt-map__marker-shape{display:block;width:100%;height:100%;fill:var(--_kpt-map-marker-bg, var(--kpt-color-muted));stroke:var(--kpt-color-surface-raised);stroke-width:1.5;filter:drop-shadow(0 1px 2px rgba(0,0,0,.25))}.kpt-map__marker-glyph{position:absolute;display:grid;place-items:center;font-size:.875rem}.kpt-map__marker-glyph svg{width:1em;height:1em}.kpt-map__marker--pin .kpt-map__marker-glyph{inset:0 0 auto;height:76%}.kpt-map__marker--dot,.kpt-map__marker--square{display:grid;place-items:center;background:var(--_kpt-map-marker-bg, var(--kpt-color-muted));border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);box-shadow:var(--kpt-elevation-1)}.kpt-map__marker--dot{border-radius:var(--kpt-radius-full)}.kpt-map__marker--square{border-radius:var(--kpt-radius-sm)}.kpt-map__marker--dot .kpt-map__marker-glyph,.kpt-map__marker--square .kpt-map__marker-glyph{position:static}.kpt-map__marker--selected{z-index:1}.kpt-map__marker--selected .kpt-map__marker-shape{stroke:var(--kpt-color-focus-ring);stroke-width:2.5}.kpt-map__cluster{display:grid;place-items:center;width:100%;height:100%;font-weight:var(--kpt-font-weight-semibold);font-variant-numeric:tabular-nums;color:var(--_kpt-map-cluster-fg, var(--kpt-color-primary-contrast));background:var(--_kpt-map-cluster-bg, var(--kpt-map-cluster-bg, var(--kpt-color-primary)));border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);border-radius:var(--kpt-radius-full);box-shadow:var(--kpt-elevation-2)}.kpt-map__cluster--sm{font-size:var(--kpt-font-size-xs);scale:.78}.kpt-map__cluster--md{font-size:var(--kpt-font-size-sm);scale:.9}.kpt-map__cluster--lg{font-size:var(--kpt-font-size-sm);scale:1}.kpt-map__user-marker{display:grid;place-items:center;width:100%;height:100%;font-size:.875rem;color:var(--kpt-color-info-contrast);background:var(--kpt-color-info);border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);border-radius:var(--kpt-radius-full);box-shadow:var(--kpt-elevation-2)}.kpt-map__user-marker svg{width:1em;height:1em}.kpt-map__popup{position:absolute;top:var(--_kpt-map-y, 0);left:var(--_kpt-map-x, 0);z-index:3;max-width:min(var(--kpt-map-popup-width, 20rem),100% - var(--kpt-space-6));padding:var(--kpt-space-4);color:var(--kpt-color-on-surface);background:var(--kpt-map-popup-bg, var(--kpt-color-surface-raised));border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-lg);box-shadow:var(--kpt-map-popup-shadow, var(--kpt-elevation-3));translate:-50% calc(-100% - var(--kpt-space-3))}.kpt-map__popup:after{position:absolute;top:100%;left:50%;width:.75rem;height:.75rem;content:\"\";background:inherit;border-right:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-bottom:var(--kpt-border-width-thin) solid var(--kpt-color-border);rotate:45deg;translate:-50% -50%}.kpt-map__popup[data-layout=card]{max-width:min(var(--kpt-map-popup-width-card, 26rem),100% - var(--kpt-space-6));width:min(var(--kpt-map-popup-width-card, 26rem),100% - var(--kpt-space-6));max-height:min(var(--kpt-map-popup-max-height, 32rem),100% - var(--kpt-space-8));padding:0;display:flex;flex-direction:column}.kpt-map__popup[data-layout=card] .kpt-map__popup-body{display:flex;min-height:0;padding:0;overflow:hidden}.kpt-map__popup[data-layout=card] .kpt-map__popup-body>*{flex:1 1 auto;min-height:0}.kpt-map__popup[data-layout=card] .kpt-map__popup-group,.kpt-map__popup[data-layout=card] .kpt-map__popup-tabs{margin-inline:var(--kpt-space-4)}.kpt-map__popup[data-layout=card] .kpt-map__popup-group{margin-top:var(--kpt-space-3)}.kpt-map__popup-close{position:absolute;top:var(--kpt-space-2);right:var(--kpt-space-2);display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--kpt-font-size-lg);line-height:1;color:var(--kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--kpt-radius-full)}.kpt-map__popup-close:hover{background:var(--kpt-color-surface-hover)}.kpt-map__popup-close:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map__popup-body{padding-right:var(--kpt-space-5);font-size:var(--kpt-font-size-sm)}.kpt-map__popup-body p{margin:0 0 var(--kpt-space-1)}.kpt-map__popup-title{display:block;margin-bottom:var(--kpt-space-1);font-size:var(--kpt-font-size-base)}.kpt-map__popup-category{color:var(--kpt-color-on-surface-muted)}.kpt-map__popup-group{margin:0 var(--kpt-space-5) var(--kpt-space-2) 0;font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted);text-transform:uppercase}.kpt-map__popup-tabs{display:flex;flex-wrap:wrap;gap:var(--kpt-space-1);margin-bottom:var(--kpt-space-2)}.kpt-map__popup-tab{padding:var(--kpt-space-1) var(--kpt-space-2);font:inherit;font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface);cursor:pointer;background:var(--kpt-color-surface-variant);border:var(--kpt-border-width-thin) solid transparent;border-radius:var(--kpt-radius-sm)}.kpt-map__popup-tab[aria-selected=true]{background:var(--kpt-color-surface-selected);border-color:var(--kpt-color-border-strong)}.kpt-map__popup-tab:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map__context{position:absolute;top:var(--_kpt-map-y, 0);left:var(--_kpt-map-x, 0);z-index:4;min-width:12rem;padding:var(--kpt-space-2);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-3)}.kpt-map__context-title{margin:0 0 var(--kpt-space-1);padding:0 var(--kpt-space-2);font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted)}.kpt-map__context-item{display:flex;gap:var(--kpt-space-2);align-items:center;width:100%;padding:var(--kpt-space-2);font:inherit;font-size:var(--kpt-font-size-sm);color:var(--kpt-color-on-surface);text-align:start;cursor:pointer;background:transparent;border:none;border-radius:var(--kpt-radius-sm)}.kpt-map__context-item:hover{background:var(--kpt-color-surface-hover)}.kpt-map__context-item:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:-2px}.kpt-map__context-empty{margin:0;padding:var(--kpt-space-2);font-size:var(--kpt-font-size-sm);color:var(--kpt-color-on-surface-muted)}.kpt-map__context-dot{width:.5rem;height:.5rem;background:var(--kpt-color-border-strong);border-radius:var(--kpt-radius-full)}.kpt-map[data-engine=google] .kpt-map__accuracy{background:color-mix(in oklch,var(--kpt-color-info) 15%,transparent);border:var(--kpt-border-width-thin) solid color-mix(in oklch,var(--kpt-color-info) 50%,transparent)}}.kpt-map .leaflet-container{font-family:var(--kpt-font-family-sans);font-size:var(--kpt-font-size-sm);background:var(--kpt-color-surface-sunken);z-index:0}.kpt-map .leaflet-div-icon,.kpt-map .kpt-map__icon{background:transparent;border:none}.kpt-map .leaflet-control-attribution{padding:0 var(--kpt-space-1);font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted);background:color-mix(in oklch,var(--kpt-color-surface-raised) 85%,transparent)}.kpt-map .leaflet-control-attribution a{color:var(--kpt-color-primary)}.kpt-map .kpt-map__accuracy{fill:var(--kpt-color-info);fill-opacity:.15;stroke:var(--kpt-color-info);stroke-opacity:.5}.kpt-map .leaflet-popup-content-wrapper,.kpt-map .leaflet-popup-tip{display:none}\n"] }]
|
|
2727
|
-
}], () => [], { locations: [{ type: i0.Input, args: [{ isSignal: true, alias: "locations", required: true }] }], categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: true }] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], restrictToCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "restrictToCountry", required: false }] }], bounds: [{ type: i0.Input, args: [{ isSignal: true, alias: "bounds", required: false }] }], cluster: [{ type: i0.Input, args: [{ isSignal: true, alias: "cluster", required: false }] }], clusterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterOptions", required: false }] }], clusterColorBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterColorBy", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], hiddenCategories: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenCategories", required: false }] }, { type: i0.Output, args: ["hiddenCategoriesChange"] }], legendCounts: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendCounts", required: false }] }], showUserLocation: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUserLocation", required: false }] }], followUser: [{ type: i0.Input, args: [{ isSignal: true, alias: "followUser", required: false }] }], allowCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCreate", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchOptions", required: false }] }], searchZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchZoom", required: false }] }], searchMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchMarker", required: false }] }], popupLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupLayout", required: false }] }], distanceFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "distanceFrom", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], tileUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "tileUrl", required: false }] }], attribution: [{ type: i0.Input, args: [{ isSignal: true, alias: "attribution", required: false }] }], engine: [{ type: i0.Input, args: [{ isSignal: true, alias: "engine", required: false }] }], geocoder: [{ type: i0.Input, args: [{ isSignal: true, alias: "geocoder", required: false }] }], locationClick: [{ type: i0.Output, args: ["locationClick"] }], clusterClick: [{ type: i0.Output, args: ["clusterClick"] }], locationCreate: [{ type: i0.Output, args: ["locationCreate"] }], searchSelect: [{ type: i0.Output, args: ["searchSelect"] }], viewChange: [{ type: i0.Output, args: ["viewChange"] }], userPositionChange: [{ type: i0.Output, args: ["userPositionChange"] }], userLocationError: [{ type: i0.Output, args: ["userLocationError"] }], canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], popupEl: [{ type: i0.ViewChild, args: ['popupEl', { isSignal: true }] }], popupTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptMapPopupTemplate), { isSignal: true }] }], createFormTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KptMapCreateFormTemplate), { isSignal: true }] }] }); })();
|
|
2793
|
+
}, template: "<div class=\"kpt-map__viewport\">\n <!-- Kontener silnika. Wszystko poni\u017Cej to warstwa Angulara rozpi\u0119ta nad map\u0105. -->\n <div #canvas class=\"kpt-map__canvas\"></div>\n\n <div class=\"kpt-map__controls\" role=\"group\" [attr.aria-label]=\"i18n.t('map.legend')\">\n <button\n class=\"kpt-map__control\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.zoomIn')\"\n [title]=\"i18n.t('map.zoomIn')\"\n [disabled]=\"!ready()\"\n (click)=\"zoomBy(1)\"\n >\n <kpt-icon name=\"plus\" />\n </button>\n <button\n class=\"kpt-map__control\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.zoomOut')\"\n [title]=\"i18n.t('map.zoomOut')\"\n [disabled]=\"!ready()\"\n (click)=\"zoomBy(-1)\"\n >\n <kpt-icon name=\"minus\" />\n </button>\n @if (showUserLocation()) {\n <button\n class=\"kpt-map__control kpt-map__control--locate\"\n type=\"button\"\n [attr.aria-label]=\"locationBlocked() ? i18n.t('map.locationDenied') : i18n.t('map.locateMe')\"\n [title]=\"locationBlocked() ? i18n.t('map.locationDenied') : i18n.t('map.locateMe')\"\n [disabled]=\"!userPosition()\"\n (click)=\"centreOnUser()\"\n >\n <span class=\"kpt-map__crosshair\" aria-hidden=\"true\"></span>\n </button>\n }\n </div>\n\n <!--\n Wyszukiwarka adres\u00F3w. Renderowana tylko wtedy, gdy port ma czym szuka\u0107.\n\n Pozycjonuje j\u0105 OPAKOWANIE, a nie klasa postawiona wprost na <kpt-map-search> -\n pow\u00F3d stoi przy regule .kpt-map__search w map.component.scss.\n -->\n @if (searchEnabled()) {\n <div class=\"kpt-map__search\">\n <kpt-map-search\n [geocoder]=\"activeGeocoder()\"\n [placeholder]=\"searchPlaceholder()\"\n [minLength]=\"searchOptions().minLength ?? 3\"\n [debounce]=\"searchOptions().debounce ?? 300\"\n [limit]=\"searchOptions().limit ?? 5\"\n [viewbox]=\"searchViewbox()\"\n [countryCodes]=\"searchCountryCodes()\"\n [speech]=\"searchSpeech()\"\n [speechLang]=\"searchSpeechLang()\"\n [speechColor]=\"searchSpeechColor()\"\n (selected)=\"onSearchSelect($event)\"\n (cleared)=\"clearSearchPin()\"\n />\n </div>\n }\n\n <!-- Menu pod prawym przyciskiem: wyb\u00F3r kategorii nowej lokalizacji. -->\n @if (allowCreate() && contextTarget()) {\n @if (contextPosition(); as position) {\n <div\n class=\"kpt-map__context\"\n role=\"menu\"\n [attr.aria-label]=\"i18n.t('map.addLocation')\"\n [style.--_kpt-map-x.px]=\"position.x\"\n [style.--_kpt-map-y.px]=\"position.y\"\n >\n <p class=\"kpt-map__context-title\">{{ i18n.t('map.chooseCategory') }}</p>\n @for (category of creatableCategories(); track category.id) {\n <button class=\"kpt-map__context-item\" type=\"button\" role=\"menuitem\" (click)=\"startCreate(category)\">\n <span class=\"kpt-map__context-dot\" aria-hidden=\"true\"></span>\n {{ category.label }}\n </button>\n } @empty {\n <p class=\"kpt-map__context-empty\">{{ i18n.t('map.empty') }}</p>\n }\n </div>\n }\n }\n\n <!-- Popup szczeg\u00F3\u0142\u00F3w. Renderowany przez Angulara, pozycjonowany z engine.project(). -->\n @if (popup(); as state) {\n @if (popupPosition(); as position) {\n <div\n #popupEl\n class=\"kpt-map__popup\"\n role=\"dialog\"\n [attr.data-layout]=\"popupLayout()\"\n [attr.aria-label]=\"state.location.title\"\n [style.--_kpt-map-x.px]=\"position.x\"\n [style.--_kpt-map-y.px]=\"position.y\"\n >\n <!-- W wariancie `card` krzy\u017Cyk daje karta, wi\u0119c wbudowany by\u0142by drugim. -->\n @if (popupLayout() === 'plain') {\n <button\n class=\"kpt-map__popup-close\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('common.close')\"\n (click)=\"closePopup()\"\n >\n <span aria-hidden=\"true\">x</span>\n </button>\n }\n\n @if (state.group) {\n <!-- Grupa punkt\u00F3w o tej samej wsp\u00F3\u0142rz\u0119dnej - zoom jej nie rozdzieli. -->\n <p class=\"kpt-map__popup-group\">{{ i18n.t('map.clusterItems') }}</p>\n <div class=\"kpt-map__popup-tabs\" role=\"tablist\">\n @for (item of state.group.items; track item.id) {\n <button\n class=\"kpt-map__popup-tab\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"item.id === state.location.id\"\n (click)=\"selectFromGroup(item)\"\n >\n {{ item.title }}\n </button>\n }\n </div>\n }\n\n <div class=\"kpt-map__popup-body\">\n @if (popupTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: state.location,\n data: state.location.data,\n category: popupCategory(),\n distance: popupDistance(),\n close: closePopupFn\n }\"\n />\n } @else {\n <strong class=\"kpt-map__popup-title\">{{ state.location.title }}</strong>\n @if (popupCategory(); as category) {\n <p class=\"kpt-map__popup-category\">{{ category.label }}</p>\n }\n }\n </div>\n </div>\n }\n }\n</div>\n\n@if (legend()) {\n <kpt-map-legend\n class=\"kpt-map__legend\"\n [categories]=\"categories()\"\n [(hidden)]=\"hiddenCategories\"\n [counts]=\"counts()\"\n />\n}\n\n<!-- Dialog dodawania: schema z kategorii, a w\u0142asny szablon ma pierwsze\u0144stwo. -->\n<kpt-dialog [(open)]=\"createOpen\" [header]=\"i18n.t('map.addLocation')\">\n @if (createFor(); as target) {\n @if (createFormTemplate(); as tpl) {\n @if (createFormApi(); as api) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: api, at: target.at, category: target.category }\"\n />\n }\n } @else {\n <kpt-map-create-dialog\n [geocoder]=\"activeGeocoder()\"\n [category]=\"target.category\"\n [at]=\"target.at\"\n (save)=\"emitCreate($event)\"\n (cancelled)=\"closeCreate()\"\n />\n }\n }\n</kpt-dialog>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map{--kpt-map-height: 480px;display:flex;flex-direction:column;gap:var(--kpt-space-3);width:100%;isolation:isolate}.kpt-map__viewport{position:relative;height:var(--kpt-map-height);overflow:hidden;background:var(--kpt-map-bg, var(--kpt-color-surface-sunken));border:var(--kpt-border-width-thin) solid var(--kpt-map-border, var(--kpt-color-border));border-radius:var(--kpt-map-radius, var(--kpt-radius-lg))}.kpt-map__canvas{width:100%;height:100%}.kpt-map__controls{position:absolute;top:var(--kpt-space-3);left:var(--kpt-space-3);z-index:2;display:flex;flex-direction:column;gap:var(--kpt-space-1)}.kpt-map__control{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:var(--kpt-font-size-lg);line-height:1;color:var(--kpt-color-on-surface);cursor:pointer;background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-1)}.kpt-map__control:hover:not(:disabled){background:var(--kpt-color-surface-hover)}.kpt-map__control:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:2px}.kpt-map__control:disabled{color:var(--kpt-color-on-surface-muted);cursor:not-allowed;opacity:.6}.kpt-map__search{position:absolute;top:var(--kpt-space-3);right:var(--kpt-space-3);z-index:5;max-width:calc(100% - 2rem - var(--kpt-space-3) * 3)}.kpt-map__crosshair{position:relative;width:.875rem;height:.875rem;border:var(--kpt-border-width-medium) solid currentcolor;border-radius:var(--kpt-radius-full)}.kpt-map__crosshair:after{position:absolute;inset:50% auto auto 50%;width:.25rem;height:.25rem;content:\"\";background:currentcolor;border-radius:var(--kpt-radius-full);translate:-50% -50%}.kpt-map__marker{position:relative;display:block;width:100%;height:100%;color:var(--_kpt-map-marker-fg, var(--kpt-color-text-inverse))}.kpt-map__marker-shape{display:block;width:100%;height:100%;fill:var(--_kpt-map-marker-bg, var(--kpt-color-muted));stroke:var(--kpt-color-surface-raised);stroke-width:1.5;filter:drop-shadow(0 1px 2px rgba(0,0,0,.25))}.kpt-map__marker-glyph{position:absolute;display:grid;place-items:center;font-size:.875rem}.kpt-map__marker-glyph svg{width:1em;height:1em}.kpt-map__marker--pin .kpt-map__marker-glyph{inset:0 0 auto;height:76%}.kpt-map__marker--dot,.kpt-map__marker--square{display:grid;place-items:center;background:var(--_kpt-map-marker-bg, var(--kpt-color-muted));border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);box-shadow:var(--kpt-elevation-1)}.kpt-map__marker--dot{border-radius:var(--kpt-radius-full)}.kpt-map__marker--square{border-radius:var(--kpt-radius-sm)}.kpt-map__marker--dot .kpt-map__marker-glyph,.kpt-map__marker--square .kpt-map__marker-glyph{position:static}.kpt-map__marker--selected{z-index:1}.kpt-map__marker--selected .kpt-map__marker-shape{stroke:var(--kpt-color-focus-ring);stroke-width:2.5}.kpt-map__cluster{display:grid;place-items:center;width:100%;height:100%;font-weight:var(--kpt-font-weight-semibold);font-variant-numeric:tabular-nums;color:var(--_kpt-map-cluster-fg, var(--kpt-color-primary-contrast));background:var(--_kpt-map-cluster-bg, var(--kpt-map-cluster-bg, var(--kpt-color-primary)));border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);border-radius:var(--kpt-radius-full);box-shadow:var(--kpt-elevation-2)}.kpt-map__cluster--sm{font-size:var(--kpt-font-size-xs);scale:.78}.kpt-map__cluster--md{font-size:var(--kpt-font-size-sm);scale:.9}.kpt-map__cluster--lg{font-size:var(--kpt-font-size-sm);scale:1}.kpt-map__user-marker{display:grid;place-items:center;width:100%;height:100%;font-size:.875rem;color:var(--kpt-color-info-contrast);background:var(--kpt-color-info);border:var(--kpt-border-width-medium) solid var(--kpt-color-surface-raised);border-radius:var(--kpt-radius-full);box-shadow:var(--kpt-elevation-2)}.kpt-map__user-marker svg{width:1em;height:1em}.kpt-map__popup{position:absolute;top:var(--_kpt-map-y, 0);left:var(--_kpt-map-x, 0);z-index:3;max-width:min(var(--kpt-map-popup-width, 20rem),100% - var(--kpt-space-6));padding:var(--kpt-space-4);color:var(--kpt-color-on-surface);background:var(--kpt-map-popup-bg, var(--kpt-color-surface-raised));border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-lg);box-shadow:var(--kpt-map-popup-shadow, var(--kpt-elevation-3));translate:-50% calc(-100% - var(--kpt-space-3))}.kpt-map__popup:after{position:absolute;top:100%;left:50%;width:.75rem;height:.75rem;content:\"\";background:inherit;border-right:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-bottom:var(--kpt-border-width-thin) solid var(--kpt-color-border);rotate:45deg;translate:-50% -50%}.kpt-map__popup[data-layout=card]{max-width:min(var(--kpt-map-popup-width-card, 26rem),100% - var(--kpt-space-6));width:min(var(--kpt-map-popup-width-card, 26rem),100% - var(--kpt-space-6));max-height:min(var(--kpt-map-popup-max-height, 32rem),100% - var(--kpt-space-8));padding:0;display:flex;flex-direction:column}.kpt-map__popup[data-layout=card] .kpt-map__popup-body{display:flex;min-height:0;padding:0;overflow:hidden}.kpt-map__popup[data-layout=card] .kpt-map__popup-body>*{flex:1 1 auto;min-height:0}.kpt-map__popup[data-layout=card] .kpt-map__popup-group,.kpt-map__popup[data-layout=card] .kpt-map__popup-tabs{margin-inline:var(--kpt-space-4)}.kpt-map__popup[data-layout=card] .kpt-map__popup-group{margin-top:var(--kpt-space-3)}.kpt-map__popup-close{position:absolute;top:var(--kpt-space-2);right:var(--kpt-space-2);display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--kpt-font-size-lg);line-height:1;color:var(--kpt-color-on-surface-muted);cursor:pointer;background:transparent;border:none;border-radius:var(--kpt-radius-full)}.kpt-map__popup-close:hover{background:var(--kpt-color-surface-hover)}.kpt-map__popup-close:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map__popup-body{padding-right:var(--kpt-space-5);font-size:var(--kpt-font-size-sm)}.kpt-map__popup-body p{margin:0 0 var(--kpt-space-1)}.kpt-map__popup-title{display:block;margin-bottom:var(--kpt-space-1);font-size:var(--kpt-font-size-base)}.kpt-map__popup-category{color:var(--kpt-color-on-surface-muted)}.kpt-map__popup-group{margin:0 var(--kpt-space-5) var(--kpt-space-2) 0;font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted);text-transform:uppercase}.kpt-map__popup-tabs{display:flex;flex-wrap:wrap;gap:var(--kpt-space-1);margin-bottom:var(--kpt-space-2)}.kpt-map__popup-tab{padding:var(--kpt-space-1) var(--kpt-space-2);font:inherit;font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface);cursor:pointer;background:var(--kpt-color-surface-variant);border:var(--kpt-border-width-thin) solid transparent;border-radius:var(--kpt-radius-sm)}.kpt-map__popup-tab[aria-selected=true]{background:var(--kpt-color-surface-selected);border-color:var(--kpt-color-border-strong)}.kpt-map__popup-tab:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}.kpt-map__context{position:absolute;top:var(--_kpt-map-y, 0);left:var(--_kpt-map-x, 0);z-index:4;min-width:12rem;padding:var(--kpt-space-2);background:var(--kpt-color-surface-raised);border:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-md);box-shadow:var(--kpt-elevation-3)}.kpt-map__context-title{margin:0 0 var(--kpt-space-1);padding:0 var(--kpt-space-2);font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted)}.kpt-map__context-item{display:flex;gap:var(--kpt-space-2);align-items:center;width:100%;padding:var(--kpt-space-2);font:inherit;font-size:var(--kpt-font-size-sm);color:var(--kpt-color-on-surface);text-align:start;cursor:pointer;background:transparent;border:none;border-radius:var(--kpt-radius-sm)}.kpt-map__context-item:hover{background:var(--kpt-color-surface-hover)}.kpt-map__context-item:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:-2px}.kpt-map__context-empty{margin:0;padding:var(--kpt-space-2);font-size:var(--kpt-font-size-sm);color:var(--kpt-color-on-surface-muted)}.kpt-map__context-dot{width:.5rem;height:.5rem;background:var(--kpt-color-border-strong);border-radius:var(--kpt-radius-full)}.kpt-map[data-engine=google] .kpt-map__accuracy{background:color-mix(in oklch,var(--kpt-color-info) 15%,transparent);border:var(--kpt-border-width-thin) solid color-mix(in oklch,var(--kpt-color-info) 50%,transparent)}}.kpt-map .leaflet-container{font-family:var(--kpt-font-family-sans);font-size:var(--kpt-font-size-sm);background:var(--kpt-color-surface-sunken);z-index:0}.kpt-map .leaflet-div-icon,.kpt-map .kpt-map__icon{background:transparent;border:none}.kpt-map .leaflet-control-attribution{padding:0 var(--kpt-space-1);font-size:var(--kpt-font-size-xs);color:var(--kpt-color-on-surface-muted);background:color-mix(in oklch,var(--kpt-color-surface-raised) 85%,transparent)}.kpt-map .leaflet-control-attribution a{color:var(--kpt-color-primary)}.kpt-map .kpt-map__accuracy{fill:var(--kpt-color-info);fill-opacity:.15;stroke:var(--kpt-color-info);stroke-opacity:.5}.kpt-map .leaflet-popup-content-wrapper,.kpt-map .leaflet-popup-tip{display:none}\n"] }]
|
|
2794
|
+
}], () => [], { locations: [{ type: i0.Input, args: [{ isSignal: true, alias: "locations", required: true }] }], categories: [{ type: i0.Input, args: [{ isSignal: true, alias: "categories", required: true }] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], restrictToCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "restrictToCountry", required: false }] }], bounds: [{ type: i0.Input, args: [{ isSignal: true, alias: "bounds", required: false }] }], cluster: [{ type: i0.Input, args: [{ isSignal: true, alias: "cluster", required: false }] }], clusterOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterOptions", required: false }] }], clusterColorBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "clusterColorBy", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], hiddenCategories: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenCategories", required: false }] }, { type: i0.Output, args: ["hiddenCategoriesChange"] }], legendCounts: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendCounts", required: false }] }], showUserLocation: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUserLocation", required: false }] }], followUser: [{ type: i0.Input, args: [{ isSignal: true, alias: "followUser", required: false }] }], allowCreate: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCreate", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchOptions", required: false }] }], searchZoom: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchZoom", required: false }] }], searchMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchMarker", required: false }] }], searchSpeech: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchSpeech", required: false }] }], searchSpeechLang: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchSpeechLang", required: false }] }], searchSpeechColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchSpeechColor", required: false }] }], popupLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupLayout", required: false }] }], distanceFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "distanceFrom", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], tileUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "tileUrl", required: false }] }], attribution: [{ type: i0.Input, args: [{ isSignal: true, alias: "attribution", required: false }] }], engine: [{ type: i0.Input, args: [{ isSignal: true, alias: "engine", required: false }] }], geocoder: [{ type: i0.Input, args: [{ isSignal: true, alias: "geocoder", required: false }] }], locationClick: [{ type: i0.Output, args: ["locationClick"] }], clusterClick: [{ type: i0.Output, args: ["clusterClick"] }], locationCreate: [{ type: i0.Output, args: ["locationCreate"] }], searchSelect: [{ type: i0.Output, args: ["searchSelect"] }], viewChange: [{ type: i0.Output, args: ["viewChange"] }], userPositionChange: [{ type: i0.Output, args: ["userPositionChange"] }], userLocationError: [{ type: i0.Output, args: ["userLocationError"] }], engineError: [{ type: i0.Output, args: ["engineError"] }], canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], popupEl: [{ type: i0.ViewChild, args: ['popupEl', { isSignal: true }] }], popupTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => KptMapPopupTemplate), { isSignal: true }] }], createFormTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KptMapCreateFormTemplate), { isSignal: true }] }] }); })();
|
|
2728
2795
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMap, { className: "KptMap", filePath: "lib/map.component.ts", lineNumber: 95 }); })();
|
|
2729
2796
|
|
|
2730
2797
|
const _c0 = () => [];
|
|
@@ -2828,7 +2895,7 @@ function KptMapPoiCard_Conditional_16_Conditional_5_Template(rf, ctx) { if (rf &
|
|
|
2828
2895
|
i0.ɵɵelementEnd();
|
|
2829
2896
|
} if (rf & 2) {
|
|
2830
2897
|
i0.ɵɵadvance();
|
|
2831
|
-
i0.ɵɵtextInterpolate1("
|
|
2898
|
+
i0.ɵɵtextInterpolate1(", ", ctx);
|
|
2832
2899
|
} }
|
|
2833
2900
|
function KptMapPoiCard_Conditional_16_Conditional_7_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
2834
2901
|
i0.ɵɵelementStart(0, "span", 36);
|
|
@@ -2912,7 +2979,7 @@ function KptMapPoiCard_Conditional_17_For_2_Conditional_2_Template(rf, ctx) { if
|
|
|
2912
2979
|
} if (rf & 2) {
|
|
2913
2980
|
const row_r10 = i0.ɵɵnextContext().$implicit;
|
|
2914
2981
|
i0.ɵɵproperty("href", row_r10.href, i0.ɵɵsanitizeUrl);
|
|
2915
|
-
i0.ɵɵattribute("target", row_r10.external ? "_blank" : null)("rel", row_r10.external ? "noopener" : null);
|
|
2982
|
+
i0.ɵɵattribute("target", row_r10.external ? "_blank" : null)("rel", row_r10.external ? "noopener noreferrer" : null);
|
|
2916
2983
|
i0.ɵɵadvance();
|
|
2917
2984
|
i0.ɵɵtextInterpolate1(" ", row_r10.text, " ");
|
|
2918
2985
|
} }
|
|
@@ -2932,7 +2999,7 @@ function KptMapPoiCard_Conditional_17_For_2_Conditional_5_Template(rf, ctx) { if
|
|
|
2932
2999
|
} if (rf & 2) {
|
|
2933
3000
|
const row_r10 = i0.ɵɵnextContext().$implicit;
|
|
2934
3001
|
i0.ɵɵproperty("href", row_r10.href, i0.ɵɵsanitizeUrl)("title", row_r10.actionLabel);
|
|
2935
|
-
i0.ɵɵattribute("target", row_r10.external ? "_blank" : null)("rel", row_r10.external ? "noopener" : null)("aria-label", row_r10.actionLabel);
|
|
3002
|
+
i0.ɵɵattribute("target", row_r10.external ? "_blank" : null)("rel", row_r10.external ? "noopener noreferrer" : null)("aria-label", row_r10.actionLabel);
|
|
2936
3003
|
i0.ɵɵadvance();
|
|
2937
3004
|
i0.ɵɵproperty("name", row_r10.actionIcon);
|
|
2938
3005
|
} }
|
|
@@ -3014,17 +3081,17 @@ function KptMapPoiCard_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
|
3014
3081
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
3015
3082
|
i0.ɵɵtextInterpolate1(" ", ctx_r1.i18n.t("map.poi.copied"), " ");
|
|
3016
3083
|
} }
|
|
3017
|
-
/** Licznik instancji
|
|
3084
|
+
/** Licznik instancji - `aria-controls` musi wskazywać unikatowy identyfikator na stronie. */
|
|
3018
3085
|
let poiCardSeq = 0;
|
|
3019
3086
|
/**
|
|
3020
|
-
* Karta miejsca do popupu mapy
|
|
3087
|
+
* Karta miejsca do popupu mapy - dystans od użytkownika, zdjęcie, akcje, kategoria,
|
|
3021
3088
|
* rozwijane godziny otwarcia i wiersze kontaktowe z kopiowaniem.
|
|
3022
3089
|
*
|
|
3023
3090
|
* Komponent jest sterowany danymi: bierze `KptMapPoi`, a nie model domenowy aplikacji.
|
|
3024
|
-
* Mapowanie `KptMapLocation.data`
|
|
3091
|
+
* Mapowanie `KptMapLocation.data` -> `KptMapPoi` robi aplikacja, dzięki czemu karta nie
|
|
3025
3092
|
* wie nic o tym, czy pokazuje ładowarkę, restaurację, czy punkt serwisowy.
|
|
3026
3093
|
*
|
|
3027
|
-
* Sam popup `kpt-map` trzeba przełączyć na `[popupLayout]="'card'"`
|
|
3094
|
+
* Sam popup `kpt-map` trzeba przełączyć na `[popupLayout]="'card'"` - inaczej karta
|
|
3028
3095
|
* dostanie 20 rem szerokości i padding przeznaczony dla treści tekstowej.
|
|
3029
3096
|
*
|
|
3030
3097
|
* @example
|
|
@@ -3067,11 +3134,11 @@ class KptMapPoiCard {
|
|
|
3067
3134
|
this.i18n = inject(KptI18n);
|
|
3068
3135
|
/** Identyfikator regionu godzin; kart na stronie bywa więcej niż jedna. */
|
|
3069
3136
|
this.hoursId = `kpt-map-poi-hours-${++poiCardSeq}`;
|
|
3070
|
-
/** Rośnie przy każdym otwarciu karty i przy zmianie danych
|
|
3137
|
+
/** Rośnie przy każdym otwarciu karty i przy zmianie danych - odświeża status godzin. */
|
|
3071
3138
|
this.now = signal(Date.now(), /* @ts-ignore */
|
|
3072
3139
|
...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
3073
3140
|
/**
|
|
3074
|
-
* Ikona kategorii stoi wprost na powierzchni karty, bez własnego tła
|
|
3141
|
+
* Ikona kategorii stoi wprost na powierzchni karty, bez własnego tła - stąd
|
|
3075
3142
|
* `foregroundVarOf()`, a nie `colorVarOf()`: rola `muted` ma kolor tła, nie treści.
|
|
3076
3143
|
*/
|
|
3077
3144
|
this.categoryColor = computed(() => {
|
|
@@ -3081,7 +3148,7 @@ class KptMapPoiCard {
|
|
|
3081
3148
|
...(ngDevMode ? [{ debugName: "categoryColor" }] : /* istanbul ignore next */ []));
|
|
3082
3149
|
this.distanceLabel = computed(() => formatDistance(this.distance(), this.i18n.locale()), /* @ts-ignore */
|
|
3083
3150
|
...(ngDevMode ? [{ debugName: "distanceLabel" }] : /* istanbul ignore next */ []));
|
|
3084
|
-
/*
|
|
3151
|
+
/* -- godziny ----------------------------------------------------------- */
|
|
3085
3152
|
this.hasHours = computed(() => (this.poi().hours?.length ?? 0) > 0, /* @ts-ignore */
|
|
3086
3153
|
...(ngDevMode ? [{ debugName: "hasHours" }] : /* istanbul ignore next */ []));
|
|
3087
3154
|
this.alwaysOpen = computed(() => isAlwaysOpen(this.poi().hours), /* @ts-ignore */
|
|
@@ -3096,7 +3163,7 @@ class KptMapPoiCard {
|
|
|
3096
3163
|
return this.i18n.t(this.open() ? 'map.poi.openNow' : 'map.poi.closedNow');
|
|
3097
3164
|
}, /* @ts-ignore */
|
|
3098
3165
|
...(ngDevMode ? [{ debugName: "statusLabel" }] : /* istanbul ignore next */ []));
|
|
3099
|
-
/** Dopisek
|
|
3166
|
+
/** Dopisek "otwarcie o 11:00" - nie ma go dla 24/7 ani gdy zmiana jest dalej niż doba. */
|
|
3100
3167
|
this.statusHint = computed(() => {
|
|
3101
3168
|
if (this.alwaysOpen() || !this.hasHours())
|
|
3102
3169
|
return null;
|
|
@@ -3113,7 +3180,7 @@ class KptMapPoiCard {
|
|
|
3113
3180
|
return this.i18n.t(change.open ? 'map.poi.opensAt' : 'map.poi.closesAt', { time });
|
|
3114
3181
|
}, /* @ts-ignore */
|
|
3115
3182
|
...(ngDevMode ? [{ debugName: "statusHint" }] : /* istanbul ignore next */ []));
|
|
3116
|
-
/*
|
|
3183
|
+
/* -- wiersze kontaktu -------------------------------------------------- */
|
|
3117
3184
|
this.rows = computed(() => {
|
|
3118
3185
|
const poi = this.poi();
|
|
3119
3186
|
const rows = [];
|
|
@@ -3170,8 +3237,8 @@ class KptMapPoiCard {
|
|
|
3170
3237
|
return rows;
|
|
3171
3238
|
}, /* @ts-ignore */
|
|
3172
3239
|
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
3173
|
-
/*
|
|
3174
|
-
/** Klucz wiersza, którego wartość właśnie skopiowano
|
|
3240
|
+
/* -- akcje ------------------------------------------------------------- */
|
|
3241
|
+
/** Klucz wiersza, którego wartość właśnie skopiowano - przełącza ikonę na "check". */
|
|
3175
3242
|
this.justCopied = signal(null, /* @ts-ignore */
|
|
3176
3243
|
...(ngDevMode ? [{ debugName: "justCopied" }] : /* istanbul ignore next */ []));
|
|
3177
3244
|
this.copyTimer = null;
|
|
@@ -3184,7 +3251,7 @@ class KptMapPoiCard {
|
|
|
3184
3251
|
await navigator.clipboard.writeText(row.copyValue);
|
|
3185
3252
|
}
|
|
3186
3253
|
catch {
|
|
3187
|
-
// Odmowa zgody albo brak bezpiecznego kontekstu
|
|
3254
|
+
// Odmowa zgody albo brak bezpiecznego kontekstu - nie ma czego zgłaszać użytkownikowi.
|
|
3188
3255
|
return;
|
|
3189
3256
|
}
|
|
3190
3257
|
this.justCopied.set(row.kind);
|
|
@@ -3202,7 +3269,7 @@ class KptMapPoiCard {
|
|
|
3202
3269
|
this.favourite.update((v) => !v);
|
|
3203
3270
|
}
|
|
3204
3271
|
toggleHours() {
|
|
3205
|
-
// Odświeżamy zegar przy rozwinięciu
|
|
3272
|
+
// Odświeżamy zegar przy rozwinięciu - karta bywa otwarta dłużej niż minutę.
|
|
3206
3273
|
this.now.set(Date.now());
|
|
3207
3274
|
this.hoursExpanded.update((v) => !v);
|
|
3208
3275
|
}
|
|
@@ -3289,18 +3356,18 @@ class KptMapPoiCard {
|
|
|
3289
3356
|
i0.ɵɵconditional(ctx.rows().length || ctx.poi().facts?.length ? 17 : -1);
|
|
3290
3357
|
i0.ɵɵadvance(2);
|
|
3291
3358
|
i0.ɵɵconditional(ctx.justCopied() ? 19 : -1);
|
|
3292
|
-
} }, dependencies: [KptButton, KptIcon, KptIconButton], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-poi{display:flex;flex-direction:column;min-height:0;color:var(--%NS%kpt-color-on-surface);font-size:var(--%NS%kpt-font-size-sm);text-align:start}.kpt-map-poi__scroll{flex:0 1 auto;min-height:0;padding:0 var(--%NS%kpt-space-4) var(--%NS%kpt-space-4);overflow-y:auto;overscroll-behavior:contain}.kpt-map-poi__head{flex:none;padding:var(--%NS%kpt-space-4) var(--%NS%kpt-space-4) 0;display:flex;gap:var(--%NS%kpt-space-2);align-items:flex-start;justify-content:space-between}.kpt-map-poi__title{margin:0;font-size:var(--%NS%kpt-font-size-lg);font-weight:var(--%NS%kpt-font-weight-bold);line-height:1.25;letter-spacing:normal;text-transform:none}.kpt-map-poi__close{flex:none;margin:calc(var(--%NS%kpt-space-1) * -1) calc(var(--%NS%kpt-space-2) * -1) 0 0}.kpt-map-poi__meta{flex:none;display:flex;flex-wrap:wrap;gap:0 var(--%NS%kpt-space-2);margin:var(--%NS%kpt-space-1) 0 0;padding:0 var(--%NS%kpt-space-4) var(--%NS%kpt-space-3);border-bottom:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__distance{font-weight:var(--%NS%kpt-font-weight-bold)}.kpt-map-poi__address{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__media{margin-top:var(--%NS%kpt-space-4);overflow:hidden;border-radius:var(--%NS%kpt-map-poi-media-radius, var(--%NS%kpt-radius-md))}.kpt-map-poi__photo,.kpt-map-poi__photo-empty{display:block;width:100%;aspect-ratio:16/9}.kpt-map-poi__photo{object-fit:cover}.kpt-map-poi__photo-empty{display:grid;place-items:center;color:var(--%NS%kpt-color-text-subtle);background:var(--%NS%kpt-color-surface-sunken)}.kpt-map-poi__actions{display:flex;gap:var(--%NS%kpt-space-2);align-items:center;margin-top:var(--%NS%kpt-space-3);margin-bottom:var(--%NS%kpt-space-3)}.kpt-map-poi__cta{flex:1 1 auto;min-width:0}.kpt-map-poi__fav[data-on] .kpt-icon-button{color:var(--%NS%kpt-color-warning);border-color:var(--%NS%kpt-color-warning-border)}.kpt-map-poi__category{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;margin:0;padding:var(--%NS%kpt-space-3) 0;border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__category-icon{color:var(--%NS%_kpt-poi-color, var(--%NS%kpt-color-primary))}.kpt-map-poi__hours{border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__hours-toggle{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;width:100%;padding:var(--%NS%kpt-space-3) 0;font:inherit;color:inherit;text-align:start;background:none;border:0;cursor:pointer}.kpt-map-poi__hours-toggle:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:calc(var(--%NS%kpt-space-1) * -1)}.kpt-map-poi__status{font-weight:var(--%NS%kpt-font-weight-medium);color:var(--%NS%kpt-color-danger)}.kpt-map-poi__status[data-open=true]{color:var(--%NS%kpt-color-success)}.kpt-map-poi__status-hint{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__chevron{margin-inline-start:auto;color:var(--%NS%kpt-color-on-surface-muted);transition:rotate var(--%NS%kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__hours-toggle[aria-expanded=true] .kpt-map-poi__chevron{rotate:180deg}.kpt-map-poi__week{display:grid;grid-template-columns:auto 1fr;gap:var(--%NS%kpt-space-1) var(--%NS%kpt-space-4);margin:0;padding:0 0 var(--%NS%kpt-space-3) calc(1em + var(--%NS%kpt-space-3))}.kpt-map-poi__week-day{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__week-hours{display:flex;flex-direction:column;margin:0}.kpt-map-poi__week-closed{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__rows{margin:0;padding:0;list-style:none}.kpt-map-poi__row{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;padding:var(--%NS%kpt-space-2) var(--%NS%kpt-space-2) var(--%NS%kpt-space-2) 0;margin-inline-start:calc(var(--%NS%kpt-space-2) * -1);padding-inline-start:var(--%NS%kpt-space-2);border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-sm)}.kpt-map-poi__row:hover,.kpt-map-poi__row:focus-within{background:var(--%NS%kpt-map-poi-row-hover, var(--%NS%kpt-color-surface-hover))}.kpt-map-poi__row-icon{flex:none;color:var(--%NS%kpt-color-primary)}.kpt-map-poi__row-value{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.kpt-map-poi__row-link{color:inherit;text-decoration:none}.kpt-map-poi__row-link:hover{text-decoration:underline}.kpt-map-poi__fact-label{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__fact-label:after{content:\"
|
|
3359
|
+
} }, dependencies: [KptButton, KptIcon, KptIconButton], styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-poi{display:flex;flex-direction:column;min-height:0;color:var(--%NS%kpt-color-on-surface);font-size:var(--%NS%kpt-font-size-sm);text-align:start}.kpt-map-poi__scroll{flex:0 1 auto;min-height:0;padding:0 var(--%NS%kpt-space-4) var(--%NS%kpt-space-4);overflow-y:auto;overscroll-behavior:contain}.kpt-map-poi__head{flex:none;padding:var(--%NS%kpt-space-4) var(--%NS%kpt-space-4) 0;display:flex;gap:var(--%NS%kpt-space-2);align-items:flex-start;justify-content:space-between}.kpt-map-poi__title{margin:0;font-size:var(--%NS%kpt-font-size-lg);font-weight:var(--%NS%kpt-font-weight-bold);line-height:1.25;letter-spacing:normal;text-transform:none}.kpt-map-poi__close{flex:none;margin:calc(var(--%NS%kpt-space-1) * -1) calc(var(--%NS%kpt-space-2) * -1) 0 0}.kpt-map-poi__meta{flex:none;display:flex;flex-wrap:wrap;gap:0 var(--%NS%kpt-space-2);margin:var(--%NS%kpt-space-1) 0 0;padding:0 var(--%NS%kpt-space-4) var(--%NS%kpt-space-3);border-bottom:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__distance{font-weight:var(--%NS%kpt-font-weight-bold)}.kpt-map-poi__address{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__media{margin-top:var(--%NS%kpt-space-4);overflow:hidden;border-radius:var(--%NS%kpt-map-poi-media-radius, var(--%NS%kpt-radius-md))}.kpt-map-poi__photo,.kpt-map-poi__photo-empty{display:block;width:100%;aspect-ratio:16/9}.kpt-map-poi__photo{object-fit:cover}.kpt-map-poi__photo-empty{display:grid;place-items:center;color:var(--%NS%kpt-color-text-subtle);background:var(--%NS%kpt-color-surface-sunken)}.kpt-map-poi__actions{display:flex;gap:var(--%NS%kpt-space-2);align-items:center;margin-top:var(--%NS%kpt-space-3);margin-bottom:var(--%NS%kpt-space-3)}.kpt-map-poi__cta{flex:1 1 auto;min-width:0}.kpt-map-poi__fav[data-on] .kpt-icon-button{color:var(--%NS%kpt-color-warning);border-color:var(--%NS%kpt-color-warning-border)}.kpt-map-poi__category{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;margin:0;padding:var(--%NS%kpt-space-3) 0;border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__category-icon{color:var(--%NS%_kpt-poi-color, var(--%NS%kpt-color-primary))}.kpt-map-poi__hours{border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border)}.kpt-map-poi__hours-toggle{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;width:100%;padding:var(--%NS%kpt-space-3) 0;font:inherit;color:inherit;text-align:start;background:none;border:0;cursor:pointer}.kpt-map-poi__hours-toggle:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:calc(var(--%NS%kpt-space-1) * -1)}.kpt-map-poi__status{font-weight:var(--%NS%kpt-font-weight-medium);color:var(--%NS%kpt-color-danger)}.kpt-map-poi__status[data-open=true]{color:var(--%NS%kpt-color-success)}.kpt-map-poi__status-hint{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__chevron{margin-inline-start:auto;color:var(--%NS%kpt-color-on-surface-muted);transition:rotate var(--%NS%kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__hours-toggle[aria-expanded=true] .kpt-map-poi__chevron{rotate:180deg}.kpt-map-poi__week{display:grid;grid-template-columns:auto 1fr;gap:var(--%NS%kpt-space-1) var(--%NS%kpt-space-4);margin:0;padding:0 0 var(--%NS%kpt-space-3) calc(1em + var(--%NS%kpt-space-3))}.kpt-map-poi__week-day{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__week-hours{display:flex;flex-direction:column;margin:0}.kpt-map-poi__week-closed{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__rows{margin:0;padding:0;list-style:none}.kpt-map-poi__row{display:flex;gap:var(--%NS%kpt-space-3);align-items:center;padding:var(--%NS%kpt-space-2) var(--%NS%kpt-space-2) var(--%NS%kpt-space-2) 0;margin-inline-start:calc(var(--%NS%kpt-space-2) * -1);padding-inline-start:var(--%NS%kpt-space-2);border-top:var(--%NS%kpt-border-width-thin) solid var(--%NS%kpt-color-border);border-radius:var(--%NS%kpt-radius-sm)}.kpt-map-poi__row:hover,.kpt-map-poi__row:focus-within{background:var(--%NS%kpt-map-poi-row-hover, var(--%NS%kpt-color-surface-hover))}.kpt-map-poi__row-icon{flex:none;color:var(--%NS%kpt-color-primary)}.kpt-map-poi__row-value{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.kpt-map-poi__row-link{color:inherit;text-decoration:none}.kpt-map-poi__row-link:hover{text-decoration:underline}.kpt-map-poi__fact-label{color:var(--%NS%kpt-color-on-surface-muted)}.kpt-map-poi__fact-label:after{content:\", \"}.kpt-map-poi__row-actions{display:flex;flex:none;gap:var(--%NS%kpt-space-1)}.kpt-map-poi__row-action{display:inline-grid;place-items:center;width:1.75rem;height:1.75rem;color:var(--%NS%kpt-color-on-surface-muted);background:none;border:0;border-radius:var(--%NS%kpt-radius-sm);cursor:pointer}.kpt-map-poi__row-action:hover{color:var(--%NS%kpt-color-primary);background:var(--%NS%kpt-color-surface-selected)}.kpt-map-poi__row-action:focus-visible{outline:var(--%NS%kpt-border-width-medium) solid var(--%NS%kpt-color-focus-ring);outline-offset:1px}@media(hover:hover)and (pointer:fine){.kpt-map-poi__row-actions{opacity:0;transition:opacity var(--%NS%kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__row:hover .kpt-map-poi__row-actions,.kpt-map-poi__row:focus-within .kpt-map-poi__row-actions{opacity:1}}.kpt-map-poi__live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"], encapsulation: 2 }); }
|
|
3293
3360
|
}
|
|
3294
3361
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KptMapPoiCard, [{
|
|
3295
3362
|
type: Component,
|
|
3296
|
-
args: [{ selector: 'kpt-map-poi-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptButton, KptIcon, KptIconButton], host: { class: 'kpt-map-poi' }, template: "<header class=\"kpt-map-poi__head\">\n <!--\n Nag\u0142\u00F3wek jako `role=\"heading\"`, nie `<h3>`: style komponent\u00F3w siedz\u0105 w `@layer\n kpt.components`, a CSS aplikacji spoza warstw wygrywa z nimi zawsze. Zwyk\u0142y `<h3>`\n \u0142apa\u0142by wi\u0119c ka\u017Cd\u0105 regu\u0142\u0119 `h3 { \u2026 }` z uk\u0142adu strony \u2014 a nag\u0142\u00F3wek sekcji strony\n i tytu\u0142 miejsca to dwie r\u00F3\u017Cne rzeczy. Dla czytnika ekranu to wci\u0105\u017C nag\u0142\u00F3wek poziomu 3.\n -->\n <p class=\"kpt-map-poi__title\" role=\"heading\" aria-level=\"3\">{{ poi().title }}</p>\n @if (closable()) {\n <kpt-icon-button\n class=\"kpt-map-poi__close\"\n variant=\"text\"\n size=\"sm\"\n [ariaLabel]=\"i18n.t('common.close')\"\n (click)=\"onClose()\"\n >\n <kpt-icon name=\"x\" />\n </kpt-icon-button>\n }\n</header>\n\n<p class=\"kpt-map-poi__meta\">\n @if (distanceLabel(); as distance) {\n <strong class=\"kpt-map-poi__distance\">{{ distance }}</strong>\n }\n @if (poi().address; as address) {\n <span class=\"kpt-map-poi__address\">{{ address }}</span>\n }\n</p>\n\n<!--\n Wszystko poni\u017Cej nag\u0142\u00F3wka przewija si\u0119 osobno. Kontenerem przewijania jest ten div,\n a nie popup mapy \u2014 inaczej tytu\u0142 z krzy\u017Cykiem odje\u017Cd\u017Ca\u0142by razem ze zdj\u0119ciem.\n-->\n<div class=\"kpt-map-poi__scroll\">\n <div class=\"kpt-map-poi__media\">\n @if (poi().photo; as photo) {\n <img\n class=\"kpt-map-poi__photo\"\n [src]=\"photo\"\n [alt]=\"poi().photoAlt ?? poi().title\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n } @else {\n <div class=\"kpt-map-poi__photo-empty\" [attr.aria-label]=\"i18n.t('map.poi.noPhoto')\" role=\"img\">\n <kpt-icon name=\"photo\" size=\"1.75rem\" />\n </div>\n }\n </div>\n\n <div class=\"kpt-map-poi__actions\">\n @if (primaryLabel()) {\n <kpt-button class=\"kpt-map-poi__cta\" size=\"sm\" fullWidth (click)=\"onPrimary()\">\n {{ primaryLabel() }}\n </kpt-button>\n }\n @if (showShare()) {\n <kpt-icon-button\n variant=\"outline\"\n size=\"sm\"\n [ariaLabel]=\"i18n.t('map.poi.share')\"\n (click)=\"share()\"\n >\n <kpt-icon name=\"share\" />\n </kpt-icon-button>\n }\n @if (showFavourite()) {\n <kpt-icon-button\n class=\"kpt-map-poi__fav\"\n variant=\"outline\"\n size=\"sm\"\n [ariaPressed]=\"favourite()\"\n [attr.data-on]=\"favourite() ? '' : null\"\n [ariaLabel]=\"favouriteLabel()\"\n (click)=\"toggleFavourite()\"\n >\n <kpt-icon name=\"star\" />\n </kpt-icon-button>\n }\n </div>\n\n @if (category(); as category) {\n <p class=\"kpt-map-poi__category\" [style.--_kpt-poi-color]=\"categoryColor()\">\n @if (category.icon) {\n <kpt-icon class=\"kpt-map-poi__category-icon\" [name]=\"category.icon\" />\n }\n {{ category.label }}\n </p>\n }\n\n @if (hasHours()) {\n <div class=\"kpt-map-poi__hours\">\n <button\n class=\"kpt-map-poi__hours-toggle\"\n type=\"button\"\n [attr.aria-expanded]=\"hoursExpanded()\"\n [attr.aria-controls]=\"hoursId\"\n (click)=\"toggleHours()\"\n >\n <kpt-icon class=\"kpt-map-poi__row-icon\" name=\"clock\" />\n <span class=\"kpt-map-poi__status\" [attr.data-open]=\"open() || alwaysOpen()\">\n {{ statusLabel() }}\n </span>\n @if (statusHint(); as hint) {\n <span class=\"kpt-map-poi__status-hint\">\u00B7 {{ hint }}</span>\n }\n <kpt-icon class=\"kpt-map-poi__chevron\" name=\"chevron-down\" />\n </button>\n\n @if (hoursExpanded()) {\n <dl class=\"kpt-map-poi__week\" [id]=\"hoursId\">\n @for (group of hoursGroups(); track group.label) {\n <dt class=\"kpt-map-poi__week-day\">{{ group.label }}</dt>\n <dd class=\"kpt-map-poi__week-hours\">\n @if (group.closed) {\n <span class=\"kpt-map-poi__week-closed\">{{ i18n.t('map.poi.closedDay') }}</span>\n } @else {\n @for (range of group.ranges; track range) {\n <span class=\"kpt-map-poi__week-range\">{{ range }}</span>\n }\n }\n </dd>\n }\n </dl>\n }\n </div>\n }\n\n @if (rows().length || poi().facts?.length) {\n <ul class=\"kpt-map-poi__rows\">\n @for (row of rows(); track row.kind) {\n <li class=\"kpt-map-poi__row\">\n <kpt-icon class=\"kpt-map-poi__row-icon\" [name]=\"row.icon\" />\n\n @if (row.href) {\n <a\n class=\"kpt-map-poi__row-value kpt-map-poi__row-link\"\n [href]=\"row.href\"\n [attr.target]=\"row.external ? '_blank' : null\"\n [attr.rel]=\"row.external ? 'noopener' : null\"\n >\n {{ row.text }}\n </a>\n } @else {\n <span class=\"kpt-map-poi__row-value\">{{ row.text }}</span>\n }\n\n <span class=\"kpt-map-poi__row-actions\">\n @if (row.href) {\n <a\n class=\"kpt-map-poi__row-action\"\n [href]=\"row.href\"\n [attr.target]=\"row.external ? '_blank' : null\"\n [attr.rel]=\"row.external ? 'noopener' : null\"\n [attr.aria-label]=\"row.actionLabel\"\n [title]=\"row.actionLabel\"\n >\n <kpt-icon [name]=\"row.actionIcon\" />\n </a>\n }\n @if (canCopy) {\n <button\n class=\"kpt-map-poi__row-action\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.poi.copy')\"\n [title]=\"i18n.t('map.poi.copy')\"\n (click)=\"copy(row)\"\n >\n <kpt-icon [name]=\"justCopied() === row.kind ? 'check' : 'copy'\" />\n </button>\n }\n </span>\n </li>\n }\n\n @for (fact of poi().facts ?? []; track fact.label) {\n <li class=\"kpt-map-poi__row kpt-map-poi__row--fact\">\n @if (fact.icon) {\n <kpt-icon class=\"kpt-map-poi__row-icon\" [name]=\"fact.icon\" />\n } @else {\n <span class=\"kpt-map-poi__row-icon\" aria-hidden=\"true\"></span>\n }\n <span class=\"kpt-map-poi__row-value\">\n <span class=\"kpt-map-poi__fact-label\">{{ fact.label }}</span>\n {{ fact.value }}\n </span>\n </li>\n }\n </ul>\n }\n\n <p class=\"kpt-map-poi__live\" aria-live=\"polite\">\n @if (justCopied()) {\n {{ i18n.t('map.poi.copied') }}\n }\n </p>\n</div>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-poi{display:flex;flex-direction:column;min-height:0;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm);text-align:start}.kpt-map-poi__scroll{flex:0 1 auto;min-height:0;padding:0 var(--kpt-space-4) var(--kpt-space-4);overflow-y:auto;overscroll-behavior:contain}.kpt-map-poi__head{flex:none;padding:var(--kpt-space-4) var(--kpt-space-4) 0;display:flex;gap:var(--kpt-space-2);align-items:flex-start;justify-content:space-between}.kpt-map-poi__title{margin:0;font-size:var(--kpt-font-size-lg);font-weight:var(--kpt-font-weight-bold);line-height:1.25;letter-spacing:normal;text-transform:none}.kpt-map-poi__close{flex:none;margin:calc(var(--kpt-space-1) * -1) calc(var(--kpt-space-2) * -1) 0 0}.kpt-map-poi__meta{flex:none;display:flex;flex-wrap:wrap;gap:0 var(--kpt-space-2);margin:var(--kpt-space-1) 0 0;padding:0 var(--kpt-space-4) var(--kpt-space-3);border-bottom:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__distance{font-weight:var(--kpt-font-weight-bold)}.kpt-map-poi__address{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__media{margin-top:var(--kpt-space-4);overflow:hidden;border-radius:var(--kpt-map-poi-media-radius, var(--kpt-radius-md))}.kpt-map-poi__photo,.kpt-map-poi__photo-empty{display:block;width:100%;aspect-ratio:16/9}.kpt-map-poi__photo{object-fit:cover}.kpt-map-poi__photo-empty{display:grid;place-items:center;color:var(--kpt-color-text-subtle);background:var(--kpt-color-surface-sunken)}.kpt-map-poi__actions{display:flex;gap:var(--kpt-space-2);align-items:center;margin-top:var(--kpt-space-3);margin-bottom:var(--kpt-space-3)}.kpt-map-poi__cta{flex:1 1 auto;min-width:0}.kpt-map-poi__fav[data-on] .kpt-icon-button{color:var(--kpt-color-warning);border-color:var(--kpt-color-warning-border)}.kpt-map-poi__category{display:flex;gap:var(--kpt-space-3);align-items:center;margin:0;padding:var(--kpt-space-3) 0;border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__category-icon{color:var(--_kpt-poi-color, var(--kpt-color-primary))}.kpt-map-poi__hours{border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__hours-toggle{display:flex;gap:var(--kpt-space-3);align-items:center;width:100%;padding:var(--kpt-space-3) 0;font:inherit;color:inherit;text-align:start;background:none;border:0;cursor:pointer}.kpt-map-poi__hours-toggle:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:calc(var(--kpt-space-1) * -1)}.kpt-map-poi__status{font-weight:var(--kpt-font-weight-medium);color:var(--kpt-color-danger)}.kpt-map-poi__status[data-open=true]{color:var(--kpt-color-success)}.kpt-map-poi__status-hint{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__chevron{margin-inline-start:auto;color:var(--kpt-color-on-surface-muted);transition:rotate var(--kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__hours-toggle[aria-expanded=true] .kpt-map-poi__chevron{rotate:180deg}.kpt-map-poi__week{display:grid;grid-template-columns:auto 1fr;gap:var(--kpt-space-1) var(--kpt-space-4);margin:0;padding:0 0 var(--kpt-space-3) calc(1em + var(--kpt-space-3))}.kpt-map-poi__week-day{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__week-hours{display:flex;flex-direction:column;margin:0}.kpt-map-poi__week-closed{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__rows{margin:0;padding:0;list-style:none}.kpt-map-poi__row{display:flex;gap:var(--kpt-space-3);align-items:center;padding:var(--kpt-space-2) var(--kpt-space-2) var(--kpt-space-2) 0;margin-inline-start:calc(var(--kpt-space-2) * -1);padding-inline-start:var(--kpt-space-2);border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-sm)}.kpt-map-poi__row:hover,.kpt-map-poi__row:focus-within{background:var(--kpt-map-poi-row-hover, var(--kpt-color-surface-hover))}.kpt-map-poi__row-icon{flex:none;color:var(--kpt-color-primary)}.kpt-map-poi__row-value{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.kpt-map-poi__row-link{color:inherit;text-decoration:none}.kpt-map-poi__row-link:hover{text-decoration:underline}.kpt-map-poi__fact-label{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__fact-label:after{content:\" \\b7 \"}.kpt-map-poi__row-actions{display:flex;flex:none;gap:var(--kpt-space-1)}.kpt-map-poi__row-action{display:inline-grid;place-items:center;width:1.75rem;height:1.75rem;color:var(--kpt-color-on-surface-muted);background:none;border:0;border-radius:var(--kpt-radius-sm);cursor:pointer}.kpt-map-poi__row-action:hover{color:var(--kpt-color-primary);background:var(--kpt-color-surface-selected)}.kpt-map-poi__row-action:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}@media(hover:hover)and (pointer:fine){.kpt-map-poi__row-actions{opacity:0;transition:opacity var(--kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__row:hover .kpt-map-poi__row-actions,.kpt-map-poi__row:focus-within .kpt-map-poi__row-actions{opacity:1}}.kpt-map-poi__live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"] }]
|
|
3363
|
+
args: [{ selector: 'kpt-map-poi-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [KptButton, KptIcon, KptIconButton], host: { class: 'kpt-map-poi' }, template: "<header class=\"kpt-map-poi__head\">\n <!--\n Nag\u0142\u00F3wek jako `role=\"heading\"`, nie `<h3>`: style komponent\u00F3w siedz\u0105 w `@layer\n kpt.components`, a CSS aplikacji spoza warstw wygrywa z nimi zawsze. Zwyk\u0142y `<h3>`\n \u0142apa\u0142by wi\u0119c ka\u017Cd\u0105 regu\u0142\u0119 `h3 { ... }` z uk\u0142adu strony - a nag\u0142\u00F3wek sekcji strony\n i tytu\u0142 miejsca to dwie r\u00F3\u017Cne rzeczy. Dla czytnika ekranu to wci\u0105\u017C nag\u0142\u00F3wek poziomu 3.\n -->\n <p class=\"kpt-map-poi__title\" role=\"heading\" aria-level=\"3\">{{ poi().title }}</p>\n @if (closable()) {\n <kpt-icon-button\n class=\"kpt-map-poi__close\"\n variant=\"text\"\n size=\"sm\"\n [ariaLabel]=\"i18n.t('common.close')\"\n (click)=\"onClose()\"\n >\n <kpt-icon name=\"x\" />\n </kpt-icon-button>\n }\n</header>\n\n<p class=\"kpt-map-poi__meta\">\n @if (distanceLabel(); as distance) {\n <strong class=\"kpt-map-poi__distance\">{{ distance }}</strong>\n }\n @if (poi().address; as address) {\n <span class=\"kpt-map-poi__address\">{{ address }}</span>\n }\n</p>\n\n<!--\n Wszystko poni\u017Cej nag\u0142\u00F3wka przewija si\u0119 osobno. Kontenerem przewijania jest ten div,\n a nie popup mapy - inaczej tytu\u0142 z krzy\u017Cykiem odje\u017Cd\u017Ca\u0142by razem ze zdj\u0119ciem.\n-->\n<div class=\"kpt-map-poi__scroll\">\n <div class=\"kpt-map-poi__media\">\n @if (poi().photo; as photo) {\n <img\n class=\"kpt-map-poi__photo\"\n [src]=\"photo\"\n [alt]=\"poi().photoAlt ?? poi().title\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n } @else {\n <div class=\"kpt-map-poi__photo-empty\" [attr.aria-label]=\"i18n.t('map.poi.noPhoto')\" role=\"img\">\n <kpt-icon name=\"photo\" size=\"1.75rem\" />\n </div>\n }\n </div>\n\n <div class=\"kpt-map-poi__actions\">\n @if (primaryLabel()) {\n <kpt-button class=\"kpt-map-poi__cta\" size=\"sm\" fullWidth (click)=\"onPrimary()\">\n {{ primaryLabel() }}\n </kpt-button>\n }\n @if (showShare()) {\n <kpt-icon-button\n variant=\"outline\"\n size=\"sm\"\n [ariaLabel]=\"i18n.t('map.poi.share')\"\n (click)=\"share()\"\n >\n <kpt-icon name=\"share\" />\n </kpt-icon-button>\n }\n @if (showFavourite()) {\n <kpt-icon-button\n class=\"kpt-map-poi__fav\"\n variant=\"outline\"\n size=\"sm\"\n [ariaPressed]=\"favourite()\"\n [attr.data-on]=\"favourite() ? '' : null\"\n [ariaLabel]=\"favouriteLabel()\"\n (click)=\"toggleFavourite()\"\n >\n <kpt-icon name=\"star\" />\n </kpt-icon-button>\n }\n </div>\n\n @if (category(); as category) {\n <p class=\"kpt-map-poi__category\" [style.--_kpt-poi-color]=\"categoryColor()\">\n @if (category.icon) {\n <kpt-icon class=\"kpt-map-poi__category-icon\" [name]=\"category.icon\" />\n }\n {{ category.label }}\n </p>\n }\n\n @if (hasHours()) {\n <div class=\"kpt-map-poi__hours\">\n <button\n class=\"kpt-map-poi__hours-toggle\"\n type=\"button\"\n [attr.aria-expanded]=\"hoursExpanded()\"\n [attr.aria-controls]=\"hoursId\"\n (click)=\"toggleHours()\"\n >\n <kpt-icon class=\"kpt-map-poi__row-icon\" name=\"clock\" />\n <span class=\"kpt-map-poi__status\" [attr.data-open]=\"open() || alwaysOpen()\">\n {{ statusLabel() }}\n </span>\n @if (statusHint(); as hint) {\n <span class=\"kpt-map-poi__status-hint\">, {{ hint }}</span>\n }\n <kpt-icon class=\"kpt-map-poi__chevron\" name=\"chevron-down\" />\n </button>\n\n @if (hoursExpanded()) {\n <dl class=\"kpt-map-poi__week\" [id]=\"hoursId\">\n @for (group of hoursGroups(); track group.label) {\n <dt class=\"kpt-map-poi__week-day\">{{ group.label }}</dt>\n <dd class=\"kpt-map-poi__week-hours\">\n @if (group.closed) {\n <span class=\"kpt-map-poi__week-closed\">{{ i18n.t('map.poi.closedDay') }}</span>\n } @else {\n @for (range of group.ranges; track range) {\n <span class=\"kpt-map-poi__week-range\">{{ range }}</span>\n }\n }\n </dd>\n }\n </dl>\n }\n </div>\n }\n\n @if (rows().length || poi().facts?.length) {\n <ul class=\"kpt-map-poi__rows\">\n @for (row of rows(); track row.kind) {\n <li class=\"kpt-map-poi__row\">\n <kpt-icon class=\"kpt-map-poi__row-icon\" [name]=\"row.icon\" />\n\n @if (row.href) {\n <a\n class=\"kpt-map-poi__row-value kpt-map-poi__row-link\"\n [href]=\"row.href\"\n [attr.target]=\"row.external ? '_blank' : null\"\n [attr.rel]=\"row.external ? 'noopener noreferrer' : null\"\n >\n {{ row.text }}\n </a>\n } @else {\n <span class=\"kpt-map-poi__row-value\">{{ row.text }}</span>\n }\n\n <span class=\"kpt-map-poi__row-actions\">\n @if (row.href) {\n <a\n class=\"kpt-map-poi__row-action\"\n [href]=\"row.href\"\n [attr.target]=\"row.external ? '_blank' : null\"\n [attr.rel]=\"row.external ? 'noopener noreferrer' : null\"\n [attr.aria-label]=\"row.actionLabel\"\n [title]=\"row.actionLabel\"\n >\n <kpt-icon [name]=\"row.actionIcon\" />\n </a>\n }\n @if (canCopy) {\n <button\n class=\"kpt-map-poi__row-action\"\n type=\"button\"\n [attr.aria-label]=\"i18n.t('map.poi.copy')\"\n [title]=\"i18n.t('map.poi.copy')\"\n (click)=\"copy(row)\"\n >\n <kpt-icon [name]=\"justCopied() === row.kind ? 'check' : 'copy'\" />\n </button>\n }\n </span>\n </li>\n }\n\n @for (fact of poi().facts ?? []; track fact.label) {\n <li class=\"kpt-map-poi__row kpt-map-poi__row--fact\">\n @if (fact.icon) {\n <kpt-icon class=\"kpt-map-poi__row-icon\" [name]=\"fact.icon\" />\n } @else {\n <span class=\"kpt-map-poi__row-icon\" aria-hidden=\"true\"></span>\n }\n <span class=\"kpt-map-poi__row-value\">\n <span class=\"kpt-map-poi__fact-label\">{{ fact.label }}</span>\n {{ fact.value }}\n </span>\n </li>\n }\n </ul>\n }\n\n <p class=\"kpt-map-poi__live\" aria-live=\"polite\">\n @if (justCopied()) {\n {{ i18n.t('map.poi.copied') }}\n }\n </p>\n</div>\n", styles: ["@charset \"UTF-8\";@layer kpt.components{.kpt-map-poi{display:flex;flex-direction:column;min-height:0;color:var(--kpt-color-on-surface);font-size:var(--kpt-font-size-sm);text-align:start}.kpt-map-poi__scroll{flex:0 1 auto;min-height:0;padding:0 var(--kpt-space-4) var(--kpt-space-4);overflow-y:auto;overscroll-behavior:contain}.kpt-map-poi__head{flex:none;padding:var(--kpt-space-4) var(--kpt-space-4) 0;display:flex;gap:var(--kpt-space-2);align-items:flex-start;justify-content:space-between}.kpt-map-poi__title{margin:0;font-size:var(--kpt-font-size-lg);font-weight:var(--kpt-font-weight-bold);line-height:1.25;letter-spacing:normal;text-transform:none}.kpt-map-poi__close{flex:none;margin:calc(var(--kpt-space-1) * -1) calc(var(--kpt-space-2) * -1) 0 0}.kpt-map-poi__meta{flex:none;display:flex;flex-wrap:wrap;gap:0 var(--kpt-space-2);margin:var(--kpt-space-1) 0 0;padding:0 var(--kpt-space-4) var(--kpt-space-3);border-bottom:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__distance{font-weight:var(--kpt-font-weight-bold)}.kpt-map-poi__address{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__media{margin-top:var(--kpt-space-4);overflow:hidden;border-radius:var(--kpt-map-poi-media-radius, var(--kpt-radius-md))}.kpt-map-poi__photo,.kpt-map-poi__photo-empty{display:block;width:100%;aspect-ratio:16/9}.kpt-map-poi__photo{object-fit:cover}.kpt-map-poi__photo-empty{display:grid;place-items:center;color:var(--kpt-color-text-subtle);background:var(--kpt-color-surface-sunken)}.kpt-map-poi__actions{display:flex;gap:var(--kpt-space-2);align-items:center;margin-top:var(--kpt-space-3);margin-bottom:var(--kpt-space-3)}.kpt-map-poi__cta{flex:1 1 auto;min-width:0}.kpt-map-poi__fav[data-on] .kpt-icon-button{color:var(--kpt-color-warning);border-color:var(--kpt-color-warning-border)}.kpt-map-poi__category{display:flex;gap:var(--kpt-space-3);align-items:center;margin:0;padding:var(--kpt-space-3) 0;border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__category-icon{color:var(--_kpt-poi-color, var(--kpt-color-primary))}.kpt-map-poi__hours{border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border)}.kpt-map-poi__hours-toggle{display:flex;gap:var(--kpt-space-3);align-items:center;width:100%;padding:var(--kpt-space-3) 0;font:inherit;color:inherit;text-align:start;background:none;border:0;cursor:pointer}.kpt-map-poi__hours-toggle:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:calc(var(--kpt-space-1) * -1)}.kpt-map-poi__status{font-weight:var(--kpt-font-weight-medium);color:var(--kpt-color-danger)}.kpt-map-poi__status[data-open=true]{color:var(--kpt-color-success)}.kpt-map-poi__status-hint{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__chevron{margin-inline-start:auto;color:var(--kpt-color-on-surface-muted);transition:rotate var(--kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__hours-toggle[aria-expanded=true] .kpt-map-poi__chevron{rotate:180deg}.kpt-map-poi__week{display:grid;grid-template-columns:auto 1fr;gap:var(--kpt-space-1) var(--kpt-space-4);margin:0;padding:0 0 var(--kpt-space-3) calc(1em + var(--kpt-space-3))}.kpt-map-poi__week-day{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__week-hours{display:flex;flex-direction:column;margin:0}.kpt-map-poi__week-closed{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__rows{margin:0;padding:0;list-style:none}.kpt-map-poi__row{display:flex;gap:var(--kpt-space-3);align-items:center;padding:var(--kpt-space-2) var(--kpt-space-2) var(--kpt-space-2) 0;margin-inline-start:calc(var(--kpt-space-2) * -1);padding-inline-start:var(--kpt-space-2);border-top:var(--kpt-border-width-thin) solid var(--kpt-color-border);border-radius:var(--kpt-radius-sm)}.kpt-map-poi__row:hover,.kpt-map-poi__row:focus-within{background:var(--kpt-map-poi-row-hover, var(--kpt-color-surface-hover))}.kpt-map-poi__row-icon{flex:none;color:var(--kpt-color-primary)}.kpt-map-poi__row-value{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.kpt-map-poi__row-link{color:inherit;text-decoration:none}.kpt-map-poi__row-link:hover{text-decoration:underline}.kpt-map-poi__fact-label{color:var(--kpt-color-on-surface-muted)}.kpt-map-poi__fact-label:after{content:\", \"}.kpt-map-poi__row-actions{display:flex;flex:none;gap:var(--kpt-space-1)}.kpt-map-poi__row-action{display:inline-grid;place-items:center;width:1.75rem;height:1.75rem;color:var(--kpt-color-on-surface-muted);background:none;border:0;border-radius:var(--kpt-radius-sm);cursor:pointer}.kpt-map-poi__row-action:hover{color:var(--kpt-color-primary);background:var(--kpt-color-surface-selected)}.kpt-map-poi__row-action:focus-visible{outline:var(--kpt-border-width-medium) solid var(--kpt-color-focus-ring);outline-offset:1px}@media(hover:hover)and (pointer:fine){.kpt-map-poi__row-actions{opacity:0;transition:opacity var(--kpt-motion-duration-fast, .15s) ease}.kpt-map-poi__row:hover .kpt-map-poi__row-actions,.kpt-map-poi__row:focus-within .kpt-map-poi__row-actions{opacity:1}}.kpt-map-poi__live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}\n"] }]
|
|
3297
3364
|
}], null, { poi: [{ type: i0.Input, args: [{ isSignal: true, alias: "poi", required: true }] }], distance: [{ type: i0.Input, args: [{ isSignal: true, alias: "distance", required: false }] }], category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: false }] }], primaryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryLabel", required: false }] }], showShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "showShare", required: false }] }], showFavourite: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFavourite", required: false }] }], favourite: [{ type: i0.Input, args: [{ isSignal: true, alias: "favourite", required: false }] }, { type: i0.Output, args: ["favouriteChange"] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], hoursExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoursExpanded", required: false }] }, { type: i0.Output, args: ["hoursExpandedChange"] }], primaryAction: [{ type: i0.Output, args: ["primaryAction"] }], closed: [{ type: i0.Output, args: ["closed"] }], shared: [{ type: i0.Output, args: ["shared"] }] }); })();
|
|
3298
3365
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(KptMapPoiCard, { className: "KptMapPoiCard", filePath: "lib/map-poi-card.component.ts", lineNumber: 69 }); })();
|
|
3299
3366
|
|
|
3300
3367
|
/*
|
|
3301
|
-
* Public API
|
|
3368
|
+
* Public API - @konce-pt/angular/map
|
|
3302
3369
|
* Mapa z konfigurowalnymi znacznikami (Leaflet + OpenStreetMap). Rdzeń obliczeń i adaptery
|
|
3303
|
-
* silników mieszkają w `@konce-pt/map`
|
|
3370
|
+
* silników mieszkają w `@konce-pt/map` - paczce bez frameworka, wspólnej z portem Reacta;
|
|
3304
3371
|
* tu tylko re-eksport, żeby publiczne API subpathu się nie zmieniło.
|
|
3305
3372
|
*
|
|
3306
3373
|
* Wymaga zależności opcjonalnej `leaflet` i dołączenia `leaflet/dist/leaflet.css`
|