Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cvlmtg committed Nov 9, 2021
2 parents 5cbd2a7 + a6c6fa1 commit c8118fd
Show file tree
Hide file tree
Showing 9 changed files with 1,362 additions and 2,833 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module.exports = {
ecmaVersion: 2018
},
rules: {
'accessor-pairs': 'error',
'array-bracket-newline': [
'error',
'consistent'
Expand Down Expand Up @@ -80,7 +79,6 @@ module.exports = {
allowSingleLine: true
}
],
'callback-return': 'off',
camelcase: [
'error',
{
Expand Down Expand Up @@ -178,7 +176,6 @@ module.exports = {
ObjectExpression: 1
}
],
'indent-legacy': 'off',
'init-declarations': 'off',
'jsx-quotes': 'error',
'key-spacing': [
Expand Down Expand Up @@ -515,7 +512,10 @@ module.exports = {
'space-unary-ops': 'error',
'spaced-comment': [
'error',
'always'
'always',
{
markers: [ '/' ]
}
],
strict: 'error',
'switch-colon-spacing': 'error',
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.0.2] - 2021-11-09

### Changed

- Popper is now a peer dependency
- Options' value can be any type, not just strings

## [1.0.1] - 2021-10-05

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ On small screens **react-smart-select** switches to a responsive layout.

Install the library and its peer dependencies:

`npm install --save-dev react-smart-select styled-components`
`npm install --save-dev react-smart-select styled-components @popperjs/core react-popper`

or:

`yarn add --dev react-smart-select styled-components`
`yarn add --dev react-smart-select styled-components @popperjs/core react-popper`

Example usage:

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-smart-select",
"version": "1.0.1",
"version": "1.0.2",
"description": "A very flexible and smart React select component",
"author": "Matteo Cavalleri <[email protected]>",
"repository": {
Expand Down Expand Up @@ -43,38 +43,38 @@
"test": "env NODE_ENV=test mocha --config mocha.json 'test/**/*.ts?(x)'",
"watch": "dts watch"
},
"dependencies": {
"@popperjs/core": "^2.10.1",
"react-popper": "^2.2.5"
},
"peerDependencies": {
"@popperjs/core": "^2.10.1",
"react": ">=17",
"react-popper": "^2.2.5",
"styled-components": ">=5"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/core": "^7.15.8",
"@babel/preset-react": "^7.14.5",
"@popperjs/core": "^2.10.1",
"@rollup/plugin-babel": "^5.3.0",
"@size-limit/preset-small-lib": "^5.0.5",
"@size-limit/preset-small-lib": "^6.0.2",
"@testing-library/react": "^12.1.0",
"@testing-library/user-event": "^13.2.1",
"@testing-library/user-event": "^13.3.0",
"@types/chai": "^4.2.22",
"@types/mocha": "^9.0.0",
"@types/node": "^16.9.6",
"@types/node": "^16.10.3",
"@types/react": "^17.0.24",
"@types/react-dom": "^17.0.9",
"@types/styled-components": "^5.1.14",
"@types/styled-components": "^5.1.15",
"chai": "^4.3.4",
"dts-cli": "^0.17.1",
"dts-cli": "^0.19.2",
"global-jsdom": "^8.2.0",
"husky": "^7.0.2",
"jsdom": "^17.0.0",
"jsdom": "^18.0.0",
"mocha": "^9.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-popper": "^2.2.5",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-serve": "^1.1.0",
"size-limit": "^5.0.5",
"size-limit": "^6.0.1",
"styled-components": "^5.3.1",
"ts-node": "^10.2.1",
"tslib": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
</head>
<body>
<div id="app"></div>
<script src="./bundle.js""></script>
<script src="./bundle.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ReactNode, CSSProperties, SyntheticEvent } from 'react';

export type RSSOption = {
label: string | ReactNode;
value: string;
value: any;
[key: string]: any;
};

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions test/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type WrapProps = Omit<SelectProps, 'options' | 'onChange'>

const option = { selector: `.${OPTION_CLASS}` };
const options = [
{ value: 'alice', label: 'alice' },
{ value: 'bob', label: 'bob' },
{ value: 'carol', label: 'carol' }
{ value: 1, label: 'alice' },
{ value: 2, label: 'bob' },
{ value: 3, label: 'carol' }
];

const WrapSelect: FunctionComponent<WrapProps> = (props) => {
Expand Down Expand Up @@ -62,8 +62,8 @@ describe('the multi select', () => {

it('renders the default value (2)', () => {
const edit = [
{ value: 'carol', label: 'carol' },
{ value: 'bob', label: 'bob' }
{ value: 2, label: 'carol' },
{ value: 3, label: 'bob' }
];

render(<WrapSelect value={edit} />);
Expand Down
Loading

0 comments on commit c8118fd

Please sign in to comment.