sheetnext 0.1.6 → 0.1.7
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/AGENT.md +2 -2
- package/DOCS.md +1 -8
- package/LICENSE +201 -0
- package/README.md +3 -2
- package/README.zh-CN.md +100 -0
- package/dist/sheetnext.css +1 -1
- package/dist/sheetnext.es.js +20 -10
- package/dist/sheetnext.umd.js +20 -10
- package/docs/logo.png +0 -0
- package/package.json +60 -56
- package/types/index.d.ts +171 -0
package/docs/logo.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sheetnext",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A powerful spreadsheet editor library",
|
|
5
|
-
"homepage": "https://www.sheetnext.com",
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "sheetnext",
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "A powerful spreadsheet editor library with AI capabilities",
|
|
5
|
+
"homepage": "https://www.sheetnext.com",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/wyyazlz/sheetnext.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/wyyazlz/sheetnext/issues"
|
|
12
|
+
},
|
|
13
|
+
"main": "dist/sheetnext.umd.js",
|
|
14
|
+
"module": "dist/sheetnext.es.js",
|
|
15
|
+
"types": "types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/sheetnext.es.js",
|
|
19
|
+
"require": "./dist/sheetnext.umd.js"
|
|
20
|
+
},
|
|
21
|
+
"./dist/sheetnext.css": "./dist/sheetnext.css"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"types",
|
|
26
|
+
"README.md",
|
|
27
|
+
"DOCS.md",
|
|
28
|
+
"AGENT.md",
|
|
29
|
+
"docs/logo.png"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"spreadsheet",
|
|
33
|
+
"excel",
|
|
34
|
+
"editor",
|
|
35
|
+
"table",
|
|
36
|
+
"ai",
|
|
37
|
+
"canvas",
|
|
38
|
+
"data-grid"
|
|
39
|
+
],
|
|
40
|
+
"author": "SheetNext Team",
|
|
41
|
+
"license": "Apache-2.0",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"echarts": "^6.0.0",
|
|
44
|
+
"fast-xml-parser": "^5.3.0",
|
|
45
|
+
"file-saver": "^2.0.5",
|
|
46
|
+
"jszip": "^2.6.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@anthropic-ai/sdk": ">=0.65.0",
|
|
50
|
+
"openai": ">=6.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@anthropic-ai/sdk": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"openai": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Type definitions for SheetNext
|
|
2
|
+
// Project: https://www.sheetnext.com
|
|
3
|
+
// Definitions by: SheetNext Team
|
|
4
|
+
|
|
5
|
+
export interface CellNum {
|
|
6
|
+
r: number;
|
|
7
|
+
c: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RangeNum {
|
|
11
|
+
s: CellNum;
|
|
12
|
+
e: CellNum;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type CellRef = string | CellNum;
|
|
16
|
+
export type RangeRef = string | RangeNum;
|
|
17
|
+
|
|
18
|
+
export interface SheetNextOptions {
|
|
19
|
+
AI_URL?: string;
|
|
20
|
+
AI_TOKEN?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ICellConfig {
|
|
24
|
+
v?: string;
|
|
25
|
+
w?: number;
|
|
26
|
+
h?: number;
|
|
27
|
+
b?: boolean;
|
|
28
|
+
s?: number;
|
|
29
|
+
fg?: string;
|
|
30
|
+
a?: 'l' | 'r' | 'c';
|
|
31
|
+
c?: string;
|
|
32
|
+
mr?: number;
|
|
33
|
+
mb?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SortItem {
|
|
37
|
+
type: 'column' | 'row' | 'custom';
|
|
38
|
+
order?: 'asc' | 'desc' | 'value';
|
|
39
|
+
index: string;
|
|
40
|
+
sortData?: any[];
|
|
41
|
+
cb?: (rowsArray: Cell[][], sortIndex: number) => Cell[][];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class Cell {
|
|
45
|
+
isMerged: boolean;
|
|
46
|
+
master: CellNum | null;
|
|
47
|
+
hyperlink: { target?: string; location?: string; tooltip?: string } | null;
|
|
48
|
+
dataValidation: any;
|
|
49
|
+
editVal: string;
|
|
50
|
+
readonly calcVal: any;
|
|
51
|
+
readonly showVal: string;
|
|
52
|
+
numFmt: string;
|
|
53
|
+
font: any;
|
|
54
|
+
alignment: any;
|
|
55
|
+
border: any;
|
|
56
|
+
fill: any;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class Row {
|
|
60
|
+
cells: Cell[];
|
|
61
|
+
height: number;
|
|
62
|
+
hidden: boolean;
|
|
63
|
+
readonly rIndex: number;
|
|
64
|
+
numFmt: string;
|
|
65
|
+
font: any;
|
|
66
|
+
alignment: any;
|
|
67
|
+
border: any;
|
|
68
|
+
fill: any;
|
|
69
|
+
getCell(c: number): Cell;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class Col {
|
|
73
|
+
cells: Cell[];
|
|
74
|
+
hidden: boolean;
|
|
75
|
+
width: number;
|
|
76
|
+
readonly cIndex: number;
|
|
77
|
+
numFmt: string;
|
|
78
|
+
font: any;
|
|
79
|
+
alignment: any;
|
|
80
|
+
border: any;
|
|
81
|
+
fill: any;
|
|
82
|
+
getCell(r: number): Cell;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class Drawing {
|
|
86
|
+
id: string;
|
|
87
|
+
type: 'chart' | 'image' | 'connector' | 'shape';
|
|
88
|
+
startCell: CellNum;
|
|
89
|
+
offsetX: number;
|
|
90
|
+
offsetY: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
option?: any;
|
|
94
|
+
imageBase64?: string;
|
|
95
|
+
updRender: boolean;
|
|
96
|
+
updIndex(direction: 'up' | 'down' | 'top' | 'bottom'): void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class Sheet {
|
|
100
|
+
name: string;
|
|
101
|
+
hidden: boolean;
|
|
102
|
+
merges: RangeNum[];
|
|
103
|
+
defaultColWidth: number;
|
|
104
|
+
defaultRowHeight: number;
|
|
105
|
+
showGridLines: boolean;
|
|
106
|
+
showRowColHeaders: boolean;
|
|
107
|
+
activeCell: CellNum;
|
|
108
|
+
activeAreas: RangeNum[];
|
|
109
|
+
rows: Row[];
|
|
110
|
+
cols: Col[];
|
|
111
|
+
xSplit: number;
|
|
112
|
+
ySplit: number;
|
|
113
|
+
drawings: Drawing[];
|
|
114
|
+
readonly rowCount: number;
|
|
115
|
+
readonly colCount: number;
|
|
116
|
+
|
|
117
|
+
getRow(r: number): Row;
|
|
118
|
+
getCol(c: number): Col;
|
|
119
|
+
getCell(r: number, c: number): Cell;
|
|
120
|
+
getCellByStr(cellStr: string): Cell;
|
|
121
|
+
rangeStrToNum(rangeStr: string): RangeNum;
|
|
122
|
+
eachArea(rangeRef: RangeRef, callback: (r: number, c: number, index: number) => void, reverse?: boolean): void;
|
|
123
|
+
showAllHidRows(): void;
|
|
124
|
+
showAllHidCols(): void;
|
|
125
|
+
addRows(startR: number, num: number): void;
|
|
126
|
+
addCols(startC: number, num: number): void;
|
|
127
|
+
delRows(startR: number, num: number): void;
|
|
128
|
+
delCols(startC: number, num: number): void;
|
|
129
|
+
mergeCells(rangeRef: RangeRef): void;
|
|
130
|
+
unMergeCells(cellRef: CellRef): void;
|
|
131
|
+
rangeSort(sortItems: SortItem[], range?: RangeRef): void;
|
|
132
|
+
insertTable(data: (ICellConfig | string | number)[][], startCell: CellRef, globalConfig?: any): RangeNum;
|
|
133
|
+
addDrawing(config: any): Drawing;
|
|
134
|
+
getDrawingsByCell(cellRef: CellRef): Drawing[];
|
|
135
|
+
removeDrawing(id: string): void;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class Utils {
|
|
139
|
+
static numToChar(num: number): string;
|
|
140
|
+
static charToNum(char: string): number;
|
|
141
|
+
static rangeNumToStr(rangeNum: RangeNum): string;
|
|
142
|
+
static cellStrToNum(cellStr: string): CellNum;
|
|
143
|
+
static cellNumToStr(cellNum: CellNum): string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export class UndoRedo {
|
|
147
|
+
undo(): void;
|
|
148
|
+
redo(): void;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export default class SheetNext {
|
|
152
|
+
constructor(dom: HTMLElement, options?: SheetNextOptions);
|
|
153
|
+
|
|
154
|
+
activeSheet: Sheet;
|
|
155
|
+
sheets: Sheet[];
|
|
156
|
+
readonly sheetNames: string[];
|
|
157
|
+
containerDom: HTMLElement;
|
|
158
|
+
namespace: string;
|
|
159
|
+
locked: boolean;
|
|
160
|
+
Utils: typeof Utils;
|
|
161
|
+
UndoRedo: UndoRedo;
|
|
162
|
+
|
|
163
|
+
addSheet(name?: string): Sheet;
|
|
164
|
+
delSheet(name: string): void;
|
|
165
|
+
getSheetByName(name: string): Sheet | null;
|
|
166
|
+
getVisibleSheetByIndex(index: number): Sheet;
|
|
167
|
+
import(file: File): Promise<void>;
|
|
168
|
+
export(type: 'XLSX'): void;
|
|
169
|
+
r(): void;
|
|
170
|
+
getLicenseInfo(): any;
|
|
171
|
+
}
|