@esfaenza/es-table 11.2.58 → 11.2.61

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.
@@ -956,7 +956,7 @@
956
956
  // Di default la visibilità è quella impostata nel componente
957
957
  if ((this_1.est.HiddenColumns || th.thVisible) && th.thIf) {
958
958
  var previouslyPinned = !this_1.est.ColumnsList || this_1.est.ColumnsList.length == 0 ? null : this_1.est.ColumnsList.find(function (t) { return t.id == column; }) || null;
959
- var toAdd = new EsTableColumn(column, null, th.thVisible, (th.thFixed || th.thGroup), previouslyPinned == null ? th.thPinned : previouslyPinned.pinned, th.thPinnable, th.thPinnedWidth, th.Template, th._thParents, th._multi, th._multi_content);
959
+ var toAdd = new EsTableColumn(column, th.thStaticContent, th.thVisible, (th.thFixed || th.thGroup), previouslyPinned == null ? th.thPinned : previouslyPinned.pinned, th.thPinnable, th.thPinnedWidth, th.Template, th._thParents, th._multi, th._multi_content);
960
960
  if (previouslyPinned)
961
961
  toAdd.prev_index = previouslyPinned.prev_index;
962
962
  this_1.est.TMPColumnsList.push(toAdd);
@@ -3754,7 +3754,9 @@
3754
3754
  EsTableComponent.prototype.ngAfterViewInit = function () {
3755
3755
  // Se utilizzo la new spicy mode deduco tutti i parametri di lavoro possibili al caricamento della tabella
3756
3756
  // Vengono sovrascritte solo le proprietà non impostate dall'utente
3757
- if (this.EsTdsDirective && this.EsTdsDirective.length > 0 && this.EsThsDirective && this.EsThsDirective.length > 0) {
3757
+ var usesThsAndTdsDirectives = this.EsTdsDirective && this.EsTdsDirective.length > 0 && this.EsThsDirective && this.EsThsDirective.length > 0;
3758
+ var hasNoContentProjection = !this.bodyRef && !this.headerRef && !this.headerGroupRef && !this.secondaryHeaderGroupRef;
3759
+ if (usesThsAndTdsDirectives || hasNoContentProjection) {
3758
3760
  if (this.UseCustomCells == null)
3759
3761
  this.UseCustomCells = true;
3760
3762
  if (this.HiddenColumns == null && this.UseCustomCells)
@@ -3801,7 +3803,7 @@
3801
3803
  EsTableComponent.prototype.writeValue = function (obj) {
3802
3804
  var _a;
3803
3805
  return __awaiter(this, void 0, void 0, function () {
3804
- var firstItemGroupOrNoGrouping, prefs, cols, updatedPrefs, columns, i, prefs, cols, updatedPrefs, i;
3806
+ var firstItemGroupOrNoGrouping, prefs, cols, updatedPrefs, repository, source, i, prefs, cols, updatedPrefs, repository, source, i;
3805
3807
  return __generator(this, function (_t) {
3806
3808
  switch (_t.label) {
3807
3809
  case 0:
@@ -3849,9 +3851,21 @@
3849
3851
  if (this.View) {
3850
3852
  cols = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
3851
3853
  updatedPrefs = true;
3852
- columns = this.View.report_columns ? this.View.report_columns.map(function (t) { return t.id; }) : this.View.columns;
3853
- for (i = 0; i < columns.length; i++) {
3854
- if (!cols.indexOf(columns[i])) {
3854
+ repository = void 0;
3855
+ source = void 0;
3856
+ if (this.View.report_columns) {
3857
+ repository = this.View.report_columns.map(function (t) { return t.id; });
3858
+ source = cols;
3859
+ }
3860
+ else {
3861
+ repository = cols;
3862
+ source = this.View.columns;
3863
+ }
3864
+ // In modalità report devo controllare che tutte le colonne salvate facciano parte della vista
3865
+ // In modalità normale invece se le preferenze fanno riferimento a delle colonne che io non ho nella View attuale significa che
3866
+ // sto facendo riferimento a una versione vecchia dell'es-table, quindi non foccio operazioni
3867
+ for (i = 0; i < source.length; i++) {
3868
+ if (repository.indexOf(source[i]) == -1) {
3855
3869
  updatedPrefs = false;
3856
3870
  break;
3857
3871
  }
@@ -3888,16 +3902,29 @@
3888
3902
  prefs = _t.sent();
3889
3903
  cols = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
3890
3904
  updatedPrefs = true;
3891
- // Se le preferenze fanno riferimento a delle colonne che io non ho nella View attuale significa che
3892
- // le preference stanno facendo riferimento a una versione vecchia dell'es-table, quindi non foccio operazioni
3893
- for (i = 0; i < this.arrayColumns.length; i++) {
3894
- if (!cols.indexOf(this.arrayColumns[i])) {
3905
+ repository = void 0;
3906
+ source = void 0;
3907
+ if (this.View.report_columns) {
3908
+ repository = this.View.report_columns.map(function (t) { return t.id; });
3909
+ source = cols;
3910
+ }
3911
+ else {
3912
+ repository = cols;
3913
+ source = this.View.columns;
3914
+ }
3915
+ // In modalità report devo controllare che tutte le colonne salvate facciano parte della vista
3916
+ // In modalità normale invece se le preferenze fanno riferimento a delle colonne che io non ho nella View attuale significa che
3917
+ // sto facendo riferimento a una versione vecchia dell'es-table, quindi non foccio operazioni
3918
+ for (i = 0; i < source.length; i++) {
3919
+ if (repository.indexOf(source[i]) == -1) {
3895
3920
  updatedPrefs = false;
3896
3921
  break;
3897
3922
  }
3898
3923
  }
3899
- this.arrayColumns = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
3900
- this.arrayColumnOrdering = (prefs === null || prefs === void 0 ? void 0 : prefs.column_ordering) || [];
3924
+ if (updatedPrefs) {
3925
+ this.View.columns = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
3926
+ this.View.column_ordering = (prefs === null || prefs === void 0 ? void 0 : prefs.column_ordering) || [];
3927
+ }
3901
3928
  _t.label = 9;
3902
3929
  case 9:
3903
3930
  if (this.SearchView)