@esfaenza/extensions 15.2.8 → 15.2.10

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.
@@ -1,6 +1,7 @@
1
1
  import { Type } from "@angular/core";
2
2
  import { LocalizationService } from "@esfaenza/localizations";
3
3
  import { DateService } from './extensions.dates.service';
4
+ import { UtilityService } from "./extensions.utilities.service";
4
5
  import { CsvHeaders } from "../models/CsvHeaders";
5
6
  import { GenericItem } from "../models/GenericItem";
6
7
  import * as i0 from "@angular/core";
@@ -113,12 +114,14 @@ export declare const ExportDictionary: (order: number, headernavigator: string,
113
114
  */
114
115
  export declare class ExportService {
115
116
  private dates;
117
+ private utiExts;
118
+ private lc;
116
119
  /**
117
120
  * Costruttore
118
121
  *
119
122
  * @ignore
120
123
  */
121
- constructor(dates: DateService);
124
+ constructor(dates: DateService, utiExts: UtilityService, lc: LocalizationService);
122
125
  /**
123
126
  * Data una lista di oggetti genera gli header per l'esportazione e integra ogni oggetto con le proprietà esportabili dalla libreria **@ctrl/ngx-csv**
124
127
  *
@@ -157,8 +160,6 @@ export declare class ExportService {
157
160
  * @returns {CsvHeaders[]} Header di esportazione già ordinati correttamente
158
161
  */
159
162
  private parseAndGetHeaders;
160
- /** Helper per ottenere il servizio di localizzazione relativo ad un'entità */
161
- private getLocalizationService;
162
163
  /**
163
164
  * Setup per l'esportazione di una singola proprietà.
164
165
  * Viene generato l'header e la proprietà relativa al valore formattato o no
@@ -225,6 +226,20 @@ export declare class ExportService {
225
226
  * @returns {any} Oggetti deserializzati
226
227
  */
227
228
  deserializeForExport(items: any[], type: any): any;
229
+ /**
230
+ * Effettua l'esportazione in file CSV
231
+ */
232
+ private exportCSV;
233
+ /** Cache del modulo per l'esportazione Excel */
234
+ private ExcelJS;
235
+ /** Effettua l'esportazione del file Excel basandosi sul modulo **ExcelJS**, sugli header **headers** e sui dati **data** */
236
+ private exportExcel;
237
+ /**
238
+ * Metodo che effettivamente genera gli header e i dati per l'esportazione con **ngx-csv**
239
+ *
240
+ * @param {any[]} items Oggetti da esportare
241
+ */
242
+ export(items: any[], format: 'CSV' | 'XLSX', fileName: string, columnsFilter: string[], genericHeaders?: CsvHeaders[]): void;
228
243
  static ɵfac: i0.ɵɵFactoryDeclaration<ExportService, never>;
229
244
  static ɵprov: i0.ɵɵInjectableDeclaration<ExportService>;
230
245
  }
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@esfaenza/extensions",
3
- "version": "15.2.8",
3
+ "version": "15.2.10",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
7
7
  "peerDependencies": {
8
- "@esfaenza/localizations": "^15.2.5",
8
+ "@esfaenza/localizations": "^15.2.10",
9
9
  "@angular/common": "^15.2.9",
10
10
  "@angular/core": "^15.2.9",
11
11
  "sweetalert2": "11.7.12",
12
12
  "ngx-toastr": "16.2.0",
13
13
  "dayjs": "1.11.8",
14
- "cerialize": "0.1.18"
14
+ "cerialize": "0.1.18",
15
+ "exceljs": "4.3.0",
16
+ "stream": "0.0.2"
15
17
  },
16
18
  "module": "fesm2015/esfaenza-extensions.mjs",
17
19
  "es2020": "fesm2020/esfaenza-extensions.mjs",