Skip to content

sdfgsdfg #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
59dd1d9
Publishing examples to gh-pages
JedWatson Sep 5, 2014
f5b45a1
Update 2014-09-09T05:20:21.227Z
JedWatson Sep 9, 2014
4956b9e
Fixing .gitignore
JedWatson Sep 9, 2014
5f0d550
Update 2014-09-16T13:07:23.664Z
JedWatson Sep 16, 2014
9a8b552
Update 2014-10-13T06:00:55.481Z
JedWatson Oct 13, 2014
6e05473
Update 2014-10-31T11:09:32.141Z
JedWatson Oct 31, 2014
f3980ea
Update 2014-10-31T11:11:37.108Z
JedWatson Oct 31, 2014
a08fa5e
Update 2014-11-04T05:37:06.448Z
JedWatson Nov 4, 2014
5d3c572
Update 2014-11-15T10:57:16.823Z
JedWatson Nov 15, 2014
e9e3b46
Update 2014-11-15T12:03:56.016Z
JedWatson Nov 15, 2014
e45b258
Update 2014-11-15T12:05:29.667Z
JedWatson Nov 15, 2014
a511236
Update 2014-11-20T04:44:32.474Z
JedWatson Nov 20, 2014
4eebe2e
Update 2014-11-30T11:49:12.747Z
JedWatson Nov 30, 2014
c0ac8ff
Update 2014-12-01T10:03:29.410Z
JedWatson Dec 1, 2014
dcb62a4
Update 2014-12-08T13:02:46.054Z
JedWatson Dec 8, 2014
fb6ab8e
Update 2014-12-09T11:02:33.292Z
JedWatson Dec 9, 2014
c2de786
Update 2015-01-01T10:19:42.977Z
JedWatson Jan 1, 2015
a4abf5c
Update 2015-01-04T06:25:24.622Z
JedWatson Jan 4, 2015
59cda93
Update 2015-01-04T10:58:09.470Z
JedWatson Jan 4, 2015
77804de
Update 2015-01-05T11:28:44.854Z
JedWatson Jan 5, 2015
18f4710
Update 2015-01-07T12:25:21.750Z
JedWatson Jan 7, 2015
11b51b9
Update 2015-01-31T06:36:09.394Z
JedWatson Jan 31, 2015
8231ffd
Update 2015-02-22T11:52:41.782Z
JedWatson Feb 22, 2015
ce4f4a9
Update 2015-02-23T06:14:33.779Z
JedWatson Feb 23, 2015
d99ae0b
Update 2015-03-09T12:44:23.722Z
JedWatson Mar 9, 2015
83b26e0
Update 2015-03-11T16:50:05.705Z
JedWatson Mar 11, 2015
709c915
Update 2015-03-21T09:28:40.051Z
JedWatson Mar 21, 2015
c78df17
Update 2015-03-22T13:23:24.744Z
JedWatson Mar 22, 2015
6899a37
Update 2015-03-25T13:49:06.712Z
JedWatson Mar 25, 2015
410b229
Update 2015-03-26T11:19:57.144Z
JedWatson Mar 26, 2015
af9d29a
Update 2015-03-28T13:02:32.707Z
JedWatson Mar 28, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

49 changes: 0 additions & 49 deletions README.md

This file was deleted.

200 changes: 200 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
Note: ESLint is currently misreporting unused / undeclared variables for JSX.
These errors can be ignored until the bug has been fixed.
*/

"use strict";

var React = require("react"),
Select = require("react-select");

var STATES = require("./data/states");

function logChange(value) {
console.log("Select value changed: " + value);
}

var CountrySelect = React.createClass({
displayName: "CountrySelect",

onClick: function onClick() {
this.props.onSelect(this.props.value);
},
render: function render() {
var className = this.props.value === this.props.selected ? "active" : "link";
return React.createElement(
"span",
{ onClick: this.onClick, className: className },
this.props.children
);
}
});

var StatesField = React.createClass({
displayName: "StatesField",

getDefaultProps: function getDefaultProps() {
return {
searchable: true,
label: "States:"
};
},
getInitialState: function getInitialState() {
return {
country: "AU",
selectValue: "new-south-wales"
};
},
switchCountry: function switchCountry(newCountry) {
console.log("Country changed to " + newCountry);
this.setState({
country: newCountry,
selectValue: null
});
},
updateValue: function updateValue(newValue) {
logChange("State changed to " + newValue);
this.setState({
selectValue: newValue || null
});
},
render: function render() {
var ops = STATES[this.state.country];
return React.createElement(
"div",
null,
React.createElement(
"label",
null,
this.props.label
),
React.createElement(Select, { options: ops, value: this.state.selectValue, onChange: this.updateValue, searchable: this.props.searchable }),
React.createElement(
"div",
{ className: "switcher" },
"Country:",
React.createElement(
CountrySelect,
{ value: "AU", selected: this.state.country, onSelect: this.switchCountry },
"Australia"
),
React.createElement(
CountrySelect,
{ value: "US", selected: this.state.country, onSelect: this.switchCountry },
"US"
)
)
);
}
});

var RemoteSelectField = React.createClass({
displayName: "RemoteSelectField",

loadOptions: function loadOptions(input, callback) {
input = input.toLowerCase();

var rtn = {
options: [{ label: "One", value: "one" }, { label: "Two", value: "two" }, { label: "Three", value: "three" }],
complete: true
};

if (input.slice(0, 1) === "a") {
if (input.slice(0, 2) === "ab") {
rtn = {
options: [{ label: "AB", value: "ab" }, { label: "ABC", value: "abc" }, { label: "ABCD", value: "abcd" }],
complete: true
};
} else {
rtn = {
options: [{ label: "A", value: "a" }, { label: "AA", value: "aa" }, { label: "AB", value: "ab" }],
complete: false
};
}
} else if (!input.length) {
rtn.complete = false;
}

setTimeout(function () {
callback(null, rtn);
}, 500);
},
render: function render() {
return React.createElement(
"div",
null,
React.createElement(
"label",
null,
this.props.label
),
React.createElement(Select, { asyncOptions: this.loadOptions, className: "remote-example" })
);
}
});

