@hipay/hipay-material-ui 2.0.0-beta.66 → 2.0.0-beta.68

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 (49) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/HiAlertModal/HiAlertModal.js +32 -32
  3. package/HiAppBar/HiAppBar.js +3 -3
  4. package/HiBreadcrumb/HiBreadcrumb.js +5 -4
  5. package/HiBreadcrumb/HiStepConnector.js +3 -3
  6. package/HiCell/CellText.js +3 -3
  7. package/HiCheckbox/HiCheckbox.js +3 -3
  8. package/HiChip/HiChipSwitch.js +5 -5
  9. package/HiDatePicker/HiDatePicker.js +17 -17
  10. package/HiDatePicker/Overlays/MonthPickerOverlay.js +3 -3
  11. package/HiDatePicker/Overlays/TimePickerOverlay.js +4 -4
  12. package/HiDatePicker/Overlays/YearPickerOverlay.js +3 -3
  13. package/HiDotsStepper/HiDotsStepper.js +4 -4
  14. package/HiExpansionPanel/HiExpansionPanel.js +41 -9
  15. package/HiForm/HiAddressField.js +7 -7
  16. package/HiForm/HiEmailField.js +3 -3
  17. package/HiForm/HiFormControl.js +6 -6
  18. package/HiForm/HiInput.js +11 -11
  19. package/HiForm/HiPasswordField.js +3 -3
  20. package/HiForm/HiSearchField.js +5 -5
  21. package/HiForm/HiTextField.js +5 -5
  22. package/HiForm/HiUpload.js +2 -2
  23. package/HiMap/HiMap.js +6 -6
  24. package/HiMap/HiMapExpand.js +4 -4
  25. package/HiNotice/HiKPI.js +3 -3
  26. package/HiSelect/HiDynamicSelect.js +7 -7
  27. package/HiSelect/HiNestedSelect.js +12 -12
  28. package/HiSelect/HiNestedSelectContent.js +9 -9
  29. package/HiSelect/HiSelect.js +25 -23
  30. package/HiSelect/HiSelectContent.js +13 -13
  31. package/HiSelect/HiSelectInput.js +7 -7
  32. package/HiSelect/HiSuggestSelect.js +6 -6
  33. package/HiSelectableList/HiSelectableList.js +50 -2
  34. package/HiSelectableList/HiSelectableListItem.js +4 -4
  35. package/HiTable/HiTable.js +3 -3
  36. package/HiTable/HiTableRow.js +5 -5
  37. package/README.md +1 -1
  38. package/es/HiAlertModal/HiAlertModal.js +28 -29
  39. package/es/HiBreadcrumb/HiBreadcrumb.js +5 -4
  40. package/es/HiExpansionPanel/HiExpansionPanel.js +41 -10
  41. package/es/HiForm/HiUpload.js +2 -2
  42. package/es/HiSelect/HiSelect.js +6 -4
  43. package/es/HiSelectableList/HiSelectableList.js +45 -2
  44. package/es/HiTable/HiTableRow.js +2 -2
  45. package/index.es.js +1 -1
  46. package/index.js +1 -1
  47. package/package.json +3 -2
  48. package/umd/hipay-material-ui.development.js +4103 -12432
  49. package/umd/hipay-material-ui.production.min.js +2 -2
@@ -7,6 +7,7 @@ import withStyles from '../styles/withStyles';
7
7
  import HiSelectableListItem from './HiSelectableListItem';
8
8
  import { getNextItemSelectable, foldAccents } from '../utils/helpers';
9
9
  import keycode from 'keycode';
