@fluixi-ui/bulk-editor 0.2.1

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 Fluixi
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,92 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/fluixi/assets/main/logos/128x128.png" alt="Fluixi" width="120" height="120" />
3
+ </p>
4
+
5
+ # @fluixi-ui/bulk-editor
6
+
7
+ **Spreadsheet-style bulk data editor grid — Excel / Smartsheet interactions for the web.**
8
+
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg)](../../LICENSE)
10
+ ![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white)
11
+ ![Registry](https://img.shields.io/badge/registry-GitHub%20Packages-181717?logo=github)
12
+ ![Framework](https://img.shields.io/badge/framework-Fluixi%20%F0%9F%AB%96-ff6b35)
13
+
14
+ ---
15
+
16
+ A keyboard- and mouse-driven grid for editing many records at once. Range
17
+ selection, type-to-edit, fill-down, and TSV copy/paste — backed by a headless
18
+ engine you can drive on its own.
19
+
20
+ ```tsx
21
+ import { BulkEditor } from '@fluixi-ui/bulk-editor';
22
+ import type { BulkEditorColumn, BulkEditorRow } from '@fluixi-ui/bulk-editor';
23
+
24
+ const columns: BulkEditorColumn[] = [
25
+ { key: 'sku', header: 'SKU', align: 'left' },
26
+ { key: 'price', header: 'Price', type: 'number' },
27
+ { key: 'active', header: 'Active', type: 'checkbox' },
28
+ ];
29
+
30
+ const rows: BulkEditorRow[] = [
31
+ { id: 'g', isGroup: true, label: 'T-Shirt' },
32
+ { id: 'r1', label: 'Small / Black', data: { sku: 'TS-S-BLK', price: '19.00', active: '1' } },
33
+ ];
34
+
35
+ <BulkEditor
36
+ columns={() => columns}
37
+ rows={() => rows}
38
+ onCellChange={(rowId, colKey, value) => save(rowId, colKey, value)}
39
+ />
40
+ ```
41
+
42
+ ## Interactions
43
+
44
+ - **Select** — click a cell, shift-click / shift-arrow to extend, drag to sweep a
45
+ range, click a column header or row label for the whole column/row, corner cell
46
+ or `Ctrl+A` for all.
47
+ - **Edit** — double-click, `Enter`, `F2`, or just start typing; `Tab` / `Enter`
48
+ commit and move, `Escape` cancels. Committing with a range selected fills it.
49
+ - **Bulk** — `Delete` clears, `Ctrl+D` (or the fill handle) fills down,
50
+ `Ctrl+C` / `Ctrl+V` copy and paste TSV.
51
+
52
+ ## Columns & rows
53
+
54
+ - Column `type`: `text` | `number` | `checkbox`; plus `width`, `align`,
55
+ `readOnly`, `placeholder`, `headerExtra`, and a per-cell `disable`.
56
+ - Rows carry `data` (keyed by column key). `isGroup` rows are non-editable
57
+ section headers with an optional `groupData` map and `subLabel` / `thumbnail`.
58
+ `rowActions` renders a trailing actions cell.
59
+
60
+ ## Headless engine
61
+
62
+ The grid is a thin layer over `createBulkEditorState`, which owns the selection,
63
+ edit buffer, and bulk operations with no DOM:
64
+
65
+ ```tsx
66
+ import { createBulkEditorState } from '@fluixi-ui/bulk-editor';
67
+
68
+ const grid = createBulkEditorState({ columns, rows, onCellChange });
69
+ grid.selectAll();
70
+ grid.fillDown();
71
+ const tsv = grid.getSelectionTSV();
72
+ ```
73
+
74
+ ### Formula-ready
75
+
76
+ Every cell has a **raw** value (what was typed) and a **computed** value shown in
77
+ the grid. Pass an `evaluate` hook to compute it — the entry point for formatting,
78
+ computed columns, or a formula engine. A1 addressing (`colToLabel`, `parseAddress`,
79
+ `cellAddress`) is built in.
80
+
81
+ ```tsx
82
+ createBulkEditorState({
83
+ columns,
84
+ rows,
85
+ evaluate: ({ raw, get }) =>
86
+ raw.startsWith('=') ? String(Number(get('A1')) + Number(get('A2'))) : raw,
87
+ });
88
+ ```
89
+
90
+ ---
91
+
92
+ Part of the [Fluixi UI](../../README.md) component library. Made with ☕ by the Fluixi team.
@@ -0,0 +1,10 @@
1
+ import type { JSX } from '@fluixi/jsx';
2
+ import type { BulkEditorProps } from './types.js';
3
+ /**
4
+ * A spreadsheet-style bulk editor grid. Wraps {@link createBulkEditorState} with
5
+ * a keyboard/mouse-driven `role="grid"` surface: click / shift-click / drag to
6
+ * select, type or double-click to edit, arrows to navigate, drag the fill handle
7
+ * or Ctrl+D to fill down, and Ctrl+C/V to copy-paste.
8
+ */
9
+ export declare function BulkEditor(props: BulkEditorProps): JSX.Element;
10
+ //# sourceMappingURL=bulk-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-editor.d.ts","sourceRoot":"","sources":["../src/bulk-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,KAAK,EAAoB,eAAe,EAAqC,MAAM,YAAY,CAAC;AAyBvG;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAklB9D"}