@feedmepos/mf-e-invoice 0.0.82 → 0.0.84-prod

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,4 +1,4 @@
1
- import type { F_EXPORT_FILE_TYPE, F_PDF_ORIENTATION_TYPE } from "./export.enum";
1
+ import { F_EXPORT_FILE_TYPE, F_PDF_ORIENTATION_TYPE } from "../export/export.enum";
2
2
  type Prev = [never, 0, 1, 2, 3, 4];
3
3
  type DeepKeyOf<T, D extends number = 4> = [D] extends [never] ? never : T extends object ? {
4
4
  [K in keyof T & string]: K | (NonNullable<T[K]> extends object ? `${K}.${DeepKeyOf<NonNullable<T[K]>, Prev[D]>}` : never);
@@ -11,28 +11,37 @@ export interface ExportColumn<T> {
11
11
  }
12
12
  export interface FilterRule<T> {
13
13
  field: DeepKeyOf<T>;
14
- operator: "equal" | "notEqual" | "greaterThan" | "lessThan" | "contains" | "between";
14
+ operator: "notEqual" | "equal" | "greaterThan" | "lessThan" | "contains" | "between";
15
15
  value: string | number | [number, number];
16
16
  }
17
+ export interface SortRule<T> {
18
+ field: DeepKeyOf<T>;
19
+ direction: "asc" | "desc";
20
+ }
17
21
  export interface ExportSectionBase<T> {
18
22
  title?: string;
19
23
  subTitle?: string;
20
24
  metaData?: string[];
21
25
  columns: ExportColumn<T>[];
26
+ sort?: SortRule<T>[];
22
27
  filters?: FilterRule<T>[];
23
- data: T[];
28
+ minRows?: number;
29
+ showGrandTotal?: boolean;
30
+ showIndex?: boolean;
24
31
  }
25
32
  export type PdfPage<T> = ExportSectionBase<T>;
26
33
  export interface ExcelWorksheet<T> extends ExportSectionBase<T> {
27
34
  sheetName: string;
28
35
  }
29
36
  export interface PdfExportBody<T> {
37
+ orientation?: F_PDF_ORIENTATION_TYPE;
30
38
  type: F_EXPORT_FILE_TYPE.pdf;
31
- orientation: F_PDF_ORIENTATION_TYPE;
39
+ data: T[];
32
40
  pages: PdfPage<T>[];
33
41
  }
34
42
  export interface ExcelExportBody<T> {
35
43
  type: F_EXPORT_FILE_TYPE.excel;
44
+ data: T[];
36
45
  worksheets: ExcelWorksheet<T>[];
37
46
  }
38
47
  export type InvoiceExportBody<T> = PdfExportBody<T> | ExcelExportBody<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-e-invoice",
3
- "version": "0.0.82",
3
+ "version": "0.0.84-prod",
4
4
  "files": [
5
5
  "dist"
6
6
  ],