@hipay/hipay-material-ui 2.0.0-beta.68 → 2.0.0-beta.69

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,79 @@
1
+ # [2.0.0-beta.64](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.64) (2019-04-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **eslint:** remove eslint warrnings in components (ignore test files) ([d236c62](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d236c62))
7
+ * **HiAlertModal:** Correct styles and buttons positions ([2cfa2a9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2cfa2a9))
8
+ * **HiBreadcrumb:** clean eslint warnings ([6db12fb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6db12fb))
9
+ * **HiDatePicker:** add static positions for custom overlays ([c3edf24](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c3edf24))
10
+ * **HiDynamicSelect:** remove onSelect override ([b803044](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b803044))
11
+ * **HiExpansionPanel:** fix props propagation collapseDisable || expanded ([eb18a96](https://gitlab.hipay.org/backend/hipay-material-ui/commit/eb18a96))
12
+ * **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
13
+ * **HiInput:** forward event in onClick ([be94fe0](https://gitlab.hipay.org/backend/hipay-material-ui/commit/be94fe0))
14
+ * **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
15
+ * **HiInput:** rename prop to spellCheck ([c11939f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c11939f))
16
+ * **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
17
+ * **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
18
+ * **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
19
+ * **HiSelect:** Forward event in onBlur ([76c6778](https://gitlab.hipay.org/backend/hipay-material-ui/commit/76c6778))
20
+ * **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
21
+ * **HiSelect:** remove HiSelectNew calls ([cc5397d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cc5397d))
22
+ * **HiSelectableList:** Add lazy props to activate lazyloading (default true) and fix unit tests ([b41f8d2](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b41f8d2))
23
+ * **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
24
+ * **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
25
+ * **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
26
+ * **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
27
+ * **HiTable:** Fix test ([9a009a8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a009a8))
28
+ * **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
29
+ * **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
30
+ * **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
31
+
32
+
33
+ ### Code Refactoring
34
+
35
+ * deleting the old HiSelect and replacing it by the new (PSYCHE-1382) ([d5fc252](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d5fc252))
36
+
37
+
38
+ ### Features
39
+
40
+ * **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
41
+ * **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
42
+ * **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
43
+ * **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
44
+ * **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
45
+ * **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
46
+ * **HiDatePicke:** add timezone props ([18360a5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/18360a5))
47
+ * **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
48
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
49
+ * **HiInput:** Add inputProps to enable passing props directly to input element ([d57466c](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d57466c))
50
+ * **HiInput:** add spellcheck property ([b2feac3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b2feac3))
51
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
52
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
53
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
54
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
55
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
56
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
57
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
58
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
59
+
60
+
61
+ ### Performance Improvements
62
+
63
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
64
+
65
+
66
+ ### BREAKING CHANGES
67
+
68
+ * HiSelectNew no longer exist, make sure you're importing HiSelect instead
69
+ * **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
70
+ * **HiUploadField:** Components names changes
71
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
72
+ CellImage & CellText)
73
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
74
+
75
+
76
+
1
77
  # [2.0.0-beta.64](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.64) (2019-03-27)
2
78
 
3
79
 
@@ -33,7 +33,7 @@ var _ExpansionPanelSummary = _interopRequireDefault(require("@material-ui/core/E
33
33
 
34
34
  var _ExpansionPanelDetails = _interopRequireDefault(require("@material-ui/core/ExpansionPanelDetails"));
35
35
 
36
- var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
36
+ var _HiIcon = _interopRequireDefault(require("./../HiIcon"));
37
37
 
38
38
  var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
39
39
 
@@ -64,20 +64,28 @@ var styles = function styles(theme) {
64
64
  pointerEvents: 'none'
65
65
  },
66
66
  heading: (0, _extends2.default)({}, theme.typography.b1, {
67
+ height: 48,
68
+ display: 'flex',
69
+ alignItems: 'center',
67
70
  fontSize: 20,
68
71
  lineHeight: '24px',
69
72
  fontWeight: theme.typography.fontWeightLight
70
73
  }),
71
74
  secondaryHeading: (0, _extends2.default)({}, theme.typography.b3, {
72
75
  color: theme.palette.neutral.light,
76
+ height: 48,
77
+ display: 'flex',
78
+ alignItems: 'center',
73
79
  fontSize: 11,
74
80
  lineHeight: '24px',
75
81
  float: 'right',
76
82
  marginRight: 32,
77
83
  '&>svg': {
78
84
  fontSize: 18,
79
- marginLeft: 3,
80
- marginBottom: -5
85
+ marginLeft: 3
86
+ },
87
+ "&>button": {
88
+ marginRight: -12
81
89
  }
82
90
  }),
83
91
  panel: {
@@ -101,7 +109,10 @@ var styles = function styles(theme) {
101
109
 
102
110
  exports.styles = styles;
103
111
 
104
- var _ref = _react.default.createElement(_ExpandMore.default, null);
112
+ var _ref = _react.default.createElement(_HiIcon.default, {
113
+ icon: "mdi_menu_up",
114
+ size: 24
115
+ });
105
116
 
106
117
  var HiExpansionPanel =
107
118
  /*#__PURE__*/
package/HiForm/HiInput.js CHANGED
@@ -341,7 +341,8 @@ function (_React$PureComponent) {
341
341
  inputClassName = _this$props.inputClassName,
342
342
  onReset = _this$props.onReset,
343
343
  spellcheck = _this$props.spellcheck,
344
- startAdornmentColor = _this$props.startAdornmentColor;
344
+ startAdornmentColor = _this$props.startAdornmentColor,
345
+ inputProps = _this$props.inputProps;
345
346
  var focused = this.state.focused;
346
347
  var overlayProps = (0, _extends2.default)({
347
348
  className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.disabled, disabled && !error), (0, _defineProperty2.default)(_classNames, classes.inkbar, !disabled), (0, _defineProperty2.default)(_classNames, classes.focused, focused), (0, _defineProperty2.default)(_classNames, classes.error, error), _classNames), className)
@@ -420,10 +421,10 @@ function (_React$PureComponent) {
420
421
  _this2.endAdornmentNode = el;
421
422
  }
422
423
  }, eraseIcon, endAdornment),
423
- inputProps: {
424
+ inputProps: (0, _extends2.default)({
424
425
  spellCheck: spellcheck ? "true" : "false",
425
426
  className: (0, _classnames.default)(inputClassName, classes.inputPropsClassName, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, classes.inputText, !multiline), (0, _defineProperty2.default)(_classNames4, classes.inputTextArea, multiline), _classNames4))
426
- }
427
+ }, inputProps)
427
428
  }));
428
429
  }
429
430
  }], [{
@@ -509,6 +510,11 @@ HiInput.propTypes = process.env.NODE_ENV !== "production" ? {
509
510
  */
510
511
  inputId: _propTypes.default.string,
511
512
 
513
+ /**
514
+ * Passe des props directement à l'input
515
+ */
516
+ inputProps: _propTypes.default.object,
517
+
512
518
  /**
513
519
  * Passe une ref callback au composant input
514
520
  */
@@ -510,11 +510,28 @@ function (_React$PureComponent) {
510
510
  this.inputEl.focus();
511
511
  }
512
512
  }
513
+ }, {
514
+ key: "getLengthItemList",
515
+ value: function getLengthItemList(itemList) {
516
+ var _this2 = this;
517
+
518
+ var itemListLength = 0;
519
+ itemList.forEach(function (parent) {
520
+ if (parent.displayed && itemListLength < 10) {
521
+ itemListLength += 1;
522
+
523
+ if (parent.children && itemListLength < 10) {
524
+ itemListLength += _this2.getLengthItemList(parent.children);
525
+ }
526
+ }
527
+ });
528
+ return itemListLength;
529
+ }
513
530
  }, {
514
531
  key: "render",
515
532
  value: function render() {
516
533
  var _classNames,
517
- _this2 = this;
534
+ _this3 = this;
518
535
 
519
536
  var _this$props4 = this.props,
520
537
  classes = _this$props4.classes,
@@ -581,10 +598,10 @@ function (_React$PureComponent) {
581
598
  return _react.default.createElement(_HiInput.default, (0, _extends2.default)({
582
599
  value: searchValue,
583
600
  autoFocus: true,
584
- inputRef: _this2.getInputElement,
585
- onKeyDown: _this2.handleKeyDownSearch,
586
- onChange: _this2.handleSearch,
587
- onReset: _this2.handleSearchReset,
601
+ inputRef: _this3.getInputElement,
602
+ onKeyDown: _this3.handleKeyDownSearch,
603
+ onChange: _this3.handleSearch,
604
+ onReset: _this3.handleSearchReset,
588
605
  placeholder: translations.search,
589
606
  startAdornment: 'search',
590
607
  tabIndex: 0,
@@ -597,8 +614,10 @@ function (_React$PureComponent) {
597
614
 
598
615
 
599
616
  if (this.placement && this.placement.indexOf('top') >= 0 && !!searchable) {
600
- // +1 for search input
601
- var nbItems = itemList.length <= 10 ? itemList.length + 1 : 11;
617
+ // In case we have a nested list
618
+ var itemListLength = this.getLengthItemList(itemList); // +1 for search input
619
+
620
+ var nbItems = itemListLength <= 10 ? itemListLength + 1 : 11;
602
621
  popperStyle.transform = "translate3d(-1px, -".concat(nbItems * 40 + 2, "px, 0px)");
603
622
  } else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
604
623
  popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
@@ -607,12 +626,12 @@ function (_React$PureComponent) {
607
626
  var content = function content(_ref) {
608
627
  var placement = _ref.placement;
609
628
 
610
- if (placement !== _this2.placement) {
611
- _this2.placement = placement;
629
+ if (placement !== _this3.placement) {
630
+ _this3.placement = placement;
612
631
  }
613
632
 
614
633
  return _react.default.createElement(_ClickAwayListener.default, {
615
- onClickAway: _this2.handleClickAway
634
+ onClickAway: _this3.handleClickAway
616
635
  }, _react.default.createElement(_Grow.default, {
617
636
  in: open,
618
637
  id: "menu-list",
@@ -621,29 +640,29 @@ function (_React$PureComponent) {
621
640
  }
622
641
  }, _react.default.createElement(_Paper.default, {
623
642
  className: classes.paper
624
- }, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, _react.default.createElement(_reactCustomScrollbars.default, (0, _extends2.default)({
643
+ }, (_this3.placement && _this3.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, _react.default.createElement(_reactCustomScrollbars.default, (0, _extends2.default)({
625
644
  ref: function ref(contentEl) {
626
- _this2.optionsContent = contentEl;
645
+ _this3.optionsContent = contentEl;
627
646
  },
628
647
  autoHeight: true,
629
648
  autoHeightMax: 430
630
649
  }, onScrollReachBottom && {
631
- onScroll: _this2.handleScroll
650
+ onScroll: _this3.handleScroll
632
651
  }), _react.default.createElement(_HiSelectableList.default, (0, _extends2.default)({
633
652
  type: type,
634
653
  itemList: itemList,
635
- onSelect: _this2.handleSelect,
654
+ onSelect: _this3.handleSelect,
636
655
  selectedItemIdList: selectedItemIdList,
637
- fallbackImage: _this2.props.fallbackImage,
638
- overlay: _this2.overlay,
656
+ fallbackImage: _this3.props.fallbackImage,
657
+ overlay: _this3.overlay,
639
658
  value: value
640
- }, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
659
+ }, hiSelectableListProps))), _this3.placement && _this3.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
641
660
  };
642
661
 
643
662
  return _react.default.createElement("div", {
644
663
  className: classes.root,
645
664
  ref: function ref(el) {
646
- _this2.overlay = el;
665
+ _this3.overlay = el;
647
666
  },
648
667
  onKeyDown: this.handleKeyDown,
649
668
  onKeyDownCapture: this.handleKeyDownCapture
@@ -666,7 +685,7 @@ function (_React$PureComponent) {
666
685
  placeholder: placeholder
667
686
  }, hiSelectInputProps, {
668
687
  refElement: function refElement(el) {
669
- _this2.inputEl = el;
688
+ _this3.inputEl = el;
670
689
  }
671
690
  })), open && staticPosition ? _react.default.createElement("div", {
672
691
  style: popperStyle,
@@ -163,9 +163,9 @@ function (_React$PureComponent) {
163
163
  overflow: true,
164
164
  placeholder: placeholderContent
165
165
  }, itemComponent);
166
- } else {
167
- return itemComponent;
168
166
  }
167
+
168
+ return itemComponent;
169
169
  };
170
170
 
171
171
  _this.compareItem = function (a, b) {
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
7
7
  import ExpansionPanel from '@material-ui/core/ExpansionPanel';
8
8
  import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
9
9
  import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';
10
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
10
+ import HiIcon from './../HiIcon';
11
11
  import withStyles from '../styles/withStyles';
12
12
  import classNames from 'classnames';
13
13
  export const styles = theme => ({
@@ -33,20 +33,28 @@ export const styles = theme => ({
33
33
  pointerEvents: 'none'
34
34
  },
35
35
  heading: _objectSpread({}, theme.typography.b1, {
36
+ height: 48,
37
+ display: 'flex',
38
+ alignItems: 'center',
36
39
  fontSize: 20,
37
40
  lineHeight: '24px',
38
41
  fontWeight: theme.typography.fontWeightLight
39
42
  }),
40
43
  secondaryHeading: _objectSpread({}, theme.typography.b3, {
41
44
  color: theme.palette.neutral.light,
45
+ height: 48,
46
+ display: 'flex',
47
+ alignItems: 'center',
42
48
  fontSize: 11,
43
49
  lineHeight: '24px',
44
50
  float: 'right',
45
51
  marginRight: 32,
46
52
  '&>svg': {
47
53
  fontSize: 18,
48
- marginLeft: 3,
49
- marginBottom: -5
54
+ marginLeft: 3
55
+ },
56
+ "&>button": {
57
+ marginRight: -12
50
58
  }
51
59
  }),
52
60
  panel: {
@@ -67,7 +75,10 @@ export const styles = theme => ({
67
75
  }
68
76
  });
69
77
 
70
- var _ref = React.createElement(ExpandMoreIcon, null);
78
+ var _ref = React.createElement(HiIcon, {
79
+ icon: "mdi_menu_up",
80
+ size: 24
81
+ });
71
82
 
72
83
  class HiExpansionPanel extends React.PureComponent {
73
84
  render() {
@@ -292,7 +292,8 @@ class HiInput extends React.PureComponent {
292
292
  inputClassName,
293
293
  onReset,
294
294
  spellcheck,
295
- startAdornmentColor
295
+ startAdornmentColor,
296
+ inputProps
296
297
  } = this.props;
297
298
  const {
298
299
  focused
@@ -385,13 +386,13 @@ class HiInput extends React.PureComponent {
385
386
  this.endAdornmentNode = el;
386
387
  }
387
388
  }, eraseIcon, endAdornment),
388
- inputProps: {
389
+ inputProps: _objectSpread({
389
390
  spellCheck: spellcheck ? "true" : "false",
390
391
  className: classNames(inputClassName, classes.inputPropsClassName, {
391
392
  [classes.inputText]: !multiline,
392
393
  [classes.inputTextArea]: multiline
393
394
  })
394
- }
395
+ }, inputProps)
395
396
  }));
396
397
  }
397
398
 
@@ -465,6 +466,11 @@ HiInput.propTypes = process.env.NODE_ENV !== "production" ? {
465
466
  */
466
467
  inputId: PropTypes.string,
467
468
 
469
+ /**
470
+ * Passe des props directement à l'input
471
+ */
472
+ inputProps: PropTypes.object,
473
+
468
474
  /**
469
475
  * Passe une ref callback au composant input
470
476
  */
@@ -432,6 +432,12 @@ class HiSelect extends React.PureComponent {
432
432
  this.getInputElement = this.getInputElement.bind(this);
433
433
  }
434
434
 
435
+ componentDidMount() {
436
+ if (this.props.autoFocus) {
437
+ this.inputEl.focus();
438
+ }
439
+ }
440
+
435
441
  static getDerivedStateFromProps(nextProps, prevState) {
436
442
  if (nextProps.options !== prevState.suggestions) {
437
443
  return _objectSpread({}, prevState, {
@@ -451,10 +457,18 @@ class HiSelect extends React.PureComponent {
451
457
  */
452
458
 
453
459
 
454
- componentDidMount() {
455
- if (this.props.autoFocus) {
456
- this.inputEl.focus();
457
- }
460
+ getLengthItemList(itemList) {
461
+ let itemListLength = 0;
462
+ itemList.forEach(parent => {
463
+ if (parent.displayed && itemListLength < 10) {
464
+ itemListLength += 1;
465
+
466
+ if (parent.children && itemListLength < 10) {
467
+ itemListLength += this.getLengthItemList(parent.children);
468
+ }
469
+ }
470
+ });
471
+ return itemListLength;
458
472
  }
459
473
 
460
474
  render() {
@@ -544,8 +558,10 @@ class HiSelect extends React.PureComponent {
544
558
 
545
559
 
546
560
  if (this.placement && this.placement.indexOf('top') >= 0 && !!searchable) {
547
- // +1 for search input
548
- const nbItems = itemList.length <= 10 ? itemList.length + 1 : 11;
561
+ // In case we have a nested list
562
+ const itemListLength = this.getLengthItemList(itemList); // +1 for search input
563
+
564
+ const nbItems = itemListLength <= 10 ? itemListLength + 1 : 11;
549
565
  popperStyle.transform = `translate3d(-1px, -${nbItems * 40 + 2}px, 0px)`;
550
566
  } else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
551
567
  popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
@@ -107,9 +107,9 @@ class HiSelectableList extends React.PureComponent {
107
107
  overflow: true,
108
108
  placeholder: placeholderContent
109
109
  }, itemComponent);
110
- } else {
111
- return itemComponent;
112
110
  }
111
+
112
+ return itemComponent;
113
113
  };
114
114
 
115
115
  this.compareItem = (a, b) => {
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.68
1
+ /** @license HiPay-Material-UI v2.0.0-beta.69
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.68
1
+ /** @license HiPay-Material-UI v2.0.0-beta.69
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
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": "2.0.0-beta.68",
5
+ "version": "2.0.0-beta.69",
6
6
  "description": "React components that implement Google's Material Design.",
7
7
  "keywords": [
8
8
  "react",
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.68
1
+ /** @license HiPay-Material-UI v2.0.0-beta.69
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -72923,7 +72923,8 @@
72923
72923
  inputClassName = _this$props.inputClassName,
72924
72924
  onReset = _this$props.onReset,
72925
72925
  spellcheck = _this$props.spellcheck,
72926
- startAdornmentColor = _this$props.startAdornmentColor;
72926
+ startAdornmentColor = _this$props.startAdornmentColor,
72927
+ inputProps = _this$props.inputProps;
72927
72928
  var focused = this.state.focused;
72928
72929
 
72929
72930
  var overlayProps = _extends_1({
@@ -73003,10 +73004,10 @@
73003
73004
  _this2.endAdornmentNode = el;
73004
73005
  }
73005
73006
  }, eraseIcon, endAdornment),
73006
- inputProps: {
73007
+ inputProps: _extends_1({
73007
73008
  spellCheck: spellcheck ? "true" : "false",
73008
73009
  className: classnames(inputClassName, classes.inputPropsClassName, (_classNames4 = {}, defineProperty(_classNames4, classes.inputText, !multiline), defineProperty(_classNames4, classes.inputTextArea, multiline), _classNames4))
73009
- }
73010
+ }, inputProps)
73010
73011
  }));
73011
73012
  }
73012
73013
  }], [{
@@ -73093,6 +73094,11 @@
73093
73094
  */
73094
73095
  inputId: propTypes.string,
73095
73096
 
73097
+ /**
73098
+ * Passe des props directement à l'input
73099
+ */
73100
+ inputProps: propTypes.object,
73101
+
73096
73102
  /**
73097
73103
  * Passe une ref callback au composant input
73098
73104
  */
@@ -80183,9 +80189,9 @@
80183
80189
  overflow: true,
80184
80190
  placeholder: placeholderContent
80185
80191
  }, itemComponent);
80186
- } else {
80187
- return itemComponent;
80188
80192
  }
80193
+
80194
+ return itemComponent;
80189
80195
  };
80190
80196
 
80191
80197
  _this.compareItem = function (a, b) {
@@ -108961,11 +108967,28 @@
108961
108967
  this.inputEl.focus();
108962
108968
  }
108963
108969
  }
108970
+ }, {
108971
+ key: "getLengthItemList",
108972
+ value: function getLengthItemList(itemList) {
108973
+ var _this2 = this;
108974
+
108975
+ var itemListLength = 0;
108976
+ itemList.forEach(function (parent) {
108977
+ if (parent.displayed && itemListLength < 10) {
108978
+ itemListLength += 1;
108979
+
108980
+ if (parent.children && itemListLength < 10) {
108981
+ itemListLength += _this2.getLengthItemList(parent.children);
108982
+ }
108983
+ }
108984
+ });
108985
+ return itemListLength;
108986
+ }
108964
108987
  }, {
108965
108988
  key: "render",
108966
108989
  value: function render() {
108967
108990
  var _classNames,
108968
- _this2 = this;
108991
+ _this3 = this;
108969
108992
 
108970
108993
  var _this$props4 = this.props,
108971
108994
  classes = _this$props4.classes,
@@ -109032,10 +109055,10 @@
109032
109055
  return React.createElement(HiInput$1, _extends_1({
109033
109056
  value: searchValue,
109034
109057
  autoFocus: true,
109035
- inputRef: _this2.getInputElement,
109036
- onKeyDown: _this2.handleKeyDownSearch,
109037
- onChange: _this2.handleSearch,
109038
- onReset: _this2.handleSearchReset,
109058
+ inputRef: _this3.getInputElement,
109059
+ onKeyDown: _this3.handleKeyDownSearch,
109060
+ onChange: _this3.handleSearch,
109061
+ onReset: _this3.handleSearchReset,
109039
109062
  placeholder: translations.search,
109040
109063
  startAdornment: 'search',
109041
109064
  tabIndex: 0,
@@ -109048,8 +109071,10 @@
109048
109071
 
109049
109072
 
109050
109073
  if (this.placement && this.placement.indexOf('top') >= 0 && !!searchable) {
109051
- // +1 for search input
109052
- var nbItems = itemList.length <= 10 ? itemList.length + 1 : 11;
109074
+ // In case we have a nested list
109075
+ var itemListLength = this.getLengthItemList(itemList); // +1 for search input
109076
+
109077
+ var nbItems = itemListLength <= 10 ? itemListLength + 1 : 11;
109053
109078
  popperStyle.transform = "translate3d(-1px, -".concat(nbItems * 40 + 2, "px, 0px)");
109054
109079
  } else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
109055
109080
  popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
@@ -109058,12 +109083,12 @@
109058
109083
  var content = function content(_ref) {
109059
109084
  var placement = _ref.placement;
109060
109085
 
109061
- if (placement !== _this2.placement) {
109062
- _this2.placement = placement;
109086
+ if (placement !== _this3.placement) {
109087
+ _this3.placement = placement;
109063
109088
  }
109064
109089
 
109065
109090
  return React.createElement(ClickAwayListener$2, {
109066
- onClickAway: _this2.handleClickAway
109091
+ onClickAway: _this3.handleClickAway
109067
109092
  }, React.createElement(Grow$2, {
109068
109093
  in: open,
109069
109094
  id: "menu-list",
@@ -109072,29 +109097,29 @@
109072
109097
  }
109073
109098
  }, React.createElement(Paper$2, {
109074
109099
  className: classes.paper
109075
- }, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, React.createElement(Scrollbars, _extends_1({
109100
+ }, (_this3.placement && _this3.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, React.createElement(Scrollbars, _extends_1({
109076
109101
  ref: function ref(contentEl) {
109077
- _this2.optionsContent = contentEl;
109102
+ _this3.optionsContent = contentEl;
109078
109103
  },
109079
109104
  autoHeight: true,
109080
109105
  autoHeightMax: 430
109081
109106
  }, onScrollReachBottom && {
109082
- onScroll: _this2.handleScroll
109107
+ onScroll: _this3.handleScroll
109083
109108
  }), React.createElement(HiSelectableList$1, _extends_1({
109084
109109
  type: type,
109085
109110
  itemList: itemList,
109086
- onSelect: _this2.handleSelect,
109111
+ onSelect: _this3.handleSelect,
109087
109112
  selectedItemIdList: selectedItemIdList,
109088
- fallbackImage: _this2.props.fallbackImage,
109089
- overlay: _this2.overlay,
109113
+ fallbackImage: _this3.props.fallbackImage,
109114
+ overlay: _this3.overlay,
109090
109115
  value: value
109091
- }, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
109116
+ }, hiSelectableListProps))), _this3.placement && _this3.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
109092
109117
  };
109093
109118
 
109094
109119
  return React.createElement("div", {
109095
109120
  className: classes.root,
109096
109121
  ref: function ref(el) {
109097
- _this2.overlay = el;
109122
+ _this3.overlay = el;
109098
109123
  },
109099
109124
  onKeyDown: this.handleKeyDown,
109100
109125
  onKeyDownCapture: this.handleKeyDownCapture
@@ -109117,7 +109142,7 @@
109117
109142
  placeholder: placeholder
109118
109143
  }, hiSelectInputProps, {
109119
109144
  refElement: function refElement(el) {
109120
- _this2.inputEl = el;
109145
+ _this3.inputEl = el;
109121
109146
  }
109122
109147
  })), open && staticPosition ? React.createElement("div", {
109123
109148
  style: popperStyle,