@aggdirect/coolmap-services 4.0.8 → 10.2.3

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/index.d.ts CHANGED
@@ -1,267 +1,5 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken } from '@angular/core';
3
- import * as _aggdirect_coolmap_services from '@aggdirect/coolmap-services';
4
- import * as rxjs from 'rxjs';
5
- import { BehaviorSubject } from 'rxjs';
6
- import * as mapbox_gl from 'mapbox-gl';
7
- import mapboxgl$1 from 'mapbox-gl/dist/mapbox-gl-csp.js';
8
-
9
- declare class CoolmapServices {
10
- static ɵfac: i0.ɵɵFactoryDeclaration<CoolmapServices, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<CoolmapServices, "lib-coolmap-services", never, {}, {}, never, never, true, never>;
12
- }
13
-
14
- type ToastVariant = 'success' | 'error' | 'warning' | 'info';
15
- type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
16
- interface ToastConfig {
17
- message: string;
18
- title?: string;
19
- variant?: ToastVariant;
20
- duration?: number;
21
- dismissible?: boolean;
22
- action?: {
23
- label: string;
24
- onClick: () => void;
25
- };
26
- }
27
- interface Toast extends ToastConfig {
28
- id: string;
29
- variant: ToastVariant;
30
- duration: number;
31
- dismissible: boolean;
32
- createdAt: Date;
33
- }
34
- declare class AgToastService {
35
- private _toasts;
36
- private defaultDuration;
37
- private position;
38
- toasts: i0.Signal<Toast[]>;
39
- toastPosition: i0.Signal<ToastPosition>;
40
- private generateId;
41
- setPosition(pos: ToastPosition): void;
42
- show(config: ToastConfig): string;
43
- success(message: string, title?: string, duration?: number): string;
44
- error(message: string, title?: string, duration?: number): string;
45
- warning(message: string, title?: string, duration?: number): string;
46
- info(message: string, title?: string, duration?: number): string;
47
- dismiss(id: string): void;
48
- dismissAll(): void;
49
- static ɵfac: i0.ɵɵFactoryDeclaration<AgToastService, never>;
50
- static ɵprov: i0.ɵɵInjectableDeclaration<AgToastService>;
51
- }
52
-
53
- interface CoolmapRoute {
54
- route_details_id?: string;
55
- route_id?: string;
56
- route_name?: string;
57
- driver_id?: string | null;
58
- driver_name?: string | null;
59
- driver_phone?: string | null;
60
- driver_email?: string | null;
61
- truck_no?: string | null;
62
- company_id?: string;
63
- company_name?: string;
64
- status?: string;
65
- driver_flag?: string | null;
66
- driver_first_login?: string | null;
67
- start_time?: string | null;
68
- is_overnight?: boolean;
69
- route_visibility?: number;
70
- pickup_location?: string;
71
- delivery_location?: string;
72
- order_number?: string;
73
- customer_name?: string;
74
- project?: string;
75
- unit?: string;
76
- material?: string;
77
- job_id?: string;
78
- path?: any;
79
- }
80
-
81
- interface LocationAll {
82
- city: string;
83
- latitude: string;
84
- location_id: string;
85
- longitude: string;
86
- name: string;
87
- state: string;
88
- street: string;
89
- suite: null;
90
- zip: string;
91
- formatted_address: string;
92
- complete_address: string;
93
- }
94
- declare class UtilsService {
95
- private http;
96
- private config;
97
- private ngZone;
98
- preventnavChange: BehaviorSubject<boolean>;
99
- navChangeObserve: rxjs.Observable<boolean>;
100
- clearViewRouteforJobCode: BehaviorSubject<boolean>;
101
- clearViewRouteforJobCodeObserve: rxjs.Observable<boolean>;
102
- preVentJobdetailclose: BehaviorSubject<boolean>;
103
- getpreVentJobdetailclose: rxjs.Observable<boolean>;
104
- routeDetailsUtility: BehaviorSubject<{}>;
105
- getrouteDetailsUtility: rxjs.Observable<{}>;
106
- removeMapEntity: BehaviorSubject<any>;
107
- removeMapEntityUtility: rxjs.Observable<any>;
108
- dict: Map<string, string>;
109
- unitsList: any;
110
- materialsList: any;
111
- materialsListForCustomer: any;
112
- customersList: any;
113
- locationList: any;
114
- pickupOptions: any[];
115
- destOptions: any[];
116
- ownerOptions: any[];
117
- customerOptions: any[];
118
- unitOptions: any[];
119
- materialOptions: any[];
120
- jcodeOptions: any[];
121
- driverOption: any[];
122
- truckingCompanayOption: any[];
123
- routeNameOptions: any[];
124
- getDateFormat(strVal: Date | null, seprater?: string): string;
125
- getData(path: string): rxjs.Observable<Object>;
126
- getRestData(path: string): rxjs.Observable<Object>;
127
- postdata(path: string, data: any): rxjs.Observable<Object>;
128
- postDataWithRestUrl(path: string, data: any): rxjs.Observable<Object>;
129
- toastService: AgToastService;
130
- openSnackBar(message: string, className?: string): void;
131
- clearOptions(): void;
132
- makeOptions(item: CoolmapRoute): void;
133
- setdictValue(key: string, value: string): void;
134
- getdictValue(key: string): any;
135
- removedictValue(key: string): void;
136
- filter(value: string, filters: any[]): any[];
137
- getSearchResults(list: CoolmapRoute[], filterval: any[]): any[];
138
- fetchUnitsList(): Promise<unknown>;
139
- fetchMaterialsListForCustomer(): Promise<unknown>;
140
- filtermaterialList(list: any[]): any[];
141
- fetchCustomersList(): Promise<unknown>;
142
- fetchLocationlist(): Promise<unknown>;
143
- static ɵfac: i0.ɵɵFactoryDeclaration<UtilsService, never>;
144
- static ɵprov: i0.ɵɵInjectableDeclaration<UtilsService>;
145
- }
146
-
147
- interface PopupData {
148
- coordinate: [number, number];
149
- pickup?: string;
150
- drop?: string;
151
- jobCode?: string;
152
- customer?: string;
153
- routeType?: string;
154
- title?: string;
155
- material?: string;
156
- type?: string;
157
- }
158
- declare class MapboxService {
159
- map: mapboxgl.Map;
160
- mapContainer: HTMLElement | null;
161
- private resizeObserver;
162
- markerOriginList: Map<string, mapbox_gl.Marker>;
163
- markerDestinationList: Map<string, mapbox_gl.Marker>;
164
- private activeRoutesRegistry;
165
- private pathCache;
166
- svgOverlay: SVGSVGElement | null;
167
- activeArcs: {
168
- [index: string]: {
169
- origin: [number, number];
170
- destination: [number, number];
171
- color: string;
172
- pathEl: SVGPathElement;
173
- };
174
- };
175
- initiatecoolmap: BehaviorSubject<boolean>;
176
- reintiatecoolmap: rxjs.Observable<boolean>;
177
- isMapReady: i0.WritableSignal<boolean>;
178
- bounds: mapbox_gl.LngLatBounds;
179
- private originDestinationCordinates;
180
- padding: any;
181
- windowActualHeightWidth: any;
182
- popup: mapboxgl.Popup;
183
- customTopForCustomer: number;
184
- utils: UtilsService;
185
- config: _aggdirect_coolmap_services.CoolmapConfigModel;
186
- private currentStyleIsDark;
187
- constructor();
188
- updateTheme(isDark: boolean): void;
189
- getRegistryKeys(): string[];
190
- initializeMap(el: HTMLElement, isDark?: boolean): Promise<unknown>;
191
- loadMapProperty(pinRouteGeojson: any, index: number, unit: any, routeProps?: any, bottom?: number): Promise<unknown>;
192
- createMarker(routeDetails: any): void;
193
- showRoutePopup(arcDetails: any, event: any, isViewRoute?: boolean): void;
194
- createPopup(datasetForPopup: PopupData): void;
195
- drawLine(cordinates?: any, index?: number | any, route?: any, enablefitbound?: boolean, routeType?: string, isStyleRefresh?: boolean): Promise<void>;
196
- provideLineColor(unitType: string, type?: string): string;
197
- hexToRGB(hex: any): [number, number, number];
198
- initSvgOverlay(): void;
199
- updateSvgPaths(): void;
200
- removeRouteAndMarker(index: number | string | any, routeType?: string): Promise<boolean>;
201
- private reAddLayers;
202
- findMarkerBound(index: any): void;
203
- filterRoute(ID: any, visibility: 'visible' | 'none', showAllFitbound?: boolean): Promise<boolean>;
204
- extendBound(route: any, showAllFitbound: boolean | undefined, id?: string): Promise<unknown>;
205
- extendReBound(bottom?: number): Promise<unknown>;
206
- plotRoute(route: any, i: number | any, type: string, enablefitbound?: boolean, showAllFitbound?: boolean): Promise<boolean>;
207
- /**
208
- * Batch toggle visibility for routes on the map.
209
- * If visibleIds is empty, shows everything in the registry.
210
- * Otherwise, shows only those in visibleIds and hides the rest.
211
- */
212
- setRoutesVisibility(visibleIds: string[], showAllOverride?: boolean, prefix?: string): void;
213
- private recalculateVisibleBounds;
214
- clearAllRoutes(): Promise<boolean>;
215
- clearBound(): void;
216
- formateLatLong(latlong: string): number[] | null;
217
- clearBoundWithCordinates(): void;
218
- onResize(event: any): void;
219
- setWindowHeight(screen: any): void;
220
- setPadding(padding: any): void;
221
- clearPadding(): void;
222
- removeJobFromMap(data: any[]): void;
223
- resize(): void;
224
- static ɵfac: i0.ɵɵFactoryDeclaration<MapboxService, never>;
225
- static ɵprov: i0.ɵɵInjectableDeclaration<MapboxService>;
226
- }
227
-
228
1
  /**
229
- * Mapbox GL shares code between the main bundle and its Web Worker. When the host app
230
- * (e.g. customer portal) bundles/transpiles mapbox-gl, the worker often breaks with
231
- * errors like "Nn is not defined" / "_createClass is not defined" in syncRTLPluginState.
232
- *
233
- * Use the CSP build and load the worker from Mapbox's CDN (or window.__env.mapboxWorkerUrl).
234
- * Keep MAPBOX_GL_VERSION in sync with the mapbox-gl peer dependency.
2
+ * Generated bundle index. Do not edit.
235
3
  */
