@hipay/hipay-material-ui 2.0.0-beta.54 → 2.0.0-beta.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/HiBreadcrumb/HiBreadcrumb.js +14 -4
  3. package/HiBreadcrumb/HiStep.js +4 -1
  4. package/HiBreadcrumb/HiStepContent.js +0 -1
  5. package/HiBreadcrumb/HiStepLabel.js +12 -4
  6. package/HiBreadcrumb/HiStepper.js +1 -1
  7. package/HiButton/HiButton.js +7 -1
  8. package/HiCell/CellIcon.js +4 -4
  9. package/HiCell/CellImage.js +28 -4
  10. package/HiCell/CellNumeric.js +1 -2
  11. package/HiCell/CellRate.js +6 -3
  12. package/HiCell/CellSentinel.js +7 -10
  13. package/HiCell/CellSentinelScore.js +4 -4
  14. package/HiCell/CellTextStyled.js +99 -0
  15. package/HiCell/index.js +9 -1
  16. package/HiChip/HiChip.js +1 -0
  17. package/HiDatePicker/Caption.js +8 -9
  18. package/HiDatePicker/HiDateRangePicker.js +37 -19
  19. package/HiDatePicker/HiDateRangeSelector.js +24 -22
  20. package/HiDatePicker/Overlays/CustomOverlayLayout.js +26 -17
  21. package/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  22. package/HiDatePicker/Overlays/Overlay.js +15 -8
  23. package/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  24. package/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  25. package/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  26. package/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
  27. package/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  28. package/HiDatePicker/stylesheet.js +3 -2
  29. package/HiDotsStepper/HiDot.js +108 -0
  30. package/HiDotsStepper/HiDotsStepper.js +121 -0
  31. package/HiExpansionPanel/HiExpansionPanel.js +1 -1
  32. package/HiForm/HiAddressField.js +176 -0
  33. package/HiForm/HiSlider.js +352 -0
  34. package/HiForm/HiUpload.js +204 -0
  35. package/HiForm/HiUploadField.js +182 -0
  36. package/HiForm/HiUploadInput.js +459 -0
  37. package/HiForm/index.js +16 -0
  38. package/HiMap/HiMap.js +345 -0
  39. package/HiMap/HiMapExpand.js +210 -0
  40. package/HiMap/index.js +23 -0
  41. package/HiNotice/HiKPI.js +238 -0
  42. package/HiNotice/HiKPINotice.js +93 -0
  43. package/HiNotice/index.js +23 -0
  44. package/HiPdfReader/HiPdfReader.js +269 -0
  45. package/HiPdfReader/index.js +15 -0
  46. package/HiRadio/HiRadio.js +74 -0
  47. package/HiRadio/index.js +15 -0
  48. package/HiSelect/HiSelect.js +73 -84
  49. package/HiSelect/HiSuggestSelect.js +32 -5
  50. package/HiSelect/SelectInput.js +5 -0
  51. package/HiSelectNew/HiNestedSelectContent.js +5 -1
  52. package/HiSelectNew/HiSelect.js +174 -137
  53. package/HiSelectNew/HiSelectContent.js +0 -8
  54. package/HiSelectNew/HiSelectInput.js +8 -9
  55. package/HiSelectableList/HiSelectableList.js +32 -4
  56. package/HiSelectableList/HiSelectableListItem.js +62 -24
  57. package/HiTable/HiCellBuilder.js +42 -32
  58. package/HiTable/HiTableHeader.js +28 -21
  59. package/HiTable/constants.js +3 -1
  60. package/README.md +249 -98
  61. package/es/HiBreadcrumb/HiBreadcrumb.js +14 -4
  62. package/es/HiBreadcrumb/HiStep.js +4 -1
  63. package/es/HiBreadcrumb/HiStepContent.js +0 -1
  64. package/es/HiBreadcrumb/HiStepLabel.js +13 -4
  65. package/es/HiBreadcrumb/HiStepper.js +1 -1
  66. package/es/HiButton/HiButton.js +7 -0
  67. package/es/HiCell/CellIcon.js +5 -5
  68. package/es/HiCell/CellImage.js +25 -2
  69. package/es/HiCell/CellNumeric.js +1 -2
  70. package/es/HiCell/CellRate.js +6 -3
  71. package/es/HiCell/CellSentinel.js +7 -10
  72. package/es/HiCell/CellSentinelScore.js +4 -4
  73. package/es/HiCell/CellTextStyled.js +84 -0
  74. package/es/HiCell/index.js +2 -1
  75. package/es/HiChip/HiChip.js +1 -0
  76. package/es/HiDatePicker/Caption.js +7 -9
  77. package/es/HiDatePicker/HiDateRangePicker.js +41 -25
  78. package/es/HiDatePicker/HiDateRangeSelector.js +24 -22
  79. package/es/HiDatePicker/ListPicker.js +1 -1
  80. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +30 -19
  81. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +2 -2
  82. package/es/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  83. package/es/HiDatePicker/Overlays/Overlay.js +16 -9
  84. package/es/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  85. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  86. package/es/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  87. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
  88. package/es/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  89. package/es/HiDatePicker/stylesheet.js +3 -2
  90. package/es/HiDotsStepper/HiDot.js +66 -0
  91. package/es/HiDotsStepper/HiDotsStepper.js +73 -0
  92. package/es/HiExpansionPanel/HiExpansionPanel.js +1 -1
  93. package/es/HiForm/HiAddressField.js +134 -0
  94. package/es/HiForm/HiSlider.js +302 -0
  95. package/es/HiForm/HiUpload.js +158 -0
  96. package/es/HiForm/HiUploadField.js +140 -0
  97. package/es/HiForm/HiUploadInput.js +411 -0
  98. package/es/HiForm/index.js +2 -0
  99. package/es/HiMap/HiMap.js +290 -0
  100. package/es/HiMap/HiMapExpand.js +162 -0
  101. package/es/HiMap/index.js +2 -0
  102. package/es/HiNotice/HiKPI.js +196 -0
  103. package/es/HiNotice/HiKPINotice.js +77 -0
  104. package/es/HiNotice/index.js +2 -0
  105. package/es/HiPdfReader/HiPdfReader.js +214 -0
  106. package/es/HiPdfReader/index.js +1 -0
  107. package/es/HiRadio/HiRadio.js +55 -0
  108. package/es/HiRadio/index.js +1 -0
  109. package/es/HiSelect/HiSelect.js +68 -78
  110. package/es/HiSelect/HiSuggestSelect.js +27 -6
  111. package/es/HiSelect/SelectInput.js +5 -0
  112. package/es/HiSelectNew/HiNestedSelectContent.js +5 -1
  113. package/es/HiSelectNew/HiSelect.js +156 -120
  114. package/es/HiSelectNew/HiSelectContent.js +0 -7
  115. package/es/HiSelectNew/HiSelectInput.js +8 -9
  116. package/es/HiSelectableList/HiSelectableList.js +28 -6
  117. package/es/HiSelectableList/HiSelectableListItem.js +71 -24
  118. package/es/HiTable/HiCellBuilder.js +140 -136
  119. package/es/HiTable/HiTableHeader.js +26 -18
  120. package/es/HiTable/constants.js +1 -0
  121. package/es/index.js +7 -0
  122. package/es/utils/helpers.js +1 -1
  123. package/index.es.js +8 -1
  124. package/index.js +57 -1
  125. package/package.json +6 -3
  126. package/umd/hipay-material-ui.development.js +42114 -35120
  127. package/umd/hipay-material-ui.production.min.js +2 -2
  128. package/utils/helpers.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,60 @@
