@esfaenza/es-table 11.2.21 → 11.2.22-beta1
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/bundles/esfaenza-es-table.umd.js +2265 -557
- package/bundles/esfaenza-es-table.umd.js.map +1 -1
- package/bundles/esfaenza-es-table.umd.min.js +2 -2
- package/bundles/esfaenza-es-table.umd.min.js.map +1 -1
- package/esfaenza-es-table.d.ts +5 -5
- package/esfaenza-es-table.metadata.json +1 -1
- package/esm2015/esfaenza-es-table.js +6 -6
- package/esm2015/lib/directives/es_td.directive.js +2 -4
- package/esm2015/lib/directives/es_th.directive.js +23 -7
- package/esm2015/lib/domain/externals/classes/CornerMenuOption.js +4 -0
- package/esm2015/lib/domain/externals/classes/EsTableColumnsDefinition.js +31 -0
- package/esm2015/lib/domain/externals/classes/EsTableOperationDefinition.js +22 -0
- package/esm2015/lib/domain/externals/classes/appsearch/AppOrdering.js +16 -0
- package/esm2015/lib/domain/externals/classes/appsearch/AppSearch.js +35 -0
- package/esm2015/lib/domain/externals/classes/appsearch/GenericItem.js +11 -0
- package/esm2015/lib/domain/externals/classes/appsearch/Group.js +17 -0
- package/esm2015/lib/domain/externals/classes/appsearch/GroupAggregation.js +16 -0
- package/esm2015/lib/domain/externals/classes/appsearch/GroupFilter.js +14 -0
- package/esm2015/lib/domain/externals/classes/appsearch/GroupOrAggregation.js +16 -0
- package/esm2015/lib/domain/externals/classes/appsearch/ItemsSelection.js +23 -0
- package/esm2015/lib/domain/externals/classes/report/ReportColumn.js +4 -0
- package/esm2015/lib/domain/externals/classes/report/ReportDefinition.js +4 -0
- package/esm2015/lib/domain/externals/classes/report/ReportOrder.js +4 -0
- package/esm2015/lib/domain/externals/classes/report/ReportParam.js +4 -0
- package/esm2015/lib/domain/externals/classes/report/ReportResult.js +4 -0
- package/esm2015/lib/domain/externals/classes/report/ReportRow.js +4 -0
- package/esm2015/lib/domain/externals/index.js +18 -0
- package/esm2015/lib/domain/index.js +3 -16
- package/esm2015/lib/domain/internals/classes/CacheTriptic.js +16 -0
- package/esm2015/lib/domain/internals/classes/EsTableColumn.js +24 -0
- package/esm2015/lib/domain/internals/classes/GroupPager.js +21 -0
- package/esm2015/lib/domain/internals/classes/GroupRouteFragment.js +17 -0
- package/esm2015/lib/domain/internals/classes/ThAggregation.js +16 -0
- package/esm2015/lib/domain/internals/index.js +6 -0
- package/esm2015/lib/es-table.module.js +9 -4
- package/esm2015/lib/es_table.component.js +1820 -325
- package/esm2015/lib/es_table.component.loc.js +6 -7
- package/esm2015/lib/es_td.component.js +28 -43
- package/esm2015/lib/es_th.component.js +16 -44
- package/esm2015/lib/models/EsTableDefaultable.js +4 -0
- package/esm2015/lib/models/EsTableModuleConfig.js +2 -4
- package/esm2015/lib/pager/table_pager.component.js +47 -26
- package/esm2015/lib/pager/table_pager.component.loc.js +5 -7
- package/esm2015/lib/tokens.js +6 -4
- package/esm2015/public-api.js +3 -2
- package/fesm2015/esfaenza-es-table.js +2152 -552
- package/fesm2015/esfaenza-es-table.js.map +1 -1
- package/lib/directives/es_td.directive.d.ts +1 -3
- package/lib/directives/es_th.directive.d.ts +18 -5
- package/lib/domain/externals/classes/CornerMenuOption.d.ts +7 -0
- package/lib/domain/{classes → externals/classes}/EsTableColumnsDefinition.d.ts +5 -7
- package/lib/domain/{classes → externals/classes}/EsTableOperationDefinition.d.ts +1 -3
- package/lib/domain/{classes → externals/classes/appsearch}/AppOrdering.d.ts +0 -0
- package/lib/domain/externals/classes/appsearch/AppSearch.d.ts +67 -0
- package/lib/domain/externals/classes/appsearch/GenericItem.d.ts +13 -0
- package/lib/domain/externals/classes/appsearch/Group.d.ts +17 -0
- package/lib/domain/externals/classes/appsearch/GroupAggregation.d.ts +14 -0
- package/lib/domain/externals/classes/appsearch/GroupFilter.d.ts +12 -0
- package/lib/domain/externals/classes/appsearch/GroupOrAggregation.d.ts +14 -0
- package/lib/domain/externals/classes/appsearch/ItemsSelection.d.ts +22 -0
- package/lib/domain/externals/classes/report/ReportColumn.d.ts +15 -0
- package/lib/domain/externals/classes/report/ReportDefinition.d.ts +24 -0
- package/lib/domain/externals/classes/report/ReportOrder.d.ts +7 -0
- package/lib/domain/externals/classes/report/ReportParam.d.ts +40 -0
- package/lib/domain/externals/classes/report/ReportResult.d.ts +12 -0
- package/lib/domain/externals/classes/report/ReportRow.d.ts +5 -0
- package/lib/domain/externals/index.d.ts +17 -0
- package/lib/domain/index.d.ts +2 -15
- package/lib/domain/internals/classes/CacheTriptic.d.ts +14 -0
- package/lib/domain/{classes → internals/classes}/EsTableColumn.d.ts +6 -4
- package/lib/domain/internals/classes/GroupPager.d.ts +22 -0
- package/lib/domain/internals/classes/GroupRouteFragment.d.ts +15 -0
- package/lib/domain/internals/classes/ThAggregation.d.ts +14 -0
- package/lib/domain/internals/index.d.ts +5 -0
- package/lib/es_table.component.d.ts +462 -62
- package/lib/es_table.component.loc.d.ts +2 -6
- package/lib/es_td.component.d.ts +14 -36
- package/lib/es_th.component.d.ts +21 -61
- package/lib/models/EsTableDefaultable.d.ts +19 -0
- package/lib/models/EsTableModuleConfig.d.ts +8 -7
- package/lib/pager/table_pager.component.d.ts +25 -30
- package/lib/pager/table_pager.component.loc.d.ts +2 -6
- package/lib/tokens.d.ts +6 -3
- package/package.json +2 -1
- package/public-api.d.ts +2 -1
- package/esm2015/lib/domain/classes/AppOrdering.js +0 -16
- package/esm2015/lib/domain/classes/AppSearch.js +0 -35
- package/esm2015/lib/domain/classes/CornerMenuOption.js +0 -6
- package/esm2015/lib/domain/classes/EsTableColumn.js +0 -22
- package/esm2015/lib/domain/classes/EsTableColumnsDefinition.js +0 -31
- package/esm2015/lib/domain/classes/EsTableOperationDefinition.js +0 -24
- package/esm2015/lib/domain/classes/GenericItem.js +0 -15
- package/esm2015/lib/domain/classes/IAppSearch.js +0 -2
- package/esm2015/lib/domain/classes/ItemsSelection.js +0 -25
- package/esm2015/lib/domain/classes/ReportColumn.js +0 -6
- package/esm2015/lib/domain/classes/ReportDefinition.js +0 -6
- package/esm2015/lib/domain/classes/ReportOrder.js +0 -6
- package/esm2015/lib/domain/classes/ReportParam.js +0 -6
- package/esm2015/lib/domain/classes/ReportResult.js +0 -6
- package/esm2015/lib/domain/classes/ReportRow.js +0 -6
- package/lib/domain/classes/AppSearch.d.ts +0 -76
- package/lib/domain/classes/CornerMenuOption.d.ts +0 -13
- package/lib/domain/classes/GenericItem.d.ts +0 -25
- package/lib/domain/classes/IAppSearch.d.ts +0 -67
- package/lib/domain/classes/ItemsSelection.d.ts +0 -27
- package/lib/domain/classes/ReportColumn.d.ts +0 -29
- package/lib/domain/classes/ReportDefinition.d.ts +0 -46
- package/lib/domain/classes/ReportOrder.d.ts +0 -13
- package/lib/domain/classes/ReportParam.d.ts +0 -76
- package/lib/domain/classes/ReportResult.d.ts +0 -22
- package/lib/domain/classes/ReportRow.d.ts +0 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@esfaenza/extensions'), require('@esfaenza/localizations'), require('@esfaenza/preferences'), require('@angular/platform-browser'), require('@angular/common'), require('@angular/router'), require('ngx-bootstrap/modal'), require('ngx-bootstrap/dropdown'), require('@ctrl/ngx-csv'), require('@esfaenza/ngx-contextmenu')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/es-table', ['exports', '@angular/core', '@angular/forms', '@esfaenza/extensions', '@esfaenza/localizations', '@esfaenza/preferences', '@angular/platform-browser', '@angular/common', '@angular/router', 'ngx-bootstrap/modal', 'ngx-bootstrap/dropdown', '@ctrl/ngx-csv', '@esfaenza/ngx-contextmenu'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza['es-table'] = {}), global.ng.core, global.ng.forms, global.extensions, global.localizations, global.preferences, global.ng.platformBrowser, global.ng.common, global.ng.router, global.modal, global.dropdown, global.ngxCsv, global.ngxContextmenu));
|
|
5
|
-
}(this, (function (exports, core, forms, extensions, localizations, preferences, platformBrowser, common, router, modal, dropdown, ngxCsv, ngxContextmenu) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@esfaenza/extensions'), require('@esfaenza/localizations'), require('@esfaenza/preferences'), require('@angular/platform-browser'), require('@angular/common'), require('@angular/router'), require('@angular/material/select'), require('@angular/material/input'), require('ngx-bootstrap/modal'), require('ngx-bootstrap/dropdown'), require('@ctrl/ngx-csv'), require('@esfaenza/ngx-contextmenu')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/es-table', ['exports', '@angular/core', '@angular/forms', '@esfaenza/extensions', '@esfaenza/localizations', '@esfaenza/preferences', '@angular/platform-browser', '@angular/common', '@angular/router', '@angular/material/select', '@angular/material/input', 'ngx-bootstrap/modal', 'ngx-bootstrap/dropdown', '@ctrl/ngx-csv', '@esfaenza/ngx-contextmenu'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza['es-table'] = {}), global.ng.core, global.ng.forms, global.extensions, global.localizations, global.preferences, global.ng.platformBrowser, global.ng.common, global.ng.router, global.ng.material.select, global.ng.material.input, global.modal, global.dropdown, global.ngxCsv, global.ngxContextmenu));
|
|
5
|
+
}(this, (function (exports, core, forms, extensions, localizations, preferences, platformBrowser, common, router, select, input, modal, dropdown, ngxCsv, ngxContextmenu) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -366,9 +366,7 @@
|
|
|
366
366
|
return AppSearch;
|
|
367
367
|
}());
|
|
368
368
|
|
|
369
|
-
/**
|
|
370
|
-
* Classe che identifica una colonna. Utilizzata in modalità "Colonne dinamiche"
|
|
371
|
-
*/
|
|
369
|
+
/** Classe che identifica una colonna. Utilizzata in modalità "Colonne dinamiche" */
|
|
372
370
|
var EsTableColumnsDefinition = /** @class */ (function () {
|
|
373
371
|
/**
|
|
374
372
|
* Costruttore
|
|
@@ -383,8 +381,9 @@
|
|
|
383
381
|
* @param {boolean} visible Visibilità o meno della colonna
|
|
384
382
|
* @param {string} clss Classe da applicare sia ai TD che ai TH relativi a questa colonna
|
|
385
383
|
* @param {boolean} orderable Indica se la colonna è ordinabile o no (nel senso ASC / DESC / NONE)
|
|
384
|
+
* @param {boolean} headerWraps Indica se il testo dell'header dev'essere wrappato all'interno del th. Di default no.
|
|
386
385
|
*/
|
|
387
|
-
function EsTableColumnsDefinition(description, propertyName, routePath, routeParameterProperties, dataOrder, columnOrder, visible, clss, orderable) {
|
|
386
|
+
function EsTableColumnsDefinition(description, propertyName, routePath, routeParameterProperties, dataOrder, columnOrder, visible, clss, orderable, headerWraps) {
|
|
388
387
|
if (routePath === void 0) { routePath = null; }
|
|
389
388
|
if (routeParameterProperties === void 0) { routeParameterProperties = null; }
|
|
390
389
|
if (dataOrder === void 0) { dataOrder = null; }
|
|
@@ -392,6 +391,7 @@
|
|
|
392
391
|
if (visible === void 0) { visible = true; }
|
|
393
392
|
if (clss === void 0) { clss = null; }
|
|
394
393
|
if (orderable === void 0) { orderable = true; }
|
|
394
|
+
if (headerWraps === void 0) { headerWraps = false; }
|
|
395
395
|
this.description = description;
|
|
396
396
|
this.propertyName = propertyName;
|
|
397
397
|
this.routePath = routePath;
|
|
@@ -401,92 +401,73 @@
|
|
|
401
401
|
this.visible = visible;
|
|
402
402
|
this.clss = clss;
|
|
403
403
|
this.orderable = orderable;
|
|
404
|
+
this.headerWraps = headerWraps;
|
|
404
405
|
}
|
|
405
406
|
return EsTableColumnsDefinition;
|
|
406
407
|
}());
|
|
407
408
|
|
|
408
|
-
/**
|
|
409
|
-
* Classe che definisce un oggetto generico come lista di proprietà-valore
|
|
410
|
-
*/
|
|
409
|
+
/** Classe che definisce un oggetto generico come lista di proprietà-valore */
|
|
411
410
|
var GenericItem = /** @class */ (function () {
|
|
412
|
-
/**
|
|
413
|
-
* @ignore
|
|
414
|
-
*/
|
|
411
|
+
/** @ignore */
|
|
415
412
|
function GenericItem() {
|
|
416
413
|
this._selected = false;
|
|
417
414
|
this._rowClass = null;
|
|
418
|
-
this.
|
|
415
|
+
this._hash = null;
|
|
419
416
|
this.properties = {};
|
|
420
417
|
}
|
|
421
418
|
return GenericItem;
|
|
422
419
|
}());
|
|
423
420
|
|
|
424
|
-
/**
|
|
425
|
-
* Indica un'opzione cliccabile nel Corner Menù della tabella (il menù richiamabile dai 3 pallini verticli in alto a destra)
|
|
426
|
-
*/
|
|
421
|
+
/** Indica un'opzione cliccabile nel Corner Menù della tabella (il menù richiamabile dai 3 pallini verticli in alto a destra) */
|
|
427
422
|
var CornerMenuOption = /** @class */ (function () {
|
|
428
423
|
function CornerMenuOption() {
|
|
429
424
|
}
|
|
430
425
|
return CornerMenuOption;
|
|
431
426
|
}());
|
|
432
427
|
|
|
433
|
-
/**
|
|
434
|
-
* Definizione generica di un report che può o no disporre di paginazione/export e la cui richiesta è basata su uno o più parametri
|
|
435
|
-
*/
|
|
428
|
+
/** Definizione generica di un report che può o no disporre di paginazione/export e la cui richiesta è basata su uno o più parametri */
|
|
436
429
|
var ReportDefinition = /** @class */ (function () {
|
|
437
430
|
function ReportDefinition() {
|
|
438
431
|
}
|
|
439
432
|
return ReportDefinition;
|
|
440
433
|
}());
|
|
441
434
|
|
|
442
|
-
/**
|
|
443
|
-
* Classe che identifica una direttiva di ordinamento per un report
|
|
444
|
-
*/
|
|
435
|
+
/** Classe che identifica una direttiva di ordinamento per un report */
|
|
445
436
|
var ReportOrder = /** @class */ (function () {
|
|
446
437
|
function ReportOrder() {
|
|
447
438
|
}
|
|
448
439
|
return ReportOrder;
|
|
449
440
|
}());
|
|
450
441
|
|
|
451
|
-
/**
|
|
452
|
-
* Classe che rappresenta una colonna di un report
|
|
453
|
-
*/
|
|
442
|
+
/** Classe che rappresenta una colonna di un report */
|
|
454
443
|
var ReportColumn = /** @class */ (function () {
|
|
455
444
|
function ReportColumn() {
|
|
456
445
|
}
|
|
457
446
|
return ReportColumn;
|
|
458
447
|
}());
|
|
459
448
|
|
|
460
|
-
/**
|
|
461
|
-
* Classe che rappresenta una lista di oggetti generati da un report
|
|
462
|
-
*/
|
|
449
|
+
/** Classe che rappresenta una lista di oggetti generati da un report */
|
|
463
450
|
var ReportResult = /** @class */ (function () {
|
|
464
451
|
function ReportResult() {
|
|
465
452
|
}
|
|
466
453
|
return ReportResult;
|
|
467
454
|
}());
|
|
468
455
|
|
|
469
|
-
/**
|
|
470
|
-
* Classe che rappresenta i valori delle proprietà di un oggetto Report
|
|
471
|
-
*/
|
|
456
|
+
/** Classe che rappresenta i valori delle proprietà di un oggetto Report */
|
|
472
457
|
var ReportRow = /** @class */ (function () {
|
|
473
458
|
function ReportRow() {
|
|
474
459
|
}
|
|
475
460
|
return ReportRow;
|
|
476
461
|
}());
|
|
477
462
|
|
|
478
|
-
/**
|
|
479
|
-
* Classe che identifica un parametro generico per un report
|
|
480
|
-
*/
|
|
463
|
+
/** Classe che identifica un parametro generico per un report */
|
|
481
464
|
var ReportParam = /** @class */ (function () {
|
|
482
465
|
function ReportParam() {
|
|
483
466
|
}
|
|
484
467
|
return ReportParam;
|
|
485
468
|
}());
|
|
486
469
|
|
|
487
|
-
/**
|
|
488
|
-
* Indica operazioni dinamiche generiche che possono essere effettuate per riga. Appaiono come colonne extra sul lato sinistro della tabella
|
|
489
|
-
*/
|
|
470
|
+
/** Indica operazioni dinamiche generiche che possono essere effettuate per riga. Appaiono come colonne extra sul lato sinistro della tabella */
|
|
490
471
|
var EsTableOperationDefinition = /** @class */ (function () {
|
|
491
472
|
/**
|
|
492
473
|
* Costruttore
|
|
@@ -509,9 +490,115 @@
|
|
|
509
490
|
return EsTableOperationDefinition;
|
|
510
491
|
}());
|
|
511
492
|
|
|
512
|
-
/**
|
|
513
|
-
|
|
514
|
-
|
|
493
|
+
/** Identifica una selezione applicabile agli oggetti presentati in una tabella */
|
|
494
|
+
var ItemsSelection = /** @class */ (function () {
|
|
495
|
+
/**
|
|
496
|
+
* Costruttore
|
|
497
|
+
*
|
|
498
|
+
* @param {T[]} selected Oggetti da considerare selezionati
|
|
499
|
+
*/
|
|
500
|
+
function ItemsSelection(selected) {
|
|
501
|
+
/** Indica se tutti gli elementi sono da considerarsi selezionati (anche quelli di altre pagine) */
|
|
502
|
+
this.all = false;
|
|
503
|
+
/** Se **all** è **true**, indica gli elementi da escludere, altrimenti è insensato */
|
|
504
|
+
this.exclusions = [];
|
|
505
|
+
/** Se **all** è **true**, indica i gruppi da escludere, altrimenti è insensato */
|
|
506
|
+
this.group_exclusions = [];
|
|
507
|
+
this.count = selected.length;
|
|
508
|
+
this.items = selected;
|
|
509
|
+
this.all = false;
|
|
510
|
+
this.exclusions = [];
|
|
511
|
+
this.groups = [];
|
|
512
|
+
this.group_exclusions = [];
|
|
513
|
+
}
|
|
514
|
+
return ItemsSelection;
|
|
515
|
+
}());
|
|
516
|
+
|
|
517
|
+
/** Classe che rappresenta un Gruppo con le proprie aggregazioni */
|
|
518
|
+
var Group = /** @class */ (function () {
|
|
519
|
+
/**
|
|
520
|
+
* Costruttore
|
|
521
|
+
*
|
|
522
|
+
* @param {string} column ID della colonna raggruppata
|
|
523
|
+
* @param {number} count Numero di elementi raggruppati sotto questa colonna
|
|
524
|
+
* @param {string} value Valore del Gruppo
|
|
525
|
+
*/
|
|
526
|
+
function Group(column, count, value) {
|
|
527
|
+
this.column = column;
|
|
528
|
+
this.count = count;
|
|
529
|
+
this.value = value;
|
|
530
|
+
this.aggregations = [];
|
|
531
|
+
}
|
|
532
|
+
return Group;
|
|
533
|
+
}());
|
|
534
|
+
|
|
535
|
+
/** Classe che rappresenta un'aggregazione */
|
|
536
|
+
var GroupAggregation = /** @class */ (function () {
|
|
537
|
+
/**
|
|
538
|
+
* Costruttore
|
|
539
|
+
*
|
|
540
|
+
* @param {string} column ID della colonna aggregata
|
|
541
|
+
* @param {'min' | 'max' | 'sum' } aggregation Aggregazione da effettuare su questa colonna
|
|
542
|
+
* @param {string} value Valore dell'aggregazione
|
|
543
|
+
*/
|
|
544
|
+
function GroupAggregation(column, aggregation, value) {
|
|
545
|
+
this.column = column;
|
|
546
|
+
this.aggregation = aggregation;
|
|
547
|
+
this.value = value;
|
|
548
|
+
}
|
|
549
|
+
return GroupAggregation;
|
|
550
|
+
}());
|
|
551
|
+
|
|
552
|
+
/** Classe che rappresenta un filtro su un gruppo */
|
|
553
|
+
var GroupFilter = /** @class */ (function () {
|
|
554
|
+
/**
|
|
555
|
+
* Costruttore
|
|
556
|
+
*
|
|
557
|
+
* @param {string} column ID della colonna gruppata per cui si richiede di filtrare
|
|
558
|
+
* @param {string} value Valore del gruppo su questa **column** per cui si richiede di filtrare
|
|
559
|
+
*/
|
|
560
|
+
function GroupFilter(column, value) {
|
|
561
|
+
this.column = column;
|
|
562
|
+
this.value = value;
|
|
563
|
+
}
|
|
564
|
+
return GroupFilter;
|
|
565
|
+
}());
|
|
566
|
+
|
|
567
|
+
/** Classe che rappresenta o un gruppo o una aggregazione su una colonna. Usata solo internamente */
|
|
568
|
+
var GroupOrAggregation = /** @class */ (function () {
|
|
569
|
+
/**
|
|
570
|
+
* Costruttore
|
|
571
|
+
*
|
|
572
|
+
* @param {string} column Colonna su cui è presente o un gruppo o un'aggregazione
|
|
573
|
+
* @param {'min' | 'max' | 'sum' } aggregation Aggregazione presente sulla **column**. Se questo campo è nullo significa che è un gruppo.
|
|
574
|
+
* @param {'string' | 'date' | 'number'} datatype Tipo di dati contenuto nella colonna **column** se non c'è alcuna aggregazione è inutile, pertanto non sarà valorizzato
|
|
575
|
+
*/
|
|
576
|
+
function GroupOrAggregation(column, aggregation, datatype) {
|
|
577
|
+
this.column = column;
|
|
578
|
+
this.aggregation = aggregation;
|
|
579
|
+
this.datatype = datatype;
|
|
580
|
+
}
|
|
581
|
+
return GroupOrAggregation;
|
|
582
|
+
}());
|
|
583
|
+
|
|
584
|
+
/** Rappresenta un trittico formato da un array e due cache relative a tale array per un accesso estremamente veloce per tutte le operazioni del caso */
|
|
585
|
+
var CacheTriptic = /** @class */ (function () {
|
|
586
|
+
/**
|
|
587
|
+
* Costruttore
|
|
588
|
+
*
|
|
589
|
+
* @param {Map<string, any>} cache Cache Chiave-Oggetto
|
|
590
|
+
* @param {Map<string, number>} index_cache Cache Indice-Oggetto
|
|
591
|
+
* @param {any[]} array Array contenente gli oggetti
|
|
592
|
+
*/
|
|
593
|
+
function CacheTriptic(cache, index_cache, array) {
|
|
594
|
+
this.cache = cache;
|
|
595
|
+
this.index_cache = index_cache;
|
|
596
|
+
this.array = array;
|
|
597
|
+
}
|
|
598
|
+
return CacheTriptic;
|
|
599
|
+
}());
|
|
600
|
+
|
|
601
|
+
/** Definizione di una colonna, utilizzato nella dialog che permette di modificare le posizioni e le visibilità */
|
|
515
602
|
var EsTableColumn = /** @class */ (function () {
|
|
516
603
|
/**
|
|
517
604
|
* Costruttore
|
|
@@ -520,68 +607,93 @@
|
|
|
520
607
|
* @param {string} description Descrizione (Header)
|
|
521
608
|
* @param {boolean} visible Indica se di default mostrarla o meno
|
|
522
609
|
* @param {boolean} fixed Indica se è una colonna fixed
|
|
610
|
+
* @param {boolean} pinned Indica se è una colonna pinnata
|
|
611
|
+
* @param {number} pinnedWidth Indica la dimensione da assegnare a questa colonna quando è pinnata
|
|
523
612
|
* @param {TemplateRef<any>} template Indica il template da usare per mostrare il testo dell'Header
|
|
524
613
|
*/
|
|
525
|
-
function EsTableColumn(id, description, visible, fixed, template) {
|
|
614
|
+
function EsTableColumn(id, description, visible, fixed, pinned, pinnedWidth, template) {
|
|
526
615
|
this.id = id;
|
|
527
616
|
this.description = description;
|
|
528
617
|
this.visible = visible;
|
|
529
618
|
this.fixed = fixed;
|
|
619
|
+
this.pinned = pinned;
|
|
620
|
+
this.pinnedWidth = pinnedWidth;
|
|
530
621
|
this.template = template;
|
|
531
622
|
}
|
|
532
623
|
return EsTableColumn;
|
|
533
624
|
}());
|
|
534
625
|
|
|
535
|
-
/**
|
|
536
|
-
|
|
537
|
-
*/
|
|
538
|
-
var ItemsSelection = /** @class */ (function () {
|
|
626
|
+
/** Classe che rappresenta un separatore da inserire fra gli oggetti dell'es-table per le operazioni di paginazione dei raggruppamenti per riga */
|
|
627
|
+
var GroupPager = /** @class */ (function () {
|
|
539
628
|
/**
|
|
540
629
|
* Costruttore
|
|
541
630
|
*
|
|
542
|
-
* @param {
|
|
631
|
+
* @param {number} groupLevel Livello del gruppo a cui questo separatore fa riferimento
|
|
632
|
+
* @param {string} parentKey Chiave del gruppo parent se esiste
|
|
633
|
+
* @param {AppSearch<any>} view Vista di ricerca collegata a questo elemento
|
|
634
|
+
* @param {'groups' | 'items'} searches Indica che cosa cerca questo separatore, se sottogruppi o oggetti
|
|
543
635
|
*/
|
|
544
|
-
function
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
this.
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
this.exclusions = [];
|
|
553
|
-
this.count = selected.length;
|
|
554
|
-
this.items = selected;
|
|
555
|
-
this.all = false;
|
|
556
|
-
this.exclusions = [];
|
|
636
|
+
function GroupPager(_grouplevel, _thisRoute, _parent, view, searches) {
|
|
637
|
+
this._grouplevel = _grouplevel;
|
|
638
|
+
this._thisRoute = _thisRoute;
|
|
639
|
+
this._parent = _parent;
|
|
640
|
+
this.view = view;
|
|
641
|
+
this.searches = searches;
|
|
642
|
+
this._sep = true;
|
|
643
|
+
this.buttons = [];
|
|
557
644
|
}
|
|
558
|
-
return
|
|
645
|
+
return GroupPager;
|
|
559
646
|
}());
|
|
560
647
|
|
|
561
|
-
//Angular
|
|
562
648
|
/**
|
|
563
|
-
*
|
|
649
|
+
* Classe che rappresenta un singolo frammento di route di un elemento gruppo o non. Un array di questi indica tutte le colonne di gruppo con i loro valori
|
|
650
|
+
* per arrivare ad una ricerca su sottogruppi o elementi relativi
|
|
564
651
|
*/
|
|
565
|
-
var
|
|
652
|
+
var GroupRouteFragment = /** @class */ (function () {
|
|
566
653
|
/**
|
|
567
|
-
*
|
|
654
|
+
* Costruttore
|
|
655
|
+
*
|
|
656
|
+
* @param {string} column Colonna di raggruppamento
|
|
657
|
+
* @param {string} value Valore della colonna di raggruppamento
|
|
658
|
+
*/
|
|
659
|
+
function GroupRouteFragment(column, value) {
|
|
660
|
+
this.column = column;
|
|
661
|
+
this.value = value;
|
|
662
|
+
}
|
|
663
|
+
return GroupRouteFragment;
|
|
664
|
+
}());
|
|
665
|
+
|
|
666
|
+
/** Classe rappresentante una singola aggregazione effettuata su una colonna */
|
|
667
|
+
var ThAggregation = /** @class */ (function () {
|
|
668
|
+
/**
|
|
669
|
+
* Costruttore
|
|
670
|
+
*
|
|
671
|
+
* @param {'min' | 'max' | 'sum'} func Funzione di aggergazione, può essere **min**, **max** o **sum**
|
|
672
|
+
* @param {string} format Formato richiesto per il valore dell'aggregazione
|
|
673
|
+
* @param {string} match Match intero del pezzo di testo da cui si è estrapolata l'aggregazione, da rimpiazzare col valore calcolato
|
|
568
674
|
*/
|
|
675
|
+
function ThAggregation(func, format, match) {
|
|
676
|
+
this.func = func;
|
|
677
|
+
this.format = format;
|
|
678
|
+
this.match = match;
|
|
679
|
+
}
|
|
680
|
+
return ThAggregation;
|
|
681
|
+
}());
|
|
682
|
+
|
|
683
|
+
//Angular
|
|
684
|
+
/** Componente rappresentante una singola cella del body della tabella */
|
|
685
|
+
var EsTd = /** @class */ (function () {
|
|
686
|
+
/** @ignore */
|
|
569
687
|
function EsTd(myself, renderer, _viewContainer, sanitizer) {
|
|
570
688
|
this.myself = myself;
|
|
571
689
|
this.renderer = renderer;
|
|
572
690
|
this._viewContainer = _viewContainer;
|
|
573
691
|
this.sanitizer = sanitizer;
|
|
574
|
-
/**
|
|
575
|
-
* Id della cella, dev'essere lo stesso della colonna **EsTh** relativa
|
|
576
|
-
*/
|
|
692
|
+
/** Id della cella, dev'essere lo stesso della colonna **EsTh** relativa */
|
|
577
693
|
this.ID = "";
|
|
578
|
-
/**
|
|
579
|
-
* Valore da mostrare all'interno della cella. Se omesso verrà proiettato il contenuto dal template in cui è stata usata
|
|
580
|
-
*/
|
|
694
|
+
/** Valore da mostrare all'interno della cella. Se omesso verrà proiettato il contenuto dal template in cui è stata usata */
|
|
581
695
|
this.Display = null;
|
|
582
|
-
/**
|
|
583
|
-
* Template Angular da istanziare per questo TD
|
|
584
|
-
*/
|
|
696
|
+
/** Template Angular da istanziare per questo TD */
|
|
585
697
|
this.Template = null;
|
|
586
698
|
}
|
|
587
699
|
Object.defineProperty(EsTd.prototype, "Visible", {
|
|
@@ -610,13 +722,18 @@
|
|
|
610
722
|
enumerable: false,
|
|
611
723
|
configurable: true
|
|
612
724
|
});
|
|
613
|
-
/**
|
|
614
|
-
* @ignore
|
|
615
|
-
*/
|
|
725
|
+
/** @ignore */
|
|
616
726
|
EsTd.prototype.ngAfterViewInit = function () {
|
|
617
727
|
// Se è Internal significa che è gestita internamente da ES-TABLE quindi evito di fare sti due passaggi di lettura del DOM
|
|
618
728
|
if (this.Internal)
|
|
619
729
|
return;
|
|
730
|
+
// L'hash è calcolato dalla ES-table in fase di binding
|
|
731
|
+
this.Context = this.Context || this.getTemplateContext()._hash;
|
|
732
|
+
this.Content = this.Display === null || this.Display === "" ? this.sanitizer.bypassSecurityTrustHtml(this.myself.nativeElement.innerHTML) : this.sanitizer.bypassSecurityTrustHtml(this.Display);
|
|
733
|
+
this.Class = this.myself.nativeElement.className.replace("app-display-none", "");
|
|
734
|
+
};
|
|
735
|
+
/** Ottiene il contesto della view su cui è istanziato il componente */
|
|
736
|
+
EsTd.prototype.getTemplateContext = function () {
|
|
620
737
|
// NGBUG: (<any>this._viewContainer)._view non esiste più in IVY: https://stackoverflow.com/questions/60398827/getting-the-context-of-the-template-inside-of-which-my-component-has-been-render
|
|
621
738
|
var vc = this._viewContainer;
|
|
622
739
|
var context;
|
|
@@ -629,34 +746,23 @@
|
|
|
629
746
|
context = vc._view.viewContainerParent.context.$implicit;
|
|
630
747
|
else
|
|
631
748
|
context = vc._view.context.$implicit;
|
|
749
|
+
if (context)
|
|
750
|
+
return context;
|
|
632
751
|
// Se non ho ancora trovato il contesto probabilmente sono in IVY e devo fare dei lookup un po' incasinati per beccarlo
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
var iitem = item[ii];
|
|
645
|
-
if (iitem && iitem.$implicit && !iitem.ngIf) {
|
|
646
|
-
context = iitem.$implicit;
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
752
|
+
var array = this._viewContainer._hostLView;
|
|
753
|
+
for (var i = 0; i < array.length; i++) {
|
|
754
|
+
var item = array[i];
|
|
755
|
+
if (item && item.$implicit && !item.ngIf)
|
|
756
|
+
return item.$implicit;
|
|
757
|
+
// Second level search for the real context in case the first one we find is an ngIf
|
|
758
|
+
if (item && item.length && item.length > 0) {
|
|
759
|
+
for (var ii = 0; ii < item.length; ii++) {
|
|
760
|
+
var iitem = item[ii];
|
|
761
|
+
if (iitem && iitem.$implicit && !iitem.ngIf)
|
|
762
|
+
return iitem.$implicit;
|
|
650
763
|
}
|
|
651
|
-
if (context)
|
|
652
|
-
break;
|
|
653
764
|
}
|
|
654
765
|
}
|
|
655
|
-
// Calcolato dalla ES-table in fase di binding
|
|
656
|
-
var hash = context.hash;
|
|
657
|
-
this.Context = hash;
|
|
658
|
-
this.Content = this.Display === null || this.Display === "" ? this.sanitizer.bypassSecurityTrustHtml(this.myself.nativeElement.innerHTML) : this.sanitizer.bypassSecurityTrustHtml(this.Display);
|
|
659
|
-
this.Class = this.myself.nativeElement.className.replace("app-display-none", "");
|
|
660
766
|
};
|
|
661
767
|
return EsTd;
|
|
662
768
|
}());
|
|
@@ -679,27 +785,20 @@
|
|
|
679
785
|
RouterLink: [{ type: core.Input }],
|
|
680
786
|
Display: [{ type: core.Input }],
|
|
681
787
|
Template: [{ type: core.Input }],
|
|
788
|
+
Context: [{ type: core.Input }],
|
|
682
789
|
Visible: [{ type: core.Input }]
|
|
683
790
|
};
|
|
684
791
|
|
|
685
792
|
//Angular
|
|
686
|
-
/**
|
|
687
|
-
* Componente rappresentante una Colonna della tabella
|
|
688
|
-
*/
|
|
793
|
+
/** Componente rappresentante una Colonna della tabella */
|
|
689
794
|
var EsTh = /** @class */ (function () {
|
|
690
|
-
/**
|
|
691
|
-
* @ignore
|
|
692
|
-
*/
|
|
795
|
+
/** @ignore */
|
|
693
796
|
function EsTh(myself, renderer) {
|
|
694
797
|
this.myself = myself;
|
|
695
798
|
this.renderer = renderer;
|
|
696
|
-
/**
|
|
697
|
-
* Dizionario di mappatura con ordinamento attuale e ordinamento successivo per gestire i passaggi di stato
|
|
698
|
-
*/
|
|
799
|
+
/** Dizionario di mappatura con ordinamento attuale e ordinamento successivo per gestire i passaggi di stato */
|
|
699
800
|
this.orderNext = { "NONE": "DESC", "DESC": "ASC", "ASC": null };
|
|
700
|
-
/**
|
|
701
|
-
* Indica se si sta effettuando un'operazione di resize su questa colonna
|
|
702
|
-
*/
|
|
801
|
+
/** Indica se si sta effettuando un'operazione di resize su questa colonna */
|
|
703
802
|
this.resizingThis = false;
|
|
704
803
|
/**
|
|
705
804
|
* Storicizza l'offset di partenza del resize dell'elemento HTML per poter calcolare la nuova dimensione richiesta durente il resize
|
|
@@ -707,21 +806,13 @@
|
|
|
707
806
|
* nuova width = startOffset + posizione X del mouse
|
|
708
807
|
*/
|
|
709
808
|
this.startOffset = null;
|
|
710
|
-
/**
|
|
711
|
-
* Id della colonna, dev'essere lo stesso per tutti gli **EsTd** relativi
|
|
712
|
-
*/
|
|
809
|
+
/** Id della colonna, dev'essere lo stesso per tutti gli **EsTd** relativi */
|
|
713
810
|
this.ID = "";
|
|
714
|
-
/**
|
|
715
|
-
* Indica se questa colonna è ordinabile o meno
|
|
716
|
-
*/
|
|
811
|
+
/** Indica se questa colonna è ordinabile o meno */
|
|
717
812
|
this.Orderable = true;
|
|
718
|
-
/**
|
|
719
|
-
* Valore da mostrare all'interno della colonna. Se omesso verrà proiettato il contenuto dal template in cui è stata usata
|
|
720
|
-
*/
|
|
813
|
+
/** Valore da mostrare all'interno della colonna. Se omesso verrà proiettato il contenuto dal template in cui è stata usata */
|
|
721
814
|
this.Display = "";
|
|
722
|
-
/**
|
|
723
|
-
* Indica se le dimnsioni di questa colonna sono modificabili o meno
|
|
724
|
-
*/
|
|
815
|
+
/** Indica se le dimnsioni di questa colonna sono modificabili o meno */
|
|
725
816
|
this.Resizable = false;
|
|
726
817
|
/**
|
|
727
818
|
* Indica se sta venendo eseguita una operazione di ricerca o meno, serve per evitare l'esecuzione di eventuale codice che potrebbe dare fastidio
|
|
@@ -732,18 +823,12 @@
|
|
|
732
823
|
this.Wrap = false;
|
|
733
824
|
/** Indica se la colonna è fixed, cioè se non può né essere nascosta, né riposizionata. Solo le prime colonne possono essere Fixed */
|
|
734
825
|
this.Fixed = false;
|
|
735
|
-
/**
|
|
736
|
-
* Template Angular da istanziare per questo TH
|
|
737
|
-
*/
|
|
826
|
+
/** Template Angular da istanziare per questo TH */
|
|
738
827
|
this.Template = null;
|
|
739
|
-
/**
|
|
740
|
-
* Evento emesso al cambio di ordinamento effettuato su questa colonna
|
|
741
|
-
*/
|
|
828
|
+
/** Evento emesso al cambio di ordinamento effettuato su questa colonna */
|
|
742
829
|
this.onOrderChange = new core.EventEmitter();
|
|
743
|
-
/**
|
|
744
|
-
|
|
745
|
-
*/
|
|
746
|
-
this.Referenced = false;
|
|
830
|
+
/** Impostato dall'**EsTable**, per controllare che ci sia almeno un TD che utilizzi quest'header */
|
|
831
|
+
this._referenced = false;
|
|
747
832
|
}
|
|
748
833
|
Object.defineProperty(EsTh.prototype, "Visible", {
|
|
749
834
|
/**
|
|
@@ -771,9 +856,7 @@
|
|
|
771
856
|
enumerable: false,
|
|
772
857
|
configurable: true
|
|
773
858
|
});
|
|
774
|
-
/**
|
|
775
|
-
* @ignore
|
|
776
|
-
*/
|
|
859
|
+
/** @ignore */
|
|
777
860
|
EsTh.prototype.ngAfterViewInit = function () {
|
|
778
861
|
//Assegnare direttamente il content è più veloce che passare dal native element per qualche motivo
|
|
779
862
|
this.Description = this.Display === null || this.Display === "" ? this.content.nativeElement.innerText : this.Display;
|
|
@@ -782,9 +865,7 @@
|
|
|
782
865
|
if (this.Resizable)
|
|
783
866
|
this.renderer.addClass(this.myself.nativeElement, "app-relative");
|
|
784
867
|
};
|
|
785
|
-
/**
|
|
786
|
-
* Gestisce la modifica dell'ordinamento qualora venisse cliccato su questa colonna
|
|
787
|
-
*/
|
|
868
|
+
/** Gestisce la modifica dell'ordinamento qualora venisse cliccato su questa colonna */
|
|
788
869
|
EsTh.prototype.setupNextOrderAndNotify = function () {
|
|
789
870
|
if (!this.ID) {
|
|
790
871
|
console.log("Attempt to order a column without ID. Operation ignored");
|
|
@@ -811,9 +892,7 @@
|
|
|
811
892
|
this.resizingThis = true;
|
|
812
893
|
this.startOffset = this.myself.nativeElement.offsetWidth - ev.pageX;
|
|
813
894
|
};
|
|
814
|
-
/**
|
|
815
|
-
* Listener per la fine dell'operazione di resize
|
|
816
|
-
*/
|
|
895
|
+
/** Listener per la fine dell'operazione di resize */
|
|
817
896
|
EsTh.prototype.onMouseUp = function () {
|
|
818
897
|
if (!this.Resizable)
|
|
819
898
|
return;
|
|
@@ -864,9 +943,7 @@
|
|
|
864
943
|
onMouseMove: [{ type: core.HostListener, args: ['window:mousemove.out-zone', ['$event'],] }]
|
|
865
944
|
};
|
|
866
945
|
|
|
867
|
-
/**
|
|
868
|
-
* Direttiva per la dichiarazione snella di un EsTd da emettere per ogni elemento, data una colonna
|
|
869
|
-
*/
|
|
946
|
+
/** Direttiva per la dichiarazione snella di un EsTd da emettere per ogni elemento, data una colonna */
|
|
870
947
|
var EsTdDirective = /** @class */ (function () {
|
|
871
948
|
/**
|
|
872
949
|
* @ignore
|
|
@@ -895,23 +972,31 @@
|
|
|
895
972
|
tdClass: [{ type: core.Input }]
|
|
896
973
|
};
|
|
897
974
|
|
|
898
|
-
/**
|
|
899
|
-
* Direttiva per la dichiarazione snella di un EsTh da emettere come header
|
|
900
|
-
*/
|
|
975
|
+
/** Direttiva per la dichiarazione snella di un EsTh da emettere come header */
|
|
901
976
|
var EsThDirective = /** @class */ (function () {
|
|
902
977
|
/**
|
|
903
978
|
* @ignore
|
|
904
979
|
*/
|
|
905
980
|
function EsThDirective(Template) {
|
|
906
981
|
this.Template = Template;
|
|
982
|
+
/** Variabile interna all'interno della quale viene raccolta la cache delle aggregazioni specificate in thAggregation */
|
|
983
|
+
this._thAggregations = null;
|
|
907
984
|
/** Variabile interna che indica il fatto che questo componente è una direttiva. Serve per disambigualrlo dell'EsThComponent */
|
|
908
985
|
this._directive = true;
|
|
986
|
+
/** Variabile interna impostata dall'**EsTable**, per controllare che ci sia almeno un TD che utilizzi quest'header */
|
|
987
|
+
this._referenced = false;
|
|
909
988
|
/** Id della colonna, dev'essere lo stesso per tutti i **td** relativi */
|
|
910
989
|
this.th = "";
|
|
990
|
+
/** Indica se la colonna è pinnata o no */
|
|
991
|
+
this.thPinned = false;
|
|
992
|
+
/** Indica le dimensioni che deve avere questa colonna quando viene pinnata, senza questo tutte le colonne mi collasserebbero l'una sull'altra */
|
|
993
|
+
this.thPinnedWidth = 150;
|
|
911
994
|
/** Indicazione sulla visibilità della colonna */
|
|
912
995
|
this.thVisible = true;
|
|
913
996
|
/** Indica se la colonna è fixed, cioè se non può né essere nascosta, né riposizionata. Solo le prime colonne possono essere Fixed */
|
|
914
997
|
this.thFixed = false;
|
|
998
|
+
/** Indica che la colonna è sotto ad un raggruppamento padre, con questo nome nel **th** */
|
|
999
|
+
this.thParent = "";
|
|
915
1000
|
/** Indica se questa colonna è ordinabile o meno */
|
|
916
1001
|
this.thOrderable = true;
|
|
917
1002
|
/** Indica se il testo presente in questo Header può andare a capo o meno, di default non può */
|
|
@@ -920,8 +1005,10 @@
|
|
|
920
1005
|
this.thResizable = false;
|
|
921
1006
|
/** Equivalente dell'NgIf sul th */
|
|
922
1007
|
this.thIf = true;
|
|
923
|
-
/**
|
|
924
|
-
this.
|
|
1008
|
+
/** Indica che bisogna fare un raggruppamento su questa colonna */
|
|
1009
|
+
this.thGroup = false;
|
|
1010
|
+
/** Indica che bisogna fare una aggregazione su questa colonna, a fronte di almeno un altra con un raggruppamento */
|
|
1011
|
+
this.thAggregation = null;
|
|
925
1012
|
}
|
|
926
1013
|
return EsThDirective;
|
|
927
1014
|
}());
|
|
@@ -933,31 +1020,38 @@
|
|
|
933
1020
|
]; };
|
|
934
1021
|
EsThDirective.propDecorators = {
|
|
935
1022
|
th: [{ type: core.Input }],
|
|
1023
|
+
thPinned: [{ type: core.Input }],
|
|
1024
|
+
thPinnedWidth: [{ type: core.Input }],
|
|
936
1025
|
thVisible: [{ type: core.Input }],
|
|
937
1026
|
thFixed: [{ type: core.Input }],
|
|
1027
|
+
thParent: [{ type: core.Input }],
|
|
938
1028
|
thOrder: [{ type: core.Input }],
|
|
939
1029
|
thOrderable: [{ type: core.Input }],
|
|
940
1030
|
thWrap: [{ type: core.Input }],
|
|
941
1031
|
thResizable: [{ type: core.Input }],
|
|
942
1032
|
thClass: [{ type: core.Input }],
|
|
943
|
-
|
|
1033
|
+
thGroupClass: [{ type: core.Input }],
|
|
1034
|
+
thIf: [{ type: core.Input }],
|
|
1035
|
+
thGroup: [{ type: core.Input }],
|
|
1036
|
+
thAggregation: [{ type: core.Input }]
|
|
944
1037
|
};
|
|
945
1038
|
|
|
946
|
-
/**
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
var
|
|
1039
|
+
/** Token che indica il locale da utilizzare all'interno del componente. Supportati solo "it-IT" ed "en-US" */
|
|
1040
|
+
var EST_LOCALE = new core.InjectionToken('EST_LOCALE');
|
|
1041
|
+
/** Token che indica se emettere log a console o meno */
|
|
1042
|
+
var EST_DEBUG = new core.InjectionToken('EST_DEBUG');
|
|
1043
|
+
/** Token che indica i default da assegnare agli Input */
|
|
1044
|
+
var EST_DEFAULTS = new core.InjectionToken('EST_DEFAULTS');
|
|
950
1045
|
|
|
951
|
-
/**
|
|
952
|
-
* Classe di localizzazione per il componente **EsTableComponent**
|
|
953
|
-
*/
|
|
1046
|
+
/** Classe di localizzazione per il componente **EsTableComponent** */
|
|
954
1047
|
var EsTableLoc = /** @class */ (function (_super) {
|
|
955
1048
|
__extends(EsTableLoc, _super);
|
|
956
|
-
/**
|
|
957
|
-
* @ignore
|
|
958
|
-
*/
|
|
1049
|
+
/** @ignore */
|
|
959
1050
|
function EsTableLoc(LOC_LOCALE) {
|
|
960
1051
|
var _this = _super.call(this, LOC_LOCALE !== null && LOC_LOCALE !== void 0 ? LOC_LOCALE : 'it-IT') || this;
|
|
1052
|
+
_super.prototype.set.call(_this, "en->it", "All", ["Tutto"]);
|
|
1053
|
+
_super.prototype.set.call(_this, "en->it", "Groups", ["Gruppi"]);
|
|
1054
|
+
_super.prototype.set.call(_this, "en->it", "Cannot export an empty dataset", ["Impossibile esportare un dataset vuoto"]);
|
|
961
1055
|
_super.prototype.set.call(_this, "en->it", "Performing Table bootstrap", ["Sto caricando la Tabella"]);
|
|
962
1056
|
_super.prototype.set.call(_this, "en->it", "Update every", ["Aggiorna ogni"]);
|
|
963
1057
|
_super.prototype.set.call(_this, "en->it", "second/s", ["secondo/i"]);
|
|
@@ -984,25 +1078,34 @@
|
|
|
984
1078
|
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EST_LOCALE,] }] }
|
|
985
1079
|
]; };
|
|
986
1080
|
|
|
1081
|
+
/** Raccolta di tutti gli Input dell'EsTable a cui può essere logicamente sensato assegnare default per progetto */
|
|
1082
|
+
var EsTableDefaultable = /** @class */ (function () {
|
|
1083
|
+
function EsTableDefaultable() {
|
|
1084
|
+
}
|
|
1085
|
+
return EsTableDefaultable;
|
|
1086
|
+
}());
|
|
1087
|
+
|
|
987
1088
|
/** Componente che permette di rappresentare una griglia di valori */
|
|
988
1089
|
var EsTableComponent = /** @class */ (function () {
|
|
989
1090
|
/** @ignore */
|
|
990
|
-
function EsTableComponent(ngControl, prefService, lc, cdr, hashExts, utiExts, expExts) {
|
|
1091
|
+
function EsTableComponent(ngControl, prefService, deafults, locale, lc, cdr, hashExts, utiExts, expExts, dateExts, msgExts) {
|
|
1092
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
991
1093
|
this.ngControl = ngControl;
|
|
992
1094
|
this.prefService = prefService;
|
|
1095
|
+
this.deafults = deafults;
|
|
1096
|
+
this.locale = locale;
|
|
993
1097
|
this.lc = lc;
|
|
994
1098
|
this.cdr = cdr;
|
|
995
1099
|
this.hashExts = hashExts;
|
|
996
1100
|
this.utiExts = utiExts;
|
|
997
1101
|
this.expExts = expExts;
|
|
1102
|
+
this.dateExts = dateExts;
|
|
1103
|
+
this.msgExts = msgExts;
|
|
998
1104
|
/** View finale su cui bindarsi lato Frontend, il tipo può essere IAppSearch<any> (per la **viewMode**), any[] (per l'**arrayMode**) e ReportDefinition per la **reportMode** */
|
|
999
1105
|
this.View = null;
|
|
1000
1106
|
/** Indica se l'es-table deve mostrare il check globale nell'header per fare il "seleziona tutto" */
|
|
1001
1107
|
this.globalCheck = false;
|
|
1002
|
-
/**
|
|
1003
|
-
* Tiene da conto l'ultimo elemento selezionato in modo da fare ragionamenti del tipo
|
|
1004
|
-
* "Ho selezionato questo, l'ultimo selezionato era **lastSelected**, devo selezionare tutti quelli in mezzo", ad esempio per la selezione multipla
|
|
1005
|
-
*/
|
|
1108
|
+
/** Tiene da conto l'ultimo elemento selezionato in modo da poter effettuare il SHIFT+CLICK */
|
|
1006
1109
|
this.lastSelected = null;
|
|
1007
1110
|
/** Conteggio interno per il numero di elementi selezionati */
|
|
1008
1111
|
this.selectedObjects = 0;
|
|
@@ -1041,6 +1144,10 @@
|
|
|
1041
1144
|
this.RowTHs = null;
|
|
1042
1145
|
/** Modello di appoggio temporaneo per i **RowTHs** */
|
|
1043
1146
|
this.TMPRowTHs = null;
|
|
1147
|
+
/** Modello di appoggio temporaneo per i **RowThGroups** */
|
|
1148
|
+
this.TMPRowThGroups = null;
|
|
1149
|
+
/** Modello rappresentante un singolo header group della tabella. Questa lista è già ordinata e pronta per essere utilizzata in ngFor */
|
|
1150
|
+
this.RowThGroups = null;
|
|
1044
1151
|
/** Cache per i routerLink generati nelle tabelle dinamiche */
|
|
1045
1152
|
this.DynamicTableRouterLinkCache = {};
|
|
1046
1153
|
/**
|
|
@@ -1087,7 +1194,11 @@
|
|
|
1087
1194
|
* @deprecated Utilizzare l'Input **Template** delle es-td e assegnare un template con tutti i binding che si vuole ai click
|
|
1088
1195
|
*/
|
|
1089
1196
|
this.CustomCellActionsOn = '';
|
|
1090
|
-
/**
|
|
1197
|
+
/**
|
|
1198
|
+
* Serve per decidere di lanciare o meno il **event.stopPropagation()** al termine della gestione dell'evento
|
|
1199
|
+
*
|
|
1200
|
+
* @deprecated Utilizzare l'Input **Template** delle es-td e assegnare un template con tutti i binding che si vuole ai click
|
|
1201
|
+
*/
|
|
1091
1202
|
this.CellActionPropagates = true;
|
|
1092
1203
|
/**
|
|
1093
1204
|
* Decide se utilizzare o meno le CustomCells. Impostandolo a **true** l'es-table diventa in grado di gestire nativamente:
|
|
@@ -1103,14 +1214,14 @@
|
|
|
1103
1214
|
this.UseCustomCells = null;
|
|
1104
1215
|
/** Permette di impostare l'altezza massima della tabella. Se null la dimensione si adatta al numero di elementi attualmente in visualizzazione */
|
|
1105
1216
|
this.MaxHeight = null;
|
|
1106
|
-
/** Classi da applicare
|
|
1107
|
-
this.
|
|
1217
|
+
/** Classi da applicare al contenitore della tabella */
|
|
1218
|
+
this.ContainerClass = null;
|
|
1108
1219
|
/** Permette o meno l'export in formato XLSX */
|
|
1109
1220
|
this.XLSXExport = null;
|
|
1110
1221
|
/** Permette o meno l'export in formato CSV */
|
|
1111
1222
|
this.CSVExport = true;
|
|
1112
1223
|
/** Permette di visualizzare o meno l'opzione di paginazione "Tutti" */
|
|
1113
|
-
this.AllSearch =
|
|
1224
|
+
this.AllSearch = null;
|
|
1114
1225
|
/** Diminuisce gli spazi fra una cella e l'altra, e internamente il padding del font in modo da presentare molti più dati in un'unica pagina */
|
|
1115
1226
|
this.HighCellDensity = null;
|
|
1116
1227
|
/** Abilita o meno la possibilità di selezionare oggetti */
|
|
@@ -1129,8 +1240,6 @@
|
|
|
1129
1240
|
this.Export = null;
|
|
1130
1241
|
/** Indica se permettere la selezione multipla Windows-like cliccando un oggetto e facendo poi Shift + click su un oggetto successivo */
|
|
1131
1242
|
this.ShiftClick = null;
|
|
1132
|
-
/** Mostra o nasconde le informazioni di paginazione, sia i pulsanti, sia il selettore degli oggetti per pagina */
|
|
1133
|
-
this.ShowPaging = true;
|
|
1134
1243
|
/** Indica se nascondere o mostrare il componente di paginazione */
|
|
1135
1244
|
this.HidePaging = null;
|
|
1136
1245
|
/** Indica se nascondere o mostrare il conteggio degli elementi trovati */
|
|
@@ -1142,12 +1251,10 @@
|
|
|
1142
1251
|
/** Nome dell'esportazione generata da questa tabella */
|
|
1143
1252
|
this.ExportFileName = 'Export.csv';
|
|
1144
1253
|
/** Classe (HTML) di default della tabella */
|
|
1145
|
-
this.TableClass =
|
|
1146
|
-
/**
|
|
1147
|
-
this.CountLabel = this.lc.loc('Found objects');
|
|
1148
|
-
/** Indica la presenza di raggruppamenti a livello di header */
|
|
1254
|
+
this.TableClass = null;
|
|
1255
|
+
/** @deprecated Indica la presenza di raggruppamenti a livello di header */
|
|
1149
1256
|
this.HasHeaderGroup = null;
|
|
1150
|
-
/** Indica la presenza di raggruppamenti a livello del raggruppamento precedentemente esistente, chiaramente è insensata senza **HasHeaderGroup** */
|
|
1257
|
+
/** @deprecated Indica la presenza di raggruppamenti a livello del raggruppamento precedentemente esistente, chiaramente è insensata senza **HasHeaderGroup** */
|
|
1151
1258
|
this.HasSecondaryHeaderGroup = null;
|
|
1152
1259
|
/** Utilizzato per dividere la sorgente in modalità EndlessScroll */
|
|
1153
1260
|
this.SliceSize = 100;
|
|
@@ -1179,11 +1286,7 @@
|
|
|
1179
1286
|
this.HiddenColumns = null;
|
|
1180
1287
|
/** Permette di riordinare le colonne in base alle impostazioni effettuate dal Menù contestuale in alto a destra */
|
|
1181
1288
|
this.ColumnsOrdering = null;
|
|
1182
|
-
/**
|
|
1183
|
-
* Eventuale supporto alle ricerche applicate alla modalità Array
|
|
1184
|
-
*
|
|
1185
|
-
* @deprecated Utilizzato solo per un caso particolare del Metering
|
|
1186
|
-
*/
|
|
1289
|
+
/** Eventuale supporto alle ricerche applicate alla modalità Array */
|
|
1187
1290
|
this.SearchView = null;
|
|
1188
1291
|
/** Abilita o disabilita il sistema che permette di selezionare tutti gli elementi nella vista */
|
|
1189
1292
|
this.SelectAll = null;
|
|
@@ -1203,6 +1306,10 @@
|
|
|
1203
1306
|
this.StartsExpanded = true;
|
|
1204
1307
|
/** Indica se effettuare il salvataggio delle preferenze di ricerca */
|
|
1205
1308
|
this.SavePreferences = null;
|
|
1309
|
+
/** Indica dove visualizzare le informazioni di paginazione, se sopra, sotto o in entrambi */
|
|
1310
|
+
this.PagingStyle = null;
|
|
1311
|
+
/** Indica dove visualizzare le informazioni di paginazione, se sopra, sotto o in entrambi */
|
|
1312
|
+
this.RowGroupingPagingStyle = null;
|
|
1206
1313
|
/**
|
|
1207
1314
|
* Sorgente dati secondaria
|
|
1208
1315
|
*
|
|
@@ -1216,12 +1323,19 @@
|
|
|
1216
1323
|
*/
|
|
1217
1324
|
this.TertiarySource = null;
|
|
1218
1325
|
/** Indica se utilizzare la cache di selezione che permette di mantenere gli stati di selezione dei vari oggetti navigando da una pagina all'altra */
|
|
1219
|
-
this.UseSelectionCache =
|
|
1326
|
+
this.UseSelectionCache = null;
|
|
1327
|
+
/** Permette di decidere se, in modalità raggruppamento, mostrare o meno il valore delle colonne di gruppo negli oggetti finali. Di default sono nascosti */
|
|
1328
|
+
this.ShowItemGroupsColumns = null;
|
|
1220
1329
|
/** Evento che viene richiamato al cambio di oridnamento di una colonna */
|
|
1221
1330
|
this.onOrderChanged = new core.EventEmitter();
|
|
1222
1331
|
/**
|
|
1223
1332
|
* Evento che viene richiamato quando l'es-table ritiene sia necessario ri-effettuare la ricerca.
|
|
1224
|
-
* Il booleano dell'evento indica se viene suggerito di resettare la pagina o meno
|
|
1333
|
+
* Il booleano dell'evento indica se viene suggerito di resettare la pagina o meno.
|
|
1334
|
+
*
|
|
1335
|
+
* Solo in caso venga utilizzata la modalità a raggruppamenti di righe può succedere che l'es-table passi un intero AppSearch come parametro di ricerca,
|
|
1336
|
+
* in quel caso l'applicazione ricevente dovrà onorare la richiesta spedendo al backand l'oggetto di ricerca AS-IS
|
|
1337
|
+
*
|
|
1338
|
+
* il tipo dell'Emitter invece di essere [boolean | AppSearch<any>] è stato impostato a "any" per evitare problemi di retrocompatibilità
|
|
1225
1339
|
*/
|
|
1226
1340
|
this.onSearchRequest = new core.EventEmitter();
|
|
1227
1341
|
/** Evento che parte ad ogni modifica di "checkaggio" in forma di comodo array. Espone l'oggetto con lo stato di check attuale */
|
|
@@ -1244,19 +1358,91 @@
|
|
|
1244
1358
|
/** Numero di pagine (durante la paginazione in modalità Array) */
|
|
1245
1359
|
this.arraymodePages = 1;
|
|
1246
1360
|
/** Oggetti per ogni pagina (durante la paginazione in modalità Array) */
|
|
1247
|
-
this.ArraymodeItemsPerPage =
|
|
1361
|
+
this.ArraymodeItemsPerPage = null;
|
|
1362
|
+
/** Colonne da visualizzare in modalità array */
|
|
1363
|
+
this.arrayColumns = [];
|
|
1364
|
+
/** Ordine delle colonne da visualizzare in modalità array */
|
|
1365
|
+
this.arrayColumnOrdering = [];
|
|
1366
|
+
/** Ordinamenti ASC-DESC sulle colonne in modalità array */
|
|
1367
|
+
this.arrayOrders = [];
|
|
1248
1368
|
/**
|
|
1249
1369
|
* Variabile che serve a gestire il momento in cui l'es-table aggiorna la paginazione (pulsanti ecc).
|
|
1250
1370
|
* Essendo operazioni comunque costose le effettuo solo su binding esterni, non su rewrite generati internamente
|
|
1251
1371
|
*/
|
|
1252
1372
|
this.internalWriteCall = false;
|
|
1253
|
-
/**
|
|
1254
|
-
|
|
1373
|
+
/**
|
|
1374
|
+
* Cache che conterrà tutte le ricerche effettuate su gruppi diversi dal primo e su elementi contenuti nei gruppi.
|
|
1375
|
+
* In caso di cambi di ordinamento delle colonne diverse dalla prima tutte le chiamate fatte dal secondo livello in poi devono essere rieseguite secondo la seguente logica:
|
|
1376
|
+
*
|
|
1377
|
+
*
|
|
1378
|
+
* **Cambio ordinamento sul primo gruppo**: reload completo, non mi occupo di ripulire gli elementi bindati in alcun modo
|
|
1379
|
+
*
|
|
1380
|
+
* **Cambio ordinamento sulla colonna relativa all'N-esimo gruppo**: reload completo del contenuto dei gruppi precedenti, ripulendo precedentemente
|
|
1381
|
+
* tutti gli elementi con **_grouplevel** = N
|
|
1382
|
+
*
|
|
1383
|
+
* **Cambio ordinamento su una colonna non raggruppata**: reload completo per tutti i gruppi finali aperti, devo precedentemente ripulire tutti gli elementi con **_item** = true
|
|
1384
|
+
*
|
|
1385
|
+
* Altri eventi non dovrebbero rappresentare problemi:
|
|
1386
|
+
* - Selezione: non cambia nulla
|
|
1387
|
+
* - Paginazione: cambia a livello root quindi viene ricaricato tutto comunque, stesso vale per le paginazioni interne
|
|
1388
|
+
*/
|
|
1389
|
+
this.groupSearchRequestsCache = [];
|
|
1390
|
+
/** Variabile d'appoggio per capire se c'è bisogno di ri-effettuare una ricerca o meno */
|
|
1391
|
+
this.ResearchNeeded = false;
|
|
1392
|
+
/** Colonne visibili della vista attuale. Valorizzato di default al numero massimo di colonne supportate dalla tabella per le casistiche in assenza di custom cells */
|
|
1393
|
+
this.Columns = { Visibile: 100, VisibleUnpinned: 100, Global: 100 };
|
|
1394
|
+
/** In caso di Row Grouping qui viene salvata la vista principale dei gruppi base */
|
|
1395
|
+
this.MainGroupView = null;
|
|
1396
|
+
/** Conteggio base degli oggetti. In modalità normale viene resettato ad ogni nuova View inserita, in modalità RowGrouping viene resettato solo ad una nuova View di livello "0" */
|
|
1397
|
+
this.BaseItemsCount = null;
|
|
1398
|
+
/** Cache per salvare per ogni chiave di ogni gruppo chi è il gruppo rappresentato */
|
|
1399
|
+
this.rgGroupCache = new Map();
|
|
1400
|
+
/** Cache per salvare per ogni chiave di ogni gruppo chi sono gli oggetti sottostanti, non dei sottogruppi */
|
|
1401
|
+
this.rgItemCache = new Map();
|
|
1402
|
+
/** Cache per salvare per ogni chiave di ogni gruppo chi sono gli oggetti sottostanti, non dei sottogruppi */
|
|
1403
|
+
this.rgChildGroupsCache = new Map();
|
|
1404
|
+
/** Cache di selezione Hash - Oggetto per la variabile **items** dell'itemSelector. Facilita le operazioni di lookup via hash*/
|
|
1405
|
+
this.itemsCache = new Map();
|
|
1406
|
+
/** Cache di selezione Hash - Oggetto per la variabile **groups** dell'itemSelector. Facilita le operazioni di lookup via hash */
|
|
1407
|
+
this.groupsCache = new Map();
|
|
1408
|
+
/** Cache di selezione Hash - Oggetto per la variabile **exclusions** dell'itemSelector. Facilita le operazioni di lookup via hash */
|
|
1409
|
+
this.exclusionsCache = new Map();
|
|
1410
|
+
/** Cache di selezione Hash - Oggetto per la variabile **group_exclusions** dell'itemSelector. Facilita le operazioni di lookup via hash */
|
|
1411
|
+
this.group_exclusionsCache = new Map();
|
|
1412
|
+
/** Cache di selezione Hash - Oggetto per la variabile **items** dell'itemSelector. Facilita le operazioni di lookup via indice*/
|
|
1413
|
+
this.i_itemsCache = new Map();
|
|
1414
|
+
/** Cache di selezione Hash - Oggetto per la variabile **groups** dell'itemSelector. Facilita le operazioni di lookup via indice */
|
|
1415
|
+
this.i_groupsCache = new Map();
|
|
1416
|
+
/** Cache di selezione Hash - Oggetto per la variabile **exclusions** dell'itemSelector. Facilita le operazioni di lookup via indice */
|
|
1417
|
+
this.i_exclusionsCache = new Map();
|
|
1418
|
+
/** Cache di selezione Hash - Oggetto per la variabile **group_exclusions** dell'itemSelector. Facilita le operazioni di lookup via indice */
|
|
1419
|
+
this.i_group_exclusionsCache = new Map();
|
|
1420
|
+
/** Indica se nonostante siamo in modalità array sono stati individuati dei gruppi. In tal caso es-table si comporta da pseudo backend ed effettua le aggregazioni e raggruppamenti completamente lato client */
|
|
1421
|
+
this.ArrayGrouping = false;
|
|
1422
|
+
this.PagerOptions = { PagerCount: null, ShowCount: true, ShowPaging: true, UsesView: true, View: null, Ready: false, Searches: 'items' };
|
|
1255
1423
|
/** @ignore */
|
|
1256
1424
|
this.propagateChange = function (_) { };
|
|
1257
1425
|
if (ngControl)
|
|
1258
1426
|
ngControl.valueAccessor = this;
|
|
1427
|
+
// Assegnazione per tutti gli Input di default
|
|
1428
|
+
this.ColumnsResizable = this.InputOrDefault(this.ColumnsResizable, (_a = this.deafults) === null || _a === void 0 ? void 0 : _a.ColumnsResizable);
|
|
1429
|
+
this.AutoUpdate = this.InputOrDefault(this.AutoUpdate, (_b = this.deafults) === null || _b === void 0 ? void 0 : _b.AutoUpdate);
|
|
1430
|
+
this.AllSearch = this.InputOrDefault(this.AllSearch, (_c = this.deafults) === null || _c === void 0 ? void 0 : _c.AllSearch, true);
|
|
1431
|
+
this.Export = this.InputOrDefault(this.Export, (_d = this.deafults) === null || _d === void 0 ? void 0 : _d.Export);
|
|
1432
|
+
this.HidePaging = this.InputOrDefault(this.HidePaging, (_e = this.deafults) === null || _e === void 0 ? void 0 : _e.HidePaging, false);
|
|
1433
|
+
this.HidePagingCount = this.InputOrDefault(this.HidePagingCount, (_f = this.deafults) === null || _f === void 0 ? void 0 : _f.HidePagingCount);
|
|
1434
|
+
this.HidePagingButtons = this.InputOrDefault(this.HidePagingButtons, (_g = this.deafults) === null || _g === void 0 ? void 0 : _g.HidePagingButtons);
|
|
1435
|
+
this.ContainerClass = this.InputOrDefault(this.ContainerClass, (_h = this.deafults) === null || _h === void 0 ? void 0 : _h.ContainerClass, '');
|
|
1436
|
+
this.TableClass = this.InputOrDefault(this.TableClass, (_j = this.deafults) === null || _j === void 0 ? void 0 : _j.TableClass, 'table table-striped table-hover table-sm');
|
|
1437
|
+
this.Selection = this.InputOrDefault(this.Selection, (_k = this.deafults) === null || _k === void 0 ? void 0 : _k.Selection);
|
|
1438
|
+
this.SavePreferences = this.InputOrDefault(this.SavePreferences, (_l = this.deafults) === null || _l === void 0 ? void 0 : _l.SavePreferences);
|
|
1439
|
+
this.PagingStyle = this.InputOrDefault(this.PagingStyle, (_m = this.deafults) === null || _m === void 0 ? void 0 : _m.PagingStyle, 'bottom');
|
|
1440
|
+
this.RowGroupingPagingStyle = this.InputOrDefault(this.RowGroupingPagingStyle, (_o = this.deafults) === null || _o === void 0 ? void 0 : _o.RowGroupingPagingStyle, 'left');
|
|
1441
|
+
this.UseSelectionCache = this.InputOrDefault(this.UseSelectionCache, (_p = this.deafults) === null || _p === void 0 ? void 0 : _p.UseSelectionCache, true);
|
|
1442
|
+
this.ShowItemGroupsColumns = this.InputOrDefault(this.ShowItemGroupsColumns, (_q = this.deafults) === null || _q === void 0 ? void 0 : _q.ShowItemGroupsColumns, false);
|
|
1443
|
+
this.ArraymodeItemsPerPage = this.InputOrDefault(this.ArraymodeItemsPerPage, (_r = this.deafults) === null || _r === void 0 ? void 0 : _r.ArraymodeItemsPerPage, 15);
|
|
1259
1444
|
}
|
|
1445
|
+
// #region Ciclo di vita ES-Table - Inizializzazioni
|
|
1260
1446
|
/** @ignore */
|
|
1261
1447
|
EsTableComponent.prototype.ngOnInit = function () {
|
|
1262
1448
|
var _this = this;
|
|
@@ -1266,6 +1452,9 @@
|
|
|
1266
1452
|
throw "Es-table error: Per poter utilizzare l'es-table con [Hierarchy]=\"true\" è richiesto anche [UseCustomCells]=\"true\"";
|
|
1267
1453
|
// click destro su una riga con selezione attiva: Tiro fuori il context menu e selezione l'elemento corrente
|
|
1268
1454
|
this.ctxMenuSubscription = (this.ContextMenu || this.tableEmptyMenu).open.subscribe(function (t) {
|
|
1455
|
+
// Gruppi va bene, oggetti pure, ma separatori fra gruppi proprio no...
|
|
1456
|
+
if (t.item._sep)
|
|
1457
|
+
return;
|
|
1269
1458
|
var shouldEmit = !t.item._selected;
|
|
1270
1459
|
t.item._selected = true;
|
|
1271
1460
|
var itemSelection = _this.handleItemsSelection([t.item]);
|
|
@@ -1293,6 +1482,26 @@
|
|
|
1293
1482
|
this.ShiftClick = true;
|
|
1294
1483
|
}
|
|
1295
1484
|
};
|
|
1485
|
+
/**
|
|
1486
|
+
* Se l'Input è null (valore non settato) vede se c'è un default con cui valorizzarlo. Se non c'è utilizza il valore di fallback (qualora fornito)
|
|
1487
|
+
*
|
|
1488
|
+
* @param {T} inputValue Valore dell'Input
|
|
1489
|
+
* @param {T} defaultValue Valore di default impostato da configurazione
|
|
1490
|
+
* @param {T} fallbackValue Valore dell'Input per quando non è stato assegnato dal programmatore e non ha un default
|
|
1491
|
+
*/
|
|
1492
|
+
EsTableComponent.prototype.InputOrDefault = function (inputValue, defaultValue, fallbackValue) {
|
|
1493
|
+
// Input valorizzato dal programmatore
|
|
1494
|
+
if (inputValue != null && inputValue != undefined)
|
|
1495
|
+
return inputValue;
|
|
1496
|
+
// Input valorizzato da configurazione globale
|
|
1497
|
+
if (defaultValue != null && defaultValue != undefined)
|
|
1498
|
+
return defaultValue;
|
|
1499
|
+
//Input non valorizzato da niente e da nessuno
|
|
1500
|
+
if (fallbackValue != null && fallbackValue != undefined)
|
|
1501
|
+
return fallbackValue;
|
|
1502
|
+
// I casi in cui si arriva qui sono i casi di Input che di default va bene che siano nulli e che nessuno si caga
|
|
1503
|
+
return null;
|
|
1504
|
+
};
|
|
1296
1505
|
/** @ignore */
|
|
1297
1506
|
EsTableComponent.prototype.ngOnDestroy = function () {
|
|
1298
1507
|
if (this.ctxMenuSubscription)
|
|
@@ -1302,7 +1511,7 @@
|
|
|
1302
1511
|
EsTableComponent.prototype.ngOnChanges = function (changes) {
|
|
1303
1512
|
return __awaiter(this, void 0, void 0, function () {
|
|
1304
1513
|
var newSearchView;
|
|
1305
|
-
return __generator(this, function (
|
|
1514
|
+
return __generator(this, function (_s) {
|
|
1306
1515
|
newSearchView = changes['SearchView'];
|
|
1307
1516
|
if (newSearchView && this.SearchView)
|
|
1308
1517
|
this.arrayPulsanti = this.getPagesArray(6, this.SearchView.page, this.SearchView.pages || 1);
|
|
@@ -1310,6 +1519,7 @@
|
|
|
1310
1519
|
});
|
|
1311
1520
|
});
|
|
1312
1521
|
};
|
|
1522
|
+
// #endregion
|
|
1313
1523
|
// #region Implementazione ControlValueAccessor ignorabile
|
|
1314
1524
|
/** @ignore */
|
|
1315
1525
|
EsTableComponent.prototype.registerOnChange = function (fn) { this.propagateChange = fn; };
|
|
@@ -1320,6 +1530,7 @@
|
|
|
1320
1530
|
// #endregion
|
|
1321
1531
|
/** @ignore */
|
|
1322
1532
|
EsTableComponent.prototype.writeValue = function (obj) {
|
|
1533
|
+
var _a;
|
|
1323
1534
|
this.View = obj ? obj : null;
|
|
1324
1535
|
// Mi è arrivata l'AppSearch quindi di sicuro non ho una ricerca in progress
|
|
1325
1536
|
this.researchInProgress = false;
|
|
@@ -1352,10 +1563,11 @@
|
|
|
1352
1563
|
else if (this.View && this.View instanceof AppSearch) {
|
|
1353
1564
|
// Se cambia l'oggetto intero significa che ho rimandato la ricerca
|
|
1354
1565
|
this.setMode('view');
|
|
1566
|
+
var firstItemGroupOrNoGrouping = (((_a = this.View.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) || 0) == 0;
|
|
1355
1567
|
// Se vengo da una ricerca interna mantengo lo stato di selezione precedente (quindi su cambio pagina, cambio ipp, ecc...)
|
|
1356
1568
|
// se invece l'utente ha fatto una ricerca lui (quindi cambiando filtri), secco le info di selezione
|
|
1357
|
-
if (!this.View.selection || !this.View.internalsearchrequest || !this.UseSelectionCache) {
|
|
1358
|
-
this.
|
|
1569
|
+
if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache) {
|
|
1570
|
+
this.clearSelectionCaches();
|
|
1359
1571
|
this.View.selection = new ItemsSelection([]);
|
|
1360
1572
|
this.onSelectionChanged.emit(this.View.selection);
|
|
1361
1573
|
}
|
|
@@ -1374,55 +1586,136 @@
|
|
|
1374
1586
|
}
|
|
1375
1587
|
}
|
|
1376
1588
|
}
|
|
1377
|
-
|
|
1589
|
+
// La paginazione devo farla solamente quando richiedo o un gruppo principale (se sono in row grouping) o se non richiedo gruppi (in tutti lgi altri casi)
|
|
1590
|
+
if (firstItemGroupOrNoGrouping)
|
|
1591
|
+
this.arrayPulsanti = this.getPagesArray(6, this.View.page, this.View.pages || 1);
|
|
1378
1592
|
}
|
|
1379
1593
|
else if (this.View && (this.View.length != null && this.View.length != undefined)) {
|
|
1380
1594
|
this.setMode('array');
|
|
1381
1595
|
if (!this.UseSelectionCache || !this.arraymodeSelection) {
|
|
1382
|
-
this.
|
|
1596
|
+
this.clearSelectionCaches();
|
|
1383
1597
|
this.arraymodeSelection = new ItemsSelection([]);
|
|
1384
1598
|
;
|
|
1385
1599
|
this.onSelectionChanged.emit(this.arraymodeSelection);
|
|
1386
1600
|
}
|
|
1601
|
+
// Recupero Preference
|
|
1602
|
+
if (this.SavePreferences) {
|
|
1603
|
+
if (!this.ngControl.name)
|
|
1604
|
+
console.error("Non posso utilizzare le preference senza avere un 'name' per questa tabella");
|
|
1605
|
+
else if (!this.prefService)
|
|
1606
|
+
console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato");
|
|
1607
|
+
else {
|
|
1608
|
+
var prefs = this.prefService.retrieve(this.ngControl.name);
|
|
1609
|
+
if (prefs) {
|
|
1610
|
+
this.arrayColumns = prefs.columns;
|
|
1611
|
+
this.arrayColumnOrdering = prefs.column_ordering;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1387
1615
|
if (this.SearchView)
|
|
1388
1616
|
this.arrayPulsanti = this.getPagesArray(6, this.SearchView.page, this.SearchView.pages || 1);
|
|
1389
1617
|
}
|
|
1390
|
-
if (this.View && !(this.View instanceof ReportDefinition))
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1618
|
+
if (this.View && !(this.View instanceof ReportDefinition))
|
|
1619
|
+
this.finalizeContext();
|
|
1620
|
+
this.postBoundSourceCalculation();
|
|
1621
|
+
};
|
|
1622
|
+
/**
|
|
1623
|
+
* Successivamente al bind del nuovo input questa funzione si occupa di finalizzare tutti i parametri di funzionamento dell'es-table
|
|
1624
|
+
* in base a Input - Modello, e qualsiasi altra cosa possa servire
|
|
1625
|
+
*/
|
|
1626
|
+
EsTableComponent.prototype.finalizeContext = function () {
|
|
1627
|
+
var viewCasted = this.View;
|
|
1628
|
+
/*
|
|
1629
|
+
*Uso la tecnica di EndlessScroll se la variabile relativa è attiva e se
|
|
1630
|
+
* 1) Ho un Array, oppure
|
|
1631
|
+
* 2) Ho un AppSearch che sta cercando con paginazione "Tutto", oppure
|
|
1632
|
+
* 3) Ho un AppSearch che sta cercando con paginazione diversa da "Tutto" ma con la variabile EndlessScrollOnlyForAll a false
|
|
1633
|
+
*/
|
|
1634
|
+
var isAppSearchWithIppMax = this.viewMode && viewCasted.itemsperpageoverride == this.defaultAllPageOverride;
|
|
1635
|
+
var isAppSearchNoMaxIpp = this.viewMode && viewCasted.itemsperpageoverride != this.defaultAllPageOverride;
|
|
1636
|
+
this.UseEndlessscroll = this.EndlessScroll && (this.arrayMode || isAppSearchWithIppMax || (isAppSearchNoMaxIpp && !this.EndlessScrollOnlyForAll));
|
|
1637
|
+
var hasRowGroups = (viewCasted.groupings && viewCasted.groupings.filter(function (t) { return !t.aggregation; }).length > 0) || (this.arrayMode && this.EsThsDirective.some(function (t) { return t.thGroup; }));
|
|
1638
|
+
// Se ho dei gruppi in modalità array devo sistemare un po' di variabili che diventano insensate
|
|
1639
|
+
if (this.arrayMode) {
|
|
1640
|
+
if (hasRowGroups)
|
|
1641
|
+
this.UseArrayModePaging = false;
|
|
1642
|
+
}
|
|
1643
|
+
// Riempimento della TMPBoundSource con gli oggetti che verranno poi mostrati ad interfaccia
|
|
1644
|
+
if (this.UseEndlessscroll && !hasRowGroups) {
|
|
1645
|
+
this.addedSlices = [];
|
|
1646
|
+
this.boundSubSources = this.getItemSlices();
|
|
1647
|
+
var firstSub = this.boundSubSources[0];
|
|
1648
|
+
this.TMPBoundSource = firstSub ? firstSub : [];
|
|
1649
|
+
if (firstSub)
|
|
1650
|
+
this.addedSlices.push(0);
|
|
1651
|
+
}
|
|
1652
|
+
else
|
|
1653
|
+
this.TMPBoundSource = this.getItemsByMode(false, !this.internalWriteCall);
|
|
1654
|
+
// Se ho una gerarchia, assegno i livelli gerarchici alla TMPBoundSource
|
|
1655
|
+
if (this.Hierarchy && !hasRowGroups)
|
|
1656
|
+
this.assignHierarchyLevels(this.TMPBoundSource);
|
|
1657
|
+
// L'hashing degli oggetti lo faccio a prescindere
|
|
1658
|
+
this.calculateHash(this.TMPBoundSource);
|
|
1659
|
+
// Assegno a una variabile mia l'eventuale override per la classe della riga
|
|
1660
|
+
// Se poi sono in modalità gerarchica inietto anche la classe per la configurazione del livello della riga
|
|
1661
|
+
if ((this.TMPBoundSource && this.RowClassAssigner) || this.Hierarchy) {
|
|
1662
|
+
for (var i = 0; i < this.TMPBoundSource.length; i++) {
|
|
1663
|
+
var item = this.TMPBoundSource[i];
|
|
1664
|
+
item._rowClass = this.RowClassAssigner ? this.RowClassAssigner(item) : "";
|
|
1665
|
+
item._rowClass += this.Hierarchy ? " est-row-lvl-" + item._level : "";
|
|
1407
1666
|
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
/** Genera le informzioni di paginazione per la vista globale dell'es-table */
|
|
1670
|
+
EsTableComponent.prototype.setupPagingInformations = function () {
|
|
1671
|
+
this.PagerOptions.ShowCount = !this.HidePagingCount;
|
|
1672
|
+
if (this.arrayMode && this.UseArrayModePaging && !this.SearchView) {
|
|
1673
|
+
this.PagerOptions.PagerCount = this.View.length || 0;
|
|
1674
|
+
this.PagerOptions.ShowPaging = !this.HidePaging && this.View.length > 10;
|
|
1675
|
+
this.PagerOptions.View = this.View;
|
|
1676
|
+
this.PagerOptions.UsesView = false;
|
|
1677
|
+
}
|
|
1678
|
+
else if (this.arrayMode && (!this.UseArrayModePaging || this.SearchView)) {
|
|
1679
|
+
if (this.SearchView) {
|
|
1680
|
+
this.PagerOptions.View = this.SearchView;
|
|
1681
|
+
this.PagerOptions.PagerCount = this.SearchView.objectcount || 0;
|
|
1421
1682
|
}
|
|
1683
|
+
else
|
|
1684
|
+
this.PagerOptions.PagerCount = this.View.length || 0;
|
|
1685
|
+
this.PagerOptions.ShowCount = this.PagerOptions.ShowCount || (this.View && this.View.length) || (this.SearchView && this.SearchView.objectcount && this.SearchView.objectcount != -1);
|
|
1422
1686
|
}
|
|
1423
|
-
this.
|
|
1687
|
+
else if (this.viewMode) {
|
|
1688
|
+
var tmpView = this.MainGroupView || this.View;
|
|
1689
|
+
var count = (tmpView === null || tmpView === void 0 ? void 0 : tmpView.groupcount) || (tmpView === null || tmpView === void 0 ? void 0 : tmpView.objectcount);
|
|
1690
|
+
this.PagerOptions.Searches = (tmpView === null || tmpView === void 0 ? void 0 : tmpView.groupcount) != null && (tmpView === null || tmpView === void 0 ? void 0 : tmpView.groupcount) != undefined ? 'groups' : 'items';
|
|
1691
|
+
this.PagerOptions.PagerCount = count || 0;
|
|
1692
|
+
this.PagerOptions.View = tmpView;
|
|
1693
|
+
this.PagerOptions.ShowCount = this.PagerOptions.ShowCount || (tmpView && count && count != -1);
|
|
1694
|
+
this.PagerOptions.ShowPaging = !this.HidePaging;
|
|
1695
|
+
}
|
|
1696
|
+
else if (this.reportMode) {
|
|
1697
|
+
var rvc = this.ReportValues.count;
|
|
1698
|
+
this.PagerOptions.View = this.View;
|
|
1699
|
+
this.PagerOptions.PagerCount = rvc && rvc == -1 ? this.ReportValues.rows.length : rvc && rvc > 0 ? this.ReportValues.count : 0;
|
|
1700
|
+
this.PagerOptions.ShowCount = this.PagerOptions.ShowCount || (this.View && this.View.objectcount && this.View.objectcount != -1);
|
|
1701
|
+
this.PagerOptions.ShowPaging = !this.HidePaging && this.View.pagingavailable;
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
/**
|
|
1705
|
+
* Ripulisce le cache di selezione
|
|
1706
|
+
*
|
|
1707
|
+
* @todo: SELECTION
|
|
1708
|
+
*/
|
|
1709
|
+
EsTableComponent.prototype.clearSelectionCaches = function () {
|
|
1710
|
+
this.itemsCache.clear();
|
|
1711
|
+
this.groupsCache.clear();
|
|
1712
|
+
this.exclusionsCache.clear();
|
|
1713
|
+
this.group_exclusionsCache.clear();
|
|
1714
|
+
this.i_itemsCache.clear();
|
|
1715
|
+
this.i_groupsCache.clear();
|
|
1716
|
+
this.i_exclusionsCache.clear();
|
|
1717
|
+
this.i_group_exclusionsCache.clear();
|
|
1424
1718
|
};
|
|
1425
|
-
// #region Gestione retrieve degli oggetti da mostrare in tabella, considerando eventuali Endless Scrolls
|
|
1426
1719
|
/**
|
|
1427
1720
|
* In base alla modalità specificata (ArrayMode, ViewMode, ecc...) questo metodo recupera l'array di oggetti da bindare ad interfaccia
|
|
1428
1721
|
*
|
|
@@ -1431,6 +1724,8 @@
|
|
|
1431
1724
|
* @param {boolean} allIfPossible [false] Indica se prendere tutti gli oggetti quaora possibile, usato solo in ArrayMode
|
|
1432
1725
|
*
|
|
1433
1726
|
* @returns {any[]} Lista degli oggetti su cui effettuare il bind lato interfaccia
|
|
1727
|
+
*
|
|
1728
|
+
* @todo: ITEMS
|
|
1434
1729
|
*/
|
|
1435
1730
|
EsTableComponent.prototype.getItemsByMode = function (onlyselected, refreshPaging, allIfPossible) {
|
|
1436
1731
|
if (onlyselected === void 0) { onlyselected = false; }
|
|
@@ -1441,6 +1736,8 @@
|
|
|
1441
1736
|
items = this.getViewItemsBySource();
|
|
1442
1737
|
}
|
|
1443
1738
|
else if (this.arrayMode) {
|
|
1739
|
+
this.View.forEach(function (itm) { itm._item = true; });
|
|
1740
|
+
// Se faccio dei raggruppamenti ignoro la paginazione
|
|
1444
1741
|
if (this.UseArrayModePaging && !allIfPossible) {
|
|
1445
1742
|
// Se sono in modalità array ma la ricerca dipende da una view devo riallineare gli itemperpage
|
|
1446
1743
|
if (this.SearchView)
|
|
@@ -1459,16 +1756,62 @@
|
|
|
1459
1756
|
return items.filter(function (t) { return t._selected; });
|
|
1460
1757
|
return items;
|
|
1461
1758
|
};
|
|
1462
|
-
/** @ignore */
|
|
1463
|
-
EsTableComponent.prototype.getViewItemsBySource = function () {
|
|
1464
|
-
return this.SecondarySource ? this.View.items2 : this.TertiarySource ? this.View.items3 : this.View.items;
|
|
1465
|
-
};
|
|
1466
1759
|
/**
|
|
1467
|
-
*
|
|
1760
|
+
* @ignore
|
|
1468
1761
|
*
|
|
1469
|
-
* @
|
|
1762
|
+
* @todo: ITEMS
|
|
1470
1763
|
*/
|
|
1471
|
-
EsTableComponent.prototype.
|
|
1764
|
+
EsTableComponent.prototype.getViewItemsBySource = function () {
|
|
1765
|
+
var _this = this;
|
|
1766
|
+
var _a, _b;
|
|
1767
|
+
var castedView = this.View;
|
|
1768
|
+
var groupKeys = castedView.groupings ? castedView.groupings.filter(function (t) { return !t.aggregation; }).length : 0;
|
|
1769
|
+
//Gruppi intermedi
|
|
1770
|
+
if ((((_a = castedView.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) != groupKeys || ((_b = castedView.requestedgroups) === null || _b === void 0 ? void 0 : _b.length) == 0) && groupKeys > 0) {
|
|
1771
|
+
var ret = castedView.groups;
|
|
1772
|
+
ret.forEach(function (itm) {
|
|
1773
|
+
// Setto variabile interna per capire che questo è in realtà un gruppo
|
|
1774
|
+
itm._group = true;
|
|
1775
|
+
// Le informazioni passate come lista le metto dentro a una cache per velocizzarne l'accesso quando devo tirare fuori il display della proprietà
|
|
1776
|
+
_this.cacheAggregations(itm);
|
|
1777
|
+
});
|
|
1778
|
+
return ret;
|
|
1779
|
+
}
|
|
1780
|
+
else {
|
|
1781
|
+
var ret = this.SecondarySource ? this.View.items2 : this.TertiarySource ? this.View.items3 : this.View.items;
|
|
1782
|
+
// Setto variabile interna per specificare che questo è un elemento normale, non un gruppo o altro
|
|
1783
|
+
ret.forEach(function (itm) { itm._item = true; });
|
|
1784
|
+
return ret;
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
/**
|
|
1788
|
+
* Helper per effettuare il caching delle aggregazioni. Le sposta da una lista di **GroupAggregation** a una **<Map<string, Map<string, string>>**
|
|
1789
|
+
*
|
|
1790
|
+
* @todo: ROWGROUPING
|
|
1791
|
+
*/
|
|
1792
|
+
EsTableComponent.prototype.cacheAggregations = function (group) {
|
|
1793
|
+
group._aggregationsCache = new Map();
|
|
1794
|
+
var castedAgCache = group._aggregationsCache;
|
|
1795
|
+
for (var i = 0; i < group.aggregations.length; i++) {
|
|
1796
|
+
var agg = group.aggregations[i];
|
|
1797
|
+
if (castedAgCache.has(agg.column))
|
|
1798
|
+
castedAgCache.get(agg.column).set(agg.aggregation, agg.value);
|
|
1799
|
+
else {
|
|
1800
|
+
var tmp = new Map();
|
|
1801
|
+
tmp.set(agg.aggregation, agg.value);
|
|
1802
|
+
castedAgCache.set(agg.column, tmp);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
};
|
|
1806
|
+
/**
|
|
1807
|
+
* Metodo che prende tutti gli oggetti di cui dispone divisi in bucket da 100 elementi
|
|
1808
|
+
*
|
|
1809
|
+
* @returns {any[][]} Matrice di array Nx100
|
|
1810
|
+
*
|
|
1811
|
+
* @todo: ITEMS
|
|
1812
|
+
*/
|
|
1813
|
+
EsTableComponent.prototype.getItemSlices = function () {
|
|
1814
|
+
// Se sono qui di sicuro non ho rowgrouping
|
|
1472
1815
|
var items = this.getItemsByMode();
|
|
1473
1816
|
if (!items)
|
|
1474
1817
|
return [];
|
|
@@ -1503,8 +1846,6 @@
|
|
|
1503
1846
|
}
|
|
1504
1847
|
}
|
|
1505
1848
|
};
|
|
1506
|
-
// #endregion
|
|
1507
|
-
// #region Gestione di tutto il ciclo di vita post binding oggetti
|
|
1508
1849
|
/**
|
|
1509
1850
|
* Metodo lanciato dopo che la sorgente dati è stata correttamente bindata, si occupa di ricalcolare tutto ciò che serve
|
|
1510
1851
|
* all'es-table per renderizzare i valori da mostrare
|
|
@@ -1515,113 +1856,476 @@
|
|
|
1515
1856
|
this.RowContexts = [];
|
|
1516
1857
|
this.OrderDirectives = [];
|
|
1517
1858
|
this.lastSelectedItemID = null;
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
_this.
|
|
1523
|
-
|
|
1524
|
-
if (_this.viewMode && _this.UseCustomCells) {
|
|
1525
|
-
var view = _this.View;
|
|
1526
|
-
var ths = _this.EsThs && _this.EsThs.length > 0 ? _this.EsThs.toArray() : _this.EsThsDirective && _this.EsThsDirective.length > 0 ? _this.EsThsDirective.toArray() : [];
|
|
1527
|
-
var tds = _this.EsTds && _this.EsTds.length > 0 ? _this.EsTds.toArray() : _this.EsTdsDirective && _this.EsTdsDirective.length > 0 ? _this.EsTdsDirective.toArray() : [];
|
|
1528
|
-
// N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
|
|
1529
|
-
// ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
|
|
1530
|
-
_this.alignColumnsIfLoadedView(view); // Se sto caricando una View da hotpotato (quindi con savedstate = true) riallineo la visibilità delle colonne e il loro ordine.
|
|
1531
|
-
_this.refreshColumnsVisibility(ths, tds, view); // Lavoro sui TH ed eventualmente modifico la visibilità anche dei TD.
|
|
1532
|
-
_this.alignHeadersOrdering(ths, view); // Allineo gli ordinamenti agli header
|
|
1533
|
-
_this.reviewColumnsList(ths); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
|
|
1534
|
-
// ************************************* Generazione binding per righe e colonne *************************************
|
|
1535
|
-
_this.evaluateRowThs(ths); // Raccolgo i TH
|
|
1536
|
-
_this.evaluateRowTds(ths, tds); // Raccolgo i TD in contesti separati, un contesto per ogni item
|
|
1537
|
-
// ************************************* Ultimi aggiustmaenti dei binding *************************************
|
|
1538
|
-
_this.generateDefaultOrder(view); // Genero le direttive di ordinamento, che siano default o derivanti dalla AppSearch
|
|
1539
|
-
_this.applyOrdering(view, true); // Applico l'ordinamento sulle colonne (non ASC DESC, ma "prima questa o quella colonna")
|
|
1540
|
-
_this.MoveTemporaryVariablesToRealOnes(); // Collego TH e TD aggiustati fino ad ora alle variabili di Binding HTML
|
|
1541
|
-
_this.evaluateSelection(view.items, view.selection); // Riallineo le info di selezione degli elementi della View
|
|
1542
|
-
}
|
|
1543
|
-
else if (_this.viewMode && !_this.UseCustomCells) {
|
|
1544
|
-
// Riallineo le info di selezione degli elementi della View
|
|
1545
|
-
var view = _this.View;
|
|
1546
|
-
_this.evaluateSelection(view.items, view.selection);
|
|
1547
|
-
}
|
|
1548
|
-
else if (_this.arrayMode) {
|
|
1549
|
-
// Riallineo le info di selezione degli elementi dell'array
|
|
1550
|
-
_this.arrayModeEvaluateSelection(_this.View);
|
|
1551
|
-
}
|
|
1552
|
-
// Collego gli oggetti da mostrare
|
|
1553
|
-
_this.boundSource = _this.TMPBoundSource;
|
|
1554
|
-
// Per essere sicuro che dopo un bind di oggetti la es-table aggiorni la grafica
|
|
1555
|
-
_this.cdr.markForCheck();
|
|
1556
|
-
_this.FirstBind = false;
|
|
1557
|
-
});
|
|
1859
|
+
if (this.EsThsDirective && this.EsThsDirective.length > 0 && this.EsTdsDirective && this.EsTdsDirective.length > 0)
|
|
1860
|
+
this.internalPostBoundSource();
|
|
1861
|
+
else {
|
|
1862
|
+
this.cdr.detectChanges();
|
|
1863
|
+
setTimeout(function () { _this.internalPostBoundSource(); });
|
|
1864
|
+
}
|
|
1558
1865
|
};
|
|
1559
1866
|
/**
|
|
1560
|
-
*
|
|
1867
|
+
* Per poter distinguere le chiamate a questo metodo: Dopo il setTimeout se uso gli EsTd/EsTh vecchi, senza il setTimeout se uso le nuove direttive
|
|
1561
1868
|
*/
|
|
1562
|
-
EsTableComponent.prototype.
|
|
1563
|
-
|
|
1564
|
-
this.
|
|
1869
|
+
EsTableComponent.prototype.internalPostBoundSource = function () {
|
|
1870
|
+
var View = this.View;
|
|
1871
|
+
var ths = this.EsThs && this.EsThs.length > 0 ? this.EsThs.toArray() : this.EsThsDirective && this.EsThsDirective.length > 0 ? this.EsThsDirective.toArray() : [];
|
|
1872
|
+
var tds = this.EsTds && this.EsTds.length > 0 ? this.EsTds.toArray() : this.EsTdsDirective && this.EsTdsDirective.length > 0 ? this.EsTdsDirective.toArray() : [];
|
|
1873
|
+
// Se non ho colonne dinamiche ma sono in modalità dinamica (lo capisco perché c'è una view piena di genericitem) metto il default delle colonne
|
|
1874
|
+
this.eventuallyReviewDynamicColumns();
|
|
1875
|
+
this.bindDisplayToLoadedItemsOrGroups(View);
|
|
1876
|
+
// Questo dev'essere per forza lanciato dopo **bindDisplayToLoadedItemsOrGroups** dato che è lì che alcune cose vengono valorizzate
|
|
1877
|
+
this.setupPagingInformations();
|
|
1878
|
+
// Molte cose sono ovviamente disponibili solo in modalità View
|
|
1879
|
+
if ((this.viewMode || this.arrayMode) && this.UseCustomCells) {
|
|
1880
|
+
var view = this.viewMode ? View : null;
|
|
1881
|
+
var itemsAndGroups = this.viewMode ? __spread((view.items || []), (view.groups || [])) : View;
|
|
1882
|
+
var si = this.viewMode ? view.selection : this.arraymodeSelection;
|
|
1883
|
+
// N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
|
|
1884
|
+
// ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
|
|
1885
|
+
var hI = this.evaluateHeadersGroupingInfos(ths); // Prepassaggio per tirare fuori tutte le info utili sugli headers in modo da non ricacolarseli sempre dopo
|
|
1886
|
+
if (this.arrayMode) { // In modalità array non ho un backend...
|
|
1887
|
+
this.arrayModeReviewOrderings(); // ... quindi gli ordinamenti li devo fare lato client, e ...
|
|
1888
|
+
this.arrayModeReviewGroupings(hI.leafs); // ... i raggruppamenti li devo fare lato client
|
|
1889
|
+
}
|
|
1890
|
+
this.reviewColumnsList(hI.leafs); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
|
|
1891
|
+
this.moveFixedColumnsAtTheBeginning(hI.leafs, tds); // Sposto tutte le cose fixed all'inizio in modo che la creazione di th e td sia più snella (Utilizza le ColumnsList, quindi dev'essere richiamata PIRMA di reviewColumnsList)
|
|
1892
|
+
this.alignHeadersOrdering(hI.leafs, view); // Allineo gli ordinamenti agli header
|
|
1893
|
+
this.alignColumnsIfLoadedView(view); // Se sto caricando una View da hotpotato (quindi con savedstate = true) riallineo la visibilità delle colonne e il loro ordine.
|
|
1894
|
+
this.refreshColumnsVisibility(hI.leafs, tds, view); // Lavoro sui TH ed eventualmente modifico la visibilità anche dei TD.
|
|
1895
|
+
this.evaluatePinnedColumnsWidth(); // Se sono presenti colonne pinnate valuta la dimensione del contenitore
|
|
1896
|
+
this.generateDefaultOrder(hI.leafs, view); // Genero le direttive di ordinamento, che siano default o derivanti dalla AppSearch
|
|
1897
|
+
this.evaluateHeaderGroups(hI); // Valuto i raggruppamenti degli header se presenti
|
|
1898
|
+
// ************************************* Generazione binding per righe e colonne *************************************
|
|
1899
|
+
this.evaluateRowThs(hI.leafs); // Raccolgo i TH
|
|
1900
|
+
this.evaluateRowTds(hI.leafs, tds); // Raccolgo i TD in contesti separati, un contesto per ogni item o gruppo
|
|
1901
|
+
// ************************************* Ultimi aggiustmaenti dei binding *************************************
|
|
1902
|
+
this.applyOrdering(view, true); // Applico l'ordinamento sulle colonne (non ASC DESC, ma "prima questa o quella colonna")
|
|
1903
|
+
this.MoveTemporaryVariablesToRealOnes(); // Collego TH e TD aggiustati fino ad ora alle variabili di Binding HTML
|
|
1904
|
+
this.evaluateSelection(itemsAndGroups, si); // Riallineo le info di selezione degli elementi della View
|
|
1905
|
+
if (this.ResearchNeeded) {
|
|
1906
|
+
this.changed();
|
|
1907
|
+
this.emitSearchRequest(false);
|
|
1908
|
+
this.ResearchNeeded = false;
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
else if ((this.viewMode || this.arrayMode) && !this.UseCustomCells) {
|
|
1912
|
+
// Riallineo le info di selezione degli elementi della View
|
|
1913
|
+
var items = this.viewMode ? View.items : View;
|
|
1914
|
+
var si = this.viewMode ? View.selection : this.arraymodeSelection;
|
|
1915
|
+
this.evaluateSelection(items, si);
|
|
1916
|
+
}
|
|
1917
|
+
// Per essere sicuro che dopo un bind di oggetti la es-table aggiorni la grafica
|
|
1918
|
+
this.cdr.markForCheck();
|
|
1919
|
+
this.FirstBind = false;
|
|
1565
1920
|
};
|
|
1566
1921
|
/**
|
|
1567
|
-
*
|
|
1922
|
+
* Se in modalità array applica gli ordinamenti ASC-DESC delle colonne
|
|
1568
1923
|
*
|
|
1569
|
-
* @
|
|
1570
|
-
* @param {ItemsSelection<any>} selectionItem Oggetti di selezione derivante dalla view o dall'oggetto per Array
|
|
1924
|
+
* @todo: INTERNALDB
|
|
1571
1925
|
*/
|
|
1572
|
-
EsTableComponent.prototype.
|
|
1573
|
-
|
|
1926
|
+
EsTableComponent.prototype.arrayModeReviewOrderings = function () {
|
|
1927
|
+
var _this = this;
|
|
1928
|
+
if (this.arrayOrders.length > 0)
|
|
1929
|
+
this.arrayOrders.forEach(function (t) {
|
|
1930
|
+
_this.boundSource = _this.boundSource.sort(function (a, b) { return (a[t.id] > b[t.id] ? 1 : -1) * (t.order == 'DESC' ? -1 : 1); });
|
|
1931
|
+
});
|
|
1932
|
+
};
|
|
1933
|
+
/**
|
|
1934
|
+
* Se in modalità array applica i raggruppamenti definiti lato row-grouping
|
|
1935
|
+
*
|
|
1936
|
+
* @param {ths: EsTh[] | EsThDirective[]} ths Header
|
|
1937
|
+
*
|
|
1938
|
+
* @todo: ROW GROUPING
|
|
1939
|
+
*/
|
|
1940
|
+
EsTableComponent.prototype.arrayModeReviewGroupings = function (ths) {
|
|
1941
|
+
if (ths.length == 0)
|
|
1574
1942
|
return;
|
|
1575
|
-
this.
|
|
1943
|
+
if (this.isEsTh(ths[0]))
|
|
1944
|
+
return;
|
|
1945
|
+
var headerGroups = [];
|
|
1946
|
+
var headerAggregations = [];
|
|
1947
|
+
for (var i = 0; i < ths.length; i++) {
|
|
1948
|
+
var th = ths[i];
|
|
1949
|
+
if (th.thGroup)
|
|
1950
|
+
headerGroups.push(new Group(th.th, 0, ""));
|
|
1951
|
+
else if (th.thAggregation)
|
|
1952
|
+
headerAggregations = __spread(headerAggregations, this.getGroupAggregations(th));
|
|
1953
|
+
}
|
|
1954
|
+
if (headerGroups.length > 0) {
|
|
1955
|
+
// Pulizia delle cache
|
|
1956
|
+
this.rgGroupCache.clear();
|
|
1957
|
+
this.rgItemCache.clear();
|
|
1958
|
+
this.rgChildGroupsCache.clear();
|
|
1959
|
+
this.ArrayGrouping = true;
|
|
1960
|
+
this.boundSource = this.getGroupsRecursive(headerGroups, 0, this.boundSource, headerAggregations, null);
|
|
1961
|
+
}
|
|
1576
1962
|
};
|
|
1577
1963
|
/**
|
|
1578
|
-
*
|
|
1964
|
+
* Data la definizione dei gruppi da generare da una lista di oggetti, suddivide gli oggetti passati in gruppi e sottogruppi
|
|
1579
1965
|
*
|
|
1580
|
-
* @param {
|
|
1966
|
+
* @param {Group[]} grps Definizione dei gruppi
|
|
1967
|
+
* @param {number} currentIndex Indice di elaborazione. Al livello 0 ho tutti gli oggetti e devo generare i primi gruppi, a livello 1 ho tutti i gruppi principali e devo
|
|
1968
|
+
* elaborare i sottogruppi, e così via ricorsivamente...
|
|
1969
|
+
* @param {any[]} items Oggetti da raggruppare
|
|
1970
|
+
* @param {GroupOrAggregation[]} aggregations Info di aggregazione
|
|
1971
|
+
* @param {any} parent Riferimento al gruppo padre
|
|
1972
|
+
*
|
|
1973
|
+
* @todo: INTERNALDB
|
|
1581
1974
|
*/
|
|
1582
|
-
EsTableComponent.prototype.
|
|
1583
|
-
|
|
1975
|
+
EsTableComponent.prototype.getGroupsRecursive = function (grps, currentIndex, items, aggregations, parent) {
|
|
1976
|
+
// Se l'indice è 0 devo sicuramente nascondere tutti gli oggetti. Solo i gruppi saranno visualizzati
|
|
1977
|
+
if (currentIndex == 0)
|
|
1978
|
+
items.forEach(function (i) { return i._visible = false; });
|
|
1979
|
+
var grp = grps[currentIndex];
|
|
1980
|
+
var ret = [];
|
|
1981
|
+
var last = grps.length == currentIndex + 1;
|
|
1982
|
+
var groups = this.groupBy(items, grp.column);
|
|
1983
|
+
var _loop_1 = function (prop) {
|
|
1984
|
+
var itms = groups[prop];
|
|
1985
|
+
var gp = new Group(grp.column, itms.length, prop);
|
|
1986
|
+
gp.aggregations = this_1.generateAggregations(itms, aggregations);
|
|
1987
|
+
var anygp = gp;
|
|
1988
|
+
anygp._group = true;
|
|
1989
|
+
anygp._expanded = false;
|
|
1990
|
+
if (!parent) {
|
|
1991
|
+
anygp._thisRoute = [{ column: gp.column, value: gp.value }];
|
|
1992
|
+
anygp._thisKey = gp.value;
|
|
1993
|
+
anygp._grouplevel = 0;
|
|
1994
|
+
}
|
|
1995
|
+
else {
|
|
1996
|
+
anygp._parent = parent._thisKey;
|
|
1997
|
+
anygp._parentRoute = parent._thisRoute;
|
|
1998
|
+
anygp._thisRoute = __spread(parent._thisRoute, [{ column: gp.column, value: gp.value }]);
|
|
1999
|
+
anygp._thisKey = parent._thisKey + gp.value;
|
|
2000
|
+
anygp._grouplevel = parent._grouplevel + 1;
|
|
2001
|
+
}
|
|
2002
|
+
// Pusho il gruppo, tutti i gruppi del livello sotto, o gli item se io sono l'ultimo gruppo.
|
|
2003
|
+
// La visibilità è solo per il gruppo a livello 0, tutti gli altri gruppi saranno mostrati o nascosti di conseguenza
|
|
2004
|
+
if (currentIndex == 0)
|
|
2005
|
+
anygp._visible = true;
|
|
2006
|
+
this_1.calculateHash([anygp]);
|
|
2007
|
+
this_1.cacheAggregations(anygp);
|
|
2008
|
+
// Aggiungo il gruppo padre
|
|
2009
|
+
ret.push(anygp);
|
|
2010
|
+
this_1.rgGroupCache.set(anygp._thisKey, anygp);
|
|
2011
|
+
if (!last) {
|
|
2012
|
+
//Dal gruppo padre, se non è l'ultimo gruppo della catena, calcolo ricorsivamente tutta la catena sotto
|
|
2013
|
+
var subGroupsAndItems = this_1.getGroupsRecursive(grps, currentIndex + 1, itms, aggregations, anygp);
|
|
2014
|
+
var childgroups = subGroupsAndItems.filter(function (t) { return t._group && t._parent == anygp._thisKey; });
|
|
2015
|
+
anygp._groupscount = childgroups.length;
|
|
2016
|
+
// Aggiungo la catena del gruppo sotto, aggiungendo alla cache solo i gruppi padre
|
|
2017
|
+
ret.push.apply(ret, __spread(subGroupsAndItems));
|
|
2018
|
+
this_1.rgChildGroupsCache.set(anygp._thisKey, childgroups);
|
|
2019
|
+
}
|
|
2020
|
+
else {
|
|
2021
|
+
// Al gruppo padre, se è l'ultimo assegno tutte le foglie assegnandogli anche la chiave del gruppo
|
|
2022
|
+
itms.forEach(function (i) { return i._thisKey = anygp._thisKey; });
|
|
2023
|
+
ret.push.apply(ret, __spread(itms));
|
|
2024
|
+
this_1.rgItemCache.set(anygp._thisKey, itms);
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2027
|
+
var this_1 = this;
|
|
2028
|
+
for (var prop in groups) {
|
|
2029
|
+
_loop_1(prop);
|
|
2030
|
+
}
|
|
2031
|
+
return ret;
|
|
2032
|
+
};
|
|
2033
|
+
/**
|
|
2034
|
+
* Data una lista di oggetti genera le aggregazioni specificate. Si considera di avere tutti gli oggetti
|
|
2035
|
+
*
|
|
2036
|
+
* @param {any[]} items Oggetti di cui calcolare le aggregazione
|
|
2037
|
+
* @param {GroupOrAggregation[]} aggregations Aggergazioni da generare
|
|
2038
|
+
*
|
|
2039
|
+
* @todo: INTERNALDB
|
|
2040
|
+
*/
|
|
2041
|
+
EsTableComponent.prototype.generateAggregations = function (items, aggregations) {
|
|
2042
|
+
var rets = [];
|
|
2043
|
+
var aggregationValue = "", feField = null, stringAgg = null, dateAgg = null, numberAgg = null;
|
|
2044
|
+
for (var i = 0; i < aggregations.length; i++) {
|
|
2045
|
+
var agg = aggregations[i];
|
|
2046
|
+
feField = agg.column;
|
|
2047
|
+
if (!feField)
|
|
2048
|
+
continue;
|
|
2049
|
+
switch (agg.datatype) {
|
|
2050
|
+
case 'string':
|
|
2051
|
+
stringAgg = items.map(function (i) { return i[feField].toString(); });
|
|
2052
|
+
break;
|
|
2053
|
+
case 'date':
|
|
2054
|
+
dateAgg = items.map(function (i) { return new Date(i[feField]).getTime(); });
|
|
2055
|
+
break;
|
|
2056
|
+
case 'number':
|
|
2057
|
+
numberAgg = items.map(function (i) { return parseFloat(i[feField]); });
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
2060
|
+
switch (agg.aggregation) {
|
|
2061
|
+
case 'max':
|
|
2062
|
+
switch (agg.datatype) {
|
|
2063
|
+
case 'string':
|
|
2064
|
+
aggregationValue = stringAgg.sort().reverse()[0];
|
|
2065
|
+
break;
|
|
2066
|
+
case 'date':
|
|
2067
|
+
aggregationValue = new Date(Math.max.apply(Math, __spread(dateAgg))).toString();
|
|
2068
|
+
break;
|
|
2069
|
+
case 'number':
|
|
2070
|
+
aggregationValue = Math.max.apply(Math, __spread(numberAgg)).toString();
|
|
2071
|
+
break;
|
|
2072
|
+
}
|
|
2073
|
+
break;
|
|
2074
|
+
case 'min':
|
|
2075
|
+
switch (agg.datatype) {
|
|
2076
|
+
case 'string':
|
|
2077
|
+
aggregationValue = stringAgg.sort()[0];
|
|
2078
|
+
break;
|
|
2079
|
+
case 'date':
|
|
2080
|
+
aggregationValue = new Date(Math.min.apply(Math, __spread(dateAgg))).toString();
|
|
2081
|
+
break;
|
|
2082
|
+
case 'number':
|
|
2083
|
+
aggregationValue = Math.min.apply(Math, __spread(numberAgg)).toString();
|
|
2084
|
+
break;
|
|
2085
|
+
}
|
|
2086
|
+
break;
|
|
2087
|
+
case 'sum':
|
|
2088
|
+
switch (agg.datatype) {
|
|
2089
|
+
case 'string':
|
|
2090
|
+
aggregationValue = stringAgg.join(", ");
|
|
2091
|
+
break;
|
|
2092
|
+
case 'date':
|
|
2093
|
+
aggregationValue = "";
|
|
2094
|
+
break;
|
|
2095
|
+
case 'number':
|
|
2096
|
+
aggregationValue = numberAgg.reduce(function (pre, curr) { return pre + curr; }, 0).toString();
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
break;
|
|
2100
|
+
}
|
|
2101
|
+
rets.push(new GroupAggregation(agg.column, agg.aggregation, aggregationValue));
|
|
2102
|
+
}
|
|
2103
|
+
return rets;
|
|
2104
|
+
};
|
|
2105
|
+
/**
|
|
2106
|
+
* Data una lista di oggetti effettua dei raggruppamenti in base alla proprietà **field**, restituendo un oggetto del tipo { Gruppo1: oggetti[], Gruppo2: oggetti[], ecc... }
|
|
2107
|
+
*
|
|
2108
|
+
* @param {any[]} array Lista degli oggetti da raggruppare
|
|
2109
|
+
* @param {string} field Campo su cui effettuare i raggruppamenti
|
|
2110
|
+
*
|
|
2111
|
+
* @returns {{ [id: string]: any[] }} Dizionario dei gruppi
|
|
2112
|
+
*
|
|
2113
|
+
* @todo: INTERNALDB
|
|
2114
|
+
*/
|
|
2115
|
+
EsTableComponent.prototype.groupBy = function (array, field) {
|
|
2116
|
+
var ret = {};
|
|
2117
|
+
for (var i = 0; i < array.length; i++) {
|
|
2118
|
+
var x = array[i];
|
|
2119
|
+
(ret[x[field]] = ret[x[field]] || []).push(x);
|
|
2120
|
+
}
|
|
2121
|
+
return ret;
|
|
2122
|
+
};
|
|
2123
|
+
;
|
|
2124
|
+
/**
|
|
2125
|
+
* Effettua il binding degli oggetti pervenuti da questa chiamata con gli oggetti effettivamente da graficare
|
|
2126
|
+
*
|
|
2127
|
+
* @param {any} view View da cui sono arrivati gli oggetti. Può essere o un array se sono in **arrayMode** o una AppSearch<T> se sono in **viewMode**
|
|
2128
|
+
*/
|
|
2129
|
+
EsTableComponent.prototype.bindDisplayToLoadedItemsOrGroups = function (view) {
|
|
2130
|
+
var _a, _b;
|
|
2131
|
+
if (this.TMPBoundSource.length == 0) {
|
|
2132
|
+
this.BaseItemsCount = 0;
|
|
1584
2133
|
return;
|
|
1585
|
-
|
|
2134
|
+
}
|
|
2135
|
+
if (this.arrayMode || !this.UseCustomCells) {
|
|
2136
|
+
this.boundSource = this.TMPBoundSource;
|
|
2137
|
+
this.BaseItemsCount = (view === null || view === void 0 ? void 0 : view.objectcount) || view.length;
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
var groupingKeys = ((_b = (_a = view.groupings) === null || _a === void 0 ? void 0 : _a.filter(function (t) { return !t.aggregation; })) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
2141
|
+
if (groupingKeys == 0) {
|
|
2142
|
+
this.boundSource = this.TMPBoundSource;
|
|
2143
|
+
this.BaseItemsCount = view.objectcount;
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
this.handleNewDataOnRowGrouping(view, groupingKeys);
|
|
1586
2147
|
};
|
|
1587
2148
|
/**
|
|
1588
|
-
*
|
|
2149
|
+
* In modalità rowgrouping quando mi arriva un nuovo blocco di oggetti devo aggiungerlo alla vista attuale:
|
|
1589
2150
|
*
|
|
1590
|
-
*
|
|
1591
|
-
*
|
|
2151
|
+
* 1) Se non viene richiesto il dettaglio di alcun gruppo significa che devo considerare mi siano arrivati tutti i gruppi principali
|
|
2152
|
+
* 2) Se viene richiesto il dettaglio di un gruppo diverso dall'ultimo devo aggiungere dopo al gruppo cliccato la lista dei sottogruppi
|
|
2153
|
+
* 2) Se viene richiesto il dettaglio dell'ultimo gruppo devo aggiungere dopo al gruppo cliccato la lista degli oggetti
|
|
2154
|
+
*
|
|
2155
|
+
* @param {any} view AppSearch<T> da cui sono arrivati gli oggetti
|
|
2156
|
+
* @param {number} groupingKeys Livelli di raggruppamento da aspettarsi sui dati
|
|
2157
|
+
*
|
|
2158
|
+
* @todo: ROWGROUPING
|
|
1592
2159
|
*/
|
|
1593
|
-
EsTableComponent.prototype.
|
|
1594
|
-
var
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
2160
|
+
EsTableComponent.prototype.handleNewDataOnRowGrouping = function (view, groupingKeys) {
|
|
2161
|
+
var e_1, _s, e_2, _t, _u;
|
|
2162
|
+
var _this = this;
|
|
2163
|
+
var _a, _b;
|
|
2164
|
+
// 1) Se non viene richiesto il dettaglio di alcun gruppo significa che la chiamata restituisce la lista paginata dei gruppi principali.
|
|
2165
|
+
// Li tratto come se fosse una qualsiasi altra query paginata su N elementi
|
|
2166
|
+
if ((((_a = view.requestedgroups) === null || _a === void 0 ? void 0 : _a.length) || 0) == 0) {
|
|
2167
|
+
this.boundSource = this.TMPBoundSource;
|
|
2168
|
+
this.rgGroupCache = new Map();
|
|
2169
|
+
this.rgItemCache = new Map();
|
|
2170
|
+
this.rgChildGroupsCache = new Map();
|
|
2171
|
+
this.TMPBoundSource.forEach(function (itm) {
|
|
2172
|
+
itm._thisRoute = itm._group ? [{ column: itm.column, value: itm.value }] : [];
|
|
2173
|
+
itm._thisKey = itm._group ? itm.value : null;
|
|
2174
|
+
itm._grouplevel = 0;
|
|
2175
|
+
_this.rgGroupCache.set(itm._thisKey, itm);
|
|
2176
|
+
});
|
|
2177
|
+
// Resetto la ricerca alla cache di questa "sessione"
|
|
2178
|
+
var firstItem = this.TMPBoundSource[0];
|
|
2179
|
+
this.MainGroupView = Object.assign({}, view);
|
|
2180
|
+
this.groupSearchRequestsCache = [{ path: '', route: [{ column: firstItem.column, value: firstItem.value }], view: this.MainGroupView, group_column: this.TMPBoundSource[0].column }];
|
|
2181
|
+
this.BaseItemsCount = view.objectcount;
|
|
1606
2182
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2183
|
+
else {
|
|
2184
|
+
// 2) Se viene richiesto il dettaglio di un qualsiasi gruppo diverso dall'ultimo vuol dire che devo aggiungere
|
|
2185
|
+
// dopo al gruppo che ho cliccato la lista dei gruppi tirata fuori questa volta (intermediateGroup = true)
|
|
2186
|
+
/*
|
|
2187
|
+
* GruppoA GruppoA
|
|
2188
|
+
* GruppoB GruppoB
|
|
2189
|
+
* GruppoC <- Clicco qui GruppoC
|
|
2190
|
+
* GruppoD GruppoC1
|
|
2191
|
+
* GruppoE GruppoC2
|
|
2192
|
+
* GruppoD
|
|
2193
|
+
* GruppoE
|
|
2194
|
+
*/
|
|
2195
|
+
// 3) se i gruppi richiesti dalla view sono uguali ai gruppi presenti vuol dire che sto prendendo gli oggetti veri e propri, sono in
|
|
2196
|
+
// view.items e quindi in TMPBoundSource, ho inoltre le informazioni di paginazione **per il singolo sottogruppo** (intermediateGroup = false)
|
|
2197
|
+
/*
|
|
2198
|
+
* GruppoA GruppoA
|
|
2199
|
+
* GruppoC1 GruppoC1
|
|
2200
|
+
* GruppoB GruppoB
|
|
2201
|
+
* GruppoC GruppoC
|
|
2202
|
+
* GruppoC1 <-- Clicco qui GruppoC1
|
|
2203
|
+
* Oggetto1
|
|
2204
|
+
* Oggetto2
|
|
2205
|
+
* Oggetto3
|
|
2206
|
+
* GruppoC2 GruppoC2
|
|
2207
|
+
* GruppoD GruppoD
|
|
2208
|
+
* GruppoE GruppoE
|
|
2209
|
+
*/
|
|
2210
|
+
var intermediateGroup_1 = view.requestedgroups.length != groupingKeys;
|
|
2211
|
+
var items = this.boundSource;
|
|
2212
|
+
var insertIndex_1 = 0;
|
|
2213
|
+
var groupKey_1 = "";
|
|
2214
|
+
var groupRoute_1 = [];
|
|
2215
|
+
var _loop_2 = function (i) {
|
|
2216
|
+
var rg = view.requestedgroups[i];
|
|
2217
|
+
groupKey_1 += rg.value;
|
|
2218
|
+
groupRoute_1.push({ column: rg.column, value: rg.value });
|
|
2219
|
+
insertIndex_1 = items.findIndex(function (t, i) { return i >= insertIndex_1 && t._group && t.column == rg.column && t.value == rg.value; });
|
|
2220
|
+
};
|
|
2221
|
+
// Navigo la stuttura dei gruppi ignorando ricorsivamente tutti gli indici fino ai gruppi che mi interessano in modo da non beccare il primo "GruppoC1" del caso sopra
|
|
2222
|
+
for (var i = 0; i < view.requestedgroups.length; i++) {
|
|
2223
|
+
_loop_2(i);
|
|
2224
|
+
}
|
|
2225
|
+
var itemsCacheReference_1;
|
|
2226
|
+
var childGroupsCacheReference_1;
|
|
2227
|
+
// Se non è un gruppo intermedio devo ripulire la cache del gruppo su cui ho attualmente cliccato. Gli oggetti saranno riaggiunti dopo
|
|
2228
|
+
if (!intermediateGroup_1) {
|
|
2229
|
+
this.rgItemCache.set(groupKey_1, []);
|
|
2230
|
+
itemsCacheReference_1 = this.rgItemCache.get(groupKey_1);
|
|
2231
|
+
}
|
|
2232
|
+
else {
|
|
2233
|
+
try {
|
|
2234
|
+
// Se invece è un gruppo intermedio devo ripulire sia tutti i child group ricorsivamente, sia tutti gli item
|
|
2235
|
+
for (var _v = __values(this.rgChildGroupsCache.keys()), _w = _v.next(); !_w.done; _w = _v.next()) {
|
|
2236
|
+
var key = _w.value;
|
|
2237
|
+
if (key.startsWith(groupKey_1))
|
|
2238
|
+
this.rgChildGroupsCache.delete(key);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2242
|
+
finally {
|
|
2243
|
+
try {
|
|
2244
|
+
if (_w && !_w.done && (_s = _v.return)) _s.call(_v);
|
|
2245
|
+
}
|
|
2246
|
+
finally { if (e_1) throw e_1.error; }
|
|
2247
|
+
}
|
|
2248
|
+
try {
|
|
2249
|
+
for (var _x = __values(this.rgItemCache.keys()), _y = _x.next(); !_y.done; _y = _x.next()) {
|
|
2250
|
+
var key = _y.value;
|
|
2251
|
+
if (key.startsWith(groupKey_1))
|
|
2252
|
+
this.rgItemCache.delete(key);
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2256
|
+
finally {
|
|
2257
|
+
try {
|
|
2258
|
+
if (_y && !_y.done && (_t = _x.return)) _t.call(_x);
|
|
2259
|
+
}
|
|
2260
|
+
finally { if (e_2) throw e_2.error; }
|
|
2261
|
+
}
|
|
2262
|
+
this.rgChildGroupsCache.set(groupKey_1, []);
|
|
2263
|
+
childGroupsCacheReference_1 = this.rgChildGroupsCache.get(groupKey_1);
|
|
2264
|
+
}
|
|
2265
|
+
// Assegno un livello ai valori che arrivano da usare per formattare la parte grafica. Il primo gruppo cliccato sarà a livello 1,
|
|
2266
|
+
// il secondo sarà a livello 2 e così via...
|
|
2267
|
+
// Li marco inoltre con il parent in modo da poter eliminare i vecchi qualora servisse
|
|
2268
|
+
this.TMPBoundSource.forEach(function (itm) {
|
|
2269
|
+
itm._parent = groupKey_1;
|
|
2270
|
+
itm._parentRoute = groupRoute_1;
|
|
2271
|
+
itm._thisRoute = itm._group ? __spread(groupRoute_1, [new GroupRouteFragment(itm.column, itm.value)]) : [];
|
|
2272
|
+
itm._thisKey = itm._group ? groupKey_1 + itm.value : groupKey_1;
|
|
2273
|
+
// Per le ricerca intermedie metto i gruppi nella cache dei gruppi
|
|
2274
|
+
if (intermediateGroup_1) {
|
|
2275
|
+
itm._grouplevel = view.requestedgroups.length;
|
|
2276
|
+
_this.rgGroupCache.set(itm._thisKey, itm);
|
|
2277
|
+
childGroupsCacheReference_1.push(itm);
|
|
2278
|
+
}
|
|
2279
|
+
else {
|
|
2280
|
+
// Metto anche gli oggetti nella cache non ricorsiva
|
|
2281
|
+
itemsCacheReference_1.push(itm);
|
|
2282
|
+
}
|
|
2283
|
+
});
|
|
2284
|
+
// Elimino gli oggetti vecchi
|
|
2285
|
+
// 1) Ricerca intermedia, stato salvato - Elimino tutti gli item e tutti i gruppi la cui route è più lunga della corrente, tutti gli item relativi alla path corrente, e tutte
|
|
2286
|
+
// le cache di ricerca effettuate su una path più profonda dell'attuale
|
|
2287
|
+
// 2) Ricerca finale o ricerca intermedia senza stato salvato - Elimino tutti gli item relativi alla path corrente
|
|
2288
|
+
// Per "stato salvato" si intendono ricerche vecchie salvate per poter essere rieffettuate in caso di ordinamenti su colonne di interesse
|
|
2289
|
+
if (intermediateGroup_1 && view.savedstate) {
|
|
2290
|
+
this.boundSource = this.boundSource.filter(function (t) { return !(t._item || t._thisRoute.length > groupRoute_1.length); });
|
|
2291
|
+
this.groupSearchRequestsCache = this.groupSearchRequestsCache.filter(function (t) { return !(t.route.length > groupRoute_1.length); });
|
|
2292
|
+
}
|
|
2293
|
+
this.boundSource = this.boundSource.filter(function (t) { return !(t._parent == groupKey_1); });
|
|
2294
|
+
var thisGroup = this.boundSource[insertIndex_1];
|
|
2295
|
+
if (intermediateGroup_1)
|
|
2296
|
+
thisGroup._groupscount = (_b = this.View) === null || _b === void 0 ? void 0 : _b.groupcount;
|
|
2297
|
+
// Li sostituisco coi nuovi di questa ricerca
|
|
2298
|
+
(_u = this.boundSource).splice.apply(_u, __spread([insertIndex_1 + 1, 0], this.TMPBoundSource));
|
|
2299
|
+
// Aggiungo un separatore alla fine o all'inizio di questi gruppi che dovrà occuparsi di caricare ALTRI gruppi o oggetti (se sono all'ultimo gruppo)
|
|
2300
|
+
var addLast = false;
|
|
2301
|
+
this.boundSource.splice(insertIndex_1 + 1 + (addLast ? this.TMPBoundSource.length : 0), 0, this.getGroupSeparator(view, groupKey_1, groupRoute_1, view.requestedgroups.length, intermediateGroup_1 ? 'groups' : 'items'));
|
|
2302
|
+
// Aggiungo la ricerca alla cache di questa "sessione"
|
|
2303
|
+
var toAdd_1 = { path: groupKey_1, route: groupRoute_1, view: Object.assign({}, view), group_column: intermediateGroup_1 ? this.TMPBoundSource[0].column : '' };
|
|
2304
|
+
var prev = this.groupSearchRequestsCache.findIndex(function (t) { return t.path == toAdd_1.path && t.group_column == toAdd_1.group_column; });
|
|
2305
|
+
if (prev == -1)
|
|
2306
|
+
this.groupSearchRequestsCache.push(toAdd_1);
|
|
2307
|
+
else
|
|
2308
|
+
this.groupSearchRequestsCache.splice(prev, 1, toAdd_1);
|
|
1618
2309
|
}
|
|
1619
2310
|
};
|
|
2311
|
+
/**
|
|
2312
|
+
* Metodo richiamato solo quando **TMPRowTDs** e **TMPRowTHs** sono completamente generati ed aggiustati. Serve per collegarli alle variabili usate lato binding HTML
|
|
2313
|
+
*/
|
|
2314
|
+
EsTableComponent.prototype.MoveTemporaryVariablesToRealOnes = function () {
|
|
2315
|
+
this.RowTDs = this.TMPRowTDs;
|
|
2316
|
+
this.RowTHs = this.TMPRowTHs;
|
|
2317
|
+
this.RowThGroups = this.TMPRowThGroups ? this.TMPRowThGroups.reverse() : null;
|
|
2318
|
+
this.Columns.Visibile = this.RowTHs.filter(function (t) { return t.Visible; }).length;
|
|
2319
|
+
this.Columns.VisibleUnpinned = this.RowTHs.filter(function (t) { return t.Visible && !t.Pinned; }).length;
|
|
2320
|
+
this.Columns.Global = this.Columns.VisibleUnpinned + (this.HasPinnedColumns ? 1 : 0) + (this.Selection ? 1 : 0) + (this.Removal ? 1 : 0) + (this.Export || this.HiddenColumns || this.ColumnsOrdering || this.CornerMenuOptions ? 1 : 0);
|
|
2321
|
+
};
|
|
1620
2322
|
/**
|
|
1621
2323
|
* Permette di selezionare o deselezionare in maniera arbitraria degli oggetti
|
|
1622
2324
|
*
|
|
1623
2325
|
* @param {any[]} items Oggetti da selezionare o deselezionare
|
|
1624
2326
|
* @param {boolean} select **true** per selezionarli, **false** per non toccarli
|
|
2327
|
+
*
|
|
2328
|
+
* @todo: SELECTION
|
|
1625
2329
|
*/
|
|
1626
2330
|
EsTableComponent.prototype.setSelectionStatus = function (items, select) {
|
|
1627
2331
|
this.handleItemsSelection(items, select);
|
|
@@ -1655,32 +2359,118 @@
|
|
|
1655
2359
|
* @param {EsTh[] | EsThDirective[]} ths Colonne della tabella
|
|
1656
2360
|
*/
|
|
1657
2361
|
EsTableComponent.prototype.reviewColumnsList = function (ths) {
|
|
1658
|
-
|
|
2362
|
+
var _this = this;
|
|
2363
|
+
this.TMPColumnsList = [];
|
|
1659
2364
|
if (ths.length == 0)
|
|
1660
2365
|
return;
|
|
1661
|
-
|
|
1662
|
-
for (var i = 0; i < ths.length; i++) {
|
|
2366
|
+
var _loop_3 = function (i) {
|
|
1663
2367
|
var th = ths[i];
|
|
1664
|
-
if (
|
|
2368
|
+
if (this_2.isEsTh(th)) {
|
|
1665
2369
|
// Se non ho un id il th è considerato inerte
|
|
1666
2370
|
if (!th.ID)
|
|
1667
|
-
continue;
|
|
1668
|
-
th.OrderBy =
|
|
2371
|
+
return "continue";
|
|
2372
|
+
th.OrderBy = this_2.OrderByColumn;
|
|
1669
2373
|
// Salvo le informazioni dell'header per far parte della lista da cui scegliere quali colonne visualizzare/nascondere
|
|
1670
2374
|
// Di default la visibilità è quella impostata nel componente
|
|
1671
|
-
if (
|
|
1672
|
-
|
|
2375
|
+
if (this_2.HiddenColumns || th.Visible)
|
|
2376
|
+
this_2.TMPColumnsList.push(new EsTableColumn(th.ID, th.Description, th.Visible, th.Fixed, null, null, null));
|
|
1673
2377
|
}
|
|
1674
2378
|
else {
|
|
2379
|
+
var column_1 = th.th;
|
|
1675
2380
|
// Se non ho un id il th è considerato inerte
|
|
1676
|
-
if (!
|
|
1677
|
-
continue;
|
|
2381
|
+
if (!column_1)
|
|
2382
|
+
return "continue";
|
|
1678
2383
|
// Salvo le informazioni dell'header per far parte della lista da cui scegliere quali colonne visualizzare/nascondere
|
|
1679
2384
|
// Di default la visibilità è quella impostata nel componente
|
|
1680
|
-
if (
|
|
1681
|
-
|
|
2385
|
+
if (this_2.HiddenColumns || th.thVisible) {
|
|
2386
|
+
var previouslyPinned = !this_2.ColumnsList || this_2.ColumnsList.length == 0 || !this_2.ColumnsList.find(function (t) { return t.id == column_1; }) ? null : this_2.ColumnsList.find(function (t) { return t.id == column_1; }).pinned;
|
|
2387
|
+
this_2.TMPColumnsList.push(new EsTableColumn(column_1, null, th.thVisible, (th.thFixed || th.thGroup), previouslyPinned == null ? th.thPinned : previouslyPinned, th.thPinnedWidth, th.Template));
|
|
2388
|
+
}
|
|
1682
2389
|
}
|
|
2390
|
+
};
|
|
2391
|
+
var this_2 = this;
|
|
2392
|
+
// Appena il contentChildren è valorizzato scorro tutti gli header
|
|
2393
|
+
for (var i = 0; i < ths.length; i++) {
|
|
2394
|
+
_loop_3(i);
|
|
1683
2395
|
}
|
|
2396
|
+
this.ColumnsList = [];
|
|
2397
|
+
this.TMPColumnsList.forEach(function (c) { _this.ColumnsList.push(Object.assign({}, c)); });
|
|
2398
|
+
};
|
|
2399
|
+
/**
|
|
2400
|
+
* Prende i th e i td in modalità diretive e li ordina in base a se ci sono colonne fixed o meno
|
|
2401
|
+
*/
|
|
2402
|
+
EsTableComponent.prototype.moveFixedColumnsAtTheBeginning = function (ths, tds) {
|
|
2403
|
+
var thsCache = {};
|
|
2404
|
+
var fixeds = 0, pinneds = 0;
|
|
2405
|
+
var columnsCache = {};
|
|
2406
|
+
var columnsIndexCache = {};
|
|
2407
|
+
// Creo la cache delle colonne
|
|
2408
|
+
for (var coli = 0; coli < this.ColumnsList.length; coli++) {
|
|
2409
|
+
var col = this.ColumnsList[coli];
|
|
2410
|
+
columnsCache[col.id] = col;
|
|
2411
|
+
}
|
|
2412
|
+
// Sposto tutti gli header fixed o pinned all'inizio
|
|
2413
|
+
for (var i = 0; i < ths.length; i++) {
|
|
2414
|
+
var th = ths[i];
|
|
2415
|
+
if (this.isEsTh(th)) {
|
|
2416
|
+
thsCache[th.ID] = th;
|
|
2417
|
+
if (th.Fixed) {
|
|
2418
|
+
if (i != pinneds + fixeds)
|
|
2419
|
+
this.arrayMove(ths, i, pinneds + fixeds);
|
|
2420
|
+
fixeds++;
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
else {
|
|
2424
|
+
thsCache[th.th] = th;
|
|
2425
|
+
// Riassegno sempre per ripulire valori di partenza o per aggiornarli in caso di modifiche utente
|
|
2426
|
+
th.thPinned = (!columnsCache[th.th] && th.thPinned) || (columnsCache[th.th] && columnsCache[th.th].pinned);
|
|
2427
|
+
if (th.thPinned) {
|
|
2428
|
+
if (i != pinneds)
|
|
2429
|
+
this.arrayMove(ths, i, pinneds);
|
|
2430
|
+
pinneds++;
|
|
2431
|
+
}
|
|
2432
|
+
//In questo caso sono informazioni statiche invece, non modificabili dall'utente, quindi non mi dò preoccupazioni
|
|
2433
|
+
if (th.thFixed || th.thGroup) {
|
|
2434
|
+
if (i != pinneds + fixeds)
|
|
2435
|
+
this.arrayMove(ths, i, pinneds + fixeds);
|
|
2436
|
+
fixeds++;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
if (this.isEsTh(ths[0]) || this.isEsTd(tds[0]))
|
|
2441
|
+
return;
|
|
2442
|
+
// Cache degli indici per riposizionare i td come i th
|
|
2443
|
+
for (var i = 0; i < ths.length; i++)
|
|
2444
|
+
columnsIndexCache[ths[i].th] = i;
|
|
2445
|
+
// Riordino le celle per fargli mantenere la stessa struttura dei th
|
|
2446
|
+
var newTds = new Array(ths.length);
|
|
2447
|
+
for (var i = 0; i < tds.length; i++) {
|
|
2448
|
+
var item = tds[i];
|
|
2449
|
+
newTds[columnsIndexCache[item.td]] = item;
|
|
2450
|
+
}
|
|
2451
|
+
this.HasPinnedColumns = pinneds > 0;
|
|
2452
|
+
};
|
|
2453
|
+
/**
|
|
2454
|
+
* In base alla configurazione delle colonne calcola le dimenioni delle colonne pinnate
|
|
2455
|
+
*/
|
|
2456
|
+
EsTableComponent.prototype.evaluatePinnedColumnsWidth = function () {
|
|
2457
|
+
if (!this.HasPinnedColumns)
|
|
2458
|
+
return;
|
|
2459
|
+
this.PinnedContainerWidth = 0;
|
|
2460
|
+
for (var i = 0; i < this.ColumnsList.length; i++) {
|
|
2461
|
+
var col = this.ColumnsList[i];
|
|
2462
|
+
if (col.pinned && col.visible)
|
|
2463
|
+
this.PinnedContainerWidth += col.pinnedWidth;
|
|
2464
|
+
}
|
|
2465
|
+
this.PinnedContainerWidth += this.Selection ? 25 : 0;
|
|
2466
|
+
};
|
|
2467
|
+
/**
|
|
2468
|
+
* Helper per spostare un oggetto di un array da un indice all'altro, in place
|
|
2469
|
+
*/
|
|
2470
|
+
EsTableComponent.prototype.arrayMove = function (array, oldI, newI) {
|
|
2471
|
+
if (newI > array.length - 1 || oldI > array.length - 1 || newI < 0 || oldI < 0)
|
|
2472
|
+
throw "Gli indici passati non fanno riferimento a una posizione dell'array. Length: " + array.length + " Old:" + oldI + " New: " + newI;
|
|
2473
|
+
array.splice(newI, 0, array.splice(oldI, 1)[0]);
|
|
1684
2474
|
};
|
|
1685
2475
|
/**
|
|
1686
2476
|
* Terminato il binding delle colonne da **reviewColumnsList** e della **View** dal **writeValue** questo metodo si occupa
|
|
@@ -1690,14 +2480,19 @@
|
|
|
1690
2480
|
*/
|
|
1691
2481
|
EsTableComponent.prototype.alignColumnsIfLoadedView = function (view) {
|
|
1692
2482
|
var _this = this;
|
|
1693
|
-
var emitChanged = view.savedstate;
|
|
2483
|
+
var emitChanged = this.viewMode && view.savedstate;
|
|
1694
2484
|
var newColset = [];
|
|
1695
2485
|
if (!this.ColumnsList || this.ColumnsList.length == 0)
|
|
1696
2486
|
return;
|
|
2487
|
+
var columns = this.viewMode ? view.columns : this.arrayColumns;
|
|
1697
2488
|
this.ColumnsList.forEach(function (c) {
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
2489
|
+
// Se la colonna è pinnata mi arriva col simoleon
|
|
2490
|
+
var exCl = columns.filter(function (cc) { return cc.replace('§', '') == c.id; });
|
|
2491
|
+
// Se la colonna è pinnata aggiorno l'informazione nella view
|
|
2492
|
+
if (exCl.length == 1)
|
|
2493
|
+
c.pinned = exCl[0].startsWith('§');
|
|
2494
|
+
// Se l'appsearch viene da uno stato precedente, uso le informazioni sulle colonne che ha dentro, altrimenti sovrascrivo tutto **
|
|
2495
|
+
if (c.visible && columns.length == 0)
|
|
1701
2496
|
newColset.push(c.id);
|
|
1702
2497
|
// Se ho una colonna lato AppSearch e nella ColumnList non è visibile, allineo all'AppSearch
|
|
1703
2498
|
else if (exCl.length == 1 && !c.visible)
|
|
@@ -1707,11 +2502,15 @@
|
|
|
1707
2502
|
c.visible = false;
|
|
1708
2503
|
});
|
|
1709
2504
|
// Non ho colonne nella appsearch, vuol dire che sono al primo binding
|
|
1710
|
-
if (
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
2505
|
+
if (columns.length == 0) {
|
|
2506
|
+
if (this.viewMode)
|
|
2507
|
+
view.columns = newColset;
|
|
2508
|
+
else
|
|
2509
|
+
this.arrayColumns = newColset;
|
|
2510
|
+
}
|
|
2511
|
+
if ((this.viewMode && view.savedstate) && this.ColumnsOrdering && view.column_ordering.length > 0) {
|
|
1714
2512
|
// Scorro gli ordinamenti che avevo salvato e ricreo la ColumnsList in base a loro
|
|
2513
|
+
var newColList_1 = [];
|
|
1715
2514
|
view.column_ordering.forEach(function (co) {
|
|
1716
2515
|
_this.ColumnsList.forEach(function (c) {
|
|
1717
2516
|
if (c.id == co)
|
|
@@ -1721,7 +2520,8 @@
|
|
|
1721
2520
|
this.ColumnsList = newColList_1;
|
|
1722
2521
|
}
|
|
1723
2522
|
// In ogni caso questo non mi serve più, lo resetto **
|
|
1724
|
-
|
|
2523
|
+
if (this.viewMode)
|
|
2524
|
+
view.savedstate = false;
|
|
1725
2525
|
if (emitChanged)
|
|
1726
2526
|
this.changed();
|
|
1727
2527
|
};
|
|
@@ -1732,20 +2532,22 @@
|
|
|
1732
2532
|
* @param {'DESC' | 'ASC'} order Nuovo ordine selezionato per la colonna
|
|
1733
2533
|
*/
|
|
1734
2534
|
EsTableComponent.prototype.thOrderChanged = function (id, order) {
|
|
1735
|
-
if (!this.viewMode) {
|
|
1736
|
-
console.warn('Order changed on a table not in viewMode. Operation not supported');
|
|
2535
|
+
if (!this.viewMode && !this.arrayMode) {
|
|
2536
|
+
console.warn('Order changed on a table not in viewMode or Array mode. Operation not supported');
|
|
1737
2537
|
return;
|
|
1738
2538
|
}
|
|
1739
2539
|
if (!this.OrderByColumn)
|
|
1740
2540
|
return;
|
|
1741
|
-
var
|
|
2541
|
+
var orders = this.viewMode ? this.View.orders : this.arrayOrders;
|
|
1742
2542
|
var orderToAdd = true;
|
|
1743
2543
|
var orderToRemove = null;
|
|
1744
2544
|
// Se per qualche motivo il costruttore non è passato (cache tarpate o simila) fixo
|
|
1745
|
-
if (!
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
2545
|
+
if (!orders && this.viewMode)
|
|
2546
|
+
this.View.orders = [];
|
|
2547
|
+
else if (!orders && this.arrayMode)
|
|
2548
|
+
this.arrayOrders = [];
|
|
2549
|
+
for (var i = 0; i < orders.length; i++) {
|
|
2550
|
+
var t = orders[i];
|
|
1749
2551
|
if (t.id == id) {
|
|
1750
2552
|
if (order) {
|
|
1751
2553
|
t.order = order;
|
|
@@ -1756,27 +2558,46 @@
|
|
|
1756
2558
|
}
|
|
1757
2559
|
}
|
|
1758
2560
|
if (orderToRemove != null) {
|
|
1759
|
-
|
|
2561
|
+
orders.splice(orderToRemove, 1);
|
|
1760
2562
|
}
|
|
1761
2563
|
else if (orderToAdd) {
|
|
1762
2564
|
if (this.MultipleOrderingDirectives)
|
|
1763
|
-
|
|
1764
|
-
else
|
|
1765
|
-
|
|
2565
|
+
orders.push(new AppOrdering(id, order));
|
|
2566
|
+
else {
|
|
2567
|
+
if (this.viewMode)
|
|
2568
|
+
this.View.orders = [new AppOrdering(id, order)];
|
|
2569
|
+
else if (this.arrayMode)
|
|
2570
|
+
this.arrayOrders = [new AppOrdering(id, order)];
|
|
2571
|
+
}
|
|
1766
2572
|
}
|
|
1767
2573
|
this.onOrderChanged.emit({ id: id, order: order });
|
|
1768
|
-
this.
|
|
2574
|
+
if (this.viewMode) {
|
|
2575
|
+
if (this.groupSearchRequestsCache.length > 0)
|
|
2576
|
+
this.emitRowGroupingSearches(id, orders);
|
|
2577
|
+
else
|
|
2578
|
+
this.emitSearchRequest(false);
|
|
2579
|
+
}
|
|
2580
|
+
else if (this.arrayMode)
|
|
2581
|
+
this.internalWriteValue();
|
|
1769
2582
|
};
|
|
1770
2583
|
/**
|
|
1771
2584
|
* Metodo da chiamare ogni volta che si vuole dare evidenza all'esterno del bisogno di rieffettuare la ricerca
|
|
2585
|
+
*
|
|
2586
|
+
* @param {boolean} resetsPage Indica al listener che deve resettare il numero di pagina
|
|
2587
|
+
* @param {AppSearch<any>} viewOverride Override della view da emettere per questa ricerca
|
|
1772
2588
|
*/
|
|
1773
|
-
EsTableComponent.prototype.emitSearchRequest = function (
|
|
1774
|
-
if (this.viewMode) {
|
|
2589
|
+
EsTableComponent.prototype.emitSearchRequest = function (resetsPage, viewOverride) {
|
|
2590
|
+
if (this.viewMode && !viewOverride) {
|
|
1775
2591
|
this.View.internalsearchrequest = true;
|
|
1776
2592
|
this.changed();
|
|
1777
2593
|
}
|
|
2594
|
+
if (viewOverride) {
|
|
2595
|
+
if (resetsPage)
|
|
2596
|
+
viewOverride.page = 1;
|
|
2597
|
+
viewOverride.internalsearchrequest = true;
|
|
2598
|
+
}
|
|
1778
2599
|
this.researchInProgress = true;
|
|
1779
|
-
this.onSearchRequest.emit(
|
|
2600
|
+
this.onSearchRequest.emit(viewOverride ? viewOverride : resetsPage);
|
|
1780
2601
|
};
|
|
1781
2602
|
/**
|
|
1782
2603
|
* In base alla visibilità registrata nelle **ColumnsList** questo metodo si occupa di prendere tutti i **EsThs** ed **EsTds** relativi e nasonderli/mostrarli
|
|
@@ -1788,16 +2609,19 @@
|
|
|
1788
2609
|
* @param {AppSearch<any>} view AppSearch da utilizzare per questa operazione
|
|
1789
2610
|
*/
|
|
1790
2611
|
EsTableComponent.prototype.refreshColumnsVisibility = function (ths, tds, view) {
|
|
1791
|
-
var columnsCache = {};
|
|
1792
2612
|
var newColset = [];
|
|
1793
2613
|
var fixedThs = {};
|
|
2614
|
+
var columnsCache = {};
|
|
1794
2615
|
for (var coli = 0; coli < this.ColumnsList.length; coli++) {
|
|
1795
2616
|
var col = this.ColumnsList[coli];
|
|
1796
2617
|
columnsCache[col.id] = col;
|
|
1797
2618
|
if (col.visible)
|
|
1798
|
-
newColset.push(col.id);
|
|
2619
|
+
newColset.push((col.pinned ? "§" : "") + col.id);
|
|
1799
2620
|
}
|
|
1800
|
-
view
|
|
2621
|
+
if (view)
|
|
2622
|
+
view.columns = newColset;
|
|
2623
|
+
else
|
|
2624
|
+
this.arrayColumns = newColset;
|
|
1801
2625
|
// Da qui in poi devono essere eseguiti SOLO in fase di writeValue quindi devo assicurarmi di passarli null in tutti i passaggi diversi da quello
|
|
1802
2626
|
if (ths) {
|
|
1803
2627
|
// Definisco se la colonna è visibile in base alla sua rappresentazione locale in ColumnsList
|
|
@@ -1810,7 +2634,7 @@
|
|
|
1810
2634
|
}
|
|
1811
2635
|
else {
|
|
1812
2636
|
th.thVisible = th.thFixed || (columnsCache[th.th] ? columnsCache[th.th].visible : th.thVisible);
|
|
1813
|
-
if (th.thFixed)
|
|
2637
|
+
if (th.thFixed || th.thGroup)
|
|
1814
2638
|
fixedThs[th.th] = true;
|
|
1815
2639
|
}
|
|
1816
2640
|
}
|
|
@@ -1827,18 +2651,6 @@
|
|
|
1827
2651
|
}
|
|
1828
2652
|
this.changed();
|
|
1829
2653
|
};
|
|
1830
|
-
/**
|
|
1831
|
-
*
|
|
1832
|
-
*/
|
|
1833
|
-
EsTableComponent.prototype.isEsTd = function (td) {
|
|
1834
|
-
return !td._directive;
|
|
1835
|
-
};
|
|
1836
|
-
/**
|
|
1837
|
-
*
|
|
1838
|
-
*/
|
|
1839
|
-
EsTableComponent.prototype.isEsTh = function (th) {
|
|
1840
|
-
return !th._directive;
|
|
1841
|
-
};
|
|
1842
2654
|
/**
|
|
1843
2655
|
* Allinea gli ordinamenti dati fra le **EsThs** e le informazioni all'interno della View bindata
|
|
1844
2656
|
*
|
|
@@ -1846,30 +2658,28 @@
|
|
|
1846
2658
|
* @param {EsTh[] | EsThDirective[]} ths Colonne della tabella
|
|
1847
2659
|
*/
|
|
1848
2660
|
EsTableComponent.prototype.alignHeadersOrdering = function (ths, view) {
|
|
1849
|
-
var
|
|
2661
|
+
var orders = view ? view.orders : this.arrayOrders;
|
|
1850
2662
|
for (var i = 0; i < ths.length; i++) {
|
|
1851
2663
|
var th = ths[i];
|
|
1852
2664
|
if (this.isEsTh(th)) {
|
|
1853
2665
|
th.Order = null;
|
|
1854
2666
|
// Assegno tutti gli ordinamenti che mi vengono da AppSearch. Sono i più importanti. Non faccio cache o cose strano perché tanto questa
|
|
1855
2667
|
// variabile sarà sempre massimo 3 elementi
|
|
1856
|
-
for (var i_1 = 0; i_1 <
|
|
1857
|
-
var or =
|
|
2668
|
+
for (var i_1 = 0; i_1 < orders.length; i_1++) {
|
|
2669
|
+
var or = orders[i_1];
|
|
1858
2670
|
if (or.id == th.ID)
|
|
1859
2671
|
th.Order = or.order;
|
|
1860
2672
|
}
|
|
1861
2673
|
}
|
|
1862
2674
|
else {
|
|
1863
2675
|
th.thOrder = null;
|
|
1864
|
-
for (var i_2 = 0; i_2 <
|
|
1865
|
-
var or =
|
|
2676
|
+
for (var i_2 = 0; i_2 < orders.length; i_2++) {
|
|
2677
|
+
var or = orders[i_2];
|
|
1866
2678
|
if (or.id == th.th)
|
|
1867
2679
|
th.thOrder = or.order;
|
|
1868
2680
|
}
|
|
1869
2681
|
}
|
|
1870
2682
|
}
|
|
1871
|
-
if (researchNeeded)
|
|
1872
|
-
this.emitSearchRequest(false);
|
|
1873
2683
|
};
|
|
1874
2684
|
/**
|
|
1875
2685
|
* Partendo dagli **EsTds** bindati genera, all'interno del dizionario **TMPRowTDs** tutti i contesti dei vari oggetti.
|
|
@@ -1885,6 +2695,11 @@
|
|
|
1885
2695
|
if (tds.length == 0)
|
|
1886
2696
|
return;
|
|
1887
2697
|
var thsCache = {};
|
|
2698
|
+
var columnsCache = {};
|
|
2699
|
+
for (var coli = 0; coli < this.ColumnsList.length; coli++) {
|
|
2700
|
+
var col = this.ColumnsList[coli];
|
|
2701
|
+
columnsCache[col.id] = col;
|
|
2702
|
+
}
|
|
1888
2703
|
for (var i = 0; i < ths.length; i++) {
|
|
1889
2704
|
var th = ths[i];
|
|
1890
2705
|
thsCache[this.isEsTh(th) ? th.ID : th.th] = th;
|
|
@@ -1897,11 +2712,11 @@
|
|
|
1897
2712
|
if (this.isEsTd(td)) {
|
|
1898
2713
|
var th = thsCache[td.ID];
|
|
1899
2714
|
if (!!th)
|
|
1900
|
-
th.
|
|
2715
|
+
th._referenced = true;
|
|
1901
2716
|
else
|
|
1902
2717
|
throw "ID dell'oggeto EsTd non compatibile con gli ID dicharati negli EsTh: " + td.ID;
|
|
1903
|
-
var isFixed = (this.isEsTh(th) && th.Fixed) || (!this.isEsTh(th) && th.thFixed);
|
|
1904
|
-
var itemToAdd = { ID: td.ID, Visible: td.Visible, Class: td.Class, Content: td.Content, RouterLink: td.RouterLink, Template: td.Template };
|
|
2718
|
+
var isFixed = (this.isEsTh(th) && th.Fixed) || (!this.isEsTh(th) && (th.thFixed || th.thGroup));
|
|
2719
|
+
var itemToAdd = { GroupAggregation: false, GroupHeader: false, Wraps: true, ID: td.ID, Visible: td.Visible, Class: td.Class, Content: td.Content, RouterLink: td.RouterLink, Template: td.Template };
|
|
1905
2720
|
var ctx = td.Context;
|
|
1906
2721
|
if (this.TMPRowTDs[ctx]) {
|
|
1907
2722
|
if (isFixed)
|
|
@@ -1916,22 +2731,27 @@
|
|
|
1916
2731
|
}
|
|
1917
2732
|
}
|
|
1918
2733
|
else {
|
|
1919
|
-
for (var i_3 = 0; i_3 < this.
|
|
1920
|
-
var
|
|
2734
|
+
for (var i_3 = 0; i_3 < this.boundSource.length; i_3++) {
|
|
2735
|
+
var item = this.boundSource[i_3];
|
|
2736
|
+
var ctx = item._hash;
|
|
1921
2737
|
var key = td.td;
|
|
1922
2738
|
var th = thsCache[td.td];
|
|
1923
2739
|
if (!!th)
|
|
1924
|
-
th.
|
|
2740
|
+
th._referenced = true;
|
|
1925
2741
|
else
|
|
1926
2742
|
throw "ID dell'oggeto EsTd non compatibile con gli ID dicharati negli EsTh: " + td.td;
|
|
1927
|
-
if (td.tdIf) {
|
|
1928
|
-
var
|
|
1929
|
-
var
|
|
2743
|
+
if (td.tdIf || (!this.isEsTh(th) && th.thGroup)) {
|
|
2744
|
+
var thCasted = th;
|
|
2745
|
+
var isFixed = (this.isEsTh(th) && th.Fixed) || (!this.isEsTh(th) && (th.thFixed || th.thGroup || th.thPinned));
|
|
2746
|
+
var itemToAdd = item._item ?
|
|
2747
|
+
{ LeftBorder: thCasted._lbord, RightBorder: thCasted._rbord, ID: key, Pinned: columnsCache[td.td].pinned, PinnedWidth: thCasted.thPinnedWidth, GroupHeader: false, GroupAggregation: false, Visible: columnsCache[td.td].visible, Wraps: false, Class: td.tdClass, Template: thCasted.thGroup && !this.ShowItemGroupsColumns ? null : td.Template } :
|
|
2748
|
+
{ LeftBorder: thCasted._lbord, RightBorder: thCasted._rbord, ID: key, Pinned: columnsCache[td.td].pinned, PinnedWidth: thCasted.thPinnedWidth, GroupHeader: thCasted.thGroup, GroupAggregation: !!thCasted.thAggregation, Visible: columnsCache[td.td].visible, Wraps: false, Class: thCasted.thGroupClass || '', Content: this.getGroupCellDisplay(item, key, th) };
|
|
1930
2749
|
if (this.TMPRowTDs[ctx]) {
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2750
|
+
// Non serve più grazie al metodo **oveFixedColumnsAtTheBeginning**
|
|
2751
|
+
//if (isFixed)
|
|
2752
|
+
// this.TMPRowTDs[ctx].splice(0 + (contextFixeds[ctx]++), 0, itemToAdd);
|
|
2753
|
+
//else
|
|
2754
|
+
this.TMPRowTDs[ctx].push(itemToAdd);
|
|
1935
2755
|
}
|
|
1936
2756
|
else {
|
|
1937
2757
|
this.RowContexts.push(ctx);
|
|
@@ -1948,7 +2768,7 @@
|
|
|
1948
2768
|
var errs = [];
|
|
1949
2769
|
for (var i = 0; i < ths.length; i++) {
|
|
1950
2770
|
var th = ths[i];
|
|
1951
|
-
if (!th.
|
|
2771
|
+
if (!th._referenced)
|
|
1952
2772
|
errs.push(this.isEsTh(th) ? th.ID : th.th);
|
|
1953
2773
|
}
|
|
1954
2774
|
if (errs.length > 0) {
|
|
@@ -1966,46 +2786,234 @@
|
|
|
1966
2786
|
* @param {EsTh[] | EsThDirective[]} ths Colonne della tabella
|
|
1967
2787
|
*/
|
|
1968
2788
|
EsTableComponent.prototype.evaluateRowThs = function (ths) {
|
|
2789
|
+
var _s;
|
|
1969
2790
|
if (ths.length == 0)
|
|
1970
2791
|
return;
|
|
2792
|
+
var columnsListCache = {};
|
|
2793
|
+
var castedView = this.View;
|
|
2794
|
+
var groupingsUndefined = this.viewMode && (castedView && !castedView.groupings || castedView.groupings.length == 0);
|
|
2795
|
+
for (var i = 0; i < this.ColumnsList.length; i++) {
|
|
2796
|
+
var itm = this.ColumnsList[i];
|
|
2797
|
+
columnsListCache[itm.id] = itm;
|
|
2798
|
+
}
|
|
1971
2799
|
this.TMPRowTHs = [];
|
|
1972
2800
|
var fixed = 0;
|
|
1973
2801
|
for (var i = 0; i < ths.length; i++) {
|
|
1974
2802
|
var th = ths[i];
|
|
1975
2803
|
var toAdd = void 0;
|
|
1976
2804
|
if (this.isEsTh(th)) {
|
|
1977
|
-
toAdd = {
|
|
2805
|
+
toAdd = { Pinned: false, ID: th.ID, Visible: th.Visible, Class: th.Class, Order: th.Order, Orderable: th.Orderable, Template: null, Content: th.Description, Wrap: false };
|
|
1978
2806
|
if (th.Fixed)
|
|
1979
2807
|
this.TMPRowTHs.splice(0 + (fixed++), 0, toAdd);
|
|
1980
2808
|
else
|
|
1981
2809
|
this.TMPRowTHs.push(toAdd);
|
|
1982
2810
|
}
|
|
1983
|
-
else if (th.thIf) {
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
this.
|
|
2811
|
+
else if (th.thIf || th.thGroup) {
|
|
2812
|
+
var thClass = (th.thClass || '') + (th.thGroup ? " est-col-min" : "");
|
|
2813
|
+
toAdd = { Pinned: columnsListCache[th.th].pinned, PinnedWidth: th.thPinnedWidth, ID: th.th, Visible: th.thVisible, Class: thClass, Order: th.thOrder, Orderable: th.thOrderable, Template: th.Template, Content: null, Wrap: false, LeftBorder: th._lbord, RightBorder: th._rbord };
|
|
2814
|
+
this.TMPRowTHs.push(toAdd);
|
|
2815
|
+
// Se ho un modello che deve funzionare a rowgrouping ma non è ancora stata effettuata nessuna ricerca sui gruppi principali (groupingsUndefined)
|
|
2816
|
+
// li genero e mando la prima ricerca che dev'essere spedita al backend per il primo caricamento dei gruppi
|
|
2817
|
+
if (groupingsUndefined && (th.thAggregation || th.thGroup)) {
|
|
2818
|
+
var groupAggregations = this.getGroupAggregations(th);
|
|
2819
|
+
if (!castedView.groupings)
|
|
2820
|
+
castedView.groupings = groupAggregations;
|
|
2821
|
+
else
|
|
2822
|
+
(_s = castedView.groupings).push.apply(_s, __spread(groupAggregations));
|
|
2823
|
+
this.ResearchNeeded = true;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
EsTableComponent.prototype.evaluateHeadersGroupingInfos = function (ths) {
|
|
2829
|
+
// Pregiro per trovare i parent
|
|
2830
|
+
var parentsCache = {};
|
|
2831
|
+
var thsCache = {};
|
|
2832
|
+
for (var i = 0; i < ths.length; i++) {
|
|
2833
|
+
var th = ths[i];
|
|
2834
|
+
if (this.isEsTh(th))
|
|
2835
|
+
continue;
|
|
2836
|
+
thsCache[th.th] = th;
|
|
2837
|
+
if (th.thParent && !parentsCache[th.thParent])
|
|
2838
|
+
parentsCache[th.thParent] = true;
|
|
2839
|
+
}
|
|
2840
|
+
// Secondo giro per beccare il livello massimo e la lista di foglie (th senza parent)
|
|
2841
|
+
var hMaxLevel = 0;
|
|
2842
|
+
var leafs = [];
|
|
2843
|
+
for (var i = 0; i < ths.length; i++) {
|
|
2844
|
+
var th = ths[i];
|
|
2845
|
+
if (this.isEsTh(th)) {
|
|
2846
|
+
leafs.push(th);
|
|
2847
|
+
continue;
|
|
2848
|
+
}
|
|
2849
|
+
// Se sono una foglia vedo quanti livelli ci sono sopra
|
|
2850
|
+
if (!parentsCache[th.th]) {
|
|
2851
|
+
leafs.push(th);
|
|
2852
|
+
var tmp = this.jumpsToFinalParent(th, thsCache);
|
|
2853
|
+
hMaxLevel = tmp > hMaxLevel ? tmp : hMaxLevel;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
return { leafs: leafs, groupingLevel: hMaxLevel, parentsCache: parentsCache, thsCache: thsCache };
|
|
2857
|
+
};
|
|
2858
|
+
/**
|
|
2859
|
+
* Genera gli header groups da una lista di info sui th all'interno della variabile **TMPRowThGroups**
|
|
2860
|
+
*/
|
|
2861
|
+
EsTableComponent.prototype.evaluateHeaderGroups = function (infos) {
|
|
2862
|
+
if (infos.groupingLevel == 0)
|
|
2863
|
+
return;
|
|
2864
|
+
// Giro 2.5, creo l'output dei raggruppamenti per header in modo da non dovermi preoccupare di celle non inizializzate
|
|
2865
|
+
var expandedGroups = [];
|
|
2866
|
+
var visibleUnpinnedLeafs = infos.leafs.filter(function (t) { return t.thVisible && !t.thPinned; });
|
|
2867
|
+
for (var l = 0; l < infos.groupingLevel; l++) {
|
|
2868
|
+
expandedGroups.push([]);
|
|
2869
|
+
for (var i = 0; i < visibleUnpinnedLeafs.length; i++)
|
|
2870
|
+
expandedGroups[l].push("");
|
|
2871
|
+
}
|
|
2872
|
+
// Ordino le foglie in base agli ordinamenti delle colonne
|
|
2873
|
+
var orderedLeafs = [];
|
|
2874
|
+
for (var i = 0; i < this.OrderDirectives.length; i++) {
|
|
2875
|
+
var leaf = infos.thsCache[this.OrderDirectives[i]];
|
|
2876
|
+
if (leaf.thVisible && !leaf.thPinned)
|
|
2877
|
+
orderedLeafs.push(leaf);
|
|
2878
|
+
}
|
|
2879
|
+
// Terzo giro per creare l'array group con tutti i riferimenti del caso
|
|
2880
|
+
var currentParent = "";
|
|
2881
|
+
for (var i = 0; i < orderedLeafs.length; i++) {
|
|
2882
|
+
var refTh = orderedLeafs[i];
|
|
2883
|
+
var prevTh = i - 1 >= 0 ? orderedLeafs[i - 1] : null;
|
|
2884
|
+
// Parent diverso da prima, metto il bordo a sinistra e a destra della cella precedente (se c'è)
|
|
2885
|
+
// All'ultimo giro metto il bordo a destra. Tutto questo lo rieseguo per ogni cella in modo da ripulire eventuali a cui avevo assegnato tag precedentemente
|
|
2886
|
+
refTh._lbord = refTh.thParent != currentParent;
|
|
2887
|
+
refTh._rbord = visibleUnpinnedLeafs.length == i + 1;
|
|
2888
|
+
if (prevTh)
|
|
2889
|
+
prevTh._rbord = refTh.thParent != currentParent;
|
|
2890
|
+
currentParent = refTh.thParent;
|
|
2891
|
+
// Per ogni gruppo srotolo il parent nella matrice dei raggruppamenti
|
|
2892
|
+
for (var l = 0; l < infos.groupingLevel; l++) {
|
|
2893
|
+
var parent = refTh.thParent;
|
|
2894
|
+
if (parent && !refTh.thPinned) {
|
|
2895
|
+
expandedGroups[l][i] = parent;
|
|
2896
|
+
refTh = infos.thsCache[parent];
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
// Quarto giro per compattarlo nell'elemento finale su cui bindarmi
|
|
2901
|
+
currentParent = "";
|
|
2902
|
+
var currentSpan = 0;
|
|
2903
|
+
this.TMPRowThGroups = [];
|
|
2904
|
+
for (var l = 0; l < expandedGroups.length; l++) {
|
|
2905
|
+
var levelArray = [];
|
|
2906
|
+
this.TMPRowThGroups.push(levelArray);
|
|
2907
|
+
if (this.Selection || this.HasPinnedColumns)
|
|
2908
|
+
levelArray.push({ Span: 1, Template: null, Pinned: this.HasPinnedColumns });
|
|
2909
|
+
for (var h = 0; h < expandedGroups[l].length; h++) {
|
|
2910
|
+
var item = expandedGroups[l][h];
|
|
2911
|
+
if (item == currentParent)
|
|
2912
|
+
currentSpan++;
|
|
2913
|
+
else {
|
|
2914
|
+
if (currentSpan > 0)
|
|
2915
|
+
levelArray.push({ Span: currentSpan, Template: (currentParent ? infos.thsCache[currentParent].Template : null), Borders: !!currentParent });
|
|
2916
|
+
currentSpan = 1;
|
|
2917
|
+
currentParent = item;
|
|
2918
|
+
}
|
|
1991
2919
|
}
|
|
2920
|
+
// Ultima aggiunta che altrimenti mi rimarrebbe in cache
|
|
2921
|
+
levelArray.push({ Span: currentSpan, Template: (currentParent ? infos.thsCache[currentParent].Template : null), Borders: !!currentParent });
|
|
2922
|
+
if (this.Removal)
|
|
2923
|
+
levelArray.push({ Span: 1, Template: null });
|
|
2924
|
+
if (this.Export || this.HiddenColumns || this.ColumnsOrdering || this.CornerMenuOptions)
|
|
2925
|
+
levelArray.push({ Span: 1, Template: null });
|
|
2926
|
+
currentSpan = 0;
|
|
2927
|
+
currentParent = "";
|
|
1992
2928
|
}
|
|
1993
2929
|
};
|
|
2930
|
+
/**
|
|
2931
|
+
* Calcola il numero di salti da un header foglia all'ultimo parent della catena
|
|
2932
|
+
*/
|
|
2933
|
+
EsTableComponent.prototype.jumpsToFinalParent = function (th, thsCache) {
|
|
2934
|
+
var jumps = 0;
|
|
2935
|
+
var parent = null;
|
|
2936
|
+
do {
|
|
2937
|
+
parent = th.thParent;
|
|
2938
|
+
if (parent)
|
|
2939
|
+
jumps++;
|
|
2940
|
+
th = thsCache[parent];
|
|
2941
|
+
} while (parent);
|
|
2942
|
+
return jumps;
|
|
2943
|
+
};
|
|
2944
|
+
/**
|
|
2945
|
+
* Data una direttiva EsTh restituisce la lista delle aggregazioni richiesta per questa colonna o il gruppo che rappresenta
|
|
2946
|
+
*
|
|
2947
|
+
* @param {EsThDirective} th Direttiva
|
|
2948
|
+
*
|
|
2949
|
+
* @returns {GroupOrAggregation[]} Lista dei gruppi o aggregazioni relativi alla Direttiva passata
|
|
2950
|
+
*/
|
|
2951
|
+
EsTableComponent.prototype.getGroupAggregations = function (th) {
|
|
2952
|
+
var ret = [];
|
|
2953
|
+
// Es: '{min:dd/MM/yyyy} - {max:dd/MM/yyyy}'
|
|
2954
|
+
if (th.thAggregation) {
|
|
2955
|
+
this.getEsThDirectiveListOfAggregations(th).forEach(function (agg) {
|
|
2956
|
+
var isdate = agg.format && ['small', 'long', 'verylong'].includes(agg.format);
|
|
2957
|
+
var isnumber = agg.format && agg.format.startsWith("F") && !Number.isNaN(agg.format.charAt(1)) && agg.format.length == 2;
|
|
2958
|
+
if (!isdate && !isnumber && agg.format)
|
|
2959
|
+
throw "Le aggergazioni supportate dall'es-table sono solo 'small', 'long', 'verylong' per le date e 'F0-9' per i numeri";
|
|
2960
|
+
ret.push(new GroupOrAggregation(th.th, agg.func, isdate ? 'date' : isnumber ? 'number' : 'string'));
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2963
|
+
else if (th.thGroup)
|
|
2964
|
+
ret.push(new GroupOrAggregation(th.th, null));
|
|
2965
|
+
return ret;
|
|
2966
|
+
};
|
|
2967
|
+
/**
|
|
2968
|
+
* Data una direttiva con un formato restituisce tutte le coppie Funzione di Aggregazione - Formato
|
|
2969
|
+
*
|
|
2970
|
+
* @param {EsThDirective} th Direttiva EsTh di cui calcolare le funzioni di aggregazione usate
|
|
2971
|
+
*
|
|
2972
|
+
* @returns {{ func: string, format: string }[]} Lista delle funzioni di aggregazione rilevate
|
|
2973
|
+
*/
|
|
2974
|
+
EsTableComponent.prototype.getEsThDirectiveListOfAggregations = function (th) {
|
|
2975
|
+
if (!th.thAggregation)
|
|
2976
|
+
return [];
|
|
2977
|
+
// Se ho già effettuato questo calcolo per questo th restituisco la versione in cache
|
|
2978
|
+
if (th._thAggregations)
|
|
2979
|
+
return th._thAggregations;
|
|
2980
|
+
var ret = [];
|
|
2981
|
+
var display = th.thAggregation;
|
|
2982
|
+
var matches = display.match(/{[a-zA-Z0-9\/:]*}/gi);
|
|
2983
|
+
if (!matches)
|
|
2984
|
+
return [];
|
|
2985
|
+
matches.forEach(function (m) {
|
|
2986
|
+
var split = m.split(":");
|
|
2987
|
+
var func = m, format = "";
|
|
2988
|
+
if (split.length > 0) {
|
|
2989
|
+
// Escludo primo e ultimo carattere (le graffe)
|
|
2990
|
+
func = split[0].substr(1);
|
|
2991
|
+
format = split[1].substr(0, split[1].length - 1);
|
|
2992
|
+
}
|
|
2993
|
+
ret.push({ func: func, format: format, match: m });
|
|
2994
|
+
});
|
|
2995
|
+
th._thAggregations = ret;
|
|
2996
|
+
return ret;
|
|
2997
|
+
};
|
|
1994
2998
|
/**
|
|
1995
2999
|
* Metodo che genera l'ordine di default delle colonne
|
|
1996
3000
|
*
|
|
1997
3001
|
* @param {AppSearch<any>} view AppSearch da utilizzare per questa operazione
|
|
1998
3002
|
*/
|
|
1999
|
-
EsTableComponent.prototype.generateDefaultOrder = function (view) {
|
|
2000
|
-
if (
|
|
3003
|
+
EsTableComponent.prototype.generateDefaultOrder = function (ths, view) {
|
|
3004
|
+
if (ths.length == 0)
|
|
2001
3005
|
return;
|
|
3006
|
+
var orderings = this.viewMode ? view.column_ordering : this.arrayColumnOrdering;
|
|
2002
3007
|
// Genero ordinamento di default da 0 fino a dove deve arrivare. Situazione attuale senza hotpotato
|
|
2003
|
-
if (!
|
|
2004
|
-
for (var i = 0; i <
|
|
2005
|
-
|
|
3008
|
+
if (!orderings || orderings.length == 0) {
|
|
3009
|
+
for (var i = 0; i < ths.length; i++) {
|
|
3010
|
+
var th = ths[i];
|
|
3011
|
+
var order = this.isEsTh(th) ? th.ID : th.th;
|
|
3012
|
+
this.OrderDirectives.push(order);
|
|
3013
|
+
}
|
|
2006
3014
|
}
|
|
2007
3015
|
else
|
|
2008
|
-
this.OrderDirectives =
|
|
3016
|
+
this.OrderDirectives = orderings;
|
|
2009
3017
|
};
|
|
2010
3018
|
/**
|
|
2011
3019
|
* Applica l'ordine specificato alle varie colonne
|
|
@@ -2014,37 +3022,220 @@
|
|
|
2014
3022
|
* @param {boolean} finalize Se **true** significa che non mi aspetto di dover effettuare altre operazioni e posso renderizzare la situazione in base ai RowContext
|
|
2015
3023
|
* Senza finalize significa che mi aspetto altre operazioni che prima o poi richiameranno questa funzione col finalize.
|
|
2016
3024
|
*
|
|
2017
|
-
* Ad esempio, una volta selezionato ordinamento fisico/logico delle colonne so che parte un altra ricerca che mi
|
|
2018
|
-
* Mettendo solo la chiamata da "writeValue" come "finalizzante" mi assicuro che smanattamenti a frontend non causino flickering fino a quando non servono
|
|
3025
|
+
* Ad esempio, una volta selezionato ordinamento fisico/logico delle colonne so che parte un altra ricerca che mi rivalorizzerà da "writeValue", che già chiama questa funzione.
|
|
3026
|
+
* Mettendo solo la chiamata da "writeValue" come "finalizzante" mi assicuro che smanattamenti a frontend non causino flickering fino a quando non servono
|
|
3027
|
+
*/
|
|
3028
|
+
EsTableComponent.prototype.applyOrdering = function (view, finalize) {
|
|
3029
|
+
var _this = this;
|
|
3030
|
+
// Genero ordinamento per gli header
|
|
3031
|
+
var newHeaders = [];
|
|
3032
|
+
// Se devo finalizzare aggancio tutte le variabili di bind
|
|
3033
|
+
if (finalize) {
|
|
3034
|
+
this.OrderDirectives.forEach(function (o) {
|
|
3035
|
+
var heaedrItem = _this.TMPRowTHs.filter(function (t) { return t.ID == o; })[0];
|
|
3036
|
+
newHeaders.push(heaedrItem);
|
|
3037
|
+
});
|
|
3038
|
+
this.TMPRowTHs = newHeaders;
|
|
3039
|
+
var _loop_4 = function (i) {
|
|
3040
|
+
var context = this_3.TMPRowTDs[this_3.RowContexts[i]];
|
|
3041
|
+
var newContext = [];
|
|
3042
|
+
this_3.OrderDirectives.forEach(function (o) {
|
|
3043
|
+
var contextItem = context.filter(function (t) { return t.ID == o; })[0];
|
|
3044
|
+
newContext.push(contextItem);
|
|
3045
|
+
});
|
|
3046
|
+
this_3.TMPRowTDs[this_3.RowContexts[i]] = newContext;
|
|
3047
|
+
};
|
|
3048
|
+
var this_3 = this;
|
|
3049
|
+
// Genero ordinamento per le celle
|
|
3050
|
+
for (var i = 0; i < this.RowContexts.length; i++) {
|
|
3051
|
+
_loop_4(i);
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
if (this.viewMode)
|
|
3055
|
+
view.column_ordering = this.OrderDirectives;
|
|
3056
|
+
else
|
|
3057
|
+
this.arrayColumnOrdering = this.OrderDirectives;
|
|
3058
|
+
this.changed();
|
|
3059
|
+
};
|
|
3060
|
+
// #endregion
|
|
3061
|
+
// #region Gestione raggruppamenti per riga
|
|
3062
|
+
/**
|
|
3063
|
+
* Ottiene un elemento di separazione fra Gruppi che serve per paginare le ricerche all'interno di ogni singolo gruppo
|
|
3064
|
+
*
|
|
3065
|
+
* @param {AppSearch<any>} view View utilizzata per la ricerca. Me ne salvo i parametri nel separatore attuale dato che ne ho bisogno per caricare altri elementi
|
|
3066
|
+
* facenti riferimento allo stesso contesto
|
|
3067
|
+
* @param {string} parent Parent path che rappresenta a quale gruppo è affibbiato questo separatore
|
|
3068
|
+
* @param {GroupRouteFragment[]} route Route path che rappresenta a quale gruppo è affibbiato questo separatore
|
|
3069
|
+
* @param {number} level Livello del gruppo di cui questo elemento è separatore, viene usato per applicare la classe "est-lvl-{{level}}"
|
|
3070
|
+
*
|
|
3071
|
+
* @returns {any} Elemento di separazione contenente tutti i bind per presentare una paginazione sotto questo gruppo lato interfaccia
|
|
3072
|
+
*/
|
|
3073
|
+
EsTableComponent.prototype.getGroupSeparator = function (view, parent, route, level, searches) {
|
|
3074
|
+
var item = new GroupPager(level, route, parent, Object.assign({}, view), searches);
|
|
3075
|
+
item.buttons = this.getPagesArray(6, view.page, view.pages);
|
|
3076
|
+
this.calculateHash([item]);
|
|
3077
|
+
return item;
|
|
3078
|
+
};
|
|
3079
|
+
/**
|
|
3080
|
+
* Sposta la ricerca di una pagina in avanti (o indietro)
|
|
3081
|
+
*
|
|
3082
|
+
* @param {number} page Numero di pagine da aggiungere (o sottrarre, se negativo) alla pagina attuale
|
|
3083
|
+
* @param {any} pager Elemento di separazione su cui è effettuata la ricerca
|
|
3084
|
+
*/
|
|
3085
|
+
EsTableComponent.prototype.addToPageGroup = function (page, pager) {
|
|
3086
|
+
this.goToPageGroup(pager.view.page + page, pager);
|
|
3087
|
+
};
|
|
3088
|
+
/**
|
|
3089
|
+
* Sposta la ricerca alla pagina specificata
|
|
3090
|
+
*
|
|
3091
|
+
* @param {number} page Pagina a cui navigare
|
|
3092
|
+
* @param {any} pager Elemento di separazione su cui è effettuata la ricerca
|
|
3093
|
+
*/
|
|
3094
|
+
EsTableComponent.prototype.goToPageGroup = function (page, pager) {
|
|
3095
|
+
var appSearchElement = pager.view;
|
|
3096
|
+
if (page === 0 || page > appSearchElement.pages)
|
|
3097
|
+
return;
|
|
3098
|
+
appSearchElement.page = page;
|
|
3099
|
+
pager.buttons = this.getPagesArray(6, appSearchElement.page, appSearchElement.pages);
|
|
3100
|
+
this.emitSearchRequest(false, appSearchElement);
|
|
3101
|
+
};
|
|
3102
|
+
/**
|
|
3103
|
+
* Data una colonna effettua la riemissione di tutte le ricerche relative.
|
|
3104
|
+
*
|
|
3105
|
+
* Es. Ho 2 campi di gruppo e ho espanso fino a vedere i valori fino ad un livello qualsiasi.
|
|
3106
|
+
* Clicco l'ordinamento sul secondo gruppo.
|
|
3107
|
+
* Tutte le ricerche relative ai primi gruppi devono essere rieseguite. Quando i risultati arriveranno ci penserà il metodo **bindDisplayToLoadedItemsOrGroups**
|
|
3108
|
+
* a tagliare via gli oggetti non più visualizzati
|
|
3109
|
+
*
|
|
3110
|
+
* @param {string} column Colonna su cui si è effettuata un'operazione di ordinamento
|
|
3111
|
+
* @param {AppOrdering[]} orderings Direttive di ordinamento da applicare alle varie sottoricerche
|
|
3112
|
+
*
|
|
3113
|
+
* @todo: Testare
|
|
3114
|
+
*/
|
|
3115
|
+
EsTableComponent.prototype.emitRowGroupingSearches = function (column, orderings) {
|
|
3116
|
+
var _this = this;
|
|
3117
|
+
// Per tutte le ricerche intermedie che devo rivalutare le re-emitto in modo da aggiornargli i dati
|
|
3118
|
+
var meaningfulAppSearches = this.groupSearchRequestsCache.filter(function (t) { return t.group_column == column; }).map(function (t) { return t.view; });
|
|
3119
|
+
// Se non ne trovo significa che ho fatto l'ordinamento o sugli item, o su colonne relative a un sottogruppo non caricato
|
|
3120
|
+
if (!meaningfulAppSearches || meaningfulAppSearches.length == 0)
|
|
3121
|
+
meaningfulAppSearches = this.groupSearchRequestsCache.filter(function (t) { return !t.group_column; }).map(function (t) { return t.view; });
|
|
3122
|
+
// Se non ne trovo qui significa che sto ordinando su colonne relative a un sottogruppo non caricato
|
|
3123
|
+
if (!meaningfulAppSearches || meaningfulAppSearches.length == 0)
|
|
3124
|
+
return;
|
|
3125
|
+
meaningfulAppSearches.forEach(function (as) {
|
|
3126
|
+
// Ovviamente gli oridnamenti devono essere quelli appena generati
|
|
3127
|
+
as.orders = orderings;
|
|
3128
|
+
as.savedstate = true;
|
|
3129
|
+
_this.emitSearchRequest(false, as);
|
|
3130
|
+
});
|
|
3131
|
+
};
|
|
3132
|
+
/**
|
|
3133
|
+
* Helper che calcola il contenuto di una cella relativa a un gruppo riga, tenendo conto del formato delle eventuali aggregazioni
|
|
3134
|
+
*
|
|
3135
|
+
* @param {Group} grp Gruppo di cui mostrare le celle
|
|
3136
|
+
* @param {string} cell Cella attuale di cui calcolare il testo
|
|
3137
|
+
* @param {EsThDirective} header Header relativo alla cella attuale, utilizzata per identificare le informazioni di aggregazione
|
|
3138
|
+
*
|
|
3139
|
+
* @returns {string} Testo finale calcolato per la **cell** corrente, in base alle aggregazioni di **header**
|
|
3140
|
+
*/
|
|
3141
|
+
EsTableComponent.prototype.getGroupCellDisplay = function (grp, cell, header) {
|
|
3142
|
+
var _this = this;
|
|
3143
|
+
if (grp._sep)
|
|
3144
|
+
return "";
|
|
3145
|
+
var display = header.thAggregation;
|
|
3146
|
+
if (grp.column == cell) {
|
|
3147
|
+
var groupsPart = grp._groupscount ? " - " + grp._groupscount + " " + this.lc.loc("Groups") : "";
|
|
3148
|
+
return grp.value + " (" + grp.count + groupsPart + ")";
|
|
3149
|
+
}
|
|
3150
|
+
else {
|
|
3151
|
+
var agg_1 = grp._aggregationsCache.get(cell);
|
|
3152
|
+
if (!agg_1)
|
|
3153
|
+
return "";
|
|
3154
|
+
this.getEsThDirectiveListOfAggregations(header).forEach(function (itm) {
|
|
3155
|
+
display = display.replace(itm.match, _this.formatAggregationValue(agg_1.get(itm.func), itm.format));
|
|
3156
|
+
});
|
|
3157
|
+
return display;
|
|
3158
|
+
}
|
|
3159
|
+
};
|
|
3160
|
+
/**
|
|
3161
|
+
* Gestisce i click sulla tabella solo per le righe a gruppo.
|
|
3162
|
+
* O rimuove gli elementi attualmente presenti o carica il contenuto del gruppo
|
|
3163
|
+
*
|
|
3164
|
+
* @param {any} group Gruppo bindato su cui si è effettuato il click
|
|
3165
|
+
*
|
|
3166
|
+
* @returns {boolean} **true** se l'operaizone è andata a buon fine, **false** altrimenti
|
|
3167
|
+
*/
|
|
3168
|
+
EsTableComponent.prototype.handleGroupClick = function (group) {
|
|
3169
|
+
var casted = this.View;
|
|
3170
|
+
var anyG = group;
|
|
3171
|
+
anyG._expanded = !anyG._expanded;
|
|
3172
|
+
// Sono in modalità raggruppamento virtuale da array: Espandere significa rendere visibili tutti gli oggetti relativi a questo gruppo, viceversa il contrarre
|
|
3173
|
+
if (this.ArrayGrouping) {
|
|
3174
|
+
var allRelatives = this.boundSource.filter(function (t) { return (t._group && ((anyG._expanded && t._parent == anyG._thisKey) || (!anyG._expanded && t._parent && t._parent.startsWith(anyG._thisKey)))) ||
|
|
3175
|
+
(t._item && ((anyG._expanded && t._thisKey == anyG._thisKey) || (!anyG._expanded && t._thisKey.startsWith(anyG._thisKey)))); });
|
|
3176
|
+
allRelatives.forEach(function (t) {
|
|
3177
|
+
t._visible = anyG._expanded;
|
|
3178
|
+
if (t._group)
|
|
3179
|
+
t._expanded = false;
|
|
3180
|
+
});
|
|
3181
|
+
return;
|
|
3182
|
+
}
|
|
3183
|
+
if (anyG._expanded) {
|
|
3184
|
+
// Resetto ipp
|
|
3185
|
+
casted.itemsperpageoverride = 15;
|
|
3186
|
+
if (!casted.requestedgroups)
|
|
3187
|
+
casted.requestedgroups = [new GroupFilter(group.column, group.value)];
|
|
3188
|
+
else {
|
|
3189
|
+
var level = anyG._grouplevel;
|
|
3190
|
+
// se il gruppo cliccato non ha un livello è il primo gruppo, quindi ordinamento unico
|
|
3191
|
+
// altrimenti devo rimuovere tutti i filtri su livelli superiori al level cliccato e aggiungere il level cliccato
|
|
3192
|
+
if (!level)
|
|
3193
|
+
casted.requestedgroups = [new GroupFilter(group.column, group.value)];
|
|
3194
|
+
else {
|
|
3195
|
+
casted.requestedgroups = [];
|
|
3196
|
+
anyG._parentRoute.forEach(function (step) {
|
|
3197
|
+
casted.requestedgroups.push(new GroupFilter(step.column, step.value));
|
|
3198
|
+
});
|
|
3199
|
+
casted.requestedgroups.push(new GroupFilter(group.column, group.value));
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
this.changed();
|
|
3203
|
+
this.emitSearchRequest(true);
|
|
3204
|
+
}
|
|
3205
|
+
else {
|
|
3206
|
+
var path_1 = (anyG._parent || '') + group.value;
|
|
3207
|
+
// Se ho chiuso un gruppo non mi serve rieffettuare ricerce, mi basta eliminare dagli oggetti bindati tutti gli elementi sottostanti a quel gruppo
|
|
3208
|
+
this.boundSource = this.boundSource.filter(function (t) { return !t._parent || !t._parent.startsWith(path_1); });
|
|
3209
|
+
// devo però anche rimuovere eventuali cache relative
|
|
3210
|
+
this.groupSearchRequestsCache = this.groupSearchRequestsCache.filter(function (t) { return t.path != path_1; });
|
|
3211
|
+
}
|
|
3212
|
+
return true;
|
|
3213
|
+
};
|
|
3214
|
+
/**
|
|
3215
|
+
* Funzione che dato un valore lo formatta in base al tipo
|
|
3216
|
+
*
|
|
3217
|
+
* @param {string} value Valore che generalemnte può essere una data o un numero
|
|
3218
|
+
* @param {string} fromat Formato su cui formattare il valore. Può essere ad esempio "small", "long" "verylong" per le date o F{0-9} per i numeri decimali
|
|
3219
|
+
*
|
|
3220
|
+
* @returns {string} Valore dell'aggregazione formattato come si deve
|
|
2019
3221
|
*/
|
|
2020
|
-
EsTableComponent.prototype.
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
var
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
var _loop_1 = function (i) {
|
|
2032
|
-
var context = this_1.TMPRowTDs[this_1.RowContexts[i]];
|
|
2033
|
-
var newContext = [];
|
|
2034
|
-
this_1.OrderDirectives.forEach(function (o) {
|
|
2035
|
-
var contextItem = context.filter(function (t) { return t.ID == o; })[0];
|
|
2036
|
-
newContext.push(contextItem);
|
|
2037
|
-
});
|
|
2038
|
-
this_1.TMPRowTDs[this_1.RowContexts[i]] = newContext;
|
|
2039
|
-
};
|
|
2040
|
-
var this_1 = this;
|
|
2041
|
-
// Genero ordinamento per le celle
|
|
2042
|
-
for (var i = 0; i < this.RowContexts.length; i++) {
|
|
2043
|
-
_loop_1(i);
|
|
2044
|
-
}
|
|
3222
|
+
EsTableComponent.prototype.formatAggregationValue = function (value, format) {
|
|
3223
|
+
if (!format)
|
|
3224
|
+
return value;
|
|
3225
|
+
var isNumber = !Number.isNaN(value) && (!format || format.startsWith("F"));
|
|
3226
|
+
if (isNumber && format.startsWith("F") && !Number.isNaN(format.substr(1)))
|
|
3227
|
+
return parseFloat(value).toFixed(parseInt(format.substr(1)));
|
|
3228
|
+
var date = null;
|
|
3229
|
+
// Alcune versione di extensions rischiano di crashare con cose non date... è stato risolto dopo quindi questo try - catch in realtà
|
|
3230
|
+
// torna utile solo con versioni vecchie/deprecate della libreria @esfaenza/extensions
|
|
3231
|
+
try {
|
|
3232
|
+
date = this.dateExts.getDateConvertion(value);
|
|
2045
3233
|
}
|
|
2046
|
-
|
|
2047
|
-
|
|
3234
|
+
catch (_a) { }
|
|
3235
|
+
if (date)
|
|
3236
|
+
return this.dateExts.getFormatted(date, format == 'small', format == 'verylong');
|
|
3237
|
+
// Qui ci finisco sia per input che non sono né date né numeri, sia per formati non riconosciuti
|
|
3238
|
+
return value;
|
|
2048
3239
|
};
|
|
2049
3240
|
// #endregion
|
|
2050
3241
|
// #region Gestione Operaizoni dialog ordinamento/visibilità colonne
|
|
@@ -2055,7 +3246,7 @@
|
|
|
2055
3246
|
*/
|
|
2056
3247
|
EsTableComponent.prototype.sendUp = function (columnItem) {
|
|
2057
3248
|
var itemIndex = this.TMPColumnsList.indexOf(columnItem);
|
|
2058
|
-
if (this.TMPColumnsList[itemIndex - 1].fixed)
|
|
3249
|
+
if (this.TMPColumnsList[itemIndex - 1].fixed || this.TMPColumnsList[itemIndex - 1].pinned)
|
|
2059
3250
|
return;
|
|
2060
3251
|
this.utiExts.swap(this.TMPColumnsList, itemIndex, itemIndex - 1);
|
|
2061
3252
|
// Non posso fare JSON.parse(JSON.stringify(this.ColumnsList)) perché contiene riferimenti a TemplateRef
|
|
@@ -2076,6 +3267,25 @@
|
|
|
2076
3267
|
this.TMPColumnsList.forEach(function (c) { tmp.push(Object.assign({}, c)); });
|
|
2077
3268
|
this.TMPColumnsList = tmp;
|
|
2078
3269
|
};
|
|
3270
|
+
/**
|
|
3271
|
+
* All'interno della dialog "Ordinamento e Visibilità Colonne" pinna la colonna specificata
|
|
3272
|
+
*
|
|
3273
|
+
* @param {EsTableColumn} columnItem Colonna da spostare
|
|
3274
|
+
*/
|
|
3275
|
+
EsTableComponent.prototype.pinOrUnpinColumn = function (columnItem) {
|
|
3276
|
+
var itemIndex = this.TMPColumnsList.indexOf(columnItem);
|
|
3277
|
+
// Sposto la colonna alla fine di tutte quelle pinnate. La cosa funziona in entrambi sensi:
|
|
3278
|
+
// 1) Se sto pinnando, devo metterla come ultima pinnata
|
|
3279
|
+
// 2) Se sto spinnando devo metterla come prima non pinnata
|
|
3280
|
+
// Coincidenza vuole che il punto 1 e 2 siano equivalenti
|
|
3281
|
+
for (var i = 0; i < this.TMPColumnsList.length; i++) {
|
|
3282
|
+
if (!this.TMPColumnsList[i].pinned) {
|
|
3283
|
+
this.arrayMove(this.TMPColumnsList, itemIndex, i);
|
|
3284
|
+
break;
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
columnItem.pinned = !columnItem.pinned;
|
|
3288
|
+
};
|
|
2079
3289
|
/**
|
|
2080
3290
|
* All'interno della dialog "Ordinamento e Visibilità Colonne" inverte le impostazioni di visibilità della colonna
|
|
2081
3291
|
*
|
|
@@ -2136,12 +3346,12 @@
|
|
|
2136
3346
|
// Non permetto di non selezionare nulla
|
|
2137
3347
|
if (this.TMPColumnsList.every(function (t) { return !t.visible; }))
|
|
2138
3348
|
return false;
|
|
2139
|
-
var castedView = this.View;
|
|
3349
|
+
var castedView = this.viewMode ? this.View : null;
|
|
2140
3350
|
this.ColumnsList = [];
|
|
2141
3351
|
this.TMPColumnsList.forEach(function (c) { _this.ColumnsList.push(Object.assign({}, c)); });
|
|
2142
3352
|
this.refreshColumnOrdering();
|
|
2143
|
-
this.refreshColumnsVisibility(null, null, castedView);
|
|
2144
3353
|
this.applyOrdering(castedView, false);
|
|
3354
|
+
this.refreshColumnsVisibility(null, null, castedView);
|
|
2145
3355
|
//Salvo le preferences di questa view
|
|
2146
3356
|
//Di default registro ordinamento e visibilità delle colonne nella vista. Solo le cose di UI
|
|
2147
3357
|
if (this.SavePreferences) {
|
|
@@ -2153,11 +3363,17 @@
|
|
|
2153
3363
|
console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato");
|
|
2154
3364
|
return false;
|
|
2155
3365
|
}
|
|
2156
|
-
var
|
|
3366
|
+
var columns = this.arrayMode ? this.arrayColumns : castedView.columns;
|
|
3367
|
+
var columnsOrderings = this.arrayMode ? this.arrayColumnOrdering : castedView.column_ordering;
|
|
3368
|
+
var toStore = { columns: JSON.parse(JSON.stringify(columns)), column_ordering: JSON.parse(JSON.stringify(columnsOrderings)) };
|
|
2157
3369
|
this.prefService.store(this.ngControl.name, toStore);
|
|
2158
3370
|
}
|
|
3371
|
+
// Rieseguo l'ultima ricerca bindata alla tabella
|
|
2159
3372
|
// Mi assicuro di farlo dopo l'espansione del changed o rischio che la ricerca mi ridia colonne che in realtà non esistono
|
|
2160
|
-
|
|
3373
|
+
if (this.viewMode)
|
|
3374
|
+
setTimeout(function () { _this.emitSearchRequest(false); });
|
|
3375
|
+
else if (this.arrayMode)
|
|
3376
|
+
setTimeout(function () { _this.internalWriteValue(); });
|
|
2161
3377
|
// Lo vorrei mettere lato template ma no
|
|
2162
3378
|
this.lastSelectedItemID = null;
|
|
2163
3379
|
return true;
|
|
@@ -2167,7 +3383,10 @@
|
|
|
2167
3383
|
*/
|
|
2168
3384
|
EsTableComponent.prototype.globalColVisCheckChanged = function () {
|
|
2169
3385
|
var _this = this;
|
|
2170
|
-
this.TMPColumnsList.forEach(function (t) {
|
|
3386
|
+
this.TMPColumnsList.forEach(function (t) {
|
|
3387
|
+
if (!t.fixed)
|
|
3388
|
+
t.visible = _this.globalColVisCheck;
|
|
3389
|
+
});
|
|
2171
3390
|
};
|
|
2172
3391
|
// #endregion
|
|
2173
3392
|
// #region Gestione data source gerarchici
|
|
@@ -2215,9 +3434,9 @@
|
|
|
2215
3434
|
var obj = objs[i];
|
|
2216
3435
|
// Se la parentKey non è valorizzata, questo è il livello 0 (1... perché gli 0 son perciolosi)
|
|
2217
3436
|
if (!obj[this.ParentKey] && levelToAssign == 1) {
|
|
2218
|
-
obj.
|
|
2219
|
-
obj.
|
|
2220
|
-
obj.
|
|
3437
|
+
obj._level = 1;
|
|
3438
|
+
obj._visible = true;
|
|
3439
|
+
obj._expanded = this.StartsExpanded;
|
|
2221
3440
|
assigned++;
|
|
2222
3441
|
continue;
|
|
2223
3442
|
}
|
|
@@ -2227,13 +3446,13 @@
|
|
|
2227
3446
|
for (var p = 0; p < objs.length; p++) {
|
|
2228
3447
|
var possibleParent = objs[p];
|
|
2229
3448
|
// Trovato il parent dell'item, assegno all'item il livello giusto
|
|
2230
|
-
if (possibleParent[this.OwnKey] == obj[this.ParentKey] && possibleParent.
|
|
2231
|
-
obj.
|
|
3449
|
+
if (possibleParent[this.OwnKey] == obj[this.ParentKey] && possibleParent._level == levelToAssign - 1) {
|
|
3450
|
+
obj._level = levelToAssign;
|
|
2232
3451
|
// So che questo item ha un parent. Ribadisco che il parent è espanso in base alle impostazione e stessa logica
|
|
2233
3452
|
// per la visibilità del figlio
|
|
2234
|
-
possibleParent.
|
|
3453
|
+
possibleParent._expanded = this.StartsExpanded;
|
|
2235
3454
|
possibleParent.parent = true;
|
|
2236
|
-
obj.
|
|
3455
|
+
obj._visible = this.StartsExpanded;
|
|
2237
3456
|
assigned++;
|
|
2238
3457
|
break;
|
|
2239
3458
|
}
|
|
@@ -2252,12 +3471,12 @@
|
|
|
2252
3471
|
var obj = this.boundSource[i];
|
|
2253
3472
|
// Trovo il parent con quell'id e lo espando
|
|
2254
3473
|
if (obj[this.OwnKey] == key) {
|
|
2255
|
-
obj.
|
|
3474
|
+
obj._expanded = true;
|
|
2256
3475
|
for (var ic = 0; ic < this.boundSource.length; ic++) {
|
|
2257
3476
|
var child = this.boundSource[ic];
|
|
2258
3477
|
// Trovo tutti i child di quel parent e li rendo visibili
|
|
2259
3478
|
if (child[this.ParentKey] == key)
|
|
2260
|
-
child.
|
|
3479
|
+
child._visible = true;
|
|
2261
3480
|
}
|
|
2262
3481
|
return;
|
|
2263
3482
|
}
|
|
@@ -2273,7 +3492,7 @@
|
|
|
2273
3492
|
var obj = this.boundSource[i];
|
|
2274
3493
|
// Trovo il parent con quell'id e lo collasso
|
|
2275
3494
|
if (obj[this.OwnKey] == key) {
|
|
2276
|
-
obj.
|
|
3495
|
+
obj._expanded = false;
|
|
2277
3496
|
// Collasso/nascondo tutti i child del parent
|
|
2278
3497
|
this.collapseChildOfParent(key);
|
|
2279
3498
|
return;
|
|
@@ -2291,16 +3510,115 @@
|
|
|
2291
3510
|
// Trovo tutti i child di quel parent e li rendo invisibili. Se il child trovato è a sua volta un parent,
|
|
2292
3511
|
// lo collasso e vado in ricorsione sui figli
|
|
2293
3512
|
if (child[this.ParentKey] == parentKey && !child.parent)
|
|
2294
|
-
child.
|
|
3513
|
+
child._visible = false;
|
|
2295
3514
|
else if (child[this.ParentKey] == parentKey && child.parent) {
|
|
2296
|
-
child.
|
|
2297
|
-
child.
|
|
3515
|
+
child._expanded = false;
|
|
3516
|
+
child._visible = false;
|
|
2298
3517
|
this.collapseChildOfParent(child[this.OwnKey]);
|
|
2299
3518
|
}
|
|
2300
3519
|
}
|
|
2301
3520
|
};
|
|
2302
3521
|
// #endregion
|
|
2303
3522
|
// #region Gestione Selezione
|
|
3523
|
+
/**
|
|
3524
|
+
* Valuta quali elementi devono essere marcati come selezionati nella vista attuale. Si basa sull'oggetto **selection** interno all'AppSearch
|
|
3525
|
+
*
|
|
3526
|
+
* @param {any[]} items Oggetti di cui valutare la selezione
|
|
3527
|
+
* @param {ItemsSelection<any>} selectionItem Oggetti di selezione derivante dalla view o dall'oggetto per Array
|
|
3528
|
+
*/
|
|
3529
|
+
EsTableComponent.prototype.evaluateSelection = function (items, selectionItem) {
|
|
3530
|
+
if (!selectionItem)
|
|
3531
|
+
return;
|
|
3532
|
+
this.handleSelectionEvaluation(items, selectionItem);
|
|
3533
|
+
};
|
|
3534
|
+
/**
|
|
3535
|
+
* Valuta quali elementi devono essere marcati come selezionati nella vista attuale. Si basa sull'oggetto **arraymodeSelection** dell'es-table
|
|
3536
|
+
*
|
|
3537
|
+
* @param {any[]} array Lista di oggetti di cui valutare la selezione in modalità array
|
|
3538
|
+
*/
|
|
3539
|
+
EsTableComponent.prototype.arrayModeEvaluateSelection = function (array) {
|
|
3540
|
+
if (array.length == 0)
|
|
3541
|
+
return;
|
|
3542
|
+
this.handleSelectionEvaluation(array, this.arraymodeSelection);
|
|
3543
|
+
};
|
|
3544
|
+
/**
|
|
3545
|
+
* Implementazione agnostica della valutazione delle selezioni degli oggetti. Richiede gli oggetti della vista attuale e l'itemSelector
|
|
3546
|
+
*
|
|
3547
|
+
* @param {any[]} items Oggetti di cui aggiornare lo stato di selezione
|
|
3548
|
+
* @param {ItemsSelection<any>} selectionItem Oggetto contenente lo stato attuale di selezione
|
|
3549
|
+
*/
|
|
3550
|
+
EsTableComponent.prototype.handleSelectionEvaluation = function (items, selectionItem) {
|
|
3551
|
+
for (var i = 0; i < items.length; i++) {
|
|
3552
|
+
var itm = items[i];
|
|
3553
|
+
var hash = itm._hash;
|
|
3554
|
+
var itemGroup = itm._group ? null : this.getItemGroup(itm);
|
|
3555
|
+
// Reidrato la cache di selezione coi nuovi oggetti altrimenti non riuscirei a beccare gli indici giusti
|
|
3556
|
+
// Dopodiché la uso per calcolare istantaneamente se gli oggetti sono selezionati o no
|
|
3557
|
+
this.rehidrateCache(itm);
|
|
3558
|
+
if (itm._item) {
|
|
3559
|
+
if (selectionItem.all)
|
|
3560
|
+
itm._selected = !this.exclusionsCache.has(hash) && ((!this.groupsCache.has(itemGroup === null || itemGroup === void 0 ? void 0 : itemGroup._hash) && this.itemsCache.has(hash)) || !this.group_exclusionsCache.has(itemGroup === null || itemGroup === void 0 ? void 0 : itemGroup._hash));
|
|
3561
|
+
else
|
|
3562
|
+
itm._selected = !this.exclusionsCache.has(hash) && (this.groupsCache.has(itemGroup === null || itemGroup === void 0 ? void 0 : itemGroup._hash) || this.itemsCache.has(hash) || (this.parentTreeStatus(itemGroup) == 'included' && !this.group_exclusionsCache.has(itemGroup === null || itemGroup === void 0 ? void 0 : itemGroup._hash)));
|
|
3563
|
+
}
|
|
3564
|
+
else if (itm._group) {
|
|
3565
|
+
if (selectionItem.all)
|
|
3566
|
+
itm._selected = !this.group_exclusionsCache.has(hash) && this.parentTreeStatus(itm) != 'excluded';
|
|
3567
|
+
else
|
|
3568
|
+
itm._selected = this.groupsCache.has(hash) || (this.parentTreeStatus(itm) == 'included' && !this.group_exclusionsCache.has(hash));
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
// Se tutti gli oggetti di questa pagina sono solezionati allora posso mettere il global check a true
|
|
3572
|
+
// Se sono in situazione di all-select anche metto la global checkbox, nonostante ci possano essere delle esclusioni
|
|
3573
|
+
this.globalCheck = this.boundSource.filter(function (t) { return t._group || t._item; }).every(function (t) { return t._selected; });
|
|
3574
|
+
this.canSelectAll = selectionItem.count > 0 && this.SelectAll;
|
|
3575
|
+
// Potrebbe cambiare qualora qualcuno inserisse dati a manazza in modalità Array e desse il refresh manuale alla tabella
|
|
3576
|
+
// Comunque costa 0 quindi mi permetto di refreshare
|
|
3577
|
+
if (this.arrayMode) {
|
|
3578
|
+
var prevSelected = this.selectedObjects;
|
|
3579
|
+
this.finalizeSelectionInformations(selectionItem);
|
|
3580
|
+
if (this.selectedObjects != prevSelected)
|
|
3581
|
+
this.onSelectionChanged.emit(selectionItem);
|
|
3582
|
+
}
|
|
3583
|
+
};
|
|
3584
|
+
/**
|
|
3585
|
+
* Dato un oggetto trova la cella di cache in cui è registrato e aggiorna il contenuto
|
|
3586
|
+
*
|
|
3587
|
+
* @param {any} item Oggetto da aggiornare
|
|
3588
|
+
*/
|
|
3589
|
+
EsTableComponent.prototype.rehidrateCache = function (item) {
|
|
3590
|
+
var ctx = item._hash;
|
|
3591
|
+
if (this.itemsCache.has(ctx))
|
|
3592
|
+
this.itemsCache.set(ctx, item);
|
|
3593
|
+
if (this.group_exclusionsCache.has(ctx))
|
|
3594
|
+
this.group_exclusionsCache.set(ctx, item);
|
|
3595
|
+
if (this.groupsCache.has(ctx))
|
|
3596
|
+
this.groupsCache.set(ctx, item);
|
|
3597
|
+
if (this.exclusionsCache.has(ctx))
|
|
3598
|
+
this.exclusionsCache.set(ctx, item);
|
|
3599
|
+
};
|
|
3600
|
+
/**
|
|
3601
|
+
* Dato un gruppo controlla ricorsivamente l'albero di cui fa parte se c'è stata una inclusione o esclusione diretta
|
|
3602
|
+
*
|
|
3603
|
+
* @param {any} grp Gruppo da controllare
|
|
3604
|
+
*
|
|
3605
|
+
* @returns {'none' | 'excluded' | 'included'}
|
|
3606
|
+
* 'none' se non ci sono informazioni su inclusioni o esclusioni
|
|
3607
|
+
* 'included' se il gruppo controllato è stato incluso in maniera esplicita dall'albero dei gruppi padri
|
|
3608
|
+
* 'excluded' se il gruppo controllato è stato escluso in maniera esplicita dall'albero dei gruppi padri
|
|
3609
|
+
*/
|
|
3610
|
+
EsTableComponent.prototype.parentTreeStatus = function (grp) {
|
|
3611
|
+
if (!grp)
|
|
3612
|
+
return 'none';
|
|
3613
|
+
var parentGroup = this.rgGroupCache.get(grp._parent);
|
|
3614
|
+
if (!parentGroup)
|
|
3615
|
+
return 'none';
|
|
3616
|
+
if (this.group_exclusionsCache.has(parentGroup._hash))
|
|
3617
|
+
return 'excluded';
|
|
3618
|
+
if (this.groupsCache.has(parentGroup._hash))
|
|
3619
|
+
return 'included';
|
|
3620
|
+
return this.parentTreeStatus(parentGroup);
|
|
3621
|
+
};
|
|
2304
3622
|
/**
|
|
2305
3623
|
* Gestisce la selezione globale degli oggetti, sia per pagina che a livello di **SelectAll**
|
|
2306
3624
|
*
|
|
@@ -2308,7 +3626,8 @@
|
|
|
2308
3626
|
*/
|
|
2309
3627
|
EsTableComponent.prototype.globalCheckChanged = function (forcedVal) {
|
|
2310
3628
|
if (forcedVal === void 0) { forcedVal = null; }
|
|
2311
|
-
|
|
3629
|
+
// Prendo tutti gli elementi presenti in questa vista. Se ho gruppi prendo solo i gruppi a livello 0, altrimenti prendo tutti gli oggetti per selezionarli
|
|
3630
|
+
var items = this.boundSource.find(function (t) { return t._group; }) ? this.boundSource.filter(function (t) { return t._group && !t._parent; }) : this.boundSource;
|
|
2312
3631
|
var itemSelection = this.handleItemsSelection(items, forcedVal, this.globalCheck);
|
|
2313
3632
|
this.changed();
|
|
2314
3633
|
this.onSelectionChanged.emit(itemSelection);
|
|
@@ -2327,14 +3646,14 @@
|
|
|
2327
3646
|
EsTableComponent.prototype.handleItemsSelection = function (items, forcedVal, globalCheck) {
|
|
2328
3647
|
if (forcedVal === void 0) { forcedVal = null; }
|
|
2329
3648
|
if (globalCheck === void 0) { globalCheck = null; }
|
|
2330
|
-
var _a, _b;
|
|
2331
|
-
var
|
|
3649
|
+
var _a, _b, _c;
|
|
3650
|
+
var si = ((_a = this.View) === null || _a === void 0 ? void 0 : _a.selection) || this.arraymodeSelection;
|
|
2332
3651
|
// Se sono in modalità di selezione singola e devo selezionare un'oggetto, per prima cosa devo deselezionare tutti gli altri
|
|
2333
|
-
if (this.SingleSelection && ((_b = items[0]) === null || _b === void 0 ? void 0 : _b._selected)) {
|
|
3652
|
+
if (this.SingleSelection && ((_b = items[0]) === null || _b === void 0 ? void 0 : _b._selected) && !((_c = items[0]) === null || _c === void 0 ? void 0 : _c._group)) {
|
|
2334
3653
|
if (items.length > 1 && forcedVal == null)
|
|
2335
3654
|
throw "Tentativo di selezionare o deselezionare più di un elemento con SingleSelection attivo";
|
|
2336
3655
|
if (items.length == 1 && forcedVal == null) {
|
|
2337
|
-
|
|
3656
|
+
si = this.handleItemsSelection(this.boundSource.filter(function (t) { return !t._group; }), false, null);
|
|
2338
3657
|
items[0]._selected = true;
|
|
2339
3658
|
}
|
|
2340
3659
|
}
|
|
@@ -2344,59 +3663,385 @@
|
|
|
2344
3663
|
// Se dev'essere overridato il valore di check effettuo l'override o col valore forzato o col valore globale
|
|
2345
3664
|
if (toChange && !item.locked)
|
|
2346
3665
|
item._selected = forcedVal != null ? forcedVal : this.globalCheck;
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
3666
|
+
// Se il valore non dev'essere variato e vengo da una selezione globale semplicemente evito di effettuare operaizoni inutili. L'item/gruppo è già nello stato giusto
|
|
3667
|
+
if (!toChange && globalCheck != null)
|
|
3668
|
+
continue;
|
|
3669
|
+
var allSelection = si.all;
|
|
3670
|
+
var isGroup = item._group;
|
|
3671
|
+
var isSelection = item._selected;
|
|
3672
|
+
var itemGroup = null, allItems = null, selectedItems = null, unselectedItems = null, allGroups = null, selectedGroups = null, unselectedGroups = null, parentGroupSelected = null, parentGroupUnselected = null;
|
|
3673
|
+
if (isGroup) {
|
|
3674
|
+
var pts = this.parentTreeStatus(item);
|
|
3675
|
+
parentGroupSelected = pts == 'included';
|
|
3676
|
+
parentGroupUnselected = pts == 'excluded';
|
|
3677
|
+
allItems = this.getGroupItems(si, item, null, true);
|
|
3678
|
+
selectedItems = this.getGroupItems(si, item, 'selected', true, allItems);
|
|
3679
|
+
unselectedItems = this.getGroupItems(si, item, 'unselected', true, allItems);
|
|
3680
|
+
allGroups = this.getGroupChildGroups(si, item, null, true);
|
|
3681
|
+
selectedGroups = this.getGroupChildGroups(si, item, 'selected', true, allGroups);
|
|
3682
|
+
unselectedGroups = this.getGroupChildGroups(si, item, 'unselected', true, allGroups);
|
|
2360
3683
|
}
|
|
2361
3684
|
else {
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
// Oggetto selezionato: lo aggiungo alla selezione attuale
|
|
2366
|
-
this.selOrDeselCache[item.hash] = item;
|
|
2367
|
-
selectionItem.items.push(item);
|
|
2368
|
-
}
|
|
2369
|
-
else if (!item._selected && this.selOrDeselCache[item.hash]) {
|
|
2370
|
-
// Oggetto deselezionato: lo rimuovo dalla selezione attuale
|
|
2371
|
-
selectionItem.items.splice(selectionItem.items.indexOf(this.selOrDeselCache[item.hash]), 1);
|
|
2372
|
-
delete this.selOrDeselCache[item.hash];
|
|
2373
|
-
}
|
|
3685
|
+
itemGroup = this.getItemGroup(item);
|
|
3686
|
+
parentGroupSelected = itemGroup == null ? null : itemGroup._selected;
|
|
3687
|
+
parentGroupUnselected = itemGroup == null ? null : !itemGroup._selected;
|
|
2374
3688
|
}
|
|
3689
|
+
if (!this.ArrayGrouping)
|
|
3690
|
+
this.performSelectionOperations(si, item, allSelection, isGroup, isSelection, selectedItems, selectedGroups, unselectedItems, unselectedGroups, allItems, allGroups, parentGroupSelected, parentGroupUnselected);
|
|
3691
|
+
else
|
|
3692
|
+
this.performSimpleSelectionOperations(si, item, isGroup, isSelection, itemGroup, selectedItems, unselectedItems, allItems, allGroups);
|
|
2375
3693
|
}
|
|
2376
3694
|
// Imposto il check globale in base a se tutti gli elementi sono selezionati o meno.
|
|
2377
3695
|
// Evito di fare queste operazioni se la selezione deriva proprio dal global Check
|
|
2378
|
-
// Non è ottimizzatissimo mettere 2 some ma scrivere questo codice a for sono tipo 25 righe....
|
|
2379
3696
|
if (globalCheck == null)
|
|
2380
|
-
this.globalCheck = !
|
|
2381
|
-
this.finalizeSelectionInformations(
|
|
2382
|
-
return
|
|
3697
|
+
this.globalCheck = !this.boundSource.some(function (t) { return !t._selected && !t._sep; });
|
|
3698
|
+
this.finalizeSelectionInformations(si);
|
|
3699
|
+
return si;
|
|
3700
|
+
};
|
|
3701
|
+
/**
|
|
3702
|
+
* Dato L'oggetto di selezione, l'oggetto da selezionare/deselezionare e tutti i parametri del caso effettua le operazioni che servono.
|
|
3703
|
+
*
|
|
3704
|
+
* Logica semplificata rispetto all'originale **performSelectionOperations** per lavorare in una modalità in cui tutti gli elementi sono caricati (**ArrayGrouping** = true)
|
|
3705
|
+
*/
|
|
3706
|
+
EsTableComponent.prototype.performSimpleSelectionOperations = function (base, item, group, sel, itm_group, sel_itm, desel_itm, all_itms, all_grps) {
|
|
3707
|
+
var _this = this;
|
|
3708
|
+
var tripticItem = this.getTriptic('item', base);
|
|
3709
|
+
if (group) {
|
|
3710
|
+
if (sel) {
|
|
3711
|
+
all_grps.forEach(function (gr) { gr._selected = true; });
|
|
3712
|
+
if (desel_itm)
|
|
3713
|
+
desel_itm.forEach(function (el) { el._selected = true; _this.addItem(el, tripticItem); });
|
|
3714
|
+
}
|
|
3715
|
+
else {
|
|
3716
|
+
all_grps.forEach(function (gr) { gr._selected = false; });
|
|
3717
|
+
if (sel_itm)
|
|
3718
|
+
sel_itm.forEach(function (el) { el._selected = false; _this.removeItem(el, tripticItem); });
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
else {
|
|
3722
|
+
if (sel) {
|
|
3723
|
+
this.addItem(item, tripticItem);
|
|
3724
|
+
if (itm_group && all_itms && all_itms.every(function (t) { return t._selected; }))
|
|
3725
|
+
this.selectGroup(itm_group);
|
|
3726
|
+
}
|
|
3727
|
+
else {
|
|
3728
|
+
this.removeItem(item, tripticItem);
|
|
3729
|
+
if (itm_group)
|
|
3730
|
+
itm_group._selected = false;
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
};
|
|
3734
|
+
/**
|
|
3735
|
+
* Helper per selezionare un gruppo e, ricorsivamente, se tutti i gruppi sottostanti al parent sono selezionati, selezionare i gruppi padri
|
|
3736
|
+
*
|
|
3737
|
+
* @param {any} group Gruppo da selezionare
|
|
3738
|
+
*/
|
|
3739
|
+
EsTableComponent.prototype.selectGroup = function (group) {
|
|
3740
|
+
group._selected = true;
|
|
3741
|
+
var parent = this.getGroupParent(group);
|
|
3742
|
+
if (parent && this.getGroupChildGroups(null, parent, null, true).every(function (t) { return t._selected; }))
|
|
3743
|
+
this.selectGroup(parent);
|
|
3744
|
+
};
|
|
3745
|
+
/**
|
|
3746
|
+
* Dato L'oggetto di selezione, l'oggetto da selezionare/deselezionare e tutti i parametri del caso effettua le operazioni che servono.
|
|
3747
|
+
*
|
|
3748
|
+
* La logica di questa funzione è nata essenzialmente da spam di trial & error ed è stata testata solo fino a due livelli di raggruppamento,
|
|
3749
|
+
* qualsiasi cosa vada oltre non è 100% detto che funzioni...
|
|
3750
|
+
*/
|
|
3751
|
+
EsTableComponent.prototype.performSelectionOperations = function (base, item, all, group, sel, sel_itm, sel_grp, desel_itm, desel_grp, all_itms, all_grps, parent_incl, parent_excl) {
|
|
3752
|
+
var _this = this;
|
|
3753
|
+
var tripticGroup = this.getTriptic('group', base);
|
|
3754
|
+
var tripticItem = this.getTriptic('item', base);
|
|
3755
|
+
var tripticExcl = this.getTriptic('exclusion', base);
|
|
3756
|
+
var tripticgrpExcl = this.getTriptic('group_exclusion', base);
|
|
3757
|
+
if (group) {
|
|
3758
|
+
if (sel) {
|
|
3759
|
+
if (all || parent_incl)
|
|
3760
|
+
this.removeItem(item, tripticgrpExcl);
|
|
3761
|
+
else
|
|
3762
|
+
this.addItem(item, tripticGroup);
|
|
3763
|
+
if (sel_itm)
|
|
3764
|
+
sel_itm.forEach(function (el) { return _this.removeItem(el, tripticItem); });
|
|
3765
|
+
if (sel_grp)
|
|
3766
|
+
sel_grp.forEach(function (gr) { return _this.removeItem(gr, tripticGroup); });
|
|
3767
|
+
if (all_itms)
|
|
3768
|
+
all_itms.forEach(function (el) { el._selected = true; _this.removeItem(el, tripticExcl); });
|
|
3769
|
+
if (all_grps)
|
|
3770
|
+
all_grps.forEach(function (gr) { gr._selected = true; _this.removeItem(gr, tripticgrpExcl); });
|
|
3771
|
+
}
|
|
3772
|
+
else {
|
|
3773
|
+
if (all || parent_incl)
|
|
3774
|
+
this.addItem(item, tripticgrpExcl);
|
|
3775
|
+
else
|
|
3776
|
+
this.removeItem(item, tripticGroup);
|
|
3777
|
+
if (desel_itm)
|
|
3778
|
+
desel_itm.forEach(function (el) { return _this.removeItem(el, tripticExcl); });
|
|
3779
|
+
if (desel_grp)
|
|
3780
|
+
desel_grp.forEach(function (gr) { return _this.removeItem(gr, tripticExcl); });
|
|
3781
|
+
if (all_itms)
|
|
3782
|
+
all_itms.forEach(function (el) { el._selected = false; _this.removeItem(el, tripticItem); });
|
|
3783
|
+
if (all_grps)
|
|
3784
|
+
all_grps.forEach(function (gr) { gr._selected = false; _this.removeItem(gr, tripticGroup); });
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
else {
|
|
3788
|
+
if (sel) {
|
|
3789
|
+
if ((parent_excl == null && all) || parent_incl)
|
|
3790
|
+
this.removeItem(item, tripticExcl);
|
|
3791
|
+
else
|
|
3792
|
+
this.addItem(item, tripticItem);
|
|
3793
|
+
}
|
|
3794
|
+
else {
|
|
3795
|
+
if (parent_excl || (!all && parent_excl == null))
|
|
3796
|
+
this.removeItem(item, tripticItem);
|
|
3797
|
+
else
|
|
3798
|
+
this.addItem(item, tripticExcl);
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
};
|
|
3802
|
+
/**
|
|
3803
|
+
* Helper per evitare di riscrivere ogni santa volta array.splice(array.indexof(item), 1);
|
|
3804
|
+
*/
|
|
3805
|
+
EsTableComponent.prototype.removeItem = function (item, triptic) {
|
|
3806
|
+
var index = triptic.index_cache.get(item._hash);
|
|
3807
|
+
if (index != null) {
|
|
3808
|
+
triptic.cache.delete(item._hash);
|
|
3809
|
+
triptic.index_cache.delete(item._hash);
|
|
3810
|
+
triptic.array[index] = null;
|
|
3811
|
+
}
|
|
3812
|
+
return !!index;
|
|
3813
|
+
};
|
|
3814
|
+
/**
|
|
3815
|
+
* Helper per evitare di riscrivere ogni santa volta array.push(item); e la gestione della
|
|
3816
|
+
*/
|
|
3817
|
+
EsTableComponent.prototype.addItem = function (item, triptic) {
|
|
3818
|
+
if (triptic.index_cache.get(item._hash) == null) {
|
|
3819
|
+
var i = triptic.array.push(item) - 1;
|
|
3820
|
+
triptic.cache.set(item._hash, item);
|
|
3821
|
+
triptic.index_cache.set(item._hash, i);
|
|
3822
|
+
return true;
|
|
3823
|
+
}
|
|
3824
|
+
return false;
|
|
3825
|
+
};
|
|
3826
|
+
/**
|
|
3827
|
+
* Ottiene il trittico di selezione: L'array degli oggetti e le due cache
|
|
3828
|
+
*/
|
|
3829
|
+
EsTableComponent.prototype.getTriptic = function (subject, base) {
|
|
3830
|
+
switch (subject) {
|
|
3831
|
+
case 'group':
|
|
3832
|
+
return new CacheTriptic(this.groupsCache, this.i_groupsCache, base.groups);
|
|
3833
|
+
case 'item':
|
|
3834
|
+
return new CacheTriptic(this.itemsCache, this.i_itemsCache, base.items);
|
|
3835
|
+
case 'group_exclusion':
|
|
3836
|
+
return new CacheTriptic(this.group_exclusionsCache, this.i_group_exclusionsCache, base.group_exclusions);
|
|
3837
|
+
case 'exclusion':
|
|
3838
|
+
return new CacheTriptic(this.exclusionsCache, this.i_exclusionsCache, base.exclusions);
|
|
3839
|
+
}
|
|
3840
|
+
};
|
|
3841
|
+
/**
|
|
3842
|
+
* Dato un oggetto restituisce il gruppo di cui fa parte, se esiste
|
|
3843
|
+
*
|
|
3844
|
+
* @param {any} item Oggetto di cui trovare il gruppo
|
|
3845
|
+
*/
|
|
3846
|
+
EsTableComponent.prototype.getItemGroup = function (item) {
|
|
3847
|
+
var parent = this.rgGroupCache.get(item._thisKey);
|
|
3848
|
+
if (parent)
|
|
3849
|
+
return parent;
|
|
3850
|
+
return null;
|
|
3851
|
+
};
|
|
3852
|
+
/**
|
|
3853
|
+
* Data la chiave di un gruppo restituisce tutti gli oggetti con quella chiave
|
|
3854
|
+
*
|
|
3855
|
+
* @param {any} group Chiave da cercare
|
|
3856
|
+
* @param {'selected' | 'unselected'} status Stato degli elementi, selezionati o no
|
|
3857
|
+
* @param {boolean} recursive Indica se cercare solo gli elementi direttamente collegati o se prendere anche quelli dei gruppi figli
|
|
3858
|
+
*
|
|
3859
|
+
* @returns {any[]} Oggetti di tipo **_item** facenti capo alla chiave **groupKey**
|
|
3860
|
+
*/
|
|
3861
|
+
EsTableComponent.prototype.getGroupItems = function (sel, group, status, recursive, allbase) {
|
|
3862
|
+
var e_3, _s;
|
|
3863
|
+
if (recursive === void 0) { recursive = false; }
|
|
3864
|
+
if (allbase === void 0) { allbase = null; }
|
|
3865
|
+
var items = [];
|
|
3866
|
+
if (allbase)
|
|
3867
|
+
items = allbase;
|
|
3868
|
+
else {
|
|
3869
|
+
if (recursive) {
|
|
3870
|
+
try {
|
|
3871
|
+
// In modalità ricorsiva prendo gli oggetti di tutte le chiavi simili che trovo
|
|
3872
|
+
for (var _t = __values(this.rgItemCache.keys()), _u = _t.next(); !_u.done; _u = _t.next()) {
|
|
3873
|
+
var key = _u.value;
|
|
3874
|
+
if (key.startsWith(group._thisKey))
|
|
3875
|
+
items.push.apply(items, __spread(this.rgItemCache.get(key)));
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3879
|
+
finally {
|
|
3880
|
+
try {
|
|
3881
|
+
if (_u && !_u.done && (_s = _t.return)) _s.call(_t);
|
|
3882
|
+
}
|
|
3883
|
+
finally { if (e_3) throw e_3.error; }
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3886
|
+
else
|
|
3887
|
+
items = this.rgItemCache.get(group._thisKey);
|
|
3888
|
+
}
|
|
3889
|
+
items = items.filter(function (t) { return !status || (t._selected && status == 'selected') || (!t._selected && status == 'unselected'); });
|
|
3890
|
+
// Non trovo nessun oggetto, però magari di oggetti ne ho all'interno dell'oggetto di selezione.
|
|
3891
|
+
// Questo può essere vero solo se NON sono in modalità array, in caso contrario gli oggetti li devo per forza avere tutti
|
|
3892
|
+
if (items.length != 0 || !sel || this.arrayMode)
|
|
3893
|
+
return items;
|
|
3894
|
+
if (status == 'unselected')
|
|
3895
|
+
items = sel.exclusions.filter(function (t) { return t != null &&
|
|
3896
|
+
(!recursive && t._thisKey == group._thisKey) ||
|
|
3897
|
+
(recursive && t._thisKey.startsWith(group._thisKey)); });
|
|
3898
|
+
else if (status == 'selected')
|
|
3899
|
+
items = sel.items.filter(function (t) { return t != null &&
|
|
3900
|
+
(!recursive && t._thisKey == group._thisKey) ||
|
|
3901
|
+
(recursive && t._thisKey.startsWith(group._thisKey)); });
|
|
3902
|
+
return items;
|
|
3903
|
+
};
|
|
3904
|
+
/**
|
|
3905
|
+
* Data la chiave di un gruppo restituisce tutti gli oggetti con quella chiave
|
|
3906
|
+
*
|
|
3907
|
+
* @param {any} group Gruppo di cui cercare il parent
|
|
3908
|
+
*
|
|
3909
|
+
* @returns {any} Oggetto di tipo **_group** rappresentante il parent del **group** attuale
|
|
3910
|
+
*/
|
|
3911
|
+
EsTableComponent.prototype.getGroupParent = function (group) {
|
|
3912
|
+
var parent = this.rgGroupCache.get(group._parent);
|
|
3913
|
+
if (parent)
|
|
3914
|
+
return parent;
|
|
3915
|
+
return null;
|
|
3916
|
+
};
|
|
3917
|
+
/**
|
|
3918
|
+
* Data la chiave di un gruppo restituisce tutti i gruppi figli
|
|
3919
|
+
*
|
|
3920
|
+
* @param {string} group Gruppo che rappresenta il padre di cui cercare i figli
|
|
3921
|
+
* @param {'selected' | 'unselected'} status Stato dei gruppi, selezionati o no
|
|
3922
|
+
* @param {boolean} recursive Indica se cercare solo i gruppi direttamente collegati o se prendere anche quelli dei gruppi figli
|
|
3923
|
+
*
|
|
3924
|
+
* @returns {any[]} Oggetti di tipo **_group** facenti capo alla chiave **groupKey**
|
|
3925
|
+
*/
|
|
3926
|
+
EsTableComponent.prototype.getGroupChildGroups = function (sel, group, status, recursive, allbase) {
|
|
3927
|
+
var e_4, _s;
|
|
3928
|
+
if (recursive === void 0) { recursive = false; }
|
|
3929
|
+
if (allbase === void 0) { allbase = null; }
|
|
3930
|
+
var thisGroup = this.rgGroupCache.get(group._thisKey);
|
|
3931
|
+
var items = [];
|
|
3932
|
+
if (allbase)
|
|
3933
|
+
items = allbase;
|
|
3934
|
+
else {
|
|
3935
|
+
if (recursive) {
|
|
3936
|
+
try {
|
|
3937
|
+
// In modalità ricorsiva prendo gli oggetti di tutte le chiavi simili che trovo
|
|
3938
|
+
for (var _t = __values(this.rgChildGroupsCache.keys()), _u = _t.next(); !_u.done; _u = _t.next()) {
|
|
3939
|
+
var key = _u.value;
|
|
3940
|
+
if (key.startsWith(group._thisKey))
|
|
3941
|
+
items.push.apply(items, __spread(this.rgChildGroupsCache.get(key)));
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
3945
|
+
finally {
|
|
3946
|
+
try {
|
|
3947
|
+
if (_u && !_u.done && (_s = _t.return)) _s.call(_t);
|
|
3948
|
+
}
|
|
3949
|
+
finally { if (e_4) throw e_4.error; }
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
else
|
|
3953
|
+
items = this.rgChildGroupsCache.get(group._thisKey);
|
|
3954
|
+
}
|
|
3955
|
+
items = items.filter(function (t) { return !status || (t._selected && status == 'selected') || (!t._selected && status == 'unselected'); });
|
|
3956
|
+
// Non trovo nessun oggetto, però magari di oggetti ne ho all'interno dell'oggetto di selezione
|
|
3957
|
+
if (items.length != 0 || !sel)
|
|
3958
|
+
return items;
|
|
3959
|
+
if (status == 'unselected')
|
|
3960
|
+
items = sel.group_exclusions.filter(function (t) { return t != null && ((!recursive && t._thisRoute.length == thisGroup._thisRoute.length + 1 && t._thisRoute.startsWith(group._thisKey)) ||
|
|
3961
|
+
(recursive && t._thisKey.startsWith(group._thisKey))); });
|
|
3962
|
+
else
|
|
3963
|
+
items = sel.groups.filter(function (t) { return t != null && ((!recursive && t._thisRoute.length == thisGroup._thisRoute.length + 1 && t._thisRoute.startsWith(group._thisKey)) ||
|
|
3964
|
+
(recursive && t._thisKey.startsWith(group._thisKey))); });
|
|
3965
|
+
return items;
|
|
2383
3966
|
};
|
|
2384
3967
|
/**
|
|
2385
3968
|
* Finalizza le informazioni di selezione del **ItemsSelection** corrente
|
|
2386
3969
|
*/
|
|
2387
3970
|
EsTableComponent.prototype.finalizeSelectionInformations = function (selectionItem) {
|
|
3971
|
+
// Dato che le delete sono logiche dato che tengo la cache degli indici devo renderle fisiche
|
|
3972
|
+
var tmpGrp = [], tmpItems = [], tmpExcl = [], tmpGrpExcl = [];
|
|
3973
|
+
var grpRemoved = false, itemsRemoved = false, exclRemoved = false, grpExclRemoved = false;
|
|
3974
|
+
for (var i = 0; i < selectionItem.items.length; i++)
|
|
3975
|
+
if (selectionItem.items[i] != null)
|
|
3976
|
+
tmpItems.push(selectionItem.items[i]);
|
|
3977
|
+
else
|
|
3978
|
+
itemsRemoved = true;
|
|
3979
|
+
for (var i = 0; i < selectionItem.groups.length; i++)
|
|
3980
|
+
if (selectionItem.groups[i] != null)
|
|
3981
|
+
tmpGrp.push(selectionItem.groups[i]);
|
|
3982
|
+
else
|
|
3983
|
+
grpRemoved = true;
|
|
3984
|
+
for (var i = 0; i < selectionItem.exclusions.length; i++)
|
|
3985
|
+
if (selectionItem.exclusions[i] != null)
|
|
3986
|
+
tmpExcl.push(selectionItem.exclusions[i]);
|
|
3987
|
+
else
|
|
3988
|
+
exclRemoved = true;
|
|
3989
|
+
for (var i = 0; i < selectionItem.group_exclusions.length; i++)
|
|
3990
|
+
if (selectionItem.group_exclusions[i] != null)
|
|
3991
|
+
tmpGrpExcl.push(selectionItem.group_exclusions[i]);
|
|
3992
|
+
else
|
|
3993
|
+
grpExclRemoved = true;
|
|
3994
|
+
selectionItem.items = tmpItems;
|
|
3995
|
+
selectionItem.group_exclusions = tmpGrpExcl;
|
|
3996
|
+
selectionItem.exclusions = tmpExcl;
|
|
3997
|
+
selectionItem.groups = tmpGrp;
|
|
3998
|
+
// Le cache degli indici potrebbero avere buchi, risolvo
|
|
3999
|
+
if (grpRemoved)
|
|
4000
|
+
this.i_groupsCache = this.compactIndexMap(this.i_groupsCache);
|
|
4001
|
+
if (itemsRemoved)
|
|
4002
|
+
this.i_itemsCache = this.compactIndexMap(this.i_itemsCache);
|
|
4003
|
+
if (exclRemoved)
|
|
4004
|
+
this.i_exclusionsCache = this.compactIndexMap(this.i_exclusionsCache);
|
|
4005
|
+
if (grpExclRemoved)
|
|
4006
|
+
this.i_group_exclusionsCache = this.compactIndexMap(this.i_group_exclusionsCache);
|
|
4007
|
+
// Poi riprendo a fare tutto in normalità
|
|
2388
4008
|
selectionItem.count = this.evaluateSelected();
|
|
2389
4009
|
// Se ho fatto selezione "all" ma poi mi sono messo a togliere tutti gli elementi fino a rimanerne 0 resetto l'oggetto di selezione
|
|
2390
|
-
if (selectionItem.count == 0
|
|
4010
|
+
if (selectionItem.count == 0) {
|
|
4011
|
+
this.boundSource.forEach(function (t) { return t._selected = false; });
|
|
2391
4012
|
selectionItem.all = false;
|
|
2392
4013
|
selectionItem.exclusions = [];
|
|
2393
4014
|
selectionItem.items = [];
|
|
4015
|
+
selectionItem.groups = [];
|
|
4016
|
+
selectionItem.group_exclusions = [];
|
|
2394
4017
|
// Ripulisco la cache altrimenti mi rimane piena di tutte le esclusioni
|
|
2395
|
-
this.
|
|
4018
|
+
this.clearSelectionCaches();
|
|
2396
4019
|
}
|
|
2397
4020
|
// Se la possibilità di fare "Seleziona tutto" è abilitata allora la considero appena mi viene selezionato qualcosa
|
|
2398
4021
|
this.canSelectAll = selectionItem.count > 0 && this.SelectAll;
|
|
2399
4022
|
};
|
|
4023
|
+
/**
|
|
4024
|
+
* Compatta una cache di indici
|
|
4025
|
+
*/
|
|
4026
|
+
EsTableComponent.prototype.compactIndexMap = function (map) {
|
|
4027
|
+
var e_5, _s;
|
|
4028
|
+
var index = 0;
|
|
4029
|
+
var ret = new Map();
|
|
4030
|
+
try {
|
|
4031
|
+
for (var _t = __values(map.keys()), _u = _t.next(); !_u.done; _u = _t.next()) {
|
|
4032
|
+
var key = _u.value;
|
|
4033
|
+
ret.set(key, index++);
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
4037
|
+
finally {
|
|
4038
|
+
try {
|
|
4039
|
+
if (_u && !_u.done && (_s = _t.return)) _s.call(_t);
|
|
4040
|
+
}
|
|
4041
|
+
finally { if (e_5) throw e_5.error; }
|
|
4042
|
+
}
|
|
4043
|
+
return ret;
|
|
4044
|
+
};
|
|
2400
4045
|
/**
|
|
2401
4046
|
* Gestisce i click sulla tabella, gestendo eventualmente anche gli Shift + Click per selezionare un range di oggetti
|
|
2402
4047
|
*
|
|
@@ -2415,7 +4060,7 @@
|
|
|
2415
4060
|
var selecteditems = [];
|
|
2416
4061
|
if (event.shiftKey && this.ShiftClick && !this.SingleSelection) {
|
|
2417
4062
|
var startSelecting = false;
|
|
2418
|
-
var items = this.
|
|
4063
|
+
var items = this.boundSource.filter(function (t) { return !t._group && !t._sep; });
|
|
2419
4064
|
for (var i = 0; i < items.length; i++) {
|
|
2420
4065
|
var t = items[i];
|
|
2421
4066
|
if (startSelecting) {
|
|
@@ -2448,8 +4093,10 @@
|
|
|
2448
4093
|
*/
|
|
2449
4094
|
EsTableComponent.prototype.evaluateSelected = function () {
|
|
2450
4095
|
var _a;
|
|
2451
|
-
var
|
|
2452
|
-
|
|
4096
|
+
var si = ((_a = this.View) === null || _a === void 0 ? void 0 : _a.selection) || this.arraymodeSelection;
|
|
4097
|
+
var excByGroup = si.group_exclusions.reduce(function (prev, curr) { return prev + curr.count; }, 0);
|
|
4098
|
+
var incByGroup = si.groups.reduce(function (prev, curr) { return prev + curr.count; }, 0);
|
|
4099
|
+
this.selectedObjects = (si.all ? this.BaseItemsCount : incByGroup) - excByGroup + si.items.length - si.exclusions.length;
|
|
2453
4100
|
return this.selectedObjects;
|
|
2454
4101
|
};
|
|
2455
4102
|
/**
|
|
@@ -2457,9 +4104,11 @@
|
|
|
2457
4104
|
*/
|
|
2458
4105
|
EsTableComponent.prototype.selectAllOrResetSelection = function () {
|
|
2459
4106
|
var selectionItem = this.View.selection || this.arraymodeSelection;
|
|
2460
|
-
this.
|
|
4107
|
+
this.clearSelectionCaches();
|
|
2461
4108
|
selectionItem.all = !selectionItem.all;
|
|
2462
4109
|
selectionItem.exclusions = [];
|
|
4110
|
+
selectionItem.groups = [];
|
|
4111
|
+
selectionItem.group_exclusions = [];
|
|
2463
4112
|
selectionItem.items = [];
|
|
2464
4113
|
// Ripulisco gli stati UI di selezione globale se l'ho disattivata
|
|
2465
4114
|
if (!selectionItem.all) {
|
|
@@ -2469,7 +4118,7 @@
|
|
|
2469
4118
|
this.finalizeSelectionInformations(selectionItem);
|
|
2470
4119
|
this.onSelectionChanged.emit(selectionItem);
|
|
2471
4120
|
// Dopo aver resettato direttamente il solo oggetto this.View.selection devo anche riallineare a tutti gli oggetti bindati
|
|
2472
|
-
this.evaluateSelection(this.
|
|
4121
|
+
this.evaluateSelection(this.boundSource, selectionItem);
|
|
2473
4122
|
};
|
|
2474
4123
|
// #endregion
|
|
2475
4124
|
// #region Gestione Paginazione
|
|
@@ -2479,9 +4128,9 @@
|
|
|
2479
4128
|
* @param {number} page Numero di pagine da aggiungere (o sottrarre, se negativo) alla pagina attuale
|
|
2480
4129
|
*/
|
|
2481
4130
|
EsTableComponent.prototype.addToPage = function (page) {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
this.goToPage((this.SearchView ||
|
|
4131
|
+
var _a;
|
|
4132
|
+
var view = this.MainGroupView ? this.MainGroupView : this.View;
|
|
4133
|
+
this.goToPage((((_a = (this.SearchView || view)) === null || _a === void 0 ? void 0 : _a.page) || 0) + page);
|
|
2485
4134
|
};
|
|
2486
4135
|
/**
|
|
2487
4136
|
* Sposta la ricerca alla pagina specificata
|
|
@@ -2489,21 +4138,35 @@
|
|
|
2489
4138
|
* @param {number} page Pagina a cui navigare
|
|
2490
4139
|
*/
|
|
2491
4140
|
EsTableComponent.prototype.goToPage = function (page) {
|
|
2492
|
-
|
|
4141
|
+
var view = this.MainGroupView ? this.MainGroupView : this.View;
|
|
4142
|
+
if (!view.page || !view.pages)
|
|
2493
4143
|
return;
|
|
2494
|
-
var appSearchElement = this.SearchView ||
|
|
4144
|
+
var appSearchElement = this.SearchView || view;
|
|
2495
4145
|
if (page === 0 || page > appSearchElement.pages)
|
|
2496
4146
|
return;
|
|
2497
4147
|
appSearchElement.page = page;
|
|
2498
4148
|
this.arrayPulsanti = this.getPagesArray(6, appSearchElement.page, appSearchElement.pages);
|
|
2499
|
-
this.
|
|
4149
|
+
var hasGroupings = !!this.MainGroupView;
|
|
4150
|
+
this.emitSearchRequest(false, hasGroupings ? view : null);
|
|
2500
4151
|
};
|
|
2501
4152
|
/**
|
|
2502
4153
|
* Evento richiamato sul cambio della paginazione. Verrà richiamato l'evento **emitSearchRequest**
|
|
2503
4154
|
* per comunicare al componente che utilizza questa tabella che i dati sono da aggiornare
|
|
2504
4155
|
*/
|
|
2505
|
-
EsTableComponent.prototype.onItemsPerPageChanged = function () {
|
|
2506
|
-
this.
|
|
4156
|
+
EsTableComponent.prototype.onItemsPerPageChanged = function (newIpp) {
|
|
4157
|
+
this.PagerOptions.View.itemsperpageoverride = newIpp;
|
|
4158
|
+
this.changed();
|
|
4159
|
+
if (this.MainGroupView)
|
|
4160
|
+
this.emitSearchRequest(true, this.MainGroupView);
|
|
4161
|
+
else
|
|
4162
|
+
this.emitSearchRequest(true);
|
|
4163
|
+
};
|
|
4164
|
+
/**
|
|
4165
|
+
* Evento richiamato sul cambio della paginazione. Verrà richiamato l'evento **emitSearchRequest** con la vista del separatore
|
|
4166
|
+
*/
|
|
4167
|
+
EsTableComponent.prototype.onGroupItemsPerPageChanged = function (pager, newIpp) {
|
|
4168
|
+
pager.view.itemsperpageoverride = newIpp;
|
|
4169
|
+
this.emitSearchRequest(true, pager.view);
|
|
2507
4170
|
};
|
|
2508
4171
|
// #endregion
|
|
2509
4172
|
// #region Gestione Export
|
|
@@ -2523,6 +4186,10 @@
|
|
|
2523
4186
|
if (cancel === void 0) { cancel = false; }
|
|
2524
4187
|
if (cancel)
|
|
2525
4188
|
return;
|
|
4189
|
+
if (data.length == 0) {
|
|
4190
|
+
_this.msgExts.simpleWarning(_this.lc.loc("Cannot export an empty dataset"));
|
|
4191
|
+
return;
|
|
4192
|
+
}
|
|
2526
4193
|
_this.setupExport(data);
|
|
2527
4194
|
_this.cdr.detectChanges();
|
|
2528
4195
|
setTimeout(function () { _this.exportDownloader.nativeElement.click(); });
|
|
@@ -2650,12 +4317,12 @@
|
|
|
2650
4317
|
* @returns {any} Router link generato in base al parametri
|
|
2651
4318
|
*/
|
|
2652
4319
|
EsTableComponent.prototype.generateRouterLink = function (path, parameterProps, item) {
|
|
2653
|
-
if (this.DynamicTableRouterLinkCache[item.
|
|
2654
|
-
return this.DynamicTableRouterLinkCache[item.
|
|
4320
|
+
if (this.DynamicTableRouterLinkCache[item._hash + path]) {
|
|
4321
|
+
return this.DynamicTableRouterLinkCache[item._hash + path];
|
|
2655
4322
|
}
|
|
2656
4323
|
else {
|
|
2657
4324
|
var link = this.getRouterLink(path, parameterProps, item);
|
|
2658
|
-
this.DynamicTableRouterLinkCache[item.
|
|
4325
|
+
this.DynamicTableRouterLinkCache[item._hash + path] = link;
|
|
2659
4326
|
return link;
|
|
2660
4327
|
}
|
|
2661
4328
|
};
|
|
@@ -2753,6 +4420,14 @@
|
|
|
2753
4420
|
};
|
|
2754
4421
|
// #endregion
|
|
2755
4422
|
// #region Metodi di utilità
|
|
4423
|
+
/** Helper che identifica se il td attuale è di tipo **EsTd**. In caso contrario è da considerarsi **EsTdDirective** */
|
|
4424
|
+
EsTableComponent.prototype.isEsTd = function (td) {
|
|
4425
|
+
return !td._directive;
|
|
4426
|
+
};
|
|
4427
|
+
/** Helper che identifica se il th attuale è di tipo **EsTh**. In caso contrario è da considerarsi **EsThDirective** */
|
|
4428
|
+
EsTableComponent.prototype.isEsTh = function (th) {
|
|
4429
|
+
return !th._directive;
|
|
4430
|
+
};
|
|
2756
4431
|
/** Impostazione modalità dell'EsTable */
|
|
2757
4432
|
EsTableComponent.prototype.setMode = function (mode) {
|
|
2758
4433
|
this.viewMode = mode == 'view';
|
|
@@ -2765,7 +4440,8 @@
|
|
|
2765
4440
|
}
|
|
2766
4441
|
};
|
|
2767
4442
|
/**
|
|
2768
|
-
* Helper per effettuare chiamate interne di allineamento alla funzione **writeValue**,
|
|
4443
|
+
* Helper per effettuare chiamate interne di allineamento alla funzione **writeValue**,
|
|
4444
|
+
* impostando prima **internalWriteCall** in modo da non effettuare operazioni inutili
|
|
2769
4445
|
*/
|
|
2770
4446
|
EsTableComponent.prototype.internalWriteValue = function () {
|
|
2771
4447
|
this.internalWriteCall = true;
|
|
@@ -2829,11 +4505,13 @@
|
|
|
2829
4505
|
for (var i = 0; i < items.length; i++) {
|
|
2830
4506
|
var item = items[i];
|
|
2831
4507
|
// Prima di calcolare l'hash rimuovo le proprietà interne prima che mi scompensino i calcoli successivi
|
|
2832
|
-
|
|
2833
|
-
delete
|
|
2834
|
-
|
|
4508
|
+
var tmp = Object.assign({}, items[i]);
|
|
4509
|
+
delete tmp._selected;
|
|
4510
|
+
delete tmp._visible;
|
|
4511
|
+
delete tmp._hash;
|
|
4512
|
+
var hash = this.hashExts.hashObject(tmp);
|
|
2835
4513
|
usedHashesCache[hash] = usedHashesCache[hash] ? usedHashesCache[hash] + 1 : 1;
|
|
2836
|
-
item.
|
|
4514
|
+
item._hash = hash + (usedHashesCache[hash] > 1 ? "_" + usedHashesCache[hash] : "");
|
|
2837
4515
|
}
|
|
2838
4516
|
};
|
|
2839
4517
|
/**
|
|
@@ -2862,18 +4540,22 @@
|
|
|
2862
4540
|
viewProviders: [{ provide: localizations.LocalizationService, useClass: EsTableLoc }],
|
|
2863
4541
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2864
4542
|
encapsulation: core.ViewEncapsulation.None,
|
|
2865
|
-
template: "<!-- Patacchino di autoaggiornamento -->\r\n<div class=\"w-100\" *ngIf=\"AutoUpdate\">\r\n <div class=\"pull-right\">\r\n {{'Update every' | localize : lc}} <input [readonly]=\"autoUpdate\" maxlength=\"3\" class=\"form-control est-custom-input\" type=\"text\" [(ngModel)]=\"seconds\" /> {{'second/s' | localize : lc}}\r\n </div>\r\n <div class=\"pull-right m-t-2\">\r\n <label class=\"est-switch\">\r\n <input type=\"checkbox\" [(ngModel)]=\"autoUpdate\" (ngModelChange)=\"autoUpdateChanged();\" />\r\n <div class=\"est-slider round\"></div>\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<!--\r\nI TH sono contenuto statico, questo significa che senza condizione per RowTHs arriverebbero sia qui sia nell ng-container dell'header in fase non inizializzata, duplicando fisicamente le colonne.\r\nPer ovviare al problema, questo pezzo lo faccio apparire solo se ci sono gi\u00E0 dei RowTHs, quindi su valorizzazione della View succeder\u00E0:\r\n1) appaiono i th nell' ng-container dell'header, e NON qui\r\n2) i TH vengono presi, elaborati e trasformati in RowTHs\r\n3) l'ng-container dell'header sparisce (per la condizione !UseCustomCells || !RowTHs) e qui appaiono i nuovi TH (che poi sono gli stessi di prima che girano)\r\n4) Vengono presi i nuovi TH da qui e trasformati a loro volta in RowTHs\r\n-->\r\n<div hidden *ngIf=\"UseCustomCells && RowTHs\">\r\n <ng-container *ngIf=\"View\">\r\n <!--Qui invece ci sono tutti i TH-->\r\n <ng-container *ngTemplateOutlet=\"headerRef\"></ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<!--\r\nQuesta parte \u00E8 un po' pi\u00F9 semplice del sopra. Infatti i TD vengono s\u00EC bindati in entrambi i punti (qui e nell'ng-container del body), ma avr\u00F2 le TD statiche prima di generare la TMPBoundSource.\r\nQuesto significa che il workflow di binding sar\u00E0:\r\n1) Appaiono i TD statici nel body e NON qui, perch\u00E9 i TMPBoundSource non sono ancora stati emessi\r\n2) Contemporaneamente all'emissione dei TMPBoundSource vengono anche emessi i RowTds\r\n3) Considerando il punto 2, al giro dopo appariranno i TD qui, perch\u00E9 \u00E8 stata generata la TMPBoundSource, e spariranno contemporaneamente dall'ng-container del body (per la condizione !UseCustomCells || !RowTDs)\r\n-->\r\n<div hidden *ngIf=\"UseCustomCells && bodyRef\">\r\n <ng-container *ngIf=\"View\">\r\n <!--Tutti i TD che dopo verranno presi ed elaborati internamente-->\r\n <ng-container *ngFor=\"let item of TMPBoundSource\">\r\n <ng-container *ngTemplateOutlet=\"bodyRef; context : {$implicit: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-container *ngIf=\"View\">\r\n <div *ngIf=\"FirstBind && ShowLoadingOnBootstrap\" class=\"est-loading-box\">\r\n <div class=\"est-loading-content\">\r\n <span class=\"fa fa-spinner fa-spin\"></span> {{'Performing Table bootstrap' | localize: lc}}...\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-responsive datatable {{Class}}\" [class.est-scrollable]=\"UseEndlessscroll\" (scroll)=\"UseEndlessscroll && onScroll($event)\" [style.max-height.px]=\"MaxHeight\">\r\n <table class=\"{{ TableClass }}\" [class.est-high-density]=\"HighCellDensity\">\r\n <thead [hidden]=\"HeaderHidden || FirstBind\">\r\n\r\n <!-- Aggiungo il pezzo che gestisce la selezione di tutto se attivo da config -->\r\n <tr *ngIf=\"SelectAll\">\r\n <th colspan=\"42\" [class.est-hidden]=\"!canSelectAll && !(View?.selection || arraymodeSelection).all\">\r\n <span>{{ (selectedObjects || 0).toString() + ' ' + ((selectedObjects == 1 ? 'Object Selected' : 'Objects Selected') | localize : lc) }}</span> \r\n <span class=\"app-link app-inline\" (click)=\"selectAllOrResetSelection()\">{{ (View?.selection || arraymodeSelection).all ? ('Reset Selection' | localize : lc) : ('Select Everything' | localize : lc)}}</span>\r\n </th>\r\n </tr>\r\n\r\n <!-- Blocco header group -->\r\n <tr *ngIf=\"HasHeaderGroup\">\r\n <ng-container *ngTemplateOutlet=\"headerGroupRef\"></ng-container>\r\n <th *ngIf=\"Export\"></th>\r\n </tr>\r\n\r\n <!-- Blocco header group secondario -->\r\n <tr *ngIf=\"HasSecondaryHeaderGroup\">\r\n <ng-container *ngTemplateOutlet=\"secondaryHeaderGroupRef\"></ng-container>\r\n <th *ngIf=\"Export\"></th>\r\n </tr>\r\n\r\n <!-- Blocco effettivo degli header -->\r\n <tr>\r\n <!-- Aggiungo una checkbox se la selezione \u00E8 attiva -->\r\n <th class=\"est-col-min\" *ngIf=\"Selection\">\r\n <input *ngIf=\"!SingleSelection\" class=\"est-pointer\" type=\"checkbox\" [disabled]=\"SelectionDisabled\" [(ngModel)]=\"globalCheck\" [ngModelOptions]=\"{'standalone': true}\" (ngModelChange)=\"globalCheckChanged();\">\r\n </th>\r\n\r\n <!-- Header che valgono per view mode e array mode -->\r\n <ng-container *ngIf=\"(viewMode || arrayMode)\">\r\n\r\n <!-- In una tabella base prendo semplicemente i th scritti dall'utente nell'HTML -->\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTHs) && !DynamicRowColumnsDefinition\">\r\n <ng-container *ngTemplateOutlet=\"headerRef\"></ng-container>\r\n </ng-container>\r\n\r\n <!-- Se ho un modello dinamico dell'oggetto creo le colonne in base alle propriet\u00E0 -->\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTHs) && DynamicRowColumnsDefinition\">\r\n <ng-container *ngFor=\"let operation of DynamicOperations\">\r\n <th class=\"est-col-min est-no-side-padding\"></th>\r\n </ng-container>\r\n \r\n <ng-container *ngFor=\"let rowHeader of DynamicRowColumnsDefinition\">\r\n <ng-container *ngIf=\"rowHeader.visible\">\r\n <th *ngIf=\"OrderByColumn\" es-th=\"{{rowHeader.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowHeader.clss : ' est-nowrap'}}\" [Order]=\"rowHeader.dataOrder\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.orderable\" [OrderBy]=\"OrderByColumn\" [SearchInProgress]=\"!!researchInProgress\" (onOrderChange)=\"thOrderChanged(rowHeader.propertyName, $event)\">{{rowHeader.description}}</th>\r\n <th *ngIf=\"!OrderByColumn\" es-th=\"{{rowHeader.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowHeader.clss : ' est-nowrap'}}\" [Order]=\"rowHeader.dataOrder\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.orderable\" [OrderBy]=\"OrderByColumn\">{{rowHeader.description}}</th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- Se non ho un modello dinamico ma invece delle celle custom, genero gli header in base ai row th -->\r\n <ng-container *ngIf=\"UseCustomCells && RowTHs\">\r\n <ng-container *ngFor=\"let rowHeader of RowTHs\">\r\n <ng-container *ngIf=\"rowHeader && rowHeader.Visible\">\r\n <th es-th=\"{{rowHeader.ID}}\" class=\"{{rowHeader.Class}}{{rowHeader.Wrap ? '' : ' est-nowrap'}}\" [Order]=\"rowHeader.Order\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.Orderable\" [OrderBy]=\"OrderByColumn\" [SearchInProgress]=\"!!researchInProgress\" (onOrderChange)=\"OrderByColumn && thOrderChanged(rowHeader.ID, $event)\">\r\n <ng-container *ngIf=\"rowHeader.Template\">\r\n <ng-container *ngTemplateOutlet=\"rowHeader.Template;\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!rowHeader.Template\">\r\n {{rowHeader.Content}}\r\n </ng-container>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--Casistica in cui ho il setup proveniente da un report. Gli header sono definiti da come \u00E8 fatto il report-->\r\n <ng-container *ngIf=\"reportMode\">\r\n <th [style.color]=\"clm.color\" *ngFor=\"let clm of ReportValues.columns\" class=\"app-no-selection app-pointer est-nowrap\" (click)=\"setupNextOrderAndSearch(clm)\">\r\n {{clm.description}}<span class=\"fa\" [class.fa-chevron-down]=\"clm.order == 'DESC'\" [class.fa-chevron-up]=\"clm.order == 'ASC'\"></span>\r\n </th>\r\n </ng-container>\r\n\r\n <!--Per l'eliminazione mi serve un header aggiuntivo-->\r\n <th *ngIf=\"Removal\" [class.app-right-10]=\"Export || HiddenColumns\" class=\"est-col-min app-sticky-last-column\"><span class=\"fa fa-trash\"></span></th>\r\n\r\n <!--Per l'esportazione mi serve l'header extra da cui faccio uscire i 3 pallocchi-->\r\n <th *ngIf=\"Export || HiddenColumns || ColumnsOrdering || CornerMenuOptions\" class=\"app-table-dotted-menu app-sticky-last-column est-col-min text-sm-center\">\r\n \r\n <!-- Link nascosto che serve a scaricare il file -->\r\n <a *ngIf=\"headers\" hidden #exportDownloader csvLink [data]=\"data\" [headers]=\"headers\" [delimiter]=\"';'\" [filename]=\"ExportFileName\"></a>\r\n\r\n <!-- Blocco con i 3 pallocchi che tira fuori il context menu delle operazioni -->\r\n <div class=\"btn-group\" container=\"body\" placement=\"bottom right\" dropdown #dropdown=\"bs-dropdown\" [autoClose]=\"true\">\r\n <span dropdownToggle class=\"fa fa-ellipsis-v app-fs-18 app-pointer app-padding-3\"></span>\r\n\r\n <div *dropdownMenu class=\"dropdown-menu dropdown-menu-right app-bring-to-front-strong\">\r\n <div class=\"est-pointer\">\r\n <a class=\"dropdown-item\" *ngIf=\"(HiddenColumns || ColumnsOrdering)\" (click)=\"resetColumnVisSelection(); changeColumnVisibilityModal.show();\">\r\n <ng-container *ngIf=\"!HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Order' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && !ColumnsOrdering\">\r\n {{'Columns Visibility' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Visibility and Order' | localize : lc}}\r\n </ng-container>\r\n </a>\r\n <a class=\"dropdown-item\" *ngIf=\"Export && CSVExport\" (click)=\"tryExport('CSV')\">{{'Export View' | localize : lc}} (CSV)</a>\r\n <a class=\"dropdown-item\" *ngIf=\"Export && XLSXExport\" (click)=\"tryExport('XLSX')\">{{'Export View' | localize : lc}} (XLSX)</a>\r\n <a class=\"dropdown-item\" *ngFor=\"let option of CornerMenuOptions\" (click)=\"cornerActionClicked(option.id)\">{{option.description}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n \r\n <!-- Valido per modalit\u00E0 View o Array. Se sono in report mode il body \u00E8 creato in altro modo -->\r\n <tbody [hidden]=\"BodyHidden || FirstBind\" *ngIf=\"(arrayMode || viewMode)\">\r\n <!--Con selection attiva richiamo il template che gestisce il context menu-->\r\n <ng-container *ngIf=\"Selection\">\r\n <ng-container *ngTemplateOutlet=\"TBodySelection; context: { $implicit: { selDisabled: arrayMode ? false : SelectionDisabled, sel: Selection }}\"></ng-container>\r\n </ng-container>\r\n\r\n <!--Senza selection richiamo il template che NON gestisce il context menu-->\r\n <ng-container *ngIf=\"!Selection\">\r\n <ng-container *ngTemplateOutlet=\"TBody\"></ng-container>\r\n </ng-container>\r\n </tbody>\r\n\r\n <!-- Per la modalit\u00E0 a report c'\u00E8 un body particolare semi-dinamico -->\r\n <tbody [hidden]=\"BodyHidden\" *ngIf=\"reportMode\">\r\n <tr *ngFor=\"let row of ReportValues.rows; let even = even;\">\r\n <td class=\"est-nowrap\" *ngFor=\"let val of row.values\">{{val}}</td>\r\n <td class=\"app-sticky-last-column{{even && !Hierarchy ? '-alt' : ''}}\"></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n <ng-container *ngIf=\"ShowPaging && !FirstBind\">\r\n\r\n <!-- Paginatore dove appare la count e le opzioni di paginazione -->\r\n <div class=\"pull-left m-t-min-3\">\r\n <ng-container *ngIf=\"viewMode\">\r\n <ng-container *ngTemplateOutlet=\"pagerSelector; context: { $implicit: { ShowCount: !HidePagingCount || (View && View.objectcount && View.objectcount != -1), ShowPaging: !HidePaging, View: View, UsesView: true }}\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"arrayMode && (!UseArrayModePaging || SearchView)\">\r\n <ng-container *ngTemplateOutlet=\"pagerSelector; context: { $implicit: { ShowCount: !HidePagingCount || (View && View.length) || (SearchView && SearchView.objectcount && SearchView.objectcount != -1), ShowPaging: !HidePaging && SearchView, View: SearchView, SecondaryView: View, UsesView: true }}\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"arrayMode && (UseArrayModePaging && !SearchView)\">\r\n <ng-container *ngTemplateOutlet=\"pagerSelector; context: { $implicit: { ShowCount: !HidePagingCount, ShowPaging: !HidePaging && View.length > 10, View: View, UsesView: false }}\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"reportMode\">\r\n <ng-container *ngTemplateOutlet=\"pagerSelector; context: { $implicit: { ShowCount: !HidePagingCount || (View && View.objectcount && View.objectcount != -1), ShowPaging: View.pagingavailable, MightBeNoPaging: true, View: View, Report: ReportValues, UsesView: true }}\"></ng-container>\r\n </ng-container>\r\n </div>\r\n \r\n <!-- Pulsanti avanti-indietro di paginazione -->\r\n <div class=\"pull-right btn-toolbar\" *ngIf=\"ShowPaging && !HidePagingButtons\">\r\n <ng-container *ngIf=\"(!reportMode || View?.pagingavailable) && (!arrayMode || SearchView)\">\r\n <ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { ATP: addToPage.bind(this), GTP: goToPage.bind(this), Array: arrayPulsanti }}\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"arrayMode && UseArrayModePaging && !SearchView\">\r\n <ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { ATP: arrayAddToPage.bind(this), GTP: arrayGoToPage.bind(this), Array: arrayPulsanti }}\"></ng-container>\r\n </ng-container>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<!-- Template che contiene i pulsanti per cambiare pagina -->\r\n<ng-template #pagingButtons let-options>\r\n <a class=\"btn app-white-button app-no-margin\" (click)=\"options.ATP(-1)\"><span class=\"fa fa-chevron-left\"></span></a>\r\n <div *ngIf=\"options.Array\" class=\"app-inline\">\r\n <a *ngFor=\"let p of options.Array\" class=\"btn {{p.cssClass}} app-no-margin\" (click)=\"options.GTP(p.val)\">{{p.val}}</a>\r\n </div>\r\n <a class=\"btn app-white-button app-no-margin\" (click)=\"options.ATP(1)\"><span class=\"fa fa-chevron-right\"></span></a>\r\n</ng-template>\r\n\r\n<!-- Template che mostra le informazioni base di paginazione: conteggio oggetti, paginazione attuale e pulsanti per cambiarla -->\r\n<ng-template #pagerSelector let-options>\r\n <div *ngIf=\"options.ShowCount\">\r\n {{ CountLabel }}: \r\n <strong *ngIf=\"options.UsesView && !options.Report\">\r\n {{ options.View?.objectcount ? options.View.objectcount : options.SecondaryView && options.SecondaryView.length ? options.SecondaryView.length : \"0\" }}\r\n </strong>\r\n <strong *ngIf=\"!options.UsesView && !options.Report\">\r\n {{ options.View.length ? options.View.length : \"0\" }}\r\n </strong>\r\n <strong *ngIf=\"options.Report\">\r\n {{ options.Report.count && options.Report.count == -1 ? options.Report.rows.length : options.Report.count && options.Report.count > 0 ? options.Report.count : 0 }}\r\n </strong>\r\n </div>\r\n <div *ngIf=\"options.ShowPaging\">\r\n <app-paging *ngIf=\"!options.UsesView\" [Hidden]=\"!options.View || options.View.length == 0\" [WarnOnAll]=\"false\" [CurrentPageSize]=\"ArraymodeItemsPerPage\" (pagingSelected)=\"refreshPaging($event)\"></app-paging>\r\n <app-paging *ngIf=\"options.UsesView\" [AllSearch]=\"AllSearch\" [DefaultAll]=\"defaultAllPageOverride\" [View]=\"options.View\" (pagingSelected)=\"options.View.itemsperpageoverride = $event; changed(); onItemsPerPageChanged();\"></app-paging>\r\n </div>\r\n <div *ngIf=\"options.MightBeNoPaging && !options.ShowPaging\">\r\n <em>{{'Paging options are not available for this report' | localize: lc}}</em>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Questi due template rappresentano effettivamente il body della tabella. essendo il tr l'unica cosa che davvero cambia, il resto \u00E8 templatizzato -->\r\n<ng-template #TBodySelection let-templateOptions>\r\n <ng-container *ngFor=\"let item of boundSource; let even = even; let i=index;\">\r\n <tr *ngIf=\"item.visible || !Hierarchy\" \r\n [class]=\"item._rowClass ? item._rowClass : ''\" [class.est-line-through]=\"item.removed || item.deleted\" [class.est-pointer]=\"!item.locked\" [class.est-white-selected]=\"item._selected && !item.locked\"\r\n [contextMenu]=\"!item.locked ? (ContextMenu || emptyMenu) : emptyMenu\" [contextMenuSubject]=\"item\"\r\n (click)=\"!item.locked && handleClick($event, item)\">\r\n \r\n <td *ngIf=\"!item.locked\"><input type=\"checkbox\" [disabled]=\"templateOptions.selDisabled\" [class.est-pointer]=\"!item.locked\" [(ngModel)]=\"item._selected\" name=\"check{{i}}\"></td>\r\n <td *ngIf=\"item.locked\"></td>\r\n\r\n <ng-container *ngTemplateOutlet=\"basicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"dynamicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customCells; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}\"></ng-container>\r\n\r\n </tr>\r\n </ng-container>\r\n</ng-template> \r\n\r\n<ng-template #TBody>\r\n <ng-container *ngFor=\"let item of boundSource; let even = even;\">\r\n <tr *ngIf=\"item.visible || !Hierarchy\" [class]=\"item._rowClass ? item._rowClass : ''\" [class.est-line-through]=\"item.removed || item.deleted\">\r\n\r\n <ng-container *ngTemplateOutlet=\"basicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"dynamicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customCells; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}\"></ng-container>\r\n\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale su tabelle semplici, con header e body scritti a manazza -->\r\n<ng-template #basicColumns let-item>\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTDs) && !DynamicRowColumnsDefinition\">\r\n <ng-container *ngTemplateOutlet=\"bodyRef; context : {$implicit: item}\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale su tabelle definite in maniera dinamica dal modello -->\r\n<ng-template #dynamicColumns let-item>\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTDs) && DynamicRowColumnsDefinition\">\r\n <ng-container *ngFor=\"let operation of DynamicOperations; let first = first; let last = last;\">\r\n <ng-container *ngIf=\"!operation.conditionField || (item.properties[operation.conditionField] == operation.conditionValue)\">\r\n <td [class.est-no-right-padding]=\"last\" [class.est-no-left-padding]=\"!first\" class=\"est-col-min\"><span title=\"{{operation.title}}\" class=\"{{operation.iconClass}} app-pointer\" (click)=\"dynamicOperation(item, operation.id)\">{{operation.text}}</span></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"operation.conditionField && (item.properties[operation.conditionField] != operation.conditionValue)\">\r\n <td class=\"est-col-min est-no-side-padding\"></td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let rowItem of DynamicRowColumnsDefinition\">\r\n <ng-container *ngIf=\"rowItem.routePath && rowItem.visible\">\r\n <td es-td=\"{{rowItem.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowItem.clss : 'est-nowrap'}}\" [Internal]=\"false\">\r\n <a [routerLink]=\"generateRouterLink(rowItem.routePath, rowItem.routeParameterProperties, item)\" class=\"app-link\" [innerHTML]=\"item.properties[rowItem.propertyName]\"></a>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"!rowItem.routePath && rowItem.visible\">\r\n <ng-container *ngTemplateOutlet=\"findEsTd(rowItem.propertyName) || defaultEsTd; context: { $implicit: item.properties[rowItem.propertyName], rowItem : rowItem, item : item }\"> </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEsTd let-value let-rowItem='rowItem' let-item='item'>\r\n <td es-td=\"{{rowItem.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowItem.clss : 'est-nowrap'}}\"\r\n [class.app-pointer]=\"UseCustomCellActions && CustomCellActionsOn.indexOf('$' + rowItem.propertyName + '$') != -1\"\r\n (click)=\"cellClicked(rowItem.propertyName, item) && !CellActionPropagates && $event.stopPropagation()\"\r\n [Internal]=\"false\">\r\n {{value}}\r\n </td>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale delle celle custom se configurate -->\r\n<ng-template #customCells let-item>\r\n <ng-container *ngIf=\"UseCustomCells && RowTDs\">\r\n <ng-container *ngFor=\"let rowItem of RowTDs[item.hash]; let i = index\">\r\n <ng-container *ngIf=\"rowItem\">\r\n\r\n <ng-container *ngIf=\"!bodyRef && rowItem.Visible\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-nowrap]=\"Hierarchy\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"rowItem.Template\">\r\n <ng-container *ngTemplateOutlet=\"rowItem.Template; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"rowItem.RouterLink && rowItem.Visible && bodyRef\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-nowrap]=\"Hierarchy\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\">\r\n <span *ngIf=\"!item.parent\" class=\"fa fa-chevron-down\" style=\"visibility:hidden\"></span>\r\n <span *ngIf=\"item.parent && item.expanded\" class=\"fa fa-chevron-down est-pointer app-no-selection\" (click)=\"collapseParent(item[this.OwnKey])\"></span>\r\n <span *ngIf=\"item.parent && !item.expanded\" class=\"fa fa-chevron-up est-pointer app-no-selection\" (click)=\"expandParent(item[this.OwnKey])\"></span>\r\n \r\n </ng-container>\r\n <a [routerLink]='rowItem.RouterLink' class=\"app-link\" [innerHTML]=\"rowItem.Content\"></a>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"!rowItem.RouterLink && rowItem.Visible && bodyRef\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-nowrap]=\"Hierarchy\" [class.app-pointer]=\"UseCustomCellActions && CustomCellActionsOn.indexOf('$' + $any(rowItem).ID + '$') != -1\" (click)=\"cellClicked(rowItem.ID, item) && !CellActionPropagates && $event.stopPropagation()\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\">\r\n <span *ngIf=\"!item.parent\" class=\"fa fa-chevron-down\" style=\"visibility:hidden\"></span>\r\n <span *ngIf=\"item.parent && item.expanded\" class=\"fa fa-chevron-down est-pointer app-no-selection\" (click)=\"collapseParent(item[this.OwnKey])\"></span>\r\n <span *ngIf=\"item.parent && !item.expanded\" class=\"fa fa-chevron-up est-pointer app-no-selection\" (click)=\"expandParent(item[this.OwnKey])\"></span>\r\n \r\n </ng-container>\r\n <ng-container *ngIf=\"rowItem.Template\">\r\n <ng-container *ngTemplateOutlet=\"rowItem.Template; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n <span *ngIf=\"!rowItem.Template\" [innerHTML]=\"rowItem.Content\"></span>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene i pulsanti di eliminazione/undo eliminazione ed esportazione che vanno in fondo ad un record edlla tabella -->\r\n<ng-template #bodyDeleteAndExport let-options>\r\n <ng-container *ngIf=\"Removal && !RemovalCondition\">\r\n <td class=\"app-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!(options.item.removed || options.item.deleted)\"><span class=\"fa fa-remove app-pointer text-danger\" [hidden]=\"options.item.removable != undefined && !options.item.removable\" (click)=\"onRemoval.emit(options.item)\"></span></td>\r\n <td class=\"app-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"(options.item.removed || options.item.deleted)\"><span class=\"fa fa-undo text-warning app-pointer\" (click)=\"onAbortRemoval.emit(options.item)\"></span></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"Removal && RemovalCondition\">\r\n <td class=\"app-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!(options.item.removed || options.item.deleted) && options.item[RemovalCondition]\"><span class=\"fa fa-remove app-pointer text-danger\" [hidden]=\"options.item.removable != undefined && !options.item.removable\" (click)=\"onRemoval.emit(options.item)\"></span></td>\r\n <td class=\"app-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"(options.item.removed || options.item.deleted) && options.item[RemovalCondition]\"><span class=\"fa fa-undo text-warning app-pointer\" (click)=\"onAbortRemoval.emit(options.item)\"></span></td>\r\n <td class=\"app-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!options.item[RemovalCondition]\"><span class=\"fa fa-remove app-hidden-view\"></span></td>\r\n </ng-container>\r\n <td *ngIf=\"Export || HiddenColumns || CornerMenuOptions\" class=\"app-sticky-last-column{{options.even && !Hierarchy ? '-alt' : ''}}\"></td>\r\n</ng-template>\r\n\r\n<!-- Context menu vuoto default per tutte le tabella che non ce l'hanno, in modo che al click destro appaia \"nessuna op disponibile\" -->\r\n<context-menu #emptyMenu>\r\n <ng-template contextMenuItem>\r\n <span>\r\n <em>{{'No operations available' | localize : lc}}...</em>\r\n </span>\r\n </ng-template>\r\n</context-menu>\r\n\r\n<!-- Modal per cambiare posizione e visibilit\u00E0 delle colonne dell'es-table -->\r\n<div bsModal #changeColumnVisibilityModal=\"bs-modal\" class=\"modal fade\" role=\"dialog\" aria-hidden=\"true\">\r\n <div class=\"modal-dialog modal-lg\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h5 class=\"modal-title pull-left\">\r\n <ng-container *ngIf=\"!HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Order' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && !ColumnsOrdering\">\r\n {{'Columns Visibility' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Visibility and Order' | localize : lc}}\r\n </ng-container>\r\n </h5>\r\n <button type=\"button\" class=\"close pull-right\" (click)=\"changeColumnVisibilityModal.hide();\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div *ngIf=\"!TMPColumnsList || TMPColumnsList.length == 0\" class=\"card card-info app-padding-10 app-margin-bottom-0\">\r\n {{'There are no columns configured to be hidden/shown in this view' | localize : lc}}\r\n </div>\r\n <div *ngIf=\"TMPColumnsList && TMPColumnsList.length > 0\" style=\"max-height:500px; overflow-y:auto\">\r\n <!--Aaaaaaah la tristezza... qui mi servirebbe l'es-table per facilitare la selezione multipla ecc... peccato che se la linko qui entro in un loop impressionante-->\r\n <table class=\"table table-striped table-sm app-margin-bottom-0\">\r\n <thead>\r\n <tr>\r\n <th class=\"est-col-min\" *ngIf=\"HiddenColumns\">\r\n <input class=\"est-pointer\" type=\"checkbox\" [(ngModel)]=\"globalColVisCheck\" [ngModelOptions]=\"{'standalone': true}\" (ngModelChange)=\"globalColVisCheckChanged();\">\r\n </th>\r\n <th class=\"est-col-min\" *ngIf=\"ColumnsOrdering\"></th>\r\n <th class=\"est-col-min est-nowrap\">{{'Column Name' | localize : lc}}</th>\r\n <!--Filler-->\r\n <th></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of TMPColumnsList; let i = index; let last = last\" class=\"est-pointer\" [class.est-white-selected]=\"lastSelectedItemID == item.id\" [class.est-no-selection]=\"!item.visible\" (click)=\"columnClicked(item);\">\r\n <td *ngIf=\"HiddenColumns\">\r\n <input type=\"checkbox\" [class.est-hidden-view]=\"item.fixed\" class=\"est-pointer\" [(ngModel)]=\"item.visible\" name=\"visible{{i}}\" (ngModelChange)=\"updateGlobalColVisCheck();\" />\r\n </td>\r\n <td class=\"est-nowrap\" *ngIf=\"ColumnsOrdering\">\r\n <span class=\"fa fa-arrow-up\" [class.est-hidden-view]=\"item.fixed\" (click)=\"lastSelectedItemID = item.id; i != 0 && !item.fixed && sendUp(item); $event.stopPropagation();\"></span>\r\n <span class=\"fa fa-arrow-down\" [class.est-hidden-view]=\"item.fixed\" (click)=\"lastSelectedItemID = item.id; !last && !item.fixed && sendDown(item); $event.stopPropagation();\"></span>\r\n </td>\r\n <td class=\"est-nowrap\">\r\n <ng-container *ngIf=\"item.template\">\r\n <ng-container *ngTemplateOutlet=\"item.template\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.template\">{{item.description}}</ng-container>\r\n </td>\r\n <!--Filler-->\r\n <td></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn btn-secondary app-margin-right-10\" (click)=\"lastSelectedItemID = null; changeColumnVisibilityModal.hide();\">{{'Close' | localize : lc}}</button>\r\n <button type=\"button\" [disabled]=\"!TMPColumnsList || TMPColumnsList.length == 0\" class=\"btn btn-primary\" (click)=\"confirmColumnVisibilitySelection() && changeColumnVisibilityModal.hide()\">{{'Confirm' | localize : lc}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>",
|
|
2866
|
-
styles: [".est-loading-box{height:200px;text-align:center;position:relative;background:#ccc}.est-loading-content{margin:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:35px}.est-scrollable{max-height:600px;overflow:auto}.est-pointer{cursor:pointer}.est-high-density td,.est-high-density th{padding:0 .2rem}.est-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.est-hidden-view{visibility:hidden}.est-nowrap{white-space:nowrap}.est-white-selected{background-color:#ddd!important}.est-line-through{text-decoration:line-through}.est-no-side-padding{padding-left:0;padding-right:0}.est-no-left-padding,.est-no-right-padding{padding-left:0}.est-col-min{width:1px}.est-switch{position:relative;display:inline-block;width:30px;height:17px;margin-bottom:0;margin-right:5px;margin-left:5px}.est-switch input{display:none}.est-slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc}.est-slider,.est-slider:before{position:absolute;transition:.4s}.est-slider:before{content:\"\";height:13px;width:13px;left:3px;bottom:2px;background-color:#fff}input:checked+.est-slider{background-color:#2196f3}input:focus+.est-slider{box-shadow:0 0 1px #2196f3}input:checked+.est-slider:before{transform:translateX(11px)}.est-slider.round{border-radius:10px}.est-slider.round:before{border-radius:50%}.est-custom-input{width:30px;display:inline;padding:1px;height:20px}.est-row-lvl-1 td:first-child{padding-left:5px}.est-row-lvl-2 td:first-child{padding-left:20px}.est-row-lvl-3 td:first-child{padding-left:35px}.est-row-lvl-4 td:first-child{padding-left:50px}.est-row-lvl-5 td:first-child{padding-left:65px}.est-row-lvl-6 td:first-child{padding-left:80px}.est-row-lvl-7 td:first-child{padding-left:95px}.est-row-lvl-8 td:first-child{padding-left:110px}.est-row-lvl-9 td:first-child{padding-left:125px}.est-row-lvl-10 td:first-child{padding-left:140px}.est-row-lvl-11 td:first-child{padding-left:155px}.est-row-lvl-12 td:first-child{padding-left:170px}.est-row-lvl-13 td:first-child{padding-left:185px}.est-row-lvl-14 td:first-child{padding-left:200px}.est-row-lvl-15 td:first-child{padding-left:215px}.est-row-lvl-16 td:first-child{padding-left:230px}.est-row-lvl-17 td:first-child{padding-left:245px}.est-row-lvl-18 td:first-child{padding-left:260px}.est-row-lvl-19 td:first-child{padding-left:275px}.est-row-lvl-20 td:first-child{padding-left:290px}.est-row-lvl-21 td:first-child{padding-left:305px}.est-row-lvl-22 td:first-child{padding-left:320px}.est-row-lvl-23 td:first-child{padding-left:335px}.est-row-lvl-24 td:first-child{padding-left:350px}.est-row-lvl-25 td:first-child{padding-left:365px}.est-row-lvl-26 td:first-child{padding-left:380px}.est-row-lvl-27 td:first-child{padding-left:395px}.est-row-lvl-28 td:first-child{padding-left:410px}.est-row-lvl-29 td:first-child{padding-left:425px}.est-row-lvl-30 td:first-child{padding-left:440px}.est-row-lvl-31 td:first-child{padding-left:455px}.est-row-lvl-32 td:first-child{padding-left:470px}.est-row-lvl-33 td:first-child{padding-left:485px}.est-row-lvl-34 td:first-child{padding-left:500px}.est-row-lvl-35 td:first-child{padding-left:515px}.est-row-lvl-36 td:first-child{padding-left:530px}.est-row-lvl-37 td:first-child{padding-left:545px}.est-row-lvl-38 td:first-child{padding-left:560px}.est-row-lvl-39 td:first-child{padding-left:575px}.est-row-lvl-40 td:first-child{padding-left:590px}.est-row-lvl-41 td:first-child{padding-left:605px}.est-row-lvl-42 td:first-child{padding-left:620px}.est-row-lvl-43 td:first-child{padding-left:635px}.est-row-lvl-44 td:first-child{padding-left:650px}.est-row-lvl-45 td:first-child{padding-left:665px}.est-row-lvl-46 td:first-child{padding-left:680px}.est-row-lvl-47 td:first-child{padding-left:695px}.est-row-lvl-48 td:first-child{padding-left:710px}.est-row-lvl-49 td:first-child{padding-left:725px}.est-row-lvl-50 td:first-child{padding-left:740px}.est-row-lvl-51 td:first-child{padding-left:755px}.est-row-lvl-52 td:first-child{padding-left:770px}.est-row-lvl-53 td:first-child{padding-left:785px}.est-row-lvl-54 td:first-child{padding-left:800px}.est-row-lvl-55 td:first-child{padding-left:815px}.est-row-lvl-56 td:first-child{padding-left:830px}.est-row-lvl-57 td:first-child{padding-left:845px}.est-row-lvl-58 td:first-child{padding-left:860px}.est-row-lvl-59 td:first-child{padding-left:875px}.est-row-lvl-60 td:first-child{padding-left:890px}.est-row-lvl-61 td:first-child{padding-left:905px}.est-row-lvl-62 td:first-child{padding-left:920px}.est-row-lvl-63 td:first-child{padding-left:935px}.est-row-lvl-64 td:first-child{padding-left:950px}.est-row-lvl-65 td:first-child{padding-left:965px}.est-row-lvl-66 td:first-child{padding-left:980px}.est-row-lvl-67 td:first-child{padding-left:995px}.est-row-lvl-68 td:first-child{padding-left:1010px}.est-row-lvl-69 td:first-child{padding-left:1025px}.est-row-lvl-70 td:first-child{padding-left:1040px}.est-row-lvl-71 td:first-child{padding-left:1055px}.est-row-lvl-72 td:first-child{padding-left:1070px}.est-row-lvl-73 td:first-child{padding-left:1085px}.est-row-lvl-74 td:first-child{padding-left:1100px}.est-row-lvl-75 td:first-child{padding-left:1115px}.est-row-lvl-76 td:first-child{padding-left:1130px}.est-row-lvl-77 td:first-child{padding-left:1145px}.est-row-lvl-78 td:first-child{padding-left:1160px}.est-row-lvl-79 td:first-child{padding-left:1175px}.est-row-lvl-80 td:first-child{padding-left:1190px}.est-row-lvl-81 td:first-child{padding-left:1205px}.est-row-lvl-82 td:first-child{padding-left:1220px}.est-row-lvl-83 td:first-child{padding-left:1235px}.est-row-lvl-84 td:first-child{padding-left:1250px}.est-row-lvl-85 td:first-child{padding-left:1265px}.est-row-lvl-86 td:first-child{padding-left:1280px}.est-row-lvl-87 td:first-child{padding-left:1295px}.est-row-lvl-88 td:first-child{padding-left:1310px}.est-row-lvl-89 td:first-child{padding-left:1325px}.est-row-lvl-90 td:first-child{padding-left:1340px}.est-row-lvl-91 td:first-child{padding-left:1355px}.est-row-lvl-92 td:first-child{padding-left:1370px}.est-row-lvl-93 td:first-child{padding-left:1385px}.est-row-lvl-94 td:first-child{padding-left:1400px}.est-row-lvl-95 td:first-child{padding-left:1415px}.est-row-lvl-96 td:first-child{padding-left:1430px}.est-row-lvl-97 td:first-child{padding-left:1445px}.est-row-lvl-98 td:first-child{padding-left:1460px}.est-row-lvl-99 td:first-child{padding-left:1475px}.est-right-10{right:10px}.est-hidden{visibility:hidden}"]
|
|
4543
|
+
template: "<!-- Patacchino di autoaggiornamento -->\r\n<div class=\"w-100\" *ngIf=\"AutoUpdate\">\r\n <div class=\"pull-right\">\r\n {{'Update every' | localize : lc}} <input [readonly]=\"autoUpdate\" maxlength=\"3\" class=\"form-control est-custom-input\" type=\"text\" [(ngModel)]=\"seconds\" /> {{'second/s' | localize : lc}}\r\n </div>\r\n <div class=\"pull-right m-t-2\">\r\n <label class=\"est-switch\">\r\n <input type=\"checkbox\" [(ngModel)]=\"autoUpdate\" (ngModelChange)=\"autoUpdateChanged();\" />\r\n <div class=\"est-slider round\"></div>\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<!--\r\nI TH sono contenuto statico, questo significa che senza condizione per RowTHs arriverebbero sia qui sia nell ng-container dell'header in fase non inizializzata, duplicando fisicamente le colonne.\r\nPer ovviare al problema, questo pezzo lo faccio apparire solo se ci sono gi\u00E0 dei RowTHs, quindi su valorizzazione della View succeder\u00E0:\r\n1) appaiono i th nell' ng-container dell'header, e NON qui\r\n2) i TH vengono presi, elaborati e trasformati in RowTHs\r\n3) l'ng-container dell'header sparisce (per la condizione !UseCustomCells || !RowTHs) e qui appaiono i nuovi TH (che poi sono gli stessi di prima che girano)\r\n4) Vengono presi i nuovi TH da qui e trasformati a loro volta in RowTHs\r\n-->\r\n<div hidden *ngIf=\"UseCustomCells && RowTHs\">\r\n <ng-container *ngIf=\"View\">\r\n <!--Qui invece ci sono tutti i TH-->\r\n <ng-container *ngTemplateOutlet=\"headerRef\"></ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<!--\r\nQuesta parte \u00E8 un po' pi\u00F9 semplice del sopra. Infatti i TD vengono s\u00EC bindati in entrambi i punti (qui e nell'ng-container del body), ma avr\u00F2 le TD statiche prima di generare la TMPBoundSource.\r\nQuesto significa che il workflow di binding sar\u00E0:\r\n1) Appaiono i TD statici nel body e NON qui, perch\u00E9 i TMPBoundSource non sono ancora stati emessi\r\n2) Contemporaneamente all'emissione dei TMPBoundSource vengono anche emessi i RowTds\r\n3) Considerando il punto 2, al giro dopo appariranno i TD qui, perch\u00E9 \u00E8 stata generata la TMPBoundSource, e spariranno contemporaneamente dall'ng-container del body (per la condizione !UseCustomCells || !RowTDs)\r\n-->\r\n<div hidden *ngIf=\"UseCustomCells && bodyRef\">\r\n <ng-container *ngIf=\"View\">\r\n <!--Tutti i TD che dopo verranno presi ed elaborati internamente-->\r\n <ng-container *ngFor=\"let item of TMPBoundSource\">\r\n <ng-container *ngTemplateOutlet=\"bodyRef; context : {$implicit: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-container *ngIf=\"View\">\r\n <div *ngIf=\"FirstBind && ShowLoadingOnBootstrap\" class=\"est-loading-box\">\r\n <div class=\"est-loading-content\">\r\n <span class=\"fa fa-spinner fa-spin\"></span> {{'Performing Table bootstrap' | localize: lc}}...\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"PagingStyle == 'both' || PagingStyle == 'top'\">\r\n <ng-container *ngTemplateOutlet=\"pagingElement\"></ng-container>\r\n </div>\r\n\r\n <div class=\"table-responsive datatable {{ContainerClass}}\" [class.est-scrollable]=\"UseEndlessscroll\" (scroll)=\"UseEndlessscroll && onScroll($event)\" [style.max-height.px]=\"MaxHeight\">\r\n <table class=\"{{ TableClass }} est-margin-bottom-10\" [class.est-high-density]=\"HighCellDensity\">\r\n <thead [hidden]=\"HeaderHidden || FirstBind\">\r\n <!-- Aggiungo il pezzo che gestisce la selezione di tutto se attivo da config -->\r\n <tr *ngIf=\"SelectAll\">\r\n <th class=\"est-no-selection\" [attr.colspan]=\"Columns.Global\" [class.est-hidden]=\"!canSelectAll && !(View?.selection || arraymodeSelection).all\">\r\n <span>{{ ((selectedObjects || 0) | number : '0.0-0' : locale) + ' ' + ((selectedObjects == 1 ? 'Object Selected' : 'Objects Selected') | localize : lc) }}</span> \r\n <span class=\"est-link est-inline\" (click)=\"selectAllOrResetSelection()\">{{ (View?.selection || arraymodeSelection).all ? ('Reset Selection' | localize : lc) : ('Select Everything' | localize : lc)}}</span>\r\n </th>\r\n </tr>\r\n\r\n <!-- Blocco header group -->\r\n <ng-container *ngIf=\"RowThGroups\">\r\n <tr *ngFor=\"let level of RowThGroups\">\r\n <th *ngFor=\"let cell of level\" [attr.colspan]=\"cell.Span\" \r\n [class.est-pinned-header]=\"cell.Pinned\" [class.est-col-min]=\"cell.Pinned\"\r\n [class.est-ltab-border]=\"cell.Borders\" [class.est-rtab-border]=\"cell.Borders\"\r\n class=\"est-text-center\">\r\n <ng-container *ngIf=\"cell.Pinned; Else: cell.Template\">\r\n <div class=\"est-pinned-border est-cell-group-padding\"></div>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!RowThGroups\">\r\n <tr *ngIf=\"headerGroupRef\">\r\n <ng-container *ngTemplateOutlet=\"headerGroupRef\"></ng-container>\r\n <th *ngIf=\"Export\"></th>\r\n </tr>\r\n \r\n <!-- Blocco header group secondario -->\r\n <tr *ngIf=\"secondaryHeaderGroupRef\">\r\n <ng-container *ngTemplateOutlet=\"secondaryHeaderGroupRef\"></ng-container>\r\n <th *ngIf=\"Export\"></th>\r\n </tr>\r\n </ng-container>\r\n\r\n <!-- Blocco effettivo degli header -->\r\n <tr>\r\n <!-- Aggiungo una checkbox se la selezione \u00E8 attiva -->\r\n <th class=\"est-col-min\" *ngIf=\"Selection && !HasPinnedColumns\">\r\n <input *ngIf=\"!SingleSelection\" class=\"est-pointer\" type=\"checkbox\" [disabled]=\"SelectionDisabled\" [(ngModel)]=\"globalCheck\" [ngModelOptions]=\"{'standalone': true}\" (ngModelChange)=\"globalCheckChanged();\">\r\n </th>\r\n\r\n <!-- Header che valgono per view mode e array mode -->\r\n <ng-container *ngIf=\"(viewMode || arrayMode)\">\r\n\r\n <!-- In una tabella base prendo semplicemente i th scritti dall'utente nell'HTML -->\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTHs) && !DynamicRowColumnsDefinition\">\r\n <ng-container *ngTemplateOutlet=\"headerRef\"></ng-container>\r\n </ng-container>\r\n\r\n <!-- Se ho un modello dinamico dell'oggetto creo le colonne in base alle propriet\u00E0 -->\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTHs) && DynamicRowColumnsDefinition\">\r\n <th *ngFor=\"let operation of DynamicOperations\" class=\"est-col-min est-no-side-padding\"></th>\r\n \r\n <ng-container *ngFor=\"let rowHeader of DynamicRowColumnsDefinition\">\r\n <ng-container *ngIf=\"rowHeader.visible\">\r\n <th *ngIf=\"OrderByColumn\" es-th=\"{{rowHeader.propertyName}}\" class=\"{{UserDefinedDynamicCols ? ((rowHeader.clss || '') + (rowHeader.headerWraps ? '' : ' est-nowrap')) : ' est-nowrap'}}\" [Order]=\"rowHeader.dataOrder\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.orderable\" [OrderBy]=\"OrderByColumn\" [SearchInProgress]=\"!!researchInProgress\" (onOrderChange)=\"thOrderChanged(rowHeader.propertyName, $event)\">{{rowHeader.description}}</th>\r\n <th *ngIf=\"!OrderByColumn\" es-th=\"{{rowHeader.propertyName}}\" class=\"{{UserDefinedDynamicCols ? ((rowHeader.clss || '') + (rowHeader.headerWraps ? '' : ' est-nowrap')) : ' est-nowrap'}}\" [Order]=\"rowHeader.dataOrder\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.orderable\" [OrderBy]=\"OrderByColumn\">{{rowHeader.description}}</th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!-- Se non ho un modello dinamico ma invece delle celle custom, genero gli header in base ai row th -->\r\n <ng-container *ngIf=\"UseCustomCells && RowTHs\">\r\n <th *ngIf=\"HasPinnedColumns\" class=\"est-pinned-header est-col-min\">\r\n <div [style.width.px]=\"PinnedContainerWidth\" class=\"est-pinned-border\">\r\n <th class=\"est-col-min est-no-border\" *ngIf=\"Selection\">\r\n <input *ngIf=\"!SingleSelection\" class=\"est-pointer\" type=\"checkbox\" [disabled]=\"SelectionDisabled\" [(ngModel)]=\"globalCheck\" [ngModelOptions]=\"{'standalone': true}\" (ngModelChange)=\"globalCheckChanged();\">\r\n </th>\r\n <ng-container *ngFor=\"let rowHeader of RowTHs\">\r\n <th *ngIf=\"rowHeader && rowHeader.Visible && rowHeader.Pinned\" [style.width.px]=\"rowHeader.PinnedWidth\" es-th=\"{{rowHeader.ID}}\" [class.est-no-border]=\"true\" [class.est-nowrap]=\"!rowHeader.Wrap\" class=\"{{rowHeader.Class || ''}}\" [Order]=\"rowHeader.Order\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.Orderable\" [OrderBy]=\"OrderByColumn\" [SearchInProgress]=\"!!researchInProgress\" (onOrderChange)=\"OrderByColumn && thOrderChanged(rowHeader.ID, $event)\">\r\n <ng-container *ngIf=\"rowHeader.Template\"><ng-container *ngTemplateOutlet=\"rowHeader.Template;\"></ng-container></ng-container>\r\n <span *ngIf=\"!rowHeader.Template\">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </div>\r\n </th>\r\n <ng-container *ngFor=\"let rowHeader of RowTHs\">\r\n <th *ngIf=\"rowHeader && rowHeader.Visible && !rowHeader.Pinned\" es-th=\"{{rowHeader.ID}}\" [class.est-ltab-border]=\"rowHeader.LeftBorder\" [class.est-rtab-border]=\"rowHeader.RightBorder\" [class.est-nowrap]=\"!rowHeader.Wrap\" class=\"{{rowHeader.Class || ''}}\" [Order]=\"rowHeader.Order\" [Resizable]=\"ColumnsResizable\" [Orderable]=\"rowHeader.Orderable\" [OrderBy]=\"OrderByColumn\" [SearchInProgress]=\"!!researchInProgress\" (onOrderChange)=\"OrderByColumn && thOrderChanged(rowHeader.ID, $event)\">\r\n <ng-container *ngIf=\"rowHeader.Template\"><ng-container *ngTemplateOutlet=\"rowHeader.Template;\"></ng-container></ng-container>\r\n <span *ngIf=\"!rowHeader.Template\">{{rowHeader.Content}}</span>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <!--Casistica in cui ho il setup proveniente da un report. Gli header sono definiti da come \u00E8 fatto il report-->\r\n <ng-container *ngIf=\"reportMode\">\r\n <th [style.color]=\"clm.color\" *ngFor=\"let clm of ReportValues.columns\" class=\"est-no-selection est-pointer est-nowrap\" (click)=\"setupNextOrderAndSearch(clm)\">\r\n {{clm.description}}<span class=\"fa\" [class.fa-chevron-down]=\"clm.order == 'DESC'\" [class.fa-chevron-up]=\"clm.order == 'ASC'\"></span>\r\n </th>\r\n </ng-container>\r\n\r\n <!--Per l'eliminazione mi serve un header aggiuntivo-->\r\n <th *ngIf=\"Removal\" [class.est-right-10]=\"Export || HiddenColumns\" class=\"est-col-min est-sticky-last-column\"><span class=\"fa fa-trash\"></span></th>\r\n\r\n <!--Per l'esportazione mi serve l'header extra da cui faccio uscire i 3 pallocchi-->\r\n <th *ngIf=\"Export || HiddenColumns || ColumnsOrdering || CornerMenuOptions\" class=\"est-table-dotted-menu est-sticky-last-column est-col-min text-sm-center\">\r\n \r\n <!-- Link nascosto che serve a scaricare il file -->\r\n <a *ngIf=\"headers\" hidden #exportDownloader csvLink [data]=\"data\" [headers]=\"headers\" [delimiter]=\"';'\" [filename]=\"ExportFileName\"></a>\r\n\r\n <!-- Blocco con i 3 pallocchi che tira fuori il context menu delle operazioni -->\r\n <div class=\"btn-group\" container=\"body\" placement=\"bottom right\" dropdown #dropdown=\"bs-dropdown\" [autoClose]=\"true\">\r\n <span dropdownToggle class=\"fa fa-ellipsis-v est-fs-18 est-pointer est-padding-3\"></span>\r\n\r\n <div *dropdownMenu class=\"dropdown-menu dropdown-menu-right est-bring-to-front-strong\">\r\n <div class=\"est-pointer\">\r\n <a class=\"dropdown-item\" *ngIf=\"HiddenColumns || ColumnsOrdering\" (click)=\"resetColumnVisSelection(); changeColumnVisibilityModal.show();\">\r\n <ng-container *ngIf=\"!HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Order' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && !ColumnsOrdering\">\r\n {{'Columns Visibility' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Visibility and Order' | localize : lc}}\r\n </ng-container>\r\n </a>\r\n <a class=\"dropdown-item\" *ngIf=\"Export && CSVExport\" (click)=\"tryExport('CSV')\">{{'Export View' | localize : lc}} (CSV)</a>\r\n <a class=\"dropdown-item\" *ngIf=\"Export && XLSXExport\" (click)=\"tryExport('XLSX')\">{{'Export View' | localize : lc}} (XLSX)</a>\r\n <a class=\"dropdown-item\" *ngFor=\"let option of CornerMenuOptions\" (click)=\"cornerActionClicked(option.id)\">{{option.description}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n </th>\r\n </tr>\r\n </thead>\r\n \r\n <!-- Valido per modalit\u00E0 View o Array. Se sono in report mode il body \u00E8 creato in altro modo -->\r\n <tbody [hidden]=\"BodyHidden || FirstBind\" *ngIf=\"(arrayMode || viewMode)\">\r\n <!--Con selection attiva richiamo il template che gestisce il context menu-->\r\n <ng-container *ngIf=\"Selection\">\r\n <ng-container *ngTemplateOutlet=\"TBodySelection; context: { $implicit: { selDisabled: arrayMode ? false : SelectionDisabled, sel: Selection }}\"></ng-container>\r\n </ng-container>\r\n\r\n <!--Senza selection richiamo il template che NON gestisce il context menu-->\r\n <ng-container *ngIf=\"!Selection\">\r\n <ng-container *ngTemplateOutlet=\"TBody\"></ng-container>\r\n </ng-container>\r\n </tbody>\r\n\r\n <!-- Per la modalit\u00E0 a report c'\u00E8 un body particolare semi-dinamico -->\r\n <tbody [hidden]=\"BodyHidden\" *ngIf=\"reportMode\">\r\n <tr *ngFor=\"let row of ReportValues.rows; let even = even;\">\r\n <td class=\"est-nowrap\" *ngFor=\"let val of row.values\">{{val}}</td>\r\n <td class=\"est-sticky-last-column{{even && !Hierarchy ? '-alt' : ''}}\"></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n <div *ngIf=\"PagingStyle == 'both' || PagingStyle == 'bottom'\">\r\n <ng-container *ngTemplateOutlet=\"pagingElement\"></ng-container>\r\n </div>\r\n</ng-container>\r\n\r\n<!-- Template che contiene tutte le info di paginazione in modo da poterlo replicare anche sopra -->\r\n<ng-template #pagingElement>\r\n <ng-container *ngIf=\"!FirstBind\">\r\n <!-- Pulsanti avanti-indietro di paginazione -->\r\n <div *ngIf=\"PagerOptions.ShowPaging && !HidePagingButtons\" class=\"pull-right btn-toolbar\">\r\n <ng-container *ngIf=\"(!reportMode || View?.pagingavailable) && (!arrayMode || SearchView)\">\r\n <ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { ATP: addToPage.bind(this), GTP: goToPage.bind(this), Array: arrayPulsanti }}\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"arrayMode && UseArrayModePaging && !SearchView\">\r\n <ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { ATP: arrayAddToPage.bind(this), GTP: arrayGoToPage.bind(this), Array: arrayPulsanti }}\"></ng-container>\r\n </ng-container>\r\n </div>\r\n <!-- Paginatore dove appare la count e le opzioni di paginazione -->\r\n <div class=\"pull-right m-t-min-3 est-margin-right-50\">\r\n <div *ngIf=\"PagerOptions.ShowPaging && (PagerOptions.PagerCount > 10 || reportMode && View.pagingavailable)\">\r\n <app-paging *ngIf=\"!PagerOptions.UsesView\" [ShowCount]=\"PagerOptions.ShowCount\" [PagerCount]=\"PagerOptions.PagerCount\" [WarnOnAll]=\"false\" [CurrentPageSize]=\"ArraymodeItemsPerPage\" (pagingSelected)=\"refreshPaging($event)\"></app-paging>\r\n <app-paging *ngIf=\"PagerOptions.UsesView\" [ShowCount]=\"PagerOptions.ShowCount\" [PagerCount]=\"PagerOptions.PagerCount\" [GroupMode]=\"PagerOptions.Searches == 'groups'\" [AllSearch]=\"AllSearch\" [View]=\"PagerOptions.View\" (pagingSelected)=\"onItemsPerPageChanged($event);\"></app-paging>\r\n </div>\r\n <div *ngIf=\"reportMode && !PagerOptions.ShowPaging\"><em>{{'Paging options are not available for this report' | localize: lc}}</em></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- Template che contiene i pulsanti per cambiare pagina -->\r\n<ng-template #pagingButtons let-options>\r\n <a class=\"btn\" class=\"est-page-prev app-pointer\" (click)=\"options.ATP(-1, options.separator)\">\r\n <span class=\"fa fa-chevron-left\"></span>\r\n </a>\r\n <div *ngIf=\"options.Array\" class=\"est-inline\">\r\n <a *ngFor=\"let p of options.Array\" class=\"est-page-sel\" class=\"btn {{p.cssClass}}\"\r\n (click)=\"options.GTP(p.val, options.separator)\">{{p.val}}</a>\r\n </div>\r\n <a class=\"btn\" class=\"est-page-next app-pointer\" (click)=\"options.ATP(1, options.separator)\">\r\n <span class=\"fa fa-chevron-right\"></span>\r\n </a>\r\n</ng-template>\r\n\r\n<!-- Questi due template rappresentano effettivamente il body della tabella. essendo il tr l'unica cosa che davvero cambia, il resto \u00E8 templatizzato -->\r\n<ng-template #TBodySelection let-templateOptions>\r\n <ng-container *ngFor=\"let item of boundSource; let even = even; let i=index;\">\r\n <tr *ngIf=\"item._visible || (!Hierarchy && !ArrayGrouping)\" \r\n [class]=\"item._rowClass ? item._rowClass : ''\" \r\n [class.est-line-through]=\"item.removed || item.deleted\" \r\n [class.est-pointer]=\"!item.locked\" \r\n [class.est-white-selected]=\"item._selected && !item.locked\"\r\n [class.est-rg]=\"item._group\"\r\n [class.est-rg-sep]=\"item._sep\"\r\n [contextMenu]=\"!item.locked ? (ContextMenu || emptyMenu) : emptyMenu\" [contextMenuSubject]=\"item\"\r\n (click)=\"(!item.locked && !item._sep && !item._group && handleClick($event, item)) || item._group && handleGroupClick(item)\">\r\n\r\n <td *ngIf=\"!item.locked && !item._sep && !HasPinnedColumns\">\r\n <input type=\"checkbox\" \r\n [disabled]=\"templateOptions.selDisabled\" \r\n [class.est-pointer]=\"!item.locked\"\r\n [(ngModel)]=\"item._selected\" name=\"check{{i}}\" \r\n (click)=\"$event.stopPropagation(); handleClick($event, item);\">\r\n </td>\r\n <td *ngIf=\"(item.locked || item._sep) && !HasPinnedColumns\"></td>\r\n\r\n <ng-container *ngIf=\"item._sep\"><ng-container *ngTemplateOutlet=\"groupPager; context: { $implicit: item }\"></ng-container> </ng-container>\r\n\r\n <ng-container *ngIf=\"!item._sep\">\r\n <ng-container *ngTemplateOutlet=\"basicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"dynamicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customCells; context: { $implicit: item, templateOptions: templateOptions }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet=\"bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}\"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #TBody>\r\n <ng-container *ngFor=\"let item of boundSource; let even = even;\">\r\n <tr *ngIf=\"item._visible || !Hierarchy\" \r\n [class]=\"item._rowClass ? item._rowClass : ''\" \r\n [class.est-line-through]=\"item.removed || item.deleted\"\r\n [class.est-rg]=\"item._group\"\r\n [class.est-rg-sep]=\"item._sep\"\r\n (click)=\"item._group && handleGroupClick(item)\">\r\n\r\n <ng-container *ngIf=\"item._sep\"><ng-container *ngTemplateOutlet=\"groupPager; context: { $implicit: item }\"></ng-container></ng-container>\r\n\r\n <ng-container *ngIf=\"!item._sep\">\r\n <ng-container *ngTemplateOutlet=\"basicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"dynamicColumns; context: { $implicit: item }\"></ng-container>\r\n <ng-container *ngTemplateOutlet=\"customCells; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngTemplateOutlet=\"bodyDeleteAndExport; context: { $implicit: { even: even, item: item }}\"></ng-container>\r\n </tr>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #groupPager let-item>\r\n <td *ngIf=\"HasPinnedColumns\"></td>\r\n <td *ngIf=\"item._grouplevel > 1\" [attr.colspan]=\"item._grouplevel-1\"></td>\r\n <td [attr.colspan]=\"Columns.VisibleUnpinned - (item._grouplevel > 0 ? item._grouplevel - 1 : 0)\">\r\n <div class=\"est-rg-sep-flex-right\" *ngIf=\"RowGroupingPagingStyle == 'right'\">\r\n <div class=\"est-rg-page\"><ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}\"></ng-container></div>\r\n <div class=\"est-rg-ipp\"><app-paging [AllSearch]=\"AllSearch\" [GroupMode]=\"item.searches == 'groups'\" [PagerCount]=\"item.searches == 'groups' ? item.view.groupcount : item.view.objectcount\" [View]=\"item.view\" (pagingSelected)=\"onGroupItemsPerPageChanged(item, $event);\"></app-paging></div>\r\n </div>\r\n\r\n <div class=\"est-rg-sep-flex-left\" *ngIf=\"RowGroupingPagingStyle == 'left'\">\r\n <div class=\"est-rg-ipp\"><app-paging [AllSearch]=\"AllSearch\" [GroupMode]=\"item.searches == 'groups'\" [PagerCount]=\"item.searches == 'groups' ? item.view.groupcount : item.view.objectcount\" [View]=\"item.view\" (pagingSelected)=\"onGroupItemsPerPageChanged(item, $event);\"></app-paging></div>\r\n <div class=\"est-rg-page\"><ng-container *ngTemplateOutlet=\"pagingButtons; context: { $implicit: { separator: item, ATP: addToPageGroup.bind(this), GTP: goToPageGroup.bind(this), Array: item.buttons }}\"></ng-container></div>\r\n </div>\r\n </td>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale su tabelle semplici, con header e body scritti a manazza -->\r\n<ng-template #basicColumns let-item>\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTDs) && !DynamicRowColumnsDefinition\">\r\n <ng-container *ngTemplateOutlet=\"bodyRef; context : {$implicit: item}\"></ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale su tabelle definite in maniera dinamica dal modello -->\r\n<ng-template #dynamicColumns let-item>\r\n <ng-container *ngIf=\"(!UseCustomCells || !RowTDs) && DynamicRowColumnsDefinition\">\r\n <ng-container *ngFor=\"let operation of DynamicOperations; let first = first; let last = last;\">\r\n <ng-container *ngIf=\"!operation.conditionField || (item.properties[operation.conditionField] == operation.conditionValue)\">\r\n <td [class.est-no-right-padding]=\"last\" [class.est-no-left-padding]=\"!first\" class=\"est-col-min\"><span title=\"{{operation.title}}\" class=\"{{operation.iconClass}} est-pointer\" (click)=\"dynamicOperation(item, operation.id)\">{{operation.text}}</span></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"operation.conditionField && (item.properties[operation.conditionField] != operation.conditionValue)\">\r\n <td class=\"est-col-min est-no-side-padding\"></td>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let rowItem of DynamicRowColumnsDefinition\">\r\n <ng-container *ngIf=\"rowItem.routePath && rowItem.visible\">\r\n <td es-td=\"{{rowItem.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowItem.clss : 'est-nowrap'}}\" [Internal]=\"false\" [Context]=\"item._hash\">\r\n <a [routerLink]=\"generateRouterLink(rowItem.routePath, rowItem.routeParameterProperties, item)\" class=\"est-link\" [innerHTML]=\"item.properties[rowItem.propertyName]\"></a>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"!rowItem.routePath && rowItem.visible\">\r\n <ng-container *ngTemplateOutlet=\"findEsTd(rowItem.propertyName) || defaultEsTd; context: { $implicit: item.properties[rowItem.propertyName], rowItem : rowItem, item : item }\"> </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #defaultEsTd let-value let-rowItem='rowItem' let-item='item'>\r\n <td es-td=\"{{rowItem.propertyName}}\" class=\"{{UserDefinedDynamicCols ? rowItem.clss : 'est-nowrap'}}\"\r\n [class.est-pointer]=\"UseCustomCellActions && CustomCellActionsOn.indexOf('$' + rowItem.propertyName + '$') != -1\"\r\n (click)=\"cellClicked(rowItem.propertyName, item) && !CellActionPropagates && $event.stopPropagation()\"\r\n [Internal]=\"false\" [Context]=\"item._hash\">\r\n {{value}}\r\n </td>\r\n</ng-template>\r\n\r\n<!-- Questo template contiene la print condizionale delle celle custom se configurate -->\r\n<ng-template #customCells let-item let-opt=\"templateOptions\">\r\n <ng-container *ngIf=\"UseCustomCells && RowTDs\">\r\n\r\n <td *ngIf=\"HasPinnedColumns\" class=\"est-pinned-body est-col-min\" [class.est-white-selected]=\"item._selected\">\r\n <div [style.width.px]=\"PinnedContainerWidth\" class=\"est-pinned-border\">\r\n <td *ngIf=\"!item.locked && !item._sep && Selection\" class=\"est-no-border est-col-min\">\r\n <input type=\"checkbox\" [disabled]=\"opt.selDisabled\" [class.est-pointer]=\"!item.locked\" [(ngModel)]=\"item._selected\" name=\"check{{item._hash}}\" (click)=\"$event.stopPropagation(); handleClick($event, item);\">\r\n </td>\r\n <td class=\"est-no-border est-col-min\" *ngIf=\"(item.locked || item._sep) && Selection\"></td>\r\n\r\n <ng-container *ngFor=\"let rowItem of RowTDs[item._hash]; let i = index\">\r\n <td *ngIf=\"rowItem && rowItem.Pinned\" [style.width.px]=\"rowItem.PinnedWidth\" es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-no-border]=\"true\" [class.est-rg-hdr]=\"rowItem.GroupHeader\" [class.est-rg-agg]=\"rowItem.GroupAggregation\" \r\n [class.est-nowrap]=\"Hierarchy || !rowItem.Wraps\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\"><ng-container *ngTemplateOutlet=\"HierarchyNavigator; context: { $implicit: item }\"></ng-container></ng-container>\r\n <ng-container *ngIf=\"rowItem.Template\"><ng-container *ngTemplateOutlet=\"rowItem.Template; context: { $implicit: item }\"></ng-container></ng-container>\r\n <span *ngIf=\"!rowItem.Template\">{{rowItem.Content}}</span>\r\n </td>\r\n </ng-container>\r\n </div>\r\n </td>\r\n\r\n <ng-container *ngFor=\"let rowItem of RowTDs[item._hash]; let i = index\">\r\n <ng-container *ngIf=\"rowItem && !rowItem.Pinned\">\r\n\r\n <!-- Casistica senza bodyRef, quindi con direttive per i td -->\r\n <ng-container *ngIf=\"!bodyRef && rowItem.Visible\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-ltab-border]=\"rowItem.LeftBorder\" [class.est-rtab-border]=\"rowItem.RightBorder\" [class.est-rg-hdr]=\"rowItem.GroupHeader\" [class.est-rg-agg]=\"rowItem.GroupAggregation\" \r\n [class.est-nowrap]=\"Hierarchy || !rowItem.Wraps\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\"><ng-container *ngTemplateOutlet=\"HierarchyNavigator; context: { $implicit: item }\"></ng-container></ng-container>\r\n <ng-container *ngIf=\"rowItem.Template\"><ng-container *ngTemplateOutlet=\"rowItem.Template; context: { $implicit: item }\"></ng-container></ng-container>\r\n <span *ngIf=\"!rowItem.Template\">{{rowItem.Content}}</span>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Casistica bodyRef, quindi con componenti per i td (RouterLink) DEPRECATO -->\r\n <ng-container *ngIf=\"rowItem.RouterLink && rowItem.Visible && bodyRef\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-nowrap]=\"Hierarchy || !rowItem.Wraps\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\">\r\n <ng-container *ngTemplateOutlet=\"HierarchyNavigator; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n <a [routerLink]='rowItem.RouterLink' class=\"est-link\" [innerHTML]=\"rowItem.Content\"></a>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Casistica bodyRef, quindi con componenti per i td (NON RouterLink) DEPRECATO -->\r\n <ng-container *ngIf=\"!rowItem.RouterLink && rowItem.Visible && bodyRef\">\r\n <td es-td=\"{{rowItem.ID}}\" class=\"{{rowItem.Class}}\" [class.est-nowrap]=\"Hierarchy || !rowItem.Wraps\" [class.est-pointer]=\"UseCustomCellActions && CustomCellActionsOn.indexOf('$' + $any(rowItem).ID + '$') != -1\" (click)=\"cellClicked(rowItem.ID, item) && !CellActionPropagates && $event.stopPropagation()\" [Internal]=\"true\">\r\n <ng-container *ngIf=\"Hierarchy && i == 0\">\r\n <ng-container *ngTemplateOutlet=\"HierarchyNavigator; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"rowItem.Template\">\r\n <ng-container *ngTemplateOutlet=\"rowItem.Template; context: { $implicit: item }\"></ng-container>\r\n </ng-container>\r\n <span *ngIf=\"!rowItem.Template\" [innerHTML]=\"rowItem.Content\"></span>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<ng-template #HierarchyNavigator let-item>\r\n <span *ngIf=\"!item.parent\" class=\"fa fa-chevron-down\" style=\"visibility:hidden\"></span>\r\n <span *ngIf=\"item.parent && item._expanded\" class=\"fa fa-chevron-down est-pointer est-no-selection\" (click)=\"collapseParent(item[this.OwnKey])\"></span>\r\n <span *ngIf=\"item.parent && !item._expanded\" class=\"fa fa-chevron-up est-pointer est-no-selection\" (click)=\"expandParent(item[this.OwnKey])\"></span>\r\n \r\n</ng-template>\r\n\r\n<!-- Questo template contiene i pulsanti di eliminazione/undo eliminazione ed esportazione che vanno in fondo ad un record edlla tabella -->\r\n<ng-template #bodyDeleteAndExport let-options>\r\n <ng-container *ngIf=\"Removal && !RemovalCondition\">\r\n <td class=\"est-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!(options.item.removed || options.item.deleted)\"><span class=\"fa fa-remove est-pointer text-danger\" [hidden]=\"options.item.removable != undefined && !options.item.removable\" (click)=\"onRemoval.emit(options.item)\"></span></td>\r\n <td class=\"est-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"(options.item.removed || options.item.deleted)\"><span class=\"fa fa-undo text-warning est-pointer\" (click)=\"onAbortRemoval.emit(options.item)\"></span></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"Removal && RemovalCondition\">\r\n <td class=\"est-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!(options.item.removed || options.item.deleted) && options.item[RemovalCondition]\"><span class=\"fa fa-remove est-pointer text-danger\" [hidden]=\"options.item.removable != undefined && !options.item.removable\" (click)=\"onRemoval.emit(options.item)\"></span></td>\r\n <td class=\"est-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"(options.item.removed || options.item.deleted) && options.item[RemovalCondition]\"><span class=\"fa fa-undo text-warning est-pointer\" (click)=\"onAbortRemoval.emit(options.item)\"></span></td>\r\n <td class=\"est-sticky-last-column{{options.even? '-alt' : ''}} {{Export || HiddenColumns || CornerMenuOptions ? 'est-right-10' : ''}}\" *ngIf=\"!options.item[RemovalCondition]\"><span class=\"fa fa-remove est-hidden-view\"></span></td>\r\n </ng-container>\r\n <td *ngIf=\"Export || HiddenColumns || CornerMenuOptions\" class=\"est-sticky-last-column{{options.even && !Hierarchy ? '-alt' : ''}}\"></td>\r\n</ng-template>\r\n\r\n<!-- Context menu vuoto default per tutte le tabella che non ce l'hanno, in modo che al click destro appaia \"nessuna op disponibile\" -->\r\n<context-menu #emptyMenu>\r\n <ng-template contextMenuItem>\r\n <span>\r\n <em>{{'No operations available' | localize : lc}}...</em>\r\n </span>\r\n </ng-template>\r\n</context-menu>\r\n\r\n<!-- Modal per cambiare posizione e visibilit\u00E0 delle colonne dell'es-table -->\r\n<div bsModal #changeColumnVisibilityModal=\"bs-modal\" class=\"modal fade\" role=\"dialog\" aria-hidden=\"true\">\r\n <div class=\"modal-dialog modal-lg\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h5 class=\"modal-title pull-left\">\r\n <ng-container *ngIf=\"!HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Order' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && !ColumnsOrdering\">\r\n {{'Columns Visibility' | localize : lc}}\r\n </ng-container>\r\n <ng-container *ngIf=\"HiddenColumns && ColumnsOrdering\">\r\n {{'Columns Visibility and Order' | localize : lc}}\r\n </ng-container>\r\n </h5>\r\n <button type=\"button\" class=\"close pull-right\" (click)=\"changeColumnVisibilityModal.hide();\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <div *ngIf=\"!TMPColumnsList || TMPColumnsList.length == 0\" class=\"card card-info est-padding-10 est-margin-bottom-0\">\r\n {{'There are no columns configured to be hidden/shown in this view' | localize : lc}}\r\n </div>\r\n <div *ngIf=\"TMPColumnsList && TMPColumnsList.length > 0\" style=\"max-height:500px; overflow-y:auto\">\r\n <!--Aaaaaaah la tristezza... qui mi servirebbe l'es-table per facilitare la selezione multipla ecc... peccato che se la linko qui entro in un loop impressionante-->\r\n <table class=\"table table-striped table-sm est-margin-bottom-0\">\r\n <thead>\r\n <tr>\r\n <th class=\"est-col-min\" *ngIf=\"HiddenColumns\">\r\n <input class=\"est-pointer\" type=\"checkbox\" [(ngModel)]=\"globalColVisCheck\" [ngModelOptions]=\"{'standalone': true}\" (ngModelChange)=\"globalColVisCheckChanged();\">\r\n </th>\r\n <th class=\"est-col-min\" *ngIf=\"ColumnsOrdering\"></th>\r\n <th class=\"est-col-min est-nowrap\">{{'Column Name' | localize : lc}}</th>\r\n <!--Filler-->\r\n <th></th>\r\n <!-- Pinner -->\r\n <th class=\"est-col-min\"></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let item of TMPColumnsList; let i = index; let last = last\" class=\"est-pointer\" [class.est-white-selected]=\"lastSelectedItemID == item.id\" [class.est-no-selection]=\"!item.visible\">\r\n <td *ngIf=\"HiddenColumns\">\r\n <input type=\"checkbox\" [class.est-hidden-view]=\"item.fixed\" class=\"est-pointer\" [(ngModel)]=\"item.visible\" name=\"visible{{i}}\" (ngModelChange)=\"updateGlobalColVisCheck();\" />\r\n </td>\r\n <td class=\"est-nowrap\" *ngIf=\"ColumnsOrdering\">\r\n <span class=\"fa fa-arrow-up\" [class.est-hidden-view]=\"item.fixed || item.pinned\" (click)=\"lastSelectedItemID = item.id; i != 0 && !item.fixed && sendUp(item); $event.stopPropagation();\"></span>\r\n <span class=\"fa fa-arrow-down\" [class.est-hidden-view]=\"item.fixed || item.pinned\" (click)=\"lastSelectedItemID = item.id; !last && !item.fixed && sendDown(item); $event.stopPropagation();\"></span>\r\n </td>\r\n <td class=\"est-nowrap\" (click)=\"columnClicked(item);\">\r\n <ng-container *ngIf=\"item.template\">\r\n <ng-container *ngTemplateOutlet=\"item.template\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.template\">{{item.description}}</ng-container>\r\n </td>\r\n <!--Filler-->\r\n <td (click)=\"columnClicked(item);\"></td>\r\n <!-- Pinner -->\r\n <td><span *ngIf=\"!item.fixed\" class=\"fa fa-thumb-tack\" [class.text-success]=\"item.pinned\" (click)=\"pinOrUnpinColumn(item)\"></span></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn btn-secondary est-margin-right-10\" (click)=\"lastSelectedItemID = null; changeColumnVisibilityModal.hide();\">{{'Close' | localize : lc}}</button>\r\n <button type=\"button\" [disabled]=\"!TMPColumnsList || TMPColumnsList.length == 0\" class=\"btn btn-primary\" (click)=\"confirmColumnVisibilitySelection() && changeColumnVisibilityModal.hide()\">{{'Confirm' | localize : lc}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>",
|
|
4544
|
+
styles: [".est-loading-box{height:200px;text-align:center;position:relative;background:#ccc}.est-loading-content{margin:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:35px}.est-scrollable{max-height:600px;overflow:auto}.est-pointer{cursor:pointer}.est-high-density td,.est-high-density th{padding:0 .2rem}.est-no-selection{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.est-hidden-view{visibility:hidden}.est-no-border{border:none!important}.est-nowrap{white-space:nowrap}.est-white-selected{background-color:#ddd!important}.est-line-through{text-decoration:line-through}.est-no-side-padding{padding-left:0;padding-right:0}.est-no-left-padding,.est-no-right-padding{padding-left:0}.est-col-min{width:1px}.est-margin-bottom-0{margin-bottom:0!important}.est-margin-right-10{margin-right:10px!important}.est-right-10{right:10px!important}.est-table-dotted-menu{padding:0 0 2px!important;color:#999}.est-fs-18{font-size:18px}.est-fs-14{font-size:14px}.est-padding-3{padding:3px!important}.est-page-container{position:relative}.est-bring-to-front-strong{z-index:99999999!important}.est-switch{position:relative;display:inline-block;width:30px;height:17px;margin-bottom:0;margin-right:5px;margin-left:5px}.est-switch input{display:none}.est-slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc}.est-slider,.est-slider:before{position:absolute;transition:.4s}.est-slider:before{content:\"\";height:13px;width:13px;left:3px;bottom:2px;background-color:#fff}input:checked+.est-slider{background-color:#2196f3}input:focus+.est-slider{box-shadow:0 0 1px #2196f3}input:checked+.est-slider:before{transform:translateX(11px)}.est-slider.round{border-radius:10px}.est-slider.round:before{border-radius:50%}.est-custom-input{width:30px;display:inline;padding:1px;height:20px}.est-row-lvl-1 td:first-child{padding-left:5px}.est-row-lvl-2 td:first-child{padding-left:20px}.est-row-lvl-3 td:first-child{padding-left:35px}.est-row-lvl-4 td:first-child{padding-left:50px}.est-row-lvl-5 td:first-child{padding-left:65px}.est-row-lvl-6 td:first-child{padding-left:80px}.est-row-lvl-7 td:first-child{padding-left:95px}.est-row-lvl-8 td:first-child{padding-left:110px}.est-row-lvl-9 td:first-child{padding-left:125px}.est-row-lvl-10 td:first-child{padding-left:140px}.est-row-lvl-11 td:first-child{padding-left:155px}.est-row-lvl-12 td:first-child{padding-left:170px}.est-row-lvl-13 td:first-child{padding-left:185px}.est-row-lvl-14 td:first-child{padding-left:200px}.est-row-lvl-15 td:first-child{padding-left:215px}.est-row-lvl-16 td:first-child{padding-left:230px}.est-row-lvl-17 td:first-child{padding-left:245px}.est-row-lvl-18 td:first-child{padding-left:260px}.est-row-lvl-19 td:first-child{padding-left:275px}.est-row-lvl-20 td:first-child{padding-left:290px}.est-row-lvl-21 td:first-child{padding-left:305px}.est-row-lvl-22 td:first-child{padding-left:320px}.est-row-lvl-23 td:first-child{padding-left:335px}.est-row-lvl-24 td:first-child{padding-left:350px}.est-row-lvl-25 td:first-child{padding-left:365px}.est-row-lvl-26 td:first-child{padding-left:380px}.est-row-lvl-27 td:first-child{padding-left:395px}.est-row-lvl-28 td:first-child{padding-left:410px}.est-row-lvl-29 td:first-child{padding-left:425px}.est-row-lvl-30 td:first-child{padding-left:440px}.est-row-lvl-31 td:first-child{padding-left:455px}.est-row-lvl-32 td:first-child{padding-left:470px}.est-row-lvl-33 td:first-child{padding-left:485px}.est-row-lvl-34 td:first-child{padding-left:500px}.est-row-lvl-35 td:first-child{padding-left:515px}.est-row-lvl-36 td:first-child{padding-left:530px}.est-row-lvl-37 td:first-child{padding-left:545px}.est-row-lvl-38 td:first-child{padding-left:560px}.est-row-lvl-39 td:first-child{padding-left:575px}.est-row-lvl-40 td:first-child{padding-left:590px}.est-row-lvl-41 td:first-child{padding-left:605px}.est-row-lvl-42 td:first-child{padding-left:620px}.est-row-lvl-43 td:first-child{padding-left:635px}.est-row-lvl-44 td:first-child{padding-left:650px}.est-row-lvl-45 td:first-child{padding-left:665px}.est-row-lvl-46 td:first-child{padding-left:680px}.est-row-lvl-47 td:first-child{padding-left:695px}.est-row-lvl-48 td:first-child{padding-left:710px}.est-row-lvl-49 td:first-child{padding-left:725px}.est-row-lvl-50 td:first-child{padding-left:740px}.est-row-lvl-51 td:first-child{padding-left:755px}.est-row-lvl-52 td:first-child{padding-left:770px}.est-row-lvl-53 td:first-child{padding-left:785px}.est-row-lvl-54 td:first-child{padding-left:800px}.est-row-lvl-55 td:first-child{padding-left:815px}.est-row-lvl-56 td:first-child{padding-left:830px}.est-row-lvl-57 td:first-child{padding-left:845px}.est-row-lvl-58 td:first-child{padding-left:860px}.est-row-lvl-59 td:first-child{padding-left:875px}.est-row-lvl-60 td:first-child{padding-left:890px}.est-row-lvl-61 td:first-child{padding-left:905px}.est-row-lvl-62 td:first-child{padding-left:920px}.est-row-lvl-63 td:first-child{padding-left:935px}.est-row-lvl-64 td:first-child{padding-left:950px}.est-row-lvl-65 td:first-child{padding-left:965px}.est-row-lvl-66 td:first-child{padding-left:980px}.est-row-lvl-67 td:first-child{padding-left:995px}.est-row-lvl-68 td:first-child{padding-left:1010px}.est-row-lvl-69 td:first-child{padding-left:1025px}.est-row-lvl-70 td:first-child{padding-left:1040px}.est-row-lvl-71 td:first-child{padding-left:1055px}.est-row-lvl-72 td:first-child{padding-left:1070px}.est-row-lvl-73 td:first-child{padding-left:1085px}.est-row-lvl-74 td:first-child{padding-left:1100px}.est-row-lvl-75 td:first-child{padding-left:1115px}.est-row-lvl-76 td:first-child{padding-left:1130px}.est-row-lvl-77 td:first-child{padding-left:1145px}.est-row-lvl-78 td:first-child{padding-left:1160px}.est-row-lvl-79 td:first-child{padding-left:1175px}.est-row-lvl-80 td:first-child{padding-left:1190px}.est-row-lvl-81 td:first-child{padding-left:1205px}.est-row-lvl-82 td:first-child{padding-left:1220px}.est-row-lvl-83 td:first-child{padding-left:1235px}.est-row-lvl-84 td:first-child{padding-left:1250px}.est-row-lvl-85 td:first-child{padding-left:1265px}.est-row-lvl-86 td:first-child{padding-left:1280px}.est-row-lvl-87 td:first-child{padding-left:1295px}.est-row-lvl-88 td:first-child{padding-left:1310px}.est-row-lvl-89 td:first-child{padding-left:1325px}.est-row-lvl-90 td:first-child{padding-left:1340px}.est-row-lvl-91 td:first-child{padding-left:1355px}.est-row-lvl-92 td:first-child{padding-left:1370px}.est-row-lvl-93 td:first-child{padding-left:1385px}.est-row-lvl-94 td:first-child{padding-left:1400px}.est-row-lvl-95 td:first-child{padding-left:1415px}.est-row-lvl-96 td:first-child{padding-left:1430px}.est-row-lvl-97 td:first-child{padding-left:1445px}.est-row-lvl-98 td:first-child{padding-left:1460px}.est-row-lvl-99 td:first-child{padding-left:1475px}.est-right-10{right:10px}.est-hidden{visibility:hidden}.est-padding-10{padding:10px!important}.est-margin-right-50{margin-right:50px}.est-page-sel{color:#000;margin-left:3px;margin-right:3px;padding:0 5px;font-size:inherit}.est-page-next,.est-page-prev{color:#000;font-size:inherit;padding:3px 0 0}.est-pinned-header{background-color:#fff;left:0;top:0;position:sticky;z-index:1;border-bottom:1px solid #dee2e6!important;padding:0!important}.est-pinned-border{border-right:2px solid #dee2e6!important}.est-cell-padding{padding:.3rem}.est-pinned-body{background-color:#fff;left:0;position:sticky;z-index:1;border-top:1px solid #dee2e6!important;padding:0!important}.est-inline{display:inline!important}.est-inline-block{display:inline-block!important}.est-link{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block}.est-link:hover{color:#23527c!important;cursor:pointer;text-decoration:underline!important}.est-sticky-last-column{right:-1px;position:sticky;z-index:0;background-color:#fff}.est-sticky-last-column-alt{right:-1px;position:sticky;z-index:0;background-color:#f2f2f2}.est-ltab-border{border-left:2px solid #bbb}.est-rtab-border{border-right:2px solid #bbb}.est-cell-group-padding{padding:calc(.3rem + 1px);position:absolute;top:0;left:0;height:100%;width:100%}.est-margin-bottom-10{margin-bottom:10px}.est-text-center{text-align:center}.est-rg-sep-flex-right{display:flex;flex-direction:row-reverse;width:100%;margin:-5px}.est-rg-sep-flex-left{display:flex;flex-direction:row;width:100%;margin:-5px}.est-rg-hdr{font-weight:700}.est-rg-agg{font-style:italic}.est-rg{background-color:hsla(0,0%,46.7%,.4666666666666667)!important}.est-rg-sep{font-size:12px;padding-right:20px!important;background-color:hsla(0,0%,73.3%,.7333333333333333)!important}.est-rg-ipp{text-align:left;display:inline-flex;margin-right:25px}.est-rg-page{text-align:right;display:inline-flex;font-size:inherit;padding-top:5px}"]
|
|
2867
4545
|
},] }
|
|
2868
4546
|
];
|
|
2869
4547
|
EsTableComponent.ctorParameters = function () { return [
|
|
2870
4548
|
{ type: forms.NgControl, decorators: [{ type: core.Self }, { type: core.Optional }] },
|
|
2871
4549
|
{ type: preferences.PreferencesService, decorators: [{ type: core.Optional }] },
|
|
4550
|
+
{ type: EsTableDefaultable, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EST_DEFAULTS,] }] },
|
|
4551
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EST_LOCALE,] }] },
|
|
2872
4552
|
{ type: localizations.LocalizationService },
|
|
2873
4553
|
{ type: core.ChangeDetectorRef },
|
|
2874
4554
|
{ type: extensions.HashingService },
|
|
2875
4555
|
{ type: extensions.UtilityService },
|
|
2876
|
-
{ type: extensions.ExportService }
|
|
4556
|
+
{ type: extensions.ExportService },
|
|
4557
|
+
{ type: extensions.DateService },
|
|
4558
|
+
{ type: extensions.MessageService }
|
|
2877
4559
|
]; };
|
|
2878
4560
|
EsTableComponent.propDecorators = {
|
|
2879
4561
|
EsTdsDirective: [{ type: core.ContentChildren, args: [EsTdDirective,] }],
|
|
@@ -2892,7 +4574,7 @@
|
|
|
2892
4574
|
CellActionPropagates: [{ type: core.Input }],
|
|
2893
4575
|
UseCustomCells: [{ type: core.Input }],
|
|
2894
4576
|
MaxHeight: [{ type: core.Input }],
|
|
2895
|
-
|
|
4577
|
+
ContainerClass: [{ type: core.Input }],
|
|
2896
4578
|
XLSXExport: [{ type: core.Input }],
|
|
2897
4579
|
CSVExport: [{ type: core.Input }],
|
|
2898
4580
|
AllSearch: [{ type: core.Input }],
|
|
@@ -2903,14 +4585,12 @@
|
|
|
2903
4585
|
RemovalCondition: [{ type: core.Input }],
|
|
2904
4586
|
Export: [{ type: core.Input }],
|
|
2905
4587
|
ShiftClick: [{ type: core.Input }],
|
|
2906
|
-
ShowPaging: [{ type: core.Input }],
|
|
2907
4588
|
HidePaging: [{ type: core.Input }],
|
|
2908
4589
|
HidePagingCount: [{ type: core.Input }],
|
|
2909
4590
|
HidePagingButtons: [{ type: core.Input }],
|
|
2910
4591
|
ContextMenu: [{ type: core.Input }],
|
|
2911
4592
|
ExportFileName: [{ type: core.Input }],
|
|
2912
4593
|
TableClass: [{ type: core.Input }],
|
|
2913
|
-
CountLabel: [{ type: core.Input }],
|
|
2914
4594
|
ExportFunction: [{ type: core.Input }],
|
|
2915
4595
|
HasHeaderGroup: [{ type: core.Input }],
|
|
2916
4596
|
HasSecondaryHeaderGroup: [{ type: core.Input }],
|
|
@@ -2936,9 +4616,12 @@
|
|
|
2936
4616
|
OwnKey: [{ type: core.Input }],
|
|
2937
4617
|
StartsExpanded: [{ type: core.Input }],
|
|
2938
4618
|
SavePreferences: [{ type: core.Input }],
|
|
4619
|
+
PagingStyle: [{ type: core.Input }],
|
|
4620
|
+
RowGroupingPagingStyle: [{ type: core.Input }],
|
|
2939
4621
|
SecondarySource: [{ type: core.Input }],
|
|
2940
4622
|
TertiarySource: [{ type: core.Input }],
|
|
2941
4623
|
UseSelectionCache: [{ type: core.Input }],
|
|
4624
|
+
ShowItemGroupsColumns: [{ type: core.Input }],
|
|
2942
4625
|
onOrderChanged: [{ type: core.Output }],
|
|
2943
4626
|
onSearchRequest: [{ type: core.Output }],
|
|
2944
4627
|
onSelectionChanged: [{ type: core.Output }],
|
|
@@ -2952,26 +4635,22 @@
|
|
|
2952
4635
|
ArraymodeItemsPerPage: [{ type: core.Input }]
|
|
2953
4636
|
};
|
|
2954
4637
|
|
|
2955
|
-
/**
|
|
2956
|
-
* Modello di configurazione per L'EsTable
|
|
2957
|
-
*/
|
|
4638
|
+
/** Modello di configurazione per L'EsTable */
|
|
2958
4639
|
var EsTableModuleConfig = /** @class */ (function () {
|
|
2959
4640
|
function EsTableModuleConfig() {
|
|
2960
4641
|
}
|
|
2961
4642
|
return EsTableModuleConfig;
|
|
2962
4643
|
}());
|
|
2963
4644
|
|
|
2964
|
-
/**
|
|
2965
|
-
* Classe di localizzazione per il componente **TablePagerComponent**
|
|
2966
|
-
*/
|
|
4645
|
+
/** Classe di localizzazione per il componente **TablePagerComponent** */
|
|
2967
4646
|
var TablePagerLoc = /** @class */ (function (_super) {
|
|
2968
4647
|
__extends(TablePagerLoc, _super);
|
|
2969
|
-
/**
|
|
2970
|
-
* @ignore
|
|
2971
|
-
*/
|
|
4648
|
+
/** @ignore */
|
|
2972
4649
|
function TablePagerLoc(LOC_LOCALE) {
|
|
2973
4650
|
var _this = _super.call(this, LOC_LOCALE !== null && LOC_LOCALE !== void 0 ? LOC_LOCALE : 'it-IT') || this;
|
|
2974
4651
|
_super.prototype.set.call(_this, "en->it", "All", ["Tutto"]);
|
|
4652
|
+
_super.prototype.set.call(_this, "en->it", "Shown Elements", ["Elementi visualizzati"]);
|
|
4653
|
+
_super.prototype.set.call(_this, "en->it", "Shown Groups", ["Gruppi visualizzati"]);
|
|
2975
4654
|
_super.prototype.set.call(_this, "en->it", "Are you sure you want to retrieve all results?", ["Si è sicuri di voler caricare tutti i risultati?"]);
|
|
2976
4655
|
_super.prototype.set.call(_this, "en->it", "This might slow down the page and possibly crash the entire application", ["L'operazione potrebbe rallentare la pagina fino al crash dell'applicazione"]);
|
|
2977
4656
|
return _this;
|
|
@@ -2986,33 +4665,36 @@
|
|
|
2986
4665
|
]; };
|
|
2987
4666
|
|
|
2988
4667
|
// Angular
|
|
2989
|
-
/**
|
|
2990
|
-
* Componente che si occupa della paginazione di una tabella
|
|
2991
|
-
*/
|
|
4668
|
+
/** Componente che si occupa della paginazione di una tabella */
|
|
2992
4669
|
var TablePagerComponent = /** @class */ (function () {
|
|
2993
|
-
/**
|
|
2994
|
-
|
|
2995
|
-
*/
|
|
2996
|
-
function TablePagerComponent(msgExts, lc) {
|
|
4670
|
+
/** @ignore */
|
|
4671
|
+
function TablePagerComponent(msgExts, lc, cdr, locale) {
|
|
2997
4672
|
this.msgExts = msgExts;
|
|
2998
4673
|
this.lc = lc;
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
4674
|
+
this.cdr = cdr;
|
|
4675
|
+
this.locale = locale;
|
|
4676
|
+
/** Indica se deve mostrare un warning quando si cercano di solezionare come elementi da visualizzare "Tutti" */
|
|
3002
4677
|
this.WarnOnAll = true;
|
|
3003
|
-
/**
|
|
3004
|
-
* Indica se dare la possibilità o meno di selezionare "Tutti" nelle opzioni di paginazione
|
|
3005
|
-
*/
|
|
4678
|
+
/** Indica se dare la possibilità o meno di selezionare "Tutti" nelle opzioni di paginazione */
|
|
3006
4679
|
this.AllSearch = true;
|
|
3007
|
-
/**
|
|
3008
|
-
* Placeholder che identifica il "Tutti"
|
|
3009
|
-
*/
|
|
4680
|
+
/** Placeholder che identifica il "Tutti" */
|
|
3010
4681
|
this.DefaultAll = 999999;
|
|
3011
|
-
/**
|
|
3012
|
-
|
|
3013
|
-
|
|
4682
|
+
/** Indica se attivare la modalità gruppo con stili più snelli per apparire sotto ai raggruppamenti */
|
|
4683
|
+
this.GroupMode = false;
|
|
4684
|
+
/** Indica se utilizzare il conteggio dei gruppi o degli oggetti */
|
|
4685
|
+
this.GroupCount = false;
|
|
4686
|
+
/** Indica se visualizzare il numero totale di oggeti presenti */
|
|
4687
|
+
this.ShowCount = true;
|
|
4688
|
+
/** Output invocato quando il numero di elementi per pagina viene modificato da un click utente */
|
|
3014
4689
|
this.pagingSelected = new core.EventEmitter();
|
|
4690
|
+
/** Opzioni di paginazione */
|
|
4691
|
+
this.PagingOptions = [10, 15, 30, 45, 100];
|
|
3015
4692
|
}
|
|
4693
|
+
TablePagerComponent.prototype.ngOnInit = function () {
|
|
4694
|
+
this.Model = this.View ? this.View.itemsperpageoverride : this.CurrentPageSize;
|
|
4695
|
+
if (this.AllSearch)
|
|
4696
|
+
this.PagingOptions.push(this.DefaultAll);
|
|
4697
|
+
};
|
|
3016
4698
|
/**
|
|
3017
4699
|
* Funzione richiamata dal template quando un utente clicca su un numero di paginazione.
|
|
3018
4700
|
*
|
|
@@ -3023,10 +4705,19 @@
|
|
|
3023
4705
|
TablePagerComponent.prototype.choice = function (pageSize) {
|
|
3024
4706
|
var _this = this;
|
|
3025
4707
|
if (pageSize == this.DefaultAll && this.WarnOnAll) {
|
|
3026
|
-
this.msgExts.simpleWarningWithChoice(this.lc.loc("Are you sure you want to retrieve all results?"), this.lc.loc("This might slow down the page and possibly crash the entire application"), function () { _this.pagingSelected.emit(pageSize); })
|
|
4708
|
+
this.msgExts.simpleWarningWithChoice(this.lc.loc("Are you sure you want to retrieve all results?"), this.lc.loc("This might slow down the page and possibly crash the entire application"), function () { _this.pagingSelected.emit(pageSize); _this.Model = pageSize; }, function () {
|
|
4709
|
+
// Dio solo sa perché mi tocca fare sta roba... qui dentro per qualche motivo la CD non prende
|
|
4710
|
+
var prevModel = _this.Model;
|
|
4711
|
+
_this.Model = null;
|
|
4712
|
+
_this.cdr.detectChanges();
|
|
4713
|
+
_this.Model = prevModel;
|
|
4714
|
+
_this.cdr.detectChanges();
|
|
4715
|
+
});
|
|
3027
4716
|
}
|
|
3028
|
-
else
|
|
4717
|
+
else {
|
|
3029
4718
|
this.pagingSelected.emit(pageSize);
|
|
4719
|
+
this.Model = pageSize;
|
|
4720
|
+
}
|
|
3030
4721
|
};
|
|
3031
4722
|
return TablePagerComponent;
|
|
3032
4723
|
}());
|
|
@@ -3034,20 +4725,28 @@
|
|
|
3034
4725
|
{ type: core.Component, args: [{
|
|
3035
4726
|
selector: "app-paging",
|
|
3036
4727
|
viewProviders: [{ provide: localizations.LocalizationService, useClass: TablePagerLoc }],
|
|
3037
|
-
template: "<!--Se non ho almeno 10 elementi non ha senso far vedere le opzioni di paginazione-->\r\n<
|
|
4728
|
+
template: "<!--Se non ho almeno 10 elementi non ha senso far vedere le opzioni di paginazione-->\r\n<span class=\"est-fs-14\"> {{(GroupMode ? 'Shown Groups' : 'Shown Elements') | localize : lc}}: </span>\r\n<mat-form-field [appearance]=\"'legacy'\" class=\"mat-paginator-page-size-select est-fs-14 est-ipp-bold\" *ngIf=\"Model\">\r\n <select matNativeControl [ngModel]=\"Model\" name=\"input\" (ngModelChange)=\"choice($event)\">\r\n <ng-container *ngFor=\"let pOpt of PagingOptions\">\r\n <option *ngIf=\"pOpt == DefaultAll || PagerCount > pOpt\" [value]=\"pOpt\">{{ pOpt == DefaultAll ? ('All' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n</mat-form-field>\r\n<span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount\"> / {{PagerCount | number : '0.0-0' : locale}}\r\n</span>",
|
|
4729
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
4730
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
4731
|
+
styles: [".est-ipp-sel,.est-ipp-sel-all,.est-rg-ipp-sel,.est-rg-ipp-sel-all{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-ipp-bold{font-weight:700}.mat-paginator-page-size-select{margin:6px 4px 0;width:50px}.mat-paginator-page-size-select .mat-form-field-wrapper{height:52px!important;margin-top:-15px!important;padding:0!important}.mat-form-field-type-mat-native-select .mat-form-field-infix:after{margin-top:-5.5px!important}"]
|
|
3038
4732
|
},] }
|
|
3039
4733
|
];
|
|
3040
4734
|
TablePagerComponent.ctorParameters = function () { return [
|
|
3041
4735
|
{ type: extensions.MessageService },
|
|
3042
|
-
{ type: localizations.LocalizationService }
|
|
4736
|
+
{ type: localizations.LocalizationService },
|
|
4737
|
+
{ type: core.ChangeDetectorRef },
|
|
4738
|
+
{ type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [EST_LOCALE,] }] }
|
|
3043
4739
|
]; };
|
|
3044
4740
|
TablePagerComponent.propDecorators = {
|
|
3045
4741
|
CurrentPageSize: [{ type: core.Input }],
|
|
3046
4742
|
View: [{ type: core.Input }],
|
|
3047
|
-
Hidden: [{ type: core.Input }],
|
|
3048
4743
|
WarnOnAll: [{ type: core.Input }],
|
|
3049
4744
|
AllSearch: [{ type: core.Input }],
|
|
3050
4745
|
DefaultAll: [{ type: core.Input }],
|
|
4746
|
+
GroupMode: [{ type: core.Input }],
|
|
4747
|
+
GroupCount: [{ type: core.Input }],
|
|
4748
|
+
ShowCount: [{ type: core.Input }],
|
|
4749
|
+
PagerCount: [{ type: core.Input }],
|
|
3051
4750
|
pagingSelected: [{ type: core.Output }]
|
|
3052
4751
|
};
|
|
3053
4752
|
|
|
@@ -3058,7 +4757,8 @@
|
|
|
3058
4757
|
return {
|
|
3059
4758
|
ngModule: EsTableModule,
|
|
3060
4759
|
providers: [
|
|
3061
|
-
{ provide: EST_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' }
|
|
4760
|
+
{ provide: EST_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' },
|
|
4761
|
+
{ provide: EST_DEBUG, useValue: (config === null || config === void 0 ? void 0 : config.debugMode) || false }
|
|
3062
4762
|
]
|
|
3063
4763
|
};
|
|
3064
4764
|
};
|
|
@@ -3074,7 +4774,9 @@
|
|
|
3074
4774
|
modal.ModalModule,
|
|
3075
4775
|
dropdown.BsDropdownModule,
|
|
3076
4776
|
ngxCsv.CsvModule,
|
|
3077
|
-
ngxContextmenu.ContextMenuModule
|
|
4777
|
+
ngxContextmenu.ContextMenuModule,
|
|
4778
|
+
select.MatSelectModule,
|
|
4779
|
+
input.MatInputModule
|
|
3078
4780
|
],
|
|
3079
4781
|
declarations: [EsTh, EsTd, EsTableComponent, EsTdDirective, EsThDirective, TablePagerComponent],
|
|
3080
4782
|
providers: [extensions.UtilityService, extensions.ExportService, extensions.HashingService, extensions.MessageService],
|
|
@@ -3093,15 +4795,19 @@
|
|
|
3093
4795
|
exports.AppOrdering = AppOrdering;
|
|
3094
4796
|
exports.AppSearch = AppSearch;
|
|
3095
4797
|
exports.CornerMenuOption = CornerMenuOption;
|
|
3096
|
-
exports.EsTableColumn = EsTableColumn;
|
|
3097
4798
|
exports.EsTableColumnsDefinition = EsTableColumnsDefinition;
|
|
3098
4799
|
exports.EsTableComponent = EsTableComponent;
|
|
4800
|
+
exports.EsTableDefaultable = EsTableDefaultable;
|
|
3099
4801
|
exports.EsTableModule = EsTableModule;
|
|
3100
4802
|
exports.EsTableModuleConfig = EsTableModuleConfig;
|
|
3101
4803
|
exports.EsTableOperationDefinition = EsTableOperationDefinition;
|
|
3102
4804
|
exports.EsTd = EsTd;
|
|
3103
4805
|
exports.EsTh = EsTh;
|
|
3104
4806
|
exports.GenericItem = GenericItem;
|
|
4807
|
+
exports.Group = Group;
|
|
4808
|
+
exports.GroupAggregation = GroupAggregation;
|
|
4809
|
+
exports.GroupFilter = GroupFilter;
|
|
4810
|
+
exports.GroupOrAggregation = GroupOrAggregation;
|
|
3105
4811
|
exports.ItemsSelection = ItemsSelection;
|
|
3106
4812
|
exports.ReportColumn = ReportColumn;
|
|
3107
4813
|
exports.ReportDefinition = ReportDefinition;
|
|
@@ -3111,10 +4817,12 @@
|
|
|
3111
4817
|
exports.ReportRow = ReportRow;
|
|
3112
4818
|
exports.ɵa = EsTableLoc;
|
|
3113
4819
|
exports.ɵb = EST_LOCALE;
|
|
3114
|
-
exports.ɵc =
|
|
3115
|
-
exports.ɵd =
|
|
3116
|
-
exports.ɵe =
|
|
3117
|
-
exports.ɵf =
|
|
4820
|
+
exports.ɵc = EST_DEBUG;
|
|
4821
|
+
exports.ɵd = EST_DEFAULTS;
|
|
4822
|
+
exports.ɵe = EsTdDirective;
|
|
4823
|
+
exports.ɵf = EsThDirective;
|
|
4824
|
+
exports.ɵg = TablePagerComponent;
|
|
4825
|
+
exports.ɵh = TablePagerLoc;
|
|
3118
4826
|
|
|
3119
4827
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3120
4828
|
|