@visactor/vtable-export 0.16.4-alpha.2
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 +97 -0
- package/cjs/csv/index.d.ts +4 -0
- package/cjs/csv/index.js +33 -0
- package/cjs/csv/index.js.map +1 -0
- package/cjs/excel/index.d.ts +3 -0
- package/cjs/excel/index.js +92 -0
- package/cjs/excel/index.js.map +1 -0
- package/cjs/excel/style.d.ts +6 -0
- package/cjs/excel/style.js +84 -0
- package/cjs/excel/style.js.map +1 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +41 -0
- package/cjs/index.js.map +1 -0
- package/cjs/util/color.d.ts +152 -0
- package/cjs/util/color.js +193 -0
- package/cjs/util/color.js.map +1 -0
- package/cjs/util/download.d.ts +2 -0
- package/cjs/util/download.js +30 -0
- package/cjs/util/download.js.map +1 -0
- package/cjs/util/encode.d.ts +3 -0
- package/cjs/util/encode.js +17 -0
- package/cjs/util/encode.js.map +1 -0
- package/cjs/util/type.d.ts +6 -0
- package/cjs/util/type.js +6 -0
- package/cjs/util/type.js.map +1 -0
- package/dist/vtable-export.js +76258 -0
- package/dist/vtable-export.min.js +92 -0
- package/es/csv/index.d.ts +4 -0
- package/es/csv/index.js +25 -0
- package/es/csv/index.js.map +1 -0
- package/es/excel/index.d.ts +3 -0
- package/es/excel/index.js +82 -0
- package/es/excel/index.js.map +1 -0
- package/es/excel/style.d.ts +6 -0
- package/es/excel/style.js +75 -0
- package/es/excel/style.js.map +1 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +7 -0
- package/es/index.js.map +1 -0
- package/es/util/color.d.ts +152 -0
- package/es/util/color.js +186 -0
- package/es/util/color.js.map +1 -0
- package/es/util/download.d.ts +2 -0
- package/es/util/download.js +22 -0
- package/es/util/download.js.map +1 -0
- package/es/util/encode.d.ts +3 -0
- package/es/util/encode.js +10 -0
- package/es/util/encode.js.map +1 -0
- package/es/util/type.d.ts +6 -0
- package/es/util/type.js +2 -0
- package/es/util/type.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function encodeCellRange(cellRange) {
|
|
2
|
+
return `${encodeCellAddress(cellRange.start.col, cellRange.start.row)}:${encodeCellAddress(cellRange.end.col, cellRange.end.row)}`;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function encodeCellAddress(col, row) {
|
|
6
|
+
let s = "";
|
|
7
|
+
for (let column = col + 1; column > 0; column = Math.floor((column - 1) / 26)) s = String.fromCharCode((column - 1) % 26 + 65) + s;
|
|
8
|
+
return s + (row + 1);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=encode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["util/encode.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,eAAe,CAAC,SAAoB;IAClD,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1E,MAAM,GAAG,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpE,OAAO,GAAG,KAAK,IAAI,GAAG,EAAE,CAAC;AAC3B,CAAC;AAQD,MAAM,UAAU,iBAAiB,CAAC,GAAW,EAAE,GAAW;IACxD,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,KAAK,IAAI,MAAM,GAAG,GAAG,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE;QAC7E,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;KACvD;IACD,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC","file":"encode.js","sourcesContent":["import type { CellRange } from './type';\n\n/**\n * @description: comvert cell range to code\n * @param {CellRange} cellRange\n * @return {*}\n */\nexport function encodeCellRange(cellRange: CellRange) {\n const start = encodeCellAddress(cellRange.start.col, cellRange.start.row);\n const end = encodeCellAddress(cellRange.end.col, cellRange.end.row);\n return `${start}:${end}`;\n}\n\n/**\n * @description: convert cell address to code\n * @param {number} col\n * @param {number} row\n * @return {*}\n */\nexport function encodeCellAddress(col: number, row: number) {\n let s = '';\n for (let column = col + 1; column > 0; column = Math.floor((column - 1) / 26)) {\n s = String.fromCharCode(((column - 1) % 26) + 65) + s;\n }\n return s + (row + 1);\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as VTable from '@visactor/vtable';
|
|
2
|
+
export type IVTable = VTable.ListTable | VTable.PivotTable | VTable.PivotChart;
|
|
3
|
+
export type CellRange = VTable.TYPES.CellRange;
|
|
4
|
+
export type CellStyle = VTable.TYPES.CellStyle;
|
|
5
|
+
export type LineDashsDef = VTable.TYPES.LineDashsDef;
|
|
6
|
+
export type CellType = VTable.TYPES.ColumnTypeOption;
|
package/es/util/type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["util/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type * as VTable from '@visactor/vtable';\n\nexport type IVTable = VTable.ListTable | VTable.PivotTable | VTable.PivotChart;\nexport type CellRange = VTable.TYPES.CellRange;\nexport type CellStyle = VTable.TYPES.CellStyle;\nexport type LineDashsDef = VTable.TYPES.LineDashsDef;\nexport type CellType = VTable.TYPES.ColumnTypeOption;\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visactor/vtable-export",
|
|
3
|
+
"version": "0.16.4-alpha.2",
|
|
4
|
+
"description": "The export util of VTable",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "VisActor",
|
|
7
|
+
"url": "https://VisActor.io/"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"main": "cjs/index.js",
|
|
12
|
+
"module": "es/index.js",
|
|
13
|
+
"types": "es/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"cjs",
|
|
16
|
+
"es",
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"require": "./cjs/index.js",
|
|
22
|
+
"import": "./es/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"unpkg": "latest",
|
|
26
|
+
"unpkgFiles": [
|
|
27
|
+
"dist/vtable-exporter.js"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@visactor/vtable": "0.16.4-alpha.2",
|
|
34
|
+
"@visactor/vutils": "~0.16.10",
|
|
35
|
+
"file-saver": "2.0.5",
|
|
36
|
+
"exceljs": "4.4.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@visactor/vchart": "1.7.3",
|
|
40
|
+
"@rushstack/eslint-patch": "~1.1.4",
|
|
41
|
+
"react": "^18.0.0",
|
|
42
|
+
"react-dom": "^18.0.0",
|
|
43
|
+
"@types/react": "^18.0.0",
|
|
44
|
+
"@types/react-dom": "^18.0.0",
|
|
45
|
+
"@vitejs/plugin-react": "3.1.0",
|
|
46
|
+
"eslint": "~8.18.0",
|
|
47
|
+
"vite": "3.2.6",
|
|
48
|
+
"typescript": "4.9.5",
|
|
49
|
+
"@babel/core": "7.20.12",
|
|
50
|
+
"@babel/preset-env": "7.20.2",
|
|
51
|
+
"@types/chai": "4.2.22",
|
|
52
|
+
"@types/jest": "^26.0.0",
|
|
53
|
+
"@types/mocha": "9.0.0",
|
|
54
|
+
"@types/node": "*",
|
|
55
|
+
"@types/offscreencanvas": "2019.6.4",
|
|
56
|
+
"chai": "4.3.4",
|
|
57
|
+
"jest": "^26.0.0",
|
|
58
|
+
"jest-electron": "^0.1.12",
|
|
59
|
+
"jest-transform-stub": "^2.0.0",
|
|
60
|
+
"magic-string": "^0.25.7",
|
|
61
|
+
"mocha": "9.1.3",
|
|
62
|
+
"postcss": "8.4.21",
|
|
63
|
+
"rimraf": "3.0.2",
|
|
64
|
+
"sass": "1.43.5",
|
|
65
|
+
"ts-jest": "^26.0.0",
|
|
66
|
+
"ts-loader": "9.2.6",
|
|
67
|
+
"ts-node": "10.9.0",
|
|
68
|
+
"tslib": "2.3.1",
|
|
69
|
+
"ttypescript": "1.5.13",
|
|
70
|
+
"typescript-transform-paths": "3.3.1",
|
|
71
|
+
"json-formatter-js": "^2.3.4",
|
|
72
|
+
"inversify": "6.0.1",
|
|
73
|
+
"vite-plugin-markdown": "^2.1.0",
|
|
74
|
+
"markdown-it": "^13.0.0",
|
|
75
|
+
"node-fetch": "2.6.7",
|
|
76
|
+
"form-data": "~4.0.0",
|
|
77
|
+
"axios": "^1.4.0",
|
|
78
|
+
"@types/react-is": "^17.0.3",
|
|
79
|
+
"@internal/bundler": "0.0.1",
|
|
80
|
+
"@internal/eslint-config": "0.0.1",
|
|
81
|
+
"@internal/ts-config": "0.0.1"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"start": "vite ./demo",
|
|
85
|
+
"build": "bundle --clean"
|
|
86
|
+
}
|
|
87
|
+
}
|