1
+ <a name="2.0.0-beta.41"></a>
2
+ # [2.0.0-beta.41](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.41) (2018-11-12)
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
+ * **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
34
+ * **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
35
+ * **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
36
+ * **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
37
+ * **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
38
+ * **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
39
+ * **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
40
+ * **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
41
+ * **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
42
+
43
+
44
+ ### Performance Improvements
45
+
46
+ * **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
47
+
48
+
49
+ ### BREAKING CHANGES
50
+
51
+ * **HiUploadField:** Components names changes
52
+ * **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
53
+ CellImage & CellText)
54
+ * **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
55
+
56
+
57
+
1
58
  <a name="2.0.0-beta.35"></a>
2
59
  # 2.0.0-beta.35 (2018-09-14)
3
60
 
@@ -47,7 +47,9 @@ function (_React$PureComponent) {
47
47
 
48
48
  _this.handleStep = function (idx) {
49
49
  return function () {
50
- _this.props.handleStep(idx);
50
+ if (_this.props.disableNavigation === false) {
51
+ _this.props.handleStep(idx);
52
+ }
51
53
  };
52
54
  };
53
55
 
@@ -62,7 +64,8 @@ function (_React$PureComponent) {
62
64
  var _this$props = this.props,
63
65
  activeStep = _this$props.activeStep,
64
66
  steps = _this$props.steps,
65
- type = _this$props.type;
67
+ type = _this$props.type,
68
+ disableNavigation = _this$props.disableNavigation;
66
69
  return _react.default.createElement(_HiStepper.default, {
67
70
  activeStep: activeStep,
68
71
  type: type
@@ -81,7 +84,8 @@ function (_React$PureComponent) {
81
84
  active: activeStep === index,
82
85
  status: step.status,
83
86
  notificationNumber: step.notificationNumber,
84
- type: type
87
+ type: type,
88
+ disableNavigation: disableNavigation
85
89
  }, step.label));
86
90
  })));
