@memberjunction/ng-user-view-grid 0.9.111 → 0.9.120
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/dist/lib/ng-user-view-grid.component.d.ts +115 -113
- package/dist/lib/ng-user-view-grid.component.js +1007 -1000
- package/dist/lib/ng-user-view-grid.module.d.ts +18 -16
- package/dist/lib/ng-user-view-grid.module.js +68 -60
- package/dist/public-api.d.ts +2 -2
- package/dist/public-api.js +5 -5
- package/package.json +15 -13
|
@@ -1,1000 +1,1007 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { Component, ViewChild, ElementRef, Output, EventEmitter, Input } from '@angular/core';
|
|
11
|
-
import { Metadata, RunView, EntityFieldTSType, LogError } from '@memberjunction/core';
|
|
12
|
-
import { ViewInfo } from '@memberjunction/core-entities';
|
|
13
|
-
import { GridComponent } from "@progress/kendo-angular-grid";
|
|
14
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
15
|
-
import { Subject } from 'rxjs';
|
|
16
|
-
import { ExcelExportComponent } from '@progress/kendo-angular-excel-export';
|
|
17
|
-
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
18
|
-
import
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
23
|
-
import * as
|
|
24
|
-
import * as
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
-
import * as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
i0.ɵɵ
|
|
36
|
-
i0.ɵɵ
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
i0.ɵɵ
|
|
41
|
-
|
|
42
|
-
i0.ɵɵ
|
|
43
|
-
i0.ɵɵ
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
i0.ɵɵ
|
|
51
|
-
i0.ɵɵ
|
|
52
|
-
|
|
53
|
-
i0.ɵɵ
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
i0.ɵɵ
|
|
61
|
-
i0.ɵɵ
|
|
62
|
-
|
|
63
|
-
i0.ɵɵ
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
i0.ɵɵ
|
|
68
|
-
i0.ɵɵ
|
|
69
|
-
i0.ɵɵ
|
|
70
|
-
i0.ɵɵ
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
i0.ɵɵ
|
|
78
|
-
i0.ɵɵ
|
|
79
|
-
|
|
80
|
-
i0.ɵɵ
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
i0.ɵɵ
|
|
85
|
-
i0.ɵɵ
|
|
86
|
-
i0.ɵɵ
|
|
87
|
-
i0.ɵɵ
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
i0.ɵɵ
|
|
92
|
-
i0.ɵɵ
|
|
93
|
-
i0.ɵɵ
|
|
94
|
-
i0.ɵɵ
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
i0.ɵɵ
|
|
100
|
-
i0.ɵɵ
|
|
101
|
-
i0.ɵɵ
|
|
102
|
-
i0.ɵɵ
|
|
103
|
-
i0.ɵɵ
|
|
104
|
-
|
|
105
|
-
i0.ɵɵ
|
|
106
|
-
i0.ɵɵ
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
i0.ɵɵ
|
|
112
|
-
|
|
113
|
-
i0.ɵɵ
|
|
114
|
-
i0.ɵɵ
|
|
115
|
-
i0.ɵɵ
|
|
116
|
-
i0.ɵɵ
|
|
117
|
-
i0.ɵɵ
|
|
118
|
-
i0.ɵɵ
|
|
119
|
-
i0.ɵɵ
|
|
120
|
-
i0.ɵɵ
|
|
121
|
-
i0.ɵɵ
|
|
122
|
-
i0.ɵɵ
|
|
123
|
-
i0.ɵɵ
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
i0.ɵɵ
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
i0.ɵɵ
|
|
136
|
-
i0.ɵɵ
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
i0.ɵɵtext(
|
|
140
|
-
i0.ɵɵpipe(
|
|
141
|
-
i0.ɵɵ
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
i0.ɵɵ
|
|
145
|
-
i0.ɵɵ
|
|
146
|
-
i0.ɵɵ
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
i0.ɵɵ
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
i0.ɵɵ
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
i0.ɵɵ
|
|
159
|
-
i0.ɵɵ
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
i0.ɵɵ
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
i0.ɵɵ
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
i0.ɵɵ
|
|
179
|
-
i0.ɵɵ
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
i0.ɵɵ
|
|
186
|
-
i0.ɵɵ
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
i0.ɵɵ
|
|
193
|
-
i0.ɵɵ
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
i0.ɵɵ
|
|
197
|
-
i0.ɵɵelementStart(
|
|
198
|
-
i0.ɵɵlistener("
|
|
199
|
-
i0.ɵɵ
|
|
200
|
-
i0.ɵɵ
|
|
201
|
-
i0.ɵɵ
|
|
202
|
-
i0.ɵɵ
|
|
203
|
-
i0.ɵɵ
|
|
204
|
-
i0.ɵɵ
|
|
205
|
-
|
|
206
|
-
i0.ɵɵ
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
i0.ɵɵ
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
i0.ɵɵ
|
|
215
|
-
i0.ɵɵelementStart(
|
|
216
|
-
i0.ɵɵ
|
|
217
|
-
i0.ɵɵ
|
|
218
|
-
i0.ɵɵ
|
|
219
|
-
i0.ɵɵelementEnd();
|
|
220
|
-
i0.ɵɵ
|
|
221
|
-
i0.ɵɵ
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
i0.ɵɵ
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
i0.ɵɵ
|
|
228
|
-
i0.ɵɵ
|
|
229
|
-
i0.ɵɵ
|
|
230
|
-
i0.ɵɵ
|
|
231
|
-
i0.ɵɵ
|
|
232
|
-
i0.ɵɵ
|
|
233
|
-
i0.ɵɵ
|
|
234
|
-
i0.ɵɵ
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
i0.ɵɵ
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
i0.ɵɵ
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
i0.ɵɵ
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this.
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
this.InEditMode =
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
this.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return { field: c.EntityField.Name, value: this.viewData[i][c.EntityField.Name]
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
this.
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
330
|
-
this.
|
|
331
|
-
this.
|
|
332
|
-
this.
|
|
333
|
-
this.
|
|
334
|
-
this.
|
|
335
|
-
this.
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
345
|
-
this.
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
350
|
-
this.
|
|
351
|
-
this.
|
|
352
|
-
this.
|
|
353
|
-
|
|
354
|
-
this.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
this.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
this.
|
|
363
|
-
this.
|
|
364
|
-
this.
|
|
365
|
-
this.
|
|
366
|
-
this.
|
|
367
|
-
|
|
368
|
-
this.
|
|
369
|
-
this.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
tempGridState
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
//
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
this.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
case EntityFieldTSType.
|
|
563
|
-
return "
|
|
564
|
-
|
|
565
|
-
return "
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
if
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
this._pendingRecords
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
// it
|
|
730
|
-
this.
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
dir =
|
|
768
|
-
else
|
|
769
|
-
dir = '';
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
return col.
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
case
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
// the user clicked
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
this.
|
|
858
|
-
this.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
// the
|
|
864
|
-
this.
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
this
|
|
886
|
-
this.
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
this.
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
this.
|
|
904
|
-
|
|
905
|
-
//
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
i0.ɵɵ
|
|
942
|
-
i0.ɵɵ
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
i0.ɵɵ
|
|
947
|
-
i0.ɵɵ
|
|
948
|
-
i0.ɵɵ
|
|
949
|
-
|
|
950
|
-
i0.ɵɵ
|
|
951
|
-
i0.ɵɵ
|
|
952
|
-
i0.ɵɵtemplate(8,
|
|
953
|
-
i0.ɵɵ
|
|
954
|
-
i0.ɵɵtemplate(
|
|
955
|
-
|
|
956
|
-
i0.ɵɵ
|
|
957
|
-
i0.ɵɵ
|
|
958
|
-
i0.ɵɵ
|
|
959
|
-
i0.ɵɵ
|
|
960
|
-
i0.ɵɵ
|
|
961
|
-
|
|
962
|
-
i0.ɵɵadvance(
|
|
963
|
-
i0.ɵɵproperty("data", ctx.
|
|
964
|
-
i0.ɵɵadvance(
|
|
965
|
-
i0.ɵɵproperty("
|
|
966
|
-
i0.ɵɵadvance(
|
|
967
|
-
i0.ɵɵproperty("
|
|
968
|
-
|
|
969
|
-
(
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
type:
|
|
978
|
-
|
|
979
|
-
type: Input
|
|
980
|
-
}],
|
|
981
|
-
type: Input
|
|
982
|
-
}],
|
|
983
|
-
type:
|
|
984
|
-
}],
|
|
985
|
-
type:
|
|
986
|
-
}],
|
|
987
|
-
type:
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
}],
|
|
993
|
-
type: ViewChild,
|
|
994
|
-
args: ['
|
|
995
|
-
}],
|
|
996
|
-
type: ViewChild,
|
|
997
|
-
args: ['
|
|
998
|
-
}],
|
|
999
|
-
type:
|
|
1000
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Component, ViewChild, ElementRef, Output, EventEmitter, Input } from '@angular/core';
|
|
11
|
+
import { Metadata, RunView, EntityFieldTSType, LogError } from '@memberjunction/core';
|
|
12
|
+
import { ViewInfo } from '@memberjunction/core-entities';
|
|
13
|
+
import { GridComponent } from "@progress/kendo-angular-grid";
|
|
14
|
+
import { Keys } from '@progress/kendo-angular-common';
|
|
15
|
+
import { Subject } from 'rxjs';
|
|
16
|
+
import { ExcelExportComponent } from '@progress/kendo-angular-excel-export';
|
|
17
|
+
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
18
|
+
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
19
|
+
import * as i0 from "@angular/core";
|
|
20
|
+
import * as i1 from "@angular/forms";
|
|
21
|
+
import * as i2 from "@angular/router";
|
|
22
|
+
import * as i3 from "@angular/common";
|
|
23
|
+
import * as i4 from "@progress/kendo-angular-grid";
|
|
24
|
+
import * as i5 from "@progress/kendo-angular-dialog";
|
|
25
|
+
import * as i6 from "@progress/kendo-angular-excel-export";
|
|
26
|
+
import * as i7 from "@progress/kendo-angular-buttons";
|
|
27
|
+
import * as i8 from "@memberjunction/ng-compare-records";
|
|
28
|
+
import * as i9 from "@memberjunction/ng-container-directives";
|
|
29
|
+
import * as i10 from "@progress/kendo-angular-icons";
|
|
30
|
+
import * as i11 from "@progress/kendo-angular-layout";
|
|
31
|
+
const _c0 = ["kendoGrid"];
|
|
32
|
+
const _c1 = ["excelExport"];
|
|
33
|
+
const _c2 = ["recordCompareRef"];
|
|
34
|
+
function UserViewGridComponent_ng_template_5_button_0_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
const _r16 = i0.ɵɵgetCurrentView();
|
|
36
|
+
i0.ɵɵelementStart(0, "button", 16);
|
|
37
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.doExcelExport()); });
|
|
38
|
+
i0.ɵɵelement(1, "kendo-svgicon", 17);
|
|
39
|
+
i0.ɵɵtext(2, " Export to Excel ");
|
|
40
|
+
i0.ɵɵelementEnd();
|
|
41
|
+
} if (rf & 2) {
|
|
42
|
+
const ctx_r7 = i0.ɵɵnextContext(2);
|
|
43
|
+
i0.ɵɵadvance();
|
|
44
|
+
i0.ɵɵproperty("icon", ctx_r7.kendoSVGIcon("fileExcel"));
|
|
45
|
+
} }
|
|
46
|
+
function UserViewGridComponent_ng_template_5_button_1_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
48
|
+
i0.ɵɵelementStart(0, "button", 18);
|
|
49
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r17.enableMergeOrCompare(false, "compare")); });
|
|
50
|
+
i0.ɵɵtext(1, "Compare");
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
52
|
+
} if (rf & 2) {
|
|
53
|
+
const ctx_r8 = i0.ɵɵnextContext(2);
|
|
54
|
+
i0.ɵɵproperty("disabled", ctx_r8.compareMode && ctx_r8.recordsToCompare.length < 2);
|
|
55
|
+
} }
|
|
56
|
+
function UserViewGridComponent_ng_template_5_button_2_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
const _r20 = i0.ɵɵgetCurrentView();
|
|
58
|
+
i0.ɵɵelementStart(0, "button", 18);
|
|
59
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r19.enableMergeOrCompare(false, "compare")); });
|
|
60
|
+
i0.ɵɵtext(1, "Compare");
|
|
61
|
+
i0.ɵɵelementEnd();
|
|
62
|
+
} if (rf & 2) {
|
|
63
|
+
const ctx_r9 = i0.ɵɵnextContext(2);
|
|
64
|
+
i0.ɵɵproperty("disabled", ctx_r9.compareMode && ctx_r9.recordsToCompare.length < 2);
|
|
65
|
+
} }
|
|
66
|
+
function UserViewGridComponent_ng_template_5_button_3_Template(rf, ctx) { if (rf & 1) {
|
|
67
|
+
const _r22 = i0.ɵɵgetCurrentView();
|
|
68
|
+
i0.ɵɵelementStart(0, "button", 19);
|
|
69
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r21.enableMergeOrCompare(true, "compare")); });
|
|
70
|
+
i0.ɵɵtext(1, "Cancel");
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
} }
|
|
73
|
+
function UserViewGridComponent_ng_template_5_button_4_Template(rf, ctx) { if (rf & 1) {
|
|
74
|
+
const _r24 = i0.ɵɵgetCurrentView();
|
|
75
|
+
i0.ɵɵelementStart(0, "button", 18);
|
|
76
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r24); const ctx_r23 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r23.enableMergeOrCompare(false, "merge")); });
|
|
77
|
+
i0.ɵɵtext(1, "Merge");
|
|
78
|
+
i0.ɵɵelementEnd();
|
|
79
|
+
} if (rf & 2) {
|
|
80
|
+
const ctx_r11 = i0.ɵɵnextContext(2);
|
|
81
|
+
i0.ɵɵproperty("disabled", ctx_r11.mergeMode && ctx_r11.recordsToCompare.length < 2);
|
|
82
|
+
} }
|
|
83
|
+
function UserViewGridComponent_ng_template_5_button_5_Template(rf, ctx) { if (rf & 1) {
|
|
84
|
+
const _r26 = i0.ɵɵgetCurrentView();
|
|
85
|
+
i0.ɵɵelementStart(0, "button", 19);
|
|
86
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r26); const ctx_r25 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r25.enableMergeOrCompare(false, "merge")); });
|
|
87
|
+
i0.ɵɵtext(1, "Merge");
|
|
88
|
+
i0.ɵɵelementEnd();
|
|
89
|
+
} }
|
|
90
|
+
function UserViewGridComponent_ng_template_5_button_6_Template(rf, ctx) { if (rf & 1) {
|
|
91
|
+
const _r28 = i0.ɵɵgetCurrentView();
|
|
92
|
+
i0.ɵɵelementStart(0, "button", 19);
|
|
93
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r28); const ctx_r27 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r27.enableMergeOrCompare(true, "merge")); });
|
|
94
|
+
i0.ɵɵtext(1, "Cancel");
|
|
95
|
+
i0.ɵɵelementEnd();
|
|
96
|
+
} }
|
|
97
|
+
function UserViewGridComponent_ng_template_5_button_7_Template(rf, ctx) { if (rf & 1) {
|
|
98
|
+
const _r30 = i0.ɵɵgetCurrentView();
|
|
99
|
+
i0.ɵɵelementStart(0, "button", 20);
|
|
100
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_ng_template_5_button_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r30); const ctx_r29 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r29.RefreshFromSavedParams()); });
|
|
101
|
+
i0.ɵɵelement(1, "kendo-svgicon", 17);
|
|
102
|
+
i0.ɵɵtext(2, " Refresh ");
|
|
103
|
+
i0.ɵɵelementEnd();
|
|
104
|
+
} if (rf & 2) {
|
|
105
|
+
const ctx_r14 = i0.ɵɵnextContext(2);
|
|
106
|
+
i0.ɵɵproperty("primary", true);
|
|
107
|
+
i0.ɵɵadvance();
|
|
108
|
+
i0.ɵɵproperty("icon", ctx_r14.kendoSVGIcon("arrowRotateCcwSmall"));
|
|
109
|
+
} }
|
|
110
|
+
function UserViewGridComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
|
|
111
|
+
i0.ɵɵtemplate(0, UserViewGridComponent_ng_template_5_button_0_Template, 3, 1, "button", 12)(1, UserViewGridComponent_ng_template_5_button_1_Template, 2, 1, "button", 13)(2, UserViewGridComponent_ng_template_5_button_2_Template, 2, 1, "button", 13)(3, UserViewGridComponent_ng_template_5_button_3_Template, 2, 0, "button", 14)(4, UserViewGridComponent_ng_template_5_button_4_Template, 2, 1, "button", 13)(5, UserViewGridComponent_ng_template_5_button_5_Template, 2, 0, "button", 14)(6, UserViewGridComponent_ng_template_5_button_6_Template, 2, 0, "button", 14)(7, UserViewGridComponent_ng_template_5_button_7_Template, 3, 2, "button", 15);
|
|
112
|
+
} if (rf & 2) {
|
|
113
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
114
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.compareMode && !ctx_r1.mergeMode);
|
|
115
|
+
i0.ɵɵadvance();
|
|
116
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.compareMode && !ctx_r1.mergeMode);
|
|
117
|
+
i0.ɵɵadvance();
|
|
118
|
+
i0.ɵɵproperty("ngIf", ctx_r1.compareMode);
|
|
119
|
+
i0.ɵɵadvance();
|
|
120
|
+
i0.ɵɵproperty("ngIf", ctx_r1.compareMode);
|
|
121
|
+
i0.ɵɵadvance();
|
|
122
|
+
i0.ɵɵproperty("ngIf", ctx_r1.mergeMode);
|
|
123
|
+
i0.ɵɵadvance();
|
|
124
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.mergeMode && !ctx_r1.compareMode);
|
|
125
|
+
i0.ɵɵadvance();
|
|
126
|
+
i0.ɵɵproperty("ngIf", ctx_r1.mergeMode);
|
|
127
|
+
i0.ɵɵadvance();
|
|
128
|
+
i0.ɵɵproperty("ngIf", ctx_r1.showRefreshButton && !ctx_r1.compareMode && !ctx_r1.mergeMode);
|
|
129
|
+
} }
|
|
130
|
+
const _c3 = () => ({ "text-align": "center", "vertical-align": "center" });
|
|
131
|
+
const _c4 = () => ({ "font-weight": "bold", "background-color": "#a9c2af" });
|
|
132
|
+
function UserViewGridComponent_kendo_grid_checkbox_column_6_Template(rf, ctx) { if (rf & 1) {
|
|
133
|
+
i0.ɵɵelement(0, "kendo-grid-checkbox-column", 21);
|
|
134
|
+
} if (rf & 2) {
|
|
135
|
+
i0.ɵɵstyleMap(i0.ɵɵpureFunction0(4, _c3));
|
|
136
|
+
i0.ɵɵproperty("width", 50)("headerStyle", i0.ɵɵpureFunction0(5, _c4));
|
|
137
|
+
} }
|
|
138
|
+
function UserViewGridComponent_kendo_grid_column_7_1_ng_template_0_Template(rf, ctx) { if (rf & 1) {
|
|
139
|
+
i0.ɵɵtext(0);
|
|
140
|
+
i0.ɵɵpipe(1, "number");
|
|
141
|
+
i0.ɵɵpipe(2, "number");
|
|
142
|
+
i0.ɵɵelement(3, "br");
|
|
143
|
+
i0.ɵɵelementStart(4, "span", 24);
|
|
144
|
+
i0.ɵɵtext(5);
|
|
145
|
+
i0.ɵɵpipe(6, "number");
|
|
146
|
+
i0.ɵɵelementEnd();
|
|
147
|
+
} if (rf & 2) {
|
|
148
|
+
const ctx_r33 = i0.ɵɵnextContext(3);
|
|
149
|
+
i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(1, 3, ctx_r33.viewData.length), "", ctx_r33.totalRowCount > ctx_r33.viewData.length ? " of " + i0.ɵɵpipeBind1(2, 5, ctx_r33.totalRowCount) : " rows", "");
|
|
150
|
+
i0.ɵɵadvance(5);
|
|
151
|
+
i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind2(6, 7, ctx_r33.viewExecutionTime, "1.2-2"), " seconds");
|
|
152
|
+
} }
|
|
153
|
+
function UserViewGridComponent_kendo_grid_column_7_1_Template(rf, ctx) { if (rf & 1) {
|
|
154
|
+
i0.ɵɵtemplate(0, UserViewGridComponent_kendo_grid_column_7_1_ng_template_0_Template, 7, 10, "ng-template", 23);
|
|
155
|
+
} }
|
|
156
|
+
function UserViewGridComponent_kendo_grid_column_7_Template(rf, ctx) { if (rf & 1) {
|
|
157
|
+
i0.ɵɵelementStart(0, "kendo-grid-column", 22);
|
|
158
|
+
i0.ɵɵtemplate(1, UserViewGridComponent_kendo_grid_column_7_1_Template, 1, 0, null, 11);
|
|
159
|
+
i0.ɵɵelementEnd();
|
|
160
|
+
} if (rf & 2) {
|
|
161
|
+
const item_r31 = ctx.$implicit;
|
|
162
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
163
|
+
i0.ɵɵstyleMap(ctx_r3.GetColumnCellStyle(item_r31));
|
|
164
|
+
i0.ɵɵproperty("field", item_r31.Name)("title", ctx_r3.GetColumnTitle(item_r31))("width", item_r31.width ? item_r31.width : 100)("editable", item_r31.EntityField.AllowUpdateAPI)("editor", ctx_r3.getEditor(item_r31.EntityField))("headerStyle", i0.ɵɵpureFunction0(9, _c4));
|
|
165
|
+
i0.ɵɵadvance();
|
|
166
|
+
i0.ɵɵproperty("ngIf", item_r31 === ctx_r3.visibleColumns[0]);
|
|
167
|
+
} }
|
|
168
|
+
function UserViewGridComponent_kendo_excelexport_column_10_Template(rf, ctx) { if (rf & 1) {
|
|
169
|
+
i0.ɵɵelement(0, "kendo-excelexport-column", 25);
|
|
170
|
+
} if (rf & 2) {
|
|
171
|
+
const exportCol_r34 = ctx.$implicit;
|
|
172
|
+
i0.ɵɵproperty("field", exportCol_r34.Name)("title", exportCol_r34.Name);
|
|
173
|
+
} }
|
|
174
|
+
function UserViewGridComponent_div_15_kendo_window_2_button_6_Template(rf, ctx) { if (rf & 1) {
|
|
175
|
+
const _r42 = i0.ɵɵgetCurrentView();
|
|
176
|
+
i0.ɵɵelementStart(0, "button", 36);
|
|
177
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_div_15_kendo_window_2_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r42); const ctx_r41 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r41.closeCompareDialog("close")); });
|
|
178
|
+
i0.ɵɵtext(1, "Close");
|
|
179
|
+
i0.ɵɵelementEnd();
|
|
180
|
+
} }
|
|
181
|
+
function UserViewGridComponent_div_15_kendo_window_2_button_7_Template(rf, ctx) { if (rf & 1) {
|
|
182
|
+
const _r44 = i0.ɵɵgetCurrentView();
|
|
183
|
+
i0.ɵɵelementStart(0, "button", 36);
|
|
184
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_div_15_kendo_window_2_button_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r44); const ctx_r43 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r43.closeCompareDialog("cancel")); });
|
|
185
|
+
i0.ɵɵtext(1, "Cancel");
|
|
186
|
+
i0.ɵɵelementEnd();
|
|
187
|
+
} }
|
|
188
|
+
function UserViewGridComponent_div_15_kendo_window_2_button_8_Template(rf, ctx) { if (rf & 1) {
|
|
189
|
+
const _r46 = i0.ɵɵgetCurrentView();
|
|
190
|
+
i0.ɵɵelementStart(0, "button", 37);
|
|
191
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_div_15_kendo_window_2_button_8_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r46); const ctx_r45 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r45.closeCompareDialog("merge")); });
|
|
192
|
+
i0.ɵɵtext(1, " Merge Records ");
|
|
193
|
+
i0.ɵɵelementEnd();
|
|
194
|
+
} }
|
|
195
|
+
function UserViewGridComponent_div_15_kendo_window_2_kendo_dialog_9_Template(rf, ctx) { if (rf & 1) {
|
|
196
|
+
const _r48 = i0.ɵɵgetCurrentView();
|
|
197
|
+
i0.ɵɵelementStart(0, "kendo-dialog", 38);
|
|
198
|
+
i0.ɵɵlistener("close", function UserViewGridComponent_div_15_kendo_window_2_kendo_dialog_9_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r48); const ctx_r47 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r47.closeConfirmMergeDialog("cancel")); });
|
|
199
|
+
i0.ɵɵelementStart(1, "p", 39);
|
|
200
|
+
i0.ɵɵtext(2, " Are you sure you want to merge the records? This action cannot be undone. If you select \"Yes\", the records will be merged and the duplicate records will be deleted. ");
|
|
201
|
+
i0.ɵɵelementEnd();
|
|
202
|
+
i0.ɵɵelementStart(3, "kendo-dialog-actions")(4, "button", 16);
|
|
203
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_div_15_kendo_window_2_kendo_dialog_9_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r48); const ctx_r49 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r49.closeConfirmMergeDialog("no")); });
|
|
204
|
+
i0.ɵɵtext(5, "No");
|
|
205
|
+
i0.ɵɵelementEnd();
|
|
206
|
+
i0.ɵɵelementStart(6, "button", 40);
|
|
207
|
+
i0.ɵɵlistener("click", function UserViewGridComponent_div_15_kendo_window_2_kendo_dialog_9_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r48); const ctx_r50 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r50.closeConfirmMergeDialog("yes")); });
|
|
208
|
+
i0.ɵɵtext(7, " Yes ");
|
|
209
|
+
i0.ɵɵelementEnd()()();
|
|
210
|
+
} if (rf & 2) {
|
|
211
|
+
i0.ɵɵproperty("minWidth", 250)("width", 450);
|
|
212
|
+
} }
|
|
213
|
+
function UserViewGridComponent_div_15_kendo_window_2_Template(rf, ctx) { if (rf & 1) {
|
|
214
|
+
const _r52 = i0.ɵɵgetCurrentView();
|
|
215
|
+
i0.ɵɵelementStart(0, "kendo-window", 28);
|
|
216
|
+
i0.ɵɵlistener("close", function UserViewGridComponent_div_15_kendo_window_2_Template_kendo_window_close_0_listener($event) { i0.ɵɵrestoreView(_r52); const ctx_r51 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r51.closeCompareDialog($event)); });
|
|
217
|
+
i0.ɵɵelementStart(1, "div", 29)(2, "div");
|
|
218
|
+
i0.ɵɵelement(3, "mj-compare-records", 30, 31);
|
|
219
|
+
i0.ɵɵelementEnd()();
|
|
220
|
+
i0.ɵɵelementStart(5, "div", 32);
|
|
221
|
+
i0.ɵɵtemplate(6, UserViewGridComponent_div_15_kendo_window_2_button_6_Template, 2, 0, "button", 33)(7, UserViewGridComponent_div_15_kendo_window_2_button_7_Template, 2, 0, "button", 33)(8, UserViewGridComponent_div_15_kendo_window_2_button_8_Template, 2, 0, "button", 34);
|
|
222
|
+
i0.ɵɵelementEnd();
|
|
223
|
+
i0.ɵɵtemplate(9, UserViewGridComponent_div_15_kendo_window_2_kendo_dialog_9_Template, 8, 2, "kendo-dialog", 35);
|
|
224
|
+
i0.ɵɵelementEnd();
|
|
225
|
+
} if (rf & 2) {
|
|
226
|
+
const ctx_r35 = i0.ɵɵnextContext(2);
|
|
227
|
+
i0.ɵɵproperty("minHeight", 300)("minWidth", 400)("resizable", true);
|
|
228
|
+
i0.ɵɵadvance(3);
|
|
229
|
+
i0.ɵɵproperty("entityName", ctx_r35._entityInfo ? ctx_r35._entityInfo.Name : "")("recordsToCompare", ctx_r35.recordsToCompare)("visibleColumns", ctx_r35.visibleColumns)("selectionMode", ctx_r35.mergeMode ? true : false);
|
|
230
|
+
i0.ɵɵadvance(3);
|
|
231
|
+
i0.ɵɵproperty("ngIf", ctx_r35.compareMode);
|
|
232
|
+
i0.ɵɵadvance();
|
|
233
|
+
i0.ɵɵproperty("ngIf", ctx_r35.mergeMode);
|
|
234
|
+
i0.ɵɵadvance();
|
|
235
|
+
i0.ɵɵproperty("ngIf", ctx_r35.mergeMode);
|
|
236
|
+
i0.ɵɵadvance();
|
|
237
|
+
i0.ɵɵproperty("ngIf", ctx_r35.isConfirmDialogOpen);
|
|
238
|
+
} }
|
|
239
|
+
function UserViewGridComponent_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
240
|
+
i0.ɵɵelementStart(0, "div");
|
|
241
|
+
i0.ɵɵelement(1, "div", 26);
|
|
242
|
+
i0.ɵɵtemplate(2, UserViewGridComponent_div_15_kendo_window_2_Template, 10, 11, "kendo-window", 27);
|
|
243
|
+
i0.ɵɵelementEnd();
|
|
244
|
+
} if (rf & 2) {
|
|
245
|
+
const ctx_r6 = i0.ɵɵnextContext();
|
|
246
|
+
i0.ɵɵadvance(2);
|
|
247
|
+
i0.ɵɵproperty("ngIf", ctx_r6.isCompareDialogOpened);
|
|
248
|
+
} }
|
|
249
|
+
export class UserViewGridComponent {
|
|
250
|
+
get PendingRecords() {
|
|
251
|
+
return this._pendingRecords;
|
|
252
|
+
}
|
|
253
|
+
StartEditMode() {
|
|
254
|
+
this.InEditMode = true;
|
|
255
|
+
}
|
|
256
|
+
EndEditMode() {
|
|
257
|
+
this.InEditMode = false;
|
|
258
|
+
this.editModeEnded.next();
|
|
259
|
+
}
|
|
260
|
+
EditingComplete() {
|
|
261
|
+
if (this.InEditMode) {
|
|
262
|
+
// we need to wait for edit mode to end before we can return true
|
|
263
|
+
return new Promise((resolve, reject) => {
|
|
264
|
+
const subscription = this.editModeEnded.subscribe(() => {
|
|
265
|
+
resolve(true);
|
|
266
|
+
subscription.unsubscribe();
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
else
|
|
271
|
+
return Promise.resolve(true); // not in edit mode, so editing is complete!
|
|
272
|
+
}
|
|
273
|
+
IsDynamicView() {
|
|
274
|
+
return !this._viewEntity; // if we have a viewEntity it is a stored view
|
|
275
|
+
}
|
|
276
|
+
pageChange(event) {
|
|
277
|
+
this.skip = event.skip;
|
|
278
|
+
this.virtualLoadData();
|
|
279
|
+
}
|
|
280
|
+
virtualLoadData() {
|
|
281
|
+
// check to see if we have already formatted the slice of the data we need right now
|
|
282
|
+
// we are storing the formattted data in the formattedData array and it has same set
|
|
283
|
+
// of indexes as the viewData array (raw unformatted data). When we first get viewData
|
|
284
|
+
// from the server we create an array of the same length as viewData, but have nulls in all of the
|
|
285
|
+
// indexes. As we format each row of viewData we store the formatted row in the same index
|
|
286
|
+
// in the formattedData array. So if we have already formatted the data we need for the current
|
|
287
|
+
// page, we just use that data, otherwise we format the data we need for the current page
|
|
288
|
+
try {
|
|
289
|
+
// check to see if we have already formatted the data we need for the current page
|
|
290
|
+
for (let i = this.skip; (i < (this.skip + this.pageSize)) && (i < this.viewData.length); i++) {
|
|
291
|
+
if (!this.formattedData[i]) {
|
|
292
|
+
// we have not formatted this row yet, so format it
|
|
293
|
+
const r = this.viewColumns.map((c) => {
|
|
294
|
+
if (c && c.EntityField && this.viewData[i] && this.viewData[i][c.EntityField.Name]) {
|
|
295
|
+
if (!c.hidden && c.EntityField.Name !== 'ID') {
|
|
296
|
+
const ef = c.EntityField;
|
|
297
|
+
return { field: c.EntityField.Name, value: ef.FormatValue(this.viewData[i][c.EntityField.Name], 0, undefined, 300) };
|
|
298
|
+
}
|
|
299
|
+
else
|
|
300
|
+
return { field: c.EntityField.Name, value: this.viewData[i][c.EntityField.Name] }; // hidden column, so just return the value, don't bother formatting
|
|
301
|
+
}
|
|
302
|
+
else
|
|
303
|
+
return { field: c.Name, value: null };
|
|
304
|
+
});
|
|
305
|
+
// now r is an array of {field: string, value: any} objects, so we need to convert it to an object
|
|
306
|
+
// with the field names as the keys and the values as the values
|
|
307
|
+
const row = {};
|
|
308
|
+
for (let j = 0; j < r.length; j++) {
|
|
309
|
+
if (r[j] && r[j].field && r[j].field.length > 0)
|
|
310
|
+
row[r[j].field] = r[j].value;
|
|
311
|
+
}
|
|
312
|
+
this.formattedData[i] = row;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// now that we have made sure current page of data is formatted, we can return it
|
|
316
|
+
this.gridView = {
|
|
317
|
+
data: this.formattedData.slice(this.skip, this.skip + this.pageSize),
|
|
318
|
+
total: this.viewData.length,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
LogError(e);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
constructor(formBuilder, router) {
|
|
326
|
+
this.formBuilder = formBuilder;
|
|
327
|
+
this.router = router;
|
|
328
|
+
this.title = 'UserViewGrid';
|
|
329
|
+
this.BottomMargin = 0;
|
|
330
|
+
this.InEditMode = false;
|
|
331
|
+
this.EditMode = "None";
|
|
332
|
+
this.AutoNavigate = true;
|
|
333
|
+
this.rowClicked = new EventEmitter();
|
|
334
|
+
this.rowEdited = new EventEmitter();
|
|
335
|
+
this.kendoGridElement = null;
|
|
336
|
+
this.kendoGridElementRef = null;
|
|
337
|
+
this.kendoExcelExport = null;
|
|
338
|
+
this.recordCompareComponent = null;
|
|
339
|
+
this._pendingRecords = [];
|
|
340
|
+
this.viewData = [];
|
|
341
|
+
this.totalRowCount = 0;
|
|
342
|
+
this.formattedData = [];
|
|
343
|
+
this.viewColumns = [];
|
|
344
|
+
this.visibleColumns = [];
|
|
345
|
+
this.sortSettings = [];
|
|
346
|
+
this.entityRecord = null;
|
|
347
|
+
this.skip = 0;
|
|
348
|
+
this.pageSize = 40;
|
|
349
|
+
this.isLoading = false;
|
|
350
|
+
this.gridView = { data: [], total: 0 };
|
|
351
|
+
this.gridHeight = 750;
|
|
352
|
+
this._newGridState = {};
|
|
353
|
+
this.editModeEnded = new Subject();
|
|
354
|
+
this.recordsToCompare = [];
|
|
355
|
+
this.compareMode = false;
|
|
356
|
+
// public compareRecords: BaseEntity[] = [];
|
|
357
|
+
this.mergeMode = false;
|
|
358
|
+
// public mergeRecords: BaseEntity[] = [];
|
|
359
|
+
this.selectableSettings = {
|
|
360
|
+
enabled: false
|
|
361
|
+
};
|
|
362
|
+
this.selectedKeys = [];
|
|
363
|
+
this.isCompareDialogOpened = false;
|
|
364
|
+
this.isConfirmDialogOpen = false;
|
|
365
|
+
this.showRefreshButton = true;
|
|
366
|
+
this.viewExecutionTime = 0;
|
|
367
|
+
this._viewDirty = false;
|
|
368
|
+
this._deferLoadCount = 0;
|
|
369
|
+
this._allowLoad = true;
|
|
370
|
+
// Export Functionality
|
|
371
|
+
this.exportColumns = [];
|
|
372
|
+
this.exportData = [];
|
|
373
|
+
this.kendoSVGIcon = kendoSVGIcon;
|
|
374
|
+
}
|
|
375
|
+
SaveView() {
|
|
376
|
+
// debounced outer function...
|
|
377
|
+
clearTimeout(this._saveTimeout);
|
|
378
|
+
this._saveTimeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
379
|
+
// when we actually call inner save view we do await
|
|
380
|
+
yield this.innerSaveView();
|
|
381
|
+
}), 5000); // 5 seconds delay
|
|
382
|
+
}
|
|
383
|
+
;
|
|
384
|
+
innerSaveView() {
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
if (this._viewDirty) {
|
|
387
|
+
const md = new Metadata();
|
|
388
|
+
if (this._viewEntity &&
|
|
389
|
+
this._viewEntity.Get('UserID') === md.CurrentUser.ID) {
|
|
390
|
+
// this view is a saved view, AND it belongs to the current user
|
|
391
|
+
// update the grid state if we have settings updates for columns and/or sorts
|
|
392
|
+
const tempGridState = JSON.parse(this._viewEntity.Get('GridState'));
|
|
393
|
+
const tempColSettings = this._newGridState.columnSettings ? this._newGridState.columnSettings : tempGridState.columnSettings;
|
|
394
|
+
tempColSettings.forEach((col) => { col.DisplayName, col.ID, col.Name, col.hidden, col.orderIndex, col.width; }); // remove EntityFieldInfo from the column settings
|
|
395
|
+
tempGridState.columnSettings = tempColSettings;
|
|
396
|
+
tempGridState.sortSettings = this._newGridState.sortSettings ? this._newGridState.sortSettings : tempGridState.sortSettings;
|
|
397
|
+
// now stringify the grid state and save it
|
|
398
|
+
this._viewEntity.Set('GridState', JSON.stringify(tempGridState));
|
|
399
|
+
const newSortState = tempGridState.sortSettings.map((s) => { return { field: s.field, direction: s.dir }; });
|
|
400
|
+
const oldSortState = JSON.parse(this._viewEntity.Get('SortState'));
|
|
401
|
+
this._viewEntity.Set('SortState', JSON.stringify(newSortState));
|
|
402
|
+
if (yield this._viewEntity.Save()) {
|
|
403
|
+
// check to see if sort state changed and if so, refresh the grid
|
|
404
|
+
if (JSON.stringify(newSortState) !== JSON.stringify(oldSortState)) {
|
|
405
|
+
if (this.Params) // makes sure we have params before we refresh
|
|
406
|
+
this.Refresh(this.Params);
|
|
407
|
+
}
|
|
408
|
+
this._viewDirty = false;
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
this.CreateSimpleNotification('Unable to save view settings', 'error', 5000);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
CreateSimpleNotification(message, style, duration) {
|
|
418
|
+
const data = {
|
|
419
|
+
message: message,
|
|
420
|
+
style: style,
|
|
421
|
+
DisplayDuration: duration
|
|
422
|
+
};
|
|
423
|
+
MJGlobal.Instance.RaiseEvent({
|
|
424
|
+
component: this,
|
|
425
|
+
event: MJEventType.DisplaySimpleNotificationRequest,
|
|
426
|
+
eventCode: "",
|
|
427
|
+
args: data
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
columnReorder(args) {
|
|
431
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
432
|
+
// Remove the column from the original position
|
|
433
|
+
// need to find the column in the viewColumns array because args.old/new Indexes are from the visibleColumns array
|
|
434
|
+
const fieldName = args.column.field;
|
|
435
|
+
if (fieldName) {
|
|
436
|
+
const vcOldIndex = this.viewColumns.findIndex((vc) => vc.Name === fieldName);
|
|
437
|
+
const vcNewIndex = this.viewColumns.findIndex((vc) => vc.orderIndex === args.newIndex);
|
|
438
|
+
if (vcOldIndex >= 0) {
|
|
439
|
+
// got the index, now remove the element
|
|
440
|
+
const element = this.viewColumns.splice(vcOldIndex, 1)[0];
|
|
441
|
+
// Insert it at the new position
|
|
442
|
+
this.viewColumns.splice(vcNewIndex, 0, element);
|
|
443
|
+
// go through all of the columns and set orderIndex as that isn't done automatically
|
|
444
|
+
let visColIndex = 0;
|
|
445
|
+
for (let i = 0; i < this.viewColumns.length; i++) {
|
|
446
|
+
if (!this.viewColumns[i].hidden) {
|
|
447
|
+
this.viewColumns[i].orderIndex = visColIndex;
|
|
448
|
+
visColIndex++;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// now loop through all of the HIDDEN columns and set their orderIndex, done in second loop because we want first loop to give us total number of visible columns
|
|
452
|
+
for (let i = 0; i < this.viewColumns.length; i++) {
|
|
453
|
+
if (this.viewColumns[i].hidden) {
|
|
454
|
+
this.viewColumns[i].orderIndex = visColIndex;
|
|
455
|
+
visColIndex++;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// make sure that _newGridState.columnSettings is set
|
|
459
|
+
this._newGridState.columnSettings = this.viewColumns;
|
|
460
|
+
this._viewDirty = true;
|
|
461
|
+
this.SaveView();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
columnResize(args) {
|
|
467
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
468
|
+
for (const col of args) {
|
|
469
|
+
const c = col.column;
|
|
470
|
+
const viewCol = this.viewColumns.find(vc => vc.Name === c.field);
|
|
471
|
+
const visCol = this.visibleColumns.find(vc => vc.Name === c.field);
|
|
472
|
+
const visCols = this.visibleColumns;
|
|
473
|
+
if (viewCol)
|
|
474
|
+
viewCol.width = col.newWidth;
|
|
475
|
+
}
|
|
476
|
+
this._newGridState.columnSettings = this.viewColumns.map(vc => {
|
|
477
|
+
return {
|
|
478
|
+
Name: vc.Name,
|
|
479
|
+
DisplayName: vc.DisplayName,
|
|
480
|
+
width: vc.width,
|
|
481
|
+
orderIndex: vc.orderIndex,
|
|
482
|
+
hidden: vc.hidden
|
|
483
|
+
};
|
|
484
|
+
});
|
|
485
|
+
this._viewDirty = true;
|
|
486
|
+
this.SaveView();
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
sortChanged(sort) {
|
|
490
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
491
|
+
if (sort && sort.length > 0) {
|
|
492
|
+
// remove any sort settings that don't have a direction
|
|
493
|
+
const filterSort = sort.filter((s) => s.dir !== undefined && s.dir !== null && s.dir !== "");
|
|
494
|
+
this._newGridState.sortSettings = filterSort;
|
|
495
|
+
}
|
|
496
|
+
else
|
|
497
|
+
this._newGridState.sortSettings = sort;
|
|
498
|
+
this.sortSettings = this._newGridState.sortSettings; // for the UI display - grid binding to this shows that the sort is applied via arrows in the column headers
|
|
499
|
+
if (this.IsDynamicView()) {
|
|
500
|
+
// Dynamic View, we have this.Params and can add an OrderBy and then just Refresh() the entire component
|
|
501
|
+
// that will result in going to the server for a refreshed set of data
|
|
502
|
+
if (this.Params) {
|
|
503
|
+
this.Params.OrderBy = sort[0].field + ' ' + (sort[0].dir);
|
|
504
|
+
this.Refresh(this.Params);
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
LogError("sortChanged() called but this.Params is null or undefined"); // should never get here
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
// Saved view - we do this on the server side only
|
|
512
|
+
this._viewDirty = true;
|
|
513
|
+
this.innerSaveView(); // for sort changes we call innerSaveView() directly, not through SaveView() which is debounced
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
cellClickHandler(args) {
|
|
518
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
+
if (this.compareMode || this.mergeMode)
|
|
520
|
+
return;
|
|
521
|
+
if (this._entityInfo) {
|
|
522
|
+
const pkeyVals = [];
|
|
523
|
+
this._entityInfo.PrimaryKeys.forEach((pkey) => {
|
|
524
|
+
pkeyVals.push({ FieldName: pkey.Name, Value: this.viewData[args.rowIndex][pkey.Name] });
|
|
525
|
+
});
|
|
526
|
+
this.rowClicked.emit({
|
|
527
|
+
entityId: this._entityInfo.ID,
|
|
528
|
+
entityName: this._entityInfo.Name,
|
|
529
|
+
primaryKeyValues: pkeyVals
|
|
530
|
+
});
|
|
531
|
+
if (this._entityInfo.AllowUpdateAPI &&
|
|
532
|
+
this.EditMode !== "None") {
|
|
533
|
+
const perm = this._entityInfo.GetUserPermisions(new Metadata().CurrentUser);
|
|
534
|
+
if (perm.CanUpdate) {
|
|
535
|
+
this.StartEditMode();
|
|
536
|
+
args.sender.editCell(args.rowIndex, args.columnIndex, this.createFormGroup(args.dataItem));
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
if (!this.InEditMode && this.AutoNavigate) {
|
|
540
|
+
// tell app router to go to this record
|
|
541
|
+
const pkVals = this.GeneratePrimaryKeyValueString(pkeyVals);
|
|
542
|
+
this.router.navigate(['resource', 'record', pkVals], { queryParams: { Entity: this._entityInfo.Name } });
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
GeneratePrimaryKeyValueString(pkVals) {
|
|
548
|
+
return pkVals.length > 1 ? pkVals.map(pk => pk.FieldName + '|' + pk.Value).join('||') : pkVals[0].Value;
|
|
549
|
+
}
|
|
550
|
+
createFormGroup(dataItem) {
|
|
551
|
+
const groupFields = {};
|
|
552
|
+
this.viewColumns.forEach((vc) => {
|
|
553
|
+
if (vc.EntityField.AllowUpdateAPI &&
|
|
554
|
+
vc.EntityField.IsVirtual === false &&
|
|
555
|
+
vc.EntityField.AllowUpdateInView)
|
|
556
|
+
groupFields[vc.Name] = dataItem[vc.Name];
|
|
557
|
+
});
|
|
558
|
+
return this.formBuilder.group(groupFields);
|
|
559
|
+
}
|
|
560
|
+
getEditor(ef) {
|
|
561
|
+
switch (ef.TSType) {
|
|
562
|
+
case EntityFieldTSType.Boolean:
|
|
563
|
+
return "boolean";
|
|
564
|
+
case EntityFieldTSType.Date:
|
|
565
|
+
return "date";
|
|
566
|
+
case EntityFieldTSType.Number:
|
|
567
|
+
return "numeric";
|
|
568
|
+
default:
|
|
569
|
+
return "text";
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
cellCloseHandler(args) {
|
|
573
|
+
var _a;
|
|
574
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
575
|
+
try {
|
|
576
|
+
if (this._entityInfo && this.EditMode !== "None") {
|
|
577
|
+
const { formGroup, dataItem } = args;
|
|
578
|
+
if (!formGroup.valid) {
|
|
579
|
+
// prevent closing the edited cell if there are invalid values.
|
|
580
|
+
args.preventDefault();
|
|
581
|
+
}
|
|
582
|
+
else if (formGroup.dirty) {
|
|
583
|
+
if (args.originalEvent && args.originalEvent.keyCode === Keys.Escape)
|
|
584
|
+
return; // user hit escape, so don't save their changes
|
|
585
|
+
// update the data item with the new values - this drives UI refresh while we save the record...
|
|
586
|
+
Object.assign(dataItem, formGroup.value);
|
|
587
|
+
const md = new Metadata();
|
|
588
|
+
const pkey = this._entityInfo.PrimaryKey.Name;
|
|
589
|
+
let record;
|
|
590
|
+
let bSaved = false;
|
|
591
|
+
if (this.EditMode === "Save") {
|
|
592
|
+
record = yield md.GetEntityObject(this._entityInfo.Name);
|
|
593
|
+
yield record.InnerLoad(this._entityInfo.PrimaryKeys.map(pk => {
|
|
594
|
+
return {
|
|
595
|
+
FieldName: pk.Name,
|
|
596
|
+
Value: dataItem[pk.Name]
|
|
597
|
+
};
|
|
598
|
+
}));
|
|
599
|
+
record.SetMany(formGroup.value);
|
|
600
|
+
bSaved = yield record.Save();
|
|
601
|
+
if (!bSaved)
|
|
602
|
+
this.CreateSimpleNotification("Error saving record: " + record.Get(pkey), 'error', 5000);
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
record = (_a = this._pendingRecords.find((r) => r.record.Get(pkey) === dataItem[pkey])) === null || _a === void 0 ? void 0 : _a.record;
|
|
606
|
+
if (!record) { // haven't edited this one before
|
|
607
|
+
record = yield md.GetEntityObject(this._viewEntity.Get('Entity'));
|
|
608
|
+
yield record.InnerLoad(this._entityInfo.PrimaryKeys.map(pk => {
|
|
609
|
+
return {
|
|
610
|
+
FieldName: pk.Name,
|
|
611
|
+
Value: dataItem[pk.Name]
|
|
612
|
+
};
|
|
613
|
+
}));
|
|
614
|
+
this._pendingRecords.push({ record,
|
|
615
|
+
row: args.rowIndex,
|
|
616
|
+
dataItem }); // don't save - put the changed record on a queue for saving later by our container
|
|
617
|
+
}
|
|
618
|
+
// go through the formGroup and only set the values that exist as columns in the grid
|
|
619
|
+
const keys = Object.keys(formGroup.value);
|
|
620
|
+
keys.forEach((k) => {
|
|
621
|
+
const vc = this.viewColumns.find((vc) => vc.Name === k && vc.hidden === false);
|
|
622
|
+
if (vc) {
|
|
623
|
+
record.Set(k, formGroup.value[k]);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
//record.SetMany(formGroup.value);
|
|
627
|
+
}
|
|
628
|
+
this.rowEdited.emit({
|
|
629
|
+
record: record,
|
|
630
|
+
row: args.rowIndex,
|
|
631
|
+
saved: bSaved
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
catch (e) {
|
|
637
|
+
console.error(e);
|
|
638
|
+
}
|
|
639
|
+
finally {
|
|
640
|
+
this.EndEditMode();
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
// this handles reverting pending cahnges to records WITHIN the grid, not the user view settings, unrelated to that.
|
|
645
|
+
RevertPendingChanges() {
|
|
646
|
+
if (this._pendingRecords && this._pendingRecords.length > 0) {
|
|
647
|
+
this._pendingRecords.forEach((r) => {
|
|
648
|
+
r.record.Revert();
|
|
649
|
+
Object.assign(r.dataItem, r.record.GetAll()); // copy the original values back to the data Item which gets the grid to display the old values again...
|
|
650
|
+
});
|
|
651
|
+
this._pendingRecords = [];
|
|
652
|
+
if (this.Params)
|
|
653
|
+
this.Refresh(this.Params);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
ngOnInit() {
|
|
657
|
+
}
|
|
658
|
+
ngAfterViewInit() {
|
|
659
|
+
//this.setGridHeight();
|
|
660
|
+
if (this.Params)
|
|
661
|
+
this.Refresh(this.Params);
|
|
662
|
+
}
|
|
663
|
+
get AllowLoad() {
|
|
664
|
+
return this._allowLoad;
|
|
665
|
+
}
|
|
666
|
+
set AllowLoad(value) {
|
|
667
|
+
this._allowLoad = value;
|
|
668
|
+
if (value === true && this._deferLoadCount === 0) {
|
|
669
|
+
this._deferLoadCount++; // only do this one time
|
|
670
|
+
if (this.Params)
|
|
671
|
+
this.Refresh(this.Params);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
RefreshFromSavedParams() {
|
|
676
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
+
if (this.Params)
|
|
678
|
+
this.Refresh(this.Params);
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
Refresh(params) {
|
|
682
|
+
var _a, _b, _c;
|
|
683
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
684
|
+
this.Params = params;
|
|
685
|
+
if (this.AllowLoad === false) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
if (params && (params.ViewEntity || params.ViewID || params.ViewName || (params.EntityName && params.ExtraFilter))) {
|
|
689
|
+
const startTime = new Date().getTime();
|
|
690
|
+
this.isLoading = true;
|
|
691
|
+
const md = new Metadata();
|
|
692
|
+
const rv = new RunView();
|
|
693
|
+
// get the view entity first so we can pass it in, otherwise it will end up getting loaded inside of RunView() which is inefficient as we need it too
|
|
694
|
+
// this is done for performance purposes
|
|
695
|
+
if (params.ViewEntity) {
|
|
696
|
+
// When we receive the .ViewEntity via our params that is a time saver as we don't need to load it again, so ALWAYS use that instance of the entity object for the view entity
|
|
697
|
+
this._viewEntity = params.ViewEntity;
|
|
698
|
+
const e = md.Entities.find(x => { var _a; return x.ID === ((_a = this._viewEntity) === null || _a === void 0 ? void 0 : _a.EntityID); });
|
|
699
|
+
if (e)
|
|
700
|
+
this._entityInfo = e;
|
|
701
|
+
else
|
|
702
|
+
throw new Error("Unable to get entity info for view: " + ((_a = this._viewEntity) === null || _a === void 0 ? void 0 : _a.Name));
|
|
703
|
+
}
|
|
704
|
+
else if (!params.ViewEntity && (params.ViewID || params.ViewName)) {
|
|
705
|
+
// this is NOT a dyamic view as we got either the ViewID or ViewName, so we can get the ViewEntity
|
|
706
|
+
if (params.ViewID && params.ViewID > 0) {
|
|
707
|
+
this._viewEntity = (yield ViewInfo.GetViewEntity(params.ViewID));
|
|
708
|
+
}
|
|
709
|
+
else if (params.ViewName) {
|
|
710
|
+
this._viewEntity = (yield ViewInfo.GetViewEntityByName(params.ViewName));
|
|
711
|
+
}
|
|
712
|
+
params.ViewEntity = this._viewEntity;
|
|
713
|
+
const e = md.Entities.find(x => { var _a; return x.ID === ((_a = this._viewEntity) === null || _a === void 0 ? void 0 : _a.EntityID); });
|
|
714
|
+
if (e)
|
|
715
|
+
this._entityInfo = e;
|
|
716
|
+
else
|
|
717
|
+
throw new Error("Unable to get entity info for view: " + ((_b = this._viewEntity) === null || _b === void 0 ? void 0 : _b.Name));
|
|
718
|
+
}
|
|
719
|
+
else if (params.EntityName) {
|
|
720
|
+
// we don't have a ViewEntity because we're doing a dynamic view, so we need to get the entity info from the Entity Name
|
|
721
|
+
const e = md.Entities.find(x => x.Name === params.EntityName);
|
|
722
|
+
if (e)
|
|
723
|
+
this._entityInfo = e;
|
|
724
|
+
}
|
|
725
|
+
else
|
|
726
|
+
throw new Error("Invalid configuration, we need to receive either a ViewEntity, ViewID, ViewName, or EntityName and ExtraFilter in order to run a view");
|
|
727
|
+
const rvResult = yield rv.RunView(params);
|
|
728
|
+
if (!rvResult.Success) {
|
|
729
|
+
// it failed
|
|
730
|
+
this.CreateSimpleNotification("Error running view:\n\n" + rvResult.ErrorMessage, 'error', 5000);
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
// it worked
|
|
734
|
+
this.viewData = rvResult.Results;
|
|
735
|
+
this.totalRowCount = rvResult.TotalRowCount;
|
|
736
|
+
this.formattedData = new Array(this.viewData.length);
|
|
737
|
+
let cols;
|
|
738
|
+
if (this._viewEntity)
|
|
739
|
+
cols = this._viewEntity.Columns;
|
|
740
|
+
else
|
|
741
|
+
cols = (_c = this._entityInfo) === null || _c === void 0 ? void 0 : _c.Fields.filter((f) => f.DefaultInView).map((f) => {
|
|
742
|
+
return {
|
|
743
|
+
ID: f.ID,
|
|
744
|
+
Name: f.Name,
|
|
745
|
+
DisplayName: f.DisplayName,
|
|
746
|
+
EntityField: f,
|
|
747
|
+
hidden: false,
|
|
748
|
+
orderIndex: f.Sequence,
|
|
749
|
+
width: f.DefaultColumnWidth ? f.DefaultColumnWidth : 100,
|
|
750
|
+
};
|
|
751
|
+
});
|
|
752
|
+
if (cols) {
|
|
753
|
+
this.viewColumns = cols;
|
|
754
|
+
const tempCols = cols.filter(x => x.hidden === false).sort((a, b) => {
|
|
755
|
+
const aOrder = a.orderIndex != null ? a.orderIndex : 9999;
|
|
756
|
+
const bOrder = b.orderIndex != null ? b.orderIndex : 9999;
|
|
757
|
+
return aOrder - bOrder;
|
|
758
|
+
});
|
|
759
|
+
this.visibleColumns = tempCols;
|
|
760
|
+
}
|
|
761
|
+
// sorting setup
|
|
762
|
+
if (this._viewEntity) {
|
|
763
|
+
const temp = this._viewEntity.ViewSortInfo;
|
|
764
|
+
const kendoSortSettings = temp.map((s) => {
|
|
765
|
+
let dir;
|
|
766
|
+
if (typeof s.direction === 'string')
|
|
767
|
+
dir = s.direction.trim().toLowerCase();
|
|
768
|
+
else if (typeof s.direction === 'number' && s.direction === 1)
|
|
769
|
+
dir = 'asc';
|
|
770
|
+
else if (typeof s.direction === 'number' && s.direction === 2)
|
|
771
|
+
dir = 'desc';
|
|
772
|
+
else
|
|
773
|
+
dir = '';
|
|
774
|
+
return { field: s.field, dir: dir };
|
|
775
|
+
});
|
|
776
|
+
this.sortSettings = kendoSortSettings;
|
|
777
|
+
}
|
|
778
|
+
this.skip = 0;
|
|
779
|
+
this.virtualLoadData();
|
|
780
|
+
}
|
|
781
|
+
this.viewExecutionTime = (new Date().getTime() - startTime) / 1000; // in seconds
|
|
782
|
+
this.isLoading = false;
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
LogError("Refresh(params) must have ViewID or ViewName or (EntityName and ExtraFilter)");
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
GetColumnTitle(col) {
|
|
790
|
+
if (col.DisplayName)
|
|
791
|
+
return col.DisplayName; // use view's display name first if it exists
|
|
792
|
+
else if (col.EntityField.DisplayName)
|
|
793
|
+
return col.EntityField.DisplayName; // then use entity display name, if that exist
|
|
794
|
+
else
|
|
795
|
+
return col.Name; // otherwise just use the column name
|
|
796
|
+
}
|
|
797
|
+
GetColumnCellStyle(col) {
|
|
798
|
+
switch (col.EntityField.Type.trim().toLowerCase()) {
|
|
799
|
+
case "money":
|
|
800
|
+
case 'decimal':
|
|
801
|
+
case 'real':
|
|
802
|
+
case 'float':
|
|
803
|
+
case 'int':
|
|
804
|
+
return { 'text-align': 'right', 'vertical-align': 'top' }; // right align numbers,
|
|
805
|
+
default:
|
|
806
|
+
return { 'text-align': 'left', 'vertical-align': 'top' }; // left align everything else
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
selectionChange(args) {
|
|
810
|
+
// update recordsToCompare based on the this.selectedKeys property that is bound
|
|
811
|
+
// selectedKeys is an array of indexes in the this.viewData, and we need to make our
|
|
812
|
+
// this.recordsToCompare an array of records from this.viewData so just map() the selectedKeys for this
|
|
813
|
+
this.recordsToCompare = this.selectedKeys.map((i) => this.viewData[i]);
|
|
814
|
+
}
|
|
815
|
+
enableMergeOrCompare(cancel = false, type) {
|
|
816
|
+
if (!cancel && this.recordsToCompare.length >= 2) {
|
|
817
|
+
// this scenario occurs when we've already started the merge/compare and the user has selected records, then clicked the merge/compare button again
|
|
818
|
+
this.isCompareDialogOpened = true;
|
|
819
|
+
}
|
|
820
|
+
else if (cancel) {
|
|
821
|
+
// the user clicked cancel in our toolbar
|
|
822
|
+
if (type === 'merge')
|
|
823
|
+
this.mergeMode = false;
|
|
824
|
+
else
|
|
825
|
+
this.compareMode = false;
|
|
826
|
+
this.selectedKeys = [];
|
|
827
|
+
this.recordsToCompare = [];
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
// just turning on merge mode from the merge/compare button, so just turn it on and let the user select records
|
|
831
|
+
if (type === 'merge')
|
|
832
|
+
this.mergeMode = true;
|
|
833
|
+
else
|
|
834
|
+
this.compareMode = true;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
closeConfirmMergeDialog(event) {
|
|
838
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
839
|
+
if (event === 'yes') {
|
|
840
|
+
if (this._entityInfo && this.recordCompareComponent) {
|
|
841
|
+
const md = new Metadata();
|
|
842
|
+
const pkey = this._entityInfo.PrimaryKey.Name;
|
|
843
|
+
const result = yield md.MergeRecords({
|
|
844
|
+
EntityName: this._entityInfo.Name,
|
|
845
|
+
RecordsToMerge: this.recordsToCompare.map((r) => r.Get(pkey)).filter((pkeyVal) => { var _a; return pkeyVal !== ((_a = this.recordCompareComponent) === null || _a === void 0 ? void 0 : _a.selectedRecordPKeyVal); }),
|
|
846
|
+
SurvivingRecordPrimaryKeyValues: [{ FieldName: pkey, Value: this.recordCompareComponent.selectedRecordPKeyVal }],
|
|
847
|
+
FieldMap: this.recordCompareComponent.fieldMap.map((fm) => {
|
|
848
|
+
return {
|
|
849
|
+
FieldName: fm.fieldName,
|
|
850
|
+
Value: fm.value
|
|
851
|
+
};
|
|
852
|
+
})
|
|
853
|
+
});
|
|
854
|
+
if (result.Success) {
|
|
855
|
+
// merge was successful, so refresh the grid
|
|
856
|
+
this.selectedKeys = [];
|
|
857
|
+
this.recordsToCompare = [];
|
|
858
|
+
this.mergeMode = false;
|
|
859
|
+
this.compareMode = false;
|
|
860
|
+
// close the dialogs
|
|
861
|
+
this.isCompareDialogOpened = false;
|
|
862
|
+
this.isConfirmDialogOpen = false;
|
|
863
|
+
// refresh the grid
|
|
864
|
+
this.Refresh(this.Params);
|
|
865
|
+
}
|
|
866
|
+
else {
|
|
867
|
+
// the merge failed, so show an error message
|
|
868
|
+
this.isConfirmDialogOpen = false;
|
|
869
|
+
this.CreateSimpleNotification("Error merging records: " + result.OverallStatus, 'error', 5000);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
else {
|
|
874
|
+
this.isConfirmDialogOpen = false;
|
|
875
|
+
// close the dialog and let the user continue to work on the merge, so don't close the compare dialog
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
closeCompareDialog(event) {
|
|
880
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
881
|
+
console.log(event);
|
|
882
|
+
switch (event) {
|
|
883
|
+
case 'merge':
|
|
884
|
+
// user has requested to merge the records and retain the selected record from the compare records component, so run the merge
|
|
885
|
+
// first, confirm with the user to make 100% sure they want to do this as it is irreversible
|
|
886
|
+
this.isConfirmDialogOpen = true;
|
|
887
|
+
break;
|
|
888
|
+
default: // close and cancel
|
|
889
|
+
this.selectedKeys = [];
|
|
890
|
+
this.recordsToCompare = [];
|
|
891
|
+
this.mergeMode = false;
|
|
892
|
+
this.compareMode = false;
|
|
893
|
+
this.isCompareDialogOpened = false;
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
doExcelExport() {
|
|
899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
+
if (this.kendoExcelExport === null)
|
|
901
|
+
throw new Error("kendoExcelExport is null, cannot export data");
|
|
902
|
+
try {
|
|
903
|
+
this.CreateSimpleNotification("Working on the export, will notify you when it is complete...", 'info', 2000);
|
|
904
|
+
const data = yield this.getExportData();
|
|
905
|
+
// we have the data.
|
|
906
|
+
const cols = this.viewColumns.filter((vc) => vc.hidden === false);
|
|
907
|
+
this.exportColumns = cols;
|
|
908
|
+
this.exportData = data;
|
|
909
|
+
// before we call the save, we need to let Angular do its thing that will result in the kendoExcelExport component binding properly to
|
|
910
|
+
// the exportColumns and exportData arrays. So we wait for the next tick before we call save()
|
|
911
|
+
setTimeout(() => {
|
|
912
|
+
this.kendoExcelExport.save();
|
|
913
|
+
this.CreateSimpleNotification("Excel Export Complete", 'success', 2000);
|
|
914
|
+
}, 100);
|
|
915
|
+
}
|
|
916
|
+
catch (e) {
|
|
917
|
+
this.CreateSimpleNotification("Error exporting data", 'error', 5000);
|
|
918
|
+
LogError(e);
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
getExportData() {
|
|
923
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
924
|
+
// Get the data for the ENTIRE view, not just the current page
|
|
925
|
+
const md = new Metadata();
|
|
926
|
+
const rv = new RunView();
|
|
927
|
+
const p = Object.assign(Object.assign({}, this.Params), { IgnoreMaxRows: true, ForceAuditLog: true, AuditLogDescription: `Export of Data From ${this._viewEntity ? '"' + this._viewEntity.Get('Name') + '"' : ''} View for User ${md.CurrentUser.Email}` });
|
|
928
|
+
const result = yield rv.RunView(p);
|
|
929
|
+
if (result && result.Success) {
|
|
930
|
+
return result.Results;
|
|
931
|
+
}
|
|
932
|
+
else
|
|
933
|
+
throw new Error("Unable to get export data");
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
UserViewGridComponent.ɵfac = function UserViewGridComponent_Factory(t) { return new (t || UserViewGridComponent)(i0.ɵɵdirectiveInject(i1.FormBuilder), i0.ɵɵdirectiveInject(i2.Router)); };
|
|
938
|
+
UserViewGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserViewGridComponent, selectors: [["mj-user-view-grid"]], viewQuery: function UserViewGridComponent_Query(rf, ctx) { if (rf & 1) {
|
|
939
|
+
i0.ɵɵviewQuery(_c0, 5, GridComponent);
|
|
940
|
+
i0.ɵɵviewQuery(_c0, 5, ElementRef);
|
|
941
|
+
i0.ɵɵviewQuery(_c1, 5, ExcelExportComponent);
|
|
942
|
+
i0.ɵɵviewQuery(_c2, 5);
|
|
943
|
+
} if (rf & 2) {
|
|
944
|
+
let _t;
|
|
945
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.kendoGridElement = _t.first);
|
|
946
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.kendoGridElementRef = _t.first);
|
|
947
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.kendoExcelExport = _t.first);
|
|
948
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.recordCompareComponent = _t.first);
|
|
949
|
+
} }, inputs: { Params: "Params", BottomMargin: "BottomMargin", InEditMode: "InEditMode", EditMode: "EditMode", AutoNavigate: "AutoNavigate", AllowLoad: "AllowLoad" }, outputs: { rowClicked: "rowClicked", rowEdited: "rowEdited" }, decls: 16, vars: 19, consts: [["mjFillContainer", "", 1, "user-view-grid-wrap"], ["title", "Data"], ["mjFillContainer", "", "scrollable", "virtual", "kendoGridSelectBy", "", 3, "resizable", "data", "skip", "pageSize", "rowHeight", "loading", "height", "sortable", "sort", "reorderable", "selectable", "selectedKeys", "pageChange", "selectedKeysChange", "cellClick", "cellClose", "columnReorder", "columnResize", "selectionChange", "sortChange"], ["kendoGrid", ""], ["kendoGridToolbarTemplate", ""], [3, "width", "headerStyle", "style", 4, "ngIf"], [3, "field", "title", "width", "editable", "editor", "headerStyle", "style", 4, "ngFor", "ngForOf"], [3, "data", "fileName"], ["excelExport", ""], [3, "field", "title", 4, "ngFor", "ngForOf"], ["title", "Analysis"], [4, "ngIf"], ["kendoButton", "", 3, "click", 4, "ngIf"], ["class", "k-button k-button-md k-rounded-md k-button-solid-base k-button-solid", 3, "disabled", "click", 4, "ngIf"], ["class", "k-button k-button-md k-rounded-md k-button-solid-base k-button-solid", 3, "click", 4, "ngIf"], ["kendoButton", "", 3, "primary", "click", 4, "ngIf"], ["kendoButton", "", 3, "click"], [3, "icon"], [1, "k-button", "k-button-md", "k-rounded-md", "k-button-solid-base", "k-button-solid", 3, "disabled", "click"], [1, "k-button", "k-button-md", "k-rounded-md", "k-button-solid-base", "k-button-solid", 3, "click"], ["kendoButton", "", 3, "primary", "click"], [3, "width", "headerStyle"], [3, "field", "title", "width", "editable", "editor", "headerStyle"], ["kendoGridFooterTemplate", ""], [2, "font-size", "smaller", "font-weight", "normal"], [3, "field", "title"], [1, "k-overlay"], ["title", "Compare Records", 3, "minHeight", "minWidth", "resizable", "close", 4, "ngIf"], ["title", "Compare Records", 3, "minHeight", "minWidth", "resizable", "close"], [1, "k-d-flex", "k-flex-col", "k-justify-content-between", "k-h-full"], [3, "entityName", "recordsToCompare", "visibleColumns", "selectionMode"], ["recordCompareRef", ""], [1, "k-actions", "k-actions-end"], ["kendoButton", "", "type", "button", 3, "click", 4, "ngIf"], ["kendoButton", "", "themeColor", "primary", "type", "button", 3, "click", 4, "ngIf"], ["title", "Confirm Choice", 3, "minWidth", "width", "close", 4, "ngIf"], ["kendoButton", "", "type", "button", 3, "click"], ["kendoButton", "", "themeColor", "primary", "type", "button", 3, "click"], ["title", "Confirm Choice", 3, "minWidth", "width", "close"], [2, "margin", "30px", "text-align", "center"], ["kendoButton", "", "themeColor", "primary", 3, "click"]], template: function UserViewGridComponent_Template(rf, ctx) { if (rf & 1) {
|
|
950
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "kendo-tabstrip")(2, "kendo-tabstrip-tab", 1)(3, "kendo-grid", 2, 3);
|
|
951
|
+
i0.ɵɵlistener("pageChange", function UserViewGridComponent_Template_kendo_grid_pageChange_3_listener($event) { return ctx.pageChange($event); })("selectedKeysChange", function UserViewGridComponent_Template_kendo_grid_selectedKeysChange_3_listener($event) { return ctx.selectedKeys = $event; })("cellClick", function UserViewGridComponent_Template_kendo_grid_cellClick_3_listener($event) { return ctx.cellClickHandler($event); })("cellClose", function UserViewGridComponent_Template_kendo_grid_cellClose_3_listener($event) { return ctx.cellCloseHandler($event); })("columnReorder", function UserViewGridComponent_Template_kendo_grid_columnReorder_3_listener($event) { return ctx.columnReorder($event); })("columnResize", function UserViewGridComponent_Template_kendo_grid_columnResize_3_listener($event) { return ctx.columnResize($event); })("selectionChange", function UserViewGridComponent_Template_kendo_grid_selectionChange_3_listener($event) { return ctx.selectionChange($event); })("sortChange", function UserViewGridComponent_Template_kendo_grid_sortChange_3_listener($event) { return ctx.sortChanged($event); });
|
|
952
|
+
i0.ɵɵtemplate(5, UserViewGridComponent_ng_template_5_Template, 8, 8, "ng-template", 4)(6, UserViewGridComponent_kendo_grid_checkbox_column_6_Template, 1, 6, "kendo-grid-checkbox-column", 5)(7, UserViewGridComponent_kendo_grid_column_7_Template, 2, 10, "kendo-grid-column", 6);
|
|
953
|
+
i0.ɵɵelementStart(8, "kendo-excelexport", 7, 8);
|
|
954
|
+
i0.ɵɵtemplate(10, UserViewGridComponent_kendo_excelexport_column_10_Template, 1, 2, "kendo-excelexport-column", 9);
|
|
955
|
+
i0.ɵɵelementEnd()()();
|
|
956
|
+
i0.ɵɵelementStart(11, "kendo-tabstrip-tab", 10)(12, "div")(13, "span");
|
|
957
|
+
i0.ɵɵtext(14, " hi ");
|
|
958
|
+
i0.ɵɵelementEnd()()()();
|
|
959
|
+
i0.ɵɵtemplate(15, UserViewGridComponent_div_15_Template, 3, 1, "div", 11);
|
|
960
|
+
i0.ɵɵelementEnd();
|
|
961
|
+
} if (rf & 2) {
|
|
962
|
+
i0.ɵɵadvance(3);
|
|
963
|
+
i0.ɵɵproperty("resizable", true)("data", ctx.gridView)("skip", ctx.skip)("pageSize", ctx.pageSize)("rowHeight", 36)("loading", ctx.isLoading)("height", ctx.gridHeight)("sortable", true)("sort", ctx.sortSettings)("resizable", true)("reorderable", true)("selectable", true)("selectedKeys", ctx.selectedKeys);
|
|
964
|
+
i0.ɵɵadvance(3);
|
|
965
|
+
i0.ɵɵproperty("ngIf", ctx.compareMode || ctx.mergeMode);
|
|
966
|
+
i0.ɵɵadvance();
|
|
967
|
+
i0.ɵɵproperty("ngForOf", ctx.visibleColumns);
|
|
968
|
+
i0.ɵɵadvance();
|
|
969
|
+
i0.ɵɵproperty("data", ctx.exportData)("fileName", (ctx._viewEntity ? ctx._viewEntity.Get("Name") : ctx._entityInfo == null ? null : ctx._entityInfo.Name) + ".xlsx");
|
|
970
|
+
i0.ɵɵadvance(2);
|
|
971
|
+
i0.ɵɵproperty("ngForOf", ctx.exportColumns);
|
|
972
|
+
i0.ɵɵadvance(5);
|
|
973
|
+
i0.ɵɵproperty("ngIf", ctx.isCompareDialogOpened);
|
|
974
|
+
} }, dependencies: [i3.NgForOf, i3.NgIf, i4.GridComponent, i4.ToolbarTemplateDirective, i4.SelectionDirective, i4.ColumnComponent, i4.FooterTemplateDirective, i4.CheckboxColumnComponent, i5.DialogComponent, i5.DialogActionsComponent, i5.WindowComponent, i6.ExcelExportComponent, i6.ColumnComponent, i7.ButtonComponent, i8.CompareRecordsComponent, i9.FillContainer, i10.SVGIconComponent, i11.TabStripComponent, i11.TabStripTabComponent, i3.DecimalPipe], styles: [".user-view-grid-wrap[_ngcontent-%COMP%] {\r\n height: calc(100vh-20px);\r\n}\r\n\r\n.user-view-grid-column-header[_ngcontent-%COMP%] {\r\n background-color: #a9c2af;\r\n font-size: 20pt;\r\n font-weight: bold;\r\n}"] });
|
|
975
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserViewGridComponent, [{
|
|
976
|
+
type: Component,
|
|
977
|
+
args: [{ selector: 'mj-user-view-grid', template: "<div class=\"user-view-grid-wrap\" mjFillContainer>\r\n <kendo-tabstrip>\r\n <kendo-tabstrip-tab title=\"Data\">\r\n <kendo-grid #kendoGrid\r\n mjFillContainer\r\n [resizable]=\"true\"\r\n [data]=\"gridView\" \r\n [skip]=\"skip\"\r\n [pageSize]=\"pageSize\"\r\n scrollable=\"virtual\"\r\n [rowHeight]=\"36\"\r\n (pageChange)=\"pageChange($event)\"\r\n [loading]=\"isLoading\"\r\n [height]=\"gridHeight\"\r\n [sortable]=\"true\"\r\n [sort]=\"sortSettings\" \r\n [resizable]=\"true\"\r\n [reorderable]=\"true\"\r\n [selectable]=\"true\"\r\n kendoGridSelectBy\r\n [(selectedKeys)]=\"selectedKeys\"\r\n (cellClick)=\"cellClickHandler($event)\"\r\n (cellClose)=\"cellCloseHandler($event)\"\r\n (columnReorder)=\"columnReorder($event)\"\r\n (columnResize)=\"columnResize($event)\"\r\n (selectionChange)=\"selectionChange($event)\"\r\n (sortChange)=\"sortChanged($event)\"\r\n >\r\n <ng-template kendoGridToolbarTemplate>\r\n <button kendoButton *ngIf=\"!compareMode && !mergeMode\" (click)=\"doExcelExport()\" >\r\n <kendo-svgicon [icon]=\"kendoSVGIcon('fileExcel')\"></kendo-svgicon>\r\n Export to Excel\r\n </button>\r\n <!-- 3 buttons for compare. First one only shows when comparison is going on in the grid, the next one is the one the user starts the process with before records are selected, last one is to cancel the pending compare. -->\r\n <button (click)=\"enableMergeOrCompare(false, 'compare')\" *ngIf=\"!compareMode && !mergeMode\" [disabled]=\"compareMode && recordsToCompare.length < 2\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Compare</button>\r\n <button (click)=\"enableMergeOrCompare(false, 'compare')\" *ngIf=\"compareMode\" [disabled]=\"compareMode && recordsToCompare.length < 2\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Compare</button>\r\n <button (click)=\"enableMergeOrCompare(true, 'compare')\" *ngIf=\"compareMode\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Cancel</button>\r\n \r\n <!-- 3 buttons for merge. First one only shows when merge is getting goin in the grid, the next one is the one the user starts the process with before records are selected, last one is to cancel the pending merge. -->\r\n <button (click)=\"enableMergeOrCompare(false, 'merge')\" *ngIf=\"mergeMode\" [disabled]=\"mergeMode && recordsToCompare.length < 2\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Merge</button>\r\n <button (click)=\"enableMergeOrCompare(false, 'merge')\" *ngIf=\"!mergeMode && !compareMode\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Merge</button>\r\n <button (click)=\"enableMergeOrCompare(true, 'merge')\" *ngIf=\"mergeMode\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Cancel</button>\r\n <button\r\n kendoButton\r\n [primary]=\"true\"\r\n *ngIf=\"showRefreshButton && !compareMode && !mergeMode\"\r\n (click)=\"RefreshFromSavedParams()\">\r\n <kendo-svgicon [icon]=\"kendoSVGIcon('arrowRotateCcwSmall')\"></kendo-svgicon>\r\n Refresh\r\n </button>\r\n </ng-template>\r\n \r\n <kendo-grid-checkbox-column \r\n *ngIf=\"compareMode || mergeMode\" \r\n [width]=\"50\" \r\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\" \r\n [style]=\"{'text-align': 'center', 'vertical-align': 'center'}\">\r\n </kendo-grid-checkbox-column>\r\n \r\n <kendo-grid-column \r\n *ngFor=\"let item of visibleColumns\" \r\n [field]=\"item.Name\" \r\n [title]=\"GetColumnTitle(item)\"\r\n [width]=\"item.width ? item.width : 100\"\r\n [editable]=\"item.EntityField.AllowUpdateAPI\"\r\n [editor]=\"getEditor(item.EntityField)\"\r\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\"\r\n [style]=\"this.GetColumnCellStyle(item)\"\r\n >\r\n <ng-template *ngIf=\"item===visibleColumns[0]\" kendoGridFooterTemplate >\r\n {{this.viewData.length | number}}{{this.totalRowCount > this.viewData.length ? ' of ' + (this.totalRowCount | number) : ' rows'}}<br/><span style=\"font-size: smaller; font-weight: normal;\">{{viewExecutionTime | number:'1.2-2'}} seconds</span>\r\n </ng-template>\r\n </kendo-grid-column>\r\n \r\n <kendo-excelexport #excelExport [data]=\"exportData\" [fileName]=\"(_viewEntity ? _viewEntity.Get('Name') : _entityInfo?.Name) + '.xlsx'\">\r\n <kendo-excelexport-column *ngFor=\"let exportCol of exportColumns\" [field]=\"exportCol.Name\" [title]=\"exportCol.Name\">\r\n </kendo-excelexport-column>\r\n </kendo-excelexport>\r\n </kendo-grid> \r\n </kendo-tabstrip-tab>\r\n <kendo-tabstrip-tab title=\"Analysis\">\r\n <div>\r\n <span>\r\n hi\r\n </span>\r\n </div>\r\n </kendo-tabstrip-tab>\r\n </kendo-tabstrip>\r\n \r\n\r\n\r\n <div *ngIf=\"isCompareDialogOpened\">\r\n <div class=\"k-overlay\"></div>\r\n <kendo-window\r\n [minHeight]=\"300\"\r\n [minWidth]=\"400\"\r\n [resizable]=\"true\"\r\n (close)=\"closeCompareDialog($event)\"\r\n title=\"Compare Records\"\r\n *ngIf=\"isCompareDialogOpened\"\r\n >\r\n <div class=\"k-d-flex k-flex-col k-justify-content-between k-h-full\">\r\n <div>\r\n <mj-compare-records\r\n #recordCompareRef\r\n [entityName]=\"_entityInfo ? _entityInfo.Name : ''\"\r\n [recordsToCompare]=\"recordsToCompare\" \r\n [visibleColumns]=\"visibleColumns\" \r\n [selectionMode]=\"mergeMode ? true : false\"\r\n >\r\n </mj-compare-records>\r\n </div>\r\n </div>\r\n <div class=\"k-actions k-actions-end\">\r\n <button *ngIf=\"compareMode\" kendoButton type=\"button\" (click)=\"closeCompareDialog('close')\">Close</button>\r\n <button *ngIf=\"mergeMode\"kendoButton type=\"button\" (click)=\"closeCompareDialog('cancel')\">Cancel</button>\r\n <button *ngIf=\"mergeMode\"\r\n kendoButton\r\n themeColor=\"primary\"\r\n type=\"button\"\r\n (click)=\"closeCompareDialog('merge')\"\r\n >\r\n Merge Records\r\n </button>\r\n </div> \r\n <kendo-dialog\r\n title=\"Confirm Choice\"\r\n *ngIf=\"isConfirmDialogOpen\"\r\n (close)=\"closeConfirmMergeDialog('cancel')\"\r\n [minWidth]=\"250\"\r\n [width]=\"450\"\r\n >\r\n <p style=\"margin: 30px; text-align: center;\">\r\n Are you sure you want to merge the records? This action cannot be undone. If you select \"Yes\", the records will be merged and the duplicate records will be deleted.\r\n </p>\r\n <kendo-dialog-actions>\r\n <button kendoButton (click)=\"closeConfirmMergeDialog('no')\">No</button>\r\n <button kendoButton (click)=\"closeConfirmMergeDialog('yes')\" themeColor=\"primary\">\r\n Yes\r\n </button>\r\n </kendo-dialog-actions>\r\n </kendo-dialog>\r\n </kendo-window>\r\n </div> \r\n</div>\r\n", styles: [".user-view-grid-wrap {\r\n height: calc(100vh-20px);\r\n}\r\n\r\n.user-view-grid-column-header {\r\n background-color: #a9c2af;\r\n font-size: 20pt;\r\n font-weight: bold;\r\n}"] }]
|
|
978
|
+
}], () => [{ type: i1.FormBuilder }, { type: i2.Router }], { Params: [{
|
|
979
|
+
type: Input
|
|
980
|
+
}], BottomMargin: [{
|
|
981
|
+
type: Input
|
|
982
|
+
}], InEditMode: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}], EditMode: [{
|
|
985
|
+
type: Input
|
|
986
|
+
}], AutoNavigate: [{
|
|
987
|
+
type: Input
|
|
988
|
+
}], rowClicked: [{
|
|
989
|
+
type: Output
|
|
990
|
+
}], rowEdited: [{
|
|
991
|
+
type: Output
|
|
992
|
+
}], kendoGridElement: [{
|
|
993
|
+
type: ViewChild,
|
|
994
|
+
args: ['kendoGrid', { read: GridComponent }]
|
|
995
|
+
}], kendoGridElementRef: [{
|
|
996
|
+
type: ViewChild,
|
|
997
|
+
args: ['kendoGrid', { read: ElementRef }]
|
|
998
|
+
}], kendoExcelExport: [{
|
|
999
|
+
type: ViewChild,
|
|
1000
|
+
args: ['excelExport', { read: ExcelExportComponent }]
|
|
1001
|
+
}], recordCompareComponent: [{
|
|
1002
|
+
type: ViewChild,
|
|
1003
|
+
args: ['recordCompareRef', { static: false }]
|
|
1004
|
+
}], AllowLoad: [{
|
|
1005
|
+
type: Input
|
|
1006
|
+
}] }); })();
|
|
1007
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserViewGridComponent, { className: "UserViewGridComponent", filePath: "src\\lib\\ng-user-view-grid.component.ts", lineNumber: 42 }); })();
|