tango-app-ui-manage-tickets 3.7.0-beta.6 → 3.7.0-beta.60

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 (147) hide show
  1. package/.eslintrc.json +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +12 -25
  4. package/src/lib/components/add-csm-modal/add-csm-modal.component.html +32 -0
  5. package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +14 -0
  6. package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +23 -0
  7. package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +94 -0
  8. package/src/lib/components/audit-log/audit-log.component.html +1 -0
  9. package/src/lib/components/audit-log/audit-log.component.scss +0 -0
  10. package/src/lib/components/audit-log/audit-log.component.spec.ts +23 -0
  11. package/src/lib/components/audit-log/audit-log.component.ts +10 -0
  12. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +234 -0
  13. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +186 -0
  14. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +23 -0
  15. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +520 -0
  16. package/src/lib/components/audit-metrics/audit-metrics.component.html +345 -0
  17. package/src/lib/components/audit-metrics/audit-metrics.component.scss +34 -0
  18. package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +23 -0
  19. package/src/lib/components/audit-metrics/audit-metrics.component.ts +292 -0
  20. package/src/lib/components/audit-report-popup/audit-report-popup.component.html +111 -0
  21. package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +101 -0
  22. package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +23 -0
  23. package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +397 -0
  24. package/src/lib/components/audit-retag/audit-retag.component.html +129 -0
  25. package/src/lib/components/audit-retag/audit-retag.component.scss +146 -0
  26. package/src/lib/components/audit-retag/audit-retag.component.spec.ts +23 -0
  27. package/src/lib/components/audit-retag/audit-retag.component.ts +489 -0
  28. package/src/lib/components/comment-model/comment-model.component.html +24 -0
  29. package/src/lib/components/comment-model/comment-model.component.scss +20 -0
  30. package/src/lib/components/comment-model/comment-model.component.spec.ts +23 -0
  31. package/src/lib/components/comment-model/comment-model.component.ts +53 -0
  32. package/src/lib/components/count/count.component.html +54 -0
  33. package/src/lib/components/count/count.component.scss +14 -0
  34. package/src/lib/components/count/count.component.spec.ts +23 -0
  35. package/src/lib/components/count/count.component.ts +82 -0
  36. package/src/lib/components/custom-select/custom-select.component.html +134 -0
  37. package/src/lib/components/custom-select/custom-select.component.scss +204 -0
  38. package/src/lib/components/custom-select/custom-select.component.spec.ts +23 -0
  39. package/src/lib/components/custom-select/custom-select.component.ts +189 -0
  40. package/src/lib/components/filter-options/filter-options.component.html +51 -0
  41. package/src/lib/components/filter-options/filter-options.component.scss +102 -0
  42. package/src/lib/components/filter-options/filter-options.component.spec.ts +23 -0
  43. package/src/lib/components/filter-options/filter-options.component.ts +38 -0
  44. package/src/lib/components/footfall-dic/footfall-dic.component.html +1275 -0
  45. package/src/lib/components/footfall-dic/footfall-dic.component.scss +273 -0
  46. package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +23 -0
  47. package/src/lib/components/footfall-dic/footfall-dic.component.ts +1206 -0
  48. package/src/lib/components/footfall-dicview/footfall-dicview.component.html +1136 -0
  49. package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +416 -0
  50. package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +23 -0
  51. package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +1168 -0
  52. package/src/lib/components/footfall-popup/footfall-popup.component.html +61 -0
  53. package/src/lib/components/footfall-popup/footfall-popup.component.scss +20 -0
  54. package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +23 -0
  55. package/src/lib/components/footfall-popup/footfall-popup.component.ts +12 -0
  56. package/src/lib/components/group-select/group-select.component.html +44 -0
  57. package/src/lib/components/group-select/group-select.component.scss +144 -0
  58. package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
  59. package/src/lib/components/group-select/group-select.component.ts +145 -0
  60. package/src/lib/components/re-trigger/re-trigger.component.html +53 -0
  61. package/src/lib/components/re-trigger/re-trigger.component.scss +16 -0
  62. package/src/lib/components/re-trigger/re-trigger.component.spec.ts +23 -0
  63. package/src/lib/components/re-trigger/re-trigger.component.ts +96 -0
  64. package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
  65. package/src/lib/components/reactive-select/reactive-select.component.scss +52 -0
  66. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
  67. package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
  68. package/src/lib/components/remove-audit/remove-audit.component.html +38 -0
  69. package/src/lib/components/remove-audit/remove-audit.component.scss +27 -0
  70. package/src/lib/components/remove-audit/remove-audit.component.spec.ts +23 -0
  71. package/src/lib/components/remove-audit/remove-audit.component.ts +81 -0
  72. package/src/lib/components/start-audit/start-audit.component.html +174 -0
  73. package/src/lib/components/start-audit/start-audit.component.scss +185 -0
  74. package/src/lib/components/start-audit/start-audit.component.spec.ts +23 -0
  75. package/src/lib/components/start-audit/start-audit.component.ts +761 -0
  76. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +43 -0
  77. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +35 -0
  78. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +23 -0
  79. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +118 -0
  80. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +386 -0
  81. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +87 -0
  82. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +23 -0
  83. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +494 -0
  84. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +4743 -0
  85. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +1208 -0
  86. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +23 -0
  87. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +3351 -0
  88. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +100 -0
  89. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +34 -0
  90. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +23 -0
  91. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +48 -0
  92. package/src/lib/components/tickets/tickets.component.html +451 -0
  93. package/src/lib/components/tickets/tickets.component.scss +131 -0
  94. package/src/lib/components/tickets/tickets.component.spec.ts +23 -0
  95. package/src/lib/components/tickets/tickets.component.ts +809 -0
  96. package/src/lib/components/viewcategory/viewcategory.component.html +38 -0
  97. package/src/lib/components/viewcategory/viewcategory.component.scss +29 -0
  98. package/src/lib/components/viewcategory/viewcategory.component.spec.ts +23 -0
  99. package/src/lib/components/viewcategory/viewcategory.component.ts +79 -0
  100. package/src/lib/services/audit.service.spec.ts +16 -0
  101. package/src/lib/services/audit.service.ts +98 -0
  102. package/src/lib/services/excel.service.ts +48 -0
  103. package/src/lib/services/ticket.service.spec.ts +16 -0
  104. package/src/lib/services/ticket.service.ts +501 -0
  105. package/src/lib/services/timer.service.spec.ts +16 -0
  106. package/src/lib/services/timer.service.ts +92 -0
  107. package/src/lib/tango-manage-tickets-routing.module.ts +37 -0
  108. package/src/lib/tango-manage-tickets.module.ts +68 -0
  109. package/{public-api.d.ts → src/public-api.ts} +8 -2
  110. package/tsconfig.lib.json +14 -0
  111. package/tsconfig.lib.prod.json +10 -0
  112. package/tsconfig.spec.json +14 -0
  113. package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +0 -98
  114. package/esm2022/lib/components/audit-log/audit-log.component.mjs +0 -11
  115. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +0 -298
  116. package/esm2022/lib/components/comment-model/comment-model.component.mjs +0 -58
  117. package/esm2022/lib/components/count/count.component.mjs +0 -89
  118. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +0 -894
  119. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  120. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +0 -96
  121. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  122. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +0 -127
  123. package/esm2022/lib/components/tickets/tickets.component.mjs +0 -793
  124. package/esm2022/lib/services/excel.service.mjs +0 -45
  125. package/esm2022/lib/services/ticket.service.mjs +0 -158
  126. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +0 -24
  127. package/esm2022/lib/tango-manage-tickets.module.mjs +0 -54
  128. package/esm2022/public-api.mjs +0 -6
  129. package/esm2022/tango-app-ui-manage-tickets.mjs +0 -5
  130. package/fesm2022/tango-app-ui-manage-tickets.mjs +0 -2914
  131. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +0 -1
  132. package/index.d.ts +0 -5
  133. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +0 -30
  134. package/lib/components/audit-log/audit-log.component.d.ts +0 -5
  135. package/lib/components/audit-metrics/audit-metrics.component.d.ts +0 -59
  136. package/lib/components/comment-model/comment-model.component.d.ts +0 -17
  137. package/lib/components/count/count.component.d.ts +0 -23
  138. package/lib/components/footfall-dic/footfall-dic.component.d.ts +0 -130
  139. package/lib/components/group-select/group-select.component.d.ts +0 -33
  140. package/lib/components/re-trigger/re-trigger.component.d.ts +0 -32
  141. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  142. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +0 -27
  143. package/lib/components/tickets/tickets.component.d.ts +0 -84
  144. package/lib/services/excel.service.d.ts +0 -10
  145. package/lib/services/ticket.service.d.ts +0 -49
  146. package/lib/tango-manage-tickets-routing.module.d.ts +0 -7
  147. package/lib/tango-manage-tickets.module.d.ts +0 -21