87
91
  }
@@ -91,7 +95,8 @@ function (_React$PureComponent) {
91
95
 
92
96
  HiBreadcrumb.defaultProps = {
93
97
  activeStep: 0,
94
- type: 'back'
98
+ type: 'back',
99
+ disableNavigation: false
95
100
  };
96
101
  HiBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? {
97
102
  /**
@@ -99,6 +104,11 @@ HiBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? {
99
104
  */
100
105
  activeStep: _propTypes.default.number,
101
106
 
107
+ /**
108
+ * Disable navigation in steps
109
+ */
110
+ disableNavigation: _propTypes.default.bool,
111
+
102
112
  /**
103
113
  * The callback function handling the flow from one step to another
104
114
  */
@@ -37,6 +37,9 @@ var styles = function styles() {
37
37
  return {
38
38
  lastStep: {
39
39
  marginBottom: 40
40
+ },
41
+ step: {
42
+ outline: 'none'
40
43
  }
41
44
  };
42
45
  };
@@ -89,7 +92,7 @@ function (_React$PureComponent) {
89
92
  return _react.default.createElement("div", {
90
93
  role: "button",
91
94
  tabIndex: index,
92
- className: (0, _classnames.default)((0, _defineProperty2.default)({}, classes.lastStep, isLast && type !== 'back')),
95
+ className: (0, _classnames.default)(classes.step, (0, _defineProperty2.default)({}, classes.lastStep, isLast && type !== 'back')),
93
96
  onClick: onClick,
94
97
  onKeyDown: onClick
95
98
  }, _react.default.Children.map(children, function (child) {
@@ -39,7 +39,6 @@ var styles = function styles() {
39
39
  contentContainer: {
40
40
  height: 'fit-content',
41
41
  maxHeight: 300,
42
- maxWidth: 323,
43
42
  marginTop: 35,
44
43
  marginLeft: 24,
45
44
  padding: 24,
@@ -59,11 +59,13 @@ var styles = function styles(theme) {
59
59
  marginLeft: 4,
60
60
  fontWeight: theme.typography.fontWeightRegular,
61
61
  color: theme.palette.neutral.main,
62
- marginBottom: -4,
62
+ marginBottom: -4
63
+ }, theme.typography.b2),
64
+ labelHover: {
63
65
  '&:hover': {
64
66
  cursor: 'pointer'
65
67
  }
66
- }, theme.typography.b2),
68
+ },
67
69
  labelContainer: {
68
70
  marginBottom: 4
69
71
  },
@@ -141,7 +143,8 @@ function (_React$PureComponent) {
141
143
  notificationNumber = _this$props.notificationNumber,
142
144
  status = _this$props.status,
143
145
  type = _this$props.type,
144
- other = (0, _objectWithoutProperties2.default)(_this$props, ["active", "children", "classes", "className", "notificationNumber", "status", "type"]);
146
+ disableNavigation = _this$props.disableNavigation,
147
+ other = (0, _objectWithoutProperties2.default)(_this$props, ["active", "children", "classes", "className", "notificationNumber", "status", "type", "disableNavigation"]);
145
148
  return _react.default.createElement("span", (0, _extends2.default)({
146
149
  className: (0, _classnames.default)(classes.root, classNameProp, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.frontRoot, type === 'front-light'), (0, _defineProperty2.default)(_classNames, classes.frontDarkRoot, type === 'front-dark'), _classNames))
147
150
  }, other), _react.default.createElement("span", {
@@ -153,7 +156,7 @@ function (_React$PureComponent) {
153
156
  })), _react.default.createElement("span", {
154
157
  className: (0, _classnames.default)(classes.labelContainer, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.largeLabelContainer, type !== 'back'), (0, _defineProperty2.default)(_classNames2, classes.shortLabelContainer, type === 'back'), _classNames2))
155
158
  }, _react.default.createElement("div", {
156
- className: (0, _classnames.default)(classes.label, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, classes.validated, status === 'validated'), (0, _defineProperty2.default)(_classNames3, classes.refused, status === 'refused'), (0, _defineProperty2.default)(_classNames3, classes.warning, status === 'warning'), (0, _defineProperty2.default)(_classNames3, classes.active, status === 'active'), (0, _defineProperty2.default)(_classNames3, classes.light, type === 'front-light'), (0, _defineProperty2.default)(_classNames3, classes.activeStep, active), (0, _defineProperty2.default)(_classNames3, classes.frontLabel, type !== 'back'), (0, _defineProperty2.default)(_classNames3, classes.shortEllipsis, notificationNumber > 0), (0, _defineProperty2.default)(_classNames3, classes.longEllipsis, notificationNumber === 0 && type === 'back'), _classNames3))
159
+ className: (0, _classnames.default)(classes.label, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, classes.labelHover, disableNavigation === false), (0, _defineProperty2.default)(_classNames3, classes.validated, status === 'validated'), (0, _defineProperty2.default)(_classNames3, classes.refused, status === 'refused'), (0, _defineProperty2.default)(_classNames3, classes.warning, status === 'warning'), (0, _defineProperty2.default)(_classNames3, classes.active, status === 'active'), (0, _defineProperty2.default)(_classNames3, classes.light, type === 'front-light'), (0, _defineProperty2.default)(_classNames3, classes.activeStep, active), (0, _defineProperty2.default)(_classNames3, classes.frontLabel, type !== 'back'), (0, _defineProperty2.default)(_classNames3, classes.shortEllipsis, notificationNumber > 0), (0, _defineProperty2.default)(_classNames3, classes.longEllipsis, notificationNumber === 0 && type === 'back'), _classNames3))
157
160
  }, children), notificationNumber > 0 && _react.default.createElement("span", {
158
161
  className: classes.pin
159
162
  }, _react.default.createElement(_HiPin.default, {
@@ -194,6 +197,11 @@ HiStepLabel.propTypes = process.env.NODE_ENV !== "production" ? {
194
197
  */
195
198
  className: _propTypes.default.string,
196
199
 
200
+ /**
201
+ * Disable navigation in steps
202
+ */
203
+ disableNavigation: _propTypes.default.bool,
204
+
197
205
  /**
198
206
  * The value to be displayed in the HiPin on the right of the label
199
207
  */
@@ -28,7 +28,7 @@ var _styles = require("../styles");
28
28
  var styles = function styles() {
29
29
  return {
30
30
  root: {
31
- width: 340
31
+ width: '100%'
32
32
  }
33
33
  };
34
34
  };
@@ -82,6 +82,12 @@ var styles = function styles(theme) {
82
82
  },
83
83
 
84
84
  /* Styles applied to the root element if `variant="[contained | fab]"` and `color="positive"`. */
85
+ containedPrimary: {
86
+ '&$disabled': {
87
+ color: theme.palette.neutral.contrastText,
88
+ backgroundColor: theme.palette.neutral.main
89
+ }
90
+ },
85
91
  containedPositive: {
86
92
  color: theme.palette.positive.contrastText,
87
93
  backgroundColor: theme.palette.positive.main,
@@ -199,7 +205,7 @@ function HiButton(props) {
199
205
  var hcolor = ['positive', 'negative', 'middle', 'neutral'].includes(color) ? 'inherit' : color;
200
206
  var fab = variant === 'fab' || variant === 'extendedFab';
201
207
  var contained = variant === 'contained' || variant === 'raised';
202
- var buttonClassNames = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.raisedDisabled, variant === 'raised' && disabled), (0, _defineProperty2.default)(_classNames, classes.flatPositive, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.flatNegative, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.flatMiddle, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.flatNeutral, (variant === 'text' || variant === 'flat' || variant === 'outlined') && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.containedPositive, (contained || fab) && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.containedNegative, (contained || fab) && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.containedMiddle, (contained || fab) && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.containedNeutral, (contained || fab) && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.outlinedPositive, variant === 'outlined' && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.outlinedNegative, variant === 'outlined' && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.outlinedMiddle, variant === 'outlined' && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.outlinedNeutral, variant === 'outlined' && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.disabled, disabled), _classNames));
208
+ var buttonClassNames = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.raisedDisabled, variant === 'raised' && disabled), (0, _defineProperty2.default)(_classNames, classes.flatPositive, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.flatNegative, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.flatMiddle, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.flatNeutral, (variant === 'text' || variant === 'flat' || variant === 'outlined') && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.containedPrimary, (contained || fab) && color === 'primary'), (0, _defineProperty2.default)(_classNames, classes.containedPositive, (contained || fab) && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.containedNegative, (contained || fab) && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.containedMiddle, (contained || fab) && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.containedNeutral, (contained || fab) && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.outlinedPositive, variant === 'outlined' && color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.outlinedNegative, variant === 'outlined' && color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.outlinedMiddle, variant === 'outlined' && color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.outlinedNeutral, variant === 'outlined' && (color === 'default' || color === 'neutral')), (0, _defineProperty2.default)(_classNames, classes.disabled, disabled), _classNames));
203
209
  return _react.default.createElement(_Button.default, (0, _extends2.default)({
204
210
  className: className,
205
211
  classes: {
@@ -71,10 +71,10 @@ function (_React$PureComponent) {
71
71
  className: classes.wrapper,
72
72
  title: label
73
73
  }, icon && _react.default.createElement(_HiIcon.default, {
74
- color: "inherit",
74
+ color: 'inherit',
75
75
  style: {
76
76
  color: color,
77
- fontSize: size ? size : 24
77
+ fontSize: size || 24
78
78
  },
79
79
  className: classes.icon,
80
80
  icon: icon
@@ -115,12 +115,12 @@ CellIcon.propTypes = process.env.NODE_ENV !== "production" ? {
115
115
  /**
116
116
  * View (L/M/S)
117
117
  */
118
- view: _propTypes.default.oneOf(['l', 'm', 's']),
118
+ size: _propTypes.default.number,
119
119
 
120
120
  /**
121
121
  * Icon size
122
122
  */
123
- size: _propTypes.default.number
123
+ view: _propTypes.default.oneOf(['l', 'm', 's'])
124
124
  } : {};
125
125
 
126
126
  var _default = (0, _withStyles.default)(styles, {
@@ -41,6 +41,18 @@ var styles = function styles() {
41
41
  }
42
42
  };
43
43
  };
44
+
45
+ exports.styles = styles;
46
+
47
+ var handleError = function handleError(fallbackImage) {
48
+ return function (e) {
49
+ if (fallbackImage) {
50
+ e.target.src = "".concat(fallbackImage);
51
+ } else {
52
+ e.target.style.display = 'none';
53
+ }
54
+ };
55
+ };
44
56
  /**
45
57
  * Cette cellule permet d'afficher une image/logo (24px largeur) et un label (optionnel).
46
58
  * En vue large, aucun tooltip n'est affiché
@@ -48,8 +60,6 @@ var styles = function styles() {
48
60
  */
49
61
 
50
62
 
51
- exports.styles = styles;
52
-
53
63
  var CellImage =
54
64
  /*#__PURE__*/
55
65
  function (_React$PureComponent) {
@@ -69,7 +79,9 @@ function (_React$PureComponent) {
69
79
  label = _this$props.label,
70
80
  shortLabel = _this$props.shortLabel,
71
81
  view = _this$props.view,
72
- size = _this$props.size;
82
+ size = _this$props.size,
83
+ fallbackImage = _this$props.fallbackImage,
84
+ title = _this$props.title;
73
85
  if (!path || path === '') return '';
74
86
  return _react.default.createElement("div", {
75
87
  className: classes.wrapper,
@@ -77,8 +89,10 @@ function (_React$PureComponent) {
77
89
  }, _react.default.createElement("img", {
78
90
  src: path,
79
91
  alt: label,
92
+ title: title,
80
93
  className: classes.img,
81
- width: size
94
+ width: size,
95
+ onError: handleError(fallbackImage)
82
96
  }), shortLabel && view === 'm' && _react.default.createElement("span", {
83
97
  className: classes.label
84
98
  }, shortLabel), label && (view === 'l' || view === 'm' && !shortLabel) && _react.default.createElement("span", {
@@ -99,6 +113,11 @@ CellImage.propTypes = process.env.NODE_ENV !== "production" ? {
99
113
  */
100
114
  classes: _propTypes.default.object,
101
115
 
116
+ /**
117
+ * Fallback image path
118
+ */
119
+ fallbackImage: _propTypes.default.string,
120
+
102
121
  /**
103
122
  * Label
104
123
  */
@@ -119,6 +138,11 @@ CellImage.propTypes = process.env.NODE_ENV !== "production" ? {
119
138
  */
120
139
  size: _propTypes.default.number,
121
140
 
141
+ /**
142
+ * Title.
143
+ */
144
+ title: _propTypes.default.string,
145
+
122
146
  /**
123
147
  * View (L/M/S)
124
148
  */
@@ -28,8 +28,7 @@ var _helpers = require("../utils/helpers");
28
28
  var styles = function styles() {
29
29
  return {
30
30
  wrapper: {
31
- textAlign: 'right',
32
- direction: 'rtl'
31
+ textAlign: 'right'
33
32
  }
34
33
  };
35
34
  };
@@ -39,7 +39,8 @@ var styles = function styles(theme) {
39
39
  justifyContent: 'center',
40
40
  overflow: 'hidden',
41
41
  position: 'relative',
42
- textAlign: 'right'
42
+ textAlign: 'right',
43
+ paddingTop: '1em'
43
44
  },
44
45
  trendChipIcon: {
45
46
  width: 14,
@@ -57,7 +58,6 @@ var styles = function styles(theme) {
57
58
  color: theme.palette.neutral.main
58
59
  },
59
60
  spanIndicator: {
60
- fontSize: 11,
61
61
  float: 'right',
62
62
  color: '#737373',
63
63
  position: 'relative',
@@ -130,7 +130,10 @@ function (_React$PureComponent) {
130
130
  }, _react.default.createElement("div", {
131
131
  className: typeof indicator === 'undefined' && classes.rateDiv || ''
132
132
  }, displayedRate, trendIcon), typeof indicator !== 'undefined' && _react.default.createElement("span", {
133
- className: classes.spanIndicator
133
+ className: classes.spanIndicator,
134
+ style: {
135
+ fontSize: view !== 'l' ? 10 : 11
136
+ }
134
137
  }, indicator));
135
138
  }
136
139
  }]);
@@ -60,21 +60,18 @@ function (_React$PureComponent) {
60
60
  outlined = _this$props.outlined,
61
61
  reviewer = _this$props.reviewer,
62
62
  value = _this$props.value;
63
-
64
- var _label = label ? label : value;
65
-
66
- var _letter = letter ? letter : _label[0];
67
-
63
+ var effectiveLabel = label || value;
64
+ var effectiveLetter = letter || effectiveLabel[0];
68
65
  return _react.default.createElement("div", {
69
66
  className: classes.flexContent,
70
- title: reviewer ? "".concat(_label, "\n").concat(reviewer) : _label
67
+ title: reviewer ? "".concat(effectiveLabel, "\n").concat(reviewer) : effectiveLabel
71
68
  }, _react.default.createElement(_HiColoredLabel.default, {
72
69
  active: active,
73
70
  classes: {
74
71
  root: classes.label
75
72
  },
76
73
  color: color,
77
- label: _letter,
74
+ label: effectiveLetter,
78
75
  outlined: outlined
79
76
  }));
80
77
  }
@@ -87,14 +84,14 @@ CellSentinel.defaultProps = {
87
84
  outlined: false
88
85
  };
89
86
  CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
87
+ active: _propTypes.default.bool,
90
88
  classes: _propTypes.default.object,
91
- value: _propTypes.default.string,
92
89
  color: _propTypes.default.string,
93
90
  label: _propTypes.default.string,
94
91
  letter: _propTypes.default.string,
95
- active: _propTypes.default.bool,
92
+ outlined: _propTypes.default.bool,
96
93
  reviewer: _propTypes.default.string,
97
- outlined: _propTypes.default.bool
94
+ value: _propTypes.default.string
98
95
  } : {};
99
96
 
100
97
  var _default = (0, _withStyles.default)(styles, {
@@ -39,7 +39,6 @@ var sentinelColorById = {
39
39
  AUTHENTICATE: '#484A4B',
40
40
  FORCE_AUTHENTICATE: '#20272B',
41
41
  PENDING: '#3987AD',
42
- TO_BE_REVIEWED: '#FF8F01',
43
42
  CHALLENGED: '#FF8F01',
44
43
  BLOCKED: '#D50000',
45
44
  ALLOWED: '#00AF01',
@@ -65,13 +64,14 @@ function (_React$PureComponent) {
65
64
  key: "render",
66
65
  value: function render() {
67
66
  var _this$props = this.props,
67
+ active = _this$props.active,
68
68
  classes = _this$props.classes,
69
69
  result = _this$props.result,
70
70
  value = _this$props.value;
71
71
  return _react.default.createElement("div", {
72
72
  className: classes.flexContent
73
73
  }, _react.default.createElement(_HiColoredLabel.default, {
74
- active: result === 'TO_BE_REVIEWED',
74
+ active: active,
75
75
  classes: {
76
76
  root: classes.label
77
77
  },
@@ -84,10 +84,10 @@ function (_React$PureComponent) {
84
84
  }(_react.default.PureComponent);
85
85
 
86
86
  CellSentinelScore.defaultProps = {
87
- active: false,
88
- outlined: false
87
+ active: false
89
88
  };
90
89
  CellSentinelScore.propTypes = process.env.NODE_ENV !== "production" ? {
90
+ active: _propTypes.default.bool,
91
91
  classes: _propTypes.default.object,
92
92
  result: _propTypes.default.string,
93
93
  value: _propTypes.default.number
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _HiColoredLabel = _interopRequireDefault(require("../HiColoredLabel"));
15
+
16
+ var styleRoot = {
17
+ width: '100%',
18
+ height: 19,
19
+ margin: 'auto 0',
20
+ display: 'flex',
21
+ lineHeight: '15px'
22
+ };
23
+ var styleColorLabel = {
24
+ display: 'inline-block',
25
+ overflow: 'hidden',
26
+ textOverflow: 'ellipsis',
27
+ whiteSpace: 'pre'
28
+ };
29
+ var styleLabel = {
30
+ display: 'inline-block',
31
+ overflow: 'hidden',
32
+ textOverflow: 'ellipsis',
33
+ whiteSpace: 'pre',
34
+ width: '100%'
35
+ };
36
+ /**
37
+ * CellText functional component
38
+ * (don't includes complex ellipsis: middle, after-first-word...)
39
+ *
40
+ * @param label
41
+ * @param color
42
+ * @param value
43
+ * @param active
44
+ * @param title
45
+ * @returns {*}
46
+ * @constructor
47
+ */
48
+
49
+ var CellTextStyled = function CellTextStyled(_ref) {
50
+ var label = _ref.label,
51
+ color = _ref.color,
52
+ _ref$value = _ref.value,
53
+ value = _ref$value === void 0 ? '' : _ref$value,
54
+ _ref$active = _ref.active,
55
+ active = _ref$active === void 0 ? false : _ref$active,
56
+ _ref$title = _ref.title,
57
+ title = _ref$title === void 0 ? '' : _ref$title;
58
+ var valueString = label ? label.toString() : value.toString();
59
+ return _react.default.createElement("div", {
60
+ style: styleRoot,
61
+ title: title || valueString
62
+ }, color ? _react.default.createElement(_HiColoredLabel.default, {
63
+ style: styleColorLabel,
64
+ label: valueString,
65
+ color: color,
66
+ active: active
67
+ }) : _react.default.createElement("div", {
68
+ style: styleLabel
69
+ }, valueString));
70
+ };
71
+
72
+ CellTextStyled.propTypes = process.env.NODE_ENV !== "production" ? {
73
+ /**
74
+ * Will forward active prop to HiColoredLabel
75
+ */
76
+ active: _propTypes.default.bool,
77
+
78
+ /**
79
+ * Couleur du text & du background
80
+ */
81
+ color: _propTypes.default.string,
82
+
83
+ /**
84
+ * Label
85
+ */
86
+ label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
87
+
88
+ /**
89
+ * Tooltip
90
+ */
91
+ title: _propTypes.default.string,
92
+
93
+ /**
94
+ * Value
95
+ */
96
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
97
+ } : {};
98
+ var _default = CellTextStyled;
99
+ exports.default = _default;
package/HiCell/index.js CHANGED
@@ -53,6 +53,12 @@ Object.defineProperty(exports, "CellText", {
53
53
  return _CellText.default;
54
54
  }
55
55
  });
56
+ Object.defineProperty(exports, "CellTextStyled", {
57
+ enumerable: true,
58
+ get: function get() {
59
+ return _CellTextStyled.default;
60
+ }
61
+ });
56
62
 
57
63
  var _CellAddress = _interopRequireDefault(require("./CellAddress"));
58
64
 
@@ -68,4 +74,6 @@ var _CellRate = _interopRequireDefault(require("./CellRate"));
68
74
 
69
75
  var _CellSentinel = _interopRequireDefault(require("./CellSentinel"));
70
76
 
71
- var _CellText = _interopRequireDefault(require("./CellText"));
77
+ var _CellText = _interopRequireDefault(require("./CellText"));
78
+
79
+ var _CellTextStyled = _interopRequireDefault(require("./CellTextStyled"));
package/HiChip/HiChip.js CHANGED
@@ -82,6 +82,7 @@ var styles = function styles(theme) {
82
82
  textOverflow: 'ellipsis'
83
83
  },
84
84
  prefix: {
85
+ whiteSpace: 'nowrap',
85
86
  color: theme.palette.neutral.dark,
86
87
  paddingRight: 4
87
88
  },
@@ -15,19 +15,18 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
16
  var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
17
17
 
18
+ var _HiButton = _interopRequireDefault(require("../HiButton"));
19
+
18
20
  var styles = function styles(theme) {
19
21
  return {
20
22
  caption: (0, _extends2.default)({
21
23
  display: 'table-caption',
22
24
  height: 40,
23
25
  textAlign: 'center',
24
- padding: '10px 0'
26
+ padding: '4px 0'
25
27
  }, theme.typography.body1, {
26
28
  color: theme.palette.neutral.main
27
- }),
28
- clickableSpan: {
29
- cursor: 'pointer'
30
- }
29
+ })
31
30
  };
32
31
  };
33
32
 
@@ -42,11 +41,11 @@ var Caption = function Caption(_ref) {
42
41
  var months = localeUtils.getMonths();
43
42
  return _react.default.createElement("div", {
44
43
  className: classes.caption
45
- }, _react.default.createElement("span", {
46
- className: classes.clickableSpan,
44
+ }, _react.default.createElement(_HiButton.default, {
45
+ size: "small",
47
46
  onClick: onMonthClick
48
- }, months[date.getMonth()]), "\xA0", _react.default.createElement("span", {
49
- className: classes.clickableSpan,
47
+ }, months[date.getMonth()]), _react.default.createElement(_HiButton.default, {
48
+ size: "small",
50
49
  onClick: onYearClick
51
50
  }, date.getFullYear()));
52
51
  };