@importcsv/react 0.4.7 → 0.6.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/README.md +24 -45
- package/build/preact/index.esm.js +1543 -1503
- package/build/preact/index.esm.js.map +1 -1
- package/build/preact/index.js +21 -18
- package/build/preact/index.js.map +1 -1
- package/build/react/index.d.ts +29 -3
- package/build/react/index.esm.js +2496 -2462
- package/build/react/index.esm.js.map +1 -1
- package/build/react/index.js +23 -20
- package/build/react/index.js.map +1 -1
- package/package.json +1 -1
package/build/react/index.d.ts
CHANGED
|
@@ -100,13 +100,39 @@ export interface ThemeConfig {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Result structure returned by onComplete callback.
|
|
105
|
+
* Contains imported rows with their data and column metadata.
|
|
106
|
+
*/
|
|
107
|
+
export interface ImportResult<T = Record<string, unknown>> {
|
|
108
|
+
rows: (T & {
|
|
109
|
+
/** Values from dynamicColumns, keyed by column id */
|
|
110
|
+
_custom_fields?: Record<string, unknown>;
|
|
111
|
+
/** Values from unmapped CSV columns (when includeUnmatchedColumns is true) */
|
|
112
|
+
_unmatched?: Record<string, unknown>;
|
|
113
|
+
})[];
|
|
114
|
+
columns: {
|
|
115
|
+
/** Columns from the columns prop */
|
|
116
|
+
predefined: Column[];
|
|
117
|
+
/** Columns from the dynamicColumns prop */
|
|
118
|
+
dynamic: Column[];
|
|
119
|
+
/** CSV column names that were not mapped to any column */
|
|
120
|
+
unmatched: string[];
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
103
124
|
export interface CSVImporterProps {
|
|
104
125
|
columns?: Column[];
|
|
126
|
+
/**
|
|
127
|
+
* Customer-specific dynamic columns passed at runtime.
|
|
128
|
+
* These appear after predefined columns in the mapping dropdown.
|
|
129
|
+
* Output is nested under _custom_fields in each row.
|
|
130
|
+
*/
|
|
131
|
+
dynamicColumns?: Column[];
|
|
105
132
|
importerKey?: string;
|
|
106
|
-
onComplete?: (data:
|
|
133
|
+
onComplete?: (data: ImportResult) => void;
|
|
107
134
|
backendUrl?: string;
|
|
108
|
-
|
|
109
|
-
metadata?: Record<string, any>;
|
|
135
|
+
context?: Record<string, any>;
|
|
110
136
|
theme?: ThemeConfig | 'default' | 'minimal' | 'modern' | 'compact' | 'dark';
|
|
111
137
|
darkMode?: boolean;
|
|
112
138
|
primaryColor?: string;
|