@aggdirect/coolmap 0.0.8 → 0.1.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.
Files changed (104) hide show
  1. package/README.md +0 -33
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +7 -0
  4. package/package.json +5 -31
  5. package/src/assets/mixin.scss +28 -0
  6. package/src/assets/palette.scss +24 -0
  7. package/src/assets/variable.scss +15 -0
  8. package/src/lib/component/add-route/add-route.component.html +140 -0
  9. package/src/lib/component/add-route/add-route.component.scss +235 -0
  10. package/src/lib/component/add-route/add-route.component.spec.ts +23 -0
  11. package/src/lib/component/add-route/add-route.component.ts +270 -0
  12. package/src/lib/component/job-code/job-code.component.html +93 -0
  13. package/src/lib/component/job-code/job-code.component.scss +427 -0
  14. package/src/lib/component/job-code/job-code.component.ts +94 -0
  15. package/src/lib/component/map/map.component.css +0 -0
  16. package/src/lib/component/map/map.component.html +5 -0
  17. package/src/lib/component/map/map.component.spec.ts +23 -0
  18. package/src/lib/component/map/map.component.ts +33 -0
  19. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +44 -0
  20. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +0 -0
  21. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +23 -0
  22. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +70 -0
  23. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +43 -0
  24. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +5 -0
  25. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +64 -0
  26. package/src/lib/component/nav/nav.component.html +19 -0
  27. package/src/lib/component/nav/nav.component.scss +65 -0
  28. package/src/lib/component/nav/nav.component.ts +38 -0
  29. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +56 -0
  30. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +167 -0
  31. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +23 -0
  32. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +42 -0
  33. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +66 -0
  34. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +226 -0
  35. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +234 -0
  36. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +7 -0
  37. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +10 -0
  38. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +23 -0
  39. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +15 -0
  40. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +30 -0
  41. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +172 -0
  42. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +23 -0
  43. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +19 -0
  44. package/src/lib/component/shared/dialog/dialog.component.html +7 -0
  45. package/src/lib/component/shared/dialog/dialog.component.scss +30 -0
  46. package/src/lib/component/shared/dialog/dialog.component.ts +18 -0
  47. package/src/lib/component/shared/job-route-list/job-route-list.component.html +27 -0
  48. package/src/lib/component/shared/job-route-list/job-route-list.component.scss +3 -0
  49. package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +23 -0
  50. package/src/lib/component/shared/job-route-list/job-route-list.component.ts +54 -0
  51. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +8 -0
  52. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +12 -0
  53. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +23 -0
  54. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +15 -0
  55. package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +5 -0
  56. package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +32 -0
  57. package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +23 -0
  58. package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +12 -0
  59. package/src/lib/coolmap.component.ts +20 -0
  60. package/src/lib/coolmap.module.ts +92 -0
  61. package/{public-api.d.ts → src/public-api.ts} +4 -0
  62. package/src/test.ts +27 -0
  63. package/tsconfig.lib.json +15 -0
  64. package/tsconfig.lib.prod.json +10 -0
  65. package/tsconfig.spec.json +17 -0
  66. package/esm2020/aggdirect-coolmap.mjs +0 -5
  67. package/esm2020/lib/component/add-route/add-route.component.mjs +0 -310
  68. package/esm2020/lib/component/job-code/job-code.component.mjs +0 -114
  69. package/esm2020/lib/component/map/map.component.mjs +0 -38
  70. package/esm2020/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +0 -87
  71. package/esm2020/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +0 -89
  72. package/esm2020/lib/component/nav/nav.component.mjs +0 -52
  73. package/esm2020/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +0 -68
  74. package/esm2020/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +0 -314
  75. package/esm2020/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +0 -19
  76. package/esm2020/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +0 -29
  77. package/esm2020/lib/component/shared/dialog/dialog.component.mjs +0 -29
  78. package/esm2020/lib/component/shared/job-route-list/job-route-list.component.mjs +0 -71
  79. package/esm2020/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +0 -19
  80. package/esm2020/lib/component/shared/jobcode-status/jobcode-status.component.mjs +0 -14
  81. package/esm2020/lib/coolmap.component.mjs +0 -22
  82. package/esm2020/lib/coolmap.module.mjs +0 -156
  83. package/esm2020/public-api.mjs +0 -10
  84. package/fesm2015/aggdirect-coolmap.mjs +0 -1344
  85. package/fesm2015/aggdirect-coolmap.mjs.map +0 -1
  86. package/fesm2020/aggdirect-coolmap.mjs +0 -1317
  87. package/fesm2020/aggdirect-coolmap.mjs.map +0 -1
  88. package/index.d.ts +0 -5
  89. package/lib/component/add-route/add-route.component.d.ts +0 -62
  90. package/lib/component/job-code/job-code.component.d.ts +0 -31
  91. package/lib/component/map/map.component.d.ts +0 -14
  92. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +0 -40
  93. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +0 -38
  94. package/lib/component/nav/nav.component.d.ts +0 -30
  95. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +0 -19
  96. package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +0 -42
  97. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +0 -9
  98. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +0 -11
  99. package/lib/component/shared/dialog/dialog.component.d.ts +0 -13
  100. package/lib/component/shared/job-route-list/job-route-list.component.d.ts +0 -26
  101. package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +0 -9
  102. package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +0 -8
  103. package/lib/coolmap.component.d.ts +0 -8
  104. package/lib/coolmap.module.d.ts +0 -40
