Skip to content

Commit

Permalink
Merge remote-tracking branch 'JedWatson/master' into make-accessible
Browse files Browse the repository at this point in the history
# Conflicts:
#	dist/react-select.js
#	dist/react-select.min.js
#	lib/Async.js
#	lib/AsyncCreatable.js
#	lib/Creatable.js
#	lib/Select.js
#	src/AsyncCreatable.js
#	src/Creatable.js
#	src/Select.js
  • Loading branch information
sreahard committed Oct 5, 2017
2 parents 99c6947 + 7523c20 commit 38bde07
Show file tree
Hide file tree
Showing 54 changed files with 4,621 additions and 1,020 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ignore": ["node-modules/**", "src/index.umd.js"],
"presets": [ "es2015", "stage-0", "react"],
"env": {
"test": {
"plugins": ["istanbul"],
},
}
}
35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

41 changes: 41 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
env: {
browser: true,
es6: true,
node: true,
},
plugins: ['react'],
rules: {
'curly': [2, 'multi-line'],
'jsx-quotes': 1,
'no-shadow': 0,
'no-trailing-spaces': 0,
'no-underscore-dangle': 0,
'no-unused-expressions': 0,
'object-curly-spacing': [1, 'always'],
'quotes': [2, 'single', 'avoid-escape'],
'react/jsx-boolean-value': 1,
'react/jsx-no-undef': 1,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/jsx-wrap-multilines': 1,
'react/no-did-mount-set-state': 1,
'react/no-did-update-set-state': 1,
'react/no-unknown-property': 1,
'react/prop-types': 1,
'react/react-in-jsx-scope': 1,
'react/self-closing-comp': 1,
'react/sort-comp': 1,
'react/sort-prop-types': 1,
'semi': 2,
'strict': 0,
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pids
# Coverage tools
lib-cov
coverage
.nyc_output

# Dependency directory
node_modules
Expand Down
12 changes: 12 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"reporter": [
"lcov",
"text-summary"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false,
"report-dir": "./coverage"
}
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
sudo: false
language: node_js
node_js:
- "v4"
- "v4"
script:
- npm run coveralls
- npm run lint
- npm run test
- npm run coveralls
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Thanks for your interest in React-Select. All forms of contribution are
welcome, from issue reports to PRs and documentation / write-ups.

* We use node.js v4 for development and testing. Due to incompatibilities with
JSDOM and older versions of node.js, you'll need to use node 4 to run the
tests. If you can't install node v4 as your "default" node installation, you
* We use node.js v4+ for development and testing. Due to incompatibilities with
JSDOM and older versions of node.js, you'll need to use node 4 and above to run the
tests. If you can't install node v4 or above as your "default" node installation, you
could try using [nvm](https://github.com/creationix/nvm) to install multiple
versions concurrently.
* If you're upgrading your node.js 0.x environment, it's sometimes necessary
Expand Down
53 changes: 51 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,56 @@
# React-Select

## Next

## v1.0.0-rc.10 / 2017-09-13

* changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now defaults to `true`
* fixed; React.PropTypes deprecation warning, thanks [Jeremy Liberman](https://github.com/MrLeebo)
* improved; scrolling behaviour when navigating the menu with the keyboard, thanks [boatkorachal](https://github.com/boatkorachal)
* fixed; error with the `Async` cache when you type `"hasOwnProperty"`, thanks [SuhushinAS](https://github.com/SuhushinAS)

## v1.0.0-rc.9 / 2017-09-13

* fixed; clearable padding style, thanks [Minori Miyauchi](https://github.com/mmiyauchi)
* fixed; removed use of `Object.assign`, fixes IE compatibility
* added; new `closeOnSelect` prop (defaults to `true`) that controls whether the menu is closed when an option is selected, thanks to [Michael Elgar](https://github.com/melgar) for the original idea
* changed; by default, the menu for multi-selects now closes when an option is selected
* changed; `Async` component no longer always clears options when one is selected (although the menu is now closed by default). Use `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open.
* fixed; `Async` component always called `onChange` even when it wasn't provided
* fixed; input lag for the `Async` component when results are returned from cache
* fixed; required was not being updated without an onChange handler
* fixed; peer dependencies for `prop-types`, thanks [Michaël De Boey](https://github.com/MichaelDeBoey)
* fixed; internal optimisations, thanks [Kieran Boyle](https://github.com/dysfunc)
* added; `Value` component is now exported, thanks [Prof Gra](https://github.com/Grahack)
* fixed; callback fired after `Async` component unmounts, thanks [Andrew Russell](https://github.com/DeadHeadRussell)
* fixed; wrapping on Firefox in SCSS files, thanks [Michael Williamson](https://github.com/mwilliamson)

## v1.0.0-rc.8 / 2017-09-12

* fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks [Simon Hartcher](https://github.com/deevus)
* fixed; missing es6 module build for `js:next` entrypoint
* updated; `[email protected]` including several fixes for react-select (see [changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md))

## v1.0.0-rc.7 / 2017-09-11

* fixed; issue with `lib` build preventing use in ES2015 environments

## v1.0.0-rc.6 / 2017-09-10

* fixed; changing `required` prop from `true` to `false` now works as expected, thanks [George Karagkiaouris](https://github.com/karaggeorge)
* added; new prop `onSelectResetsInput` controls whether the input value is cleared when options are selected, thanks [David Roeca](https://github.com/davidroeca) and [Alexander Nosov](https://github.com/nosovsh)
* fixed; tabindex parent bug fix for Edge, thanks [George Payne](https://github.com/George-A-Payne)
* fixed; update selectize link in README.md, thanks [kerumen](https://github.com/kerumen)
* added; standard issue template, thanks [agirton](https://github.com/agirton)
* added; new build process using rollup and webpack. Removed grunt. thanks [gwyneplaine](https://github.com/gwyneplaine)
* fixed; updated contributor docs with the correct node version reference [gwyneplaine](https://github.com/gwyneplaine)
* fixed; missing method binds in Option, thanks [agirton](https://github.com/agirton)
* fixed; converted components to use es6 classes, thanks [jochenberger](https://github.com/jochenberger)
* fixed; console.log example in usage docs, thanks [rohmanhm](https://github.com/rohmanhm)
* fixed; hide create option after closing menu, thanks [andreme](https://github.com/andreme)
* fixed; remove circular reference, thanks [agirton](https://github.com/agirton)
* fixed; readme typo, thanks [ieldanr](https:/github.com/ieldanr)
* fixed; add missing function binds in Option component, thanks [agirton](https://github.com/agirton) and [blacktemplar](https://github.com/blacktemplar)
* fixed; re-added fix to [#1580](https://github.com/JedWatson/react-select/issues/1580), thanks [agirton](https://github.com/agirton)
* fixed; avoid mutating user inputs when ignoring case/accents, thanks [not-an-aardvark](https://github.com/not-an-aardvark)
* fixed; issues synchronising options props in `Async`, thanks [cbergmiller](https://github.com/cbergmiller)
* fixed; backspace handling for non-multi select controls, thanks [Jeremy Liberman](https://github.com/MrLeebo)

Expand Down
19 changes: 17 additions & 2 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
### Thanks for using react-select!

If you are reporting an error please include a test case that demonstrates the issue you're reporting!
Before creating an issue...

# Are you asking a question?
Please don't file GitHub issues to ask questions. Use Stack Overflow with a [#react-select](http://stackoverflow.com/questions/tagged/react-select) tag


# Are you reporting a bug or runtime error?
Please include a test case that demonstrates the issue you're reporting!
This is very helpful to maintainers in order to help us see the issue you're seeing.

Here is a Plunker you can fork that has react-select loaded and supports JSX syntax:
https://plnkr.co/edit/HTmtER9AMNcPoWhXV707?p=preview
https://plnkr.co/edit/dHygFMWWqVwaRAfpEmbn?p=preview

You may also find the [online Babel tool](https://babeljs.io/repl/) quite helpful if you wish to use ES6/ES7 syntax not yet supported by the browser you are using.


# Are you making a feature request?
Provide as much information as possible about your requested feature. Here are a few questions you may consider answering:

* What's your use case? (Tell us about your application and what problem you're trying to solve.)
* What interface do you have in mind? (What new properties or methods do you think might be helpful?)
* Can you point to similar functionality with any existing libraries or components? (Working demos can be helpful.)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Jed Watson
Copyright (c) 2017 Jed Watson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A Select control built with and for [React](http://facebook.github.io/react/inde

## New version 1.0.0-rc

I've nearly completed a major rewrite of this component (see issue [#568](https://github.com/JedWatson/react-select/issues/568) for details and progress). The new code has been merged into `master`, and `[email protected]` has been published to npm and bower.
I've nearly completed a major rewrite of this component (see issue [#568](https://github.com/JedWatson/react-select/issues/568) for details and progress). The new code has been merged into `master`, and `[email protected].10` has been published to npm and bower.

1.0.0 has some breaking changes. The documentation is still being updated for the new API; notes on the changes can be found in [CHANGES.md](https://github.com/JedWatson/react-select/blob/master/CHANGES.md) and will be finalised into [HISTORY.md](https://github.com/JedWatson/react-select/blob/master/HISTORY.md) soon.

Expand Down Expand Up @@ -52,12 +52,14 @@ import Select from 'react-select';
import 'react-select/dist/react-select.css';
```

You can also use the standalone build by including `react-select.js` and `react-select.css` in your page. (If you do this though you'll also need to include the dependencies.) For example:
You can also use the standalone UMD build by including `dist/react-select.js` and `dist/react-select.css` in your page. If you do this you'll also need to include the dependencies. For example:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<script src="https://unpkg.com/classnames/index.js"></script>
<script src="https://unpkg.com/react-input-autosize/dist/react-input-autosize.js"></script>
<script src="https://unpkg.com/[email protected]/dist/react.js"></script>
<script src="https://unpkg.com/[email protected]/dist/react-dom.js"></script>
<script src="https://unpkg.com/[email protected]/prop-types.js"></script>
<script src="https://unpkg.com/[email protected]/index.js"></script>
<script src="https://unpkg.com/[email protected]/dist/react-input-autosize.js"></script>
<script src="https://unpkg.com/react-select/dist/react-select.js"></script>

<link rel="stylesheet" href="https://unpkg.com/react-select/dist/react-select.css">
Expand Down Expand Up @@ -277,7 +279,7 @@ The default `filterOptions` method scans the options array for matches each time
This works well but can get slow as the options array grows to several hundred objects.
For larger options lists a custom filter function like [`react-select-fast-filter-options`](https://github.com/bvaughn/react-select-fast-filter-options) will produce better results.

### Effeciently rendering large lists with windowing
### Efficiently rendering large lists with windowing

The `menuRenderer` property can be used to override the default drop-down list of options.
This should be done when the list is large (hundreds or thousands of items) for faster rendering.
Expand Down Expand Up @@ -360,7 +362,7 @@ function onInputKeyDown(event) {
| clearAllText | string | 'Clear all' | title for the "clear" control when `multi` is true |
| clearRenderer | func | undefined | Renders a custom clear to be shown in the right-hand side of the select when clearable true: `clearRenderer()` |
| clearValueText | string | 'Clear value' | title for the "clear" control |
| resetValue | any | null | value to use when you clear the control |
| closeOnSelect | bool | true | whether to close the menu when a value is selected
| deleteRemoves | bool | true | whether pressing delete key removes the last item when there is no input value |
| delimiter | string | ',' | delimiter to use to join multiple values |
| disabled | bool | false | whether the Select is disabled or not |
Expand Down Expand Up @@ -389,11 +391,15 @@ function onInputKeyDown(event) {
| onInputChange | func | undefined | onInputChange handler/interceptor: `function(inputValue: string): string` |
| onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}` |
| onOpen | func | undefined | handler for when the menu opens: `function () {}` |
| onSelectResetsInput | bool | true | whether the input value should be reset when options are selected, for `multi`
| onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}` |
| openOnFocus | bool | false | open the options menu when the input gets focus (requires searchable = true) |
| openOnClick | bool | true | open the options menu when the control is clicked (requires searchable = true) |
| openOnFocus | bool | false | open the options menu when the control gets focus (requires searchable = true) |
| optionRenderer | func | undefined | function which returns a custom way to render the options in the menu |
| options | array | undefined | array of options |
| placeholder | string\|node | 'Select ...' | field placeholder, displayed when there's no value |
| required | bool | false | applies HTML5 required attribute when needed |
| resetValue | any | null | value to set when the control is cleared |
| scrollMenuIntoView | bool | true | whether the viewport will shift to display the entire menu when engaged |
| searchable | bool | true | whether to enable searching feature or not |
| searchPromptText | string\|node | 'Type to search' | label to prompt for search input |
Expand All @@ -417,9 +423,9 @@ Right now there's simply a `focus()` method that gives the control focus. All ot

See our [CONTRIBUTING.md](https://github.com/JedWatson/react-select/blob/master/CONTRIBUTING.md) for information on how to contribute.

Thanks to the projects this was inspired by: [Selectize](http://brianreavis.github.io/selectize.js/) (in terms of behaviour and user experience), [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a quality React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).
Thanks to the projects this was inspired by: [Selectize](http://selectize.github.io/selectize.js/) (in terms of behaviour and user experience), [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a quality React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).


# License

MIT Licensed. Copyright (c) Jed Watson 2016.
MIT Licensed. Copyright (c) Jed Watson 2017.
19 changes: 5 additions & 14 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"name": "react-select",
"main": [
"dist/react-select.min.js",
"dist/react-select.min.css"
],
"version": "1.0.0-rc.4",
"main": ["dist/react-select.min.js", "dist/react-select.min.css"],
"version": "1.0.0-rc.10",
"homepage": "https://github.com/JedWatson/react-select",
"authors": [
"Jed Watson"
],
"authors": ["Jed Watson"],
"description": "A Select control built with and for ReactJS",
"moduleType": [
"amd",
"globals",
"node"
],
"moduleType": ["amd", "globals", "node"],
"dependencies": {
"classnames": "^2.2.0",
"react-input-autosize": "^1.1.0"
"react-input-autosize": "^2.0.1"
},
"keywords": [
"react",
Expand Down
3 changes: 3 additions & 0 deletions dist/react-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.has-value.is-clearable.Select--single > .Select-control .Select-value {
padding-right: 42px;
}
.has-value.Select--single > .Select-control .Select-value .Select-value-label,
.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label {
color: #333;
Expand Down
Loading

0 comments on commit 38bde07

Please sign in to comment.