mapa-library-ui 2.11.0 → 2.13.0
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/README.md +3 -0
- package/docs/EXCEL_EXPORT.md +157 -0
- package/docs/TABLE_EXPORT.md +153 -0
- package/fesm2022/mapa-library-ui-src-lib-core-excel-export-excel-export.logo-DV7jykE5.mjs +5 -0
- package/fesm2022/mapa-library-ui-src-lib-core-excel-export-excel-export.logo-DV7jykE5.mjs.map +1 -0
- package/fesm2022/mapa-library-ui-src-lib-core-excel-export.mjs +790 -0
- package/fesm2022/mapa-library-ui-src-lib-core-excel-export.mjs.map +1 -0
- package/fesm2022/mapa-library-ui-src-lib-core-export.mjs +536 -0
- package/fesm2022/mapa-library-ui-src-lib-core-export.mjs.map +1 -0
- package/fesm2022/mapa-library-ui.mjs +17 -9
- package/fesm2022/mapa-library-ui.mjs.map +1 -1
- package/mapa-library-ui-2.13.0.tgz +0 -0
- package/package.json +38 -2
- package/src/lib/core/excel-export/index.d.ts +184 -0
- package/src/lib/core/export/index.d.ts +211 -0
- package/worker/excel-export.runtime.d.ts +4 -0
- package/worker/excel-export.runtime.js +76 -0
- package/worker/excel-export.worker.js +76 -0
- package/mapa-library-ui-2.11.0.tgz +0 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mapa-library-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^20.3.0",
|
|
6
6
|
"@angular/cdk": "^20.2.0",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"ngx-mat-select-search": "^8.0.4",
|
|
18
18
|
"ngxsmk-datepicker": "^3.0.0",
|
|
19
19
|
"rxjs": "^7.8.2",
|
|
20
|
-
"ts-md5": "^1.3.1"
|
|
20
|
+
"ts-md5": "^1.3.1",
|
|
21
|
+
"exceljs": "^4.4.0",
|
|
22
|
+
"@types/node": ">=20"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
25
|
"tslib": "^2.3.0"
|
|
@@ -204,6 +206,14 @@
|
|
|
204
206
|
"types": "./src/lib/components/warning/index.d.ts",
|
|
205
207
|
"default": "./fesm2022/mapa-library-ui-src-lib-components-warning.mjs"
|
|
206
208
|
},
|
|
209
|
+
"./excel-export": {
|
|
210
|
+
"types": "./src/lib/core/excel-export/index.d.ts",
|
|
211
|
+
"default": "./fesm2022/mapa-library-ui-src-lib-core-excel-export.mjs"
|
|
212
|
+
},
|
|
213
|
+
"./export": {
|
|
214
|
+
"types": "./src/lib/core/export/index.d.ts",
|
|
215
|
+
"default": "./fesm2022/mapa-library-ui-src-lib-core-export.mjs"
|
|
216
|
+
},
|
|
207
217
|
"./package.json": {
|
|
208
218
|
"default": "./package.json"
|
|
209
219
|
},
|
|
@@ -331,6 +341,14 @@
|
|
|
331
341
|
"types": "./src/lib/components/warning/index.d.ts",
|
|
332
342
|
"default": "./fesm2022/mapa-library-ui-src-lib-components-warning.mjs"
|
|
333
343
|
},
|
|
344
|
+
"./src/lib/core/excel-export": {
|
|
345
|
+
"types": "./src/lib/core/excel-export/index.d.ts",
|
|
346
|
+
"default": "./fesm2022/mapa-library-ui-src-lib-core-excel-export.mjs"
|
|
347
|
+
},
|
|
348
|
+
"./src/lib/core/export": {
|
|
349
|
+
"types": "./src/lib/core/export/index.d.ts",
|
|
350
|
+
"default": "./fesm2022/mapa-library-ui-src-lib-core-export.mjs"
|
|
351
|
+
},
|
|
334
352
|
"./src/lib/core/guards/authorize-guard": {
|
|
335
353
|
"types": "./src/lib/core/guards/authorize-guard/index.d.ts",
|
|
336
354
|
"default": "./fesm2022/mapa-library-ui-src-lib-core-guards-authorize-guard.mjs"
|
|
@@ -344,6 +362,24 @@
|
|
|
344
362
|
"default": "./fesm2022/mapa-library-ui-src-lib-core-utils.mjs"
|
|
345
363
|
}
|
|
346
364
|
},
|
|
365
|
+
"peerDependenciesMeta": {
|
|
366
|
+
"exceljs": {
|
|
367
|
+
"optional": true
|
|
368
|
+
},
|
|
369
|
+
"@types/node": {
|
|
370
|
+
"optional": true
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"typesVersions": {
|
|
374
|
+
"*": {
|
|
375
|
+
"excel-export": [
|
|
376
|
+
"src/lib/core/excel-export/index.d.ts"
|
|
377
|
+
],
|
|
378
|
+
"export": [
|
|
379
|
+
"src/lib/core/export/index.d.ts"
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
347
383
|
"module": "fesm2022/mapa-library-ui.mjs",
|
|
348
384
|
"typings": "index.d.ts"
|
|
349
385
|
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Worksheet, Workbook, Alignment } from 'exceljs';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
|
|
5
|
+
/** Cell dates use UTC calendar fields; normalize local UI instants with toExportDate. */
|
|
6
|
+
type ExcelScalar = string | number | boolean | Date | null | undefined;
|
|
7
|
+
type ExcelValue = ExcelScalar | {
|
|
8
|
+
formula: string;
|
|
9
|
+
result: ExcelScalar;
|
|
10
|
+
};
|
|
11
|
+
type ExcelStatusTone = 'ok' | 'info' | 'warning' | 'neutral' | 'danger';
|
|
12
|
+
interface ExcelContext {
|
|
13
|
+
module: string;
|
|
14
|
+
company: string;
|
|
15
|
+
user: string;
|
|
16
|
+
generatedAt: Date;
|
|
17
|
+
filters: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
interface ExcelIndicator {
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
operation: 'sum' | 'countIf' | 'sumIf';
|
|
23
|
+
criteria?: string | number;
|
|
24
|
+
numFmt?: string;
|
|
25
|
+
absolute?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface ExcelProgress {
|
|
28
|
+
phase: 'building' | 'serializing';
|
|
29
|
+
completed?: number;
|
|
30
|
+
total?: number;
|
|
31
|
+
}
|
|
32
|
+
interface ExcelColumn<TRow = Record<string, ExcelValue>> {
|
|
33
|
+
key?: string;
|
|
34
|
+
value?: (row: TRow, index: number) => ExcelValue;
|
|
35
|
+
label: string;
|
|
36
|
+
width?: number;
|
|
37
|
+
numFmt?: string;
|
|
38
|
+
total?: 'sum';
|
|
39
|
+
status?: readonly {
|
|
40
|
+
value: string;
|
|
41
|
+
tone: ExcelStatusTone;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
interface ExcelSheetRequest<TRow = Record<string, ExcelValue>> {
|
|
45
|
+
sheetName: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
columns: readonly ExcelColumn<TRow>[];
|
|
48
|
+
rows: readonly TRow[];
|
|
49
|
+
/** Already translated metadata. At most three lines above the table. */
|
|
50
|
+
metadata?: readonly string[];
|
|
51
|
+
context?: ExcelContext;
|
|
52
|
+
indicators?: readonly ExcelIndicator[];
|
|
53
|
+
mode?: 'mapa' | 'plain';
|
|
54
|
+
rowHeight?: number;
|
|
55
|
+
/** Called on the main thread after building this sheet. */
|
|
56
|
+
customize?: (sheet: Worksheet) => void | Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
interface ExcelWorkbookRequest<TRow = Record<string, ExcelValue>> {
|
|
59
|
+
fileName: string;
|
|
60
|
+
sheets: readonly ExcelSheetRequest<TRow>[];
|
|
61
|
+
creator?: string;
|
|
62
|
+
created?: Date;
|
|
63
|
+
customize?: (workbook: Workbook) => void | Promise<void>;
|
|
64
|
+
/** Cloneable extension interpreted by a consumer-owned worker. */
|
|
65
|
+
extension?: unknown;
|
|
66
|
+
}
|
|
67
|
+
interface ExcelExportOptions {
|
|
68
|
+
isCancelled?: () => boolean;
|
|
69
|
+
/** Angular consumers supply a worker compiled by their application builder. */
|
|
70
|
+
workerFactory?: () => Worker;
|
|
71
|
+
onProgress?: (progress: ExcelProgress) => void;
|
|
72
|
+
}
|
|
73
|
+
interface ExcelWorkerRequest {
|
|
74
|
+
request: ExcelWorkbookRequest;
|
|
75
|
+
format?: 'xlsx' | 'csv';
|
|
76
|
+
}
|
|
77
|
+
type ExcelWorkerResponse = {
|
|
78
|
+
buffer: ArrayBuffer;
|
|
79
|
+
} | {
|
|
80
|
+
error: string;
|
|
81
|
+
} | {
|
|
82
|
+
progress: ExcelProgress;
|
|
83
|
+
};
|
|
84
|
+
declare class ExcelExportCancelledError extends Error {
|
|
85
|
+
constructor();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare function excelFileName(value: string): string;
|
|
89
|
+
declare function excelFileNameWithDate(name: string, reference?: Date): string;
|
|
90
|
+
declare function fitExcelSheetTitle(title: string, maxLength: number): string;
|
|
91
|
+
declare function excelSheetName(value: string): string;
|
|
92
|
+
declare function uniqueExcelSheetNames(values: readonly string[]): string[];
|
|
93
|
+
|
|
94
|
+
declare const MAPA_EXCEL_COLORS: {
|
|
95
|
+
readonly orange: "FFFF560B";
|
|
96
|
+
readonly darkOrange: "FFD94021";
|
|
97
|
+
readonly pale: "FFFFEDE6";
|
|
98
|
+
readonly accent: "FFA8321A";
|
|
99
|
+
readonly ink: "FF162F42";
|
|
100
|
+
readonly text: "FF41566A";
|
|
101
|
+
readonly border: "FFDCE5E8";
|
|
102
|
+
readonly green: "FF065156";
|
|
103
|
+
readonly red: "FFB3341B";
|
|
104
|
+
};
|
|
105
|
+
declare const MAPA_EXCEL_STATUS_COLORS: {
|
|
106
|
+
readonly ok: {
|
|
107
|
+
readonly background: "FFDDF1F2";
|
|
108
|
+
readonly text: "FF065156";
|
|
109
|
+
};
|
|
110
|
+
readonly info: {
|
|
111
|
+
readonly background: "FFE4EEF0";
|
|
112
|
+
readonly text: "FF162F42";
|
|
113
|
+
};
|
|
114
|
+
readonly warning: {
|
|
115
|
+
readonly background: "FFFFF4C7";
|
|
116
|
+
readonly text: "FF6E4A00";
|
|
117
|
+
};
|
|
118
|
+
readonly neutral: {
|
|
119
|
+
readonly background: "FFEEF1F3";
|
|
120
|
+
readonly text: "FF4F5F6B";
|
|
121
|
+
};
|
|
122
|
+
readonly danger: {
|
|
123
|
+
readonly background: "FFFDE9E4";
|
|
124
|
+
readonly text: "FFB3341B";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
declare function fillExcelCell(sheet: Worksheet, row: number, col: number, color: string): void;
|
|
128
|
+
/** The two banner geometries used by the original MF reports. */
|
|
129
|
+
declare function applyMapaExcelBanner(sheet: Worksheet, options: {
|
|
130
|
+
columnCount: number;
|
|
131
|
+
logoId: number;
|
|
132
|
+
title: string;
|
|
133
|
+
titleEndColumn?: number;
|
|
134
|
+
rowHeights?: readonly number[];
|
|
135
|
+
titleAlignment?: Partial<Alignment>;
|
|
136
|
+
absoluteLogo?: boolean;
|
|
137
|
+
}): void;
|
|
138
|
+
declare function styleMapaExcelHeaderCell(sheet: Worksheet, row: number, col: number, headerRow?: number): void;
|
|
139
|
+
|
|
140
|
+
declare function resolveWorkbookConstructor(module: {
|
|
141
|
+
Workbook?: typeof Workbook;
|
|
142
|
+
default?: {
|
|
143
|
+
Workbook?: typeof Workbook;
|
|
144
|
+
};
|
|
145
|
+
}): typeof Workbook;
|
|
146
|
+
declare function createExcelWorkbook(): Promise<Workbook>;
|
|
147
|
+
declare function addMapaExcelLogo(book: Workbook): Promise<number>;
|
|
148
|
+
/** Adds a table to an existing workbook; no domain or HTTP dependencies. */
|
|
149
|
+
declare function addExcelTable<TRow>(book: Workbook, request: ExcelSheetRequest<TRow>, options?: {
|
|
150
|
+
logoId?: number;
|
|
151
|
+
isCancelled?: () => boolean;
|
|
152
|
+
onProgress?: (progress: ExcelProgress) => void;
|
|
153
|
+
}): Promise<Worksheet>;
|
|
154
|
+
declare function buildExcelWorkbook<TRow>(request: ExcelWorkbookRequest<TRow>, isCancelled?: () => boolean, onProgress?: (progress: ExcelProgress) => void): Promise<Workbook>;
|
|
155
|
+
declare function serializeExcelWorkbook(book: Workbook): Promise<ArrayBuffer>;
|
|
156
|
+
/** May be called from a consumer-owned module worker. Functions cannot be cloned. */
|
|
157
|
+
declare function serializeExcelRequest(request: ExcelWorkbookRequest, onProgress?: (progress: ExcelProgress) => void): Promise<ArrayBuffer>;
|
|
158
|
+
|
|
159
|
+
declare class MapaExcelExportService {
|
|
160
|
+
createWorkbook(): Promise<Workbook>;
|
|
161
|
+
buildWorkbook<TRow>(request: ExcelWorkbookRequest<TRow>, isCancelled?: () => boolean): Promise<Workbook>;
|
|
162
|
+
serialize(book: Workbook): Promise<ArrayBuffer>;
|
|
163
|
+
exportTable<TRow>(request: ExcelSheetRequest<TRow> & {
|
|
164
|
+
fileName: string;
|
|
165
|
+
}, options?: ExcelExportOptions): Promise<void>;
|
|
166
|
+
exportWorkbook<TRow>(request: ExcelWorkbookRequest<TRow>, options?: ExcelExportOptions): Promise<void>;
|
|
167
|
+
generateWorkbook<TRow>(request: ExcelWorkbookRequest<TRow>, options?: ExcelExportOptions): Promise<ArrayBuffer>;
|
|
168
|
+
generateCsv(request: ExcelWorkbookRequest, options: ExcelExportOptions): Promise<ArrayBuffer>;
|
|
169
|
+
save(book: Workbook, fileName: string, isCancelled?: () => boolean): Promise<void>;
|
|
170
|
+
download(buffer: ArrayBuffer, fileName: string): void;
|
|
171
|
+
private serializeInWorker;
|
|
172
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapaExcelExportService, never>;
|
|
173
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MapaExcelExportService>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* A remote's worker URL can have a different origin from the shell. Bootstrap
|
|
178
|
+
* through a local blob, then import the self-contained module with normal CORS.
|
|
179
|
+
* Keep the local name `Worker` at the call site so Angular recognizes the URL.
|
|
180
|
+
*/
|
|
181
|
+
declare function getExcelWorkerConstructor(): typeof Worker;
|
|
182
|
+
|
|
183
|
+
export { ExcelExportCancelledError, MAPA_EXCEL_COLORS, MAPA_EXCEL_STATUS_COLORS, MapaExcelExportService, addExcelTable, addMapaExcelLogo, applyMapaExcelBanner, buildExcelWorkbook, createExcelWorkbook, excelFileName, excelFileNameWithDate, excelSheetName, fillExcelCell, fitExcelSheetTitle, getExcelWorkerConstructor, resolveWorkbookConstructor, serializeExcelRequest, serializeExcelWorkbook, styleMapaExcelHeaderCell, uniqueExcelSheetNames };
|
|
184
|
+
export type { ExcelColumn, ExcelContext, ExcelExportOptions, ExcelIndicator, ExcelProgress, ExcelScalar, ExcelSheetRequest, ExcelStatusTone, ExcelValue, ExcelWorkbookRequest, ExcelWorkerRequest, ExcelWorkerResponse };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Worksheet } from 'exceljs';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken } from '@angular/core';
|
|
5
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
6
|
+
import { HttpContextToken } from '@angular/common/http';
|
|
7
|
+
|
|
8
|
+
/** Cell dates use UTC calendar fields; normalize local UI instants with toExportDate. */
|
|
9
|
+
type ExcelScalar = string | number | boolean | Date | null | undefined;
|
|
10
|
+
type ExcelValue = ExcelScalar | {
|
|
11
|
+
formula: string;
|
|
12
|
+
result: ExcelScalar;
|
|
13
|
+
};
|
|
14
|
+
type ExcelStatusTone = 'ok' | 'info' | 'warning' | 'neutral' | 'danger';
|
|
15
|
+
interface ExcelContext {
|
|
16
|
+
module: string;
|
|
17
|
+
company: string;
|
|
18
|
+
user: string;
|
|
19
|
+
generatedAt: Date;
|
|
20
|
+
filters: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
interface ExcelIndicator {
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
operation: 'sum' | 'countIf' | 'sumIf';
|
|
26
|
+
criteria?: string | number;
|
|
27
|
+
numFmt?: string;
|
|
28
|
+
absolute?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface ExcelColumn<TRow = Record<string, ExcelValue>> {
|
|
31
|
+
key?: string;
|
|
32
|
+
value?: (row: TRow, index: number) => ExcelValue;
|
|
33
|
+
label: string;
|
|
34
|
+
width?: number;
|
|
35
|
+
numFmt?: string;
|
|
36
|
+
total?: 'sum';
|
|
37
|
+
status?: readonly {
|
|
38
|
+
value: string;
|
|
39
|
+
tone: ExcelStatusTone;
|
|
40
|
+
}[];
|
|
41
|
+
}
|
|
42
|
+
interface ExcelSheetRequest<TRow = Record<string, ExcelValue>> {
|
|
43
|
+
sheetName: string;
|
|
44
|
+
title?: string;
|
|
45
|
+
columns: readonly ExcelColumn<TRow>[];
|
|
46
|
+
rows: readonly TRow[];
|
|
47
|
+
/** Already translated metadata. At most three lines above the table. */
|
|
48
|
+
metadata?: readonly string[];
|
|
49
|
+
context?: ExcelContext;
|
|
50
|
+
indicators?: readonly ExcelIndicator[];
|
|
51
|
+
mode?: 'mapa' | 'plain';
|
|
52
|
+
rowHeight?: number;
|
|
53
|
+
/** Called on the main thread after building this sheet. */
|
|
54
|
+
customize?: (sheet: Worksheet) => void | Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type ExportRow$1 = Record<string, ExcelValue>;
|
|
58
|
+
type ExportFormat = 'xlsx' | 'csv';
|
|
59
|
+
type ExportScope = 'all' | 'selected';
|
|
60
|
+
interface ExportColumn extends ExcelColumn<ExportRow$1> {
|
|
61
|
+
key: string;
|
|
62
|
+
visible?: boolean;
|
|
63
|
+
exportable?: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface ExportLoadContext {
|
|
66
|
+
signal: AbortSignal;
|
|
67
|
+
generatedAt?: Date;
|
|
68
|
+
scope: ExportScope;
|
|
69
|
+
onProgress: (completed: number, total?: number) => void;
|
|
70
|
+
}
|
|
71
|
+
interface ExportDataset {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
sheetName?: string;
|
|
75
|
+
columns: readonly ExportColumn[];
|
|
76
|
+
totalCount: number;
|
|
77
|
+
rows?: readonly ExportRow$1[];
|
|
78
|
+
selectedRows?: readonly ExportRow$1[];
|
|
79
|
+
selectable?: boolean;
|
|
80
|
+
indicators?: readonly ExcelIndicator[];
|
|
81
|
+
load?: (context: ExportLoadContext) => Promise<readonly ExportRow$1[]>;
|
|
82
|
+
}
|
|
83
|
+
interface ExportChoices {
|
|
84
|
+
format: ExportFormat;
|
|
85
|
+
scope: ExportScope;
|
|
86
|
+
visibleOnly: boolean;
|
|
87
|
+
datasetIds: readonly string[];
|
|
88
|
+
}
|
|
89
|
+
interface ExportPreparedContent {
|
|
90
|
+
sheets: ExcelSheetRequest<ExportRow$1>[];
|
|
91
|
+
/** Cloneable payload interpreted exclusively by a consumer-owned worker. */
|
|
92
|
+
extension?: unknown;
|
|
93
|
+
}
|
|
94
|
+
interface ExportRequest {
|
|
95
|
+
listing: string;
|
|
96
|
+
allRecordsDescription?: string;
|
|
97
|
+
context: Omit<ExcelContext, 'generatedAt'>;
|
|
98
|
+
datasets: readonly ExportDataset[];
|
|
99
|
+
initialScope?: ExportScope;
|
|
100
|
+
workerFactory?: () => Worker;
|
|
101
|
+
/** For domain reports that prepare several related sheets atomically. */
|
|
102
|
+
prepare?: (choices: ExportChoices, context: ExportLoadContext) => Promise<ExportPreparedContent>;
|
|
103
|
+
}
|
|
104
|
+
interface ExportProgress {
|
|
105
|
+
phase: 'fetching' | 'building' | 'serializing';
|
|
106
|
+
completed?: number;
|
|
107
|
+
total?: number;
|
|
108
|
+
part?: number;
|
|
109
|
+
parts?: number;
|
|
110
|
+
}
|
|
111
|
+
interface ExportFile {
|
|
112
|
+
name: string;
|
|
113
|
+
mime: string;
|
|
114
|
+
buffer: ArrayBuffer;
|
|
115
|
+
}
|
|
116
|
+
interface ExportTask {
|
|
117
|
+
id: string;
|
|
118
|
+
title: string;
|
|
119
|
+
state: 'queued' | 'running' | 'ready' | 'cancelled' | 'error';
|
|
120
|
+
progress?: ExportProgress;
|
|
121
|
+
background: boolean;
|
|
122
|
+
files: readonly ExportFile[];
|
|
123
|
+
recordCount?: number;
|
|
124
|
+
error?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type ExportRow = Record<string, ExcelValue>;
|
|
128
|
+
declare const EXPORT_FILE_ROW_LIMIT = 100000;
|
|
129
|
+
/** Encode browser-local calendar fields for timezone-free Excel and CSV cells. */
|
|
130
|
+
declare function toExportDate(value: Date): Date;
|
|
131
|
+
declare const exportSlug: (value: string) => string;
|
|
132
|
+
declare function exportFileBase(listing: string, company: string, date: Date): string;
|
|
133
|
+
/** Greedy packing preserves dataset order and counts records across all sheets. */
|
|
134
|
+
declare function splitExportSheets(sheets: readonly ExcelSheetRequest<ExportRow>[], limit?: number): ExcelSheetRequest<ExportRow>[][];
|
|
135
|
+
declare function encodeExportCsv(sheet: ExcelSheetRequest<ExportRow>, onProgress?: (completed: number, total: number) => void): ArrayBuffer;
|
|
136
|
+
interface ExportPage<TRow> {
|
|
137
|
+
data: readonly TRow[];
|
|
138
|
+
totalCount: number;
|
|
139
|
+
pageSize: number;
|
|
140
|
+
pageIndex?: number;
|
|
141
|
+
}
|
|
142
|
+
/** HTTP and domain adaptation remain in load; this helper verifies completeness. */
|
|
143
|
+
declare function collectExportPages<TRow>(options: {
|
|
144
|
+
totalCount: number;
|
|
145
|
+
load: (pageIndex: number, pageSize: number, signal: AbortSignal) => Promise<ExportPage<TRow>>;
|
|
146
|
+
key: (row: TRow) => string;
|
|
147
|
+
signal: AbortSignal;
|
|
148
|
+
onProgress?: (completed: number, total: number) => void;
|
|
149
|
+
}): Promise<TRow[]>;
|
|
150
|
+
|
|
151
|
+
declare const MAPA_EXPORT_WORKER_FACTORY: InjectionToken<() => Worker>;
|
|
152
|
+
declare function snapshotExportRequest(request: ExportRequest): ExportRequest;
|
|
153
|
+
declare class MapaExportJobsService {
|
|
154
|
+
private readonly excel;
|
|
155
|
+
private readonly defaultWorker;
|
|
156
|
+
private readonly state;
|
|
157
|
+
readonly tasks: i0.Signal<readonly ExportTask[]>;
|
|
158
|
+
private readonly pending;
|
|
159
|
+
private readonly controllers;
|
|
160
|
+
private draining;
|
|
161
|
+
enqueue(request: ExportRequest, choices: ExportChoices): string;
|
|
162
|
+
cancel(id: string): void;
|
|
163
|
+
remove(id: string): void;
|
|
164
|
+
clear(): void;
|
|
165
|
+
retry(id: string): void;
|
|
166
|
+
download(file: ExportFile): void;
|
|
167
|
+
private patch;
|
|
168
|
+
private drain;
|
|
169
|
+
private run;
|
|
170
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapaExportJobsService, never>;
|
|
171
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MapaExportJobsService>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare class MapaExportDialogComponent {
|
|
175
|
+
readonly request: ExportRequest;
|
|
176
|
+
readonly dialog: MatDialogRef<any, any>;
|
|
177
|
+
private readonly jobs;
|
|
178
|
+
readonly selectable: boolean;
|
|
179
|
+
readonly selectedCount: number;
|
|
180
|
+
readonly total: number;
|
|
181
|
+
readonly hasHiddenColumns: boolean;
|
|
182
|
+
readonly choices: ExportChoices;
|
|
183
|
+
error: string;
|
|
184
|
+
get fileName(): string;
|
|
185
|
+
toggleDataset(id: string, checked: boolean): void;
|
|
186
|
+
generate(): void;
|
|
187
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapaExportDialogComponent, never>;
|
|
188
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MapaExportDialogComponent, "mapa-export-dialog", never, {}, {}, never, never, true, never>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare class MapaExportDialogService {
|
|
192
|
+
private readonly dialog;
|
|
193
|
+
private ref?;
|
|
194
|
+
open(request: ExportRequest): MatDialogRef<MapaExportDialogComponent, string>;
|
|
195
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapaExportDialogService, never>;
|
|
196
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MapaExportDialogService>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare class MapaExportJobsComponent {
|
|
200
|
+
readonly jobs: MapaExportJobsService;
|
|
201
|
+
percent(task: ExportTask): number | null;
|
|
202
|
+
phase(task: ExportTask): string;
|
|
203
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapaExportJobsComponent, never>;
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MapaExportJobsComponent, "mapa-export-jobs", never, {}, {}, never, never, true, never>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Lets a host keep export requests out of its blocking, global loading overlay. */
|
|
208
|
+
declare const MAPA_EXPORT_BACKGROUND_REQUEST: HttpContextToken<boolean>;
|
|
209
|
+
|
|
210
|
+
export { EXPORT_FILE_ROW_LIMIT, MAPA_EXPORT_BACKGROUND_REQUEST, MAPA_EXPORT_WORKER_FACTORY, MapaExportDialogService, MapaExportJobsComponent, MapaExportJobsService, collectExportPages, encodeExportCsv, exportFileBase, exportSlug, snapshotExportRequest, splitExportSheets, toExportDate };
|
|
211
|
+
export type { ExportChoices, ExportColumn, ExportDataset, ExportFile, ExportFormat, ExportLoadContext, ExportPage, ExportPreparedContent, ExportProgress, ExportRequest, ExportRow$1 as ExportRow, ExportScope, ExportTask };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createExcelWorkbook, buildExcelWorkbook, addExcelTable, addMapaExcelLogo, serializeExcelWorkbook, serializeExcelRequest, resolveWorkbookConstructor, applyMapaExcelBanner, fillExcelCell, styleMapaExcelHeaderCell, MAPA_EXCEL_COLORS, MAPA_EXCEL_STATUS_COLORS, excelFileName, excelFileNameWithDate, excelSheetName, fitExcelSheetTitle, uniqueExcelSheetNames, ExcelExportCancelledError } from '../src/lib/core/excel-export/index';
|
|
2
|
+
export type { ExcelWorkbookRequest, ExcelSheetRequest, ExcelColumn, ExcelContext, ExcelIndicator, ExcelValue, ExcelProgress, ExcelWorkerRequest, ExcelWorkerResponse } from '../src/lib/core/excel-export/index';
|
|
3
|
+
export declare function encodeExportCsv(sheet: import('../src/lib/core/excel-export/index').ExcelSheetRequest): ArrayBuffer;
|
|
4
|
+
export declare function registerExcelExportWorker(compose?: (book: import('exceljs').Workbook, request: import('../src/lib/core/excel-export/index').ExcelWorkbookRequest, progress: (progress: import('../src/lib/core/excel-export/index').ExcelProgress) => void) => Promise<void> | void): void;
|