excellentexport 3.9.2 → 3.9.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/README.md +23 -6
- package/dist/excellentexport.d.ts +45 -43
- package/dist/excellentexport.js +1 -1
- package/dist/format.d.ts +30 -30
- package/dist/utils.d.ts +30 -30
- package/package.json +16 -17
- package/src/excellentexport.ts +16 -4
- package/dist/index.d.ts +0 -3
- package/src/index.ts +0 -4
package/dist/format.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export declare enum CellTypes {
|
|
2
|
-
TEXT = "s",
|
|
3
|
-
NUMBER = "n",
|
|
4
|
-
DATE = "d",
|
|
5
|
-
BOOLEAN = "b"
|
|
6
|
-
}
|
|
7
|
-
export declare enum CellPatterns {
|
|
8
|
-
INTEGER = "0",
|
|
9
|
-
DECIMAL = "0.00",
|
|
10
|
-
DATE = "dd/mm/yyyy",
|
|
11
|
-
TIME = "hh:mm:ss",
|
|
12
|
-
DATETIME = "dd/mm/yyyy hh:mm:ss",
|
|
13
|
-
CURRENCY = "[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00",
|
|
14
|
-
PERCENTAGE = "0.00%",
|
|
15
|
-
EXPONENT = "0.00E+00",
|
|
16
|
-
TEXT = "@"
|
|
17
|
-
}
|
|
18
|
-
export type CellType = 's' | 'n' | 'd' | 'b';
|
|
19
|
-
export interface CellFormat {
|
|
20
|
-
type: CellType;
|
|
21
|
-
pattern?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface CellFormats {
|
|
24
|
-
[key: string]: CellFormat;
|
|
25
|
-
}
|
|
26
|
-
export declare const PredefinedFormat: CellFormats;
|
|
27
|
-
export interface FormatDefinition {
|
|
28
|
-
range: string;
|
|
29
|
-
format?: CellFormat;
|
|
30
|
-
}
|
|
1
|
+
export declare enum CellTypes {
|
|
2
|
+
TEXT = "s",
|
|
3
|
+
NUMBER = "n",
|
|
4
|
+
DATE = "d",
|
|
5
|
+
BOOLEAN = "b"
|
|
6
|
+
}
|
|
7
|
+
export declare enum CellPatterns {
|
|
8
|
+
INTEGER = "0",
|
|
9
|
+
DECIMAL = "0.00",
|
|
10
|
+
DATE = "dd/mm/yyyy",
|
|
11
|
+
TIME = "hh:mm:ss",
|
|
12
|
+
DATETIME = "dd/mm/yyyy hh:mm:ss",
|
|
13
|
+
CURRENCY = "[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00",
|
|
14
|
+
PERCENTAGE = "0.00%",
|
|
15
|
+
EXPONENT = "0.00E+00",
|
|
16
|
+
TEXT = "@"
|
|
17
|
+
}
|
|
18
|
+
export type CellType = 's' | 'n' | 'd' | 'b';
|
|
19
|
+
export interface CellFormat {
|
|
20
|
+
type: CellType;
|
|
21
|
+
pattern?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CellFormats {
|
|
24
|
+
[key: string]: CellFormat;
|
|
25
|
+
}
|
|
26
|
+
export declare const PredefinedFormat: CellFormats;
|
|
27
|
+
export interface FormatDefinition {
|
|
28
|
+
range: string;
|
|
29
|
+
format?: CellFormat;
|
|
30
|
+
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
export declare const b64toBlob: (b64Data: string, contentType: string, sliceSize?: number) => Blob;
|
|
2
|
-
export declare const templates: {
|
|
3
|
-
excel: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Convert a string to Base64.
|
|
7
|
-
*/
|
|
8
|
-
export declare const base64: (s: string) => string;
|
|
9
|
-
export declare const format: (s: string, context: any) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Get element by ID.
|
|
12
|
-
* @param {*} element
|
|
13
|
-
*/
|
|
14
|
-
export declare const getTable: (element: (HTMLTableElement | string)) => HTMLTableElement;
|
|
15
|
-
/**
|
|
16
|
-
* Get element by ID.
|
|
17
|
-
* @param {*} element
|
|
18
|
-
*/
|
|
19
|
-
export declare const getAnchor: (element: (HTMLAnchorElement | string)) => HTMLAnchorElement;
|
|
20
|
-
/**
|
|
21
|
-
* Encode a value for CSV.
|
|
22
|
-
* @param {*} value
|
|
23
|
-
*/
|
|
24
|
-
export declare const fixCSVField: (value: string, csvDelimiter: string) => string;
|
|
25
|
-
export declare const tableToArray: (table: HTMLTableElement) => any[][];
|
|
26
|
-
export declare const tableToCSV: (table: HTMLTableElement, csvDelimiter?: string, csvNewLine?: string) => string;
|
|
27
|
-
export declare const createDownloadLink: (anchor: HTMLAnchorElement, base64data: string, exporttype: string, filename: string) => boolean;
|
|
28
|
-
export declare const string2ArrayBuffer: (s: string) => ArrayBuffer;
|
|
29
|
-
export declare const removeColumns: (dataArray: any[][], columnIndexes: number[]) => void;
|
|
30
|
-
export declare const hasContent: (value: any) => boolean;
|
|
1
|
+
export declare const b64toBlob: (b64Data: string, contentType: string, sliceSize?: number) => Blob;
|
|
2
|
+
export declare const templates: {
|
|
3
|
+
excel: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Convert a string to Base64.
|
|
7
|
+
*/
|
|
8
|
+
export declare const base64: (s: string) => string;
|
|
9
|
+
export declare const format: (s: string, context: any) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get element by ID.
|
|
12
|
+
* @param {*} element
|
|
13
|
+
*/
|
|
14
|
+
export declare const getTable: (element: (HTMLTableElement | string)) => HTMLTableElement;
|
|
15
|
+
/**
|
|
16
|
+
* Get element by ID.
|
|
17
|
+
* @param {*} element
|
|
18
|
+
*/
|
|
19
|
+
export declare const getAnchor: (element: (HTMLAnchorElement | string)) => HTMLAnchorElement;
|
|
20
|
+
/**
|
|
21
|
+
* Encode a value for CSV.
|
|
22
|
+
* @param {*} value
|
|
23
|
+
*/
|
|
24
|
+
export declare const fixCSVField: (value: string, csvDelimiter: string) => string;
|
|
25
|
+
export declare const tableToArray: (table: HTMLTableElement) => any[][];
|
|
26
|
+
export declare const tableToCSV: (table: HTMLTableElement, csvDelimiter?: string, csvNewLine?: string) => string;
|
|
27
|
+
export declare const createDownloadLink: (anchor: HTMLAnchorElement, base64data: string, exporttype: string, filename: string) => boolean;
|
|
28
|
+
export declare const string2ArrayBuffer: (s: string) => ArrayBuffer;
|
|
29
|
+
export declare const removeColumns: (dataArray: any[][], columnIndexes: number[]) => void;
|
|
30
|
+
export declare const hasContent: (value: any) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "excellentexport",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.4",
|
|
4
4
|
"description": "Client side JavaScript export to Excel or CSV",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "http://jordiburgos.com",
|
|
@@ -26,32 +26,31 @@
|
|
|
26
26
|
"watch": "jest --watch"
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/excellentexport.js",
|
|
29
|
-
"types": "dist/index.d.ts",
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@babel/core": "7.
|
|
30
|
+
"@babel/core": "7.21.4",
|
|
32
31
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
33
|
-
"@babel/plugin-transform-flow-strip-types": "7.
|
|
34
|
-
"@babel/preset-env": "7.
|
|
35
|
-
"@types/jest": "29.
|
|
32
|
+
"@babel/plugin-transform-flow-strip-types": "7.21.0",
|
|
33
|
+
"@babel/preset-env": "7.21.4",
|
|
34
|
+
"@types/jest": "29.5.1",
|
|
36
35
|
"@types/jest-environment-puppeteer": "5.0.3",
|
|
37
|
-
"@types/node": "18.13
|
|
36
|
+
"@types/node": "18.15.13",
|
|
38
37
|
"babel-loader": "9.1.2",
|
|
39
38
|
"blob-polyfill": "7.0.20220408",
|
|
40
39
|
"coveralls": "3.1.1",
|
|
41
40
|
"cross-env": "7.0.3",
|
|
42
41
|
"html-loader": "4.2.0",
|
|
43
|
-
"jest": "29.
|
|
44
|
-
"jest-environment-jsdom": "^29.
|
|
45
|
-
"jest-puppeteer": "
|
|
46
|
-
"puppeteer": "19.
|
|
47
|
-
"ts-jest": "29.0
|
|
42
|
+
"jest": "29.5.0",
|
|
43
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
44
|
+
"jest-puppeteer": "8.0.6",
|
|
45
|
+
"puppeteer": "19.10.1",
|
|
46
|
+
"ts-jest": "29.1.0",
|
|
48
47
|
"ts-loader": "9.4.2",
|
|
49
48
|
"ts-node": "10.9.1",
|
|
50
|
-
"typescript": "
|
|
51
|
-
"webdriverio": "8.
|
|
52
|
-
"webpack": "5.
|
|
53
|
-
"webpack-cli": "5.0.
|
|
54
|
-
"webpack-dev-server": "4.
|
|
49
|
+
"typescript": "5.0.4",
|
|
50
|
+
"webdriverio": "8.8.6",
|
|
51
|
+
"webpack": "5.80.0",
|
|
52
|
+
"webpack-cli": "5.0.2",
|
|
53
|
+
"webpack-dev-server": "4.13.3",
|
|
55
54
|
"webpack-node-externals": "3.0.0",
|
|
56
55
|
"xlsx": "0.18.5"
|
|
57
56
|
},
|
package/src/excellentexport.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as XLSX from 'xlsx';
|
|
11
|
-
import { CellTypes, FormatDefinition, PredefinedFormat } from './format';
|
|
11
|
+
import { CellTypes, FormatDefinition, PredefinedFormat, CellFormats, CellPatterns } from './format';
|
|
12
12
|
|
|
13
13
|
import * as utils from './utils';
|
|
14
14
|
|
|
@@ -42,9 +42,19 @@ export interface SheetOptions {
|
|
|
42
42
|
formats?: (FormatDefinition | null)[],
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/*
|
|
46
|
+
export type ExcellentExportType = {
|
|
47
|
+
version: () => string,
|
|
48
|
+
formats: CellFormats,
|
|
49
|
+
excel: (anchor:(HTMLAnchorElement|string), table:HTMLTableElement, name:string) => void,
|
|
50
|
+
csv: (anchor:(HTMLAnchorElement|string), table:HTMLTableElement, delimiter?:string, newLine?:string) => void,
|
|
51
|
+
convert: (options:ConvertOptions, sheets:SheetOptions[]) => void,
|
|
52
|
+
}
|
|
53
|
+
*/
|
|
54
|
+
|
|
45
55
|
const ExcellentExport = function() {
|
|
46
56
|
|
|
47
|
-
const version = "3.9.
|
|
57
|
+
const version = "3.9.4";
|
|
48
58
|
|
|
49
59
|
/*
|
|
50
60
|
ExcellentExport.convert(options, sheets);
|
|
@@ -208,7 +218,6 @@ const ExcellentExport = function() {
|
|
|
208
218
|
version: function(): string {
|
|
209
219
|
return version;
|
|
210
220
|
},
|
|
211
|
-
formats: PredefinedFormat,
|
|
212
221
|
excel: function(anchor:(HTMLAnchorElement|string), table:HTMLTableElement, name:string) {
|
|
213
222
|
table = utils.getTable(table);
|
|
214
223
|
anchor = utils.getAnchor(anchor);
|
|
@@ -235,7 +244,10 @@ const ExcellentExport = function() {
|
|
|
235
244
|
},
|
|
236
245
|
convert: function(options:ConvertOptions, sheets:SheetOptions[]) {
|
|
237
246
|
return convert(options, sheets);
|
|
238
|
-
}
|
|
247
|
+
},
|
|
248
|
+
formats: PredefinedFormat,
|
|
249
|
+
cellTypes: CellTypes,
|
|
250
|
+
cellPatterns: CellPatterns,
|
|
239
251
|
};
|
|
240
252
|
}();
|
|
241
253
|
|
package/dist/index.d.ts
DELETED
package/src/index.ts
DELETED