@solidexpert/csv-importer-angular 19.0.10 → 19.0.12
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/package.json +14 -22
- package/dist/README.md +0 -206
- /package/{dist/fesm2022 → fesm2022}/solidexpert-csv-importer-angular.mjs +0 -0
- /package/{dist/fesm2022 → fesm2022}/solidexpert-csv-importer-angular.mjs.map +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/lib → lib}/components/checkbox/checkbox.component.d.ts +0 -0
- /package/{dist/lib → lib}/components/errors/errors.component.d.ts +0 -0
- /package/{dist/lib → lib}/components/select/select.component.d.ts +0 -0
- /package/{dist/lib → lib}/components/stepper/stepper.component.d.ts +0 -0
- /package/{dist/lib → lib}/csv-importer/csv-importer.component.d.ts +0 -0
- /package/{dist/lib → lib}/features/complete/complete.component.d.ts +0 -0
- /package/{dist/lib → lib}/features/map-columns/map-columns.component.d.ts +0 -0
- /package/{dist/lib → lib}/features/row-selection/row-selection.component.d.ts +0 -0
- /package/{dist/lib → lib}/features/uploader/uploader.component.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/i18n.service.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/translations/de.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/translations/en.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/translations/es.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/translations/fr.d.ts +0 -0
- /package/{dist/lib → lib}/i18n/translations/index.d.ts +0 -0
- /package/{dist/lib → lib}/services/theme.service.d.ts +0 -0
- /package/{dist/lib → lib}/types/index.d.ts +0 -0
- /package/{dist/lib → lib}/utils/string-similarity.d.ts +0 -0
- /package/{dist/lib → lib}/utils/template.d.ts +0 -0
- /package/{dist/lib → lib}/utils/utils.d.ts +0 -0
- /package/{dist/public-api.d.ts → public-api.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidexpert/csv-importer-angular",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.12",
|
|
4
4
|
"description": "Open-source CSV, TSV, and XLS/XLSX file importer for Angular",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
],
|
|
8
5
|
"publishConfig": {
|
|
9
6
|
"access": "public"
|
|
10
7
|
},
|
|
@@ -19,23 +16,6 @@
|
|
|
19
16
|
"tslib": "^2.6.0",
|
|
20
17
|
"xlsx": "^0.18.5"
|
|
21
18
|
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "ng-packagr -p ng-package.json",
|
|
24
|
-
"prepublishOnly": "npm run build"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@angular/common": "^19.0.0",
|
|
28
|
-
"@angular/core": "^19.0.0",
|
|
29
|
-
"@angular/forms": "^19.0.0",
|
|
30
|
-
"@angular/cli": "^19.0.0",
|
|
31
|
-
"@angular/compiler": "^19.0.0",
|
|
32
|
-
"@angular/compiler-cli": "^19.0.0",
|
|
33
|
-
"@types/papaparse": "^5.3.14",
|
|
34
|
-
"ng-packagr": "^19.0.0",
|
|
35
|
-
"rxjs": "^7.8.0",
|
|
36
|
-
"typescript": "~5.6.0",
|
|
37
|
-
"zone.js": "~0.15.0"
|
|
38
|
-
},
|
|
39
19
|
"keywords": [
|
|
40
20
|
"csv",
|
|
41
21
|
"import",
|
|
@@ -54,5 +34,17 @@
|
|
|
54
34
|
"bugs": {
|
|
55
35
|
"url": "https://github.com/solidexpert-ltd/csv-parser-angular/issues"
|
|
56
36
|
},
|
|
57
|
-
"homepage": "https://github.com/solidexpert-ltd/csv-parser-angular#readme"
|
|
37
|
+
"homepage": "https://github.com/solidexpert-ltd/csv-parser-angular#readme",
|
|
38
|
+
"module": "fesm2022/solidexpert-csv-importer-angular.mjs",
|
|
39
|
+
"typings": "index.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
"./package.json": {
|
|
42
|
+
"default": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
|
+
"default": "./fesm2022/solidexpert-csv-importer-angular.mjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"sideEffects": false
|
|
58
50
|
}
|
package/dist/README.md
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
# CSV Import Angular
|
|
2
|
-
|
|
3
|
-
Open-source CSV, TSV, and XLS/XLSX file importer for Angular.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- 📁 **Multi-format support**: CSV, TSV, XLS, and XLSX files
|
|
8
|
-
- 🎨 **Theming**: Light and dark mode support with customizable primary color
|
|
9
|
-
- 🌍 **i18n**: Built-in translations (English, Spanish, French, German) with custom translation support
|
|
10
|
-
- 📱 **Modal & Inline**: Use as a modal or embed directly in your page
|
|
11
|
-
- ✅ **Column mapping**: Smart column matching with suggested mappings
|
|
12
|
-
- 🔧 **Customizable**: Custom styles, templates, and validation
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install @solidexpert/csv-importer-angular
|
|
18
|
-
# or
|
|
19
|
-
yarn add @solidexpert/csv-importer-angular
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Quick Start
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { Component } from '@angular/core';
|
|
26
|
-
import { CsvImporterComponent, Template, ImportResult } from '@solidexpert/csv-importer-angular';
|
|
27
|
-
|
|
28
|
-
@Component({
|
|
29
|
-
selector: 'app-root',
|
|
30
|
-
standalone: true,
|
|
31
|
-
imports: [CsvImporterComponent],
|
|
32
|
-
template: `
|
|
33
|
-
<button (click)="isOpen = true">Open Importer</button>
|
|
34
|
-
|
|
35
|
-
<csv-importer
|
|
36
|
-
[isModal]="true"
|
|
37
|
-
[modalIsOpen]="isOpen"
|
|
38
|
-
[darkMode]="true"
|
|
39
|
-
[template]="template"
|
|
40
|
-
(modalClose)="isOpen = false"
|
|
41
|
-
(complete)="onComplete($event)"
|
|
42
|
-
></csv-importer>
|
|
43
|
-
`
|
|
44
|
-
})
|
|
45
|
-
export class AppComponent {
|
|
46
|
-
isOpen = false;
|
|
47
|
-
|
|
48
|
-
template: Template = {
|
|
49
|
-
columns: [
|
|
50
|
-
{
|
|
51
|
-
name: 'First Name',
|
|
52
|
-
key: 'first_name',
|
|
53
|
-
required: true,
|
|
54
|
-
description: 'The first name of the user',
|
|
55
|
-
suggested_mappings: ['first', 'name']
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'Last Name',
|
|
59
|
-
key: 'last_name',
|
|
60
|
-
suggested_mappings: ['last', 'surname']
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'Email',
|
|
64
|
-
key: 'email',
|
|
65
|
-
required: true
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
onComplete(result: ImportResult): void {
|
|
71
|
-
console.log('Import complete:', result);
|
|
72
|
-
// Process your data here
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## API Reference
|
|
78
|
-
|
|
79
|
-
### Inputs
|
|
80
|
-
|
|
81
|
-
| Input | Type | Default | Description |
|
|
82
|
-
|-------|------|---------|-------------|
|
|
83
|
-
| `isModal` | `boolean` | `true` | Display as modal or inline |
|
|
84
|
-
| `modalIsOpen` | `boolean` | `true` | Control modal visibility |
|
|
85
|
-
| `modalCloseOnOutsideClick` | `boolean` | `false` | Close modal on backdrop click |
|
|
86
|
-
| `template` | `Template \| string` | - | Column configuration (required) |
|
|
87
|
-
| `darkMode` | `boolean` | `false` | Enable dark theme |
|
|
88
|
-
| `primaryColor` | `string` | `'#7a5ef8'` | Primary brand color |
|
|
89
|
-
| `showDownloadTemplateButton` | `boolean` | `true` | Show template download button |
|
|
90
|
-
| `skipHeaderRowSelection` | `boolean` | `false` | Skip header row selection step |
|
|
91
|
-
| `language` | `string` | `'en'` | UI language (en, es, fr, de) |
|
|
92
|
-
| `customTranslations` | `object` | - | Custom translation strings |
|
|
93
|
-
| `customStyles` | `object \| string` | - | CSS custom properties |
|
|
94
|
-
|
|
95
|
-
### Outputs
|
|
96
|
-
|
|
97
|
-
| Output | Type | Description |
|
|
98
|
-
|--------|------|-------------|
|
|
99
|
-
| `complete` | `ImportResult` | Emitted when import completes successfully |
|
|
100
|
-
| `modalClose` | `void` | Emitted when modal close is triggered |
|
|
101
|
-
|
|
102
|
-
### Template Configuration
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
interface Template {
|
|
106
|
-
columns: TemplateColumn[];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
interface TemplateColumn {
|
|
110
|
-
name: string; // Display name
|
|
111
|
-
key: string; // Unique identifier
|
|
112
|
-
description?: string; // Help text
|
|
113
|
-
required?: boolean; // Mark as required
|
|
114
|
-
suggested_mappings?: string[]; // Auto-match column names
|
|
115
|
-
multiple?: boolean; // Allow multiple columns to map
|
|
116
|
-
combiner?: (values: string[]) => string; // Custom value combiner
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Import Result
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
interface ImportResult {
|
|
124
|
-
num_rows: number;
|
|
125
|
-
num_columns: number;
|
|
126
|
-
error: string | null;
|
|
127
|
-
columns: { key: string; name: string }[];
|
|
128
|
-
rows: {
|
|
129
|
-
index: number;
|
|
130
|
-
values: Record<string, string | number>;
|
|
131
|
-
}[];
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Custom Translations
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
const customTranslations = {
|
|
139
|
-
en: {
|
|
140
|
-
'Upload': 'Upload File',
|
|
141
|
-
'Drop your file here': 'Drag and drop your file here'
|
|
142
|
-
},
|
|
143
|
-
fr: {
|
|
144
|
-
'Upload': 'Téléverser un fichier'
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// In template
|
|
149
|
-
<csv-importer
|
|
150
|
-
[customTranslations]="customTranslations"
|
|
151
|
-
></csv-importer>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Custom Styling
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
const customStyles = {
|
|
158
|
-
'--color-primary': '#10b981',
|
|
159
|
-
'--color-primary-hover': '#059669',
|
|
160
|
-
'--border-radius': '8px'
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
// In template
|
|
164
|
-
<csv-importer
|
|
165
|
-
[customStyles]="customStyles"
|
|
166
|
-
></csv-importer>
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Publishing
|
|
170
|
-
|
|
171
|
-
This package is automatically published to npm when a new version tag is pushed.
|
|
172
|
-
|
|
173
|
-
### Publishing a new version:
|
|
174
|
-
|
|
175
|
-
1. Update the version in `package.json`:
|
|
176
|
-
```bash
|
|
177
|
-
npm version patch # for bug fixes (1.0.0 -> 1.0.1)
|
|
178
|
-
npm version minor # for new features (1.0.0 -> 1.1.0)
|
|
179
|
-
npm version major # for breaking changes (1.0.0 -> 2.0.0)
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
2. Push the version commit and tag:
|
|
183
|
-
```bash
|
|
184
|
-
git push && git push --tags
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
3. The GitHub Actions workflow will automatically:
|
|
188
|
-
- Build the library
|
|
189
|
-
- Publish to npm as `@solidexpert/csv-importer-angular`
|
|
190
|
-
- Create a GitHub release
|
|
191
|
-
|
|
192
|
-
### Manual publishing:
|
|
193
|
-
|
|
194
|
-
You can also trigger the workflow manually from the GitHub Actions tab, or publish directly:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
npm run build
|
|
198
|
-
npm publish
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**Note**: You need to set up `NPM_TOKEN` secret in your GitHub repository settings for automatic publishing to work.
|
|
202
|
-
|
|
203
|
-
## License
|
|
204
|
-
|
|
205
|
-
MIT
|
|
206
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|