@webilix/ngx-helper-m3 0.0.29 → 0.0.32
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/webilix-ngx-helper-m3.mjs +379 -15
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -1
- package/index.d.ts +38 -2
- package/ngx-helper-m3.css +128 -1
- package/package.json +2 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, makeEnvironmentProviders, Injector, Input, HostBinding, Component, Pipe, Injectable, Optional, Inject, EventEmitter, Output, inject, createComponent, HostListener, Directive } from '@angular/core';
|
3
|
-
import { NgComponentOutlet, NgClass } from '@angular/common';
|
3
|
+
import { NgComponentOutlet, NgClass, DecimalPipe } from '@angular/common';
|
4
4
|
import * as i1$1 from '@angular/material/button';
|
5
5
|
import { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';
|
6
6
|
import { MatDivider } from '@angular/material/divider';
|
@@ -21,7 +21,7 @@ import * as i1$3 from '@angular/forms';
|
|
21
21
|
import { FormsModule } from '@angular/forms';
|
22
22
|
import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
|
23
23
|
import { Map, View, Feature } from 'ol';
|
24
|
-
import { Point } from 'ol/geom';
|
24
|
+
import { Point, LineString } from 'ol/geom';
|
25
25
|
import interactionDoubleClickZoom from 'ol/interaction/DoubleClickZoom';
|
26
26
|
import TileLayer from 'ol/layer/Tile';
|
27
27
|
import VectorLayer from 'ol/layer/Vector';
|
@@ -31,6 +31,8 @@ import { trigger, transition, style, animate } from '@angular/animations';
|
|
31
31
|
import * as i1$5 from '@angular/common/http';
|
32
32
|
import { HttpHeaders, HttpEventType } from '@angular/common/http';
|
33
33
|
import * as i1$4 from '@angular/platform-browser';
|
34
|
+
import * as i1$6 from '@angular/cdk/drag-drop';
|
35
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
34
36
|
|
35
37
|
const NGX_HELPER_CONFIG = new InjectionToken('NGX-HELPER-CONFIG');
|
36
38
|
const provideNgxHelperConfig = (config) => {
|
@@ -1336,7 +1338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
1336
1338
|
args: [{ providedIn: 'root' }]
|
1337
1339
|
}], ctorParameters: () => [{ type: i1$2.MatBottomSheet }, { type: i2$1.MatDialog }] });
|
1338
1340
|
|
1339
|
-
class GetComponent {
|
1341
|
+
let GetComponent$1 = class GetComponent {
|
1340
1342
|
className = 'ngx-helper-m3-coordinates';
|
1341
1343
|
coordinates;
|
1342
1344
|
config;
|
@@ -1415,18 +1417,26 @@ class GetComponent {
|
|
1415
1417
|
this.coordinates = { latitude: this.coordinate[1], longitude: this.coordinate[0] };
|
1416
1418
|
this.addLayer();
|
1417
1419
|
}
|
1420
|
+
checkEscape(event) {
|
1421
|
+
if (!(event instanceof KeyboardEvent))
|
1422
|
+
return;
|
1423
|
+
if (event.code === 'Escape') {
|
1424
|
+
event.preventDefault();
|
1425
|
+
this.close();
|
1426
|
+
}
|
1427
|
+
}
|
1418
1428
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1419
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: GetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "get" }, properties: { "className": "this.className" } }, providers: [provideNgxMask()], ngImport: i0, template: "<div\n id=\"ngx-helper-m3-coordinates-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.latitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #latitudeInput\n />\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.longitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #longitudeInput\n />\n </div>\n <div class=\"buttons\">\n <mat-icon [class.disabled]=\"!coordinates\" (click)=\"selectCoordinates()\">done_all</mat-icon>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
1420
|
-
}
|
1421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GetComponent, decorators: [{
|
1429
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: GetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "get" }, listeners: { "window:keydown": "checkEscape($event)" }, properties: { "className": "this.className" } }, providers: [provideNgxMask()], ngImport: i0, template: "<div\n id=\"ngx-helper-m3-coordinates-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.latitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #latitudeInput\n />\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.longitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #longitudeInput\n />\n </div>\n <div class=\"buttons\">\n <mat-icon [class.disabled]=\"!coordinates\" (click)=\"selectCoordinates()\">done_all</mat-icon>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
1430
|
+
};
|
1431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GetComponent$1, decorators: [{
|
1422
1432
|
type: Component,
|
1423
|
-
args: [{ host: { selector: 'get' }, imports: [FormsModule, NgxMaskDirective, MatIcon], providers: [provideNgxMask()], template: "<div\n id=\"ngx-helper-m3-coordinates-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.latitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #latitudeInput\n />\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.longitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #longitudeInput\n />\n </div>\n <div class=\"buttons\">\n <mat-icon [class.disabled]=\"!coordinates\" (click)=\"selectCoordinates()\">done_all</mat-icon>\n </div>\n</div>\n" }]
|
1433
|
+
args: [{ host: { selector: 'get', '(window:keydown)': 'checkEscape($event)' }, imports: [FormsModule, NgxMaskDirective, MatIcon], providers: [provideNgxMask()], template: "<div\n id=\"ngx-helper-m3-coordinates-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.latitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #latitudeInput\n />\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <input\n type=\"text\"\n maxlength=\"15\"\n inputmode=\"numeric\"\n [ngModel]=\"coordinates?.longitude\"\n mask=\"separator.12\"\n thousandSeparator=\"\"\n decimalMarker=\".\"\n [allowNegativeNumbers]=\"true\"\n [inputTransformFn]=\"inputTransformFn\"\n (keyup.enter)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n (blur)=\"checkInputs(latitudeInput.value, longitudeInput.value)\"\n #longitudeInput\n />\n </div>\n <div class=\"buttons\">\n <mat-icon [class.disabled]=\"!coordinates\" (click)=\"selectCoordinates()\">done_all</mat-icon>\n </div>\n</div>\n" }]
|
1424
1434
|
}], propDecorators: { className: [{
|
1425
1435
|
type: HostBinding,
|
1426
1436
|
args: ['className']
|
1427
1437
|
}] } });
|
1428
1438
|
|
1429
|
-
class ShowComponent {
|
1439
|
+
let ShowComponent$1 = class ShowComponent {
|
1430
1440
|
className = 'ngx-helper-m3-coordinates';
|
1431
1441
|
coordinates;
|
1432
1442
|
config;
|
@@ -1463,12 +1473,20 @@ class ShowComponent {
|
|
1463
1473
|
this.copied = type;
|
1464
1474
|
this.copyTimeout = setTimeout(() => (this.copied = undefined), 1000);
|
1465
1475
|
}
|
1476
|
+
checkEscape(event) {
|
1477
|
+
if (!(event instanceof KeyboardEvent))
|
1478
|
+
return;
|
1479
|
+
if (event.code === 'Escape') {
|
1480
|
+
event.preventDefault();
|
1481
|
+
this.close();
|
1482
|
+
}
|
1483
|
+
}
|
1466
1484
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1467
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: ShowComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "show" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div id=\"ngx-helper-m3-coordinates-map\" class=\"map\"></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <div class=\"value\">{{ coordinates.latitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.latitude.toString()\" (click)=\"setCopy('LATITUDE')\">\n {{ copied === 'LATITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <div class=\"value\">{{ coordinates.longitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.longitude.toString()\" (click)=\"setCopy('LONGITUDE')\">\n {{ copied === 'LONGITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
1468
|
-
}
|
1469
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, decorators: [{
|
1485
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: ShowComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "show" }, listeners: { "window:keydown": "checkEscape($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div id=\"ngx-helper-m3-coordinates-map\" class=\"map\"></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <div class=\"value\">{{ coordinates.latitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.latitude.toString()\" (click)=\"setCopy('LATITUDE')\">\n {{ copied === 'LATITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <div class=\"value\">{{ coordinates.longitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.longitude.toString()\" (click)=\"setCopy('LONGITUDE')\">\n {{ copied === 'LONGITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
1486
|
+
};
|
1487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent$1, decorators: [{
|
1470
1488
|
type: Component,
|
1471
|
-
args: [{ host: { selector: 'show' }, imports: [ClipboardModule, MatIcon], template: "<div id=\"ngx-helper-m3-coordinates-map\" class=\"map\"></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <div class=\"value\">{{ coordinates.latitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.latitude.toString()\" (click)=\"setCopy('LATITUDE')\">\n {{ copied === 'LATITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <div class=\"value\">{{ coordinates.longitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.longitude.toString()\" (click)=\"setCopy('LONGITUDE')\">\n {{ copied === 'LONGITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n</div>\n" }]
|
1489
|
+
args: [{ host: { selector: 'show', '(window:keydown)': 'checkEscape($event)' }, imports: [ClipboardModule, MatIcon], template: "<div id=\"ngx-helper-m3-coordinates-map\" class=\"map\"></div>\n\n<div class=\"coordinates\">\n <div class=\"header\">\n <div class=\"title\">COORDINATES</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LATITUDE</div>\n <div class=\"value\">{{ coordinates.latitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.latitude.toString()\" (click)=\"setCopy('LATITUDE')\">\n {{ copied === 'LATITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n <div class=\"item\">\n <div class=\"title\">LONGITUDE</div>\n <div class=\"value\">{{ coordinates.longitude.toFixed(7) }}</div>\n <mat-icon [cdkCopyToClipboard]=\"coordinates.longitude.toString()\" (click)=\"setCopy('LONGITUDE')\">\n {{ copied === 'LONGITUDE' ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n</div>\n" }]
|
1472
1490
|
}], propDecorators: { className: [{
|
1473
1491
|
type: HostBinding,
|
1474
1492
|
args: ['className']
|
@@ -1485,7 +1503,7 @@ class NgxHelperCoordinatesService {
|
|
1485
1503
|
const coordinates = arg1 ? ('latitude' in arg1 ? arg1 : undefined) : undefined;
|
1486
1504
|
const config = arg2 || (arg1 && !coordinates ? arg1 : undefined);
|
1487
1505
|
return new Promise((resolve, reject) => {
|
1488
|
-
const componentRef = createComponent(GetComponent, {
|
1506
|
+
const componentRef = createComponent(GetComponent$1, {
|
1489
1507
|
environmentInjector: this.applicationRef.injector,
|
1490
1508
|
elementInjector: this.injector,
|
1491
1509
|
});
|
@@ -1502,7 +1520,7 @@ class NgxHelperCoordinatesService {
|
|
1502
1520
|
});
|
1503
1521
|
}
|
1504
1522
|
show(coordinates, config) {
|
1505
|
-
const componentRef = createComponent(ShowComponent, {
|
1523
|
+
const componentRef = createComponent(ShowComponent$1, {
|
1506
1524
|
environmentInjector: this.applicationRef.injector,
|
1507
1525
|
elementInjector: this.injector,
|
1508
1526
|
});
|
@@ -2070,6 +2088,352 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
2070
2088
|
args: [{ providedIn: 'root' }]
|
2071
2089
|
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: NgxHelperToastService }] });
|
2072
2090
|
|
2091
|
+
class GetComponent {
|
2092
|
+
className = 'ngx-helper-m3-route';
|
2093
|
+
route;
|
2094
|
+
config;
|
2095
|
+
close;
|
2096
|
+
distance;
|
2097
|
+
layers = [];
|
2098
|
+
map;
|
2099
|
+
ngOnInit() {
|
2100
|
+
const coordinates = this.route.length > 0
|
2101
|
+
? [this.route[0].longitude, this.route[0].latitude]
|
2102
|
+
: this.config?.view
|
2103
|
+
? [this.config.view.longitude, this.config.view.latitude]
|
2104
|
+
: [51.3380603, 35.6997382];
|
2105
|
+
const zoom = this.config?.zoom || 15;
|
2106
|
+
this.map = new Map({
|
2107
|
+
view: new View({ center: coordinates, zoom, projection: 'EPSG:4326' }),
|
2108
|
+
layers: [new TileLayer({ source: new OSM() })],
|
2109
|
+
target: 'ngx-helper-m3-route-map',
|
2110
|
+
});
|
2111
|
+
this.map
|
2112
|
+
.getInteractions()
|
2113
|
+
.getArray()
|
2114
|
+
.forEach((interaction) => {
|
2115
|
+
if (interaction instanceof interactionDoubleClickZoom)
|
2116
|
+
this.map.removeInteraction(interaction);
|
2117
|
+
});
|
2118
|
+
this.addLayers();
|
2119
|
+
}
|
2120
|
+
addLayers() {
|
2121
|
+
this.layers.forEach((layer) => this.map.removeLayer(layer));
|
2122
|
+
this.layers = [];
|
2123
|
+
this.distance = Helper.GEO.routeLength(this.route);
|
2124
|
+
if (this.route.length === 0)
|
2125
|
+
return;
|
2126
|
+
// ADD LINES
|
2127
|
+
this.route.forEach((coordinates, index) => {
|
2128
|
+
if (index == 0)
|
2129
|
+
return;
|
2130
|
+
const color = this.config?.circle?.color || 'rgb(42, 101, 126)';
|
2131
|
+
const from = [this.route[index - 1].longitude, this.route[index - 1].latitude];
|
2132
|
+
const to = [coordinates.longitude, coordinates.latitude];
|
2133
|
+
const feature = new Feature({ geometry: new LineString([from, to]) });
|
2134
|
+
const layer = new VectorLayer({
|
2135
|
+
source: new VectorSource({ features: [feature] }),
|
2136
|
+
style: {
|
2137
|
+
'stroke-line-dash': [3, 3, 3],
|
2138
|
+
'stroke-color': color,
|
2139
|
+
'stroke-width': 2,
|
2140
|
+
},
|
2141
|
+
});
|
2142
|
+
this.map.addLayer(layer);
|
2143
|
+
this.layers.push(layer);
|
2144
|
+
});
|
2145
|
+
// ADD CIRCLES
|
2146
|
+
this.route.forEach((coordinates, index) => {
|
2147
|
+
const circle = {
|
2148
|
+
size: this.config?.circle?.size || 10,
|
2149
|
+
color: this.config?.circle?.color || 'rgb(42, 101, 126)',
|
2150
|
+
};
|
2151
|
+
const text = {
|
2152
|
+
size: this.config?.text?.size || 13,
|
2153
|
+
font: this.config?.text?.font || 'Yekan',
|
2154
|
+
color: this.config?.text?.color || 'rgb(255, 255, 255)',
|
2155
|
+
};
|
2156
|
+
const point = new Point([coordinates.longitude, coordinates.latitude]);
|
2157
|
+
const layer = new VectorLayer({
|
2158
|
+
source: new VectorSource({ features: [new Feature(point)] }),
|
2159
|
+
style: {
|
2160
|
+
// CIRCLE
|
2161
|
+
'circle-fill-color': circle.color,
|
2162
|
+
'circle-radius': circle.size,
|
2163
|
+
'circle-stroke-color': '#FFF',
|
2164
|
+
'circle-stroke-width': 1,
|
2165
|
+
// TEXT
|
2166
|
+
'text-value': (index + 1).toString(),
|
2167
|
+
'text-font': `${text.size}px ${text.font}`,
|
2168
|
+
'text-fill-color': text.color,
|
2169
|
+
'text-offset-y': 1,
|
2170
|
+
'text-stroke-color': circle.color,
|
2171
|
+
'text-stroke-width': 2,
|
2172
|
+
},
|
2173
|
+
});
|
2174
|
+
this.map.addLayer(layer);
|
2175
|
+
this.layers.push(layer);
|
2176
|
+
});
|
2177
|
+
}
|
2178
|
+
setCoordinates(event) {
|
2179
|
+
event.preventDefault();
|
2180
|
+
const coordinates = this.map.getEventCoordinate(event).map((c) => +c.toFixed(7));
|
2181
|
+
if (isNaN(coordinates[0]) || isNaN(coordinates[1]))
|
2182
|
+
return;
|
2183
|
+
this.route.push({ latitude: coordinates[1], longitude: coordinates[0] });
|
2184
|
+
this.addLayers();
|
2185
|
+
// ANIMATE
|
2186
|
+
if (!this.config?.disableAnimate)
|
2187
|
+
this.animate(this.route.length - 1);
|
2188
|
+
}
|
2189
|
+
selectRoute() {
|
2190
|
+
if (this.route.length < 2)
|
2191
|
+
return;
|
2192
|
+
this.close(this.route);
|
2193
|
+
}
|
2194
|
+
animate(index) {
|
2195
|
+
if (!this.route[index])
|
2196
|
+
return;
|
2197
|
+
const center = [this.route[index].longitude, this.route[index].latitude];
|
2198
|
+
this.map.getView().animate({ center, duration: 250 });
|
2199
|
+
}
|
2200
|
+
delete(index) {
|
2201
|
+
if (!this.route[index])
|
2202
|
+
return;
|
2203
|
+
this.route.splice(index, 1);
|
2204
|
+
this.addLayers();
|
2205
|
+
}
|
2206
|
+
drop(event) {
|
2207
|
+
if (event.previousIndex === event.currentIndex)
|
2208
|
+
return;
|
2209
|
+
moveItemInArray(this.route, event.previousIndex, event.currentIndex);
|
2210
|
+
this.addLayers();
|
2211
|
+
}
|
2212
|
+
checkEscape(event) {
|
2213
|
+
if (!(event instanceof KeyboardEvent))
|
2214
|
+
return;
|
2215
|
+
if (event.code === 'Escape') {
|
2216
|
+
event.preventDefault();
|
2217
|
+
this.close();
|
2218
|
+
}
|
2219
|
+
}
|
2220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: GetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "get" }, listeners: { "window:keydown": "checkEscape($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div\n id=\"ngx-helper-m3-route-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"route\">\n <div class=\"header\">\n <div class=\"title\">ROUTE</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n\n <div class=\"coordinates\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (item of route; track $index) {\n <div class=\"coordinate ngx-helper-m3-route-coordinate\" cdkDrag cdkDragLockAxis=\"y\" cdkDragBoundary=\".coordinates\">\n <!-- DRAG -->\n @if (route.length > 1) { <mat-icon cdkDragHandle>drag_indicator</mat-icon> }\n <div class=\"index\" [style.padding-left]=\"route.length > 1 ? '0' : '0.5rem'\">{{ $index + 1 }}</div>\n <div class=\"value\" (click)=\"animate($index)\">{{ item.latitude.toFixed(5) }}</div>\n <div class=\"value\" (click)=\"animate($index)\">{{ item.longitude.toFixed(5) }}</div>\n <mat-icon class=\"delete\" (click)=\"delete($index)\">delete</mat-icon>\n </div>\n }\n </div>\n\n <div class=\"footer\">\n <div class=\"distance\">{{ distance.length | number }} M</div>\n <mat-icon [class.disabled]=\"route.length < 2\" (click)=\"selectRoute()\">done_all</mat-icon>\n </div>\n</div>\n", styles: [".cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.coordinates.cdk-drop-list-dragging .coordinates:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$6.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$6.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$6.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: DecimalPipe, name: "number" }] });
|
2222
|
+
}
|
2223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GetComponent, decorators: [{
|
2224
|
+
type: Component,
|
2225
|
+
args: [{ host: { selector: 'get', '(window:keydown)': 'checkEscape($event)' }, imports: [DragDropModule, MatIcon, DecimalPipe], template: "<div\n id=\"ngx-helper-m3-route-map\"\n class=\"map\"\n (dblclick)=\"setCoordinates($event)\"\n (contextmenu)=\"setCoordinates($event)\"\n></div>\n\n<div class=\"route\">\n <div class=\"header\">\n <div class=\"title\">ROUTE</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n\n <div class=\"coordinates\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n @for (item of route; track $index) {\n <div class=\"coordinate ngx-helper-m3-route-coordinate\" cdkDrag cdkDragLockAxis=\"y\" cdkDragBoundary=\".coordinates\">\n <!-- DRAG -->\n @if (route.length > 1) { <mat-icon cdkDragHandle>drag_indicator</mat-icon> }\n <div class=\"index\" [style.padding-left]=\"route.length > 1 ? '0' : '0.5rem'\">{{ $index + 1 }}</div>\n <div class=\"value\" (click)=\"animate($index)\">{{ item.latitude.toFixed(5) }}</div>\n <div class=\"value\" (click)=\"animate($index)\">{{ item.longitude.toFixed(5) }}</div>\n <mat-icon class=\"delete\" (click)=\"delete($index)\">delete</mat-icon>\n </div>\n }\n </div>\n\n <div class=\"footer\">\n <div class=\"distance\">{{ distance.length | number }} M</div>\n <mat-icon [class.disabled]=\"route.length < 2\" (click)=\"selectRoute()\">done_all</mat-icon>\n </div>\n</div>\n", styles: [".cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;transition:transform .25s cubic-bezier(0,0,.2,1)}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.coordinates.cdk-drop-list-dragging .coordinates:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
2226
|
+
}], propDecorators: { className: [{
|
2227
|
+
type: HostBinding,
|
2228
|
+
args: ['className']
|
2229
|
+
}] } });
|
2230
|
+
|
2231
|
+
class ShowComponent {
|
2232
|
+
className = 'ngx-helper-m3-route';
|
2233
|
+
route;
|
2234
|
+
config;
|
2235
|
+
close;
|
2236
|
+
distance;
|
2237
|
+
copied;
|
2238
|
+
index = 0;
|
2239
|
+
layers = [];
|
2240
|
+
copyTimeout;
|
2241
|
+
map;
|
2242
|
+
ngOnInit() {
|
2243
|
+
this.distance = Helper.GEO.routeLength(this.route);
|
2244
|
+
const coordinates = [this.route[0].longitude, this.route[0].latitude];
|
2245
|
+
const zoom = this.config?.zoom || 15;
|
2246
|
+
this.map = new Map({
|
2247
|
+
view: new View({ center: coordinates, zoom, projection: 'EPSG:4326' }),
|
2248
|
+
layers: [new TileLayer({ source: new OSM() })],
|
2249
|
+
target: 'ngx-helper-m3-route-map',
|
2250
|
+
});
|
2251
|
+
this.map
|
2252
|
+
.getInteractions()
|
2253
|
+
.getArray()
|
2254
|
+
.forEach((interaction) => {
|
2255
|
+
if (interaction instanceof interactionDoubleClickZoom)
|
2256
|
+
this.map.removeInteraction(interaction);
|
2257
|
+
});
|
2258
|
+
// ADD LINES
|
2259
|
+
this.route.forEach((coordinates, index) => {
|
2260
|
+
if (index == 0)
|
2261
|
+
return;
|
2262
|
+
const color = this.config?.circle?.color || 'rgb(42, 101, 126)';
|
2263
|
+
const from = [this.route[index - 1].longitude, this.route[index - 1].latitude];
|
2264
|
+
const to = [coordinates.longitude, coordinates.latitude];
|
2265
|
+
const feature = new Feature({ geometry: new LineString([from, to]) });
|
2266
|
+
const layer = new VectorLayer({
|
2267
|
+
source: new VectorSource({ features: [feature] }),
|
2268
|
+
style: {
|
2269
|
+
'stroke-line-dash': [3, 3, 3],
|
2270
|
+
'stroke-color': color,
|
2271
|
+
'stroke-width': 2,
|
2272
|
+
},
|
2273
|
+
});
|
2274
|
+
this.map.addLayer(layer);
|
2275
|
+
});
|
2276
|
+
// ADD CIRCLES
|
2277
|
+
this.route.forEach((coordinates, index) => {
|
2278
|
+
const circle = {
|
2279
|
+
size: this.config?.circle?.size || 10,
|
2280
|
+
color: this.config?.circle?.color || 'rgb(42, 101, 126)',
|
2281
|
+
};
|
2282
|
+
const text = {
|
2283
|
+
size: this.config?.text?.size || 13,
|
2284
|
+
font: this.config?.text?.font || 'Yekan',
|
2285
|
+
color: this.config?.text?.color || 'rgb(255, 255, 255)',
|
2286
|
+
};
|
2287
|
+
const point = new Point([coordinates.longitude, coordinates.latitude]);
|
2288
|
+
const layer = new VectorLayer({
|
2289
|
+
source: new VectorSource({ features: [new Feature(point)] }),
|
2290
|
+
style: {
|
2291
|
+
// CIRCLE
|
2292
|
+
'circle-fill-color': circle.color,
|
2293
|
+
'circle-radius': circle.size,
|
2294
|
+
'circle-stroke-color': '#FFF',
|
2295
|
+
'circle-stroke-width': 1,
|
2296
|
+
// TEXT
|
2297
|
+
'text-value': (index + 1).toString(),
|
2298
|
+
'text-font': `${text.size}px ${text.font}`,
|
2299
|
+
'text-fill-color': text.color,
|
2300
|
+
'text-offset-y': 1,
|
2301
|
+
'text-stroke-color': circle.color,
|
2302
|
+
'text-stroke-width': 2,
|
2303
|
+
},
|
2304
|
+
});
|
2305
|
+
this.map.addLayer(layer);
|
2306
|
+
});
|
2307
|
+
this.addLayers();
|
2308
|
+
}
|
2309
|
+
addLayers() {
|
2310
|
+
this.layers.forEach((layer) => this.map.removeLayer(layer));
|
2311
|
+
this.layers = [];
|
2312
|
+
// ADD CIRCLES
|
2313
|
+
this.route.forEach((coordinates, index) => {
|
2314
|
+
if (index !== this.index)
|
2315
|
+
return;
|
2316
|
+
const circle = {
|
2317
|
+
size: this.config?.circle?.size || 10,
|
2318
|
+
color: this.config?.circle?.color || 'rgb(42, 101, 126)',
|
2319
|
+
};
|
2320
|
+
const text = {
|
2321
|
+
size: this.config?.text?.size || 13,
|
2322
|
+
font: this.config?.text?.font || 'Yekan',
|
2323
|
+
color: this.config?.text?.color || 'rgb(255, 255, 255)',
|
2324
|
+
};
|
2325
|
+
const point = new Point([coordinates.longitude, coordinates.latitude]);
|
2326
|
+
const layer = new VectorLayer({
|
2327
|
+
source: new VectorSource({ features: [new Feature(point)] }),
|
2328
|
+
style: {
|
2329
|
+
// CIRCLE
|
2330
|
+
'circle-fill-color': circle.color,
|
2331
|
+
'circle-radius': circle.size * 1.4,
|
2332
|
+
'circle-stroke-color': '#FFF',
|
2333
|
+
'circle-stroke-width': 1,
|
2334
|
+
// TEXT
|
2335
|
+
'text-value': (index + 1).toString(),
|
2336
|
+
'text-font': `${text.size * 1.2}px ${text.font}`,
|
2337
|
+
'text-fill-color': text.color,
|
2338
|
+
'text-offset-y': 1,
|
2339
|
+
'text-stroke-color': circle.color,
|
2340
|
+
'text-stroke-width': 2,
|
2341
|
+
},
|
2342
|
+
});
|
2343
|
+
this.map.addLayer(layer);
|
2344
|
+
this.layers.push(layer);
|
2345
|
+
});
|
2346
|
+
}
|
2347
|
+
animate(index) {
|
2348
|
+
if (!this.route[index])
|
2349
|
+
return;
|
2350
|
+
this.index = index;
|
2351
|
+
this.addLayers();
|
2352
|
+
const center = [this.route[index].longitude, this.route[index].latitude];
|
2353
|
+
this.map.getView().animate({ center, duration: 250 });
|
2354
|
+
}
|
2355
|
+
setCopy(index) {
|
2356
|
+
if (this.copyTimeout)
|
2357
|
+
clearTimeout(this.copyTimeout);
|
2358
|
+
this.copied = index;
|
2359
|
+
this.copyTimeout = setTimeout(() => (this.copied = undefined), 1000);
|
2360
|
+
}
|
2361
|
+
checkKey(event) {
|
2362
|
+
if (!(event instanceof KeyboardEvent))
|
2363
|
+
return;
|
2364
|
+
if (event.code === 'Escape') {
|
2365
|
+
event.preventDefault();
|
2366
|
+
this.close();
|
2367
|
+
}
|
2368
|
+
if (this.index !== undefined) {
|
2369
|
+
const change = event.code === 'ArrowUp' ? -1 : event.code === 'ArrowDown' ? 1 : 0;
|
2370
|
+
if (change !== 0) {
|
2371
|
+
event.preventDefault();
|
2372
|
+
this.animate(this.index + change);
|
2373
|
+
}
|
2374
|
+
}
|
2375
|
+
}
|
2376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ShowComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "show" }, listeners: { "window:keydown": "checkKey($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div id=\"ngx-helper-m3-route-map\" class=\"map\"></div>\n\n<div class=\"route\">\n <div class=\"header\">\n <div class=\"title\">ROUTE</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n\n <div class=\"coordinates\">\n @for (item of route; track $index) {\n <div class=\"coordinate ngx-helper-m3-route-coordinate\" [class.selected]=\"index === $index\" (click)=\"animate($index)\">\n <div class=\"index\" [style.padding-left]=\"route.length > 1 ? '0' : '0.5rem'\">{{ $index + 1 }}</div>\n <div class=\"value\">{{ item.latitude.toFixed(5) }}</div>\n <div class=\"value\">{{ item.longitude.toFixed(5) }}</div>\n <mat-icon\n [cdkCopyToClipboard]=\"item.latitude.toString() + ',' + item.longitude.toString()\"\n (click)=\"setCopy($index)\"\n >\n {{ copied === $index ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n }\n </div>\n\n <div class=\"footer\">\n <div class=\"distance\">{{ distance.length | number }} M</div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: DecimalPipe, name: "number" }] });
|
2378
|
+
}
|
2379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, decorators: [{
|
2380
|
+
type: Component,
|
2381
|
+
args: [{ host: { selector: 'show', '(window:keydown)': 'checkKey($event)' }, imports: [ClipboardModule, MatIcon, DecimalPipe], template: "<div id=\"ngx-helper-m3-route-map\" class=\"map\"></div>\n\n<div class=\"route\">\n <div class=\"header\">\n <div class=\"title\">ROUTE</div>\n <mat-icon (click)=\"close()\">close</mat-icon>\n </div>\n\n <div class=\"coordinates\">\n @for (item of route; track $index) {\n <div class=\"coordinate ngx-helper-m3-route-coordinate\" [class.selected]=\"index === $index\" (click)=\"animate($index)\">\n <div class=\"index\" [style.padding-left]=\"route.length > 1 ? '0' : '0.5rem'\">{{ $index + 1 }}</div>\n <div class=\"value\">{{ item.latitude.toFixed(5) }}</div>\n <div class=\"value\">{{ item.longitude.toFixed(5) }}</div>\n <mat-icon\n [cdkCopyToClipboard]=\"item.latitude.toString() + ',' + item.longitude.toString()\"\n (click)=\"setCopy($index)\"\n >\n {{ copied === $index ? 'done_all' : 'copy' }}\n </mat-icon>\n </div>\n }\n </div>\n\n <div class=\"footer\">\n <div class=\"distance\">{{ distance.length | number }} M</div>\n </div>\n</div>\n" }]
|
2382
|
+
}], propDecorators: { className: [{
|
2383
|
+
type: HostBinding,
|
2384
|
+
args: ['className']
|
2385
|
+
}] } });
|
2386
|
+
|
2387
|
+
class NgxHelperRouteService {
|
2388
|
+
applicationRef;
|
2389
|
+
injector;
|
2390
|
+
constructor(applicationRef, injector) {
|
2391
|
+
this.applicationRef = applicationRef;
|
2392
|
+
this.injector = injector;
|
2393
|
+
}
|
2394
|
+
get(arg1, arg2) {
|
2395
|
+
const route = arg1 && Helper.IS.array(arg1) ? arg1 : [];
|
2396
|
+
const config = arg2 || (arg1 && !Helper.IS.array(arg1) ? arg1 : undefined);
|
2397
|
+
return new Promise((resolve, reject) => {
|
2398
|
+
const componentRef = createComponent(GetComponent, {
|
2399
|
+
environmentInjector: this.applicationRef.injector,
|
2400
|
+
elementInjector: this.injector,
|
2401
|
+
});
|
2402
|
+
componentRef.instance.route = route;
|
2403
|
+
componentRef.instance.config = config;
|
2404
|
+
componentRef.instance.close = (route) => {
|
2405
|
+
this.applicationRef.detachView(componentRef.hostView);
|
2406
|
+
componentRef.destroy();
|
2407
|
+
route ? resolve(route) : reject();
|
2408
|
+
};
|
2409
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
2410
|
+
this.applicationRef.attachView(componentRef.hostView);
|
2411
|
+
document.body.appendChild(htmlElement);
|
2412
|
+
});
|
2413
|
+
}
|
2414
|
+
show(route, config) {
|
2415
|
+
const componentRef = createComponent(ShowComponent, {
|
2416
|
+
environmentInjector: this.applicationRef.injector,
|
2417
|
+
elementInjector: this.injector,
|
2418
|
+
});
|
2419
|
+
componentRef.instance.route = route;
|
2420
|
+
componentRef.instance.config = config;
|
2421
|
+
componentRef.instance.close = () => {
|
2422
|
+
this.applicationRef.detachView(componentRef.hostView);
|
2423
|
+
componentRef.destroy();
|
2424
|
+
};
|
2425
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
2426
|
+
this.applicationRef.attachView(componentRef.hostView);
|
2427
|
+
document.body.appendChild(htmlElement);
|
2428
|
+
}
|
2429
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperRouteService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
2430
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperRouteService, providedIn: 'root' });
|
2431
|
+
}
|
2432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperRouteService, decorators: [{
|
2433
|
+
type: Injectable,
|
2434
|
+
args: [{ providedIn: 'root' }]
|
2435
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }] });
|
2436
|
+
|
2073
2437
|
class NgxHelperMobileViewDirective {
|
2074
2438
|
elementRef;
|
2075
2439
|
rendererFactory;
|
@@ -2235,5 +2599,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
2235
2599
|
* Generated bundle index. Do not edit.
|
2236
2600
|
*/
|
2237
2601
|
|
2238
|
-
export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
2602
|
+
export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_DATA_CHANGE, NGX_HELPER_PAGE_GROUP_ITEM, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperCoordinatesService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperHttpService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
2239
2603
|
//# sourceMappingURL=webilix-ngx-helper-m3.mjs.map
|