@@ -0,0 +1,14 @@
1
+ .img {
2
+ width: 95px;
3
+ height: 200px;
4
+ }
5
+ .item {
6
+ position: relative;
7
+ padding-top: 20px;
8
+ display: inline-block;
9
+ max-height: 595px;
10
+ }
11
+ .scroll-y{
12
+ overflow-y: auto !important;
13
+ position: relative !important;
14
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CountComponent } from './count.component';
4
+
5
+ describe('CountComponent', () => {
6
+ let component: CountComponent;
7
+ let fixture: ComponentFixture<CountComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [CountComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CountComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,82 @@
1
+ import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
2
+ import { TicketService } from '../../services/ticket.service';
3
+ import { ToastService } from 'tango-app-ui-shared';
4
+ import { ExcelService } from '../../services/excel.service';
5
+ import { Subject, takeUntil } from 'rxjs';
6
+
7
+ @Component({
8
+ selector: 'lib-count',
9
+ templateUrl: './count.component.html',
10
+ styleUrl: './count.component.scss'
11
+ })
12
+ export class CountComponent implements OnInit,OnDestroy {
13
+
14
+ private readonly destroy$ = new Subject();
15
+ @Input() data:any;
16
+ loading:any = true;
17
+ noData:any=false;
18
+ auditImages:any;
19
+
20
+ constructor(private Service:TicketService,private toast:ToastService,private excel : ExcelService,private cd: ChangeDetectorRef){}
21
+ ngOnInit(){
22
+ this.getAuditImages();
23
+ }
24
+
25
+ ngOnDestroy(): void {
26
+ this.destroy$.next(true);
27
+ this.destroy$.complete();
28
+ }
29
+
30
+ getAuditImages(){
31
+ let params:any = {
32
+ fileDate: this.data?.fileDate,
33
+ storeId:this.data?.storeId,
34
+ imageType:this.data?.imageType,
35
+ export : false,
36
+ moduleType : this.data?.selectedType,
37
+ zoneName: this.data?.zoneName
38
+ }
39
+ this.Service.getAuditImages(params).pipe(takeUntil(this.destroy$)).subscribe({
40
+ next:(res:any)=>{
41
+ if(res && res?.code === 200){
42
+ this.auditImages = res?.data?.result;
43
+ this.loading = false;
44
+ this.noData = false;
45
+ }else{
46
+ this.noData = true;
47
+ this.loading = false;
48
+ }
49
+ this.cd.detectChanges();
50
+ },
51
+ error:(err:any)=>{
52
+ this.noData = true;
53
+ this.loading = false;
54
+ },
55
+ })
56
+
57
+ }
58
+
59
+ exportTable(){
60
+ let params:any = {
61
+ fileDate: this.data?.fileDate,
62
+ storeId:this.data?.storeId,
63
+ imageType:this.data?.imageType,
64
+ export : true,
65
+ moduleType: this.data?.selectedType,
66
+ zoneName: this.data?.zoneName
67
+ }
68
+ let type = this.data?.type === 'before' ? 'BeforeCount' : 'AfterCount'
69
+ this.Service.ExportAuditImagesasxlsx(params).pipe(takeUntil(this.destroy$)).subscribe({
70
+ next:(res:any)=>{
71
+ if(res){
72
+ this.excel.saveAsZipFile(res,type)
73
+ }
74
+ },
75
+ error:(err:any)=>{
76
+ this.toast.getErrorToast(err?.error)
77
+ },
78
+ })
79
+
80
+ }
81
+
82
+ }
@@ -0,0 +1,134 @@
1
+ <div class="outer-container">
2
+ <!-- TRIGGER -->
3
+ <div
4
+ [ngClass]="disabled ? 'disable-input' : ''"
5
+ class="select-trigger form-select"
6
+ (click)="openDropdown($event)"
7
+ >
8
+ <ng-container *ngIf="multi; else singleMode">
9
+ <span *ngIf="selectedValues?.length" class="select-value mx-2">
10
+ <!-- <img class="me-2 trigger-avatar" alt="Pic" src="./assets/tango/Image/users-teams.svg" /> -->
11
+ {{ selectedValues?.[0]?.[searchField] }}
12
+ </span>
13
+ <span class="select-value mx-2" *ngIf="selectedValues?.length > 1">
14
+ +{{ selectedValues?.length - 1 }}
15
+ </span>
16
+ <span *ngIf="!selectedValues?.length">{{ label || 'Select' }}</span>
17
+ </ng-container>
18
+
19
+ <ng-template #singleMode>
20
+ <span *ngIf="selectedValues?.[0]; else placeholderSingle">
21
+ {{ selectedValues?.[0]?.[searchField] || 'Select' }}
22
+ </span>
23
+ <ng-template #placeholderSingle>
24
+ <span >{{ label || 'Select' }}</span>
25
+ </ng-template>
26
+ </ng-template>
27
+
28
+
29
+ </div>
30
+
31
+ <!-- DROPDOWN PANEL -->
32
+ <div
33
+ class="input-container dropdown"
34
+ [ngClass]="showDropdown ? '' : 'd-none'"
35
+ (click)="$event.stopPropagation()"
36
+ >
37
+ <!-- Search -->
38
+ <div class="w-100 input-wrapper">
39
+ <input
40
+ [(ngModel)]="searchValue"
41
+ placeholder="Search"
42
+ (input)="onInput($event)"
43
+ type="text"
44
+ />
45
+ <svg
46
+ class="search-icon"
47
+ xmlns="http://www.w3.org/2000/svg"
48
+ width="16"
49
+ height="17"
50
+ viewBox="0 0 16 17"
51
+ fill="none"
52
+ >
53
+ <path
54
+ d="M14 14.5L11.1 11.6M12.6667 7.83333C12.6667 10.7789 10.2789 13.1667 7.33333 13.1667C4.38781 13.1667 2 10.7789 2 7.83333C2 4.88781 4.38781 2.5 7.33333 2.5C10.2789 2.5 12.6667 4.88781 12.6667 7.83333Z"
55
+ stroke="#667085"
56
+ stroke-width="1.3"
57
+ stroke-linecap="round"
58
+ stroke-linejoin="round"
59
+ />
60
+ </svg>
61
+ </div>
62
+
63
+ <ul>
64
+ <!-- Select all (multi mode only) -->
65
+ <li *ngIf="multi && filteredValues?.length">
66
+ <label class="form-check" [for]="instanceId">
67
+ <input
68
+ (change)="onSelectAll($event)"
69
+ [checked]="checkIfAllSelected()"
70
+ class="form-check-input me-3"
71
+ type="checkbox"
72
+ [id]="instanceId"
73
+ />
74
+ <span class="form-check-label"> Select All </span>
75
+ </label>
76
+ </li>
77
+
78
+ <!-- LIST ITEMS -->
79
+ <li
80
+ *ngFor="let item of filteredValues"
81
+ [ngClass]="item.isSelected && !multi ? 'selected' : ''"
82
+ (click)="onItemClick(item, $event)"
83
+ >
84
+ <!-- multi → checkbox + label ; single → user row (avatar + name + email) -->
85
+ <ng-container *ngIf="multi; else singleItemTemplate">
86
+ <label
87
+ [for]="item[idField] + instanceId"
88
+ [ngClass]="multi ? '' : 'ps-0'"
89
+ class="form-check"
90
+ >
91
+ <input
92
+ (change)="onSelect($event, item)"
93
+ [(ngModel)]="item.isSelected"
94
+ class="form-check-input me-3"
95
+ type="checkbox"
96
+ [id]="item[idField] + instanceId"
97
+ />
98
+ <span class="form-check-label">
99
+ {{ item[searchField] }}
100
+ </span>
101
+ </label>
102
+ </ng-container>
103
+
104
+ <ng-template #singleItemTemplate>
105
+ <div class="user-row">
106
+ <div class="avatar avatar-text light-primary p-3">
107
+ {{ getInitialsFromEmail(item.email ||
108
+ item.email) }}
109
+ </div>
110
+ <!-- <img
111
+ class="user-avatar"
112
+ [src]="item.avatarUrl || './assets/tango/Image/Avatar.svg'"
113
+ alt="{{ item[searchField] }}"
114
+ /> -->
115
+ <div class="user-text">
116
+ <div class="user-name">
117
+ {{ item[searchField] }}
118
+ </div>
119
+ <div class="user-email">
120
+ {{ item.email }}
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </ng-template>
125
+ </li>
126
+
127
+ <li *ngIf="!filteredValues?.length">
128
+ <span class="d-flex align-items-center justify-content-center">
129
+ No data found
130
+ </span>
131
+ </li>
132
+ </ul>
133
+ </div>
134
+ </div>
@@ -0,0 +1,204 @@
1
+ :host {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
5
+
6
+
7
+ .outer-container {
8
+ // z-index: 1;
9
+ position: relative;
10
+ background-color: white;
11
+
12
+
13
+ .form-select {
14
+ font-size: 1.1rem;
15
+ font-weight: 600;
16
+ border-radius: 8px !important;
17
+ color: var(--Gray-500, #344054);
18
+ border: 1px solid var(--Gray-300, #D0D5DD) !important;
19
+ height: 42.5px;
20
+ }
21
+
22
+ .disable-input{
23
+ pointer-events: none;
24
+ background-color: #F9FAFB !important;
25
+ }
26
+
27
+ .input-container {
28
+ // position: absolute;
29
+ width: 100%;
30
+ z-index: 1;
31
+
32
+ .input-wrapper {
33
+ padding: 8px 10px;
34
+ background-color: white;
35
+ border-top-right-radius: 8px;
36
+ border-top-left-radius: 8px;
37
+ border-top: 1px solid rgba(16, 24, 40, 0.08);
38
+ border-right: 1px solid rgba(16, 24, 40, 0.08);
39
+ border-left: 1px solid rgba(16, 24, 40, 0.08);
40
+
41
+
42
+ input {
43
+ width: 100%;
44
+ border-radius: 8px;
45
+ border: 1px solid var(--Gray-300, #D0D5DD);
46
+ background: var(--White, #FFF);
47
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
48
+ padding: 10px 14px 10px 30px;
49
+ outline: none;
50
+
51
+ ::placeholder {
52
+ color: var(--Gray-500, #667085);
53
+ font-family: Inter;
54
+ font-size: 14px;
55
+ font-weight: 500;
56
+ line-height: 20px;
57
+ }
58
+ }
59
+
60
+ .search-icon {
61
+ position: absolute;
62
+ left: 20px;
63
+ top: 20px;
64
+ }
65
+ }
66
+
67
+ ul {
68
+ position: relative;
69
+ background-color: white;
70
+ margin: 0;
71
+ padding: 0;
72
+ max-height: 200px;
73
+ min-height: auto;
74
+ overflow-y: auto;
75
+ border-bottom-right-radius: 8px;
76
+ border-bottom-left-radius: 8px;
77
+ border-bottom: 1px solid rgba(16, 24, 40, 0.08);
78
+ border-right: 1px solid rgba(16, 24, 40, 0.08);
79
+ border-left: 1px solid rgba(16, 24, 40, 0.08);
80
+
81
+ .selected{
82
+ background: #F9FAFB;
83
+ }
84
+
85
+ li {
86
+ list-style: none;
87
+ padding: 10px 16px;
88
+ cursor: pointer;
89
+
90
+ label{
91
+ cursor: pointer;
92
+ }
93
+
94
+ }
95
+
96
+ li:hover{
97
+ background: #F9FAFB;
98
+ }
99
+
100
+ }
101
+
102
+ }
103
+
104
+ }
105
+
106
+ .form-check {
107
+ display: flex;
108
+ align-items: center;
109
+ }
110
+
111
+ .form-check-input {
112
+ height: 16px;
113
+ width: 16px;
114
+ border-radius: 4px;
115
+ border: 1px solid var(--Primary-600, #00A3FF);
116
+ }
117
+
118
+ .form-check-input:checked {
119
+ --bs-form-check-bg-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAB4SURBVHgBhY7NDUBQEIRnqcJNKXTg6qYTStCB+Isy6IQSNMDa9SLh5eWZZPcw+81kCX/quABhD73QyKXsGoyIvNCJSto2hEhNtY4N9cwYeMXEsVqB1GaSauRQOpty2tSmO3FgloAmF5nEhgyoesMO6CuFW66fn2xdFyA3ZzcRLrMAAAAASUVORK5CYII=');
120
+ background-color: #EAF8FF;
121
+ border-color: #00A3FF;
122
+ }
123
+
124
+ .form-check-label {
125
+ color: var(--Gray-700, #344054);
126
+ font-family: Inter;
127
+ font-size: 14px;
128
+ font-style: normal;
129
+ font-weight: 500;
130
+ line-height: 20px;
131
+ }
132
+
133
+ .select-value{
134
+ border-radius: 16px !important;
135
+ background: var(--Gray-100, #F2F4F7) !important;
136
+ mix-blend-mode: multiply;
137
+ color: var(--Gray-700, #344054) !important;
138
+ text-align: center;
139
+ font-size: 14px;
140
+ font-style: normal;
141
+ font-weight: 500;
142
+ line-height: 20px;
143
+ padding: 4px 12px 4px 6px;
144
+ }
145
+
146
+ .user-row {
147
+ display: flex;
148
+ align-items: center;
149
+ padding: 8px 14px;
150
+ cursor: pointer;
151
+ border-bottom: 1px solid #f3f4f6;
152
+ }
153
+
154
+ .user-row:last-child {
155
+ border-bottom: none;
156
+ }
157
+
158
+ .user-row:hover {
159
+ background: #f5f7ff;
160
+ }
161
+
162
+ .user-avatar {
163
+ width: 36px;
164
+ height: 36px;
165
+ border-radius: 50%;
166
+ object-fit: cover;
167
+ margin-right: 10px;
168
+ }
169
+
170
+ .user-text {
171
+ display: flex;
172
+ flex-direction: column;
173
+ }
174
+
175
+ .user-name {
176
+ font-size: 14px;
177
+ font-weight: 500;
178
+ color: #111827;
179
+ }
180
+
181
+ .user-email {
182
+ font-size: 12px;
183
+ color: #6b7280;
184
+ }
185
+
186
+ .disable-input {
187
+ pointer-events: none;
188
+ opacity: 0.6;
189
+ }
190
+
191
+
192
+ .avatar {
193
+ width: 42px;
194
+ height: 40px;
195
+ border-radius: 50%;
196
+ margin-right: 15px;
197
+ font-size: 14px;
198
+ color: #1D2939;
199
+ font-weight: 600;
200
+ }
201
+
202
+ .light-primary {
203
+ background: #eaf8ff !important;
204
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CustomSelectComponent } from './custom-select.component';
4
+
5
+ describe('CustomSelectComponent', () => {
6
+ let component: CustomSelectComponent;
7
+ let fixture: ComponentFixture<CustomSelectComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [CustomSelectComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CustomSelectComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,189 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostListener, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
2
+ import { TicketService } from '../../services/ticket.service';
3
+ // import { ManageUsersService } from '../../services-v2/manage-users.service';
4
+
5
+ @Component({
6
+ // eslint-disable-next-line @angular-eslint/component-selector
7
+ selector: 'team-select',
8
+ templateUrl: './custom-select.component.html',
9
+ styleUrl: './custom-select.component.scss',
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ })
12
+ export class CustomSelectComponent implements OnChanges, OnInit {
13
+
14
+ @HostListener('document:click', ['$event'])
15
+ onClick(event: MouseEvent) {
16
+ const target = event.target as HTMLElement;
17
+ if (!target.closest('.dropdown')) {
18
+ this.showDropdown = false;
19
+ }
20
+ }
21
+
22
+ @Input() items: any
23
+ @Input() searchField: string
24
+ @Input() multi: boolean
25
+ @Input() idField: string
26
+ @Input() selectedValues: any = []
27
+ @Input() disabled: boolean | undefined
28
+ @Input() label: string
29
+ @Output() selected = new EventEmitter<any>()
30
+ filteredValues: any = []
31
+ showDropdown: boolean
32
+ searchValue: string
33
+ instanceId: any;
34
+
35
+
36
+ constructor(private cd: ChangeDetectorRef, private authService:TicketService) { }
37
+ ngOnInit(): void {
38
+ this.instanceId = crypto.randomUUID();
39
+ this.authService.dropDownTrigger.subscribe((e)=>{
40
+ if(e !== this.instanceId){
41
+ this.showDropdown = false
42
+ this.cd.detectChanges()
43
+ }
44
+ })
45
+ }
46
+
47
+ ngOnChanges(changes: SimpleChanges): void {
48
+
49
+ if (changes['items'] && this.items?.length) {
50
+ this.initializeItems();
51
+ }
52
+ if (changes['selectedValues'] && Array.isArray(changes['selectedValues']?.currentValue) && changes['selectedValues']?.currentValue?.length > 0 && changes['selectedValues']?.currentValue[0]) {
53
+ this.updateSelectedValues();
54
+ }
55
+ }
56
+
57
+ initializeItems() {
58
+ this.filteredValues = this.items.map((item: any) => ({ ...item }));
59
+ this.updateSelectedValues()
60
+ }
61
+
62
+ updateSelectedValues() {
63
+ this.selectedValues?.forEach((selectedItem: any) => {
64
+ const item = this.filteredValues?.find((filteredItem: any) => filteredItem?.[this.idField] === selectedItem?.[this.idField]);
65
+ if (item) {
66
+ item.isSelected = true;
67
+ }
68
+ });
69
+
70
+ }
71
+
72
+ openDropdown(event: any) {
73
+ this.authService.dropDownTrigger.next(this.instanceId)
74
+ event.stopPropagation();
75
+ this.showDropdown = !this.showDropdown;
76
+ }
77
+
78
+ onInput(event: any) {
79
+ if (!event.target.value) {
80
+ this.filteredValues = [...this.items];
81
+ } else {
82
+ const searchTerm = event.target.value.toLowerCase();
83
+ this.filteredValues = this.items.filter((item: any) =>
84
+ item[this.searchField].toLowerCase().includes(searchTerm)
85
+ );
86
+ }
87
+ this.updateSelectedValues();
88
+ this.cd.detectChanges();
89
+ }
90
+
91
+ onSelect(event: any, item: any) {
92
+ if (this.multi) {
93
+ if (event.currentTarget.checked) {
94
+ this.selectedValues.push(item );
95
+ } else {
96
+ this.selectedValues = this.selectedValues.filter((elem: any) => elem[this.idField] !== item[this.idField]);
97
+ }
98
+ } else {
99
+ this.selectedValues = [{ ...item }];
100
+ this.filteredValues.forEach((element:any) => {
101
+ if(element[this.idField] !== item[this.idField]){
102
+ element.isSelected = false
103
+ }
104
+ });
105
+ this.showDropdown = false;
106
+ }
107
+
108
+ const valuesToEmit = this.selectedValues.map((value: any) => {
109
+ const selectedItem = { ...value };
110
+ delete selectedItem.isSelected;
111
+ return selectedItem;
112
+ });
113
+
114
+ this.cd.detectChanges();
115
+ this.emitSelectedValues(valuesToEmit);
116
+
117
+ }
118
+
119
+ onSelectAll(event: any) {
120
+ const selectAll = event.currentTarget.checked;
121
+ this.filteredValues.forEach((item: any) => item.isSelected = selectAll);
122
+
123
+ if (selectAll) {
124
+ this.selectedValues = [...this.filteredValues];
125
+ } else {
126
+ this.selectedValues = [];
127
+ }
128
+
129
+ const valuesToEmit = this.selectedValues.map((value: any) => {
130
+ const { isSelected, ...selectedItem } = value;
131
+ return selectedItem;
132
+ });
133
+
134
+ this.cd.detectChanges();
135
+ this.emitSelectedValues(valuesToEmit);
136
+ }
137
+
138
+
139
+ emitSelectedValues(values: any[]) {
140
+ if (this.multi) {
141
+ this.selected.emit(values);
142
+ } else {
143
+ this.selected.emit(values[0]);
144
+ }
145
+ }
146
+
147
+ checkIfAllSelected() {
148
+ return this.filteredValues.every((item: any) => item.isSelected);
149
+ }
150
+ onItemClick(item: any, event: MouseEvent) {
151
+ event.stopPropagation();
152
+
153
+ // For multi-select, row click should not do anything special;
154
+ // checkbox + onSelect already handle it
155
+ if (this.multi) {
156
+ return;
157
+ }
158
+
159
+ // Mark this item as selected so UI highlights it
160
+ item.isSelected = true;
161
+
162
+ // Fake an event with `currentTarget.checked = true`
163
+ const fakeEvent: any = {
164
+ currentTarget: {
165
+ checked: true
166
+ }
167
+ };
168
+
169
+ // Reuse your existing logic
170
+ this.onSelect(fakeEvent, item);
171
+ }
172
+ getInitialsFromEmail(email?: string): string {
173
+ if (!email) return "";
174
+
175
+ // take text before @
176
+ const namePart = email.split("@")[0];
177
+
178
+ // split by . or space (e.g. "sandeep.pal" -> ["sandeep", "pal"])
179
+ const parts = namePart.split(/[.\s_-]+/).filter(Boolean);
180
+
181
+ if (parts.length >= 2) {
182
+ return (parts[0][0] + parts[1][0]).toUpperCase(); // S + P = SP
183
+ }
184
+
185
+ // fallback: first two chars of whole namePart
186
+ return namePart.substring(0, 2).toUpperCase();
187
+ }
188
+
189
+ }