@hipay/hipay-material-ui 2.1.0-RC1 → 2.1.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,157 @@
1
+ # [2.1.0](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.1.0) (2019-08-29)
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
+ * **HiAlertModal:** Title is not required anymore and will not create warning ([4019d33](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4019d33))
9
+ * **HiBreadcrumb:** clean eslint warnings ([6db12fb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6db12fb))
10
+ * **HiDatePicker:** add static positions for custom overlays ([c3edf24](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c3edf24))
11
+ * **HiDynamicSelect:** remove onSelect override ([b803044](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b803044))
12
+ * **HiExpansionPanel:** fix props propagation collapseDisable || expanded ([eb18a96](https://gitlab.hipay.org/backend/hipay-material-ui/commit/eb18a96))
13
+ * **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
14
+ * **HiInput:** forward event in onClick ([be94fe0](https://gitlab.hipay.org/backend/hipay-material-ui/commit/be94fe0))
15
+ * **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
16
+ * **HiInput:** rename prop to spellCheck ([c11939f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c11939f))
17
+ * **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
18
+ * **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
19
+ * **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
20
+ * **HiSelect:** Forward event in onBlur ([76c6778](https://gitlab.hipay.org/backend/hipay-material-ui/commit/76c6778))
21
+ * **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
22
+ * **HiSelect:** remove HiSelectNew calls ([cc5397d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cc5397d))
23
+ * **HiSelectableList:** Add lazy props to activate lazyloading (default true) and fix unit tests ([b41f8d2](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b41f8d2))
24
+ * **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
25
+ * **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
26
+ * **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
27
+ * **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
28
+ * **HiTable:** Fix test ([9a009a8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a009a8))
29
+ * **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
30
+ * **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
31
+ * **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
32
+
33
+
34
+ ### Code Refactoring
35
+
36
+ * deleting the old HiSelect and replacing it by the new (PSYCHE-1382) ([d5fc252](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d5fc252))
37
+
38
+
39
+ ### Features
40
+
41
+ * **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
42
+ * **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
43
+ * **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
44
+ * **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
45
+ * **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
46
+ * **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
47
+ * **HiDatePicke:** add timezone props ([18360a5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/18360a5))
48
+ * **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
49
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
50
+ * **HiInput:** Add inputProps to enable passing props directly to input element ([d57466c](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d57466c))
51
+ * **HiInput:** add spellcheck property ([b2feac3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b2feac3))
52
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
53
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
54
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
55
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
56
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
57
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
58
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
59
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
60
+
61
+
62
+ ### Performance Improvements
63
+
64
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
65
+
66
+
67
+ ### BREAKING CHANGES
68
+
69
+ * HiSelectNew no longer exist, make sure you're importing HiSelect instead
70
+ * **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
71
+ * **HiUploadField:** Components names changes
72
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
73
+ CellImage & CellText)
74
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
75
+
76
+
77
+
78
+ # [2.0.0-beta.76](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.76) (2019-07-18)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * **eslint:** remove eslint warrnings in components (ignore test files) ([d236c62](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d236c62))
84
+ * **HiAlertModal:** Correct styles and buttons positions ([2cfa2a9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2cfa2a9))
85
+ * **HiAlertModal:** Title is not required anymore and will not create warning ([4019d33](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4019d33))
86
+ * **HiBreadcrumb:** clean eslint warnings ([6db12fb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6db12fb))
87
+ * **HiDatePicker:** add static positions for custom overlays ([c3edf24](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c3edf24))
88
+ * **HiDynamicSelect:** remove onSelect override ([b803044](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b803044))
89
+ * **HiExpansionPanel:** fix props propagation collapseDisable || expanded ([eb18a96](https://gitlab.hipay.org/backend/hipay-material-ui/commit/eb18a96))
90
+ * **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
91
+ * **HiInput:** forward event in onClick ([be94fe0](https://gitlab.hipay.org/backend/hipay-material-ui/commit/be94fe0))
92
+ * **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
93
+ * **HiInput:** rename prop to spellCheck ([c11939f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c11939f))
94
+ * **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
95
+ * **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
96
+ * **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
97
+ * **HiSelect:** Forward event in onBlur ([76c6778](https://gitlab.hipay.org/backend/hipay-material-ui/commit/76c6778))
98
+ * **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
99
+ * **HiSelect:** remove HiSelectNew calls ([cc5397d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cc5397d))
100
+ * **HiSelectableList:** Add lazy props to activate lazyloading (default true) and fix unit tests ([b41f8d2](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b41f8d2))
101
+ * **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
102
+ * **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
103
+ * **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
104
+ * **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
105
+ * **HiTable:** Fix test ([9a009a8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a009a8))
106
+ * **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
107
+ * **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
108
+ * **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
109
+
110
+
111
+ ### Code Refactoring
112
+
113
+ * deleting the old HiSelect and replacing it by the new (PSYCHE-1382) ([d5fc252](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d5fc252))
114
+
115
+
116
+ ### Features
117
+
118
+ * **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
119
+ * **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
120
+ * **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
121
+ * **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
122
+ * **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
123
+ * **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
124
+ * **HiDatePicke:** add timezone props ([18360a5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/18360a5))
125
+ * **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
126
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
127
+ * **HiInput:** Add inputProps to enable passing props directly to input element ([d57466c](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d57466c))
128
+ * **HiInput:** add spellcheck property ([b2feac3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b2feac3))
129
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
130
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
131
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
132
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
133
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
134
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
135
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
136
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
137
+
138
+
139
+ ### Performance Improvements
140
+
141
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
142
+
143
+
144
+ ### BREAKING CHANGES
145
+
146
+ * HiSelectNew no longer exist, make sure you're importing HiSelect instead
147
+ * **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
148
+ * **HiUploadField:** Components names changes
149
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
150
+ CellImage & CellText)
151
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
152
+
153
+
154
+
1
155
  # [2.0.0-beta.74](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.74) (2019-07-02)
2
156
 
3
157
 
@@ -59,10 +59,6 @@ var _stylesheet = _interopRequireDefault(require("./stylesheet"));
59
59
 
60
60
  var _reactDeviceDetect = require("react-device-detect");
61
61
 
62
- var _classnames = _interopRequireDefault(require("classnames"));
63
-
64
- var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
65
-
66
62
  var _HiDatePickerMobile = _interopRequireDefault(require("./HiDatePickerMobile"));
67
63
 
68
64
  var HiDatePicker =
@@ -43,11 +43,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
43
43
  var styles = function styles(theme) {
44
44
  return {
45
45
  summaryContent: {
46
- display: 'inline-block',
46
+ display: 'flex',
47
+ alignItems: 'baseline',
48
+ justifyContent: 'space-between',
47
49
  border: 'none',
48
50
  '&$expanded': {
49
51
  margin: 'initial'
50
- }
52
+ },
53
+ maxWidth: '100%'
51
54
  },
52
55
  summaryRoot: {
53
56
  borderBottom: '1px solid #E3E6E7',
@@ -77,17 +80,21 @@ var styles = function styles(theme) {
77
80
  display: 'flex',
78
81
  alignItems: 'center',
79
82
  fontSize: 11,
80
- lineHeight: '24px',
81
- float: 'right',
82
- marginRight: 32,
83
83
  '&>svg': {
84
84
  fontSize: 18,
85
85
  marginLeft: 3
86
86
  },
87
- "&>button": {
87
+ '&>button': {
88
88
  marginRight: -12
89
- }
89
+ },
90
+ marginLeft: 24,
91
+ overflow: 'hidden'
90
92
  }),
93
+ secondaryHeadingSpan: {
94
+ overflow: 'hidden',
95
+ whiteSpace: 'nowrap',
96
+ textOverflow: 'ellipsis'
97
+ },
91
98
  panel: {
92
99
  boxShadow: 'none',
93
100
  border: 'none'
@@ -156,10 +163,12 @@ function (_React$PureComponent) {
156
163
  className: (0, _classnames.default)((0, _defineProperty2.default)({}, classes.collapseDisable, collapseDisable)),
157
164
  expandIcon: !collapseDisable && _ref
158
165
  }, _react.default.createElement("div", {
159
- className: classes.secondaryHeading
160
- }, !effectiveDisabled ? secondaryHeading : secondaryHeadingDisabled, secondaryHeadingIcon), _react.default.createElement("div", {
161
166
  className: classes.heading
162
- }, heading)), !!children && _react.default.createElement(_ExpansionPanelDetails.default, {
167
+ }, heading), _react.default.createElement("div", {
168
+ className: classes.secondaryHeading
169
+ }, _react.default.createElement("span", {
170
+ className: classes.secondaryHeadingSpan
171
+ }, !effectiveDisabled ? secondaryHeading : secondaryHeadingDisabled), secondaryHeadingIcon)), !!children && _react.default.createElement(_ExpansionPanelDetails.default, {
163
172
  className: classes.panelDetails
164
173
  }, children));
165
174
  }
package/HiForm/index.js CHANGED
@@ -59,6 +59,18 @@ Object.defineProperty(exports, "HiTextField", {
59
59
  return _HiTextField.default;
60
60
  }
61
61
  });
62
+ Object.defineProperty(exports, "HiUpload", {
63
+ enumerable: true,
64
+ get: function get() {
65
+ return _HiUpload.default;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, "HiUploadField", {
69
+ enumerable: true,
70
+ get: function get() {
71
+ return _HiUploadField.default;
72
+ }
73
+ });
62
74
 
63
75
  var _HiAddressField = _interopRequireDefault(require("./HiAddressField"));
64
76
 
@@ -76,4 +88,8 @@ var _HiSearchField = _interopRequireDefault(require("./HiSearchField"));
76
88
 
77
89
  var _HiSlider = _interopRequireDefault(require("./HiSlider"));
78
90
 
79
- var _HiTextField = _interopRequireDefault(require("./HiTextField"));
91
+ var _HiTextField = _interopRequireDefault(require("./HiTextField"));
92
+
93
+ var _HiUpload = _interopRequireDefault(require("./HiUpload"));
94
+
95
+ var _HiUploadField = _interopRequireDefault(require("./HiUploadField"));
package/HiNotice/HiKPI.js CHANGED
@@ -45,7 +45,8 @@ var styles = function styles(theme) {
45
45
  textAlign: 'center',
46
46
  flexDirection: 'column',
47
47
  alignItems: 'center',
48
- fontFamily: theme.typography.fontFamily
48
+ fontFamily: theme.typography.fontFamily,
49
+ transition: 'height .5s ease-out'
49
50
  },
50
51
  rootDisable: {
51
52
  cursor: 'default'
@@ -153,11 +154,7 @@ function (_React$Component) {
153
154
  tooltip = _this$props.tooltip,
154
155
  disable = _this$props.disable;
155
156
  var rootclass = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.inherit, color === 'inherit' && !disable), (0, _defineProperty2.default)(_classNames, classes.warning, color === 'warning' && !disable), (0, _defineProperty2.default)(_classNames, classes.error, color === 'error' && !disable), (0, _defineProperty2.default)(_classNames, classes.positive, color === 'positive' && !disable), (0, _defineProperty2.default)(_classNames, classes.active, active), (0, _defineProperty2.default)(_classNames, classes.minify, minify), (0, _defineProperty2.default)(_classNames, classes.rootDisable, disable), _classNames));
156
- return _react.default.createElement(_Collapse.default, {
157
- in: !minify,
158
- timeout: "auto",
159
- collapsedHeight: "88px"
160
- }, _react.default.createElement(_ButtonBase.default, {
157
+ return _react.default.createElement(_ButtonBase.default, {
161
158
  className: rootclass,
162
159
  onClick: !disable ? this.handleClick(id) : undefined,
163
160
  title: tooltip,
@@ -166,7 +163,10 @@ function (_React$Component) {
166
163
  className: classes.title
167
164
  }, title), _react.default.createElement("div", {
168
165
  className: classes.body
169
- }, minify && bodyMinify ? bodyMinify : body), subtitle && minify === false && _react.default.createElement("div", {
166
+ }, minify && bodyMinify ? bodyMinify : body), _react.default.createElement(_Collapse.default, {
167
+ in: !minify,
168
+ timeout: 'auto'
169
+ }, _react.default.createElement("div", {
170
170
  className: classes.subtitle
171
171
  }, subtitle)));
172
172
  }
@@ -19,8 +19,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
19
19
 
20
20
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
21
 
22
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
23
-
24
22
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
25
23
 
26
24
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -210,6 +208,7 @@ function (_React$PureComponent) {
210
208
  className: classes.selectIconLabel
211
209
  }, _react.default.createElement(_HiIcon.default, {
212
210
  className: classes.labelIcon,
211
+ color: item.color,
213
212
  icon: item.icon
214
213
  }), item.label);
215
214
  } else if (type === 'image' || item.type === 'image') {
@@ -512,6 +511,20 @@ function (_React$PureComponent) {
512
511
  }, '');
513
512
  };
514
513
 
514
+ _this.getLengthItemList = function (itemList) {
515
+ var itemListLength = 0;
516
+ itemList.forEach(function (parent) {
517
+ if (parent.displayed !== false) {
518
+ itemListLength += 1;
519
+
520
+ if (parent.children) {
521
+ itemListLength += _this.getLengthItemList(parent.children);
522
+ }
523
+ }
524
+ });
525
+ return itemListLength;
526
+ };
527
+
515
528
  _this.state = {
516
529
  alertOpen: false,
517
530
  open: false,
@@ -521,16 +534,6 @@ function (_React$PureComponent) {
521
534
  openDown: true,
522
535
  overlayWidth: 0
523
536
  };
524
- _this.handleBlur = _this.handleBlur.bind((0, _assertThisInitialized2.default)(_this));
525
- _this.handleClick = _this.handleClick.bind((0, _assertThisInitialized2.default)(_this));
526
- _this.handleClose = _this.handleClose.bind((0, _assertThisInitialized2.default)(_this));
527
- _this.handleClickAway = _this.handleClickAway.bind((0, _assertThisInitialized2.default)(_this));
528
- _this.handleFocus = _this.handleFocus.bind((0, _assertThisInitialized2.default)(_this));
529
- _this.handleSearch = _this.handleSearch.bind((0, _assertThisInitialized2.default)(_this));
530
- _this.handleSearchReset = _this.handleSearchReset.bind((0, _assertThisInitialized2.default)(_this));
531
- _this.handleSelect = _this.handleSelect.bind((0, _assertThisInitialized2.default)(_this));
532
- _this.handleSuggestions = _this.handleSuggestions.bind((0, _assertThisInitialized2.default)(_this));
533
- _this.getInputElement = _this.getInputElement.bind((0, _assertThisInitialized2.default)(_this));
534
537
  return _this;
535
538
  }
536
539
 
@@ -547,28 +550,11 @@ function (_React$PureComponent) {
547
550
  });
548
551
  }
549
552
  }
550
- }, {
551
- key: "getLengthItemList",
552
- value: function getLengthItemList(itemList) {
553
- var _this2 = this;
554
-
555
- var itemListLength = 0;
556
- itemList.forEach(function (parent) {
557
- if (parent.displayed !== false) {
558
- itemListLength += 1;
559
-
560
- if (parent.children) {
561
- itemListLength += _this2.getLengthItemList(parent.children);
562
- }
563
- }
564
- });
565
- return itemListLength;
566
- }
567
553
  }, {
568
554
  key: "render",
569
555
  value: function render() {
570
556
  var _classNames,
571
- _this3 = this;
557
+ _this2 = this;
572
558
 
573
559
  var _this$props4 = this.props,
574
560
  alert = _this$props4.alert,
@@ -594,6 +580,7 @@ function (_React$PureComponent) {
594
580
  searchValue = _this$props4$searchVa === void 0 ? this.state.searchValue : _this$props4$searchVa,
595
581
  startAdornment = _this$props4.startAdornment,
596
582
  staticPosition = _this$props4.staticPosition,
583
+ maxOptionsDisplayed = _this$props4.maxOptionsDisplayed,
597
584
  _this$props4$buildSel = _this$props4.buildSelectProps,
598
585
  buildSelectProps = _this$props4$buildSel === void 0 ? this.buildSelectProps : _this$props4$buildSel;
599
586
  var _this$state = this.state,
@@ -637,10 +624,10 @@ function (_React$PureComponent) {
637
624
  return _react.default.createElement(_HiInput.default, (0, _extends2.default)({
638
625
  value: searchValue,
639
626
  autoFocus: true,
640
- inputRef: _this3.getInputElement,
641
- onKeyDown: _this3.handleKeyDownSearch,
642
- onChange: _this3.handleSearch,
643
- onReset: _this3.handleSearchReset,
627
+ inputRef: _this2.getInputElement,
628
+ onKeyDown: _this2.handleKeyDownSearch,
629
+ onChange: _this2.handleSearch,
630
+ onReset: _this2.handleSearchReset,
644
631
  placeholder: translations.search,
645
632
  startAdornment: 'search',
646
633
  tabIndex: 0,
@@ -656,7 +643,7 @@ function (_React$PureComponent) {
656
643
  // In case we have a nested list
657
644
  var itemListLength = this.getLengthItemList(itemList); // +1 for search input
658
645
 
659
- var nbItems = itemListLength <= 10 ? itemListLength + 1 : 11;
646
+ var nbItems = itemListLength <= maxOptionsDisplayed - 2 ? itemListLength + 1 : maxOptionsDisplayed - 1;
660
647
  popperStyle.transform = "translate3d(-1px, -".concat(nbItems * 40 + 2, "px, 0px)");
661
648
  } else if (this.placement && this.placement.indexOf('top') < 0 && !!searchable) {
662
649
  popperStyle.transform = 'translate3d(-1px, 40px, 0px)';
@@ -665,12 +652,14 @@ function (_React$PureComponent) {
665
652
  var content = function content(_ref) {
666
653
  var placement = _ref.placement;
667
654
 
668
- if (placement !== _this3.placement) {
669
- _this3.placement = placement;
655
+ if (placement !== _this2.placement) {
656
+ _this2.placement = placement;
670
657
  }
671
658
 
659
+ var nbItemsDisplayed = !!searchable ? maxOptionsDisplayed - 1 : maxOptionsDisplayed;
660
+ var autoHeightMax = nbItemsDisplayed * 40 - 10;
672
661
  return _react.default.createElement(_ClickAwayListener.default, {
673
- onClickAway: _this3.handleClickAway
662
+ onClickAway: _this2.handleClickAway
674
663
  }, _react.default.createElement(_Grow.default, {
675
664
  in: open,
676
665
  id: "menu-list",
@@ -678,30 +667,33 @@ function (_React$PureComponent) {
678
667
  transformOrigin: '0 0 0'
679
668
  }
680
669
  }, _react.default.createElement(_Paper.default, {
670
+ style: maxOptionsDisplayed < 12 ? {
671
+ maxHeight: 40 * maxOptionsDisplayed
672
+ } : {},
681
673
  className: classes.paper
682
- }, (_this3.placement && _this3.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, _react.default.createElement(_reactCustomScrollbars.default, (0, _extends2.default)({
674
+ }, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, _react.default.createElement(_reactCustomScrollbars.default, (0, _extends2.default)({
683
675
  ref: function ref(contentEl) {
684
- _this3.optionsContent = contentEl;
676
+ _this2.optionsContent = contentEl;
685
677
  },
686
678
  autoHeight: true,
687
- autoHeightMax: 430
679
+ autoHeightMax: autoHeightMax
688
680
  }, onScrollReachBottom && {
689
- onScroll: _this3.handleScroll
681
+ onScroll: _this2.handleScroll
690
682
  }), _react.default.createElement(_HiSelectableList.default, (0, _extends2.default)({
691
683
  type: type,
692
684
  itemList: itemList,
693
- onSelect: _this3.handleSelect,
685
+ onSelect: _this2.handleSelect,
694
686
  selectedItemIdList: selectedItemIdList,
695
- fallbackImage: _this3.props.fallbackImage,
696
- overlay: _this3.overlay,
687
+ fallbackImage: _this2.props.fallbackImage,
688
+ overlay: _this2.overlay,
697
689
  value: value
698
- }, hiSelectableListProps))), _this3.placement && _this3.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
690
+ }, hiSelectableListProps))), _this2.placement && _this2.placement.indexOf('top') >= 0 && !staticPosition && searchInput('top'))));
699
691
  };
700
692
 
701
693
  return !_reactDeviceDetect.isMobile ? _react.default.createElement("div", {
702
694
  className: classes.root,
703
695
  ref: function ref(el) {
704
- _this3.overlay = el;
696
+ _this2.overlay = el;
705
697
  },
706
698
  onKeyDown: this.handleKeyDown,
707
699
  onKeyDownCapture: this.handleKeyDownCapture
@@ -734,7 +726,7 @@ function (_React$PureComponent) {
734
726
  placeholder: placeholder
735
727
  }, hiSelectInputProps, {
736
728
  refElement: function refElement(el) {
737
- _this3.inputEl = el;
729
+ _this2.inputEl = el;
738
730
  }
739
731
  })), open && staticPosition ? _react.default.createElement("div", {
740
732
  style: popperStyle,
@@ -748,7 +740,7 @@ function (_React$PureComponent) {
748
740
  style: popperStyle
749
741
  }, content)) : _react.default.createElement("div", {
750
742
  ref: function ref(el) {
751
- _this3.overlay = el;
743
+ _this2.overlay = el;
752
744
  }
753
745
  }, _react.default.createElement(_HiSelectInput.default, (0, _extends2.default)({
754
746
  id: id,
@@ -767,7 +759,7 @@ function (_React$PureComponent) {
767
759
  placeholder: placeholder
768
760
  }, hiSelectInputProps, {
769
761
  refElement: function refElement(el) {
770
- _this3.inputEl = el;
762
+ _this2.inputEl = el;
771
763
  }
772
764
  })), _react.default.createElement(_HiSelectMobile.default, {
773
765
  onChange: this.handleSelect,
@@ -826,7 +818,8 @@ HiSelect.defaultProps = {
826
818
  one_child: '%s item'
827
819
  },
828
820
  type: 'text',
829
- filterFunc: filterValue
821
+ filterFunc: filterValue,
822
+ maxOptionsDisplayed: 12
830
823
  };
831
824
  HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
832
825
  /**
@@ -910,6 +903,11 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
910
903
  */
911
904
  loading: _propTypes.default.bool,
912
905
 
906
+ /**
907
+ * Nombre max d'items affichés
908
+ */
909
+ maxOptionsDisplayed: _propTypes.default.number,
910
+
913
911
  /**
914
912
  * Autorise la sélection de plusieurs valeurs
915
913
  */