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

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.
@@ -176,7 +176,6 @@ class HiDateRangeSelector extends React.Component {
176
176
  this.setState({
177
177
  containerWidth: findDOMNode(this.container).clientWidth - 5
178
178
  });
179
- this.handleSelectChange('selectedPreset')(undefined, this.state.selectedPreset);
180
179
  }
181
180
  }
182
181
 
@@ -269,8 +268,8 @@ class HiDateRangeSelector extends React.Component {
269
268
  root: classes.dateRangePicker
270
269
  },
271
270
  id: idRange,
272
- from: from,
273
- to: to,
271
+ from: selectedPreset ? from : undefined,
272
+ to: selectedPreset ? to : undefined,
274
273
  enableTime: enableTime,
275
274
  onChange: onChange,
276
275
  toError: toError,
@@ -290,7 +289,6 @@ class HiDateRangeSelector extends React.Component {
290
289
 
291
290
  HiDateRangeSelector.defaultProps = {
292
291
  availableOptionKeys: ['cd', 'pd', 'cw', 'pw', 'cm', 'pm', 'cq', 'pq', 'cy', 'custom'],
293
- defaultPreset: 'cd',
294
292
  enableTime: false,
295
293
  returnSelectValue: false,
296
294
  staticPosition: false,
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import { findDOMNode } from 'react-dom';
7
7
  import Grow from '@material-ui/core/Grow';
8
8
  import Paper from '@material-ui/core/Paper';
9
+ import classNames from 'classnames';
9
10
  import HiSelectableList from '../HiSelectableList';
10
11
  import HiInput from '../HiForm/HiInput';
11
12
  import { withStyles } from '../styles';
@@ -28,6 +29,9 @@ export const styles = theme => ({
28
29
  borderRadius: '0px 2px',
29
30
  maxHeight: 440,
30
31
  transition: 'none'
32
+ },
33
+ alignRight: {
34
+ right: 0
31
35
  }
32
36
  });
33
37
 
@@ -139,9 +143,10 @@ class HiSuggestSelect extends React.PureComponent {
139
143
  showMinLength,
140
144
  showNoResults,
141
145
  onSearch,
142
- translations
146
+ translations,
147
+ align
143
148
  } = _this$props,
144
- otherProps = _objectWithoutProperties(_this$props, ["classes", "id", "loading", "showMinLength", "showNoResults", "onSearch", "translations"]);
149
+ otherProps = _objectWithoutProperties(_this$props, ["classes", "id", "loading", "showMinLength", "showNoResults", "onSearch", "translations", "align"]);
145
150
 
146
151
  const {
147
152
  focused,
@@ -188,7 +193,9 @@ class HiSuggestSelect extends React.PureComponent {
188
193
  disablePortal: true,
189
194
  anchorEl: this.textInput,
190
195
  placement: "bottom-start",
191
- className: classes.popper,
196
+ className: classNames(classes.popper, {
197
+ [classes.alignRight]: align === 'right'
198
+ }),
192
199
  open: true
193
200
  }, React.createElement(Grow, {
194
201
  in: open,
@@ -211,6 +218,7 @@ class HiSuggestSelect extends React.PureComponent {
211
218
  }
212
219
 
213
220
  HiSuggestSelect.defaultProps = {
221
+ align: 'left',
214
222
  showMinLength: false,
215
223
  showNoResults: false,
216
224
  translations: {
@@ -220,6 +228,11 @@ HiSuggestSelect.defaultProps = {
220
228
  options: []
221
229
  };
222
230
  HiSuggestSelect.propTypes = process.env.NODE_ENV !== "production" ? {
231
+ /**
232
+ * Align popper on right or left of container
233
+ */
234
+ align: PropTypes.oneOf(['left', 'right']),
235
+
223
236
  /**
224
237
  * Useful to extend the style applied to components.
225
238
  */
@@ -109,7 +109,9 @@ export const styles = theme => ({
109
109
  textOverflow: 'ellipsis',
110
110
  textAlign: 'right',
111
111
  margin: '4px 12px 4px 8px',
112
- alignSelf: 'center'
112
+ alignSelf: 'center',
113
+ minWidth: '40%',
114
+ maxWidth: '100%'
113
115
  }),
114
116
  checkbox: {
115
117
  marginTop: 3
@@ -2,16 +2,16 @@
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import TableCell from '@material-ui/core/TableCell';
5
- import CellAddress from '@hipay/hipay-material-ui/HiCell/CellAddress';
6
- import CellDate from '@hipay/hipay-material-ui/HiCell/CellDate';
7
- import CellIcon from '@hipay/hipay-material-ui/HiCell/CellIcon';
8
- import CellImage from '@hipay/hipay-material-ui/HiCell/CellImage';
9
- import CellNumeric from '@hipay/hipay-material-ui/HiCell/CellNumeric';
10
- import CellSentinel from '@hipay/hipay-material-ui/HiCell/CellSentinel';
11
- import CellSentinelScore from '@hipay/hipay-material-ui/HiCell/CellSentinelScore';
12
- import CellText from '@hipay/hipay-material-ui/HiCell/CellText';
13
- import CellRate from '@hipay/hipay-material-ui/HiCell/CellRate';
14
- import CellPinToAction from '@hipay/hipay-material-ui/HiCell/CellPinToAction';
5
+ import CellAddress from '../HiCell/CellAddress';
6
+ import CellDate from '../HiCell/CellDate';
7
+ import CellIcon from '../HiCell/CellIcon';
8
+ import CellImage from '../HiCell/CellImage';
9
+ import CellNumeric from '../HiCell/CellNumeric';
10
+ import CellSentinel from '../HiCell/CellSentinel';
11
+ import CellSentinelScore from '../HiCell/CellSentinelScore';
12
+ import CellTextStyled from '../HiCell/CellTextStyled';
13
+ import CellRate from '../HiCell/CellRate';
14
+ import CellPinToAction from '../HiCell/CellPinToAction';
15
15
  import * as cst from './constants';
16
16
 
17
17
  class HiCellBuilder extends React.PureComponent {
@@ -57,7 +57,8 @@ class HiCellBuilder extends React.PureComponent {
57
57
  shortLabel: datacell.id,
58
58
  path: datacell.img,
59
59
  size: datacell.size,
60
- view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
60
+ view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
61
+ fallbackImage: datacell.fallbackImage
61
62
  });
62
63
 
63
64
  case cst.TYPE_RATE:
@@ -121,7 +122,8 @@ class HiCellBuilder extends React.PureComponent {
121
122
  case cst.TYPE_SENTINEL_SCORE:
122
123
  return React.createElement(CellSentinelScore, {
123
124
  value: datacell.value,
124
- result: datacell.result
125
+ result: datacell.result,
126
+ active: datacell.active
125
127
  });
126
128
 
127
129
  case cst.TYPE_PIN_TO_ACTION:
@@ -131,18 +133,13 @@ class HiCellBuilder extends React.PureComponent {
131
133
  });
132
134
 
133
135
  case cst.TYPE_ACCOUNT_NUMBER:
134
- return React.createElement(CellText, {
135
- label: datacell.value,
136
- color: datacell.color,
137
- ellipsis: datacell.ellipse
138
- });
139
-
140
136
  default:
141
- return React.createElement(CellText, {
142
- label: datacell.value,
137
+ return React.createElement(CellTextStyled, {
138
+ active: datacell.active,
143
139
  color: datacell.color,
144
- ellipsis: datacell.ellipse,
145
- view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
140
+ label: datacell.label,
141
+ title: datacell.title,
142
+ value: datacell.value
146
143
  });
147
144
  }
148
145
  }
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  // @inheritedComponent TableHeader
2
3
  import React from 'react';
3
4
  import PropTypes from 'prop-types';
@@ -38,29 +39,34 @@ class HiTableHeader extends React.PureComponent {
38
39
  height: dense ? cst.CELL_HEADER_HEIGHT_DENSE : cst.CELL_HEADER_HEIGHT,
39
40
  whiteSpace: 'nowrap'
40
41
  }
41
- }, Object.keys(columns).map(function (key) {
42
- const column = columns[key];
42
+ }, Object.keys(columns).map(key => {
43
+ const {
44
+ colId,
45
+ type,
46
+ label,
47
+ smallLabel,
48
+ view
49
+ } = columns[key];
43
50
  return React.createElement(TableCell, {
44
- key: column.colId,
45
- sortDirection: orderBy === column.colId ? order : false,
51
+ key: colId,
52
+ sortDirection: orderBy === colId ? order : false,
46
53
  style: {
47
54
  border: 'none',
48
- borderBottom: orderBy === column.colId ? 'solid 1px #00ADE9' : 'none',
55
+ borderBottom: orderBy === colId ? 'solid 1px #00ADE9' : 'none',
49
56
  paddingRight: '13px',
50
57
  paddingLeft: '13px'
51
58
  },
52
- numeric: !!cst.ALIGN_RIGHT_TYPES.includes(column.type)
53
- }, sortable ? React.createElement(Tooltip, {
54
- title: "Sort",
55
- enterDelay: 300
56
- }, React.createElement(TableSortLabel, {
57
- active: orderBy === column.colId,
59
+ numeric: cst.ALIGN_RIGHT_TYPES.includes(type)
60
+ }, React.createElement(TableSortLabel, _extends({}, sortable && {
61
+ active: orderBy === colId,
58
62
  direction: order,
59
- onClick: this.createSortHandler(column.colId),
63
+ onClick: this.createSortHandler(colId)
64
+ }, {
60
65
  classes: {
61
66
  icon: classes.icon
62
- }
63
- }, column.label)) : column.label);
67
+ },
68
+ title: label
69
+ }), view === 's' ? smallLabel : label));
64
70
  }, this)));
65
71
  }
66
72
 
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.53
1
+ /** @license HiPay-Material-UI v2.0.0-beta.55
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.53
1
+ /** @license HiPay-Material-UI v2.0.0-beta.55
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hipay/hipay-material-ui",
3
3
  "private": false,
4
4
  "author": "HiPay PSYCHE Team",
5
- "version": "2.0.0-beta.54",
5
+ "version": "2.0.0-beta.55",
6
6
  "description": "React components that implement Google's Material Design.",
7
7
  "keywords": [
8
8
  "react",
@@ -72,4 +72,4 @@
72
72
  },
73
73
  "main": "./index.js",
74
74
  "module": "./index.es.js"
75
- }
75
+ }