@hipay/hipay-material-ui 1.0.0-beta.25 → 1.0.0-beta.27

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 (37) hide show
  1. package/HI-CHANGELOG.md +73 -0
  2. package/HiChip/HiChip.js +11 -5
  3. package/HiForm/HiFormControl.js +4 -4
  4. package/HiSelect/HiSelect.js +29 -21
  5. package/HiSelectableList/HiSelectableList.js +1 -1
  6. package/HiSelectableList/HiSelectableListItem.js +3 -3
  7. package/HiTable/BodyCellBuilder.js +3 -2
  8. package/HiTable/BodyCells/CellAccount.js +1 -12
  9. package/HiTable/BodyCells/CellDate.js +15 -12
  10. package/HiTable/BodyCells/CellRate.js +3 -3
  11. package/HiTable/BodyCells/CellText.js +76 -48
  12. package/HiTable/HiStickyRow.js +3 -3
  13. package/HiTable/HiTableFooter.js +5 -6
  14. package/README.md +2 -1
  15. package/es/HiChip/HiChip.js +11 -5
  16. package/es/HiForm/HiFormControl.js +4 -4
  17. package/es/HiSelect/HiSelect.js +27 -17
  18. package/es/HiSelectableList/HiSelectableList.js +1 -1
  19. package/es/HiSelectableList/HiSelectableListItem.js +3 -3
  20. package/es/HiTable/BodyCellBuilder.js +3 -2
  21. package/es/HiTable/BodyCells/CellAccount.js +1 -4
  22. package/es/HiTable/BodyCells/CellDate.js +11 -7
  23. package/es/HiTable/BodyCells/CellRate.js +3 -3
  24. package/es/HiTable/BodyCells/CellText.js +48 -23
  25. package/es/HiTable/HiStickyRow.js +1 -1
  26. package/es/HiTable/HiTableFooter.js +6 -6
  27. package/es/svg-icons/Cancel.js +2 -0
  28. package/es/svg-icons/HiBriefcaseRescue.js +15 -0
  29. package/es/svg-icons/index.js +2 -1
  30. package/index.es.js +1 -1
  31. package/index.js +1 -1
  32. package/package.json +2 -1
  33. package/svg-icons/Cancel.js +2 -0
  34. package/svg-icons/HiBriefcaseRescue.js +30 -0
  35. package/svg-icons/index.js +9 -0
  36. package/umd/hipay-material-ui.development.js +10062 -52486
  37. package/umd/hipay-material-ui.production.min.js +4 -4
@@ -1,12 +1,13 @@
1
1
  import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
-
5
4
  import Tooltip from '../../Tooltip';
6
5
  import withStyles from '../../styles/withStyles';
7
6
  import * as cst from '../constants';
7
+ import HiColoredLabel from '../../HiColoredLabel';
8
+ import { getContrastedTextColor } from '../../styles/colorManipulator';
8
9
 
