@solidexpert/csv-importer-angular 19.0.10 → 19.0.13

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.
Files changed (32) hide show
  1. package/package.json +14 -22
  2. package/styles/_colors.scss +98 -0
  3. package/styles/_vars.scss +56 -0
  4. package/styles/global.scss +95 -0
  5. package/styles/themes/_common.scss +42 -0
  6. package/styles/themes/_dark.scss +87 -0
  7. package/styles/themes/_light.scss +87 -0
  8. package/dist/README.md +0 -206
  9. /package/{dist/fesm2022 → fesm2022}/solidexpert-csv-importer-angular.mjs +0 -0
  10. /package/{dist/fesm2022 → fesm2022}/solidexpert-csv-importer-angular.mjs.map +0 -0
  11. /package/{dist/index.d.ts → index.d.ts} +0 -0
  12. /package/{dist/lib → lib}/components/checkbox/checkbox.component.d.ts +0 -0
  13. /package/{dist/lib → lib}/components/errors/errors.component.d.ts +0 -0
  14. /package/{dist/lib → lib}/components/select/select.component.d.ts +0 -0
  15. /package/{dist/lib → lib}/components/stepper/stepper.component.d.ts +0 -0
  16. /package/{dist/lib → lib}/csv-importer/csv-importer.component.d.ts +0 -0
  17. /package/{dist/lib → lib}/features/complete/complete.component.d.ts +0 -0
  18. /package/{dist/lib → lib}/features/map-columns/map-columns.component.d.ts +0 -0
  19. /package/{dist/lib → lib}/features/row-selection/row-selection.component.d.ts +0 -0
  20. /package/{dist/lib → lib}/features/uploader/uploader.component.d.ts +0 -0
  21. /package/{dist/lib → lib}/i18n/i18n.service.d.ts +0 -0
  22. /package/{dist/lib → lib}/i18n/translations/de.d.ts +0 -0
  23. /package/{dist/lib → lib}/i18n/translations/en.d.ts +0 -0
  24. /package/{dist/lib → lib}/i18n/translations/es.d.ts +0 -0
  25. /package/{dist/lib → lib}/i18n/translations/fr.d.ts +0 -0
  26. /package/{dist/lib → lib}/i18n/translations/index.d.ts +0 -0
  27. /package/{dist/lib → lib}/services/theme.service.d.ts +0 -0
  28. /package/{dist/lib → lib}/types/index.d.ts +0 -0
  29. /package/{dist/lib → lib}/utils/string-similarity.d.ts +0 -0
  30. /package/{dist/lib → lib}/utils/template.d.ts +0 -0
  31. /package/{dist/lib → lib}/utils/utils.d.ts +0 -0
  32. /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.10",
3
+ "version": "19.0.13",
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
  }
