@senlinz/import-export 0.1.0-beta.10 → 0.1.0-beta.12

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,17 +1,46 @@
1
- import { ExcelDataType } from "@senlinz/import-export-wasm";
2
1
  interface ExcelDefinition {
3
2
  name: string;
4
- sheetName: string;
3
+ sheetName?: string;
5
4
  columns: ExcelColumnDefinition[];
6
5
  author?: string;
7
6
  createTime?: Date | string;
7
+ title?: string;
8
+ titleHeight?: number;
9
+ titleFormat?: ExcelCellFormatDefinition;
10
+ defaultRowHeight?: number;
11
+ dx?: number;
12
+ dy?: number;
13
+ isHeaderFreeze?: boolean;
8
14
  }
9
15
  interface ExcelColumnDefinition {
10
16
  key: string;
11
17
  name: string;
12
18
  width?: number;
13
19
  note?: string;
14
- dataType?: ExcelDataType;
20
+ dataType?: "string" | "number" | "date";
15
21
  allowedValues?: string[];
22
+ parent?: string;
23
+ backgroundColor?: string;
24
+ color?: string;
25
+ bold?: boolean;
26
+ format?: ExcelCellFormatDefinition;
27
+ valueFormat?: ExcelCellFormatDefinition[] | ExcelCellFormatDefinition;
28
+ dataGroup?: string;
29
+ dataGroupParent?: string;
16
30
  }
17
- export { ExcelDefinition, ExcelColumnDefinition, ExcelDataType };
31
+ interface ExcelCellFormatDefinition {
32
+ rule?: 'default' | 'eq';
33
+ value?: string;
34
+ color?: string;
35
+ bold?: boolean;
36
+ italic?: boolean;
37
+ underline?: boolean;
38
+ strikethrough?: boolean;
39
+ fontSize?: number;
40
+ backgroundColor?: string;
41
+ align?: 'left' | 'center' | 'right';
42
+ alignVertical?: 'top' | 'center' | 'bottom';
43
+ dateFormat?: string;
44
+ borderColor?: string;
45
+ }
46
+ export { ExcelDefinition, ExcelColumnDefinition, ExcelCellFormatDefinition };
@@ -11,5 +11,7 @@ declare function getUtils(): {
11
11
  };
12
12
  declare function _importExcel<T>(defintion: ExcelDefinition): Promise<T[]>;
13
13
  declare function _exportExcel<T>(defintion: ExcelDefinition, data: T[]): Promise<void>;
14
+ declare function _fromExcel<T>(definition: ExcelDefinition, buffer: Uint8Array): Promise<T[]>;
15
+ declare function _toExcel<T>(definition: ExcelDefinition, data: T[]): Promise<Uint8Array>;
14
16
  declare function _downloadExcelTemplate(defintion: ExcelDefinition): Promise<void>;
15
- export { getUtils, _importExcel as importExcel, _exportExcel as exportExcel, _downloadExcelTemplate as downloadExcelTemplate };
17
+ export { getUtils, _importExcel as importExcel, _exportExcel as exportExcel, _fromExcel as fromExcel, _toExcel as toExcel, _downloadExcelTemplate as downloadExcelTemplate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senlinz/import-export",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.12",
4
4
  "description": "Stencil Component for import/export excel files.",
5
5
  "module": "dist/components/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -12,11 +12,11 @@
12
12
  "exports": {
13
13
  ".": {
14
14
  "import": "./dist/components/index.js",
15
- "types": "./dist/components/index.d.ts"
15
+ "types": "./dist/types/index.d.ts"
16
16
  },
17
17
  "./components/import-export-studio.js": {
18
18
  "import": "./dist/components/import-export-studio.js",
19
- "types": "./dist/components/import-export-studio.d.ts"
19
+ "types": "./dist/types/components/import-export-studio.d.ts"
20
20
  }
21
21
  },
22
22
  "devDependencies": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "fflate": "^0.8.2",
38
- "@senlinz/import-export-wasm": "0.1.0-beta.10"
38
+ "@senlinz/import-export-wasm": "0.1.0-beta.12"
39
39
  },
40
40
  "keywords": [
41
41
  "stencil",