@esfaenza/es-table 11.2.148 → 11.2.150

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.
@@ -755,6 +755,19 @@
755
755
  editorForProperty: [{ type: i0.Input }]
756
756
  };
757
757
 
758
+ var ThTdProvider = /** @class */ (function () {
759
+ function ThTdProvider() {
760
+ }
761
+ return ThTdProvider;
762
+ }());
763
+ ThTdProvider.decorators = [
764
+ { type: i0.Directive, args: [{ selector: '[td_th_provider]' },] }
765
+ ];
766
+ ThTdProvider.propDecorators = {
767
+ EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
768
+ EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }]
769
+ };
770
+
758
771
  /** Classe di localizzazione per il componente **EsTableComponent** */
759
772
  var EsTableLoc = /** @class */ (function (_super) {
760
773
  __extends(EsTableLoc, _super);
@@ -4389,12 +4402,16 @@
4389
4402
  };
4390
4403
  /** @ignore */
4391
4404
  EsTableComponent.prototype.ngAfterViewInit = function () {
4392
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
4405
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
4393
4406
  // Se utilizzo la new spicy mode deduco tutti i parametri di lavoro possibili al caricamento della tabella
4394
4407
  // Vengono sovrascritte solo le proprietà non impostate dall'utente
4395
- var tdsD = 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;
4396
- var thsD = 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;
4397
- var usesThsAndTdsDirectives = tdsD && tdsD.length > 0 && thsD && thsD.length > 0;
4408
+ 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();
4409
+ 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();
4410
+ if (((_l = this.ThTdProvider) === null || _l === void 0 ? void 0 : _l.length) > 0) {
4411
+ this.EsTds = __spread(this.EsTds, this.ThTdProvider.map(function (t) { return t.EsTdsDirective.toArray(); }).flat());
4412
+ this.EsThs = __spread(this.EsThs, this.ThTdProvider.map(function (t) { return t.EsThsDirective.toArray(); }).flat());
4413
+ }
4414
+ var 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;
4398
4415
  var hasNoContentProjection = !this.bodyRef && !this.headerRef && !this.headerGroupRef && !this.secondaryHeaderGroupRef;
4399
4416
  if (usesThsAndTdsDirectives || hasNoContentProjection) {
4400
4417
  if (this.UseCustomCells == null)
@@ -4697,12 +4714,8 @@
4697
4714
  };
4698
4715
  /** 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
4716
  EsTableComponent.prototype.internalPostBoundSource = function () {
4700
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
4717
+ var _a;
4701
4718
  var View = this.View;
4702
- var tdsD = 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;
4703
- var thsD = 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;
4704
- var ths = thsD && thsD.length > 0 ? thsD.toArray() : [];
4705
- var tds = tdsD && tdsD.length > 0 ? tdsD.toArray() : [];
4706
4719
  // Se non ho colonne dinamiche ma sono in modalità dinamica (lo capisco perché c'è una view piena di genericitem) metto il default delle colonne
4707
4720
  this.dynamicMode_H.eventuallyReviewDynamicColumns();
4708
4721
  // Gestisce la richiesta per gruppi o per singoli oggetti
@@ -4717,44 +4730,44 @@
4717
4730
  // N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
4718
4731
  // ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
4719
4732
  // 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
4720
- if (((_l = this.DynamicRowColumnsDefinition) === null || _l === void 0 ? void 0 : _l.length) > 0) {
4733
+ if (((_a = this.DynamicRowColumnsDefinition) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4721
4734
  this.logger.log("Generating ths and tds from Dynamic definition");
4722
4735
  var ret_1 = this.dynamicMode_H.emitThsAndTdsBasedOnDynamicDefinition();
4723
- ths = ret_1.ths;
4724
- tds = ret_1.tds;
4736
+ this.EsThs = ret_1.ths;
4737
+ this.EsTds = ret_1.tds;
4725
4738
  }
4726
4739
  // Gestione delle view in modalità report, i th e i td vengono rigenerati dalle configurazioni della view
4727
4740
  if (!this.arrayMode && view.report_columns) {
4728
4741
  this.logger.log("Generating ths and tds from report results");
4729
4742
  var ret_2 = this.reportMode_H.generateThsAndTdsFromView(view);
4730
- ths = ret_2.ths;
4731
- tds = ret_2.tds;
4743
+ this.EsThs = ret_2.ths;
4744
+ this.EsTds = ret_2.tds;
4732
4745
  }
4733
4746
  // Espando i th e i td multipli duplicandoli
4734
- var ret = this.columnMetadata_H.expandMultiThsAndTds(ths, tds, itemsAndGroups);
4735
- ths = ret.expThs;
4736
- tds = ret.expTds;
4747
+ var ret = this.columnMetadata_H.expandMultiThsAndTds(this.EsThs, this.EsTds, itemsAndGroups);
4748
+ this.EsThs = ret.expThs;
4749
+ this.EsTds = ret.expTds;
4737
4750
  // 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
4738
- for (var i = 0; i < ths.length; i++) {
4739
- var th = ths[i];
4751
+ for (var i = 0; i < this.EsThs.length; i++) {
4752
+ var th = this.EsThs[i];
4740
4753
  this.thsCache[th.th] = th;
4741
4754
  }
4742
4755
  this.thsCacheSet = true;
4743
4756
  // Prepassaggio per tirare fuori tutte le info utili sugli headers in modo da non ricacolarseli sempre dopo
4744
- var hI = this.columnMetadata_H.evaluateHeadersGroupingInfos(ths);
4757
+ var hI = this.columnMetadata_H.evaluateHeadersGroupingInfos(this.EsThs);
4745
4758
  if (this.arrayMode) // In modalità array non ho un backend...
4746
4759
  this.rowGrouping_H.arrayModeReviewGroupings(hI.leafs); // ... i raggruppamenti li devo fare lato client
4747
4760
  this.columnMetadata_H.reviewColumnsList(hI.leafs); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
4748
4761
  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.
4749
- this.columnMetadata_H.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)
4762
+ 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)
4750
4763
  this.columnMetadata_H.alignHeadersOrdering(hI.leafs, view); // Allineo gli ordinamenti agli header
4751
- this.columnMetadata_H.refreshColumnsVisibility(hI.leafs, tds, view); // Lavoro sui TH ed eventualmente modifico la visibilità anche dei TD.
4764
+ this.columnMetadata_H.refreshColumnsVisibility(hI.leafs, this.EsTds, view); // Lavoro sui TH ed eventualmente modifico la visibilità anche dei TD.
4752
4765
  this.columnMetadata_H.evaluatePinnedColumnsWidth(); // Se sono presenti colonne pinnate valuta la dimensione del contenitore
4753
4766
  this.columnMetadata_H.generateDefaultOrder(hI.leafs, view); // Genero le direttive di ordinamento, che siano default o derivanti dalla AppSearch
4754
4767
  this.columnMetadata_H.evaluateHeaderGroups(hI); // Valuto i raggruppamenti degli header se presenti
4755
4768
  // ************************************* Generazione binding per righe e colonne *************************************
4756
4769
  this.evaluateRowThs(hI.leafs); // Raccolgo i TH
4757
- this.evaluateRowTds(hI.leafs, tds); // Raccolgo i TD in contesti separati, un contesto per ogni item o gruppo
4770
+ this.evaluateRowTds(hI.leafs, this.EsTds); // Raccolgo i TD in contesti separati, un contesto per ogni item o gruppo
4758
4771
  // ************************************* Ultimi aggiustmaenti dei binding *************************************
4759
4772
  this.columnMetadata_H.applyOrdering(view, true); // Applico l'ordinamento sulle colonne (non ASC DESC, ma "prima questa o quella colonna")
4760
4773
  this.MoveTemporaryVariablesToRealOnes(); // Collego TH e TD aggiustati fino ad ora alle variabili di Binding HTML
@@ -4855,14 +4868,13 @@
4855
4868
  */
4856
4869
  EsTableComponent.prototype.resetSelection = function (emit) {
4857
4870
  if (emit === void 0) { emit = false; }
4858
- var _a;
4859
4871
  this.selection_H.clearSelectionCaches();
4860
- if ((_a = this.View) === null || _a === void 0 ? void 0 : _a.selection) {
4872
+ if (this.viewMode && this.View) {
4861
4873
  this.View.selection = new ItemsSelection([]);
4862
4874
  if (emit)
4863
4875
  this.onSelectionChanged.emit(this.View.selection);
4864
4876
  }
4865
- else if (this.arraymodeSelection) {
4877
+ else if (this.arrayMode) {
4866
4878
  this.arraymodeSelection = new ItemsSelection([]);
4867
4879
  if (emit)
4868
4880
  this.onSelectionChanged.emit(this.arraymodeSelection);
@@ -5685,6 +5697,7 @@
5685
5697
  EsTdEditorDirectives: [{ type: i0.ContentChildren, args: [EsTdEditorDirective,] }],
5686
5698
  EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
5687
5699
  EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }],
5700
+ ThTdProvider: [{ type: i0.ContentChildren, args: [ThTdProvider,] }],
5688
5701
  EsTableTemplate: [{ type: i0.Input }],
5689
5702
  bodyRef: [{ type: i0.ContentChild, args: ['body', { static: false },] }],
5690
5703
  headerRef: [{ type: i0.ContentChild, args: ['header', { static: false },] }],
@@ -6202,7 +6215,8 @@
6202
6215
  // Componenti
6203
6216
  EsTableComponent,
6204
6217
  TablePagerComponent,
6205
- EsTableTemplate
6218
+ EsTableTemplate,
6219
+ ThTdProvider
6206
6220
  ];
6207
6221
  var PRIVATE_ELEMENTS = [
6208
6222
  // Componenti
@@ -6369,6 +6383,7 @@
6369
6383
  exports.ReportParam = ReportParam;
6370
6384
  exports.ReportRow = ReportRow;
6371
6385
  exports.TablePagerComponent = TablePagerComponent;
6386
+ exports.ThTdProvider = ThTdProvider;
6372
6387
  exports.ɵa = TablePagerLoc;
6373
6388
  exports.ɵb = EST_LOCALE;
6374
6389
  exports.ɵc = EST_DEBUG;