@solidexpert/csv-importer-angular 1.0.8
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 +206 -0
- package/dist/README.md +206 -0
- package/dist/esm2022/lib/components/checkbox/checkbox.component.mjs +84 -0
- package/dist/esm2022/lib/components/errors/errors.component.mjs +40 -0
- package/dist/esm2022/lib/components/select/select.component.mjs +167 -0
- package/dist/esm2022/lib/components/stepper/stepper.component.mjs +129 -0
- package/dist/esm2022/lib/csv-importer/csv-importer.component.mjs +564 -0
- package/dist/esm2022/lib/features/complete/complete.component.mjs +79 -0
- package/dist/esm2022/lib/features/map-columns/map-columns.component.mjs +349 -0
- package/dist/esm2022/lib/features/row-selection/row-selection.component.mjs +224 -0
- package/dist/esm2022/lib/features/uploader/uploader.component.mjs +269 -0
- package/dist/esm2022/lib/i18n/i18n.service.mjs +41 -0
- package/dist/esm2022/lib/i18n/translations/de.mjs +32 -0
- package/dist/esm2022/lib/i18n/translations/en.mjs +32 -0
- package/dist/esm2022/lib/i18n/translations/es.mjs +32 -0
- package/dist/esm2022/lib/i18n/translations/fr.mjs +32 -0
- package/dist/esm2022/lib/i18n/translations/index.mjs +5 -0
- package/dist/esm2022/lib/services/theme.service.mjs +18 -0
- package/dist/esm2022/lib/types/index.mjs +8 -0
- package/dist/esm2022/lib/utils/string-similarity.mjs +50 -0
- package/dist/esm2022/lib/utils/template.mjs +69 -0
- package/dist/esm2022/lib/utils/utils.mjs +76 -0
- package/dist/esm2022/public-api.mjs +8 -0
- package/dist/esm2022/solidexpert-csv-importer-angular.mjs +5 -0
- package/dist/fesm2022/solidexpert-csv-importer-angular.mjs +2249 -0
- package/dist/fesm2022/solidexpert-csv-importer-angular.mjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/lib/components/checkbox/checkbox.component.d.ts +18 -0
- package/dist/lib/components/errors/errors.component.d.ts +7 -0
- package/dist/lib/components/select/select.component.d.ts +26 -0
- package/dist/lib/components/stepper/stepper.component.d.ts +14 -0
- package/dist/lib/csv-importer/csv-importer.component.d.ts +57 -0
- package/dist/lib/features/complete/complete.component.d.ts +13 -0
- package/dist/lib/features/map-columns/map-columns.component.d.ts +34 -0
- package/dist/lib/features/row-selection/row-selection.component.d.ts +29 -0
- package/dist/lib/features/uploader/uploader.component.d.ts +27 -0
- package/dist/lib/i18n/i18n.service.d.ts +11 -0
- package/dist/lib/i18n/translations/de.d.ts +1 -0
- package/dist/lib/i18n/translations/en.d.ts +1 -0
- package/dist/lib/i18n/translations/es.d.ts +1 -0
- package/dist/lib/i18n/translations/fr.d.ts +1 -0
- package/dist/lib/i18n/translations/index.d.ts +4 -0
- package/dist/lib/services/theme.service.d.ts +9 -0
- package/dist/lib/types/index.d.ts +83 -0
- package/dist/lib/utils/string-similarity.d.ts +1 -0
- package/dist/lib/utils/template.d.ts +2 -0
- package/dist/lib/utils/utils.d.ts +7 -0
- package/dist/public-api.d.ts +4 -0
- package/package.json +58 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface Template {
|
|
2
|
+
columns: TemplateColumn[];
|
|
3
|
+
}
|
|
4
|
+
export interface TemplateColumn {
|
|
5
|
+
name: string;
|
|
6
|
+
key: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
suggested_mappings?: string[];
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
combiner?: (values: string[]) => string;
|
|
12
|
+
}
|
|
13
|
+
export interface UploadColumn {
|
|
14
|
+
index: number;
|
|
15
|
+
name: string;
|
|
16
|
+
sample_data: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface FileRow {
|
|
19
|
+
index: number;
|
|
20
|
+
values: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface FileData {
|
|
23
|
+
fileName: string;
|
|
24
|
+
rows: FileRow[];
|
|
25
|
+
sheetList: string[];
|
|
26
|
+
errors: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface TemplateColumnMapping {
|
|
29
|
+
key: string;
|
|
30
|
+
include: boolean;
|
|
31
|
+
selected?: boolean;
|
|
32
|
+
isMultiple?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface CSVImporterConfig {
|
|
35
|
+
isModal?: boolean;
|
|
36
|
+
modalIsOpen?: boolean;
|
|
37
|
+
modalCloseOnOutsideClick?: boolean;
|
|
38
|
+
template?: Template | string;
|
|
39
|
+
darkMode?: boolean;
|
|
40
|
+
primaryColor?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
showDownloadTemplateButton?: boolean;
|
|
43
|
+
skipHeaderRowSelection?: boolean;
|
|
44
|
+
language?: string;
|
|
45
|
+
customTranslations?: Record<string, Record<string, string>>;
|
|
46
|
+
customStyles?: Record<string, string> | string;
|
|
47
|
+
}
|
|
48
|
+
export interface ImportResult {
|
|
49
|
+
num_rows: number;
|
|
50
|
+
num_columns: number;
|
|
51
|
+
error: string | null;
|
|
52
|
+
columns: {
|
|
53
|
+
key: string;
|
|
54
|
+
name: string;
|
|
55
|
+
}[];
|
|
56
|
+
rows: MappedRow[];
|
|
57
|
+
}
|
|
58
|
+
export interface MappedRow {
|
|
59
|
+
index: number;
|
|
60
|
+
values: Record<string, string | number>;
|
|
61
|
+
}
|
|
62
|
+
export interface StepConfig {
|
|
63
|
+
label: string;
|
|
64
|
+
id: string;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare enum StepEnum {
|
|
68
|
+
Upload = 0,
|
|
69
|
+
RowSelection = 1,
|
|
70
|
+
MapColumns = 2,
|
|
71
|
+
Complete = 3
|
|
72
|
+
}
|
|
73
|
+
export interface InputOption {
|
|
74
|
+
value: string;
|
|
75
|
+
required?: boolean;
|
|
76
|
+
multiple?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface TableCell {
|
|
79
|
+
raw?: string | number | boolean;
|
|
80
|
+
content?: string;
|
|
81
|
+
tooltip?: string;
|
|
82
|
+
}
|
|
83
|
+
export type TableRow = Record<string, TableCell | string | number | boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function stringsSimilarity(s1: string, s2: string): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function parseObjectOrStringJSON(name: string, param?: Record<string, unknown> | string): string;
|
|
2
|
+
export declare function parseObjectOrStringJSONToRecord(name: string, param?: Record<string, unknown> | string): Record<string, unknown>;
|
|
3
|
+
export declare function sanitizeKey(input: string): string;
|
|
4
|
+
export declare function isValidColor(color: string): boolean;
|
|
5
|
+
export declare function expandHex(color: string): string;
|
|
6
|
+
export declare function darkenColor(color: string, percent: number): string;
|
|
7
|
+
export declare function classes(classList: (string | false | undefined | null)[]): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solidexpert/csv-importer-angular",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "Open-source CSV, TSV, and XLS/XLSX file importer for Angular",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@angular/common": ">=17.0.0",
|
|
13
|
+
"@angular/core": ">=17.0.0",
|
|
14
|
+
"@angular/forms": ">=17.0.0",
|
|
15
|
+
"rxjs": ">=7.0.0"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"papaparse": "^5.4.1",
|
|
19
|
+
"tslib": "^2.6.0",
|
|
20
|
+
"xlsx": "^0.18.5"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "ng-packagr -p ng-package.json",
|
|
24
|
+
"prepublishOnly": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@angular/common": "^17.3.0",
|
|
28
|
+
"@angular/core": "^17.3.0",
|
|
29
|
+
"@angular/forms": "^17.3.0",
|
|
30
|
+
"@angular/cli": "^17.3.0",
|
|
31
|
+
"@angular/compiler": "^17.3.0",
|
|
32
|
+
"@angular/compiler-cli": "^17.3.0",
|
|
33
|
+
"@types/papaparse": "^5.3.14",
|
|
34
|
+
"ng-packagr": "^17.3.0",
|
|
35
|
+
"rxjs": "^7.8.0",
|
|
36
|
+
"typescript": "~5.4.0",
|
|
37
|
+
"zone.js": "~0.14.0"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"csv",
|
|
41
|
+
"import",
|
|
42
|
+
"excel",
|
|
43
|
+
"data",
|
|
44
|
+
"importer",
|
|
45
|
+
"angular",
|
|
46
|
+
"csv-import"
|
|
47
|
+
],
|
|
48
|
+
"author": "Solidexpert LTD",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/solidexpert-ltd/csv-parser-angular.git"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/solidexpert-ltd/csv-parser-angular/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/solidexpert-ltd/csv-parser-angular#readme"
|
|
58
|
+
}
|