rapid-spreadjs 1.0.10 → 1.0.11
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/.markdownlint.json +13 -13
- package/README.md +39 -1
- package/dist/index.cjs.js +54 -82
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +55 -82
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/utils/sheet.d.ts +27 -33
- package/markdownlint-config-schema.json +1596 -1596
- package/package.json +38 -39
- package/rollup.config.js +0 -51
- package/src/index.ts +0 -11
- package/src/types/sheet.ts +0 -38
- package/src/types/wookbook.ts +0 -0
- package/src/utils/common.ts +0 -22
- package/src/utils/sheet.ts +0 -525
- package/src/utils/wookbook.ts +0 -188
- package/tsconfig.json +0 -113
package/package.json
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rapid-spreadjs",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"description": "SpreadJS常用公用处理函数,包括设计器、工作簿和工作表的相关处理函数。",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"build": "rollup -c rollup.config.mjs"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"utils",
|
|
14
|
+
"helpers",
|
|
15
|
+
"spreadjs",
|
|
16
|
+
"spreadsheet",
|
|
17
|
+
"excel",
|
|
18
|
+
"workbook",
|
|
19
|
+
"worksheet"
|
|
20
|
+
],
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "qubernet",
|
|
23
|
+
"email": "qubernet@163.com",
|
|
24
|
+
"url": "https://www.cnblogs.com/qubernet"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
29
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
30
|
+
"rollup": "^4.34.9",
|
|
31
|
+
"tslib": "^2.8.1",
|
|
32
|
+
"typescript": "^5.8.2"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@types/file-saver": "^2.0.7",
|
|
36
|
+
"file-saver": "^2.0.5"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/rollup.config.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import typescript from "@rollup/plugin-typescript";
|
|
2
|
-
import terser from "@rollup/plugin-terser";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
input: "src/index.ts",
|
|
6
|
-
output: [
|
|
7
|
-
// 未压缩的ES模块
|
|
8
|
-
{
|
|
9
|
-
file: "dist/index.esm.js",
|
|
10
|
-
format: "es",
|
|
11
|
-
sourcemap: true, // 可选:生成SourceMap
|
|
12
|
-
},
|
|
13
|
-
// 压缩后的ES模块
|
|
14
|
-
{
|
|
15
|
-
file: "dist/index.esm.min.js",
|
|
16
|
-
format: "es",
|
|
17
|
-
plugins: [
|
|
18
|
-
// 仅针对此输出启用压缩
|
|
19
|
-
terser({
|
|
20
|
-
compress: { drop_console: true }, // 删除console语句
|
|
21
|
-
format: { comments: false }, // 移除注释
|
|
22
|
-
}),
|
|
23
|
-
],
|
|
24
|
-
sourcemap: true,
|
|
25
|
-
},
|
|
26
|
-
// 未压缩的CommonJS模块
|
|
27
|
-
{
|
|
28
|
-
file: "dist/index.cjs.js",
|
|
29
|
-
format: "cjs",
|
|
30
|
-
sourcemap: true,
|
|
31
|
-
},
|
|
32
|
-
// 压缩后的CommonJS模块
|
|
33
|
-
{
|
|
34
|
-
file: "dist/index.cjs.min.js",
|
|
35
|
-
format: "cjs",
|
|
36
|
-
plugins: [
|
|
37
|
-
terser({
|
|
38
|
-
compress: { drop_console: true },
|
|
39
|
-
format: { comments: false },
|
|
40
|
-
}),
|
|
41
|
-
],
|
|
42
|
-
sourcemap: true,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
plugins: [
|
|
46
|
-
typescript({
|
|
47
|
-
tsconfig: "./tsconfig.json",
|
|
48
|
-
// exclude: ["**/*.test.ts"],
|
|
49
|
-
}),
|
|
50
|
-
],
|
|
51
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** 导出/types/sheet.ts中的所有type */
|
|
2
|
-
export * from "./types/sheet";
|
|
3
|
-
|
|
4
|
-
/** 导出/utils/common.ts中的所有属性或函数 */
|
|
5
|
-
export * from "./utils/common";
|
|
6
|
-
|
|
7
|
-
/** 导出/utils/sheet.ts中的所有属性或函数 */
|
|
8
|
-
export * from "./utils/sheet";
|
|
9
|
-
|
|
10
|
-
/** 导出/utils/wookbook.ts中的所有属性或函数 */
|
|
11
|
-
export * from "./utils/wookbook";
|
package/src/types/sheet.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 单元格实体
|
|
3
|
-
*/
|
|
4
|
-
export type CellModel = {
|
|
5
|
-
/** 行索引 */
|
|
6
|
-
row?: number;
|
|
7
|
-
|
|
8
|
-
/** 列索引 */
|
|
9
|
-
col?: number;
|
|
10
|
-
|
|
11
|
-
/** 行数量 */
|
|
12
|
-
rowCount?: number;
|
|
13
|
-
|
|
14
|
-
/** 列数量 */
|
|
15
|
-
colCount?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 单元格水印和数据绑定实体
|
|
20
|
-
*/
|
|
21
|
-
export type CellWatermarkModel = CellModel & {
|
|
22
|
-
/** 水印标题内容 */
|
|
23
|
-
title?: string;
|
|
24
|
-
|
|
25
|
-
/** 数据绑定路径的前缀,如:user.name中的user */
|
|
26
|
-
pathPrev?: string;
|
|
27
|
-
|
|
28
|
-
/** 数据绑定路径的字段,如:user.name中的name */
|
|
29
|
-
pathField?: string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 单元格日期控件实体
|
|
34
|
-
*/
|
|
35
|
-
export type CellDateModel = CellModel & {
|
|
36
|
-
/** 日期格式化方式,如:yyyy-MM-dd */
|
|
37
|
-
dateFormat?: string;
|
|
38
|
-
};
|
package/src/types/wookbook.ts
DELETED
|
File without changes
|
package/src/utils/common.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公用工具函数属性
|
|
3
|
-
*/
|
|
4
|
-
export const CommonUtils = {
|
|
5
|
-
/**
|
|
6
|
-
* 获取列的英文字母
|
|
7
|
-
* @param colIndex 列的索引
|
|
8
|
-
* @returns 返回英文字母
|
|
9
|
-
*/
|
|
10
|
-
getColLetterName: (colIndex: number): string => {
|
|
11
|
-
colIndex += 1;
|
|
12
|
-
|
|
13
|
-
let letter = "";
|
|
14
|
-
while (colIndex > 0) {
|
|
15
|
-
const remainder = (colIndex - 1) % 26;
|
|
16
|
-
letter = String.fromCharCode(remainder + 65) + letter;
|
|
17
|
-
colIndex = Math.floor((colIndex - 1) / 26);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return letter.toUpperCase();
|
|
21
|
-
},
|
|
22
|
-
};
|