@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.
- package/CHANGELOG.md +75 -0
- package/HiAlertModal/HiAlertModal.js +32 -32
- package/HiAppBar/HiAppBar.js +3 -3
- package/HiBreadcrumb/HiBreadcrumb.js +5 -4
- package/HiBreadcrumb/HiStepConnector.js +3 -3
- package/HiCell/CellText.js +3 -3
- package/HiCheckbox/HiCheckbox.js +3 -3
- package/HiChip/HiChipSwitch.js +5 -5
- package/HiDatePicker/HiDatePicker.js +17 -17
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +3 -3
- package/HiDatePicker/Overlays/TimePickerOverlay.js +4 -4
- package/HiDatePicker/Overlays/YearPickerOverlay.js +3 -3
- package/HiDotsStepper/HiDotsStepper.js +4 -4
- package/HiExpansionPanel/HiExpansionPanel.js +41 -9
- package/HiForm/HiAddressField.js +7 -7
- package/HiForm/HiEmailField.js +3 -3
- package/HiForm/HiFormControl.js +6 -6
- package/HiForm/HiInput.js +11 -11
- package/HiForm/HiPasswordField.js +3 -3
- package/HiForm/HiSearchField.js +5 -5
- package/HiForm/HiTextField.js +5 -5
- package/HiForm/HiUpload.js +2 -2
- package/HiMap/HiMap.js +6 -6
- package/HiMap/HiMapExpand.js +4 -4
- package/HiNotice/HiKPI.js +3 -3
- package/HiSelect/HiDynamicSelect.js +7 -7
- package/HiSelect/HiNestedSelect.js +12 -12
- package/HiSelect/HiNestedSelectContent.js +9 -9
- package/HiSelect/HiSelect.js +25 -23
- package/HiSelect/HiSelectContent.js +13 -13
- package/HiSelect/HiSelectInput.js +7 -7
- package/HiSelect/HiSuggestSelect.js +6 -6
- package/HiSelectableList/HiSelectableList.js +50 -2
- package/HiSelectableList/HiSelectableListItem.js +4 -4
- package/HiTable/HiTable.js +3 -3
- package/HiTable/HiTableRow.js +5 -5
- package/README.md +1 -1
- package/es/HiAlertModal/HiAlertModal.js +28 -29
- package/es/HiBreadcrumb/HiBreadcrumb.js +5 -4
- package/es/HiExpansionPanel/HiExpansionPanel.js +41 -10
- package/es/HiForm/HiUpload.js +2 -2
- package/es/HiSelect/HiSelect.js +6 -4
- package/es/HiSelectableList/HiSelectableList.js +45 -2
- package/es/HiTable/HiTableRow.js +2 -2
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +3 -2
- package/umd/hipay-material-ui.development.js +4103 -12432
- 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
|
-
|
|
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
|
*
|
package/es/HiTable/HiTableRow.js
CHANGED
|
@@ -19,7 +19,7 @@ export const styles = theme => ({
|
|
|
19
19
|
backgroundColor: `${theme.palette.action.hover} !important`
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
|
|
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.
|
|
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
package/index.js
CHANGED
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.
|
|
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
|
+
}
|