@hipay/hipay-material-ui 2.3.1-rc3 → 2.3.1-rc5
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/HiAlertModal/HiAlertModal.js +6 -6
- package/HiBreadcrumb/HiBreadcrumb.js +6 -8
- package/HiBreadcrumb/HiStep.js +11 -10
- package/HiBreadcrumb/HiStepConnector.js +4 -4
- package/HiBreadcrumb/HiStepContent.js +4 -4
- package/HiBreadcrumb/HiStepIcon.js +4 -4
- package/HiBreadcrumb/HiStepLabel.js +4 -4
- package/HiBreadcrumb/HiStepper.js +2 -4
- package/HiCell/CellAddress.js +2 -4
- package/HiCell/CellDate.js +3 -7
- package/HiCell/CellIcon.js +2 -4
- package/HiCell/CellImage.js +2 -4
- package/HiCell/CellNumeric.js +2 -4
- package/HiCell/CellRate.js +4 -4
- package/HiCell/CellSentinel.js +2 -4
- package/HiCell/CellSentinelScore.js +2 -4
- package/HiCell/CellText.js +1 -3
- package/HiCheckbox/HiCheckbox.js +4 -4
- package/HiChip/HiChipSwitch.js +12 -9
- package/HiDatePicker/HiDatePicker.js +55 -40
- package/HiDatePicker/HiDateRangePicker.js +64 -46
- package/HiDatePicker/HiDateRangeSelector.js +15 -13
- package/HiDatePicker/ListPicker.js +6 -8
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +3 -5
- package/HiDatePicker/Overlays/TimePickerOverlay.js +4 -6
- package/HiDatePicker/Overlays/YearPickerOverlay.js +3 -5
- package/HiDotsStepper/HiDot.js +2 -4
- package/HiDotsStepper/HiDotsStepper.js +7 -6
- package/HiExpansionPanel/HiExpansionPanel.js +4 -4
- package/HiForm/HiAddressField.js +4 -4
- package/HiForm/HiEmailField.js +4 -4
- package/HiForm/HiFormControl.js +17 -12
- package/HiForm/HiFormLabel.js +2 -4
- package/HiForm/HiInput.js +11 -8
- package/HiForm/HiSearchField.js +2 -4
- package/HiForm/HiSlider.js +9 -8
- package/HiForm/HiTextField.js +6 -6
- package/HiForm/HiUpload.js +28 -21
- package/HiForm/HiUploadField.js +2 -4
- package/HiForm/HiUploadInput.js +30 -23
- package/HiMap/HiMap.js +3 -5
- package/HiNotice/HiKPI.js +8 -6
- package/HiPaymentMeans/HiPaymentMeans.js +14 -12
- package/HiPdfReader/HiPdfReader.js +17 -16
- package/HiSelect/HiDynamicSelect.js +12 -10
- package/HiSelect/HiNestedSelect.js +9 -8
- package/HiSelect/HiNestedSelectContent.js +9 -10
- package/HiSelect/HiSelect.js +74 -52
- package/HiSelect/HiSelectContent.js +33 -24
- package/HiSelect/HiSelectInput.js +23 -16
- package/HiSelect/HiSelectMobile.js +12 -12
- package/HiSelect/HiSuggestSelect.js +23 -18
- package/HiSelectableList/HiSelectableList.js +17 -14
- package/HiSelectableList/HiSelectableListHierarchic.js +9 -10
- package/HiSelectableList/HiSelectableListItem.js +11 -8
- package/HiTable/HiCellBuilder.js +4 -6
- package/HiTable/HiTable.js +4 -4
- package/HiTable/HiTableHeader.js +4 -6
- package/es/HiAlertModal/HiAlertModal.js +6 -6
- package/es/HiBreadcrumb/HiBreadcrumb.js +6 -8
- package/es/HiBreadcrumb/HiStep.js +11 -10
- package/es/HiBreadcrumb/HiStepConnector.js +4 -4
- package/es/HiBreadcrumb/HiStepContent.js +4 -4
- package/es/HiBreadcrumb/HiStepIcon.js +4 -4
- package/es/HiBreadcrumb/HiStepLabel.js +4 -4
- package/es/HiBreadcrumb/HiStepper.js +2 -4
- package/es/HiCell/CellAddress.js +2 -4
- package/es/HiCell/CellDate.js +3 -7
- package/es/HiCell/CellIcon.js +2 -4
- package/es/HiCell/CellImage.js +2 -4
- package/es/HiCell/CellNumeric.js +2 -4
- package/es/HiCell/CellRate.js +4 -4
- package/es/HiCell/CellSentinel.js +2 -4
- package/es/HiCell/CellSentinelScore.js +2 -4
- package/es/HiCell/CellText.js +1 -3
- package/es/HiCheckbox/HiCheckbox.js +4 -4
- package/es/HiChip/HiChipSwitch.js +12 -9
- package/es/HiDatePicker/HiDatePicker.js +55 -40
- package/es/HiDatePicker/HiDateRangePicker.js +64 -46
- package/es/HiDatePicker/HiDateRangeSelector.js +15 -13
- package/es/HiDatePicker/ListPicker.js +6 -8
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +3 -5
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +4 -6
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +3 -5
- package/es/HiDotsStepper/HiDot.js +2 -4
- package/es/HiDotsStepper/HiDotsStepper.js +7 -6
- package/es/HiExpansionPanel/HiExpansionPanel.js +4 -4
- package/es/HiForm/HiAddressField.js +4 -4
- package/es/HiForm/HiEmailField.js +4 -4
- package/es/HiForm/HiFormControl.js +17 -12
- package/es/HiForm/HiFormLabel.js +2 -4
- package/es/HiForm/HiInput.js +11 -8
- package/es/HiForm/HiSearchField.js +2 -4
- package/es/HiForm/HiSlider.js +9 -8
- package/es/HiForm/HiTextField.js +6 -6
- package/es/HiForm/HiUpload.js +28 -21
- package/es/HiForm/HiUploadField.js +2 -4
- package/es/HiForm/HiUploadInput.js +30 -23
- package/es/HiMap/HiMap.js +3 -5
- package/es/HiNotice/HiKPI.js +8 -6
- package/es/HiPaymentMeans/HiPaymentMeans.js +14 -12
- package/es/HiPdfReader/HiPdfReader.js +17 -16
- package/es/HiSelect/HiDynamicSelect.js +12 -10
- package/es/HiSelect/HiNestedSelect.js +9 -8
- package/es/HiSelect/HiNestedSelectContent.js +9 -10
- package/es/HiSelect/HiSelect.js +74 -52
- package/es/HiSelect/HiSelectContent.js +33 -24
- package/es/HiSelect/HiSelectInput.js +23 -16
- package/es/HiSelect/HiSelectMobile.js +12 -12
- package/es/HiSelect/HiSuggestSelect.js +23 -18
- package/es/HiSelectableList/HiSelectableList.js +17 -14
- package/es/HiSelectableList/HiSelectableListHierarchic.js +9 -10
- package/es/HiSelectableList/HiSelectableListItem.js +11 -8
- package/es/HiTable/HiCellBuilder.js +4 -6
- package/es/HiTable/HiTable.js +4 -4
- package/es/HiTable/HiTableHeader.js +4 -6
- package/es/styles/MuiThemeProvider.js +5 -7
- package/es/theme/typography.js +1 -1
- package/es/theme.js +2 -2
- package/package.json +2 -1
- package/styles/MuiThemeProvider.js +5 -7
- package/theme/typography.js +1 -1
- package/theme.js +2 -2
package/HiSelect/HiSelect.js
CHANGED
|
@@ -9,6 +9,8 @@ exports.default = exports.styles = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
11
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
13
|
+
|
|
12
14
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
13
15
|
|
|
14
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
@@ -19,12 +21,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
19
21
|
|
|
20
22
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
|
21
23
|
|
|
22
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
23
|
-
|
|
24
24
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
25
25
|
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
27
|
-
|
|
28
26
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
29
27
|
|
|
30
28
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -152,7 +150,8 @@ function (_React$PureComponent) {
|
|
|
152
150
|
|
|
153
151
|
(0, _classCallCheck2.default)(this, HiSelect);
|
|
154
152
|
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiSelect).call(this, props));
|
|
155
|
-
|
|
153
|
+
|
|
154
|
+
_this.buildSelectProps = function (options) {
|
|
156
155
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
157
156
|
var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
158
157
|
var loading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
@@ -177,8 +176,9 @@ function (_React$PureComponent) {
|
|
|
177
176
|
itemList: itemList,
|
|
178
177
|
inputValue: _this.buildInputValue(options, value, loading)
|
|
179
178
|
};
|
|
180
|
-
}
|
|
181
|
-
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
_this.buildInputValue = function (options) {
|
|
182
182
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
183
183
|
var loading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
184
184
|
var _this$props = _this.props,
|
|
@@ -232,8 +232,9 @@ function (_React$PureComponent) {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
return inputValue;
|
|
235
|
-
}
|
|
236
|
-
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
_this.focusOnFirstItem = function () {
|
|
237
238
|
if (_this.overlay && _this.overlay.getElementsByTagName('li')[0]) {
|
|
238
239
|
setTimeout(function () {
|
|
239
240
|
var item = _this.overlay.getElementsByTagName('li')[0];
|
|
@@ -241,15 +242,17 @@ function (_React$PureComponent) {
|
|
|
241
242
|
item.focus();
|
|
242
243
|
}, 1);
|
|
243
244
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
_this.getInputElement = function (el) {
|
|
246
248
|
_this.searchField = el;
|
|
247
249
|
|
|
248
250
|
if (_this.props.inputRef) {
|
|
249
251
|
_this.props.inputRef(_this.searchField);
|
|
250
252
|
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
_this.handleBlur = function (event) {
|
|
253
256
|
_this.handleSearchReset();
|
|
254
257
|
|
|
255
258
|
_this.setState({
|
|
@@ -259,8 +262,9 @@ function (_React$PureComponent) {
|
|
|
259
262
|
if (_this.props.onBlur && !_this.inputEl.contains(event.relatedTarget) && !_this.state.open) {
|
|
260
263
|
_this.props.onBlur(event);
|
|
261
264
|
}
|
|
262
|
-
}
|
|
263
|
-
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
_this.handleClick = function () {
|
|
264
268
|
if (_this.state.open) {
|
|
265
269
|
_this.handleClose();
|
|
266
270
|
} else if (_this.props.alert && !_this.state.alertOpen) {
|
|
@@ -285,22 +289,27 @@ function (_React$PureComponent) {
|
|
|
285
289
|
}
|
|
286
290
|
}, 1);
|
|
287
291
|
}
|
|
288
|
-
}
|
|
289
|
-
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
_this.handleSubmitAlert = function () {
|
|
290
295
|
_this.handleClick();
|
|
291
|
-
}
|
|
292
|
-
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
_this.handleCancelAlert = function () {
|
|
293
299
|
_this.handleClose();
|
|
294
|
-
}
|
|
295
|
-
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
_this.handleExitedAlert = function () {
|
|
296
303
|
if (_this.searchField) {
|
|
297
304
|
_this.searchField.focus();
|
|
298
305
|
}
|
|
299
|
-
}
|
|
300
|
-
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
_this.handleCloseAlert = function () {
|
|
301
309
|
_this.handleClose();
|
|
302
|
-
}
|
|
303
|
-
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
_this.focusOnSelectedItem = function (selectedValue) {
|
|
304
313
|
if (_this.overlay && _this.overlay.getElementsByTagName('li')[0]) {
|
|
305
314
|
setTimeout(function () {
|
|
306
315
|
if (_this.overlay) {
|
|
@@ -319,14 +328,16 @@ function (_React$PureComponent) {
|
|
|
319
328
|
}
|
|
320
329
|
}, 1);
|
|
321
330
|
}
|
|
322
|
-
}
|
|
323
|
-
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
_this.handleClickAway = function (event) {
|
|
324
334
|
// Au clic sur le bouton, on laisse le handleClick fermer le select
|
|
325
335
|
if (!_this.inputEl.contains(event.target)) {
|
|
326
336
|
_this.handleClose(event);
|
|
327
337
|
}
|
|
328
|
-
}
|
|
329
|
-
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
_this.handleClose = function () {
|
|
330
341
|
_this.handleSearchReset();
|
|
331
342
|
|
|
332
343
|
_this.setState({
|
|
@@ -341,13 +352,15 @@ function (_React$PureComponent) {
|
|
|
341
352
|
if (_this.inputEl) {
|
|
342
353
|
_this.inputEl.focus();
|
|
343
354
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
_this.handleFocus = function () {
|
|
346
358
|
_this.setState({
|
|
347
359
|
focused: true
|
|
348
360
|
});
|
|
349
|
-
}
|
|
350
|
-
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
_this.handleKeyDownCapture = function (event) {
|
|
351
364
|
var key = (0, _keycode.default)(event);
|
|
352
365
|
|
|
353
366
|
if (key === 'enter') {
|
|
@@ -359,8 +372,9 @@ function (_React$PureComponent) {
|
|
|
359
372
|
}
|
|
360
373
|
}
|
|
361
374
|
}
|
|
362
|
-
}
|
|
363
|
-
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
_this.handleKeyDown = function (event) {
|
|
364
378
|
var key = (0, _keycode.default)(event);
|
|
365
379
|
|
|
366
380
|
if (!_this.state.alertOpen) {
|
|
@@ -382,8 +396,9 @@ function (_React$PureComponent) {
|
|
|
382
396
|
_this.handleClose();
|
|
383
397
|
}
|
|
384
398
|
}
|
|
385
|
-
}
|
|
386
|
-
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
_this.handleKeyDownSearch = function (event) {
|
|
387
402
|
var key = (0, _keycode.default)(event);
|
|
388
403
|
|
|
389
404
|
if (_this.overlay && (key === 'down' || key === 'up')) {
|
|
@@ -397,13 +412,15 @@ function (_React$PureComponent) {
|
|
|
397
412
|
open: false
|
|
398
413
|
});
|
|
399
414
|
}
|
|
400
|
-
}
|
|
401
|
-
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
_this.handleScroll = function (e) {
|
|
402
418
|
if (e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop < 15) {
|
|
403
419
|
_this.props.onScrollReachBottom();
|
|
404
420
|
}
|
|
405
|
-
}
|
|
406
|
-
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
_this.handleSelect = function (event, item) {
|
|
407
424
|
var _this$props2 = _this.props,
|
|
408
425
|
hasAll = _this$props2.hasAll,
|
|
409
426
|
multiple = _this$props2.multiple,
|
|
@@ -439,8 +456,9 @@ function (_React$PureComponent) {
|
|
|
439
456
|
} else {
|
|
440
457
|
onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
|
|
441
458
|
}
|
|
442
|
-
}
|
|
443
|
-
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
_this.handleSuggestions = function (suggestions) {
|
|
444
462
|
var _this$props3 = _this.props,
|
|
445
463
|
hasAll = _this$props3.hasAll,
|
|
446
464
|
iconAll = _this$props3.iconAll,
|
|
@@ -471,8 +489,9 @@ function (_React$PureComponent) {
|
|
|
471
489
|
})] : []), (0, _toConsumableArray2.default)(suggestions))
|
|
472
490
|
});
|
|
473
491
|
}
|
|
474
|
-
}
|
|
475
|
-
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
_this.handleSearch = function (e, inputValue) {
|
|
476
495
|
var searchValue = inputValue && e.target.value ? inputValue : e.target.value;
|
|
477
496
|
|
|
478
497
|
if (_this.props.onSearch) {
|
|
@@ -482,15 +501,17 @@ function (_React$PureComponent) {
|
|
|
482
501
|
searchValue: searchValue
|
|
483
502
|
});
|
|
484
503
|
}
|
|
485
|
-
}
|
|
486
|
-
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
_this.handleSearchReset = function () {
|
|
487
507
|
_this.handleSearch({
|
|
488
508
|
target: {
|
|
489
509
|
value: ''
|
|
490
510
|
}
|
|
491
511
|
}, '');
|
|
492
|
-
}
|
|
493
|
-
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
_this.getLengthItemList = function (itemList) {
|
|
494
515
|
var itemListLength = 0;
|
|
495
516
|
itemList.forEach(function (parent) {
|
|
496
517
|
if (parent.displayed !== false) {
|
|
@@ -502,7 +523,8 @@ function (_React$PureComponent) {
|
|
|
502
523
|
}
|
|
503
524
|
});
|
|
504
525
|
return itemListLength;
|
|
505
|
-
}
|
|
526
|
+
};
|
|
527
|
+
|
|
506
528
|
_this.state = {
|
|
507
529
|
alertOpen: false,
|
|
508
530
|
open: false,
|
|
@@ -772,7 +794,7 @@ function (_React$PureComponent) {
|
|
|
772
794
|
return HiSelect;
|
|
773
795
|
}(_react.default.PureComponent);
|
|
774
796
|
|
|
775
|
-
|
|
797
|
+
HiSelect.defaultProps = {
|
|
776
798
|
align: 'left',
|
|
777
799
|
autoFocus: false,
|
|
778
800
|
disabled: false,
|
|
@@ -798,7 +820,7 @@ function (_React$PureComponent) {
|
|
|
798
820
|
type: 'text',
|
|
799
821
|
filterFunc: filterValue,
|
|
800
822
|
maxOptionsDisplayed: 12
|
|
801
|
-
}
|
|
823
|
+
};
|
|
802
824
|
|
|
803
825
|
var _default = (0, _styles.withStyles)(styles, {
|
|
804
826
|
hiComponent: true,
|
|
@@ -23,8 +23,6 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
23
23
|
|
|
24
24
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
25
25
|
|
|
26
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
27
|
-
|
|
28
26
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
29
27
|
|
|
30
28
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -106,7 +104,8 @@ function (_React$PureComponent) {
|
|
|
106
104
|
|
|
107
105
|
(0, _classCallCheck2.default)(this, HiSelectContent);
|
|
108
106
|
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiSelectContent).call(this, props));
|
|
109
|
-
|
|
107
|
+
|
|
108
|
+
_this.handleKeyDown = function (event) {
|
|
110
109
|
var nextItem;
|
|
111
110
|
var key = (0, _keycode.default)(event);
|
|
112
111
|
|
|
@@ -137,8 +136,9 @@ function (_React$PureComponent) {
|
|
|
137
136
|
if (nextItem) {
|
|
138
137
|
nextItem.focus();
|
|
139
138
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
_this.handleKeyDownSearch = function (event) {
|
|
142
142
|
var key = (0, _keycode.default)(event);
|
|
143
143
|
|
|
144
144
|
if (_this.overlay && (key === 'down' || key === 'up')) {
|
|
@@ -148,8 +148,9 @@ function (_React$PureComponent) {
|
|
|
148
148
|
|
|
149
149
|
_this.handleClose();
|
|
150
150
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
_this.handleSelect = function (event, item) {
|
|
153
154
|
var _this$props = _this.props,
|
|
154
155
|
hasAll = _this$props.hasAll,
|
|
155
156
|
multiple = _this$props.multiple,
|
|
@@ -180,11 +181,13 @@ function (_React$PureComponent) {
|
|
|
180
181
|
} else {
|
|
181
182
|
onChange(event, [].concat((0, _toConsumableArray2.default)(value), [item.id]), item);
|
|
182
183
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
_this.handleClose = function () {
|
|
185
187
|
if (_this.props.onClose) _this.props.onClose();
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
_this.handleSuggestions = function (suggestions) {
|
|
188
191
|
var _this$props2 = _this.props,
|
|
189
192
|
hasAll = _this$props2.hasAll,
|
|
190
193
|
iconAll = _this$props2.iconAll,
|
|
@@ -215,13 +218,15 @@ function (_React$PureComponent) {
|
|
|
215
218
|
})] : []), (0, _toConsumableArray2.default)(suggestions))
|
|
216
219
|
});
|
|
217
220
|
}
|
|
218
|
-
}
|
|
219
|
-
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
_this.handleScroll = function (e) {
|
|
220
224
|
if (e.target.scrollHeight - e.target.clientHeight - e.target.scrollTop < 15) {
|
|
221
225
|
_this.props.onScrollReachBottom();
|
|
222
226
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
_this.handleSearch = function (e, inputValue) {
|
|
225
230
|
var searchValue = inputValue && e.target.value ? inputValue : e.target.value;
|
|
226
231
|
|
|
227
232
|
if (_this.props.onSearch) {
|
|
@@ -231,15 +236,17 @@ function (_React$PureComponent) {
|
|
|
231
236
|
searchValue: searchValue
|
|
232
237
|
});
|
|
233
238
|
}
|
|
234
|
-
}
|
|
235
|
-
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
_this.handleSearchReset = function () {
|
|
236
242
|
_this.handleSearch({
|
|
237
243
|
target: {
|
|
238
244
|
value: ''
|
|
239
245
|
}
|
|
240
246
|
}, '');
|
|
241
|
-
}
|
|
242
|
-
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
_this.buildSelectProps = function (options) {
|
|
243
250
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
244
251
|
var search = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
245
252
|
var loading = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
@@ -263,14 +270,16 @@ function (_React$PureComponent) {
|
|
|
263
270
|
return {
|
|
264
271
|
itemList: itemList
|
|
265
272
|
};
|
|
266
|
-
}
|
|
267
|
-
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
_this.getInputElement = function (el) {
|
|
268
276
|
_this.searchField = el;
|
|
269
277
|
|
|
270
278
|
if (_this.props.inputRef) {
|
|
271
279
|
_this.props.inputRef(_this.searchField);
|
|
272
280
|
}
|
|
273
|
-
}
|
|
281
|
+
};
|
|
282
|
+
|
|
274
283
|
_this.state = {
|
|
275
284
|
open: false,
|
|
276
285
|
focused: false,
|
|
@@ -373,7 +382,7 @@ function (_React$PureComponent) {
|
|
|
373
382
|
return HiSelectContent;
|
|
374
383
|
}(_react.default.PureComponent);
|
|
375
384
|
|
|
376
|
-
|
|
385
|
+
HiSelectContent.defaultProps = {
|
|
377
386
|
autoHeight: true,
|
|
378
387
|
height: 400,
|
|
379
388
|
disabled: false,
|
|
@@ -394,7 +403,7 @@ function (_React$PureComponent) {
|
|
|
394
403
|
},
|
|
395
404
|
type: 'text',
|
|
396
405
|
filterFunc: filterValue
|
|
397
|
-
}
|
|
406
|
+
};
|
|
398
407
|
|
|
399
408
|
var _default = (0, _styles.withStyles)(styles, {
|
|
400
409
|
hiComponent: true,
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.styles = void 0;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
@@ -19,8 +21,6 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
19
21
|
|
|
20
22
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
21
23
|
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
23
|
-
|
|
24
24
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -170,7 +170,8 @@ function (_React$PureComponent) {
|
|
|
170
170
|
|
|
171
171
|
(0, _classCallCheck2.default)(this, HiSelectInput);
|
|
172
172
|
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiSelectInput).call(this, props));
|
|
173
|
-
|
|
173
|
+
|
|
174
|
+
_this.handleKeyDown = function (event) {
|
|
174
175
|
var key = (0, _keycode.default)(event);
|
|
175
176
|
|
|
176
177
|
if (_this.props.onKeyDown) {
|
|
@@ -182,8 +183,9 @@ function (_React$PureComponent) {
|
|
|
182
183
|
|
|
183
184
|
_this.props.onSubmit(event);
|
|
184
185
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
_this.handleKeyDownReset = function (event) {
|
|
187
189
|
var key = (0, _keycode.default)(event);
|
|
188
190
|
|
|
189
191
|
if (key === 'enter' || key === 'space') {
|
|
@@ -192,8 +194,9 @@ function (_React$PureComponent) {
|
|
|
192
194
|
event.stopPropagation();
|
|
193
195
|
event.preventDefault();
|
|
194
196
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
_this.handleClick = function (event) {
|
|
197
200
|
// Do not open select if press on resetIcon
|
|
198
201
|
if ((!_this.resetIcon || !_this.resetIcon.contains(event.target)) && _this.props.onClick) {
|
|
199
202
|
// Do not open select if press enter on button => submit form
|
|
@@ -201,15 +204,17 @@ function (_React$PureComponent) {
|
|
|
201
204
|
_this.props.onClick(event);
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
_this.handleReset = function (event) {
|
|
206
210
|
_this.props.onReset(event);
|
|
207
211
|
|
|
208
212
|
if (_this.input) {
|
|
209
213
|
_this.input.focus();
|
|
210
214
|
}
|
|
211
|
-
}
|
|
212
|
-
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
_this.handleBlur = function (event) {
|
|
213
218
|
if ((!_this.input || !_this.input.contains(event.relatedTarget)) && _this.props.onBlur) {
|
|
214
219
|
_this.props.onBlur(event);
|
|
215
220
|
}
|
|
@@ -217,14 +222,16 @@ function (_React$PureComponent) {
|
|
|
217
222
|
this.input.focus();
|
|
218
223
|
}*/
|
|
219
224
|
|
|
220
|
-
}
|
|
221
|
-
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
_this.ref = function (el) {
|
|
222
228
|
_this.input = el;
|
|
223
229
|
|
|
224
230
|
if (_this.props.refElement) {
|
|
225
231
|
_this.props.refElement(el);
|
|
226
232
|
}
|
|
227
|
-
}
|
|
233
|
+
};
|
|
234
|
+
|
|
228
235
|
_this.handleKeyDown = _this.handleKeyDown.bind((0, _assertThisInitialized2.default)(_this));
|
|
229
236
|
_this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2.default)(_this));
|
|
230
237
|
_this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)(_this));
|
|
@@ -307,13 +314,13 @@ function (_React$PureComponent) {
|
|
|
307
314
|
return HiSelectInput;
|
|
308
315
|
}(_react.default.PureComponent);
|
|
309
316
|
|
|
310
|
-
|
|
317
|
+
HiSelectInput.defaultProps = {
|
|
311
318
|
disabled: false,
|
|
312
319
|
open: false,
|
|
313
320
|
focused: false,
|
|
314
321
|
noButton: false,
|
|
315
322
|
error: false
|
|
316
|
-
}
|
|
323
|
+
};
|
|
317
324
|
|
|
318
325
|
var _default = (0, _styles.withStyles)(styles, {
|
|
319
326
|
hiComponent: true,
|
|
@@ -21,12 +21,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
21
21
|
|
|
22
22
|
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/getPrototypeOf"));
|
|
23
23
|
|
|
24
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
25
|
-
|
|
26
24
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
27
25
|
|
|
28
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
29
|
-
|
|
30
26
|
var _react = _interopRequireDefault(require("react"));
|
|
31
27
|
|
|
32
28
|
var _styles = require("@material-ui/core/styles");
|
|
@@ -61,7 +57,8 @@ function (_React$Component) {
|
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(HiSelectMobile)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
64
|
-
|
|
60
|
+
|
|
61
|
+
_this.buildOptionList = function (itemList) {
|
|
65
62
|
var optionList = [];
|
|
66
63
|
|
|
67
64
|
if (itemList.length) {
|
|
@@ -97,8 +94,9 @@ function (_React$Component) {
|
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
return optionList;
|
|
100
|
-
}
|
|
101
|
-
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
_this.buildChildrenList = function (itemList) {
|
|
102
100
|
var group = itemList.shift();
|
|
103
101
|
return _react.default.createElement("optgroup", {
|
|
104
102
|
key: group.id,
|
|
@@ -110,8 +108,9 @@ function (_React$Component) {
|
|
|
110
108
|
value: item.id
|
|
111
109
|
}, item.label);
|
|
112
110
|
}));
|
|
113
|
-
}
|
|
114
|
-
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
_this.handleChange = function (event) {
|
|
115
114
|
if (!_this.props.multiple) {
|
|
116
115
|
var itemSelected = event.target[event.target.selectedIndex];
|
|
117
116
|
|
|
@@ -127,7 +126,8 @@ function (_React$Component) {
|
|
|
127
126
|
|
|
128
127
|
_this.props.onChange(event, optionsSelected);
|
|
129
128
|
}
|
|
130
|
-
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
131
|
return _this;
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -158,9 +158,9 @@ function (_React$Component) {
|
|
|
158
158
|
return HiSelectMobile;
|
|
159
159
|
}(_react.default.Component);
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
HiSelectMobile.defaultProps = {
|
|
162
162
|
itemList: []
|
|
163
|
-
}
|
|
163
|
+
};
|
|
164
164
|
|
|
165
165
|
var _default = (0, _styles.withStyles)(styles)(HiSelectMobile);
|
|
166
166
|
|