@forgeroute/ui 0.4.92 → 0.4.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/forgeroute-ui-map.mjs +11 -4
- package/fesm2022/forgeroute-ui-map.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +37 -13
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui.mjs +164 -79
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-map.d.ts +4 -0
- package/types/forgeroute-ui-messaging.d.ts +17 -7
- package/types/forgeroute-ui.d.ts +105 -56
|
@@ -2196,6 +2196,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2196
2196
|
this.pointLng = signal(null, ...ngDevMode ? [{ debugName: "pointLng" }] : /* istanbul ignore next */ []);
|
|
2197
2197
|
this.points = signal([], ...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
|
|
2198
2198
|
this.touched = signal(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
|
|
2199
|
+
this.pointsTouched = signal(false, ...ngDevMode ? [{ debugName: "pointsTouched" }] : /* istanbul ignore next */ []);
|
|
2199
2200
|
this.pointTouched = signal(false, ...ngDevMode ? [{ debugName: "pointTouched" }] : /* istanbul ignore next */ []);
|
|
2200
2201
|
this.announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
|
|
2201
2202
|
this.lastApplied = null;
|
|
@@ -2257,6 +2258,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2257
2258
|
}
|
|
2258
2259
|
return out;
|
|
2259
2260
|
}, ...ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []);
|
|
2261
|
+
this.pointsMessage = computed(() => this.touched() && this.pointsTouched() ? this.errors().points : "", ...ngDevMode ? [{ debugName: "pointsMessage" }] : /* istanbul ignore next */ []);
|
|
2260
2262
|
this.hasErrors = computed(() => Object.entries(this.errors()).some(([field, m]) => m !== "" && field !== "pointLat" && field !== "pointLng"), ...ngDevMode ? [{ debugName: "hasErrors" }] : /* istanbul ignore next */ []);
|
|
2261
2263
|
effect(() => {
|
|
2262
2264
|
const unit = this.defaultUnit();
|
|
@@ -2290,6 +2292,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2290
2292
|
if (value !== "circle" && value !== "rectangle" && value !== "polygon") return;
|
|
2291
2293
|
this.shape.set(value);
|
|
2292
2294
|
this.touched.set(false);
|
|
2295
|
+
this.pointsTouched.set(false);
|
|
2293
2296
|
this.pointTouched.set(false);
|
|
2294
2297
|
}
|
|
2295
2298
|
setUnit(value) {
|
|
@@ -2301,6 +2304,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2301
2304
|
}
|
|
2302
2305
|
addPoint() {
|
|
2303
2306
|
this.pointTouched.set(true);
|
|
2307
|
+
this.pointsTouched.set(true);
|
|
2304
2308
|
const la = this.pointLat();
|
|
2305
2309
|
const ln = this.pointLng();
|
|
2306
2310
|
if (la === null || ln === null || !isValidLat(la) || !isValidLng(ln)) return;
|
|
@@ -2313,6 +2317,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2313
2317
|
this.pointTouched.set(false);
|
|
2314
2318
|
}
|
|
2315
2319
|
removePoint(index) {
|
|
2320
|
+
this.pointsTouched.set(true);
|
|
2316
2321
|
this.points.update((list) => list.filter((_, i) => i !== index));
|
|
2317
2322
|
}
|
|
2318
2323
|
apply() {
|
|
@@ -2361,6 +2366,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2361
2366
|
}
|
|
2362
2367
|
fillFrom(a) {
|
|
2363
2368
|
this.touched.set(false);
|
|
2369
|
+
this.pointsTouched.set(false);
|
|
2364
2370
|
this.pointTouched.set(false);
|
|
2365
2371
|
if (a.type === "circle") {
|
|
2366
2372
|
this.shape.set("circle");
|
|
@@ -2381,6 +2387,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2381
2387
|
}
|
|
2382
2388
|
reset() {
|
|
2383
2389
|
this.touched.set(false);
|
|
2390
|
+
this.pointsTouched.set(false);
|
|
2384
2391
|
this.pointTouched.set(false);
|
|
2385
2392
|
for (const s of [
|
|
2386
2393
|
this.lat,
|
|
@@ -2494,7 +2501,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2494
2501
|
<div class="maf-actions">
|
|
2495
2502
|
<ui-button variant="secondary" size="sm" [disabled]="readOnly()" (click)="addPoint()">{{ labels.t('map.form.addPoint') }}</ui-button>
|
|
2496
2503
|
</div>
|
|
2497
|
-
<div role="group" [attr.aria-label]="labels.t('map.form.pointsLabel')">
|
|
2504
|
+
<div role="group" [attr.aria-label]="labels.t('map.form.pointsLabel')" (focusout)="pointsTouched.set(true)">
|
|
2498
2505
|
@if (points().length === 0) {
|
|
2499
2506
|
<p class="maf-empty">{{ labels.t('map.form.noPoints') }}</p>
|
|
2500
2507
|
} @else {
|
|
@@ -2509,7 +2516,7 @@ var MapAreaFormComponent = class MapAreaFormComponent {
|
|
|
2509
2516
|
}
|
|
2510
2517
|
</ul>
|
|
2511
2518
|
}
|
|
2512
|
-
@if (
|
|
2519
|
+
@if (pointsMessage(); as message) { <p class="maf-error" role="alert">{{ message }}</p> }
|
|
2513
2520
|
</div>
|
|
2514
2521
|
}
|
|
2515
2522
|
}
|
|
@@ -2725,7 +2732,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2725
2732
|
<div class="maf-actions">
|
|
2726
2733
|
<ui-button variant="secondary" size="sm" [disabled]="readOnly()" (click)="addPoint()">{{ labels.t('map.form.addPoint') }}</ui-button>
|
|
2727
2734
|
</div>
|
|
2728
|
-
<div role="group" [attr.aria-label]="labels.t('map.form.pointsLabel')">
|
|
2735
|
+
<div role="group" [attr.aria-label]="labels.t('map.form.pointsLabel')" (focusout)="pointsTouched.set(true)">
|
|
2729
2736
|
@if (points().length === 0) {
|
|
2730
2737
|
<p class="maf-empty">{{ labels.t('map.form.noPoints') }}</p>
|
|
2731
2738
|
} @else {
|
|
@@ -2740,7 +2747,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2740
2747
|
}
|
|
2741
2748
|
</ul>
|
|
2742
2749
|
}
|
|
2743
|
-
@if (
|
|
2750
|
+
@if (pointsMessage(); as message) { <p class="maf-error" role="alert">{{ message }}</p> }
|
|
2744
2751
|
</div>
|
|
2745
2752
|
}
|
|
2746
2753
|
}
|