@@ -0,0 +1,98 @@
1
+ // Base colors
2
+ $base-white: #ffffff;
3
+ $base-black: #000000;
4
+
5
+ // Gray scale
6
+ $gray-25: #fcfcfd;
7
+ $gray-50: #f9fafb;
8
+ $gray-100: #f2f4f7;
9
+ $gray-200: #eaecf0;
10
+ $gray-300: #d0d5dd;
11
+ $gray-400: #98a2b3;
12
+ $gray-500: #667085;
13
+ $gray-600: #475467;
14
+ $gray-700: #344054;
15
+ $gray-800: #1d2939;
16
+ $gray-900: #101828;
17
+
18
+ // Gray cool
19
+ $gray-cool-25: #fcfcfd;
20
+ $gray-cool-50: #f9f9fb;
21
+ $gray-cool-100: #eff1f5;
22
+ $gray-cool-200: #dcdfea;
23
+ $gray-cool-300: #b9c0d4;
24
+ $gray-cool-400: #7d89b0;
25
+ $gray-cool-500: #5d6b98;
26
+ $gray-cool-600: #4a5578;
27
+ $gray-cool-700: #404968;
28
+ $gray-cool-800: #30374f;
29
+ $gray-cool-900: #111322;
30
+
31
+ // Primary (purple)
32
+ $primary-25: #fcfaff;
33
+ $primary-50: #f9f5ff;
34
+ $primary-100: #f4ebff;
35
+ $primary-200: #e9d7fe;
36
+ $primary-300: #d6bbfb;
37
+ $primary-400: #b692f6;
38
+ $primary-500: #9e77ed;
39
+ $primary-600: #7a5ef8;
40
+ $primary-700: #6941c6;
41
+ $primary-800: #53389e;
42
+ $primary-900: #42307d;
43
+
44
+ // Error (red)
45
+ $error-25: #fffbfa;
46
+ $error-50: #fef3f2;
47
+ $error-100: #fee4e2;
48
+ $error-200: #fecdca;
49
+ $error-300: #fda29b;
50
+ $error-400: #f97066;
51
+ $error-500: #f04438;
52
+ $error-600: #d92d20;
53
+ $error-700: #b42318;
54
+ $error-800: #912018;
55
+ $error-900: #7a271a;
56
+
57
+ // Warning (yellow)
58
+ $warning-25: #fffcf5;
59
+ $warning-50: #fffaeb;
60
+ $warning-100: #fef0c7;
61
+ $warning-200: #fedf89;
62
+ $warning-300: #fec84b;
63
+ $warning-400: #fdb022;
64
+ $warning-500: #f79009;
65
+ $warning-600: #dc6803;
66
+ $warning-700: #b54708;
67
+ $warning-800: #93370d;
68
+ $warning-900: #7a2e0e;
69
+
70
+ // Success (green)
71
+ $success-25: #f6fef9;
72
+ $success-50: #ecfdf3;
73
+ $success-100: #d1fadf;
74
+ $success-200: #a6f4c5;
75
+ $success-300: #6ce9a6;
76
+ $success-400: #32d583;
77
+ $success-500: #12b76a;
78
+ $success-600: #039855;
79
+ $success-700: #027a48;
80
+ $success-800: #05603a;
81
+ $success-900: #054f31;
82
+
83
+ // Blue light
84
+ $blue-light-25: #f5fbff;
85
+ $blue-light-50: #f0f9ff;
86
+ $blue-light-100: #e0f2fe;
87
+ $blue-light-200: #b9e6fe;
88
+ $blue-light-300: #7cd4fd;
89
+ $blue-light-400: #36bffa;
90
+ $blue-light-500: #0ba5ec;
91
+ $blue-light-600: #0086c9;
92
+ $blue-light-700: #026aa2;
93
+ $blue-light-800: #065986;
94
+ $blue-light-900: #0b4a6f;
95
+
96
+ // Green
97
+ $green-600: #039855;
98
+
@@ -0,0 +1,56 @@
1
+ :root {
2
+ // DIMENSIONS
3
+
4
+ // margins and paddings
5
+ --base-spacing: 24px;
6
+ --m-xxxxs: calc(var(--base-spacing) / 5);
7
+ --m-xxxs: calc(var(--base-spacing) / 4);
8
+ --m-xxs: calc(var(--base-spacing) / 3);
9
+ --m-xs: calc(var(--base-spacing) / 2);
10
+ --m-s: calc(var(--base-spacing) * 2 / 3);
11
+ --m: var(--base-spacing);
12
+ --m-mm: calc(var(--base-spacing) * 3 / 2);
13
+ --m-l: calc(var(--base-spacing) * 5 / 3);
14
+ --m-xl: calc(var(--base-spacing) * 2);
15
+ --m-xxl: calc(var(--base-spacing) * 5 / 2);
16
+ --m-xxxl: calc(var(--base-spacing) * 3);
17
+
18
+ // FONTS
19
+
20
+ --font-size-xs: calc(var(--font-size) * 16 / 17);
21
+ --font-size-s: calc(var(--font-size) * 13 / 14);
22
+ --font-size: 0.875rem;
23
+ --font-size-l: calc(var(--font-size) * 8 / 7);
24
+ --font-size-xl: calc(var(--font-size) * 9 / 7);
25
+ --font-size-xxl: calc(var(--font-size) * 12 / 7);
26
+ --font-size-xxxl: calc(var(--font-size) * 18 / 7);
27
+ --font-size-h: calc(var(--font-size) * 24 / 7);
28
+
29
+ --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
30
+ --font-family-1: var(--font-family);
31
+ --font-family-2: "Laxan", sans-serif;
32
+
33
+ // BORDERS
34
+
35
+ --border-radius: 4px;
36
+ --border-radius-1: var(--border-radius);
37
+ --border-radius-2: calc(var(--border-radius) * 2);
38
+ --border-radius-3: calc(var(--border-radius) * 3);
39
+ --border-radius-4: calc(var(--border-radius) * 4);
40
+ --border-radius-5: calc(var(--border-radius) * 5);
41
+ --border-radius-r: 50%;
42
+
43
+ // TRANSITIONS
44
+
45
+ --fast: 0.3s;
46
+ --speed: 0.4s;
47
+ --slow: 0.9s;
48
+ --ease: ease-out;
49
+ --transition-ui: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), opacity var(--fast) var(--ease),
50
+ transform var(--fast) var(--ease), color var(--fast) var(--ease);
51
+
52
+ // BLURRED
53
+
54
+ --blurred: 5px;
55
+ }
56
+
@@ -0,0 +1,95 @@
1
+ @import './lib/styles/vars';
2
+ @import './lib/styles/colors';
3
+ @import './lib/styles/themes/common';
4
+ @import './lib/styles/themes/light';
5
+ @import './lib/styles/themes/dark';
6
+
7
+ * {
8
+ margin: 0;
9
+ padding: 0;
10
+ box-sizing: border-box;
11
+ }
12
+
13
+ body {
14
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
15
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
16
+ min-height: 100vh;
17
+ color: #e8e8e8;
18
+ }
19
+
20
+ // Apply dark theme variables by default
21
+ :root {
22
+ color-scheme: dark;
23
+
24
+ // BACKGROUND
25
+ --color-background: #0e1116;
26
+ --color-background-main: var(--color-background);
27
+ --color-background-modal: #171a20;
28
+ --color-background-modal-hover: #2e323c;
29
+ --color-background-modal-veil: #0e1116;
30
+ --color-background-modal-shadow: #0e1116;
31
+ --color-background-modal-shade: #171a20;
32
+
33
+ --color-tertiary: #{$gray-900};
34
+ --color-tertiary-hover: #{$gray-800};
35
+ --color-tertiary-focus: #{$gray-800};
36
+ --color-tertiary-disabled: #{$gray-200};
37
+
38
+ --color-background-menu: #{$gray-900};
39
+ --color-background-menu-hover: #{$gray-800};
40
+
41
+ // TEXT
42
+ --color-text-strong: #{$gray-100};
43
+ --color-text: #{$gray-300};
44
+ --color-text-soft: #{$gray-500};
45
+
46
+ --color-text-on-tertiary: #{$base-white};
47
+ --color-text-on-tertiary-disabled: #{$gray-500};
48
+
49
+ --color-error: #{$error-800};
50
+ --color-text-error: #{$error-500};
51
+ --color-background-error: #{$error-500};
52
+ --color-background-error-hover: #{$error-600};
53
+ --color-background-error-soft: #{$error-200};
54
+
55
+ // INPUT
56
+ --color-input-background: #{$gray-900};
57
+ --color-input-background-soft: #{$gray-800};
58
+ --color-input-border: #{$gray-700};
59
+ --color-input-placeholder: #{$gray-700};
60
+ --color-input-text-disabled: #{$gray-700};
61
+ --color-input-disabled: #171a20;
62
+
63
+ --color-border: #{$gray-800};
64
+
65
+ --color-background-small-button-selected: #{$gray-700};
66
+ --color-background-small-button-hover: #{$gray-900};
67
+ --color-text-small-button: $base-white;
68
+
69
+ // BUTTON
70
+ --color-button: #{$primary-50};
71
+ --color-button-hover: #{$primary-100};
72
+ --color-button-disabled: #{$primary-100};
73
+
74
+ --color-button-text: #171a20;
75
+ --color-button-text-disabled: #171a20;
76
+
77
+ --color-button-border: transparent;
78
+
79
+ // BORDER
80
+ --color-border: #{$gray-700};
81
+ --color-border-soft: #{$gray-800};
82
+
83
+ // ICONS
84
+ --color-icon: #{$gray-300};
85
+
86
+ // SHADOW
87
+ --color-bisel: rgba(255, 255, 255, 0.05);
88
+
89
+ // BRAND
90
+ --color-csv-import-text: var(--color-text);
91
+
92
+ // STEPPER
93
+ --color-stepper: #{$gray-cool-800};
94
+ --color-stepper-active: #{$success-300};
95
+ }
@@ -0,0 +1,42 @@
1
+ @import '../colors';
2
+
3
+ :root {
4
+ // BACKGROUND
5
+ --color-primary: #{$primary-600};
6
+ --color-primary-hover: #{$primary-700};
7
+ --color-primary-focus: #{$primary-600};
8
+ --color-primary-disabled: #{$primary-200};
9
+ --color-primary-button-disabled: #3f3b55;
10
+
11
+ --color-secondary: #{$gray-800};
12
+ --color-secondary-hover: #{$gray-600};
13
+ --color-secondary-focus: #{$gray-800};
14
+ --color-secondary-disabled: #{$gray-700};
15
+
16
+ // TEXT
17
+
18
+ --color-text-on-primary: #{$base-white};
19
+ --color-text-on-primary-disabled: #{$gray-500};
20
+ --color-text-on-primary-button-disabled: #{$base-white};
21
+
22
+ --color-text-on-secondary: #{$gray-100};
23
+ --color-text-on-secondary-disabled: #{$gray-600};
24
+
25
+ --color-progress-bar: #{$green-600};
26
+
27
+ --color-success: rgba(18, 183, 106, 0.88);
28
+ --color-emphasis: #{$blue-light-500};
29
+ --color-error: rgba(252, 93, 93, 0.88);
30
+ --color-attention: rgba(248, 203, 44, 0.88);
31
+
32
+ --color-importer-link: #2275d7;
33
+
34
+ --blue-light-500: #{$blue-light-500};
35
+ --color-green-ui: var(--color-progress-bar);
36
+ --color-green: var(--color-success);
37
+ --color-blue: #{$blue-light-500};
38
+ --color-red: rgba(252, 93, 93, 0.88);
39
+ --color-yellow: rgba(248, 203, 44, 0.88);
40
+ --importer-link: var(--color-importer-link);
41
+ }
42
+
@@ -0,0 +1,87 @@
1
+ @import '../colors';
2
+
3
+ .CSVImporter-dark {
4
+ color-scheme: dark;
5
+
6
+ // BACKGROUND
7
+
8
+ --color-background: #0e1116;
9
+ --color-background-main: var(--color-background);
10
+ --color-background-modal: #171a20;
11
+ --color-background-modal-hover: #2e323c;
12
+ --color-background-modal-veil: #0e1116;
13
+ --color-background-modal-shadow: #0e1116;
14
+ --color-background-modal-shade: #171a20;
15
+
16
+ --color-tertiary: #{$gray-900};
17
+ --color-tertiary-hover: #{$gray-800};
18
+ --color-tertiary-focus: #{$gray-800};
19
+ --color-tertiary-disabled: #{$gray-200};
20
+
21
+ --color-background-menu: #{$gray-900};
22
+ --color-background-menu-hover: #{$gray-800};
23
+
24
+ // TEXT
25
+
26
+ --color-text-strong: #{$gray-100};
27
+ --color-text: #{$gray-300};
28
+ --color-text-soft: #{$gray-500};
29
+
30
+ --color-text-on-tertiary: #{$base-white};
31
+ --color-text-on-tertiary-disabled: #{$gray-500};
32
+
33
+ --color-error: #{$error-800};
34
+ --color-text-error: #{$error-500};
35
+ --color-background-error: #{$error-500};
36
+ --color-background-error-hover: #{$error-600};
37
+ --color-background-error-soft: #{$error-200};
38
+
39
+ // INPUT
40
+
41
+ --color-input-background: #{$gray-900};
42
+ --color-input-background-soft: #{$gray-800};
43
+ --color-input-border: #{$gray-700};
44
+ --color-input-placeholder: #{$gray-700};
45
+ --color-input-text-disabled: #{$gray-700};
46
+ --color-input-disabled: #171a20;
47
+
48
+ --color-border: #{$gray-800};
49
+
50
+ --color-background-small-button-selected: #{$gray-700};
51
+ --color-background-small-button-hover: #{$gray-900};
52
+ --color-text-small-button: $base-white;
53
+
54
+ // BUTTON
55
+
56
+ --color-button: #{$primary-50};
57
+ --color-button-hover: #{$primary-100};
58
+ --color-button-disabled: #{$primary-100};
59
+
60
+ --color-button-text: #171a20;
61
+ --color-button-text-disabled: #171a20;
62
+
63
+ --color-button-border: transparent;
64
+
65
+ // BORDER
66
+
67
+ --color-border: #{$gray-700};
68
+ --color-border-soft: #{$gray-800};
69
+
70
+ // ICONS
71
+
72
+ --color-icon: #{$gray-300};
73
+
74
+ // SHADOW
75
+
76
+ --color-bisel: rgba(255, 255, 255, 0.05);
77
+
78
+ // BRAND
79
+
80
+ --color-csv-import-text: var(--color-text);
81
+
82
+ // STEPPER
83
+
84
+ --color-stepper: #{$gray-cool-800};
85
+ --color-stepper-active: #{$success-300};
86
+ }
87
+
@@ -0,0 +1,87 @@
1
+ @import '../colors';
2
+
3
+ .CSVImporter-light {
4
+ color-scheme: light;
5
+
6
+ // BACKGROUND
7
+
8
+ --color-background: #{$gray-100};
9
+ --color-background-main: #{$base-white};
10
+ --color-background-modal: #{$base-white};
11
+ --color-background-modal-hover: #{$base-white};
12
+ --color-background-modal-veil: #0e1116;
13
+ --color-background-modal-shadow: transparent;
14
+ --color-background-modal-shade: #{$gray-100};
15
+
16
+ --color-tertiary: #{$base-white};
17
+ --color-tertiary-hover: #{$gray-100};
18
+ --color-tertiary-focus: #{$base-white};
19
+ --color-tertiary-disabled: #{$gray-200};
20
+
21
+ --color-background-menu: #{$base-white};
22
+ --color-background-menu-hover: #{$gray-100};
23
+
24
+ // TEXT
25
+
26
+ --color-text-strong: #{$gray-900};
27
+ --color-text: #{$gray-800};
28
+ --color-text-soft: #{$gray-500};
29
+
30
+ --color-text-on-tertiary: #{$gray-700};
31
+ --color-text-on-tertiary-disabled: #{$gray-500};
32
+
33
+ --color-error: #{$error-200};
34
+ --color-text-error: #{$error-500};
35
+ --color-background-error: #{$error-500};
36
+ --color-background-error-hover: #{$error-600};
37
+ --color-background-error-soft: #{$error-200};
38
+
39
+ // INPUT
40
+
41
+ --color-input-background: #{$base-white};
42
+ --color-input-background-soft: #{$gray-300};
43
+ --color-input-border: #{$gray-700};
44
+ --color-input-placeholder: #{$gray-700};
45
+ --color-input-text-disabled: #{$gray-700};
46
+ --color-input-disabled: #{$gray-50};
47
+
48
+ --color-border: #{$gray-800};
49
+
50
+ --color-background-small-button-selected: #{$gray-100};
51
+ --color-background-small-button-hover: #{$gray-50};
52
+ --color-text-small-button: var(--color-text);
53
+
54
+ // BUTTON (default)
55
+
56
+ --color-button: #{$base-white};
57
+ --color-button-hover: #{$gray-100};
58
+ --color-button-disabled: #{$gray-25};
59
+
60
+ --color-button-text: var(--color-text-soft);
61
+ --color-button-text-disabled: #{$gray-300};
62
+
63
+ --color-button-border: #{$gray-300};
64
+
65
+ // BORDER
66
+
67
+ --color-border: #{$gray-300};
68
+ --color-border-soft: #{$gray-200};
69
+
70
+ // ICONS
71
+
72
+ --color-icon: #{$gray-cool-900};
73
+
74
+ // SHADOW
75
+
76
+ --color-bisel: rgba(0, 0, 0, 0.05);
77
+
78
+ // BRAND
79
+
80
+ --color-csv-import-text: #130638;
81
+
82
+ // STEPPER
83
+
84
+ --color-stepper: #{$gray-cool-300};
85
+ --color-stepper-active: #{$success-300};
86
+ }
87
+
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