@webilix/ngx-helper-m3 0.0.31 → 0.0.33
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 +173 -4
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -1
- package/index.d.ts +21 -2
- package/ngx-helper-m3.css +457 -336
- package/package.json +1 -1
@@ -2088,6 +2088,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
2088
2088
|
args: [{ providedIn: 'root' }]
|
2089
2089
|
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: NgxHelperToastService }] });
|
2090
2090
|
|
2091
|
+
class ImageComponent {
|
2092
|
+
className = 'ngx-helper-m3-image';
|
2093
|
+
image;
|
2094
|
+
config;
|
2095
|
+
close;
|
2096
|
+
checkEscape(event) {
|
2097
|
+
if (!(event instanceof KeyboardEvent))
|
2098
|
+
return;
|
2099
|
+
if (event.code === 'Escape') {
|
2100
|
+
event.preventDefault();
|
2101
|
+
this.close();
|
2102
|
+
}
|
2103
|
+
}
|
2104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ImageComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "image" }, listeners: { "window:keydown": "checkEscape($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"image\">\n <img [src]=\"image.image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (image.description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"image.description | ngxHelperMultiLine\"></div>\n</div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }] });
|
2106
|
+
}
|
2107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ImageComponent, decorators: [{
|
2108
|
+
type: Component,
|
2109
|
+
args: [{ host: { selector: 'image', '(window:keydown)': 'checkEscape($event)' }, imports: [MatIcon, MatIconButton, NgxHelperMultiLinePipe], template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"image\">\n <img [src]=\"image.image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (image.description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"image.description | ngxHelperMultiLine\"></div>\n</div>\n}\n" }]
|
2110
|
+
}], propDecorators: { className: [{
|
2111
|
+
type: HostBinding,
|
2112
|
+
args: ['className']
|
2113
|
+
}] } });
|
2114
|
+
|
2115
|
+
class GalleryComponent {
|
2116
|
+
className = 'ngx-helper-m3-image';
|
2117
|
+
images;
|
2118
|
+
config;
|
2119
|
+
close;
|
2120
|
+
index = 0;
|
2121
|
+
checkKey(event) {
|
2122
|
+
if (!(event instanceof KeyboardEvent))
|
2123
|
+
return;
|
2124
|
+
if (event.code === 'Escape') {
|
2125
|
+
event.preventDefault();
|
2126
|
+
this.close();
|
2127
|
+
}
|
2128
|
+
if (event.code === 'ArrowRight') {
|
2129
|
+
event.preventDefault();
|
2130
|
+
this.changeIndex(-1);
|
2131
|
+
}
|
2132
|
+
if (event.code === 'ArrowLeft') {
|
2133
|
+
event.preventDefault();
|
2134
|
+
this.changeIndex(1);
|
2135
|
+
}
|
2136
|
+
}
|
2137
|
+
changeIndex(change) {
|
2138
|
+
this.index += change;
|
2139
|
+
if (this.index < 0)
|
2140
|
+
this.index = this.images.length - 1;
|
2141
|
+
if (this.index >= this.images.length)
|
2142
|
+
this.index = 0;
|
2143
|
+
}
|
2144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GalleryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: GalleryComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "gallery" }, listeners: { "window:keydown": "checkKey($event)" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"arrows\">\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(-1)\"><mat-icon>chevron_right</mat-icon></button>\n <div class=\"count\">{{ index + 1 }} \u0627\u0632 {{ images.length }}</div>\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(1)\"><mat-icon>chevron_left</mat-icon></button>\n</div>\n\n<div class=\"image\">\n <img [src]=\"images[index].image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (images[index].description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"images[index].description | ngxHelperMultiLine\"></div>\n</div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }] });
|
2146
|
+
}
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: GalleryComponent, decorators: [{
|
2148
|
+
type: Component,
|
2149
|
+
args: [{ host: { selector: 'gallery', '(window:keydown)': 'checkKey($event)' }, imports: [MatIcon, MatIconButton, NgxHelperMultiLinePipe], template: "<div\n class=\"background\"\n [style.background-color]=\"config?.backgroundColor || 'var(--background)'\"\n [style.opacity]=\"config?.backgroundOpacity || 0.95\"\n></div>\n\n<button class=\"close\" mat-icon-button (click)=\"close()\"><mat-icon>close</mat-icon></button>\n\n<div class=\"arrows\">\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(-1)\"><mat-icon>chevron_right</mat-icon></button>\n <div class=\"count\">{{ index + 1 }} \u0627\u0632 {{ images.length }}</div>\n <button class=\"arrow\" mat-icon-button (click)=\"changeIndex(1)\"><mat-icon>chevron_left</mat-icon></button>\n</div>\n\n<div class=\"image\">\n <img [src]=\"images[index].image\" />\n</div>\n\n<!-- DESCRIPTION -->\n@if (images[index].description) {\n<div class=\"description\">\n <div class=\"content\" [innerHTML]=\"images[index].description | ngxHelperMultiLine\"></div>\n</div>\n}\n" }]
|
2150
|
+
}], propDecorators: { className: [{
|
2151
|
+
type: HostBinding,
|
2152
|
+
args: ['className']
|
2153
|
+
}] } });
|
2154
|
+
|
2155
|
+
class NgxHelperImageService {
|
2156
|
+
applicationRef;
|
2157
|
+
injector;
|
2158
|
+
constructor(applicationRef, injector) {
|
2159
|
+
this.applicationRef = applicationRef;
|
2160
|
+
this.injector = injector;
|
2161
|
+
}
|
2162
|
+
showImage(image, config) {
|
2163
|
+
const componentRef = createComponent(ImageComponent, {
|
2164
|
+
environmentInjector: this.applicationRef.injector,
|
2165
|
+
elementInjector: this.injector,
|
2166
|
+
});
|
2167
|
+
componentRef.instance.image = image;
|
2168
|
+
componentRef.instance.config = config;
|
2169
|
+
componentRef.instance.close = () => {
|
2170
|
+
this.applicationRef.detachView(componentRef.hostView);
|
2171
|
+
componentRef.destroy();
|
2172
|
+
document.body.style.overflow = 'visible';
|
2173
|
+
};
|
2174
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
2175
|
+
this.applicationRef.attachView(componentRef.hostView);
|
2176
|
+
document.body.appendChild(htmlElement);
|
2177
|
+
document.body.style.overflow = 'hidden';
|
2178
|
+
}
|
2179
|
+
showGallery(images, config) {
|
2180
|
+
if (images.length === 0)
|
2181
|
+
return;
|
2182
|
+
if (images.length === 1) {
|
2183
|
+
this.showImage(images[0], config);
|
2184
|
+
return;
|
2185
|
+
}
|
2186
|
+
const componentRef = createComponent(GalleryComponent, {
|
2187
|
+
environmentInjector: this.applicationRef.injector,
|
2188
|
+
elementInjector: this.injector,
|
2189
|
+
});
|
2190
|
+
componentRef.instance.images = images;
|
2191
|
+
componentRef.instance.config = config;
|
2192
|
+
componentRef.instance.close = () => {
|
2193
|
+
this.applicationRef.detachView(componentRef.hostView);
|
2194
|
+
componentRef.destroy();
|
2195
|
+
document.body.style.overflow = 'visible';
|
2196
|
+
};
|
2197
|
+
const htmlElement = componentRef.hostView.rootNodes[0];
|
2198
|
+
this.applicationRef.attachView(componentRef.hostView);
|
2199
|
+
document.body.appendChild(htmlElement);
|
2200
|
+
document.body.style.overflow = 'hidden';
|
2201
|
+
}
|
2202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
2203
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, providedIn: 'root' });
|
2204
|
+
}
|
2205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NgxHelperImageService, decorators: [{
|
2206
|
+
type: Injectable,
|
2207
|
+
args: [{ providedIn: 'root' }]
|
2208
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.Injector }] });
|
2209
|
+
|
2091
2210
|
class GetComponent {
|
2092
2211
|
className = 'ngx-helper-m3-route';
|
2093
2212
|
route;
|
@@ -2235,6 +2354,8 @@ class ShowComponent {
|
|
2235
2354
|
close;
|
2236
2355
|
distance;
|
2237
2356
|
copied;
|
2357
|
+
index = 0;
|
2358
|
+
layers = [];
|
2238
2359
|
copyTimeout;
|
2239
2360
|
map;
|
2240
2361
|
ngOnInit() {
|
@@ -2302,10 +2423,51 @@ class ShowComponent {
|
|
2302
2423
|
});
|
2303
2424
|
this.map.addLayer(layer);
|
2304
2425
|
});
|
2426
|
+
this.addLayers();
|
2427
|
+
}
|
2428
|
+
addLayers() {
|
2429
|
+
this.layers.forEach((layer) => this.map.removeLayer(layer));
|
2430
|
+
this.layers = [];
|
2431
|
+
// ADD CIRCLES
|
2432
|
+
this.route.forEach((coordinates, index) => {
|
2433
|
+
if (index !== this.index)
|
2434
|
+
return;
|
2435
|
+
const circle = {
|
2436
|
+
size: this.config?.circle?.size || 10,
|
2437
|
+
color: this.config?.circle?.color || 'rgb(42, 101, 126)',
|
2438
|
+
};
|
2439
|
+
const text = {
|
2440
|
+
size: this.config?.text?.size || 13,
|
2441
|
+
font: this.config?.text?.font || 'Yekan',
|
2442
|
+
color: this.config?.text?.color || 'rgb(255, 255, 255)',
|
2443
|
+
};
|
2444
|
+
const point = new Point([coordinates.longitude, coordinates.latitude]);
|
2445
|
+
const layer = new VectorLayer({
|
2446
|
+
source: new VectorSource({ features: [new Feature(point)] }),
|
2447
|
+
style: {
|
2448
|
+
// CIRCLE
|
2449
|
+
'circle-fill-color': circle.color,
|
2450
|
+
'circle-radius': circle.size * 1.4,
|
2451
|
+
'circle-stroke-color': '#FFF',
|
2452
|
+
'circle-stroke-width': 1,
|
2453
|
+
// TEXT
|
2454
|
+
'text-value': (index + 1).toString(),
|
2455
|
+
'text-font': `${text.size * 1.2}px ${text.font}`,
|
2456
|
+
'text-fill-color': text.color,
|
2457
|
+
'text-offset-y': 1,
|
2458
|
+
'text-stroke-color': circle.color,
|
2459
|
+
'text-stroke-width': 2,
|
2460
|
+
},
|
2461
|
+
});
|
2462
|
+
this.map.addLayer(layer);
|
2463
|
+
this.layers.push(layer);
|
2464
|
+
});
|
2305
2465
|
}
|
2306
2466
|
animate(index) {
|
2307
2467
|
if (!this.route[index])
|
2308
2468
|
return;
|
2469
|
+
this.index = index;
|
2470
|
+
this.addLayers();
|
2309
2471
|
const center = [this.route[index].longitude, this.route[index].latitude];
|
2310
2472
|
this.map.getView().animate({ center, duration: 250 });
|
2311
2473
|
}
|
@@ -2315,20 +2477,27 @@ class ShowComponent {
|
|
2315
2477
|
this.copied = index;
|
2316
2478
|
this.copyTimeout = setTimeout(() => (this.copied = undefined), 1000);
|
2317
2479
|
}
|
2318
|
-
|
2480
|
+
checkKey(event) {
|
2319
2481
|
if (!(event instanceof KeyboardEvent))
|
2320
2482
|
return;
|
2321
2483
|
if (event.code === 'Escape') {
|
2322
2484
|
event.preventDefault();
|
2323
2485
|
this.close();
|
2324
2486
|
}
|
2487
|
+
if (this.index !== undefined) {
|
2488
|
+
const change = event.code === 'ArrowUp' ? -1 : event.code === 'ArrowDown' ? 1 : 0;
|
2489
|
+
if (change !== 0) {
|
2490
|
+
event.preventDefault();
|
2491
|
+
this.animate(this.index + change);
|
2492
|
+
}
|
2493
|
+
}
|
2325
2494
|
}
|
2326
2495
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2327
|
-
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": "
|
2496
|
+
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" }] });
|
2328
2497
|
}
|
2329
2498
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ShowComponent, decorators: [{
|
2330
2499
|
type: Component,
|
2331
|
-
args: [{ host: { selector: 'show', '(window:keydown)': '
|
2500
|
+
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" }]
|
2332
2501
|
}], propDecorators: { className: [{
|
2333
2502
|
type: HostBinding,
|
2334
2503
|
args: ['className']
|
@@ -2549,5 +2718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
2549
2718
|
* Generated bundle index. Do not edit.
|
2550
2719
|
*/
|
2551
2720
|
|
2552
|
-
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 };
|
2721
|
+
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, NgxHelperImageService, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMobileViewDirective, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperProgressComponent, NgxHelperRouteService, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperStickyDirective, NgxHelperToastService, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
2553
2722
|
//# sourceMappingURL=webilix-ngx-helper-m3.mjs.map
|