@slickgrid-universal/excel-export 2.4.1 → 2.6.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.
Files changed (41) hide show
  1. package/dist/commonjs/excelExport.service.js +572 -572
  2. package/dist/commonjs/excelExport.service.js.map +1 -1
  3. package/dist/commonjs/excelUtils.js +258 -210
  4. package/dist/commonjs/excelUtils.js.map +1 -1
  5. package/dist/commonjs/index.js +5 -5
  6. package/dist/commonjs/interfaces/excelCellFormat.interface.js +2 -2
  7. package/dist/commonjs/interfaces/excelMetadata.interface.js +2 -2
  8. package/dist/commonjs/interfaces/excelStylesheet.interface.js +2 -2
  9. package/dist/commonjs/interfaces/index.js +19 -19
  10. package/dist/esm/excelExport.service.js +570 -570
  11. package/dist/esm/excelExport.service.js.map +1 -1
  12. package/dist/esm/excelUtils.js +247 -201
  13. package/dist/esm/excelUtils.js.map +1 -1
  14. package/dist/esm/index.js +1 -1
  15. package/dist/esm/interfaces/excelCellFormat.interface.js +1 -1
  16. package/dist/esm/interfaces/excelMetadata.interface.js +1 -1
  17. package/dist/esm/interfaces/excelStylesheet.interface.js +1 -1
  18. package/dist/esm/interfaces/index.js +3 -3
  19. package/dist/tsconfig.tsbuildinfo +1 -0
  20. package/dist/{commonjs → types}/excelExport.service.d.ts +137 -136
  21. package/dist/types/excelExport.service.d.ts.map +1 -0
  22. package/dist/{esm → types}/excelUtils.d.ts +32 -28
  23. package/dist/types/excelUtils.d.ts.map +1 -0
  24. package/dist/{esm → types}/index.d.ts +2 -1
  25. package/dist/types/index.d.ts.map +1 -0
  26. package/dist/{esm → types}/interfaces/excelCellFormat.interface.d.ts +6 -5
  27. package/dist/types/interfaces/excelCellFormat.interface.d.ts.map +1 -0
  28. package/dist/{commonjs → types}/interfaces/excelMetadata.interface.d.ts +10 -9
  29. package/dist/types/interfaces/excelMetadata.interface.d.ts.map +1 -0
  30. package/dist/{commonjs → types}/interfaces/excelStylesheet.interface.d.ts +34 -33
  31. package/dist/types/interfaces/excelStylesheet.interface.d.ts.map +1 -0
  32. package/dist/{commonjs → types}/interfaces/index.d.ts +4 -3
  33. package/dist/types/interfaces/index.d.ts.map +1 -0
  34. package/package.json +9 -9
  35. package/dist/commonjs/excelUtils.d.ts +0 -28
  36. package/dist/commonjs/index.d.ts +0 -1
  37. package/dist/commonjs/interfaces/excelCellFormat.interface.d.ts +0 -5
  38. package/dist/esm/excelExport.service.d.ts +0 -136
  39. package/dist/esm/interfaces/excelMetadata.interface.d.ts +0 -9
  40. package/dist/esm/interfaces/excelStylesheet.interface.d.ts +0 -33
  41. package/dist/esm/interfaces/index.d.ts +0 -3
