@updog/data-editor 0.1.79 → 0.1.81
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/index.css +1 -1
- package/index.d.ts +31 -3
- package/index.js +11950 -11424
- package/package.json +1 -1
- package/{sheetWorkerSource.generated-BRh0-P0M.js → sheetWorkerSource.generated-LkZmDPiq.js} +1 -1
package/index.d.ts
CHANGED
|
@@ -529,6 +529,9 @@ declare var export_default = {
|
|
|
529
529
|
editColumnTitle: "Edit column",
|
|
530
530
|
createColumnWarning: "A matching column already exists",
|
|
531
531
|
newColumnTag: "New",
|
|
532
|
+
sampleValues: "Example values",
|
|
533
|
+
sampleValuesEmpty: "No values in this column",
|
|
534
|
+
showSampleValues: "Show example values from {{column}}",
|
|
532
535
|
unmatchedWarning:
|
|
533
536
|
"Unmatched columns won't be imported. Match this column to keep the data. You can transform columns after importing.",
|
|
534
537
|
},
|
|
@@ -3122,10 +3125,24 @@ type CustomImportFormat = {
|
|
|
3122
3125
|
* Returns rows, named tables, or a `File` in a format the SDK already reads.
|
|
3123
3126
|
* Throw to fail the import; the thrown message is shown to the user.
|
|
3124
3127
|
*/
|
|
3125
|
-
handle:
|
|
3126
|
-
signal: AbortSignal;
|
|
3127
|
-
}) => Promise<File | Record<string, unknown>[] | CustomImportTable[]>;
|
|
3128
|
+
handle: FileHandler;
|
|
3128
3129
|
};
|
|
3130
|
+
/**
|
|
3131
|
+
* What client code may hand back for a file the SDK will not read itself: rows,
|
|
3132
|
+
* named tables, or a `File` in a format the SDK already reads.
|
|
3133
|
+
*/
|
|
3134
|
+
type FileHandlerResult = File | Record<string, unknown>[] | CustomImportTable[];
|
|
3135
|
+
/** Claims a file by extension and turns it into tables the SDK can stage. */
|
|
3136
|
+
type FileHandler = (file: File, ctx: {
|
|
3137
|
+
signal: AbortSignal;
|
|
3138
|
+
}) => Promise<FileHandlerResult>;
|
|
3139
|
+
/**
|
|
3140
|
+
* Takes over a readable file that holds no single table. `null` declines the
|
|
3141
|
+
* file, leaving it to be staged the ordinary way.
|
|
3142
|
+
*/
|
|
3143
|
+
type UnstructuredFileHandler = (file: File, ctx: {
|
|
3144
|
+
signal: AbortSignal;
|
|
3145
|
+
}) => Promise<FileHandlerResult | null>;
|
|
3129
3146
|
/**
|
|
3130
3147
|
* Controls the initial view when the editor opens.
|
|
3131
3148
|
*
|
|
@@ -3246,6 +3263,17 @@ type DataEditorBaseProps<TRow extends DataEditorRow = DataEditorRow> = {
|
|
|
3246
3263
|
* the file and stages whatever `handle()` returns.
|
|
3247
3264
|
*/
|
|
3248
3265
|
customFormats?: CustomImportFormat[];
|
|
3266
|
+
/**
|
|
3267
|
+
* Called when a file the SDK can read turns out to hold no single table —
|
|
3268
|
+
* a report with a banner, several tables on one sheet, a sheet that is really
|
|
3269
|
+
* a document. You get the `File` and return tables, exactly as a
|
|
3270
|
+
* `customFormats` handler does.
|
|
3271
|
+
*
|
|
3272
|
+
* Return `null`, throw, or take longer than 30 seconds and the file is staged
|
|
3273
|
+
* the ordinary way, as if this prop were absent. Nothing about the file
|
|
3274
|
+
* reaches Updog.
|
|
3275
|
+
*/
|
|
3276
|
+
onUnstructuredFile?: UnstructuredFileHandler;
|
|
3249
3277
|
/**
|
|
3250
3278
|
* Which file formats the user can export to. `undefined` allows all
|
|
3251
3279
|
* formats, `false` disables export entirely.
|