10
+ import LazyLoad, { forceCheck } from 'react-lazyload';
10
11
  export const styles = () => ({
11
12
  root: {
12
13
  padding: 0
@@ -52,18 +53,35 @@ class HiSelectableList extends React.PureComponent {
52
53
  hideCheckbox,
53
54
  hoverIcon,
54
55
  icon,
56
+ lazy,
55
57
  selectedItemIdList,
56
58
  sort,
57
59
  onKeyDown,
58
60
  onKeyUp
59
61
  } = _this$props,
60
- others = _objectWithoutProperties(_this$props, ["checkedIcon", "disabled", "disabledItemIdList", "hideCheckbox", "hoverIcon", "icon", "selectedItemIdList", "sort", "onKeyDown", "onKeyUp"]);
62
+ others = _objectWithoutProperties(_this$props, ["checkedIcon", "disabled", "disabledItemIdList", "hideCheckbox", "hoverIcon", "icon", "lazy", "selectedItemIdList", "sort", "onKeyDown", "onKeyUp"]);
61
63
 
62
64
  if (sort && item.children) {
63
65
  item.children.sort(this.compareItem);
64
66
  }
65
67
 
66
- return React.createElement(React.Fragment, {
68
+ const placeholderContent = React.createElement("div", {
69
+ style: {
70
+ width: '90%',
71
+ padding: '8px 6px',
72
+ height: 40,
73
+ position: 'sticky',
74
+ left: 0
75
+ }
76
+ }, React.createElement("div", {
77
+ style: {
78
+ backgroundColor: '#F5F5F5',
79
+ width: '100%',
80
+ height: '100%',
81
+ borderRadius: 4
82
+ }
83
+ }));
84
+ const itemComponent = React.createElement(React.Fragment, {
67
85
  key: item.id
68
86
  }, React.createElement(HiSelectableListItem, _extends({}, others, {
69
87
  checkedIcon: checkedIcon,
@@ -79,6 +97,19 @@ class HiSelectableList extends React.PureComponent {
79
97
  ,
80
98
  item: item
81
99
  }, item)), item.children && item.children.length > 0 && item.children.filter(subItem => !(subItem.displayed === false)).map(subItem => this.buildRecursiveListItem(subItem, level + 1)));
100
+
101
+ if (lazy) {
102
+ return React.createElement(LazyLoad, {
103
+ key: item.id,
104
+ height: 40,
105
+ offset: 400,
106
+ once: true,
107
+ overflow: true,
108
+ placeholder: placeholderContent
109
+ }, itemComponent);
110
+ } else {
111
+ return itemComponent;
112
+ }
82
113
  };
83
114
 
84
115
  this.compareItem = (a, b) => {
@@ -133,6 +164,12 @@ class HiSelectableList extends React.PureComponent {
133
164
  }
134
165
  }
135
166
 
167
+ componentDidUpdate(prevProps) {
168
+ if (this.props.lazy && prevProps.itemList !== this.props.itemList) {
169
+ forceCheck();
170
+ }
171
+ }
172
+
136
173
  render() {
137
174
  const {
138
175
  classes,
@@ -161,6 +198,7 @@ HiSelectableList.defaultProps = {
161
198
  disabled: false,
162
199
  disabledItemIdList: [],
163
200
  hideCheckbox: false,
201
+ lazy: true,
164
202
  selectedItemIdList: [],
165
203
  sort: false,
166
204
  sortAppendList: ['_all']
@@ -216,6 +254,11 @@ HiSelectableList.propTypes = process.env.NODE_ENV !== "production" ? {
216
254
  */
217
255
  itemList: PropTypes.array.isRequired,
218
256
 
257
+ /**
258
+ * Active lazyloading on list items
259
+ */
260
+ lazy: PropTypes.bool,
261
+
219
262
  /**
220
263
  * Fonction de callback à la sélection d'un item, renvoie l'item sélectionné
221
264
  *
@@ -19,7 +19,7 @@ export const styles = theme => ({
19
19
  backgroundColor: `${theme.palette.action.hover} !important`
20
20
  }
21
21
  },
22
- clicableRow: {
22
+ clickableRow: {
23
23
  cursor: 'pointer'
24
24
  }
25
25
  });
@@ -47,7 +47,7 @@ class HiTableRow extends React.PureComponent {
47
47
  } = this.props;
48
48
  return React.createElement(TableRow, {
49
49
  className: classNames(classes.row, {
50
- [classes.clicableRow]: this.props.onClick
50
+ [classes.clickableRow]: this.props.onClick
51
51
  }),
52
52
  hover: true,
53
53
  onClick: event => this.handleClick(event, rowdata),
package/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license HiPay-Material-UI v2.0.0-beta.65
1
+ /** @license HiPay-Material-UI v2.0.0-beta.68
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.65
1
+ /** @license HiPay-Material-UI v2.0.0-beta.68
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.66",
5
+ "version": "2.0.0-beta.68",
6
6
  "description": "React components that implement Google's Material Design.",
7
7
  "keywords": [
8
8
  "react",
@@ -58,6 +58,7 @@
58
58
  "react-day-picker": "^7.2.4",
59
59
  "react-event-listener": "^0.6.2",
60
60
  "react-jss": "^8.1.0",
61
+ "react-lazyload": "^2.5.0",
61
62
  "react-leaflet": "^2.1.0",
62
63
  "react-pdf": "^3.0.5",
63
64
  "react-spinners": "^0.4.5",
@@ -73,4 +74,4 @@
73
74
  },
74
75
  "main": "./index.js",
75
76
  "module": "./index.es.js"
76
- }
77
+ }