@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/README.md
CHANGED
|
@@ -12,21 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
- **Column mapping** - Auto-matches columns, users fix the rest
|
|
18
|
-
- **Validation** - Required, unique, email, regex, custom
|
|
19
|
-
- **Large files** - Virtual scrolling handles 10k+ rows
|
|
20
|
-
- **~125KB gzipped**
|
|
21
|
-
|
|
22
|
-
Optional with backend: AI column matching, AI error fixing, natural language transforms.
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
15
|
+
## Install
|
|
25
16
|
|
|
26
17
|
```bash
|
|
27
|
-
npm install @importcsv/react
|
|
18
|
+
npm install @importcsv/react zod
|
|
28
19
|
```
|
|
29
20
|
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
30
23
|
```tsx
|
|
31
24
|
import { useState } from 'react';
|
|
32
25
|
import { CSVImporter } from '@importcsv/react';
|
|
@@ -48,54 +41,40 @@ function App() {
|
|
|
48
41
|
schema={schema}
|
|
49
42
|
modalIsOpen={isOpen}
|
|
50
43
|
modalOnCloseTriggered={() => setIsOpen(false)}
|
|
51
|
-
onComplete={(
|
|
44
|
+
onComplete={(result) => console.log(result.rows)}
|
|
52
45
|
/>
|
|
53
46
|
</>
|
|
54
47
|
);
|
|
55
48
|
}
|
|
56
49
|
```
|
|
57
50
|
|
|
58
|
-
Zod handles validation automatically. No need to define validators separately.
|
|
59
|
-
|
|
60
51
|
## Features
|
|
61
52
|
|
|
62
|
-
**
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
53
|
+
- **Column mapping** — Auto-matches headers to your schema
|
|
54
|
+
- **Zod validation** — Type-safe with automatic error messages
|
|
55
|
+
- **Large files** — Virtual scrolling handles 100k+ rows
|
|
56
|
+
- **~100KB gzipped** — Styles included
|
|
66
57
|
|
|
67
|
-
**
|
|
68
|
-
- Required, unique, min/max, regex
|
|
69
|
-
- Email, phone, date formats
|
|
70
|
-
- Custom validators
|
|
58
|
+
**File formats:** CSV, TSV, XLS, XLSX (Excel requires `npm install xlsx`)
|
|
71
59
|
|
|
72
|
-
**
|
|
73
|
-
- trim, uppercase, lowercase, capitalize
|
|
74
|
-
- normalize_phone, normalize_date
|
|
75
|
-
- Custom functions
|
|
60
|
+
**Frameworks:** React 16–19, Preact, Next.js
|
|
76
61
|
|
|
77
|
-
|
|
78
|
-
- React 16–19
|
|
79
|
-
- Preact
|
|
80
|
-
- Next.js (App & Pages Router)
|
|
62
|
+
## Theming
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- Dark mode support
|
|
64
|
+
```tsx
|
|
65
|
+
<CSVImporter theme="dark" primaryColor="#10b981" />
|
|
66
|
+
```
|
|
86
67
|
|
|
87
|
-
|
|
68
|
+
Presets: `default`, `minimal`, `modern`, `compact`, `dark`, `corporate`, `playful`
|
|
88
69
|
|
|
89
|
-
|
|
70
|
+
## Next.js / Preact
|
|
90
71
|
|
|
91
72
|
```tsx
|
|
73
|
+
// Next.js App Router
|
|
92
74
|
'use client';
|
|
93
75
|
import { CSVImporter } from '@importcsv/react';
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Preact
|
|
97
76
|
|
|
98
|
-
|
|
77
|
+
// Preact
|
|
99
78
|
import { CSVImporter } from '@importcsv/react/preact';
|
|
100
79
|
```
|
|
101
80
|
|
|
@@ -103,15 +82,15 @@ import { CSVImporter } from '@importcsv/react/preact';
|
|
|
103
82
|
|
|
104
83
|
With the [ImportCSV backend](https://github.com/importcsv/importcsv/tree/main/backend):
|
|
105
84
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
85
|
+
- AI column matching
|
|
86
|
+
- AI error fixing
|
|
87
|
+
- Natural language transforms
|
|
109
88
|
|
|
110
|
-
##
|
|
89
|
+
## Links
|
|
111
90
|
|
|
112
91
|
- [Documentation](https://docs.importcsv.com)
|
|
113
|
-
- [Issues](https://github.com/importcsv/importcsv/issues)
|
|
114
92
|
- [GitHub](https://github.com/importcsv/importcsv)
|
|
93
|
+
- [Issues](https://github.com/importcsv/importcsv/issues)
|
|
115
94
|
|
|
116
95
|
## License
|
|
117
96
|
|