@gridsheet/vue-core 3.0.0-rc.11 → 3.0.0-rc.13
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 +52 -38
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Spreadsheet component for Vue 3
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @gridsheet/vue-core
|
|
8
|
+
npm install @gridsheet/vue-core @gridsheet/functions
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
### Peer Dependencies
|
|
@@ -19,39 +19,37 @@ This package requires the following peer dependency:
|
|
|
19
19
|
```vue
|
|
20
20
|
<template>
|
|
21
21
|
<main>
|
|
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
|
-
sheetName="Sheet2"
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
22
|
+
<GridSheet
|
|
23
|
+
:book="book"
|
|
24
|
+
:initialCells="{
|
|
25
|
+
A1: { value: 'Hello' },
|
|
26
|
+
B1: { value: 'Vue', style: { backgroundColor: '#448888'} },
|
|
27
|
+
A2: { value: 123 },
|
|
28
|
+
B2: { value: 456 },
|
|
29
|
+
A3: { value: 789},
|
|
30
|
+
C6: { value: '=SUM(A2:B2)' },
|
|
31
|
+
}"
|
|
32
|
+
:options="{
|
|
33
|
+
mode: 'dark',
|
|
34
|
+
}"
|
|
35
|
+
sheetName="Sheet1"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<GridSheet
|
|
39
|
+
:book="book"
|
|
40
|
+
:initialCells="{
|
|
41
|
+
C3: { value: '=SUM(Sheet1!A2:B3)' },
|
|
42
|
+
}"
|
|
43
|
+
:options="{}"
|
|
44
|
+
sheetName="Sheet2"
|
|
45
|
+
/>
|
|
49
46
|
</main>
|
|
50
47
|
</template>
|
|
51
48
|
|
|
52
49
|
<script setup>
|
|
53
|
-
import { GridSheet
|
|
54
|
-
|
|
50
|
+
import { GridSheet } from '@gridsheet/vue-core';
|
|
51
|
+
import { useSpellbook } from '@gridsheet/vue-core/spellbook'; // requires @gridsheet/functions
|
|
52
|
+
const book = useSpellbook();
|
|
55
53
|
</script>
|
|
56
54
|
```
|
|
57
55
|
|
|
@@ -62,14 +60,32 @@ const hub = useHub();
|
|
|
62
60
|
The main spreadsheet component for Vue 3 applications.
|
|
63
61
|
|
|
64
62
|
**Props:**
|
|
65
|
-
- `
|
|
63
|
+
- `book` - Book object for cross-sheet data binding and state management
|
|
66
64
|
- `initialCells` - Initial cell data with values, styles, and formulas
|
|
67
65
|
- `options` - GridSheet options (e.g., mode: 'dark')
|
|
68
66
|
- `sheetName` - Name of the sheet
|
|
67
|
+
- `sheetRef` - Ref object to access sheet handle
|
|
68
|
+
- `storeRef` - Ref object to access store handle
|
|
69
|
+
- `className` - CSS class name
|
|
70
|
+
- `style` - Inline styles
|
|
69
71
|
|
|
70
|
-
###
|
|
72
|
+
### useSpellbook
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
Creates a reactive book with all extended functions (`@gridsheet/functions`) pre-loaded. Returns a `shallowRef<BookType>`.
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
import { useSpellbook } from '@gridsheet/vue-core/spellbook'; // requires @gridsheet/functions
|
|
78
|
+
const book = useSpellbook({ /* RegistryProps */ });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### useBook
|
|
82
|
+
|
|
83
|
+
Same as `useSpellbook` but without extended functions.
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
import { useBook } from '@gridsheet/vue-core';
|
|
87
|
+
const book = useBook({ /* RegistryProps */ });
|
|
88
|
+
```
|
|
73
89
|
|
|
74
90
|
## Exports
|
|
75
91
|
|
|
@@ -77,7 +93,8 @@ This package exports:
|
|
|
77
93
|
|
|
78
94
|
- All core GridSheet functionality from `@gridsheet/preact-core`
|
|
79
95
|
- `GridSheet` - Vue 3 component
|
|
80
|
-
- `
|
|
96
|
+
- `useBook` - Vue 3-specific reactive book composable
|
|
97
|
+
- `@gridsheet/vue-core/spellbook` - `useSpellbook`, `createSpellbook`
|
|
81
98
|
|
|
82
99
|
## Docs
|
|
83
100
|
|
|
@@ -92,11 +109,8 @@ pnpm dev
|
|
|
92
109
|
|
|
93
110
|
# Build the package
|
|
94
111
|
pnpm build
|
|
95
|
-
|
|
96
|
-
# Preview the build
|
|
97
|
-
pnpm preview
|
|
98
112
|
```
|
|
99
113
|
|
|
100
114
|
## License
|
|
101
115
|
|
|
102
|
-
Apache-2.0
|
|
116
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsheet/vue-core",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.13",
|
|
4
4
|
"description": "Spreadsheet component for Vue 3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"vue": "^3.3.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@gridsheet/preact-core": "3.0.0-rc.
|
|
32
|
+
"@gridsheet/preact-core": "3.0.0-rc.13"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
36
36
|
"vue": "^3.4.21",
|
|
37
37
|
"vite": "^6.3.5",
|
|
38
38
|
"vite-plugin-dts": "^4.5.3",
|
|
39
|
-
"@gridsheet/functions": "3.0.0-rc.
|
|
39
|
+
"@gridsheet/functions": "3.0.0-rc.13"
|
|
40
40
|
},
|
|
41
41
|
"author": "righ",
|
|
42
42
|
"license": "Apache-2.0",
|