@esfaenza/es-table 11.2.149 → 11.2.151
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 +156 -110
- package/bundles/esfaenza-es-table.umd.js.map +1 -1
- package/bundles/esfaenza-es-table.umd.min.js +1 -1
- package/bundles/esfaenza-es-table.umd.min.js.map +1 -1
- package/esfaenza-es-table.metadata.json +1 -1
- package/esm2015/lib/components/es-table/es_table.component.js +114 -105
- package/esm2015/lib/directives/es_th_td_provider.directive.js +21 -0
- package/esm2015/lib/es-table.module.js +4 -2
- package/esm2015/public-api.js +2 -1
- package/fesm2015/esfaenza-es-table.js +133 -107
- package/fesm2015/esfaenza-es-table.js.map +1 -1
- package/lib/components/es-table/es_table.component.d.ts +7 -1
- package/lib/directives/es_th_td_provider.directive.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@esfaenza/localizations'), require('@esfaenza/extensions'), require('@angular/forms'), require('@esfaenza/preferences'), require('@angular/cdk/drag-drop'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/es-table', ['exports', '@angular/core', '@esfaenza/localizations', '@esfaenza/extensions', '@angular/forms', '@esfaenza/preferences', '@angular/cdk/drag-drop', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza['es-table'] = {}), global.ng.core, global.localizations, global.i1, global.ng.forms, global.preferences, global.ng.cdk.dragDrop, global.
|
|
5
|
-
}(this, (function (exports, i0, localizations, i1, forms, preferences,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@esfaenza/localizations'), require('@esfaenza/extensions'), require('@angular/forms'), require('@esfaenza/preferences'), require('rxjs'), require('@angular/cdk/drag-drop'), require('@angular/common'), require('@angular/router'), require('@angular/material/select'), require('@angular/material/input'), require('@angular/material/tooltip'), require('@esfaenza/forms-and-validations'), require('ngx-bootstrap/modal'), require('ngx-bootstrap/dropdown'), require('@esfaenza/ngx-contextmenu')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@esfaenza/es-table', ['exports', '@angular/core', '@esfaenza/localizations', '@esfaenza/extensions', '@angular/forms', '@esfaenza/preferences', 'rxjs', '@angular/cdk/drag-drop', '@angular/common', '@angular/router', '@angular/material/select', '@angular/material/input', '@angular/material/tooltip', '@esfaenza/forms-and-validations', 'ngx-bootstrap/modal', 'ngx-bootstrap/dropdown', '@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.localizations, global.i1, global.ng.forms, global.preferences, global.rxjs, global.ng.cdk.dragDrop, global.ng.common, global.ng.router, global.ng.material.select, global.ng.material.input, global.ng.material.tooltip, global.formsAndValidations, global.modal, global.dropdown, global.ngxContextmenu));
|
|
5
|
+
}(this, (function (exports, i0, localizations, i1, forms, preferences, rxjs, dragDrop, common, router, select, input, tooltip, formsAndValidations, modal, dropdown, ngxContextmenu) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -755,6 +755,24 @@
|
|
|
755
755
|
editorForProperty: [{ type: i0.Input }]
|
|
756
756
|
};
|
|
757
757
|
|
|
758
|
+
var ThTdProvider = /** @class */ (function () {
|
|
759
|
+
function ThTdProvider() {
|
|
760
|
+
this.LoadedSignal = new rxjs.Subject();
|
|
761
|
+
}
|
|
762
|
+
ThTdProvider.prototype.setLoaded = function () {
|
|
763
|
+
this.LoadedSignal.next();
|
|
764
|
+
this.LoadedSignal.complete();
|
|
765
|
+
};
|
|
766
|
+
return ThTdProvider;
|
|
767
|
+
}());
|
|
768
|
+
ThTdProvider.decorators = [
|
|
769
|
+
{ type: i0.Directive, args: [{ selector: '[td_th_provider]' },] }
|
|
770
|
+
];
|
|
771
|
+
ThTdProvider.propDecorators = {
|
|
772
|
+
EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
|
|
773
|
+
EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }]
|
|
774
|
+
};
|
|
775
|
+
|
|
758
776
|
/** Classe di localizzazione per il componente **EsTableComponent** */
|
|
759
777
|
var EsTableLoc = /** @class */ (function (_super) {
|
|
760
778
|
__extends(EsTableLoc, _super);
|
|
@@ -4389,32 +4407,49 @@
|
|
|
4389
4407
|
};
|
|
4390
4408
|
/** @ignore */
|
|
4391
4409
|
EsTableComponent.prototype.ngAfterViewInit = function () {
|
|
4392
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4410
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4411
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4412
|
+
var usesThsAndTdsDirectives, hasNoContentProjection;
|
|
4413
|
+
return __generator(this, function (_u) {
|
|
4414
|
+
switch (_u.label) {
|
|
4415
|
+
case 0:
|
|
4416
|
+
// Se utilizzo la new spicy mode deduco tutti i parametri di lavoro possibili al caricamento della tabella
|
|
4417
|
+
// Vengono sovrascritte solo le proprietà non impostate dall'utente
|
|
4418
|
+
this.EsTds = (this.EsTdsDirective.length == 0 ? ((_c = (_b = (_a = this.EsTableTemplate) === null || _a === void 0 ? void 0 : _a.Template) === null || _b === void 0 ? void 0 : _b.EsTdsDirective) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (_e = (_d = this.EsTableTemplate) === null || _d === void 0 ? void 0 : _d.Template) === null || _e === void 0 ? void 0 : _e.EsTdsDirective : this.EsTdsDirective : this.EsTdsDirective).toArray();
|
|
4419
|
+
this.EsThs = (this.EsThsDirective.length == 0 ? ((_h = (_g = (_f = this.EsTableTemplate) === null || _f === void 0 ? void 0 : _f.Template) === null || _g === void 0 ? void 0 : _g.EsThsDirective) === null || _h === void 0 ? void 0 : _h.length) > 0 ? (_k = (_j = this.EsTableTemplate) === null || _j === void 0 ? void 0 : _j.Template) === null || _k === void 0 ? void 0 : _k.EsThsDirective : this.EsThsDirective : this.EsThsDirective).toArray();
|
|
4420
|
+
if (!(((_l = this.ThTdProvider) === null || _l === void 0 ? void 0 : _l.length) > 0)) return [3 /*break*/, 2];
|
|
4421
|
+
return [4 /*yield*/, rxjs.forkJoin(this.ThTdProvider.map(function (t) { return t.LoadedSignal; })).toPromise()];
|
|
4422
|
+
case 1:
|
|
4423
|
+
_u.sent();
|
|
4424
|
+
this.EsTds = __spread(this.EsTds, this.ThTdProvider.map(function (t) { return t.EsTdsDirective.toArray(); }).flat());
|
|
4425
|
+
this.EsThs = __spread(this.EsThs, this.ThTdProvider.map(function (t) { return t.EsThsDirective.toArray(); }).flat());
|
|
4426
|
+
_u.label = 2;
|
|
4427
|
+
case 2:
|
|
4428
|
+
usesThsAndTdsDirectives = ((_m = this.EsTds) === null || _m === void 0 ? void 0 : _m.length) > 0 && ((_o = this.EsThs) === null || _o === void 0 ? void 0 : _o.length) > 0;
|
|
4429
|
+
hasNoContentProjection = !this.bodyRef && !this.headerRef && !this.headerGroupRef && !this.secondaryHeaderGroupRef;
|
|
4430
|
+
if (usesThsAndTdsDirectives || hasNoContentProjection) {
|
|
4431
|
+
if (this.UseCustomCells == null)
|
|
4432
|
+
this.UseCustomCells = true;
|
|
4433
|
+
if (this.HiddenColumns == null && this.UseCustomCells)
|
|
4434
|
+
this.HiddenColumns = true;
|
|
4435
|
+
if (this.ColumnsOrdering == null && this.UseCustomCells)
|
|
4436
|
+
this.ColumnsOrdering = true;
|
|
4437
|
+
if (this.OrderByColumn == null && this.UseCustomCells)
|
|
4438
|
+
this.OrderByColumn = true;
|
|
4439
|
+
if (this.SelectAll == null && this.Selection)
|
|
4440
|
+
this.SelectAll = true;
|
|
4441
|
+
if (this.ShiftClick == null && this.Selection)
|
|
4442
|
+
this.ShiftClick = true;
|
|
4443
|
+
this.DirectivesBased = true;
|
|
4444
|
+
}
|
|
4445
|
+
//Per poter cambiare il layout in base al livello gerarchico il componente deva avere il pieno controllo di ogni cella,
|
|
4446
|
+
//che con solo la proiezione (senza celle cusotm) non è disponibile
|
|
4447
|
+
if (this.Hierarchy && !this.UseCustomCells)
|
|
4448
|
+
throw "Es-table error: Per poter utilizzare l'es-table con [Hierarchy]=\"true\" è richiesto anche [UseCustomCells]=\"true\"";
|
|
4449
|
+
return [2 /*return*/];
|
|
4450
|
+
}
|
|
4451
|
+
});
|
|
4452
|
+
});
|
|
4418
4453
|
};
|
|
4419
4454
|
/** @ignore */
|
|
4420
4455
|
EsTableComponent.prototype.ngOnDestroy = function () {
|
|
@@ -4697,85 +4732,93 @@
|
|
|
4697
4732
|
};
|
|
4698
4733
|
/** 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 */
|
|
4699
4734
|
EsTableComponent.prototype.internalPostBoundSource = function () {
|
|
4700
|
-
var _a, _b
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4735
|
+
var _a, _b;
|
|
4736
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4737
|
+
var View, view, itemsAndGroups, si, ret_1, ret_2, ret, i, th, hI, items, si;
|
|
4738
|
+
return __generator(this, function (_u) {
|
|
4739
|
+
switch (_u.label) {
|
|
4740
|
+
case 0:
|
|
4741
|
+
View = this.View;
|
|
4742
|
+
if (!(((_a = this.ThTdProvider) === null || _a === void 0 ? void 0 : _a.length) > 0)) return [3 /*break*/, 2];
|
|
4743
|
+
return [4 /*yield*/, rxjs.forkJoin(this.ThTdProvider.map(function (t) { return t.LoadedSignal; })).toPromise()];
|
|
4744
|
+
case 1:
|
|
4745
|
+
_u.sent();
|
|
4746
|
+
_u.label = 2;
|
|
4747
|
+
case 2:
|
|
4748
|
+
// Se non ho colonne dinamiche ma sono in modalità dinamica (lo capisco perché c'è una view piena di genericitem) metto il default delle colonne
|
|
4749
|
+
this.dynamicMode_H.eventuallyReviewDynamicColumns();
|
|
4750
|
+
// Gestisce la richiesta per gruppi o per singoli oggetti
|
|
4751
|
+
this.bindDisplayToLoadedItemsOrGroups(View);
|
|
4752
|
+
// Questo dev'essere per forza lanciato dopo **bindDisplayToLoadedItemsOrGroups** dato che è lì che alcune cose vengono valorizzate
|
|
4753
|
+
this.setupPagingInformations();
|
|
4754
|
+
// Molte cose sono ovviamente disponibili solo in modalità View
|
|
4755
|
+
if ((this.viewMode || this.arrayMode) && this.UseCustomCells) {
|
|
4756
|
+
view = this.viewMode ? View : null;
|
|
4757
|
+
itemsAndGroups = this.viewMode ? __spread((view.items || []), (view.groups || [])) : View;
|
|
4758
|
+
si = this.viewMode ? view.selection : this.arraymodeSelection;
|
|
4759
|
+
// N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
|
|
4760
|
+
// ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
|
|
4761
|
+
// Se ho definizioni dinamiche, prima di qualsiasi altra cosa devo trasformarle in th/td in modo che poi il codice qui sotto faccia le sue magie
|
|
4762
|
+
if (((_b = this.DynamicRowColumnsDefinition) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
4763
|
+
this.logger.log("Generating ths and tds from Dynamic definition");
|
|
4764
|
+
ret_1 = this.dynamicMode_H.emitThsAndTdsBasedOnDynamicDefinition();
|
|
4765
|
+
this.EsThs = ret_1.ths;
|
|
4766
|
+
this.EsTds = ret_1.tds;
|
|
4767
|
+
}
|
|
4768
|
+
// Gestione delle view in modalità report, i th e i td vengono rigenerati dalle configurazioni della view
|
|
4769
|
+
if (!this.arrayMode && view.report_columns) {
|
|
4770
|
+
this.logger.log("Generating ths and tds from report results");
|
|
4771
|
+
ret_2 = this.reportMode_H.generateThsAndTdsFromView(view);
|
|
4772
|
+
this.EsThs = ret_2.ths;
|
|
4773
|
+
this.EsTds = ret_2.tds;
|
|
4774
|
+
}
|
|
4775
|
+
ret = this.columnMetadata_H.expandMultiThsAndTds(this.EsThs, this.EsTds, itemsAndGroups);
|
|
4776
|
+
this.EsThs = ret.expThs;
|
|
4777
|
+
this.EsTds = ret.expTds;
|
|
4778
|
+
// Genero la cache dei th da usare da qui in poi, dopo avergli lasciato fare le sue cose in caso ci siano dei multi o dei report
|
|
4779
|
+
for (i = 0; i < this.EsThs.length; i++) {
|
|
4780
|
+
th = this.EsThs[i];
|
|
4781
|
+
this.thsCache[th.th] = th;
|
|
4782
|
+
}
|
|
4783
|
+
this.thsCacheSet = true;
|
|
4784
|
+
hI = this.columnMetadata_H.evaluateHeadersGroupingInfos(this.EsThs);
|
|
4785
|
+
if (this.arrayMode) // In modalità array non ho un backend...
|
|
4786
|
+
this.rowGrouping_H.arrayModeReviewGroupings(hI.leafs); // ... i raggruppamenti li devo fare lato client
|
|
4787
|
+
this.columnMetadata_H.reviewColumnsList(hI.leafs); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
|
|
4788
|
+
this.columnMetadata_H.alignColumnsIfLoadedView(view); // Se sto caricando una View da hotpotato (quindi con savedstate = true) riallineo la visibilità delle colonne e il loro ordine.
|
|
4789
|
+
this.columnMetadata_H.moveFixedColumnsAtTheBeginning(hI.leafs, this.EsTds); // 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)
|
|
4790
|
+
this.columnMetadata_H.alignHeadersOrdering(hI.leafs, view); // Allineo gli ordinamenti agli header
|
|
4791
|
+
this.columnMetadata_H.refreshColumnsVisibility(hI.leafs, this.EsTds, view); // Lavoro sui TH ed eventualmente modifico la visibilità anche dei TD.
|
|
4792
|
+
this.columnMetadata_H.evaluatePinnedColumnsWidth(); // Se sono presenti colonne pinnate valuta la dimensione del contenitore
|
|
4793
|
+
this.columnMetadata_H.generateDefaultOrder(hI.leafs, view); // Genero le direttive di ordinamento, che siano default o derivanti dalla AppSearch
|
|
4794
|
+
this.columnMetadata_H.evaluateHeaderGroups(hI); // Valuto i raggruppamenti degli header se presenti
|
|
4795
|
+
// ************************************* Generazione binding per righe e colonne *************************************
|
|
4796
|
+
this.evaluateRowThs(hI.leafs); // Raccolgo i TH
|
|
4797
|
+
this.evaluateRowTds(hI.leafs, this.EsTds); // Raccolgo i TD in contesti separati, un contesto per ogni item o gruppo
|
|
4798
|
+
// ************************************* Ultimi aggiustmaenti dei binding *************************************
|
|
4799
|
+
this.columnMetadata_H.applyOrdering(view, true); // Applico l'ordinamento sulle colonne (non ASC DESC, ma "prima questa o quella colonna")
|
|
4800
|
+
this.MoveTemporaryVariablesToRealOnes(); // Collego TH e TD aggiustati fino ad ora alle variabili di Binding HTML
|
|
4801
|
+
this.selection_H.evaluateSelection(itemsAndGroups, si); // Riallineo le info di selezione degli elementi della View
|
|
4802
|
+
// Valuta lo stato iniziale di selezione a range
|
|
4803
|
+
this.selection_H.evaluateSingleCellSelection(itemsAndGroups, hI.leafs, this.DynamicRowColumnsDefinition);
|
|
4804
|
+
if (this.ResearchNeeded) {
|
|
4805
|
+
this.changed();
|
|
4806
|
+
this.emitSearchRequest(false);
|
|
4807
|
+
this.ResearchNeeded = false;
|
|
4808
|
+
}
|
|
4809
|
+
}
|
|
4810
|
+
else if ((this.viewMode || this.arrayMode) && !this.UseCustomCells) {
|
|
4811
|
+
items = this.viewMode ? View.items : View;
|
|
4812
|
+
si = this.viewMode ? View.selection : this.arraymodeSelection;
|
|
4813
|
+
this.selection_H.evaluateSelection(items, si);
|
|
4814
|
+
}
|
|
4815
|
+
// Per essere sicuro che dopo un bind di oggetti la es-table aggiorni la grafica
|
|
4816
|
+
this.cdr.markForCheck();
|
|
4817
|
+
this.FirstBind = false;
|
|
4818
|
+
return [2 /*return*/];
|
|
4819
|
+
}
|
|
4820
|
+
});
|
|
4821
|
+
});
|
|
4779
4822
|
};
|
|
4780
4823
|
/**
|
|
4781
4824
|
* Effettua il binding degli oggetti pervenuti da questa chiamata con gli oggetti effettivamente da graficare
|
|
@@ -5684,6 +5727,7 @@
|
|
|
5684
5727
|
EsTdEditorDirectives: [{ type: i0.ContentChildren, args: [EsTdEditorDirective,] }],
|
|
5685
5728
|
EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
|
|
5686
5729
|
EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }],
|
|
5730
|
+
ThTdProvider: [{ type: i0.ContentChildren, args: [ThTdProvider,] }],
|
|
5687
5731
|
EsTableTemplate: [{ type: i0.Input }],
|
|
5688
5732
|
bodyRef: [{ type: i0.ContentChild, args: ['body', { static: false },] }],
|
|
5689
5733
|
headerRef: [{ type: i0.ContentChild, args: ['header', { static: false },] }],
|
|
@@ -6201,7 +6245,8 @@
|
|
|
6201
6245
|
// Componenti
|
|
6202
6246
|
EsTableComponent,
|
|
6203
6247
|
TablePagerComponent,
|
|
6204
|
-
EsTableTemplate
|
|
6248
|
+
EsTableTemplate,
|
|
6249
|
+
ThTdProvider
|
|
6205
6250
|
];
|
|
6206
6251
|
var PRIVATE_ELEMENTS = [
|
|
6207
6252
|
// Componenti
|
|
@@ -6368,6 +6413,7 @@
|
|
|
6368
6413
|
exports.ReportParam = ReportParam;
|
|
6369
6414
|
exports.ReportRow = ReportRow;
|
|
6370
6415
|
exports.TablePagerComponent = TablePagerComponent;
|
|
6416
|
+
exports.ThTdProvider = ThTdProvider;
|
|
6371
6417
|
exports.ɵa = TablePagerLoc;
|
|
6372
6418
|
exports.ɵb = EST_LOCALE;
|
|
6373
6419
|
exports.ɵc = EST_DEBUG;
|