236
-
237
- declare function ensureMapboxWorker(): typeof mapboxgl$1;
238
-
239
- interface CoolmapConfigModel {
240
- analyticsRESTURL: string | null;
241
- RESTURLPrefix: string | null;
242
- repository: string | null;
243
- mapboxStyle: string | null;
244
- mapboxAccessToken: string | null;
245
- }
246
- declare const COOLMAP_CONFIG: InjectionToken<CoolmapConfigModel>;
247
- declare function provideCoolmapConfig(config: CoolmapConfigModel): {
248
- provide: InjectionToken<CoolmapConfigModel>;
249
- useValue: CoolmapConfigModel;
250
- };
251
-
252
- declare class CoolmapService {
253
- mapbox: MapboxService;
254
- isLoading: i0.WritableSignal<boolean>;
255
- isDataFetched: i0.WritableSignal<boolean>;
256
- plottingIds: i0.WritableSignal<Set<string>>;
257
- resetModals: i0.WritableSignal<number>;
258
- plotRoute(route: any, i?: number | any, type?: string, enablefitbound?: boolean, showAllFitbound?: boolean): Promise<boolean> | undefined;
259
- loadMapProperty(pinRouteGeojson: any, index: number, unit: any, routeProps?: any): void;
260
- removeRouteAndMarker(index: number | any, type?: string): Promise<boolean>;
261
- clearAllRoutes(): Promise<boolean>;
262
- static ɵfac: i0.ɵɵFactoryDeclaration<CoolmapService, never>;
263
- static ɵprov: i0.ɵɵInjectableDeclaration<CoolmapService>;
264
- }
265
-
266
- export { AgToastService, COOLMAP_CONFIG, CoolmapService, CoolmapServices, MapboxService, UtilsService, ensureMapboxWorker, provideCoolmapConfig };
267
- export type { CoolmapConfigModel, CoolmapRoute, LocationAll, PopupData, Toast, ToastConfig, ToastPosition, ToastVariant };
4
+ /// <amd-module name="@aggdirect/coolmap-services" />
5
+ export * from './public-api';
@@ -0,0 +1,47 @@
1
+ import * as mapboxgl from 'mapbox-gl';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { CoolmapConfigModel, PopupData, Route } from './data-model';
4
+ import { UtilsService } from './utils.service';
5
+ import { EventManager } from '@angular/platform-browser';
6
+ import * as i0 from "@angular/core";
7
+ export declare class CoolmapService {
8
+ utils: UtilsService;
9
+ eventManager: EventManager;
10
+ private config;
11
+ map: mapboxgl.Map;
12
+ markerOriginList: mapboxgl.Marker[];
13
+ markerDestinationList: mapboxgl.Marker[];
14
+ initiatecoolmap: BehaviorSubject<boolean>;
15
+ reintiatecoolmap: import("rxjs").Observable<boolean>;
16
+ bounds: mapboxgl.LngLatBounds;
17
+ originDestinationCordinates: any;
18
+ padding: any;
19
+ windowActualHeightWidth: any;
20
+ popup: mapboxgl.Popup;
21
+ customTopForCustomer: number;
22
+ constructor(utils: UtilsService, eventManager: EventManager, config: CoolmapConfigModel);
23
+ initiateMapForAddRoute(el: HTMLElement): Promise<unknown>;
24
+ loadMapProperty(pinRouteGeojson: any, index: number, unit: any, route?: any, bottom?: number): Promise<unknown>;
25
+ drawLine(cordinates?: any, index?: number | any, route?: any, enablefitbound?: boolean, routeType?: string): void;
26
+ provideLineColor(unitType: string, type?: string | undefined): any;
27
+ showRoutePopup(arcDetails: any, event: any, isViewRoute?: any): void;
28
+ createPopup(datasetForPopup: PopupData): void;
29
+ hexToRGB(hex: any): [number, number, number];
30
+ createMarker(routeDetails: any): void;
31
+ removeRouteAndMarker(index: number | string | any): Promise<void>;
32
+ findMarkerBound(index: any): void;
33
+ filterRoute(ID: any, visibility: string, showAllFitbound?: boolean): Promise<void>;
34
+ extendBound(route: any, showAllFitbound: boolean | undefined): Promise<unknown>;
35
+ extendReBound(bottom?: number): Promise<unknown>;
36
+ plotRoute(route: any, i: number | any, type: string, enablefitbound?: boolean, showAllFitbound?: boolean): Promise<unknown>;
37
+ clearBound(): void;
38
+ formateLatLong(latlong: string): number[];
39
+ clearBoundWithCordinates(): void;
40
+ onResize(event: any): void;
41
+ setWindowHeight(screen: any): void;
42
+ setPadding(padding: any): void;
43
+ clearPadding(): void;
44
+ removeJobFromMap(data: Route[]): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<CoolmapService, never>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<CoolmapService>;
47
+ }
@@ -0,0 +1,92 @@
1
+ export declare class Route {
2
+ index: number;
3
+ type?: string | null;
4
+ customer_contact?: string | null;
5
+ customer_name?: string | null;
6
+ delivery_contact?: string | null;
7
+ delivery_lat?: number | null;
8
+ delivery_location?: string | null | undefined;
9
+ delivery_lon?: number | null;
10
+ driver_list?: Array<any>;
11
+ material?: string | null;
12
+ order_number?: string | null;
13
+ pickup_lat?: number | null;
14
+ pickup_location?: string | null | undefined;
15
+ pickup_lon?: number | null;
16
+ project?: string | null;
17
+ total_count?: number;
18
+ unit?: string | null;
19
+ values: any;
20
+ job_id?: string;
21
+ isSelected?: boolean;
22
+ date?: string;
23
+ created_at?: string | null;
24
+ created_by_name?: string | null;
25
+ customer_id?: string | null;
26
+ delivery_lat_lng?: string | null;
27
+ estimated_distance?: string | null;
28
+ estimated_time?: string | null;
29
+ materials_id?: string | null;
30
+ path?: [number, number];
31
+ pickup_lat_lng?: string | null;
32
+ route_id?: string | null;
33
+ route_name?: string | null;
34
+ unit_id?: string | null;
35
+ note?: string | null;
36
+ materialLabel?: string | null;
37
+ isActive?: boolean;
38
+ prevent?: boolean;
39
+ }
40
+ export declare const EstinationData: string[];
41
+ export declare enum EstinationEnum {
42
+ estimated_distance = "miles",
43
+ estimated_time = "time"
44
+ }
45
+ export declare const JobCodeOverviewData: string[];
46
+ export declare enum JobCodeOverviewEnum {
47
+ material = "Material",
48
+ order_number = "Job Code",
49
+ customer_name = "Customer",
50
+ customer_contact = "Customer Contact",
51
+ delivery_contact = "Delivery Contact",
52
+ project = "Project Name",
53
+ unit = "Job Type",
54
+ pickup_location = "Pickup",
55
+ delivery_location = "Delivery"
56
+ }
57
+ export declare const DriversmsCardKey: string[];
58
+ export declare enum DriverSmsCardEnum {
59
+ order_number = "Jobcode",
60
+ date = "Date",
61
+ values = "Total tasks",
62
+ material = "Material",
63
+ unit = "Unit",
64
+ pickup_location = "Pickup Address",
65
+ delivery_location = "Delivery Address"
66
+ }
67
+ export declare class PopupData {
68
+ coordinate: [number, number];
69
+ pickup: string | null;
70
+ jobCode?: string | null;
71
+ customer?: string | null;
72
+ drop: string | null;
73
+ routeType: string | null;
74
+ title: string | null;
75
+ material: string | null;
76
+ type: string | null;
77
+ }
78
+ export declare class CoolmapConfigModel {
79
+ analyticsRESTURL: string | null;
80
+ RESTURLPrefix: string | null;
81
+ repository: string | null;
82
+ mapboxStyle: string | null;
83
+ mapboxAccessToken: string | null;
84
+ }
85
+ export declare class CustomerRepoDetailsModel {
86
+ customer: CustomerDetailsModel | null;
87
+ projectId: string | null;
88
+ }
89
+ export declare class CustomerDetailsModel {
90
+ id: string | null;
91
+ name: string | null;
92
+ }
@@ -0,0 +1,61 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { NgZone } from '@angular/core';
3
+ import { MatSnackBar } from '@angular/material/snack-bar';
4
+ import { BehaviorSubject } from 'rxjs';
5
+ import { CoolmapConfigModel, Route } from './data-model';
6
+ import { FormGroup } from '@angular/forms';
7
+ import * as i0 from "@angular/core";
8
+ export declare class UtilsService {
9
+ http: HttpClient;
10
+ snackBar: MatSnackBar;
11
+ private config;
12
+ ngZone: NgZone;
13
+ analyticsRESTURL: string;
14
+ RESTURLPrefix: string;
15
+ pickupOptions: any[];
16
+ destOptions: any[];
17
+ ownerOptions: any[];
18
+ customerOptions: any[];
19
+ unitOptions: any[];
20
+ materialOptions: any[];
21
+ jcodeOptions: any[];
22
+ driverOption: any[];
23
+ truckingCompanayOption: any[];
24
+ routeNameOptions: any[];
25
+ preventnavChange: BehaviorSubject<boolean>;
26
+ navChangeObserve: import("rxjs").Observable<boolean>;
27
+ clearViewRouteforJobCode: BehaviorSubject<boolean>;
28
+ clearViewRouteforJobCodeObserve: import("rxjs").Observable<boolean>;
29
+ preVentJobdetailclose: BehaviorSubject<boolean>;
30
+ getpreVentJobdetailclose: import("rxjs").Observable<boolean>;
31
+ routeDetailsUtility: BehaviorSubject<{}>;
32
+ getrouteDetailsUtility: import("rxjs").Observable<{}>;
33
+ removeMapEntity: BehaviorSubject<{}>;
34
+ removeMapEntityUtility: import("rxjs").Observable<{}>;
35
+ dict: Map<string, string>;
36
+ unitsList: any;
37
+ materialsList: any;
38
+ materialsListForCustomer: any;
39
+ customersList: any;
40
+ constructor(http: HttpClient, snackBar: MatSnackBar, config: CoolmapConfigModel, ngZone: NgZone);
41
+ getDateFormat(strVal: Date | null, seprater?: string): string;
42
+ getData(path: string): import("rxjs").Observable<Object>;
43
+ postdata(path: string, data: any): import("rxjs").Observable<Object>;
44
+ postDataWithRestUrl(path: string, data: any): import("rxjs").Observable<Object>;
45
+ autocomplete(searchElementRef: any, form?: FormGroup): Promise<unknown>;
46
+ openSnackBar(message: string, className?: string): void;
47
+ makeOptions(item: Route): void;
48
+ filter(value: string, filters: any): any[];
49
+ getSearchResults(list: Route[], filterval: any): any;
50
+ clearOptions(): void;
51
+ setdictValue(key: string, value: string): void;
52
+ getdictValue(key: string): any;
53
+ removedictValue(key: string): void;
54
+ conveySearchIcon(value: any): boolean;
55
+ fetchUnitsList(): Promise<unknown>;
56
+ fetchMaterialsList(): Promise<unknown>;
57
+ fetchMaterialsListForCustomer(): Promise<unknown>;
58
+ fetchCustomersList(): Promise<unknown>;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<UtilsService, never>;
60
+ static ɵprov: i0.ɵɵInjectableDeclaration<UtilsService>;
61
+ }
package/package.json CHANGED
@@ -1,15 +1,29 @@
1
1
  {
2
2
  "name": "@aggdirect/coolmap-services",
3
- "version": "4.0.8",
3
+ "version": "10.2.3",
4
4
  "peerDependencies": {
5
- "@angular/common": "^20.3.0",
6
- "@angular/core": "^20.3.0",
7
- "mapbox-gl": "^3.0.0"
5
+ "@angular/common": "^17.0.8",
6
+ "@angular/core": "^17.0.8"
8
7
  },
9
8
  "dependencies": {
10
9
  "tslib": "^2.3.0"
11
10
  },
12
- "sideEffects": false,
11
+ "allowedNonPeerDependencies": {
12
+ "mapbox-gl": "^2.10.0",
13
+ "@types/mapbox-gl": "^2.7.5",
14
+ "@turf/turf": "^6.5.0",
15
+ "deck.gl": "^8.4.16"
16
+ },
17
+ "description": "This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.0.",
18
+ "main": "karma.conf.js",
19
+ "author": "Navin Vishwakarma <navin@ogmaconceptions.com>",
20
+ "contributors": [
21
+ "Santanu Das <santanu.das@ogmaconceptions.com>"
22
+ ],
23
+ "license": "ISC",
24
+ "keywords": [
25
+ "Coolmap-service"
26
+ ],
13
27
  "module": "fesm2022/aggdirect-coolmap-services.mjs",
14
28
  "typings": "index.d.ts",
15
29
  "exports": {
@@ -18,7 +32,16 @@
18
32
  },
19
33
  ".": {
20
34
  "types": "./index.d.ts",
35
+ "esm2022": "./esm2022/aggdirect-coolmap-services.mjs",
36
+ "esm": "./esm2022/aggdirect-coolmap-services.mjs",
21
37
  "default": "./fesm2022/aggdirect-coolmap-services.mjs"
22
38
  }
39
+ },
40
+ "sideEffects": false,
41
+ "directories": {
42
+ "lib": "lib"
43
+ },
44
+ "scripts": {
45
+ "test": "echo \"Error: no test specified\" && exit 1"
23
46
  }
24
- }
47
+ }
@@ -0,0 +1,3 @@
1
+ export * from './lib/service/coolmap.service';
2
+ export * from './lib/service/utils.service';
3
+ export * from './lib/service/data-model';