@@ -1,28 +1,32 @@
1
- import { Column, ExcelStylesheet, FormatterType, GetDataValueCallback, SlickGrid } from '@slickgrid-universal/common';
2
- export type ExcelFormatter = object & {
3
- id: number;
4
- };
5
- export declare const getExcelSameInputDataCallback: GetDataValueCallback;
6
- export declare const getExcelNumberCallback: GetDataValueCallback;
7
- /** use different Excel Stylesheet Format as per the Field Type */
8
- export declare function useCellFormatByFieldType(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid): {
9
- stylesheetFormatterId: number | undefined;
10
- getDataValueParser: GetDataValueCallback;
11
- };
12
- export declare function getGroupTotalValue(totals: any, columnDef: Column, groupType: string): any;
13
- /** Get numeric formatter options when defined or use default values (minDecimal, maxDecimal, thousandSeparator, decimalSeparator, wrapNegativeNumber) */
14
- export declare function getNumericFormatterOptions(columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
15
- minDecimal: any;
16
- maxDecimal: any;
17
- decimalSeparator: any;
18
- thousandSeparator: any;
19
- wrapNegativeNumber: any;
20
- currencyPrefix: any;
21
- currencySuffix: any;
22
- numberPrefix: string;
23
- numberSuffix: string;
24
- };
25
- export declare function getExcelFormatFromGridFormatter(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
26
- stylesheetFormatter: ExcelFormatter;
27
- groupType: string;
28
- };
1
+ import { Column, ExcelStylesheet, Formatter, FormatterType, GetDataValueCallback, GridOption, SlickGrid } from '@slickgrid-universal/common';
2
+ export type ExcelFormatter = object & {
3
+ id: number;
4
+ };
5
+ export declare const getExcelSameInputDataCallback: GetDataValueCallback;
6
+ export declare const getExcelNumberCallback: GetDataValueCallback;
7
+ /** Parse a number which the user might have provided formatter options (for example a user might have provided { decimalSeparator: ',', thousandSeparator: ' '}) */
8
+ export declare function parseNumberWithFormatterOptions(value: any, column: Column, gridOptions: GridOption): any;
9
+ /** use different Excel Stylesheet Format as per the Field Type */
10
+ export declare function useCellFormatByFieldType(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid): {
11
+ stylesheetFormatterId: number | undefined;
12
+ getDataValueParser: GetDataValueCallback;
13
+ };
14
+ export declare function getGroupTotalValue(totals: any, columnDef: Column, groupType: string): any;
15
+ /** Get numeric formatter options when defined or use default values (minDecimal, maxDecimal, thousandSeparator, decimalSeparator, wrapNegativeNumber) */
16
+ export declare function getNumericFormatterOptions(columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
17
+ minDecimal: any;
18
+ maxDecimal: any;
19
+ decimalSeparator: any;
20
+ thousandSeparator: any;
21
+ wrapNegativeNumber: any;
22
+ currencyPrefix: any;
23
+ currencySuffix: any;
24
+ numberPrefix: string;
25
+ numberSuffix: string;
26
+ };
27
+ export declare function getFormatterNumericDataType(formatter?: Formatter): "currency" | "decimal" | "percent";
28
+ export declare function getExcelFormatFromGridFormatter(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
29
+ stylesheetFormatter: ExcelFormatter;
30
+ groupType: string;
31
+ };
32
+ //# sourceMappingURL=excelUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excelUtils.d.ts","sourceRoot":"","sources":["../../src/excelUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAEN,eAAe,EAEf,SAAS,EAET,aAAa,EAEb,oBAAoB,EAEpB,UAAU,EAIV,SAAS,EACV,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE,CAAC;AAGtD,eAAO,MAAM,6BAA6B,EAAE,oBAAqC,CAAC;AAClF,eAAO,MAAM,sBAAsB,EAAE,oBAGnC,CAAC;AAEH,oKAAoK;AACpK,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,OAUlG;AAED,kEAAkE;AAClE,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;;;EAUlI;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAEnF;AAED,yJAAyJ;AACzJ,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa;;;;;;;;;;EA6C1G;AAED,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,SAAS,sCAwBhE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa;;;EAkFvK"}
@@ -1 +1,2 @@
1
- export { ExcelExportService } from './excelExport.service';
1
+ export { ExcelExportService } from './excelExport.service';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,5 +1,6 @@
1
- import { ExcelMetadata } from './excelMetadata.interface';
2
- export interface ExcelCellFormat {
3
- value: any;
4
- metadata: ExcelMetadata;
5
- }
1
+ import { ExcelMetadata } from './excelMetadata.interface';
2
+ export interface ExcelCellFormat {
3
+ value: any;
4
+ metadata: ExcelMetadata;
5
+ }
6
+ //# sourceMappingURL=excelCellFormat.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excelCellFormat.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/excelCellFormat.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,aAAa,CAAC;CACzB"}
@@ -1,9 +1,10 @@
1
- export interface ExcelMetadata {
2
- alignment?: any;
3
- border?: any;
4
- font?: any;
5
- format?: any;
6
- style?: any;
7
- type?: any;
8
- protection?: any;
9
- }
1
+ export interface ExcelMetadata {
2
+ alignment?: any;
3
+ border?: any;
4
+ font?: any;
5
+ format?: any;
6
+ style?: any;
7
+ type?: any;
8
+ protection?: any;
9
+ }
10
+ //# sourceMappingURL=excelMetadata.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excelMetadata.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/excelMetadata.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB"}
@@ -1,33 +1,34 @@
1
- import { ExcelAlignmentStyle, ExcelBorderStyle, ExcelColorStyle, ExcelCustomStyling, ExcelFillStyle, ExcelFontStyle } from '@slickgrid-universal/common';
2
- export interface ExcelStylesheet {
3
- createBorderFormatter: (border: ExcelBorderStyle) => any;
4
- createDifferentialStyle: (instructions: ExcelCustomStyling) => any;
5
- createFill: (instructions: ExcelFillStyle) => any;
6
- createFontStyle: (instructions: ExcelFontStyle) => any;
7
- createFormat: (instructions: ExcelCustomStyling) => any;
8
- createNumberFormatter: (format: string) => any;
9
- createSimpleFormatter: (type: any) => any;
10
- createTableStyle: (instructions: any) => any;
11
- exportAlignment: (doc: any, alignmentData: ExcelAlignmentStyle) => any;
12
- exportBorder: (doc: any, data: any[]) => ExcelBorderStyle;
13
- exportBorders: (doc: any) => any;
14
- exportCellFormatElement: (doc: any, instructions: ExcelCustomStyling) => any;
15
- exportCellStyles: (doc: any) => any;
16
- exportColor: (doc: any, color: ExcelColorStyle) => any;
17
- exportDifferentialStyles: (doc: any) => any;
18
- exportDFX: (doc: any, style: any) => any;
19
- exportFill: (doc: any, fd: any) => any;
20
- exportFills: (doc: any) => any;
21
- exportFont: (doc: any, fd: any) => any;
22
- exportFonts: (doc: any) => any;
23
- exportGradientFill: (doc: any, data: any[]) => any;
24
- exportNumberFormatter: (doc: any, fd: any) => any;
25
- exportNumberFormatters: (doc: any) => any;
26
- exportMasterCellFormats: (doc: any) => any;
27
- exportMasterCellStyles: (doc: any) => any;
28
- exportPatternFill: (doc: any, data: any[]) => any;
29
- exportProtection: (doc: any, protectionData: any) => any;
30
- exportTableStyle: (doc: any, style: any) => any;
31
- exportTableStyles: (doc: any) => any;
32
- toXML: () => any;
33
- }
1
+ import { ExcelAlignmentStyle, ExcelBorderStyle, ExcelColorStyle, ExcelCustomStyling, ExcelFillStyle, ExcelFontStyle } from '@slickgrid-universal/common';
2
+ export interface ExcelStylesheet {
3
+ createBorderFormatter: (border: ExcelBorderStyle) => any;
4
+ createDifferentialStyle: (instructions: ExcelCustomStyling) => any;
5
+ createFill: (instructions: ExcelFillStyle) => any;
6
+ createFontStyle: (instructions: ExcelFontStyle) => any;
7
+ createFormat: (instructions: ExcelCustomStyling) => any;
8
+ createNumberFormatter: (format: string) => any;
9
+ createSimpleFormatter: (type: any) => any;
10
+ createTableStyle: (instructions: any) => any;
11
+ exportAlignment: (doc: any, alignmentData: ExcelAlignmentStyle) => any;
12
+ exportBorder: (doc: any, data: any[]) => ExcelBorderStyle;
13
+ exportBorders: (doc: any) => any;
14
+ exportCellFormatElement: (doc: any, instructions: ExcelCustomStyling) => any;
15
+ exportCellStyles: (doc: any) => any;
16
+ exportColor: (doc: any, color: ExcelColorStyle) => any;
17
+ exportDifferentialStyles: (doc: any) => any;
18
+ exportDFX: (doc: any, style: any) => any;
19
+ exportFill: (doc: any, fd: any) => any;
20
+ exportFills: (doc: any) => any;
21
+ exportFont: (doc: any, fd: any) => any;
22
+ exportFonts: (doc: any) => any;
23
+ exportGradientFill: (doc: any, data: any[]) => any;
24
+ exportNumberFormatter: (doc: any, fd: any) => any;
25
+ exportNumberFormatters: (doc: any) => any;
26
+ exportMasterCellFormats: (doc: any) => any;
27
+ exportMasterCellStyles: (doc: any) => any;
28
+ exportPatternFill: (doc: any, data: any[]) => any;
29
+ exportProtection: (doc: any, protectionData: any) => any;
30
+ exportTableStyle: (doc: any, style: any) => any;
31
+ exportTableStyles: (doc: any) => any;
32
+ toXML: () => any;
33
+ }
34
+ //# sourceMappingURL=excelStylesheet.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"excelStylesheet.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/excelStylesheet.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEzJ,MAAM,WAAW,eAAe;IAC9B,qBAAqB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,GAAG,CAAC;IACzD,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,GAAG,CAAC;IACnE,UAAU,EAAE,CAAC,YAAY,EAAE,cAAc,KAAK,GAAG,CAAC;IAClD,eAAe,EAAE,CAAC,YAAY,EAAE,cAAc,KAAK,GAAG,CAAC;IACvD,YAAY,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,GAAG,CAAC;IACxD,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;IAC/C,qBAAqB,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IAC1C,gBAAgB,EAAE,CAAC,YAAY,EAAE,GAAG,KAAK,GAAG,CAAC;IAC7C,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,mBAAmB,KAAK,GAAG,CAAC;IACvE,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,gBAAgB,CAAC;IAC1D,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IACjC,uBAAuB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,kBAAkB,KAAK,GAAG,CAAC;IAC7E,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IACpC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,KAAK,GAAG,CAAC;IACvD,wBAAwB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC5C,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;IACzC,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,CAAC;IACvC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/B,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,CAAC;IACvC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/B,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IACnD,qBAAqB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,KAAK,GAAG,CAAC;IAClD,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC1C,uBAAuB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC3C,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IAC1C,iBAAiB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAClD,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,KAAK,GAAG,CAAC;IACzD,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;IAChD,iBAAiB,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;IACrC,KAAK,EAAE,MAAM,GAAG,CAAC;CAClB"}
@@ -1,3 +1,4 @@
1
- export * from './excelCellFormat.interface';
2
- export * from './excelMetadata.interface';
3
- export * from './excelStylesheet.interface';
1
+ export * from './excelCellFormat.interface';
2
+ export * from './excelMetadata.interface';
3
+ export * from './excelStylesheet.interface';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@slickgrid-universal/excel-export",
3
- "version": "2.4.1",
3
+ "version": "2.6.0",
4
4
  "description": "Excel Export (xls/xlsx) Service.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "exports": {
