@hipay/hipay-material-ui 2.0.0-beta.57 → 2.0.0-beta.59

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/HiAlertModal/HiAlertModal.js +56 -13
  3. package/HiColoredLabel/HiColoredLabel.js +16 -4
  4. package/HiForm/HiFormControl.js +2 -4
  5. package/HiForm/HiInput.js +29 -4
  6. package/HiForm/HiUploadField.js +2 -1
  7. package/HiSelect/HiSelect.js +6 -5
  8. package/HiSelect/HiSuggestSelect.js +5 -4
  9. package/HiSelect/SelectInput.js +1 -0
  10. package/HiSelectNew/HiNestedSelect.js +20 -6
  11. package/HiSelectNew/HiNestedSelectContent.js +20 -6
  12. package/HiSelectNew/HiSelect.js +104 -32
  13. package/HiSelectNew/HiSelectContent.js +16 -4
  14. package/HiSelectNew/HiSelectInput.js +10 -3
  15. package/HiSelectableList/HiSelectableList.js +2 -35
  16. package/HiSelectableList/HiSelectableListItem.js +6 -4
  17. package/es/HiAlertModal/HiAlertModal.js +55 -13
  18. package/es/HiColoredLabel/HiColoredLabel.js +21 -4
  19. package/es/HiForm/HiFormControl.js +2 -4
  20. package/es/HiForm/HiInput.js +29 -4
  21. package/es/HiForm/HiUploadField.js +2 -1
  22. package/es/HiSelect/HiSelect.js +6 -5
  23. package/es/HiSelect/HiSuggestSelect.js +5 -4
  24. package/es/HiSelect/SelectInput.js +1 -0
  25. package/es/HiSelectNew/HiNestedSelect.js +17 -7
  26. package/es/HiSelectNew/HiNestedSelectContent.js +16 -6
  27. package/es/HiSelectNew/HiSelect.js +106 -31
  28. package/es/HiSelectNew/HiSelectContent.js +11 -2
  29. package/es/HiSelectNew/HiSelectInput.js +10 -3
  30. package/es/HiSelectableList/HiSelectableList.js +3 -29
  31. package/es/HiSelectableList/HiSelectableListItem.js +6 -4
  32. package/index.es.js +1 -1
  33. package/index.js +1 -1
  34. package/package.json +1 -1
  35. package/umd/hipay-material-ui.development.js +15551 -16279
  36. package/umd/hipay-material-ui.production.min.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,120 @@
1
+ <a name="2.0.0-beta.59"></a>
2
+ # [2.0.0-beta.59](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.59) (2018-12-27)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **eslint:** remove eslint warrnings in components (ignore test files) ([d236c62](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d236c62))
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
+ * **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
11
+ * **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
12
+ * **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
13
+ * **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
14
+ * **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
15
+ * **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
16
+ * **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
17
+ * **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
18
+ * **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
19
+ * **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
20
+ * **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
21
+ * **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
22
+ * **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
23
+
24
+
25
+ ### Features
26
+
27
+ * **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
28
+ * **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
29
+ * **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
30
+ * **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
31
+ * **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
32
+ * **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
33
+ * **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
34
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
35
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
36
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
37
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
38
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
39
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
40
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
41
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
42
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
43
+
44
+
45
+ ### Performance Improvements
46
+
47
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
48
+
49
+
50
+ ### BREAKING CHANGES
51
+
52
+ * **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
53
+ * **HiUploadField:** Components names changes
54
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
55
+ CellImage & CellText)
56
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
57
+
58
+
59
+
60
+ # [2.0.0-beta.58](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.58) (2018-12-13)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **eslint:** remove eslint warrnings in components (ignore test files) ([d236c62](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d236c62))
66
+ * **HiBreadcrumb:** clean eslint warnings ([6db12fb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6db12fb))
67
+ * **HiDatePicker:** add static positions for custom overlays ([c3edf24](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c3edf24))
68
+ * **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
69
+ * **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
70
+ * **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
71
+ * **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
72
+ * **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
73
+ * **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
74
+ * **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
75
+ * **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
76
+ * **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
77
+ * **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
78
+ * **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
79
+ * **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
80
+ * **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
81
+
82
+
83
+ ### Features
84
+
85
+ * **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
86
+ * **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
87
+ * **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
88
+ * **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
89
+ * **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
90
+ * **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
91
+ * **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
92
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
93
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
94
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
95
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
96
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
97
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
98
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
99
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
100
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
101
+
102
+
103
+ ### Performance Improvements
104
+
105
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
106
+
107
+
108
+ ### BREAKING CHANGES
109
+
110
+ * **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
111
+ * **HiUploadField:** Components names changes
112
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
113
+ CellImage & CellText)
114
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
115
+
116
+
117
+
1
118
  <a name="2.0.0-beta.41"></a>
