@esfaenza/es-table 11.2.98 → 11.2.100

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.
@@ -825,7 +825,7 @@
825
825
  /** Effettua l'esportazione del file Excel basandosi sul modulo **ExcelJS**, sugli header **this.est.headers** e sui dati **this.est.data** */
826
826
  ExportHandler.prototype.exportExcel = function () {
827
827
  return __awaiter(this, void 0, void 0, function () {
828
- var iFix, workbook, sheet, header, i, h, i, row, item, i_1, h, cell, val, buffer, blob, objectUrl, fn;
828
+ var iFix, workbook, sheet, header, i, h, i, row, item, i_1, h, cell, val, date, correctedDate, buffer, blob, objectUrl, fn;
829
829
  return __generator(this, function (_b) {
830
830
  switch (_b.label) {
831
831
  case 0:
@@ -853,7 +853,9 @@
853
853
  else {
854
854
  switch (h.type) {
855
855
  case 'date':
856
- cell.value = this.dateExts.getDateConvertion(val).toDate();
856
+ date = this.dateExts.getDateConvertion(val);
857
+ correctedDate = dayjs(date).add(dayjs().utcOffset(), 'minute');
858
+ cell.value = correctedDate.toDate();
857
859
  break;
858
860
  case 'number':
859
861
  cell.value = parseFloat(val.replace(',', '.'));
@@ -2105,18 +2107,25 @@
2105
2107
  this.est.arrayPulsanti = this.utilities.getPagesArray(6, this.est.arraymodePage, this.est.arraymodePages);
2106
2108
  else
2107
2109
  return this.est.View;
2110
+ // Applico eventuali oridnamenti lato Array prima di tirare fuori la pagina selezionata
2111
+ var items = this.est.View;
2112
+ if (this.est)
2113
+ items = this.arrayModeReviewOrderings(items);
2108
2114
  // Poi per tutti i valori dopo compresi fra la pagina - 1 e la pagina
2109
2115
  for (var i = ((this.est.arraymodePage - 1) * this.est.ArraymodeItemsPerPage); i < this.est.arraymodePage * this.est.ArraymodeItemsPerPage; i++) {
2110
- if (i <= this.est.View.length - 1)
2111
- tmpItems.push(this.est.View[i]);
2116
+ if (i <= items.length - 1)
2117
+ tmpItems.push(items);
2112
2118
  }
2113
2119
  return tmpItems;
2114
2120
  };
2115
2121
  /** Se in modalità array applica gli ordinamenti ASC-DESC delle colonne */
2116
- ItemsHandler.prototype.arrayModeReviewOrderings = function () {
2117
- var _this = this;
2122
+ ItemsHandler.prototype.arrayModeReviewOrderings = function (items) {
2123
+ var tmp = items;
2118
2124
  if (this.est.arrayOrders.length > 0)
2119
- this.est.arrayOrders.forEach(function (t) { _this.est.boundSource = _this.est.boundSource.sort(function (a, b) { return (a[t.id] > b[t.id] ? 1 : -1) * (t.order == 'DESC' ? -1 : 1); }); });
2125
+ this.est.arrayOrders.forEach(function (t) {
2126
+ tmp = tmp.sort(function (a, b) { return (a[t.id] > b[t.id] ? 1 : -1) * (t.order == 'DESC' ? -1 : 1); });
2127
+ });
2128
+ return tmp;
2120
2129
  };
2121
2130
  return ItemsHandler;
2122
2131
  }());
@@ -4484,10 +4493,8 @@
4484
4493
  }
4485
4494
  // Prepassaggio per tirare fuori tutte le info utili sugli headers in modo da non ricacolarseli sempre dopo
4486
4495
  var hI = this.columnMetadata_H.evaluateHeadersGroupingInfos(ths);
4487
- if (this.arrayMode) { // In modalità array non ho un backend...
4488
- this.items_H.arrayModeReviewOrderings(); // ... quindi gli ordinamenti li devo fare lato client, e ...
4496
+ if (this.arrayMode) // In modalità array non ho un backend...
4489
4497
  this.rowGrouping_H.arrayModeReviewGroupings(hI.leafs); // ... i raggruppamenti li devo fare lato client
4490
- }
4491
4498
  this.columnMetadata_H.reviewColumnsList(hI.leafs); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
4492
4499
  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.
4493
4500
  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)