@gridsheet/vue-core 0.1.0 → 2.0.0-0
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 +7 -7
- package/dist/GridSheet.vue.d.ts +11 -11
- package/dist/hub.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -33
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ This package requires the following peer dependency:
|
|
|
22
22
|
<h1>GridSheet Vue Example</h1>
|
|
23
23
|
<div class="grid-container">
|
|
24
24
|
<GridSheet
|
|
25
|
-
:
|
|
25
|
+
:hub="hub"
|
|
26
26
|
:initialCells="{
|
|
27
27
|
A1: { value: 'Hello' },
|
|
28
28
|
B1: { value: 'Vue', style: { backgroundColor: '#448888'} },
|
|
@@ -38,7 +38,7 @@ This package requires the following peer dependency:
|
|
|
38
38
|
/>
|
|
39
39
|
|
|
40
40
|
<GridSheet
|
|
41
|
-
:
|
|
41
|
+
:hub="hub"
|
|
42
42
|
:initialCells="{
|
|
43
43
|
C3: { value: '=SUM(Sheet1!A2:B3)' },
|
|
44
44
|
}"
|
|
@@ -50,8 +50,8 @@ This package requires the following peer dependency:
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup>
|
|
53
|
-
import { GridSheet,
|
|
54
|
-
const
|
|
53
|
+
import { GridSheet, useHub } from '@gridsheet/vue-core';
|
|
54
|
+
const hub = useHub();
|
|
55
55
|
</script>
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -62,12 +62,12 @@ const hubReactive = useHubReactive();
|
|
|
62
62
|
The main spreadsheet component for Vue 3 applications.
|
|
63
63
|
|
|
64
64
|
**Props:**
|
|
65
|
-
- `
|
|
65
|
+
- `hub` - Reactive hub for data binding and state management
|
|
66
66
|
- `initialCells` - Initial cell data with values, styles, and formulas
|
|
67
67
|
- `options` - GridSheet options (e.g., mode: 'dark')
|
|
68
68
|
- `sheetName` - Name of the sheet
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### useHub
|
|
71
71
|
|
|
72
72
|
A Vue 3-specific composable for creating reactive hubs that can be used for data binding and state management.
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ This package exports:
|
|
|
77
77
|
|
|
78
78
|
- All core GridSheet functionality from `@gridsheet/preact-core`
|
|
79
79
|
- `GridSheet` - Vue 3 component
|
|
80
|
-
- `
|
|
80
|
+
- `useHub` - Vue 3-specific reactive hub composable
|
|
81
81
|
|
|
82
82
|
## Development
|
|
83
83
|
|
package/dist/GridSheet.vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HubReactiveType, CellsByAddressType, OptionsType, TableRef } from '@gridsheet/preact-core';
|
|
2
1
|
import { Ref } from 'vue';
|
|
2
|
+
import { CellsByAddressType, OptionsType, HubType, Connector } from '@gridsheet/preact-core';
|
|
3
3
|
|
|
4
4
|
interface RefObject<T> {
|
|
5
5
|
readonly current: T | null;
|
|
@@ -13,12 +13,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
type: () =>
|
|
16
|
+
hub: {
|
|
17
|
+
type: () => HubType | Ref<HubType>;
|
|
18
18
|
default: null;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
type: () => RefObject<
|
|
20
|
+
connector: {
|
|
21
|
+
type: () => RefObject<Connector | null>;
|
|
22
22
|
default: null;
|
|
23
23
|
};
|
|
24
24
|
options: {
|
|
@@ -44,12 +44,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
default: string;
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
type: () =>
|
|
47
|
+
hub: {
|
|
48
|
+
type: () => HubType | Ref<HubType>;
|
|
49
49
|
default: null;
|
|
50
50
|
};
|
|
51
|
-
|
|
52
|
-
type: () => RefObject<
|
|
51
|
+
connector: {
|
|
52
|
+
type: () => RefObject<Connector | null>;
|
|
53
53
|
default: null;
|
|
54
54
|
};
|
|
55
55
|
options: {
|
|
@@ -66,8 +66,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
66
66
|
};
|
|
67
67
|
}>> & Readonly<{}>, {
|
|
68
68
|
sheetName: string;
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
hub: HubType | Ref<HubType, HubType>;
|
|
70
|
+
connector: RefObject<Connector | null>;
|
|
71
71
|
options: OptionsType;
|
|
72
72
|
className: string;
|
|
73
73
|
style: any;
|
package/dist/hub.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { WireProps } from '@gridsheet/preact-core';
|
|
2
|
+
|
|
3
|
+
export declare function useHub(wireProps?: WireProps): import('vue').ShallowRef<import('@gridsheet/preact-core').HubType, import('@gridsheet/preact-core').HubType>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { render as
|
|
1
|
+
import { render as i, h as s, GridSheet as f, createHub as d } from "@gridsheet/preact-core";
|
|
2
2
|
export * from "@gridsheet/preact-core";
|
|
3
|
-
import { defineComponent as h, ref as
|
|
4
|
-
const
|
|
3
|
+
import { defineComponent as h, ref as b, onMounted as m, isRef as c, watch as a, onBeforeUnmount as p, createElementBlock as _, openBlock as v, shallowRef as y } from "vue";
|
|
4
|
+
const O = h({
|
|
5
5
|
name: "GridSheet",
|
|
6
6
|
props: {
|
|
7
7
|
initialCells: {
|
|
@@ -12,11 +12,11 @@ const y = h({
|
|
|
12
12
|
type: String,
|
|
13
13
|
default: ""
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
hub: {
|
|
16
16
|
type: Object,
|
|
17
17
|
default: null
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
connector: {
|
|
20
20
|
type: Object,
|
|
21
21
|
default: null
|
|
22
22
|
},
|
|
@@ -34,54 +34,59 @@ const y = h({
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
setup(e) {
|
|
37
|
-
const
|
|
37
|
+
const r = b(null);
|
|
38
38
|
let t = null;
|
|
39
|
-
function
|
|
39
|
+
function u() {
|
|
40
|
+
const { tableRef: o, ...l } = e;
|
|
40
41
|
return {
|
|
41
|
-
...
|
|
42
|
-
|
|
42
|
+
...l,
|
|
43
|
+
hub: c(e.hub) ? e.hub.value : e.hub
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
function n() {
|
|
47
|
+
r.value && (t = r.value, i(
|
|
48
|
+
s(f, u()),
|
|
48
49
|
t
|
|
49
50
|
));
|
|
50
51
|
}
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
() => e.
|
|
54
|
-
|
|
52
|
+
return m(() => {
|
|
53
|
+
n(), c(e.hub) ? a(
|
|
54
|
+
() => e.hub.value,
|
|
55
|
+
n,
|
|
55
56
|
{ deep: !1 }
|
|
56
|
-
) :
|
|
57
|
-
() => e.
|
|
58
|
-
|
|
57
|
+
) : a(
|
|
58
|
+
() => e.hub,
|
|
59
|
+
n,
|
|
59
60
|
{ deep: !1 }
|
|
60
61
|
);
|
|
61
62
|
}), p(() => {
|
|
62
63
|
t && (t.innerHTML = "");
|
|
63
64
|
}), {
|
|
64
|
-
container:
|
|
65
|
+
container: r
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
}),
|
|
68
|
+
}), j = (e, r) => {
|
|
68
69
|
const t = e.__vccOpts || e;
|
|
69
|
-
for (const [
|
|
70
|
-
t[
|
|
70
|
+
for (const [u, n] of r)
|
|
71
|
+
t[u] = n;
|
|
71
72
|
return t;
|
|
72
73
|
}, S = { ref: "container" };
|
|
73
|
-
function
|
|
74
|
-
return
|
|
74
|
+
function g(e, r, t, u, n, o) {
|
|
75
|
+
return v(), _("div", S, null, 512);
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
-
function
|
|
78
|
-
const
|
|
79
|
-
function
|
|
80
|
-
Object.assign(
|
|
77
|
+
const G = /* @__PURE__ */ j(O, [["render", g]]);
|
|
78
|
+
function k(e = {}) {
|
|
79
|
+
const r = d(e), t = y(r), { wire: u } = t.value;
|
|
80
|
+
function n(o) {
|
|
81
|
+
Object.assign(u, o), u.ready && requestAnimationFrame(() => t.value = { ...t.value });
|
|
81
82
|
}
|
|
82
|
-
return
|
|
83
|
+
return u.transmit = n, a(
|
|
84
|
+
() => e,
|
|
85
|
+
(o) => n(o),
|
|
86
|
+
{ deep: !0 }
|
|
87
|
+
), t;
|
|
83
88
|
}
|
|
84
89
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
G as GridSheet,
|
|
91
|
+
k as useHub
|
|
87
92
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsheet/vue-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0-0",
|
|
4
|
+
"description": "Spreadsheet component for Vue 3",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"module": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
@@ -10,16 +11,23 @@
|
|
|
10
11
|
"build": "vite build",
|
|
11
12
|
"preview": "vite preview"
|
|
12
13
|
},
|
|
14
|
+
"homepage": "https://gridsheet.walkframe.com/",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/walkframe/gridsheet.git"
|
|
18
|
+
},
|
|
13
19
|
"peerDependencies": {
|
|
14
20
|
"vue": "^3.3.0"
|
|
15
21
|
},
|
|
16
22
|
"dependencies": {
|
|
17
|
-
"@gridsheet/preact-core": "^2.0.0
|
|
23
|
+
"@gridsheet/preact-core": "^2.0.0"
|
|
18
24
|
},
|
|
19
25
|
"devDependencies": {
|
|
20
26
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
21
27
|
"vue": "^3.4.21",
|
|
22
28
|
"vite": "^6.3.5",
|
|
23
29
|
"vite-plugin-dts": "^3.9.0"
|
|
24
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"author": "righ",
|
|
32
|
+
"license": "Apache-2.0"
|
|
25
33
|
}
|