8
8
  ".": {
9
- "browser": "./dist/esm/index.js",
10
- "import": "./dist/esm/index.d.ts",
11
- "require": "./dist/commonjs/index.js"
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/commonjs/index.js",
11
+ "default": "./dist/esm/index.js"
12
12
  },
13
13
  "./*": "./*"
14
14
  },
15
15
  "typesVersions": {
16
16
  "*": {
17
17
  "*": [
18
- "./dist/esm/index.d.ts"
18
+ "./dist/types/index.d.ts"
19
19
  ]
20
20
  }
21
21
  },
22
- "types": "dist/esm/index.d.ts",
22
+ "types": "dist/types/index.d.ts",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -43,8 +43,8 @@
43
43
  "not dead"
44
44
  ],
45
45
  "dependencies": {
46
- "@slickgrid-universal/common": "~2.4.1",
47
- "@slickgrid-universal/utils": "~2.4.0",
46
+ "@slickgrid-universal/common": "~2.6.0",
47
+ "@slickgrid-universal/utils": "~2.6.0",
48
48
  "excel-builder-webpacker": "^2.1.8",
49
49
  "moment-mini": "^2.29.4"
50
50
  },
@@ -52,5 +52,5 @@
52
52
  "type": "ko_fi",
53
53
  "url": "https://ko-fi.com/ghiscoding"
