@molecule/app-spreadsheet-grid-vue 0.0.0-stage → 1.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,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,428 @@
1
- # Temporary Holding Version
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-11-21T12:47:25.055Z
7
+ -->
2
8
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
9
+ # @molecule/app-spreadsheet-grid-vue
10
+
11
+ High-performance virtualized spreadsheet cell grid for Vue.
12
+
13
+ Exports:
14
+
15
+ - `<SpreadsheetGrid>` — the grid component (virtualized cells, frozen
16
+ rows/columns, range selection, copy/paste as TSV, in-cell editing).
17
+ - Types: `SpreadsheetGridProps`, `SpreadsheetSelection`, `CellMap`,
18
+ `CellRef`, `CellValue`.
19
+ - Helpers: `cellRef()`, `columnLetter()`, `normalizeSelection()`,
20
+ `isInSelection()`, `formatCellValue()`, `parseClipboardTsv()`,
21
+ `serializeSelectionTsv()`, `computeVisibleRange()`.
22
+
23
+ Pairs with `@molecule/api-formula-engine` for formula evaluation —
24
+ pass evaluated `cells` plus an optional `renderCell` to display
25
+ formula results.
26
+
27
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
28
+ > It is written to be read by coding agents as much as by people, and is generated from this
29
+ > package's source — edit `src/index.ts` JSDoc, not this file.
30
+
31
+ ## Quick Start
32
+
33
+ ```ts
34
+ import { createApp, defineComponent, h, ref } from 'vue'
35
+
36
+ import {
37
+ SpreadsheetGrid,
38
+ type CellMap,
39
+ type SpreadsheetSelection,
40
+ } from '@molecule/app-spreadsheet-grid-vue'
41
+
42
+ const Sheet = defineComponent({
43
+ setup() {
44
+ const cells = ref<CellMap>(new Map())
45
+ const selection = ref<SpreadsheetSelection>({ r1: 0, c1: 0, r2: 0, c2: 0 })
46
+ return () =>
47
+ h(SpreadsheetGrid, {
48
+ rows: 1000,
49
+ columns: 26,
50
+ cells: cells.value,
51
+ selection: selection.value,
52
+ frozenRows: 1,
53
+ frozenCols: 1,
54
+ onCellChange: (ref, value) => {
55
+ const next = new Map(cells.value)
56
+ if (value === null) next.delete(ref)
57
+ else next.set(ref, value)
58
+ cells.value = next
59
+ },
60
+ onSelectionChange: (next) => {
61
+ selection.value = next
62
+ },
63
+ })
64
+ },
65
+ })
66
+
67
+ createApp(Sheet).mount('#app')
68
+ ```
69
+
70
+ ## Type
71
+
72
+ `feature`
73
+
74
+ ## Installation
75
+
76
+ ```bash
77
+ npm install @molecule/app-spreadsheet-grid-vue @molecule/app-clipboard @molecule/app-i18n @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
78
+ ```
79
+
80
+ ## API
81
+
82
+ ### Interfaces
83
+
84
+ #### `SpreadsheetSelection`
85
+
86
+ Inclusive rectangular selection — `r1`/`c1` is the anchor (where the
87
+ drag started) and `r2`/`c2` is the focus (where it ended). Both are
88
+ 0-indexed. A single-cell selection has `r1 === r2 && c1 === c2`.
89
+
90
+ ```typescript
91
+ interface SpreadsheetSelection {
92
+ r1: number
93
+ c1: number
94
+ r2: number
95
+ c2: number
96
+ }
97
+ ```
98
+
99
+ #### `SpreadsheetGridProps`
100
+
101
+ Props accepted by the {@link SpreadsheetGrid} component.
102
+
103
+ ```typescript
104
+ interface SpreadsheetGridProps {
105
+ /** Total number of rows in the grid. */
106
+ rows: number
107
+ /** Total number of columns in the grid. */
108
+ columns: number
109
+ /** Sparse cell-data map. Cells not present render as empty. */
110
+ cells: CellMap
111
+ /** Called when the user commits an edit (Enter, Tab, or focus loss). */
112
+ onCellChange: (ref: CellRef, value: CellValue) => void
113
+ /** Current selection. */
114
+ selection: SpreadsheetSelection
115
+ /** Called when the user changes the selection (click, drag, Shift+click). */
116
+ onSelectionChange: (selection: SpreadsheetSelection) => void
117
+ /** Number of rows frozen at the top (default `0`). */
118
+ frozenRows?: number
119
+ /** Number of columns frozen on the left (default `0`). */
120
+ frozenCols?: number
121
+ /** Per-cell width in pixels (default `96`). */
122
+ cellWidth?: number
123
+ /** Per-cell height in pixels (default `28`). */
124
+ cellHeight?: number
125
+ /** Width of the row-number gutter on the left (default `48`). */
126
+ gutterWidth?: number
127
+ /** Height of the column-letter header (default `28`). */
128
+ headerHeight?: number
129
+ /** Visible viewport width in pixels (default `720`). */
130
+ viewportWidth?: number
131
+ /** Visible viewport height in pixels (default `360`). */
132
+ viewportHeight?: number
133
+ /** `data-mol-id` for AI-agent selectors. */
134
+ dataMolId?: string
135
+ /**
136
+ * Optional cell renderer. Receives the cached display string plus the
137
+ * raw value. Defaults to plain text. Use to render formula results
138
+ * (`'=A1+B1'` → evaluated number) or custom formatting.
139
+ */
140
+ renderCell?: (value: CellValue | undefined, ref: CellRef) => VNodeChild
141
+ }
142
+ ```
143
+
144
+ ### Types
145
+
146
+ #### `CellRef`
147
+
148
+ Cell reference in A1 notation (e.g. `'A1'`, `'AB17'`). Column letters are
149
+ uppercase; row numbers are 1-indexed.
150
+
151
+ ```typescript
152
+ type CellRef = string
153
+ ```
154
+
155
+ #### `CellValue`
156
+
157
+ Primitive value stored in a cell. Formula strings start with `'='` —
158
+ evaluation is the host application's responsibility (typically wired
159
+ through `@molecule/api-formula-engine`).
160
+
161
+ ```typescript
162
+ type CellValue = string | number | boolean | null
163
+ ```
164
+
165
+ #### `CellMap`
166
+
167
+ Sparse map from `CellRef` to value. Cells not present in the map render
168
+ as empty. Using a `Map` keeps update cost O(1) regardless of grid size.
169
+
170
+ ```typescript
171
+ type CellMap = Map<CellRef, CellValue>
172
+ ```
173
+
174
+ ### Functions
175
+
176
+ #### `columnLetter(col)`
177
+
178
+ Convert a 0-indexed column number to its A1 letter (`0` → `'A'`, `25` →
179
+ `'Z'`, `26` → `'AA'`, `701` → `'ZZ'`, `702` → `'AAA'`).
180
+
181
+ ```typescript
182
+ function columnLetter(col: number): string
183
+ ```
184
+
185
+ - `col` — 0-indexed column number.
186
+
187
+ **Returns:** Uppercase A1 column letter.
188
+
189
+ #### `cellRef(row, col)`
190
+
191
+ Build an A1 reference from 0-indexed row and column numbers.
192
+
193
+ ```typescript
194
+ function cellRef(row: number, col: number): CellRef
195
+ ```
196
+
197
+ - `row` — 0-indexed row number.
198
+ - `col` — 0-indexed column number.
199
+
200
+ **Returns:** A1-style cell reference (e.g. `'B3'`).
201
+
202
+ #### `normalizeSelection(sel)`
203
+
204
+ Normalize a possibly-inverted selection so `r1 <= r2 && c1 <= c2`.
205
+
206
+ ```typescript
207
+ function normalizeSelection(sel: SpreadsheetSelection): SpreadsheetSelection
208
+ ```
209
+
210
+ - `sel` — Raw selection (anchor and focus).
211
+
212
+ **Returns:** Selection with `r1`/`c1` as top-left and `r2`/`c2` as bottom-right.
213
+
214
+ #### `isInSelection(sel, row, col)`
215
+
216
+ Test whether `(row, col)` is inside the selection.
217
+
218
+ ```typescript
219
+ function isInSelection(sel: SpreadsheetSelection, row: number, col: number): boolean
220
+ ```
221
+
222
+ - `sel` — Selection to test against.
223
+ - `row` — 0-indexed row number.
224
+ - `col` — 0-indexed column number.
225
+
226
+ **Returns:** `true` when the cell is in the selection.
227
+
228
+ #### `formatCellValue(value)`
229
+
230
+ Format a cell value for display. `null`/`undefined` render as the empty
231
+ string; booleans become `TRUE`/`FALSE` (matching common spreadsheet
232
+ tools); numbers and strings stringify as-is.
233
+
234
+ ```typescript
235
+ function formatCellValue(value: CellValue | undefined): string
236
+ ```
237
+
238
+ - `value` — The raw cell value.
239
+
240
+ **Returns:** Display string.
241
+
242
+ #### `parseClipboardTsv(text)`
243
+
244
+ Parse a TSV (tab-separated values) string into a 2D array of strings.
245
+ Empty trailing lines are ignored. Used to ingest clipboard paste data.
246
+
247
+ ```typescript
248
+ function parseClipboardTsv(text: string): string[][]
249
+ ```
250
+
251
+ - `text` — Clipboard text (typically TSV).
252
+
253
+ **Returns:** 2D array of cell strings — `rows[r][c]`.
254
+
255
+ #### `serializeSelectionTsv(cells, sel)`
256
+
257
+ Serialize a rectangular selection to TSV (tab-separated values) so it
258
+ can round-trip with Excel/Google Sheets via the system clipboard.
259
+
260
+ ```typescript
261
+ function serializeSelectionTsv(cells: CellMap, sel: SpreadsheetSelection): string
262
+ ```
263
+
264
+ - `cells` — Source cell map.
265
+ - `sel` — Selection to serialize.
266
+
267
+ **Returns:** TSV-formatted string with `\n` row separators.
268
+
269
+ #### `computeVisibleRange(scroll, viewport, itemSize, total, overscan)`
270
+
271
+ Compute the inclusive `[start, end]` window of indices to render given
272
+ the scroll offset, viewport size, item size, and total count. Adds an
273
+ `overscan` margin on each side so newly-visible cells are pre-rendered
274
+ during fast scrolls.
275
+
276
+ ```typescript
277
+ function computeVisibleRange(
278
+ scroll: number,
279
+ viewport: number,
280
+ itemSize: number,
281
+ total: number,
282
+ overscan?: number,
283
+ ): [number, number]
284
+ ```
285
+
286
+ - `scroll` — Current scroll position (px).
287
+ - `viewport` — Viewport size (px) along the scroll axis.
288
+ - `itemSize` — Per-item size (px) along the scroll axis.
289
+ - `total` — Total number of items.
290
+ - `overscan` — Extra items to render on each side (default `2`).
291
+
292
+ **Returns:** `[startIndex, endIndex]` (both inclusive, clamped to `[0, total)`).
293
+
294
+ ### Constants
295
+
296
+ #### `SpreadsheetGrid`
297
+
298
+ High-performance virtualized spreadsheet cell grid.
299
+
300
+ Renders an `rows × columns` grid backed by a sparse `Map<cellRef, value>`,
301
+ with frozen rows/columns, range selection (click + drag, Shift+click),
302
+ copy/paste through the system clipboard as TSV, and in-cell editing
303
+ (double-click → input; Enter commits, Escape cancels).
304
+
305
+ Only the cells inside the visible viewport (plus a small overscan margin)
306
+ are rendered, so 10k × 10k grids stay responsive.
307
+
308
+ ```typescript
309
+ const SpreadsheetGrid: DefineComponent<
310
+ ExtractPropTypes<{
311
+ rows: { type: NumberConstructor; required: true }
312
+ columns: { type: NumberConstructor; required: true }
313
+ cells: { type: PropType<CellMap>; required: true }
314
+ onCellChange: { type: PropType<SpreadsheetGridProps['onCellChange']>; required: true }
315
+ selection: { type: PropType<SpreadsheetSelection>; required: true }
316
+ onSelectionChange: { type: PropType<SpreadsheetGridProps['onSelectionChange']>; required: true }
317
+ frozenRows: { type: NumberConstructor; default: number }
318
+ frozenCols: { type: NumberConstructor; default: number }
319
+ cellWidth: { type: NumberConstructor; default: number }
320
+ cellHeight: { type: NumberConstructor; default: number }
321
+ gutterWidth: { type: NumberConstructor; default: number }
322
+ headerHeight: { type: NumberConstructor; default: number }
323
+ viewportWidth: { type: NumberConstructor; default: number }
324
+ viewportHeight: { type: NumberConstructor; default: number }
325
+ dataMolId: StringConstructor
326
+ renderCell: PropType<SpreadsheetGridProps['renderCell']>
327
+ }>,
328
+ () => VNode,
329
+ {},
330
+ {},
331
+ {},
332
+ ComponentOptionsMixin,
333
+ ComponentOptionsMixin,
334
+ {},
335
+ string,
336
+ PublicProps,
337
+ Readonly<
338
+ ExtractPropTypes<{
339
+ rows: { type: NumberConstructor; required: true }
340
+ columns: { type: NumberConstructor; required: true }
341
+ cells: { type: PropType<CellMap>; required: true }
342
+ onCellChange: { type: PropType<SpreadsheetGridProps['onCellChange']>; required: true }
343
+ selection: { type: PropType<SpreadsheetSelection>; required: true }
344
+ onSelectionChange: {
345
+ type: PropType<SpreadsheetGridProps['onSelectionChange']>
346
+ required: true
347
+ }
348
+ frozenRows: { type: NumberConstructor; default: number }
349
+ frozenCols: { type: NumberConstructor; default: number }
350
+ cellWidth: { type: NumberConstructor; default: number }
351
+ cellHeight: { type: NumberConstructor; default: number }
352
+ gutterWidth: { type: NumberConstructor; default: number }
353
+ headerHeight: { type: NumberConstructor; default: number }
354
+ viewportWidth: { type: NumberConstructor; default: number }
355
+ viewportHeight: { type: NumberConstructor; default: number }
356
+ dataMolId: StringConstructor
357
+ renderCell: PropType<SpreadsheetGridProps['renderCell']>
358
+ }>
359
+ > &
360
+ Readonly<{}>,
361
+ {
362
+ frozenRows: number
363
+ frozenCols: number
364
+ cellWidth: number
365
+ cellHeight: number
366
+ gutterWidth: number
367
+ headerHeight: number
368
+ viewportWidth: number
369
+ viewportHeight: number
370
+ },
371
+ {},
372
+ {},
373
+ {},
374
+ string,
375
+ ComponentProvideOptions,
376
+ true,
377
+ {},
378
+ any
379
+ >
380
+ ```
381
+
382
+ - `props` — Component props (see {@link SpreadsheetGridProps}).
383
+
384
+ **Returns:** The spreadsheet grid component.
385
+
386
+ ## Injection Notes
387
+
388
+ ### Requirements
389
+
390
+ Peer dependencies:
391
+
392
+ - `@molecule/app-clipboard` ^1.0.1
393
+ - `@molecule/app-i18n` ^1.0.1
394
+ - `@molecule/app-ui` ^1.3.11
395
+ - `@molecule/app-ui-vue` ^1.1.0
396
+ - `@molecule/app-vue` ^3.5.0
397
+ - `vue` ^3.4.0
398
+
399
+ ### Runtime Dependencies
400
+
401
+ - `@molecule/app-clipboard`
402
+ - `@molecule/app-i18n`
403
+ - `@molecule/app-ui`
404
+ - `@molecule/app-ui-vue`
405
+ - `@molecule/app-vue`
406
+ - `vue`
407
+
408
+ - Must render with a ClassMap bond wired (`getClassMap()` throws
409
+ otherwise), and inside the app's i18n provider (or with the bonded one).
410
+ - The viewport is FIXED-PIXEL: `viewportWidth`/`viewportHeight`
411
+ (defaults 720×360) — the grid does not auto-size to its container.
412
+ Measure the container and pass px if you need it to fill.
413
+ - Copy (Ctrl/Cmd+C) writes TSV through `copyTextWithFallback()` from
414
+ `@molecule/app-clipboard`, which uses the bonded clipboard provider with
415
+ a selection-and-copy fallback and never throws. Paste is handled through
416
+ the native paste event, so the grid container must have focus (click a
417
+ cell first). Keyboard support is Enter/F2 (edit) + copy/paste only; there
418
+ is NO arrow-key cell navigation.
419
+ - Committed edits and pasted cells auto-coerce number-like strings to
420
+ numbers (`'42'` → `42`); empty string clears the cell (`null`).
421
+ - Gridlines/selection/header styling uses Material-3 design-token
422
+ utilities (`bg-surface`, `border-outline-variant`, …). Apps whose
423
+ Tailwind theme does not define those tokens (the minimal scaffold
424
+ theme does not) get a functional but unstyled grid.
425
+
426
+ ## Translations
427
+
428
+ Translation strings are provided by `@molecule/app-locales-spreadsheet-grid`.