Skip to content

Commit dc95188

Browse files
committed
Some more changes
1 parent c619215 commit dc95188

12 files changed

+27
-30
lines changed

README.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ React-Select
1010
A Select control built with and for [React](http://facebook.github.io/react/index.html). Initially built for use in [KeystoneJS](http://www.keystonejs.com).
1111

1212

13-
## New version 1.0.0-rc
13+
## New version 1.0.1-rc
1414

1515
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.
1616

@@ -19,13 +19,8 @@ I've nearly completed a major rewrite of this component (see issue [#568](https:
1919
Testing, feedback and PRs for the new version are appreciated.
2020

2121

22-
## Demo & Examples
22+
## Examples
2323

24-
Live demo: [jedwatson.github.io/react-select](http://jedwatson.github.io/react-select/)
25-
26-
The live demo is still running `v0.9.1`.
27-
28-
To build the **new 1.0.0** examples locally, clone this repo then run:
2924

3025
```javascript
3126
npm install
@@ -40,13 +35,13 @@ Then open [`localhost:8000`](http://localhost:8000) in a browser.
4035
The easiest way to use React-Select is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), etc).
4136

4237
```javascript
43-
npm install react-select --save
38+
npm install smb-react-selection --save
4439
```
4540

4641
At this point you can import react-select and its styles in your application as follows:
4742

4843
```js
49-
import Select from 'react-select';
44+
import Select from 'smb-react-selection';
5045

5146
// Be sure to include styles at some point, probably during your bootstrapping
5247
import 'react-select/dist/react-select.css';
@@ -157,7 +152,7 @@ Everything that applies to `loadOptions` with callbacks still applies to the Pro
157152
An example using the `fetch` API and ES6 syntax, with an API that returns an object like:
158153

159154
```javascript
160-
import Select from 'react-select';
155+
import Select from 'smb-react-selection';
161156

162157
/*
163158
* assuming the API returns something like this:
@@ -188,7 +183,7 @@ const getOptions = (input) => {
188183
If you want to load options asynchronously externally from the `Select` component, you can have the `Select` component show a loading spinner by passing in the `isLoading` prop set to `true`.
189184

190185
```javascript
191-
var Select = require('react-select');
186+
var Select = require('smb-react-selection');
192187

193188
var isLoadingExternally = true;
194189

@@ -206,7 +201,7 @@ It decorates a `Select` and so it supports all of the default properties (eg sin
206201
The easiest way to use it is like so:
207202

208203
```js
209-
import { Creatable } from 'react-select';
204+
import { Creatable } from 'smb-react-selection';
210205

211206
function render (selectProps) {
212207
return <Creatable {...selectProps} />;
@@ -232,7 +227,7 @@ Use it as follows:
232227

233228
```jsx
234229
import React from 'react';
235-
import { AsyncCreatable } from 'react-select';
230+
import { AsyncCreatable } from 'smb-react-selection';
236231

237232
function render (props) {
238233
// props can be a mix of Async, Creatable, and Select properties
@@ -390,6 +385,7 @@ function onInputKeyDown(event) {
390385
value | any | undefined | initial field value
391386
valueKey | string | 'value' | the option property to use for the value
392387
valueRenderer | func | undefined | function which returns a custom way to render the value selected `function (option) {}`
388+
showSelectedCount | bool | false | Used with inputRenderer inorder to show one selected item for multi selected list
393389

394390
### Methods
395391

@@ -402,11 +398,11 @@ Right now there's simply a `focus()` method that gives the control focus. All ot
402398

403399
# Contributing
404400

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

407403
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/).
408404

409405

410406
# License
411407

412-
MIT Licensed. Copyright (c) Jed Watson 2016.
408+
MIT Licensed. Copyright (c) 2016.

examples/src/components/BooleanSelect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
var ValuesAsBooleansField = React.createClass({
55
displayName: 'ValuesAsBooleansField',

examples/src/components/Contributors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
const CONTRIBUTORS = require('../data/contributors');
55
const MAX_CONTRIBUTORS = 6;

examples/src/components/Creatable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
var CreatableDemo = React.createClass({
55
displayName: 'CreatableDemo',

examples/src/components/CustomComponents.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33
import Gravatar from 'react-gravatar';
44

55
const USERS = require('../data/users');

examples/src/components/CustomRender.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33
import Highlighter from 'react-highlight-words';
44

55
var DisabledUpsellOptions = React.createClass({

examples/src/components/GithubUsers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33
import fetch from 'isomorphic-fetch';
44

55

examples/src/components/MultiSelectWithDifferentLabel.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
const FLAVOURS = [
55
{ label: 'Chocolate', value: 'chocolate' },
@@ -18,7 +18,8 @@ const inputRender = (values) => {
1818
if (!values) {
1919
return null;
2020
}
21-
return `${values.length}`;
21+
const splitLen = values.split(',');
22+
return `${splitLen.length}`;
2223
};
2324

2425
var MultiSelectWithDifferentLabel = React.createClass({

examples/src/components/Multiselect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
const FLAVOURS = [
55
{ label: 'Chocolate', value: 'chocolate' },

examples/src/components/NumericSelect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
var ValuesAsNumbersField = React.createClass({
55
displayName: 'ValuesAsNumbersField',

examples/src/components/States.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Select from 'react-select';
2+
import Select from 'smb-react-selection';
33

44
const STATES = require('../data/states');
55

src/Select.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,9 @@ const Select = React.createClass({
813813
return (
814814
<ValueComponent
815815
id={this._instancePrefix + '-value-item'}
816-
disabled={true}
816+
disabled={this.props.disabled}
817817
instancePrefix={this._instancePrefix}
818-
onClick={onClick}
818+
onClick={null}
819819
value={valueArray[0]}
820820
>
821821
{renderLabel(valueArray[0])}
@@ -1069,8 +1069,8 @@ const Select = React.createClass({
10691069
focusedOption = this._focusedOption = null;
10701070
}
10711071
let className = classNames('Select', this.props.className, {
1072-
'Select--multi': this.props.multi,
1073-
'Select--single': !this.props.multi,
1072+
'Select--multi': this.props.multi && !this.props.showSelectedCount,
1073+
'Select--single': !this.props.multi || this.props.showSelectedCount,
10741074
'is-disabled': this.props.disabled,
10751075
'is-focused': this.state.isFocused,
10761076
'is-loading': this.props.isLoading,

0 commit comments

Comments
 (0)