2
119
  # [2.0.0-beta.41](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.41) (2018-12-07)
3
120
 
@@ -41,20 +41,28 @@ var _styles = require("../styles");
41
41
 
42
42
  var _HiButton = _interopRequireDefault(require("../HiButton"));
43
43
 
44
+ var _HiIcon = _interopRequireDefault(require("../HiIcon"));
45
+
44
46
  // @inheritedComponent Dialog
45
47
  var styles = function styles(theme) {
46
48
  return {
47
49
  classContent: {
48
50
  fontSize: 14,
49
- lineHeight: '24px',
50
- color: '#484848'
51
+ lineHeight: '20px',
52
+ color: '#484848',
53
+ position: 'relative'
51
54
  },
52
- classPaper: {
53
- maxWidth: 300
55
+ classDialogPaper: {
56
+ minHeight: 280,
57
+ maxWidth: 280,
58
+ borderRadius: 2
54
59
  },
55
60
  classCancelButton: {
56
61
  float: 'right'
57
62
  },
63
+ classSubmitButton: {
64
+ margin: '0'
65
+ },
58
66
  classTitle: {
59
67
  fontSize: 20,
60
68
  fontFamily: theme.typography.fontFamily,
@@ -62,10 +70,20 @@ var styles = function styles(theme) {
62
70
  lineHeight: '24px'
63
71
  },
64
72
  classAction: {
65
- display: 'inline-block'
73
+ display: 'inline-block',
74
+ margin: '0',
75
+ padding: '0px 24px 24px 24px'
66
76
  },
67
77
  classDialogRoot: {
68
78
  backgroundColor: 'rgba(0, 0, 0, 0.28)'
79
+ },
80
+ classBackgroundIcon: {
81
+ position: 'absolute',
82
+ top: 'calc(50%)',
83
+ left: '50%',
84
+ transform: 'translate(-50%, -50%)',
85
+ color: theme.palette.background2,
86
+ flex: '1'
69
87
  }
70
88
  };
71
89
  };
@@ -117,6 +135,8 @@ function (_React$PureComponent) {
117
135
  // Render
118
136
  value: function render() {
119
137
  var _this$props = this.props,
138
+ backgroundIcon = _this$props.backgroundIcon,
139
+ iconSize = _this$props.iconSize,
120
140
  classes = _this$props.classes,
121
141
  content = _this$props.content,
122
142
  labelCancelButton = _this$props.labelCancelButton,
@@ -124,17 +144,23 @@ function (_React$PureComponent) {
124
144
  onCancelClick = _this$props.onCancelClick,
125
145
  onSubmitClick = _this$props.onSubmitClick,
126
146
  open = _this$props.open,
147
+ cancelColor = _this$props.cancelColor,
127
148
  submitColor = _this$props.submitColor,
128
149
  title = _this$props.title,
129
- props = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "content", "labelCancelButton", "labelSubmitButton", "onCancelClick", "onSubmitClick", "open", "submitColor", "title"]);
150
+ props = (0, _objectWithoutProperties2.default)(_this$props, ["backgroundIcon", "iconSize", "classes", "content", "labelCancelButton", "labelSubmitButton", "onCancelClick", "onSubmitClick", "open", "cancelColor", "submitColor", "title"]);
130
151
  return _react.default.createElement(_Dialog.default, (0, _extends2.default)({
131
152
  open: open,
132
153
  onClose: this.handleOnClose,
133
154
  classes: {
134
- paper: classes.classPaper,
135
- root: classes.classDialogRoot
155
+ root: classes.classDialogRoot,
156
+ paper: classes.classDialogPaper
136
157
  }
137
- }, props), _react.default.createElement(_DialogTitle.default, {
158
+ }, props), backgroundIcon && _react.default.createElement("div", {
159
+ className: classes.classBackgroundIcon
160
+ }, _react.default.createElement(_HiIcon.default, {
161
+ icon: backgroundIcon,
162
+ size: iconSize
163
+ })), _react.default.createElement(_DialogTitle.default, {
138
164
  disableTypography: true,
139
165
  classes: {
140
166
  root: classes.classTitle
@@ -147,22 +173,39 @@ function (_React$PureComponent) {
147
173
  classes: {
148
174
  root: classes.classAction
149
175
  }
150
- }, _react.default.createElement(_HiButton.default, {
176
+ }, labelSubmitButton && _react.default.createElement(_HiButton.default, {
177
+ classes: {
178
+ root: classes.classSubmitButton
179
+ },
151
180
  onClick: this.handleClickSubmit,
152
181
  color: submitColor
153
- }, labelSubmitButton), _react.default.createElement(_HiButton.default, {
182
+ }, labelSubmitButton), labelCancelButton && _react.default.createElement(_HiButton.default, {
154
183
  classes: {
155
184
  root: classes.classCancelButton
156
185
  },
157
186
  onClick: this.handleClickCancel,
158
- color: "neutral"
187
+ color: cancelColor
159
188
  }, labelCancelButton)));
160
189
  }
161
190
  }]);
162
191
  return HiAlertModal;
163
192
  }(_react.default.PureComponent);
164
193
 
194
+ HiAlertModal.defaultProps = {
195
+ cancelColor: 'neutral',
196
+ submitColor: 'primary'
197
+ };
165
198
  HiAlertModal.propTypes = process.env.NODE_ENV !== "production" ? {
199
+ /**
200
+ * Icon à mettre en fond
201
+ */
202
+ backgroundIcon: _propTypes.default.string,
203
+
204
+ /**
205
+ * The color of the cancel button. It supports those theme colors that make sense for this component.
206
+ */
207
+ cancelColor: _propTypes.default.oneOf(['default', 'inherit', 'primary', 'secondary', 'positive', 'negative', 'middle', 'neutral']),
208
+
166
209
  /**
167
210
  * Surcharge les classes du composant
168
211
  */
@@ -171,7 +214,7 @@ HiAlertModal.propTypes = process.env.NODE_ENV !== "production" ? {
171
214
  /**
172
215
  * Texte contenu dans la modal
173
216
  */
174
- content: _propTypes.default.string,
217
+ content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.node]),
175
218
 
176
219
  /**
177
220
  * Texte sur le bouton d'annulation
@@ -27,7 +27,7 @@ var _colorManipulator = require("../styles/colorManipulator");
27
27
 
28
28
  var styles = function styles(theme) {
29
29
  return {
30
- root: (0, _extends2.default)({}, theme.typography.b3, {
30
+ root: {
31
31
  display: 'inline-block',
32
32
  alignItems: 'baseline',
33
33
  maxWidth: '100%',
@@ -37,7 +37,12 @@ var styles = function styles(theme) {
37
37
  overflow: 'hidden',
38
38
  whiteSpace: 'nowrap',
39
39
  lineHeight: 1
40
- }),
40
+ },
41
+ body1: (0, _extends2.default)({}, theme.typography.b1),
42
+ body2: (0, _extends2.default)({}, theme.typography.b2),
43
+ body3: (0, _extends2.default)({}, theme.typography.b3),
44
+ body4: (0, _extends2.default)({}, theme.typography.b4),
45
+ body5: (0, _extends2.default)({}, theme.typography.b5),
41
46
  color: {
42
47
  fontWeight: 400
43
48
  },
@@ -135,6 +140,7 @@ function HiColoredLabel(props) {
135
140
 
136
141
  var classes = props.classes,
137
142
  className = props.className,
143
+ fontSize = props.fontSize,
138
144
  label = props.label,
139
145
  color = props.color,
140
146
  active = props.active,
@@ -142,11 +148,11 @@ function HiColoredLabel(props) {
142
148
  fontWeight = props.fontWeight,
143
149
  style = props.style,
144
150
  theme = props.theme,
145
- other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "label", "color", "active", "outlined", "fontWeight", "style", "theme"]);
151
+ other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "fontSize", "label", "color", "active", "outlined", "fontWeight", "style", "theme"]);
146
152
  var isHiColor = ['primary', 'secondary', 'positive', 'negative', 'middle', 'neutral'].includes(color);
147
153
  var isHexColor = !isHiColor && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
148
154
  return _react.default.createElement("div", (0, _extends2.default)({
149
- className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes.outlined, outlined), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), _classNames), className),
155
+ className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes.outlined, outlined), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), (0, _defineProperty2.default)(_classNames, classes.body1, fontSize >= 15), (0, _defineProperty2.default)(_classNames, classes.body2, fontSize === 14), (0, _defineProperty2.default)(_classNames, classes.body3, fontSize === 13), (0, _defineProperty2.default)(_classNames, classes.body4, fontSize === 12), (0, _defineProperty2.default)(_classNames, classes.body5, fontSize <= 11), _classNames), className),
150
156
  style: (0, _extends2.default)({}, style, isHexColor && {
151
157
  backgroundColor: active ? color : (0, _colorManipulator.fade)(color, 0.08),
152
158
  color: active ? theme.palette.getContrastText(color) : color
@@ -178,6 +184,11 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
178
184
  */
179
185
  color: _propTypes.default.string,
180
186
 
187
+ /**
188
+ * Taille du text
189
+ */
190
+ fontSize: _propTypes.default.number,
191
+
181
192
  /**
182
193
  * Graisse du text
183
194
  */
@@ -196,6 +207,7 @@ HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
196
207
  HiColoredLabel.defaultProps = {
197
208
  active: false,
198
209
  color: 'primary',
210
+ fontSize: 15,
199
211
  outlined: false
200
212
  };
201
213
 
@@ -252,14 +252,12 @@ function (_React$PureComponent) {
252
252
  focused: !disabled && (focused || hovered)
253
253
  }, InputLabelProps), error && errorText && _react.default.createElement(_HiIconButton.default, {
254
254
  className: (0, _classnames.default)(classes.iconButton, classes.iconButtonError),
255
- onClick: this.handleHelperClick,
256
- onKeyDown: this.handleKeyDown
255
+ onClick: this.handleHelperClick
257
256
  }, _react.default.createElement(_Warning.default, {
258
257
  className: (0, _classnames.default)(classes.icon)
259
258
  })), helperIcon && helperText && !error && _react.default.createElement(_HiIconButton.default, {
260
259
  className: (0, _classnames.default)(classes.iconButton, classes.iconButtonInfo, (0, _defineProperty2.default)({}, classes.iconButtonInfoActive, helperOpen)),
261
- onClick: this.handleHelperClick,
262
- onKeyDown: this.handleKeyDown
260
+ onClick: this.handleHelperClick
263
261
  }, _react.default.createElement(_Info.default, {
264
262
  className: (0, _classnames.default)(classes.icon)
265
263
  }))), _react.default.createElement("div", {
package/HiForm/HiInput.js CHANGED
@@ -169,6 +169,13 @@ function (_React$PureComponent) {
169
169
 
170
170
  (0, _classCallCheck2.default)(this, HiInput);
171
171
  _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiInput).call(this));
172
+
173
+ _this.handleClick = function () {
174
+ if (_this.props.onClick) {
175
+ _this.props.onClick();
176
+ }
177
+ };
178
+
172
179
  _this.state = {
173
180
  focused: false
174
181
  };
@@ -215,10 +222,15 @@ function (_React$PureComponent) {
215
222
  // Si on click sur un élément de HiInput, on garde le focus
216
223
  // Par exemple sur l'icone reset
217
224
  if (event.relatedTarget && this.overlayNode && this.overlayNode.contains(event.relatedTarget)) {
218
- if (this.endAdornmentNode.contains(event.relatedTarget) && this.props.onBlur) {
225
+ // If blur came from erase icon => stay focused and don't call onBlur props
226
+ if (this.eraseIconNode && this.eraseIconNode.contains(event.relatedTarget)) {
227
+ event.preventDefault();
228
+ event.stopPropagation();
229
+ } else if (this.endAdornmentNode.contains(event.relatedTarget) && this.props.onBlur) {
219
230
  this.props.onBlur(event);
220
231
  }
221
232
 
233
+ event.preventDefault();
222
234
  event.stopPropagation();
223
235
  } else {
224
236
  this.setState({
@@ -240,9 +252,13 @@ function (_React$PureComponent) {
240
252
  this.setState({
241
253
  focused: true
242
254
  });
243
- }
255
+ } // If focus came from erase icon => stay focused and don't call onFocus props
256
+
244
257
 
245
- if (this.props.onFocus) {
258
+ if (this.eraseIconNode && this.eraseIconNode.contains(event.relatedTarget)) {
259
+ event.preventDefault();
260
+ event.stopPropagation();
261
+ } else if (this.props.onFocus) {
246
262
  this.props.onFocus(event);
247
263
  }
248
264
  }
@@ -342,7 +358,10 @@ function (_React$PureComponent) {
342
358
  label: classes.eraseButtonLabel
343
359
  },
344
360
  onClick: this.handleReset,
345
- onBlur: this.handleBlur
361
+ onBlur: this.handleBlur,
362
+ buttonRef: function buttonRef(el) {
363
+ _this2.eraseIconNode = el;
364
+ }
346
365
  }, _ref);
347
366
 
348
367
  var endAdornment = endAdornmentProps;
@@ -369,6 +388,7 @@ function (_React$PureComponent) {
369
388
  placeholder: placeholder,
370
389
  onFocus: this.handleFocus,
371
390
  onKeyDown: this.props.onKeyDown,
391
+ onClick: this.handleClick,
372
392
  onBlur: this.handleBlur,
373
393
  inputRef: this.getInputElement,
374
394
  disabled: disabled,
@@ -497,6 +517,11 @@ HiInput.propTypes = process.env.NODE_ENV !== "production" ? {
497
517
  */
498
518
  onChange: _propTypes.default.func,
499
519
 
520
+ /**
521
+ * Fonction de callback appelée au click dans l'input
522
+ */
523
+ onClick: _propTypes.default.func,
524
+
500
525
  /**
501
526
  * Fonction de callback appelée au focus du champs
502
527
  */
@@ -49,7 +49,8 @@ var styles = function styles(theme) {
49
49
  fontSize: '80px'
50
50
  },
51
51
  inputContainer: {
52
- flex: '1'
52
+ flex: '1',
53
+ width: 'calc(100% - 88px)'
53
54
  },
54
55
  empty: {
55
56
  border: "1px solid ".concat(theme.palette.input.bottomLine),
@@ -249,17 +249,13 @@ function (_React$PureComponent) {
249
249
  nextItem = (0, _helpers.getNextItemSelectable)(document.activeElement, 'down');
250
250
  } else if (event.key === 'ArrowUp') {
251
251
  nextItem = (0, _helpers.getNextItemSelectable)(document.activeElement, 'up');
252
- } else if (event.key === 'Tab') {
252
+ } else if (event.key === 'Tab' || event.key === 'Escape') {
253
253
  /* if (!this.props.staticPosition) {
254
254
  document.body.style.overflow = 'auto';
255
255
  } */
256
256
  _this.setState({
257
257
  open: false
258
258
  });
259
- } else if (event.key === 'Escape') {
260
- _this.setState({
261
- open: false
262
- });
263
259
  }
264
260
 
265
261
  if (nextItem) {
@@ -272,6 +268,10 @@ function (_React$PureComponent) {
272
268
  _this.focusOnSelectedItem();
273
269
  } else if (event.key === 'Enter' && _this.props.onSubmit) {
274
270
  _this.props.onSubmit(event);
271
+ } else if (event.key === 'Tab' || event.key === 'Escape') {
272
+ _this.setState({
273
+ open: false
274
+ });
275
275
  }
276
276
  };
277
277
 
@@ -750,6 +750,7 @@ function (_React$PureComponent) {
750
750
  onClick: this.handleClick,
751
751
  onFocus: this.handleFocus,
752
752
  onBlur: this.handleBlur,
753
+ onKeyDown: this.handleKeyDown,
753
754
  onMouseEnter: this.props.onMouseEnter,
754
755
  onMouseLeave: this.props.onMouseLeave,
755
756
  refElement: function refElement(el) {
@@ -62,7 +62,8 @@ var styles = function styles(theme) {
62
62
  width: '100% !important',
63
63
  transform: 'none !important',
64
64
  zIndex: '9 !important',
65
- top: '100% !important'
65
+ top: '100% !important',
66
+ textOverflow: 'ellipsis'
66
67
  },
67
68
  paper: {
68
69
  borderRadius: '0px 2px',
@@ -204,10 +205,10 @@ function (_React$PureComponent) {
204
205
  options: [],
205
206
  focused: false
206
207
  });
207
- }
208
208
 
209
- if (this.props.onBlurInput) {
210
- this.props.onBlurInput(event);
209
+ if (this.props.onBlurInput) {
210
+ this.props.onBlurInput(event);
211
+ }
211
212
  }
212
213
  }
213
214
  }, {
@@ -229,6 +229,7 @@ function (_React$PureComponent) {
229
229
  className: iconClass,
230
230
  icon: "arrow_drop_down"
231
231
  })) : _react.default.createElement(_ButtonBase.default, {
232
+ component: "div",
232
233
  id: id,
233
234
  classes: {
234
235
  root: rootClass
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.styles = void 0;
8
+ exports.default = exports.styles = exports.filterValue = void 0;
9
9
 
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
 
@@ -76,6 +76,10 @@ function findFinalItemRecursively(itemList, searchId) {
76
76
  });
77
77
  return foundItem;
78
78
  }
79
+
80
+ var filterValue = function filterValue(item, searchValue) {
81
+ return searchValue === '' || (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(searchValue.toLowerCase())) !== -1;
82
+ };
79
83
  /**
80
84
  * Build item list by settings item props relative to the nested parent/child situation
81
85
  * Reduce the item list to build specified items (displayed, pinned, disabled, selected, indeterminate)
@@ -94,6 +98,8 @@ function findFinalItemRecursively(itemList, searchId) {
94
98
  */
95
99
 
96
100
 
101
+ exports.filterValue = filterValue;
102
+
97
103
  function buildFilteredItemList(itemList) {
98
104
  var selectedItemIdList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
99
105
  var searchValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
@@ -102,15 +108,16 @@ function buildFilteredItemList(itemList) {
102
108
  var disabledParent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
103
109
  var nbChildrenAsInfo = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
104
110
  var translations = arguments.length > 7 ? arguments[7] : undefined;
111
+ var filterFunc = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : filterValue;
105
112
  return itemList.reduce(function (_ref, item) {
106
113
  var memoItemList = _ref.l,
107
114
  memoSelected = _ref.s,
108
115
  memoUnselected = _ref.u,
109
116
  memoVisible = _ref.v;
110
- var itemVisible = searchValue === '' || (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(searchValue.toLowerCase())) !== -1; // Parent item
117
+ var itemVisible = filterFunc(item, searchValue); // Parent item
111
118
 
112
119
  if (item.children) {
113
- var _buildFilteredItemLis = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent),
120
+ var _buildFilteredItemLis = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent, nbChildrenAsInfo, translations, filterFunc),
114
121
  customizedChildren = _buildFilteredItemLis.l,
115
122
  selected = _buildFilteredItemLis.s,
116
123
  unselected = _buildFilteredItemLis.u,
@@ -285,9 +292,10 @@ function (_React$PureComponent) {
285
292
  multiple = _this$props2.multiple,
286
293
  nbChildrenAsInfo = _this$props2.nbChildrenAsInfo,
287
294
  pinnedParent = _this$props2.pinnedParent,
288
- translations = _this$props2.translations; // build item list
295
+ translations = _this$props2.translations,
296
+ filterFunc = _this$props2.filterFunc; // build item list
289
297
 
290
- var _buildFilteredItemLis2 = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations),
298
+ var _buildFilteredItemLis2 = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations, filterFunc),
291
299
  filteredItemList = _buildFilteredItemLis2.l,
292
300
  allSelected = _buildFilteredItemLis2.s,
293
301
  allUnselected = _buildFilteredItemLis2.u,
@@ -426,7 +434,8 @@ HiNestedSelect.defaultProps = {
426
434
  one_item_selected: '%s item selected',
427
435
  n_children: '%s',
428
436
  one_child: '%s item'
429
- }
437
+ },
438
+ filterFunc: filterValue
430
439
  };
431
440
  HiNestedSelect.propTypes = process.env.NODE_ENV !== "production" ? {
432
441
  /**
@@ -444,6 +453,11 @@ HiNestedSelect.propTypes = process.env.NODE_ENV !== "production" ? {
444
453
  */
445
454
  displayAsChip: _propTypes.default.bool,
446
455
 
456
+ /*
457
+ * Fonction de filtrage custom
458
+ */
459
+ filterFunc: _propTypes.default.func,
460
+
447
461
  /**
448
462
  * Affiche l'élément 'All'
449
463
  */