@hipay/hipay-material-ui 1.0.0-beta.23 → 1.0.0-beta.26
Sign up to get free protection for your applications and to get access to all the features.
- package/HI-CHANGELOG.md +58 -39
- package/HiChip/HiChip.js +67 -8
- package/HiDatePicker/HiDateRangePicker.js +27 -13
- package/HiDatePicker/HiDateRangeSelector.js +13 -2
- package/HiForm/HiInput.js +1 -0
- package/HiForm/HiPasswordField.js +2 -2
- package/HiPins/HiPins.js +6 -4
- package/HiSelect/HiSelect.js +28 -20
- package/HiSelect/SelectInput.js +3 -8
- package/HiSelectableList/HiSelectableList.js +51 -49
- package/HiSelectableList/HiSelectableListItem.js +7 -5
- package/HiTable/BodyCellBuilder.js +25 -14
- package/HiTable/BodyCells/CellAccount.js +13 -15
- package/HiTable/BodyCells/CellAccountNumber.js +12 -3
- package/HiTable/BodyCells/CellAddress.js +12 -3
- package/HiTable/BodyCells/CellCountry.js +12 -3
- package/HiTable/BodyCells/CellDate.js +56 -52
- package/HiTable/BodyCells/CellIcon.js +12 -3
- package/HiTable/BodyCells/CellImage.js +12 -3
- package/HiTable/BodyCells/CellNumeric.js +12 -3
- package/HiTable/BodyCells/CellRate.js +12 -3
- package/HiTable/BodyCells/CellSentinel.js +17 -7
- package/HiTable/BodyCells/CellStatus.js +12 -3
- package/HiTable/BodyCells/CellText.js +75 -37
- package/HiTable/BodyCells/CellThirdPartySecurity.js +12 -3
- package/HiTable/BodyRow.js +12 -3
- package/HiTable/ColumnFilter.js +1 -4
- package/HiTable/HeaderCell.js +21 -11
- package/HiTable/HiStickyRow.js +27 -16
- package/HiTable/HiTable.js +30 -69
- package/HiTable/HiTableBody.js +99 -29
- package/HiTable/HiTableContextMenu.js +31 -16
- package/HiTable/HiTableFooter.js +9 -0
- package/HiTable/HiTableHead.js +15 -7
- package/HiTopBar/HiTopBar.js +6 -0
- package/README.md +72 -6
- package/es/HiChip/HiChip.js +81 -9
- package/es/HiDatePicker/HiDateRangePicker.js +25 -12
- package/es/HiDatePicker/HiDateRangeSelector.js +12 -2
- package/es/HiForm/HiInput.js +1 -0
- package/es/HiForm/HiPasswordField.js +2 -2
- package/es/HiPins/HiPins.js +4 -4
- package/es/HiSelect/HiSelect.js +25 -16
- package/es/HiSelect/SelectInput.js +3 -8
- package/es/HiSelectableList/HiSelectableList.js +51 -49
- package/es/HiSelectableList/HiSelectableListItem.js +7 -5
- package/es/HiTable/BodyCellBuilder.js +11 -4
- package/es/HiTable/BodyCells/CellAccount.js +7 -5
- package/es/HiTable/BodyCells/CellAccountNumber.js +6 -1
- package/es/HiTable/BodyCells/CellAddress.js +6 -1
- package/es/HiTable/BodyCells/CellCountry.js +6 -1
- package/es/HiTable/BodyCells/CellDate.js +35 -40
- package/es/HiTable/BodyCells/CellIcon.js +6 -1
- package/es/HiTable/BodyCells/CellImage.js +6 -1
- package/es/HiTable/BodyCells/CellNumeric.js +6 -1
- package/es/HiTable/BodyCells/CellRate.js +6 -1
- package/es/HiTable/BodyCells/CellSentinel.js +6 -1
- package/es/HiTable/BodyCells/CellStatus.js +6 -1
- package/es/HiTable/BodyCells/CellText.js +50 -20
- package/es/HiTable/BodyCells/CellThirdPartySecurity.js +6 -1
- package/es/HiTable/BodyRow.js +7 -2
- package/es/HiTable/ColumnFilter.js +1 -4
- package/es/HiTable/HeaderCell.js +16 -9
- package/es/HiTable/HiStickyRow.js +21 -14
- package/es/HiTable/HiTable.js +4 -40
- package/es/HiTable/HiTableBody.js +78 -26
- package/es/HiTable/HiTableContextMenu.js +28 -16
- package/es/HiTable/HiTableFooter.js +5 -0
- package/es/HiTable/HiTableHead.js +11 -6
- package/es/HiTopBar/HiTopBar.js +5 -0
- package/es/svg-icons/Cancel.js +2 -0
- package/es/svg-icons/HiBriefcaseRescue.js +15 -0
- package/es/svg-icons/index.js +2 -1
- package/es/utils/HiIconBuilder.js +6 -2
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +7 -1
- package/svg-icons/Cancel.js +2 -0
- package/svg-icons/HiBriefcaseRescue.js +30 -0
- package/svg-icons/index.js +9 -0
- package/umd/hipay-material-ui.development.js +110915 -119592
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/HiIconBuilder.js +6 -2
package/HI-CHANGELOG.md
CHANGED
@@ -1,58 +1,77 @@
|
|
1
|
-
|
1
|
+
<a name="1.0.0-beta.26"></a>
|
2
|
+
# 1.0.0-beta.26 (2018-08-24)
|
2
3
|
|
3
|
-
Changes. Changes everywhere!
|
4
4
|
|
5
|
-
|
6
|
-
###### *17 mai 2018*
|
5
|
+
### Bug Fixes
|
7
6
|
|
8
|
-
|
7
|
+
* **BodyRow:** add locale vars to child BodyRow ([9252382](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9252382))
|
8
|
+
* **CellDate:** Handle date with moment & use prop format ([7fa8bf5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7fa8bf5))
|
9
|
+
* **HeaderCell:** set sort icons always on the right of the title ([0704619](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0704619))
|
10
|
+
* **HiDateRangePicker:** Keep focus on change dateTo if user types directly into the input to see date selection into calendar ([e998c60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e998c60))
|
11
|
+
* **HiDateRangePicker:** Reset date range picker input to ([b1a66f3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1a66f3))
|
12
|
+
* **HiDateRangeSelector:** UPD select value from parent component (defaultPreset property) ([90bb994](https://gitlab.hipay.org/backend/hipay-material-ui/commit/90bb994))
|
13
|
+
* **HiInput:** Keep focus on reset HiInput ([a84edab](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a84edab))
|
14
|
+
* **HiPins:** Add theme business primary color as default background color for HiPins and fix line-height ([23aa2d9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/23aa2d9))
|
15
|
+
* **HiSelect:** add dynamic prop to handle dynamic select with initial options ([c668b90](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c668b90))
|
16
|
+
* **HiSelect:** Display option label instead of all for selects with 1 option ([e47574a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e47574a))
|
17
|
+
* **HiSelect:** Don't try to display unique selected options item when still loading ([116a72a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/116a72a))
|
18
|
+
* **HiSelect:** Enable to handle hierarchic padding via options prop level ([dc4e5d8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/dc4e5d8))
|
19
|
+
* **HiSelect:** Handle unique and undefined selected item ([8dbb542](https://gitlab.hipay.org/backend/hipay-material-ui/commit/8dbb542))
|
20
|
+
* **HiSelectableList:** item displayed only if item.displayed != false ([e65b865](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e65b865))
|
21
|
+
* **HiTable:** Add default translations object to HeaderCell ([4ed766f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4ed766f))
|
22
|
+
* **HiTable:** Performance optimization ([3ca60d3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/3ca60d3))
|
23
|
+
* **HiTable:** remove anchorEls from state to remove circular structure in JSON compares ([c064ce9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c064ce9))
|
24
|
+
* **SelectInput:** selected choice label not overflowing on right arrow of HiSelect ([a7d7058](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a7d7058))
|
9
25
|
|
10
|
-
### Breaking change
|
11
26
|
|
12
|
-
|
27
|
+
### Features
|
13
28
|
|
14
|
-
|
29
|
+
* **CellText:** add color props ([ff2bba8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/ff2bba8))
|
30
|
+
* **HiChip:** enable to display tooltip on HiChip via the prop 'title' ([6b15ca6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6b15ca6))
|
31
|
+
* **HiDateRangePicker:** Add onBlur prop function to handle date errors properly ([df79494](https://gitlab.hipay.org/backend/hipay-material-ui/commit/df79494))
|
32
|
+
* **HiTableContextMenu:** handle hide lookup/exclude menu item for each column ([03e00cb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/03e00cb))
|
33
|
+
* **workflow:** Add HI-CHANGELOG generation from commits ([edee0f6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/edee0f6))
|
15
34
|
|
16
|
-
- [HiSelect] Ajout d'un param staticPosition dans le HiSelect pour afficher dans une div plutot qu'une popper
|
17
|
-
- [HiSelect] Fermeture du select au click sur le bouton
|
18
|
-
- [SelectInput] cursor pointer si noButton
|
19
|
-
- [HiDateRangeSelector] Suppression du last 24h
|
20
35
|
|
21
|
-
## 1.0.0-beta.4
|
22
|
-
###### *06 avril 2018*
|
23
36
|
|
24
|
-
-
|
25
|
-
-
|
37
|
+
<a name="1.0.0-beta.25"></a>
|
38
|
+
# 1.0.0-beta.25 (2018-08-16)
|
26
39
|
|
27
|
-
### Breaking change
|
28
40
|
|
29
|
-
|
41
|
+
### Bug Fixes
|
30
42
|
|
31
|
-
|
43
|
+
* **BodyRow:** add locale vars to child BodyRow ([9252382](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9252382))
|
44
|
+
* **CellDate:** Handle date with moment & use prop format ([7fa8bf5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7fa8bf5))
|
45
|
+
* **HeaderCell:** set sort icons always on the right of the title ([0704619](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0704619))
|
46
|
+
* **HiDateRangePicker:** Keep focus on change dateTo if user types directly into the input to see date selection into calendar ([e998c60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e998c60))
|
47
|
+
* **HiDateRangePicker:** Reset date range picker input to ([b1a66f3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1a66f3))
|
48
|
+
* **HiDateRangeSelector:** UPD select value from parent component (defaultPreset property) ([90bb994](https://gitlab.hipay.org/backend/hipay-material-ui/commit/90bb994))
|
49
|
+
* **HiInput:** Keep focus on reset HiInput ([a84edab](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a84edab))
|
50
|
+
* **HiPins:** Add theme business primary color as default background color for HiPins and fix line-height ([23aa2d9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/23aa2d9))
|
51
|
+
* **HiSelect:** Display option label instead of all for selects with 1 option ([e47574a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e47574a))
|
52
|
+
* **HiSelect:** Don't try to display unique selected options item when still loading ([116a72a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/116a72a))
|
53
|
+
* **HiSelectableList:** item displayed only if item.displayed != false ([e65b865](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e65b865))
|
54
|
+
* **HiTable:** Add default translations object to HeaderCell ([4ed766f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4ed766f))
|
55
|
+
* **HiTable:** Performance optimization ([3ca60d3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/3ca60d3))
|
56
|
+
* **HiTable:** remove anchorEls from state to remove circular structure in JSON compares ([c064ce9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c064ce9))
|
57
|
+
* **SelectInput:** selected choice label not overflowing on right arrow of HiSelect ([a7d7058](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a7d7058))
|
32
58
|
|
33
|
-
- [HiTopBar] Ajout d'une props refButtons poutr récupérer la div contenant les boutons "menu" et "back"
|
34
|
-
- [HiSelect] Gestion d'une value vide
|
35
|
-
- [HiSelect] Ajout du focus sur l'élement SelectInput à la fermeture du select
|
36
|
-
- [HiSelectField] Ajout de la props className
|
37
|
-
- [HiSuggestSelectField] Ajout de la props className
|
38
|
-
- [HiSuggestSelect] Gestion du focus et du open des suggestions
|
39
|
-
- [SelectInput] Suppression du soulignage bleu au hover quand champs en erreur
|
40
|
-
- [HiFormControl] Stop de l'event click sur error pour ne pas ouvrir le select
|
41
59
|
|
42
|
-
|
43
|
-
###### *28 mars 2018*
|
60
|
+
### Features
|
44
61
|
|
45
|
-
|
46
|
-
|
62
|
+
* **HiDateRangePicker:** Add onBlur prop function to handle date errors properly ([df79494](https://gitlab.hipay.org/backend/hipay-material-ui/commit/df79494))
|
63
|
+
* **HiTableContextMenu:** handle hide lookup/exclude menu item for each column ([03e00cb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/03e00cb))
|
64
|
+
* **workflow:** Add HI-CHANGELOG generation from commits ([edee0f6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/edee0f6))
|
47
65
|
|
48
|
-
### Breaking change
|
49
66
|
|
50
|
-
- [HiTopBar] Ajout d'une props "searchInput" obligatoire
|
51
67
|
|
52
|
-
|
68
|
+
<a name="1.0.0-beta.24"></a>
|
69
|
+
# 1.0.0-beta.24 (2018-07-26)
|
70
|
+
|
71
|
+
|
72
|
+
### Features
|
73
|
+
|
74
|
+
* **workflow:** Add HI-CHANGELOG generation from commits ([edee0f6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/edee0f6))
|
75
|
+
|
76
|
+
|
53
77
|
|
54
|
-
- [HiTopBar] Ajout du style "overflow: 'inherit'" sur le Collapse si pas "hideable", afin de ne pas cacher les suggestions
|
55
|
-
- [HiTopBar] Gestion du focus en props plutôt qu'en state
|
56
|
-
- [HiTopBar] Ajout d'une props "searchInput" obligatoire
|
57
|
-
- [HiChipSwitch] Ajout d'un title sur la sélection
|
58
|
-
- [HiDateRangePicker] Correction du focus
|
package/HiChip/HiChip.js
CHANGED
@@ -58,14 +58,24 @@ var styles = exports.styles = function styles(theme) {
|
|
58
58
|
},
|
59
59
|
'&$deletable': {
|
60
60
|
paddingRight: 4
|
61
|
+
},
|
62
|
+
'&$leftIccon': {
|
63
|
+
paddingLeft: 4
|
61
64
|
}
|
62
65
|
}),
|
63
66
|
leftNavigation: {},
|
64
67
|
rightNavigation: {},
|
65
68
|
deletable: {},
|
69
|
+
leftIccon: {},
|
66
70
|
icon: {
|
67
71
|
marginRight: 4
|
68
72
|
},
|
73
|
+
iconClickable: {
|
74
|
+
cursor: 'pointer',
|
75
|
+
'&:hover, &:focus': {
|
76
|
+
color: theme.palette.business.primary.normal
|
77
|
+
}
|
78
|
+
},
|
69
79
|
eraseIcon: {
|
70
80
|
// Remove grey highlight
|
71
81
|
WebkitTapHighlightColor: 'transparent',
|
@@ -120,14 +130,22 @@ function HiChip(props) {
|
|
120
130
|
onPrevious = props.onPrevious,
|
121
131
|
onNext = props.onNext,
|
122
132
|
onDelete = props.onDelete,
|
123
|
-
prefix = props.prefix
|
133
|
+
prefix = props.prefix,
|
134
|
+
onIconClick = props.onIconClick,
|
135
|
+
title = props.title,
|
136
|
+
titleDelete = props.titleDelete,
|
137
|
+
titleIcon = props.titleIcon,
|
138
|
+
titleImg = props.titleImg,
|
139
|
+
titleNext = props.titleNext,
|
140
|
+
titlePrevious = props.titlePrevious;
|
124
141
|
|
125
142
|
|
126
143
|
return _react2.default.createElement(
|
127
144
|
'div',
|
128
145
|
{
|
129
146
|
id: id,
|
130
|
-
className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.leftNavigation, onPrevious), (0, _defineProperty3.default)(_classNames, classes.rightNavigation, onNext), (0, _defineProperty3.default)(_classNames, classes.deletable, onDelete), _classNames))
|
147
|
+
className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.leftNavigation, onPrevious), (0, _defineProperty3.default)(_classNames, classes.rightNavigation, onNext), (0, _defineProperty3.default)(_classNames, classes.deletable, onDelete), (0, _defineProperty3.default)(_classNames, classes.leftIccon, icon), _classNames)),
|
148
|
+
title: title
|
131
149
|
},
|
132
150
|
prefix && _react2.default.createElement(
|
133
151
|
'span',
|
@@ -135,13 +153,20 @@ function HiChip(props) {
|
|
135
153
|
prefix,
|
136
154
|
' : '
|
137
155
|
),
|
138
|
-
img && _react2.default.createElement('img', { className: classes.badge, src: img, alt: img }),
|
139
|
-
icon && _react2.default.createElement(_HiIconBuilder2.default, {
|
156
|
+
img && _react2.default.createElement('img', { className: classes.badge, src: img, alt: img, title: titleImg }),
|
157
|
+
icon && _react2.default.createElement(_HiIconBuilder2.default, {
|
158
|
+
className: (0, _classnames2.default)(classes.icon, (0, _defineProperty3.default)({}, classes.iconClickable, onIconClick)),
|
159
|
+
icon: icon,
|
160
|
+
size: 16,
|
161
|
+
onClick: onIconClick,
|
162
|
+
title: titleIcon
|
163
|
+
}),
|
140
164
|
onPrevious && _react2.default.createElement(_HiIconBuilder2.default, {
|
141
165
|
className: (0, _classnames2.default)(classes.navigate),
|
142
166
|
icon: 'menuLeft',
|
143
167
|
onClick: onPrevious,
|
144
|
-
size: 16
|
168
|
+
size: 16,
|
169
|
+
title: titlePrevious
|
145
170
|
}),
|
146
171
|
_react2.default.createElement(
|
147
172
|
'span',
|
@@ -152,13 +177,15 @@ function HiChip(props) {
|
|
152
177
|
className: (0, _classnames2.default)(classes.navigate),
|
153
178
|
icon: 'menuRight',
|
154
179
|
onClick: onNext,
|
155
|
-
size: 16
|
180
|
+
size: 16,
|
181
|
+
title: titleNext
|
156
182
|
}),
|
157
183
|
onDelete && _react2.default.createElement(_HiIconBuilder2.default, {
|
158
184
|
classes: { root: classes.eraseIcon },
|
159
185
|
icon: 'closeCircle',
|
160
186
|
onClick: onDelete,
|
161
|
-
size: 16
|
187
|
+
size: 16,
|
188
|
+
title: titleDelete
|
162
189
|
})
|
163
190
|
);
|
164
191
|
}
|
@@ -188,6 +215,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
188
215
|
* Fonction de callback au clic sur l'icon close si cancelable = true
|
189
216
|
*/
|
190
217
|
onDelete: _propTypes2.default.func,
|
218
|
+
/**
|
219
|
+
* Fonction de callback au clic sur l'icon à gauche
|
220
|
+
*/
|
221
|
+
onIconClick: _propTypes2.default.func,
|
191
222
|
/**
|
192
223
|
* Fonction de callback au clic sur l'icon next
|
193
224
|
*/
|
@@ -195,7 +226,35 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
195
226
|
/**
|
196
227
|
* Fonction de callback au clic sur l'icon previous
|
197
228
|
*/
|
198
|
-
onPrevious: _propTypes2.default.func
|
229
|
+
onPrevious: _propTypes2.default.func,
|
230
|
+
/**
|
231
|
+
* Préfixe dans le HiChip
|
232
|
+
*/
|
233
|
+
prefix: _propTypes2.default.string,
|
234
|
+
/**
|
235
|
+
* Titre du chip
|
236
|
+
*/
|
237
|
+
title: _propTypes2.default.string,
|
238
|
+
/**
|
239
|
+
* Titre de l'icône supprimer
|
240
|
+
*/
|
241
|
+
titleDelete: _propTypes2.default.string,
|
242
|
+
/**
|
243
|
+
* Titre de l'icône
|
244
|
+
*/
|
245
|
+
titleIcon: _propTypes2.default.string,
|
246
|
+
/**
|
247
|
+
* Titre de la balise img
|
248
|
+
*/
|
249
|
+
titleImg: _propTypes2.default.string,
|
250
|
+
/**
|
251
|
+
* Titre de la navigation suivante
|
252
|
+
*/
|
253
|
+
titleNext: _propTypes2.default.string,
|
254
|
+
/**
|
255
|
+
* Titre de la navigation précédente
|
256
|
+
*/
|
257
|
+
titlePrevious: _propTypes2.default.string
|
199
258
|
} : {};
|
200
259
|
|
201
260
|
exports.default = (0, _withStyles2.default)(styles, { name: 'HmuiHiChip' })(HiChip);
|
@@ -112,6 +112,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
112
112
|
|
113
113
|
_this.handleInputChange = function (inputName) {
|
114
114
|
return function (event) {
|
115
|
+
_this.event = event;
|
115
116
|
_this.props.onChange(inputName, event.target.value);
|
116
117
|
};
|
117
118
|
};
|
@@ -122,6 +123,15 @@ var HiDateRangePicker = function (_React$Component) {
|
|
122
123
|
};
|
123
124
|
};
|
124
125
|
|
126
|
+
_this.handleDayPickerBlur = function (name) {
|
127
|
+
return function () {
|
128
|
+
_this.setState({ focusedInput: '' });
|
129
|
+
if (_this.props.onBlur) {
|
130
|
+
_this.props.onBlur(name);
|
131
|
+
}
|
132
|
+
};
|
133
|
+
};
|
134
|
+
|
125
135
|
_this.state = {
|
126
136
|
fromCurrentMonth: props.from ? props.from : new Date(),
|
127
137
|
toCurrentMonth: props.to ? props.to : new Date(),
|
@@ -197,11 +207,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
197
207
|
value: function handleReset(name) {
|
198
208
|
var _this3 = this;
|
199
209
|
|
200
|
-
|
201
|
-
this.handleCurrentMonthChange(name, new Date());
|
202
|
-
} else {
|
203
|
-
this.handleCurrentMonthChange(name, this.props.from);
|
204
|
-
}
|
210
|
+
this.handleCurrentMonthChange(name, new Date());
|
205
211
|
|
206
212
|
this.timeout = setTimeout(function () {
|
207
213
|
if (_this3.props.onReset) {
|
@@ -222,7 +228,12 @@ var HiDateRangePicker = function (_React$Component) {
|
|
222
228
|
if (name === 'from' && this.toInput) {
|
223
229
|
this.toInput.getInput().focus();
|
224
230
|
} else if (name === 'to') {
|
225
|
-
|
231
|
+
if (typeof this.event === 'undefined' || this.event && this.event.type !== 'change') {
|
232
|
+
// trigger blur only if user clicks on date into calendar
|
233
|
+
// else keep focus to see day selection into calendar
|
234
|
+
document.activeElement.blur();
|
235
|
+
}
|
236
|
+
delete this.event;
|
226
237
|
}
|
227
238
|
}
|
228
239
|
} else {
|
@@ -350,11 +361,6 @@ var HiDateRangePicker = function (_React$Component) {
|
|
350
361
|
document.activeElement.blur();
|
351
362
|
}
|
352
363
|
}
|
353
|
-
}, {
|
354
|
-
key: 'handleDayPickerBlur',
|
355
|
-
value: function handleDayPickerBlur() {
|
356
|
-
this.setState({ focusedInput: '' });
|
357
|
-
}
|
358
364
|
}, {
|
359
365
|
key: 'openPanel',
|
360
366
|
value: function openPanel(name, panel) {
|
@@ -635,7 +641,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
635
641
|
{
|
636
642
|
className: classes.fromInput,
|
637
643
|
onFocus: this.handleDayPickerFocus('from'),
|
638
|
-
onBlur: this.handleDayPickerBlur
|
644
|
+
onBlur: this.handleDayPickerBlur('from')
|
639
645
|
},
|
640
646
|
_react2.default.createElement(
|
641
647
|
'div',
|
@@ -663,7 +669,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
663
669
|
{
|
664
670
|
className: toClass,
|
665
671
|
onFocus: this.handleDayPickerFocus('to'),
|
666
|
-
onBlur: this.handleDayPickerBlur
|
672
|
+
onBlur: this.handleDayPickerBlur('to')
|
667
673
|
},
|
668
674
|
_react2.default.createElement(_DayPickerInput2.default, {
|
669
675
|
ref: function ref(el) {
|
@@ -762,10 +768,18 @@ HiDateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
762
768
|
minimumDate: _propTypes2.default.instanceOf(Date),
|
763
769
|
/**
|
764
770
|
* Callback à la sélection d'une date
|
771
|
+
* @param {string} nom de l'input
|
772
|
+
*/
|
773
|
+
onBlur: _propTypes2.default.func,
|
774
|
+
/**
|
775
|
+
* Callback à la sélection d'une date
|
776
|
+
* @param {string} nom du champs
|
777
|
+
* @param {string} nouvelle valeur du champs
|
765
778
|
*/
|
766
779
|
onChange: _propTypes2.default.func,
|
767
780
|
/**
|
768
781
|
* Callback au reset de l'input
|
782
|
+
* @param {string} nom du champs réinitialisé
|
769
783
|
*/
|
770
784
|
onReset: _propTypes2.default.func,
|
771
785
|
/**
|
@@ -100,13 +100,13 @@ function buildDateRangeOptionByKey(key, t, format) {
|
|
100
100
|
label = t.current_week;
|
101
101
|
from = (0, _moment2.default)().startOf('week');
|
102
102
|
to = (0, _moment2.default)();
|
103
|
-
info =
|
103
|
+
info = '' + t.short_week + from.format('w') + ', \n ' + from.format(format) + ' ' + t.to_now;
|
104
104
|
break;
|
105
105
|
case 'pw':
|
106
106
|
label = t.previous_week;
|
107
107
|
from = (0, _moment2.default)().subtract(1, 'week').startOf('week');
|
108
108
|
to = (0, _moment2.default)().subtract(1, 'week').endOf('week');
|
109
|
-
info =
|
109
|
+
info = '' + t.short_week + from.format('w') + ', ' + from.format(format) + ' ' + t.to + ' ' + to.format(format);
|
110
110
|
break;
|
111
111
|
case 'cm':
|
112
112
|
label = t.current_month;
|
@@ -308,6 +308,16 @@ var HiDateRangeSelector = function (_React$Component) {
|
|
308
308
|
)
|
309
309
|
);
|
310
310
|
}
|
311
|
+
}], [{
|
312
|
+
key: 'getDerivedStateFromProps',
|
313
|
+
value: function getDerivedStateFromProps(props, state) {
|
314
|
+
if (props.defaultPreset && props.returnSelectValue) {
|
315
|
+
return {
|
316
|
+
selectedPreset: props.defaultPreset
|
317
|
+
};
|
318
|
+
}
|
319
|
+
return null;
|
320
|
+
}
|
311
321
|
}]);
|
312
322
|
return HiDateRangeSelector;
|
313
323
|
}(_react2.default.Component);
|
@@ -327,6 +337,7 @@ HiDateRangeSelector.defaultProps = {
|
|
327
337
|
month: 'Month',
|
328
338
|
quarter: 'Quarter',
|
329
339
|
week: 'Week',
|
340
|
+
short_week: 'W',
|
330
341
|
year: 'Year',
|
331
342
|
days: 'days',
|
332
343
|
custom_period: 'Custom Period',
|
package/HiForm/HiInput.js
CHANGED
@@ -63,9 +63,9 @@ var styles = exports.styles = function styles(theme) {
|
|
63
63
|
return {
|
64
64
|
inputPassword: {
|
65
65
|
fontWeight: 'bolder',
|
66
|
-
fontFamily: '
|
66
|
+
fontFamily: 'inherit',
|
67
67
|
letterSpacing: '4px',
|
68
|
-
fontSize:
|
68
|
+
fontSize: '1.6rem'
|
69
69
|
}
|
70
70
|
};
|
71
71
|
};
|
package/HiPins/HiPins.js
CHANGED
@@ -37,7 +37,7 @@ var styles = exports.styles = function styles(theme) {
|
|
37
37
|
display: 'inline-block',
|
38
38
|
padding: '0 9px',
|
39
39
|
height: 16,
|
40
|
-
lineHeight: '
|
40
|
+
lineHeight: '18px',
|
41
41
|
minWidth: 25,
|
42
42
|
textAlign: 'center',
|
43
43
|
borderRadius: '45px',
|
@@ -64,13 +64,15 @@ var styles = exports.styles = function styles(theme) {
|
|
64
64
|
|
65
65
|
function HiPins(props) {
|
66
66
|
var classes = props.classes,
|
67
|
+
theme = props.theme,
|
67
68
|
children = props.children,
|
68
|
-
color = props.color,
|
69
|
+
_props$color = props.color,
|
70
|
+
color = _props$color === undefined ? props.theme.palette.business.primary.normal : _props$color,
|
69
71
|
onClick = props.onClick,
|
70
72
|
className = props.className;
|
71
73
|
|
72
74
|
|
73
|
-
var textColor = (0, _colorManipulator.getContrastedTextColor)(color,
|
75
|
+
var textColor = (0, _colorManipulator.getContrastedTextColor)(color, theme.palette.neutral.dark, '#FFF');
|
74
76
|
|
75
77
|
var divProps = {
|
76
78
|
style: { backgroundColor: color, color: textColor }
|
@@ -92,7 +94,7 @@ HiPins.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
92
94
|
children: _propTypes2.default.node.isRequired,
|
93
95
|
classes: _propTypes2.default.object.isRequired,
|
94
96
|
className: _propTypes2.default.string,
|
95
|
-
color: _propTypes2.default.string
|
97
|
+
color: _propTypes2.default.string,
|
96
98
|
onClick: _propTypes2.default.func
|
97
99
|
} : {};
|
98
100
|
exports.default = (0, _styles.withStyles)(styles, { withTheme: true, name: 'HmuiHiPins' })(HiPins);
|
package/HiSelect/HiSelect.js
CHANGED
@@ -162,7 +162,7 @@ var HiSelect = function (_React$PureComponent) {
|
|
162
162
|
hierarchySelected: {},
|
163
163
|
hierarchy: {},
|
164
164
|
nbOptions: 0,
|
165
|
-
dynamic: false
|
165
|
+
dynamic: props.dynamic || false
|
166
166
|
};
|
167
167
|
|
168
168
|
// Check if value is in options
|
@@ -205,7 +205,7 @@ var HiSelect = function (_React$PureComponent) {
|
|
205
205
|
}
|
206
206
|
});
|
207
207
|
_this.state.nbOptions = optionsLength;
|
208
|
-
} else {
|
208
|
+
} else if (!props.dynamic) {
|
209
209
|
_this.state.dynamic = true;
|
210
210
|
}
|
211
211
|
|
@@ -314,11 +314,13 @@ var HiSelect = function (_React$PureComponent) {
|
|
314
314
|
id = _props.id,
|
315
315
|
placeholder = _props.placeholder,
|
316
316
|
staticPosition = _props.staticPosition,
|
317
|
-
pinnedItem = _props.pinnedItem
|
317
|
+
pinnedItem = _props.pinnedItem,
|
318
|
+
hasAll = _props.hasAll;
|
318
319
|
var _state = this.state,
|
319
320
|
open = _state.open,
|
320
321
|
suggestions = _state.suggestions,
|
321
|
-
focused = _state.focused
|
322
|
+
focused = _state.focused,
|
323
|
+
dynamic = _state.dynamic;
|
322
324
|
|
323
325
|
|
324
326
|
var display = '';
|
@@ -342,30 +344,29 @@ var HiSelect = function (_React$PureComponent) {
|
|
342
344
|
});
|
343
345
|
}
|
344
346
|
|
345
|
-
if (
|
346
|
-
display = translations.one_item_selected
|
347
|
-
} else if (this.state.nbOptions !== selectedIdList.length && selectedIdList.length > 1) {
|
347
|
+
if ((dynamic || loading) && selectedIdList.length === 1) {
|
348
|
+
display = translations.one_item_selected;
|
349
|
+
} else if ((this.state.nbOptions !== selectedIdList.length || !hasAll) && selectedIdList.length > 1) {
|
348
350
|
display = translations.n_items_selected.replace('%s', selectedIdList.length);
|
349
|
-
} else if (this.state.nbOptions === selectedIdList.length && this.state.nbOptions
|
351
|
+
} else if (this.state.nbOptions === selectedIdList.length && this.state.nbOptions > 1) {
|
350
352
|
display = translations.all;
|
351
353
|
} else if (selectedIdList.length === 1) {
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
354
|
+
var item = options.find(function (o) {
|
355
|
+
return o.id === selectedIdList[0];
|
356
|
+
});
|
357
|
+
if (item === undefined) {
|
358
|
+
display = translations.one_item_selected;
|
359
|
+
} else if (type !== 'icon') {
|
360
|
+
if (pinnedItem) {
|
357
361
|
item = pinnedItem;
|
358
362
|
}
|
359
363
|
display = item.label;
|
360
364
|
} else {
|
361
|
-
var optionSelected = options.find(function (o) {
|
362
|
-
return o.id === selectedIdList[0];
|
363
|
-
});
|
364
365
|
display = _react2.default.createElement(
|
365
366
|
'span',
|
366
367
|
{ className: classes.selectIconLabel },
|
367
|
-
_react2.default.createElement(_HiIconBuilder2.default, { icon:
|
368
|
-
|
368
|
+
_react2.default.createElement(_HiIconBuilder2.default, { icon: item.icon, className: classes.labelIcon }),
|
369
|
+
item.label
|
369
370
|
);
|
370
371
|
}
|
371
372
|
}
|
@@ -499,6 +500,7 @@ HiSelect.defaultProps = {
|
|
499
500
|
hierarchic: false,
|
500
501
|
parentItemSelectable: false,
|
501
502
|
displayAsChip: false,
|
503
|
+
dynamic: false,
|
502
504
|
icon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
503
505
|
parentIcon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
504
506
|
hoverIcon: _react2.default.createElement(_mdiMaterialUi.CheckboxBlankOutline, { style: { width: 20, height: 20 } }),
|
@@ -741,9 +743,9 @@ var _initialiseProps = function _initialiseProps() {
|
|
741
743
|
}
|
742
744
|
}
|
743
745
|
_this3.setState({ hierarchySelected: hiSelected });
|
744
|
-
onChange(event, valueList);
|
746
|
+
onChange(event, valueList, item);
|
745
747
|
} else {
|
746
|
-
onChange(event, item.id);
|
748
|
+
onChange(event, item.id, item);
|
747
749
|
_this3.handleClose();
|
748
750
|
}
|
749
751
|
};
|
@@ -818,6 +820,12 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
818
820
|
* Option permettant d'afficher les sélection sous forme de Chip.
|
819
821
|
*/
|
820
822
|
displayAsChip: _propTypes2.default.bool,
|
823
|
+
/**
|
824
|
+
* Option permettant de définir si les options du select sont dynamiques.
|
825
|
+
* Si les options du select sont initialisées à vide, alors ce sera mis à true
|
826
|
+
* automatiquement.
|
827
|
+
*/
|
828
|
+
dynamic: _propTypes2.default.bool.isRequired,
|
821
829
|
/**
|
822
830
|
* Applique le style error
|
823
831
|
*/
|
package/HiSelect/SelectInput.js
CHANGED
@@ -67,7 +67,8 @@ var styles = exports.styles = function styles(theme) {
|
|
67
67
|
width: '100%',
|
68
68
|
height: 40,
|
69
69
|
maxWidth: 500,
|
70
|
-
|
70
|
+
display: 'flex',
|
71
|
+
justifyContent: 'center',
|
71
72
|
padding: 8,
|
72
73
|
cursor: 'pointer'
|
73
74
|
},
|
@@ -142,18 +143,12 @@ var styles = exports.styles = function styles(theme) {
|
|
142
143
|
label: (0, _extends3.default)({
|
143
144
|
whiteSpace: 'nowrap',
|
144
145
|
overflow: 'hidden',
|
145
|
-
textOverflow: 'ellipsis'
|
146
|
-
paddingRight: 16
|
146
|
+
textOverflow: 'ellipsis'
|
147
147
|
}, theme.typography.body1, {
|
148
148
|
display: 'inline-flex',
|
149
149
|
width: '100%'
|
150
150
|
}),
|
151
151
|
icon: {
|
152
|
-
position: 'absolute',
|
153
|
-
display: 'flex',
|
154
|
-
alignItems: 'center',
|
155
|
-
right: 0,
|
156
|
-
height: 40,
|
157
152
|
transition: theme.transitions.create(['opacity', 'transform'], {
|
158
153
|
duration: theme.transitions.duration.shorter
|
159
154
|
})
|