react-select-input-v2 1.0.7 → 1.0.8-react16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +82 -82
- package/es/index.js +68 -91
- package/es/react-select-input.css +92 -92
- package/lib/index.js +70 -91
- package/lib/react-select-input.css +92 -92
- package/package.json +12 -37
- package/src/index.js +270 -0
- package/src/react-select-input.css +92 -0
- package/umd/{react-select-input.js → react-select-input-v2.js} +341 -629
- package/umd/react-select-input-v2.min.js +6 -0
- package/umd/react-select-input-v2.min.js.map +1 -0
- package/umd/react-select-input.min.js +0 -6
- package/umd/react-select-input.min.js.map +0 -1
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.ris {
|
|
4
|
-
display: block;
|
|
5
|
-
position: relative;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
font-size:12px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ris * {
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ris.ris-is-clearable .ris-clearable {
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: 50%;
|
|
17
|
-
right: 5px;
|
|
18
|
-
font-size:1.1em;
|
|
19
|
-
margin-top:-1px;
|
|
20
|
-
transform: translate(0, -50%);
|
|
21
|
-
padding:5px;
|
|
22
|
-
color: #555;
|
|
23
|
-
cursor:pointer;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ris.ris-is-creatable .ris-input {
|
|
27
|
-
padding-right:15px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ris .ris-input {
|
|
31
|
-
display: block;
|
|
32
|
-
resize: none;
|
|
33
|
-
width: 100%;
|
|
34
|
-
padding: 5px;
|
|
35
|
-
border: 5px solid #eee;
|
|
36
|
-
border-radius: 5px;
|
|
37
|
-
font-size:inherit;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ris .ris-input:active, .ris .ris-input:focus {
|
|
41
|
-
outline: 0;
|
|
42
|
-
border: 5px solid #1e88e5;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ris.ris-open-up .ris-options {
|
|
46
|
-
top:0;
|
|
47
|
-
transform:translate(-50%,-100%);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.ris .ris-options {
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 100%;
|
|
53
|
-
left: 50%;
|
|
54
|
-
margin:0;
|
|
55
|
-
width: calc(100% - 10px);
|
|
56
|
-
background: #fff;
|
|
57
|
-
transform:translate(-50%, 0);
|
|
58
|
-
border: 1px solid #eee;
|
|
59
|
-
overflow: auto;
|
|
60
|
-
box-shadow: 0 2px 3px 1px #eee;
|
|
61
|
-
max-height:245px;
|
|
62
|
-
font-size:inherit;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.ris .ris-options .ris-option {
|
|
66
|
-
padding: 5px;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
border-bottom: 1px solid #efefef;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ris .ris-options .ris-option:last-child {
|
|
72
|
-
border-bottom: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ris .ris-options .ris-option:hover {
|
|
76
|
-
background: #bbdefb;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ris .ris-options .ris-option.current {
|
|
80
|
-
background:#bbdefb;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.ris .ris-options .ris-option.selected {
|
|
84
|
-
background:#1e88e5;
|
|
85
|
-
color: #fff;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ris .ris-options.ris-no-options {
|
|
89
|
-
padding:5px;
|
|
90
|
-
text-align:center;
|
|
91
|
-
color:#ccc;
|
|
92
|
-
}
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.ris {
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
font-size:12px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ris * {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ris.ris-is-clearable .ris-clearable {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 50%;
|
|
17
|
+
right: 5px;
|
|
18
|
+
font-size:1.1em;
|
|
19
|
+
margin-top:-1px;
|
|
20
|
+
transform: translate(0, -50%);
|
|
21
|
+
padding:5px;
|
|
22
|
+
color: #555;
|
|
23
|
+
cursor:pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ris.ris-is-creatable .ris-input {
|
|
27
|
+
padding-right:15px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ris .ris-input {
|
|
31
|
+
display: block;
|
|
32
|
+
resize: none;
|
|
33
|
+
width: 100%;
|
|
34
|
+
padding: 5px;
|
|
35
|
+
border: 5px solid #eee;
|
|
36
|
+
border-radius: 5px;
|
|
37
|
+
font-size:inherit;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ris .ris-input:active, .ris .ris-input:focus {
|
|
41
|
+
outline: 0;
|
|
42
|
+
border: 5px solid #1e88e5;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ris.ris-open-up .ris-options {
|
|
46
|
+
top:0;
|
|
47
|
+
transform:translate(-50%,-100%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ris .ris-options {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 100%;
|
|
53
|
+
left: 50%;
|
|
54
|
+
margin:0;
|
|
55
|
+
width: calc(100% - 10px);
|
|
56
|
+
background: #fff;
|
|
57
|
+
transform:translate(-50%, 0);
|
|
58
|
+
border: 1px solid #eee;
|
|
59
|
+
overflow: auto;
|
|
60
|
+
box-shadow: 0 2px 3px 1px #eee;
|
|
61
|
+
max-height:245px;
|
|
62
|
+
font-size:inherit;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ris .ris-options .ris-option {
|
|
66
|
+
padding: 5px;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
border-bottom: 1px solid #efefef;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ris .ris-options .ris-option:last-child {
|
|
72
|
+
border-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ris .ris-options .ris-option:hover {
|
|
76
|
+
background: #bbdefb;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ris .ris-options .ris-option.current {
|
|
80
|
+
background:#bbdefb;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ris .ris-options .ris-option.selected {
|
|
84
|
+
background:#1e88e5;
|
|
85
|
+
color: #fff;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ris .ris-options.ris-no-options {
|
|
89
|
+
padding:5px;
|
|
90
|
+
text-align:center;
|
|
91
|
+
color:#ccc;
|
|
92
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = undefined;
|
|
5
5
|
|
|
6
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
7
|
+
|
|
6
8
|
var _react = require('react');
|
|
7
9
|
|
|
8
10
|
var _react2 = _interopRequireDefault(_react);
|
|
9
11
|
|
|
12
|
+
var _propTypes = require('prop-types');
|
|
13
|
+
|
|
14
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
15
|
+
|
|
10
16
|
var _reactAutosizeTextarea = require('react-autosize-textarea');
|
|
11
17
|
|
|
12
18
|
var _reactAutosizeTextarea2 = _interopRequireDefault(_reactAutosizeTextarea);
|
|
@@ -57,7 +63,6 @@ var SelectInput = function (_Component) {
|
|
|
57
63
|
if (_this.props.collapseOnSelect) state = _this.setIsOpen(state, false);
|
|
58
64
|
state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, state.value));
|
|
59
65
|
_this.setState(state);
|
|
60
|
-
|
|
61
66
|
if (_this.isFunction(_this.props.onSelect)) _this.props.onSelect(option);
|
|
62
67
|
};
|
|
63
68
|
|
|
@@ -70,14 +75,11 @@ var SelectInput = function (_Component) {
|
|
|
70
75
|
var state = _this.manipState(_this.state, 'value', event.target.value);
|
|
71
76
|
state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, event.target.value));
|
|
72
77
|
state = _this.setIsOpen(state, true);
|
|
73
|
-
|
|
74
78
|
if (!state.value) {
|
|
75
79
|
state = _this.manipState(state, 'currentOption', -1);
|
|
76
80
|
state = _this.manipState(state, 'selectedOption', null);
|
|
77
81
|
}
|
|
78
|
-
|
|
79
82
|
if (_this.isFunction(_this.props.onChange)) _this.props.onChange(event);
|
|
80
|
-
|
|
81
83
|
_this.setState(state);
|
|
82
84
|
};
|
|
83
85
|
|
|
@@ -85,7 +87,6 @@ var SelectInput = function (_Component) {
|
|
|
85
87
|
var state = _this.setIsOpen(_this.state, true);
|
|
86
88
|
state = _this.manipState(state, 'searchMatchOptions', _this.matchingOptions(_this.props.options, event.target.value));
|
|
87
89
|
_this.setState(state);
|
|
88
|
-
|
|
89
90
|
if (_this.isFunction(_this.props.onFocus)) _this.props.onFocus(event);
|
|
90
91
|
};
|
|
91
92
|
|
|
@@ -96,65 +97,47 @@ var SelectInput = function (_Component) {
|
|
|
96
97
|
state = _this.manipState(state, 'currentOption', -1);
|
|
97
98
|
state = _this.manipState(state, 'selectedOption', null);
|
|
98
99
|
_this.setState(state);
|
|
99
|
-
|
|
100
100
|
if (_this.isFunction(_this.props.onClear)) _this.props.onClear();
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
_this.handleBlur = function (event) {
|
|
104
104
|
if (_this.props.collapseOnBlur) {
|
|
105
|
-
|
|
106
|
-
_this.setState(state);
|
|
105
|
+
_this.setState(_this.setIsOpen(_this.state, false));
|
|
107
106
|
}
|
|
108
|
-
|
|
109
107
|
if (_this.isFunction(_this.props.onBlur)) _this.props.onBlur(event);
|
|
110
108
|
};
|
|
111
109
|
|
|
112
110
|
_this.handleKeyUp = function (event) {
|
|
113
|
-
if (event.key === 'Enter' && _this.state.currentOption > -1)
|
|
114
|
-
|
|
115
|
-
} else if (event.key === 'Enter' && _this.state.currentOption === -1) {
|
|
116
|
-
_this.handleSelect(_this.pickOption());
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (event.key === 'Escape' && _this.props.collapseOnEscape) {
|
|
120
|
-
_this.setState(_this.setIsOpen(_this.state, false));
|
|
121
|
-
}
|
|
122
|
-
|
|
111
|
+
if (event.key === 'Enter' && _this.state.currentOption > -1) _this.handleSelect(_this.pickOption());
|
|
112
|
+
if (event.key === 'Escape' && _this.props.collapseOnEscape) _this.setState(_this.setIsOpen(_this.state, false));
|
|
123
113
|
if (_this.isFunction(_this.props.onKeyUp)) _this.props.onKeyUp(event);
|
|
124
114
|
};
|
|
125
115
|
|
|
126
116
|
_this.handleKeyDown = function (event) {
|
|
127
117
|
if (event.key === 'Enter' && _this.props.disableEnter) event.preventDefault();
|
|
128
|
-
|
|
129
|
-
if (event.key === 'Escape' && _this.props.collapseOnEscape) {
|
|
130
|
-
var state = _this.setIsOpen(_this.state, false);
|
|
131
|
-
_this.setState(state);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
_this.handleOptionNavigation(event);
|
|
135
|
-
|
|
118
|
+
if (event.key === 'Escape' && _this.props.collapseOnEscape) _this.setState(_this.setIsOpen(_this.state, false));
|
|
136
119
|
if (_this.isFunction(_this.props.onKeyDown)) _this.props.onKeyDown(event);
|
|
120
|
+
_this.handleOptionNavigation(event);
|
|
137
121
|
};
|
|
138
122
|
|
|
139
123
|
_this.handleOptionNavigation = function (event) {
|
|
140
124
|
var state = {};
|
|
141
125
|
var currentOption = _this.state.currentOption;
|
|
142
126
|
|
|
143
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowDown'
|
|
127
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') event.preventDefault();
|
|
144
128
|
|
|
145
129
|
if (event.key === 'ArrowUp' && currentOption === -1 && _this.props.openUp) currentOption = _this.state.searchMatchOptions.length;
|
|
146
130
|
|
|
147
131
|
if (_this.props.openUp) {
|
|
148
|
-
if (event.key === 'ArrowDown')
|
|
149
|
-
if (currentOption > -1) currentOption++;else currentOption = -1;
|
|
150
|
-
} else if (event.key === 'ArrowUp') currentOption--;
|
|
132
|
+
if (event.key === 'ArrowDown') currentOption = currentOption > -1 ? currentOption + 1 : -1;else if (event.key === 'ArrowUp') currentOption--;
|
|
151
133
|
} else {
|
|
152
134
|
if (event.key === 'ArrowDown') currentOption++;else if (event.key === 'ArrowUp') currentOption--;
|
|
153
135
|
}
|
|
154
136
|
|
|
155
|
-
if (currentOption < -1) currentOption = -1;else if (currentOption > _this.state.searchMatchOptions.length - 1
|
|
137
|
+
if (currentOption < -1) currentOption = -1;else if (currentOption > _this.state.searchMatchOptions.length - 1) currentOption = _this.state.searchMatchOptions.length - 1;
|
|
156
138
|
|
|
157
139
|
state = _this.manipState(_this.state, 'currentOption', currentOption);
|
|
140
|
+
|
|
158
141
|
var optionRef = currentOption > -1 ? _this['option-' + _this.state.searchMatchOptions[currentOption][_this.props.valueKey]] : null;
|
|
159
142
|
if (optionRef) optionRef.scrollIntoViewIfNeeded(false);
|
|
160
143
|
|
|
@@ -166,12 +149,12 @@ var SelectInput = function (_Component) {
|
|
|
166
149
|
var searchValue = value.replace(/\s/g, '');
|
|
167
150
|
var searchOptions = [];
|
|
168
151
|
|
|
169
|
-
if (options && options.length > 0 && value) searchOptions = options.filter(function (option
|
|
170
|
-
var
|
|
171
|
-
var value = option[_this.props.valueKey] || '';
|
|
152
|
+
if (options && options.length > 0 && value) searchOptions = options.filter(function (option) {
|
|
153
|
+
var val = option[_this.props.valueKey] || '';
|
|
172
154
|
var label = option[_this.props.labelKey] || '';
|
|
173
|
-
|
|
174
|
-
|
|
155
|
+
var regexp = new RegExp(searchValue, 'gi');
|
|
156
|
+
return regexp.test(label.replace(/\s/g, '')) || regexp.test(val.replace(/\s/g, ''));
|
|
157
|
+
});else searchOptions = options.slice();
|
|
175
158
|
|
|
176
159
|
if (_this.props.openUp) searchOptions.reverse();
|
|
177
160
|
|
|
@@ -186,15 +169,13 @@ var SelectInput = function (_Component) {
|
|
|
186
169
|
};
|
|
187
170
|
|
|
188
171
|
_this.setIsOpen = function (state, show) {
|
|
189
|
-
return
|
|
190
|
-
isOpen: show || false
|
|
191
|
-
});
|
|
172
|
+
return _extends({}, state, { isOpen: show || false });
|
|
192
173
|
};
|
|
193
174
|
|
|
194
175
|
_this.manipState = function (state, key, value) {
|
|
195
|
-
var
|
|
176
|
+
var _extends2;
|
|
196
177
|
|
|
197
|
-
return
|
|
178
|
+
return _extends({}, state, (_extends2 = {}, _extends2[key] = value, _extends2));
|
|
198
179
|
};
|
|
199
180
|
|
|
200
181
|
_this.isFunction = function (obj) {
|
|
@@ -202,7 +183,7 @@ var SelectInput = function (_Component) {
|
|
|
202
183
|
};
|
|
203
184
|
|
|
204
185
|
_this.handleOutsideClick = function (event) {
|
|
205
|
-
if (!_this.ris.contains(event.target) && _this.props.collapseOnBlur) _this.setState(
|
|
186
|
+
if (_this.ris && !_this.ris.contains(event.target) && _this.props.collapseOnBlur) _this.setState({ isOpen: false });
|
|
206
187
|
};
|
|
207
188
|
|
|
208
189
|
_this.state = {
|
|
@@ -221,9 +202,10 @@ var SelectInput = function (_Component) {
|
|
|
221
202
|
|
|
222
203
|
SelectInput.prototype.componentDidUpdate = function componentDidUpdate() {
|
|
223
204
|
if (this.props.openUp && this.state.currentOption === -1 && this.state.isOpen && !this.state.selectedOption) {
|
|
224
|
-
this.options.scrollTop = this.options.scrollHeight;
|
|
205
|
+
if (this.options) this.options.scrollTop = this.options.scrollHeight;
|
|
225
206
|
} else if (this.props.openUp && this.state.selectedOption && this.state.isOpen) {
|
|
226
|
-
this['option-' + this.state.selectedOption]
|
|
207
|
+
var ref = this['option-' + this.state.selectedOption];
|
|
208
|
+
if (ref && ref.scrollIntoViewIfNeeded) ref.scrollIntoViewIfNeeded(true);
|
|
227
209
|
}
|
|
228
210
|
};
|
|
229
211
|
|
|
@@ -231,21 +213,11 @@ var SelectInput = function (_Component) {
|
|
|
231
213
|
document.removeEventListener('click', this.handleOutsideClick);
|
|
232
214
|
};
|
|
233
215
|
|
|
234
|
-
|
|
235
|
-
Various renderers
|
|
236
|
-
*/
|
|
216
|
+
// ======= 渲染选项 =======
|
|
237
217
|
|
|
238
|
-
/*
|
|
239
|
-
Handle different events
|
|
240
|
-
*/
|
|
241
218
|
|
|
242
|
-
|
|
243
|
-
Searching function
|
|
244
|
-
*/
|
|
219
|
+
// ======= 事件处理 =======
|
|
245
220
|
|
|
246
|
-
/*
|
|
247
|
-
Various helpers
|
|
248
|
-
*/
|
|
249
221
|
|
|
250
222
|
SelectInput.prototype.render = function render() {
|
|
251
223
|
var _this2 = this;
|
|
@@ -270,27 +242,22 @@ var SelectInput = function (_Component) {
|
|
|
270
242
|
onKeyUp: this.handleKeyUp,
|
|
271
243
|
onKeyDown: this.handleKeyDown,
|
|
272
244
|
autoFocus: this.props.autoFocus,
|
|
273
|
-
disabled: this.props.disabled,
|
|
274
245
|
innerRef: function innerRef(ref) {
|
|
275
246
|
return _this2.input = ref;
|
|
276
247
|
}
|
|
277
248
|
}),
|
|
278
|
-
this.props.clearable
|
|
249
|
+
this.props.clearable && _react2.default.createElement(
|
|
279
250
|
'div',
|
|
280
251
|
{ className: 'ris-clearable', onClick: this.handleClear },
|
|
281
252
|
'x'
|
|
282
|
-
)
|
|
283
|
-
this.state.isOpen
|
|
253
|
+
),
|
|
254
|
+
this.state.isOpen && this.state.searchMatchOptions.length > 0 && _react2.default.createElement(
|
|
284
255
|
'div',
|
|
285
256
|
{ className: 'ris-options', ref: function ref(_ref3) {
|
|
286
257
|
return _this2.options = _ref3;
|
|
287
258
|
} },
|
|
288
259
|
this.renderOptions(this.state.searchMatchOptions)
|
|
289
|
-
)
|
|
290
|
-
'div',
|
|
291
|
-
{ className: 'ris-options ris-no-options' },
|
|
292
|
-
this.props.noOptions
|
|
293
|
-
) : null : null
|
|
260
|
+
)
|
|
294
261
|
);
|
|
295
262
|
};
|
|
296
263
|
|
|
@@ -301,30 +268,42 @@ exports.default = SelectInput;
|
|
|
301
268
|
|
|
302
269
|
|
|
303
270
|
SelectInput.defaultProps = {
|
|
304
|
-
uniqueKey: 'react-select-input',
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
autoFocus: true, //Boolean
|
|
318
|
-
clearable: true, //Boolean
|
|
319
|
-
options: [], //Array
|
|
320
|
-
onChange: undefined, //Function
|
|
321
|
-
onSelect: undefined, //Function
|
|
322
|
-
onFocus: undefined, //Function
|
|
323
|
-
onBlur: undefined, //Function
|
|
324
|
-
onKeyUp: undefined, //Function
|
|
325
|
-
onKeyDown: undefined, //Function
|
|
326
|
-
onClear: undefined, //Function
|
|
327
|
-
noOptions: undefined, //JSX
|
|
328
|
-
disabled: false,
|
|
271
|
+
uniqueKey: 'react-select-input',
|
|
272
|
+
value: '',
|
|
273
|
+
valueKey: 'value',
|
|
274
|
+
labelKey: 'label',
|
|
275
|
+
placeholder: 'Enter text',
|
|
276
|
+
openUp: false,
|
|
277
|
+
disableEnter: true,
|
|
278
|
+
collapseOnBlur: true,
|
|
279
|
+
collapseOnEscape: true,
|
|
280
|
+
collapseOnSelect: true,
|
|
281
|
+
autoFocus: true,
|
|
282
|
+
clearable: true,
|
|
283
|
+
options: []
|
|
329
284
|
};
|
|
285
|
+
|
|
286
|
+
SelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
287
|
+
uniqueKey: _propTypes2.default.string,
|
|
288
|
+
value: _propTypes2.default.string,
|
|
289
|
+
valueKey: _propTypes2.default.string,
|
|
290
|
+
labelKey: _propTypes2.default.string,
|
|
291
|
+
placeholder: _propTypes2.default.string,
|
|
292
|
+
openUp: _propTypes2.default.bool,
|
|
293
|
+
disableEnter: _propTypes2.default.bool,
|
|
294
|
+
collapseOnBlur: _propTypes2.default.bool,
|
|
295
|
+
collapseOnEscape: _propTypes2.default.bool,
|
|
296
|
+
collapseOnSelect: _propTypes2.default.bool,
|
|
297
|
+
autoFocus: _propTypes2.default.bool,
|
|
298
|
+
clearable: _propTypes2.default.bool,
|
|
299
|
+
options: _propTypes2.default.array,
|
|
300
|
+
onChange: _propTypes2.default.func,
|
|
301
|
+
onSelect: _propTypes2.default.func,
|
|
302
|
+
onFocus: _propTypes2.default.func,
|
|
303
|
+
onBlur: _propTypes2.default.func,
|
|
304
|
+
onKeyUp: _propTypes2.default.func,
|
|
305
|
+
onKeyDown: _propTypes2.default.func,
|
|
306
|
+
onClear: _propTypes2.default.func,
|
|
307
|
+
noOptions: _propTypes2.default.node
|
|
308
|
+
} : {};
|
|
330
309
|
module.exports = exports['default'];
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.ris {
|
|
4
|
-
display: block;
|
|
5
|
-
position: relative;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
font-size:12px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ris * {
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ris.ris-is-clearable .ris-clearable {
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: 50%;
|
|
17
|
-
right: 5px;
|
|
18
|
-
font-size:1.1em;
|
|
19
|
-
margin-top:-1px;
|
|
20
|
-
transform: translate(0, -50%);
|
|
21
|
-
padding:5px;
|
|
22
|
-
color: #555;
|
|
23
|
-
cursor:pointer;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ris.ris-is-creatable .ris-input {
|
|
27
|
-
padding-right:15px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ris .ris-input {
|
|
31
|
-
display: block;
|
|
32
|
-
resize: none;
|
|
33
|
-
width: 100%;
|
|
34
|
-
padding: 5px;
|
|
35
|
-
border: 5px solid #eee;
|
|
36
|
-
border-radius: 5px;
|
|
37
|
-
font-size:inherit;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ris .ris-input:active, .ris .ris-input:focus {
|
|
41
|
-
outline: 0;
|
|
42
|
-
border: 5px solid #1e88e5;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ris.ris-open-up .ris-options {
|
|
46
|
-
top:0;
|
|
47
|
-
transform:translate(-50%,-100%);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.ris .ris-options {
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 100%;
|
|
53
|
-
left: 50%;
|
|
54
|
-
margin:0;
|
|
55
|
-
width: calc(100% - 10px);
|
|
56
|
-
background: #fff;
|
|
57
|
-
transform:translate(-50%, 0);
|
|
58
|
-
border: 1px solid #eee;
|
|
59
|
-
overflow: auto;
|
|
60
|
-
box-shadow: 0 2px 3px 1px #eee;
|
|
61
|
-
max-height:245px;
|
|
62
|
-
font-size:inherit;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.ris .ris-options .ris-option {
|
|
66
|
-
padding: 5px;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
border-bottom: 1px solid #efefef;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ris .ris-options .ris-option:last-child {
|
|
72
|
-
border-bottom: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.ris .ris-options .ris-option:hover {
|
|
76
|
-
background: #bbdefb;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.ris .ris-options .ris-option.current {
|
|
80
|
-
background:#bbdefb;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.ris .ris-options .ris-option.selected {
|
|
84
|
-
background:#1e88e5;
|
|
85
|
-
color: #fff;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.ris .ris-options.ris-no-options {
|
|
89
|
-
padding:5px;
|
|
90
|
-
text-align:center;
|
|
91
|
-
color:#ccc;
|
|
92
|
-
}
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
.ris {
|
|
4
|
+
display: block;
|
|
5
|
+
position: relative;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
font-size:12px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ris * {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ris.ris-is-clearable .ris-clearable {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 50%;
|
|
17
|
+
right: 5px;
|
|
18
|
+
font-size:1.1em;
|
|
19
|
+
margin-top:-1px;
|
|
20
|
+
transform: translate(0, -50%);
|
|
21
|
+
padding:5px;
|
|
22
|
+
color: #555;
|
|
23
|
+
cursor:pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ris.ris-is-creatable .ris-input {
|
|
27
|
+
padding-right:15px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ris .ris-input {
|
|
31
|
+
display: block;
|
|
32
|
+
resize: none;
|
|
33
|
+
width: 100%;
|
|
34
|
+
padding: 5px;
|
|
35
|
+
border: 5px solid #eee;
|
|
36
|
+
border-radius: 5px;
|
|
37
|
+
font-size:inherit;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ris .ris-input:active, .ris .ris-input:focus {
|
|
41
|
+
outline: 0;
|
|
42
|
+
border: 5px solid #1e88e5;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ris.ris-open-up .ris-options {
|
|
46
|
+
top:0;
|
|
47
|
+
transform:translate(-50%,-100%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ris .ris-options {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 100%;
|
|
53
|
+
left: 50%;
|
|
54
|
+
margin:0;
|
|
55
|
+
width: calc(100% - 10px);
|
|
56
|
+
background: #fff;
|
|
57
|
+
transform:translate(-50%, 0);
|
|
58
|
+
border: 1px solid #eee;
|
|
59
|
+
overflow: auto;
|
|
60
|
+
box-shadow: 0 2px 3px 1px #eee;
|
|
61
|
+
max-height:245px;
|
|
62
|
+
font-size:inherit;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ris .ris-options .ris-option {
|
|
66
|
+
padding: 5px;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
border-bottom: 1px solid #efefef;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ris .ris-options .ris-option:last-child {
|
|
72
|
+
border-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ris .ris-options .ris-option:hover {
|
|
76
|
+
background: #bbdefb;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ris .ris-options .ris-option.current {
|
|
80
|
+
background:#bbdefb;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ris .ris-options .ris-option.selected {
|
|
84
|
+
background:#1e88e5;
|
|
85
|
+
color: #fff;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ris .ris-options.ris-no-options {
|
|
89
|
+
padding:5px;
|
|
90
|
+
text-align:center;
|
|
91
|
+
color:#ccc;
|
|
92
|
+
}
|