@sheetwrite/vue 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sheetwrite contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @sheetwrite/vue
2
+
3
+ Vue 3 components for Sheetwrite.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ bun add @sheetwrite/vue
9
+ ```
10
+
11
+ Vue 3.4 or newer is a peer dependency. Core and WASM arrive transitively.
12
+
13
+ ## Data-first component
14
+
15
+ ```vue
16
+ <script setup lang="ts">
17
+ import { Sheetwrite } from "@sheetwrite/vue";
18
+ import "@sheetwrite/vue/styles.css";
19
+ </script>
20
+
21
+ <template>
22
+ <Sheetwrite
23
+ :columns="columns"
24
+ :default-rows="products"
25
+ height="500px"
26
+ @grid-change="(event) => console.log(event.source, event.transaction.patches)"
27
+ />
28
+ </template>
29
+ ```
30
+
31
+ `defaultRows` seeds an uncontrolled grid and is never mutated. A new array identity deliberately creates a new generation. Use `height` or `fill`; `fill` requires an already-sized ancestor.
32
+
33
+ `grid-change` observes the complete transaction. Do not persist only
34
+ `event.changes`; use `event.transaction.patches` or attach `SyncCoordinator` to
35
+ the exposed `Grid` for mutation IDs, acknowledgements, retry, and remote ordering.
36
+
37
+ WASM initializes on client mount. Supply a `#fallback` slot while loading, observe `@initialization-error`, and use `wasm-source` only for explicit asset control.
38
+
39
+ ## Advanced component
40
+
41
+ ```vue
42
+ <SheetwriteGrid ref="gridComponent" :workbook="workbook" :data="data" fill />
43
+ ```
44
+
45
+ The exposed `grid` handle is published before `@ready="({ grid, generation, reason }) => …"` and clears during replacement/unmount. Reset-bound inputs are `workbook`, `data`, `datasource`, `datasourceStorage`, `renderer`, `workerUrl`, and `renderers`; `theme`, `readOnly`, `config`, `overscan`, and `minColumns` update live.
46
+
47
+ Events are `grid-change`, `viewport-change`, `selection-change`, `edit-begin`, `edit-commit`, `search`, `active-sheet-change`, `ready`, and `initialization-error`. Native DOM change/scroll listeners remain available on the host.
48
+
49
+ For vanilla/preload control, use `initSheetwrite()` and `createGrid()` from `@sheetwrite/core`. See [installation](https://sheetwrite.vercel.app/docs/start/installation/), [Vue integration](https://sheetwrite.vercel.app/docs/frameworks/vue/), and [collaboration](https://sheetwrite.vercel.app/docs/guides/collaboration/).
50
+
51
+ XLSX is not installed by this adapter. If the toolbar configuration enables
52
+ XLSX export, install `@sheetwrite/xlsx` and import
53
+ `@sheetwrite/xlsx/register` before the action (or lazily inside its handler).
54
+ CSV/TSV require no optional package.
@@ -0,0 +1,304 @@
1
+ import { type CellRenderer, type CellScalar, type ChangeEvent, type ColumnarData, type DataSource, type DataSourceStorageOptions, type Grid, type GridEvents, type GridOptions, type Selection, type Theme, type Workbook } from "@sheetwrite/core";
2
+ import { type GridReadyEvent, type SheetwriteInitializationProps } from "@sheetwrite/core/adapter";
3
+ import { type PropType } from "vue";
4
+ /** Imperative Grid handle exposed by the Vue advanced component. */
5
+ export interface SheetwriteGridExpose {
6
+ /** Live Grid after readiness, or `null` before initialization and during teardown. */
7
+ grid: Grid | null;
8
+ }
9
+ declare const SheetwriteGridComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ /** Live workbook schema adopted by the Grid. */
11
+ workbook: {
12
+ type: PropType<Workbook>;
13
+ required: true;
14
+ };
15
+ /** Eager column-major values for the active sheet. */
16
+ data: {
17
+ type: PropType<ColumnarData>;
18
+ default: undefined;
19
+ };
20
+ /** Lazy row provider requested for visible windows. */
21
+ datasource: {
22
+ type: PropType<DataSource>;
23
+ default: undefined;
24
+ };
25
+ /** Allocation and cache policy for datasource storage. */
26
+ datasourceStorage: {
27
+ type: PropType<DataSourceStorageOptions>;
28
+ default: undefined;
29
+ };
30
+ /** Paint backend; defaults to main-thread canvas. */
31
+ renderer: {
32
+ type: PropType<GridOptions["renderer"]>;
33
+ default: undefined;
34
+ };
35
+ /** Browser-fetchable worker module URL. */
36
+ workerUrl: {
37
+ type: PropType<GridOptions["workerUrl"]>;
38
+ default: undefined;
39
+ };
40
+ /** Live overrides merged into the resolved Grid theme. */
41
+ theme: {
42
+ type: PropType<Partial<Theme>>;
43
+ default: undefined;
44
+ };
45
+ /** Disables mutation while preserving navigation and selection. */
46
+ readOnly: {
47
+ type: BooleanConstructor;
48
+ default: undefined;
49
+ };
50
+ /** Host-owned client permission check for protected ranges. */
51
+ protectionResolver: {
52
+ type: PropType<GridOptions["protectionResolver"]>;
53
+ default: undefined;
54
+ };
55
+ /** Atomic or partial handling for denied local operations. */
56
+ mutationPolicy: {
57
+ type: PropType<GridOptions["mutationPolicy"]>;
58
+ default: undefined;
59
+ };
60
+ /** Named custom renderers registered when the Grid is created. */
61
+ renderers: {
62
+ type: PropType<Record<string, CellRenderer>>;
63
+ default: undefined;
64
+ };
65
+ /** Extra rows painted above and below the viewport. */
66
+ overscan: {
67
+ type: NumberConstructor;
68
+ default: undefined;
69
+ };
70
+ /** Minimum rendered column count, including empty padding columns. */
71
+ minColumns: {
72
+ type: NumberConstructor;
73
+ default: undefined;
74
+ };
75
+ /** Built-in toolbar, menu, keyboard, find, and tab controls. */
76
+ config: {
77
+ type: PropType<GridOptions["config"]>;
78
+ default: undefined;
79
+ };
80
+ /** Explicit source passed to process-wide WASM initialization. */
81
+ wasmSource: {
82
+ type: PropType<SheetwriteInitializationProps["wasmSource"]>;
83
+ default: undefined;
84
+ };
85
+ /** Host height in CSS pixels for numbers or any CSS length string. */
86
+ height: {
87
+ type: (NumberConstructor | StringConstructor)[];
88
+ default: undefined;
89
+ };
90
+ /** Fills the parent's available width and height. */
91
+ fill: {
92
+ type: BooleanConstructor;
93
+ default: undefined;
94
+ };
95
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
96
+ [key: string]: any;
97
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
98
+ "grid-change": (_event: ChangeEvent) => boolean;
99
+ "selection-change": (_selection: Selection | null) => boolean;
100
+ "viewport-change": (_event: GridEvents["scroll"]) => boolean;
101
+ "edit-begin": (_event: GridEvents["edit-begin"]) => boolean;
102
+ "edit-commit": (_event: GridEvents["edit-commit"]) => boolean;
103
+ search: (_result: GridEvents["search"]) => boolean;
104
+ "active-sheet-change": (_event: GridEvents["active-sheet"]) => boolean;
105
+ ready: (_event: GridReadyEvent) => boolean;
106
+ "initialization-error": (_error: unknown) => boolean;
107
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
108
+ /** Live workbook schema adopted by the Grid. */
109
+ workbook: {
110
+ type: PropType<Workbook>;
111
+ required: true;
112
+ };
113
+ /** Eager column-major values for the active sheet. */
114
+ data: {
115
+ type: PropType<ColumnarData>;
116
+ default: undefined;
117
+ };
118
+ /** Lazy row provider requested for visible windows. */
119
+ datasource: {
120
+ type: PropType<DataSource>;
121
+ default: undefined;
122
+ };
123
+ /** Allocation and cache policy for datasource storage. */
124
+ datasourceStorage: {
125
+ type: PropType<DataSourceStorageOptions>;
126
+ default: undefined;
127
+ };
128
+ /** Paint backend; defaults to main-thread canvas. */
129
+ renderer: {
130
+ type: PropType<GridOptions["renderer"]>;
131
+ default: undefined;
132
+ };
133
+ /** Browser-fetchable worker module URL. */
134
+ workerUrl: {
135
+ type: PropType<GridOptions["workerUrl"]>;
136
+ default: undefined;
137
+ };
138
+ /** Live overrides merged into the resolved Grid theme. */
139
+ theme: {
140
+ type: PropType<Partial<Theme>>;
141
+ default: undefined;
142
+ };
143
+ /** Disables mutation while preserving navigation and selection. */
144
+ readOnly: {
145
+ type: BooleanConstructor;
146
+ default: undefined;
147
+ };
148
+ /** Host-owned client permission check for protected ranges. */
149
+ protectionResolver: {
150
+ type: PropType<GridOptions["protectionResolver"]>;
151
+ default: undefined;
152
+ };
153
+ /** Atomic or partial handling for denied local operations. */
154
+ mutationPolicy: {
155
+ type: PropType<GridOptions["mutationPolicy"]>;
156
+ default: undefined;
157
+ };
158
+ /** Named custom renderers registered when the Grid is created. */
159
+ renderers: {
160
+ type: PropType<Record<string, CellRenderer>>;
161
+ default: undefined;
162
+ };
163
+ /** Extra rows painted above and below the viewport. */
164
+ overscan: {
165
+ type: NumberConstructor;
166
+ default: undefined;
167
+ };
168
+ /** Minimum rendered column count, including empty padding columns. */
169
+ minColumns: {
170
+ type: NumberConstructor;
171
+ default: undefined;
172
+ };
173
+ /** Built-in toolbar, menu, keyboard, find, and tab controls. */
174
+ config: {
175
+ type: PropType<GridOptions["config"]>;
176
+ default: undefined;
177
+ };
178
+ /** Explicit source passed to process-wide WASM initialization. */
179
+ wasmSource: {
180
+ type: PropType<SheetwriteInitializationProps["wasmSource"]>;
181
+ default: undefined;
182
+ };
183
+ /** Host height in CSS pixels for numbers or any CSS length string. */
184
+ height: {
185
+ type: (NumberConstructor | StringConstructor)[];
186
+ default: undefined;
187
+ };
188
+ /** Fills the parent's available width and height. */
189
+ fill: {
190
+ type: BooleanConstructor;
191
+ default: undefined;
192
+ };
193
+ }>> & Readonly<{
194
+ "onActive-sheet-change"?: ((_event: {
195
+ sheet: import("@sheetwrite/core").SheetId;
196
+ }) => any) | undefined;
197
+ "onEdit-begin"?: ((_event: {
198
+ addr: import("@sheetwrite/core").CellAddress;
199
+ }) => any) | undefined;
200
+ "onEdit-commit"?: ((_event: {
201
+ addr: import("@sheetwrite/core").CellAddress;
202
+ value: import("@sheetwrite/core").CellValue;
203
+ }) => any) | undefined;
204
+ "onGrid-change"?: ((_event: ChangeEvent) => any) | undefined;
205
+ "onInitialization-error"?: ((_error: unknown) => any) | undefined;
206
+ onReady?: ((_event: GridReadyEvent) => any) | undefined;
207
+ onSearch?: ((_result: import("@sheetwrite/core").SearchResult) => any) | undefined;
208
+ "onSelection-change"?: ((_selection: Selection | null) => any) | undefined;
209
+ "onViewport-change"?: ((_event: {
210
+ scrollTop: number;
211
+ firstRow: number;
212
+ lastRow: number;
213
+ }) => any) | undefined;
214
+ }>, {
215
+ data: ColumnarData;
216
+ datasource: DataSource;
217
+ datasourceStorage: DataSourceStorageOptions;
218
+ renderer: "canvas" | "worker" | undefined;
219
+ workerUrl: string | URL | undefined;
220
+ theme: Partial<Theme>;
221
+ readOnly: boolean;
222
+ protectionResolver: import("@sheetwrite/core").ProtectionResolver | undefined;
223
+ mutationPolicy: import("@sheetwrite/core").MutationPolicyMode | undefined;
224
+ renderers: Record<string, CellRenderer>;
225
+ overscan: number;
226
+ minColumns: number;
227
+ config: import("@sheetwrite/core").GridConfig | undefined;
228
+ wasmSource: string | WebAssembly.Module | Request | URL | BufferSource | undefined;
229
+ height: string | number;
230
+ fill: boolean;
231
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
232
+ /** Advanced framework component for workbook data or datasource input. */
233
+ export declare const SheetwriteGrid: typeof SheetwriteGridComponent & {
234
+ new (): InstanceType<typeof SheetwriteGridComponent> & SheetwriteGridExpose;
235
+ };
236
+ /** Convenience component for local object rows with live option updates. */
237
+ export declare const Sheetwrite: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
238
+ /** Ordered schema used to derive the component-owned sheet. */
239
+ columns: {
240
+ type: PropType<readonly {
241
+ key: string;
242
+ title: string;
243
+ }[]>;
244
+ required: true;
245
+ };
246
+ /** Rows converted to initial columnar data; missing keys become `null`. */
247
+ defaultRows: {
248
+ type: PropType<readonly Record<string, CellScalar>[]>;
249
+ required: true;
250
+ };
251
+ /** Generated sheet name; defaults to `Sheet 1`. */
252
+ sheetName: {
253
+ type: StringConstructor;
254
+ default: undefined;
255
+ };
256
+ /** Host height in CSS pixels for numbers or any CSS length string. */
257
+ height: {
258
+ type: (NumberConstructor | StringConstructor)[];
259
+ default: undefined;
260
+ };
261
+ /** Fills the parent; exactly one of `fill` or `height` is required. */
262
+ fill: {
263
+ type: BooleanConstructor;
264
+ default: undefined;
265
+ };
266
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
267
+ [key: string]: any;
268
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
269
+ /** Ordered schema used to derive the component-owned sheet. */
270
+ columns: {
271
+ type: PropType<readonly {
272
+ key: string;
273
+ title: string;
274
+ }[]>;
275
+ required: true;
276
+ };
277
+ /** Rows converted to initial columnar data; missing keys become `null`. */
278
+ defaultRows: {
279
+ type: PropType<readonly Record<string, CellScalar>[]>;
280
+ required: true;
281
+ };
282
+ /** Generated sheet name; defaults to `Sheet 1`. */
283
+ sheetName: {
284
+ type: StringConstructor;
285
+ default: undefined;
286
+ };
287
+ /** Host height in CSS pixels for numbers or any CSS length string. */
288
+ height: {
289
+ type: (NumberConstructor | StringConstructor)[];
290
+ default: undefined;
291
+ };
292
+ /** Fills the parent; exactly one of `fill` or `height` is required. */
293
+ fill: {
294
+ type: BooleanConstructor;
295
+ default: undefined;
296
+ };
297
+ }>> & Readonly<{}>, {
298
+ sheetName: string;
299
+ height: string | number;
300
+ fill: boolean;
301
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
302
+ export type { CellScalar, Grid } from "@sheetwrite/core";
303
+ export type { GridReadyEvent, SimpleColumn } from "@sheetwrite/core/adapter";
304
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,WAAW,EAGhB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKL,KAAK,cAAc,EAInB,KAAK,6BAA6B,EAEnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAML,KAAK,QAAQ,EAId,MAAM,KAAK,CAAC;AAEb,oEAAoE;AACpE,MAAM,WAAW,oBAAoB;IACnC,sFAAsF;IACtF,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB;AAkED,QAAA,MAAM,uBAAuB;IA/D3B,gDAAgD;;QACpC,IAAI,EAAY,QAAQ,CAAC,QAAQ,CAAC;QAAE,QAAQ;;IACxD,sDAAsD;;QAC9C,IAAI,EAAY,QAAQ,CAAC,YAAY,CAAC;QAAE,OAAO;;IACvD,uDAAuD;;QACzC,IAAI,EAAY,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO;;IAC3D,0DAA0D;;QAExD,IAAI,EAAY,QAAQ,CAAC,wBAAwB,CAAC;QAClD,OAAO;;IAET,qDAAqD;;QACzC,IAAI,EAAY,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAA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3C,0DAA0D;;;;;IAE1D,mEAAmE;;;;;IAEnE,+DAA+D;;;;;IAK/D,8DAA8D;;;;;IAK9D,kEAAkE;;;;;IAElE,uDAAuD;;;;;IAEvD,sEAAsE;;;;;IAEtE,gEAAgE;;;;;IAEhE,kEAAkE;;;;;IAKlE,sEAAsE;;;;;IAEtE,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAqKrD,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,cAAc,EAA8B,OAAO,uBAAuB,GAAG;IACxF,QAAQ,YAAY,CAAC,OAAO,uBAAuB,CAAC,GAAG,oBAAoB,CAAC;CAC7E,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,UAAU;IAInB,+DAA+D;;cACrC,QAAQ,CAAC,SAAS;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;;;IAC7E,2EAA2E;;cAC7C,QAAQ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;;;IAC7E,mDAAmD;;QACtC,IAAI;QAAU,OAAO;;IAClC,sEAAsE;;QAC5D,IAAI;QAAoB,OAAO;;IACzC,uEAAuE;;QAC/D,IAAI;QAAW,OAAO;;;;;IAT9B,+DAA+D;;;;;;;;IAE/D,2EAA2E;;;;;IAE3E,mDAAmD;;;;;IAEnD,sEAAsE;;;;;IAEtE,uEAAuE;;;;;;;;;4EAkCzE,CAAC;AAEH,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,208 @@
1
+ import { initSheetwrite, isSheetwriteReady, } from "@sheetwrite/core";
2
+ import { createGridController, createSimpleGridInput, getGridResetReason, gridSizeStyle, } from "@sheetwrite/core/adapter";
3
+ import { defineComponent, h, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch, } from "vue";
4
+ const gridProps = {
5
+ workbook: { type: Object, required: true },
6
+ data: { type: Object, default: undefined },
7
+ datasource: { type: Object, default: undefined },
8
+ datasourceStorage: {
9
+ type: Object,
10
+ default: undefined,
11
+ },
12
+ renderer: { type: String, default: undefined },
13
+ workerUrl: {
14
+ type: [String, URL],
15
+ default: undefined,
16
+ },
17
+ theme: { type: Object, default: undefined },
18
+ readOnly: { type: Boolean, default: undefined },
19
+ protectionResolver: {
20
+ type: Function,
21
+ default: undefined,
22
+ },
23
+ mutationPolicy: {
24
+ type: String,
25
+ default: undefined,
26
+ },
27
+ renderers: { type: Object, default: undefined },
28
+ overscan: { type: Number, default: undefined },
29
+ minColumns: { type: Number, default: undefined },
30
+ config: { type: Object, default: undefined },
31
+ wasmSource: {
32
+ type: [Object, String],
33
+ default: undefined,
34
+ },
35
+ height: { type: [Number, String], default: undefined },
36
+ fill: { type: Boolean, default: undefined },
37
+ };
38
+ const gridEmits = {
39
+ "grid-change": (_event) => true,
40
+ "selection-change": (_selection) => true,
41
+ "viewport-change": (_event) => true,
42
+ "edit-begin": (_event) => true,
43
+ "edit-commit": (_event) => true,
44
+ search: (_result) => true,
45
+ "active-sheet-change": (_event) => true,
46
+ ready: (_event) => true,
47
+ "initialization-error": (_error) => true,
48
+ };
49
+ const SheetwriteGridComponent = defineComponent({
50
+ name: "SheetwriteGrid",
51
+ inheritAttrs: false,
52
+ props: gridProps,
53
+ emits: gridEmits,
54
+ setup(props, { attrs, emit, expose, slots }) {
55
+ const host = ref(null);
56
+ const exposedGrid = shallowRef(null);
57
+ let controller = null;
58
+ let generation = 0;
59
+ let previousOptions = null;
60
+ let mounted = false;
61
+ let initializationToken = 0;
62
+ const handlers = {
63
+ onGridChange: (event) => emit("grid-change", event),
64
+ onSelectionChange: (selection) => emit("selection-change", selection),
65
+ onViewportChange: (event) => emit("viewport-change", event),
66
+ onEditBegin: (event) => emit("edit-begin", event),
67
+ onEditCommit: (event) => emit("edit-commit", event),
68
+ onSearch: (result) => emit("search", result),
69
+ onActiveSheetChange: (event) => emit("active-sheet-change", event),
70
+ };
71
+ function currentOptions() {
72
+ return {
73
+ workbook: props.workbook,
74
+ data: props.data,
75
+ datasource: props.datasource,
76
+ datasourceStorage: props.datasourceStorage,
77
+ renderer: props.renderer,
78
+ workerUrl: props.workerUrl,
79
+ theme: props.theme,
80
+ readOnly: props.readOnly,
81
+ protectionResolver: props.protectionResolver,
82
+ mutationPolicy: props.mutationPolicy,
83
+ renderers: props.renderers,
84
+ overscan: props.overscan,
85
+ minColumns: props.minColumns,
86
+ config: props.config,
87
+ };
88
+ }
89
+ function teardownGrid() {
90
+ exposedGrid.value = null;
91
+ controller?.destroy();
92
+ controller = null;
93
+ }
94
+ async function createCurrentGrid() {
95
+ if (!mounted || !host.value)
96
+ return;
97
+ const options = currentOptions();
98
+ const reason = generation === 0
99
+ ? "initial"
100
+ : ((previousOptions && getGridResetReason(previousOptions, options)) ?? "input-reset");
101
+ teardownGrid();
102
+ const created = createGridController(host.value, options, handlers);
103
+ controller = created;
104
+ generation += 1;
105
+ previousOptions = options;
106
+ exposedGrid.value = created.grid;
107
+ await nextTick();
108
+ if (controller !== created)
109
+ return;
110
+ emit("ready", { grid: created.grid, generation, reason });
111
+ }
112
+ async function initialize() {
113
+ const token = ++initializationToken;
114
+ const alreadyReady = isSheetwriteReady();
115
+ try {
116
+ const initialization = initSheetwrite(props.wasmSource);
117
+ if (alreadyReady && mounted && !controller)
118
+ await createCurrentGrid();
119
+ await initialization;
120
+ if (!alreadyReady && mounted && isSheetwriteReady() && !controller) {
121
+ await createCurrentGrid();
122
+ }
123
+ }
124
+ catch (error) {
125
+ if (mounted && token === initializationToken)
126
+ emit("initialization-error", error);
127
+ }
128
+ }
129
+ onMounted(() => {
130
+ mounted = true;
131
+ void initialize();
132
+ });
133
+ onBeforeUnmount(() => {
134
+ mounted = false;
135
+ initializationToken += 1;
136
+ teardownGrid();
137
+ });
138
+ watch(() => props.wasmSource, () => {
139
+ void initialize();
140
+ });
141
+ watch(() => [
142
+ props.workbook,
143
+ props.data,
144
+ props.datasource,
145
+ props.datasourceStorage,
146
+ props.renderer,
147
+ props.workerUrl,
148
+ props.protectionResolver,
149
+ props.mutationPolicy,
150
+ props.renderers,
151
+ ], () => {
152
+ if (isSheetwriteReady())
153
+ void createCurrentGrid();
154
+ });
155
+ watch(() => props.readOnly, (value) => controller?.setReadOnly(value ?? false));
156
+ watch(() => props.config, (value) => controller?.setConfig(value));
157
+ watch(() => props.theme, (value) => controller?.setTheme(value));
158
+ watch(() => props.overscan, (value) => controller?.setOverscan(value));
159
+ watch(() => props.minColumns, (value) => controller?.setMinColumns(value));
160
+ expose({ grid: exposedGrid });
161
+ return () => {
162
+ const style = [
163
+ attrs.style,
164
+ gridSizeStyle({ height: props.height, fill: props.fill || undefined }),
165
+ ];
166
+ return h("div", { ...attrs, ref: host, class: ["sheetwrite", attrs.class], style }, exposedGrid.value ? undefined : slots.fallback?.());
167
+ };
168
+ },
169
+ });
170
+ export const SheetwriteGrid = SheetwriteGridComponent;
171
+ export const Sheetwrite = defineComponent({
172
+ name: "SheetwriteComponent",
173
+ inheritAttrs: false,
174
+ props: {
175
+ columns: { type: Array, required: true },
176
+ defaultRows: { type: Array, required: true },
177
+ sheetName: { type: String, default: undefined },
178
+ height: { type: [Number, String], default: undefined },
179
+ fill: { type: Boolean, default: undefined },
180
+ },
181
+ setup(props, { attrs, slots }) {
182
+ let input = null;
183
+ let inputColumns = null;
184
+ let inputRows = null;
185
+ let inputSheetName;
186
+ return () => {
187
+ if ((props.height === undefined && !props.fill) ||
188
+ (props.height !== undefined && props.fill)) {
189
+ throw new Error("Sheetwrite: provide exactly one of height or fill");
190
+ }
191
+ if (input === null ||
192
+ inputColumns !== props.columns ||
193
+ inputRows !== props.defaultRows ||
194
+ inputSheetName !== props.sheetName) {
195
+ input = createSimpleGridInput({
196
+ columns: props.columns,
197
+ defaultRows: props.defaultRows,
198
+ sheetName: props.sheetName,
199
+ });
200
+ inputColumns = props.columns;
201
+ inputRows = props.defaultRows;
202
+ inputSheetName = props.sheetName;
203
+ }
204
+ return h(SheetwriteGrid, { ...attrs, ...props, ...input }, slots);
205
+ };
206
+ },
207
+ });
208
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,cAAc,EACd,iBAAiB,GAIlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EAKrB,kBAAkB,EAClB,aAAa,GAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,CAAC,EACD,QAAQ,EACR,eAAe,EACf,SAAS,EAET,GAAG,EACH,UAAU,EACV,KAAK,GACN,MAAM,KAAK,CAAC;AAQb,MAAM,SAAS,GAAG;IAEhB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAA4B,EAAE,QAAQ,EAAE,IAAa,EAAE;IAEzE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAgC,EAAE,OAAO,EAAE,SAAS,EAAE;IAEpE,UAAU,EAAE,EAAE,IAAI,EAAE,MAA8B,EAAE,OAAO,EAAE,SAAS,EAAE;IAExE,iBAAiB,EAAE;QACjB,IAAI,EAAE,MAA4C;QAClD,OAAO,EAAE,SAAS;KACnB;IAED,QAAQ,EAAE,EAAE,IAAI,EAAE,MAA2C,EAAE,OAAO,EAAE,SAAS,EAAE;IAEnF,SAAS,EAAE;QACT,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAkD;QACpE,OAAO,EAAE,SAAS;KACnB;IAED,KAAK,EAAE,EAAE,IAAI,EAAE,MAAkC,EAAE,OAAO,EAAE,SAAS,EAAE;IAEvE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;IAE/C,kBAAkB,EAAE;QAClB,IAAI,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C3C,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,EAC1C,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,IACE,KAAK,KAAK,IAAI;gBACd,YAAY,KAAK,KAAK,CAAC,OAAO;gBAC9B,SAAS,KAAK,KAAK,CAAC,WAAW;gBAC/B,cAAc,KAAK,KAAK,CAAC,SAAS,EAClC,CAAC;gBACD,KAAK,GAAG,qBAAqB,CAAC;oBAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;iBAC3B,CAAC,CAAC;gBACH,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC7B,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC;gBAC9B,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC;YACnC,CAAC;YACD,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC;QACpE,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@sheetwrite/vue",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Vue adapter for Sheetwrite.",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/chh-ay/Sheetwrite.git",
10
+ "directory": "packages/vue"
11
+ },
12
+ "homepage": "https://chh-ay.github.io/Sheetwrite/",
13
+ "bugs": {
14
+ "url": "https://github.com/chh-ay/Sheetwrite/issues"
15
+ },
16
+ "keywords": [
17
+ "spreadsheet",
18
+ "data-grid",
19
+ "vue",
20
+ "canvas"
21
+ ],
22
+ "main": "./dist/index.js",
23
+ "module": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "./styles.css": "./styles.css"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "styles.css"
35
+ ],
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "provenance": true
39
+ },
40
+ "scripts": {
41
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && tsc -p tsconfig.declarations.json",
42
+ "typecheck": "tsc --noEmit -p tsconfig.json"
43
+ },
44
+ "peerDependencies": {
45
+ "vue": ">=3.4"
46
+ },
47
+ "dependencies": {
48
+ "@sheetwrite/core": "0.1.0"
49
+ }
50
+ }
package/styles.css ADDED
@@ -0,0 +1 @@
1
+ @import "@sheetwrite/core/styles.css";