var MultiSelectField = React.createClass({
displayName: "MultiSelectField",

render: function render() {
var ops = [{ label: "Chocolate", value: "chocolate" }, { label: "Vanilla", value: "vanilla" }, { label: "Strawberry", value: "strawberry" }, { label: "Caramel", value: "caramel" }, { label: "Cookies and Cream", value: "cookiescream" }, { label: "Peppermint", value: "peppermint" }];
return React.createElement(
"div",
null,
React.createElement(
"label",
null,
this.props.label
),
React.createElement(Select, { multi: true, placeholder: "Select your favourite(s)", options: ops, onChange: logChange })
);
}
});

var SelectedValuesField = React.createClass({
displayName: "SelectedValuesField",

onLabelClick: function onLabelClick(data, event) {
console.log(data);
},

render: function render() {
var ops = [{ label: "Chocolate", value: "chocolate" }, { label: "Vanilla", value: "vanilla" }, { label: "Strawberry", value: "strawberry" }, { label: "Caramel", value: "caramel" }, { label: "Cookies and Cream", value: "cookiescream" }, { label: "Peppermint", value: "peppermint" }];
return React.createElement(
"div",
null,
React.createElement(
"label",
null,
this.props.label
),
React.createElement(Select, {
onOptionLabelClick: this.onLabelClick,
value: "chocolate,vanilla,strawberry",
multi: true,
placeholder: "Select your favourite(s)",
options: ops,
onChange: logChange })
);
}
});

React.render(React.createElement(
"div",
null,
React.createElement(StatesField, null),
React.createElement(StatesField, { label: "States (non-searchable):", searchable: false }),
React.createElement(MultiSelectField, { label: "Multiselect:" }),
React.createElement(SelectedValuesField, { label: "Clickable labels (labels as links):" }),
React.createElement(RemoteSelectField, { label: "Remote Options:" })
), document.getElementById("example"));

},{"./data/states":2,"react":undefined,"react-select":undefined}],2:[function(require,module,exports){
"use strict";

exports.AU = [{ value: "australian-capital-territory", label: "Australian Capital Territory" }, { value: "new-south-wales", label: "New South Wales" }, { value: "victoria", label: "Victoria" }, { value: "queensland", label: "Queensland" }, { value: "western-australia", label: "Western Australia" }, { value: "south-australia", label: "South Australia" }, { value: "tasmania", label: "Tasmania" }, { value: "northern-territory", label: "Northern Territory" }];

exports.US = [{ value: "AL", label: "Alabama" }, { value: "AK", label: "Alaska" }, { value: "AS", label: "American Samoa" }, { value: "AZ", label: "Arizona" }, { value: "AR", label: "Arkansas" }, { value: "CA", label: "California" }, { value: "CO", label: "Colorado" }, { value: "CT", label: "Connecticut" }, { value: "DE", label: "Delaware" }, { value: "DC", label: "District Of Columbia" }, { value: "FM", label: "Federated States Of Micronesia" }, { value: "FL", label: "Florida" }, { value: "GA", label: "Georgia" }, { value: "GU", label: "Guam" }, { value: "HI", label: "Hawaii" }, { value: "ID", label: "Idaho" }, { value: "IL", label: "Illinois" }, { value: "IN", label: "Indiana" }, { value: "IA", label: "Iowa" }, { value: "KS", label: "Kansas" }, { value: "KY", label: "Kentucky" }, { value: "LA", label: "Louisiana" }, { value: "ME", label: "Maine" }, { value: "MH", label: "Marshall Islands" }, { value: "MD", label: "Maryland" }, { value: "MA", label: "Massachusetts" }, { value: "MI", label: "Michigan" }, { value: "MN", label: "Minnesota" }, { value: "MS", label: "Mississippi" }, { value: "MO", label: "Missouri" }, { value: "MT", label: "Montana" }, { value: "NE", label: "Nebraska" }, { value: "NV", label: "Nevada" }, { value: "NH", label: "New Hampshire" }, { value: "NJ", label: "New Jersey" }, { value: "NM", label: "New Mexico" }, { value: "NY", label: "New York" }, { value: "NC", label: "North Carolina" }, { value: "ND", label: "North Dakota" }, { value: "MP", label: "Northern Mariana Islands" }, { value: "OH", label: "Ohio" }, { value: "OK", label: "Oklahoma" }, { value: "OR", label: "Oregon" }, { value: "PW", label: "Palau" }, { value: "PA", label: "Pennsylvania" }, { value: "PR", label: "Puerto Rico" }, { value: "RI", label: "Rhode Island" }, { value: "SC", label: "South Carolina" }, { value: "SD", label: "South Dakota" }, { value: "TN", label: "Tennessee" }, { value: "TX", label: "Texas" }, { value: "UT", label: "Utah" }, { value: "VT", label: "Vermont" }, { value: "VI", label: "Virgin Islands" }, { value: "VA", label: "Virginia" }, { value: "WA", label: "Washington" }, { value: "WV", label: "West Virginia" }, { value: "WI", label: "Wisconsin" }, { value: "WY", label: "Wyoming" }];

},{}]},{},[1]);
Loading