@hipay/hipay-material-ui 1.0.0-beta.28 → 1.0.0-beta.29
Sign up to get free protection for your applications and to get access to all the features.
- package/HiSelect/HiSuggestSelect.js +15 -3
- package/es/HiSelect/HiSuggestSelect.js +14 -3
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +21416 -20891
- package/umd/hipay-material-ui.production.min.js +5 -5
@@ -106,6 +106,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
106
106
|
if (textInput) {
|
107
107
|
setTimeout(function () {
|
108
108
|
textInput.focus();
|
109
|
+
textInput.scrollLeft = textInput.scrollWidth;
|
109
110
|
}, 1);
|
110
111
|
}
|
111
112
|
};
|
@@ -151,6 +152,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
151
152
|
_this.handleSelect = _this.handleSelect.bind(_this);
|
152
153
|
_this.handleBlur = _this.handleBlur.bind(_this);
|
153
154
|
_this.handleFocus = _this.handleFocus.bind(_this);
|
155
|
+
_this.getInputElement = _this.getInputElement.bind(_this);
|
154
156
|
return _this;
|
155
157
|
}
|
156
158
|
|
@@ -159,6 +161,14 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
159
161
|
value: function componentWillReceiveProps(nextProps) {
|
160
162
|
this.setState({ options: nextProps.options });
|
161
163
|
}
|
164
|
+
}, {
|
165
|
+
key: 'getInputElement',
|
166
|
+
value: function getInputElement(el) {
|
167
|
+
this.textInput = el;
|
168
|
+
if (this.props.inputRef) {
|
169
|
+
this.props.inputRef(this.textInput);
|
170
|
+
}
|
171
|
+
}
|
162
172
|
|
163
173
|
// Key down on list items
|
164
174
|
|
@@ -243,9 +253,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
243
253
|
|
244
254
|
inputId: id,
|
245
255
|
focused: focused,
|
246
|
-
inputRef:
|
247
|
-
_this2.textInput = input;
|
248
|
-
},
|
256
|
+
inputRef: this.getInputElement,
|
249
257
|
onChange: onSearch,
|
250
258
|
onKeyDown: this.handleKeyDownSearch,
|
251
259
|
onBlur: this.handleBlur,
|
@@ -301,6 +309,10 @@ HiSuggestSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
301
309
|
* id de l'élément input
|
302
310
|
*/
|
303
311
|
id: _propTypes2.default.string,
|
312
|
+
/**
|
313
|
+
* Passe une ref callback au composant input
|
314
|
+
*/
|
315
|
+
inputRef: _propTypes2.default.func,
|
304
316
|
/**
|
305
317
|
* Ajoute un loader
|
306
318
|
*/
|
@@ -45,6 +45,7 @@ class HiSuggestSelect extends React.PureComponent {
|
|
45
45
|
if (textInput) {
|
46
46
|
setTimeout(() => {
|
47
47
|
textInput.focus();
|
48
|
+
textInput.scrollLeft = textInput.scrollWidth;
|
48
49
|
}, 1);
|
49
50
|
}
|
50
51
|
};
|
@@ -90,12 +91,20 @@ class HiSuggestSelect extends React.PureComponent {
|
|
90
91
|
this.handleSelect = this.handleSelect.bind(this);
|
91
92
|
this.handleBlur = this.handleBlur.bind(this);
|
92
93
|
this.handleFocus = this.handleFocus.bind(this);
|
94
|
+
this.getInputElement = this.getInputElement.bind(this);
|
93
95
|
}
|
94
96
|
|
95
97
|
componentWillReceiveProps(nextProps) {
|
96
98
|
this.setState({ options: nextProps.options });
|
97
99
|
}
|
98
100
|
|
101
|
+
getInputElement(el) {
|
102
|
+
this.textInput = el;
|
103
|
+
if (this.props.inputRef) {
|
104
|
+
this.props.inputRef(this.textInput);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
99
108
|
// Key down on list items
|
100
109
|
|
101
110
|
|
@@ -166,9 +175,7 @@ class HiSuggestSelect extends React.PureComponent {
|
|
166
175
|
|
167
176
|
inputId: id,
|
168
177
|
focused: focused,
|
169
|
-
inputRef:
|
170
|
-
this.textInput = input;
|
171
|
-
},
|
178
|
+
inputRef: this.getInputElement,
|
172
179
|
onChange: onSearch,
|
173
180
|
onKeyDown: this.handleKeyDownSearch,
|
174
181
|
onBlur: this.handleBlur,
|
@@ -222,6 +229,10 @@ HiSuggestSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
222
229
|
* id de l'élément input
|
223
230
|
*/
|
224
231
|
id: PropTypes.string,
|
232
|
+
/**
|
233
|
+
* Passe une ref callback au composant input
|
234
|
+
*/
|
235
|
+
inputRef: PropTypes.func,
|
225
236
|
/**
|
226
237
|
* Ajoute un loader
|
227
238
|
*/
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@hipay/hipay-material-ui",
|
3
3
|
"private": false,
|
4
4
|
"author": "HiPay PSYCHE Team",
|
5
|
-
"version": "1.0.0-beta.
|
5
|
+
"version": "1.0.0-beta.29",
|
6
6
|
"description": "HiPay Material-UI Style Guide - React components that implement Google's Material Design from Material-UI.",
|
7
7
|
"main": "./index.js",
|
8
8
|
"repository": {
|