54
54
  },
55
- "gitHead": "e62c2da0d9d1c8e97462f4125bfdf735d4e4782d"
55
+ "gitHead": "9cddf3ee91a91ca829d0ced99c1f20f6d0e9941f"
56
56
  }
@@ -1,28 +0,0 @@
1
- import { Column, ExcelStylesheet, FormatterType, GetDataValueCallback, SlickGrid } from '@slickgrid-universal/common';
2
- export type ExcelFormatter = object & {
3
- id: number;
4
- };
5
- export declare const getExcelSameInputDataCallback: GetDataValueCallback;
6
- export declare const getExcelNumberCallback: GetDataValueCallback;
7
- /** use different Excel Stylesheet Format as per the Field Type */
8
- export declare function useCellFormatByFieldType(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid): {
9
- stylesheetFormatterId: number | undefined;
10
- getDataValueParser: GetDataValueCallback;
11
- };
12
- export declare function getGroupTotalValue(totals: any, columnDef: Column, groupType: string): any;
13
- /** Get numeric formatter options when defined or use default values (minDecimal, maxDecimal, thousandSeparator, decimalSeparator, wrapNegativeNumber) */
14
- export declare function getNumericFormatterOptions(columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
15
- minDecimal: any;
16
- maxDecimal: any;
17
- decimalSeparator: any;
18
- thousandSeparator: any;
19
- wrapNegativeNumber: any;
20
- currencyPrefix: any;
21
- currencySuffix: any;
22
- numberPrefix: string;
23
- numberSuffix: string;
24
- };
25
- export declare function getExcelFormatFromGridFormatter(stylesheet: ExcelStylesheet, stylesheetFormatters: any, columnDef: Column, grid: SlickGrid, formatterType: FormatterType): {
26
- stylesheetFormatter: ExcelFormatter;
27
- groupType: string;
28
- };
@@ -1 +0,0 @@
1
- export { ExcelExportService } from './excelExport.service';
@@ -1,5 +0,0 @@
1
- import { ExcelMetadata } from './excelMetadata.interface';
2
- export interface ExcelCellFormat {
3
- value: any;
4
- metadata: ExcelMetadata;
5
- }
@@ -1,136 +0,0 @@
1
- import { Column, ContainerService, ExcelExportService as BaseExcelExportService, ExcelExportOption, ExternalResource, ExcelWorkbook, ExcelWorksheet, FileType, GetDataValueCallback, GetGroupTotalValueCallback, GridOption, KeyTitlePair, Locale, PubSubService, SlickDataView, SlickGrid, TranslaterService } from '@slickgrid-universal/common';
2
- import { ExcelCellFormat, ExcelMetadata, ExcelStylesheet } from './interfaces/index';
3
- import { ExcelFormatter } from './excelUtils';
4
- export declare class ExcelExportService implements ExternalResource, BaseExcelExportService {
5
- protected _fileFormat: FileType;
6
- protected _grid: SlickGrid;
7
- protected _locales: Locale;
8
- protected _groupedColumnHeaders?: Array<KeyTitlePair>;
9
- protected _columnHeaders: Array<KeyTitlePair>;
10
- protected _hasColumnTitlePreHeader: boolean;
11
- protected _hasGroupedItems: boolean;
12
- protected _excelExportOptions: ExcelExportOption;
13
- protected _sheet: ExcelWorksheet;
14
- protected _stylesheet: ExcelStylesheet;
15
- protected _stylesheetFormats: any;
16
- protected _pubSubService: PubSubService | null;
17
- protected _translaterService: TranslaterService | undefined;
18
- protected _workbook: ExcelWorkbook;
19
- protected _regularCellExcelFormats: {
20
- [fieldId: string]: {
21
- stylesheetFormatterId?: number;
22
- getDataValueParser: GetDataValueCallback;
23
- };
24
- };
25
- protected _groupTotalExcelFormats: {
26
- [fieldId: string]: {
27
- groupType: string;
28
- stylesheetFormatter?: ExcelFormatter;
29
- getGroupTotalParser?: GetGroupTotalValueCallback;
30
- };
31
- };
32
- /** ExcelExportService class name which is use to find service instance in the external registered services */
33
- readonly className = "ExcelExportService";
34
- protected get _datasetIdPropName(): string;
35
- /** Getter of SlickGrid DataView object */
36
- get _dataView(): SlickDataView;
37
- /** Getter for the Grid Options pulled through the Grid Object */
38
- protected get _gridOptions(): GridOption;
39
- get stylesheet(): ExcelStylesheet;
40
- get stylesheetFormats(): any;
41
- get groupTotalExcelFormats(): {
42
- [fieldId: string]: {
43
- groupType: string;
44
- stylesheetFormatter?: ExcelFormatter | undefined;
45
- getGroupTotalParser?: GetGroupTotalValueCallback | undefined;
46
- };
47
- };
48
- get regularCellExcelFormats(): {
49
- [fieldId: string]: {
50
- stylesheetFormatterId?: number | undefined;
51
- getDataValueParser: GetDataValueCallback;
52
- };
53
- };
54
- dispose(): void;
55
- /**
56
- * Initialize the Export Service
57
- * @param grid
58
- * @param containerService
59
- */
60
- init(grid: SlickGrid, containerService: ContainerService): void;
61
- /**
62
- * Function to export the Grid result to an Excel CSV format using javascript for it to produce the CSV file.
63
- * This is a WYSIWYG export to file output (What You See is What You Get)
64
- *
65
- * NOTES: The column position needs to match perfectly the JSON Object position because of the way we are pulling the data,
66
- * which means that if any column(s) got moved in the UI, it has to be reflected in the JSON array output as well
67
- *
68
- * Example: exportToExcel({ format: FileType.csv, delimiter: DelimiterType.comma })
69
- */
70
- exportToExcel(options?: ExcelExportOption): Promise<boolean>;
71
- /**
72
- * Takes a positive integer and returns the corresponding column name.
73
- * 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,...)
74
- * 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, ...)
75
- * and again if we go 26, we need to add yet again an extra prefix (AA1, AB1, ...) and so goes the cycle
76
- * @param {number} colIndex - The positive integer to convert to a column name.
77
- * @return {string} The column name.
78
- */
79
- getExcelColumnNameByIndex(colIndex: number): string;
80
- /**
81
- * Triggers download file with file format.
82
- * IE(6-10) are not supported
83
- * All other browsers will use plain javascript on client side to produce a file download.
84
- * @param options
85
- */
86
- startDownloadFile(options: {
87
- filename: string;
88
- blob: Blob;
89
- data: any[];
90
- }): void;
91
- protected getDataOutput(): Array<string[] | ExcelCellFormat[]>;
92
- /** Get each column style including a style for the width of each column */
93
- protected getColumnStyles(columns: Column[]): any[];
94
- /**
95
- * Get all Grouped Header Titles and their keys, translate the title when required, and format them in Bold
96
- * @param {Array<Object>} columns - grid column definitions
97
- * @param {Object} metadata - Excel metadata
98
- * @returns {Object} array of Excel cell format
99
- */
100
- protected getColumnGroupedHeaderTitlesData(columns: Column[], metadata: ExcelMetadata): Array<ExcelCellFormat>;
101
- /** Get all column headers and format them in Bold */
102
- protected getColumnHeaderData(columns: Column[], metadata: ExcelMetadata): Array<ExcelCellFormat>;
103
- protected getGroupColumnTitle(): string | null;
104
- /**
105
- * Get all Grouped Header Titles and their keys, translate the title when required.
106
- * @param {Array<object>} columns of the grid
107
- */
108
- protected getColumnGroupedHeaderTitles(columns: Column[]): Array<KeyTitlePair>;
109
- /**
110
- * Get all header titles and their keys, translate the title when required.
111
- * @param {Array<object>} columns of the grid
112
- */
113
- protected getColumnHeaders(columns: Column[]): Array<KeyTitlePair> | null;
114
- /**
115
- * Get all the grid row data and return that as an output string
116
- */
117
- protected pushAllGridRowDataToArray(originalDaraArray: Array<Array<string | ExcelCellFormat | number>>, columns: Column[]): Array<Array<string | ExcelCellFormat | number>>;
118
- /**
119
- * Get the data of a regular row (a row without grouping)
120
- * @param {Array<Object>} columns - column definitions
121
- * @param {Number} row - row index
122
- * @param {Object} itemObj - item datacontext object
123
- */
124
- protected readRegularRowData(columns: Column[], row: number, itemObj: any): string[];
125
- /**
126
- * 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)'
127
- * @param itemObj
128
- */
129
- protected readGroupedRowTitle(itemObj: any): string;
130
- /**
131
- * Get the grouped totals (below the regular rows), these are set by Slick Aggregators.
132
- * For example if we grouped by "salesRep" and we have a Sum Aggregator on "sales", then the returned output would be:: ["Sum 123$"]
133
- * @param itemObj
134
- */
135
- protected readGroupedTotalRows(columns: Column[], itemObj: any): Array<ExcelCellFormat | string | number>;
136
- }
@@ -1,9 +0,0 @@
1
- export interface ExcelMetadata {
2
- alignment?: any;
3
- border?: any;
4
- font?: any;
5
- format?: any;
6
- style?: any;
7
- type?: any;
8
- protection?: any;
9
- }
@@ -1,33 +0,0 @@
1
- import { ExcelAlignmentStyle, ExcelBorderStyle, ExcelColorStyle, ExcelCustomStyling, ExcelFillStyle, ExcelFontStyle } from '@slickgrid-universal/common';
2
- export interface ExcelStylesheet {
3
- createBorderFormatter: (border: ExcelBorderStyle) => any;
4
- createDifferentialStyle: (instructions: ExcelCustomStyling) => any;
5
- createFill: (instructions: ExcelFillStyle) => any;
6
- createFontStyle: (instructions: ExcelFontStyle) => any;
7
- createFormat: (instructions: ExcelCustomStyling) => any;
8
- createNumberFormatter: (format: string) => any;
9
- createSimpleFormatter: (type: any) => any;
10
- createTableStyle: (instructions: any) => any;
11
- exportAlignment: (doc: any, alignmentData: ExcelAlignmentStyle) => any;
12
- exportBorder: (doc: any, data: any[]) => ExcelBorderStyle;
13
- exportBorders: (doc: any) => any;
14
- exportCellFormatElement: (doc: any, instructions: ExcelCustomStyling) => any;
15
- exportCellStyles: (doc: any) => any;
16
- exportColor: (doc: any, color: ExcelColorStyle) => any;
17
- exportDifferentialStyles: (doc: any) => any;
18
- exportDFX: (doc: any, style: any) => any;
19
- exportFill: (doc: any, fd: any) => any;
20
- exportFills: (doc: any) => any;
21
- exportFont: (doc: any, fd: any) => any;
22
- exportFonts: (doc: any) => any;
23
- exportGradientFill: (doc: any, data: any[]) => any;
24
- exportNumberFormatter: (doc: any, fd: any) => any;
25
- exportNumberFormatters: (doc: any) => any;
26
- exportMasterCellFormats: (doc: any) => any;
27
- exportMasterCellStyles: (doc: any) => any;
28
- exportPatternFill: (doc: any, data: any[]) => any;
29
- exportProtection: (doc: any, protectionData: any) => any;
30
- exportTableStyle: (doc: any, style: any) => any;
31
- exportTableStyles: (doc: any) => any;
32
- toXML: () => any;
33
- }
@@ -1,3 +0,0 @@
1
- export * from './excelCellFormat.interface';
2
- export * from './excelMetadata.interface';
3
- export * from './excelStylesheet.interface';