@molecule/app-spreadsheet-grid-solid 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 +202 -0
- package/README.md +355 -2
- package/dist/SpreadsheetGrid.d.ts +28 -0
- package/dist/SpreadsheetGrid.d.ts.map +1 -0
- package/dist/SpreadsheetGrid.jsx +378 -0
- package/dist/SpreadsheetGrid.jsx.map +1 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +167 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +183 -0
- package/dist/layout.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities.d.ts +74 -0
- package/dist/utilities.d.ts.map +1 -0
- package/dist/utilities.js +122 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +68 -4
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid spreadsheet grid: a virtualized cell grid with frozen rows/columns,
|
|
3
|
+
* range selection, copy/paste as TSV and in-cell editing.
|
|
4
|
+
*
|
|
5
|
+
* Solid counterpart of `@molecule/app-spreadsheet-grid-react`'s
|
|
6
|
+
* `SpreadsheetGrid` — the same props (React names), the same DOM for the same
|
|
7
|
+
* input, and the same callbacks.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { createMemo, createSignal, For, onMount, Show } from 'solid-js';
|
|
12
|
+
import { copyTextWithFallback } from '@molecule/app-clipboard';
|
|
13
|
+
import { useTranslation } from '@molecule/app-solid';
|
|
14
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
15
|
+
import { computeLayout } from './layout.js';
|
|
16
|
+
import { cellRef, formatCellValue, normalizeSelection, parseClipboardTsv, serializeSelectionTsv, } from './utilities.js';
|
|
17
|
+
/**
|
|
18
|
+
* The in-cell editor. React mounts it when editing starts, so focusing and
|
|
19
|
+
* selecting its text on mount is React's `useEffect(… focus(); select() …)`.
|
|
20
|
+
*
|
|
21
|
+
* @param props - See {@link CellEditorProps}.
|
|
22
|
+
* @returns The editor input.
|
|
23
|
+
*/
|
|
24
|
+
const CellEditor = (props) => {
|
|
25
|
+
let field;
|
|
26
|
+
onMount(() => {
|
|
27
|
+
if (!field)
|
|
28
|
+
return;
|
|
29
|
+
field.focus();
|
|
30
|
+
field.select();
|
|
31
|
+
});
|
|
32
|
+
return (<input ref={(element) => {
|
|
33
|
+
field = element;
|
|
34
|
+
}} data-mol-id={props.identifier} class={props.classes} value={props.draft} attr:value={props.draft} onInput={(event) => props.onDraft(event.target.value)} onBlur={() => props.onCommit()} onKeyDown={(event) => {
|
|
35
|
+
// The grid's own key handler runs only while no editor is open (React
|
|
36
|
+
// reads the state the render before the event began, so a key that
|
|
37
|
+
// commits here never reaches it): keep the event on the field, as that
|
|
38
|
+
// guard does.
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
if (event.key === 'Enter') {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
props.onCommit();
|
|
43
|
+
}
|
|
44
|
+
else if (event.key === 'Escape') {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
props.onCancel();
|
|
47
|
+
}
|
|
48
|
+
}} aria-label={props.ariaLabel}/>);
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* High-performance virtualized spreadsheet cell grid.
|
|
52
|
+
*
|
|
53
|
+
* Renders an `rows × columns` grid backed by a sparse `Map<cellRef, value>`,
|
|
54
|
+
* with frozen rows/columns, range selection (click + drag, Shift+click),
|
|
55
|
+
* copy/paste through the system clipboard as TSV, and in-cell editing
|
|
56
|
+
* (double-click → input; Enter commits, Escape cancels).
|
|
57
|
+
*
|
|
58
|
+
* Only the cells inside the visible viewport (plus a small overscan margin)
|
|
59
|
+
* are rendered, so 10k × 10k grids stay responsive.
|
|
60
|
+
*
|
|
61
|
+
* @param props - Component props (see {@link SpreadsheetGridProps}).
|
|
62
|
+
* @returns The rendered spreadsheet grid.
|
|
63
|
+
*/
|
|
64
|
+
export const SpreadsheetGrid = (props) => {
|
|
65
|
+
const cm = getClassMap();
|
|
66
|
+
const { t } = useTranslation();
|
|
67
|
+
const [scrollLeft, setScrollLeft] = createSignal(0);
|
|
68
|
+
const [scrollTop, setScrollTop] = createSignal(0);
|
|
69
|
+
const [editing, setEditing] = createSignal(null);
|
|
70
|
+
/** Where the current drag started, while a mouse button is held. */
|
|
71
|
+
let dragAnchor = null;
|
|
72
|
+
/**
|
|
73
|
+
* The current geometry from the props and the grid's own state.
|
|
74
|
+
*
|
|
75
|
+
* @returns The geometry.
|
|
76
|
+
*/
|
|
77
|
+
const geometry = () => ({
|
|
78
|
+
rows: props.rows,
|
|
79
|
+
columns: props.columns,
|
|
80
|
+
cells: props.cells,
|
|
81
|
+
selection: props.selection,
|
|
82
|
+
frozenRows: props.frozenRows ?? 0,
|
|
83
|
+
frozenCols: props.frozenCols ?? 0,
|
|
84
|
+
cellWidth: props.cellWidth ?? 96,
|
|
85
|
+
cellHeight: props.cellHeight ?? 28,
|
|
86
|
+
gutterWidth: props.gutterWidth ?? 48,
|
|
87
|
+
headerHeight: props.headerHeight ?? 28,
|
|
88
|
+
viewportWidth: props.viewportWidth ?? 720,
|
|
89
|
+
viewportHeight: props.viewportHeight ?? 360,
|
|
90
|
+
scrollLeft: scrollLeft(),
|
|
91
|
+
scrollTop: scrollTop(),
|
|
92
|
+
editing: editing(),
|
|
93
|
+
});
|
|
94
|
+
/** The current layout plan. */
|
|
95
|
+
const layout = createMemo(() => computeLayout(geometry(), cm));
|
|
96
|
+
/** One stable record per rendered cell reference. */
|
|
97
|
+
const records = new Map();
|
|
98
|
+
/**
|
|
99
|
+
* The stable record of one cell, created on first sight.
|
|
100
|
+
*
|
|
101
|
+
* @param cell - The cell.
|
|
102
|
+
* @returns Its record.
|
|
103
|
+
*/
|
|
104
|
+
const itemFor = (cell) => {
|
|
105
|
+
let record = records.get(cell.ref);
|
|
106
|
+
if (!record) {
|
|
107
|
+
record = { ref: cell.ref, row: cell.row, col: cell.col };
|
|
108
|
+
records.set(cell.ref, record);
|
|
109
|
+
}
|
|
110
|
+
return record;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* The editor state of one cell, when that cell is the one being edited.
|
|
114
|
+
*
|
|
115
|
+
* @param row - 0-indexed row.
|
|
116
|
+
* @param col - 0-indexed column.
|
|
117
|
+
* @returns The editor state, or null.
|
|
118
|
+
*/
|
|
119
|
+
const editorAt = (row, col) => {
|
|
120
|
+
const current = editing();
|
|
121
|
+
return current && current.row === row && current.col === col ? current : null;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Opens the in-cell editor on one cell, seeding the draft from its value.
|
|
125
|
+
*
|
|
126
|
+
* @param row - 0-indexed row.
|
|
127
|
+
* @param col - 0-indexed column.
|
|
128
|
+
*/
|
|
129
|
+
const beginEdit = (row, col) => {
|
|
130
|
+
setEditing({ row, col, draft: formatCellValue(props.cells.get(cellRef(row, col))) });
|
|
131
|
+
};
|
|
132
|
+
/** Commits the open edit: empty clears the cell, number-like text becomes a number. */
|
|
133
|
+
const commitEdit = () => {
|
|
134
|
+
const current = editing();
|
|
135
|
+
if (!current)
|
|
136
|
+
return;
|
|
137
|
+
const ref = cellRef(current.row, current.col);
|
|
138
|
+
const trimmed = current.draft;
|
|
139
|
+
let next;
|
|
140
|
+
if (trimmed === '')
|
|
141
|
+
next = null;
|
|
142
|
+
else if (/^-?\d+(\.\d+)?$/.test(trimmed))
|
|
143
|
+
next = Number(trimmed);
|
|
144
|
+
else
|
|
145
|
+
next = trimmed;
|
|
146
|
+
props.onCellChange(ref, next);
|
|
147
|
+
setEditing(null);
|
|
148
|
+
};
|
|
149
|
+
/** Closes the editor without committing. */
|
|
150
|
+
const cancelEdit = () => {
|
|
151
|
+
setEditing(null);
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* React's cell `onMouseDown`: commits an open edit, then starts or extends
|
|
155
|
+
* the selection.
|
|
156
|
+
*
|
|
157
|
+
* @param row - 0-indexed row.
|
|
158
|
+
* @param col - 0-indexed column.
|
|
159
|
+
* @param shiftKey - Whether Shift was held (extend from the anchor).
|
|
160
|
+
*/
|
|
161
|
+
const handleMouseDown = (row, col, shiftKey) => {
|
|
162
|
+
if (editing())
|
|
163
|
+
commitEdit();
|
|
164
|
+
if (shiftKey) {
|
|
165
|
+
props.onSelectionChange({
|
|
166
|
+
r1: props.selection.r1,
|
|
167
|
+
c1: props.selection.c1,
|
|
168
|
+
r2: row,
|
|
169
|
+
c2: col,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
dragAnchor = { row, col };
|
|
174
|
+
props.onSelectionChange({ r1: row, c1: col, r2: row, c2: col });
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* React's cell `onMouseEnter`: extends the selection while the primary
|
|
179
|
+
* button is held.
|
|
180
|
+
*
|
|
181
|
+
* @param row - 0-indexed row.
|
|
182
|
+
* @param col - 0-indexed column.
|
|
183
|
+
* @param buttonsDown - Whether the primary button is held.
|
|
184
|
+
*/
|
|
185
|
+
const handleMouseEnter = (row, col, buttonsDown) => {
|
|
186
|
+
if (!buttonsDown)
|
|
187
|
+
return;
|
|
188
|
+
const anchor = dragAnchor;
|
|
189
|
+
if (!anchor)
|
|
190
|
+
return;
|
|
191
|
+
props.onSelectionChange({ r1: anchor.row, c1: anchor.col, r2: row, c2: col });
|
|
192
|
+
};
|
|
193
|
+
/** Clears the drag anchor on mouse up. */
|
|
194
|
+
const handleMouseUp = () => {
|
|
195
|
+
dragAnchor = null;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Serializes the selection to TSV and copies it through the clipboard bond.
|
|
199
|
+
*
|
|
200
|
+
* @returns The TSV text.
|
|
201
|
+
*/
|
|
202
|
+
const handleCopy = async () => {
|
|
203
|
+
const tsv = serializeSelectionTsv(props.cells, props.selection);
|
|
204
|
+
await copyTextWithFallback(tsv);
|
|
205
|
+
return tsv;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Writes pasted TSV into cells starting at the selection anchor.
|
|
209
|
+
*
|
|
210
|
+
* @param text - Clipboard text (typically TSV).
|
|
211
|
+
*/
|
|
212
|
+
const handlePaste = (text) => {
|
|
213
|
+
const grid = parseClipboardTsv(text);
|
|
214
|
+
if (grid.length === 0)
|
|
215
|
+
return;
|
|
216
|
+
const n = normalizeSelection(props.selection);
|
|
217
|
+
for (let r = 0; r < grid.length; r += 1) {
|
|
218
|
+
const row = grid[r];
|
|
219
|
+
for (let c = 0; c < row.length; c += 1) {
|
|
220
|
+
const targetRow = n.r1 + r;
|
|
221
|
+
const targetCol = n.c1 + c;
|
|
222
|
+
if (targetRow >= props.rows || targetCol >= props.columns)
|
|
223
|
+
continue;
|
|
224
|
+
const raw = row[c];
|
|
225
|
+
let next;
|
|
226
|
+
if (raw === '')
|
|
227
|
+
next = null;
|
|
228
|
+
else if (/^-?\d+(\.\d+)?$/.test(raw))
|
|
229
|
+
next = Number(raw);
|
|
230
|
+
else
|
|
231
|
+
next = raw;
|
|
232
|
+
props.onCellChange(cellRef(targetRow, targetCol), next);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* React's container `onKeyDown`: copy, and Edit on Enter / F2.
|
|
238
|
+
*
|
|
239
|
+
* @param event - The keyboard event.
|
|
240
|
+
*/
|
|
241
|
+
const handleKeyDown = (event) => {
|
|
242
|
+
const isMod = event.ctrlKey || event.metaKey;
|
|
243
|
+
if (editing())
|
|
244
|
+
return;
|
|
245
|
+
if (isMod && event.key.toLowerCase() === 'c') {
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
void handleCopy();
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (isMod && event.key.toLowerCase() === 'v')
|
|
251
|
+
return;
|
|
252
|
+
if (event.key === 'Enter' || event.key === 'F2') {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
beginEdit(props.selection.r1, props.selection.c1);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* React's container `onPaste`: intercepts the native paste event.
|
|
259
|
+
*
|
|
260
|
+
* @param event - The clipboard event.
|
|
261
|
+
*/
|
|
262
|
+
const handlePasteEvent = (event) => {
|
|
263
|
+
const text = event.clipboardData ? event.clipboardData.getData('text/plain') : '';
|
|
264
|
+
if (!text)
|
|
265
|
+
return;
|
|
266
|
+
event.preventDefault();
|
|
267
|
+
handlePaste(text);
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Renders one column-letter or row-number label.
|
|
271
|
+
*
|
|
272
|
+
* @param cell - The label.
|
|
273
|
+
* @param role - The ARIA role the label carries (`columnheader`), if any.
|
|
274
|
+
* @returns The label element.
|
|
275
|
+
*/
|
|
276
|
+
const headerBox = (cell, role) => (<div role={role} aria-colindex={role ? cell.index + 1 : undefined} class={cell.classes} style={cell.style}>
|
|
277
|
+
{cell.text}
|
|
278
|
+
</div>);
|
|
279
|
+
/**
|
|
280
|
+
* The content React renders for a cell without an editor.
|
|
281
|
+
*
|
|
282
|
+
* @param record - The cell's record.
|
|
283
|
+
* @returns The cell's renderer output, or its display text.
|
|
284
|
+
*/
|
|
285
|
+
const cellContent = (record) => {
|
|
286
|
+
const cell = layout().byRef.get(record.ref);
|
|
287
|
+
return props.renderCell ? props.renderCell(cell?.value, record.ref) : (cell?.text ?? '');
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Renders one cell box: its editor while it is being edited, its content
|
|
291
|
+
* otherwise. The record keeps the element stable across renders; its
|
|
292
|
+
* attributes and content read the current plan reactively.
|
|
293
|
+
*
|
|
294
|
+
* @param record - The cell's record.
|
|
295
|
+
* @returns The cell element.
|
|
296
|
+
*/
|
|
297
|
+
const cellBox = (record) => {
|
|
298
|
+
const cell = () => layout().byRef.get(record.ref);
|
|
299
|
+
return (<div role="gridcell" data-mol-id={`spreadsheet-grid-cell-${record.ref}`}
|
|
300
|
+
// Roving tabindex per the WAI-ARIA grid pattern: exactly one cell —
|
|
301
|
+
// the selection anchor — is in the tab order.
|
|
302
|
+
tabindex={cell()?.anchor ? 0 : -1} aria-selected={cell()?.selected ? 'true' : undefined} class={cell()?.classes} style={cell()?.style} onMouseDown={(event) => handleMouseDown(record.row, record.col, event.shiftKey)} onMouseEnter={(event) => handleMouseEnter(record.row, record.col, event.buttons === 1)} onDblClick={() => beginEdit(record.row, record.col)}>
|
|
303
|
+
<Show when={editorAt(record.row, record.col)} fallback={<div class={layout().contentClasses}>{cellContent(record)}</div>}>
|
|
304
|
+
{(open) => (<CellEditor identifier={`spreadsheet-grid-editor-${record.ref}`} draft={open().draft} classes={layout().editorClasses} ariaLabel={t('spreadsheetGrid.cellEditor', { ref: record.ref }, {
|
|
305
|
+
defaultValue: 'Edit cell {{ref}}',
|
|
306
|
+
})} onDraft={(draft) => {
|
|
307
|
+
const current = editorAt(record.row, record.col);
|
|
308
|
+
if (current)
|
|
309
|
+
setEditing({ ...current, draft });
|
|
310
|
+
}} onCommit={() => commitEdit()} onCancel={() => cancelEdit()}/>)}
|
|
311
|
+
</Show>
|
|
312
|
+
</div>);
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* One region's cell records, created per render from the current plan.
|
|
316
|
+
*
|
|
317
|
+
* @param cells - The region's cells.
|
|
318
|
+
* @returns Their stable records.
|
|
319
|
+
*/
|
|
320
|
+
const recordsFor = (cells) => cells.map(itemFor);
|
|
321
|
+
return (<div data-mol-id={props.dataMolId ?? 'spreadsheet-grid'} role="grid" tabindex={0} aria-rowcount={props.rows} aria-colcount={props.columns} aria-label={t('spreadsheetGrid.label', undefined, { defaultValue: 'Spreadsheet' })} class={layout().rootClasses} style={layout().rootStyle} onKeyDown={(event) => handleKeyDown(event)} onPaste={(event) => handlePasteEvent(event)} onMouseUp={() => handleMouseUp()}>
|
|
322
|
+
{/* Top-left corner (gutter × header). */}
|
|
323
|
+
<div aria-hidden="true" class={layout().cornerClasses} style={layout().cornerStyle}/>
|
|
324
|
+
{/* Column-letter header (frozen + scrollable). */}
|
|
325
|
+
<div role="row" aria-rowindex={1} class={layout().headerLaneClasses} style={layout().headerLaneStyle}>
|
|
326
|
+
<For each={layout().frozenHeaderCells}>{(cell) => headerBox(cell, 'columnheader')}</For>
|
|
327
|
+
<div style={layout().headerScrollerStyle}>
|
|
328
|
+
<For each={layout().scrollingHeaderCells}>
|
|
329
|
+
{(cell) => headerBox(cell, 'columnheader')}
|
|
330
|
+
</For>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
{/* Row-number gutter (frozen + scrollable). */}
|
|
334
|
+
<div aria-hidden="true" class={layout().gutterLaneClasses} style={layout().gutterLaneStyle}>
|
|
335
|
+
<For each={layout().frozenGutterCells}>{(cell) => headerBox(cell)}</For>
|
|
336
|
+
<div style={layout().gutterScrollerStyle}>
|
|
337
|
+
<For each={layout().scrollingGutterCells}>{(cell) => headerBox(cell)}</For>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
{/* Frozen-rows × scrolling-cols region. */}
|
|
341
|
+
<Show when={layout().showFrozenRows}>
|
|
342
|
+
<div style={layout().frozenRowsRegionStyle}>
|
|
343
|
+
<div style={layout().frozenRowsInnerStyle}>
|
|
344
|
+
<For each={recordsFor(layout().frozenRowsCells)}>{(record) => cellBox(record)}</For>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
</Show>
|
|
348
|
+
{/* Frozen-cols × scrolling-rows region. */}
|
|
349
|
+
<Show when={layout().showFrozenCols}>
|
|
350
|
+
<div style={layout().frozenColsRegionStyle}>
|
|
351
|
+
<div style={layout().frozenColsInnerStyle}>
|
|
352
|
+
<For each={recordsFor(layout().frozenColsCells)}>{(record) => cellBox(record)}</For>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
</Show>
|
|
356
|
+
{/* Frozen-rows × frozen-cols corner. */}
|
|
357
|
+
<Show when={layout().showFrozenCorner}>
|
|
358
|
+
<div style={layout().frozenCornerStyle}>
|
|
359
|
+
<For each={recordsFor(layout().frozenCornerCells)}>{(record) => cellBox(record)}</For>
|
|
360
|
+
</div>
|
|
361
|
+
</Show>
|
|
362
|
+
{/* Main scrollable region. */}
|
|
363
|
+
<div data-mol-id="spreadsheet-grid-scroll" style={layout().scrollRegionStyle} onScroll={(event) => {
|
|
364
|
+
const element = event.currentTarget;
|
|
365
|
+
setScrollLeft(element.scrollLeft);
|
|
366
|
+
setScrollTop(element.scrollTop);
|
|
367
|
+
}}>
|
|
368
|
+
<div style={layout().scrollSpacerStyle}>
|
|
369
|
+
<For each={recordsFor(layout().mainCells)}>{(record) => cellBox(record)}</For>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
{/* Hidden total-size hint for accessibility tooling. */}
|
|
373
|
+
<span class={layout().totalClasses} style={layout().totalStyle} aria-hidden="true">
|
|
374
|
+
{layout().totalText}
|
|
375
|
+
</span>
|
|
376
|
+
</div>);
|
|
377
|
+
};
|
|
378
|
+
//# sourceMappingURL=SpreadsheetGrid.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpreadsheetGrid.jsx","sourceRoot":"","sources":["../src/SpreadsheetGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,E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ACN;MAAA,CAAC,6BAA6B,CAC9B;MAAA,CAAC,GAAG,CACF,WAAW,CAAC,yBAAyB,CACrC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,iBAAiB,CAAC,CAClC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YAClB,MAAM,OAAO,GAAG,KAAK,CAAC,aAA+B,CAAA;YACrD,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;YACjC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACjC,CAAC,CAAC,CAEF;QAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,iBAAiB,CAAC,CACrC;UAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAC/E;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,uDAAuD,CACxD;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,MAAM,CAChF;QAAA,CAAC,MAAM,EAAE,CAAC,SAAS,CACrB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance virtualized spreadsheet cell grid for Solid.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<SpreadsheetGrid>` — the grid component (virtualized cells, frozen
|
|
6
|
+
* rows/columns, range selection, copy/paste as TSV, in-cell editing).
|
|
7
|
+
* - Types: `SpreadsheetGridProps`, `SpreadsheetSelection`, `CellMap`,
|
|
8
|
+
* `CellRef`, `CellValue`.
|
|
9
|
+
* - Helpers: `cellRef()`, `columnLetter()`, `normalizeSelection()`,
|
|
10
|
+
* `isInSelection()`, `formatCellValue()`, `parseClipboardTsv()`,
|
|
11
|
+
* `serializeSelectionTsv()`, `computeVisibleRange()`.
|
|
12
|
+
*
|
|
13
|
+
* Pairs with `@molecule/api-formula-engine` for formula evaluation —
|
|
14
|
+
* pass evaluated `cells` plus an optional `renderCell` to display
|
|
15
|
+
* formula results.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { createSignal } from 'solid-js'
|
|
20
|
+
*
|
|
21
|
+
* import { SpreadsheetGrid, type CellMap, type SpreadsheetSelection } from '@molecule/app-spreadsheet-grid-solid'
|
|
22
|
+
*
|
|
23
|
+
* export function Sheet() {
|
|
24
|
+
* const [cells, setCells] = createSignal<CellMap>(new Map())
|
|
25
|
+
* const [selection, setSelection] = createSignal<SpreadsheetSelection>({
|
|
26
|
+
* r1: 0,
|
|
27
|
+
* c1: 0,
|
|
28
|
+
* r2: 0,
|
|
29
|
+
* c2: 0,
|
|
30
|
+
* })
|
|
31
|
+
* return (
|
|
32
|
+
* <SpreadsheetGrid
|
|
33
|
+
* rows={1000}
|
|
34
|
+
* columns={26}
|
|
35
|
+
* cells={cells()}
|
|
36
|
+
* selection={selection()}
|
|
37
|
+
* frozenRows={1}
|
|
38
|
+
* frozenCols={1}
|
|
39
|
+
* onCellChange={(ref, value) => {
|
|
40
|
+
* const next = new Map(cells())
|
|
41
|
+
* if (value === null) next.delete(ref)
|
|
42
|
+
* else next.set(ref, value)
|
|
43
|
+
* setCells(next)
|
|
44
|
+
* }}
|
|
45
|
+
* onSelectionChange={(next) => setSelection(next)}
|
|
46
|
+
* />
|
|
47
|
+
* )
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* - Must render with a ClassMap bond wired (`getClassMap()` throws
|
|
53
|
+
* otherwise), and inside the app's i18n provider (or with the bonded one).
|
|
54
|
+
* - The viewport is FIXED-PIXEL: `viewportWidth`/`viewportHeight`
|
|
55
|
+
* (defaults 720×360) — the grid does not auto-size to its container.
|
|
56
|
+
* Measure the container and pass px if you need it to fill.
|
|
57
|
+
* - Copy (Ctrl/Cmd+C) writes TSV through `copyTextWithFallback()` from
|
|
58
|
+
* `@molecule/app-clipboard`, which uses the bonded clipboard provider with
|
|
59
|
+
* a selection-and-copy fallback and never throws. Paste is handled through
|
|
60
|
+
* the native paste event, so the grid container must have focus (click a
|
|
61
|
+
* cell first). Keyboard support is Enter/F2 (edit) + copy/paste only; there
|
|
62
|
+
* is NO arrow-key cell navigation.
|
|
63
|
+
* - Committed edits and pasted cells auto-coerce number-like strings to
|
|
64
|
+
* numbers (`'42'` → `42`); empty string clears the cell (`null`).
|
|
65
|
+
* - Gridlines/selection/header styling uses Material-3 design-token
|
|
66
|
+
* utilities (`bg-surface`, `border-outline-variant`, …). Apps whose
|
|
67
|
+
* Tailwind theme does not define those tokens (the minimal scaffold
|
|
68
|
+
* theme does not) get a functional but unstyled grid.
|
|
69
|
+
*
|
|
70
|
+
* @module
|
|
71
|
+
*/
|
|
72
|
+
export * from './SpreadsheetGrid.jsx';
|
|
73
|
+
export * from './types.js';
|
|
74
|
+
export * from './utilities.js';
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance virtualized spreadsheet cell grid for Solid.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<SpreadsheetGrid>` — the grid component (virtualized cells, frozen
|
|
6
|
+
* rows/columns, range selection, copy/paste as TSV, in-cell editing).
|
|
7
|
+
* - Types: `SpreadsheetGridProps`, `SpreadsheetSelection`, `CellMap`,
|
|
8
|
+
* `CellRef`, `CellValue`.
|
|
9
|
+
* - Helpers: `cellRef()`, `columnLetter()`, `normalizeSelection()`,
|
|
10
|
+
* `isInSelection()`, `formatCellValue()`, `parseClipboardTsv()`,
|
|
11
|
+
* `serializeSelectionTsv()`, `computeVisibleRange()`.
|
|
12
|
+
*
|
|
13
|
+
* Pairs with `@molecule/api-formula-engine` for formula evaluation —
|
|
14
|
+
* pass evaluated `cells` plus an optional `renderCell` to display
|
|
15
|
+
* formula results.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { createSignal } from 'solid-js'
|
|
20
|
+
*
|
|
21
|
+
* import { SpreadsheetGrid, type CellMap, type SpreadsheetSelection } from '@molecule/app-spreadsheet-grid-solid'
|
|
22
|
+
*
|
|
23
|
+
* export function Sheet() {
|
|
24
|
+
* const [cells, setCells] = createSignal<CellMap>(new Map())
|
|
25
|
+
* const [selection, setSelection] = createSignal<SpreadsheetSelection>({
|
|
26
|
+
* r1: 0,
|
|
27
|
+
* c1: 0,
|
|
28
|
+
* r2: 0,
|
|
29
|
+
* c2: 0,
|
|
30
|
+
* })
|
|
31
|
+
* return (
|
|
32
|
+
* <SpreadsheetGrid
|
|
33
|
+
* rows={1000}
|
|
34
|
+
* columns={26}
|
|
35
|
+
* cells={cells()}
|
|
36
|
+
* selection={selection()}
|
|
37
|
+
* frozenRows={1}
|
|
38
|
+
* frozenCols={1}
|
|
39
|
+
* onCellChange={(ref, value) => {
|
|
40
|
+
* const next = new Map(cells())
|
|
41
|
+
* if (value === null) next.delete(ref)
|
|
42
|
+
* else next.set(ref, value)
|
|
43
|
+
* setCells(next)
|
|
44
|
+
* }}
|
|
45
|
+
* onSelectionChange={(next) => setSelection(next)}
|
|
46
|
+
* />
|
|
47
|
+
* )
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* - Must render with a ClassMap bond wired (`getClassMap()` throws
|
|
53
|
+
* otherwise), and inside the app's i18n provider (or with the bonded one).
|
|
54
|
+
* - The viewport is FIXED-PIXEL: `viewportWidth`/`viewportHeight`
|
|
55
|
+
* (defaults 720×360) — the grid does not auto-size to its container.
|
|
56
|
+
* Measure the container and pass px if you need it to fill.
|
|
57
|
+
* - Copy (Ctrl/Cmd+C) writes TSV through `copyTextWithFallback()` from
|
|
58
|
+
* `@molecule/app-clipboard`, which uses the bonded clipboard provider with
|
|
59
|
+
* a selection-and-copy fallback and never throws. Paste is handled through
|
|
60
|
+
* the native paste event, so the grid container must have focus (click a
|
|
61
|
+
* cell first). Keyboard support is Enter/F2 (edit) + copy/paste only; there
|
|
62
|
+
* is NO arrow-key cell navigation.
|
|
63
|
+
* - Committed edits and pasted cells auto-coerce number-like strings to
|
|
64
|
+
* numbers (`'42'` → `42`); empty string clears the cell (`null`).
|
|
65
|
+
* - Gridlines/selection/header styling uses Material-3 design-token
|
|
66
|
+
* utilities (`bg-surface`, `border-outline-variant`, …). Apps whose
|
|
67
|
+
* Tailwind theme does not define those tokens (the minimal scaffold
|
|
68
|
+
* theme does not) get a functional but unstyled grid.
|
|
69
|
+
*
|
|
70
|
+
* @module
|
|
71
|
+
*/
|
|
72
|
+
export * from './SpreadsheetGrid.jsx';
|
|
73
|
+
export * from './types.js';
|
|
74
|
+
export * from './utilities.js';
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|