@esfaenza/es-table 11.2.73 → 11.2.76

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.
@@ -967,6 +967,12 @@
967
967
  this.est.arrayOrders = [new AppOrdering(id, order)];
968
968
  }
969
969
  }
970
+ //Salvo le preferences di questa view
971
+ //Di default registro ordinamento e visibilità delle colonne nella vista. Solo le cose di UI
972
+ if (this.est.SavePreferences) {
973
+ var castedView = this.est.viewMode ? (this.est.MainGroupView || this.est.View) : null;
974
+ this.registerViewPreferences(castedView);
975
+ }
970
976
  this.est.onOrderChanged.emit({ id: id, order: order });
971
977
  if (this.est.viewMode) {
972
978
  if (this.est.groupSearchRequestsCache.length > 0)
@@ -977,6 +983,30 @@
977
983
  else if (this.est.arrayMode)
978
984
  this.est.internalWriteValue();
979
985
  };
986
+ /**
987
+ * Registra le preference relative alla view passata come parametro
988
+ *
989
+ * @param {any} castedView View di cui salvare colonne e ordinamento colonne
990
+ */
991
+ ColumnMetadataHandler.prototype.registerViewPreferences = function (castedView) {
992
+ if (!this.est.ngControl.name) {
993
+ console.error("Non posso utilizzare le preference senza avere un 'name' per la tabella");
994
+ return false;
995
+ }
996
+ if (!this.prefService) {
997
+ console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato");
998
+ return false;
999
+ }
1000
+ var columns = this.est.arrayMode ? this.est.arrayColumns : castedView.columns;
1001
+ var columnsOrderings = this.est.arrayMode ? this.est.arrayColumnOrdering : castedView.column_ordering;
1002
+ var columnOrders = this.est.arrayMode ? [] : castedView.orders;
1003
+ var toStore = {
1004
+ columns: JSON.parse(JSON.stringify(columns)),
1005
+ column_ordering: JSON.parse(JSON.stringify(columnsOrderings)),
1006
+ orders: JSON.parse(JSON.stringify(columnOrders))
1007
+ };
1008
+ this.prefService.setItem(this.est.ngControl.name, toStore, 'preference').subscribe();
1009
+ };
980
1010
  /**
981
1011
  * Partendo dagli **EsThs** estrappolo la lista di **EsTableColumn** che questa tabella dovrà eventualmente gestire per Visibilità e Ordine
982
1012
  *
@@ -1650,20 +1680,8 @@
1650
1680
  this.refreshColumnsVisibility(null, null, castedView);
1651
1681
  //Salvo le preferences di questa view
1652
1682
  //Di default registro ordinamento e visibilità delle colonne nella vista. Solo le cose di UI
1653
- if (this.est.SavePreferences) {
1654
- if (!this.est.ngControl.name) {
1655
- console.error("Non posso utilizzare le preference senza avere un 'name' per la tabella");
1656
- return false;
1657
- }
1658
- if (!this.prefService) {
1659
- console.error("Non posso utilizzare le preference senza che il pacchetto @esfaenza/preferences sia installato");
1660
- return false;
1661
- }
1662
- var columns = this.est.arrayMode ? this.est.arrayColumns : castedView.columns;
1663
- var columnsOrderings = this.est.arrayMode ? this.est.arrayColumnOrdering : castedView.column_ordering;
1664
- var toStore = { columns: JSON.parse(JSON.stringify(columns)), column_ordering: JSON.parse(JSON.stringify(columnsOrderings)) };
1665
- this.prefService.setItem(this.est.ngControl.name, toStore, 'preference').subscribe();
1666
- }
1683
+ if (this.est.SavePreferences)
1684
+ this.registerViewPreferences(castedView);
1667
1685
  // Rieseguo l'ultima ricerca bindata alla tabella
1668
1686
  // Mi assicuro di farlo dopo l'espansione del changed o rischio che la ricerca mi ridia colonne che in realtà non esistono
1669
1687
  if (this.est.viewMode)
@@ -3436,6 +3454,7 @@
3436
3454
  SelectionHandler.prototype.singleCellSelection = function (event, row, column) {
3437
3455
  this.clearTextSelection(event);
3438
3456
  if (event.shiftKey && this.est.ShiftClick && this.lastSingleSelection) {
3457
+ this.clearSelectionStatus({ row: row, column: column });
3439
3458
  var rowAddition = row < this.lastSingleSelection.row ? -1 : +1;
3440
3459
  var columnAddition = column < this.lastSingleSelection.column ? -1 : +1;
3441
3460
  for (var ir = this.lastSingleSelection.row; ir != row + rowAddition; ir += rowAddition)
@@ -4189,6 +4208,7 @@
4189
4208
  if (updatedPrefs) {
4190
4209
  this.View.columns = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
4191
4210
  this.View.column_ordering = (prefs === null || prefs === void 0 ? void 0 : prefs.column_ordering) || [];
4211
+ this.View.orders = (prefs === null || prefs === void 0 ? void 0 : prefs.orders) || [];
4192
4212
  }
4193
4213
  }
4194
4214
  _t.label = 4;
@@ -4240,6 +4260,7 @@
4240
4260
  if (updatedPrefs) {
4241
4261
  this.View.columns = (prefs === null || prefs === void 0 ? void 0 : prefs.columns) || [];
4242
4262
  this.View.column_ordering = (prefs === null || prefs === void 0 ? void 0 : prefs.column_ordering) || [];
4263
+ this.View.orders = (prefs === null || prefs === void 0 ? void 0 : prefs.orders) || [];
4243
4264
  }
4244
4265
  _t.label = 9;
4245
4266
  case 9: