@slickgrid-universal/excel-export 5.14.0 → 9.0.2

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,563 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExcelExportService = void 0;
4
- const excel_builder_vanilla_1 = require("excel-builder-vanilla");
5
- const common_1 = require("@slickgrid-universal/common");
6
- const utils_1 = require("@slickgrid-universal/utils");
7
- const excelUtils_js_1 = require("./excelUtils.js");
8
- const DEFAULT_EXPORT_OPTIONS = {
9
- filename: 'export',
10
- format: common_1.FileType.xlsx,
11
- };
12
- class ExcelExportService {
13
- constructor() {
14
- this._fileFormat = common_1.FileType.xlsx;
15
- this._columnHeaders = [];
16
- this._hasColumnTitlePreHeader = false;
17
- this._hasGroupedItems = false;
18
- this._pubSubService = null;
19
- // references of each detected cell and/or group total formats
20
- this._regularCellExcelFormats = {};
21
- this._groupTotalExcelFormats = {};
22
- /** ExcelExportService class name which is use to find service instance in the external registered services */
23
- this.className = 'ExcelExportService';
24
- }
25
- get _datasetIdPropName() {
26
- return this._gridOptions?.datasetIdPropertyName ?? 'id';
27
- }
28
- /** Getter of SlickGrid DataView object */
29
- get _dataView() {
30
- return this._grid?.getData();
31
- }
32
- /** Getter for the Grid Options pulled through the Grid Object */
33
- get _gridOptions() {
34
- return this._grid?.getOptions() || {};
35
- }
36
- get stylesheet() {
37
- return this._stylesheet;
38
- }
39
- get stylesheetFormats() {
40
- return this._stylesheetFormats;
41
- }
42
- get groupTotalExcelFormats() {
43
- return this._groupTotalExcelFormats;
44
- }
45
- get regularCellExcelFormats() {
46
- return this._regularCellExcelFormats;
47
- }
48
- dispose() {
49
- this._pubSubService?.unsubscribeAll();
50
- }
51
- /**
52
- * Initialize the Export Service
53
- * @param grid
54
- * @param containerService
55
- */
56
- init(grid, containerService) {
57
- this._grid = grid;
58
- this._pubSubService = containerService.get('PubSubService');
59
- // get locales provided by user in main file or else use default English locales via the Constants
60
- this._locales = this._gridOptions?.locales ?? common_1.Constants.locales;
61
- this._translaterService = this._gridOptions?.translater;
62
- if (this._gridOptions.enableTranslate && (!this._translaterService || !this._translaterService.translate)) {
63
- throw new Error('[Slickgrid-Universal] requires a Translate Service to be passed in the "translater" Grid Options when "enableTranslate" is enabled. (example: this.gridOptions = { enableTranslate: true, translater: this.translaterService })');
64
- }
65
- }
66
- /**
67
- * Function to export the Grid result to an Excel CSV format using javascript for it to produce the CSV file.
68
- * This is a WYSIWYG export to file output (What You See is What You Get)
69
- *
70
- * NOTES: The column position needs to match perfectly the JSON Object position because of the way we are pulling the data,
71
- * which means that if any column(s) got moved in the UI, it has to be reflected in the JSON array output as well
72
- *
73
- * Example: exportToExcel({ format: FileType.csv, delimiter: DelimiterType.comma })
74
- */
75
- exportToExcel(options) {
76
- if (!this._grid || !this._dataView || !this._pubSubService) {
77
- throw new Error('[Slickgrid-Universal] it seems that the SlickGrid & DataView objects and/or PubSubService are not initialized did you forget to enable the grid option flag "enableExcelExport"?');
78
- }
79
- this._pubSubService?.publish(`onBeforeExportToExcel`, true);
80
- this._excelExportOptions = (0, utils_1.extend)(true, {}, { ...DEFAULT_EXPORT_OPTIONS, ...this._gridOptions.excelExportOptions, ...options });
81
- this._fileFormat = this._excelExportOptions.format || common_1.FileType.xlsx;
82
- // reset references of detected Excel formats
83
- this._regularCellExcelFormats = {};
84
- this._groupTotalExcelFormats = {};
85
- // wrap in a Promise so that we can add loading spinner
86
- return new Promise((resolve) => {
87
- // prepare the Excel Workbook & Sheet
88
- const worksheetOptions = { name: this._excelExportOptions.sheetName || 'Sheet1' };
89
- this._workbook = new excel_builder_vanilla_1.Workbook();
90
- this._sheet = this._workbook.createWorksheet(worksheetOptions);
91
- // add any Excel Format/Stylesheet to current Workbook
92
- this._stylesheet = this._workbook.getStyleSheet();
93
- // create some common default Excel formatters that will be used
94
- const boldFormat = this._stylesheet.createFormat({ font: { bold: true } });
95
- const stringFormat = this._stylesheet.createFormat({ format: '@' });
96
- const numberFormat = this._stylesheet.createFormat({ format: '0' });
97
- this._stylesheetFormats = { boldFormat, numberFormat, stringFormat };
98
- this._sheet.setColumnFormats([boldFormat]);
99
- // get all data by reading all DataView rows
100
- const dataOutput = this.getDataOutput();
101
- // trigger a download file
102
- // wrap it into a setTimeout so that the EventAggregator has enough time to start a pre-process like showing a spinner
103
- window.setTimeout(async () => {
104
- if (this._gridOptions?.excelExportOptions?.customExcelHeader) {
105
- this._gridOptions.excelExportOptions.customExcelHeader(this._workbook, this._sheet);
106
- }
107
- const columns = this._grid?.getColumns() || [];
108
- this._sheet.setColumns(this.getColumnStyles(columns));
109
- const currentSheetData = this._sheet.data;
110
- let finalOutput = currentSheetData;
111
- if (Array.isArray(currentSheetData) && Array.isArray(dataOutput)) {
112
- finalOutput = this._sheet.data.concat(dataOutput);
113
- }
114
- this._sheet.setData(finalOutput);
115
- this._workbook.addWorksheet(this._sheet);
116
- // MIME type could be undefined, if that's the case we'll detect the type by its file extension
117
- // user could also provide its own mime type, if however an empty string is provided we will consider to be without any MIME type)
118
- let mimeType = this._excelExportOptions?.mimeType;
119
- if (mimeType === undefined) {
120
- mimeType =
121
- this._fileFormat === common_1.FileType.xls
122
- ? 'application/vnd.ms-excel'
123
- : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
124
- }
125
- const filename = `${this._excelExportOptions.filename}.${this._fileFormat}`;
126
- (0, excel_builder_vanilla_1.downloadExcelFile)(this._workbook, filename, { mimeType }).then(() => {
127
- this._pubSubService?.publish(`onAfterExportToExcel`, { filename, mimeType });
128
- resolve(true);
129
- });
130
- });
131
- });
132
- }
133
- /**
134
- * Takes a positive integer and returns the corresponding column name.
135
- * dealing with the Excel column position is a bit tricky since the first 26 columns are single char (A,B,...) but after that it becomes double char (AA,AB,...)
136
- * so we must first see if we are in the first section of 26 chars, if that is the case we just concatenate 1 (1st row) so it becomes (A1, B1, ...)
137
- * and again if we go 26, we need to add yet again an extra prefix (AA1, AB1, ...) and so goes the cycle
138
- * @param {number} colIndex - The positive integer to convert to a column name.
139
- * @return {string} The column name.
140
- */
141
- getExcelColumnNameByIndex(colIndex) {
142
- const letters = 'ZABCDEFGHIJKLMNOPQRSTUVWXY';
143
- let nextPos = Math.floor(colIndex / 26);
144
- const lastPos = Math.floor(colIndex % 26);
145
- if (lastPos === 0) {
146
- nextPos--;
147
- }
148
- if (colIndex > 26) {
149
- return this.getExcelColumnNameByIndex(nextPos) + letters[lastPos];
150
- }
151
- return letters[lastPos] + '';
152
- }
153
- // -----------------------
154
- // protected functions
155
- // -----------------------
156
- getDataOutput() {
157
- const columns = this._grid?.getColumns() || [];
158
- // data variable which will hold all the fields data of a row
159
- const outputData = [];
160
- const gridExportOptions = this._gridOptions?.excelExportOptions;
161
- const columnHeaderStyle = gridExportOptions?.columnHeaderStyle;
162
- let columnHeaderStyleId = this._stylesheetFormats.boldFormat.id;
163
- if (columnHeaderStyle) {
164
- columnHeaderStyleId = this._stylesheet.createFormat(columnHeaderStyle).id;
165
- }
166
- // get all Grouped Column Header Titles when defined (from pre-header row)
167
- if (this._gridOptions.createPreHeaderPanel && this._gridOptions.showPreHeaderPanel && !this._gridOptions.enableDraggableGrouping) {
168
- // when having Grouped Header Titles (in the pre-header), then make the cell Bold & Aligned Center
169
- const boldCenterAlign = this._stylesheet.createFormat({ alignment: { horizontal: 'center' }, font: { bold: true } });
170
- outputData.push(this.getColumnGroupedHeaderTitlesData(columns, { style: boldCenterAlign?.id }));
171
- this._hasColumnTitlePreHeader = true;
172
- }
173
- // get all Column Header Titles (it might include a "Group by" title at A1 cell)
174
- // also style the headers, defaults to Bold but user could pass his own style
175
- outputData.push(this.getColumnHeaderData(columns, { style: columnHeaderStyleId }));
176
- // Populate the rest of the Grid Data
177
- this.pushAllGridRowDataToArray(outputData, columns);
178
- return outputData;
179
- }
180
- /** Get each column style including a style for the width of each column */
181
- getColumnStyles(columns) {
182
- const grouping = this._dataView.getGrouping();
183
- const columnStyles = [];
184
- if (Array.isArray(grouping) && grouping.length > 0) {
185
- columnStyles.push({
186
- bestFit: true,
187
- columnStyles: this._gridOptions?.excelExportOptions?.customColumnWidth ?? 10,
188
- });
189
- }
190
- columns.forEach((columnDef) => {
191
- const skippedField = columnDef.excludeFromExport ?? false;
192
- // if column width is 0, then we consider that field as a hidden field and should not be part of the export
193
- if ((columnDef.width === undefined || columnDef.width > 0) && !skippedField) {
194
- columnStyles.push({
195
- bestFit: true,
196
- width: columnDef.excelExportOptions?.width ?? this._gridOptions?.excelExportOptions?.customColumnWidth ?? 10,
197
- });
198
- }
199
- });
200
- return columnStyles;
201
- }
202
- /**
203
- * Get all Grouped Header Titles and their keys, translate the title when required, and format them in Bold
204
- * @param {Array<Object>} columns - grid column definitions
205
- * @param {Object} metadata - Excel metadata
206
- * @returns {Object} array of Excel cell format
207
- */
208
- getColumnGroupedHeaderTitlesData(columns, metadata) {
209
- let outputGroupedHeaderTitles = [];
210
- // get all Column Header Titles
211
- this._groupedColumnHeaders = this.getColumnGroupedHeaderTitles(columns) || [];
212
- if (this._groupedColumnHeaders && Array.isArray(this._groupedColumnHeaders) && this._groupedColumnHeaders.length > 0) {
213
- // add the header row + add a new line at the end of the row
214
- outputGroupedHeaderTitles = this._groupedColumnHeaders.map((header) => ({ value: header.title, metadata }));
215
- }
216
- // merge necessary cells (any grouped header titles)
217
- let colspanStartIndex = 0;
218
- const headersLn = this._groupedColumnHeaders.length;
219
- for (let cellIndex = 0; cellIndex < headersLn; cellIndex++) {
220
- if (cellIndex + 1 === headersLn ||
221
- (cellIndex + 1 < headersLn && this._groupedColumnHeaders[cellIndex].title !== this._groupedColumnHeaders[cellIndex + 1].title)) {
222
- const leftExcelColumnChar = this.getExcelColumnNameByIndex(colspanStartIndex + 1);
223
- const rightExcelColumnChar = this.getExcelColumnNameByIndex(cellIndex + 1);
224
- this._sheet.mergeCells(`${leftExcelColumnChar}1`, `${rightExcelColumnChar}1`);
225
- // next group starts 1 column index away
226
- colspanStartIndex = cellIndex + 1;
227
- }
228
- }
229
- return outputGroupedHeaderTitles;
230
- }
231
- /** Get all column headers and format them in Bold */
232
- getColumnHeaderData(columns, metadata) {
233
- let outputHeaderTitles = [];
234
- // get all Column Header Titles
235
- this._columnHeaders = this.getColumnHeaders(columns) || [];
236
- if (this._columnHeaders && Array.isArray(this._columnHeaders) && this._columnHeaders.length > 0) {
237
- // add the header row + add a new line at the end of the row
238
- outputHeaderTitles = this._columnHeaders.map((header) => ({ value: (0, utils_1.stripTags)(header.title), metadata }));
239
- }
240
- // do we have a Group by title?
241
- const groupTitle = this.getGroupColumnTitle();
242
- if (groupTitle) {
243
- outputHeaderTitles.unshift({ value: groupTitle, metadata });
244
- }
245
- return outputHeaderTitles;
246
- }
247
- getGroupColumnTitle() {
248
- // Group By text, it could be set in the export options or from translation or if nothing is found then use the English constant text
249
- let groupByColumnHeader = this._excelExportOptions.groupingColumnHeaderTitle;
250
- if (!groupByColumnHeader && this._gridOptions.enableTranslate && this._translaterService?.translate) {
251
- groupByColumnHeader = this._translaterService.translate(`${(0, common_1.getTranslationPrefix)(this._gridOptions)}GROUP_BY`);
252
- }
253
- else if (!groupByColumnHeader) {
254
- groupByColumnHeader = this._locales?.TEXT_GROUP_BY;
255
- }
256
- // get grouped column titles and if found, we will add a "Group by" column at the first column index
257
- // if it's a CSV format, we'll escape the text in double quotes
258
- const grouping = this._dataView.getGrouping();
259
- if (Array.isArray(grouping) && grouping.length > 0) {
260
- this._hasGroupedItems = true;
261
- return groupByColumnHeader;
262
- }
263
- else {
264
- this._hasGroupedItems = false;
265
- }
266
- return null;
267
- }
268
- /**
269
- * Get all Grouped Header Titles and their keys, translate the title when required.
270
- * @param {Array<object>} columns of the grid
271
- */
272
- getColumnGroupedHeaderTitles(columns) {
273
- const groupedColumnHeaders = [];
274
- if (Array.isArray(columns)) {
275
- // Populate the Grouped Column Header, pull the columnGroup(Key) defined
276
- columns.forEach((columnDef) => {
277
- let groupedHeaderTitle = '';
278
- if (columnDef.columnGroupKey && this._gridOptions.enableTranslate && this._translaterService?.translate) {
279
- groupedHeaderTitle = this._translaterService.translate(columnDef.columnGroupKey);
280
- }
281
- else {
282
- groupedHeaderTitle = columnDef.columnGroup || '';
283
- }
284
- const skippedField = columnDef.excludeFromExport || false;
285
- // if column width is 0px, then we consider that field as a hidden field and should not be part of the export
286
- if ((columnDef.width === undefined || columnDef.width > 0) && !skippedField) {
287
- groupedColumnHeaders.push({
288
- key: (columnDef.field || columnDef.id),
289
- title: groupedHeaderTitle || '',
290
- });
291
- }
292
- });
293
- }
294
- return groupedColumnHeaders;
295
- }
296
- /**
297
- * Get all header titles and their keys, translate the title when required.
298
- * @param {Array<object>} columns of the grid
299
- */
300
- getColumnHeaders(columns) {
301
- const columnHeaders = [];
302
- if (Array.isArray(columns)) {
303
- // Populate the Column Header, pull the name defined
304
- columns.forEach((columnDef) => {
305
- let headerTitle = '';
306
- if ((columnDef.nameKey || columnDef.nameKey) && this._gridOptions.enableTranslate && this._translaterService?.translate) {
307
- headerTitle = this._translaterService.translate(columnDef.nameKey || columnDef.nameKey);
308
- }
309
- else {
310
- headerTitle = (0, utils_1.getHtmlStringOutput)(columnDef.name || '', 'innerHTML') || (0, utils_1.titleCase)(columnDef.field);
311
- }
312
- const skippedField = columnDef.excludeFromExport || false;
313
- // if column width is 0, then we consider that field as a hidden field and should not be part of the export
314
- if ((columnDef.width === undefined || columnDef.width > 0) && !skippedField) {
315
- columnHeaders.push({
316
- key: (columnDef.field || columnDef.id) + '',
317
- title: headerTitle,
318
- });
319
- }
320
- });
321
- }
322
- return columnHeaders;
323
- }
324
- /**
325
- * Get all the grid row data and return that as an output string
326
- */
327
- pushAllGridRowDataToArray(originalDaraArray, columns) {
328
- const lineCount = this._dataView.getLength();
329
- // loop through all the grid rows of data
330
- for (let rowNumber = 0; rowNumber < lineCount; rowNumber++) {
331
- const itemObj = this._dataView.getItem(rowNumber);
332
- // make sure we have a filled object AND that the item doesn't include the "getItem" method
333
- // this happen could happen with an opened Row Detail as it seems to include an empty Slick DataView (we'll just skip those lines)
334
- if (itemObj && !itemObj.hasOwnProperty('getItem')) {
335
- // Normal row (not grouped by anything) would have an ID which was predefined in the Grid Columns definition
336
- if (itemObj[this._datasetIdPropName] !== null && itemObj[this._datasetIdPropName] !== undefined) {
337
- // get regular row item data
338
- originalDaraArray.push(this.readRegularRowData(columns, rowNumber, itemObj, rowNumber));
339
- }
340
- else if (this._hasGroupedItems && itemObj.__groupTotals === undefined) {
341
- // get the group row
342
- originalDaraArray.push([this.readGroupedRowTitle(itemObj)]);
343
- }
344
- else if (itemObj.__groupTotals) {
345
- // else if the row is a Group By and we have agreggators, then a property of '__groupTotals' would exist under that object
346
- originalDaraArray.push(this.readGroupedTotalRows(columns, itemObj, rowNumber));
347
- }
348
- }
349
- }
350
- return originalDaraArray;
351
- }
352
- /**
353
- * Get the data of a regular row (a row without grouping)
354
- * @param {Array<Object>} columns - column definitions
355
- * @param {Number} row - row index
356
- * @param {Object} itemObj - item datacontext object
357
- */
358
- readRegularRowData(columns, row, itemObj, dataRowIdx) {
359
- let idx = 0;
360
- const rowOutputStrings = [];
361
- const columnsLn = columns.length;
362
- let prevColspan = 1;
363
- let colspanStartIndex = 0;
364
- const itemMetadata = this._dataView.getItemMetadata(row);
365
- for (let col = 0; col < columnsLn; col++) {
366
- const columnDef = columns[col];
367
- // skip excluded column
368
- if (columnDef.excludeFromExport) {
369
- continue;
370
- }
371
- // if we are grouping and are on 1st column index, we need to skip this column since it will be used later by the grouping text:: Group by [columnX]
372
- if (this._hasGroupedItems && idx === 0) {
373
- rowOutputStrings.push('');
374
- }
375
- // when using rowspan
376
- let rowspan = 1;
377
- if (this._gridOptions.enableCellRowSpan) {
378
- const prs = this._grid.getParentRowSpanByCell(row, col, false);
379
- if (prs) {
380
- if (prs.start === row) {
381
- rowspan = prs.end - prs.start + 1;
382
- }
383
- else {
384
- // skip any rowspan child cell since it was already merged
385
- rowOutputStrings.push('');
386
- continue;
387
- }
388
- }
389
- }
390
- // when using colspan (it could be a number or a "*" when spreading the entire row)
391
- let colspan = 1;
392
- let colspanColumnId;
393
- if (itemMetadata?.columns) {
394
- const metadata = itemMetadata.columns;
395
- const columnData = metadata[columnDef.id] || metadata[col];
396
- if (!((!isNaN(prevColspan) && +prevColspan > 1) || (prevColspan === '*' && col > 0))) {
397
- prevColspan = columnData?.colspan ?? 1;
398
- }
399
- if (prevColspan === '*') {
400
- colspan = columns.length - col;
401
- }
402
- else {
403
- colspan = prevColspan;
404
- if (columnDef.id in metadata || col in metadata) {
405
- colspanColumnId = columnDef.id;
406
- colspanStartIndex = col;
407
- }
408
- }
409
- }
410
- // when using grid with rowspan without any colspan, we will merge some cells on single column
411
- if (rowspan > 1 && !isNaN(prevColspan) && +prevColspan === 1 && columnDef.id === colspanColumnId) {
412
- // -- Merge Data RowSpan only
413
- // Excel row starts at 2 or at 3 when dealing with pre-header grouping
414
- const excelRowNumber = row + (this._hasColumnTitlePreHeader ? 3 : 2);
415
- const leftExcelColumnChar = this.getExcelColumnNameByIndex(col + 1);
416
- const rightExcelColumnChar = this.getExcelColumnNameByIndex(col + 1);
417
- this._sheet.mergeCells(`${leftExcelColumnChar}${excelRowNumber}`, `${rightExcelColumnChar}${excelRowNumber + rowspan - 1}`);
418
- }
419
- // when using grid with colspan, we will merge some cells together
420
- if ((prevColspan === '*' && col > 0) || (!isNaN(prevColspan) && +prevColspan > 1 && columnDef.id !== colspanColumnId)) {
421
- // -- Merge Data, ColSpan and maybe RowSpan
422
- // Excel row starts at 2 or at 3 when dealing with pre-header grouping
423
- const excelRowNumber = row + (this._hasColumnTitlePreHeader ? 3 : 2);
424
- if (typeof prevColspan === 'number' && colspan - 1 === 1) {
425
- // partial column span
426
- const leftExcelColumnChar = this.getExcelColumnNameByIndex(colspanStartIndex + 1);
427
- const rightExcelColumnChar = this.getExcelColumnNameByIndex(col + 1);
428
- this._sheet.mergeCells(`${leftExcelColumnChar}${excelRowNumber}`, `${rightExcelColumnChar}${excelRowNumber + rowspan - 1}`);
429
- rowOutputStrings.push(''); // clear cell that won't be shown by a cell merge
430
- }
431
- else if (prevColspan === '*' && colspan === 1) {
432
- // full column span (from A1 until the last column)
433
- const rightExcelColumnChar = this.getExcelColumnNameByIndex(col + 1);
434
- this._sheet.mergeCells(`A${excelRowNumber}`, `${rightExcelColumnChar}${excelRowNumber + rowspan - 1}`);
435
- }
436
- else {
437
- rowOutputStrings.push(''); // clear cell that won't be shown by a cell merge
438
- }
439
- // decrement colspan until we reach colspan of 1 then proceed with cell merge OR full row merge when colspan is (*)
440
- if (typeof prevColspan === 'number' && !isNaN(prevColspan) && +prevColspan > 1) {
441
- colspan = prevColspan--;
442
- }
443
- }
444
- else {
445
- let itemData = '';
446
- const fieldType = (0, common_1.getColumnFieldType)(columnDef);
447
- // -- Read Data & Push to Data Array
448
- // user might want to export with Formatter, and/or auto-detect Excel format, and/or export as regular cell data
449
- // for column that are Date type, we'll always export with their associated Date Formatters unless `exportWithFormatter` is specifically set to false
450
- const exportOptions = { ...this._excelExportOptions };
451
- if (columnDef.exportWithFormatter !== false && (0, common_1.isColumnDateType)(fieldType)) {
452
- exportOptions.exportWithFormatter = true;
453
- }
454
- itemData = (0, common_1.exportWithFormatterWhenDefined)(row, col, columnDef, itemObj, this._grid, exportOptions);
455
- // auto-detect best possible Excel format, unless the user provide his own formatting,
456
- // we only do this check once per column (everything after that will be pull from temp ref)
457
- if (!this._regularCellExcelFormats.hasOwnProperty(columnDef.id)) {
458
- const autoDetectCellFormat = columnDef.excelExportOptions?.autoDetectCellFormat ?? this._excelExportOptions?.autoDetectCellFormat;
459
- const cellStyleFormat = (0, excelUtils_js_1.useCellFormatByFieldType)(this._stylesheet, this._stylesheetFormats, columnDef, this._grid, autoDetectCellFormat);
460
- // user could also override style and/or valueParserCallback
461
- if (columnDef.excelExportOptions?.style) {
462
- cellStyleFormat.excelFormatId = this._stylesheet.createFormat(columnDef.excelExportOptions.style).id;
463
- }
464
- if (columnDef.excelExportOptions?.valueParserCallback) {
465
- cellStyleFormat.getDataValueParser = columnDef.excelExportOptions.valueParserCallback;
466
- }
467
- this._regularCellExcelFormats[columnDef.id] = cellStyleFormat;
468
- }
469
- // sanitize early, when enabled, any HTML tags (remove HTML tags)
470
- if (typeof itemData === 'string' && (columnDef.sanitizeDataExport || this._excelExportOptions.sanitizeDataExport)) {
471
- itemData = (0, utils_1.stripTags)(itemData);
472
- }
473
- const { excelFormatId, getDataValueParser } = this._regularCellExcelFormats[columnDef.id];
474
- itemData = getDataValueParser(itemData, {
475
- columnDef,
476
- excelFormatId,
477
- stylesheet: this._stylesheet,
478
- gridOptions: this._gridOptions,
479
- dataRowIdx,
480
- dataContext: itemObj,
481
- });
482
- rowOutputStrings.push(itemData);
483
- idx++;
484
- }
485
- }
486
- return rowOutputStrings;
487
- }
488
- /**
489
- * Get the grouped title(s) and its group title formatter, for example if we grouped by salesRep, the returned result would be:: 'Sales Rep: John Dow (2 items)'
490
- * @param itemObj
491
- */
492
- readGroupedRowTitle(itemObj) {
493
- const groupName = (0, utils_1.stripTags)(itemObj.title);
494
- if (this._excelExportOptions?.addGroupIndentation) {
495
- const collapsedSymbol = this._excelExportOptions?.groupCollapsedSymbol || '⮞';
496
- const expandedSymbol = this._excelExportOptions?.groupExpandedSymbol || '⮟';
497
- const chevron = itemObj.collapsed ? collapsedSymbol : expandedSymbol;
498
- return chevron + ' ' + (0, utils_1.addWhiteSpaces)(5 * itemObj.level) + groupName;
499
- }
500
- return groupName;
501
- }
502
- /**
503
- * Get the grouped totals (below the regular rows), these are set by Slick Aggregators.
504
- * For example if we grouped by "salesRep" and we have a Sum Aggregator on "sales", then the returned output would be:: ["Sum 123$"]
505
- * @param itemObj
506
- */
507
- readGroupedTotalRows(columns, itemObj, dataRowIdx) {
508
- const groupingAggregatorRowText = this._excelExportOptions.groupingAggregatorRowText || '';
509
- const outputStrings = [groupingAggregatorRowText];
510
- columns.forEach((columnDef) => {
511
- let itemData = '';
512
- const fieldType = (0, common_1.getColumnFieldType)(columnDef);
513
- const skippedField = columnDef.excludeFromExport || false;
514
- // if there's a exportCustomGroupTotalsFormatter or groupTotalsFormatter, we will re-run it to get the exact same output as what is shown in UI
515
- if (columnDef.exportCustomGroupTotalsFormatter) {
516
- const totalResult = columnDef.exportCustomGroupTotalsFormatter(itemObj, columnDef, this._grid);
517
- itemData = totalResult instanceof HTMLElement ? totalResult.textContent || '' : totalResult;
518
- }
519
- // auto-detect best possible Excel format for Group Totals, unless the user provide his own formatting,
520
- // we only do this check once per column (everything after that will be pull from temp ref)
521
- const autoDetectCellFormat = columnDef.excelExportOptions?.autoDetectCellFormat ?? this._excelExportOptions?.autoDetectCellFormat;
522
- if (fieldType === common_1.FieldType.number && autoDetectCellFormat !== false) {
523
- let groupCellFormat = this._groupTotalExcelFormats[columnDef.id];
524
- if (!groupCellFormat?.groupType) {
525
- groupCellFormat = (0, excelUtils_js_1.getExcelFormatFromGridFormatter)(this._stylesheet, this._stylesheetFormats, columnDef, this._grid, 'group');
526
- if (columnDef.groupTotalsExcelExportOptions?.style) {
527
- groupCellFormat.excelFormat = this._stylesheet.createFormat(columnDef.groupTotalsExcelExportOptions.style);
528
- }
529
- this._groupTotalExcelFormats[columnDef.id] = groupCellFormat;
530
- }
531
- const groupTotalParser = columnDef.groupTotalsExcelExportOptions?.valueParserCallback ?? excelUtils_js_1.getGroupTotalValue;
532
- if (itemObj[groupCellFormat.groupType]?.[columnDef.field] !== undefined) {
533
- const groupData = groupTotalParser(itemObj, {
534
- columnDef,
535
- groupType: groupCellFormat.groupType,
536
- excelFormatId: groupCellFormat.excelFormat?.id,
537
- stylesheet: this._stylesheet,
538
- dataRowIdx,
539
- });
540
- itemData =
541
- typeof groupData === 'object' && groupData.hasOwnProperty('metadata')
542
- ? groupData
543
- : (itemData = { value: groupData, metadata: { style: groupCellFormat.excelFormat?.id } });
544
- }
545
- }
546
- else if (columnDef.groupTotalsFormatter) {
547
- const totalResult = columnDef.groupTotalsFormatter(itemObj, columnDef, this._grid);
548
- itemData = totalResult instanceof HTMLElement ? totalResult.textContent || '' : totalResult;
549
- }
550
- // does the user want to sanitize the output data (remove HTML tags)?
551
- if (typeof itemData === 'string' && (columnDef.sanitizeDataExport || this._excelExportOptions.sanitizeDataExport)) {
552
- itemData = (0, utils_1.stripTags)(itemData);
553
- }
554
- // add the column (unless user wants to skip it)
555
- if ((columnDef.width === undefined || columnDef.width > 0) && !skippedField) {
556
- outputStrings.push(itemData);
557
- }
558
- });
559
- return outputStrings;
560
- }
561
- }
562
- exports.ExcelExportService = ExcelExportService;
563
- //# sourceMappingURL=excelExport.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"excelExport.service.js","sourceRoot":"","sources":["../../src/excelExport.service.ts"],"names":[],"mappings":";;;AAAA,iEAO+B;AAkB/B,wDASqC;AACrC,sDAA+G;AAE/G,mDAAqI;AAErI,MAAM,sBAAsB,GAAsB;IAChD,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,iBAAQ,CAAC,IAAI;CACtB,CAAC;AAEF,MAAa,kBAAkB;IAA/B;QACY,gBAAW,GAA8B,iBAAQ,CAAC,IAAI,CAAC;QAIvD,mBAAc,GAAwB,EAAE,CAAC;QACzC,6BAAwB,GAAG,KAAK,CAAC;QACjC,qBAAgB,GAAG,KAAK,CAAC;QAKzB,mBAAc,GAAyB,IAAI,CAAC;QAItD,8DAA8D;QACpD,6BAAwB,GAE9B,EAAE,CAAC;QACG,4BAAuB,GAE7B,EAAE,CAAC;QAEP,8GAA8G;QACrG,cAAS,GAAG,oBAAoB,CAAC;IA+mB5C,CAAC;IA7mBC,IAAc,kBAAkB;QAC9B,OAAO,IAAI,CAAC,YAAY,EAAE,qBAAqB,IAAI,IAAI,CAAC;IAC1D,CAAC;IAED,0CAA0C;IAC1C,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO,EAAiB,CAAC;IAC9C,CAAC;IAED,iEAAiE;IACjE,IAAc,YAAY;QACxB,OAAO,IAAI,CAAC,K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