@hipay/hipay-material-ui 1.0.0-beta.22 → 1.0.0-beta.23
Sign up to get free protection for your applications and to get access to all the features.
- package/HiChip/HiChip.js +6 -0
- package/HiChip/HiChipSwitch.js +6 -0
- package/HiDatePicker/HiDatePicker.js +35 -21
- package/HiDatePicker/HiDateRangePicker.js +66 -38
- package/HiDatePicker/HiDateRangeSelector.js +2 -2
- package/HiDatePicker/Overlays/Overlay.js +1 -1
- package/HiDatePicker/stylesheet.js +3 -0
- package/HiForm/HiInput.js +11 -2
- package/HiForm/HiPasswordField.js +6 -1
- package/HiLoader/HiLoader.js +7 -4
- package/HiSelect/HiSelect.js +19 -1
- package/HiSelect/HiSuggestSelect.js +2 -1
- package/HiSelectableList/HiSelectableListItem.js +14 -0
- package/HiTable/BodyCells/CellAccount.js +1 -1
- package/HiTable/BodyCells/CellStatus.js +1 -1
- package/HiTable/ColumnFilter.js +1 -1
- package/es/HiChip/HiChip.js +6 -1
- package/es/HiChip/HiChipSwitch.js +6 -0
- package/es/HiDatePicker/HiDatePicker.js +30 -21
- package/es/HiDatePicker/HiDateRangePicker.js +62 -41
- package/es/HiDatePicker/HiDateRangeSelector.js +2 -2
- package/es/HiDatePicker/Overlays/Overlay.js +1 -1
- package/es/HiDatePicker/stylesheet.js +3 -0
- package/es/HiForm/HiInput.js +11 -2
- package/es/HiForm/HiPasswordField.js +6 -1
- package/es/HiLoader/HiLoader.js +3 -3
- package/es/HiSelect/HiSelect.js +19 -1
- package/es/HiSelect/HiSuggestSelect.js +2 -1
- package/es/HiSelectableList/HiSelectableListItem.js +11 -0
- package/es/HiTable/BodyCells/CellAccount.js +1 -1
- package/es/HiTable/BodyCells/CellStatus.js +1 -1
- package/es/HiTable/ColumnFilter.js +1 -1
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +15728 -15666
- package/umd/hipay-material-ui.production.min.js +5 -5
package/HiChip/HiChip.js
CHANGED
@@ -115,6 +115,7 @@ function HiChip(props) {
|
|
115
115
|
var label = props.label,
|
116
116
|
classes = props.classes,
|
117
117
|
icon = props.icon,
|
118
|
+
id = props.id,
|
118
119
|
img = props.img,
|
119
120
|
onPrevious = props.onPrevious,
|
120
121
|
onNext = props.onNext,
|
@@ -125,6 +126,7 @@ function HiChip(props) {
|
|
125
126
|
return _react2.default.createElement(
|
126
127
|
'div',
|
127
128
|
{
|
129
|
+
id: id,
|
128
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))
|
129
131
|
},
|
130
132
|
prefix && _react2.default.createElement(
|
@@ -170,6 +172,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
170
172
|
* Icone affiché à gauche
|
171
173
|
*/
|
172
174
|
icon: _propTypes2.default.string,
|
175
|
+
/**
|
176
|
+
* Identifiant de l'élément
|
177
|
+
*/
|
178
|
+
id: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
173
179
|
/**
|
174
180
|
* Ajoute une image à gauche du Chip
|
175
181
|
*/
|
package/HiChip/HiChipSwitch.js
CHANGED
@@ -207,6 +207,7 @@ var HiChipSwitch = function (_React$PureComponent) {
|
|
207
207
|
_this2 = this;
|
208
208
|
|
209
209
|
var _props = this.props,
|
210
|
+
id = _props.id,
|
210
211
|
label = _props.label,
|
211
212
|
classes = _props.classes,
|
212
213
|
activeIcon = _props.activeIcon,
|
@@ -232,6 +233,7 @@ var HiChipSwitch = function (_React$PureComponent) {
|
|
232
233
|
return _react2.default.createElement(
|
233
234
|
'div',
|
234
235
|
{
|
236
|
+
id: id,
|
235
237
|
className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.active, !!active), (0, _defineProperty3.default)(_classNames, classes.inactive, !active), _classNames)),
|
236
238
|
onClick: onClick,
|
237
239
|
role: 'button',
|
@@ -285,6 +287,10 @@ HiChipSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
285
287
|
* Surcharge les classes du composant
|
286
288
|
*/
|
287
289
|
classes: _propTypes2.default.object,
|
290
|
+
/**
|
291
|
+
* Identifiant de l'élément
|
292
|
+
*/
|
293
|
+
id: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
288
294
|
/**
|
289
295
|
* Label qu'affiche le ChipFilter
|
290
296
|
*/
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
+
var _typeof2 = require('babel-runtime/helpers/typeof');
|
8
|
+
|
9
|
+
var _typeof3 = _interopRequireDefault(_typeof2);
|
10
|
+
|
7
11
|
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
8
12
|
|
9
13
|
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
@@ -114,6 +118,7 @@ var HiDatePicker = function (_React$Component) {
|
|
114
118
|
_this.renderMonthPickerOverlay = _this.renderMonthPickerOverlay.bind(_this);
|
115
119
|
_this.renderTimePickerOverlay = _this.renderTimePickerOverlay.bind(_this);
|
116
120
|
_this.renderYearPickerOverlay = _this.renderYearPickerOverlay.bind(_this);
|
121
|
+
_this.handleInputChange = _this.handleInputChange.bind(_this);
|
117
122
|
return _this;
|
118
123
|
}
|
119
124
|
|
@@ -128,29 +133,36 @@ var HiDatePicker = function (_React$Component) {
|
|
128
133
|
this.handleCurrentMonthChange(new Date());
|
129
134
|
this.props.onReset();
|
130
135
|
}
|
136
|
+
}, {
|
137
|
+
key: 'handleInputChange',
|
138
|
+
value: function handleInputChange(event) {
|
139
|
+
this.props.onChange(event.target.value);
|
140
|
+
}
|
131
141
|
}, {
|
132
142
|
key: 'handleDayChange',
|
133
143
|
value: function handleDayChange(day, modifiers) {
|
134
|
-
if (
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
if (this.props.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
+
if (day) {
|
145
|
+
if (modifiers.selected) {
|
146
|
+
// Deselect day
|
147
|
+
this.props.onChange(undefined);
|
148
|
+
} else {
|
149
|
+
// Keep Time if set
|
150
|
+
if (this.props.enableTime && day !== undefined) {
|
151
|
+
if (this.props.value) {
|
152
|
+
day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
|
153
|
+
} else {
|
154
|
+
day.setHours(0, 0);
|
155
|
+
}
|
144
156
|
}
|
157
|
+
this.props.onChange(day);
|
158
|
+
}
|
159
|
+
if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
|
160
|
+
// Hide overlay & remove focus on input
|
161
|
+
document.activeElement.blur();
|
162
|
+
} else if (day instanceof Date && this.props.enableTime && modifiers.selected !== true) {
|
163
|
+
// Open Time panel after date selection
|
164
|
+
this.openPanel('time');
|
145
165
|
}
|
146
|
-
this.props.onChange(day);
|
147
|
-
}
|
148
|
-
if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
|
149
|
-
// Hide overlay & remove focus on input
|
150
|
-
document.activeElement.blur();
|
151
|
-
} else if (day instanceof Date && this.props.enableTime && modifiers.selected !== true) {
|
152
|
-
// Open Time panel after date selection
|
153
|
-
this.openPanel('time');
|
154
166
|
}
|
155
167
|
}
|
156
168
|
}, {
|
@@ -299,7 +311,7 @@ var HiDatePicker = function (_React$Component) {
|
|
299
311
|
captionElement: this.renderCaption,
|
300
312
|
classNames: classes,
|
301
313
|
disabledDays: effectiveDisabledDays,
|
302
|
-
selectedDays: value,
|
314
|
+
selectedDays: (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object' ? value : undefined,
|
303
315
|
locale: locale,
|
304
316
|
firstDayOfWeek: 1,
|
305
317
|
fromMonth: minimumDate,
|
@@ -315,7 +327,9 @@ var HiDatePicker = function (_React$Component) {
|
|
315
327
|
onReset: this.handleReset
|
316
328
|
}, {
|
317
329
|
onBlur: this.handleBlur
|
318
|
-
}, props
|
330
|
+
}, props, {
|
331
|
+
onChange: this.handleInputChange
|
332
|
+
});
|
319
333
|
|
320
334
|
return _react2.default.createElement(
|
321
335
|
'div',
|
@@ -410,6 +424,6 @@ HiDatePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
410
424
|
/**
|
411
425
|
* Date sélectionnée
|
412
426
|
*/
|
413
|
-
value: _propTypes2.default.instanceOf(Date)
|
427
|
+
value: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(Date), _propTypes2.default.string])
|
414
428
|
} : {};
|
415
429
|
exports.default = (0, _withStyles2.default)(_stylesheet2.default, { name: 'HmuiHiDatePicker' })(HiDatePicker);
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
+
var _values = require('babel-runtime/core-js/object/values');
|
8
|
+
|
9
|
+
var _values2 = _interopRequireDefault(_values);
|
10
|
+
|
7
11
|
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
8
12
|
|
9
13
|
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
@@ -106,6 +110,12 @@ var HiDateRangePicker = function (_React$Component) {
|
|
106
110
|
|
107
111
|
var _this = (0, _possibleConstructorReturn3.default)(this, (HiDateRangePicker.__proto__ || (0, _getPrototypeOf2.default)(HiDateRangePicker)).call(this));
|
108
112
|
|
113
|
+
_this.handleInputChange = function (inputName) {
|
114
|
+
return function (event) {
|
115
|
+
_this.props.onChange(inputName, event.target.value);
|
116
|
+
};
|
117
|
+
};
|
118
|
+
|
109
119
|
_this.handleDayPickerFocus = function (name) {
|
110
120
|
return function () {
|
111
121
|
_this.setState({ focusedInput: name });
|
@@ -141,6 +151,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
141
151
|
_this.handleYearClickTo = _this.handleYearClickTo.bind(_this);
|
142
152
|
_this.handleDayPickerFocus = _this.handleDayPickerFocus.bind(_this);
|
143
153
|
_this.handleDayPickerBlur = _this.handleDayPickerBlur.bind(_this);
|
154
|
+
_this.handleInputChange = _this.handleInputChange.bind(_this);
|
144
155
|
|
145
156
|
_this.openPanel = _this.openPanel.bind(_this);
|
146
157
|
|
@@ -203,38 +214,40 @@ var HiDateRangePicker = function (_React$Component) {
|
|
203
214
|
value: function handleDayChange(name, day, modifiers) {
|
204
215
|
var _this4 = this;
|
205
216
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
if (
|
210
|
-
if (
|
211
|
-
this.toInput
|
212
|
-
|
213
|
-
|
217
|
+
if (day) {
|
218
|
+
// if time disabled, focus TO input
|
219
|
+
// else focus current input
|
220
|
+
if (!this.props.enableTime) {
|
221
|
+
if (day instanceof Date) {
|
222
|
+
if (name === 'from' && this.toInput) {
|
223
|
+
this.toInput.getInput().focus();
|
224
|
+
} else if (name === 'to') {
|
225
|
+
document.activeElement.blur();
|
226
|
+
}
|
214
227
|
}
|
228
|
+
} else {
|
229
|
+
this.timeout = setTimeout(function () {
|
230
|
+
if (_this4[name + 'Input'].getInput()) {
|
231
|
+
_this4[name + 'Input'].getInput().focus();
|
232
|
+
}
|
233
|
+
}, 10);
|
215
234
|
}
|
216
|
-
} else {
|
217
|
-
this.timeout = setTimeout(function () {
|
218
|
-
if (_this4[name + 'Input'].getInput()) {
|
219
|
-
_this4[name + 'Input'].getInput().focus();
|
220
|
-
}
|
221
|
-
}, 10);
|
222
|
-
}
|
223
235
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
236
|
+
if (this.props.onChange) {
|
237
|
+
// Keep Time if set
|
238
|
+
if (this.props.enableTime) {
|
239
|
+
if (this.props[name]) {
|
240
|
+
day.setHours(this.props[name].getHours(), this.props[name].getMinutes());
|
241
|
+
} else {
|
242
|
+
day.setHours(0, 0);
|
243
|
+
}
|
231
244
|
}
|
245
|
+
this.props.onChange(name, day);
|
232
246
|
}
|
233
|
-
this.props.onChange(name, day);
|
234
|
-
}
|
235
247
|
|
236
|
-
|
237
|
-
|
248
|
+
if (this.props.enableTime) {
|
249
|
+
this.openPanel(name, 'time');
|
250
|
+
}
|
238
251
|
}
|
239
252
|
}
|
240
253
|
}, {
|
@@ -502,6 +515,20 @@ var HiDateRangePicker = function (_React$Component) {
|
|
502
515
|
}
|
503
516
|
};
|
504
517
|
|
518
|
+
var selectedDays = [];
|
519
|
+
var selected = {};
|
520
|
+
if (from instanceof Date) {
|
521
|
+
selectedDays.push(from);
|
522
|
+
selected.from = from;
|
523
|
+
}
|
524
|
+
if (to instanceof Date) {
|
525
|
+
selectedDays.push(to);
|
526
|
+
selected.to = to;
|
527
|
+
}
|
528
|
+
if ((0, _values2.default)(selected).length > 0) {
|
529
|
+
selectedDays.push(selected);
|
530
|
+
}
|
531
|
+
|
505
532
|
var dayPickerProps = (0, _extends3.default)({
|
506
533
|
classNames: classes,
|
507
534
|
disabledDays: disabledDays,
|
@@ -511,7 +538,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
511
538
|
modifiers: modifiers,
|
512
539
|
modifiersStyles: modifiersStyles,
|
513
540
|
// Both are required ?
|
514
|
-
selectedDays:
|
541
|
+
selectedDays: selectedDays,
|
515
542
|
todayButton: translations.today,
|
516
543
|
weekdayElement: _Weekday2.default
|
517
544
|
}, props);
|
@@ -520,9 +547,9 @@ var HiDateRangePicker = function (_React$Component) {
|
|
520
547
|
// Disable days after 'to' date if define
|
521
548
|
|
522
549
|
var after = void 0;
|
523
|
-
if (to && disableFutureDays) {
|
550
|
+
if (to instanceof Date && disableFutureDays) {
|
524
551
|
after = to < now ? now : to;
|
525
|
-
} else if (to) {
|
552
|
+
} else if (to instanceof Date) {
|
526
553
|
after = to;
|
527
554
|
} else if (disableFutureDays) {
|
528
555
|
after = now;
|
@@ -549,9 +576,9 @@ var HiDateRangePicker = function (_React$Component) {
|
|
549
576
|
// Disable days before 'from' date if define
|
550
577
|
|
551
578
|
var before = void 0;
|
552
|
-
if (from && disablePastDays) {
|
579
|
+
if (from instanceof Date && disablePastDays) {
|
553
580
|
before = from < now ? now : from;
|
554
|
-
} else if (from) {
|
581
|
+
} else if (from instanceof Date) {
|
555
582
|
before = from;
|
556
583
|
} else if (disablePastDays) {
|
557
584
|
before = now;
|
@@ -583,7 +610,8 @@ var HiDateRangePicker = function (_React$Component) {
|
|
583
610
|
}, props, labelFrom && {
|
584
611
|
label: labelFrom
|
585
612
|
}, {
|
586
|
-
id: id + '-from'
|
613
|
+
id: id + '-from',
|
614
|
+
onChange: this.handleInputChange('from')
|
587
615
|
});
|
588
616
|
|
589
617
|
var toInputProps = (0, _extends3.default)({}, onReset && {
|
@@ -593,11 +621,11 @@ var HiDateRangePicker = function (_React$Component) {
|
|
593
621
|
}, props, labelTo && {
|
594
622
|
label: labelTo
|
595
623
|
}, {
|
596
|
-
id: id + '-to'
|
624
|
+
id: id + '-to',
|
625
|
+
onChange: this.handleInputChange('to')
|
597
626
|
});
|
598
627
|
|
599
|
-
var
|
600
|
-
var toClass = (0, _classnames2.default)(classes.toInput, (0, _defineProperty3.default)({}, classes.absolute, staticPosition === true && this.state.focusedInput === 'from'));
|
628
|
+
var toClass = (0, _classnames2.default)(classes.toInput, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.absolute, staticPosition === true && this.state.focusedInput === 'from'), (0, _defineProperty3.default)(_classNames, classes.right4, staticPosition === true && this.state.focusedInput === 'from'), _classNames));
|
601
629
|
|
602
630
|
return _react2.default.createElement(
|
603
631
|
'div',
|
@@ -611,7 +639,7 @@ var HiDateRangePicker = function (_React$Component) {
|
|
611
639
|
},
|
612
640
|
_react2.default.createElement(
|
613
641
|
'div',
|
614
|
-
|
642
|
+
null,
|
615
643
|
_react2.default.createElement(_DayPickerInput2.default, {
|
616
644
|
ref: function ref(el) {
|
617
645
|
_this6.fromInput = el;
|
@@ -711,7 +739,7 @@ HiDateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
711
739
|
/**
|
712
740
|
* Date de début sélectionnée
|
713
741
|
*/
|
714
|
-
from: _propTypes2.default.instanceOf(Date),
|
742
|
+
from: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(Date), _propTypes2.default.string]),
|
715
743
|
/**
|
716
744
|
* Utilisé pour construire les ids des champs from et to en les suffixant "-from" et "-to"
|
717
745
|
*/
|
@@ -747,7 +775,7 @@ HiDateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
747
775
|
/**
|
748
776
|
* Date de fin sélectionnée
|
749
777
|
*/
|
750
|
-
to: _propTypes2.default.instanceOf(Date),
|
778
|
+
to: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(Date), _propTypes2.default.string]),
|
751
779
|
/**
|
752
780
|
* Traductions
|
753
781
|
*/
|
@@ -378,7 +378,7 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
378
378
|
/**
|
379
379
|
* Date de début sélectionnée
|
380
380
|
*/
|
381
|
-
from: _propTypes2.default.instanceOf(Date),
|
381
|
+
from: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(Date), _propTypes2.default.string]),
|
382
382
|
/**
|
383
383
|
* Si "true", le texte d'aide s'affichera seulement au clic sur l'icône "Information"
|
384
384
|
*/
|
@@ -426,7 +426,7 @@ HiDateRangeSelector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
426
426
|
/**
|
427
427
|
* Date de fin sélectionnée
|
428
428
|
*/
|
429
|
-
to: _propTypes2.default.instanceOf(Date),
|
429
|
+
to: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(Date), _propTypes2.default.string]),
|
430
430
|
/**
|
431
431
|
* Traductions
|
432
432
|
*/
|
@@ -113,7 +113,7 @@ Overlay.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
113
113
|
* ReactDayPicker prop
|
114
114
|
* The currently selected day or selected days
|
115
115
|
*/
|
116
|
-
selectedDay: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.array]),
|
116
|
+
selectedDay: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.array, _propTypes2.default.string]),
|
117
117
|
/**
|
118
118
|
* Définit comment construire le Paper dans le cas d'un double input
|
119
119
|
*/
|
package/HiForm/HiInput.js
CHANGED
@@ -307,7 +307,8 @@ var HiInput = function (_React$PureComponent) {
|
|
307
307
|
rows = _props.rows,
|
308
308
|
inputClassName = _props.inputClassName,
|
309
309
|
onReset = _props.onReset,
|
310
|
-
theme = _props.theme
|
310
|
+
theme = _props.theme,
|
311
|
+
startAdornmentColor = _props.startAdornmentColor;
|
311
312
|
var focused = this.state.focused;
|
312
313
|
|
313
314
|
|
@@ -322,13 +323,17 @@ var HiInput = function (_React$PureComponent) {
|
|
322
323
|
});
|
323
324
|
|
324
325
|
var leftIcon = void 0;
|
326
|
+
var startAdornmentStyle = { padding: 8 };
|
327
|
+
if (startAdornmentColor) {
|
328
|
+
startAdornmentStyle.color = startAdornmentColor;
|
329
|
+
}
|
325
330
|
if (startAdornment) {
|
326
331
|
var _classNames2;
|
327
332
|
|
328
333
|
leftIcon = _react2.default.createElement(_HiIconBuilder2.default, {
|
329
334
|
icon: startAdornment,
|
330
335
|
size: 36,
|
331
|
-
style:
|
336
|
+
style: startAdornmentStyle,
|
332
337
|
onClick: this.props.onLeftIconClick,
|
333
338
|
className: (0, _classnames2.default)(classes.startAdornment, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.startAdornmentFocus, focused), (0, _defineProperty3.default)(_classNames2, classes.startAdornmentDisabled, disabled), (0, _defineProperty3.default)(_classNames2, classes.iconPointer, this.props.onLeftIconClick), _classNames2))
|
334
339
|
});
|
@@ -521,6 +526,10 @@ HiInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
521
526
|
* Icône à afficher à gauche de l'input
|
522
527
|
*/
|
523
528
|
startAdornment: _propTypes2.default.string,
|
529
|
+
/**
|
530
|
+
* Couleur de l'icône à afficher à gauche de l'input
|
531
|
+
*/
|
532
|
+
startAdornmentColor: _propTypes2.default.string,
|
524
533
|
/**
|
525
534
|
* @ignore
|
526
535
|
*/
|
@@ -114,7 +114,12 @@ var HiPasswordField = function (_React$Component) {
|
|
114
114
|
return _react2.default.createElement(_HiTextField2.default, (0, _extends3.default)({}, otherProps, {
|
115
115
|
type: type,
|
116
116
|
onRightIconClick: this.handlePasswordToggle,
|
117
|
-
HiInputProps: (0, _extends3.default)({}, HiInputProps, {
|
117
|
+
HiInputProps: (0, _extends3.default)({}, HiInputProps, {
|
118
|
+
endAdornment: endAdornment,
|
119
|
+
placeholder: '',
|
120
|
+
inputClassName: inputClassName,
|
121
|
+
autocomplete: 'on'
|
122
|
+
})
|
118
123
|
}));
|
119
124
|
}
|
120
125
|
}]);
|
package/HiLoader/HiLoader.js
CHANGED
@@ -26,16 +26,19 @@ var styles = exports.styles = function styles() {
|
|
26
26
|
};
|
27
27
|
|
28
28
|
function HiLoader(props) {
|
29
|
-
var
|
30
|
-
|
29
|
+
var className = props.className,
|
30
|
+
theme = props.theme,
|
31
|
+
loading = props.loading,
|
32
|
+
_props$size = props.size,
|
33
|
+
size = _props$size === undefined ? 12 : _props$size;
|
31
34
|
|
32
35
|
|
33
36
|
return _react2.default.createElement(
|
34
37
|
'div',
|
35
|
-
{ id: 'hi-loader' },
|
38
|
+
{ id: 'hi-loader', className: className },
|
36
39
|
_react2.default.createElement(_reactSpinners.PropagateLoader, {
|
37
40
|
loading: loading,
|
38
|
-
size:
|
41
|
+
size: size,
|
39
42
|
color: theme.palette.business.primary.normal
|
40
43
|
})
|
41
44
|
);
|
package/HiSelect/HiSelect.js
CHANGED
@@ -297,6 +297,7 @@ var HiSelect = function (_React$PureComponent) {
|
|
297
297
|
classes = _props.classes,
|
298
298
|
disabled = _props.disabled,
|
299
299
|
error = _props.error,
|
300
|
+
loading = _props.loading,
|
300
301
|
options = _props.options,
|
301
302
|
checkbox = _props.checkbox,
|
302
303
|
searchable = _props.searchable,
|
@@ -324,8 +325,21 @@ var HiSelect = function (_React$PureComponent) {
|
|
324
325
|
var selectedIdList = Array.isArray(value) ? value : value ? [value] : [];
|
325
326
|
|
326
327
|
var _suggestions = [].concat((0, _toConsumableArray3.default)(suggestions));
|
328
|
+
|
327
329
|
if (pinnedItem) {
|
328
|
-
_suggestions
|
330
|
+
_suggestions.unshift(pinnedItem);
|
331
|
+
}
|
332
|
+
|
333
|
+
// If loading
|
334
|
+
if (loading) {
|
335
|
+
_suggestions.unshift({
|
336
|
+
id: '_loading',
|
337
|
+
type: 'loader',
|
338
|
+
disabled: true,
|
339
|
+
centered: true,
|
340
|
+
checkbox: false,
|
341
|
+
label: 'loading'
|
342
|
+
});
|
329
343
|
}
|
330
344
|
|
331
345
|
if (this.state.dynamic && selectedIdList.length === 1) {
|
@@ -832,6 +846,10 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
832
846
|
* id du select
|
833
847
|
*/
|
834
848
|
id: _propTypes2.default.string,
|
849
|
+
/**
|
850
|
+
* Ajoute un loader
|
851
|
+
*/
|
852
|
+
loading: _propTypes2.default.bool,
|
835
853
|
/**
|
836
854
|
* Autorise la sélection de plusieurs valeurs
|
837
855
|
*/
|
@@ -210,6 +210,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
210
210
|
label: showNoResults ? translations.no_result_match : translations.min_length
|
211
211
|
}];
|
212
212
|
}
|
213
|
+
|
213
214
|
var open = !!optionsShown.length && focused;
|
214
215
|
|
215
216
|
return _react2.default.createElement(
|
@@ -274,7 +275,7 @@ HiSuggestSelect.defaultProps = {
|
|
274
275
|
showMinLength: false,
|
275
276
|
showNoResults: false,
|
276
277
|
translations: {
|
277
|
-
no_result_match: '
|
278
|
+
no_result_match: 'Aucun résultat correspondant',
|
278
279
|
min_length: 'Veuillez saisir 3 caractères minimum'
|
279
280
|
},
|
280
281
|
options: []
|
@@ -73,6 +73,10 @@ var _HiColoredLabel = require('../HiColoredLabel');
|
|
73
73
|
|
74
74
|
var _HiColoredLabel2 = _interopRequireDefault(_HiColoredLabel);
|
75
75
|
|
76
|
+
var _HiLoader = require('../HiLoader');
|
77
|
+
|
78
|
+
var _HiLoader2 = _interopRequireDefault(_HiLoader);
|
79
|
+
|
76
80
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
77
81
|
|
78
82
|
var styles = exports.styles = function styles(theme) {
|
@@ -100,6 +104,13 @@ var styles = exports.styles = function styles(theme) {
|
|
100
104
|
textAlign: 'center',
|
101
105
|
width: '100%'
|
102
106
|
},
|
107
|
+
loader: {
|
108
|
+
textAlign: 'center',
|
109
|
+
width: 1,
|
110
|
+
height: 22,
|
111
|
+
padding: '8px 0',
|
112
|
+
margin: 'auto'
|
113
|
+
},
|
103
114
|
selected: {
|
104
115
|
backgroundColor: theme.palette.selected
|
105
116
|
},
|
@@ -259,6 +270,9 @@ var HiSelectableListItem = function (_React$Component) {
|
|
259
270
|
{ className: itemPrimaryHighlightClass, 'data-id': item.id },
|
260
271
|
_this.getItemLabel(item)
|
261
272
|
);
|
273
|
+
case 'loader':
|
274
|
+
return _react2.default.createElement(_HiLoader2.default, { loading: true, className: classes.loader, size: 8 });
|
275
|
+
break;
|
262
276
|
case 'text':
|
263
277
|
default:
|
264
278
|
var itemTextClass = (0, _classnames2.default)(classes.listItemContent, (0, _defineProperty3.default)({}, classes.centered, item.centered));
|
@@ -131,7 +131,7 @@ CellStatus.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
131
131
|
/**
|
132
132
|
* Code du statut courant de la transaction (détermine la couleur du label)
|
133
133
|
*/
|
134
|
-
code: _propTypes2.default.number.isRequired,
|
134
|
+
code: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]).isRequired,
|
135
135
|
/**
|
136
136
|
* Fonction de callback appelée pour ouvrir les lignes de détails
|
137
137
|
*/
|
package/HiTable/ColumnFilter.js
CHANGED
package/es/HiChip/HiChip.js
CHANGED
@@ -78,11 +78,12 @@ export const styles = theme => ({
|
|
78
78
|
});
|
79
79
|
|
80
80
|
function HiChip(props) {
|
81
|
-
const { label, classes, icon, img, onPrevious, onNext, onDelete, prefix } = props;
|
81
|
+
const { label, classes, icon, id, img, onPrevious, onNext, onDelete, prefix } = props;
|
82
82
|
|
83
83
|
return React.createElement(
|
84
84
|
'div',
|
85
85
|
{
|
86
|
+
id: id,
|
86
87
|
className: classNames(classes.root, {
|
87
88
|
[classes.leftNavigation]: onPrevious,
|
88
89
|
[classes.rightNavigation]: onNext,
|
@@ -132,6 +133,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
132
133
|
* Icone affiché à gauche
|
133
134
|
*/
|
134
135
|
icon: PropTypes.string,
|
136
|
+
/**
|
137
|
+
* Identifiant de l'élément
|
138
|
+
*/
|
139
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
135
140
|
/**
|
136
141
|
* Ajoute une image à gauche du Chip
|
137
142
|
*/
|
@@ -138,6 +138,7 @@ class HiChipSwitch extends React.PureComponent {
|
|
138
138
|
|
139
139
|
render() {
|
140
140
|
const {
|
141
|
+
id,
|
141
142
|
label,
|
142
143
|
classes,
|
143
144
|
activeIcon,
|
@@ -163,6 +164,7 @@ class HiChipSwitch extends React.PureComponent {
|
|
163
164
|
return React.createElement(
|
164
165
|
'div',
|
165
166
|
{
|
167
|
+
id: id,
|
166
168
|
className: classNames(classes.root, {
|
167
169
|
[classes.active]: !!active,
|
168
170
|
[classes.inactive]: !active
|
@@ -223,6 +225,10 @@ HiChipSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
223
225
|
* Surcharge les classes du composant
|
224
226
|
*/
|
225
227
|
classes: PropTypes.object,
|
228
|
+
/**
|
229
|
+
* Identifiant de l'élément
|
230
|
+
*/
|
231
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
226
232
|
/**
|
227
233
|
* Label qu'affiche le ChipFilter
|
228
234
|
*/
|