igniteui-angular 14.2.0-alpha.3 → 14.2.0-alpha.4
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.
- package/esm2020/lib/core/setImmediate.mjs +1 -1
- package/esm2020/lib/core/utils.mjs +2 -2
- package/esm2020/lib/grids/grid-public-row.mjs +2 -2
- package/esm2020/lib/grids/row.directive.mjs +2 -2
- package/esm2020/lib/services/excel/excel-exporter.mjs +12 -13
- package/esm2020/lib/services/excel/excel-files.mjs +14 -13
- package/esm2020/lib/services/excel/excel-interfaces.mjs +1 -1
- package/fesm2015/igniteui-angular.mjs +24 -25
- package/fesm2015/igniteui-angular.mjs.map +1 -1
- package/fesm2020/igniteui-angular.mjs +24 -25
- package/fesm2020/igniteui-angular.mjs.map +1 -1
- package/lib/core/setImmediate.d.ts +8 -3
- package/lib/services/excel/excel-exporter.d.ts +2 -5
- package/lib/services/excel/excel-files.d.ts +12 -13
- package/lib/services/excel/excel-interfaces.d.ts +1 -2
- package/package.json +3 -3
- package/schematics/ng-add/index.spec.js +1 -1
- package/schematics/tsconfig.tsbuildinfo +1 -1
- package/schematics/utils/dependency-handler.js +2 -2
|
@@ -8,8 +8,8 @@ import * as i1$1 from '@angular/common';
|
|
|
8
8
|
import { isPlatformBrowser, formatDate as formatDate$1, CurrencyPipe, formatPercent, formatNumber, getLocaleCurrencyCode, DatePipe, DOCUMENT, CommonModule, FormatWidth, getLocaleDateFormat, getLocaleFirstDayOfWeek, getLocaleCurrencySymbol, formatCurrency as formatCurrency$1, getLocaleNumberFormat, NumberFormatStyle, getCurrencySymbol } from '@angular/common';
|
|
9
9
|
import { Observable, Subject, fromEvent, interval, animationFrameScheduler, noop, merge, Subscription, timer, pipe } from 'rxjs';
|
|
10
10
|
import { takeUntil, filter, first as first$1, throttleTime, take, throttle, startWith, debounce, tap, switchMap, skipLast, map, debounceTime, shareReplay, takeWhile, pluck } from 'rxjs/operators';
|
|
11
|
-
import mergeWith from 'lodash
|
|
12
|
-
import
|
|
11
|
+
import { mergeWith } from 'lodash-es';
|
|
12
|
+
import { strToU8, zip } from 'fflate';
|
|
13
13
|
import * as i1$2 from '@angular/platform-browser';
|
|
14
14
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, ɵgetDOM } from '@angular/platform-browser';
|
|
15
15
|
import * as i2 from '@angular/common/http';
|
|
@@ -4331,7 +4331,7 @@ ExcelStrings.SHARED_STRING_RELATIONSHIP = '<Relationship Id="rId4" Type="http://
|
|
|
4331
4331
|
*/
|
|
4332
4332
|
class RootRelsFile {
|
|
4333
4333
|
writeElement(folder) {
|
|
4334
|
-
folder
|
|
4334
|
+
folder['.rels'] = strToU8(ExcelStrings.getRels());
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
/**
|
|
@@ -4339,7 +4339,7 @@ class RootRelsFile {
|
|
|
4339
4339
|
*/
|
|
4340
4340
|
class AppFile {
|
|
4341
4341
|
writeElement(folder, worksheetData) {
|
|
4342
|
-
folder
|
|
4342
|
+
folder['app.xml'] = strToU8(ExcelStrings.getApp(worksheetData.options.worksheetName));
|
|
4343
4343
|
}
|
|
4344
4344
|
}
|
|
4345
4345
|
/**
|
|
@@ -4347,7 +4347,7 @@ class AppFile {
|
|
|
4347
4347
|
*/
|
|
4348
4348
|
class CoreFile {
|
|
4349
4349
|
writeElement(folder) {
|
|
4350
|
-
folder
|
|
4350
|
+
folder['core.xml'] = strToU8(ExcelStrings.getCore());
|
|
4351
4351
|
}
|
|
4352
4352
|
}
|
|
4353
4353
|
/**
|
|
@@ -4356,7 +4356,7 @@ class CoreFile {
|
|
|
4356
4356
|
class WorkbookRelsFile {
|
|
4357
4357
|
writeElement(folder, worksheetData) {
|
|
4358
4358
|
const hasSharedStrings = !worksheetData.isEmpty || worksheetData.options.alwaysExportHeaders;
|
|
4359
|
-
folder
|
|
4359
|
+
folder['workbook.xml.rels'] = strToU8(ExcelStrings.getWorkbookRels(hasSharedStrings));
|
|
4360
4360
|
}
|
|
4361
4361
|
}
|
|
4362
4362
|
/**
|
|
@@ -4364,7 +4364,7 @@ class WorkbookRelsFile {
|
|
|
4364
4364
|
*/
|
|
4365
4365
|
class ThemeFile {
|
|
4366
4366
|
writeElement(folder) {
|
|
4367
|
-
folder
|
|
4367
|
+
folder['theme1.xml'] = strToU8(ExcelStrings.getTheme());
|
|
4368
4368
|
}
|
|
4369
4369
|
}
|
|
4370
4370
|
/**
|
|
@@ -4386,7 +4386,7 @@ class WorksheetFile {
|
|
|
4386
4386
|
this.prepareDataAsync(worksheetData, (cols, rows) => {
|
|
4387
4387
|
const hasTable = (!worksheetData.isEmpty || worksheetData.options.alwaysExportHeaders)
|
|
4388
4388
|
&& worksheetData.options.exportAsTable;
|
|
4389
|
-
folder
|
|
4389
|
+
folder['sheet1.xml'] = strToU8(ExcelStrings.getSheetXML(this.dimension, this.freezePane, cols, rows, hasTable, this.maxOutlineLevel, worksheetData.isHierarchical));
|
|
4390
4390
|
resolve();
|
|
4391
4391
|
});
|
|
4392
4392
|
});
|
|
@@ -4643,7 +4643,7 @@ WorksheetFile.MIN_WIDTH = 8.43;
|
|
|
4643
4643
|
*/
|
|
4644
4644
|
class StyleFile {
|
|
4645
4645
|
writeElement(folder) {
|
|
4646
|
-
folder
|
|
4646
|
+
folder['styles.xml'] = strToU8(ExcelStrings.getStyles());
|
|
4647
4647
|
}
|
|
4648
4648
|
}
|
|
4649
4649
|
/**
|
|
@@ -4651,7 +4651,7 @@ class StyleFile {
|
|
|
4651
4651
|
*/
|
|
4652
4652
|
class WorkbookFile {
|
|
4653
4653
|
writeElement(folder, worksheetData) {
|
|
4654
|
-
folder
|
|
4654
|
+
folder['workbook.xml'] = strToU8(ExcelStrings.getWorkbook(worksheetData.options.worksheetName));
|
|
4655
4655
|
}
|
|
4656
4656
|
}
|
|
4657
4657
|
/**
|
|
@@ -4660,7 +4660,7 @@ class WorkbookFile {
|
|
|
4660
4660
|
class ContentTypesFile {
|
|
4661
4661
|
writeElement(folder, worksheetData) {
|
|
4662
4662
|
const hasSharedStrings = !worksheetData.isEmpty || worksheetData.options.alwaysExportHeaders;
|
|
4663
|
-
folder
|
|
4663
|
+
folder['[Content_Types].xml'] = strToU8(ExcelStrings.getContentTypesXML(hasSharedStrings, worksheetData.options.exportAsTable));
|
|
4664
4664
|
}
|
|
4665
4665
|
}
|
|
4666
4666
|
/**
|
|
@@ -4674,7 +4674,7 @@ class SharedStringsFile {
|
|
|
4674
4674
|
for (const value of sortedValues) {
|
|
4675
4675
|
sharedStrings[dict.getSanitizedValue(value)] = '<si><t>' + value + '</t></si>';
|
|
4676
4676
|
}
|
|
4677
|
-
folder
|
|
4677
|
+
folder['sharedStrings.xml'] = strToU8(ExcelStrings.getSharedStringXML(dict.stringsCount, sortedValues.length, sharedStrings.join('')));
|
|
4678
4678
|
}
|
|
4679
4679
|
}
|
|
4680
4680
|
/**
|
|
@@ -4709,7 +4709,7 @@ class TablesFile {
|
|
|
4709
4709
|
const dir = sortingExpression.dir - 1;
|
|
4710
4710
|
sortString = `<sortState ref="A2:${lastColumn}"><sortCondition descending="${dir}" ref="${sc}1:${sc}15"/></sortState>`;
|
|
4711
4711
|
}
|
|
4712
|
-
folder
|
|
4712
|
+
folder['table1.xml'] = strToU8(ExcelStrings.getTablesXML(autoFilterDimension, tableDimension, tableColumns, sortString));
|
|
4713
4713
|
}
|
|
4714
4714
|
}
|
|
4715
4715
|
/**
|
|
@@ -4717,7 +4717,7 @@ class TablesFile {
|
|
|
4717
4717
|
*/
|
|
4718
4718
|
class WorksheetRelsFile {
|
|
4719
4719
|
writeElement(folder) {
|
|
4720
|
-
folder
|
|
4720
|
+
folder['sheet1.xml.rels'] = strToU8(ExcelStrings.getWorksheetRels());
|
|
4721
4721
|
}
|
|
4722
4722
|
}
|
|
4723
4723
|
|
|
@@ -5099,19 +5099,19 @@ class IgxExcelExporterService extends IgxBaseExporter {
|
|
|
5099
5099
|
*/
|
|
5100
5100
|
this.exportEnded = new EventEmitter();
|
|
5101
5101
|
}
|
|
5102
|
-
static async
|
|
5102
|
+
static async populateZipFileConfig(fileStructure, folder, worksheetData) {
|
|
5103
5103
|
for (const childFolder of folder.childFolders(worksheetData)) {
|
|
5104
5104
|
const folderInstance = ExcelElementsFactory.getExcelFolder(childFolder);
|
|
5105
|
-
const
|
|
5106
|
-
await IgxExcelExporterService.
|
|
5105
|
+
const childStructure = fileStructure[folderInstance.folderName] = {};
|
|
5106
|
+
await IgxExcelExporterService.populateZipFileConfig(childStructure, folderInstance, worksheetData);
|
|
5107
5107
|
}
|
|
5108
5108
|
for (const childFile of folder.childFiles(worksheetData)) {
|
|
5109
5109
|
const fileInstance = ExcelElementsFactory.getExcelFile(childFile);
|
|
5110
5110
|
if (fileInstance instanceof WorksheetFile) {
|
|
5111
|
-
await fileInstance.writeElementAsync(
|
|
5111
|
+
await fileInstance.writeElementAsync(fileStructure, worksheetData);
|
|
5112
5112
|
}
|
|
5113
5113
|
else {
|
|
5114
|
-
fileInstance.writeElement(
|
|
5114
|
+
fileInstance.writeElement(fileStructure, worksheetData);
|
|
5115
5115
|
}
|
|
5116
5116
|
}
|
|
5117
5117
|
}
|
|
@@ -5162,25 +5162,24 @@ class IgxExcelExporterService extends IgxBaseExporter {
|
|
|
5162
5162
|
columnCount = defaultOwner.columns.filter(col => !col.skip && col.headerType === HeaderType.ColumnHeader).length;
|
|
5163
5163
|
}
|
|
5164
5164
|
const worksheetData = new WorksheetData(data, options, this._sort, columnCount, rootKeys, indexOfLastPinnedColumn, columnWidths, defaultOwner, this._ownersMap);
|
|
5165
|
-
this._xlsx = typeof JSZip.default === 'function' ? new JSZip.default() : new JSZip();
|
|
5166
5165
|
const rootFolder = ExcelElementsFactory.getExcelFolder(ExcelFolderTypes.RootExcelFolder);
|
|
5167
|
-
|
|
5166
|
+
const fileData = {};
|
|
5167
|
+
IgxExcelExporterService.populateZipFileConfig(fileData, rootFolder, worksheetData)
|
|
5168
5168
|
.then(() => {
|
|
5169
|
-
|
|
5169
|
+
zip(fileData, (_, result) => {
|
|
5170
5170
|
this.saveFile(result, options.fileName);
|
|
5171
|
-
this.exportEnded.emit({ xlsx:
|
|
5171
|
+
this.exportEnded.emit({ xlsx: fileData });
|
|
5172
5172
|
done();
|
|
5173
5173
|
});
|
|
5174
5174
|
});
|
|
5175
5175
|
}
|
|
5176
5176
|
saveFile(data, fileName) {
|
|
5177
|
-
const blob = new Blob([
|
|
5177
|
+
const blob = new Blob([data], {
|
|
5178
5178
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
5179
5179
|
});
|
|
5180
5180
|
ExportUtilities.saveBlobToFile(blob, fileName);
|
|
5181
5181
|
}
|
|
5182
5182
|
}
|
|
5183
|
-
IgxExcelExporterService.ZIP_OPTIONS = { compression: 'DEFLATE', type: 'base64' };
|
|
5184
5183
|
IgxExcelExporterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: IgxExcelExporterService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
5185
5184
|
IgxExcelExporterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: IgxExcelExporterService, providedIn: 'root' });
|
|
5186
5185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: IgxExcelExporterService, decorators: [{
|