@@ -0,0 +1,270 @@
1
+ import { Component, ElementRef, OnInit, ViewChild, Output, EventEmitter, SimpleChanges, OnChanges, Input, OnDestroy } from '@angular/core';
2
+ import { FormControl, FormGroup, Validators } from '@angular/forms';
3
+ import { debounceTime, distinctUntilChanged, fromEvent, map, Observable, startWith, Subject, takeUntil } from 'rxjs';
4
+ import {MatDialog} from '@angular/material/dialog';
5
+ import { CoolmapService, Route, UtilsService } from 'coolmap-services';
6
+ import { DialogComponent } from '../shared/dialog/dialog.component';
7
+
8
+
9
+ @Component({
10
+ selector: 'app-add-route',
11
+ templateUrl: './add-route.component.html',
12
+ styleUrls: ['./add-route.component.scss']
13
+ })
14
+ export class AddRouteComponent implements OnInit, OnChanges, OnDestroy {
15
+ @ViewChild('filterPickup') filterPickup!: ElementRef;
16
+ @ViewChild('filterDelivery') filterDelivery!: ElementRef;
17
+ @Output() changeNav = new EventEmitter<string>();
18
+ @Output() updateRouteList = new EventEmitter<boolean>();
19
+ pickupOptions: any = [];
20
+ deliveryOptions: any = [];
21
+ requestParmsForRouteDetails = { pickup_lat_lng: '', delivery_lat_lng: '' }
22
+ customersList: any = [];
23
+ unitsList: any = [];
24
+ materialsList: any = [];
25
+ addRouteForm!: FormGroup;
26
+ @Input() routeData!: Route;
27
+ routeId: string | null | undefined;
28
+ preventSave: boolean = false;
29
+ preventInitialSave: boolean = false;
30
+ customersList$!: Observable<any>;
31
+ routeDetails!: { pickup_location: string | null | undefined; delivery_location: string | null | undefined; } | null;
32
+ private destroyer$ = new Subject<boolean>();
33
+ popupDetails: Route;
34
+ enablePopUp: boolean = false;
35
+ prevantPopupClose = false;
36
+ enableForm: boolean = false;
37
+
38
+ constructor(private coolMapService: CoolmapService, private utils: UtilsService, public dialog: MatDialog) {
39
+ this.fetchCustomersList();
40
+ this.fetchUnitsList();
41
+ this.fetchMaterialsList(); this.formInit();
42
+ this.utils.getrouteDetailsUtility.subscribe(res => {
43
+ if (res) {
44
+ if (res['event'] !== 'click' && !this.prevantPopupClose) { this.enablePopUp = res['event'] }
45
+ else if(this.enablePopUp && !this.prevantPopupClose) { this.prevantPopupClose = true; }
46
+ if (res['event'] !== 'click' && !res['event'] && this.prevantPopupClose) {
47
+ this.popupDetails = this.utils.getdictValue('route-detailsv2');
48
+ } else { this.popupDetails = res['route'] }
49
+ this.popupDetails['created_at'] = this.utils.getDateFormat(new Date(this.popupDetails['created_at']), '/');
50
+ }
51
+ });
52
+ }
53
+ filterCustomerList() {
54
+ this.customersList$ = this.addRouteForm.controls['customer_name'].valueChanges.pipe(
55
+ startWith(''),
56
+ map(value => this._filter(value || '')),
57
+ );
58
+ }
59
+ private _filter(value: string): string[] {
60
+ const filterValue = value.toLowerCase();
61
+ return this.customersList.filter((option: any) => option['customer_name'].toLowerCase().includes(filterValue));
62
+ }
63
+ ngOnChanges(changes: SimpleChanges): void {
64
+ if (changes['routeData'] && !changes['routeData']['currentValue']) this.inIt(null);
65
+ }
66
+ openDialog(): void {
67
+ const dialogRef = this.dialog.open(DialogComponent, {
68
+ data: { body: 'Are you sure you want to delete this route?' },
69
+ });
70
+ dialogRef.afterClosed().subscribe(res => { if (res) { this.deleteRoute() } });
71
+ }
72
+ editEvent(){
73
+ this.prevantPopupClose = false;
74
+ this.enableForm = true; this.enablePopUp = false;
75
+ this.popupDetails['prevent'] = false;
76
+ this.utils.removeMapEntity.next(this.popupDetails);
77
+ this.inIt(this.popupDetails);
78
+ }
79
+ inIt(changes: Route) {
80
+ if (changes) {
81
+ if (!changes['prevent']) {
82
+ this.preventSave = false;
83
+ this.formControlValue();
84
+ this.patchFormValue(changes); this.checkAndFetchRouteInformation(true)
85
+ }
86
+ }
87
+ if (!changes) { this.enableForm = true; this.preventSave = true; this.patchFormValue(); this.checkAndFetchRouteInformation() }
88
+ }
89
+ ngOnInit(): void {
90
+ this.formControlValue();
91
+ }
92
+
93
+ ngAfterViewInit() {
94
+ fromEvent(this.filterPickup.nativeElement, 'keyup').pipe(
95
+ distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
96
+ this.utils.fetchAutoCompleteLocations(this.filterPickup.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
97
+ this.pickupOptions = res.features;
98
+ });
99
+ });
100
+
101
+ fromEvent(this.filterDelivery.nativeElement, 'keyup').pipe(
102
+ distinctUntilChanged(), debounceTime(150)).pipe(takeUntil(this.destroyer$)).subscribe(() => {
103
+ this.utils.fetchAutoCompleteLocations(this.filterDelivery.nativeElement.value).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
104
+ this.deliveryOptions = res.features;
105
+ });
106
+ });
107
+ }
108
+
109
+ formControlValue() {
110
+ this.addRouteForm.controls['pickup_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
111
+ if (this.addRouteForm.value.pickup_location && res !== this.addRouteForm.value.pickup_location) {
112
+ this.addRouteForm.patchValue({
113
+ pickup_lat_lng: '',
114
+ });
115
+ this.addRouteForm.controls['pickup_lat_lng'].markAsTouched();
116
+ }
117
+ });
118
+
119
+ this.addRouteForm.controls['delivery_location']?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
120
+ if (this.addRouteForm.value.delivery_location && res !== this.addRouteForm.value.delivery_location) {
121
+ this.addRouteForm.patchValue({
122
+ delivery_lat_lng: '',
123
+ });
124
+ this.addRouteForm.controls['delivery_lat_lng'].markAsTouched();
125
+ }
126
+ });
127
+ }
128
+
129
+ formInit() {
130
+ this.addRouteForm = new FormGroup({
131
+ route_name: new FormControl('', [Validators.required]),
132
+ customer_name: new FormControl({value: '', disabled: true}, [Validators.required]),
133
+ materials_id: new FormControl('', [Validators.required]),
134
+ unit_id: new FormControl('', [Validators.required]),
135
+ path: new FormControl('', [Validators.required]),
136
+ pickup_location: new FormControl('', [Validators.required]),
137
+ pickup_lat_lng: new FormControl('', [Validators.required]),
138
+ delivery_location: new FormControl('', [Validators.required]),
139
+ delivery_lat_lng: new FormControl('', [Validators.required]),
140
+ estimated_distance: new FormControl('', [Validators.required]),
141
+ estimated_time: new FormControl('', [Validators.required]),
142
+ note: new FormControl('', [Validators.maxLength(2048)]),
143
+ });
144
+ }
145
+
146
+ patchFormValue(data?: Route) {
147
+ this.addRouteForm.reset();
148
+ this.addRouteForm.patchValue(data!);
149
+ this.routeId = data?.route_id;
150
+ this.routeDetails = data ? { pickup_location: data.pickup_location, delivery_location: data.delivery_location } : null;
151
+ this.addRouteForm.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe(res => {
152
+ if (res) { if (this.preventInitialSave) this.preventInitialSave = false }
153
+ });
154
+ this.filterCustomerList();
155
+ }
156
+
157
+ fetchCustomersList() {
158
+ this.utils.getData('coolmap/company/list/view').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
159
+ if (res) { this.customersList = res.data; this.filterCustomerList(); this.addRouteForm.controls['customer_name'].enable(); }
160
+ })
161
+ }
162
+
163
+ async fetchUnitsList() {
164
+ await this.utils.getData('coolmap/unit/list/view').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
165
+ if (res) { this.unitsList = res.data }
166
+ })
167
+ }
168
+
169
+ fetchMaterialsList() {
170
+ this.utils.getData('coolmap/material/list/view').pipe(takeUntil(this.destroyer$)).subscribe(((res: any) => {
171
+ res.data.sort((a: any, b: any) => a.material.localeCompare(b.material))
172
+ this.materialsList = res.data
173
+ }))
174
+ }
175
+
176
+ selectedLongLat(type: string, event: any) {
177
+ if (type === 'pickup') {
178
+ this.addRouteForm.patchValue({
179
+ pickup_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
180
+ });
181
+ this.coolMapService.clearBoundWithCordinates();
182
+ } else if (type === 'delivery') {
183
+ this.addRouteForm.patchValue({
184
+ delivery_lat_lng: (event.geometry.coordinates[1] + ',' + event.geometry.coordinates[0]).toString()
185
+ })
186
+ }
187
+ this.checkAndFetchRouteInformation();
188
+ }
189
+
190
+ checkAndFetchRouteInformation(isinitial?: boolean) {
191
+ if (this.addRouteForm.value?.delivery_lat_lng?.length > 0 && this.addRouteForm.value?.pickup_lat_lng?.length > 0) {
192
+ const param = {
193
+ delivery_lat_lng: this.addRouteForm.value.delivery_lat_lng,
194
+ pickup_lat_lng: this.addRouteForm.value.pickup_lat_lng
195
+ };
196
+ this.utils.postdata('coolmap/calculate/routes/estimation', param).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
197
+ if (res && res['path']) {
198
+ this.addRouteForm.patchValue({
199
+ estimated_distance: res.dist, estimated_time: res.time, path: res.path
200
+ });
201
+ let path = res['path'].split(';');
202
+ path = path.map((ele: string | any) => { return ele = this.formateLatLong(ele) });
203
+ res['path'] = path;
204
+ const element: any = {
205
+ type: 'FeatureCollection',
206
+ features: [{ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: res['path'] } }]
207
+ }
208
+ this.coolMapService.removeRouteAndMarker(1).then(() => {
209
+ const unit = this.unitsList.find((x: any) => x.id === this.addRouteForm.value.unit_id);
210
+ const materialDetails = this.materialsList.find((x: any) => x.material_id === this.addRouteForm.value.materials_id);
211
+ this.coolMapService.loadMapProperty(element, 1, unit?.type,
212
+ {
213
+ pickup_location: this.addRouteForm.get('pickup_location')?.value,
214
+ delivery_location: this.addRouteForm.get('delivery_location')?.value,
215
+ route_name: this.addRouteForm.get('route_name')?.value,
216
+ material: materialDetails?.material, unit: unit?.type
217
+ }).then((res) =>{this.preventSave = true});
218
+ });
219
+ } else {
220
+ this.coolMapService.removeRouteAndMarker(1);
221
+ this.utils.openSnackBar(res['status'], 'error');
222
+ }
223
+ if (this.routeId && isinitial) this.preventInitialSave = true;
224
+ });
225
+ } else { this.coolMapService.removeRouteAndMarker(1) }
226
+ }
227
+
228
+ formateLatLong(latlong: string) { return latlong ? latlong.split(',').map(x => +x).reverse() : null }
229
+ saveRoute() {
230
+ if (this.addRouteForm.valid) {
231
+ this.preventSave = false;
232
+ const data = this.addRouteForm.value;
233
+ const url = this.routeId ? this.utils.postdata('coolmap/update/routes', data) : this.utils.postdata('coolmap/add/routes', data)
234
+ if (this.routeId) data['id'] = this.routeId;
235
+ url.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
236
+ if (res.success) {
237
+ this.updateRouteList.emit(true);
238
+ this.utils.openSnackBar(res.message, 'success');
239
+ this.preventInitialSave = true;
240
+ this.preventSave = true;
241
+ if(!this.routeId)this.changeNav.next('Addroute');
242
+ } else {
243
+ this.utils.openSnackBar(res.message, 'error');
244
+ this.preventSave = true;
245
+ }
246
+ }, (err) => { if (err) { this.preventSave = true; } });
247
+ } else {
248
+ this.addRouteForm.markAllAsTouched();
249
+ }
250
+ }
251
+ deleteRoute() {
252
+ this.preventSave = false;
253
+ this.utils.postdata('coolmap/delete/routes', { uuid: this.routeId }).subscribe(res => {
254
+ if (res['data']['success']) {
255
+ this.utils.openSnackBar(res['data']['message'], 'success');
256
+ this.updateRouteList.emit(true);
257
+ this.changeNav.next('Addroute');
258
+ this.preventInitialSave = true;
259
+ this.preventSave = true;
260
+ } else {
261
+ this.utils.openSnackBar('Somthing went wrong', 'error');
262
+ this.preventSave = true;
263
+ }
264
+ }, (err) =>{this.preventSave = true})
265
+ }
266
+ ngOnDestroy(): void {
267
+ this.destroyer$.next(true);
268
+ this.destroyer$.unsubscribe();
269
+ }
270
+ }
@@ -0,0 +1,93 @@
1
+ <div class="jobcode_detailprt" (click)="isOverlapRouteSection = false" *ngIf="jobdetail" [ngClass]="{'overlap': !isOverlapRouteSection}" cdkDrag>
2
+ <div class="topheadingprt" *ngIf="jobdetail['order_number']">
3
+ <h2>{{jobdetail['order_number']}}</h2>
4
+ </div>
5
+ <span class="close"><mat-icon (click)="clearJob()">clear</mat-icon></span>
6
+ <div class="job_details_area">
7
+ <div class="detailnameprt">
8
+ <span> <b> {{jobdetail.customer_name}} </b> Customer </span>
9
+ <app-jobcode-status [jobValue]="jobdetail"></app-jobcode-status>
10
+ </div>
11
+ <app-jobcode-overview [jobValue]="jobdetail"></app-jobcode-overview>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="route_listprt" (click)="isOverlapRouteSection = true" [ngClass]="{ 'show': isVisible, 'overlap': isOverlapRouteSection}">
16
+ <div class="listing_toggle" (click)="toggleSidemenu()">
17
+ <img src="assets/images/route.svg" alt="" />
18
+ </div>
19
+
20
+ <div class="listing_box">
21
+ <div class="closebtn" (click)="toggleSidemenu()">
22
+ <mat-icon>clear</mat-icon>
23
+ </div>
24
+
25
+ <div class="btnprt">
26
+ <h2> List of Routes </h2>
27
+ <button (click)="masterToggle()">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>
28
+ </div>
29
+
30
+ <app-job-route-list [routes]="routes" [masterRoutes]="masterRoutes" [selectedRoute]="selectedRoute" (changeRoutes)="routes = $event" (changeSelectedRoute)="selectedRoute = $event"></app-job-route-list>
31
+
32
+ <perfect-scrollbar>
33
+ <ul *ngIf="routes['length'] > 0">
34
+ <li *ngFor="let list of routes">
35
+ <div class="iconprt">
36
+ <span>
37
+ <input type="checkbox" [checked]="selectedRoute.isSelected(list)"
38
+ (change)="$event ? selectRoute(list) : null" /><label>&nbsp;</label>
39
+ <div class="border"></div>
40
+ </span>
41
+ <div class="statusunit" [ngClass]="list['unit']">{{list['unit']}}</div>
42
+ <div class="infoicon">
43
+ <img (mouseenter)="togglerouteDetails(true, list)" (mouseout)="togglerouteDetails(false, list, true)"
44
+ (click)="togglerouteDetails('click', list)" src="assets/images/info_icon.png" [alt]="" />
45
+ </div>
46
+ </div>
47
+ <div class="pickprtbox">
48
+ <h2> {{list['route_name']}} </h2>
49
+ <h3>{{list['customer_name']}} | {{list['material']}}</h3>
50
+ <div class="pickdropprt">
51
+ <div class="pickprt">
52
+ <b>
53
+ <h4>{{list['pickup_location']}}</h4>
54
+ </b>
55
+ </div>
56
+ <div class="dropprt">
57
+ <b>
58
+ <h4>{{list['delivery_location']}}</h4>
59
+ </b>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </li>
64
+ </ul>
65
+ <p style="color: #fff;" *ngIf="routes.length === 0">No Route found</p>
66
+ </perfect-scrollbar>
67
+ </div>
68
+
69
+ <div class="route_detail" *ngIf="detailsCardEnable">
70
+ <div class="closebtnroutedetail" (click)="detailsCardEnable = false; preventMouseout = false">
71
+ <mat-icon>clear</mat-icon>
72
+ </div>
73
+ <div class="destination">
74
+ <div class="duration">
75
+ <p class="pickprt"><b>Pickup:</b> {{routeCardDetail?.pickup_location}}</p>
76
+ <p class="dropprt"><b>Delivery:</b> {{routeCardDetail?.delivery_location}} </p>
77
+ </div>
78
+ <span><b>Name:</b> {{routeCardDetail?.route_name}}</span>
79
+ <span><b>Customer:</b> {{routeCardDetail?.customer_name}}</span>
80
+ <span><b>Material:</b> {{routeCardDetail?.material}}</span>
81
+ <span><b>Type:</b> {{routeCardDetail?.unit}}</span>
82
+ <span><b>Distance:</b> {{routeCardDetail?.estimated_distance}}</span>
83
+ <span><b>Travel Time:</b> {{routeCardDetail?.estimated_time}}</span>
84
+ <span class="notes"><b>Notes:</b> {{routeCardDetail?.note}}</span>
85
+ </div>
86
+
87
+ <div class="createTxt">
88
+ <small>
89
+ Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}
90
+ </small>
91
+ </div>
92
+ </div>
93
+ </div>