├── .editorconfig ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml └── workflows │ └── nodejs.yml ├── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc.json ├── .release-it.json ├── .yarnrc.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── COMMITLINT.md ├── LICENSE ├── README.md ├── babel.config.js ├── commitlint.config.js ├── dist ├── index.d.ts ├── index.test.d.ts ├── react-csv-reader.js └── react-csv-reader.js.map ├── docs ├── 404 │ └── index.html ├── 18ce031aab28626b04079871b11d4debec0b4c99-b7ccf091a31b373f792a.js ├── 18ce031aab28626b04079871b11d4debec0b4c99-b7ccf091a31b373f792a.js.map ├── 18ce031aab28626b04079871b11d4debec0b4c99-b90c91ef27bc87d2e660.js ├── 18ce031aab28626b04079871b11d4debec0b4c99-b90c91ef27bc87d2e660.js.map ├── 18ce031aab28626b04079871b11d4debec0b4c99-c8bb116ab09776cce779.js ├── 18ce031aab28626b04079871b11d4debec0b4c99-c8bb116ab09776cce779.js.map ├── 404.html ├── app-2f9bfb7e1140136961fc.js ├── app-2f9bfb7e1140136961fc.js.map ├── app-34e6cffcaad7f6d50834.js ├── app-34e6cffcaad7f6d50834.js.map ├── app-4db72b120c10b7b7aca6.js ├── app-4db72b120c10b7b7aca6.js.map ├── app-5349113d739548149eda.js ├── app-5349113d739548149eda.js.map ├── app-6c0e184d66b4febef0b3.js ├── app-6c0e184d66b4febef0b3.js.map ├── app-7a619b62bb16133d8c92.js ├── app-7a619b62bb16133d8c92.js.map ├── app-8d7b95604e0b1f48a342.js ├── app-8d7b95604e0b1f48a342.js.map ├── app-eee93526f561bf9d28f8.js ├── app-eee93526f561bf9d28f8.js.map ├── app-f5dc30893aaff16423d7.js ├── app-f5dc30893aaff16423d7.js.map ├── bac1b955-cdbdc4e9e6c7bc5d8f90.js ├── bac1b955-cdbdc4e9e6c7bc5d8f90.js.map ├── chunk-map.json ├── component---docz-index-mdx-473152bc17ab119d2de3.js ├── component---docz-index-mdx-473152bc17ab119d2de3.js.map ├── component---docz-index-mdx-8d047ea6327ad8c76b39.js ├── component---docz-index-mdx-8d047ea6327ad8c76b39.js.map ├── component---docz-usage-mdx-1eb92be2297b0483f484.js ├── component---docz-usage-mdx-1eb92be2297b0483f484.js.map ├── component---docz-usage-mdx-5276e20c9807e3c1d63f.js ├── component---docz-usage-mdx-5276e20c9807e3c1d63f.js.map ├── component---docz-usage-mdx-74bb706b80ce9471bc9a.js ├── component---docz-usage-mdx-74bb706b80ce9471bc9a.js.map ├── component---src-pages-404-js-db753cdb2043952b245a.js ├── component---src-pages-404-js-db753cdb2043952b245a.js.map ├── framework-b78375d5ac8251e457fa.js ├── framework-b78375d5ac8251e457fa.js.map ├── index.html ├── page-data │ ├── 404 │ │ └── page-data.json │ ├── 404.html │ │ └── page-data.json │ ├── app-data.json │ ├── changelog │ │ └── page-data.json │ ├── code-of-conduct │ │ └── page-data.json │ ├── dev-404-page │ │ └── page-data.json │ ├── index │ │ └── page-data.json │ ├── react-csv-reader │ │ └── page-data.json │ ├── readme │ │ └── page-data.json │ ├── sq │ │ └── d │ │ │ └── 1635659820.json │ └── usage │ │ └── page-data.json ├── polyfill-e9d1aeba5f5365d2e706.js ├── polyfill-e9d1aeba5f5365d2e706.js.map ├── styles-2c77e34bdfc18dfe38bd.js ├── styles-2c77e34bdfc18dfe38bd.js.map ├── styles.2543ff947a193d7f33b1.css ├── usage │ └── index.html ├── webpack-runtime-1af6de491763f4d49a11.js ├── webpack-runtime-1af6de491763f4d49a11.js.map ├── webpack-runtime-23187edc4bd87b179dd1.js ├── webpack-runtime-23187edc4bd87b179dd1.js.map ├── webpack-runtime-2ae34d04ca419ab7c801.js ├── webpack-runtime-2ae34d04ca419ab7c801.js.map ├── webpack-runtime-37ad6d70e5fc58176869.js ├── webpack-runtime-37ad6d70e5fc58176869.js.map ├── webpack-runtime-4cda1870dfc9e640c110.js ├── webpack-runtime-4cda1870dfc9e640c110.js.map ├── webpack-runtime-67c59502f5b1a0d64647.js ├── webpack-runtime-67c59502f5b1a0d64647.js.map ├── webpack-runtime-714cf9e7272c81dbd362.js ├── webpack-runtime-714cf9e7272c81dbd362.js.map └── webpack.stats.json ├── docz ├── index.mdx └── usage.mdx ├── doczrc.js ├── package.json ├── src ├── __snapshots__ │ └── index.test.tsx.snap ├── index.test.tsx └── index.tsx ├── tsconfig.json ├── webpack.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | end_of_line = lf 4 | insert_final_newline = true 5 | trim_trailing_whitespace = true 6 | charset = utf-8 7 | 8 | [{*.css,*.scss}] 9 | indent_size = 4 10 | 11 | [{*.js,*.json}] 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["react-app", "plugin:jsx-a11y/recommended", "prettier", "prettier/react"], 3 | "plugins": ["prettier"], 4 | "rules": { 5 | "prettier/prettier": [ 6 | "warn", 7 | { 8 | "printWidth": 120, 9 | "singleQuote": true, 10 | "trailingComma": "all" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Platform (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: macos-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [12.x, 14.x, lts/*] 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Use Node.js ${{ matrix.node-version }} 24 | uses: actions/setup-node@v1 25 | with: 26 | node-version: ${{ matrix.node-version }} 27 | - name: Install dependencies 28 | run: yarn 29 | - name: Run tests 30 | run: yarn test 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Node ### 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | *.pid.lock 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # node-waf configuration 25 | .lock-wscript 26 | 27 | # Compiled binary addons (http://nodejs.org/api/addons.html) 28 | build/Release 29 | 30 | # Dependency directories 31 | node_modules/ 32 | jspm_packages/ 33 | /.pnp 34 | .pnp.* 35 | .yarn/* 36 | !.yarn/patches 37 | !.yarn/plugins 38 | !.yarn/releases 39 | !.yarn/sdks 40 | !.yarn/versions 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | # docz tmp build folder 64 | .docz 65 | 66 | ### Vim ### 67 | # swap 68 | [._]*.s[a-v][a-z] 69 | [._]*.sw[a-p] 70 | [._]s[a-v][a-z] 71 | [._]sw[a-p] 72 | # session 73 | Session.vim 74 | # temporary 75 | .netrwhist 76 | *~ 77 | # auto-generated tag files 78 | tags 79 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | docs 2 | docz 3 | .github 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | 4 | package.json 5 | package-lock.json 6 | yarn.lock 7 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "trailingComma": "all", 5 | "semi": false, 6 | "tabWidth": 2, 7 | "overrides": [ 8 | { 9 | "files": ["*.css", "*.scss"], 10 | "options": { 11 | "tabWidth": 4 12 | } 13 | }, 14 | { 15 | "files": "*.json", 16 | "options": { 17 | "printWidth": 200 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "git": { 3 | "tagName": "v${version}" 4 | }, 5 | "github": { 6 | "release": true, 7 | "releaseName": "${version}" 8 | }, 9 | "npm": { 10 | "publish": true, 11 | "skipChecks": true 12 | }, 13 | "hooks": { 14 | "before:init": "yarn test" 15 | }, 16 | "plugins": { 17 | "@release-it/conventional-changelog": { 18 | "infile": "CHANGELOG.md", 19 | "preset": { 20 | "name": "conventionalcommits", 21 | "types": [ 22 | { 23 | "type": "feat", 24 | "section": "Features" 25 | }, 26 | { 27 | "type": "fix", 28 | "section": "Bug Fixes" 29 | }, 30 | { 31 | "type": "refactor", 32 | "section": "Changes" 33 | }, 34 | { 35 | "type": "chore", 36 | "section": "Maintenance" 37 | } 38 | ] 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [4.0.0](https://github.com/nzambello/react-csv-reader/compare/v3.5.2...v4.0.0) (2023-03-23) 2 | 3 | 4 | ### ⚠ BREAKING CHANGES 5 | 6 | * Console error when using MutableRef from useRef 7 | 8 | ### Features 9 | 10 | * support react 18 ([3d02d93](https://github.com/nzambello/react-csv-reader/commit/3d02d936657b491ee0ae674f362ca4e7d25559e8)) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * `npm run docz:build` error ([5b410d0](https://github.com/nzambello/react-csv-reader/commit/5b410d0949c65ce765ea5356d4e87eeac9b4bfd7)) 16 | * cleanup merge conflicts ([90248db](https://github.com/nzambello/react-csv-reader/commit/90248dbd306faf0912055e0408bc4174eb3dcd93)) 17 | * Console error when using MutableRef from useRef ([6d5a595](https://github.com/nzambello/react-csv-reader/commit/6d5a595536dda3de1fe73a17a0c47a7b06e2dcfc)) 18 | 19 | 20 | ### Maintenance 21 | 22 | * `npm run build` ([62c04e1](https://github.com/nzambello/react-csv-reader/commit/62c04e10763021c78c5c40a4c1b1083e9ec4cfaf)) 23 | * add prop-types as dep ([a4067a4](https://github.com/nzambello/react-csv-reader/commit/a4067a43a5cf188656d24e2e5f7e977e4d0ee066)) 24 | * run build ([ebae51b](https://github.com/nzambello/react-csv-reader/commit/ebae51bdf5c15e4a5a38ece2afd6ea28c9b9141e)) 25 | * upgrade to yarn@3 ([ebde83b](https://github.com/nzambello/react-csv-reader/commit/ebde83b5c8a399ae105008915b5553d9cb172c71)) 26 | 27 | ### [3.5.2](https://github.com/nzambello/react-csv-reader/compare/v3.5.1...v3.5.2) (2022-09-22) 28 | 29 | 30 | ### Bug Fixes 31 | 32 | * prop-types error ([214ce9b](https://github.com/nzambello/react-csv-reader/commit/214ce9bb56c8d9054744745b3affac1e42f410ec)) 33 | 34 | ### [3.5.1](https://github.com/nzambello/react-csv-reader/compare/v3.5.0...v3.5.1) (2022-09-22) 35 | 36 | 37 | ### Maintenance 38 | 39 | * add react 17.0.0 to peerDependencies ([a4202bd](https://github.com/nzambello/react-csv-reader/commit/a4202bded38b3783e6c533f34ef48d9e2d6adf14)) 40 | * update peerDependencies to expect react 17 as well ([19164a0](https://github.com/nzambello/react-csv-reader/commit/19164a0de1dca643e789e466ccbbf9891dd657de)) 41 | 42 | ## [3.5.0](https://github.com/nzambello/react-csv-reader/compare/v3.4.0...v3.5.0) (2022-04-01) 43 | 44 | 45 | ### Features 46 | 47 | * add inputRef prop. ([7ec784c](https://github.com/nzambello/react-csv-reader/commit/7ec784cb088b8cd912bdf4cea9d8723d9136a95d)) 48 | 49 | 50 | ### Maintenance 51 | 52 | * run dist, move types to dev deps, update docz build ([a5de40d](https://github.com/nzambello/react-csv-reader/commit/a5de40d3b79813bf748ba03cde4e01a77052c384)) 53 | 54 | ## [3.4.0](https://github.com/nzambello/react-csv-reader/compare/v3.3.1...v3.4.0) (2021-10-04) 55 | 56 | 57 | ### Features 58 | 59 | * add originalFile to onFileLoaded ([0d379bd](https://github.com/nzambello/react-csv-reader/commit/0d379bd07813d5a77264ea811d0cd7c3f9310bc8)) 60 | 61 | 62 | ### Bug Fixes 63 | 64 | * originalFile attr + run build ([66906d8](https://github.com/nzambello/react-csv-reader/commit/66906d8b2aa4f0731f6843dcff5c41adf6bee928)) 65 | 66 | ### [3.3.1](https://github.com/nzambello/react-csv-reader/compare/v3.3.0...v3.3.1) (2021-07-09) 67 | 68 | 69 | ### Bug Fixes 70 | 71 | * fixed typo ([#58](https://github.com/nzambello/react-csv-reader/issues/58)) ([d9f0178](https://github.com/nzambello/react-csv-reader/commit/d9f0178550b49607e48cb897869169762b9e17a3)) 72 | 73 | 74 | ### Maintenance 75 | 76 | * react 16-17 in peerDeps ([#71](https://github.com/nzambello/react-csv-reader/issues/71)) ([3fe9f9b](https://github.com/nzambello/react-csv-reader/commit/3fe9f9bc9ed03c7044957e9d55a3a3ce301c7d02)) 77 | * update changelog preset types ([b122b35](https://github.com/nzambello/react-csv-reader/commit/b122b35859b8c8ca201720e64c5873c2b6e3b073)) 78 | 79 | # [3.3.0](https://github.com/nzambello/react-csv-reader/compare/v3.2.1...v3.3.0) (2021-02-24) 80 | 81 | 82 | ### Features 83 | 84 | * add strict prop for file type validation ([42078e5](https://github.com/nzambello/react-csv-reader/commit/42078e5d4f8c5432f14d69b5187b53d27599768f)) 85 | 86 | ## [3.2.1](https://github.com/nzambello/react-csv-reader/compare/v3.2.0...v3.2.1) (2021-02-11) 87 | 88 | # [3.2.0](https://github.com/nzambello/react-csv-reader/compare/v3.1.2...v3.2.0) (2021-02-10) 89 | 90 | 91 | ### Features 92 | 93 | * Add name attribute to file input ([24866bf](https://github.com/nzambello/react-csv-reader/commit/24866bfcc1bd1affe6a5c1ce69bfe4796e3dd205)) 94 | 95 | ### Changelog 96 | 97 | All notable changes to this project will be documented in this file. Dates are displayed in UTC. 98 | 99 | Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). 100 | 101 | #### [v3.1.2](https://github.com/nzambello/react-csv-reader/compare/v3.1.1...v3.1.2) 102 | 103 | - chore: updated release-it [`bdd9ec4`](https://github.com/nzambello/react-csv-reader/commit/bdd9ec4208255ab688441f7125cf165ae2aaa234) 104 | - chore: updated papaparse [`2a3fdd8`](https://github.com/nzambello/react-csv-reader/commit/2a3fdd83660200fced404bbfb221fe3ea51f5f78) 105 | 106 | #### [v3.1.1](https://github.com/nzambello/react-csv-reader/compare/v3.1.0...v3.1.1) 107 | 108 | > 18 August 2020 109 | 110 | - added docs with docz [`#48`](https://github.com/nzambello/react-csv-reader/pull/48) 111 | - Bump elliptic from 6.5.2 to 6.5.3 [`#47`](https://github.com/nzambello/react-csv-reader/pull/47) 112 | - Release 3.1.1 [`5d7b940`](https://github.com/nzambello/react-csv-reader/commit/5d7b9408da7539c999cfa15e3d7d21f814df1ab2) 113 | - added link to docs in readme [`9644a90`](https://github.com/nzambello/react-csv-reader/commit/9644a9033be4da3fa510dcd3dc16a61da00ac536) 114 | 115 | #### [v3.1.0](https://github.com/nzambello/react-csv-reader/compare/v3.0.6...v3.1.0) 116 | 117 | > 23 June 2020 118 | 119 | - Add Label Class Option [`#44`](https://github.com/nzambello/react-csv-reader/pull/44) 120 | - updated lockfile [`497d105`](https://github.com/nzambello/react-csv-reader/commit/497d105dff2f1a8ab3519391baf6f98e04b1d1fc) 121 | - Add the ability to specify the class for the label [`1484af9`](https://github.com/nzambello/react-csv-reader/commit/1484af98179cd5bb8ef5294add1a1b69127b8f7a) 122 | - Release 3.1.0 [`24f576f`](https://github.com/nzambello/react-csv-reader/commit/24f576fbd3c14d338befbbdd2b6c4fac675d3a24) 123 | - Remove unintended imports [`aec30aa`](https://github.com/nzambello/react-csv-reader/commit/aec30aa9ce8cec9ea5a3800e71a6da784cb35d55) 124 | - Update @babel/preset-env to resolve build error [`406094f`](https://github.com/nzambello/react-csv-reader/commit/406094f213a7a76c704f709850eede2626151090) 125 | - Remove commented code [`b5ac873`](https://github.com/nzambello/react-csv-reader/commit/b5ac873b265c55401668e94ef31677433ffcb97d) 126 | - Remove unintended imports [`ee3556b`](https://github.com/nzambello/react-csv-reader/commit/ee3556b3a15404d1a0415546794cbc6140047f61) 127 | - update more strict prettier config [`e7a5ad0`](https://github.com/nzambello/react-csv-reader/commit/e7a5ad0f66d6b804776aa410ccee6736fed36561) 128 | 129 | #### [v3.0.6](https://github.com/nzambello/react-csv-reader/compare/v3.0.5...v3.0.6) 130 | 131 | > 2 May 2020 132 | 133 | - Fix type checker [`#43`](https://github.com/nzambello/react-csv-reader/pull/43) 134 | - Release 3.0.6 [`c390692`](https://github.com/nzambello/react-csv-reader/commit/c390692f4b53c40bb5482a167dd2f7ae3d5cd821) 135 | 136 | #### [v3.0.5](https://github.com/nzambello/react-csv-reader/compare/v3.0.4...v3.0.5) 137 | 138 | > 3 April 2020 139 | 140 | - Update webpack.config.js [`#40`](https://github.com/nzambello/react-csv-reader/pull/40) 141 | - Update issue templates [`#39`](https://github.com/nzambello/react-csv-reader/pull/39) 142 | - Create CODE_OF_CONDUCT.md [`c01b9ea`](https://github.com/nzambello/react-csv-reader/commit/c01b9ea6b41bd5edb4f5e413b410d4005d46a54c) 143 | - Release 3.0.5 [`7181762`](https://github.com/nzambello/react-csv-reader/commit/718176221cc481a1f27fe7d9e7cd612f5a6e5e36) 144 | - added github integration in release-it [`5e17a37`](https://github.com/nzambello/react-csv-reader/commit/5e17a37a102fbb6ec9b74f6c83eb6d96d342fd06) 145 | - dev: added nullish handling as empty list for results [`0a311f6`](https://github.com/nzambello/react-csv-reader/commit/0a311f6ffc3e6c230365058752cc850375905daa) 146 | - Update README.md [`332079f`](https://github.com/nzambello/react-csv-reader/commit/332079fed6065f3b0ba1b21e95f011f12f04afc8) 147 | 148 | #### [v3.0.4](https://github.com/nzambello/react-csv-reader/compare/v3.0.3...v3.0.4) 149 | 150 | > 21 March 2020 151 | 152 | - added release-it [`778ee81`](https://github.com/nzambello/react-csv-reader/commit/778ee8190f2891dcf86b40a27c687ac21cf63319) 153 | - Release 3.0.4 [`8a4a9d6`](https://github.com/nzambello/react-csv-reader/commit/8a4a9d6e3ee58e71eb9a0e96a1830e82ac0ae94a) 154 | - included PapaParse types for parserOptions prop [`48506f8`](https://github.com/nzambello/react-csv-reader/commit/48506f8b7f38c5ee68c4669c5808589fdebd5553) 155 | - fix release-it config [`b10ae0a`](https://github.com/nzambello/react-csv-reader/commit/b10ae0a86e455e35084da7d4b2d87254ea2f73f6) 156 | - fix changelog [`27640eb`](https://github.com/nzambello/react-csv-reader/commit/27640ebdf9709b9cf69e51f965c8c1276ec69691) 157 | 158 | #### [v3.0.3](https://github.com/nzambello/react-csv-reader/compare/v3.0.2...v3.0.3) 159 | 160 | > 21 March 2020 161 | 162 | - added declaration file [`#38`](https://github.com/nzambello/react-csv-reader/pull/38) 163 | 164 | #### [v3.0.2](https://github.com/nzambello/react-csv-reader/compare/v3.0.1...v3.0.2) 165 | 166 | > 16 March 2020 167 | 168 | - updated README [`7feaec3`](https://github.com/nzambello/react-csv-reader/commit/7feaec3747e784c63f5bf5ac7b04437ff262cd5c) 169 | 170 | #### [v3.0.1](https://github.com/nzambello/react-csv-reader/compare/v3.0.0...v3.0.1) 171 | 172 | > 16 March 2020 173 | 174 | - added a11y axe tests, refactoring tests [`#35`](https://github.com/nzambello/react-csv-reader/pull/35) 175 | 176 | ### [v3.0.0](https://github.com/nzambello/react-csv-reader/compare/v2.2.1...v3.0.0) 177 | 178 | > 16 March 2020 179 | 180 | - moved to typescript [`#34`](https://github.com/nzambello/react-csv-reader/pull/34) 181 | 182 | #### [v2.2.1](https://github.com/nzambello/react-csv-reader/compare/v2.2.0...v2.2.1) 183 | 184 | > 16 March 2020 185 | 186 | - Create nodejs.yml [`#33`](https://github.com/nzambello/react-csv-reader/pull/33) 187 | - updated readme [`ac3bdd3`](https://github.com/nzambello/react-csv-reader/commit/ac3bdd3485080cdcbde25f59b74bfd55f8fb9227) 188 | - updated readme [`5b897fa`](https://github.com/nzambello/react-csv-reader/commit/5b897fa19937633f362bd26a5be35a6afc94d76c) 189 | - updated readme [`ec49b06`](https://github.com/nzambello/react-csv-reader/commit/ec49b06734ef28bf6a0fed63bf4694378cab3b60) 190 | 191 | #### [v2.2.0](https://github.com/nzambello/react-csv-reader/compare/v2.1.0...v2.2.0) 192 | 193 | > 14 March 2020 194 | 195 | - Added disabled prop [`#32`](https://github.com/nzambello/react-csv-reader/pull/32) 196 | - added tests for single props [`20f63b8`](https://github.com/nzambello/react-csv-reader/commit/20f63b82dea5c929b49f7af874b1283ccc2758e5) 197 | - updated build [`1653b8b`](https://github.com/nzambello/react-csv-reader/commit/1653b8b37d2f78881bd85d8da2a36eca927c89e9) 198 | 199 | #### [v2.1.0](https://github.com/nzambello/react-csv-reader/compare/v2.0.2...v2.1.0) 200 | 201 | > 14 March 2020 202 | 203 | - Bump acorn from 6.3.0 to 6.4.1 [`#31`](https://github.com/nzambello/react-csv-reader/pull/31) 204 | - added test machinery and snapshots, build [`6611b76`](https://github.com/nzambello/react-csv-reader/commit/6611b76d4a4611453fcc3e08cec0ae8a301d2cc3) 205 | - updated dependencies [`38167a7`](https://github.com/nzambello/react-csv-reader/commit/38167a7d34d21fcce4dbf1ff384632b92bc27e75) 206 | - updated README and added default inputId [`0454b99`](https://github.com/nzambello/react-csv-reader/commit/0454b990650235d90912c131d088a8b8c1ed3602) 207 | - updated snapshots [`eaa1804`](https://github.com/nzambello/react-csv-reader/commit/eaa18040ded9fed6d9158aff1c89475af7d2bba0) 208 | - Added filename as second argument in onFileLoaded example [`186a423`](https://github.com/nzambello/react-csv-reader/commit/186a42392bda509fa07be6e67020ee6ce5b5b3de) 209 | 210 | #### [v2.0.2](https://github.com/nzambello/react-csv-reader/compare/v2.0.1...v2.0.2) 211 | 212 | > 4 November 2019 213 | 214 | - updated README [`a25a4f3`](https://github.com/nzambello/react-csv-reader/commit/a25a4f350abfc811e5aef25cd1abb2436918c126) 215 | 216 | #### [v2.0.1](https://github.com/nzambello/react-csv-reader/compare/v2.0.0...v2.0.1) 217 | 218 | > 4 November 2019 219 | 220 | - updated codesandbox demo [`0711961`](https://github.com/nzambello/react-csv-reader/commit/07119618c999f1c1a0da1246b5756eb54746dc5e) 221 | 222 | ### [v2.0.0](https://github.com/nzambello/react-csv-reader/compare/v1.3.1...v2.0.0) 223 | 224 | > 4 November 2019 225 | 226 | - added and upgraded dev plugins, upgraded to webpack to v4, upgraded papaparse to v5 [`44900ff`](https://github.com/nzambello/react-csv-reader/commit/44900ff175683a024bffd673b665a1db953d4398) 227 | - added missing prop-types [`389af15`](https://github.com/nzambello/react-csv-reader/commit/389af15b5f8deeb759aa12e99d0e45ed4b5a2cc7) 228 | 229 | #### [v1.3.1](https://github.com/nzambello/react-csv-reader/compare/v1.3.0...v1.3.1) 230 | 231 | > 3 September 2019 232 | 233 | - Update README [`5e5c4f3`](https://github.com/nzambello/react-csv-reader/commit/5e5c4f3b22f1b0a5ab8d731b090b256dee6352f9) 234 | 235 | #### [v1.3.0](https://github.com/nzambello/react-csv-reader/compare/v1.2.2...v1.3.0) 236 | 237 | > 3 September 2019 238 | 239 | - Can specify input file encoding [`#21`](https://github.com/nzambello/react-csv-reader/pull/21) 240 | - Support for "accept" file type options [`#18`](https://github.com/nzambello/react-csv-reader/pull/18) 241 | - Fixes error on cancel [`#20`](https://github.com/nzambello/react-csv-reader/pull/20) 242 | - updated build [`6f8e3ec`](https://github.com/nzambello/react-csv-reader/commit/6f8e3ecd8bf399b780fa44ae1666de5e8c6cb74e) 243 | 244 | #### [v1.2.2](https://github.com/nzambello/react-csv-reader/compare/v1.2.1...v1.2.2) 245 | 246 | > 19 January 2019 247 | 248 | - Added Patreon link on README [`a355353`](https://github.com/nzambello/react-csv-reader/commit/a35535311b311b15c92dfff3ab05d0efbbb74650) 249 | 250 | #### [v1.2.1](https://github.com/nzambello/react-csv-reader/compare/v1.2.0...v1.2.1) 251 | 252 | > 31 December 2018 253 | 254 | - Fixing `accept` file type in input [`#11`](https://github.com/nzambello/react-csv-reader/pull/11) 255 | 256 | #### [v1.2.0](https://github.com/nzambello/react-csv-reader/compare/v1.1.0...v1.2.0) 257 | 258 | > 22 December 2018 259 | 260 | - added separated arguments for css classes [`7265188`](https://github.com/nzambello/react-csv-reader/commit/72651888fa8ff41e7d01871a73baff370c4f6e9b) 261 | 262 | #### [v1.1.0](https://github.com/nzambello/react-csv-reader/compare/v1.0.0...v1.1.0) 263 | 264 | > 19 October 2018 265 | 266 | - added option to include input style as prop [`560d6fe`](https://github.com/nzambello/react-csv-reader/commit/560d6fe3d292164211e605c7bd642ef659a95361) 267 | 268 | ### [v1.0.0](https://github.com/nzambello/react-csv-reader/compare/v0.3.3...v1.0.0) 269 | 270 | > 6 October 2018 271 | 272 | - allow parser options to be overridden [`51c8e93`](https://github.com/nzambello/react-csv-reader/commit/51c8e93bcabae71c6fdc18982a4c94cf649cef57) 273 | - deleted unwanted lock file [`5f10bd9`](https://github.com/nzambello/react-csv-reader/commit/5f10bd9897faf073d7c3114dd5c37ae647c3c06d) 274 | - fix label attribute for/htmlFor [`d80f1a0`](https://github.com/nzambello/react-csv-reader/commit/d80f1a0982d2f9c1ee2f226a25fded285383e65a) 275 | 276 | #### [v0.3.3](https://github.com/nzambello/react-csv-reader/compare/v0.3.2...v0.3.3) 277 | 278 | > 18 June 2018 279 | 280 | - Added for={inputId} to label option. [`#4`](https://github.com/nzambello/react-csv-reader/pull/4) 281 | - run dist [`75f8c7a`](https://github.com/nzambello/react-csv-reader/commit/75f8c7a8e8e2cb2c079a18cbfa4d7dbc13b7ae8e) 282 | 283 | #### [v0.3.2](https://github.com/nzambello/react-csv-reader/compare/v0.3.1...v0.3.2) 284 | 285 | > 12 June 2018 286 | 287 | - run dist [`5f90cc3`](https://github.com/nzambello/react-csv-reader/commit/5f90cc33b190b1ab15fe0c7d512bcfa456b90810) 288 | 289 | #### [v0.3.1](https://github.com/nzambello/react-csv-reader/compare/v0.2.2...v0.3.1) 290 | 291 | > 12 June 2018 292 | 293 | - added inputId attribute: input element ID [`#3`](https://github.com/nzambello/react-csv-reader/pull/3) 294 | - Provide the filename as an argument to onFileLoaded [`#1`](https://github.com/nzambello/react-csv-reader/pull/1) 295 | 296 | #### [v0.2.2](https://github.com/nzambello/react-csv-reader/compare/v0.2.1...v0.2.2) 297 | 298 | > 20 January 2018 299 | 300 | - Updated README with demo [`34fcd5b`](https://github.com/nzambello/react-csv-reader/commit/34fcd5b91ff496e3c9d5f78c9e6415fc65638eca) 301 | 302 | #### [v0.2.1](https://github.com/nzambello/react-csv-reader/compare/v0.2.0...v0.2.1) 303 | 304 | > 24 December 2017 305 | 306 | - moved css class to outer div, it's more useful [`f0b91b7`](https://github.com/nzambello/react-csv-reader/commit/f0b91b79d88abc8a2aa860904b53726199891f75) 307 | 308 | #### [v0.2.0](https://github.com/nzambello/react-csv-reader/compare/v0.1.1...v0.2.0) 309 | 310 | > 24 December 2017 311 | 312 | - added support for react elements in label [`45f83d3`](https://github.com/nzambello/react-csv-reader/commit/45f83d3365e27f020b8c1805d0c1f85564a79955) 313 | 314 | #### v0.1.1 315 | 316 | > 23 December 2017 317 | 318 | - initial commit [`1bb92f7`](https://github.com/nzambello/react-csv-reader/commit/1bb92f7f9f20678b67dc82e48b85ea358216ea21) 319 | - added eslint [`cbb67c1`](https://github.com/nzambello/react-csv-reader/commit/cbb67c131cb70accaf1919c76406bc319e472524) 320 | - added component and basic functionalities [`c932735`](https://github.com/nzambello/react-csv-reader/commit/c932735ba449cf6e6d71d97d081b3e37180990a8) 321 | - added usage and docs to README [`aac3ee1`](https://github.com/nzambello/react-csv-reader/commit/aac3ee19b51a447f4109ad829be80c563c9cfeaa) 322 | - added cssClass and label attributes [`905dd3a`](https://github.com/nzambello/react-csv-reader/commit/905dd3afca01cd4ac35d03e2220ba2166a8c1f5b) 323 | - Create LICENSE [`0e59b40`](https://github.com/nzambello/react-csv-reader/commit/0e59b4040bf927d975f41f7aeb363613f74d2af6) 324 | - added return value explanation [`384df46`](https://github.com/nzambello/react-csv-reader/commit/384df468539d9f0a865fb7987f25321b1ad9118e) 325 | - fix readme example code [`8e23c6e`](https://github.com/nzambello/react-csv-reader/commit/8e23c6ed4f247fe79565f39fbeeb1ea184893a1a) 326 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at nzambello@protonmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /COMMITLINT.md: -------------------------------------------------------------------------------- 1 | # Commit Messages Format 2 | 3 | This project uses the (conventional commit specification)[https://www.conventionalcommits.org/en/v1.0.0/#specification] for consistent commit messages. 4 | 5 | All commit messages should have the following form: 6 | 7 | ```` 8 | : 9 | ```` 10 | 11 | ## Fix 12 | 13 | A fix (PATCH in semantic versioning) looks like this: 14 | 15 | ```` 16 | fix: correct minor typos in code 17 | ```` 18 | 19 | ## Feature 20 | 21 | A new feature (MINOR in semantic versioning) looks like this: 22 | 23 | ```` 24 | feat: add catalan language 25 | ```` 26 | 27 | ## Breaking Change 28 | 29 | Breaking changes can be indicated by either appending a "!" to the type: 30 | 31 | ```` 32 | refactor!: drop support for Node 6 33 | ```` 34 | 35 | Or adding "BREAKING CHANGE" to the commit message body text: 36 | 37 | ```` 38 | refactor!: drop support for Node 6 39 | 40 | BREAKING CHANGE: refactor to use JavaScript features not available in Node 6. 41 | ```` 42 | 43 | ## Available Types 44 | 45 | In addition to "fix" and "feat" the following types are allowed: 46 | build:, chore:, ci:, docs:, style:, refactor:, perf:, test: 47 | 48 | 49 | 50 | Install commitlint: 51 | 52 | ```` 53 | npm install --save-dev @commitlint/{config-conventional,cli} 54 | ```` 55 | 56 | or via yarn: 57 | 58 | ```` 59 | yarn add @commitlint/{config-conventional,cli} 60 | ```` 61 | 62 | Create a commitlint.config.js file: 63 | 64 | ```` 65 | echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js 66 | ```` 67 | 68 | Add husky to package.json: 69 | 70 | ```` 71 | { 72 | "husky": { 73 | "hooks": { 74 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" 75 | } 76 | } 77 | } 78 | ```` 79 | 80 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-2021 Nicola Zambello 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-csv-reader 2 | 3 | [![npm version](https://img.shields.io/github/package-json/v/nzambello/react-csv-reader)](https://www.npmjs.com/package/react-csv-reader) 4 | [![npm](https://img.shields.io/npm/dm/react-csv-reader)](https://www.npmjs.com/package/react-csv-reader) 5 | ![Node.js CI](https://github.com/nzambello/react-csv-reader/workflows/Node.js%20CI/badge.svg?branch=master) 6 | ![a11y axe](https://img.shields.io/badge/a11y-tested-brightgreen) 7 | ![TypeScript Support](https://img.shields.io/badge/TypeScript-Support-blue) 8 | 9 | React component that handles csv file input. 10 | It handles file input and returns its content as a matrix. 11 | 12 | Docs: [nzambello.github.io/react-csv-reader](https://nzambello.github.io/react-csv-reader/) 13 | 14 | You can try it out in the playground in the [docs](https://nzambello.github.io/react-csv-reader/usage#playground) or in the [demo on Codesandbox](https://codesandbox.io/s/react-csv-reader-vtull). 15 | 16 | ## Installation 17 | 18 | Install the package with either yarn or npm. 19 | 20 | With yarn: 21 | 22 | ```sh 23 | yarn add react-csv-reader 24 | ``` 25 | 26 | With npm: 27 | 28 | ```sh 29 | npm install --save react-csv-reader 30 | ``` 31 | 32 | ## Usage 33 | 34 | Basic usage: 35 | 36 | ```javascript 37 | import React, { Component } from 'react' 38 | import ReactDOM from 'react-dom' 39 | import CSVReader from 'react-csv-reader' 40 | 41 | class App extends Component { 42 | ... 43 | 44 | render() { 45 | return ( 46 | console.dir(data, fileInfo, originalFile)} /> 47 | ) 48 | } 49 | } 50 | 51 | ReactDOM.render(, document.getElementById('root')) 52 | ``` 53 | 54 | More complex example: 55 | 56 | ```javascript 57 | import React, { Component } from 'react' 58 | import ReactDOM from 'react-dom' 59 | import CSVReader from 'react-csv-reader' 60 | 61 | class App extends Component { 62 | ... 63 | 64 | const papaparseOptions = { 65 | header: true, 66 | dynamicTyping: true, 67 | skipEmptyLines: true, 68 | transformHeader: header => 69 | header 70 | .toLowerCase() 71 | .replace(/\W/g, '_') 72 | } 73 | 74 | render() { 75 | return ( 76 | 86 | ) 87 | } 88 | } 89 | 90 | ReactDOM.render(, document.getElementById('root')) 91 | ``` 92 | 93 | ### Parameters 94 | 95 | | Name | Type | Default | Description | 96 | | ------------- | --------------- | ------------------------ | -------------------------------------------------------------------------------- | 97 | | accept | string | `.csv, text/csv` | File type accepted by file input. | 98 | | cssClass | string | `csv-reader-input` | A CSS class to be applied to the wrapper element. | 99 | | cssInputClass | string | `csv-input` | A CSS class to be applied to the `` element. | 100 | | cssLabelClass | string | `csv-label` | A CSS class to be applied to the `