@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 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
- :hubReactive="hubReactive"
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
- :hubReactive="hubReactive"
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, useHubReactive } from '@gridsheet/vue-core';
54
- const hubReactive = useHubReactive();
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
- - `hubReactive` - Reactive hub for data binding and state management
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
- ### useHubReactive
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
- - `useHubReactive` - Vue 3-specific reactive hub composable
80
+ - `useHub` - Vue 3-specific reactive hub composable
81
81
 
82
82
  ## Development
83
83
 
@@ -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
- hubReactive: {
17
- type: () => HubReactiveType | Ref<HubReactiveType>;
16
+ hub: {
17
+ type: () => HubType | Ref<HubType>;
18
18
  default: null;
19
19
  };
20
- tableRef: {
21
- type: () => RefObject<TableRef | null>;
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
- hubReactive: {
48
- type: () => HubReactiveType | Ref<HubReactiveType>;
47
+ hub: {
48
+ type: () => HubType | Ref<HubType>;
49
49
  default: null;
50
50
  };
51
- tableRef: {
52
- type: () => RefObject<TableRef | null>;
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
- hubReactive: HubReactiveType | Ref<HubReactiveType, HubReactiveType>;
70
- tableRef: RefObject<TableRef | null>;
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
- export declare function useHubReactive(historyLimit?: number): import('vue').ShallowRef<import('@gridsheet/preact-core').HubReactiveType, import('@gridsheet/preact-core').HubReactiveType>;
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
@@ -1,3 +1,3 @@
1
1
  export * from '@gridsheet/preact-core';
2
2
  export { default as GridSheet } from './GridSheet.vue';
3
- export { useHubReactive } from './hub';
3
+ export { useHub } from './hub';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { render as o, h as l, GridSheet as f, DEFAULT_HISTORY_LIMIT as s, createHubReactive as d } from "@gridsheet/preact-core";
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 v, onMounted as b, isRef as u, watch as i, onBeforeUnmount as p, createElementBlock as R, openBlock as m, shallowRef as _ } from "vue";
4
- const y = h({
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
- hubReactive: {
15
+ hub: {
16
16
  type: Object,
17
17
  default: null
18
18
  },
19
- tableRef: {
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 n = v(null);
37
+ const r = b(null);
38
38
  let t = null;
39
- function a() {
39
+ function u() {
40
+ const { tableRef: o, ...l } = e;
40
41
  return {
41
- ...e,
42
- hubReactive: u(e.hubReactive) ? e.hubReactive.value : e.hubReactive
42
+ ...l,
43
+ hub: c(e.hub) ? e.hub.value : e.hub
43
44
  };
44
45
  }
45
- function r() {
46
- n.value && (t = n.value, o(
47
- l(f, a()),
46
+ function n() {
47
+ r.value && (t = r.value, i(
48
+ s(f, u()),
48
49
  t
49
50
  ));
50
51
  }
51
- return b(() => {
52
- r(), u(e.hubReactive) ? i(
53
- () => e.hubReactive.value,
54
- r,
52
+ return m(() => {
53
+ n(), c(e.hub) ? a(
54
+ () => e.hub.value,
55
+ n,
55
56
  { deep: !1 }
56
- ) : i(
57
- () => e.hubReactive,
58
- r,
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: n
65
+ container: r
65
66
  };
66
67
  }
67
- }), O = (e, n) => {
68
+ }), j = (e, r) => {
68
69
  const t = e.__vccOpts || e;
69
- for (const [a, r] of n)
70
- t[a] = r;
70
+ for (const [u, n] of r)
71
+ t[u] = n;
71
72
  return t;
72
73
  }, S = { ref: "container" };
73
- function j(e, n, t, a, r, c) {
74
- return m(), R("div", S, null, 512);
74
+ function g(e, r, t, u, n, o) {
75
+ return v(), _("div", S, null, 512);
75
76
  }
76
- const x = /* @__PURE__ */ O(y, [["render", j]]);
77
- function G(e = s) {
78
- const n = d(e), t = _(n), { hub: a } = t.value;
79
- function r(c) {
80
- Object.assign(a, { ...c }), a.ready && requestAnimationFrame(() => t.value = { ...t.value });
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 a.reflect = r, t;
83
+ return u.transmit = n, a(
84
+ () => e,
85
+ (o) => n(o),
86
+ { deep: !0 }
87
+ ), t;
83
88
  }
84
89
  export {
85
- x as GridSheet,
86
- G as useHubReactive
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.1.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-rc.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
  }