@hipay/hipay-material-ui 1.0.0-beta.23 → 1.0.0-beta.25
Sign up to get free protection for your applications and to get access to all the features.
- package/HI-CHANGELOG.md +26 -43
- package/HiChip/HiChip.js +61 -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 +7 -5
- package/HiSelect/SelectInput.js +3 -8
- package/HiSelectableList/HiSelectableList.js +51 -49
- package/HiSelectableList/HiSelectableListItem.js +4 -2
- package/HiTable/BodyCellBuilder.js +22 -12
- package/HiTable/BodyCells/CellAccount.js +12 -3
- 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 +43 -42
- 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 +17 -7
- 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 +24 -13
- 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 +71 -6
- package/es/HiChip/HiChip.js +74 -8
- 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 +6 -5
- package/es/HiSelect/SelectInput.js +3 -8
- package/es/HiSelectableList/HiSelectableList.js +51 -49
- package/es/HiSelectableList/HiSelectableListItem.js +4 -2
- package/es/HiTable/BodyCellBuilder.js +8 -2
- package/es/HiTable/BodyCells/CellAccount.js +6 -1
- 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 +28 -37
- 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 +6 -1
- 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 +20 -13
- 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/utils/HiIconBuilder.js +6 -2
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +6 -1
- package/umd/hipay-material-ui.development.js +80901 -47149
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/HiIconBuilder.js +6 -2
package/HI-CHANGELOG.md
CHANGED
@@ -1,58 +1,41 @@
|
|
1
|
-
|
1
|
+
<a name="1.0.0-beta.25"></a>
|
2
|
+
# 1.0.0-beta.25 (2018-08-16)
|
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:** Display option label instead of all for selects with 1 option ([e47574a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e47574a))
|
16
|
+
* **HiSelect:** Don't try to display unique selected options item when still loading ([116a72a](https://gitlab.hipay.org/backend/hipay-material-ui/commit/116a72a))
|
17
|
+
* **HiSelectableList:** item displayed only if item.displayed != false ([e65b865](https://gitlab.hipay.org/backend/hipay-material-ui/commit/e65b865))
|
18
|
+
* **HiTable:** Add default translations object to HeaderCell ([4ed766f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4ed766f))
|
19
|
+
* **HiTable:** Performance optimization ([3ca60d3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/3ca60d3))
|
20
|
+
* **HiTable:** remove anchorEls from state to remove circular structure in JSON compares ([c064ce9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c064ce9))
|
21
|
+
* **SelectInput:** selected choice label not overflowing on right arrow of HiSelect ([a7d7058](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a7d7058))
|
9
22
|
|
10
|
-
### Breaking change
|
11
23
|
|
12
|
-
|
24
|
+
### Features
|
13
25
|
|
14
|
-
|
26
|
+
* **HiDateRangePicker:** Add onBlur prop function to handle date errors properly ([df79494](https://gitlab.hipay.org/backend/hipay-material-ui/commit/df79494))
|
27
|
+
* **HiTableContextMenu:** handle hide lookup/exclude menu item for each column ([03e00cb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/03e00cb))
|
28
|
+
* **workflow:** Add HI-CHANGELOG generation from commits ([edee0f6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/edee0f6))
|
15
29
|
|
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
30
|
|
21
|
-
## 1.0.0-beta.4
|
22
|
-
###### *06 avril 2018*
|
23
31
|
|
24
|
-
-
|
25
|
-
-
|
32
|
+
<a name="1.0.0-beta.24"></a>
|
33
|
+
# 1.0.0-beta.24 (2018-07-26)
|
26
34
|
|
27
|
-
### Breaking change
|
28
35
|
|
29
|
-
|
36
|
+
### Features
|
30
37
|
|
31
|
-
|
38
|
+
* **workflow:** Add HI-CHANGELOG generation from commits ([edee0f6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/edee0f6))
|
32
39
|
|
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
40
|
|
42
|
-
## 1.0.0-beta.3
|
43
|
-
###### *28 mars 2018*
|
44
41
|
|
45
|
-
- Ajout d'un CHANGELOG HiPay ! (HI-CHANGELOG.md)
|
46
|
-
- Corrections de styles sur quelques composants
|
47
|
-
|
48
|
-
### Breaking change
|
49
|
-
|
50
|
-
- [HiTopBar] Ajout d'une props "searchInput" obligatoire
|
51
|
-
|
52
|
-
#### Component Fixes / Enhancements
|
53
|
-
|
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,20 @@ 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
|
+
titleDelete = props.titleDelete,
|
136
|
+
titleIcon = props.titleIcon,
|
137
|
+
titleImg = props.titleImg,
|
138
|
+
titleNext = props.titleNext,
|
139
|
+
titlePrevious = props.titlePrevious;
|
124
140
|
|
125
141
|
|
126
142
|
return _react2.default.createElement(
|
127
143
|
'div',
|
128
144
|
{
|
129
145
|
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))
|
146
|
+
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))
|
131
147
|
},
|
132
148
|
prefix && _react2.default.createElement(
|
133
149
|
'span',
|
@@ -135,13 +151,20 @@ function HiChip(props) {
|
|
135
151
|
prefix,
|
136
152
|
' : '
|
137
153
|
),
|
138
|
-
img && _react2.default.createElement('img', { className: classes.badge, src: img, alt: img }),
|
139
|
-
icon && _react2.default.createElement(_HiIconBuilder2.default, {
|
154
|
+
img && _react2.default.createElement('img', { className: classes.badge, src: img, alt: img, title: titleImg }),
|
155
|
+
icon && _react2.default.createElement(_HiIconBuilder2.default, {
|
156
|
+
className: (0, _classnames2.default)(classes.icon, (0, _defineProperty3.default)({}, classes.iconClickable, onIconClick)),
|
157
|
+
icon: icon,
|
158
|
+
size: 16,
|
159
|
+
onClick: onIconClick,
|
160
|
+
titleAccess: titleIcon
|
161
|
+
}),
|
140
162
|
onPrevious && _react2.default.createElement(_HiIconBuilder2.default, {
|
141
163
|
className: (0, _classnames2.default)(classes.navigate),
|
142
164
|
icon: 'menuLeft',
|
143
165
|
onClick: onPrevious,
|
144
|
-
size: 16
|
166
|
+
size: 16,
|
167
|
+
titleAccess: titlePrevious
|
145
168
|
}),
|
146
169
|
_react2.default.createElement(
|
147
170
|
'span',
|
@@ -152,13 +175,15 @@ function HiChip(props) {
|
|
152
175
|
className: (0, _classnames2.default)(classes.navigate),
|
153
176
|
icon: 'menuRight',
|
154
177
|
onClick: onNext,
|
155
|
-
size: 16
|
178
|
+
size: 16,
|
179
|
+
titleAccess: titleNext
|
156
180
|
}),
|
157
181
|
onDelete && _react2.default.createElement(_HiIconBuilder2.default, {
|
158
182
|
classes: { root: classes.eraseIcon },
|
159
183
|
icon: 'closeCircle',
|
160
184
|
onClick: onDelete,
|
161
|
-
size: 16
|
185
|
+
size: 16,
|
186
|
+
titleAccess: titleDelete
|
162
187
|
})
|
163
188
|
);
|
164
189
|
}
|
@@ -188,6 +213,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
188
213
|
* Fonction de callback au clic sur l'icon close si cancelable = true
|
189
214
|
*/
|
190
215
|
onDelete: _propTypes2.default.func,
|
216
|
+
/**
|
217
|
+
* Fonction de callback au clic sur l'icon à gauche
|
218
|
+
*/
|
219
|
+
onIconClick: _propTypes2.default.func,
|
191
220
|
/**
|
192
221
|
* Fonction de callback au clic sur l'icon next
|
193
222
|
*/
|
@@ -195,7 +224,31 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
195
224
|
/**
|
196
225
|
* Fonction de callback au clic sur l'icon previous
|
197
226
|
*/
|
198
|
-
onPrevious: _propTypes2.default.func
|
227
|
+
onPrevious: _propTypes2.default.func,
|
228
|
+
/**
|
229
|
+
* Préfixe dans le HiChip
|
230
|
+
*/
|
231
|
+
prefix: _propTypes2.default.string,
|
232
|
+
/**
|
233
|
+
* Titre de l'icône supprimer
|
234
|
+
*/
|
235
|
+
titleDelete: _propTypes2.default.string,
|
236
|
+
/**
|
237
|
+
* Titre de l'icône
|
238
|
+
*/
|
239
|
+
titleIcon: _propTypes2.default.string,
|
240
|
+
/**
|
241
|
+
* Titre de la balise img
|
242
|
+
*/
|
243
|
+
titleImg: _propTypes2.default.string,
|
244
|
+
/**
|
245
|
+
* Titre de la navigation suivante
|
246
|
+
*/
|
247
|
+
titleNext: _propTypes2.default.string,
|
248
|
+
/**
|
249
|
+
* Titre de la navigation précédente
|
250
|
+
*/
|
251
|
+
titlePrevious: _propTypes2.default.string
|
199
252
|
} : {};
|
200
253
|
|
201
254
|
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
@@ -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,11 +344,11 @@ var HiSelect = function (_React$PureComponent) {
|
|
342
344
|
});
|
343
345
|
}
|
344
346
|
|
345
|
-
if (
|
347
|
+
if ((dynamic || loading) && selectedIdList.length === 1) {
|
346
348
|
display = translations.one_item_selected.replace('%s', selectedIdList.length);
|
347
|
-
} else if (this.state.nbOptions !== selectedIdList.length && selectedIdList.length > 1) {
|
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
354
|
if (type !== 'icon') {
|
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
|
})
|
@@ -112,59 +112,61 @@ var HiSelectableList = function (_React$PureComponent) {
|
|
112
112
|
_List2.default,
|
113
113
|
{ className: classes.root, onKeyDown: this.props.onKeyDown },
|
114
114
|
itemList.map(function (item) {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
parents.
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
115
|
+
if (item.displayed !== false) {
|
116
|
+
/**
|
117
|
+
* Calcul du level de l'item
|
118
|
+
*/
|
119
|
+
if (hierarchic) {
|
120
|
+
// On stocke l'id des parents dans un tableau
|
121
|
+
if (item.parentId && !parents.includes(item.parentId)) {
|
122
|
+
parents.push(item.parentId);
|
123
|
+
} else if (item.parentId && parents.includes(item.parentId)) {
|
124
|
+
// Si l'item n'a pas de parentId ou qu'on l'a déjà stocké :
|
125
|
+
// Et si le parentId n'est pas le dernier inseré
|
126
|
+
if (item.parentId !== parents[parents.length - 1]) {
|
127
|
+
// On est donc redescendu d'un niveau
|
128
|
+
// donc on supprime le dernier parent
|
129
|
+
parents.pop();
|
130
|
+
}
|
131
|
+
} else if (!item.parentId && parents.length > 0) {
|
132
|
+
// Si l'item n'a pas de parent et que le tableau des parent
|
133
|
+
// n'est pas vide => on le réinitialise
|
134
|
+
parents = [];
|
129
135
|
}
|
130
|
-
} else if (!item.parentId && parents.length > 0) {
|
131
|
-
// Si l'item n'a pas de parent et que le tableau des parent
|
132
|
-
// n'est pas vide => on le réinitialise
|
133
|
-
parents = [];
|
134
136
|
}
|
135
|
-
}
|
136
137
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
138
|
+
/**
|
139
|
+
* L'élément est-il selectionné ?
|
140
|
+
*/
|
141
|
+
var selected = false;
|
142
|
+
if (item.id === '_all') {
|
143
|
+
selected = allSelected;
|
144
|
+
} else if (!item.hasChildren) {
|
145
|
+
selected = selectedIdList.includes(item.id);
|
146
|
+
} else if (hierarchic && parentItemSelectable) {
|
147
|
+
selected = hierarchySelected[item.id].length === hierarchy[item.id].length;
|
148
|
+
}
|
148
149
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
150
|
+
return _react2.default.createElement(_HiSelectableListItem2.default, (0, _extends3.default)({
|
151
|
+
key: item.id,
|
152
|
+
item: item,
|
153
|
+
selected: selected,
|
154
|
+
indeterminate: item.hasChildren && parentItemSelectable ? hierarchySelected[item.id].length > 0 && hierarchySelected[item.id].length !== hierarchy[item.id].length : false,
|
155
|
+
onSelect: onSelect,
|
156
|
+
hierarchySelected: hierarchySelected,
|
157
|
+
parentItemSelectable: parentItemSelectable,
|
158
|
+
nbChildren: typeof hierarchy !== 'undefined' && typeof hierarchy[item.id] !== 'undefined' ? hierarchy[item.id].length : 0,
|
159
|
+
hierarchic: hierarchic,
|
160
|
+
translations: translations,
|
161
|
+
icon: icon,
|
162
|
+
parentIcon: parentIcon,
|
163
|
+
hoverIcon: hoverIcon,
|
164
|
+
checkedIcon: checkedIcon,
|
165
|
+
checkbox: checkbox,
|
166
|
+
level: parents.length,
|
167
|
+
disabled: disabledIds ? disabledIds.includes(item.id) : false
|
168
|
+
}, others));
|
169
|
+
}
|
168
170
|
})
|
169
171
|
)
|
170
172
|
);
|
@@ -82,9 +82,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
82
82
|
var styles = exports.styles = function styles(theme) {
|
83
83
|
return {
|
84
84
|
listItem: {
|
85
|
-
padding:
|
85
|
+
padding: '9px 0px',
|
86
86
|
fontWeight: theme.typography.fontWeightRegular,
|
87
|
-
maxHeight: 40
|
87
|
+
maxHeight: 40,
|
88
|
+
display: 'flex',
|
89
|
+
alignItems: 'flex-start'
|
88
90
|
},
|
89
91
|
listItemTitle: {
|
90
92
|
padding: 9 + 'px 0px',
|