Skip to content

Commit fdbc7d9

Browse files
committed
project structure changed
1 parent 72baa5b commit fdbc7d9

34 files changed

+18077
-11448
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
dist/
3+
node_modules/
4+
.snapshots/
5+
*.min.js

.eslintrc

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": [
4+
"standard",
5+
"standard-react",
6+
"plugin:prettier/recommended",
7+
"prettier/standard",
8+
"prettier/react"
9+
],
10+
"env": {
11+
"node": true
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2020,
15+
"ecmaFeatures": {
16+
"legacyDecorators": true,
17+
"jsx": true
18+
}
19+
},
20+
"settings": {
21+
"react": {
22+
"version": "16"
23+
}
24+
},
25+
"rules": {
26+
"space-before-function-paren": 0,
27+
"react/prop-types": 0,
28+
"react/jsx-handler-names": 0,
29+
"react/jsx-fragments": 0,
30+
"react/no-unused-prop-types": 0,
31+
"import/export": 0
32+
}
33+
}

.gitignore

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
21

3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
73

8-
# testing
9-
/coverage
4+
# dependencies
5+
node_modules
106

11-
# production
12-
/build
7+
# builds
8+
build
9+
dist
10+
.rpt2_cache
1311

1412
# misc
1513
.DS_Store
14+
.env
1615
.env.local
1716
.env.development.local
1817
.env.test.local

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"semi": false,
5+
"tabWidth": 2,
6+
"bracketSpacing": true,
7+
"jsxBracketSameLine": false,
8+
"arrowParens": "always",
9+
"trailingComma": "none"
10+
}

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- 12
4+
- 10

README.md

+69-67
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,70 @@
1-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1+
## React Multiple Select Dropdown Lite
2+
A lightweight Multiple/Single Select component for react using React-Hooks
3+
4+
### Install
5+
6+
npm i react-multiple-select-dropdown-lite
7+
8+
### Basic Initialization
9+
```
10+
import React, { useState } from 'react'
11+
import MultiSelect from 'react-multiple-select-dropdown-lite'
12+
import 'react-multiple-select-dropdown-lite/dist/index.css'
13+
14+
const App = () => {
15+
16+
const [value, setvalue] = useState('')
17+
18+
const handleOnchange = val => {
19+
setvalue(val)
20+
}
21+
22+
const options = [
23+
{ label: 'Option 1', value: 'option_1' },
24+
{ label: 'Option 2', value: 'option_2' },
25+
{ label: 'Option 3', value: 'option_3' },
26+
{ label: 'Option 4', value: 'option_4' },
27+
]
28+
29+
return(
30+
<div className="app">
31+
<div className="preview-values">
32+
<h4>Values</h4>
33+
{value}
34+
</div>
35+
36+
<MultiSelect
37+
onChange={handleOnchange}
38+
options={options}
39+
/>
40+
41+
</div>
42+
)}
43+
export default App
44+
```
45+
46+
### Options
47+
|Props| type | default | description
48+
|-----|------| ------- | ----------|
49+
| width | int | 300 | Specify width in px
50+
| options| array | | pass options as array of object <br> example: <br> `[ { label : 'Option 1', value : 'opt_1' } ]`
51+
|onChange | function | |Return value on input change
52+
| defaultValue | string \| array of object | | specify default value
53+
|jsonValue | bool | false | get value from input as json
54+
|singleSelect | bool | false | allow one select only
55+
|downArrowIcon| string \| icon \| component | Icon | Specify custom down arrow icon
56+
|clearable | bool | true | show / hide close icon to clear value
57+
downArrow |bool | true| show / hide down icon in dropdown
58+
| className | string \| object | | specify custom class
59+
|placeholder | string | Select... | Input Placeholder
60+
|disableChip | bool | false | disable multiple select chips show value or total selected value only
61+
||
62+
63+
### Sponsor
64+
65+
[<img src="https://www.bitcode.pro/wp-content/uploads/2019/09/final.svg_-3.png">](https://www.bitcode.pro/)
66+
67+
68+
### License
69+
MIT © [Arif-Un]([https://github.com/arif-un](https://github.com/arif-un)) | Build for Bit Form
270

3-
## Available Scripts
4-
5-
In the project directory, you can run:
6-
7-
### `yarn start`
8-
9-
Runs the app in the development mode.<br />
10-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11-
12-
The page will reload if you make edits.<br />
13-
You will also see any lint errors in the console.
14-
15-
### `yarn test`
16-
17-
Launches the test runner in the interactive watch mode.<br />
18-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19-
20-
### `yarn build`
21-
22-
Builds the app for production to the `build` folder.<br />
23-
It correctly bundles React in production mode and optimizes the build for the best performance.
24-
25-
The build is minified and the filenames include the hashes.<br />
26-
Your app is ready to be deployed!
27-
28-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29-
30-
### `yarn eject`
31-
32-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33-
34-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35-
36-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37-
38-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39-
40-
## Learn More
41-
42-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43-
44-
To learn React, check out the [React documentation](https://reactjs.org/).
45-
46-
### Code Splitting
47-
48-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49-
50-
### Analyzing the Bundle Size
51-
52-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53-
54-
### Making a Progressive Web App
55-
56-
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57-
58-
### Advanced Configuration
59-
60-
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61-
62-
### Deployment
63-
64-
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65-
66-
### `yarn build` fails to minify
67-
68-
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

example/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
It is linked to the project-name package in the parent directory for development purposes.
4+
5+
You can run `npm install` and then `npm start` to test your package.

example/package-lock.json

+104
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "project-name-example",
3+
"homepage": ".",
4+
"version": "0.0.0",
5+
"private": true,
6+
"scripts": {
7+
"start": "node ../node_modules/react-scripts/bin/react-scripts.js start",
8+
"build": "node ../node_modules/react-scripts/bin/react-scripts.js build",
9+
"test": "node ../node_modules/react-scripts/bin/react-scripts.js test",
10+
"eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject"
11+
},
12+
"dependencies": {
13+
"react": "file:../node_modules/react",
14+
"react-dom": "file:../node_modules/react-dom",
15+
"react-scripts": "file:../node_modules/react-scripts",
16+
"react-multiple-select-dropdown-lite": "file:.."
17+
},
18+
"devDependencies": {
19+
"@babel/plugin-syntax-object-rest-spread": "^7.8.3"
20+
},
21+
"eslintConfig": {
22+
"extends": "react-app"
23+
},
24+
"browserslist": [
25+
">0.2%",
26+
"not dead",
27+
"not ie <= 11",
28+
"not op_mini all"
29+
]
30+
}

example/public/favicon.ico

3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)