9
- export const styles = theme => ({
10
+ export const styles = {
10
11
  leftEllipsisSpan: {
11
12
  display: 'inline-block',
12
13
  overflow: 'hidden',
@@ -18,22 +19,17 @@ export const styles = theme => ({
18
19
  display: 'inline-block',
19
20
  overflow: 'hidden',
20
21
  textOverflow: 'ellipsis',
21
- whiteSpace: 'pre',
22
- width: '100%'
22
+ whiteSpace: 'pre'
23
23
  },
24
24
  noEllipsisSpan: {
25
25
  display: 'inline-block',
26
26
  overflow: 'hidden',
27
27
  whiteSpace: 'pre'
28
28
  }
29
- });
29
+ };
30
30
 
31
31
  class CellText extends React.Component {
32
32
 
33
- shouldComponentUpdate(nextProps, nextState) {
34
- return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
35
- }
36
-
37
33
  constructor(props) {
38
34
  super(props);
39
35
 
@@ -48,6 +44,10 @@ class CellText extends React.Component {
48
44
  this.buildEllipsis();
49
45
  }
50
46
 
47
+ shouldComponentUpdate(nextProps, nextState) {
48
+ return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
49
+ }
50
+
51
51
  componentDidUpdate() {
52
52
  this.buildEllipsis();
53
53
  }
@@ -73,8 +73,9 @@ class CellText extends React.Component {
73
73
 
74
74
  /**
75
75
  * Calcul l'espace pris par les 2 spans (les 2 moitiés du texte),
76
- * si ils dépassent la largeur de la cellule, diminue d'autant et proportionnellement chaque span
77
- * ajoute l'ellipse à gauche de la deuxième moitié du texte.
76
+ * si ils dépassent la largeur de la cellule :
77
+ * - diminue d'autant et proportionnellement chaque span
78
+ * - ajoute l'ellipse à gauche de la deuxième moitié du texte.
78
79
  */
79
80
  if (this.props.ellipsis === cst.ELLIPSIS_MIDDLE) {
80
81
  if (this.cellText !== null) {
@@ -94,13 +95,13 @@ class CellText extends React.Component {
94
95
  }
95
96
 
96
97
  render() {
97
- const { classes, value, ellipsis } = this.props;
98
+ const { classes, value, ellipsis, color } = this.props;
98
99
 
99
100
  let start,
100
101
  end,
101
102
  valueElement = '';
102
103
 
103
- let valueString = value.toString();
104
+ const valueString = value.toString();
104
105
 
105
106
  switch (ellipsis) {
106
107
  case cst.ELLIPSIS_AFTER_FIRST_WORD:
@@ -113,13 +114,19 @@ class CellText extends React.Component {
113
114
  }
114
115
  valueElement = React.createElement(
115
116
  'div',
116
- { ref: div => {
117
+ {
118
+ ref: div => {
117
119
  this.cellText = div;
118
- } },
120
+ },
121
+ style: {
122
+ backgroundColor: color || 'inherit',
123
+ color: color ? getContrastedTextColor(color, '#4C4C4C', '#FFF') : 'inherit'
124
+ }
125
+ },
119
126
  React.createElement(
120
127
  'span',
121
128
  { className: classes.rightEllipsisSpan },
122
- start + ' '
129
+ `${start} `
123
130
  ),
124
131
  React.createElement(
125
132
  'span',
@@ -135,9 +142,15 @@ class CellText extends React.Component {
135
142
  end = valueString.substr(Math.round(valueString.length / 2));
136
143
  valueElement = React.createElement(
137
144
  'div',
138
- { ref: div => {
145
+ {
146
+ ref: div => {
139
147
  this.cellText = div;
140
- } },
148
+ },
149
+ style: {
150
+ backgroundColor: color || 'inherit',
151
+ color: color ? getContrastedTextColor(color, '#4C4C4C', '#FFF') : 'inherit'
152
+ }
153
+ },
141
154
  React.createElement(
142
155
  'span',
143
156
  { className: classes.noEllipsisSpan },
@@ -152,7 +165,11 @@ class CellText extends React.Component {
152
165
  break;
153
166
 
154
167
  case cst.ELLIPSIS_LEFT:
155
- valueElement = React.createElement(
168
+ valueElement = color ? React.createElement(HiColoredLabel, {
169
+ className: classes.leftEllipsisSpan,
170
+ label: valueString,
171
+ color: color
172
+ }) : React.createElement(
156
173
  'div',
157
174
  { className: classes.leftEllipsisSpan, style: { width: '100%' } },
158
175
  valueString
@@ -161,7 +178,11 @@ class CellText extends React.Component {
161
178
 
162
179
  case cst.ELLIPSIS_RIGHT:
163
180
  default:
164
- valueElement = React.createElement(
181
+ valueElement = color ? React.createElement(HiColoredLabel, {
182
+ className: classes.rightEllipsisSpan,
183
+ label: valueString,
184
+ color: color
185
+ }) : React.createElement(
165
186
  'div',
166
187
  { className: classes.rightEllipsisSpan, style: { width: '100%' } },
167
188
  valueString
@@ -183,12 +204,16 @@ CellText.propTypes = process.env.NODE_ENV !== "production" ? {
183
204
  */
184
205
  classes: PropTypes.object,
185
206
  /**
186
- * Valeur à afficher
207
+ * Couleur du text & du background
187
208
  */
188
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
209
+ color: PropTypes.string,
189
210
  /**
190
211
  * Ellipsis
191
212
  */
192
- ellipsis: PropTypes.oneOf(['left', 'right', 'middle', 'name', 'after-first-word'])
213
+ ellipsis: PropTypes.oneOf(['left', 'right', 'middle', 'name', 'after-first-word']),
214
+ /**
215
+ * Valeur à afficher
216
+ */
217
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
193
218
  } : {};
194
219
  export default withStyles(styles, { name: 'HmuiCellText' })(CellText);
@@ -72,7 +72,7 @@ export const styles = theme => ({
72
72
 
73
73
  export const ONCHANGE_ERROR_MESSAGE = 'Vous devez saisir la propriété "onChange" pour les lignes "selectable"';
74
74
 
75
- class HiStickyRow extends React.PureComponent {
75
+ class HiStickyRow extends React.Component {
76
76
 
77
77
  shouldComponentUpdate(nextProps, nextState) {
78
78
  return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
@@ -1,9 +1,8 @@
1
- import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
2
1
  import React from 'react';
3
2
  import { TableCell, TableFooter, TableRow } from 'material-ui/Table';
4
3
  import { withStyles } from '../styles';
5
4
  import PropTypes from 'prop-types';
6
- import * as cst from "./constants";
5
+ import * as cst from './constants';
7
6
 
8
7
  export const styles = theme => ({
9
8
  tfoot: {
@@ -29,8 +28,9 @@ export const styles = theme => ({
29
28
 
30
29
  class HiTableFooter extends React.Component {
31
30
 
32
- shouldComponentUpdate(nextProps, nextState) {
33
- return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
31
+ // Table footer never need to be updated
32
+ shouldComponentUpdate() {
33
+ return false;
34
34
  }
35
35
 
36
36
  render() {
@@ -46,7 +46,7 @@ class HiTableFooter extends React.Component {
46
46
  style: {
47
47
  paddingLeft: cst.DEFAULT_PADDING[view]
48
48
  },
49
- key: `footer-left-cell`,
49
+ key: 'footer-left-cell',
50
50
  className: classes.patchDiv
51
51
  }),
52
52
  React.createElement(
@@ -58,7 +58,7 @@ class HiTableFooter extends React.Component {
58
58
  style: {
59
59
  paddingLeft: cst.DEFAULT_PADDING[view]
60
60
  },
61
- key: `footer-right-cell`,
61
+ key: 'footer-right-cell',
62
62
  className: classes.patchDiv
63
63
  })
64
64
  )
@@ -1,3 +1,5 @@
1
+ messageAlert;
2
+
1
3
  import React from 'react';
2
4
  import pure from 'recompose/pure';
3
5
  import SvgIcon from '../SvgIcon';
@@ -0,0 +1,15 @@
1
+ import _extends from "babel-runtime/helpers/extends";
2
+ import React from "react";
3
+
4
+ var _ref = React.createElement("path", {
5
+ d: "M486 108H378V27a27 27 0 0 0-27-27H189a27 27 0 0 0-27 27v81H54a54.06 54.06 0 0 0-54 54v270a54.06 54.06 0 0 0 54 54h432a54.06 54.06 0 0 0 54-54V162a54.06 54.06 0 0 0-54-54zM216 54h108v54H216zm162 270h-81v81h-54v-81h-81v-54h81v-81h54v81h81z",
6
+ fill: "#767676"
7
+ });
8
+
9
+ const HiBriefcaseRescue = props => React.createElement(
10
+ "svg",
11
+ _extends({ viewBox: "0 0 540 486" }, props),
12
+ _ref
13
+ );
14
+
15
+ export default HiBriefcaseRescue;
@@ -8,4 +8,5 @@ export { default as HiRoute } from './HiRoute';
8
8
  export { default as HiSettlement } from './HiSettlement';
9
9
  export { default as HiTransaction } from './HiTransaction';
10
10
  export { default as HiUser } from './HiUser';
11
- export { default as HiWidget } from './HiWidget';
11
+ export { default as HiWidget } from './HiWidget';
12
+ export { default as HiBriefcaseRescue } from './HiBriefcaseRescue';
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Material-UI v1.0.0-beta.25
1
+ /** @license Material-UI v1.0.0-beta.27
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Material-UI v1.0.0-beta.25
1
+ /** @license Material-UI v1.0.0-beta.27
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hipay/hipay-material-ui",
3
3
  "private": false,
4
4
  "author": "HiPay PSYCHE Team",
5
- "version": "1.0.0-beta.25",
5
+ "version": "1.0.0-beta.27",
6
6
  "description": "HiPay Material-UI Style Guide - React components that implement Google's Material Design from Material-UI.",
7
7
  "main": "./index.js",
8
8
  "repository": {
@@ -23,6 +23,7 @@
23
23
  "babel-runtime": "^6.26.0",
24
24
  "brcast": "^3.0.1",
25
25
  "classnames": "^2.2.5",
26
+ "commitizen": "^2.10.1",
26
27
  "deepmerge": "^2.0.1",
27
28
  "dom-helpers": "^3.2.1",
28
29
  "hoist-non-react-statics": "^2.5.0",
@@ -18,6 +18,8 @@ var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
18
18
 
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
20
 
21
+ messageAlert;
22
+
21
23
  /**
22
24
  * @ignore - internal component.
23
25
  */
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _extends2 = require("babel-runtime/helpers/extends");
8
+
9
+ var _extends3 = _interopRequireDefault(_extends2);
10
+
11
+ var _react = require("react");
12
+
13
+ var _react2 = _interopRequireDefault(_react);
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ var _ref = _react2.default.createElement("path", {
18
+ d: "M486 108H378V27a27 27 0 0 0-27-27H189a27 27 0 0 0-27 27v81H54a54.06 54.06 0 0 0-54 54v270a54.06 54.06 0 0 0 54 54h432a54.06 54.06 0 0 0 54-54V162a54.06 54.06 0 0 0-54-54zM216 54h108v54H216zm162 270h-81v81h-54v-81h-81v-54h81v-81h54v81h81z",
19
+ fill: "#767676"
20
+ });
21
+
22
+ var HiBriefcaseRescue = function HiBriefcaseRescue(props) {
23
+ return _react2.default.createElement(
24
+ "svg",
25
+ (0, _extends3.default)({ viewBox: "0 0 540 486" }, props),
26
+ _ref
27
+ );
28
+ };
29
+
30
+ exports.default = HiBriefcaseRescue;
@@ -103,4 +103,13 @@ Object.defineProperty(exports, 'HiWidget', {
103
103
  }
104
104
  });
105
105
 
106
+ var _HiBriefcaseRescue = require('./HiBriefcaseRescue');
107
+
108
+ Object.defineProperty(exports, 'HiBriefcaseRescue', {
109
+ enumerable: true,
110
+ get: function get() {
111
+ return _interopRequireDefault(_HiBriefcaseRescue).default;
112
+ }
113
+ });
114
+
106
115
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }