@servicemind.tis/tis-smart-table-viewer 1.0.0
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/README.md +278 -0
- package/fesm2022/servicemind.tis-tis-smart-table-viewer.mjs +1744 -0
- package/fesm2022/servicemind.tis-tis-smart-table-viewer.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/create-columns-template/create-columns-template.component.d.ts +42 -0
- package/lib/components/tis-columns-btn/tis-columns-btn.component.d.ts +36 -0
- package/lib/components/tis-smart-table-confirmation-dialog/tis-smart-table-confirmation-dialog.component.d.ts +10 -0
- package/lib/components/tis-smart-table-error-dialog/tis-smart-table-error-dialog.component.d.ts +10 -0
- package/lib/components/tis-smart-table-viewer/tis-smart-table-viewer.component.d.ts +142 -0
- package/lib/datasources/api.datasource.d.ts +16 -0
- package/lib/directives/scrolling/scrolling.directive.d.ts +11 -0
- package/lib/helpers/storage-helper.d.ts +3 -0
- package/lib/interfaces/data-not-found-config.type.d.ts +10 -0
- package/lib/interfaces/index.d.ts +4 -0
- package/lib/interfaces/smart-table-wrapper-columns-config.type.d.ts +16 -0
- package/lib/interfaces/tis-selection-config.type.d.ts +16 -0
- package/lib/interfaces/url-config.type.d.ts +8 -0
- package/lib/pipes/money.pipe.d.ts +9 -0
- package/lib/pipes/quantity.pipe.d.ts +9 -0
- package/lib/pipes/tis-date-time-with-seconds.pipe.d.ts +7 -0
- package/lib/pipes/tis-date-time.pipe.d.ts +7 -0
- package/lib/pipes/tis-date.pipe.d.ts +7 -0
- package/lib/services/api.service.d.ts +10 -0
- package/lib/services/tis-helper.service.d.ts +17 -0
- package/lib/services/user-customization.service.d.ts +15 -0
- package/lib/tis-smart-table-viewer.module.d.ts +36 -0
- package/lib/tis-smart-table-viewer.service.d.ts +6 -0
- package/package.json +28 -0
- package/public-api.d.ts +4 -0
|
@@ -0,0 +1,1744 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, HostListener, Input, Directive, Inject, Component, EventEmitter, Output, Pipe, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import { CdkColumnDef } from '@angular/cdk/table';
|
|
4
|
+
import * as i6 from '@angular/forms';
|
|
5
|
+
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i3$1 from '@angular/router';
|
|
7
|
+
import { RouterLink, RouterOutlet } from '@angular/router';
|
|
8
|
+
import { BehaviorSubject, of, Subject, takeUntil, tap, map, shareReplay, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
9
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
10
|
+
import * as i13 from '@angular/cdk/drag-drop';
|
|
11
|
+
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
12
|
+
import { catchError, finalize } from 'rxjs/operators';
|
|
13
|
+
import * as i1 from '@angular/common/http';
|
|
14
|
+
import * as i1$1 from '@angular/material/dialog';
|
|
15
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
16
|
+
import * as i12$1 from '@angular/material/paginator';
|
|
17
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
18
|
+
import { MatSort } from '@angular/material/sort';
|
|
19
|
+
import * as i5 from '@angular/cdk/layout';
|
|
20
|
+
import { Breakpoints, LayoutModule } from '@angular/cdk/layout';
|
|
21
|
+
import { DateTime } from 'luxon';
|
|
22
|
+
import * as i4 from '@angular/common';
|
|
23
|
+
import { CommonModule } from '@angular/common';
|
|
24
|
+
import * as i3 from '@angular/material/icon';
|
|
25
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
26
|
+
import * as i8 from '@angular/material/form-field';
|
|
27
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
28
|
+
import * as i10 from '@angular/material/input';
|
|
29
|
+
import { MatInputModule } from '@angular/material/input';
|
|
30
|
+
import * as i10$1 from '@angular/material/progress-spinner';
|
|
31
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
32
|
+
import * as i4$1 from '@angular/material/button';
|
|
33
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
34
|
+
import * as i13$1 from '@angular/material/table';
|
|
35
|
+
import { MatTableModule } from '@angular/material/table';
|
|
36
|
+
import * as i12 from '@angular/material/checkbox';
|
|
37
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
38
|
+
import * as i1$2 from '@angular/material/snack-bar';
|
|
39
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
40
|
+
import * as i9 from '@angular/material/select';
|
|
41
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
42
|
+
import * as i7 from '@angular/material/menu';
|
|
43
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
44
|
+
import * as i8$1 from '@angular/material/divider';
|
|
45
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
46
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
47
|
+
|
|
48
|
+
class TisSmartTableViewerService {
|
|
49
|
+
constructor() { }
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
51
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerService, providedIn: 'root' });
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerService, decorators: [{
|
|
54
|
+
type: Injectable,
|
|
55
|
+
args: [{
|
|
56
|
+
providedIn: 'root'
|
|
57
|
+
}]
|
|
58
|
+
}], ctorParameters: () => [] });
|
|
59
|
+
|
|
60
|
+
class ApiDataSource {
|
|
61
|
+
apiService;
|
|
62
|
+
apiSubs;
|
|
63
|
+
apiSubject = new BehaviorSubject([]);
|
|
64
|
+
loadingSubject = new BehaviorSubject(false);
|
|
65
|
+
loading$ = this.loadingSubject.asObservable();
|
|
66
|
+
totalDataLength = new BehaviorSubject(null);
|
|
67
|
+
totalDataLength$ = this.totalDataLength.asObservable();
|
|
68
|
+
constructor(apiService) {
|
|
69
|
+
this.apiService = apiService;
|
|
70
|
+
console.log(' DataSource Initialized...');
|
|
71
|
+
}
|
|
72
|
+
connect(collectionViewer) {
|
|
73
|
+
return this.apiSubject.asObservable();
|
|
74
|
+
}
|
|
75
|
+
disconnect(collectionViewer) {
|
|
76
|
+
this.apiSubject.complete();
|
|
77
|
+
this.loadingSubject.complete();
|
|
78
|
+
}
|
|
79
|
+
load(url, pageIndex, pageSize, search, filter, sortFilter) {
|
|
80
|
+
if (this.apiSubs) {
|
|
81
|
+
this.apiSubs.unsubscribe();
|
|
82
|
+
}
|
|
83
|
+
this.loadingSubject.next(true);
|
|
84
|
+
this.apiSubs = this.apiService.getList(url, (pageIndex + 1), pageSize, search, { filter }, { sortFilter }).pipe(catchError(() => of([])), finalize(() => this.loadingSubject.next(false))).subscribe(r => {
|
|
85
|
+
console.log(`DataSource: Url: ${url}, Reply:`, r);
|
|
86
|
+
if (r?.data?.length > 0) {
|
|
87
|
+
this.totalDataLength.next(r?.total);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.totalDataLength.next(0);
|
|
91
|
+
}
|
|
92
|
+
this.apiSubject.next(r?.data);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
class ApiService {
|
|
98
|
+
http;
|
|
99
|
+
constructor(http) {
|
|
100
|
+
this.http = http;
|
|
101
|
+
}
|
|
102
|
+
getList(apiUrl, currentPage = 1, limit = 10, search = '', filters, sortFilter) {
|
|
103
|
+
const body = { ...filters, ...sortFilter };
|
|
104
|
+
return this.http.get(`${apiUrl}?current_page=${currentPage}&per_page=${limit}&search=${search}`);
|
|
105
|
+
}
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ApiService, providedIn: 'root' });
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ApiService, decorators: [{
|
|
110
|
+
type: Injectable,
|
|
111
|
+
args: [{
|
|
112
|
+
providedIn: 'root'
|
|
113
|
+
}]
|
|
114
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
115
|
+
|
|
116
|
+
const setToLocalStorageWithExpiry = (key, value, ttl = 9 * 1000 * 60 * 60) => {
|
|
117
|
+
const now = new Date();
|
|
118
|
+
// `item` is an object which contains the original value
|
|
119
|
+
// as well as the time when it's supposed to expire
|
|
120
|
+
const item = {
|
|
121
|
+
value,
|
|
122
|
+
expiry: now.getTime() + ttl
|
|
123
|
+
};
|
|
124
|
+
localStorage.setItem(key, JSON.stringify(item));
|
|
125
|
+
};
|
|
126
|
+
const getFromLocalStorageWithExpiry = (key) => {
|
|
127
|
+
const itemStr = localStorage.getItem(key);
|
|
128
|
+
// if the item doesn't exist, return null
|
|
129
|
+
if (!itemStr) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const item = JSON.parse(itemStr);
|
|
133
|
+
const now = new Date();
|
|
134
|
+
if (!item.expiry) {
|
|
135
|
+
localStorage.removeItem(key);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
// compare the expiry time of the item with the current time
|
|
139
|
+
if (now.getTime() > item.expiry) {
|
|
140
|
+
// If the item is expired, delete the item from storage
|
|
141
|
+
// and return null
|
|
142
|
+
localStorage.removeItem(key);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return item.value;
|
|
146
|
+
};
|
|
147
|
+
const removeMultipleKeys = (keys) => {
|
|
148
|
+
console.log('Storage Helper: Keys To Remove:', keys);
|
|
149
|
+
keys.forEach(key => {
|
|
150
|
+
localStorage.removeItem(key);
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
class ScrollingDirective {
|
|
155
|
+
el;
|
|
156
|
+
constructor(el) {
|
|
157
|
+
this.el = el;
|
|
158
|
+
}
|
|
159
|
+
appScrolling = false;
|
|
160
|
+
// @HostListener('mouseenter') onMouseEnter() {}
|
|
161
|
+
onMouseLeave() {
|
|
162
|
+
// console.log("==== appScrolling mouseleave ===", this.el.nativeElement, this.appScrolling);
|
|
163
|
+
this.el.nativeElement.classList.remove('more-scrollbar-width', 'more-scrollbar-height');
|
|
164
|
+
}
|
|
165
|
+
onMousemove(event) {
|
|
166
|
+
// console.log("==== appScrolling mousemove clientX-clientY ===", event.clientX, event.clientY);
|
|
167
|
+
// console.log("==== appScrolling mousemove clientWidth-clientHeight ===", this.el.nativeElement.clientWidth, this.el.nativeElement.clientHeight);
|
|
168
|
+
// console.log("==== appScrolling mousemove offsetX-offsetY ===", this.el.nativeElement.offsetX, this.el.nativeElement.offsetY);
|
|
169
|
+
// console.log("==== appScrolling mousemove offsetWidth-offsetLeft ===", this.el.nativeElement.offsetWidth, this.el.nativeElement.offsetLeft);
|
|
170
|
+
// console.log("==== appScrolling mousemove json ===", {
|
|
171
|
+
// clientX: event.clientX,
|
|
172
|
+
// clientY: event.clientY,
|
|
173
|
+
// clientWidth: this.el.nativeElement.clientWidth,
|
|
174
|
+
// clientHeight: this.el.nativeElement.clientHeight,
|
|
175
|
+
// offsetX: this.el.nativeElement.offsetX,
|
|
176
|
+
// offsetY: this.el.nativeElement.offsetY,
|
|
177
|
+
// offsetWidth: this.el.nativeElement.offsetWidth,
|
|
178
|
+
// offsetLeft: this.el.nativeElement.offsetLeft,
|
|
179
|
+
// rect: this.el.nativeElement.getBoundingClientRect()
|
|
180
|
+
// });
|
|
181
|
+
const rect = this.el.nativeElement.getBoundingClientRect();
|
|
182
|
+
let xDistance = rect.left + this.el.nativeElement.clientWidth + 10 - event.clientX;
|
|
183
|
+
// console.log("=== appScrolling mousemove xDistance ===", xDistance);
|
|
184
|
+
xDistance < 15 && xDistance > -15 ? this.el.nativeElement.classList.add('more-scrollbar-width') : this.el.nativeElement.classList.remove('more-scrollbar-width');
|
|
185
|
+
let yDistance = rect.top + this.el.nativeElement.clientHeight + 15 - event.clientY;
|
|
186
|
+
// console.log("=== appScrolling mousemove yDistance ===", yDistance);
|
|
187
|
+
yDistance < 20 && yDistance > -20 ? this.el.nativeElement.classList.add('more-scrollbar-height') : this.el.nativeElement.classList.remove('more-scrollbar-height');
|
|
188
|
+
// this.el.nativeElement.classList.remove('more-scrollbar-width', 'more-scrollbar-height')
|
|
189
|
+
}
|
|
190
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ScrollingDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
191
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.7", type: ScrollingDirective, isStandalone: false, selector: "[appScrolling]", inputs: { appScrolling: "appScrolling" }, host: { listeners: { "mouseleave": "onMouseLeave()", "mousemove": "onMousemove($event)" } }, ngImport: i0 });
|
|
192
|
+
}
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ScrollingDirective, decorators: [{
|
|
194
|
+
type: Directive,
|
|
195
|
+
args: [{
|
|
196
|
+
selector: '[appScrolling]',
|
|
197
|
+
standalone: false
|
|
198
|
+
}]
|
|
199
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { appScrolling: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], onMouseLeave: [{
|
|
202
|
+
type: HostListener,
|
|
203
|
+
args: ['mouseleave']
|
|
204
|
+
}], onMousemove: [{
|
|
205
|
+
type: HostListener,
|
|
206
|
+
args: ['mousemove', ['$event']]
|
|
207
|
+
}] } });
|
|
208
|
+
|
|
209
|
+
class UserCustomizationService {
|
|
210
|
+
http;
|
|
211
|
+
constructor(http) {
|
|
212
|
+
this.http = http;
|
|
213
|
+
}
|
|
214
|
+
getColumnsTemplates(url, listComponent) {
|
|
215
|
+
return this.http.get(`${url}?listComponent=${listComponent}`);
|
|
216
|
+
}
|
|
217
|
+
addColumnsTemplate(url, body) {
|
|
218
|
+
return this.http.post(url, body);
|
|
219
|
+
}
|
|
220
|
+
updateColumnsTemplate(url, body) {
|
|
221
|
+
return this.http.post(url, body);
|
|
222
|
+
}
|
|
223
|
+
deleteColumnsTemplate(url, body) {
|
|
224
|
+
return this.http.put(url, body);
|
|
225
|
+
}
|
|
226
|
+
getSelectedColumnsTemplate(url, listComponent) {
|
|
227
|
+
return this.http.get(`${url}?listComponent=${listComponent}`);
|
|
228
|
+
}
|
|
229
|
+
updateSelectedColumnsTemplate(url, body) {
|
|
230
|
+
return this.http.post(url, body);
|
|
231
|
+
}
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: UserCustomizationService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
233
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: UserCustomizationService, providedIn: 'root' });
|
|
234
|
+
}
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: UserCustomizationService, decorators: [{
|
|
236
|
+
type: Injectable,
|
|
237
|
+
args: [{
|
|
238
|
+
providedIn: 'root'
|
|
239
|
+
}]
|
|
240
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
241
|
+
|
|
242
|
+
class TisSmartTableErrorDialogComponent {
|
|
243
|
+
dialogRef;
|
|
244
|
+
data;
|
|
245
|
+
constructor(dialogRef, data) {
|
|
246
|
+
this.dialogRef = dialogRef;
|
|
247
|
+
this.data = data;
|
|
248
|
+
}
|
|
249
|
+
onClose() {
|
|
250
|
+
this.dialogRef.close();
|
|
251
|
+
}
|
|
252
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableErrorDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TisSmartTableErrorDialogComponent, isStandalone: false, selector: "tis-smart-table-error-dialog", ngImport: i0, template: "<h1 mat-dialog-title>\n <mat-icon class=\"{{data?.iconClass}}\">{{data?.icon}}</mat-icon>\n {{data?.title}}\n</h1>\n<div mat-dialog-content>\n {{data?.message}}\n</div>\n<div mat-dialog-actions>\n <button mat-button class=\"tis-text-upper {{data?.buttonClass ?? 'tis-btn-primary'}}\" (click)=\"onClose()\" cdkFocusInitial *ngIf=\"data?.buttonText && data?.buttonText != ''\">{{data?.buttonText}}</button>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
|
|
254
|
+
}
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableErrorDialogComponent, decorators: [{
|
|
256
|
+
type: Component,
|
|
257
|
+
args: [{ selector: 'tis-smart-table-error-dialog', standalone: false, template: "<h1 mat-dialog-title>\n <mat-icon class=\"{{data?.iconClass}}\">{{data?.icon}}</mat-icon>\n {{data?.title}}\n</h1>\n<div mat-dialog-content>\n {{data?.message}}\n</div>\n<div mat-dialog-actions>\n <button mat-button class=\"tis-text-upper {{data?.buttonClass ?? 'tis-btn-primary'}}\" (click)=\"onClose()\" cdkFocusInitial *ngIf=\"data?.buttonText && data?.buttonText != ''\">{{data?.buttonText}}</button>\n</div>" }]
|
|
258
|
+
}], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
259
|
+
type: Inject,
|
|
260
|
+
args: [MAT_DIALOG_DATA]
|
|
261
|
+
}] }] });
|
|
262
|
+
|
|
263
|
+
class TisHelperService {
|
|
264
|
+
snackBar;
|
|
265
|
+
dialog;
|
|
266
|
+
http;
|
|
267
|
+
constructor(snackBar, dialog, http) {
|
|
268
|
+
this.snackBar = snackBar;
|
|
269
|
+
this.dialog = dialog;
|
|
270
|
+
this.http = http;
|
|
271
|
+
}
|
|
272
|
+
showHttpErrorMsg(error, duration = 5000) {
|
|
273
|
+
console.log('httpError: ', error);
|
|
274
|
+
let errorMessage = 'Some Unknown Error Occurred.';
|
|
275
|
+
let errorCode = 'Unknown Error';
|
|
276
|
+
const httpError = error;
|
|
277
|
+
if (httpError.status >= 400) {
|
|
278
|
+
const errorFromServer = httpError.error;
|
|
279
|
+
if (Array.isArray(errorFromServer) && errorFromServer.length > 0) {
|
|
280
|
+
errorMessage = errorFromServer[0].message;
|
|
281
|
+
errorCode = errorFromServer[0].code;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else if (httpError.status < 100) {
|
|
285
|
+
errorMessage = httpError.message;
|
|
286
|
+
errorCode = httpError.statusText;
|
|
287
|
+
}
|
|
288
|
+
if (errorCode == "VALIDATION_ERROR" || errorCode == "NOT_FOUND_ERROR" || errorCode == "THIRD_PARTY_API_ERROR") {
|
|
289
|
+
let confirmBoxData = {
|
|
290
|
+
title: "Error !",
|
|
291
|
+
message: errorMessage,
|
|
292
|
+
icon: "error",
|
|
293
|
+
iconClass: "tis-text-danger",
|
|
294
|
+
buttonText: "Ok",
|
|
295
|
+
buttonClass: "tis-btn-primary",
|
|
296
|
+
};
|
|
297
|
+
const dialogRef = this.dialog.open(TisSmartTableErrorDialogComponent, {
|
|
298
|
+
width: "550px",
|
|
299
|
+
panelClass: ['tis-simple-confirmation'],
|
|
300
|
+
data: confirmBoxData,
|
|
301
|
+
disableClose: false,
|
|
302
|
+
});
|
|
303
|
+
return dialogRef;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
const snackbarRef = this.snackBar.open(errorMessage, 'Error', { duration: duration });
|
|
307
|
+
return snackbarRef;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
showSuccessMsg(message, title, duration = 5000) {
|
|
311
|
+
this.snackBar.open(message, title, {
|
|
312
|
+
duration: duration
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
showErrorMsg(message, title, duration = 5000) {
|
|
316
|
+
this.snackBar.open(message, title, {
|
|
317
|
+
duration: duration
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
sortArrayByOrder(A, B) {
|
|
321
|
+
const sortedA = [];
|
|
322
|
+
for (const element of B) {
|
|
323
|
+
const index = A.indexOf(element);
|
|
324
|
+
if (index !== -1) {
|
|
325
|
+
sortedA.push(A[index]);
|
|
326
|
+
A.splice(index, 1);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return [...sortedA, ...A]; // Combine sorted elements with remaining elements
|
|
330
|
+
}
|
|
331
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisHelperService, deps: [{ token: i1$2.MatSnackBar }, { token: i1$1.MatDialog }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
332
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisHelperService, providedIn: 'root' });
|
|
333
|
+
}
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisHelperService, decorators: [{
|
|
335
|
+
type: Injectable,
|
|
336
|
+
args: [{
|
|
337
|
+
providedIn: 'root'
|
|
338
|
+
}]
|
|
339
|
+
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: i1$1.MatDialog }, { type: i1.HttpClient }] });
|
|
340
|
+
|
|
341
|
+
class TisSmartTableConfirmationDialogComponent {
|
|
342
|
+
dialogRef;
|
|
343
|
+
data;
|
|
344
|
+
constructor(dialogRef, data) {
|
|
345
|
+
this.dialogRef = dialogRef;
|
|
346
|
+
this.data = data;
|
|
347
|
+
this.dialogRef.addPanelClass(['tis-smart-table-confirmation-dialog']);
|
|
348
|
+
}
|
|
349
|
+
onClose(status) {
|
|
350
|
+
this.dialogRef.close(status);
|
|
351
|
+
}
|
|
352
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableConfirmationDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
353
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: TisSmartTableConfirmationDialogComponent, isStandalone: false, selector: "tis-smart-table-confirmation-dialog", ngImport: i0, template: "<h1 mat-dialog-title style=\"align-items: center; display: flex;\">\n <mat-icon class=\"{{data?.iconClass}}\" style=\"color: var(--tis-cancel, #bb333b)\">{{data?.icon}}</mat-icon>\n <span>{{data?.title}}</span>\n</h1>\n<div mat-dialog-content style=\"padding: 20px 24px; padding-top: 0px;\">\n @if(data?.html){\n <h5 class=\"title\">{{data?.message}}</h5>\n <div [innerHTML]=\"data.html\">\n </div>\n }\n @else {\n <span>{{data?.message}}</span>\n }\n</div>\n<div mat-dialog-actions>\n <button mat-button class=\"{{data?.cancelButtonClass}}\" style=\"color: var(--tis-primary, var(--mat-sys-primary))\" (click)=\"onClose(false)\" *ngIf=\"data?.cancelButtonText && data?.cancelButtonText != ''\">{{data?.cancelButtonText}}</button>\n <button mat-button class=\"{{data?.approveButtonClass}}\" style=\"color: var(--tis-cancel, #bb333b)\" (click)=\"onClose(true)\" cdkFocusInitial *ngIf=\"data?.approveButtonText && data?.approveButtonText != ''\">{{data?.approveButtonText}}</button>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
|
|
354
|
+
}
|
|
355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableConfirmationDialogComponent, decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{ selector: 'tis-smart-table-confirmation-dialog', standalone: false, template: "<h1 mat-dialog-title style=\"align-items: center; display: flex;\">\n <mat-icon class=\"{{data?.iconClass}}\" style=\"color: var(--tis-cancel, #bb333b)\">{{data?.icon}}</mat-icon>\n <span>{{data?.title}}</span>\n</h1>\n<div mat-dialog-content style=\"padding: 20px 24px; padding-top: 0px;\">\n @if(data?.html){\n <h5 class=\"title\">{{data?.message}}</h5>\n <div [innerHTML]=\"data.html\">\n </div>\n }\n @else {\n <span>{{data?.message}}</span>\n }\n</div>\n<div mat-dialog-actions>\n <button mat-button class=\"{{data?.cancelButtonClass}}\" style=\"color: var(--tis-primary, var(--mat-sys-primary))\" (click)=\"onClose(false)\" *ngIf=\"data?.cancelButtonText && data?.cancelButtonText != ''\">{{data?.cancelButtonText}}</button>\n <button mat-button class=\"{{data?.approveButtonClass}}\" style=\"color: var(--tis-cancel, #bb333b)\" (click)=\"onClose(true)\" cdkFocusInitial *ngIf=\"data?.approveButtonText && data?.approveButtonText != ''\">{{data?.approveButtonText}}</button>\n</div>" }]
|
|
358
|
+
}], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
359
|
+
type: Inject,
|
|
360
|
+
args: [MAT_DIALOG_DATA]
|
|
361
|
+
}] }] });
|
|
362
|
+
|
|
363
|
+
class CreateColumnsTemplateComponent {
|
|
364
|
+
dialogRef;
|
|
365
|
+
helper;
|
|
366
|
+
snackBar;
|
|
367
|
+
userCustomizationService;
|
|
368
|
+
data;
|
|
369
|
+
loading = false;
|
|
370
|
+
updatingTemplate = false;
|
|
371
|
+
savingTemplate = false;
|
|
372
|
+
columns = [];
|
|
373
|
+
displayedColumns = [];
|
|
374
|
+
listComponentColumns;
|
|
375
|
+
listComponentColumnsTemplateDetail;
|
|
376
|
+
form;
|
|
377
|
+
userId;
|
|
378
|
+
translationReadKey;
|
|
379
|
+
customColumns;
|
|
380
|
+
t;
|
|
381
|
+
columnCustomizationUrlConfig;
|
|
382
|
+
constructor(dialogRef, helper, snackBar, userCustomizationService, data) {
|
|
383
|
+
this.dialogRef = dialogRef;
|
|
384
|
+
this.helper = helper;
|
|
385
|
+
this.snackBar = snackBar;
|
|
386
|
+
this.userCustomizationService = userCustomizationService;
|
|
387
|
+
this.data = data;
|
|
388
|
+
this.translationReadKey = this.data?.translationReadKey ?? '';
|
|
389
|
+
if (this.data?.customColumns) {
|
|
390
|
+
this.customColumns = this.data?.customColumns ?? {};
|
|
391
|
+
}
|
|
392
|
+
if (this.data?.columnCustomizationUrlConfig) {
|
|
393
|
+
this.columnCustomizationUrlConfig = this.data.columnCustomizationUrlConfig;
|
|
394
|
+
}
|
|
395
|
+
// this.dialogRef.addPanelClass(['lg-w-45-per']);
|
|
396
|
+
}
|
|
397
|
+
ngOnInit() {
|
|
398
|
+
this.t = this.data?.t || {};
|
|
399
|
+
this.columns = JSON.parse(JSON.stringify(this.data.columns));
|
|
400
|
+
this.displayedColumns = JSON.parse(JSON.stringify(this.data.displayColumns));
|
|
401
|
+
this.displayedColumns = this.data.displayColumns;
|
|
402
|
+
if (this.data?.defaultSelectedState == null || this.data?.defaultSelectedState == 'undefined') {
|
|
403
|
+
this.data.defaultSelectedState = true;
|
|
404
|
+
}
|
|
405
|
+
if (this.data?.selectedTemplateId && this.displayedColumns?.length) {
|
|
406
|
+
this.columns = this.helper.sortArrayByOrder(JSON.parse(JSON.stringify(this.columns)), JSON.parse(JSON.stringify(this.displayedColumns)));
|
|
407
|
+
}
|
|
408
|
+
this.listComponentColumns = this.columns.map((col, ndx) => ({ id: ndx + 1, isSelected: this.data?.defaultSelectedState === true ? true : (this.displayedColumns?.indexOf(col) >= 0 ? true : false), column: col }));
|
|
409
|
+
this.createForm();
|
|
410
|
+
// this.store.select('auth').subscribe((authState: fromAuth.State) => {
|
|
411
|
+
// console.log('Current AuthState:', authState);
|
|
412
|
+
// if(authState?.user?.id){
|
|
413
|
+
// this.userId = authState.user.id;
|
|
414
|
+
// }
|
|
415
|
+
// })
|
|
416
|
+
}
|
|
417
|
+
ngAfterViewInit() {
|
|
418
|
+
// this.translocoService.selectTranslate('lang', {}, 'shared').subscribe((translation: string) => {
|
|
419
|
+
// this.tl = this.translocoService.translateObject('createColumnsTemplateComponent', {}, 'shared');
|
|
420
|
+
// });
|
|
421
|
+
}
|
|
422
|
+
createForm() {
|
|
423
|
+
this.form = new FormGroup({
|
|
424
|
+
name: new FormControl(this.data?.name ?? '', Validators.required),
|
|
425
|
+
enableStickiness: new FormControl(true),
|
|
426
|
+
fromStartColumnNumber: new FormControl(this.data?.fromStartColumnNumber ? Number(this.data?.fromStartColumnNumber) : 0, Validators.required),
|
|
427
|
+
fromEndColumnNumber: new FormControl(this.data?.fromEndColumnNumber ? Number(this.data?.fromEndColumnNumber) : 0, Validators.required),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
get name() {
|
|
431
|
+
return this.form.get('name');
|
|
432
|
+
}
|
|
433
|
+
get listComponentColumnsTemplateName() {
|
|
434
|
+
return this.name.value;
|
|
435
|
+
}
|
|
436
|
+
get orgDisplayColumns() {
|
|
437
|
+
return this.displayedColumns;
|
|
438
|
+
}
|
|
439
|
+
drop(event) {
|
|
440
|
+
moveItemInArray(this.listComponentColumns, event.previousIndex, event.currentIndex);
|
|
441
|
+
}
|
|
442
|
+
onSubmit() {
|
|
443
|
+
const orgDisplayColumns = this.orgDisplayColumns;
|
|
444
|
+
if (this.form.invalid) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
// Get selected columns (first filter on selected column and then get column array)
|
|
448
|
+
this.displayedColumns = this.listComponentColumns.filter((r) => { if (r.isSelected)
|
|
449
|
+
return r.column; }).map((r) => r.column);
|
|
450
|
+
if (this.displayedColumns.length <= 0) {
|
|
451
|
+
this.snackBar.open("Please select at least one column", "ok", {
|
|
452
|
+
duration: 4000
|
|
453
|
+
});
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
console.log('new and org display columns: ', this.displayedColumns, orgDisplayColumns);
|
|
457
|
+
this.acceptTemplateNameAndSave();
|
|
458
|
+
}
|
|
459
|
+
acceptTemplateNameAndSave() {
|
|
460
|
+
let data = {
|
|
461
|
+
listComponentName: this.data.listComponentName,
|
|
462
|
+
name: this.name.getRawValue(),
|
|
463
|
+
enableStickiness: this.form.getRawValue().enableStickiness,
|
|
464
|
+
fromStartColumnNumber: this.form.getRawValue().fromStartColumnNumber,
|
|
465
|
+
fromEndColumnNumber: this.form.getRawValue().fromEndColumnNumber,
|
|
466
|
+
defaultColumns: this.columns.join(),
|
|
467
|
+
displayColumns: this.displayedColumns.join()
|
|
468
|
+
};
|
|
469
|
+
console.log('save value: ', data);
|
|
470
|
+
this.savingTemplate = true;
|
|
471
|
+
this.loading = true;
|
|
472
|
+
if (this.data?.selectedTemplateId) {
|
|
473
|
+
this.userCustomizationService.updateColumnsTemplate(this.columnCustomizationUrlConfig.update, { id: this.data?.selectedTemplateId, ...data }).subscribe(r => {
|
|
474
|
+
console.log("add response: ", r);
|
|
475
|
+
// this.loading = false;
|
|
476
|
+
this.helper.showSuccessMsg(r.message, 'Success');
|
|
477
|
+
let selectedTemplate = {
|
|
478
|
+
...r.data,
|
|
479
|
+
...data,
|
|
480
|
+
isUpdated: true,
|
|
481
|
+
};
|
|
482
|
+
this.onClose(selectedTemplate);
|
|
483
|
+
}, err => {
|
|
484
|
+
this.loading = false;
|
|
485
|
+
this.savingTemplate = false;
|
|
486
|
+
this.helper.showHttpErrorMsg(err);
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
this.userCustomizationService.addColumnsTemplate(this.columnCustomizationUrlConfig.add, data).subscribe(r => {
|
|
491
|
+
console.log("add response: ", r);
|
|
492
|
+
// this.loading = false;
|
|
493
|
+
this.helper.showSuccessMsg(r.message, 'Success');
|
|
494
|
+
let selectedTemplate = {
|
|
495
|
+
...r.data,
|
|
496
|
+
...data
|
|
497
|
+
};
|
|
498
|
+
this.onClose(selectedTemplate);
|
|
499
|
+
}, err => {
|
|
500
|
+
console.log(err);
|
|
501
|
+
this.loading = false;
|
|
502
|
+
this.savingTemplate = false;
|
|
503
|
+
this.helper.showHttpErrorMsg(err);
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
onChangeColumnStatus(status, data) {
|
|
508
|
+
if (status == false) {
|
|
509
|
+
let leftColumn = data.id;
|
|
510
|
+
let rightColumn = this.listComponentColumns?.length - (data.id - 1);
|
|
511
|
+
let formValue = this.form.getRawValue();
|
|
512
|
+
if (formValue?.fromStartColumnNumber == leftColumn) {
|
|
513
|
+
this.form.patchValue({
|
|
514
|
+
fromStartColumnNumber: 0
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
if (formValue?.fromEndColumnNumber == rightColumn) {
|
|
518
|
+
this.form.patchValue({
|
|
519
|
+
fromEndColumnNumber: 0
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
onClose(data = null) {
|
|
525
|
+
this.dialogRef.close(data);
|
|
526
|
+
}
|
|
527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CreateColumnsTemplateComponent, deps: [{ token: i1$1.MatDialogRef }, { token: TisHelperService }, { token: i1$2.MatSnackBar }, { token: UserCustomizationService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: CreateColumnsTemplateComponent, isStandalone: false, selector: "app-create-columns-template", ngImport: i0, template: "\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <h1 mat-dialog-title>\n {{t('createColumnsTemplate.title')}}\n <mat-icon (click)=\"onClose()\" class=\"tis-curser-pointer\">clear</mat-icon>\n </h1>\n <div class=\"px-6 pt-4\">\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.templateName')}}</mat-label>\n <input matInput formControlName=\"name\" placeholder=\"{{t('createColumnsTemplate.enterTemplateName')}}\" />\n </mat-form-field>\n </div>\n\n <mat-dialog-content [appScrolling]=\"true\" class=\"w-100 p-0 m-0\" style=\"max-height: 60vh !important;\">\n <div cdkDropList class=\"example-list\" (cdkDropListDropped)=\"drop($event)\">\n <div class=\"example-box\" *ngFor=\"let item of listComponentColumns, let ndx = index\" cdkDrag>\n <div class=\"w-full flex flex-row items-center justify-between\">\n <div class=\"flex flex-row items-center\">\n <mat-icon cdkDragHandle class=\"tis-curser-pointer\" style=\"color: rgba(0, 0, 0, 0.54); font-size: 19px; width: 19px; height: 19px;\">drag_indicator</mat-icon>\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </div>\n <mat-checkbox color=\"primary\" [(ngModel)]=\"item.isSelected\" (ngModelChange)=\"onChangeColumnStatus($event, item)\" [ngModelOptions]=\"{standalone: true}\"></mat-checkbox>\n </div>\n </div>\n </div>\n </mat-dialog-content>\n\n @if(form.value?.enableStickiness){\n <div class=\"px-6 pt-4\">\n <div class=\"grid grid-cols-2 gap-4\">\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.freezeColumnFromLeft')}}</mat-label>\n <mat-select formControlName=\"fromStartColumnNumber\">\n <mat-option [value]=\"0\">None</mat-option>\n @for (item of listComponentColumns; track item; let i = $index; let l = $last;) {\n @if(item?.isSelected){\n <mat-option [value]=\"(i+1)\">\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.freezeColumnFromRight')}}</mat-label>\n <mat-select formControlName=\"fromEndColumnNumber\">\n <mat-option [value]=\"0\">None</mat-option>\n @for (item of listComponentColumns; track item; let i = $index; let l = $last;) {\n @if(item?.isSelected){\n <mat-option [value]=\"(listComponentColumns?.length - i)\">\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n }\n\n <div mat-dialog-actions>\n <button mat-button type=\"button\" class=\"tis-text-upper tis-btn-primary\" mat-dialog-close [disabled]=\"loading\">{{t?.cancel}}</button>\n <button mat-flat-button type=\"submit\" class=\"tis-text-upper tis-btn-filled-primary\" cdkFocusInitial [disabled]=\"savingTemplate\">\n {{data?.selectedTemplateId ? t('createColumnsTemplate.update') : t('createColumnsTemplate.save')}}\n @if(savingTemplate){\n <i class=\"fas fa-spinner fa-spin\"></i>\n }\n </button>\n </div>\n</form>", styles: [".example-container{width:400px;max-width:100%;margin:0 25px 25px 0;display:inline-block;vertical-align:top}.example-list{min-height:60px;background:#fff;border-radius:4px;overflow:hidden;display:block}.example-box{border-bottom:solid 1px #EEE;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mt-20{margin-top:20px}.mt-40{margin-top:40px}.w-10{width:10%}.w-100{width:100%}.container{width:100%;display:flex;align-items:center}.drag-index{font-size:16px;font-weight:500;padding:8px;width:40px;text-align:end}.drag-icon{background-color:#36834f;color:#fff;text-align:center;position:relative}.drag-icon i{padding-top:3px;cursor:move}.drag-content{margin-top:8px;padding-left:10px}.drag-content span{vertical-align:text-bottom;padding-left:5px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "component", type: i9.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i9.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i13.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i13.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i13.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: ScrollingDirective, selector: "[appScrolling]", inputs: ["appScrolling"] }] });
|
|
529
|
+
}
|
|
530
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CreateColumnsTemplateComponent, decorators: [{
|
|
531
|
+
type: Component,
|
|
532
|
+
args: [{ selector: 'app-create-columns-template', standalone: false, template: "\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <h1 mat-dialog-title>\n {{t('createColumnsTemplate.title')}}\n <mat-icon (click)=\"onClose()\" class=\"tis-curser-pointer\">clear</mat-icon>\n </h1>\n <div class=\"px-6 pt-4\">\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.templateName')}}</mat-label>\n <input matInput formControlName=\"name\" placeholder=\"{{t('createColumnsTemplate.enterTemplateName')}}\" />\n </mat-form-field>\n </div>\n\n <mat-dialog-content [appScrolling]=\"true\" class=\"w-100 p-0 m-0\" style=\"max-height: 60vh !important;\">\n <div cdkDropList class=\"example-list\" (cdkDropListDropped)=\"drop($event)\">\n <div class=\"example-box\" *ngFor=\"let item of listComponentColumns, let ndx = index\" cdkDrag>\n <div class=\"w-full flex flex-row items-center justify-between\">\n <div class=\"flex flex-row items-center\">\n <mat-icon cdkDragHandle class=\"tis-curser-pointer\" style=\"color: rgba(0, 0, 0, 0.54); font-size: 19px; width: 19px; height: 19px;\">drag_indicator</mat-icon>\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </div>\n <mat-checkbox color=\"primary\" [(ngModel)]=\"item.isSelected\" (ngModelChange)=\"onChangeColumnStatus($event, item)\" [ngModelOptions]=\"{standalone: true}\"></mat-checkbox>\n </div>\n </div>\n </div>\n </mat-dialog-content>\n\n @if(form.value?.enableStickiness){\n <div class=\"px-6 pt-4\">\n <div class=\"grid grid-cols-2 gap-4\">\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.freezeColumnFromLeft')}}</mat-label>\n <mat-select formControlName=\"fromStartColumnNumber\">\n <mat-option [value]=\"0\">None</mat-option>\n @for (item of listComponentColumns; track item; let i = $index; let l = $last;) {\n @if(item?.isSelected){\n <mat-option [value]=\"(i+1)\">\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n <mat-form-field class=\"w-full tis-mat-form-field\" appearance=\"outline\">\n <mat-label>{{t('createColumnsTemplate.freezeColumnFromRight')}}</mat-label>\n <mat-select formControlName=\"fromEndColumnNumber\">\n <mat-option [value]=\"0\">None</mat-option>\n @for (item of listComponentColumns; track item; let i = $index; let l = $last;) {\n @if(item?.isSelected){\n <mat-option [value]=\"(listComponentColumns?.length - i)\">\n <span *ngIf=\"!data?.skipTranslation\">{{t(item.column)}}</span>\n <span *ngIf=\"data?.skipTranslation\">{{customColumns[item.column]}}</span>\n </mat-option>\n }\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n }\n\n <div mat-dialog-actions>\n <button mat-button type=\"button\" class=\"tis-text-upper tis-btn-primary\" mat-dialog-close [disabled]=\"loading\">{{t?.cancel}}</button>\n <button mat-flat-button type=\"submit\" class=\"tis-text-upper tis-btn-filled-primary\" cdkFocusInitial [disabled]=\"savingTemplate\">\n {{data?.selectedTemplateId ? t('createColumnsTemplate.update') : t('createColumnsTemplate.save')}}\n @if(savingTemplate){\n <i class=\"fas fa-spinner fa-spin\"></i>\n }\n </button>\n </div>\n</form>", styles: [".example-container{width:400px;max-width:100%;margin:0 25px 25px 0;display:inline-block;vertical-align:top}.example-list{min-height:60px;background:#fff;border-radius:4px;overflow:hidden;display:block}.example-box{border-bottom:solid 1px #EEE;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;background:#fff;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mt-20{margin-top:20px}.mt-40{margin-top:40px}.w-10{width:10%}.w-100{width:100%}.container{width:100%;display:flex;align-items:center}.drag-index{font-size:16px;font-weight:500;padding:8px;width:40px;text-align:end}.drag-icon{background-color:#36834f;color:#fff;text-align:center;position:relative}.drag-icon i{padding-top:3px;cursor:move}.drag-content{margin-top:8px;padding-left:10px}.drag-content span{vertical-align:text-bottom;padding-left:5px}\n"] }]
|
|
533
|
+
}], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: TisHelperService }, { type: i1$2.MatSnackBar }, { type: UserCustomizationService }, { type: undefined, decorators: [{
|
|
534
|
+
type: Inject,
|
|
535
|
+
args: [MAT_DIALOG_DATA]
|
|
536
|
+
}] }] });
|
|
537
|
+
|
|
538
|
+
class TisColumnsBtnComponent {
|
|
539
|
+
helper;
|
|
540
|
+
userCustomizationService;
|
|
541
|
+
dialog;
|
|
542
|
+
static COMPONENT_NAME = 'TisColumnsBtnComponent';
|
|
543
|
+
columnCustomizationUrlConfig;
|
|
544
|
+
t = {};
|
|
545
|
+
componentName;
|
|
546
|
+
defaultColumns;
|
|
547
|
+
columns;
|
|
548
|
+
skipTranslation = false;
|
|
549
|
+
customColumns;
|
|
550
|
+
displayedColumnsChange = new EventEmitter();
|
|
551
|
+
fromStartColumnNumberChange = new EventEmitter();
|
|
552
|
+
fromEndColumnNumberChange = new EventEmitter();
|
|
553
|
+
selectedTemplate = {
|
|
554
|
+
id: -1,
|
|
555
|
+
name: 'Default'
|
|
556
|
+
};
|
|
557
|
+
displayedColumns = [];
|
|
558
|
+
templates = [];
|
|
559
|
+
isDeleteTemplate = false;
|
|
560
|
+
isEditTemplate = false;
|
|
561
|
+
constructor(helper, userCustomizationService, dialog) {
|
|
562
|
+
this.helper = helper;
|
|
563
|
+
this.userCustomizationService = userCustomizationService;
|
|
564
|
+
this.dialog = dialog;
|
|
565
|
+
}
|
|
566
|
+
ngOnInit() {
|
|
567
|
+
this.getColumnsTemplates();
|
|
568
|
+
// setTimeout(() => {
|
|
569
|
+
// this.createNewTemplateDialog();
|
|
570
|
+
// }, 2000);
|
|
571
|
+
}
|
|
572
|
+
createNewTemplateDialog(stData = null) {
|
|
573
|
+
if (!this.componentName)
|
|
574
|
+
return;
|
|
575
|
+
let data = {
|
|
576
|
+
name: stData ? stData.name : null,
|
|
577
|
+
enableStickiness: stData ? stData.enableStickiness : false,
|
|
578
|
+
fromStartColumnNumber: stData ? stData.fromStartColumnNumber : 0,
|
|
579
|
+
fromEndColumnNumber: stData ? stData.fromEndColumnNumber : 0,
|
|
580
|
+
listComponentName: this.componentName,
|
|
581
|
+
selectedTemplateId: stData ? stData?.id : null,
|
|
582
|
+
defaultSelectedState: stData && stData?.id ? false : true,
|
|
583
|
+
defaultColumns: this.defaultColumns,
|
|
584
|
+
columns: this.columns,
|
|
585
|
+
displayColumns: stData ? stData?.displayColumns?.split(',') : this.displayedColumns,
|
|
586
|
+
t: this.t,
|
|
587
|
+
skipTranslation: this.skipTranslation,
|
|
588
|
+
customColumns: this.customColumns
|
|
589
|
+
};
|
|
590
|
+
const dialogRef = this.dialog.open(CreateColumnsTemplateComponent, {
|
|
591
|
+
width: "35%",
|
|
592
|
+
minWidth: '370px',
|
|
593
|
+
data: data,
|
|
594
|
+
panelClass: ['tis-create-new-columns-template'],
|
|
595
|
+
disableClose: true,
|
|
596
|
+
});
|
|
597
|
+
dialogRef.afterClosed().subscribe((res) => {
|
|
598
|
+
if (res) {
|
|
599
|
+
console.log("=== createNewTemplateDialog ===", res);
|
|
600
|
+
if (res?.isUpdated) {
|
|
601
|
+
this.templates = this.templates?.map(t => {
|
|
602
|
+
if (t.id == res?.id) {
|
|
603
|
+
t = res;
|
|
604
|
+
}
|
|
605
|
+
return t;
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
this.templates = [res, ...this.templates];
|
|
610
|
+
}
|
|
611
|
+
this.selectedTemplate = res;
|
|
612
|
+
this.changeDisplayColumns();
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
getColumnsTemplates() {
|
|
617
|
+
this.userCustomizationService.getColumnsTemplates(this.columnCustomizationUrlConfig.list, this.componentName).subscribe(r => {
|
|
618
|
+
console.log("getColumnsTemplates:", r.data);
|
|
619
|
+
this.templates = r?.data ?? [];
|
|
620
|
+
setTimeout(() => {
|
|
621
|
+
this.getSelectedColumnsTemplate();
|
|
622
|
+
}, 100);
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
getSelectedColumnsTemplate() {
|
|
626
|
+
this.userCustomizationService.getSelectedColumnsTemplate(this.columnCustomizationUrlConfig.getSelectedTemplate, this.componentName).subscribe((r) => {
|
|
627
|
+
console.log("getSelectedColumnsTemplate:", r.data);
|
|
628
|
+
if (r?.data && Object.keys(r?.data).length != 0) {
|
|
629
|
+
if (r.data?.listComponentColumnsTemplateId > 0) {
|
|
630
|
+
this.selectedTemplate = this.templates?.find((t) => t.id == r.data?.listComponentColumnsTemplateId);
|
|
631
|
+
}
|
|
632
|
+
console.log("getSelectedColumnsTemplate:", this.templates, this.selectedTemplate);
|
|
633
|
+
this.changeDisplayColumns();
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
onSelectedTemplate(templateId) {
|
|
638
|
+
setTimeout(() => {
|
|
639
|
+
if (this.isDeleteTemplate) {
|
|
640
|
+
console.log("onSelectedTemplate:", this.isDeleteTemplate);
|
|
641
|
+
let confirmBoxData = {
|
|
642
|
+
title: "Delete template",
|
|
643
|
+
message: `Are you sure you want to delete this template?`,
|
|
644
|
+
iconClass: "tis-text-danger",
|
|
645
|
+
icon: "delete",
|
|
646
|
+
approveButtonText: "Yes, Confirm",
|
|
647
|
+
approveButtonClass: "tis-btn-danger",
|
|
648
|
+
cancelButtonText: "Cancel",
|
|
649
|
+
cancelButtonClass: "tis-btn-primary"
|
|
650
|
+
};
|
|
651
|
+
const dialogRef = this.dialog.open(TisSmartTableConfirmationDialogComponent, {
|
|
652
|
+
width: "30%",
|
|
653
|
+
minWidth: '370px',
|
|
654
|
+
// panelClass: ['tis-simple-confirmation'],
|
|
655
|
+
data: confirmBoxData,
|
|
656
|
+
disableClose: true,
|
|
657
|
+
});
|
|
658
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
659
|
+
console.log("The dialog was closed with result:", result);
|
|
660
|
+
if (result) {
|
|
661
|
+
this.userCustomizationService.deleteColumnsTemplate(this.columnCustomizationUrlConfig.delete, { id: templateId, isSelectedTemplate: this.selectedTemplate?.id == templateId }).subscribe((r) => {
|
|
662
|
+
this.helper.showSuccessMsg('Columns template has been deleted successfully', 'Done');
|
|
663
|
+
this.templates.splice(this.templates.findIndex(ee => ee.id == templateId), 1);
|
|
664
|
+
if (this.selectedTemplate?.id == templateId) {
|
|
665
|
+
this.selectedTemplate = {
|
|
666
|
+
id: -1,
|
|
667
|
+
name: 'Default',
|
|
668
|
+
fromStartColumnNumber: 0,
|
|
669
|
+
fromEndColumnNumber: 0,
|
|
670
|
+
};
|
|
671
|
+
this.changeDisplayColumns();
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
else if (this.isEditTemplate) {
|
|
678
|
+
console.log("onSelectedTemplate:", this.isEditTemplate);
|
|
679
|
+
let st = this.templates?.find((t) => t.id == templateId);
|
|
680
|
+
this.createNewTemplateDialog(st);
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
if (this.selectedTemplate?.id != templateId) {
|
|
684
|
+
if (templateId > 0) {
|
|
685
|
+
this.selectedTemplate = this.templates?.find((t) => t.id == templateId);
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
this.selectedTemplate = {
|
|
689
|
+
id: -1,
|
|
690
|
+
name: 'Default'
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
this.userCustomizationService.updateSelectedColumnsTemplate(this.columnCustomizationUrlConfig.updateSelectedTemplate, { id: this.selectedTemplate?.id, listComponentName: this.componentName }).subscribe((r) => {
|
|
694
|
+
this.changeDisplayColumns();
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
this.isDeleteTemplate = false;
|
|
699
|
+
this.isEditTemplate = false;
|
|
700
|
+
}, 200);
|
|
701
|
+
}
|
|
702
|
+
changeDisplayColumns() {
|
|
703
|
+
if (this.selectedTemplate?.id > 0) {
|
|
704
|
+
this.displayedColumns = this.selectedTemplate.displayColumns?.split(',');
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
this.displayedColumns = this.defaultColumns;
|
|
708
|
+
}
|
|
709
|
+
this.displayedColumnsChange.emit(this.displayedColumns);
|
|
710
|
+
this.fromStartColumnNumberChange.emit(this.selectedTemplate?.fromStartColumnNumber ?? 0);
|
|
711
|
+
this.fromEndColumnNumberChange.emit(this.selectedTemplate?.fromEndColumnNumber ?? 0);
|
|
712
|
+
}
|
|
713
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisColumnsBtnComponent, deps: [{ token: TisHelperService }, { token: UserCustomizationService }, { token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
714
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: TisColumnsBtnComponent, isStandalone: false, selector: "tis-columns-btn", inputs: { columnCustomizationUrlConfig: "columnCustomizationUrlConfig", t: "t", componentName: "componentName", defaultColumns: "defaultColumns", columns: "columns", skipTranslation: "skipTranslation", customColumns: "customColumns" }, outputs: { displayedColumnsChange: "displayedColumnsChange", fromStartColumnNumberChange: "fromStartColumnNumberChange", fromEndColumnNumberChange: "fromEndColumnNumberChange" }, ngImport: i0, template: "<!-- shared.tisColumnsBtnComponent -->\n<button mat-flat-button class=\"tis-text-upper tis-bg-light\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>view_week</mat-icon>\n <span class=\"flex flex-row align-center\">\n {{selectedTemplate?.name}}\n <mat-icon class=\"tis-expansion-icon\">arrow_drop_down</mat-icon>\n </span>\n</button>\n<mat-menu #menu=\"matMenu\" class=\"tis-mat-menu\">\n <button mat-menu-item (click)=\"selectedTemplate?.id != -1 ? onSelectedTemplate(-1) : null\">\n <mat-icon>{{selectedTemplate?.id == -1 ? 'done': ''}}</mat-icon>\n Default\n </button>\n <button mat-menu-item *ngFor=\"let template of templates\" (click)=\"onSelectedTemplate(template?.id)\">\n <mat-icon>{{template?.id == selectedTemplate?.id ? 'done': ''}}</mat-icon>\n <span class=\"pr-16\">{{template.name}}</span>\n <mat-icon class=\"absolute right-0 delete\" (click)=\"isDeleteTemplate = true\">delete</mat-icon>\n <mat-icon class=\"absolute right-8 edit\" (click)=\"isEditTemplate = true\">edit</mat-icon>\n </button>\n <mat-divider></mat-divider>\n <button mat-menu-item class=\"tis-text-upper active\" (click)=\"createNewTemplateDialog()\"><mat-icon>add</mat-icon> {{t('tisColumnsBtnComponent.createNewView')}}</button>\n</mat-menu>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i7.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i7.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i7.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i8$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }] });
|
|
715
|
+
}
|
|
716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisColumnsBtnComponent, decorators: [{
|
|
717
|
+
type: Component,
|
|
718
|
+
args: [{ selector: 'tis-columns-btn', standalone: false, template: "<!-- shared.tisColumnsBtnComponent -->\n<button mat-flat-button class=\"tis-text-upper tis-bg-light\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>view_week</mat-icon>\n <span class=\"flex flex-row align-center\">\n {{selectedTemplate?.name}}\n <mat-icon class=\"tis-expansion-icon\">arrow_drop_down</mat-icon>\n </span>\n</button>\n<mat-menu #menu=\"matMenu\" class=\"tis-mat-menu\">\n <button mat-menu-item (click)=\"selectedTemplate?.id != -1 ? onSelectedTemplate(-1) : null\">\n <mat-icon>{{selectedTemplate?.id == -1 ? 'done': ''}}</mat-icon>\n Default\n </button>\n <button mat-menu-item *ngFor=\"let template of templates\" (click)=\"onSelectedTemplate(template?.id)\">\n <mat-icon>{{template?.id == selectedTemplate?.id ? 'done': ''}}</mat-icon>\n <span class=\"pr-16\">{{template.name}}</span>\n <mat-icon class=\"absolute right-0 delete\" (click)=\"isDeleteTemplate = true\">delete</mat-icon>\n <mat-icon class=\"absolute right-8 edit\" (click)=\"isEditTemplate = true\">edit</mat-icon>\n </button>\n <mat-divider></mat-divider>\n <button mat-menu-item class=\"tis-text-upper active\" (click)=\"createNewTemplateDialog()\"><mat-icon>add</mat-icon> {{t('tisColumnsBtnComponent.createNewView')}}</button>\n</mat-menu>" }]
|
|
719
|
+
}], ctorParameters: () => [{ type: TisHelperService }, { type: UserCustomizationService }, { type: i1$1.MatDialog }], propDecorators: { columnCustomizationUrlConfig: [{
|
|
720
|
+
type: Input,
|
|
721
|
+
args: [{ required: true }]
|
|
722
|
+
}], t: [{
|
|
723
|
+
type: Input
|
|
724
|
+
}], componentName: [{
|
|
725
|
+
type: Input,
|
|
726
|
+
args: [{ required: true }]
|
|
727
|
+
}], defaultColumns: [{
|
|
728
|
+
type: Input,
|
|
729
|
+
args: [{ required: true }]
|
|
730
|
+
}], columns: [{
|
|
731
|
+
type: Input,
|
|
732
|
+
args: [{ required: true }]
|
|
733
|
+
}], skipTranslation: [{
|
|
734
|
+
type: Input
|
|
735
|
+
}], customColumns: [{
|
|
736
|
+
type: Input
|
|
737
|
+
}], displayedColumnsChange: [{
|
|
738
|
+
type: Output
|
|
739
|
+
}], fromStartColumnNumberChange: [{
|
|
740
|
+
type: Output
|
|
741
|
+
}], fromEndColumnNumberChange: [{
|
|
742
|
+
type: Output
|
|
743
|
+
}] } });
|
|
744
|
+
|
|
745
|
+
class TisDatePipe {
|
|
746
|
+
transform(value, ...args) {
|
|
747
|
+
if (typeof value == 'string' && value !== '') {
|
|
748
|
+
return DateTime.fromMillis(+value).toFormat('dd MMM yyyy');
|
|
749
|
+
}
|
|
750
|
+
else if (typeof value == 'number') {
|
|
751
|
+
return DateTime.fromMillis(value).toFormat('dd MMM yyyy');
|
|
752
|
+
}
|
|
753
|
+
else if (value instanceof Date) {
|
|
754
|
+
return DateTime.fromJSDate(value).toFormat('dd MMM yyyy');
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
return 'Invalid Date';
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
761
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, isStandalone: false, name: "tisDate" });
|
|
762
|
+
}
|
|
763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, decorators: [{
|
|
764
|
+
type: Pipe,
|
|
765
|
+
args: [{
|
|
766
|
+
name: 'tisDate',
|
|
767
|
+
standalone: false
|
|
768
|
+
}]
|
|
769
|
+
}] });
|
|
770
|
+
|
|
771
|
+
class TisDateTimePipe {
|
|
772
|
+
transform(value, ...args) {
|
|
773
|
+
if (typeof value == 'string' && value !== '') {
|
|
774
|
+
return DateTime.fromMillis(+value).toFormat('dd MMM yyyy hh:mm a');
|
|
775
|
+
}
|
|
776
|
+
else if (typeof value == 'number') {
|
|
777
|
+
return DateTime.fromMillis(value).toFormat('dd MMM yyyy hh:mm a');
|
|
778
|
+
}
|
|
779
|
+
else {
|
|
780
|
+
return 'Invalid Date';
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
784
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, isStandalone: false, name: "tisDateTime" });
|
|
785
|
+
}
|
|
786
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, decorators: [{
|
|
787
|
+
type: Pipe,
|
|
788
|
+
args: [{
|
|
789
|
+
name: 'tisDateTime',
|
|
790
|
+
standalone: false
|
|
791
|
+
}]
|
|
792
|
+
}] });
|
|
793
|
+
|
|
794
|
+
class TisDateTimeWithSecondsPipe {
|
|
795
|
+
transform(value, ...args) {
|
|
796
|
+
if (typeof value == 'string' && value !== '') {
|
|
797
|
+
return DateTime.fromMillis(+value).toFormat('dd MMM yyyy hh:mm:ss a');
|
|
798
|
+
}
|
|
799
|
+
else if (typeof value == 'number') {
|
|
800
|
+
return DateTime.fromMillis(value).toFormat('dd MMM yyyy hh:mm:ss a');
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
return 'Invalid Date';
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
807
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, isStandalone: false, name: "tisDateTimeWithSeconds" });
|
|
808
|
+
}
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, decorators: [{
|
|
810
|
+
type: Pipe,
|
|
811
|
+
args: [{
|
|
812
|
+
name: 'tisDateTimeWithSeconds',
|
|
813
|
+
standalone: false
|
|
814
|
+
}]
|
|
815
|
+
}] });
|
|
816
|
+
|
|
817
|
+
class TisSmartTableViewerComponent {
|
|
818
|
+
dialog;
|
|
819
|
+
apiService;
|
|
820
|
+
route;
|
|
821
|
+
router;
|
|
822
|
+
location;
|
|
823
|
+
breakpointObserver;
|
|
824
|
+
homeUrl = '';
|
|
825
|
+
columnCustomizationUrlConfig;
|
|
826
|
+
t = {};
|
|
827
|
+
componentName = '';
|
|
828
|
+
mainTitle;
|
|
829
|
+
searchPlaceholder;
|
|
830
|
+
breadcrumbs = [];
|
|
831
|
+
hideHeader = false;
|
|
832
|
+
hideTableHeader = false;
|
|
833
|
+
hidePaginator = false;
|
|
834
|
+
keepFilterInUrl = true;
|
|
835
|
+
displayColumnsSelectionButton = true;
|
|
836
|
+
loadDataApiBaseUrl;
|
|
837
|
+
startStickyColumnCount;
|
|
838
|
+
endStickyColumnCount;
|
|
839
|
+
loaderPosition = 'top';
|
|
840
|
+
dataNotFoundConfig = {
|
|
841
|
+
title: 'No Data Found',
|
|
842
|
+
desc: 'There is no data. Please click on button to add',
|
|
843
|
+
btnText: 'Add New',
|
|
844
|
+
btnUrl: '',
|
|
845
|
+
btnClick: null,
|
|
846
|
+
secondBtnText: '',
|
|
847
|
+
secondBtnUrl: '',
|
|
848
|
+
secondBtnClick: null
|
|
849
|
+
};
|
|
850
|
+
showFilterButtonSection;
|
|
851
|
+
columnsCodeMapping;
|
|
852
|
+
autoRenderColumns;
|
|
853
|
+
templateRenderColumns;
|
|
854
|
+
defaultDisplayedColumns;
|
|
855
|
+
displayedColumns;
|
|
856
|
+
defaultColumns;
|
|
857
|
+
columns;
|
|
858
|
+
displayedColumnsChange = new EventEmitter();
|
|
859
|
+
usersColumnSelectionDetail;
|
|
860
|
+
defaultSortObj = {};
|
|
861
|
+
sortObj = {};
|
|
862
|
+
sortObjChange = new EventEmitter();
|
|
863
|
+
loadingSpinnerDiameter = 30;
|
|
864
|
+
pageSizeOptions = [5, 10, 25, 100];
|
|
865
|
+
pageSize = 10;
|
|
866
|
+
pageSizeChange = new EventEmitter();
|
|
867
|
+
useGlobalPageSize = true;
|
|
868
|
+
pageIndex = 0;
|
|
869
|
+
pageIndexChange = new EventEmitter();
|
|
870
|
+
filterFormGroup = new FormGroup({});
|
|
871
|
+
rowsConfig = {
|
|
872
|
+
backgroundApplyFunction: () => null // Default blank function
|
|
873
|
+
};
|
|
874
|
+
selectedFilterValues = [];
|
|
875
|
+
finalSelectedFilterValuesToDisplay = [];
|
|
876
|
+
selectedFilterGroupedValues = [];
|
|
877
|
+
isShowFilter = false;
|
|
878
|
+
filterFormGroupSubscription;
|
|
879
|
+
filterHasNonEmptyValue = false;
|
|
880
|
+
filterApplied = false;
|
|
881
|
+
resetFlag = false;
|
|
882
|
+
initialLoading = true;
|
|
883
|
+
filterFromQueryParams = {};
|
|
884
|
+
sortFromQueryParams = {};
|
|
885
|
+
search = '';
|
|
886
|
+
searchCtrl = new FormControl();
|
|
887
|
+
_onDestroy = new Subject();
|
|
888
|
+
dataSource;
|
|
889
|
+
_sort;
|
|
890
|
+
_sortSubscription;
|
|
891
|
+
set sort(value) {
|
|
892
|
+
this._sort = value;
|
|
893
|
+
if (this._sort) {
|
|
894
|
+
if (this._sortSubscription) {
|
|
895
|
+
this._sortSubscription.unsubscribe();
|
|
896
|
+
}
|
|
897
|
+
this._sortSubscription = this._sort.sortChange.pipe(takeUntil(this._onDestroy)).subscribe((ch) => {
|
|
898
|
+
this.handleSortingChanges(ch);
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
_paginator;
|
|
903
|
+
_paginatorSubscription;
|
|
904
|
+
set paginator(value) {
|
|
905
|
+
this._paginator = value;
|
|
906
|
+
if (this._paginator) {
|
|
907
|
+
if (this._paginatorSubscription) {
|
|
908
|
+
this._paginatorSubscription.unsubscribe();
|
|
909
|
+
}
|
|
910
|
+
this._paginatorSubscription = this._paginator.page.pipe(takeUntil(this._onDestroy), tap(() => {
|
|
911
|
+
this.onPaginationChanges();
|
|
912
|
+
})).subscribe();
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
loadingSubscription;
|
|
916
|
+
dataLengthSubscription;
|
|
917
|
+
enableRowsSelection = false;
|
|
918
|
+
enableAllRowsSelection = false;
|
|
919
|
+
onlySingleSelection = false;
|
|
920
|
+
selectedRows;
|
|
921
|
+
selectedRowsChange = new EventEmitter();
|
|
922
|
+
selection = new SelectionModel(true, []);
|
|
923
|
+
selectedIds = new Set();
|
|
924
|
+
isAllRowsSelected = false;
|
|
925
|
+
enableDragNDrop = false;
|
|
926
|
+
listDataSequenceChange = new EventEmitter();
|
|
927
|
+
isHandset$;
|
|
928
|
+
isMobile = false;
|
|
929
|
+
constructor(
|
|
930
|
+
// private userCustomizationService: UserCustomizationService,
|
|
931
|
+
dialog, apiService, route, router, location, breakpointObserver) {
|
|
932
|
+
this.dialog = dialog;
|
|
933
|
+
this.apiService = apiService;
|
|
934
|
+
this.route = route;
|
|
935
|
+
this.router = router;
|
|
936
|
+
this.location = location;
|
|
937
|
+
this.breakpointObserver = breakpointObserver;
|
|
938
|
+
this.selection.changed.subscribe(change => {
|
|
939
|
+
change.added.forEach(item => this.selectedIds.add(item['id']));
|
|
940
|
+
change.removed.forEach(item => this.selectedIds.delete(item['id']));
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
ngOnInit() {
|
|
944
|
+
this.isHandset$ = this.breakpointObserver.observe([Breakpoints.Handset])
|
|
945
|
+
.pipe(map(result => {
|
|
946
|
+
console.log("== result ==", result);
|
|
947
|
+
return result.matches;
|
|
948
|
+
}), shareReplay());
|
|
949
|
+
this.isHandset$.subscribe(r => {
|
|
950
|
+
console.log('IS HANDSET:', r);
|
|
951
|
+
this.isMobile = r;
|
|
952
|
+
});
|
|
953
|
+
this.setDefaultColumns();
|
|
954
|
+
this.getHomeUrl();
|
|
955
|
+
this.route.queryParams.subscribe(qp => {
|
|
956
|
+
this.filterFromQueryParams = {};
|
|
957
|
+
this.sortFromQueryParams = {};
|
|
958
|
+
if (this.keepFilterInUrl) {
|
|
959
|
+
for (const key in qp) {
|
|
960
|
+
if (qp.hasOwnProperty(key) && qp[key] && qp[key] != '' && qp[key] != 'null' && qp[key] != 'undefined') {
|
|
961
|
+
let fixedKeyMatched = false;
|
|
962
|
+
if (key.toLowerCase() === 'pageIndex'.toLowerCase()) {
|
|
963
|
+
this.pageIndex = Number(qp[key]);
|
|
964
|
+
fixedKeyMatched = true;
|
|
965
|
+
}
|
|
966
|
+
if (key.toLowerCase() === 'pageSize'.toLowerCase()) {
|
|
967
|
+
this.pageSize = Number(qp[key]);
|
|
968
|
+
fixedKeyMatched = true;
|
|
969
|
+
}
|
|
970
|
+
if (key.toLowerCase() === 'sortBy'.toLowerCase()) {
|
|
971
|
+
this.sortFromQueryParams.sortBy = qp[key];
|
|
972
|
+
fixedKeyMatched = true;
|
|
973
|
+
}
|
|
974
|
+
if (key.toLowerCase() === 'sortOrder'.toLowerCase()) {
|
|
975
|
+
this.sortFromQueryParams.sortOrder = qp[key];
|
|
976
|
+
fixedKeyMatched = true;
|
|
977
|
+
}
|
|
978
|
+
if (key.toLowerCase() === 'search'.toLowerCase()) {
|
|
979
|
+
this.search = qp[key];
|
|
980
|
+
this.searchCtrl.patchValue(this.search);
|
|
981
|
+
fixedKeyMatched = true;
|
|
982
|
+
}
|
|
983
|
+
if (key.toLowerCase().includes('date') && qp[key].length == 13) { // To Check if it is a date
|
|
984
|
+
// this.filterFromQueryParams[key] = moment(Number(qp[key]));
|
|
985
|
+
this.filterFromQueryParams[key] = DateTime.fromMillis(Number(qp[key]));
|
|
986
|
+
fixedKeyMatched = true;
|
|
987
|
+
}
|
|
988
|
+
if (!fixedKeyMatched) {
|
|
989
|
+
if ((qp[key]).includes(',')) {
|
|
990
|
+
this.filterFromQueryParams[key] = (qp[key]).split(',');
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
this.filterFromQueryParams[key] = qp[key];
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
// Transform Data, before patching in filter Form
|
|
997
|
+
let mapping = this.columnsCodeMapping.find(ccm => ccm.filterFormKey == key);
|
|
998
|
+
if (mapping?.transformQueryParamFn) {
|
|
999
|
+
this.filterFromQueryParams[key] = mapping.transformQueryParamFn(this.filterFromQueryParams[key]);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
this.filterFormGroup.patchValue(this.filterFromQueryParams);
|
|
1004
|
+
if (this.sortFromQueryParams && this.sortFromQueryParams.sortBy && this.sortFromQueryParams.sortOrder) {
|
|
1005
|
+
this.sortObj = this.sortFromQueryParams;
|
|
1006
|
+
console.log('[table-list-view-wrapper]: Emitting Sort Obj from QP to parent component:', this.sortFromQueryParams);
|
|
1007
|
+
this.sortObjChange.emit(this.sortObj);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
let filterHasNonEmptyValue = Object.values(this.filterFromQueryParams).some(value => value !== null && value !== undefined && value !== '');
|
|
1011
|
+
if (filterHasNonEmptyValue) {
|
|
1012
|
+
this.filterApplied = true;
|
|
1013
|
+
}
|
|
1014
|
+
this.getList();
|
|
1015
|
+
});
|
|
1016
|
+
this.searchCtrl.valueChanges
|
|
1017
|
+
.pipe(takeUntil(this._onDestroy), debounceTime(400), distinctUntilChanged())
|
|
1018
|
+
.subscribe((search) => {
|
|
1019
|
+
this.search = search;
|
|
1020
|
+
this.resetFlag = true; // B/c every time search is made, make sure we go to first page...
|
|
1021
|
+
this.getList(false);
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
ngOnChanges(changes) {
|
|
1025
|
+
console.log(`[table-list-view-wrapper]: ngOnChanges:`, changes);
|
|
1026
|
+
if (changes['defaultDisplayedColumns']) {
|
|
1027
|
+
console.log(`[table-list-view-wrapper]: changes['defaultDisplayedColumns']:`, changes['defaultDisplayedColumns']);
|
|
1028
|
+
this.handleDisplayedColumns();
|
|
1029
|
+
}
|
|
1030
|
+
if (changes['columnsCodeMapping']) {
|
|
1031
|
+
console.log(`[table-list-view-wrapper]: changes['columnsCodeMapping']:`, changes['columnsCodeMapping']);
|
|
1032
|
+
this.columnsCodeMapping = changes['columnsCodeMapping'].currentValue;
|
|
1033
|
+
this.handleDisplayedColumns();
|
|
1034
|
+
this.columns = this.columnsCodeMapping.map(c => c.name);
|
|
1035
|
+
this.autoRenderColumns = this.columnsCodeMapping.filter(c => c.hasOwnProperty('valueKey'));
|
|
1036
|
+
this.templateRenderColumns = this.columnsCodeMapping.filter(c => c.hasOwnProperty('template'));
|
|
1037
|
+
}
|
|
1038
|
+
if (changes['pageIndex']) {
|
|
1039
|
+
this.pageIndex = changes['pageIndex'].currentValue;
|
|
1040
|
+
}
|
|
1041
|
+
if (changes['pageSize']) {
|
|
1042
|
+
if (!changes['pageSize'].isFirstChange) {
|
|
1043
|
+
this.pageSize = changes['pageSize'].currentValue;
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
if (this.useGlobalPageSize) {
|
|
1047
|
+
let userDefaultPageSize = getFromLocalStorageWithExpiry('user_pagination_page_size');
|
|
1048
|
+
this.pageSize = userDefaultPageSize ? userDefaultPageSize : changes['pageSize'].currentValue;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
if (changes['loadDataApiBaseUrl']) {
|
|
1053
|
+
if (changes['loadDataApiBaseUrl'].currentValue) {
|
|
1054
|
+
console.log(`[table-list-view-wrapper]: Datasource changes['loadDataApiBaseUrl'].currentValue:`, changes['loadDataApiBaseUrl'].currentValue);
|
|
1055
|
+
if (this.loadingSubscription) {
|
|
1056
|
+
this.loadingSubscription.unsubscribe();
|
|
1057
|
+
}
|
|
1058
|
+
if (this.dataLengthSubscription) {
|
|
1059
|
+
this.dataLengthSubscription.unsubscribe();
|
|
1060
|
+
}
|
|
1061
|
+
this.dataSource = new ApiDataSource(this.apiService);
|
|
1062
|
+
console.log('[table-list-view-wrapper]: Datasource Initialized:', this.dataSource);
|
|
1063
|
+
this.loadingSubscription = this.dataSource.loading$.subscribe(loading => {
|
|
1064
|
+
console.log('[table-list-view-wrapper]: dataSource loading:', loading);
|
|
1065
|
+
if (!loading && this._paginator) {
|
|
1066
|
+
this._paginator.pageIndex = this.pageIndex;
|
|
1067
|
+
this._paginator.pageSize = this.pageSize;
|
|
1068
|
+
this.checkAllRowsSelected();
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
this.dataLengthSubscription = this.dataSource.totalDataLength$.subscribe((total) => {
|
|
1072
|
+
console.log('[table-list-view-wrapper]: dataSource total:', total);
|
|
1073
|
+
if (total !== null) {
|
|
1074
|
+
this.initialLoading = false;
|
|
1075
|
+
// console.log('[table-list-view-wrapper]: dataSource total total:', total);
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
if (changes['filterFormGroup']) {
|
|
1081
|
+
if (this.filterFormGroupSubscription) {
|
|
1082
|
+
this.filterFormGroupSubscription.unsubscribe();
|
|
1083
|
+
}
|
|
1084
|
+
this.filterFormGroupSubscription = this.filterFormGroup.valueChanges
|
|
1085
|
+
.pipe(takeUntil(this._onDestroy), distinctUntilChanged()).subscribe(val => {
|
|
1086
|
+
this.filterHasNonEmptyValue = Object.values(val).some(value => value !== null && value !== undefined && value !== '');
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
if (changes['selectedRows']) {
|
|
1090
|
+
this.selectedRows = changes['selectedRows'].currentValue;
|
|
1091
|
+
if (this.selectedRows && this.selectedRows.length) {
|
|
1092
|
+
// TODO:: Leave for now..... (Not able to decide whether in future we need to pass whole row or ids only)
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (changes['defaultSortObj']?.currentValue) {
|
|
1096
|
+
this.defaultSortObj = changes['defaultSortObj'].currentValue;
|
|
1097
|
+
this.handleSortingChanges({
|
|
1098
|
+
direction: this.defaultSortObj.sortOrder,
|
|
1099
|
+
active: this.defaultSortObj.sortBy
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
ngOnDestroy() {
|
|
1104
|
+
this._sortSubscription?.unsubscribe();
|
|
1105
|
+
this._paginatorSubscription?.unsubscribe();
|
|
1106
|
+
this.loadingSubscription?.unsubscribe();
|
|
1107
|
+
this.dataLengthSubscription?.unsubscribe();
|
|
1108
|
+
this.filterFormGroupSubscription?.unsubscribe();
|
|
1109
|
+
}
|
|
1110
|
+
setDefaultColumns() {
|
|
1111
|
+
if (this.defaultDisplayedColumns && this.defaultDisplayedColumns.length) {
|
|
1112
|
+
this.defaultColumns = this.defaultDisplayedColumns;
|
|
1113
|
+
}
|
|
1114
|
+
else {
|
|
1115
|
+
this.defaultColumns = this.columnsCodeMapping.map(c => c.name);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
handleDisplayedColumns() {
|
|
1119
|
+
if (this.defaultDisplayedColumns && this.defaultDisplayedColumns.length) {
|
|
1120
|
+
const columnsSet = new Set(this.columnsCodeMapping.map(ccm => ccm.name));
|
|
1121
|
+
this.displayedColumns = this.defaultDisplayedColumns.filter(c => columnsSet.has(c));
|
|
1122
|
+
}
|
|
1123
|
+
else {
|
|
1124
|
+
this.displayedColumns = this.columnsCodeMapping.map(c => c.name);
|
|
1125
|
+
}
|
|
1126
|
+
if (this.enableRowsSelection) {
|
|
1127
|
+
this.displayedColumns = ['Select', ...this.displayedColumns];
|
|
1128
|
+
}
|
|
1129
|
+
if (this.enableDragNDrop) {
|
|
1130
|
+
this.displayedColumns = ['drag', ...this.displayedColumns];
|
|
1131
|
+
}
|
|
1132
|
+
this.displayedColumnsChange.emit(this.displayedColumns);
|
|
1133
|
+
}
|
|
1134
|
+
handleSortingChanges(ch) {
|
|
1135
|
+
this.sortObj = { sortOrder: ch.direction, sortBy: this.columnsCodeMapping.find(c => c.name === ch.active)?.serverKeyCode };
|
|
1136
|
+
this.sortFromQueryParams.sortBy = this.sortObj.sortBy;
|
|
1137
|
+
this.sortFromQueryParams.sortOrder = this.sortObj.sortOrder;
|
|
1138
|
+
this.resetFlag = true;
|
|
1139
|
+
this.getList();
|
|
1140
|
+
}
|
|
1141
|
+
getHomeUrl() {
|
|
1142
|
+
let pathname = window.location.pathname;
|
|
1143
|
+
// console.log("=== app-table-list-view-wrapper :: pathname ===", pathname);
|
|
1144
|
+
this.homeUrl = `/${pathname.split('/')[1]}`;
|
|
1145
|
+
}
|
|
1146
|
+
getNestedValue(obj, path) {
|
|
1147
|
+
if (!path)
|
|
1148
|
+
return null;
|
|
1149
|
+
// If there is no '.', just return the direct property
|
|
1150
|
+
if (!path.includes('.')) {
|
|
1151
|
+
return obj ? obj[path] : null;
|
|
1152
|
+
}
|
|
1153
|
+
// Otherwise, traverse the nested properties
|
|
1154
|
+
return path.split('.').reduce((acc, part) => acc && acc[part], obj);
|
|
1155
|
+
}
|
|
1156
|
+
groupByFormControlAttributes(data) {
|
|
1157
|
+
const groups = {};
|
|
1158
|
+
data.forEach(item => {
|
|
1159
|
+
if (item.formControlType == 'input') {
|
|
1160
|
+
// Do Nothing...
|
|
1161
|
+
}
|
|
1162
|
+
if (item.formControlType == 'checkbox') {
|
|
1163
|
+
// Do Nothing...
|
|
1164
|
+
}
|
|
1165
|
+
if (item.formControlType == 'date') {
|
|
1166
|
+
item.valueKey = DateTime.fromJSDate(item.value).toFormat('dd-MM-yyyy');
|
|
1167
|
+
}
|
|
1168
|
+
if (item.formControlType == 'date-time') {
|
|
1169
|
+
item.valueKey = DateTime.fromJSDate(item.value).toFormat('dd-MM-yyyy HH:mm');
|
|
1170
|
+
}
|
|
1171
|
+
const key = `${item.formControlName}-${item.formControlType}`;
|
|
1172
|
+
if (!groups[key]) {
|
|
1173
|
+
groups[key] = {
|
|
1174
|
+
formControlName: item.formControlName,
|
|
1175
|
+
formControlType: item.formControlType,
|
|
1176
|
+
arrValues: []
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
const isSingleValue = item.isSingleValue ?? ['input', 'radio', 'date', 'date-time', 'toggle'].includes(item.formControlType);
|
|
1180
|
+
// Check if only the last value should be kept due to isSingleValue or duplicated value/valueKey
|
|
1181
|
+
if (isSingleValue) {
|
|
1182
|
+
groups[key].arrValues = [item]; // Replace with the current item
|
|
1183
|
+
}
|
|
1184
|
+
else {
|
|
1185
|
+
// Check for duplicate value and valueKey in the current array
|
|
1186
|
+
const existingIndex = groups[key].arrValues.findIndex(x => x.value === item.value && x.valueKey === item.valueKey);
|
|
1187
|
+
if (existingIndex !== -1) {
|
|
1188
|
+
groups[key].arrValues[existingIndex] = item; // Replace the duplicate
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
groups[key].arrValues.push(item); // Add new item
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
return Object.values(groups);
|
|
1196
|
+
}
|
|
1197
|
+
updateSelectedFilterValues(values) {
|
|
1198
|
+
let currentFormControlName;
|
|
1199
|
+
if (Array.isArray(values)) {
|
|
1200
|
+
this.selectedFilterGroupedValues = this.groupByFormControlAttributes(values);
|
|
1201
|
+
currentFormControlName = values[0]?.formControlName;
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
currentFormControlName = values?.formControlName;
|
|
1205
|
+
this.selectedFilterGroupedValues = this.groupByFormControlAttributes([values]);
|
|
1206
|
+
}
|
|
1207
|
+
this.selectedFilterValues = this.selectedFilterValues.filter(sfv => sfv.formControlName != currentFormControlName);
|
|
1208
|
+
this.selectedFilterGroupedValues.forEach(gv => {
|
|
1209
|
+
if (gv.formControlName = currentFormControlName) {
|
|
1210
|
+
gv.arrValues.forEach(v => {
|
|
1211
|
+
this.selectedFilterValues.push(v);
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
});
|
|
1215
|
+
// this.filterFromQueryParams
|
|
1216
|
+
this.getFinalSelectedFilterValuesToDisplay();
|
|
1217
|
+
}
|
|
1218
|
+
getFinalSelectedFilterValuesToDisplay() {
|
|
1219
|
+
this.finalSelectedFilterValuesToDisplay = [];
|
|
1220
|
+
this.selectedFilterValues.forEach(sf => {
|
|
1221
|
+
if (Object.keys(this.filterFromQueryParams).includes(sf.formControlName)) {
|
|
1222
|
+
this.finalSelectedFilterValuesToDisplay.push(sf);
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
removeParticularFilter(f) {
|
|
1227
|
+
let val = this.filterFormGroup.get(f.formControlName)?.value;
|
|
1228
|
+
if (Array.isArray(val)) {
|
|
1229
|
+
val = val.filter(v => v != f.value);
|
|
1230
|
+
this.filterFormGroup.get(f.formControlName)?.patchValue(val);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
this.filterFormGroup.get(f.formControlName)?.reset();
|
|
1234
|
+
}
|
|
1235
|
+
this.selectedFilterValues = this.selectedFilterValues.filter(sfv => !(sfv.formControlName == f.formControlName && sfv.valueKey == f.valueKey));
|
|
1236
|
+
setTimeout(() => {
|
|
1237
|
+
this.filterRecords();
|
|
1238
|
+
}, 500);
|
|
1239
|
+
}
|
|
1240
|
+
filterRecords() {
|
|
1241
|
+
this.filterApplied = true;
|
|
1242
|
+
this.resetFlag = true;
|
|
1243
|
+
setTimeout(() => {
|
|
1244
|
+
this.getList(true);
|
|
1245
|
+
this.isShowFilter = false;
|
|
1246
|
+
}, 500);
|
|
1247
|
+
}
|
|
1248
|
+
resetFilters() {
|
|
1249
|
+
this.filterApplied = false;
|
|
1250
|
+
setTimeout(() => {
|
|
1251
|
+
this.resetFlag = true;
|
|
1252
|
+
this.filterFromQueryParams = {};
|
|
1253
|
+
this.sortFromQueryParams = {};
|
|
1254
|
+
this.selectedFilterGroupedValues = [];
|
|
1255
|
+
this.selectedFilterValues = [];
|
|
1256
|
+
this.getList();
|
|
1257
|
+
}, 250);
|
|
1258
|
+
}
|
|
1259
|
+
getList(forceFromObject = false) {
|
|
1260
|
+
const filterFormData = this.filterFormGroup?.value;
|
|
1261
|
+
let qs = new URLSearchParams();
|
|
1262
|
+
let filter = { ...filterFormData };
|
|
1263
|
+
if (filterFormData) {
|
|
1264
|
+
this.filterHasNonEmptyValue = Object.values(filterFormData).some(value => value !== null && value !== undefined && value !== '');
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
this.filterHasNonEmptyValue = false;
|
|
1268
|
+
}
|
|
1269
|
+
for (const key in filter) {
|
|
1270
|
+
if (typeof filter[key] === 'object' && (filter[key] instanceof Date || DateTime.isDateTime(filter[key]))) {
|
|
1271
|
+
if (filter[key] instanceof Date) {
|
|
1272
|
+
filter[key] = DateTime.fromJSDate(filter[key]).toMillis();
|
|
1273
|
+
}
|
|
1274
|
+
else if (DateTime.isDateTime(filter[key])) {
|
|
1275
|
+
filter[key] = filter[key].toMillis();
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
// Append All Filters from filter form
|
|
1280
|
+
Object.keys(filter).forEach(key => {
|
|
1281
|
+
if (filter[key] != null && filter[key] != '' && filter[key] != 'null' && filter[key] != 'undefined') {
|
|
1282
|
+
if (filter[key] === '*') {
|
|
1283
|
+
filter[key] = '';
|
|
1284
|
+
}
|
|
1285
|
+
qs.append(key, filter[key]);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
// Append sorting conditions...
|
|
1289
|
+
if (this.sortFromQueryParams) {
|
|
1290
|
+
Object.keys(this.sortFromQueryParams).forEach(key => {
|
|
1291
|
+
if (this.sortFromQueryParams[key] != null && this.sortFromQueryParams[key] != '' && this.sortFromQueryParams[key] != 'null' && this.sortFromQueryParams[key] != 'undefined') {
|
|
1292
|
+
qs.append(key, this.sortFromQueryParams[key]);
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
if (this.resetFlag) {
|
|
1297
|
+
this.pageIndex = 0;
|
|
1298
|
+
}
|
|
1299
|
+
if (this._paginator) {
|
|
1300
|
+
this._paginator.pageIndex = this.pageIndex;
|
|
1301
|
+
this._paginator.pageSize = this.pageSize;
|
|
1302
|
+
}
|
|
1303
|
+
qs.append("pageIndex", this.pageIndex);
|
|
1304
|
+
qs.append("pageSize", this.pageSize);
|
|
1305
|
+
if (this.search != '') {
|
|
1306
|
+
qs.append('search', this.search);
|
|
1307
|
+
}
|
|
1308
|
+
qs = qs.toString();
|
|
1309
|
+
let genUrl = this.router.url.split('?')[0] + '?' + qs;
|
|
1310
|
+
let currentUrl = window.location.pathname + window.location.search;
|
|
1311
|
+
if (currentUrl != genUrl) {
|
|
1312
|
+
if (this.keepFilterInUrl) {
|
|
1313
|
+
this.location.go(genUrl);
|
|
1314
|
+
this.filterFromQueryParams = this.getQueryParams(window.location.href);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
else { }
|
|
1318
|
+
this.dataSource.load(this.loadDataApiBaseUrl, this.pageIndex, this.pageSize, this.search, filter, this.sortObj);
|
|
1319
|
+
this.getFinalSelectedFilterValuesToDisplay();
|
|
1320
|
+
this.resetFlag = false;
|
|
1321
|
+
}
|
|
1322
|
+
onPaginationChanges() {
|
|
1323
|
+
if (this.pageIndex != this._paginator.pageIndex) {
|
|
1324
|
+
this.pageIndex = this._paginator.pageIndex;
|
|
1325
|
+
this.getList();
|
|
1326
|
+
this.pageIndexChange.emit(this.pageIndex);
|
|
1327
|
+
}
|
|
1328
|
+
if (this.pageSize != this._paginator.pageSize) {
|
|
1329
|
+
this.pageSize = this._paginator.pageSize;
|
|
1330
|
+
this.getList();
|
|
1331
|
+
this.pageSizeChange.emit(this.pageSize);
|
|
1332
|
+
setToLocalStorageWithExpiry('user_pagination_page_size', this.pageSize, 1000 * 60 * 60 * 24 * 15);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
onChangeDisplayColumns(columns) {
|
|
1336
|
+
this.defaultDisplayedColumns = columns;
|
|
1337
|
+
this.handleDisplayedColumns();
|
|
1338
|
+
}
|
|
1339
|
+
onChangeFromStartColumnNumber(columnNumber) {
|
|
1340
|
+
this.startStickyColumnCount = columnNumber;
|
|
1341
|
+
}
|
|
1342
|
+
onChangeFromEndColumnNumber(columnNumber) {
|
|
1343
|
+
this.endStickyColumnCount = columnNumber;
|
|
1344
|
+
}
|
|
1345
|
+
goToUrl(url) {
|
|
1346
|
+
if (url) {
|
|
1347
|
+
this.router.navigateByUrl(url);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
toggleSelection(status, row) {
|
|
1351
|
+
if (this.onlySingleSelection && status.checked) {
|
|
1352
|
+
this.selection.clear();
|
|
1353
|
+
}
|
|
1354
|
+
this.selection.toggle(row);
|
|
1355
|
+
this.selectedRows = this.selection.selected;
|
|
1356
|
+
this.selectedRowsChange.emit(this.selectedRows);
|
|
1357
|
+
this.checkAllRowsSelected();
|
|
1358
|
+
}
|
|
1359
|
+
checkAllRowsSelected() {
|
|
1360
|
+
this.isAllRowsSelected = this.selection.selected.length === this.dataSource.apiSubject.value.length;
|
|
1361
|
+
}
|
|
1362
|
+
toggleAllRows() {
|
|
1363
|
+
if (this.isAllRowsSelected) {
|
|
1364
|
+
this.selection.clear();
|
|
1365
|
+
}
|
|
1366
|
+
else {
|
|
1367
|
+
this.dataSource.apiSubject.value.forEach(row => {
|
|
1368
|
+
this.selection.select(row);
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
this.selectedRows = this.selection.selected;
|
|
1372
|
+
this.selectedRowsChange.emit(this.selectedRows);
|
|
1373
|
+
this.checkAllRowsSelected();
|
|
1374
|
+
}
|
|
1375
|
+
stopPropagation($event) {
|
|
1376
|
+
$event.stopPropagation();
|
|
1377
|
+
}
|
|
1378
|
+
isChecked(row) {
|
|
1379
|
+
return this.selectedIds.has(row['id']);
|
|
1380
|
+
}
|
|
1381
|
+
getQueryParams(url) {
|
|
1382
|
+
const urlObj = new URL(url);
|
|
1383
|
+
const params = new URLSearchParams(urlObj.search);
|
|
1384
|
+
const paramsObj = {};
|
|
1385
|
+
params.forEach((value, key) => {
|
|
1386
|
+
// Check if the parameter already exists (for handling multiple values)
|
|
1387
|
+
if (paramsObj.hasOwnProperty(key)) {
|
|
1388
|
+
// If it's not already an array, convert it to an array
|
|
1389
|
+
if (!Array.isArray(paramsObj[key])) {
|
|
1390
|
+
paramsObj[key] = [paramsObj[key]]; // Cast as string because we know it's not an array here
|
|
1391
|
+
}
|
|
1392
|
+
// Push the new value to the existing array
|
|
1393
|
+
paramsObj[key].push(value); // Cast as string[] to use array methods
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
// Assign the value to the key in the object
|
|
1397
|
+
paramsObj[key] = value;
|
|
1398
|
+
}
|
|
1399
|
+
});
|
|
1400
|
+
return paramsObj;
|
|
1401
|
+
}
|
|
1402
|
+
isStickyStart(columnName) {
|
|
1403
|
+
const index = this.displayedColumns.indexOf(columnName);
|
|
1404
|
+
return index !== -1 && index < this.startStickyColumnCount;
|
|
1405
|
+
}
|
|
1406
|
+
isStickyEnd(columnName) {
|
|
1407
|
+
const index = this.displayedColumns.indexOf(columnName);
|
|
1408
|
+
if (index === -1)
|
|
1409
|
+
return false;
|
|
1410
|
+
return index >= this.displayedColumns.length - this.endStickyColumnCount;
|
|
1411
|
+
}
|
|
1412
|
+
getColumnClasses(column) {
|
|
1413
|
+
// Check if alignment is explicitly specified
|
|
1414
|
+
if (column.align) {
|
|
1415
|
+
return {
|
|
1416
|
+
'text-right': column.align === 'right',
|
|
1417
|
+
'text-left': column.align === 'left',
|
|
1418
|
+
'text-center': column.align === 'center'
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
else {
|
|
1422
|
+
// Default alignment based on column type
|
|
1423
|
+
switch (column.type) {
|
|
1424
|
+
case 'money':
|
|
1425
|
+
case 'quantity':
|
|
1426
|
+
return { 'text-right': true };
|
|
1427
|
+
case 'number':
|
|
1428
|
+
return { 'text-center': true };
|
|
1429
|
+
default:
|
|
1430
|
+
return {};
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
getRowBackground(row) {
|
|
1435
|
+
return this.rowsConfig.backgroundApplyFunction
|
|
1436
|
+
? this.rowsConfig.backgroundApplyFunction(row)
|
|
1437
|
+
: null;
|
|
1438
|
+
}
|
|
1439
|
+
drop(event) {
|
|
1440
|
+
// Ignore if the item was dropped at the same index
|
|
1441
|
+
if (event.previousIndex === event.currentIndex) {
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
// Access current data from apiSubject
|
|
1445
|
+
const currentData = [...this.dataSource.apiSubject.value];
|
|
1446
|
+
if (!currentData || currentData.length === 0) {
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
// Rearrange items based on the drop event
|
|
1450
|
+
moveItemInArray(currentData, event.previousIndex, event.currentIndex);
|
|
1451
|
+
// Update the apiSubject with reordered data
|
|
1452
|
+
this.dataSource.apiSubject.next(currentData);
|
|
1453
|
+
// We need to emit this also
|
|
1454
|
+
this.listDataSequenceChange.emit(currentData);
|
|
1455
|
+
}
|
|
1456
|
+
handleButtonClick(config) {
|
|
1457
|
+
if (config?.btnClick) {
|
|
1458
|
+
config.btnClick();
|
|
1459
|
+
}
|
|
1460
|
+
else if (config?.btnUrl) {
|
|
1461
|
+
this.goToUrl(config.btnUrl);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
handleSecondButtonClick(config) {
|
|
1465
|
+
if (config?.secondBtnClick) {
|
|
1466
|
+
config.secondBtnClick();
|
|
1467
|
+
}
|
|
1468
|
+
else if (config?.secondBtnUrl) {
|
|
1469
|
+
this.goToUrl(config.secondBtnUrl);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerComponent, deps: [{ token: i1$1.MatDialog }, { token: ApiService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }, { token: i4.Location }, { token: i5.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
1473
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: TisSmartTableViewerComponent, isStandalone: false, selector: "tis-smart-table-viewer", inputs: { columnCustomizationUrlConfig: "columnCustomizationUrlConfig", t: "t", componentName: "componentName", mainTitle: "mainTitle", searchPlaceholder: "searchPlaceholder", breadcrumbs: "breadcrumbs", hideHeader: "hideHeader", hideTableHeader: "hideTableHeader", hidePaginator: "hidePaginator", keepFilterInUrl: "keepFilterInUrl", displayColumnsSelectionButton: "displayColumnsSelectionButton", loadDataApiBaseUrl: "loadDataApiBaseUrl", startStickyColumnCount: "startStickyColumnCount", endStickyColumnCount: "endStickyColumnCount", loaderPosition: "loaderPosition", dataNotFoundConfig: "dataNotFoundConfig", showFilterButtonSection: "showFilterButtonSection", columnsCodeMapping: "columnsCodeMapping", defaultDisplayedColumns: "defaultDisplayedColumns", defaultSortObj: "defaultSortObj", loadingSpinnerDiameter: "loadingSpinnerDiameter", pageSizeOptions: "pageSizeOptions", pageSize: "pageSize", useGlobalPageSize: "useGlobalPageSize", pageIndex: "pageIndex", filterFormGroup: "filterFormGroup", rowsConfig: "rowsConfig", enableRowsSelection: "enableRowsSelection", enableAllRowsSelection: "enableAllRowsSelection", onlySingleSelection: "onlySingleSelection", selectedRows: "selectedRows", enableDragNDrop: "enableDragNDrop" }, outputs: { displayedColumnsChange: "displayedColumnsChange", sortObjChange: "sortObjChange", pageSizeChange: "pageSizeChange", pageIndexChange: "pageIndexChange", selectedRowsChange: "selectedRowsChange", listDataSequenceChange: "listDataSequenceChange" }, providers: [CdkColumnDef], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<section [class.tis-page]=\"!hideHeader\">\n <div class=\"tis-page-header\" *ngIf=\"!hideHeader\">\n <nav aria-label=\"tis-breadcrumb\">\n <ol class=\"tis-breadcrumb\">\n <li class=\"tis-breadcrumb-item\"><a href=\"javascript:;\" [routerLink]=\"homeUrl\">{{t('home')}}</a></li>\n @for(breadcrumb of breadcrumbs; track breadcrumb) {\n <li class=\"tis-breadcrumb-item\" *ngIf=\"breadcrumb?.url\">\n <a href=\"javascript:;\" (click)=\"goToUrl(breadcrumb.url)\">{{breadcrumb?.name}}</a>\n </li>\n }\n <li class=\"tis-breadcrumb-item active\">\n {{mainTitle}}\n </li>\n </ol>\n </nav>\n <ng-content select=\"[slot='top-buttons-section']\"></ng-content>\n </div>\n <h1 class=\"tis-page-title\" *ngIf=\"!hideHeader\">{{mainTitle}}</h1>\n <div class=\"tis-page-body\">\n <div class=\"tis-page-body-content\">\n\n @if(initialLoading){\n <div class=\"tis-d-flex tis-justify-content-center pb-2 pt-7\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"60\"></mat-progress-spinner>\n </div>\n } @else {\n\n @if ((dataSource?.totalDataLength$ | async) || (dataSource?.loading$ | async) || search ||\n filterHasNonEmptyValue || showFilterButtonSection) {\n <div class=\"tis-table-container\">\n @if(!hideTableHeader){\n <div class=\"tis-table-container-header\">\n <ul class=\"tis-inline-group\">\n <li class=\"tis-inline-group-item\">\n <tis-columns-btn [columnCustomizationUrlConfig]=\"columnCustomizationUrlConfig\" [t]=\"t\"\n [componentName]=\"componentName\" [defaultColumns]=\"defaultColumns\" [columns]=\"columns\"\n (displayedColumnsChange)=\"onChangeDisplayColumns($event)\"\n (fromStartColumnNumberChange)=\"onChangeFromStartColumnNumber($event)\"\n (fromEndColumnNumberChange)=\"onChangeFromEndColumnNumber($event)\"></tis-columns-btn>\n </li>\n <ng-content select=\"[slot='filter-button-section']\"></ng-content>\n </ul>\n <div class=\"flex items-center\">\n <ul class=\"tis-inline-group\">\n <ng-content select=\"[slot='filter-right-button-section']\"></ng-content>\n </ul>\n @if(!isMobile && searchPlaceholder && searchPlaceholder != ''){\n <mat-form-field\n class=\"custom-mat-form-field-mb-0 search-mat-form-field ml-3 tis-table-search-field\"\n appearance=\"outline\">\n <span class=\"material-icons\" matPrefix>search</span>\n <input matInput [formControl]=\"searchCtrl\" [placeholder]=\"searchPlaceholder\">\n <span class=\"material-icons mr-2 tis-curser-pointer\" matSuffix\n (click)=\"searchCtrl.setValue('')\"\n *ngIf=\"searchCtrl.value && searchCtrl.value != ''\">close</span>\n </mat-form-field>\n }\n </div>\n </div>\n }\n\n @if (filterFormGroup) {\n\n <ng-content select=\"[slot='filter-form-section']\"></ng-content>\n\n @if(finalSelectedFilterValuesToDisplay.length && filterApplied) {\n <div class=\"flex gap-3 mb-3 filter-applied-section md-hide-scrollbar\">\n @for(v of finalSelectedFilterValuesToDisplay; track v) {\n @if (v) {\n <span class=\"tis-filter-badge\" style=\"white-space: nowrap;\">\n @if(v.labelKey && v.labelKey != '' && (v.valueKey || v.value)) {\n <span class=\"font-semibold\"> {{v.labelKey }} </span>\n }\n @if(v.valueKey) {\n {{v.valueKey }}\n } @else {\n {{v.value }}\n }\n <span class=\"material-icons tis-curser-pointer\"\n (click)=\"removeParticularFilter(v)\">cancel</span>\n </span>\n }\n }\n </div>\n }\n }\n\n @if(isMobile && searchPlaceholder && searchPlaceholder != ''){\n <mat-form-field\n class=\"custom-mat-form-field-mb-0 search-mat-form-field mb-3 tis-table-search-field\"\n appearance=\"outline\">\n <span class=\"material-icons\" matPrefix>search</span>\n <input matInput [formControl]=\"searchCtrl\" [placeholder]=\"searchPlaceholder\">\n <span class=\"material-icons mr-2 tis-curser-pointer\" matSuffix\n (click)=\"searchCtrl.setValue('')\"\n *ngIf=\"searchCtrl.value && searchCtrl.value != ''\">close</span>\n </mat-form-field>\n }\n\n \n @if(loaderPosition == 'top'){\n @if(dataSource?.loading$ | async){\n <div class=\"tis-d-flex tis-justify-content-center py-2\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"loadingSpinnerDiameter\"></mat-progress-spinner>\n </div>\n }\n }\n <div class=\"tis-table-container-body\">\n <div class=\"tis-table-wrapper\" [appScrolling]=\"true\">\n\n <!--Table Here-->\n <table mat-table matSort [dataSource]=\"dataSource\" class=\"tis-table\" cdkDropList (cdkDropListDropped)=\"drop($event)\" [cdkDropListLockAxis]=\"'y'\">\n\n @if (enableRowsSelection) {\n <ng-container matColumnDef=\"Select\">\n <th mat-header-cell *matHeaderCellDef>\n @if (enableAllRowsSelection) {\n <mat-checkbox color=\"primary\" (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"isAllRowsSelected\"\n [indeterminate]=\"selection.hasValue() && !isAllRowsSelected\">\n </mat-checkbox>\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox color=\"primary\" (click)=\"stopPropagation($event)\" (change)=\"$event ? toggleSelection($event, row) : null\" [checked]=\"isChecked(row)\"></mat-checkbox>\n </td>\n </ng-container>\n }\n\n @for(column of autoRenderColumns; track column.serverKeyCode; let i = $index; let l = $last){\n <!-- [sticky]=\"i < startStickyColumnCount\" [stickyEnd]=\"i > (autoRenderColumns?.length - endStickyColumnCount)\" -->\n <ng-container [matColumnDef]=\"column.name\" [sticky]=\"isStickyStart(column.name)\" [stickyEnd]=\"isStickyEnd(column.name)\">\n @if(column.sort) {\n <th mat-header-cell mat-sort-header *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n }\n \n\n @if(column.type == 'date'){\n <td mat-cell *matCellDef=\"let element\" class=\"1al-{{column.align}} 1ty-{{column.type}}\" >\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDate) : ''}}\n </p>\n </td>\n } @else if(column.type == 'date-time'){\n <td mat-cell *matCellDef=\"let element\" class=\"2al-{{column.align}} 2ty-{{column.type}}\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDateTime) : ''}}\n </p>\n </td>\n } @else if(column.type == 'date-time-with-seconds'){\n <td mat-cell *matCellDef=\"let element\" class=\"2al-{{column.align}} 2ty-{{column.type}}\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDateTimeWithSeconds) : ''}}\n </p>\n </td>\n } @else {\n <td mat-cell *matCellDef=\"let element\" class=\"3al-{{column.align}} 3ty-{{column.type}}\" [ngClass]=\"getColumnClasses(column)\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n @if (column.type == 'quantity') {\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | number : '1.4-4') : '-' }}\n } @else if (column.type == 'money') {\n {{ column.valueKey && (getNestedValue(element, column.valueKey)).toFixed(2) }}\n } @else {\n {{ column.valueKey && getNestedValue(element, column.valueKey) }}\n }\n </p>\n </td>\n }\n </ng-container>\n\n }\n\n\n @for(column of templateRenderColumns; track column.serverKeyCode; let i = $index; let l = $last){\n <!-- [sticky]=\"i < startStickyColumnCount\" [stickyEnd]=\"l\" -->\n <ng-container [matColumnDef]=\"column.name\" [sticky]=\"isStickyStart(column.name)\" [stickyEnd]=\"isStickyEnd(column.name)\">\n @if(column.sort) {\n <th mat-header-cell *matHeaderCellDef mat-sort-header [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n }\n <td mat-cell *matCellDef=\"let element\" class=\"4al-{{column.align}} 4ty-{{column.type}}\" [ngClass]=\"getColumnClasses(column)\">\n <ng-container *ngIf=\"column.template as template\">\n <ng-container *ngTemplateOutlet=\"template; context: { colDef: column, colData: element }\"></ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n\n <!--Drag Column Def Start-->\n <ng-container [matColumnDef]=\"'drag'\" >\n <th mat-header-cell *matHeaderCellDef>\n --\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"5al-drag 5ty-drag\">\n <mat-icon cdkDragHandle class=\"tis-curser-pointer\" style=\"color: rgba(0, 0, 0, 0.54); font-size: 19px; width: 19px; height: 19px;\">drag_indicator</mat-icon>\n </td>\n </ng-container>\n <!--Drag Column Def End-->\n\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell\" [attr.colspan]=\"displayedColumns.length\">\n <div class=\"tis-data-not-found\">\n <img src=\"/assets/icons/not-found.svg\" alt=\"not-found\" class=\"w-53\">\n <h5 class=\"tis-h5\">{{dataNotFoundConfig.title}}</h5>\n </div>\n </td>\n </tr>\n\n <!-- Apply Drag and Drop to tbody -->\n @if(enableDragNDrop) {\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\" [ngStyle]=\"{'background-color': getRowBackground(row) || 'inherit'}\" cdkDrag></tr>\n }\n\n @if(!enableDragNDrop) {\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\" [ngStyle]=\"{'background-color': getRowBackground(row) || 'inherit'}\"></tr>\n } \n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n </table>\n <!--Table End-->\n\n </div>\n @if(loaderPosition == 'bottom'){\n @if(dataSource?.loading$ | async){\n <div class=\"tis-d-flex tis-justify-content-center py-2\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"loadingSpinnerDiameter\"></mat-progress-spinner>\n </div>\n }\n }\n @if (!hidePaginator) {\n <div class=\"tis-table-paginator\">\n <mat-paginator [length]=\"dataSource?.totalDataLength?.value\" [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons></mat-paginator>\n </div>\n }\n </div>\n </div>\n } @else {\n\n @if(dataNotFoundConfig) {\n <div class=\"tis-data-not-found\">\n <img src=\"/assets/icons/not-found.svg\" alt=\"not-found\" class=\"w-53\">\n <h5 class=\"tis-h5\">{{dataNotFoundConfig.title}}</h5>\n <p class=\"tis-p\">{{dataNotFoundConfig.desc}}</p>\n @if((dataNotFoundConfig.btnUrl || dataNotFoundConfig?.btnClick) && dataNotFoundConfig.btnText) {\n <button mat-flat-button color=\"primary\" class=\"tis-text-upper\"\n (click)=\"handleButtonClick(dataNotFoundConfig)\">\n <mat-icon>add</mat-icon>\n {{dataNotFoundConfig.btnText}}\n </button>\n }\n @if((dataNotFoundConfig.secondBtnUrl || dataNotFoundConfig?.secondBtnClick) && dataNotFoundConfig.secondBtnText) {\n <button mat-stroked-button color=\"primary\" class=\"tis-text-upper\"\n (click)=\"handleSecondButtonClick(dataNotFoundConfig)\">\n <mat-icon>add</mat-icon>\n {{dataNotFoundConfig.secondBtnText}}\n </button>\n }\n </div>\n }\n\n }\n\n }\n\n </div>\n </div>\n</section>", styles: ["::ng-deep .sub-main-content{border:0px solid #f00;margin-top:56px;height:calc(100% - 56px);padding:15px;overflow:auto}.header-title{margin-top:8px;padding:7px 10px;color:#969a9c}.header-title h3{font-size:20px!important;font-weight:700}.header-menu{border:0px solid red;background:#fff;margin-top:1px;margin-bottom:0}.w-100{width:100%}.mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e087}.mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e087}.search-mat-form-field{width:100%}.filter-applied-section{overflow:auto}@media (max-width: 575.98px){.search-mat-form-field{width:100%!important}}@media (min-width: 576px) and (max-width: 767.98px){.search-mat-form-field{width:100%!important}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i8.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i4$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i12$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: i13$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i13$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i13$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i13$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i13$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i13$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i13$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i13$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i13$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i13$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i13$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "component", type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i13.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i13.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i13.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: ScrollingDirective, selector: "[appScrolling]", inputs: ["appScrolling"] }, { kind: "component", type: TisColumnsBtnComponent, selector: "tis-columns-btn", inputs: ["columnCustomizationUrlConfig", "t", "componentName", "defaultColumns", "columns", "skipTranslation", "customColumns"], outputs: ["displayedColumnsChange", "fromStartColumnNumberChange", "fromEndColumnNumberChange"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.DecimalPipe, name: "number" }, { kind: "pipe", type: TisDatePipe, name: "tisDate" }, { kind: "pipe", type: TisDateTimePipe, name: "tisDateTime" }, { kind: "pipe", type: TisDateTimeWithSecondsPipe, name: "tisDateTimeWithSeconds" }] });
|
|
1474
|
+
}
|
|
1475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerComponent, decorators: [{
|
|
1476
|
+
type: Component,
|
|
1477
|
+
args: [{ selector: 'tis-smart-table-viewer', standalone: false, providers: [CdkColumnDef], template: "<section [class.tis-page]=\"!hideHeader\">\n <div class=\"tis-page-header\" *ngIf=\"!hideHeader\">\n <nav aria-label=\"tis-breadcrumb\">\n <ol class=\"tis-breadcrumb\">\n <li class=\"tis-breadcrumb-item\"><a href=\"javascript:;\" [routerLink]=\"homeUrl\">{{t('home')}}</a></li>\n @for(breadcrumb of breadcrumbs; track breadcrumb) {\n <li class=\"tis-breadcrumb-item\" *ngIf=\"breadcrumb?.url\">\n <a href=\"javascript:;\" (click)=\"goToUrl(breadcrumb.url)\">{{breadcrumb?.name}}</a>\n </li>\n }\n <li class=\"tis-breadcrumb-item active\">\n {{mainTitle}}\n </li>\n </ol>\n </nav>\n <ng-content select=\"[slot='top-buttons-section']\"></ng-content>\n </div>\n <h1 class=\"tis-page-title\" *ngIf=\"!hideHeader\">{{mainTitle}}</h1>\n <div class=\"tis-page-body\">\n <div class=\"tis-page-body-content\">\n\n @if(initialLoading){\n <div class=\"tis-d-flex tis-justify-content-center pb-2 pt-7\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"60\"></mat-progress-spinner>\n </div>\n } @else {\n\n @if ((dataSource?.totalDataLength$ | async) || (dataSource?.loading$ | async) || search ||\n filterHasNonEmptyValue || showFilterButtonSection) {\n <div class=\"tis-table-container\">\n @if(!hideTableHeader){\n <div class=\"tis-table-container-header\">\n <ul class=\"tis-inline-group\">\n <li class=\"tis-inline-group-item\">\n <tis-columns-btn [columnCustomizationUrlConfig]=\"columnCustomizationUrlConfig\" [t]=\"t\"\n [componentName]=\"componentName\" [defaultColumns]=\"defaultColumns\" [columns]=\"columns\"\n (displayedColumnsChange)=\"onChangeDisplayColumns($event)\"\n (fromStartColumnNumberChange)=\"onChangeFromStartColumnNumber($event)\"\n (fromEndColumnNumberChange)=\"onChangeFromEndColumnNumber($event)\"></tis-columns-btn>\n </li>\n <ng-content select=\"[slot='filter-button-section']\"></ng-content>\n </ul>\n <div class=\"flex items-center\">\n <ul class=\"tis-inline-group\">\n <ng-content select=\"[slot='filter-right-button-section']\"></ng-content>\n </ul>\n @if(!isMobile && searchPlaceholder && searchPlaceholder != ''){\n <mat-form-field\n class=\"custom-mat-form-field-mb-0 search-mat-form-field ml-3 tis-table-search-field\"\n appearance=\"outline\">\n <span class=\"material-icons\" matPrefix>search</span>\n <input matInput [formControl]=\"searchCtrl\" [placeholder]=\"searchPlaceholder\">\n <span class=\"material-icons mr-2 tis-curser-pointer\" matSuffix\n (click)=\"searchCtrl.setValue('')\"\n *ngIf=\"searchCtrl.value && searchCtrl.value != ''\">close</span>\n </mat-form-field>\n }\n </div>\n </div>\n }\n\n @if (filterFormGroup) {\n\n <ng-content select=\"[slot='filter-form-section']\"></ng-content>\n\n @if(finalSelectedFilterValuesToDisplay.length && filterApplied) {\n <div class=\"flex gap-3 mb-3 filter-applied-section md-hide-scrollbar\">\n @for(v of finalSelectedFilterValuesToDisplay; track v) {\n @if (v) {\n <span class=\"tis-filter-badge\" style=\"white-space: nowrap;\">\n @if(v.labelKey && v.labelKey != '' && (v.valueKey || v.value)) {\n <span class=\"font-semibold\"> {{v.labelKey }} </span>\n }\n @if(v.valueKey) {\n {{v.valueKey }}\n } @else {\n {{v.value }}\n }\n <span class=\"material-icons tis-curser-pointer\"\n (click)=\"removeParticularFilter(v)\">cancel</span>\n </span>\n }\n }\n </div>\n }\n }\n\n @if(isMobile && searchPlaceholder && searchPlaceholder != ''){\n <mat-form-field\n class=\"custom-mat-form-field-mb-0 search-mat-form-field mb-3 tis-table-search-field\"\n appearance=\"outline\">\n <span class=\"material-icons\" matPrefix>search</span>\n <input matInput [formControl]=\"searchCtrl\" [placeholder]=\"searchPlaceholder\">\n <span class=\"material-icons mr-2 tis-curser-pointer\" matSuffix\n (click)=\"searchCtrl.setValue('')\"\n *ngIf=\"searchCtrl.value && searchCtrl.value != ''\">close</span>\n </mat-form-field>\n }\n\n \n @if(loaderPosition == 'top'){\n @if(dataSource?.loading$ | async){\n <div class=\"tis-d-flex tis-justify-content-center py-2\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"loadingSpinnerDiameter\"></mat-progress-spinner>\n </div>\n }\n }\n <div class=\"tis-table-container-body\">\n <div class=\"tis-table-wrapper\" [appScrolling]=\"true\">\n\n <!--Table Here-->\n <table mat-table matSort [dataSource]=\"dataSource\" class=\"tis-table\" cdkDropList (cdkDropListDropped)=\"drop($event)\" [cdkDropListLockAxis]=\"'y'\">\n\n @if (enableRowsSelection) {\n <ng-container matColumnDef=\"Select\">\n <th mat-header-cell *matHeaderCellDef>\n @if (enableAllRowsSelection) {\n <mat-checkbox color=\"primary\" (change)=\"$event ? toggleAllRows() : null\"\n [checked]=\"isAllRowsSelected\"\n [indeterminate]=\"selection.hasValue() && !isAllRowsSelected\">\n </mat-checkbox>\n }\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <mat-checkbox color=\"primary\" (click)=\"stopPropagation($event)\" (change)=\"$event ? toggleSelection($event, row) : null\" [checked]=\"isChecked(row)\"></mat-checkbox>\n </td>\n </ng-container>\n }\n\n @for(column of autoRenderColumns; track column.serverKeyCode; let i = $index; let l = $last){\n <!-- [sticky]=\"i < startStickyColumnCount\" [stickyEnd]=\"i > (autoRenderColumns?.length - endStickyColumnCount)\" -->\n <ng-container [matColumnDef]=\"column.name\" [sticky]=\"isStickyStart(column.name)\" [stickyEnd]=\"isStickyEnd(column.name)\">\n @if(column.sort) {\n <th mat-header-cell mat-sort-header *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n }\n \n\n @if(column.type == 'date'){\n <td mat-cell *matCellDef=\"let element\" class=\"1al-{{column.align}} 1ty-{{column.type}}\" >\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDate) : ''}}\n </p>\n </td>\n } @else if(column.type == 'date-time'){\n <td mat-cell *matCellDef=\"let element\" class=\"2al-{{column.align}} 2ty-{{column.type}}\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDateTime) : ''}}\n </p>\n </td>\n } @else if(column.type == 'date-time-with-seconds'){\n <td mat-cell *matCellDef=\"let element\" class=\"2al-{{column.align}} 2ty-{{column.type}}\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | tisDateTimeWithSeconds) : ''}}\n </p>\n </td>\n } @else {\n <td mat-cell *matCellDef=\"let element\" class=\"3al-{{column.align}} 3ty-{{column.type}}\" [ngClass]=\"getColumnClasses(column)\">\n <p [class.tis-a]=\"column.clickFn\" (click)=\"column?.clickFn?.(element, $event)\">\n @if (column.type == 'quantity') {\n {{ (column.valueKey && element[column.valueKey]) ? (getNestedValue(element, column.valueKey) | number : '1.4-4') : '-' }}\n } @else if (column.type == 'money') {\n {{ column.valueKey && (getNestedValue(element, column.valueKey)).toFixed(2) }}\n } @else {\n {{ column.valueKey && getNestedValue(element, column.valueKey) }}\n }\n </p>\n </td>\n }\n </ng-container>\n\n }\n\n\n @for(column of templateRenderColumns; track column.serverKeyCode; let i = $index; let l = $last){\n <!-- [sticky]=\"i < startStickyColumnCount\" [stickyEnd]=\"l\" -->\n <ng-container [matColumnDef]=\"column.name\" [sticky]=\"isStickyStart(column.name)\" [stickyEnd]=\"isStickyEnd(column.name)\">\n @if(column.sort) {\n <th mat-header-cell *matHeaderCellDef mat-sort-header [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n } @else {\n <th mat-header-cell *matHeaderCellDef [ngClass]=\"getColumnClasses(column)\">\n {{ t(column.name) }}\n </th>\n }\n <td mat-cell *matCellDef=\"let element\" class=\"4al-{{column.align}} 4ty-{{column.type}}\" [ngClass]=\"getColumnClasses(column)\">\n <ng-container *ngIf=\"column.template as template\">\n <ng-container *ngTemplateOutlet=\"template; context: { colDef: column, colData: element }\"></ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n\n <!--Drag Column Def Start-->\n <ng-container [matColumnDef]=\"'drag'\" >\n <th mat-header-cell *matHeaderCellDef>\n --\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"5al-drag 5ty-drag\">\n <mat-icon cdkDragHandle class=\"tis-curser-pointer\" style=\"color: rgba(0, 0, 0, 0.54); font-size: 19px; width: 19px; height: 19px;\">drag_indicator</mat-icon>\n </td>\n </ng-container>\n <!--Drag Column Def End-->\n\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell\" [attr.colspan]=\"displayedColumns.length\">\n <div class=\"tis-data-not-found\">\n <img src=\"/assets/icons/not-found.svg\" alt=\"not-found\" class=\"w-53\">\n <h5 class=\"tis-h5\">{{dataNotFoundConfig.title}}</h5>\n </div>\n </td>\n </tr>\n\n <!-- Apply Drag and Drop to tbody -->\n @if(enableDragNDrop) {\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\" [ngStyle]=\"{'background-color': getRowBackground(row) || 'inherit'}\" cdkDrag></tr>\n }\n\n @if(!enableDragNDrop) {\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\" [ngStyle]=\"{'background-color': getRowBackground(row) || 'inherit'}\"></tr>\n } \n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n </table>\n <!--Table End-->\n\n </div>\n @if(loaderPosition == 'bottom'){\n @if(dataSource?.loading$ | async){\n <div class=\"tis-d-flex tis-justify-content-center py-2\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\" [diameter]=\"loadingSpinnerDiameter\"></mat-progress-spinner>\n </div>\n }\n }\n @if (!hidePaginator) {\n <div class=\"tis-table-paginator\">\n <mat-paginator [length]=\"dataSource?.totalDataLength?.value\" [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\" showFirstLastButtons></mat-paginator>\n </div>\n }\n </div>\n </div>\n } @else {\n\n @if(dataNotFoundConfig) {\n <div class=\"tis-data-not-found\">\n <img src=\"/assets/icons/not-found.svg\" alt=\"not-found\" class=\"w-53\">\n <h5 class=\"tis-h5\">{{dataNotFoundConfig.title}}</h5>\n <p class=\"tis-p\">{{dataNotFoundConfig.desc}}</p>\n @if((dataNotFoundConfig.btnUrl || dataNotFoundConfig?.btnClick) && dataNotFoundConfig.btnText) {\n <button mat-flat-button color=\"primary\" class=\"tis-text-upper\"\n (click)=\"handleButtonClick(dataNotFoundConfig)\">\n <mat-icon>add</mat-icon>\n {{dataNotFoundConfig.btnText}}\n </button>\n }\n @if((dataNotFoundConfig.secondBtnUrl || dataNotFoundConfig?.secondBtnClick) && dataNotFoundConfig.secondBtnText) {\n <button mat-stroked-button color=\"primary\" class=\"tis-text-upper\"\n (click)=\"handleSecondButtonClick(dataNotFoundConfig)\">\n <mat-icon>add</mat-icon>\n {{dataNotFoundConfig.secondBtnText}}\n </button>\n }\n </div>\n }\n\n }\n\n }\n\n </div>\n </div>\n</section>", styles: ["::ng-deep .sub-main-content{border:0px solid #f00;margin-top:56px;height:calc(100% - 56px);padding:15px;overflow:auto}.header-title{margin-top:8px;padding:7px 10px;color:#969a9c}.header-title h3{font-size:20px!important;font-weight:700}.header-menu{border:0px solid red;background:#fff;margin-top:1px;margin-bottom:0}.w-100{width:100%}.mat-mdc-table-sticky-border-elem-right{border-left:1px solid #e0e0e087}.mat-mdc-table-sticky-border-elem-left{border-right:1px solid #e0e0e087}.search-mat-form-field{width:100%}.filter-applied-section{overflow:auto}@media (max-width: 575.98px){.search-mat-form-field{width:100%!important}}@media (min-width: 576px) and (max-width: 767.98px){.search-mat-form-field{width:100%!important}}\n"] }]
|
|
1478
|
+
}], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: ApiService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }, { type: i4.Location }, { type: i5.BreakpointObserver }], propDecorators: { columnCustomizationUrlConfig: [{
|
|
1479
|
+
type: Input,
|
|
1480
|
+
args: [{ required: true }]
|
|
1481
|
+
}], t: [{
|
|
1482
|
+
type: Input,
|
|
1483
|
+
args: [{ required: true }]
|
|
1484
|
+
}], componentName: [{
|
|
1485
|
+
type: Input,
|
|
1486
|
+
args: [{ required: true }]
|
|
1487
|
+
}], mainTitle: [{
|
|
1488
|
+
type: Input,
|
|
1489
|
+
args: [{ required: true }]
|
|
1490
|
+
}], searchPlaceholder: [{
|
|
1491
|
+
type: Input
|
|
1492
|
+
}], breadcrumbs: [{
|
|
1493
|
+
type: Input
|
|
1494
|
+
}], hideHeader: [{
|
|
1495
|
+
type: Input
|
|
1496
|
+
}], hideTableHeader: [{
|
|
1497
|
+
type: Input
|
|
1498
|
+
}], hidePaginator: [{
|
|
1499
|
+
type: Input
|
|
1500
|
+
}], keepFilterInUrl: [{
|
|
1501
|
+
type: Input
|
|
1502
|
+
}], displayColumnsSelectionButton: [{
|
|
1503
|
+
type: Input
|
|
1504
|
+
}], loadDataApiBaseUrl: [{
|
|
1505
|
+
type: Input
|
|
1506
|
+
}], startStickyColumnCount: [{
|
|
1507
|
+
type: Input
|
|
1508
|
+
}], endStickyColumnCount: [{
|
|
1509
|
+
type: Input
|
|
1510
|
+
}], loaderPosition: [{
|
|
1511
|
+
type: Input
|
|
1512
|
+
}], dataNotFoundConfig: [{
|
|
1513
|
+
type: Input,
|
|
1514
|
+
args: [{ required: true }]
|
|
1515
|
+
}], showFilterButtonSection: [{
|
|
1516
|
+
type: Input
|
|
1517
|
+
}], columnsCodeMapping: [{
|
|
1518
|
+
type: Input,
|
|
1519
|
+
args: [{ required: true }]
|
|
1520
|
+
}], defaultDisplayedColumns: [{
|
|
1521
|
+
type: Input
|
|
1522
|
+
}], displayedColumnsChange: [{
|
|
1523
|
+
type: Output
|
|
1524
|
+
}], defaultSortObj: [{
|
|
1525
|
+
type: Input
|
|
1526
|
+
}], sortObjChange: [{
|
|
1527
|
+
type: Output
|
|
1528
|
+
}], loadingSpinnerDiameter: [{
|
|
1529
|
+
type: Input
|
|
1530
|
+
}], pageSizeOptions: [{
|
|
1531
|
+
type: Input
|
|
1532
|
+
}], pageSize: [{
|
|
1533
|
+
type: Input
|
|
1534
|
+
}], pageSizeChange: [{
|
|
1535
|
+
type: Output
|
|
1536
|
+
}], useGlobalPageSize: [{
|
|
1537
|
+
type: Input
|
|
1538
|
+
}], pageIndex: [{
|
|
1539
|
+
type: Input
|
|
1540
|
+
}], pageIndexChange: [{
|
|
1541
|
+
type: Output
|
|
1542
|
+
}], filterFormGroup: [{
|
|
1543
|
+
type: Input
|
|
1544
|
+
}], rowsConfig: [{
|
|
1545
|
+
type: Input
|
|
1546
|
+
}], sort: [{
|
|
1547
|
+
type: ViewChild,
|
|
1548
|
+
args: [MatSort]
|
|
1549
|
+
}], paginator: [{
|
|
1550
|
+
type: ViewChild,
|
|
1551
|
+
args: [MatPaginator]
|
|
1552
|
+
}], enableRowsSelection: [{
|
|
1553
|
+
type: Input
|
|
1554
|
+
}], enableAllRowsSelection: [{
|
|
1555
|
+
type: Input
|
|
1556
|
+
}], onlySingleSelection: [{
|
|
1557
|
+
type: Input
|
|
1558
|
+
}], selectedRows: [{
|
|
1559
|
+
type: Input
|
|
1560
|
+
}], selectedRowsChange: [{
|
|
1561
|
+
type: Output
|
|
1562
|
+
}], enableDragNDrop: [{
|
|
1563
|
+
type: Input
|
|
1564
|
+
}], listDataSequenceChange: [{
|
|
1565
|
+
type: Output
|
|
1566
|
+
}] } });
|
|
1567
|
+
|
|
1568
|
+
class Quantity {
|
|
1569
|
+
decimalPoints = 4;
|
|
1570
|
+
transform(value) {
|
|
1571
|
+
if (Number(value) > 0) {
|
|
1572
|
+
let roundValue = this.roundNumber(Number(value), this.decimalPoints);
|
|
1573
|
+
let roundValueArr = String(roundValue)?.split('.');
|
|
1574
|
+
if (roundValueArr?.length > 1) {
|
|
1575
|
+
let currentDesimal = roundValueArr[1];
|
|
1576
|
+
if (currentDesimal?.length < this.decimalPoints) {
|
|
1577
|
+
roundValue = `${roundValue}`;
|
|
1578
|
+
for (let index = 0; index < (this.decimalPoints - currentDesimal?.length); index++) {
|
|
1579
|
+
roundValue = `${roundValue}0`;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
else {
|
|
1584
|
+
roundValue = `${roundValueArr[0]}.0000`;
|
|
1585
|
+
}
|
|
1586
|
+
return roundValue;
|
|
1587
|
+
}
|
|
1588
|
+
else {
|
|
1589
|
+
return 0;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
roundNumber(number, decimals = 0) {
|
|
1593
|
+
const multiplier = Math.pow(10, decimals);
|
|
1594
|
+
return Math.round(number * multiplier) / multiplier;
|
|
1595
|
+
}
|
|
1596
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Quantity, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1597
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: Quantity, isStandalone: false, name: "qty" });
|
|
1598
|
+
}
|
|
1599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Quantity, decorators: [{
|
|
1600
|
+
type: Pipe,
|
|
1601
|
+
args: [{
|
|
1602
|
+
name: 'qty',
|
|
1603
|
+
standalone: false
|
|
1604
|
+
}]
|
|
1605
|
+
}] });
|
|
1606
|
+
|
|
1607
|
+
class Money {
|
|
1608
|
+
decimalPoints = 4;
|
|
1609
|
+
transform(value) {
|
|
1610
|
+
if (Number(value) > 0) {
|
|
1611
|
+
let roundValue = this.roundNumber(Number(value), this.decimalPoints);
|
|
1612
|
+
let roundValueArr = String(roundValue)?.split('.');
|
|
1613
|
+
if (roundValueArr?.length > 1) {
|
|
1614
|
+
let currentDesimal = roundValueArr[1];
|
|
1615
|
+
if (currentDesimal?.length < this.decimalPoints) {
|
|
1616
|
+
roundValue = `${roundValue}`;
|
|
1617
|
+
for (let index = 0; index < (this.decimalPoints - currentDesimal?.length); index++) {
|
|
1618
|
+
roundValue = `${roundValue}0`;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
else {
|
|
1623
|
+
roundValue = `${roundValueArr[0]}.0000`;
|
|
1624
|
+
}
|
|
1625
|
+
return roundValue;
|
|
1626
|
+
}
|
|
1627
|
+
else {
|
|
1628
|
+
return 0;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
roundNumber(number, decimals = 0) {
|
|
1632
|
+
const multiplier = Math.pow(10, decimals);
|
|
1633
|
+
return Math.round(number * multiplier) / multiplier;
|
|
1634
|
+
}
|
|
1635
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Money, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1636
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: Money, isStandalone: false, name: "money" });
|
|
1637
|
+
}
|
|
1638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Money, decorators: [{
|
|
1639
|
+
type: Pipe,
|
|
1640
|
+
args: [{
|
|
1641
|
+
name: 'money',
|
|
1642
|
+
standalone: false
|
|
1643
|
+
}]
|
|
1644
|
+
}] });
|
|
1645
|
+
|
|
1646
|
+
const directives = [
|
|
1647
|
+
ScrollingDirective
|
|
1648
|
+
];
|
|
1649
|
+
const pipes = [
|
|
1650
|
+
TisDatePipe,
|
|
1651
|
+
TisDateTimePipe,
|
|
1652
|
+
TisDateTimeWithSecondsPipe,
|
|
1653
|
+
Quantity,
|
|
1654
|
+
Money,
|
|
1655
|
+
];
|
|
1656
|
+
const uiImports = [
|
|
1657
|
+
MatTooltipModule,
|
|
1658
|
+
MatIconModule,
|
|
1659
|
+
MatFormFieldModule,
|
|
1660
|
+
MatSelectModule,
|
|
1661
|
+
MatInputModule,
|
|
1662
|
+
MatSnackBarModule,
|
|
1663
|
+
MatProgressSpinnerModule,
|
|
1664
|
+
MatButtonModule,
|
|
1665
|
+
MatPaginatorModule,
|
|
1666
|
+
LayoutModule, // For Breakpoint Observer,
|
|
1667
|
+
MatDialogModule,
|
|
1668
|
+
MatTableModule,
|
|
1669
|
+
MatCheckboxModule,
|
|
1670
|
+
MatMenuModule,
|
|
1671
|
+
MatDividerModule
|
|
1672
|
+
];
|
|
1673
|
+
class TisSmartTableViewerModule {
|
|
1674
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1675
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerModule, declarations: [ScrollingDirective, TisDatePipe,
|
|
1676
|
+
TisDateTimePipe,
|
|
1677
|
+
TisDateTimeWithSecondsPipe,
|
|
1678
|
+
Quantity,
|
|
1679
|
+
Money, TisSmartTableViewerComponent,
|
|
1680
|
+
TisColumnsBtnComponent,
|
|
1681
|
+
CreateColumnsTemplateComponent,
|
|
1682
|
+
TisSmartTableViewerComponent,
|
|
1683
|
+
TisSmartTableErrorDialogComponent,
|
|
1684
|
+
TisSmartTableConfirmationDialogComponent], imports: [CommonModule,
|
|
1685
|
+
FormsModule,
|
|
1686
|
+
ReactiveFormsModule,
|
|
1687
|
+
RouterLink,
|
|
1688
|
+
RouterOutlet, MatTooltipModule,
|
|
1689
|
+
MatIconModule,
|
|
1690
|
+
MatFormFieldModule,
|
|
1691
|
+
MatSelectModule,
|
|
1692
|
+
MatInputModule,
|
|
1693
|
+
MatSnackBarModule,
|
|
1694
|
+
MatProgressSpinnerModule,
|
|
1695
|
+
MatButtonModule,
|
|
1696
|
+
MatPaginatorModule,
|
|
1697
|
+
LayoutModule, // For Breakpoint Observer,
|
|
1698
|
+
MatDialogModule,
|
|
1699
|
+
MatTableModule,
|
|
1700
|
+
MatCheckboxModule,
|
|
1701
|
+
MatMenuModule,
|
|
1702
|
+
MatDividerModule, DragDropModule], exports: [TisSmartTableViewerComponent] });
|
|
1703
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerModule, imports: [CommonModule,
|
|
1704
|
+
FormsModule,
|
|
1705
|
+
ReactiveFormsModule, uiImports, DragDropModule] });
|
|
1706
|
+
}
|
|
1707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisSmartTableViewerModule, decorators: [{
|
|
1708
|
+
type: NgModule,
|
|
1709
|
+
args: [{
|
|
1710
|
+
declarations: [
|
|
1711
|
+
...directives,
|
|
1712
|
+
...pipes,
|
|
1713
|
+
TisSmartTableViewerComponent,
|
|
1714
|
+
TisColumnsBtnComponent,
|
|
1715
|
+
CreateColumnsTemplateComponent,
|
|
1716
|
+
TisSmartTableViewerComponent,
|
|
1717
|
+
TisSmartTableErrorDialogComponent,
|
|
1718
|
+
TisSmartTableConfirmationDialogComponent
|
|
1719
|
+
],
|
|
1720
|
+
imports: [
|
|
1721
|
+
CommonModule,
|
|
1722
|
+
FormsModule,
|
|
1723
|
+
ReactiveFormsModule,
|
|
1724
|
+
RouterLink,
|
|
1725
|
+
RouterOutlet,
|
|
1726
|
+
...uiImports,
|
|
1727
|
+
DragDropModule
|
|
1728
|
+
],
|
|
1729
|
+
exports: [
|
|
1730
|
+
TisSmartTableViewerComponent
|
|
1731
|
+
]
|
|
1732
|
+
}]
|
|
1733
|
+
}] });
|
|
1734
|
+
|
|
1735
|
+
/*
|
|
1736
|
+
* Public API Surface of tis-smart-table-viewer
|
|
1737
|
+
*/
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* Generated bundle index. Do not edit.
|
|
1741
|
+
*/
|
|
1742
|
+
|
|
1743
|
+
export { TisSmartTableViewerComponent, TisSmartTableViewerModule, TisSmartTableViewerService };
|
|
1744
|
+
//# sourceMappingURL=servicemind.tis-tis-smart-table-viewer.mjs.map
|