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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/HiCheckbox/HiCheckbox.js +6 -3
  2. package/HiColoredLabel/HiColoredLabel.js +2 -2
  3. package/HiDatePicker/HiDateRangeSelector.js +32 -9
  4. package/HiForm/HiSearchField.js +7 -1
  5. package/HiSelect/HiSelect.js +187 -77
  6. package/HiSelect/HiSuggestSelect.js +37 -9
  7. package/HiSelect/SelectInput.js +63 -10
  8. package/HiSelectableList/HiSelectableListItem.js +2 -1
  9. package/HiTable/BodyCellBuilder.js +22 -16
  10. package/HiTable/BodyCells/CellAccount.js +1 -5
  11. package/HiTable/BodyCells/CellAddress.js +3 -50
  12. package/HiTable/BodyCells/CellCountry.js +0 -4
  13. package/HiTable/BodyCells/CellDate.js +4 -13
  14. package/HiTable/BodyCells/CellIcon.js +10 -27
  15. package/HiTable/BodyCells/CellImage.js +1 -21
  16. package/HiTable/BodyCells/CellLayout.js +11 -4
  17. package/HiTable/BodyCells/CellNumeric.js +3 -23
  18. package/HiTable/BodyCells/CellSentinel.js +20 -49
  19. package/HiTable/BodyCells/CellStatus.js +11 -19
  20. package/HiTable/BodyCells/CellText.js +3 -10
  21. package/HiTable/BodyCells/CellThirdPartySecurity.js +4 -18
  22. package/HiTable/BodyCells/index.js +0 -9
  23. package/HiTable/BodyRow.js +15 -17
  24. package/HiTable/HiTable.js +41 -26
  25. package/HiTable/HiTableBody.js +2 -1
  26. package/HiTable/HiTableContextMenu.js +4 -3
  27. package/HiTable/constants.js +2 -2
  28. package/es/HiCheckbox/HiCheckbox.js +6 -3
  29. package/es/HiColoredLabel/HiColoredLabel.js +2 -2
  30. package/es/HiDatePicker/HiDateRangeSelector.js +27 -9
  31. package/es/HiForm/HiSearchField.js +2 -1
  32. package/es/HiSelect/HiSelect.js +133 -36
  33. package/es/HiSelect/HiSuggestSelect.js +36 -10
  34. package/es/HiSelect/SelectInput.js +50 -10
  35. package/es/HiSelectableList/HiSelectableListItem.js +2 -1
  36. package/es/HiTable/BodyCellBuilder.js +21 -19
  37. package/es/HiTable/BodyCells/CellAccount.js +1 -5
  38. package/es/HiTable/BodyCells/CellAddress.js +3 -44
  39. package/es/HiTable/BodyCells/CellCountry.js +0 -2
  40. package/es/HiTable/BodyCells/CellDate.js +4 -10
  41. package/es/HiTable/BodyCells/CellIcon.js +10 -24
  42. package/es/HiTable/BodyCells/CellImage.js +1 -21
  43. package/es/HiTable/BodyCells/CellLayout.js +10 -4
  44. package/es/HiTable/BodyCells/CellNumeric.js +3 -16
  45. package/es/HiTable/BodyCells/CellSentinel.js +20 -46
  46. package/es/HiTable/BodyCells/CellStatus.js +11 -16
  47. package/es/HiTable/BodyCells/CellText.js +3 -7
  48. package/es/HiTable/BodyCells/CellThirdPartySecurity.js +3 -15
  49. package/es/HiTable/BodyCells/index.js +0 -2
  50. package/es/HiTable/BodyRow.js +12 -14
  51. package/es/HiTable/HiTable.js +41 -26
  52. package/es/HiTable/HiTableBody.js +2 -1
  53. package/es/HiTable/HiTableContextMenu.js +4 -3
  54. package/es/HiTable/constants.js +7 -7
  55. package/es/utils/HiIconBuilder.js +12 -4
  56. package/es/utils/hiHelpers.js +1 -1
  57. package/index.es.js +1 -1
  58. package/index.js +1 -1
  59. package/package.json +1 -1
  60. package/umd/hipay-material-ui.development.js +23532 -23548
  61. package/umd/hipay-material-ui.production.min.js +5 -5
  62. package/utils/HiIconBuilder.js +13 -3
  63. package/utils/hiHelpers.js +1 -1
  64. package/HiTable/BodyCells/CellAccountNumber.js +0 -229
  65. package/es/HiTable/BodyCells/CellAccountNumber.js +0 -171
