sheetnext 0.2.4 → 0.2.5

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.
@@ -0,0 +1,56 @@
1
+ # SheetNext Recipes
2
+
3
+ Short patterns for common SheetNext development tasks. Check `core-api.md` for exact signatures before expanding these examples.
4
+
5
+ ## Initialize
6
+
7
+ ```js
8
+ import SheetNext from 'sheetnext';
9
+ import 'sheetnext.css';
10
+
11
+ const SN = new SheetNext(document.querySelector('#SNContainer'));
12
+ ```
13
+
14
+ ## Insert A Template
15
+
16
+ ```js
17
+ const sheet = SN.activeSheet;
18
+ const template = [
19
+ [{ v: 'Title', mr: 2, b: true, s: 16, h: 36 }, '', ''],
20
+ ['Name', 'Amount', 'Remark'],
21
+ ['Example', 100, '']
22
+ ];
23
+
24
+ sheet.insertTemplate(template, 'A1', { border: true, align: 'center', width: 120 });
25
+ ```
26
+
27
+ ## Read And Write Cells
28
+
29
+ ```js
30
+ const sheet = SN.activeSheet;
31
+ sheet.getCell('A1').value = 'Name';
32
+ sheet.getCell('B1').value = 'Amount';
33
+ sheet.getCell('B2').numFmt = '#,##0.00';
34
+ ```
35
+
36
+ ## Listen To Events
37
+
38
+ ```js
39
+ SN.Event.on('afterSelectionChange', (e) => {
40
+ console.log(e.data.newCell);
41
+ });
42
+ ```
43
+
44
+ ## JSON Import And Export
45
+
46
+ ```js
47
+ const data = await SN.IO.getData();
48
+ SN.IO.setData(data);
49
+ ```
50
+
51
+ ## File Export
52
+
53
+ ```js
54
+ await SN.IO.export('XLSX');
55
+ await SN.IO.export('CSV');
56
+ ```
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "sheetnext",
3
- "version": "0.2.4",
4
- "description": "A pure front-end spreadsheet component with Excel-like capabilities, built-in native AI workflows, and flexible LLM integration for data operations.",
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
- "license": "Apache-2.0",
14
- "main": "dist/sheetnext.umd.js",
15
- "module": "dist/sheetnext.es.js",
16
- "exports": {
17
- ".": {
18
- "import": "./dist/sheetnext.es.js",
19
- "require": "./dist/sheetnext.umd.js"
20
- },
21
- "./dist/sheetnext.css": "./dist/sheetnext.css",
22
- "./locales/zh-CN": {
23
- "import": "./dist/sheetnext.locale.zh-CN.es.js",
24
- "require": "./dist/sheetnext.locale.zh-CN.umd.js"
25
- }
26
- },
27
- "files": [
28
- "dist",
29
- "README.md",
30
- "README_CN.md",
31
- "docs",
32
- "docs/logo.png",
33
- "docs/image_en.png"
34
- ],
35
- "scripts": {
36
- "dev": "vite",
37
- "build": "vite build",
38
- "preview": "vite preview"
39
- },
40
- "keywords": [
41
- "spreadsheet",
42
- "excel",
43
- "editor",
44
- "table",
45
- "ai",
46
- "sheetnext",
47
- "sheet",
48
- "spreadsheet editor",
49
- "ai excel",
50
- "ai spreadsheet"
51
- ],
52
- "dependencies": {
53
- "fast-xml-parser": "^5.3.0"
54
- },
55
- "devDependencies": {
56
- "vite": "^7.1.9"
57
- }
58
- }
1
+ {
2
+ "name": "sheetnext",
3
+ "version": "0.2.5",
4
+ "description": "A pure front-end spreadsheet component with Excel-like capabilities, built-in native AI workflows, and flexible LLM integration for data operations.",
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
+ "license": "Apache-2.0",
14
+ "main": "dist/sheetnext.umd.js",
15
+ "module": "dist/sheetnext.es.js",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/sheetnext.es.js",
19
+ "require": "./dist/sheetnext.umd.js"
20
+ },
21
+ "./dist/sheetnext.css": "./dist/sheetnext.css",
22
+ "./locales/zh-CN": {
23
+ "import": "./dist/sheetnext.locale.zh-CN.es.js",
24
+ "require": "./dist/sheetnext.locale.zh-CN.umd.js"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md",
30
+ "README_CN.md",
31
+ "docs",
32
+ "docs/logo.png",
33
+ "docs/image_en.png"
34
+ ],
35
+ "scripts": {
36
+ "dev": "vite",
37
+ "build": "vite build",
38
+ "preview": "vite preview"
39
+ },
40
+ "keywords": [
41
+ "spreadsheet",
42
+ "excel",
43
+ "editor",
44
+ "table",
45
+ "ai",
46
+ "sheetnext",
47
+ "sheet",
48
+ "spreadsheet editor",
49
+ "ai excel",
50
+ "ai spreadsheet"
51
+ ],
52
+ "dependencies": {
53
+ "fast-xml-parser": "^5.3.0"
54
+ },
55
+ "devDependencies": {
56
+ "vite": "^7.1.9"
57
+ }
58
+ }