@updog/data-editor 0.1.30 → 0.1.32
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 +10 -7
- package/index.d.ts +0 -1
- package/index.js +7 -3
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React CSV Importer & Spreadsheet Editor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> `@updog/data-editor`: client-side CSV importer and spreadsheet editor SDK for React. Your users import files, match columns to your schema, fix errors, and submit clean data. Edits happen inline, in the browser, at 1M+ rows.
|
|
4
4
|
|
|
5
5
|
## What is @updog/data-editor
|
|
6
6
|
|
|
@@ -145,13 +145,13 @@ In inline mode, `open` and `onClose` don't apply.
|
|
|
145
145
|
| `readonly` | `boolean` | No | `false` | Hide all editing UI. |
|
|
146
146
|
| `enableDeleteRow` | `"all"` \| `"new"` \| `false` | No | `false` | Row deletion policy. |
|
|
147
147
|
| `enableAddRow` | `boolean` | No | `true` | Show the "Add row" button. |
|
|
148
|
+
| `enableAddSource` | `boolean` | No | `true` | Show the "Add data source" button. |
|
|
148
149
|
| `enableCreateColumn` | `boolean` | No | `true` | Allow creating columns for unmatched CSV headers during import. |
|
|
149
|
-
| `importFormats` | `DataEditorFormat[]` | No | all | Allowed import formats. `[]` disables import. |
|
|
150
|
-
| `exportFormats` | `DataEditorFormat[]` | No | all | Allowed export formats. `[]` disables export. |
|
|
150
|
+
| `importFormats` | `DataEditorFormat[] \| false` | No | all | Allowed import formats. `false` or `[]` disables import. |
|
|
151
|
+
| `exportFormats` | `DataEditorFormat[] \| false` | No | all | Allowed export formats. `false` or `[]` disables export. |
|
|
151
152
|
| `remoteSources` | `RemoteSource[]` | No | — | Custom import buttons (Google Sheets, S3, etc.) rendered on the upload step. |
|
|
152
153
|
| `rowHeight` | `number` | No | `34` | Row height in pixels. |
|
|
153
154
|
| `headerHeight` | `number` | No | `36` | Header height in pixels. |
|
|
154
|
-
| `server` | `DataEditorServer<TRow>` | No | — | Server-delegated mode: SDK renders, your backend handles queries and mutations. |
|
|
155
155
|
| `chat` | `DataEditorChat<TRow>` | No | — | Bring-your-own AI chat panel. |
|
|
156
156
|
| `onColumnMatch` | `(headers, columns) => ...` | No | — | Override import column matching. |
|
|
157
157
|
| `onValueMatch` | `(valuesToMatch) => ...` | No | — | Override import value matching for `select` columns. |
|
|
@@ -196,6 +196,9 @@ const columns: DataEditorColumn[] = [
|
|
|
196
196
|
// Sidebar filter control.
|
|
197
197
|
filter: { type: "select" },
|
|
198
198
|
|
|
199
|
+
// Allow pinning this column to the leading edge via the header menu. Default true.
|
|
200
|
+
pinnable: true,
|
|
201
|
+
|
|
199
202
|
// Lock cells in this column. `"default"` locks only default-source rows.
|
|
200
203
|
locked: "default",
|
|
201
204
|
},
|
|
@@ -208,7 +211,7 @@ const columns: DataEditorColumn[] = [
|
|
|
208
211
|
|
|
209
212
|
## Built-in Validators
|
|
210
213
|
|
|
211
|
-
Validators are declarative objects passed in the `validators` array on each column.
|
|
214
|
+
Validators are declarative objects passed in the `validators` array on each column. They run on every edit, entirely in the browser.
|
|
212
215
|
|
|
213
216
|
| `type` | Fields | Behavior |
|
|
214
217
|
|---|---|---|
|
|
@@ -251,7 +254,7 @@ A `ValidationError` with `level: "error"` flags the cell in the grid but does **
|
|
|
251
254
|
|
|
252
255
|
### Custom validators
|
|
253
256
|
|
|
254
|
-
For cross-field checks or anything not covered by the built-ins, wrap a `CellValidator` function in `{ type: "function", fn }`.
|
|
257
|
+
For cross-field checks or anything not covered by the built-ins, wrap a `CellValidator` function in `{ type: "function", fn }`. Use `dependentFields` on the column to trigger re-validation when another column changes.
|
|
255
258
|
|
|
256
259
|
```tsx
|
|
257
260
|
import type { CellValidator, DataEditorColumn } from "@updog/data-editor";
|
package/index.d.ts
CHANGED
|
@@ -3152,7 +3152,6 @@ declare function exportDataEditor<TRow extends DataEditorRow>(params: ExportPara
|
|
|
3152
3152
|
* onClose={() => setIsOpen(false)}
|
|
3153
3153
|
* columns={columns}
|
|
3154
3154
|
* primaryKey="id"
|
|
3155
|
-
* server={{ url: scaleUrl }}
|
|
3156
3155
|
* loadData={async (onChunk) => onChunk(await fetchRows())}
|
|
3157
3156
|
* onComplete={async (result) => { await saveChanges(result); }}
|
|
3158
3157
|
* />
|
package/index.js
CHANGED
|
@@ -25816,9 +25816,13 @@ function QT(e) {
|
|
|
25816
25816
|
primaryKey: e.primaryKey,
|
|
25817
25817
|
columns: e.columns
|
|
25818
25818
|
}), [m, h] = y(e.variant === "uploader"), g = v(null), { value: _, setTrue: b, setFalse: w } = Ro(!1), T = t === "modal" ? e.onClose : void 0, E = d(() => {
|
|
25819
|
-
let
|
|
25820
|
-
|
|
25821
|
-
}, [
|
|
25819
|
+
let t = g.current?.getSnapshot();
|
|
25820
|
+
t && (t.dirtyRowCount > 0 || t.deletedRowCount > 0) && !e.readonly ? b() : T?.();
|
|
25821
|
+
}, [
|
|
25822
|
+
b,
|
|
25823
|
+
T,
|
|
25824
|
+
e.readonly
|
|
25825
|
+
]), D = d(() => T?.(), [T]), O = n(m ? "dataEditor.modal.importTitle" : "dataEditor.modal.editTitle");
|
|
25822
25826
|
p(() => {
|
|
25823
25827
|
t === "modal" && !o && h(e.variant === "uploader");
|
|
25824
25828
|
}, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updog/data-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Client-side CSV importer and spreadsheet editor SDK for React. Import CSV, Excel, JSON, TSV, and XML, match columns, validate, and edit 1M+ rows entirely in the browser.",
|
|
5
5
|
"author": "Mikhail Kutateladze <admin@updog.tech>",
|
|
6
6
|
"homepage": "https://updog.tech",
|
|
@@ -52,8 +52,11 @@
|
|
|
52
52
|
"keywords": [
|
|
53
53
|
"csv-importer",
|
|
54
54
|
"csv-import",
|
|
55
|
+
"importer",
|
|
55
56
|
"data-import",
|
|
56
57
|
"data-import-sdk",
|
|
58
|
+
"column-mapping",
|
|
59
|
+
"spreadsheet",
|
|
57
60
|
"spreadsheet-editor",
|
|
58
61
|
"react",
|
|
59
62
|
"react-csv",
|
|
@@ -62,9 +65,13 @@
|
|
|
62
65
|
"data-editor",
|
|
63
66
|
"csv",
|
|
64
67
|
"xlsx",
|
|
68
|
+
"excel",
|
|
65
69
|
"grid",
|
|
66
70
|
"table",
|
|
67
|
-
"validation"
|
|
71
|
+
"validation",
|
|
72
|
+
"flatfile-alternative",
|
|
73
|
+
"dromo-alternative",
|
|
74
|
+
"usecsv-alternative"
|
|
68
75
|
],
|
|
69
76
|
"publishConfig": {
|
|
70
77
|
"access": "public",
|