@@ -1,6 +1,6 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
1
  import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3
2
  import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
3
+ import _extends from 'babel-runtime/helpers/extends';
4
4
 
5
5
  // @inheritedComponent BodyCellBuilder
6
6
  import React from 'react';
@@ -13,9 +13,12 @@ import { withStyles } from '../styles';
13
13
  import * as cst from './constants';
14
14
 
15
15
  export const styles = theme => ({
16
- rootSelected: {
16
+ root: {
17
17
  backgroundColor: theme.palette.background3
18
18
  },
19
+ rootSelected: {
20
+ backgroundColor: theme.palette.background1
21
+ },
19
22
  hover: {
20
23
  '&:hover': {
21
24
  backgroundColor: theme.palette.hover,
@@ -57,10 +60,10 @@ class BodyRow extends React.Component {
57
60
 
58
61
  this.state = {
59
62
  live: props.live,
60
- style: {
61
- backgroundColor: props.live ? fade(props.theme.palette.business.primary.normal, 0.08) : props.theme.palette.background3,
62
- transition: props.live ? 'background-color 2s' : 'none'
63
- }
63
+ style: _extends({}, props.live && {
64
+ backgroundColor: fade(props.theme.palette.business.primary.normal, 0.08),
65
+ transition: 'background-color 2s'
66
+ })
64
67
  };
65
68
 
66
69
  this.handleClick = this.handleClick.bind(this);
@@ -77,10 +80,7 @@ class BodyRow extends React.Component {
77
80
  if (this.state.live) {
78
81
  this.setState({
79
82
  live: false,
80
- style: {
81
- backgroundColor: this.props.theme.palette.background3,
82
- transition: 'background-color 2s'
83
- }
83
+ style: {}
84
84
  });
85
85
  }
86
86
  }
@@ -90,10 +90,7 @@ class BodyRow extends React.Component {
90
90
  if (prevState.live === true && this.state.live === false) {
91
91
  setTimeout(() => {
92
92
  this.setState({
93
- style: {
94
- backgroundColor: this.props.theme.palette.background3,
95
- transition: 'none'
96
- }
93
+ style: {}
97
94
  });
98
95
  }, 2500);
99
96
  }
@@ -165,6 +162,7 @@ class BodyRow extends React.Component {
165
162
  return React.createElement(
166
163
  TableRow,
167
164
  {
165
+ className: classes.root,
168
166
  classes: { selected: classes.rootSelected, hover: classes.hover },
169
167
  onClick: this.handleClick,
170
168
  hover: true,
@@ -124,16 +124,18 @@ class HiTable extends React.Component {
124
124
  this.groupByRowsPositions = [];
125
125
 
126
126
  this.updateFloatingBodyElementRefs = () => {
127
- this.tBodyScrollbarWidth = this.tBody.offsetWidth - this.tBody.clientWidth;
127
+ if (this.tBody) {
128
+ this.tBodyScrollbarWidth = this.tBody.offsetWidth - this.tBody.clientWidth;
128
129
 
129
- if (this.tHead && this.tBodyScrollbarWidth > 0) {
130
- this.tHead.style.width = 'calc(100% - ' + this.tBodyScrollbarWidth + 'px)';
131
- }
130
+ if (this.tHead && this.tBodyScrollbarWidth > 0) {
131
+ this.tHead.style.width = 'calc(100% - ' + this.tBodyScrollbarWidth + 'px)';
132
+ }
132
133
 
133
- this.tBodyLeftPaddingElements = this.tBody.querySelectorAll('tr td:nth-child(1), .floating-parent-row-label');
134
- this.tBodyRightPaddingElements = this.tBody.querySelectorAll('tr td:nth-last-child(1), .floating-parent-row-indicator');
134
+ this.tBodyLeftPaddingElements = this.tBody.querySelectorAll('tr td:nth-child(1), .floating-parent-row-label');
135
+ this.tBodyRightPaddingElements = this.tBody.querySelectorAll('tr td:nth-last-child(1), .floating-parent-row-indicator');
135
136
 
136
- this.tBodyFirstElements = this.tBody.querySelectorAll('tr td:nth-child(2)');
137
+ this.tBodyFirstElements = this.tBody.querySelectorAll('tr td:nth-child(2)');
138
+ }
137
139
  };
138
140
 
139
141
  this.addNewRowRefs = () => {
@@ -245,8 +247,9 @@ class HiTable extends React.Component {
245
247
  this.handleStickyRowPositions();
246
248
  }
247
249
  }
248
-
249
- this.isScrollToBottom(this.scrollTop === this.tBody.scrollHeight - this.tBody.offsetHeight);
250
+ if (this.tBody) {
251
+ this.isScrollToBottom(this.scrollTop === this.tBody.scrollHeight - this.tBody.offsetHeight);
252
+ }
250
253
 
251
254
  this.placeHorizontalFloatingElement();
252
255
  }
@@ -258,11 +261,13 @@ class HiTable extends React.Component {
258
261
  this.groupByRowsPositions = [];
259
262
  // Initialize new stickyRows position
260
263
  const tableBody = document.getElementById(`${this.props.tabId}-body`);
261
- const stickyRows = tableBody.getElementsByClassName('stickyGroupBy');
262
- if (stickyRows.length > 0) {
263
- Array.prototype.filter.call(stickyRows, stickyRow => {
264
- this.groupByRowsPositions.push(stickyRow.nextSibling.nextSibling.offsetTop - rowHeight);
265
- });
264
+ if (tableBody) {
265
+ const stickyRows = tableBody.getElementsByClassName('stickyGroupBy');
266
+ if (stickyRows.length > 0) {
267
+ Array.prototype.filter.call(stickyRows, stickyRow => {
268
+ this.groupByRowsPositions.push(stickyRow.nextSibling.nextSibling.offsetTop - rowHeight);
269
+ });
270
+ }
266
271
  }
267
272
  }
268
273
 
@@ -359,13 +364,14 @@ class HiTable extends React.Component {
359
364
  }
360
365
 
361
366
  this.handleStickyRowPositions();
362
-
363
- this.isScrollToBottom(this.scrollTop === event.target.scrollHeight - this.tBody.offsetHeight);
367
+ if (this.tBody) {
368
+ this.isScrollToBottom(this.scrollTop === event.target.scrollHeight - this.tBody.offsetHeight);
369
+ }
364
370
  }
365
371
 
366
372
  handleStickyRowPositions() {
367
373
  const tableBody = document.getElementById(`${this.props.tabId}-body`);
368
- const stickyRows = tableBody.getElementsByClassName('stickyGroupBy');
374
+ const stickyRows = tableBody ? tableBody.getElementsByClassName('stickyGroupBy') : [];
369
375
  const rowHeight = this.props.dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT;
370
376
  if (stickyRows.length > 0) {
371
377
  Array.prototype.filter.call(stickyRows, (stickyRow, index) => {
@@ -458,7 +464,7 @@ class HiTable extends React.Component {
458
464
 
459
465
  // Replace stickyRowContent
460
466
  const tableBody = document.getElementById(`${this.props.tabId}-body`);
461
- const stickyRowContentDiv = tableBody.getElementsByClassName('stickyRowContent');
467
+ const stickyRowContentDiv = tableBody ? tableBody.getElementsByClassName('stickyRowContent') : [];
462
468
  if (stickyRowContentDiv.length > 0) {
463
469
  Array.prototype.filter.call(stickyRowContentDiv, div => {
464
470
  div.style.left = `${this.wrapperDiv.scrollLeft + (this.props.selectable ? 25 : 0)}px`;
@@ -479,7 +485,9 @@ class HiTable extends React.Component {
479
485
  this.backToTopButton['style'].top = -99999 + 'px';
480
486
 
481
487
  // Set scroll top to 0
482
- this.tBody.scrollTop = 0;
488
+ if (this.tBody) {
489
+ this.tBody.scrollTop = 0;
490
+ }
483
491
  this.scrollTop = 0;
484
492
  }
485
493
 
@@ -551,7 +559,8 @@ class HiTable extends React.Component {
551
559
  fixedColumnWidth,
552
560
  disableContextMenu,
553
561
  footerContent,
554
- detailRowsOptions
562
+ detailRowsOptions,
563
+ noResultsContent
555
564
  } = this.props;
556
565
 
557
566
  const { dateUpdate, isScrollToBottom } = this.state;
@@ -607,7 +616,7 @@ class HiTable extends React.Component {
607
616
  lookupColumns: lookupColumns,
608
617
  fixedColumnWidth: fixedColumnWidth
609
618
  }),
610
- React.createElement(HiTableBody, {
619
+ dataSource.length > 0 && React.createElement(HiTableBody, {
611
620
  tabId: tabId,
612
621
  columns: columns,
613
622
  orderedColumns: orderedColumns,
@@ -635,7 +644,7 @@ class HiTable extends React.Component {
635
644
  disableContextMenu: disableContextMenu,
636
645
  detailRowsOptions: detailRowsOptions
637
646
  }),
638
- infiniteScroll && React.createElement(HiTableFooterScroll, {
647
+ dataSource.length > 0 && infiniteScroll && React.createElement(HiTableFooterScroll, {
639
648
  tabId: tabId,
640
649
  hasNextDatas: hasNextDatas,
641
650
  requestNextDatas: requestNextDatas,
@@ -643,7 +652,7 @@ class HiTable extends React.Component {
643
652
  isScrollToBottom: isScrollToBottom,
644
653
  translations: translations.tableFooterScroll
645
654
  }),
646
- !infiniteScroll && footerContent && React.createElement(
655
+ dataSource.length > 0 && !infiniteScroll && footerContent && React.createElement(
647
656
  HiTableFooter,
648
657
  {
649
658
  nbColumnsDisplayed: nbColumnsDisplayed,
@@ -674,7 +683,8 @@ class HiTable extends React.Component {
674
683
  React.createElement(ArrowUp, { className: classes.backToTopButtonArrow })
675
684
  )
676
685
  )
677
- )
686
+ ),
687
+ dataSource.length === 0 && noResultsContent && noResultsContent
678
688
  );
679
689
  }
680
690
  }
@@ -701,7 +711,8 @@ HiTable.defaultProps = {
701
711
  lookupColumns: [],
702
712
  loading: false,
703
713
  fixedColumnWidth: true,
704
- disableContextMenu: true
714
+ disableContextMenu: true,
715
+ noResultsContent: null
705
716
  };
706
717
  HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
707
718
  /**
@@ -886,6 +897,10 @@ HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
886
897
  * Taille du tableau (L/M/S),
887
898
  * définit l'espace entre les cellules et leurs tailles par default
888
899
  */
889
- view: PropTypes.oneOf(['l', 'm', 's'])
900
+ view: PropTypes.oneOf(['l', 'm', 's']),
901
+ /**
902
+ * No results content.
903
+ */
904
+ noResultsContent: PropTypes.object
890
905
  } : {};
891
906
  export default withStyles(styles, { withTheme: true, name: 'HmuiHiTable' })(HiTable);
@@ -423,7 +423,8 @@ HiTableBody.defaultProps = {
423
423
  view: 'l',
424
424
  loading: false,
425
425
  disableContextMenu: true,
426
- detailRowsOptions: {}
426
+ detailRowsOptions: {},
427
+ noResultsContent: null
427
428
  };
428
429
  HiTableBody.propTypes = process.env.NODE_ENV !== "production" ? {
429
430
  /**
@@ -10,13 +10,14 @@ export const styles = theme => ({
10
10
  contextMenu: {
11
11
  zIndex: 9999,
12
12
  backgroundColor: theme.palette.background3,
13
- boxShadow: '0px 2px 2px rgba(100, 100, 100, 0.5)'
13
+ boxShadow: '0px 2px 2px rgba(100, 100, 100, 0.5)',
14
+ textAlign: 'left'
14
15
  },
15
16
  contextMenuItem: _extends({}, theme.typography.body1, {
16
17
  height: 40,
17
18
  width: 300,
18
19
  cursor: 'pointer',
19
- padding: '10px 10px 10px 28px',
20
+ padding: 10,
20
21
  color: theme.palette.neutral.dark,
21
22
  '&:hover': {
22
23
  backgroundColor: theme.palette.hover,
@@ -125,7 +126,7 @@ HiTableContextMenu.defaultProps = {
125
126
  copy: 'Copy',
126
127
  exclude: 'Exclude "%s"',
127
128
  lookUp: 'Look up "%s"',
128
- openInNewTab: 'Open the transaction in a new tab'
129
+ openInNewTab: 'Open in new tab'
129
130
  }
130
131
  };
131
132
  HiTableContextMenu.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -102,12 +102,12 @@ export const DEFAULT_WIDTHS = {
102
102
  [VIEWS.SMALL]: 120
103
103
  },
104
104
  [TYPE_ICON]: {
105
- [VIEWS.LARGE]: 120,
105
+ [VIEWS.LARGE]: 140,
106
106
  [VIEWS.MEDIUM]: 100,
107
- [VIEWS.SMALL]: 40
107
+ [VIEWS.SMALL]: 60
108
108
  },
109
109
  [TYPE_IMAGE]: {
110
- [VIEWS.LARGE]: 120,
110
+ [VIEWS.LARGE]: 140,
111
111
  [VIEWS.MEDIUM]: 100,
112
112
  [VIEWS.SMALL]: 60
113
113
  },
@@ -132,8 +132,8 @@ export const DEFAULT_WIDTHS = {
132
132
  [VIEWS.SMALL]: 80
133
133
  },
134
134
  [TYPE_TEXT]: {
135
- [VIEWS.LARGE]: 120,
136
- [VIEWS.MEDIUM]: 100,
135
+ [VIEWS.LARGE]: 200,
136
+ [VIEWS.MEDIUM]: 120,
137
137
  [VIEWS.SMALL]: 80
138
138
  },
139
139
  [TYPE_THIRD_PARTY_SECURITY]: {
@@ -168,8 +168,8 @@ export const DEFAULT_VIEWS = {
168
168
  * @type {{}}
169
169
  */
170
170
  export const DEFAULT_PADDING = {
171
- [VIEWS.LARGE]: 12,
172
- [VIEWS.MEDIUM]: 10,
171
+ [VIEWS.LARGE]: 8,
172
+ [VIEWS.MEDIUM]: 8,
173
173
  [VIEWS.SMALL]: 8
174
174
  };
175
175
 
@@ -30,8 +30,8 @@ class HiIconBuilder extends PureComponent {
30
30
 
31
31
  render() {
32
32
  const _props = this.props,
33
- { icon, size, className, style, onClick, color, backgroundColor } = _props,
34
- others = _objectWithoutProperties(_props, ['icon', 'size', 'className', 'style', 'onClick', 'color', 'backgroundColor']);
33
+ { icon, size, width, height, className, style, onClick, color, backgroundColor } = _props,
34
+ others = _objectWithoutProperties(_props, ['icon', 'size', 'width', 'height', 'className', 'style', 'onClick', 'color', 'backgroundColor']);
35
35
 
36
36
  let props = {};
37
37
  if (onClick) {
@@ -63,8 +63,8 @@ class HiIconBuilder extends PureComponent {
63
63
  return React.createElement(IconName, _extends({
64
64
  className: className,
65
65
  style: _extends({
66
- height: size,
67
- width: size
66
+ height: height ? height : size,
67
+ width: width ? width : size
68
68
  }, color && { color, fill: color }, backgroundColor && { backgroundColor, padding: 2, borderRadius: size }, style),
69
69
  onClick: onClick
70
70
  }, props, others));
@@ -99,6 +99,14 @@ HiIconBuilder.propTypes = process.env.NODE_ENV !== "production" ? {
99
99
  * Taile de la police
100
100
  */
101
101
  size: PropTypes.number,
102
+ /**
103
+ * Largeur de l'icone (px)
104
+ */
105
+ width: PropTypes.number,
106
+ /**
107
+ * Hauteur de l'icone (px)
108
+ */
109
+ height: PropTypes.number,
102
110
  /**
103
111
  * Style surchargé
104
112
  */
@@ -162,7 +162,7 @@ export function getNextItemSelectable(node, direction) {
162
162
  if (node.nextSibling === null) {
163
163
  return null;
164
164
  } else if (node.nextSibling.tabIndex === -1) {
165
- return this.getNextItemSelectable(node.nextSibling, direction);
165
+ return getNextItemSelectable(node.nextSibling, direction);
166
166
  }
167
167
  return node.nextSibling;
168
168
  } else if (node.previousSibling === null) {
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Material-UI v1.0.0-beta.27
1
+ /** @license Material-UI v1.0.0-beta.29
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.27
1
+ /** @license Material-UI v1.0.0-beta.29
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.27",
5
+ "version": "1.0.0-beta.29",
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": {