├── .all-contributorsrc ├── .babelrc ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question-request.md └── workflows │ └── main.yml ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE_996 ├── README.md ├── docs ├── locales-example-es5.md ├── locales-example-es6.md ├── v1-v2-v3-doc.md └── v4-doc.md ├── eslintignore.json ├── example ├── global.d.ts └── index.tsx ├── index.js ├── jest.config.js ├── package.json ├── postcss.config.js ├── react-inputs-validation.gif ├── src ├── __tests__ │ ├── Checkbox.js │ ├── Radiobox.js │ ├── Select.js │ ├── Textarea.js │ ├── Textbox.js │ ├── message.js │ ├── utils.js │ └── validator.js ├── css │ ├── example.css │ └── icon.css ├── font │ ├── icomoon.svg │ ├── icomoon.ttf │ └── icomoon.woff ├── html │ └── layout.html └── js │ └── Inputs │ ├── Checkbox.tsx │ ├── Radiobox.tsx │ ├── Select.tsx │ ├── Textarea.tsx │ ├── Textbox.tsx │ ├── const.ts │ ├── global.d.ts │ ├── index.global.ts │ ├── index.ts │ ├── message.ts │ ├── react-inputs-validation.css │ ├── utils.ts │ └── validator.ts ├── stylelint.config.js ├── tea.yaml ├── tsconfig.json ├── tslint.json └── webpack ├── base.js ├── build_path.js ├── development.config.js ├── production.config.js ├── umd.base.config.js ├── umd.global.config.js └── umd.local.config.js /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "edwardfxiao", 10 | "name": "Edward Xiao", 11 | "avatar_url": "https://avatars3.githubusercontent.com/u/11728228?v=4", 12 | "profile": "https://github.com/edwardfxiao", 13 | "contributions": [ 14 | "code", 15 | "doc", 16 | "infra", 17 | "test", 18 | "review" 19 | ] 20 | }, 21 | { 22 | "login": "DecentralizedIT", 23 | "name": "Frank Bonnet", 24 | "avatar_url": "https://avatars1.githubusercontent.com/u/31480614?v=4", 25 | "profile": "http://www.dcorp.it", 26 | "contributions": [ 27 | "code" 28 | ] 29 | },{ 30 | "login": "RokasAniss", 31 | "name": "Rokas Anisas", 32 | "avatar_url": "https://avatars3.githubusercontent.com/u/33621394?v=4", 33 | "profile": "http://rokasanisas.com", 34 | "contributions": [ 35 | "code" 36 | ] 37 | } 38 | ], 39 | "contributorsPerLine": 7, 40 | "projectName": "react-inputs-validation", 41 | "projectOwner": "edwardfxiao", 42 | "repoType": "github", 43 | "repoHost": "https://github.com", 44 | "skipCi": true 45 | } 46 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"], 3 | "env": { 4 | "development": { 5 | "comments": false 6 | }, 7 | "production": { 8 | "comments": false 9 | }, 10 | "lib": { 11 | "plugins": ["css-modules-transform", "@babel/proposal-class-properties", "@babel/proposal-object-rest-spread"], 12 | "comments": false 13 | }, 14 | "test": { 15 | "plugins": ["babel-plugin-rewire"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | // Extend existing configuration 3 | // from ESlint and eslint-plugin-react defaults. 4 | "extends": ["eslint:recommended", "plugin:react/recommended"], 5 | // Enable ES6 support. If you want to use custom Babel 6 | // features, you will need to enable a custom parser 7 | // as described in a section below. 8 | "parserOptions": { 9 | "ecmaVersion": 6, 10 | "sourceType": "module", 11 | "ecmaFeatures": { 12 | "experimentalObjectRestSpread": true 13 | } 14 | }, 15 | "env": { 16 | "jest": true, 17 | "es6": true, 18 | "browser": true, 19 | "node": true, 20 | "jquery": true 21 | }, 22 | // Enable custom plugin known as eslint-plugin-react 23 | "plugins": ["react", "react-hooks"], 24 | "rules": { 25 | // Disable `no-console` rule 26 | "no-console": 0, 27 | // Give a warning if identifiers contain underscores 28 | "no-underscore-dangle": 1, 29 | "no-debugger": 0, 30 | "react-hooks/rules-of-hooks": "error", 31 | "no-empty": [ 32 | "error", 33 | { 34 | "allowEmptyCatch": true 35 | } 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: [e.g. iOS] 25 | - Browser [e.g. chrome, safari] 26 | - Version [e.g. 22] 27 | 28 | **Smartphone (please complete the following information):** 29 | - Device: [e.g. iPhone6] 30 | - OS: [e.g. iOS8.1] 31 | - Browser [e.g. stock browser, safari] 32 | - Version [e.g. 22] 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question request 3 | about: Ask your question here 4 | 5 | --- 6 | 7 | 8 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | strategy: 24 | matrix: 25 | node-version: [10.x] 26 | 27 | # Steps represent a sequence of tasks that will be executed as part of the job 28 | steps: 29 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 30 | - uses: actions/checkout@v3 31 | 32 | - name: Install dependencies 33 | run: npm i 34 | 35 | - name: Test:coverage 36 | run: npm run test:coverage 37 | 38 | - name: Coveralls 39 | uses: coverallsapp/github-action@master 40 | with: 41 | github-token: ${{ secrets.GITHUB_TOKEN }} 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /*.log 3 | /log/*.log 4 | coverage 5 | /notes 6 | /lib 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /coverage 2 | /example 3 | /webpack 4 | /src 5 | /.babelrc 6 | /.eslintrc.json 7 | /eslintignore.json 8 | /.gitignore 9 | /.travis.yml 10 | /jest.config.js 11 | /postcss.config.js 12 | /stylelint.config.js 13 | /tsconfig.json 14 | /tslint.json 15 | /*.gif 16 | /dist 17 | /*.html 18 | /.github 19 | /rev-manifest.json 20 | /docs -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | before_script: 5 | - npm i 6 | script: npm run prepublish 7 | after_script: "cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js" 8 | env: 9 | - REACT=16 10 | notifications: 11 | email: 12 | - email:edwardfhsiao@gmail.com 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 4.9.10 2 | 3 | - enable `hidden`, `disabled` props in OptionListItem for `` 8 | 9 | # 4.9.8 10 | 11 | - `classNameInputBoxItem` for `` 12 | - `title` and `ellipsis` for `` handleOnItemClick 17 | 18 | # 4.9.6 19 | 20 | - Fix potential bug for ```` 73 | 74 | # 4.8.2 75 | 76 | - Minor fix for ``````'s ```optionList``` ```[{id: '1', name: 'Twin Peaks']``` => ```[{id: '1', name: 'Twin Peaks', icon: 'optional']``` 81 | 82 | # 4.8.0 83 | 84 | - Replace ```classNameOptionListContainer``` with ```classNameOptionListWrapper``` and provide new ```classNameOptionListContainer``` & change className ```'options-container'``` to ```'options-wrapper'``` in ```